@adyen/kyc-components 3.28.1 → 3.30.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 (61) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1448 -504
  2. package/dist/es/us-check-account-number-CHnzmLNd.js +39 -0
  3. package/dist/es/us-check-o5Ax_0LS.js +37 -0
  4. package/dist/es/us-check-routing-number-BtVf7GH3.js +40 -0
  5. package/dist/style.css +192 -705
  6. package/dist/types/components/AdditionalInformation/VerifiedBusinessCard.d.ts +3 -1
  7. package/dist/types/components/AdditionalInformation/utils.d.ts +6 -0
  8. package/dist/types/components/BusinessSelection/types.d.ts +3 -1
  9. package/dist/types/components/ContractingStatus/ContractingStatus.d.ts +12 -0
  10. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/components/ServiceAgreementDropinComponent.d.ts +1 -1
  11. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/types.d.ts +2 -1
  12. package/dist/types/components/Dropins/types.d.ts +2 -2
  13. package/dist/types/components/EmbeddedDropins/CreateContractingComponent/CreateContractingComponent.d.ts +2 -1
  14. package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +2 -1
  15. package/dist/types/components/EmbeddedDropins/ManageContractingComponent/ManageContractingComponent.d.ts +6 -0
  16. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentComponent.d.ts +2 -1
  17. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverview/ManageTransferInstrumentOverview.d.ts +2 -1
  18. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItem/ManageTransferInstrumentOverviewItem.d.ts +2 -1
  19. package/dist/types/components/EmbeddedDropins/ManageTransferInstrumentComponent/ManageTransferInstrumentOverviewItemModal/ManageTransferInstrumentOverviewItemModal.d.ts +2 -1
  20. package/dist/types/components/PayoutAccount/component/CheckGuidance/CheckGuidance.d.ts +7 -0
  21. package/dist/types/components/RegistrationAddress/component/RegistrationAddressComponent.d.ts +2 -1
  22. package/dist/types/components/embedded-ui/OutlinedIcon/OutlinedIcon.d.ts +5 -0
  23. package/dist/types/components/embedded-ui/Splashscreen/Splashscreen.d.ts +10 -0
  24. package/dist/types/components/index.d.ts +16 -2
  25. package/dist/types/components/internal/Address/AddressComponent.d.ts +3 -0
  26. package/dist/types/components/internal/Address/AddressExperimentWrapper.d.ts +2 -0
  27. package/dist/types/components/internal/Address/components/FieldContainerComponent.d.ts +9 -0
  28. package/dist/types/components/internal/Address/types.d.ts +7 -11
  29. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  30. package/dist/types/components/internal/Address/validate.d.ts +2 -2
  31. package/dist/types/components/internal/BankAccountNumber/types.d.ts +2 -0
  32. package/dist/types/components/internal/BranchCode/types.d.ts +2 -0
  33. package/dist/types/components/internal/Button/Button.d.ts +1 -1
  34. package/dist/types/components/internal/Button/types.d.ts +1 -0
  35. package/dist/types/components/internal/Confirm/Confirm.d.ts +2 -0
  36. package/dist/types/components/internal/Confirm/types.d.ts +6 -0
  37. package/dist/types/components/internal/DecisionMakerRole/types.d.ts +1 -1
  38. package/dist/types/components/internal/FormFields/MaskedInputText/MaskedInputText.d.ts +2 -1
  39. package/dist/types/components/internal/FormFields/MultiSelectList/MultiSelectList.d.ts +1 -0
  40. package/dist/types/components/internal/FormFields/Select/Select.d.ts +2 -1
  41. package/dist/types/components/internal/FormFields/Select/components/SelectButton.d.ts +2 -1
  42. package/dist/types/components/internal/FormFields/Select/components/SelectList.d.ts +1 -0
  43. package/dist/types/components/internal/FormFields/Select/components/SelectListItem.d.ts +1 -0
  44. package/dist/types/components/internal/FormFields/Select/types.d.ts +4 -1
  45. package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +1 -1
  46. package/dist/types/components/internal/Modal/Modal.d.ts +1 -1
  47. package/dist/types/components/internal/Skeleton/Skeleton.d.ts +0 -1
  48. package/dist/types/components/internal/Svg/svgs.d.ts +3 -0
  49. package/dist/types/core/Context/ExperimentContext/types.d.ts +4 -1
  50. package/dist/types/core/Context/SettingsContext/types.d.ts +3 -1
  51. package/dist/types/core/SDKValidation/types.d.ts +2 -2
  52. package/dist/types/core/Services/componentApi/get-address.d.ts +2 -2
  53. package/dist/types/core/hooks/useBusinessData/types.d.ts +3 -1
  54. package/dist/types/core/hooks/useDebounce.d.ts +1 -0
  55. package/dist/types/core/models/api/address-search.d.ts +1 -8
  56. package/dist/types/core/models/api/company-search.d.ts +7 -0
  57. package/dist/types/core/models/form-rules.d.ts +2 -0
  58. package/dist/types/utils/datasetUtil.d.ts +1 -1
  59. package/dist/types/utils/payout-account-util.d.ts +1 -0
  60. package/dist/types/utils/validatorUtils.d.ts +1 -1
  61. package/package.json +1 -1
@@ -95,7 +95,6 @@ const defaultTrans = {
95
95
  accountNumberOrIbanVisible: "Includes your account number or IBAN",
96
96
  accountNumberVisible: "Includes your account number",
97
97
  accountVerification: "Account Verification",
98
- achRoutingNumber: "ACH routing number",
99
98
  acknowledgePciRequirements: "We hereby acknowledge that we must remain compliant with the aforementioned PCI DSS requirements at all times as long as we want to receive payments. Consequently, we must continuously reassess our environment and implement any additional PCI DSS requirements if our environment changes.",
100
99
  actionNeeded: "Action needed",
101
100
  add: "Add",
@@ -113,6 +112,7 @@ const defaultTrans = {
113
112
  addPayinAccount: "Add a payin account",
114
113
  addPayoutAccount: "Add a payout account",
115
114
  addTrustMember: "Add trust member",
115
+ addYourselfAsSigner: "Add yourself as a signer",
116
116
  additionalInformation: "Additional information",
117
117
  additionalInformationFormHeading: "Additional business details",
118
118
  additionalInformationFormName: "Additional details",
@@ -137,6 +137,7 @@ const defaultTrans = {
137
137
  areYouACompany: "Are you a company?",
138
138
  areYouAnIndividual: "Are you an individual?",
139
139
  areYouSureToLeave: "Are you sure you want to leave?",
140
+ areYouSureYouWantToDeleteThisBankAccount: "Are you sure you want to delete this bank account?",
140
141
  arithmosEngraphes: "Αριθμός Εγγραφής Φ.Π.Α.",
141
142
  articlesOfIncorporation: "Articles of incorporation",
142
143
  arvonlisaveronumeroMervardesskattenummer: "Arvonlisäveronumero Mervärdesskattenummer",
@@ -238,6 +239,7 @@ const defaultTrans = {
238
239
  chamberOfCommerceExtract: "Chamber of Commerce extract",
239
240
  chamberOfCommerceRegistrationNumber: "Chamber of Commerce registration number",
240
241
  changeYourBusinessSetup: "Change your business setup?",
242
+ chargeCardUserAgreement: "Charge Card User Agreement",
241
243
  charitableTrust: "Charitable trust",
242
244
  charityNumber: "Charity number",
243
245
  charter: "Charter",
@@ -335,6 +337,7 @@ const defaultTrans = {
335
337
  decisionMakers: "Decision-makers",
336
338
  definedBeneficiary: "Defined beneficiary",
337
339
  definedBeneficiaryDescription: "A natural person, corporate entity, or member of a class in whose interest the trust is principally constituted or operates.",
340
+ "delete": "Delete",
338
341
  depositSlip: "Deposit slip",
339
342
  describeWhoIsABeneficiaryInYourTrust: "Describe in open format who is set to be a beneficiary in your trust deed",
340
343
  description: "Description",
@@ -406,6 +409,7 @@ const defaultTrans = {
406
409
  enterAMaximumOfNCharactersWithAMixForExample: "Enter a maximum of %{maxChars} characters, with a mix of letters and numbers. For example, %{example}",
407
410
  enterAMaximumOfNDigitsForExample: "Enter a maximum of %{maxDigits} digits. For example, %{example}",
408
411
  enterAMaximumOfNMoreDigitsForExample: "Enter a maximum of %{maxDigits} more digits. For example, %{example}",
412
+ enterEnglishLetterFollowedByXtoYDigitsForExample: "Enter an English-equivalent letter (C for HE, O for AE, P for Σ) followed by %{minDigits} - %{maxDigits} digits. For example, %{example}",
409
413
  enterLastNDigitsForExample: "Enter the last %{numDigits} digits. For example, %{example}",
410
414
  enterLastNameExactlyAsAppearInID: "Enter your last name(s) exactly as it appears on your identity document",
411
415
  enterNCharactersForExample: "Enter %{numChars} characters. For example, %{example}",
@@ -497,6 +501,8 @@ const defaultTrans = {
497
501
  errorMessage_1_3051: "The proof of national ID number image was of too low quality.",
498
502
  errorMessage_1_3052: "An ID document is needed to verify the individual.",
499
503
  errorMessage_1_3062: "The name and 4 digit SSN couldn't be verified.",
504
+ errorMessage_1_3072: "We found the following issues:\n- The name and nationality couldn't be verified.\nReview the information below and correct any mistakes, or upload an id document then resubmit.",
505
+ errorMessage_1_3073: "We found the following issues:\n- The ID document didn't show the nationality.\nReview the information below and correct any mistakes, or upload an id document then resubmit.",
500
506
  errorMessage_1_31: "ID document is needed",
501
507
  errorMessage_1_32: "ID document couldn't be processed",
502
508
  errorMessage_1_33: "ID document didn't meet requirements",
@@ -870,6 +876,7 @@ const defaultTrans = {
870
876
  isParentOwnedByAnotherCompany: "Is your parent company owned by another company?",
871
877
  isThisAddressTheMainHeadquarters: "Is this address the main headquarters?",
872
878
  isTrustOperationAddressSame: "Is there a different address for your trust's operations?",
879
+ isYourNameMissingFromSigners: "Is your name missing from the list of signers?",
873
880
  issuedByTheTaxAuthority: "Issued by the tax authority or government of the country where the company is registered",
874
881
  issuedInTheLastXMonths: "Issued in the last %{number} months",
875
882
  issuerState: "Issuing state",
@@ -970,6 +977,7 @@ const defaultTrans = {
970
977
  nonProfitOrCharitableOrgDescription: "Your organization has official non-profit or tax-exempt status.",
971
978
  nonProfitOrCharitableOrgTitle: "Non-profit or charitable organization",
972
979
  noneOfTheAbove: "None of the above",
980
+ nothingNeedsToBeSigned: "Nothing needs to be signed right now.",
973
981
  notBlurry: "Not blurry",
974
982
  notCutOff: "Not cut off",
975
983
  notExpired: "Not expired",
@@ -1023,6 +1031,7 @@ const defaultTrans = {
1023
1031
  parentCompany: "Parent company",
1024
1032
  parentCompanyInformation: "Parent company information",
1025
1033
  partitaIVA: "Partita IVA",
1034
+ codiceFiscalePartitaIVA: "Codice Fiscale / Partita IVA",
1026
1035
  partnerShipAgreement: "Partnership agreement",
1027
1036
  partnership: "Partnership",
1028
1037
  partnershipIncorporated: "Incorporated partnership",
@@ -1053,6 +1062,7 @@ const defaultTrans = {
1053
1062
  pciDssQuestionnaire: "PCI DSS questionnaire",
1054
1063
  pciSignFailed: "PCI signing failed",
1055
1064
  pciSignedSuccessfully: "PCI signed successfully",
1065
+ pciDssSelfAssesmentSignedSuccessfully: "PCI-DSS Self assesment questionnaire signed and dated",
1056
1066
  personAppointmentUnderTrustInstrument: "The person appointed under the trust instrument to direct or restrain the trustees in relation to their administration of the trust.",
1057
1067
  personalDetails: "Personal details",
1058
1068
  personnummer: "Personnummer",
@@ -1108,7 +1118,7 @@ const defaultTrans = {
1108
1118
  reasonForFillingIndividualAddressDetails: "We have to make sure that everyone who uses our services is who they say they are. To do that, we'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.",
1109
1119
  reasonForFillingIndividualPersonalDetails: "We have to make sure that everyone who uses our services is who they say they are. To do that, we'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.",
1110
1120
  reasonForFillingPayoutAccountDetails: "We have to make sure the businesses using our services will not be misusing the funds or causing harm. To do that, we'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.",
1111
- reasonForFillingPayoutDetails: "We have to make sure the businesses using our services will not be misusing the funds or causing harm. To do that, we'll check all of this information against official records. This is a part of the financial regulations that we have to follow as a payments provider.",
1121
+ reasonForFillingPayoutDetails: "This bank account will be verified to prevent fraud or other misuse of funds in compliance with global regulations.",
1112
1122
  region: "Region",
1113
1123
  registeredAddress: "Registered address",
1114
1124
  registeredAddressHeaderDescription: "The address as it appears on your company's official registration documents.",
@@ -1225,8 +1235,10 @@ const defaultTrans = {
1225
1235
  selectTheApplicableRoles: "Select the applicable role(s)",
1226
1236
  selectTheBankToReceivePayouts: "After this page, you can select the bank where you would like to receive the payouts.",
1227
1237
  selectedSomeRolesBasedOnMyinfo: "We selected some roles based on Myinfo business data about your company's appointment holders and shareholders.",
1238
+ serviceAgreements: "Service agreements",
1228
1239
  serviceAgreementSignFailed: "Service agreement signing failed",
1229
1240
  serviceAgreementSignedSuccessfully: "Service agreement signed successfully",
1241
+ serviceAgreementSignedAndDated: "Service agreement signed and dated",
1230
1242
  sessionTimeout: "Session timeout",
1231
1243
  setUpYourAccount: "Set up your account",
1232
1244
  settlerDetailsIncl: "Settlor details including their full legal name and home address",
@@ -1329,6 +1341,7 @@ const defaultTrans = {
1329
1341
  theIdCheckWillBeAutomaticallyValidated: "With the right capture, the ID check will be automatically validated",
1330
1342
  theSubmitWasSuccessful: "The submit was successful",
1331
1343
  thenResubmit: "then resubmit.",
1344
+ thereAreNoSigners: "There are no signers, please add yourself to make sure you can accept the terms and get the funds.",
1332
1345
  thereWasAnErrorTryAgain: "There was an error, please try again",
1333
1346
  thisIsMyBusiness: "This is my business",
1334
1347
  thisMeansYouHaveAParentCompany: "If yes, this means you have a parent company, such as a global headquarters or a holding company.",
@@ -1853,7 +1866,7 @@ class UserEvents {
1853
1866
  }
1854
1867
  }
1855
1868
  const userEvents = new UserEvents();
1856
- const logger$J = createLogger("useCompanySearch");
1869
+ const logger$K = createLogger("useCompanySearch");
1857
1870
  const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
1858
1871
  function useCompanySearch({
1859
1872
  defaultData,
@@ -1977,7 +1990,7 @@ function useCompanySearch({
1977
1990
  state: companyData.state ?? stateOrProvince
1978
1991
  });
1979
1992
  } catch (e) {
1980
- logger$J.error(e);
1993
+ logger$K.error(e);
1981
1994
  setError(e);
1982
1995
  setStatus("error");
1983
1996
  } finally {
@@ -2010,7 +2023,7 @@ function useCompanySearch({
2010
2023
  indexSearch: handleCompanyIndexSearch,
2011
2024
  deepSearch: handleCompanyDeepSearch,
2012
2025
  resultsLimit: limit
2013
- })) == null ? void 0 : _a.catch((e) => logger$J.error(e));
2026
+ })) == null ? void 0 : _a.catch((e) => logger$K.error(e));
2014
2027
  }
2015
2028
  }, [legalCompanyName, country, stateOrProvince, taxIdentificationNumber, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
2016
2029
  useEffect(() => {
@@ -2033,8 +2046,8 @@ function useCompanySearch({
2033
2046
  reset
2034
2047
  };
2035
2048
  }
2036
- const logger$I = createLogger("useBusinessData");
2037
- const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [StateCodesUS.Arkansas, StateCodesUS.Connecticut, StateCodesUS.Georgia, StateCodesUS.Hawaii, StateCodesUS.Kentucky, StateCodesUS.Maryland, StateCodesUS.Minnesota, StateCodesUS.Missouri, StateCodesUS.Montana, StateCodesUS.NewHampshire, StateCodesUS.NewMexico, StateCodesUS.SouthCarolina, StateCodesUS.Utah, StateCodesUS.Vermont, StateCodesUS.Wisconsin, StateCodesUS.Wyoming];
2049
+ const logger$J = createLogger("useBusinessData");
2050
+ const KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS = [StateCodesUS.Arkansas, StateCodesUS.Connecticut, StateCodesUS.Georgia, StateCodesUS.Hawaii, StateCodesUS.Indiana, StateCodesUS.Kentucky, StateCodesUS.Maryland, StateCodesUS.Minnesota, StateCodesUS.Missouri, StateCodesUS.Montana, StateCodesUS.NewHampshire, StateCodesUS.NewMexico, StateCodesUS.SouthCarolina, StateCodesUS.Utah, StateCodesUS.Vermont, StateCodesUS.Wisconsin, StateCodesUS.Wyoming];
2038
2051
  function useBusinessData({
2039
2052
  handleCompanyIndexSearch,
2040
2053
  handleCompanyDeepSearch,
@@ -2052,36 +2065,49 @@ function useBusinessData({
2052
2065
  const [cachedBusiness, setCachedBusiness] = useState();
2053
2066
  const [verifiedBusiness, setVerifiedBusiness] = useState();
2054
2067
  const [invalidTin, setInvalidTin] = useState(false);
2068
+ const primarySourceSearch = async (data, indexSearch, deepSearch) => {
2069
+ let response;
2070
+ try {
2071
+ response = await deepSearch({
2072
+ ...data,
2073
+ limit: data.limit ?? 15
2074
+ });
2075
+ } catch (e) {
2076
+ response = await indexSearch({
2077
+ ...data,
2078
+ limit: data.limit ?? 15
2079
+ });
2080
+ }
2081
+ return response;
2082
+ };
2055
2083
  const searchForBusiness = useCallback(async (data) => {
2056
2084
  if (!handleCompanyDeepSearch || !handleCompanyIndexSearch) {
2057
- logger$I.log("Missing handlers for searchForBusiness");
2085
+ logger$J.log("Missing handlers for searchForBusiness");
2058
2086
  return;
2059
2087
  }
2060
2088
  if (searchResults && objectsDeepEqual(cachedSearch, data)) return;
2061
2089
  try {
2062
2090
  setSearching("loading");
2063
- const {
2064
- results
2065
- } = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
2091
+ const response = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
2066
2092
  ...data,
2067
2093
  limit: data.limit ?? 15
2068
- }) : await handleCompanyDeepSearch({
2094
+ }) : await primarySourceSearch({
2069
2095
  ...data,
2070
2096
  limit: data.limit ?? 15
2071
- });
2072
- setSearchResults(results);
2073
- return results;
2097
+ }, handleCompanyIndexSearch, handleCompanyDeepSearch);
2098
+ setSearchResults(response == null ? void 0 : response.results);
2099
+ return response == null ? void 0 : response.results;
2074
2100
  } catch (e) {
2075
2101
  setSearching("error");
2076
- logger$I.error(e);
2102
+ logger$J.error(e);
2077
2103
  } finally {
2078
2104
  setCachedSearch(data);
2079
2105
  setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
2080
2106
  }
2081
2107
  }, [handleCompanyDeepSearch, handleCompanyIndexSearch, searchResults, cachedSearch]);
2082
- const fetchBusinessData = useCallback(async (company) => {
2108
+ const fetchBusinessData = useCallback(async (company, state) => {
2083
2109
  if (!handleGetCompanyDataset || !handleRefreshCompanyDataset) {
2084
- logger$I.log("Missing handlers for fetchBusinessData");
2110
+ logger$J.log("Missing handlers for fetchBusinessData");
2085
2111
  return;
2086
2112
  }
2087
2113
  if (cachedBusiness && objectsDeepEqual({
@@ -2100,23 +2126,25 @@ function useBusinessData({
2100
2126
  const businessData = isDataCompliant ? await handleGetCompanyDataset({
2101
2127
  companyId: company.id,
2102
2128
  country: "US"
2129
+ // state: state as StateCodeUS,
2103
2130
  }) : await handleRefreshCompanyDataset({
2104
2131
  companyId: company.id,
2105
2132
  country: "US"
2133
+ // state: state as StateCodeUS,
2106
2134
  });
2107
2135
  setCachedBusiness(businessData);
2108
2136
  return businessData;
2109
2137
  } catch (e) {
2110
2138
  setFetching("error");
2111
2139
  setCachedBusiness(void 0);
2112
- logger$I.error(e);
2140
+ logger$J.error(e);
2113
2141
  } finally {
2114
2142
  setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
2115
2143
  }
2116
2144
  }, [cachedBusiness, handleGetCompanyDataset, handleRefreshCompanyDataset]);
2117
2145
  const verifyBusinessData = useCallback(async (data, tin) => {
2118
2146
  if (!handleVerifyTin) {
2119
- logger$I.log("Missing handlers for verifyBusinessData");
2147
+ logger$J.log("Missing handlers for verifyBusinessData");
2120
2148
  return;
2121
2149
  }
2122
2150
  try {
@@ -2137,7 +2165,7 @@ function useBusinessData({
2137
2165
  return matched;
2138
2166
  } catch (e) {
2139
2167
  setVerifying("error");
2140
- logger$I.error(e);
2168
+ logger$J.error(e);
2141
2169
  } finally {
2142
2170
  setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
2143
2171
  }
@@ -2148,7 +2176,7 @@ function useBusinessData({
2148
2176
  await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
2149
2177
  } catch (e) {
2150
2178
  setResettingTrustedData("error");
2151
- logger$I.error(e);
2179
+ logger$J.error(e);
2152
2180
  } finally {
2153
2181
  setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
2154
2182
  }
@@ -2197,6 +2225,7 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
2197
2225
  SettingNames2["TransferInstrumentLimit"] = "transferInstrumentLimit";
2198
2226
  SettingNames2["ViewOnboardingGuidance"] = "viewOnboardingGuidance";
2199
2227
  SettingNames2["InstantBankVerification"] = "instantBankVerification";
2228
+ SettingNames2["ShowServiceAgreementsFirst"] = "showServiceAgreementsFirst";
2200
2229
  return SettingNames2;
2201
2230
  })(SettingNames || {});
2202
2231
  const SettingsContext = createContext(void 0);
@@ -2381,8 +2410,9 @@ const mergeFieldMetadataIntoProps = (fieldName, metadata, otherProps) => {
2381
2410
  const MAX_LENGTH = 30;
2382
2411
  const getMaxLengthByFieldAndCountry = (formattingRules, field, country, ignoreIfFormatterExists) => {
2383
2412
  var _a, _b, _c, _d;
2413
+ if (!country) return void 0;
2384
2414
  if ((_b = (_a = formattingRules[country]) == null ? void 0 : _a[field]) == null ? void 0 : _b.formatter) {
2385
- return null;
2415
+ return void 0;
2386
2416
  }
2387
2417
  const maxLength = (_d = (_c = formattingRules[country]) == null ? void 0 : _c[field]) == null ? void 0 : _d.maxlength;
2388
2418
  return maxLength || MAX_LENGTH;
@@ -2466,6 +2496,9 @@ const svgs = {
2466
2496
  "document-cutoff": lazy(() => import("./document-cut-off-D2vCeeIS.js")),
2467
2497
  "document-expired": lazy(() => import("./document-expired-_4Syh1xW.js")),
2468
2498
  "document-front": lazy(() => import("./document-front-9Glzn7ZR.js")),
2499
+ "us-check": lazy(() => import("./us-check-o5Ax_0LS.js")),
2500
+ "us-check-routing-number": lazy(() => import("./us-check-routing-number-BtVf7GH3.js")),
2501
+ "us-check-account-number": lazy(() => import("./us-check-account-number-CHnzmLNd.js")),
2469
2502
  "id-blurred": lazy(() => import("./id-blurred-A45CVnPk.js")),
2470
2503
  "id-cutoff": lazy(() => import("./id-cut-off-DMoJYcGr.js")),
2471
2504
  "id-front": lazy(() => import("./id-front-CTIDY7Nu.js")),
@@ -2491,7 +2524,7 @@ const svgs = {
2491
2524
  "trustly-logo": lazy(() => import("./trustly-logo-YJslAOYF.js"))
2492
2525
  };
2493
2526
  const unscalableIconNames = ["bin", "check", "checkmark", "checkmark-small", "chevron-right", "chevron-left", "company", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "image", "location", "payout", "pci", "plus", "remove", "save", "search", "trust", "user", "upload", "warning"];
2494
- const logger$H = createLogger("Icon");
2527
+ const logger$I = createLogger("Icon");
2495
2528
  const Svg = ({
2496
2529
  className,
2497
2530
  name,
@@ -2502,7 +2535,7 @@ const Svg = ({
2502
2535
  const LazyLoadedSvg = svgs[name];
2503
2536
  const viewBox = unscalableIconNames.includes(name) ? "0 0 16 16" : void 0;
2504
2537
  if (!LazyLoadedSvg) {
2505
- logger$H.error(`No such svg: "${name}"`);
2538
+ logger$I.error(`No such svg: "${name}"`);
2506
2539
  return null;
2507
2540
  }
2508
2541
  return jsx("span", {
@@ -2552,6 +2585,7 @@ const Button = ({
2552
2585
  role,
2553
2586
  small,
2554
2587
  block,
2588
+ critical,
2555
2589
  shaded,
2556
2590
  label = "",
2557
2591
  icon,
@@ -2598,6 +2632,7 @@ const Button = ({
2598
2632
  "adyen-kyc-button--secondary": secondary,
2599
2633
  "adyen-kyc-button--tertiary": tertiary && !secondary,
2600
2634
  "adyen-kyc-button--block": block,
2635
+ "adyen-kyc-button--critical": critical,
2601
2636
  "adyen-kyc-button--small": small && label,
2602
2637
  "adyen-kyc-button--shaded": shaded && icon && tertiary,
2603
2638
  // disallow shaded effect if not just tertiary icon
@@ -2788,10 +2823,10 @@ function useFormRouterContext() {
2788
2823
  }
2789
2824
  return context;
2790
2825
  }
2791
- const logger$G = createLogger("Link");
2826
+ const logger$H = createLogger("Link");
2792
2827
  const isValidLink = (href) => {
2793
2828
  if (href === "#") {
2794
- logger$G.error('Links must include a valid href. If your href is "#", consider using a Button instead');
2829
+ logger$H.error('Links must include a valid href. If your href is "#", consider using a Button instead');
2795
2830
  return false;
2796
2831
  }
2797
2832
  return true;
@@ -3067,6 +3102,7 @@ function getFieldProps(props, innerFormFields) {
3067
3102
  var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
3068
3103
  ExperimentNames2["EnableCompanySearchFlow"] = "EnableCompanySearchFlow";
3069
3104
  ExperimentNames2["EnableNewBusinessDetailsFlow"] = "EnableNewBusinessDetailsFlow";
3105
+ ExperimentNames2["EnableNewAddressComponent"] = "EnableNewAddressComponent";
3070
3106
  ExperimentNames2["EnableNewEntryFlow"] = "EnableNewEntryFlow";
3071
3107
  ExperimentNames2["AllowOrganizationSettlorWithExemptionReason"] = "AllowOrganizationSettlorWithExemptionReason";
3072
3108
  ExperimentNames2["AllowMoreRolesForMainRootTrustee"] = "AllowMoreRolesForMainRootTrustee";
@@ -3080,6 +3116,8 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
3080
3116
  ExperimentNames2["EnableAgeVerification"] = "EnableAgeVerification";
3081
3117
  ExperimentNames2["PreserveMismatchedInitialValues"] = "PreserveMismatchedInitialValues";
3082
3118
  ExperimentNames2["StrictNameAndAddressValidationV4"] = "StrictNameAndAddressValidationV4";
3119
+ ExperimentNames2["EnableIdentificationNationalityCrossBorderAssociateCheck"] = "EnableIdentificationNationalityCrossBorderAssociateCheck";
3120
+ ExperimentNames2["EnableAUGovernmentalOrganizationSkipRegistrationNumber"] = "EnableAUGovernmentalOrganizationSkipRegistrationNumber";
3083
3121
  return ExperimentNames2;
3084
3122
  })(ExperimentNames || {});
3085
3123
  const ON_CHANGE_DEBOUNCE_DURATION = 200;
@@ -3140,7 +3178,7 @@ const useSetting = (settingName) => {
3140
3178
  } = context;
3141
3179
  return getSetting(settingName);
3142
3180
  };
3143
- const logger$F = createLogger("useAllowedCountries");
3181
+ const logger$G = createLogger("useAllowedCountries");
3144
3182
  const useAllowedCountries = () => {
3145
3183
  const acceptedCountries = useSetting("acceptedCountries");
3146
3184
  const {
@@ -3149,7 +3187,7 @@ const useAllowedCountries = () => {
3149
3187
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
3150
3188
  useEffect(() => {
3151
3189
  if (acceptedCountries !== void 0) return;
3152
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$F.error);
3190
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$G.error);
3153
3191
  }, [acceptedCountries]);
3154
3192
  return allowedCountries;
3155
3193
  };
@@ -3508,7 +3546,7 @@ function reducer({
3508
3546
  }
3509
3547
  };
3510
3548
  }
3511
- const logger$E = createLogger("useAsyncValidator");
3549
+ const logger$F = createLogger("useAsyncValidator");
3512
3550
  const useAsyncValidator = (asyncRules) => {
3513
3551
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3514
3552
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3529,7 +3567,7 @@ const useAsyncValidator = (asyncRules) => {
3529
3567
  hasError: !isValid
3530
3568
  }])
3531
3569
  });
3532
- }).catch(logger$E.error);
3570
+ }).catch(logger$F.error);
3533
3571
  }, [asyncRules, clearAsyncValidationResults]);
3534
3572
  return {
3535
3573
  asyncValidationResults,
@@ -3783,6 +3821,7 @@ const datasetIdentifier = {
3783
3821
  function datasetUtilities(locale) {
3784
3822
  return {
3785
3823
  getCountryName: (countryCode) => {
3824
+ if (!countryCode) return null;
3786
3825
  const datasetKey = createDatasetKey(datasetIdentifier.country, locale);
3787
3826
  return getDataName(datasetKey, countryCode);
3788
3827
  },
@@ -3949,6 +3988,14 @@ const Field = ({
3949
3988
  })
3950
3989
  });
3951
3990
  };
3991
+ const useDebounce = (value, delay) => {
3992
+ const [debouncedValue, setDebouncedValue] = useState(value);
3993
+ useEffect(() => {
3994
+ const handler = setTimeout(() => setDebouncedValue(value), delay);
3995
+ return () => clearTimeout(handler);
3996
+ }, [value, delay]);
3997
+ return debouncedValue;
3998
+ };
3952
3999
  const getScrollParent = (node) => {
3953
4000
  if (!node) return null;
3954
4001
  const isElement = node instanceof HTMLElement;
@@ -3974,16 +4021,6 @@ const Tag = ({
3974
4021
  children
3975
4022
  });
3976
4023
  };
3977
- const styles$4 = {
3978
- "adyen-kyc-dropdown": "adyen-kyc-dropdown",
3979
- "adyen-kyc-dropdown-button": "adyen-kyc-dropdown-button",
3980
- "adyen-kyc-dropdown-button--active": "adyen-kyc-dropdown-button--active",
3981
- "adyen-kyc-filter-input": "adyen-kyc-filter-input",
3982
- "adyen-kyc-dropdown-list": "adyen-kyc-dropdown-list",
3983
- "adyen-kyc-dropdown-list__transformer": "adyen-kyc-dropdown-list__transformer",
3984
- "adyen-kyc-dropdown-list--active": "adyen-kyc-dropdown-list--active",
3985
- "adyen-kyc-dropdown-element": "adyen-kyc-dropdown-element"
3986
- };
3987
4024
  function SelectButtonElement({
3988
4025
  filterable,
3989
4026
  isMulti,
@@ -4019,6 +4056,7 @@ function SelectButton({
4019
4056
  isMulti,
4020
4057
  id,
4021
4058
  isSearch,
4059
+ hideSearchIcon = false,
4022
4060
  loading,
4023
4061
  textFilter
4024
4062
  }) {
@@ -4031,10 +4069,8 @@ function SelectButton({
4031
4069
  "aria-haspopup": "listbox",
4032
4070
  className: cx({
4033
4071
  "adyen-kyc-dropdown-button": true,
4034
- [styles$4["adyen-kyc-dropdown-button"]]: true,
4035
4072
  "adyen-kyc-dropdown-button--readonly": readonly,
4036
4073
  "adyen-kyc-dropdown-button--active": showList,
4037
- [styles$4["adyen-kyc-dropdown-button--active"]]: showList,
4038
4074
  "adyen-kyc-dropdown-button--invalid": isInvalid,
4039
4075
  "adyen-kyc-dropdown-field--valid": isValid,
4040
4076
  "adyen-kyc-dropdown-button-search": isSearch
@@ -4063,6 +4099,7 @@ function SelectButton({
4063
4099
  filterable,
4064
4100
  onInput,
4065
4101
  isSearch,
4102
+ hideSearchIcon,
4066
4103
  loading,
4067
4104
  textFilter
4068
4105
  })
@@ -4077,6 +4114,7 @@ const SelectButtonContentSingle = ({
4077
4114
  filterable,
4078
4115
  onInput,
4079
4116
  isSearch,
4117
+ hideSearchIcon = false,
4080
4118
  loading,
4081
4119
  textFilter
4082
4120
  }) => {
@@ -4085,17 +4123,17 @@ const SelectButtonContentSingle = ({
4085
4123
  children: [(activeSingle == null ? void 0 : activeSingle.icon) && jsx("span", {
4086
4124
  className: "adyen-kyc-dropdown-button__icon",
4087
4125
  children: activeSingle.icon
4088
- }), isSearch && jsx(Icon, {
4126
+ }), isSearch && !hideSearchIcon && jsx(Icon, {
4089
4127
  name: "search",
4090
4128
  className: "adyen-kyc-dropdown-button-search__icon"
4091
4129
  }), jsx("span", {
4092
4130
  className: cx("adyen-kyc-dropdown-button__text", {
4093
- "adyen-kyc-dropdown-button__text--placeholder": !activeSingle
4131
+ "adyen-kyc-dropdown-button__text--placeholder": !activeSingle && placeholder
4094
4132
  }),
4095
4133
  children: (activeSingle == null ? void 0 : activeSingle.selectedOptionName) || (activeSingle == null ? void 0 : activeSingle.name) || textFilter || placeholder
4096
4134
  })]
4097
4135
  }) : jsxs(Fragment, {
4098
- children: [isSearch && jsx(Icon, {
4136
+ children: [isSearch && !hideSearchIcon && jsx(Icon, {
4099
4137
  name: "search",
4100
4138
  className: "adyen-kyc-dropdown-button-search__icon"
4101
4139
  }), jsx("input", {
@@ -4104,7 +4142,7 @@ const SelectButtonContentSingle = ({
4104
4142
  "aria-expanded": showList,
4105
4143
  "aria-owns": selectListId,
4106
4144
  autoComplete: "off",
4107
- className: cx("adyen-kyc-filter-input", [styles$4["adyen-kyc-filter-input"]]),
4145
+ className: cx("adyen-kyc-filter-input"),
4108
4146
  onInput,
4109
4147
  placeholder,
4110
4148
  ref: filterInputRef,
@@ -4192,7 +4230,7 @@ const SelectListItem = ({
4192
4230
  }) => jsx("li", {
4193
4231
  "aria-disabled": !!item.disabled,
4194
4232
  "aria-selected": selected,
4195
- className: cx(["adyen-kyc-dropdown-element", styles$4["adyen-kyc-dropdown-element"], {
4233
+ className: cx(["adyen-kyc-dropdown-element", {
4196
4234
  "adyen-kyc-dropdown-element--active": selected,
4197
4235
  "adyen-kyc-dropdown-element--disabled": !!item.disabled,
4198
4236
  "adyen-kyc-dropdown-multi-element": isMulti,
@@ -4323,9 +4361,7 @@ function SelectList({
4323
4361
  test: true,
4324
4362
  "adyen-kyc-dropdown-list--above": showAbove,
4325
4363
  "adyen-kyc-dropdown-list": true,
4326
- [styles$4["adyen-kyc-dropdown-list"]]: true,
4327
- "adyen-kyc-dropdown-list--active": showList,
4328
- [styles$4["adyen-kyc-dropdown-list--active"]]: showList
4364
+ "adyen-kyc-dropdown-list--active": showList
4329
4365
  }),
4330
4366
  id: props.selectListId,
4331
4367
  role: "listbox",
@@ -4357,7 +4393,7 @@ const Select = ({
4357
4393
  name,
4358
4394
  isInvalid = false,
4359
4395
  isValid,
4360
- placeholder,
4396
+ placeholder = "",
4361
4397
  isMulti,
4362
4398
  uniqueId,
4363
4399
  showSelectedItemsAsTags = false,
@@ -4367,21 +4403,21 @@ const Select = ({
4367
4403
  loading = false,
4368
4404
  getSearchItem,
4369
4405
  searchText,
4406
+ onSearchTextChange,
4370
4407
  showSearchList
4371
4408
  }) => {
4372
4409
  const filterInputRef = useRef(null);
4373
4410
  const selectContainerRef = useRef(null);
4374
4411
  const toggleButtonRef = useRef(null);
4375
4412
  const selectListRef = useRef(null);
4376
- const [textFilter, setTextFilter] = useState(null);
4413
+ const [textFilter, setTextFilter] = useState(searchText);
4377
4414
  const [isShowList, setIsShowList] = useState(false);
4378
4415
  const selectListId = useMemo(() => `select-${uuidv4()}`, []);
4379
4416
  const active = items.filter((i) => !isMulti ? i.id === selected : selected == null ? void 0 : selected.includes(i.id)) || [];
4380
4417
  const [isShowListAbove, setIsShowListAbove] = useState(false);
4381
4418
  const [scrollParent, setScrollParent] = useState(null);
4382
- const debouncedOnSearch = useCallback(debounce(onSearch, 500), [onSearch]);
4383
4419
  const closeList = () => {
4384
- setTextFilter(null);
4420
+ if (!onSearchTextChange) setTextFilter(null);
4385
4421
  setIsShowList(false);
4386
4422
  if (toggleButtonRef.current) toggleButtonRef.current.focus();
4387
4423
  };
@@ -4492,11 +4528,19 @@ const Select = ({
4492
4528
  const {
4493
4529
  value
4494
4530
  } = e.target;
4495
- if (isSearch && value.length > 2) {
4496
- debouncedOnSearch(value);
4531
+ if (onSearchTextChange) {
4532
+ onSearchTextChange == null ? void 0 : onSearchTextChange(value);
4533
+ setTextFilter(value);
4534
+ } else {
4535
+ setTextFilter(value.toLowerCase());
4497
4536
  }
4498
- setTextFilter(value.toLowerCase());
4499
4537
  };
4538
+ const debouncedTextFilter = useDebounce(textFilter, 500);
4539
+ useEffect(() => {
4540
+ if (isSearch && (debouncedTextFilter == null ? void 0 : debouncedTextFilter.length) > 2) {
4541
+ onSearch(debouncedTextFilter);
4542
+ }
4543
+ }, [debouncedTextFilter]);
4500
4544
  const toggleList = (e) => {
4501
4545
  e.preventDefault();
4502
4546
  if (isShowList) {
@@ -4506,9 +4550,9 @@ const Select = ({
4506
4550
  }
4507
4551
  };
4508
4552
  useEffect(() => {
4509
- if (resetSearch) {
4510
- setTextFilter("");
4511
- }
4553
+ if (!onSearchTextChange) {
4554
+ if (resetSearch) setTextFilter("");
4555
+ } else if (resetSearch && !searchText) setTextFilter("");
4512
4556
  }, [resetSearch]);
4513
4557
  useEffect(() => {
4514
4558
  setTextFilter(searchText);
@@ -4528,7 +4572,7 @@ const Select = ({
4528
4572
  };
4529
4573
  }, []);
4530
4574
  return jsxs("div", {
4531
- className: cx(["adyen-kyc-dropdown", styles$4["adyen-kyc-dropdown"], className, ...classNameModifiers.map((m) => `adyen-kyc-dropdown--${m}`)]),
4575
+ className: cx(["adyen-kyc-dropdown", className, ...classNameModifiers.map((m) => `adyen-kyc-dropdown--${m}`)]),
4532
4576
  ref: selectContainerRef,
4533
4577
  onClick: (e) => {
4534
4578
  e.stopPropagation();
@@ -4556,6 +4600,7 @@ const Select = ({
4556
4600
  isMulti,
4557
4601
  showSelectedItemsAsTags,
4558
4602
  isSearch,
4603
+ hideSearchIcon: !!onSearchTextChange,
4559
4604
  loading,
4560
4605
  textFilter
4561
4606
  }), jsx(SelectList, {
@@ -5562,7 +5607,7 @@ const businessRegistrationNumberMasks = {
5562
5607
  },
5563
5608
  [CountryCodes.Cyprus]: {
5564
5609
  default: {
5565
- mask: makeMask(...alphaInputs(1), ...alphaInputs(1, true), ...numericInputs(1), ...numericInputs(7, true)),
5610
+ mask: makeMask(...customInputs(1, /^[COP]$/), ...numericInputs(1), ...numericInputs(7, true)),
5566
5611
  transformOnType: uppercase
5567
5612
  }
5568
5613
  },
@@ -6403,7 +6448,7 @@ const businessRegistrationNumberPatterns = {
6403
6448
  soleProprietorship: /^\d{8}$/
6404
6449
  },
6405
6450
  [CountryCodes.Cyprus]: {
6406
- default: /^[A-Z]{1,2}\d{1,8}$/
6451
+ default: /^[COP]{1}\d{1,8}$/
6407
6452
  },
6408
6453
  [CountryCodes.CzechRepublic]: {
6409
6454
  default: /^\d{8,10}$/
@@ -6750,13 +6795,11 @@ const defaultFieldConfig$9 = {
6750
6795
  mask: businessRegistrationNumberMasks[CountryCodes.Cyprus].default,
6751
6796
  validators: validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.Cyprus].default),
6752
6797
  guidanceText: {
6753
- key: "enterXToYLettersAndThenWToZDigitsForExample",
6798
+ key: "enterEnglishLetterFollowedByXtoYDigitsForExample",
6754
6799
  values: {
6755
- minLetters: "1",
6756
- maxLetters: "2",
6757
6800
  minDigits: "1",
6758
6801
  maxDigits: "8",
6759
- example: "HE337518"
6802
+ example: "C12345678"
6760
6803
  }
6761
6804
  }
6762
6805
  },
@@ -6952,18 +6995,16 @@ const defaultFieldConfig$9 = {
6952
6995
  case "partitaIVA":
6953
6996
  default:
6954
6997
  return {
6955
- label: "partitaIVA",
6998
+ label: "codiceFiscalePartitaIVA",
6956
6999
  validators: validatePatternOnBlur(/^\d{11}$/),
6957
7000
  mask: {
6958
- mask: makeMask(...nonInputs("IT", {
6959
- includeInValue: false
6960
- }), spacer, ...numericInputs(11))
7001
+ mask: makeMask(spacer, ...numericInputs(11))
6961
7002
  },
6962
7003
  guidanceText: {
6963
7004
  key: "enterTheRemainingNDigitsForExample",
6964
7005
  values: {
6965
7006
  numDigits: "11",
6966
- example: "IT47040001100"
7007
+ example: "47040001100"
6967
7008
  }
6968
7009
  }
6969
7010
  };
@@ -7453,11 +7494,12 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
7453
7494
  };
7454
7495
  };
7455
7496
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
7456
- const logger$D = createLogger("MaskedInputText");
7497
+ const logger$E = createLogger("MaskedInputText");
7457
7498
  const MaskedInputText = ({
7458
7499
  value,
7459
7500
  onInput,
7460
7501
  onBlur,
7502
+ onFocus,
7461
7503
  onMismatch: onMismatchExternal,
7462
7504
  isValid: validationIsValid,
7463
7505
  errorMessage,
@@ -7499,7 +7541,7 @@ const MaskedInputText = ({
7499
7541
  };
7500
7542
  useEffect(() => {
7501
7543
  if (!mask) {
7502
- logger$D.warn("`mask` is undefined. No masking of input will take place.");
7544
+ logger$E.warn("`mask` is undefined. No masking of input will take place.");
7503
7545
  }
7504
7546
  }, [mask]);
7505
7547
  const getMaskResult = useCallback((pureValue) => {
@@ -7524,13 +7566,13 @@ const MaskedInputText = ({
7524
7566
  return;
7525
7567
  }
7526
7568
  if (preserveMismatchingInitialValue) {
7527
- logger$D.warn(`Value received "${value}" does not match mask`, maskResult, `
7569
+ logger$E.warn(`Value received "${value}" does not match mask`, maskResult, `
7528
7570
  Preserving mismatched initial value until user input.`);
7529
7571
  setPreservingMismatchedValue(true);
7530
7572
  return;
7531
7573
  }
7532
7574
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
7533
- logger$D.warn(`Value received "${value}" does not match mask`, maskResult, `
7575
+ logger$E.warn(`Value received "${value}" does not match mask`, maskResult, `
7534
7576
  Falling back to partially valid value "${fallback}"`);
7535
7577
  onInput(fallback);
7536
7578
  }
@@ -7625,6 +7667,7 @@ Falling back to partially valid value "${fallback}"`);
7625
7667
  }
7626
7668
  },
7627
7669
  onFocusHandler: (event) => {
7670
+ onFocus == null ? void 0 : onFocus();
7628
7671
  fieldOnFocus(event);
7629
7672
  setIsFocused(true);
7630
7673
  },
@@ -7719,7 +7762,7 @@ const companyRegistrationNumberOptions = {
7719
7762
  }],
7720
7763
  [CountryCodes.Italy]: [{
7721
7764
  id: "partitaIVA",
7722
- name: "partitaIVA"
7765
+ name: "codiceFiscalePartitaIVA"
7723
7766
  }, {
7724
7767
  id: "CCIAA",
7725
7768
  name: "CCIAA"
@@ -10970,7 +11013,7 @@ const ID_NUMBER_EXEMPT_COUNTRIES = [CountryCodes.Canada, CountryCodes.PuertoRico
10970
11013
  const ID_NUMBER_VERIFICATION_COUNTRIES = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
10971
11014
  const COUNTRIES_WHICH_USE_MULTIPLE_IDENTITY_TYPES = [CountryCodes.HongKong, CountryCodes.Australia, CountryCodes.NewZealand];
10972
11015
  const ID_NUMBER_REQUIRED_FOR_DIRECTOR_COUNTRIES = [CountryCodes.Singapore];
10973
- const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore];
11016
+ const NATIONALITY_REQUIRED_FOR_COUNTRIES = [CountryCodes.Singapore, CountryCodes.HongKong];
10974
11017
  const CONTACTS_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
10975
11018
  const JOB_TITLE_REQUIRED_FOR_COUNTRIES = [CountryCodes.NewZealand];
10976
11019
  const ISSUER_REQUIRED_FOR_COUNTRIES = [CountryCodes.Australia];
@@ -10980,7 +11023,8 @@ const rules$3 = ({
10980
11023
  data,
10981
11024
  country,
10982
11025
  taskType,
10983
- isExperimentEnabled = () => false
11026
+ isExperimentEnabled = () => false,
11027
+ rootLegalEntity
10984
11028
  }) => ({
10985
11029
  isDirectorIdNumberRequiredForCountry: () => {
10986
11030
  var _a, _b, _c, _d, _e;
@@ -11045,8 +11089,13 @@ const rules$3 = ({
11045
11089
  }
11046
11090
  },
11047
11091
  nationalityIfRequiredForRole: () => {
11048
- var _a;
11049
- if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) && ((_a = data.personalDetails) == null ? void 0 : _a.nationality)) {
11092
+ var _a, _b;
11093
+ const enableIdentificationNationalityCrossBorderAssociateCheck = isExperimentEnabled("EnableIdentificationNationalityCrossBorderAssociateCheck");
11094
+ const rootLegalEntityCountry = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _a.registeredAddress.country;
11095
+ if (enableIdentificationNationalityCrossBorderAssociateCheck && rootLegalEntityCountry && NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(rootLegalEntityCountry)) {
11096
+ return REQUIRED;
11097
+ }
11098
+ if (NATIONALITY_REQUIRED_FOR_COUNTRIES.includes(country) || ((_b = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b.nationality)) {
11050
11099
  return REQUIRED;
11051
11100
  }
11052
11101
  },
@@ -11086,7 +11135,7 @@ const accountHolderValidationRules = {
11086
11135
  }
11087
11136
  };
11088
11137
  const accountHolderFields = ["accountHolder"];
11089
- const logger$C = createLogger("AccountHolder");
11138
+ const logger$D = createLogger("AccountHolder");
11090
11139
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
11091
11140
  switch (legalEntityType) {
11092
11141
  case LegalEntityType.ORGANIZATION: {
@@ -11096,7 +11145,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
11096
11145
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
11097
11146
  }
11098
11147
  default:
11099
- logger$C.error(`No available account holder options for legal entity type '${legalEntityType}'`);
11148
+ logger$D.error(`No available account holder options for legal entity type '${legalEntityType}'`);
11100
11149
  return [];
11101
11150
  }
11102
11151
  }
@@ -11664,7 +11713,7 @@ function Dropzone(props) {
11664
11713
  })]
11665
11714
  });
11666
11715
  }
11667
- const logger$B = createLogger("TextArea");
11716
+ const logger$C = createLogger("TextArea");
11668
11717
  function TextArea(props) {
11669
11718
  const {
11670
11719
  classNameModifiers,
@@ -11685,7 +11734,7 @@ function TextArea(props) {
11685
11734
  } = useI18nContext();
11686
11735
  const [value, setValue] = useState("");
11687
11736
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11688
- logger$B.error("Error: Form fields that rely on InputBase may not have an onChange property");
11737
+ logger$C.error("Error: Form fields that rely on InputBase may not have an onChange property");
11689
11738
  }
11690
11739
  const handleInput = (e) => {
11691
11740
  var _a;
@@ -11950,7 +11999,7 @@ const LABELS = {
11950
11999
  }
11951
12000
  };
11952
12001
  const getKeyForField = (fieldName, country) => country ? LABELS[fieldName][country] || LABELS[fieldName].default : LABELS[fieldName].default;
11953
- const getAddressSchemaForCountry = (country) => ADDRESS_SCHEMAS[country] || ADDRESS_SCHEMAS.default;
12002
+ const getAddressSchemaForCountry = (country) => country && ADDRESS_SCHEMAS[country] ? ADDRESS_SCHEMAS[country] : ADDRESS_SCHEMAS.default;
11954
12003
  const getAddressSchemaLabelsByCountry = (country) => {
11955
12004
  const schema = getAddressSchemaForCountry(country);
11956
12005
  return schema.reduce((labels2, field) => ({
@@ -12136,7 +12185,7 @@ function useIsElementVisible(ref, fallback = true) {
12136
12185
  }, [ref]);
12137
12186
  return isOnScreen;
12138
12187
  }
12139
- const logger$A = createLogger("SearchAddress");
12188
+ const logger$B = createLogger("SearchAddress");
12140
12189
  const SearchAddress = ({
12141
12190
  data,
12142
12191
  legalEntityId,
@@ -12180,7 +12229,7 @@ const SearchAddress = ({
12180
12229
  const response = await handleFindAddress(selectedAddressId);
12181
12230
  autocompleteAddressForm(response);
12182
12231
  } catch (e) {
12183
- logger$A.error(e);
12232
+ logger$B.error(e);
12184
12233
  }
12185
12234
  };
12186
12235
  const onDrilldown = async (selectedAddress) => {
@@ -12192,7 +12241,7 @@ const SearchAddress = ({
12192
12241
  }, legalEntityId);
12193
12242
  setItems((response == null ? void 0 : response.results) || []);
12194
12243
  } catch (e) {
12195
- logger$A.error(e);
12244
+ logger$B.error(e);
12196
12245
  }
12197
12246
  };
12198
12247
  const onChange = (e) => {
@@ -12212,7 +12261,7 @@ const SearchAddress = ({
12212
12261
  }
12213
12262
  setLoading(false);
12214
12263
  };
12215
- const formatAddressItem = (item) => {
12264
+ const formatAddressItem2 = (item) => {
12216
12265
  if (item.description.includes("Addresses")) {
12217
12266
  const splittedDescription = item.description.split(" - ");
12218
12267
  if (splittedDescription.length === 1) {
@@ -12241,18 +12290,18 @@ const SearchAddress = ({
12241
12290
  country: data.country
12242
12291
  }, legalEntityId);
12243
12292
  if (response == null ? void 0 : response.results) {
12244
- const modifiedItems = response.results.map(formatAddressItem);
12293
+ const modifiedItems = response.results.map(formatAddressItem2);
12245
12294
  setItems(modifiedItems);
12246
12295
  } else {
12247
12296
  setItems([]);
12248
12297
  }
12249
12298
  } catch (e) {
12250
- logger$A.error(e);
12299
+ logger$B.error(e);
12251
12300
  }
12252
12301
  setLoading(false);
12253
12302
  }
12254
12303
  };
12255
- const getFormattedText = (highlightItems, text) => {
12304
+ const getFormattedText2 = (highlightItems, text) => {
12256
12305
  const formattedText = [];
12257
12306
  let lastHighlightIndex = 0;
12258
12307
  if (highlightItems[0] === "") {
@@ -12278,7 +12327,7 @@ const SearchAddress = ({
12278
12327
  }
12279
12328
  return formattedText;
12280
12329
  };
12281
- const getHighlightedText = ({
12330
+ const getHighlightedText2 = ({
12282
12331
  text,
12283
12332
  highlight,
12284
12333
  description
@@ -12292,11 +12341,11 @@ const SearchAddress = ({
12292
12341
  }
12293
12342
  } else {
12294
12343
  const highlightItems = highlight.split(";");
12295
- formattedText = getFormattedText(highlightItems[0].split(","), text);
12344
+ formattedText = getFormattedText2(highlightItems[0].split(","), text);
12296
12345
  if (highlightItems.length > 1) {
12297
12346
  formattedText.push(`, `);
12298
12347
  formattedText.push(jsx(Fragment, {
12299
- children: getFormattedText(highlightItems[1].split(","), description)
12348
+ children: getFormattedText2(highlightItems[1].split(","), description)
12300
12349
  }));
12301
12350
  } else if (description) {
12302
12351
  formattedText.push(`, ${description}`);
@@ -12304,10 +12353,10 @@ const SearchAddress = ({
12304
12353
  }
12305
12354
  return formattedText;
12306
12355
  };
12307
- const generateSearchListItem = (item) => jsxs(Fragment, {
12356
+ const generateSearchListItem2 = (item) => jsxs(Fragment, {
12308
12357
  children: [jsx("span", {
12309
12358
  className: "adyen-kyc-dropdown-search-element__description",
12310
- children: getHighlightedText(item)
12359
+ children: getHighlightedText2(item)
12311
12360
  }), item.addressAmount && jsxs("div", {
12312
12361
  className: "adyen-kyc-dropdown-search-element__addresses",
12313
12362
  children: [item.addressAmount, " ", jsxs("span", {
@@ -12338,7 +12387,7 @@ const SearchAddress = ({
12338
12387
  resetSearch,
12339
12388
  onSearch: getSearchItems,
12340
12389
  loading,
12341
- getSearchItem: generateSearchListItem,
12390
+ getSearchItem: generateSearchListItem2,
12342
12391
  isInvalid: false,
12343
12392
  searchText,
12344
12393
  showSearchList
@@ -12625,7 +12674,7 @@ const countrySpecificFormatters = {
12625
12674
  };
12626
12675
  const addressValidationRules = (country) => {
12627
12676
  var _a, _b;
12628
- const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
12677
+ const postalCodeFormat = country ? (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format : void 0;
12629
12678
  return {
12630
12679
  address: {
12631
12680
  modes: ["blur"],
@@ -12635,7 +12684,7 @@ const addressValidationRules = (country) => {
12635
12684
  postalCode: {
12636
12685
  modes: ["blur"],
12637
12686
  validate: (val) => {
12638
- const pattern = postalCodePatterns[country];
12687
+ const pattern = country ? postalCodePatterns[country] : void 0;
12639
12688
  return pattern ? !!val && pattern.test(val) : !!val;
12640
12689
  },
12641
12690
  errorMessage: postalCodeFormat ? {
@@ -12664,7 +12713,7 @@ const addressValidationRules = (country) => {
12664
12713
  };
12665
12714
  const addressValidationRulesV4 = (country, i18n) => {
12666
12715
  var _a, _b;
12667
- const postalCodeFormat = (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format;
12716
+ const postalCodeFormat = country ? (_b = (_a = countrySpecificFormatters[country]) == null ? void 0 : _a.postalCode) == null ? void 0 : _b.format : void 0;
12668
12717
  const MIN_LENGTH_3 = 3;
12669
12718
  return {
12670
12719
  address: [{
@@ -12693,7 +12742,7 @@ const addressValidationRulesV4 = (country, i18n) => {
12693
12742
  postalCode: {
12694
12743
  modes: ["blur"],
12695
12744
  validate: (val) => {
12696
- const pattern = postalCodePatterns[country];
12745
+ const pattern = country ? postalCodePatterns[country] : void 0;
12697
12746
  return pattern ? !!val && pattern.test(val) : !!val;
12698
12747
  },
12699
12748
  errorMessage: postalCodeFormat ? {
@@ -12786,11 +12835,10 @@ function Address(props) {
12786
12835
  const stateRef = useRef({
12787
12836
  setState: null
12788
12837
  });
12789
- const addressFields = ADDRESS_SCHEMAS[dataProp == null ? void 0 : dataProp.country] ?? ADDRESS_SCHEMAS.default;
12790
12838
  const datasetUtils = datasetUtilities(i18n.locale);
12791
- const requiredFields = (requiredFieldsProp == null ? void 0 : requiredFieldsProp.includes("stateOrProvince")) || dataProp.country && COUNTRIES_WITH_STATES_DATASET.includes(dataProp.country) ? addressFields : addressFields.filter((ad) => ad !== "stateOrProvince");
12792
- const rules2 = useMemo(() => addressValidationRules(dataProp.country), [dataProp.country]);
12793
- const rulesV4 = useMemo(() => addressValidationRulesV4(dataProp.country, i18n), [dataProp.country, i18n]);
12839
+ const requiredFields = (requiredFieldsProp == null ? void 0 : requiredFieldsProp.includes("stateOrProvince")) || (dataProp == null ? void 0 : dataProp.country) && COUNTRIES_WITH_STATES_DATASET.includes(dataProp == null ? void 0 : dataProp.country) ? getAddressSchemaForCountry(dataProp == null ? void 0 : dataProp.country) : getAddressSchemaForCountry(dataProp == null ? void 0 : dataProp.country).filter((ad) => ad !== "stateOrProvince");
12840
+ const rules2 = useMemo(() => addressValidationRules(dataProp == null ? void 0 : dataProp.country), [dataProp == null ? void 0 : dataProp.country]);
12841
+ const rulesV4 = useMemo(() => addressValidationRulesV4(dataProp == null ? void 0 : dataProp.country, i18n), [dataProp == null ? void 0 : dataProp.country, i18n]);
12794
12842
  const {
12795
12843
  data,
12796
12844
  errors,
@@ -12818,7 +12866,7 @@ function Address(props) {
12818
12866
  optionalFields: optionalFieldsProp
12819
12867
  }, i18n);
12820
12868
  useEffect(() => {
12821
- if (dataProp.country !== data.country && dataProp.country) {
12869
+ if ((dataProp == null ? void 0 : dataProp.country) !== data.country && (dataProp == null ? void 0 : dataProp.country)) {
12822
12870
  requiredFields.forEach((field) => {
12823
12871
  handleChangeFor(field, "input")("");
12824
12872
  });
@@ -12826,7 +12874,7 @@ function Address(props) {
12826
12874
  setShowAutocompletedAddressFields(false);
12827
12875
  setShowAddAddressButton(true);
12828
12876
  }
12829
- }, [dataProp.country]);
12877
+ }, [dataProp == null ? void 0 : dataProp.country]);
12830
12878
  useEffect(() => {
12831
12879
  if (handleAddressSearch && handleFindAddress) {
12832
12880
  setIsHandlerPresent(true);
@@ -12837,12 +12885,13 @@ function Address(props) {
12837
12885
  }
12838
12886
  }, []);
12839
12887
  useEffect(() => {
12888
+ var _a, _b;
12840
12889
  const processedData = ADDRESS_SCHEMA.reduce((acc, cur) => {
12841
12890
  if (!formUtils.isRequiredField(cur)) {
12842
12891
  delete acc[cur];
12843
12892
  return acc;
12844
12893
  }
12845
- const fallbackValue = !formUtils.isRequiredField(cur) && !data[cur] && dataProp[cur] ? dataProp[cur] : "N/A";
12894
+ const fallbackValue = !formUtils.isRequiredField(cur) && !data[cur] && (dataProp == null ? void 0 : dataProp[cur]) ? dataProp[cur] : "N/A";
12846
12895
  return {
12847
12896
  ...acc,
12848
12897
  [cur]: formUtils.isRequiredField(cur) || !!data[cur] ? data[cur] : fallbackValue
@@ -12877,7 +12926,7 @@ function Address(props) {
12877
12926
  },
12878
12927
  isValid
12879
12928
  });
12880
- stateRef.current.setState({
12929
+ (_b = (_a = stateRef.current).setState) == null ? void 0 : _b.call(_a, {
12881
12930
  type: "addToState",
12882
12931
  value: {
12883
12932
  ...addressState,
@@ -12937,8 +12986,8 @@ function Address(props) {
12937
12986
  }) => {
12938
12987
  const hasHouseNumber = !!houseNumberOrName;
12939
12988
  if (hasHouseNumber) {
12940
- const isHouseNumberFirst = COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country);
12941
- const needsComma = COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country);
12989
+ const isHouseNumberFirst = data.country ? COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) : false;
12990
+ const needsComma = data.country ? COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country) : false;
12942
12991
  const formattedAddress = isHouseNumberFirst ? `${houseNumberOrName}${needsComma ? ", " : " "}${street}` : `${street}${needsComma ? ", " : " "}${houseNumberOrName}`;
12943
12992
  return handleChangeFor("address", "input")(formattedAddress);
12944
12993
  }
@@ -12980,7 +13029,7 @@ function Address(props) {
12980
13029
  className: "adyen-kyc-search-address",
12981
13030
  children: [jsx(SearchAddress, {
12982
13031
  handleChangeFor,
12983
- data: dataProp,
13032
+ data: dataProp ?? {},
12984
13033
  handleAddressSearch,
12985
13034
  handleFindAddress,
12986
13035
  legalEntityId,
@@ -12994,7 +13043,7 @@ function Address(props) {
12994
13043
  className: "adyen-kyc-search-address--below-location",
12995
13044
  children: [jsx(Icon, {
12996
13045
  name: "location"
12997
- }), datasetUtils.getCountryName(dataProp.country)]
13046
+ }), datasetUtils.getCountryName(dataProp == null ? void 0 : dataProp.country)]
12998
13047
  }), showAddAddressButton && jsx(Button, {
12999
13048
  showAsLink: true,
13000
13049
  testId: "addAddressManuallyBtn",
@@ -13018,6 +13067,460 @@ Address.defaultProps = {
13018
13067
  requiredFields: ADDRESS_SCHEMA,
13019
13068
  countryCode: null
13020
13069
  };
13070
+ const logger$A = createLogger("AddressFieldContainer");
13071
+ const formatAddressItem = (item) => {
13072
+ if (item.description.includes("Addresses")) {
13073
+ const splittedDescription = item.description.split(" - ");
13074
+ if (splittedDescription.length === 1) {
13075
+ return {
13076
+ ...item,
13077
+ description: "",
13078
+ addressAmount: splittedDescription[0].replace("Addresses", "")
13079
+ };
13080
+ }
13081
+ return {
13082
+ ...item,
13083
+ description: splittedDescription[0],
13084
+ addressAmount: splittedDescription[1].replace("Addresses", "")
13085
+ };
13086
+ }
13087
+ return item;
13088
+ };
13089
+ const getFormattedText = (highlightItems, text) => {
13090
+ const formattedText = [];
13091
+ let lastHighlightIndex = 0;
13092
+ if (highlightItems[0] === "") {
13093
+ return [text];
13094
+ }
13095
+ highlightItems.forEach((highlightValue) => {
13096
+ const highlightRange = highlightValue.split("-");
13097
+ const highlightInit = parseInt(highlightRange[0]);
13098
+ const highlightEnd = parseInt(highlightRange[1]);
13099
+ if (lastHighlightIndex < highlightInit) {
13100
+ const remain = text.substring(lastHighlightIndex, highlightInit);
13101
+ formattedText.push(`${remain}`);
13102
+ }
13103
+ const boldText = text.substring(highlightInit, highlightEnd);
13104
+ formattedText.push(jsx("span", {
13105
+ className: "adyen-kyc-dropdown-search-element__description--highlight",
13106
+ children: boldText
13107
+ }));
13108
+ lastHighlightIndex = highlightEnd;
13109
+ });
13110
+ if (lastHighlightIndex < text.length) {
13111
+ formattedText.push(`${text.substring(lastHighlightIndex)}`);
13112
+ }
13113
+ return formattedText;
13114
+ };
13115
+ const getHighlightedText = ({
13116
+ text = "",
13117
+ highlight = "",
13118
+ description = ""
13119
+ }) => {
13120
+ let formattedText = [];
13121
+ if (highlight === "") {
13122
+ if (description) {
13123
+ formattedText.push(`${text}, ${description}`);
13124
+ } else {
13125
+ formattedText.push(text);
13126
+ }
13127
+ } else {
13128
+ const highlightItems = highlight.split(";");
13129
+ formattedText = getFormattedText(highlightItems[0].split(","), text);
13130
+ if (highlightItems.length > 1) {
13131
+ formattedText.push(`, `);
13132
+ formattedText.push(jsx(Fragment, {
13133
+ children: getFormattedText(highlightItems[1].split(","), description)
13134
+ }));
13135
+ } else if (description) {
13136
+ formattedText.push(`, ${description}`);
13137
+ }
13138
+ }
13139
+ return formattedText;
13140
+ };
13141
+ const generateSearchListItem = (item, i18n) => jsxs(Fragment, {
13142
+ children: [jsx("span", {
13143
+ className: "adyen-kyc-dropdown-search-element__description",
13144
+ children: getHighlightedText(item)
13145
+ }), item.addressAmount && jsxs("div", {
13146
+ className: "adyen-kyc-dropdown-search-element__addresses",
13147
+ children: [item.addressAmount, " ", jsxs("span", {
13148
+ className: "adyen-kyc-dropdown-search-element__addresses--text",
13149
+ children: [" ", i18n.get("addresses")]
13150
+ }), jsx(Icon, {
13151
+ name: "arrow-right",
13152
+ className: "adyen-kyc-dropdown-search-element__addresses--icon"
13153
+ })]
13154
+ })]
13155
+ });
13156
+ function FieldContainerComponent({
13157
+ legalEntityId = "",
13158
+ classNameModifiers = [],
13159
+ schema,
13160
+ data,
13161
+ valid,
13162
+ errors,
13163
+ fieldProblems,
13164
+ fieldName,
13165
+ trimOnBlur,
13166
+ hideField,
13167
+ maxlength,
13168
+ readOnly,
13169
+ optional,
13170
+ handleChangeFor,
13171
+ handleAddressSearch,
13172
+ handleFindAddress
13173
+ }) {
13174
+ const {
13175
+ i18n
13176
+ } = useI18nContext();
13177
+ useEffect(() => {
13178
+ setItems([]);
13179
+ setSearchText("");
13180
+ setResetSearch(true);
13181
+ }, [data.country]);
13182
+ const formUtils = formUtilities({
13183
+ data
13184
+ }, i18n);
13185
+ const errorMessage = formUtils.getErrorMessage(fieldName, errors ?? {}, fieldProblems);
13186
+ const value = data[fieldName];
13187
+ const labelKey = getKeyForField(fieldName, data.country);
13188
+ const [items, setItems] = useState([]);
13189
+ const [loading, setLoading] = useState(false);
13190
+ const [resetSearch, setResetSearch] = useState(false);
13191
+ const [showSearchList, setShowSearchList] = useState(false);
13192
+ const [selectedAddressId, setSelectedAddressId] = useState();
13193
+ const [searchText, setSearchText] = useState(data.address);
13194
+ useEffect(() => {
13195
+ setSearchText(data.address);
13196
+ }, [data.address]);
13197
+ const setAddressField = ({
13198
+ houseNumberOrName,
13199
+ street
13200
+ }) => {
13201
+ const hasHouseNumber = !!houseNumberOrName;
13202
+ if (hasHouseNumber) {
13203
+ const isHouseNumberFirst = data.country ? COUNTRIES_WITH_HOUSE_NUMBER_FIRST.includes(data.country) : false;
13204
+ const needsComma = data.country ? COUNTRIES_WITH_COMMA_SEPARATED.includes(data.country) : false;
13205
+ const formattedAddress = isHouseNumberFirst ? `${houseNumberOrName}${needsComma ? ", " : " "}${street}` : `${street}${needsComma ? ", " : " "}${houseNumberOrName}`;
13206
+ return handleChangeFor("address", "input")(formattedAddress);
13207
+ }
13208
+ return handleChangeFor("address", "input")(street);
13209
+ };
13210
+ const getSearchItems = async (text) => {
13211
+ if (!text || !data.country) return setItems([]);
13212
+ try {
13213
+ setLoading(true);
13214
+ const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch({
13215
+ text,
13216
+ country: data.country
13217
+ }, legalEntityId));
13218
+ if (response == null ? void 0 : response.results) {
13219
+ setItems(response.results.map(formatAddressItem));
13220
+ } else {
13221
+ setItems([]);
13222
+ }
13223
+ } catch (e) {
13224
+ logger$A.error(e);
13225
+ }
13226
+ setLoading(false);
13227
+ };
13228
+ const onFindAddress = async (addressId) => {
13229
+ try {
13230
+ const response = await (handleFindAddress == null ? void 0 : handleFindAddress(addressId));
13231
+ if (response) {
13232
+ schema == null ? void 0 : schema.forEach((field) => {
13233
+ switch (field) {
13234
+ case "country":
13235
+ handleChangeFor("country", "input")(response.country ?? " ");
13236
+ break;
13237
+ case "address":
13238
+ setAddressField(response);
13239
+ break;
13240
+ case "otherAddressInformation":
13241
+ handleChangeFor("otherAddressInformation", "blur")(response.street2 ?? " ");
13242
+ break;
13243
+ case "city":
13244
+ handleChangeFor("city", "input")(response.city ?? " ");
13245
+ break;
13246
+ case "postalCode":
13247
+ handleChangeFor("postalCode", "input")(response.postalCode ?? " ");
13248
+ break;
13249
+ case "stateOrProvince":
13250
+ handleChangeFor("stateOrProvince", "input")(response.stateOrProvince ?? " ");
13251
+ break;
13252
+ default:
13253
+ break;
13254
+ }
13255
+ });
13256
+ }
13257
+ } catch (e) {
13258
+ logger$A.error(e);
13259
+ }
13260
+ };
13261
+ const onDrilldown = async (address) => {
13262
+ if (!data.country) return;
13263
+ try {
13264
+ const response = await (handleAddressSearch == null ? void 0 : handleAddressSearch({
13265
+ text: address.text,
13266
+ country: data.country,
13267
+ container: address.id
13268
+ }, legalEntityId));
13269
+ setItems((response == null ? void 0 : response.results) || []);
13270
+ } catch (e) {
13271
+ logger$A.error(e);
13272
+ }
13273
+ };
13274
+ const handleOnChange = (e) => {
13275
+ const addressId = e.target.value;
13276
+ setSelectedAddressId(addressId);
13277
+ setLoading(true);
13278
+ const selectedAddress = items.filter((i) => i.id === addressId)[0];
13279
+ if (selectedAddress.type === "Address") {
13280
+ onFindAddress(selectedAddress.id);
13281
+ setShowSearchList(false);
13282
+ } else {
13283
+ onDrilldown(selectedAddress);
13284
+ setShowSearchList(true);
13285
+ }
13286
+ setLoading(false);
13287
+ };
13288
+ const renderField = (field) => {
13289
+ switch (field) {
13290
+ case "address":
13291
+ return handleAddressSearch && handleFindAddress ? jsx(Field, {
13292
+ name: field,
13293
+ label: i18n.get(labelKey),
13294
+ classNameModifiers,
13295
+ errorMessage,
13296
+ isValid: valid == null ? void 0 : valid[field],
13297
+ optional,
13298
+ children: (childProps) => jsx(Select, {
13299
+ ...childProps,
13300
+ isSearch: true,
13301
+ name: field,
13302
+ items: items.map((item) => ({
13303
+ ...item,
13304
+ name: ""
13305
+ })),
13306
+ selected: selectedAddressId,
13307
+ loading,
13308
+ onChange: handleOnChange,
13309
+ onSearch: getSearchItems,
13310
+ onSearchTextChange: (text) => handleChangeFor("address", "input")(text),
13311
+ getSearchItem: (item) => generateSearchListItem(item, i18n),
13312
+ showSearchList,
13313
+ resetSearch,
13314
+ searchText
13315
+ })
13316
+ }) : jsx(Field, {
13317
+ name: field,
13318
+ label: i18n.get(labelKey),
13319
+ classNameModifiers,
13320
+ errorMessage,
13321
+ isValid: valid == null ? void 0 : valid[field],
13322
+ optional,
13323
+ children: (childProps) => jsx(InputText, {
13324
+ ...childProps,
13325
+ classNameModifiers,
13326
+ name: field,
13327
+ value,
13328
+ onInput: handleChangeFor(fieldName, "input"),
13329
+ onBlur: handleChangeFor(fieldName, "blur"),
13330
+ maxLength: maxlength,
13331
+ "aria-required": true,
13332
+ "aria-label": i18n.get(labelKey),
13333
+ "aria-invalid": !(valid == null ? void 0 : valid[field]),
13334
+ trimOnBlur,
13335
+ readonly: readOnly
13336
+ })
13337
+ });
13338
+ case "country":
13339
+ return jsx(CountryField, {
13340
+ data: {
13341
+ country: value
13342
+ },
13343
+ valid: {
13344
+ country: valid == null ? void 0 : valid.country
13345
+ },
13346
+ errors: {
13347
+ country: errorMessage
13348
+ },
13349
+ labels: {
13350
+ country: formUtils.getLabel(field, labelKey)
13351
+ },
13352
+ readonly: Boolean(readOnly),
13353
+ classNameModifiers,
13354
+ className: hideField ? "adyen-kyc-search-fieldcontainer-hide" : "",
13355
+ handleChangeFor
13356
+ });
13357
+ case "stateOrProvince":
13358
+ return jsx(StateField, {
13359
+ data: {
13360
+ stateOrProvince: value
13361
+ },
13362
+ valid: {
13363
+ stateOrProvince: valid == null ? void 0 : valid.stateOrProvince
13364
+ },
13365
+ errors: {
13366
+ stateOrProvince: errorMessage
13367
+ },
13368
+ labels: {
13369
+ stateOrProvince: formUtils.getLabel(field, labelKey)
13370
+ },
13371
+ readonly: Boolean(readOnly),
13372
+ classNameModifiers,
13373
+ selectedCountry: data.country,
13374
+ handleChangeFor
13375
+ });
13376
+ default:
13377
+ return jsx(Field, {
13378
+ name: field,
13379
+ label: i18n.get(labelKey),
13380
+ classNameModifiers,
13381
+ errorMessage,
13382
+ isValid: valid == null ? void 0 : valid[field],
13383
+ optional,
13384
+ children: (childProps) => jsx(InputText, {
13385
+ ...childProps,
13386
+ classNameModifiers,
13387
+ name: field,
13388
+ value: field === "postalCode" ? value == null ? void 0 : value.toUpperCase() : value,
13389
+ onInput: handleChangeFor(fieldName, "input"),
13390
+ onBlur: handleChangeFor(fieldName, "blur"),
13391
+ maxLength: maxlength,
13392
+ "aria-required": true,
13393
+ "aria-label": i18n.get(labelKey),
13394
+ "aria-invalid": !(valid == null ? void 0 : valid[field]),
13395
+ trimOnBlur,
13396
+ readonly: readOnly
13397
+ })
13398
+ });
13399
+ }
13400
+ };
13401
+ return hideField ? null : renderField(fieldName);
13402
+ }
13403
+ function AddressComponent({
13404
+ data,
13405
+ labels: labels2,
13406
+ placeholders,
13407
+ helperText,
13408
+ readOnly,
13409
+ hideCountry,
13410
+ fieldValidationErrors,
13411
+ allFields,
13412
+ requiredFields,
13413
+ optionalFields = ["otherAddressInformation"],
13414
+ readOnlyFields,
13415
+ trustedFields,
13416
+ shouldValidate,
13417
+ handleAddressSearch,
13418
+ handleFindAddress,
13419
+ onChange,
13420
+ legalEntityId,
13421
+ verifiedAddress
13422
+ }) {
13423
+ const {
13424
+ i18n
13425
+ } = useI18nContext();
13426
+ const {
13427
+ isExperimentEnabled
13428
+ } = useExperimentsContext();
13429
+ const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(ExperimentNames.StrictNameAndAddressValidationV4);
13430
+ const schema = useMemo(() => {
13431
+ if (requiredFields == null ? void 0 : requiredFields.length) {
13432
+ return (requiredFields == null ? void 0 : requiredFields.includes("stateOrProvince")) || (data == null ? void 0 : data.country) && COUNTRIES_WITH_STATES_DATASET.includes(data == null ? void 0 : data.country) ? requiredFields : requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "stateOrProvince");
13433
+ }
13434
+ return (data == null ? void 0 : data.country) && COUNTRIES_WITH_STATES_DATASET.includes(data == null ? void 0 : data.country) ? getAddressSchemaForCountry(data == null ? void 0 : data.country) : getAddressSchemaForCountry(data == null ? void 0 : data.country).filter((ad) => ad !== "stateOrProvince");
13435
+ }, [data == null ? void 0 : data.country, requiredFields]);
13436
+ const rules2 = useMemo(() => addressValidationRules(data == null ? void 0 : data.country), [data == null ? void 0 : data.country]);
13437
+ const rulesV4 = useMemo(() => addressValidationRulesV4(data == null ? void 0 : data.country, i18n), [data == null ? void 0 : data.country, i18n]);
13438
+ const {
13439
+ schema: formSchema,
13440
+ data: formData,
13441
+ errors: formErrors,
13442
+ valid: formValid,
13443
+ fieldProblems: formFieldProblems,
13444
+ handleChangeFor,
13445
+ isValid
13446
+ } = useForm({
13447
+ schema,
13448
+ defaultData: data,
13449
+ formatters: addressFormatters,
13450
+ rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
13451
+ fieldProblems: fieldValidationErrors,
13452
+ optionalFields,
13453
+ obscuredFields: [],
13454
+ trustedFields: [],
13455
+ shouldValidate
13456
+ });
13457
+ useEffect(
13458
+ () => verifiedAddress ? entriesOf(verifiedAddress).forEach(([key, value]) => {
13459
+ if (formData[key] !== value) handleChangeFor(key, "input")(value);
13460
+ }) : formSchema.forEach((field) => handleChangeFor(field, "input")((data == null ? void 0 : data[field]) ?? " ")),
13461
+ // eslint-disable-next-line react-hooks/exhaustive-deps
13462
+ [verifiedAddress]
13463
+ );
13464
+ const formUtils = formUtilities({
13465
+ data,
13466
+ labels: labels2,
13467
+ placeholders,
13468
+ helperText,
13469
+ readOnly,
13470
+ allFields,
13471
+ requiredFields: schema,
13472
+ optionalFields,
13473
+ readOnlyFields,
13474
+ trustedFields
13475
+ }, i18n);
13476
+ useEffect(() => {
13477
+ onChange == null ? void 0 : onChange({
13478
+ schema: formSchema,
13479
+ data: formData,
13480
+ valid: formValid,
13481
+ errors: formErrors,
13482
+ fieldProblems: formFieldProblems,
13483
+ isValid
13484
+ });
13485
+ }, [formData, formErrors, formFieldProblems, formSchema, formValid, isValid]);
13486
+ const createFieldComponent = (fieldName) => {
13487
+ if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
13488
+ const hideField = fieldName === "country" && hideCountry;
13489
+ return jsx(FieldContainerComponent, {
13490
+ classNameModifiers: [fieldName],
13491
+ schema: formSchema,
13492
+ data: formData,
13493
+ valid: formValid,
13494
+ errors: formErrors,
13495
+ fieldProblems: formFieldProblems,
13496
+ fieldName,
13497
+ maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, formData.country),
13498
+ hideField,
13499
+ "aria-label": formUtils.getLabel(fieldName, fieldName),
13500
+ readOnly: formUtils.isReadOnly(fieldName),
13501
+ optional: formUtils.isOptionalField(fieldName),
13502
+ trimOnBlur: true,
13503
+ legalEntityId,
13504
+ handleChangeFor,
13505
+ handleAddressSearch,
13506
+ handleFindAddress
13507
+ }, fieldName);
13508
+ };
13509
+ return jsx("fieldset", {
13510
+ className: "adyen-kyc__address",
13511
+ children: formSchema.map((field) => createFieldComponent(field))
13512
+ });
13513
+ }
13514
+ function AddressExperimentWrapper(props) {
13515
+ const {
13516
+ isExperimentEnabled
13517
+ } = useExperimentsContext();
13518
+ return isExperimentEnabled("EnableNewAddressComponent") ? jsx(AddressComponent, {
13519
+ ...props
13520
+ }) : jsx(Address, {
13521
+ ...props
13522
+ });
13523
+ }
13021
13524
  var operationalAddressIsSameIds = /* @__PURE__ */ ((operationalAddressIsSameIds2) => {
13022
13525
  operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_SAME"] = "OperationAddressAnswerYes";
13023
13526
  operationalAddressIsSameIds2["OPERATIONAL_ADDRESS_IS_NOT_SAME"] = "OperationAddressAnswerNo";
@@ -13082,7 +13585,8 @@ function RegistrationAddressComponent(props) {
13082
13585
  valid: formValid,
13083
13586
  errors: formErrors,
13084
13587
  fieldProblems: formFieldProblems,
13085
- handleChangeFor
13588
+ handleChangeFor,
13589
+ setValid
13086
13590
  } = useForm({
13087
13591
  ...props,
13088
13592
  schema: ["operationalAddressIsSame"],
@@ -13119,10 +13623,25 @@ function RegistrationAddressComponent(props) {
13119
13623
  schema: ["registrationAddress", "operationalAddressIsSame", ...isOperationAddressNotSame() ? ["operationalAddress"] : []]
13120
13624
  }
13121
13625
  });
13122
- }, [formData.operationalAddressIsSame]);
13626
+ }, [formData, formValid, formErrors, formFieldProblems]);
13123
13627
  const isOperationAddressNotSame = () => formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME;
13124
13628
  const registrationAddressFormProps = getFormProps(props, registrationAddressFormID);
13125
13629
  const operationalAddressFormProps = getFormProps(props, operationalAddressFormID);
13630
+ const handleRegistrationAddressChange = (state) => {
13631
+ handleChangeFor("registrationAddress")(state.data);
13632
+ setValid("registrationAddress", Boolean(state.isValid));
13633
+ };
13634
+ const handleOperationalAddressChange = (state) => {
13635
+ handleChangeFor("operationalAddress")(state.data);
13636
+ setValid("operationalAddress", Boolean(state.isValid));
13637
+ };
13638
+ const handleOperationalAddressIsSameChange = (e) => {
13639
+ const {
13640
+ value
13641
+ } = e.target;
13642
+ handleChangeFor("operationalAddressIsSame")(value);
13643
+ if (value === "OperationAddressAnswerYes") setValid("operationalAddress", true);
13644
+ };
13126
13645
  return jsxs(Fragment, {
13127
13646
  children: [jsx(StateContextSetter, {
13128
13647
  owner: id,
@@ -13141,7 +13660,7 @@ function RegistrationAddressComponent(props) {
13141
13660
  contentId: "reasonForFillingCompanyAddressDetails",
13142
13661
  title: i18n.get("whyDoINeedToFillInThisInformation"),
13143
13662
  content: i18n.get("reasonForFillingCompanyAddressDetails")
13144
- }), jsx(Address, {
13663
+ }), jsx(AddressExperimentWrapper, {
13145
13664
  ...registrationAddressFormProps,
13146
13665
  data: {
13147
13666
  ...registrationAddressFormProps == null ? void 0 : registrationAddressFormProps.data,
@@ -13150,10 +13669,12 @@ function RegistrationAddressComponent(props) {
13150
13669
  hideCountry: true,
13151
13670
  id,
13152
13671
  addressType: "registrationAddress",
13672
+ optionalFields: ["otherAddressInformation"],
13153
13673
  handleAddressSearch,
13154
13674
  handleFindAddress,
13155
13675
  verifiedBusiness,
13156
- kompanyAddress
13676
+ kompanyAddress,
13677
+ onChange: handleRegistrationAddressChange
13157
13678
  }), jsx(FormHeader, {
13158
13679
  classNames: "adyen-kyc-u-margin-top-32",
13159
13680
  heading: i18n.get("operationalAddressHeader")
@@ -13169,12 +13690,12 @@ function RegistrationAddressComponent(props) {
13169
13690
  items: operationalAddressIsSameItems,
13170
13691
  value: formData.operationalAddressIsSame,
13171
13692
  disabled: formUtils.isReadOnly("operationalAddressIsSame"),
13172
- onChange: handleChangeFor("operationalAddressIsSame"),
13693
+ onChange: handleOperationalAddressIsSameChange,
13173
13694
  "aria-required": true,
13174
13695
  "aria-label": formUtils.getLabel("operationalAddressIsSame"),
13175
13696
  "aria-invalid": !formValid.operationalAddressIsSame
13176
13697
  })
13177
- }), isOperationAddressNotSame() && createElement(Address, {
13698
+ }), isOperationAddressNotSame() && createElement(AddressExperimentWrapper, {
13178
13699
  ...operationalAddressFormProps,
13179
13700
  key: "operationalAddress",
13180
13701
  data: {
@@ -13183,9 +13704,11 @@ function RegistrationAddressComponent(props) {
13183
13704
  },
13184
13705
  hideCountry: true,
13185
13706
  id,
13707
+ optionalFields: ["otherAddressInformation"],
13186
13708
  addressType: "operationalAddress",
13187
13709
  handleAddressSearch,
13188
- handleFindAddress
13710
+ handleFindAddress,
13711
+ onChange: handleOperationalAddressChange
13189
13712
  })]
13190
13713
  });
13191
13714
  }
@@ -13865,9 +14388,18 @@ const rules$2 = ({
13865
14388
  }
13866
14389
  },
13867
14390
  countryRequiresRegistrationNumberForCompanies: () => {
14391
+ var _a, _b;
13868
14392
  if (COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER.includes(country)) {
13869
14393
  return "OPTIONAL";
13870
14394
  }
14395
+ if (isExperimentEnabled("EnableAUGovernmentalOrganizationSkipRegistrationNumber") && country === CountryCodes.Australia) {
14396
+ if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION) {
14397
+ return;
14398
+ }
14399
+ if ("companyStructure" in data && ((_b = data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION) {
14400
+ return;
14401
+ }
14402
+ }
13871
14403
  if (!COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION.includes(country)) {
13872
14404
  return "REQUIRED";
13873
14405
  }
@@ -15090,21 +15622,13 @@ const useIdVerificationToken = ({
15090
15622
  loadingStatus
15091
15623
  };
15092
15624
  };
15093
- const styles$3 = {
15094
- "adyen-kyc-loading-input__form": "adyen-kyc-loading-input__form",
15095
- "adyen-kyc-loading-input__form--loading-opacity0": "adyen-kyc-loading-input__form--loading-opacity0",
15096
- "adyen-kyc-loading-input__form--loading-opacity0-1": "adyen-kyc-loading-input__form--loading-opacity0-1",
15097
- "adyen-kyc-loading-input__form--loading-opacity0-2": "adyen-kyc-loading-input__form--loading-opacity0-2",
15098
- "adyen-kyc-loading-input__form--loading-opacity0-3": "adyen-kyc-loading-input__form--loading-opacity0-3",
15099
- "adyen-kyc-loading-input__form--loading-opacity0-4": "adyen-kyc-loading-input__form--loading-opacity0-4",
15100
- "adyen-kyc-loading-input__form--loading-opacity0-5": "adyen-kyc-loading-input__form--loading-opacity0-5",
15101
- "adyen-kyc-loading-input__form--loading-opacity0-6": "adyen-kyc-loading-input__form--loading-opacity0-6",
15102
- "adyen-kyc-loading-input__form--loading-opacity0-7": "adyen-kyc-loading-input__form--loading-opacity0-7",
15103
- "adyen-kyc-loading-input__form--loading-opacity0-8": "adyen-kyc-loading-input__form--loading-opacity0-8",
15104
- "adyen-kyc-loading-input__form--loading-opacity0-9": "adyen-kyc-loading-input__form--loading-opacity0-9",
15105
- "adyen-kyc-loading-input__form--loading-opacity1": "adyen-kyc-loading-input__form--loading-opacity1",
15106
- "adyen-kyc-loading-input__loader": "adyen-kyc-loading-input__loader",
15107
- "adyen-kyc-loading-input__loader--active": "adyen-kyc-loading-input__loader--active"
15625
+ const loaderWrapperLoader = "adyen-kyc-loader-wrapper-loader";
15626
+ const loaderWrapperLoaderActive = "adyen-kyc-loader-wrapper-loader-active";
15627
+ const styles$4 = {
15628
+ "loader-wrapper-loader": "adyen-kyc-loader-wrapper-loader",
15629
+ loaderWrapperLoader,
15630
+ "loader-wrapper-loader-active": "adyen-kyc-loader-wrapper-loader-active",
15631
+ loaderWrapperLoaderActive
15108
15632
  };
15109
15633
  const LoaderWrapper = ({
15110
15634
  children,
@@ -15114,18 +15638,15 @@ const LoaderWrapper = ({
15114
15638
  showSpinner = true,
15115
15639
  className
15116
15640
  }) => {
15117
- const formOpacityStrArr = `${formOpacityWhenLoading}`.split(".");
15118
- const digit = formOpacityStrArr[0];
15119
- const decimal = formOpacityStrArr[1];
15120
- const opacity = decimal ? `${digit}-${decimal}` : `${digit}`;
15121
- const wrapperClass = cx("adyen-kyc-loading-input__form", styles$3["adyen-kyc-loading-input__form"], {
15122
- [styles$3[`adyen-kyc-loading-input__form--loading-opacity${opacity}`]]: status === "loading"
15123
- });
15124
- const loaderWrapperClass = cx({
15125
- [styles$3["adyen-kyc-loading-input__loader"]]: true,
15126
- [styles$3["adyen-kyc-loading-input__loader--active"]]: status === "loading" && showSpinner
15127
- });
15128
- const overlayClass = cx("adyen-kyc-loading-input", className);
15641
+ const opacitySyle = status === "loading" ? {
15642
+ opacity: formOpacityWhenLoading
15643
+ } : {
15644
+ opacity: 1
15645
+ };
15646
+ const loaderWrapperClass = cx(styles$4.loaderWrapperLoader, {
15647
+ [styles$4.loaderWrapperLoaderActive]: status === "loading" && showSpinner
15648
+ });
15649
+ const overlayClass = cx(styles$4.loaderWrapper, className);
15129
15650
  return jsxs("div", {
15130
15651
  className: overlayClass,
15131
15652
  style: {
@@ -15137,7 +15658,8 @@ const LoaderWrapper = ({
15137
15658
  size: loaderSize
15138
15659
  })
15139
15660
  }), jsx("div", {
15140
- className: wrapperClass,
15661
+ className: styles$4.loaderWrapperForm,
15662
+ style: opacitySyle,
15141
15663
  children
15142
15664
  })]
15143
15665
  });
@@ -16638,19 +17160,13 @@ const handleKeys = (keys, callback, propagationMode = "stopIfMatches") => (event
16638
17160
  callback();
16639
17161
  }
16640
17162
  };
16641
- const styles$2 = {
16642
- "adyen-kyc-multi-select-list": "adyen-kyc-multi-select-list",
16643
- "adyen-kyc-multi-select-list-item": "adyen-kyc-multi-select-list-item",
16644
- "adyen-kyc-multi-select-list-item--with-description": "adyen-kyc-multi-select-list-item--with-description",
16645
- "adyen-kyc-checkbox__label": "adyen-kyc-checkbox__label"
16646
- };
16647
17163
  const MultiSelectList = ({
16648
17164
  options,
16649
17165
  selected,
16650
17166
  onSelect,
16651
17167
  mapToSelectItem
16652
17168
  }) => jsx("ul", {
16653
- className: styles$2["adyen-kyc-multi-select-list"],
17169
+ className: "adyen-kyc-multi-select-list",
16654
17170
  children: options.map((option) => {
16655
17171
  const item = mapToSelectItem(option);
16656
17172
  const isSelected = selected.includes(option);
@@ -16664,8 +17180,8 @@ const MultiSelectList = ({
16664
17180
  onKeyDown: handleKeys(["Enter", " "], handleSelect),
16665
17181
  onSelect: handleSelect,
16666
17182
  isMulti: true,
16667
- className: cx([styles$2["adyen-kyc-multi-select-list-item"], {
16668
- [styles$2["adyen-kyc-multi-select-list-item--with-description"]]: !!item.description
17183
+ className: cx(["adyen-kyc-multi-select-list-item", {
17184
+ "adyen-kyc-multi-select-list-item--with-description": !!item.description
16669
17185
  }])
16670
17186
  }, item.id);
16671
17187
  })
@@ -16686,7 +17202,7 @@ const DecisionMakerRoleComponent = (props) => {
16686
17202
  fieldValidationErrors,
16687
17203
  requiredFields,
16688
17204
  allowedRoles,
16689
- trustedRoles
17205
+ trustedRoles = []
16690
17206
  } = props;
16691
17207
  const {
16692
17208
  i18n
@@ -16744,7 +17260,7 @@ const DecisionMakerRoleComponent = (props) => {
16744
17260
  onSelect: changeRoles,
16745
17261
  mapToSelectItem: (role) => ({
16746
17262
  ...makeSelectItemForRole(role, i18n),
16747
- disabled: allowedRoles ? !(allowedRoles == null ? void 0 : allowedRoles.includes(role)) : trustedRoles.includes(role)
17263
+ disabled: allowedRoles && !allowedRoles.includes(role) || trustedRoles.includes(role)
16748
17264
  })
16749
17265
  })
16750
17266
  })]
@@ -17626,8 +18142,9 @@ const relationshipOptions = [{
17626
18142
  id: "guardian",
17627
18143
  name: "guardian"
17628
18144
  }];
18145
+ const countriesRequiringNationality = [CountryCodes.HongKong, CountryCodes.Singapore];
17629
18146
  function PersonalDetailsComponent(props) {
17630
- var _a;
18147
+ var _a, _b, _c, _d;
17631
18148
  const {
17632
18149
  i18n
17633
18150
  } = useI18nContext();
@@ -17658,6 +18175,7 @@ function PersonalDetailsComponent(props) {
17658
18175
  const isDecisionMakerTask = props.taskType === TaskTypes.DECISION_MAKER || props.taskType === TaskTypes.TRUST_MEMBER_COMPANY_OWNER;
17659
18176
  const isTopLevelEntity = props.taskType === TaskTypes.INDIVIDUAL;
17660
18177
  const isLegalRepresentativeDetailsTask = props.taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
18178
+ const countryRequiringNationality = ((_c = (_b = props.parentLegalEntity) == null ? void 0 : _b.organization) == null ? void 0 : _c.registeredAddress.country) || ((_d = props.data) == null ? void 0 : _d.residencyCountry);
17661
18179
  const requiredFieldsByTask = (props.requiredFields || personalDetailsFields).filter((field) => !isNewEntryFlowEnabled && (field !== "role" || field === "role" && isDecisionMakerTask) || isNewEntryFlowEnabled && (field !== "role" && field !== "accountHolder" || field === "role" && isDecisionMakerTask) || field === "relationship" && isLegalRepresentativeDetailsTask);
17662
18180
  const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
17663
18181
  const getDirectChildFields = () => requiredFieldsByTask.filter((field) => ["birthDate", "residencyCountry", "jobTitle", "nationality", "relationship"].includes(field));
@@ -17749,9 +18267,9 @@ function PersonalDetailsComponent(props) {
17749
18267
  currentState,
17750
18268
  changeInitiatedBy
17751
18269
  }) => {
17752
- var _a2, _b;
18270
+ var _a2, _b2;
17753
18271
  if (changeInitiatedBy === PERSONAL_DETAILS) {
17754
- if (!((_b = (_a2 = currentState.errors) == null ? void 0 : _a2[PERSONAL_DETAILS]) == null ? void 0 : _b.idNumber) && (externalErrors == null ? void 0 : externalErrors.idNumber)) {
18272
+ if (!((_b2 = (_a2 = currentState.errors) == null ? void 0 : _a2[PERSONAL_DETAILS]) == null ? void 0 : _b2.idNumber) && (externalErrors == null ? void 0 : externalErrors.idNumber)) {
17755
18273
  delete externalErrors.idNumber;
17756
18274
  }
17757
18275
  this.isValid = currentState.validityByForm[PERSONAL_DETAILS];
@@ -17927,7 +18445,7 @@ function PersonalDetailsComponent(props) {
17927
18445
  country: data.residencyCountry,
17928
18446
  errors: externalErrors,
17929
18447
  idNumberType
17930
- }), (data.residencyCountry === "SG" || data.residencyCountry === "HK") && formUtils.isRequiredField("nationality") && jsx(CountryField, {
18448
+ }), countriesRequiringNationality.includes(countryRequiringNationality) && formUtils.isRequiredField("nationality") && jsx(CountryField, {
17931
18449
  data: {
17932
18450
  country: data.nationality
17933
18451
  },
@@ -18185,7 +18703,7 @@ const proofOfNationalIdFormID = individualForms.proofOfNationalId.formId;
18185
18703
  const proofOfRelationshipFormID = individualForms.proofOfRelationship.formId;
18186
18704
  const individualDocumentForms = [idVerificationMethodFormID, idDocumentFormID, proofOfResidencyFormID, proofOfNationalIdFormID, proofOfRelationshipFormID];
18187
18705
  function IndividualComponent(props) {
18188
- var _a, _b, _c, _d, _e, _f, _g, _h;
18706
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
18189
18707
  const {
18190
18708
  i18n
18191
18709
  } = useI18nContext();
@@ -18228,7 +18746,7 @@ function IndividualComponent(props) {
18228
18746
  currentState,
18229
18747
  prevState
18230
18748
  }) => {
18231
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i, _j;
18749
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j;
18232
18750
  const residencyCountryPrev = (_b2 = (_a2 = prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
18233
18751
  const residencyCountry = (_d2 = (_c2 = currentState.data) == null ? void 0 : _c2.personalDetails) == null ? void 0 : _d2.residencyCountry;
18234
18752
  if (residencyCountry != null && residencyCountry !== residencyCountryPrev) {
@@ -18239,13 +18757,18 @@ function IndividualComponent(props) {
18239
18757
  if (idVerificationMethod != null && idVerificationMethod !== idVerificationMethodPrev) {
18240
18758
  setIdVerificationMethodSelected(idVerificationMethod);
18241
18759
  }
18242
- const accountHolder = (_j = (_i = currentState.data) == null ? void 0 : _i.personalDetails) == null ? void 0 : _j.accountHolder;
18760
+ const accountHolder = (_j = (_i2 = currentState.data) == null ? void 0 : _i2.personalDetails) == null ? void 0 : _j.accountHolder;
18243
18761
  this.customNavigationHandler = accountHolder === "theCompanyIWorkFor" ? () => {
18244
18762
  var _a3;
18245
18763
  return (_a3 = props.onTypeSwitch) == null ? void 0 : _a3.call(props, LegalEntityType.ORGANIZATION);
18246
18764
  } : null;
18247
18765
  setData(currentState.data);
18248
18766
  };
18767
+ const handleAddressChange = (addressData) => {
18768
+ updateStateSlice({
18769
+ ...addressData
18770
+ });
18771
+ };
18249
18772
  useEffect(() => {
18250
18773
  var _a2, _b2, _c2;
18251
18774
  const isIdDocumentFormActive = props.activeForm.formId === idDocumentFormID;
@@ -18253,8 +18776,18 @@ function IndividualComponent(props) {
18253
18776
  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);
18254
18777
  props.setHideFooter(isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled);
18255
18778
  }, [props.activeForm, idVerificationMethodSelected, props.handleGetIdVerificationToken, (_f = data == null ? void 0 : data.idDocument) == null ? void 0 : _f.instantIdVerificationData, (_h = (_g = props.data) == null ? void 0 : _g.idDocument) == null ? void 0 : _h.idDocumentType]);
18256
- const renderActiveForm = (activeForm) => {
18779
+ const addressSchema = getAddressSchemaForCountry((_i = data == null ? void 0 : data.personalDetails) == null ? void 0 : _i.residencyCountry).filter((field) => {
18257
18780
  var _a2;
18781
+ if (!COUNTRIES_WITH_STATES_DATASET.includes((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry)) {
18782
+ return field !== "otherAddressInformation" && field !== "stateOrProvince";
18783
+ }
18784
+ return field !== "otherAddressInformation";
18785
+ });
18786
+ const {
18787
+ updateStateSlice
18788
+ } = useGlobalDataSlice("address");
18789
+ const renderActiveForm = (activeForm) => {
18790
+ var _a2, _b2;
18258
18791
  return jsxs(Fragment, {
18259
18792
  children: [jsx(StateContextWatcher, {
18260
18793
  owner: "IndividualComponent",
@@ -18291,17 +18824,20 @@ function IndividualComponent(props) {
18291
18824
  content: i18n.get("reasonForFillingIndividualAddressDetails"),
18292
18825
  titleId: "whyDoINeedToFillInThisInformation",
18293
18826
  contentId: "reasonForFillingIndividualAddressDetails"
18294
- }), jsx(Address, {
18827
+ }), jsx(AddressExperimentWrapper, {
18295
18828
  ...addressFormProps,
18829
+ id: addressFormID,
18296
18830
  data: {
18297
- ...addressFormProps.data,
18298
- country: props.country
18831
+ ...data.address,
18832
+ country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry
18299
18833
  },
18300
- hideCountry: true,
18301
- id: addressFormID,
18834
+ requiredFields: addressSchema,
18835
+ optionalFields: ["otherAddressInformation"],
18302
18836
  legalEntityId: props.legalEntityId,
18303
18837
  handleAddressSearch: props.handleAddressSearch,
18304
- handleFindAddress: props.handleFindAddress
18838
+ handleFindAddress: props.handleFindAddress,
18839
+ onChange: handleAddressChange,
18840
+ hideCountry: true
18305
18841
  })]
18306
18842
  })
18307
18843
  }), !!props.handleGetIdVerificationToken && jsx("div", {
@@ -18310,7 +18846,7 @@ function IndividualComponent(props) {
18310
18846
  ...idVerificationMethodFormProps,
18311
18847
  name: fullName,
18312
18848
  id: idVerificationMethodFormID,
18313
- countryOfResidence: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry
18849
+ countryOfResidence: (_b2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b2.residencyCountry
18314
18850
  })
18315
18851
  }), jsx("div", {
18316
18852
  className: activeForm.formId !== idDocumentFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -19641,7 +20177,8 @@ function InstantBankVerification({
19641
20177
  case "GENERIC_ERROR":
19642
20178
  errorTitle = i18n.get("ranIntoTechnicalError");
19643
20179
  break;
19644
- case "UNKNOWN_ERROR": {
20180
+ case "UNKNOWN_ERROR":
20181
+ default: {
19645
20182
  errorTitle = i18n.get("couldNotCompleteAccountCheck");
19646
20183
  break;
19647
20184
  }
@@ -19812,6 +20349,7 @@ const payoutCurrencySupport = {
19812
20349
  iban: [Currencies.CAD, Currencies.USD]
19813
20350
  }
19814
20351
  };
20352
+ const shouldShowCheckGuidance = (country) => country === "US";
19815
20353
  const shouldShowPayoutAccountFormatSelector = (country) => countriesWithLocalFormat.has(country);
19816
20354
  const shouldShowPayoutAlert = (country) => shouldShowPayoutAccountFormatSelector(country) || countriesWithMultipleCurrencies.has(country);
19817
20355
  const getSupportedCurrencyGuidance = (i18n, country, requiredFields) => {
@@ -19963,7 +20501,9 @@ function BankAccountNumber(props) {
19963
20501
  } = useI18nContext();
19964
20502
  const {
19965
20503
  country,
19966
- fieldConfig = defaultFieldConfig$4
20504
+ fieldConfig = defaultFieldConfig$4,
20505
+ onFocus,
20506
+ onBlur
19967
20507
  } = props;
19968
20508
  const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$4);
19969
20509
  const mergedProps = mergeFieldMetadataIntoProps("bankAccountNumber", metadata, props);
@@ -19981,6 +20521,10 @@ function BankAccountNumber(props) {
19981
20521
  fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors,
19982
20522
  obscuredFields: mergedProps.obscuredFields
19983
20523
  });
20524
+ const handleBlur = () => {
20525
+ onBlur == null ? void 0 : onBlur();
20526
+ handleChangeFor("bankAccountNumber", "blur");
20527
+ };
19984
20528
  const {
19985
20529
  updateStateSlice
19986
20530
  } = useGlobalDataSlice("payoutAccountDetails", "bankAccountNumber");
@@ -20007,8 +20551,9 @@ function BankAccountNumber(props) {
20007
20551
  field: ["bankAccountNumber"],
20008
20552
  input: ["bankAccountNumber"]
20009
20553
  },
20010
- onBlur: handleChangeFor("bankAccountNumber", "blur"),
20554
+ onBlur: handleBlur,
20011
20555
  onInput: handleChangeFor("bankAccountNumber", "input"),
20556
+ onFocus,
20012
20557
  readonly: formUtils.isReadOnly("bankAccountNumber"),
20013
20558
  value: data.bankAccountNumber ?? "",
20014
20559
  acceptObscuredValue: formUtils.isObscured("bankAccountNumber")
@@ -20265,7 +20810,7 @@ const defaultFieldConfig$2 = {
20265
20810
  }
20266
20811
  },
20267
20812
  [CountryCodes.UnitedStates]: {
20268
- label: "achRoutingNumber",
20813
+ label: "routingNumber",
20269
20814
  validators: validatePatternOnBlur(/^\d{9}$/),
20270
20815
  mask: {
20271
20816
  mask: makeMask(...numericInputs(9))
@@ -20308,7 +20853,9 @@ function BranchCode(props) {
20308
20853
  } = useI18nContext();
20309
20854
  const {
20310
20855
  country,
20311
- fieldConfig = defaultFieldConfig$2
20856
+ fieldConfig = defaultFieldConfig$2,
20857
+ onFocus,
20858
+ onBlur
20312
20859
  } = props;
20313
20860
  const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$2);
20314
20861
  const mergedProps = mergeFieldMetadataIntoProps("branchCode", metadata, props);
@@ -20328,6 +20875,10 @@ function BranchCode(props) {
20328
20875
  const {
20329
20876
  updateStateSlice
20330
20877
  } = useGlobalDataSlice("payoutAccountDetails", "branchCode");
20878
+ const handleBlur = () => {
20879
+ onBlur == null ? void 0 : onBlur();
20880
+ handleChangeFor("branchCode", "blur");
20881
+ };
20331
20882
  useEffect(() => {
20332
20883
  updateStateSlice({
20333
20884
  data,
@@ -20351,7 +20902,8 @@ function BranchCode(props) {
20351
20902
  value: data.branchCode ?? "",
20352
20903
  readonly: formUtils.isReadOnly("branchCode"),
20353
20904
  onInput: handleChangeFor("branchCode", "input"),
20354
- onBlur: handleChangeFor("branchCode", "blur"),
20905
+ onBlur: handleBlur,
20906
+ onFocus,
20355
20907
  "aria-required": true,
20356
20908
  "aria-label": formUtils.getLabel("branchCode"),
20357
20909
  "aria-invalid": !valid.branchCode
@@ -20689,6 +21241,28 @@ function SwiftCode(props) {
20689
21241
  "aria-invalid": !valid.swiftCode
20690
21242
  });
20691
21243
  }
21244
+ const CheckGuidance = ({
21245
+ annotated
21246
+ }) => jsxs("div", {
21247
+ className: "adyen-kyc-check-guidance",
21248
+ children: [jsx(Svg, {
21249
+ type: "image",
21250
+ name: "us-check-account-number",
21251
+ className: cx("adyen-kyc-check-guidance__image", "adyen-kyc-check-guidance__image--annotated", {
21252
+ "adyen-kyc-check-guidance__image--inactive": annotated !== "account"
21253
+ })
21254
+ }), jsx(Svg, {
21255
+ type: "image",
21256
+ name: "us-check-routing-number",
21257
+ className: cx("adyen-kyc-check-guidance__image", "adyen-kyc-check-guidance__image--annotated", {
21258
+ "adyen-kyc-check-guidance__image--inactive": annotated !== "routing"
21259
+ })
21260
+ }), jsx(Svg, {
21261
+ name: "us-check",
21262
+ type: "image",
21263
+ className: "adyen-kyc-check-guidance__image"
21264
+ })]
21265
+ });
20692
21266
  const payoutAccountFields = ["accountHolder", ...ibanFields, ...branchCodeFields, ...swiftCodeFields, ...currencyFields, ...bankAccountNumberFields, ...bankNameFields, ...bankCodeFields];
20693
21267
  function PayoutAccountComponent(props) {
20694
21268
  const {
@@ -20699,11 +21273,13 @@ function PayoutAccountComponent(props) {
20699
21273
  const {
20700
21274
  i18n
20701
21275
  } = useI18nContext();
21276
+ const [checkAnnotation, setCheckAnnotation] = useState();
20702
21277
  const {
20703
21278
  isSettingEnabled
20704
21279
  } = useSettingsContext();
20705
21280
  const bankAccountFormatSelectionAllowed = isSettingEnabled(SettingNames.AllowBankAccountFormatSelection);
20706
21281
  const {
21282
+ heading,
20707
21283
  country,
20708
21284
  id,
20709
21285
  legalEntityResponse,
@@ -20711,6 +21287,7 @@ function PayoutAccountComponent(props) {
20711
21287
  arePayoutAccountDetailsInvalid,
20712
21288
  invalidFieldNames
20713
21289
  } = props;
21290
+ const showCheckGuidance = shouldShowCheckGuidance(country);
20714
21291
  const {
20715
21292
  data,
20716
21293
  valid,
@@ -20753,19 +21330,15 @@ function PayoutAccountComponent(props) {
20753
21330
  className: "adyen-kyc-individual__payout-account",
20754
21331
  "aria-describedby": "ariaErrorField",
20755
21332
  children: [jsx(FormHeader, {
20756
- heading: props.heading
21333
+ heading
20757
21334
  }), jsx(ErrorPanel, {
20758
21335
  verificationErrors: props == null ? void 0 : props.formVerificationErrors,
20759
21336
  validationErrors: props == null ? void 0 : props.fieldValidationErrors,
20760
21337
  formUtils,
20761
21338
  id: "ariaErrorField"
20762
- }), jsx(ContextGuidance, {
20763
- page: "Payout account details",
20764
- titleId: "whyDoINeedToFillInThisInformation",
20765
- contentId: "reasonForFillingPayoutDetails",
20766
- title: i18n.get("whyDoINeedToFillInThisInformation"),
20767
- content: i18n.get("reasonForFillingPayoutDetails")
20768
- }), formUtils.isRequiredField("accountHolder") && jsx(Field, {
21339
+ }), showCheckGuidance ? jsx(CheckGuidance, {
21340
+ annotated: checkAnnotation
21341
+ }) : void 0, formUtils.isRequiredField("accountHolder") && jsx(Field, {
20769
21342
  name: "accountHolder",
20770
21343
  label: formUtils.getLabel("accountHolder"),
20771
21344
  helper: i18n.get(accountHolderDescriptionKey),
@@ -20789,7 +21362,9 @@ function PayoutAccountComponent(props) {
20789
21362
  }), formUtils.isRequiredField("bankAccountNumber") && jsx(BankAccountNumber, {
20790
21363
  ...bankAccountNumberProps,
20791
21364
  country,
20792
- dataStoreId: id
21365
+ dataStoreId: id,
21366
+ onFocus: showCheckGuidance ? () => setCheckAnnotation("account") : void 0,
21367
+ onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
20793
21368
  }), formUtils.isRequiredField("iban") && jsx(Iban, {
20794
21369
  ...ibanProps,
20795
21370
  dataStoreId: id,
@@ -20807,12 +21382,18 @@ function PayoutAccountComponent(props) {
20807
21382
  }), formUtils.isRequiredField("branchCode") && jsx(BranchCode, {
20808
21383
  ...branchCodeProps,
20809
21384
  country,
20810
- dataStoreId: id
21385
+ dataStoreId: id,
21386
+ onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
21387
+ onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
20811
21388
  }), formUtils.isRequiredField("bankCity") && jsx(BankCity, {
20812
21389
  ...bankCityProps,
20813
21390
  dataStoreId: id
20814
21391
  }), shouldShowPayoutAlert(country) && jsx(Alert, {
20815
21392
  title: getSupportedCurrencyGuidance(i18n, country, requiredFields)
21393
+ }), jsx(Typography, {
21394
+ variant: "caption",
21395
+ color: "tertiary",
21396
+ children: i18n.get("reasonForFillingPayoutDetails")
20816
21397
  }), arePayoutAccountDetailsInvalid && jsx(Alert, {
20817
21398
  className: "adyen-kyc-u-margin-top-16",
20818
21399
  variant: "error",
@@ -24254,12 +24835,42 @@ const dbaNameFieldMetadata = {
24254
24835
  label: "dbaName",
24255
24836
  validators: [validateNotEmptyOnBlur]
24256
24837
  };
24257
- const styles$1 = {
24258
- "adyen-kyc-structured-list": "adyen-kyc-structured-list",
24259
- "adyen-kyc-structured-list__list-item": "adyen-kyc-structured-list__list-item",
24838
+ const mapAddressData = (verifiedBusiness) => ({
24839
+ address: verifiedBusiness.street ?? "",
24840
+ otherAddressInformation: verifiedBusiness.street2 ?? "",
24841
+ city: verifiedBusiness.city ?? "",
24842
+ postalCode: verifiedBusiness.zipcode ?? "",
24843
+ stateOrProvince: verifiedBusiness.state ?? ""
24844
+ });
24845
+ const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
24846
+ if (!verifiedBusiness) return;
24847
+ entriesOf(verifiedBusiness).forEach(([key, value]) => {
24848
+ switch (key) {
24849
+ case "name":
24850
+ if (value) handleChangeFor("legalCompanyName", "input")(value);
24851
+ break;
24852
+ case "isPrincipalAddress":
24853
+ if (value) handleChangeFor("operationalAddressIsSame", "input")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
24854
+ break;
24855
+ }
24856
+ });
24857
+ };
24858
+ const structuredList = "adyen-kyc-structured-list";
24859
+ const structuredListListItem = "adyen-kyc-structured-list-list-item";
24860
+ const adyenLayoutMd = "adyen-layout-md";
24861
+ const structuredListLabel = "adyen-kyc-structured-list-label";
24862
+ const structuredListValue = "adyen-kyc-structured-list-value";
24863
+ const styles$3 = {
24864
+ "structured-list": "adyen-kyc-structured-list",
24865
+ structuredList,
24866
+ "structured-list-list-item": "adyen-kyc-structured-list-list-item",
24867
+ structuredListListItem,
24260
24868
  "adyen-layout-md": "adyen-layout-md",
24261
- "adyen-kyc-structured-list__label": "adyen-kyc-structured-list__label",
24262
- "adyen-kyc-structured-list__value": "adyen-kyc-structured-list__value"
24869
+ adyenLayoutMd,
24870
+ "structured-list-label": "adyen-kyc-structured-list-label",
24871
+ structuredListLabel,
24872
+ "structured-list-value": "adyen-kyc-structured-list-value",
24873
+ structuredListValue
24263
24874
  };
24264
24875
  const StructuredList = ({
24265
24876
  items
@@ -24268,28 +24879,29 @@ const StructuredList = ({
24268
24879
  i18n
24269
24880
  } = useI18nContext();
24270
24881
  return jsx("dl", {
24271
- className: styles$1["adyen-kyc-structured-list"],
24882
+ className: styles$3.structuredList,
24272
24883
  children: items.map((item) => jsxs("div", {
24273
- className: styles$1["adyen-kyc-structured-list__list-item"],
24884
+ className: styles$3.structuredListListItem,
24274
24885
  children: [jsx("dt", {
24275
- className: styles$1["adyen-kyc-structured-list__label"],
24886
+ className: styles$3.structuredListLabel,
24276
24887
  children: i18n.get(item.labelKey)
24277
24888
  }), jsx("dd", {
24278
- className: styles$1["adyen-kyc-structured-list__value"],
24889
+ className: styles$3.structuredListValue,
24279
24890
  children: item.value
24280
24891
  })]
24281
24892
  }, item.labelKey))
24282
24893
  });
24283
24894
  };
24284
24895
  function VerifiedBusinessCard({
24285
- verifiedBusiness
24896
+ verifiedBusiness,
24897
+ verifiedAddress
24286
24898
  }) {
24287
24899
  const {
24288
24900
  i18n
24289
24901
  } = useI18nContext();
24290
24902
  const [expanded, setExpanded] = useState(false);
24291
- const address = (verifiedBusiness == null ? void 0 : verifiedBusiness.street) && (verifiedBusiness == null ? void 0 : verifiedBusiness.city) && (verifiedBusiness == null ? void 0 : verifiedBusiness.state) && (verifiedBusiness == null ? void 0 : verifiedBusiness.zipcode) ? `${verifiedBusiness == null ? void 0 : verifiedBusiness.street} ${verifiedBusiness.city} ${verifiedBusiness.state} ${verifiedBusiness.zipcode}` : verifiedBusiness == null ? void 0 : verifiedBusiness.address;
24292
- const addressLink = (verifiedBusiness == null ? void 0 : verifiedBusiness.address) ? `https://www.google.com/maps/place/${verifiedBusiness == null ? void 0 : verifiedBusiness.address.replaceAll(" ", "+")}` : void 0;
24903
+ const address = (verifiedAddress == null ? void 0 : verifiedAddress.address) && (verifiedAddress == null ? void 0 : verifiedAddress.city) && (verifiedAddress == null ? void 0 : verifiedAddress.stateOrProvince) && (verifiedAddress == null ? void 0 : verifiedAddress.postalCode) ? `${verifiedAddress == null ? void 0 : verifiedAddress.address} ${verifiedAddress.city} ${verifiedAddress.stateOrProvince} ${verifiedAddress.postalCode}` : verifiedBusiness == null ? void 0 : verifiedBusiness.address;
24904
+ const addressLink = address ? `https://www.google.com/maps/place/${address.replaceAll(" ", "+")}` : void 0;
24293
24905
  const baseItems = useMemo(() => [{
24294
24906
  labelKey: "legalCompanyName__US",
24295
24907
  value: verifiedBusiness == null ? void 0 : verifiedBusiness.name
@@ -24302,7 +24914,7 @@ function VerifiedBusinessCard({
24302
24914
  value: verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm
24303
24915
  }, {
24304
24916
  labelKey: "address",
24305
- value: jsxs("div", {
24917
+ value: jsxs("span", {
24306
24918
  className: "adyen-kyc-verified-business-card__address",
24307
24919
  children: [address, addressLink && jsx(Link, {
24308
24920
  external: true,
@@ -24311,24 +24923,30 @@ function VerifiedBusinessCard({
24311
24923
  })]
24312
24924
  })
24313
24925
  }].filter((item) => !!item.value), [address, addressLink, i18n, verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm]);
24314
- return jsx("section", {
24315
- children: jsxs("div", {
24316
- className: "adyen-kyc-verified-business-card",
24926
+ const expandedContentClasses = cx("adyen-kyc-verified-business-card__content", {
24927
+ "adyen-kyc-verified-business-card__content--collapsed": !expanded,
24928
+ "adyen-kyc-verified-business-card__content--expanded": expanded
24929
+ });
24930
+ return jsxs("section", {
24931
+ className: "adyen-kyc-verified-business-card",
24932
+ children: [jsxs("div", {
24933
+ className: "adyen-kyc-verified-business-card__content",
24317
24934
  children: [jsx(StructuredList, {
24318
24935
  items: baseItems
24319
- }), jsx(Divider, {}), expanded && jsxs(Fragment, {
24320
- children: [jsx(StructuredList, {
24321
- items: expandedItems
24322
- }), jsx(Divider, {})]
24323
- }), jsx("div", {
24324
- className: "adyen-kyc-verified-business-card__button",
24325
- children: jsx(Button, {
24326
- label: expanded ? i18n.get("hideDetails") : i18n.get("showDetails"),
24327
- showAsLink: true,
24328
- onClick: () => setExpanded(!expanded)
24329
- })
24330
- })]
24331
- })
24936
+ }), jsx(Divider, {})]
24937
+ }), jsxs("div", {
24938
+ className: expandedContentClasses,
24939
+ children: [jsx(StructuredList, {
24940
+ items: expandedItems
24941
+ }), jsx(Divider, {})]
24942
+ }), jsx("div", {
24943
+ className: "adyen-kyc-verified-business-card__expand-button",
24944
+ children: jsx(Button, {
24945
+ label: expanded ? i18n.get("hideDetails") : i18n.get("showDetails"),
24946
+ showAsLink: true,
24947
+ onClick: () => setExpanded(!expanded)
24948
+ })
24949
+ })]
24332
24950
  });
24333
24951
  }
24334
24952
  const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
@@ -24358,20 +24976,21 @@ function AdditionalInformationComponent({
24358
24976
  handleFindAddress
24359
24977
  }) {
24360
24978
  var _a, _b, _c, _d;
24979
+ const {
24980
+ basicInformation
24981
+ } = useGlobalData();
24361
24982
  const {
24362
24983
  updateStateSlice
24363
24984
  } = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
24364
24985
  const {
24365
24986
  i18n
24366
24987
  } = useI18nContext();
24988
+ const {
24989
+ isExperimentEnabled
24990
+ } = useExperimentsContext();
24367
24991
  const showVerified = !!verifiedBusiness;
24368
24992
  const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
24369
- const ADDRESS_SCHEMA2 = getAddressSchemaForCountry(country).filter((field) => {
24370
- if (!COUNTRIES_WITH_STATES_DATASET.includes(country)) {
24371
- return field !== "otherAddressInformation" && field !== "stateOrProvince";
24372
- }
24373
- return field !== "otherAddressInformation";
24374
- });
24993
+ const addressSchema = getAddressSchemaForCountry(country).filter((field) => !COUNTRIES_WITH_STATES_DATASET.includes(country) ? field !== "stateOrProvince" : true);
24375
24994
  const initialFormUtilsProps = useMemo(() => ({
24376
24995
  data,
24377
24996
  labels: labels2,
@@ -24503,10 +25122,30 @@ function AdditionalInformationComponent({
24503
25122
  valid: formValid,
24504
25123
  fieldProblems: formFieldProblems
24505
25124
  });
24506
- }, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
24507
- useEffect(() => {
24508
- if (verifiedBusiness && verifiedBusiness.name !== formData.legalCompanyName) return handleChangeFor("legalCompanyName")(verifiedBusiness.name);
24509
- }, [formData.legalCompanyName, verifiedBusiness, showCompanyStructure]);
25125
+ }, [formSchema, formData, formErrors, formValid, formFieldProblems]);
25126
+ const verifiedAddress = useMemo(() => {
25127
+ if (!verifiedBusiness) return void 0;
25128
+ return verifiedBusiness.isPrincipalAddress || verifiedBusiness.state && (basicInformation == null ? void 0 : basicInformation.stateOrProvince) !== verifiedBusiness.state ? {
25129
+ operationalAddress: {
25130
+ ...mapAddressData(verifiedBusiness),
25131
+ country
25132
+ }
25133
+ } : {
25134
+ registrationAddress: {
25135
+ ...mapAddressData(verifiedBusiness),
25136
+ country
25137
+ }
25138
+ };
25139
+ }, [verifiedBusiness, basicInformation == null ? void 0 : basicInformation.stateOrProvince, country]);
25140
+ const hideRegistrationAddress = useMemo(() => addressSchema.filter((field) => field !== "otherAddressInformation").every((field) => {
25141
+ var _a2;
25142
+ return !!((_a2 = verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress) == null ? void 0 : _a2[field]);
25143
+ }) && Boolean(verifiedBusiness == null ? void 0 : verifiedBusiness.isTrustedAddress) && isExperimentEnabled("EnableNewAddressComponent"), [addressSchema, verifiedBusiness == null ? void 0 : verifiedBusiness.isTrustedAddress, isExperimentEnabled, verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress]);
25144
+ useEffect(
25145
+ () => applyVerifiedBusinessData(verifiedBusiness, handleChangeFor),
25146
+ // eslint-disable-next-line react-hooks/exhaustive-deps
25147
+ [verifiedBusiness]
25148
+ );
24510
25149
  useEffect(() => {
24511
25150
  if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
24512
25151
  }, [verifiedBusiness]);
@@ -24527,7 +25166,14 @@ function AdditionalInformationComponent({
24527
25166
  handleChangeFor("operationalAddress")(state.data);
24528
25167
  setValid("operationalAddress", Boolean(state.isValid));
24529
25168
  };
24530
- const handleOperationalAddressIsSameChange = (isChecked) => isChecked ? handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME) : handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
25169
+ const handleOperationalAddressIsSameChange = (isChecked) => {
25170
+ if (isChecked) {
25171
+ handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME);
25172
+ setValid("operationalAddress", true);
25173
+ } else {
25174
+ handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
25175
+ }
25176
+ };
24531
25177
  return jsxs("form", {
24532
25178
  id: ADDITIONAL_INFORMATION_FORM_ID,
24533
25179
  className: "adyen-kyc-additional-information",
@@ -24539,7 +25185,7 @@ function AdditionalInformationComponent({
24539
25185
  verificationErrors: formVerificationErrors,
24540
25186
  validationErrors: fieldValidationErrors,
24541
25187
  formUtils
24542
- }), showVerified && jsxs("div", {
25188
+ }), showVerified && jsxs("section", {
24543
25189
  children: [jsx("div", {
24544
25190
  className: "adyen-kyc-additional-information__section-heading",
24545
25191
  children: jsx(Typography, {
@@ -24548,9 +25194,10 @@ function AdditionalInformationComponent({
24548
25194
  children: i18n.get("verifiedInformation")
24549
25195
  })
24550
25196
  }), jsx(VerifiedBusinessCard, {
24551
- verifiedBusiness
25197
+ verifiedBusiness,
25198
+ verifiedAddress: (verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress) ?? (verifiedAddress == null ? void 0 : verifiedAddress.operationalAddress)
24552
25199
  })]
24553
- }), jsxs("fieldset", {
25200
+ }), jsxs("section", {
24554
25201
  children: [showVerified && jsx("div", {
24555
25202
  className: "adyen-kyc-additional-information__section-heading",
24556
25203
  children: jsx(Typography, {
@@ -24558,114 +25205,116 @@ function AdditionalInformationComponent({
24558
25205
  variant: "title",
24559
25206
  children: i18n.get("otherBusinessInformation")
24560
25207
  })
24561
- }), showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
24562
- className: "adyen-kyc-field-wrapper",
24563
- children: jsx(LegalCompanyNameField, {
24564
- data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
24565
- valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
24566
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
24567
- labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
24568
- helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
24569
- legalCompanyName: "legalCompanyName__helperText"
24570
- }),
24571
- readonly: formUtils.isReadOnly("legalCompanyName"),
24572
- handleChangeFor
24573
- })
24574
- }), showField(DBA_NAME_FIELD) && jsx("div", {
24575
- className: "adyen-kyc-field-wrapper",
24576
- children: jsx(DBANameField, {
24577
- data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
24578
- valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
24579
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
24580
- labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
24581
- hasDba: "hasDba"
24582
- }),
24583
- readonly: formUtils.isReadOnly("dbaName"),
24584
- handleChangeFor,
24585
- setErrors
24586
- })
24587
- }), showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && jsx("div", {
24588
- className: "adyen-kyc-field-wrapper",
24589
- children: jsx(BusinessRegistrationNumberField, {
24590
- data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
24591
- valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
24592
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
24593
- labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
24594
- exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
24595
- }),
24596
- mask: formUtils.getMask("registrationNumber"),
24597
- guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24598
- placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
24599
- helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
24600
- readonly: formUtils.isReadOnly("registrationNumber"),
24601
- optional: formUtils.isOptionalField("registrationNumber"),
24602
- shouldValidate,
24603
- handleChangeFor,
24604
- country,
24605
- canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
24606
- companyType,
24607
- registrationNumberOptions,
24608
- registrationNumberType,
24609
- setRegistrationNumberType
24610
- })
24611
- }), showField(TAX_INFORMATION_FIELD) && jsx("div", {
24612
- className: "adyen-kyc-field-wrapper",
24613
- children: jsx(TaxInformationField, {
24614
- data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
24615
- valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
24616
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
24617
- labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
24618
- exemptedFromTax: "iDontHaveATaxId"
24619
- }),
24620
- mask: formUtils.getMask("taxInformation"),
24621
- helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
24622
- guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
24623
- readonly: formUtils.isReadOnly("taxInformation"),
24624
- shouldValidate,
24625
- handleChangeFor,
24626
- canExempt: formUtils.isRequiredField("exemptedFromTax"),
24627
- isUen: formUtils.isRequiredField("isUen"),
24628
- country,
24629
- companyType,
24630
- taxIdNumberType,
24631
- setTaxIdNumberType,
24632
- defaultData: data == null ? void 0 : data.taxInformation
24633
- })
24634
- }), showField(VAT_NUMBER_FIELD) && jsx("div", {
24635
- className: "adyen-kyc-field-wrapper",
24636
- children: jsx(VatNumberField, {
24637
- data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
24638
- valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
24639
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
24640
- labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
24641
- exemptedFromVat: "iDontHaveAVatNumber"
24642
- }),
24643
- mask: formUtils.getMask("vatNumber"),
24644
- guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
24645
- placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
24646
- readonly: formUtils.isReadOnly("vatNumber"),
24647
- handleChangeFor,
24648
- country,
24649
- canExempt: formUtils.isRequiredField("exemptedFromVat"),
24650
- vatNumberType,
24651
- setVatNumberType,
24652
- shouldValidate
24653
- })
24654
- }), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
24655
- className: "adyen-kyc-field-wrapper",
24656
- children: jsx(DateOfIncorporationField, {
24657
- data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
24658
- valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
24659
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DATE_OF_INCORPORATION_FIELD),
24660
- labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
24661
- placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
24662
- dateOfIncorporation: "datePlaceholder"
24663
- }),
24664
- readonly: formUtils.isReadOnly("dateOfIncorporation"),
24665
- handleChangeFor
24666
- })
25208
+ }), jsxs("fieldset", {
25209
+ children: [showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
25210
+ className: "adyen-kyc-field-wrapper",
25211
+ children: jsx(LegalCompanyNameField, {
25212
+ data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
25213
+ valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
25214
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
25215
+ labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
25216
+ helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
25217
+ legalCompanyName: "legalCompanyName__helperText"
25218
+ }),
25219
+ readonly: formUtils.isReadOnly("legalCompanyName"),
25220
+ handleChangeFor
25221
+ })
25222
+ }), showField(DBA_NAME_FIELD) && jsx("div", {
25223
+ className: "adyen-kyc-field-wrapper",
25224
+ children: jsx(DBANameField, {
25225
+ data: formUtils.getFieldData(formData, DBA_NAME_FIELD),
25226
+ valid: formUtils.getFieldValid(formValid, DBA_NAME_FIELD),
25227
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DBA_NAME_FIELD),
25228
+ labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
25229
+ hasDba: "hasDba"
25230
+ }),
25231
+ readonly: formUtils.isReadOnly("dbaName"),
25232
+ handleChangeFor,
25233
+ setErrors
25234
+ })
25235
+ }), showField(BUSINESS_REGISTRATION_NUMBER_FIELD) && jsx("div", {
25236
+ className: "adyen-kyc-field-wrapper",
25237
+ children: jsx(BusinessRegistrationNumberField, {
25238
+ data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
25239
+ valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
25240
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
25241
+ labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
25242
+ exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
25243
+ }),
25244
+ mask: formUtils.getMask("registrationNumber"),
25245
+ guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
25246
+ placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
25247
+ helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
25248
+ readonly: formUtils.isReadOnly("registrationNumber"),
25249
+ optional: formUtils.isOptionalField("registrationNumber"),
25250
+ shouldValidate,
25251
+ handleChangeFor,
25252
+ country,
25253
+ canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
25254
+ companyType,
25255
+ registrationNumberOptions,
25256
+ registrationNumberType,
25257
+ setRegistrationNumberType
25258
+ })
25259
+ }), showField(TAX_INFORMATION_FIELD) && jsx("div", {
25260
+ className: "adyen-kyc-field-wrapper",
25261
+ children: jsx(TaxInformationField, {
25262
+ data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
25263
+ valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
25264
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
25265
+ labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
25266
+ exemptedFromTax: "iDontHaveATaxId"
25267
+ }),
25268
+ mask: formUtils.getMask("taxInformation"),
25269
+ helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
25270
+ guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
25271
+ readonly: formUtils.isReadOnly("taxInformation"),
25272
+ shouldValidate,
25273
+ handleChangeFor,
25274
+ canExempt: formUtils.isRequiredField("exemptedFromTax"),
25275
+ isUen: formUtils.isRequiredField("isUen"),
25276
+ country,
25277
+ companyType,
25278
+ taxIdNumberType,
25279
+ setTaxIdNumberType,
25280
+ defaultData: data == null ? void 0 : data.taxInformation
25281
+ })
25282
+ }), showField(VAT_NUMBER_FIELD) && jsx("div", {
25283
+ className: "adyen-kyc-field-wrapper",
25284
+ children: jsx(VatNumberField, {
25285
+ data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
25286
+ valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
25287
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
25288
+ labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
25289
+ exemptedFromVat: "iDontHaveAVatNumber"
25290
+ }),
25291
+ mask: formUtils.getMask("vatNumber"),
25292
+ guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
25293
+ placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
25294
+ readonly: formUtils.isReadOnly("vatNumber"),
25295
+ handleChangeFor,
25296
+ country,
25297
+ canExempt: formUtils.isRequiredField("exemptedFromVat"),
25298
+ vatNumberType,
25299
+ setVatNumberType,
25300
+ shouldValidate
25301
+ })
25302
+ }), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
25303
+ className: "adyen-kyc-field-wrapper",
25304
+ children: jsx(DateOfIncorporationField, {
25305
+ data: formUtils.getFieldData(formData, DATE_OF_INCORPORATION_FIELD),
25306
+ valid: formUtils.getFieldValid(formValid, DATE_OF_INCORPORATION_FIELD),
25307
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, DATE_OF_INCORPORATION_FIELD),
25308
+ labels: formUtils.getFieldLabels(DATE_OF_INCORPORATION_FIELD),
25309
+ placeholders: formUtils.getFieldPlaceholders(DATE_OF_INCORPORATION_FIELD, {
25310
+ dateOfIncorporation: "datePlaceholder"
25311
+ }),
25312
+ readonly: formUtils.isReadOnly("dateOfIncorporation"),
25313
+ handleChangeFor
25314
+ })
25315
+ })]
24667
25316
  })]
24668
- }), showStockData && jsxs("fieldset", {
25317
+ }), showStockData && jsxs("section", {
24669
25318
  children: [jsx("div", {
24670
25319
  className: "adyen-kyc-additional-information__section-heading",
24671
25320
  children: jsx(Typography, {
@@ -24673,50 +25322,55 @@ function AdditionalInformationComponent({
24673
25322
  variant: "title",
24674
25323
  children: i18n.get("stockExchangeInformation")
24675
25324
  })
24676
- }), showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
24677
- className: "adyen-kyc-field-wrapper",
24678
- children: jsx(StockExchangeMICField, {
24679
- data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
24680
- valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
24681
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_EXCHANGE_MIC_FIELD),
24682
- labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
24683
- placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
24684
- mask: formUtils.getMask("stockExchangeMIC"),
24685
- guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
24686
- readonly: formUtils.isReadOnly("stockExchangeMIC"),
24687
- shouldValidate,
24688
- handleChangeFor
24689
- })
24690
- }), showField(STOCK_ISIN_FIELD) && jsx("div", {
24691
- className: "adyen-kyc-field-wrapper",
24692
- children: jsx(StockISINField, {
24693
- data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
24694
- valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
24695
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_ISIN_FIELD),
24696
- labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
24697
- placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
24698
- mask: formUtils.getMask("stockISIN"),
24699
- guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
24700
- readonly: formUtils.isReadOnly("stockISIN"),
24701
- shouldValidate,
24702
- handleChangeFor
24703
- })
24704
- }), showField(STOCK_TICKER_SYMBOL_FIELD) && jsx("div", {
24705
- className: "adyen-kyc-field-wrapper",
24706
- children: jsx(StockTickerSymbolField, {
24707
- data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
24708
- valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
24709
- errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
24710
- labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
24711
- placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
24712
- mask: formUtils.getMask("stockTickerSymbol"),
24713
- guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
24714
- readonly: formUtils.isReadOnly("stockTickerSymbol"),
24715
- shouldValidate,
24716
- handleChangeFor
24717
- })
25325
+ }), jsxs("fieldset", {
25326
+ children: [showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
25327
+ className: "adyen-kyc-field-wrapper",
25328
+ children: jsx(StockExchangeMICField, {
25329
+ data: formUtils.getFieldData(formData, STOCK_EXCHANGE_MIC_FIELD),
25330
+ valid: formUtils.getFieldValid(formValid, STOCK_EXCHANGE_MIC_FIELD),
25331
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_EXCHANGE_MIC_FIELD),
25332
+ labels: formUtils.getFieldLabels(STOCK_EXCHANGE_MIC_FIELD),
25333
+ placeholders: formUtils.getFieldPlaceholders(STOCK_EXCHANGE_MIC_FIELD),
25334
+ mask: formUtils.getMask("stockExchangeMIC"),
25335
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_EXCHANGE_MIC_FIELD),
25336
+ readonly: formUtils.isReadOnly("stockExchangeMIC"),
25337
+ shouldValidate,
25338
+ handleChangeFor
25339
+ })
25340
+ }), showField(STOCK_ISIN_FIELD) && jsx("div", {
25341
+ className: "adyen-kyc-field-wrapper",
25342
+ children: jsx(StockISINField, {
25343
+ data: formUtils.getFieldData(formData, STOCK_ISIN_FIELD),
25344
+ valid: formUtils.getFieldValid(formValid, STOCK_ISIN_FIELD),
25345
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_ISIN_FIELD),
25346
+ labels: formUtils.getFieldLabels(STOCK_ISIN_FIELD),
25347
+ placeholders: formUtils.getFieldPlaceholders(STOCK_ISIN_FIELD),
25348
+ mask: formUtils.getMask("stockISIN"),
25349
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
25350
+ readonly: formUtils.isReadOnly("stockISIN"),
25351
+ shouldValidate,
25352
+ handleChangeFor
25353
+ })
25354
+ }), showField(STOCK_TICKER_SYMBOL_FIELD) && jsx("div", {
25355
+ className: "adyen-kyc-field-wrapper",
25356
+ children: jsx(StockTickerSymbolField, {
25357
+ data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
25358
+ valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
25359
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
25360
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
25361
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
25362
+ mask: formUtils.getMask("stockTickerSymbol"),
25363
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
25364
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
25365
+ shouldValidate,
25366
+ handleChangeFor
25367
+ })
25368
+ })]
24718
25369
  })]
24719
- }), jsxs("fieldset", {
25370
+ }), jsxs("section", {
25371
+ style: {
25372
+ display: hideRegistrationAddress ? "none" : "unset"
25373
+ },
24720
25374
  children: [jsxs("div", {
24721
25375
  className: "adyen-kyc-additional-information__section-heading",
24722
25376
  children: [jsx(Typography, {
@@ -24724,11 +25378,11 @@ function AdditionalInformationComponent({
24724
25378
  variant: "title",
24725
25379
  children: i18n.get("registeredBusinessAddress")
24726
25380
  }), jsx(Typography, {
24727
- el: "h4",
24728
- variant: "caption",
25381
+ el: "p",
25382
+ variant: "body",
24729
25383
  children: i18n.get("registeredBusinessAddressDescription")
24730
25384
  })]
24731
- }), jsx(Address, {
25385
+ }), jsx(AddressExperimentWrapper, {
24732
25386
  id: ADDITIONAL_INFORMATION_FORM_ID,
24733
25387
  addressType: "registrationAddress",
24734
25388
  data: {
@@ -24737,16 +25391,18 @@ function AdditionalInformationComponent({
24737
25391
  },
24738
25392
  labels: getAddressSchemaLabelsByCountry(country),
24739
25393
  countryCode: country,
24740
- requiredFields: ADDRESS_SCHEMA2,
25394
+ requiredFields: addressSchema,
24741
25395
  shouldValidate,
24742
25396
  hideCountry: true,
24743
25397
  optionalFields: ["otherAddressInformation"],
25398
+ readOnlyFields: verifiedBusiness ? ["stateOrProvince"] : [],
24744
25399
  onChange: handleRegistrationAddressChange,
24745
25400
  handleAddressSearch,
24746
25401
  handleFindAddress,
24747
- verifiedBusiness
25402
+ verifiedBusiness,
25403
+ verifiedAddress: verifiedAddress == null ? void 0 : verifiedAddress.registrationAddress
24748
25404
  })]
24749
- }), jsxs("fieldset", {
25405
+ }), jsxs("section", {
24750
25406
  children: [jsxs("div", {
24751
25407
  className: "adyen-kyc-additional-information__section-heading",
24752
25408
  children: [jsx(Typography, {
@@ -24754,8 +25410,8 @@ function AdditionalInformationComponent({
24754
25410
  variant: "title",
24755
25411
  children: i18n.get("principalPlaceOfBusiness")
24756
25412
  }), jsx(Typography, {
24757
- el: "h4",
24758
- variant: "caption",
25413
+ el: "p",
25414
+ variant: "body",
24759
25415
  children: i18n.get("principalPlaceOfBusinessDescription")
24760
25416
  })]
24761
25417
  }), jsx(Field, {
@@ -24773,7 +25429,7 @@ function AdditionalInformationComponent({
24773
25429
  checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
24774
25430
  onChange: handleOperationalAddressIsSameChange
24775
25431
  })
24776
- }), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(Address, {
25432
+ }), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(AddressExperimentWrapper, {
24777
25433
  id: ADDITIONAL_INFORMATION_FORM_ID,
24778
25434
  addressType: "operationalAddress",
24779
25435
  data: {
@@ -24782,12 +25438,15 @@ function AdditionalInformationComponent({
24782
25438
  },
24783
25439
  labels: getAddressSchemaLabelsByCountry(country),
24784
25440
  countryCode: country,
24785
- requiredFields: ADDRESS_SCHEMA2,
25441
+ requiredFields: addressSchema,
24786
25442
  shouldValidate,
25443
+ hideCountry: true,
24787
25444
  optionalFields: ["otherAddressInformation"],
24788
25445
  onChange: handleOperationalAddressChange,
24789
25446
  handleAddressSearch,
24790
- handleFindAddress
25447
+ handleFindAddress,
25448
+ verifiedBusiness,
25449
+ verifiedAddress: verifiedAddress == null ? void 0 : verifiedAddress.operationalAddress
24791
25450
  })]
24792
25451
  })]
24793
25452
  });
@@ -25042,10 +25701,10 @@ function BusinessSelectionComponent({
25042
25701
  if (fetching === "loading") return;
25043
25702
  if (!selectedBusinessId || selectedBusinessId !== result.id) {
25044
25703
  setSelectedBusinessId(result.id);
25045
- const businessData = await fetchBusinessData(result);
25704
+ const businessData = await fetchBusinessData(result, basicInformation == null ? void 0 : basicInformation.stateOrProvince);
25046
25705
  setCurrentBusinessSelection(businessData);
25047
25706
  } else if (fetching === "error") {
25048
- const businessData = await fetchBusinessData(result);
25707
+ const businessData = await fetchBusinessData(result, basicInformation == null ? void 0 : basicInformation.stateOrProvince);
25049
25708
  setCurrentBusinessSelection(businessData);
25050
25709
  }
25051
25710
  } catch (e) {
@@ -26272,14 +26931,14 @@ const Modal = ({
26272
26931
  tertiary: true,
26273
26932
  "aria-label": "back",
26274
26933
  icon: "arrow-left",
26275
- className: "adyen-kyc-modal-button-blur",
26934
+ className: "adyen-kyc-modal-button",
26276
26935
  onClick: onBack,
26277
26936
  shaded: true
26278
26937
  }) : jsx("div", {}), onClose ? jsx(Button, {
26279
26938
  tertiary: true,
26280
26939
  "aria-label": "close",
26281
26940
  icon: "cross",
26282
- className: "adyen-kyc-modal-button-blur",
26941
+ className: "adyen-kyc-modal-button",
26283
26942
  onClick: onClose,
26284
26943
  shaded: true
26285
26944
  }) : jsx("div", {})]
@@ -26607,16 +27266,11 @@ const DropinLayout = ({
26607
27266
  if (modalOpen) {
26608
27267
  return jsx(Modal, {
26609
27268
  footer,
26610
- onClose: handleClose,
27269
+ onClose: !onBack ? handleClose : void 0,
26611
27270
  onBack,
26612
27271
  children: jsx("div", {
26613
- className: "adyen-kyc-dropin",
26614
- children: jsx("div", {
26615
- className: "adyen-kyc-dropin__content",
26616
- children: jsx("div", {
26617
- children: content
26618
- })
26619
- })
27272
+ className: "adyen-kyc-modal-content",
27273
+ children: content
26620
27274
  })
26621
27275
  });
26622
27276
  }
@@ -27257,7 +27911,7 @@ function BusinessDetailsDropinComponent({
27257
27911
  handleClearCompanyData,
27258
27912
  onTypeSwitch
27259
27913
  }) {
27260
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
27914
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
27261
27915
  const {
27262
27916
  state: {
27263
27917
  currentState
@@ -27424,17 +28078,17 @@ function BusinessDetailsDropinComponent({
27424
28078
  return tinMatch;
27425
28079
  }, [verifyBusinessData]);
27426
28080
  const findBusiness = useCallback(async (data) => {
27427
- var _a2, _b2, _c2;
28081
+ var _a2, _b2, _c2, _d2;
27428
28082
  const tin = (_c2 = (_b2 = (_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.taxInformation) == null ? void 0 : _b2.find((taxId) => currentCountry === taxId.country)) == null ? void 0 : _c2.number;
27429
28083
  const results = await searchForBusiness(data);
27430
28084
  if (results && results.length === 1) {
27431
- const businessData = await fetchBusinessData(results[0]);
28085
+ const businessData = await fetchBusinessData(results[0], (_d2 = currentState.data.basicInformation) == null ? void 0 : _d2.stateOrProvince);
27432
28086
  if (businessData && tin) {
27433
28087
  const tinMatch = await handleVerifyBusinessData(businessData, tin);
27434
28088
  return tinMatch ? handleNextClick() : void 0;
27435
28089
  }
27436
28090
  }
27437
- }, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
28091
+ }, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, (_f = currentState.data.basicInformation) == null ? void 0 : _f.stateOrProvince, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
27438
28092
  useEffect(() => {
27439
28093
  if (searchResults && !searchResults.length || searching === "error") {
27440
28094
  setShowCompanyStructure(true);
@@ -27446,7 +28100,7 @@ function BusinessDetailsDropinComponent({
27446
28100
  setShowCompanyStructure(false);
27447
28101
  resetBusinessData();
27448
28102
  }
27449
- }, [currentSearchName, (_f = currentState.data.basicInformation) == null ? void 0 : _f.businessName]);
28103
+ }, [currentSearchName, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName]);
27450
28104
  const [showBusinessSelection, setShowBusinessSelection] = useState(false);
27451
28105
  const isBusinessSelection = useMemo(() => showBusinessSelection && activeForm.formId === "basicInformation", [activeForm.formId, showBusinessSelection]);
27452
28106
  const hideBack = useMemo(() => {
@@ -27493,7 +28147,7 @@ function BusinessDetailsDropinComponent({
27493
28147
  default:
27494
28148
  return gotoFormByFormIndex(index);
27495
28149
  }
27496
- }, [canSubmitForm, currentCountry, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName, (_h = currentState.data.basicInformation) == null ? void 0 : _h.country, (_i = currentState.data.basicInformation) == null ? void 0 : _i.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
28150
+ }, [canSubmitForm, currentCountry, (_h = currentState.data.basicInformation) == null ? void 0 : _h.businessName, (_i = currentState.data.basicInformation) == null ? void 0 : _i.country, (_j = currentState.data.basicInformation) == null ? void 0 : _j.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
27497
28151
  const nextClick = useCallback(() => {
27498
28152
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27499
28153
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
@@ -27516,7 +28170,7 @@ function BusinessDetailsDropinComponent({
27516
28170
  default:
27517
28171
  return handleNextClick();
27518
28172
  }
27519
- }, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_j = currentState.validityByForm) == null ? void 0 : _j.basicInformation, (_k = currentState.data.basicInformation) == null ? void 0 : _k.businessName, (_l = currentState.data.basicInformation) == null ? void 0 : _l.country, (_m = currentState.data.basicInformation) == null ? void 0 : _m.stateOrProvince, isBusinessSelection, findBusiness]);
28173
+ }, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_k = currentState.validityByForm) == null ? void 0 : _k.basicInformation, (_l = currentState.data.basicInformation) == null ? void 0 : _l.businessName, (_m = currentState.data.basicInformation) == null ? void 0 : _m.country, (_n = currentState.data.basicInformation) == null ? void 0 : _n.stateOrProvince, isBusinessSelection, findBusiness]);
27520
28174
  const backClick = useCallback(() => {
27521
28175
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
27522
28176
  switch (activeForm.formId) {
@@ -32833,7 +33487,8 @@ function IndividualDropinComponent({
32833
33487
  data,
32834
33488
  country,
32835
33489
  taskType,
32836
- isExperimentEnabled
33490
+ isExperimentEnabled,
33491
+ rootLegalEntity: parentLegalEntity
32837
33492
  }), [country, data, taskType]);
32838
33493
  const customValidators = useMemo(() => isExperimentEnabled("EnableAgeVerification") ? validators({
32839
33494
  country,
@@ -34676,6 +35331,47 @@ function RoleAndTypeDropinComponent({
34676
35331
  content
34677
35332
  });
34678
35333
  }
35334
+ const outlinedIcon = "adyen-kyc-outlined-icon";
35335
+ const styles$2 = {
35336
+ "outlined-icon": "adyen-kyc-outlined-icon",
35337
+ outlinedIcon
35338
+ };
35339
+ const OutlinedIcon = ({
35340
+ name
35341
+ }) => jsx("div", {
35342
+ className: styles$2.outlinedIcon,
35343
+ children: jsx(Icon, {
35344
+ name
35345
+ })
35346
+ });
35347
+ const Splashscreen = ({
35348
+ title,
35349
+ subtitle,
35350
+ icon,
35351
+ buttonText,
35352
+ onClick
35353
+ }) => {
35354
+ const {
35355
+ i18n
35356
+ } = useI18nContext();
35357
+ return jsxs("div", {
35358
+ className: "adyen-kyc-splashscreen",
35359
+ children: [icon && jsx(OutlinedIcon, {
35360
+ name: icon
35361
+ }), jsx(Typography, {
35362
+ el: "h2",
35363
+ variant: "title-l",
35364
+ children: title
35365
+ }), jsx(Typography, {
35366
+ el: "p",
35367
+ variant: "body",
35368
+ children: subtitle
35369
+ }), onClick && jsx(Button, {
35370
+ onClick,
35371
+ label: buttonText ?? i18n.get("finish")
35372
+ })]
35373
+ });
35374
+ };
34679
35375
  const serviceAgreementValidationRules = {
34680
35376
  signer: {
34681
35377
  modes: ["blur"],
@@ -34769,7 +35465,8 @@ const serviceAgreementTypesTranslationMapping = {
34769
35465
  adyenAccount: "businessAccountTerms",
34770
35466
  adyenCard: "cardUserTerms",
34771
35467
  adyenFranchisee: "franchiseesTAndCs",
34772
- adyenPccr: "pccr"
35468
+ adyenPccr: "pccr",
35469
+ adyenChargeCard: "chargeCardUserAgreement"
34773
35470
  };
34774
35471
  const logger$i = createLogger("ServiceAgreementDropinComponent");
34775
35472
  const FALLBACK_LANGUAGE_CODE = "en";
@@ -34780,6 +35477,7 @@ function ServiceAgreementDropinComponent({
34780
35477
  handleDownloadAcceptedTermsOfServiceDocument,
34781
35478
  handleDownloadUnacceptedTermsOfServiceDocument,
34782
35479
  handleHomeClick,
35480
+ handleAddSigner,
34783
35481
  handleSign,
34784
35482
  taskType,
34785
35483
  serviceAgreementTypes,
@@ -34823,8 +35521,10 @@ function ServiceAgreementDropinComponent({
34823
35521
  const forms2 = [...signedForms, ...formsToBeSigned];
34824
35522
  const [activeFormIndex, setActiveFormIndex] = useState(0);
34825
35523
  const [activeForm, setActiveForm] = useState(forms2[activeFormIndex]);
34826
- const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm.serviceAgreementType)) && !activeForm.acceptanceId;
34827
- const showSignerCard = !!activeForm.acceptanceId;
35524
+ const [hasFinished, setHasFinished] = useState(false);
35525
+ const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm == null ? void 0 : activeForm.serviceAgreementType)) && !(activeForm == null ? void 0 : activeForm.acceptanceId);
35526
+ const isLastStep = activeFormIndex === forms2.length - 1;
35527
+ const showSignerCard = !!(activeForm == null ? void 0 : activeForm.acceptanceId);
34828
35528
  const handleServiceAgreementIsNotAvailableInThatLanguage = useCallback(() => {
34829
35529
  showToast({
34830
35530
  label: i18n.get("failedToGetServiceAgreementInSelectedLanguageFallbackToEn"),
@@ -34837,10 +35537,10 @@ function ServiceAgreementDropinComponent({
34837
35537
  } = useServiceAgreement({
34838
35538
  handleGetServiceAgreement,
34839
35539
  handleServiceAgreementIsNotAvailableInThatLanguage,
34840
- acceptanceId: activeForm.acceptanceId,
35540
+ acceptanceId: activeForm == null ? void 0 : activeForm.acceptanceId,
34841
35541
  handleViewAcceptedTermsOfServiceDocument,
34842
35542
  legalEntityId: legalEntityResponse.id,
34843
- serviceAgreementType: activeForm.serviceAgreementType,
35543
+ serviceAgreementType: activeForm == null ? void 0 : activeForm.serviceAgreementType,
34844
35544
  language: i18n.languageCode
34845
35545
  });
34846
35546
  const {
@@ -34995,12 +35695,24 @@ function ServiceAgreementDropinComponent({
34995
35695
  });
34996
35696
  }
34997
35697
  };
35698
+ const addSignerAlert = jsx(Alert, {
35699
+ variant: signers.length ? "info" : "warning",
35700
+ className: "adyen-kyc-u-margin-top-16",
35701
+ title: i18n.get(signers.length ? "isYourNameMissingFromSigners" : "thereAreNoSigners"),
35702
+ children: jsx(Button, {
35703
+ label: i18n.get("addYourselfAsSigner"),
35704
+ onClick: handleAddSigner,
35705
+ showAsLink: true,
35706
+ underline: true,
35707
+ type: "button"
35708
+ })
35709
+ });
34998
35710
  const sidebar = jsx(LoaderWrapper, {
34999
35711
  status: loadingStatus,
35000
35712
  formOpacityWhenLoading: 0.3,
35001
35713
  showSpinner: false,
35002
35714
  className: "adyen-kyc-dropin__sidebar-wrapper",
35003
- children: !!forms2.length && jsx(FormNavigation, {
35715
+ children: jsx(FormNavigation, {
35004
35716
  forms: forms2,
35005
35717
  activeForm,
35006
35718
  gotoForm,
@@ -35013,11 +35725,11 @@ function ServiceAgreementDropinComponent({
35013
35725
  formOpacityWhenLoading: 0.3,
35014
35726
  showSpinner: false,
35015
35727
  className: "adyen-kyc-form-container",
35016
- children: [jsx(LoaderWrapper, {
35728
+ children: [jsxs(LoaderWrapper, {
35017
35729
  status: contractLoadingStatus,
35018
35730
  formOpacityWhenLoading: 0.3,
35019
35731
  showSpinner: false,
35020
- children: serviceAgreement && jsxs(Fragment, {
35732
+ children: [serviceAgreement && jsxs(Fragment, {
35021
35733
  children: [jsx(ContractViewer, {
35022
35734
  contract: serviceAgreement.contract,
35023
35735
  onExpandSection: handleExpandSection
@@ -35028,13 +35740,16 @@ function ServiceAgreementDropinComponent({
35028
35740
  label: i18n.get("downloadAsPdf"),
35029
35741
  icon: "download"
35030
35742
  })]
35031
- })
35743
+ }), !forms2.length && jsx(Alert, {
35744
+ variant: "info",
35745
+ title: i18n.get("nothingNeedsToBeSigned")
35746
+ })]
35032
35747
  }), canSign && jsxs(Fragment, {
35033
- children: [jsx(Field, {
35748
+ children: [!!signers.length && jsx(Field, {
35034
35749
  name: "signer",
35035
35750
  label: i18n.get("signer"),
35036
35751
  classNameModifiers: ["col-50"],
35037
- className: "adyen-kyc-u-margin-y-32",
35752
+ className: "adyen-kyc-u-margin-top-32",
35038
35753
  errorMessage: i18n.get((_a = errors.signer) == null ? void 0 : _a.errorMessage),
35039
35754
  isValid: valid.signer,
35040
35755
  children: (childProps) => jsx(Select, {
@@ -35045,8 +35760,9 @@ function ServiceAgreementDropinComponent({
35045
35760
  selected: data.signer,
35046
35761
  items: signers
35047
35762
  })
35048
- }), jsx(Field, {
35763
+ }), addSignerAlert, jsx(Field, {
35049
35764
  name: "acceptServiceAgreement",
35765
+ className: "adyen-kyc-u-margin-top-16",
35050
35766
  errorMessage: i18n.get((_b = errors.acceptServiceAgreement) == null ? void 0 : _b.errorMessage),
35051
35767
  isValid: valid.acceptServiceAgreement,
35052
35768
  children: (childProps) => jsx(Checkbox, {
@@ -35076,7 +35792,7 @@ function ServiceAgreementDropinComponent({
35076
35792
  homeButtonLabel: i18n.get("goToOverview"),
35077
35793
  onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
35078
35794
  nextButtonLabel: i18n.get(canSign ? "sign" : "next"),
35079
- nextButtonDisabled: !canSign && activeFormIndex === forms2.length - 1,
35795
+ nextButtonDisabled: forms2.length === 0 || !canSign && isLastStep,
35080
35796
  onBack: () => gotoForm(activeFormIndex - 1),
35081
35797
  hideBackButton: activeFormIndex === 0,
35082
35798
  backButtonLabel: i18n.get("previous")
@@ -35084,6 +35800,15 @@ function ServiceAgreementDropinComponent({
35084
35800
  });
35085
35801
  const currentStep = signedForms.length;
35086
35802
  const totalSteps = forms2.length;
35803
+ const handleClick = async () => {
35804
+ if (canSign) {
35805
+ await handleSignClick();
35806
+ } else if (!isLastStep) {
35807
+ gotoForm(activeFormIndex + 1);
35808
+ } else {
35809
+ setHasFinished(true);
35810
+ }
35811
+ };
35087
35812
  const footer = jsx(EmbeddedActionBar, {
35088
35813
  left: jsx(StepProgressIndicator, {
35089
35814
  activeStepIndex: currentStep ?? 0,
@@ -35096,15 +35821,20 @@ function ServiceAgreementDropinComponent({
35096
35821
  jsx(Button, {
35097
35822
  secondary: !canSign,
35098
35823
  label: i18n.get(canSign ? "signAndContinue" : "next"),
35099
- onClick: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1)
35824
+ onClick: handleClick
35100
35825
  })
35101
35826
  )
35102
35827
  });
35828
+ const endScreen = hasFinished && jsx(Splashscreen, {
35829
+ icon: "check",
35830
+ title: i18n.get("serviceAgreementSignedAndDated"),
35831
+ onClick: handleCloseClick
35832
+ });
35103
35833
  return jsx(DropinLayout, {
35104
35834
  showAsModal: asModal,
35105
35835
  onClose: handleCloseClick,
35106
35836
  content: jsxs(Fragment, {
35107
- children: [!asEmbedded && sidebar, content]
35837
+ children: [!asEmbedded && sidebar, endScreen || content]
35108
35838
  }),
35109
35839
  footer: asEmbedded ? footer : void 0
35110
35840
  });
@@ -35755,6 +36485,10 @@ const useNavigation = ({
35755
36485
  onNavigate,
35756
36486
  handleOpenSingpassAuthorizationLink
35757
36487
  }) => {
36488
+ const {
36489
+ isSettingEnabled
36490
+ } = useSettingsContext();
36491
+ const showServiceAgreementsFirst = isSettingEnabled(SettingNames.ShowServiceAgreementsFirst);
35758
36492
  const isNewEntryFlowEnabled = useEnableNewEntryFlow();
35759
36493
  const showIntroduction = useShouldShowIntroduction({
35760
36494
  legalEntity
@@ -35822,11 +36556,12 @@ const useNavigation = ({
35822
36556
  canSeeEntitySelection,
35823
36557
  showIntroduction,
35824
36558
  isNewEntryFlowEnabled,
35825
- shouldShowSingpassSelection
36559
+ shouldShowSingpassSelection,
36560
+ showServiceAgreementsFirst
35826
36561
  });
35827
36562
  setTaskHistory([...taskHistory.slice(0, taskHistory.length - 1), defaultTask]);
35828
36563
  }
35829
- }, [legalEntity, accountHolder, showIntroduction, isNewEntryFlowEnabled, shouldShowSingpassSelection, taskHistory]);
36564
+ }, [legalEntity, accountHolder, showIntroduction, isNewEntryFlowEnabled, shouldShowSingpassSelection, showServiceAgreementsFirst, taskHistory]);
35830
36565
  return {
35831
36566
  currentTask: actualTasks.at(-1),
35832
36567
  previousTask: actualTasks.at(-2),
@@ -35839,9 +36574,13 @@ const getDefaultTask = ({
35839
36574
  canSeeEntitySelection,
35840
36575
  isNewEntryFlowEnabled,
35841
36576
  showIntroduction,
35842
- shouldShowSingpassSelection
36577
+ shouldShowSingpassSelection,
36578
+ showServiceAgreementsFirst
35843
36579
  }) => {
35844
36580
  const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
36581
+ if (showServiceAgreementsFirst) {
36582
+ return TaskTypes.SERVICE_AGREEMENT;
36583
+ }
35845
36584
  if (isNewEntryFlowEnabled && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
35846
36585
  if (showIntroduction) return TaskTypes.INTRODUCTION;
35847
36586
  if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
@@ -36921,7 +37660,8 @@ function DropinComposerComponent({
36921
37660
  handleViewAcceptedTermsOfServiceDocument: args.handleViewAcceptedTermsOfServiceDocument,
36922
37661
  handleDownloadAcceptedTermsOfServiceDocument: args.handleDownloadAcceptedTermsOfServiceDocument,
36923
37662
  handleDownloadUnacceptedTermsOfServiceDocument: args.handleDownloadUnacceptedTermsOfServiceDocument,
36924
- handleHomeClick: navigateBack,
37663
+ handleHomeClick: () => navigateTo(TaskTypes.TASKS_OVERVIEW),
37664
+ handleAddSigner: () => navigateTo(TaskTypes.DECISION_MAKER),
36925
37665
  handleSign: async (...params) => {
36926
37666
  await args.handleSignServiceAgreement(...params);
36927
37667
  await getServiceAgreementStatus2();
@@ -37648,7 +38388,8 @@ const logger$g = createLogger("CreateContractingComponent");
37648
38388
  function CreateContractingComponent({
37649
38389
  legalEntityId,
37650
38390
  modalView,
37651
- onClose
38391
+ onClose,
38392
+ onUnmount
37652
38393
  }) {
37653
38394
  const {
37654
38395
  isModalView,
@@ -37664,7 +38405,8 @@ function CreateContractingComponent({
37664
38405
  getServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2,
37665
38406
  getAcceptedServiceAgreement: getAcceptedServiceAgreement2,
37666
38407
  downloadAcceptedServiceAgreement,
37667
- downloadUnacceptedServiceAgreement
38408
+ downloadUnacceptedServiceAgreement,
38409
+ acceptServiceAgreement: acceptServiceAgreement2
37668
38410
  } = useComponentApi(legalEntityId);
37669
38411
  const [isLoading, setIsLoading] = useState(true);
37670
38412
  const [legalEntity, setLegalEntity] = useState();
@@ -37673,6 +38415,12 @@ function CreateContractingComponent({
37673
38415
  if (modalView) {
37674
38416
  setIsModalView(true);
37675
38417
  }
38418
+ const handleOnClose = () => {
38419
+ if (modalView) {
38420
+ onUnmount == null ? void 0 : onUnmount();
38421
+ }
38422
+ onClose == null ? void 0 : onClose();
38423
+ };
37676
38424
  const fetchLegalEntity = useCallback(async () => {
37677
38425
  await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$g.error);
37678
38426
  }, [getLegalEntity2, legalEntityId]);
@@ -37686,6 +38434,14 @@ function CreateContractingComponent({
37686
38434
  data
37687
38435
  }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$g.error);
37688
38436
  }, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
38437
+ const handleSign = useCallback(
38438
+ // @ts-ignore-error:next-line ts does not infer type correctly
38439
+ async (...params) => {
38440
+ await acceptServiceAgreement2(...params);
38441
+ await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
38442
+ },
38443
+ [acceptServiceAgreement2, fetchLegalEntity, fetchSigned, fetchUnsigned]
38444
+ );
37689
38445
  useEffect(() => {
37690
38446
  (async () => {
37691
38447
  setIsLoading(true);
@@ -37696,8 +38452,6 @@ function CreateContractingComponent({
37696
38452
  }, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
37697
38453
  const handleHomeClick = () => {
37698
38454
  };
37699
- const handleSign = () => {
37700
- };
37701
38455
  return isLoading || !legalEntity ? jsx(Loader, {
37702
38456
  size: "medium"
37703
38457
  }) : jsx(ServiceAgreementDropinComponent, {
@@ -37713,7 +38467,10 @@ function CreateContractingComponent({
37713
38467
  handleSign,
37714
38468
  asEmbedded: true,
37715
38469
  asModal: isModalView,
37716
- handleCloseClick: onClose
38470
+ handleCloseClick: handleOnClose,
38471
+ handleAddSigner: () => {
38472
+ }
38473
+ // TODO: figure out what this should be, in the dropin it's () => navigateTo(TaskTypes.DECISION_MAKER)
37717
38474
  });
37718
38475
  }
37719
38476
  const logger$f = createLogger("CreateIndividualComponent");
@@ -37724,7 +38481,8 @@ function CreateIndividualComponent({
37724
38481
  onSubmitSuccess,
37725
38482
  handleBackClick,
37726
38483
  modalView,
37727
- onClose
38484
+ onClose,
38485
+ onUnmount
37728
38486
  }) {
37729
38487
  var _a;
37730
38488
  const {
@@ -37755,6 +38513,12 @@ function CreateIndividualComponent({
37755
38513
  if (modalView) {
37756
38514
  setIsModalView(true);
37757
38515
  }
38516
+ const handleOnClose = () => {
38517
+ if (modalView) {
38518
+ onUnmount == null ? void 0 : onUnmount();
38519
+ }
38520
+ onClose == null ? void 0 : onClose();
38521
+ };
37758
38522
  const fetchLegalEntity = useCallback(async () => {
37759
38523
  try {
37760
38524
  const [parentEntity, entity] = await Promise.all([parentLegalEntityId ? getLegalEntity2(parentLegalEntityId) : Promise.resolve(void 0), legalEntityId ? getLegalEntity2(legalEntityId) : Promise.resolve(void 0)]);
@@ -37769,9 +38533,10 @@ function CreateIndividualComponent({
37769
38533
  }, [fetchLegalEntity]);
37770
38534
  const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
37771
38535
  const onSubmit = (d) => {
37772
- if (onSubmitSuccess) {
37773
- onSubmitSuccess(d);
38536
+ if (modalView) {
38537
+ onUnmount == null ? void 0 : onUnmount();
37774
38538
  }
38539
+ onSubmitSuccess == null ? void 0 : onSubmitSuccess(d);
37775
38540
  };
37776
38541
  const fetchProviderStatus = useCallback(async () => {
37777
38542
  const res = await getProviderStatus2({
@@ -37801,7 +38566,7 @@ function CreateIndividualComponent({
37801
38566
  hideNavigation: true,
37802
38567
  asModal: isModalView,
37803
38568
  onSubmit,
37804
- handleCloseClick: onClose,
38569
+ handleCloseClick: handleOnClose,
37805
38570
  taskType
37806
38571
  });
37807
38572
  }
@@ -37873,23 +38638,25 @@ function CreateTransferInstrumentComponent({
37873
38638
  taskType: TaskTypes.PAYOUT
37874
38639
  });
37875
38640
  }
37876
- var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
37877
- OnboardingStatus2["AWAITING_DATA"] = "AWAITING_DATA";
37878
- OnboardingStatus2["IN_REVIEW"] = "IN_REVIEW";
37879
- OnboardingStatus2["UNSUCCESSFUL"] = "UNSUCCESSFUL";
37880
- OnboardingStatus2["REJECTED"] = "REJECTED";
37881
- OnboardingStatus2["VERIFIED"] = "VERIFIED";
37882
- return OnboardingStatus2;
37883
- })(OnboardingStatus || {});
38641
+ const skeleton = "adyen-kyc-skeleton";
38642
+ const skeletonCircle = "adyen-kyc-skeleton-circle";
38643
+ const skeletonText = "adyen-kyc-skeleton-text";
38644
+ const styles$1 = {
38645
+ skeleton,
38646
+ "skeleton-circle": "adyen-kyc-skeleton-circle",
38647
+ skeletonCircle,
38648
+ "skeleton-text": "adyen-kyc-skeleton-text",
38649
+ skeletonText
38650
+ };
37884
38651
  const Skeleton = ({
37885
38652
  circle = false,
37886
38653
  text = false,
37887
38654
  height = "1em",
37888
38655
  width
37889
38656
  }) => {
37890
- const classNames = cx("adyen-kyc-skeleton", {
37891
- "adyen-kyc-skeleton__circle": circle,
37892
- "adyen-kyc-skeleton__text": text
38657
+ const classNames = cx(styles$1.skeleton, {
38658
+ [styles$1.skeletonCircle]: circle,
38659
+ [styles$1.skeletonText]: text
37893
38660
  });
37894
38661
  return jsx("div", {
37895
38662
  className: classNames,
@@ -37899,14 +38666,34 @@ const Skeleton = ({
37899
38666
  }
37900
38667
  });
37901
38668
  };
38669
+ const embeddedStatus = "adyen-kyc-embedded-status";
38670
+ const embeddedStatusLoading = "adyen-kyc-embedded-status-loading";
38671
+ const embeddedStatusAvatar = "adyen-kyc-embedded-status-avatar";
38672
+ const embeddedStatusLight = "adyen-kyc-embedded-status-light";
38673
+ const embeddedStatusIcon = "adyen-kyc-embedded-status-icon";
38674
+ const embeddedStatusInfo = "adyen-kyc-embedded-status-info";
37902
38675
  const styles = {
37903
- "adyen-kyc-embedded-status": "adyen-kyc-embedded-status",
37904
- "adyen-kyc-embedded-status--loading": "adyen-kyc-embedded-status--loading",
37905
- "adyen-kyc-embedded-status__avatar": "adyen-kyc-embedded-status__avatar",
37906
- "adyen-kyc-embedded-status--light": "adyen-kyc-embedded-status--light",
37907
- "adyen-kyc-embedded-status__icon": "adyen-kyc-embedded-status__icon",
37908
- "adyen-kyc-embedded-status__info": "adyen-kyc-embedded-status__info"
38676
+ "embedded-status": "adyen-kyc-embedded-status",
38677
+ embeddedStatus,
38678
+ "embedded-status-loading": "adyen-kyc-embedded-status-loading",
38679
+ embeddedStatusLoading,
38680
+ "embedded-status-avatar": "adyen-kyc-embedded-status-avatar",
38681
+ embeddedStatusAvatar,
38682
+ "embedded-status-light": "adyen-kyc-embedded-status-light",
38683
+ embeddedStatusLight,
38684
+ "embedded-status-icon": "adyen-kyc-embedded-status-icon",
38685
+ embeddedStatusIcon,
38686
+ "embedded-status-info": "adyen-kyc-embedded-status-info",
38687
+ embeddedStatusInfo
37909
38688
  };
38689
+ var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
38690
+ OnboardingStatus2["AWAITING_DATA"] = "AWAITING_DATA";
38691
+ OnboardingStatus2["IN_REVIEW"] = "IN_REVIEW";
38692
+ OnboardingStatus2["UNSUCCESSFUL"] = "UNSUCCESSFUL";
38693
+ OnboardingStatus2["REJECTED"] = "REJECTED";
38694
+ OnboardingStatus2["VERIFIED"] = "VERIFIED";
38695
+ return OnboardingStatus2;
38696
+ })(OnboardingStatus || {});
37910
38697
  const statusToTag = (status) => {
37911
38698
  switch (status) {
37912
38699
  case OnboardingStatus.IN_REVIEW:
@@ -37973,24 +38760,24 @@ const EmbeddedStatus = ({
37973
38760
  };
37974
38761
  return jsxs("button", {
37975
38762
  type: "button",
37976
- className: cx(className, styles["adyen-kyc-embedded-status"], {
37977
- "adyen-kyc-embedded-status--loading": loading,
37978
- "adyen-kyc-embedded-status--light": light
38763
+ className: cx(className, styles.embeddedStatus, {
38764
+ [styles.embeddedStatusLoading]: loading,
38765
+ [styles.embeddedStatusLight]: light
37979
38766
  }),
37980
38767
  onClick,
37981
38768
  ...props,
37982
38769
  children: [jsx("section", {
37983
- className: styles["adyen-kyc-embedded-status__avatar"],
38770
+ className: styles.embeddedStatusAvatar,
37984
38771
  children: loading ? jsx(Skeleton, {
37985
38772
  height: "100%",
37986
38773
  width: "100%",
37987
38774
  circle: true
37988
38775
  }) : jsx(Icon, {
37989
- className: styles["adyen-kyc-embedded-status__icon"],
38776
+ className: styles.embeddedStatusIcon,
37990
38777
  name: iconName
37991
38778
  })
37992
38779
  }), jsx("section", {
37993
- className: styles["adyen-kyc-embedded-status__info"],
38780
+ className: styles.embeddedStatusInfo,
37994
38781
  children: loading ? jsxs(Fragment, {
37995
38782
  children: [jsx(Skeleton, {
37996
38783
  text: true,
@@ -38012,7 +38799,7 @@ const EmbeddedStatus = ({
38012
38799
  })]
38013
38800
  })
38014
38801
  }), actionButton ? jsx("section", {
38015
- className: styles["adyen-kyc-embedded-status__button"],
38802
+ className: styles.embeddedStatusButton,
38016
38803
  children: loading ? jsx(Skeleton, {
38017
38804
  width: "5em",
38018
38805
  height: "2em"
@@ -38026,7 +38813,7 @@ const EmbeddedStatus = ({
38026
38813
  small: true
38027
38814
  })
38028
38815
  }) : (statusTag == null ? void 0 : statusTag.translationKey) && jsx("section", {
38029
- className: styles["adyen-kyc-embedded-status__tag"],
38816
+ className: styles.embeddedStatusTag,
38030
38817
  children: loading ? jsx(Skeleton, {
38031
38818
  width: "8ch",
38032
38819
  height: "1em"
@@ -38037,6 +38824,66 @@ const EmbeddedStatus = ({
38037
38824
  })]
38038
38825
  });
38039
38826
  };
38827
+ function ContractingStatus({
38828
+ legalEntityId,
38829
+ onClick,
38830
+ title,
38831
+ subtitle = ""
38832
+ }) {
38833
+ const {
38834
+ getServiceAgreementStatus: getServiceAgreementStatus2,
38835
+ getServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos2
38836
+ } = useComponentApi(legalEntityId);
38837
+ const [isLoading, setIsLoading] = useState(true);
38838
+ const [hasSignedAll, setHasSignedAll] = useState(false);
38839
+ const getUnsigned = useCallback(async () => getServiceAgreementStatus2(legalEntityId), [getServiceAgreementStatus2, legalEntityId]);
38840
+ const getSigned = useCallback(async () => getServiceAgreementAcceptanceInfos2(legalEntityId), [getServiceAgreementAcceptanceInfos2, legalEntityId]);
38841
+ const getStatus = useCallback(async () => {
38842
+ const [signedRes, unsignedRes] = await Promise.all([getSigned(), getUnsigned()]);
38843
+ const signed = signedRes.data.map((d) => d.type);
38844
+ const unsigned = unsignedRes.termsOfServiceTypes;
38845
+ return signed.length !== 0 && unsigned.length === 0;
38846
+ }, [getUnsigned, getSigned]);
38847
+ useEffect(() => {
38848
+ getStatus().then((allSigned) => {
38849
+ setIsLoading(false);
38850
+ setHasSignedAll(allSigned);
38851
+ }).catch(() => {
38852
+ });
38853
+ });
38854
+ const handleClick = () => {
38855
+ onClick == null ? void 0 : onClick();
38856
+ };
38857
+ return hasSignedAll ? jsx(EmbeddedStatus, {
38858
+ onClick,
38859
+ title,
38860
+ subtitle,
38861
+ tagLabel: "complete",
38862
+ loading: isLoading
38863
+ }) : jsx(EmbeddedStatus, {
38864
+ onClick,
38865
+ actionButton: {
38866
+ labelKey: "sign",
38867
+ onClick: handleClick
38868
+ },
38869
+ title,
38870
+ subtitle,
38871
+ loading: isLoading
38872
+ });
38873
+ }
38874
+ function ManageContractingComponent({
38875
+ legalEntityId,
38876
+ onClick
38877
+ }) {
38878
+ const {
38879
+ i18n
38880
+ } = useI18nContext();
38881
+ return jsx(ContractingStatus, {
38882
+ legalEntityId,
38883
+ title: i18n.get("serviceAgreements"),
38884
+ onClick
38885
+ });
38886
+ }
38040
38887
  function LegalEntityStatus({
38041
38888
  legalEntityId,
38042
38889
  onClick
@@ -38125,17 +38972,64 @@ function useInterval(callback, initialDelay = DEFAULT_POLLING_INTERVAL) {
38125
38972
  }, [timeoutId]);
38126
38973
  return timeoutId;
38127
38974
  }
38975
+ const Confirm = ({
38976
+ onConfirm,
38977
+ title,
38978
+ confirmBtnLabel,
38979
+ onClose
38980
+ }) => {
38981
+ const {
38982
+ i18n
38983
+ } = useI18nContext();
38984
+ const [isInFlight, setIsInFlight] = useState(false);
38985
+ const handleConfirm = async () => {
38986
+ setIsInFlight(true);
38987
+ try {
38988
+ await onConfirm();
38989
+ } finally {
38990
+ setIsInFlight(false);
38991
+ onClose();
38992
+ }
38993
+ };
38994
+ const modalHeader = jsx(Typography, {
38995
+ variant: "title",
38996
+ el: "h3",
38997
+ className: "adyen-kyc-u-margin-top-8 adyen-kyc-u-margin-left-8",
38998
+ children: title
38999
+ });
39000
+ const modalFooter = jsx(EmbeddedActionBar, {
39001
+ right: jsxs(Fragment, {
39002
+ children: [jsx(Button, {
39003
+ label: i18n.get("cancel"),
39004
+ onClick: onClose,
39005
+ secondary: true
39006
+ }), jsx(Button, {
39007
+ label: confirmBtnLabel || i18n.get("confirm"),
39008
+ onClick: handleConfirm,
39009
+ critical: true,
39010
+ disabled: isInFlight
39011
+ })]
39012
+ })
39013
+ });
39014
+ return jsx(Modal, {
39015
+ header: modalHeader,
39016
+ footer: modalFooter,
39017
+ size: "small"
39018
+ });
39019
+ };
38128
39020
  function ManageTransferInstrumentOverviewItemModal({
38129
39021
  status,
38130
39022
  transferInstrument,
38131
39023
  onEdit,
38132
39024
  onClose,
38133
- onRemove
39025
+ onRemove,
39026
+ onInitiateRemove
38134
39027
  }) {
38135
39028
  var _a, _b, _c;
38136
39029
  const {
38137
39030
  i18n
38138
39031
  } = useI18nContext();
39032
+ const [confirmOpen, setConfirmOpen] = useState(false);
38139
39033
  const datasetUtils = datasetUtilities(i18n.locale);
38140
39034
  const isReviewInProgress = status === "PROCESSING";
38141
39035
  const showEditButton = status !== "ERROR" && !(transferInstrument == null ? void 0 : transferInstrument.bankAccount.trustedSource);
@@ -38192,14 +39086,31 @@ function ManageTransferInstrumentOverviewItemModal({
38192
39086
  };
38193
39087
  const modalHeader = jsx(Typography, {
38194
39088
  variant: "title-l",
39089
+ el: "h3",
39090
+ className: "adyen-kyc-manage-ti-overview-item-summary__header",
38195
39091
  children: i18n.get("bankAccount")
38196
39092
  });
39093
+ const handleRemove = async () => {
39094
+ await onRemove(transferInstrument.id);
39095
+ onClose();
39096
+ };
39097
+ const handleDeleteClick = async () => {
39098
+ if (onInitiateRemove) {
39099
+ const confirmDeletion = onInitiateRemove();
39100
+ if (confirmDeletion) await handleRemove();
39101
+ } else {
39102
+ setConfirmOpen(true);
39103
+ }
39104
+ };
38197
39105
  const modalFooter = () => {
38198
39106
  if (!transferInstrument) return;
38199
39107
  const actions = jsxs(Fragment, {
38200
- children: [jsx(Remove, {
38201
- onRemove: async () => onRemove(transferInstrument.id),
38202
- isRemoveDisabled: isReviewInProgress
39108
+ children: [jsx(Button, {
39109
+ title: i18n.get("delete"),
39110
+ icon: "bin",
39111
+ secondary: true,
39112
+ disabled: isReviewInProgress,
39113
+ onClick: handleDeleteClick
38203
39114
  }), showEditButton && jsx(Button, {
38204
39115
  label: i18n.get("edit"),
38205
39116
  onClick: () => onEdit(transferInstrument.id),
@@ -38210,28 +39121,35 @@ function ManageTransferInstrumentOverviewItemModal({
38210
39121
  right: actions
38211
39122
  });
38212
39123
  };
38213
- return jsx(Modal, {
38214
- header: modalHeader,
38215
- onClose: () => onClose(),
38216
- footer: modalFooter(),
38217
- children: !transferInstrument ? jsx(Loader, {}) : jsxs("div", {
38218
- className: "adyen-kyc-manage-ti-overview-item-summary",
38219
- children: [!!((_b = (_a = problems.BankAccount) == null ? void 0 : _a[transferInstrument.id]) == null ? void 0 : _b.verificationErrors) && jsx(VerificationErrorAlert, {
38220
- className: "adyen-kyc-manage-ti-overview-item-summary__error",
38221
- problems: (_c = problems.BankAccount) == null ? void 0 : _c[transferInstrument.id],
38222
- children: jsx(Button, {
38223
- className: "adyen-kyc-manage-ti-overview-item-summary__error-button",
38224
- label: i18n.get("editDetails"),
38225
- tertiary: true,
38226
- onClick: () => onEdit(transferInstrument.id)
38227
- })
38228
- }), getStructuredLists().map((listItems) => jsx(Card, {
38229
- className: "adyen-kyc-manage-ti-overview-item-summary__card",
38230
- children: jsx(StructuredList, {
38231
- items: listItems
38232
- })
38233
- }, listItems))]
38234
- })
39124
+ return jsxs(Fragment, {
39125
+ children: [jsx(Modal, {
39126
+ header: modalHeader,
39127
+ onClose,
39128
+ footer: modalFooter(),
39129
+ children: !transferInstrument ? jsx(Loader, {}) : jsxs("div", {
39130
+ className: "adyen-kyc-manage-ti-overview-item-summary",
39131
+ children: [!!((_b = (_a = problems.BankAccount) == null ? void 0 : _a[transferInstrument.id]) == null ? void 0 : _b.verificationErrors) && jsx(VerificationErrorAlert, {
39132
+ className: "adyen-kyc-manage-ti-overview-item-summary__error",
39133
+ problems: (_c = problems.BankAccount) == null ? void 0 : _c[transferInstrument.id],
39134
+ children: jsx(Button, {
39135
+ className: "adyen-kyc-manage-ti-overview-item-summary__error-button",
39136
+ label: i18n.get("editDetails"),
39137
+ tertiary: true,
39138
+ onClick: () => onEdit(transferInstrument.id)
39139
+ })
39140
+ }), getStructuredLists().map((listItems) => jsx(Card, {
39141
+ className: "adyen-kyc-manage-ti-overview-item-summary__card",
39142
+ children: jsx(StructuredList, {
39143
+ items: listItems
39144
+ })
39145
+ }, listItems))]
39146
+ })
39147
+ }), confirmOpen && jsx(Confirm, {
39148
+ title: i18n.get("areYouSureYouWantToDeleteThisBankAccount"),
39149
+ confirmBtnLabel: i18n.get("delete"),
39150
+ onConfirm: handleRemove,
39151
+ onClose: () => setConfirmOpen(false)
39152
+ })]
38235
39153
  });
38236
39154
  }
38237
39155
  function ManageTransferInstrumentOverviewItem({
@@ -38239,7 +39157,8 @@ function ManageTransferInstrumentOverviewItem({
38239
39157
  transferInstrument,
38240
39158
  onEdit,
38241
39159
  onOpen,
38242
- onRemove
39160
+ onRemove,
39161
+ onInitiateRemove
38243
39162
  }) {
38244
39163
  const {
38245
39164
  i18n
@@ -38269,6 +39188,7 @@ function ManageTransferInstrumentOverviewItem({
38269
39188
  transferInstrument,
38270
39189
  onEdit,
38271
39190
  onRemove,
39191
+ onInitiateRemove,
38272
39192
  onClose: () => setModalOpen(false),
38273
39193
  status: transferInstrumentReference.status
38274
39194
  })]
@@ -38277,14 +39197,18 @@ function ManageTransferInstrumentOverviewItem({
38277
39197
  const logger$d = createLogger("ManageTransferInstrumentOverview");
38278
39198
  function ManageTransferInstrumentOverview({
38279
39199
  transferInstrumentReferences,
39200
+ legalEntityId,
38280
39201
  onEdit,
38281
39202
  onAdd,
38282
39203
  onRemove,
38283
- legalEntityId
39204
+ onInitiateRemove
38284
39205
  }) {
38285
39206
  const {
38286
39207
  i18n
38287
39208
  } = useI18nContext();
39209
+ const {
39210
+ showToast
39211
+ } = useToastContext();
38288
39212
  const {
38289
39213
  getTransferInstrument: getTransferInstrument2,
38290
39214
  deleteTransferInstrument: deleteTransferInstrument2
@@ -38307,6 +39231,10 @@ function ManageTransferInstrumentOverview({
38307
39231
  await deleteTransferInstrument2(transferInstrumentId);
38308
39232
  onRemove(transferInstrumentId);
38309
39233
  } catch (e) {
39234
+ showToast({
39235
+ label: i18n.get("thereWasAnErrorTryAgain"),
39236
+ type: "error"
39237
+ });
38310
39238
  logger$d.error(e);
38311
39239
  }
38312
39240
  };
@@ -38315,6 +39243,7 @@ function ManageTransferInstrumentOverview({
38315
39243
  transferInstrumentReference: transferInstrumentRef,
38316
39244
  onEdit,
38317
39245
  onRemove: onRemoveTransferInstrument,
39246
+ onInitiateRemove,
38318
39247
  onOpen: onShowBankDetails
38319
39248
  }, transferInstrumentRef.transferInstrument.id));
38320
39249
  return jsxs("section", {
@@ -38333,6 +39262,7 @@ function ManageTransferInstrumentComponent({
38333
39262
  legalEntityId,
38334
39263
  onAdd,
38335
39264
  onEdit,
39265
+ onInitiateRemove,
38336
39266
  onRemoveSuccess,
38337
39267
  eventEmitter
38338
39268
  }) {
@@ -38393,6 +39323,7 @@ function ManageTransferInstrumentComponent({
38393
39323
  transferInstrumentReferences: transferInstruments,
38394
39324
  onEdit: (transferInstrumentId) => onEdit(transferInstrumentId, legalEntityId),
38395
39325
  onRemove,
39326
+ onInitiateRemove,
38396
39327
  onAdd,
38397
39328
  legalEntityId
38398
39329
  })]
@@ -40409,6 +41340,7 @@ const componentsMap = {
40409
41340
  onboardingDropinComponent: OnboardingDropinComponent,
40410
41341
  manageIndividualComponent: ManageIndividualComponent,
40411
41342
  createContractingComponent: CreateContractingComponent,
41343
+ manageContractingComponent: ManageContractingComponent,
40412
41344
  viewVerificationStatusComponent: ViewVerificationStatusComponent,
40413
41345
  updateLegalEntityForHighExposureComponent: UpdateLegalEntityForHighExposure
40414
41346
  };
@@ -40865,7 +41797,7 @@ const ConfigurationApiProvider = ({
40865
41797
  isEmbeddedDropin,
40866
41798
  loadingContext
40867
41799
  } = authContext;
40868
- const sdkVersion = "3.28.1";
41800
+ const sdkVersion = "3.30.0";
40869
41801
  useAnalytics({
40870
41802
  onUserEvent,
40871
41803
  legalEntityId: rootLegalEntityId,
@@ -41057,7 +41989,8 @@ const settingsDefaults = {
41057
41989
  hideOnboardingIntroductionSoleProprietor: true,
41058
41990
  viewOnboardingGuidance: false,
41059
41991
  transferInstrumentLimit: 0,
41060
- instantBankVerification: true
41992
+ instantBankVerification: true,
41993
+ showServiceAgreementsFirst: false
41061
41994
  };
41062
41995
  function SettingsProvider({
41063
41996
  children,
@@ -41432,6 +42365,7 @@ class BaseElement {
41432
42365
  ...props
41433
42366
  };
41434
42367
  this._parentInstance = this.props._parentInstance;
42368
+ this.remove = this.remove.bind(this);
41435
42369
  }
41436
42370
  /**
41437
42371
  * Mounts an element into the dom
@@ -41491,6 +42425,7 @@ class BaseElement {
41491
42425
  if (this._node) {
41492
42426
  render(null, this._node);
41493
42427
  }
42428
+ this._node = void 0;
41494
42429
  return this;
41495
42430
  }
41496
42431
  /**
@@ -41547,7 +42482,7 @@ const DebugModal = ({
41547
42482
  };
41548
42483
  const copyToClipboard = async () => {
41549
42484
  const toCopy = {
41550
- sdkVersion: "3.28.1",
42485
+ sdkVersion: "3.30.0",
41551
42486
  experiments: Object.fromEntries(allExperimentsWithValues),
41552
42487
  settings: Object.fromEntries(allSettingsWithValues)
41553
42488
  };
@@ -41586,7 +42521,7 @@ const DebugModal = ({
41586
42521
  children: [jsxs("div", {
41587
42522
  className: "adyen-kyc-debug-modal__meta",
41588
42523
  children: [jsxs("span", {
41589
- children: ["SDK version: ", "3.28.1"]
42524
+ children: ["SDK version: ", "3.30.0"]
41590
42525
  }), jsxs("span", {
41591
42526
  children: ["rootLegalEntityId: ", rootLegalEntityId]
41592
42527
  })]
@@ -41734,14 +42669,14 @@ class UIElement extends BaseElement {
41734
42669
  rootLegalEntityId,
41735
42670
  handleGetLegalEntity: "handleGetLegalEntity" in this.props.componentProps ? this.props.componentProps.handleGetLegalEntity : void 0,
41736
42671
  children: jsx("div", {
41737
- className: "adyen-kyc-ui-element-container-wrapper",
41738
42672
  children: jsx(AutoResizer, {
41739
42673
  children: jsx("div", {
41740
42674
  className: "adyen-kyc-ui-element-container",
41741
42675
  children: jsx(ToastContextProvider, {
41742
42676
  children: jsx(StateProvider, {
41743
42677
  children: jsx(Component, {
41744
- ...this.props.componentProps
42678
+ ...this.props.componentProps,
42679
+ onUnmount: this.remove
41745
42680
  })
41746
42681
  })
41747
42682
  })
@@ -42470,6 +43405,9 @@ const manageTransferInstrumentComponentSchema = {
42470
43405
  onRemoveSuccess: {
42471
43406
  type: "function"
42472
43407
  },
43408
+ onInitiateRemove: {
43409
+ type: "function"
43410
+ },
42473
43411
  legalEntityId: {
42474
43412
  type: "string",
42475
43413
  required: true
@@ -42505,6 +43443,11 @@ const createContractingComponentSchema = {
42505
43443
  type: "boolean"
42506
43444
  }
42507
43445
  };
43446
+ const manageContractingComponentSchema = {
43447
+ legalEntityId: {
43448
+ type: "string"
43449
+ }
43450
+ };
42508
43451
  const viewVerificationStatusComponentSchema = {
42509
43452
  legalEntityId: {
42510
43453
  type: "string",
@@ -42565,6 +43508,7 @@ const componentsSchemaMap = {
42565
43508
  createIndividualComponent: createIndividualComponentSchema,
42566
43509
  manageIndividualComponent: manageIndividualComponentSchema,
42567
43510
  createContractingComponent: createContractingComponentSchema,
43511
+ manageContractingComponent: manageContractingComponentSchema,
42568
43512
  createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
42569
43513
  viewVerificationStatusComponent: viewVerificationStatusComponentSchema,
42570
43514
  updateLegalEntityForHighExposureComponent: updateLegalEntityForHighExposureComponentSchema,