@adyen/kyc-components 3.28.0 → 3.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -216,6 +216,7 @@ const defaultTrans = {
216
216
  businessSelection__footerButton: "Add details manually",
217
217
  businessSelection__heading: "Select your business",
218
218
  businessSelection__invalidTin: "This company's TIN doesn't match yours",
219
+ businessSelection__tinVerificationFailure: "Sorry, something went wrong. Try again or continue by pressing Add details manually",
219
220
  businessStructure: "Business structure",
220
221
  businessTrust: "Business trust",
221
222
  businessTrusteeDetails: "Business trustee details",
@@ -1682,6 +1683,12 @@ function useToastContext() {
1682
1683
  }
1683
1684
  return context;
1684
1685
  }
1686
+ const CoreContext = createContext(void 0);
1687
+ const useCoreContext = () => {
1688
+ const context = useContext(CoreContext);
1689
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
1690
+ return context;
1691
+ };
1685
1692
  let suppressed = false;
1686
1693
  const consoleMethodsPrefixable = Object.freeze(["debug", "info", "log", "warn", "error", "trace"]);
1687
1694
  const stringSubstitutionRegex = /%([soOc]|(\.\d)?[dif])/;
@@ -2036,10 +2043,10 @@ function useBusinessData({
2036
2043
  handleVerifyTin,
2037
2044
  handleClearCompanyData
2038
2045
  }) {
2039
- const [isSearching, setIsSearching] = useState("idle");
2040
- const [isFetching, setIsFetching] = useState("idle");
2041
- const [isVerifying, setIsVerifying] = useState("idle");
2042
- const [isClearingTrustedData, setIsClearingTrustedData] = useState("idle");
2046
+ const [searching, setSearching] = useState("idle");
2047
+ const [fetching, setFetching] = useState("idle");
2048
+ const [verifying, setVerifying] = useState("idle");
2049
+ const [resettingTrustedData, setResettingTrustedData] = useState("idle");
2043
2050
  const [searchResults, setSearchResults] = useState();
2044
2051
  const [cachedSearch, setCachedSearch] = useState();
2045
2052
  const [cachedBusiness, setCachedBusiness] = useState();
@@ -2052,7 +2059,7 @@ function useBusinessData({
2052
2059
  }
2053
2060
  if (searchResults && objectsDeepEqual(cachedSearch, data)) return;
2054
2061
  try {
2055
- setIsSearching("loading");
2062
+ setSearching("loading");
2056
2063
  const {
2057
2064
  results
2058
2065
  } = KNOWN_BROKEN_PRIMARY_SOURCE_CONNECTIONS.includes(data.state) ? await handleCompanyIndexSearch({
@@ -2065,11 +2072,11 @@ function useBusinessData({
2065
2072
  setSearchResults(results);
2066
2073
  return results;
2067
2074
  } catch (e) {
2068
- setIsSearching("error");
2075
+ setSearching("error");
2069
2076
  logger$I.error(e);
2070
2077
  } finally {
2071
2078
  setCachedSearch(data);
2072
- setIsSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
2079
+ setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
2073
2080
  }
2074
2081
  }, [handleCompanyDeepSearch, handleCompanyIndexSearch, searchResults, cachedSearch]);
2075
2082
  const fetchBusinessData = useCallback(async (company) => {
@@ -2087,7 +2094,8 @@ function useBusinessData({
2087
2094
  const date = (/* @__PURE__ */ new Date()).toDateString();
2088
2095
  const isDataCompliant = company.lastUpdate ? Date.parse(date) - Date.parse(company.lastUpdate) < LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW : false;
2089
2096
  try {
2090
- setIsFetching("loading");
2097
+ setFetching("loading");
2098
+ setVerifying("idle");
2091
2099
  setInvalidTin(false);
2092
2100
  const businessData = isDataCompliant ? await handleGetCompanyDataset({
2093
2101
  companyId: company.id,
@@ -2099,11 +2107,11 @@ function useBusinessData({
2099
2107
  setCachedBusiness(businessData);
2100
2108
  return businessData;
2101
2109
  } catch (e) {
2102
- setIsFetching("error");
2110
+ setFetching("error");
2103
2111
  setCachedBusiness(void 0);
2104
2112
  logger$I.error(e);
2105
2113
  } finally {
2106
- setIsFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
2114
+ setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
2107
2115
  }
2108
2116
  }, [cachedBusiness, handleGetCompanyDataset, handleRefreshCompanyDataset]);
2109
2117
  const verifyBusinessData = useCallback(async (data, tin) => {
@@ -2112,7 +2120,7 @@ function useBusinessData({
2112
2120
  return;
2113
2121
  }
2114
2122
  try {
2115
- setIsVerifying("loading");
2123
+ setVerifying("loading");
2116
2124
  setVerifiedBusiness(void 0);
2117
2125
  setInvalidTin(false);
2118
2126
  const {
@@ -2128,21 +2136,21 @@ function useBusinessData({
2128
2136
  }
2129
2137
  return matched;
2130
2138
  } catch (e) {
2131
- setIsVerifying("error");
2139
+ setVerifying("error");
2132
2140
  logger$I.error(e);
2133
2141
  } finally {
2134
- setIsVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
2142
+ setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
2135
2143
  }
2136
2144
  }, [handleVerifyTin]);
2137
2145
  const clearTrustedBusinessData = useCallback(async () => {
2138
2146
  try {
2139
- setIsClearingTrustedData("loading");
2147
+ setResettingTrustedData("loading");
2140
2148
  await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
2141
2149
  } catch (e) {
2142
- setIsClearingTrustedData("error");
2150
+ setResettingTrustedData("error");
2143
2151
  logger$I.error(e);
2144
2152
  } finally {
2145
- setIsClearingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
2153
+ setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
2146
2154
  }
2147
2155
  }, [handleClearCompanyData]);
2148
2156
  const resetBusinessData = () => {
@@ -2161,10 +2169,10 @@ function useBusinessData({
2161
2169
  resetBusinessData,
2162
2170
  resetTinVerification,
2163
2171
  // Data
2164
- isSearching,
2165
- isFetching,
2166
- isVerifying,
2167
- isClearingTrustedData,
2172
+ searching,
2173
+ fetching,
2174
+ verifying,
2175
+ resettingTrustedData,
2168
2176
  currentSearchName: cachedSearch == null ? void 0 : cachedSearch.text,
2169
2177
  searchResults,
2170
2178
  verifiedBusiness,
@@ -15027,12 +15035,6 @@ function IdDocumentManualUploadComponent(props) {
15027
15035
  });
15028
15036
  }
15029
15037
  const IdDocumentManualUpload = memo(IdDocumentManualUploadComponent, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.name === nextProps.name);
15030
- const CoreContext = createContext(void 0);
15031
- const useCoreContext = () => {
15032
- const context = useContext(CoreContext);
15033
- if (!context) throw Error("You need a <CoreProvider> to use core context");
15034
- return context;
15035
- };
15036
15038
  const useIdVerificationToken = ({
15037
15039
  userDetails,
15038
15040
  legalEntityId,
@@ -24933,8 +24935,8 @@ function BusinessInformationCard({
24933
24935
  result,
24934
24936
  selectedBusinessId,
24935
24937
  currentBusinessSelection,
24936
- fetching,
24937
- failedToLoad,
24938
+ fetchStatus,
24939
+ verifyStatus,
24938
24940
  invalidTin,
24939
24941
  resetTinVerification,
24940
24942
  setIsBusinessSelection,
@@ -24944,9 +24946,9 @@ function BusinessInformationCard({
24944
24946
  const {
24945
24947
  i18n
24946
24948
  } = useI18nContext();
24947
- const showSelectButton = !fetching && !failedToLoad && currentBusinessSelection;
24949
+ const showSelectButton = fetchStatus !== "loading" && fetchStatus !== "error" && currentBusinessSelection;
24948
24950
  const selectBusiness = (searchResult) => {
24949
- if (failedToLoad && selectedBusinessId === searchResult.id) return;
24951
+ if (fetchStatus === "error" && selectedBusinessId === searchResult.id) return;
24950
24952
  return handleSelectBusiness(searchResult);
24951
24953
  };
24952
24954
  const handleGoBack = () => {
@@ -24959,7 +24961,7 @@ function BusinessInformationCard({
24959
24961
  title: result.name,
24960
24962
  subTitle: result.registrationNumber,
24961
24963
  stateful: true,
24962
- fetching: fetching && selectedBusinessId === result.id,
24964
+ fetching: fetchStatus === "loading" && selectedBusinessId === result.id,
24963
24965
  active: selectedBusinessId === result.id,
24964
24966
  headerButton: selectedBusinessId === result.id && showSelectButton ? jsx(Button, {
24965
24967
  label: i18n.get("thisIsMyBusiness"),
@@ -24981,7 +24983,11 @@ function BusinessInformationCard({
24981
24983
  showAsLink: true
24982
24984
  }),
24983
24985
  testId: "invalidTin"
24984
- }), failedToLoad && jsx(Alert, {
24986
+ }), verifyStatus === "error" && jsx(Alert, {
24987
+ variant: "error",
24988
+ title: i18n.get("businessSelection__tinVerificationFailure"),
24989
+ testId: "tinVerificationFailure"
24990
+ }), fetchStatus === "error" && jsx(Alert, {
24985
24991
  variant: "info",
24986
24992
  type: "callToAction",
24987
24993
  title: i18n.get("businessSelection__failedToLoad"),
@@ -24992,8 +24998,8 @@ function BusinessInformationCard({
24992
24998
  showAsLink: true
24993
24999
  }),
24994
25000
  testId: "failedToLoad"
24995
- }), !failedToLoad && jsx(BusinessInformation, {
24996
- fetching,
25001
+ }), fetchStatus !== "error" && jsx(BusinessInformation, {
25002
+ fetching: fetchStatus === "loading",
24997
25003
  selectedBusiness: currentBusinessSelection
24998
25004
  })]
24999
25005
  })
@@ -25002,10 +25008,10 @@ function BusinessInformationCard({
25002
25008
  const logger$r = createLogger("BusinessSelection");
25003
25009
  function BusinessSelectionComponent({
25004
25010
  showCompanyStructure,
25005
- isSearching,
25006
- isFetching,
25007
- isVerifying,
25008
- isClearingTrustedData,
25011
+ searching,
25012
+ fetching,
25013
+ verifying,
25014
+ resettingTrustedData,
25009
25015
  searchResults,
25010
25016
  invalidTin,
25011
25017
  fetchBusinessData,
@@ -25033,19 +25039,19 @@ function BusinessSelectionComponent({
25033
25039
  }, [setShowCompanyStructure, verifyBusinessData]);
25034
25040
  const handleSelectBusiness = useCallback(async (result) => {
25035
25041
  try {
25036
- if (isFetching === "loading") return;
25042
+ if (fetching === "loading") return;
25037
25043
  if (!selectedBusinessId || selectedBusinessId !== result.id) {
25038
25044
  setSelectedBusinessId(result.id);
25039
25045
  const businessData = await fetchBusinessData(result);
25040
25046
  setCurrentBusinessSelection(businessData);
25041
- } else if (isFetching === "error") {
25047
+ } else if (fetching === "error") {
25042
25048
  const businessData = await fetchBusinessData(result);
25043
25049
  setCurrentBusinessSelection(businessData);
25044
25050
  }
25045
25051
  } catch (e) {
25046
25052
  logger$r.error(e);
25047
25053
  }
25048
- }, [fetchBusinessData, isFetching, selectedBusinessId]);
25054
+ }, [fetchBusinessData, fetching, selectedBusinessId]);
25049
25055
  const handleConfirmSelection = useCallback(async (data) => {
25050
25056
  if (!currentTin) return;
25051
25057
  try {
@@ -25057,7 +25063,7 @@ function BusinessSelectionComponent({
25057
25063
  logger$r.error(e);
25058
25064
  }
25059
25065
  }, [currentTin, handleNextClick, handleBusinessVerification]);
25060
- const showLoader = isSearching === "loading" || isVerifying === "loading" || isClearingTrustedData === "loading" || isFetching === "loading" && (searchResults == null ? void 0 : searchResults.length) === 1;
25066
+ const showLoader = searching === "loading" || verifying === "loading" || resettingTrustedData === "loading" || fetching === "loading" && (searchResults == null ? void 0 : searchResults.length) === 1;
25061
25067
  const businessSelectionClasses = cx("adyen-kyc-business-selection", {
25062
25068
  "adyen-kyc-business-selection--loading": showLoader
25063
25069
  });
@@ -25082,8 +25088,8 @@ function BusinessSelectionComponent({
25082
25088
  result,
25083
25089
  selectedBusinessId,
25084
25090
  currentBusinessSelection,
25085
- fetching: isFetching === "loading",
25086
- failedToLoad: isFetching === "error",
25091
+ fetchStatus: fetching,
25092
+ verifyStatus: verifying,
25087
25093
  invalidTin,
25088
25094
  resetTinVerification,
25089
25095
  handleSelectBusiness,
@@ -25205,10 +25211,10 @@ function BasicInformationComponent({
25205
25211
  showBusinessSelection,
25206
25212
  showCompanyStructure,
25207
25213
  isActiveForm,
25208
- isSearching,
25209
- isFetching,
25210
- isVerifying,
25211
- isClearingTrustedData,
25214
+ searching,
25215
+ fetching,
25216
+ verifying,
25217
+ resettingTrustedData,
25212
25218
  searchResults,
25213
25219
  invalidTin,
25214
25220
  verifiedBusiness,
@@ -25333,10 +25339,10 @@ function BasicInformationComponent({
25333
25339
  if (showBusinessSelection) {
25334
25340
  return jsx(BusinessSelectionComponent, {
25335
25341
  showCompanyStructure,
25336
- isSearching,
25337
- isFetching,
25338
- isVerifying,
25339
- isClearingTrustedData,
25342
+ searching,
25343
+ fetching,
25344
+ verifying,
25345
+ resettingTrustedData,
25340
25346
  searchResults,
25341
25347
  invalidTin,
25342
25348
  fetchBusinessData,
@@ -25923,10 +25929,10 @@ function BusinessDetailsComponent(props) {
25923
25929
  showBusinessSelection,
25924
25930
  setShowBusinessSelection,
25925
25931
  setShowCompanyStructure,
25926
- isSearching,
25927
- isFetching,
25928
- isVerifying,
25929
- isClearingTrustedData,
25932
+ searching,
25933
+ fetching,
25934
+ verifying,
25935
+ resettingTrustedData,
25930
25936
  searchResults,
25931
25937
  invalidTin,
25932
25938
  verifiedBusiness,
@@ -25967,10 +25973,10 @@ function BusinessDetailsComponent(props) {
25967
25973
  showBusinessSelection,
25968
25974
  showCompanyStructure,
25969
25975
  isActiveForm: (activeForm == null ? void 0 : activeForm.formId) === forms2.basicInformation.formId,
25970
- isSearching,
25971
- isFetching,
25972
- isVerifying,
25973
- isClearingTrustedData,
25976
+ searching,
25977
+ fetching,
25978
+ verifying,
25979
+ resettingTrustedData,
25974
25980
  fetchBusinessData,
25975
25981
  verifyBusinessData,
25976
25982
  proceedToManualDataEntry,
@@ -27142,9 +27148,10 @@ async function submit({
27142
27148
  showToast,
27143
27149
  clearToasts,
27144
27150
  handleUpdateLegalEntity,
27145
- onExternalSubmit
27151
+ onExternalSubmit,
27152
+ accountHolder
27146
27153
  }) {
27147
- var _a, _b, _c, _d;
27154
+ var _a, _b, _c, _d, _e;
27148
27155
  const logger2 = createLogger("submitBusinessDetails");
27149
27156
  setLoadingStatus("loading");
27150
27157
  const trackingPayload = {
@@ -27157,7 +27164,7 @@ async function submit({
27157
27164
  const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
27158
27165
  const legalEntity = {
27159
27166
  ...mapBusinessDetailsSchemaToLegalEntity(filteredData),
27160
- entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse, entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type])
27167
+ entityAssociations: filterOutUnwantedAssociationsIfRootLE(TaskTypes.BUSINESS_DETAILS, legalEntityResponse, ((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder)
27161
27168
  };
27162
27169
  try {
27163
27170
  userEvents.addEvent(BusinessDetailsEvents.TASK_SUBMIT, {
@@ -27229,7 +27236,6 @@ function BusinessDetailsDropinComponent({
27229
27236
  parentLegalEntity,
27230
27237
  trackingConfig,
27231
27238
  capabilities,
27232
- accountHolder,
27233
27239
  taskName,
27234
27240
  hideDropinLayout,
27235
27241
  homeButtonLabel,
@@ -27272,6 +27278,10 @@ function BusinessDetailsDropinComponent({
27272
27278
  });
27273
27279
  }, []);
27274
27280
  const formRef = useRef(null);
27281
+ const {
27282
+ accountHolder,
27283
+ setAccountHolder
27284
+ } = useCoreContext();
27275
27285
  const {
27276
27286
  showToast,
27277
27287
  clearToasts
@@ -27290,7 +27300,7 @@ function BusinessDetailsDropinComponent({
27290
27300
  var _a2;
27291
27301
  return ((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.country) ?? country;
27292
27302
  }, [(_a = currentState.data.basicInformation) == null ? void 0 : _a.country, country]);
27293
- const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
27303
+ const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
27294
27304
  const [trustedFields, setTrustedFields] = useState(legalEntityResponse.trustedFields);
27295
27305
  const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
27296
27306
  useEffect(() => {
@@ -27348,22 +27358,26 @@ function BusinessDetailsDropinComponent({
27348
27358
  data: formatDataForSummary$1(currentState.data, forms2, derivedProps == null ? void 0 : derivedProps.labels, i18n),
27349
27359
  omittedKeys: ["operationalAddressIsSame"]
27350
27360
  }), [currentState.data, derivedProps == null ? void 0 : derivedProps.labels, forms2, i18n]);
27351
- const submitTask = useCallback(() => submit({
27352
- data: currentState.data,
27353
- legalEntityResponse,
27354
- isTargetLegalEntityType: Boolean(isTargetLegalEntityType),
27355
- baseTrackingPayload,
27356
- problems: currentProblems,
27357
- forms: forms2,
27358
- documentUtils,
27359
- i18n,
27360
- setLoadingStatus,
27361
- setProblems: setCurrentProblems,
27362
- showToast,
27363
- clearToasts,
27364
- handleUpdateLegalEntity,
27365
- onExternalSubmit
27366
- }), [baseTrackingPayload, clearToasts, currentState.data, documentUtils, forms2, handleUpdateLegalEntity, i18n, isTargetLegalEntityType, legalEntityResponse, onExternalSubmit, currentProblems, showToast]);
27361
+ const submitTask = useCallback(() => {
27362
+ var _a2;
27363
+ setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
27364
+ return submit({
27365
+ data: currentState.data,
27366
+ legalEntityResponse,
27367
+ isTargetLegalEntityType: Boolean(isTargetLegalEntityType),
27368
+ baseTrackingPayload,
27369
+ problems: currentProblems,
27370
+ forms: forms2,
27371
+ documentUtils,
27372
+ i18n,
27373
+ setLoadingStatus,
27374
+ setProblems: setCurrentProblems,
27375
+ showToast,
27376
+ clearToasts,
27377
+ handleUpdateLegalEntity,
27378
+ onExternalSubmit
27379
+ });
27380
+ }, [baseTrackingPayload, clearToasts, currentState.data, documentUtils, forms2, handleUpdateLegalEntity, i18n, isTargetLegalEntityType, legalEntityResponse, onExternalSubmit, currentProblems, showToast]);
27367
27381
  const {
27368
27382
  handleNextClick,
27369
27383
  handleBackClick,
@@ -27388,10 +27402,10 @@ function BusinessDetailsDropinComponent({
27388
27402
  clearTrustedBusinessData,
27389
27403
  resetBusinessData,
27390
27404
  resetTinVerification,
27391
- isSearching,
27392
- isFetching,
27393
- isVerifying,
27394
- isClearingTrustedData,
27405
+ searching,
27406
+ fetching,
27407
+ verifying,
27408
+ resettingTrustedData,
27395
27409
  currentSearchName,
27396
27410
  searchResults,
27397
27411
  invalidTin,
@@ -27422,10 +27436,10 @@ function BusinessDetailsDropinComponent({
27422
27436
  }
27423
27437
  }, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
27424
27438
  useEffect(() => {
27425
- if (searchResults && !searchResults.length || isSearching === "error") {
27439
+ if (searchResults && !searchResults.length || searching === "error") {
27426
27440
  setShowCompanyStructure(true);
27427
27441
  }
27428
- }, [searchResults, isSearching]);
27442
+ }, [searchResults, searching]);
27429
27443
  useEffect(() => {
27430
27444
  var _a2;
27431
27445
  if (((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) !== currentSearchName) {
@@ -27438,16 +27452,16 @@ function BusinessDetailsDropinComponent({
27438
27452
  const hideBack = useMemo(() => {
27439
27453
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideBackButton;
27440
27454
  if (isBusinessSelection) {
27441
- return isSearching === "loading" || isFetching === "loading" || isVerifying === "loading" || isClearingTrustedData === "loading" ? hideBackButton : false;
27455
+ return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? hideBackButton : false;
27442
27456
  }
27443
27457
  return hideBackButton;
27444
- }, [currentCountry, hideBackButton, isBusinessSelection, isSearching, isFetching, isVerifying, isClearingTrustedData]);
27458
+ }, [currentCountry, hideBackButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
27445
27459
  const hideHome = useMemo(() => {
27446
27460
  if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return hideHomeButton;
27447
27461
  if (isBusinessSelection) {
27448
- return isSearching === "loading" || isFetching === "loading" || isVerifying === "loading" || isClearingTrustedData === "loading" ? true : hideHomeButton;
27462
+ return searching === "loading" || fetching === "loading" || verifying === "loading" || resettingTrustedData === "loading" ? true : hideHomeButton;
27449
27463
  }
27450
- }, [currentCountry, hideHomeButton, isBusinessSelection, isSearching, isFetching, isVerifying, isClearingTrustedData]);
27464
+ }, [currentCountry, hideHomeButton, isBusinessSelection, searching, fetching, verifying, resettingTrustedData]);
27451
27465
  const goToForm = useCallback((index) => {
27452
27466
  var _a2, _b2, _c2, _d2, _e2, _f2;
27453
27467
  const form = forms2[index].formId;
@@ -27510,12 +27524,12 @@ function BusinessDetailsDropinComponent({
27510
27524
  return showBusinessSelection ? setShowBusinessSelection(false) : void 0;
27511
27525
  }
27512
27526
  case "companyStructure": {
27513
- if (isSearching === "error") {
27527
+ if (searching === "error") {
27514
27528
  setShowBusinessSelection(false);
27515
27529
  setShowCompanyStructure(false);
27516
27530
  return handleBackClick == null ? void 0 : handleBackClick();
27517
27531
  }
27518
- if (isSearching !== "loading" && searchResults && !searchResults.length) {
27532
+ if (searching !== "loading" && searchResults && !searchResults.length) {
27519
27533
  setShowBusinessSelection(false);
27520
27534
  } else if (!verifiedBusiness) setShowCompanyStructure(false);
27521
27535
  return handleBackClick == null ? void 0 : handleBackClick();
@@ -27529,7 +27543,7 @@ function BusinessDetailsDropinComponent({
27529
27543
  default:
27530
27544
  return handleBackClick == null ? void 0 : handleBackClick();
27531
27545
  }
27532
- }, [activeForm.formId, country, handleBackClick, handleNextClick, isSearching, searchResults, showBusinessSelection, verifiedBusiness]);
27546
+ }, [activeForm.formId, country, handleBackClick, handleNextClick, searching, searchResults, showBusinessSelection, verifiedBusiness]);
27533
27547
  const proceedToManualDataEntry = useCallback(async () => {
27534
27548
  await clearTrustedBusinessData().then(() => setShowCompanyStructure(true));
27535
27549
  }, [clearTrustedBusinessData]);
@@ -27580,10 +27594,10 @@ function BusinessDetailsDropinComponent({
27580
27594
  invalidTin,
27581
27595
  resetTinVerification,
27582
27596
  verifiedBusiness,
27583
- isSearching,
27584
- isFetching,
27585
- isVerifying,
27586
- isClearingTrustedData,
27597
+ searching,
27598
+ fetching,
27599
+ verifying,
27600
+ resettingTrustedData,
27587
27601
  searchForBusiness,
27588
27602
  fetchBusinessData,
27589
27603
  verifyBusinessData,
@@ -28997,7 +29011,8 @@ function useCompanySearchTaskSubmit({
28997
29011
  setProblems,
28998
29012
  setLoadingStatus,
28999
29013
  onExternalSubmit,
29000
- handleUpdateLegalEntity
29014
+ handleUpdateLegalEntity,
29015
+ accountHolder
29001
29016
  }) {
29002
29017
  const {
29003
29018
  showToast,
@@ -29042,7 +29057,7 @@ function useCompanySearchTaskSubmit({
29042
29057
  const submit2 = useCallback(async ({
29043
29058
  data
29044
29059
  }) => {
29045
- var _a, _b, _c, _d;
29060
+ var _a, _b, _c, _d, _e;
29046
29061
  setLoadingStatus("loading");
29047
29062
  const trackingPayload = {
29048
29063
  companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
@@ -29054,7 +29069,7 @@ function useCompanySearchTaskSubmit({
29054
29069
  const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
29055
29070
  const legalEntity = {
29056
29071
  ...mapCompanySearchSchemaToLegalEntity(filteredData),
29057
- entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse, entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type])
29072
+ entityAssociations: filterOutUnwantedAssociationsIfRootLE(task, legalEntityResponse, (((_e = data.companyStructure) == null ? void 0 : _e.accountHolder) || accountHolder) ?? void 0)
29058
29073
  };
29059
29074
  try {
29060
29075
  userEvents.addEvent(CompanySearchEvents.TASK_SUBMIT, {
@@ -29261,7 +29276,6 @@ function CompanySearchDropinComponent({
29261
29276
  taskName,
29262
29277
  hideDropinLayout,
29263
29278
  homeButtonLabel,
29264
- accountHolder,
29265
29279
  onChange,
29266
29280
  onSubmit: onExternalSubmit,
29267
29281
  handleHomeClick,
@@ -29288,6 +29302,10 @@ function CompanySearchDropinComponent({
29288
29302
  useEffect(() => {
29289
29303
  onChange == null ? void 0 : onChange(currentState);
29290
29304
  }, [currentState, onChange]);
29305
+ const {
29306
+ accountHolder,
29307
+ setAccountHolder
29308
+ } = useCoreContext();
29291
29309
  const formRef = useRef(null);
29292
29310
  const {
29293
29311
  showToast
@@ -29303,7 +29321,7 @@ function CompanySearchDropinComponent({
29303
29321
  } = useExperimentsContext();
29304
29322
  const isNewEntryFlowEnabled = useEnableNewEntryFlow();
29305
29323
  const [loadingStatus, setLoadingStatus] = useState("success");
29306
- const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
29324
+ const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled && accountHolder ? accountHolder : void 0));
29307
29325
  const country = useMemo(() => {
29308
29326
  var _a2;
29309
29327
  return ((_a2 = currentState.data.companyBasics) == null ? void 0 : _a2.country) ?? parentCountry;
@@ -29393,7 +29411,8 @@ function CompanySearchDropinComponent({
29393
29411
  setProblems,
29394
29412
  setLoadingStatus,
29395
29413
  onExternalSubmit,
29396
- handleUpdateLegalEntity
29414
+ handleUpdateLegalEntity,
29415
+ accountHolder
29397
29416
  });
29398
29417
  const {
29399
29418
  handleNextClick,
@@ -29431,9 +29450,13 @@ function CompanySearchDropinComponent({
29431
29450
  activeForm,
29432
29451
  validateForm: () => setShouldValidate(true),
29433
29452
  baseTrackingPayload,
29434
- onSubmit: () => submit2({
29435
- data: currentState.data
29436
- }),
29453
+ onSubmit: () => {
29454
+ var _a2;
29455
+ setAccountHolder(((_a2 = currentState.data.companyStructure) == null ? void 0 : _a2.accountHolder) || accountHolder);
29456
+ return submit2({
29457
+ data: currentState.data
29458
+ });
29459
+ },
29437
29460
  problems,
29438
29461
  canSubmit: canSubmitForm,
29439
29462
  summary: summaryData,
@@ -33021,7 +33044,8 @@ function IndividualDropinComponent({
33021
33044
  }
33022
33045
  });
33023
33046
  const accountHolderToEvaluated = ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder) || accountHolder;
33024
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated ?? void 0);
33047
+ const filteredEntityAssociation = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated || void 0);
33048
+ legalEntity.entityAssociations = filteredEntityAssociation;
33025
33049
  const createdLegalEntity = await submitLegalEntity({
33026
33050
  dataSubmitted,
33027
33051
  legalEntity,
@@ -36722,7 +36746,6 @@ function DropinComposerComponent({
36722
36746
  handleVerifyTin: args.handleVerifyTin,
36723
36747
  onTypeSwitch: navigateToTypeSwitcher,
36724
36748
  isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
36725
- accountHolder,
36726
36749
  trustedFields: singpassTrustedFields,
36727
36750
  trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
36728
36751
  });
@@ -36762,8 +36785,7 @@ function DropinComposerComponent({
36762
36785
  handleVerifyTin: args.handleVerifyTin,
36763
36786
  handleClearCompanyData: args.handleClearCompanyData,
36764
36787
  onTypeSwitch: navigateToTypeSwitcher,
36765
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
36766
- accountHolder
36788
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
36767
36789
  })
36768
36790
  });
36769
36791
  case TaskTypes.TRUST_MEMBER_COMPANY:
@@ -40843,7 +40865,7 @@ const ConfigurationApiProvider = ({
40843
40865
  isEmbeddedDropin,
40844
40866
  loadingContext
40845
40867
  } = authContext;
40846
- const sdkVersion = "3.28.0";
40868
+ const sdkVersion = "3.28.1";
40847
40869
  useAnalytics({
40848
40870
  onUserEvent,
40849
40871
  legalEntityId: rootLegalEntityId,
@@ -41525,7 +41547,7 @@ const DebugModal = ({
41525
41547
  };
41526
41548
  const copyToClipboard = async () => {
41527
41549
  const toCopy = {
41528
- sdkVersion: "3.28.0",
41550
+ sdkVersion: "3.28.1",
41529
41551
  experiments: Object.fromEntries(allExperimentsWithValues),
41530
41552
  settings: Object.fromEntries(allSettingsWithValues)
41531
41553
  };
@@ -41564,7 +41586,7 @@ const DebugModal = ({
41564
41586
  children: [jsxs("div", {
41565
41587
  className: "adyen-kyc-debug-modal__meta",
41566
41588
  children: [jsxs("span", {
41567
- children: ["SDK version: ", "3.28.0"]
41589
+ children: ["SDK version: ", "3.28.1"]
41568
41590
  }), jsxs("span", {
41569
41591
  children: ["rootLegalEntityId: ", rootLegalEntityId]
41570
41592
  })]
@@ -3,4 +3,4 @@ import type { BusinessDetailsSchema } from '../../BusinessDetails/types';
3
3
  import type { BasicInformationProps, BasicInformationSchema } from '../types';
4
4
  export declare const BASIC_INFORMATION_FORM_ID: keyof BusinessDetailsSchema;
5
5
  export declare const BASIC_INFORMATION_FIELDS: Array<keyof BasicInformationSchema>;
6
- export declare function BasicInformationComponent({ data, labels, placeholders, helperText, heading, description, readOnly, shouldValidate, formVerificationErrors, fieldValidationErrors, allFields, requiredFields, obscuredFields, optionalFields, readOnlyFields, trustedFields, country, companyType, isTopLevelEntity, className, showBusinessSelection, showCompanyStructure, isActiveForm, isSearching, isFetching, isVerifying, isClearingTrustedData, searchResults, invalidTin, verifiedBusiness, fetchBusinessData, verifyBusinessData, proceedToManualDataEntry, handleNextClick, setShowBusinessSelection, setShowCompanyStructure, resetTinVerification, }: BasicInformationProps): import("preact").JSX.Element;
6
+ export declare function BasicInformationComponent({ data, labels, placeholders, helperText, heading, description, readOnly, shouldValidate, formVerificationErrors, fieldValidationErrors, allFields, requiredFields, obscuredFields, optionalFields, readOnlyFields, trustedFields, country, companyType, isTopLevelEntity, className, showBusinessSelection, showCompanyStructure, isActiveForm, searching, fetching, verifying, resettingTrustedData, searchResults, invalidTin, verifiedBusiness, fetchBusinessData, verifyBusinessData, proceedToManualDataEntry, handleNextClick, setShowBusinessSelection, setShowCompanyStructure, resetTinVerification, }: BasicInformationProps): import("preact").JSX.Element;
@@ -19,10 +19,10 @@ export interface BasicInformationProps extends BaseInnerFormProps<BasicInformati
19
19
  showBusinessSelection: boolean;
20
20
  showCompanyStructure: boolean;
21
21
  isActiveForm: boolean;
22
- isSearching: HookStatus;
23
- isFetching: HookStatus;
24
- isVerifying: HookStatus;
25
- isClearingTrustedData: HookStatus;
22
+ searching: HookStatus;
23
+ fetching: HookStatus;
24
+ verifying: HookStatus;
25
+ resettingTrustedData: HookStatus;
26
26
  searchResults: CompanySearchResult[] | undefined;
27
27
  invalidTin: boolean;
28
28
  verifiedBusiness: CompanyDatasetResponse | undefined;
@@ -24,10 +24,10 @@ export interface BusinessDetailsProps extends BaseOuterFormProps<BusinessDetails
24
24
  baseTrackingPayload: BaseTrackingPayload;
25
25
  showCompanyStructure: boolean;
26
26
  showBusinessSelection: boolean;
27
- isSearching: HookStatus;
28
- isFetching: HookStatus;
29
- isVerifying: HookStatus;
30
- isClearingTrustedData: HookStatus;
27
+ searching: HookStatus;
28
+ fetching: HookStatus;
29
+ verifying: HookStatus;
30
+ resettingTrustedData: HookStatus;
31
31
  searchResults: Array<CompanySearchResult> | undefined;
32
32
  invalidTin: boolean;
33
33
  verifiedBusiness: CompanyDatasetResponse | undefined;
@@ -1,17 +1,18 @@
1
1
  import './BusinessInformationCard.scss';
2
2
  import { type Dispatch, type StateUpdater } from 'preact/hooks';
3
+ import type { HookStatus } from '../../core/hooks/types';
3
4
  import type { CompanyDatasetResponse, CompanySearchResult } from '../../core/models/api/company-search';
4
5
  interface BusinessInformationCardProps {
5
6
  result: CompanySearchResult;
6
7
  selectedBusinessId: string | undefined;
7
8
  currentBusinessSelection: CompanyDatasetResponse | undefined;
8
- fetching: boolean;
9
- failedToLoad: boolean;
9
+ fetchStatus: HookStatus;
10
+ verifyStatus: HookStatus;
10
11
  invalidTin: boolean;
11
12
  setIsBusinessSelection: Dispatch<StateUpdater<boolean>>;
12
13
  resetTinVerification: () => void;
13
14
  handleSelectBusiness: (result: CompanySearchResult) => Promise<void>;
14
15
  handleConfirmSelection: (data: CompanyDatasetResponse) => Promise<void>;
15
16
  }
16
- export declare function BusinessInformationCard({ result, selectedBusinessId, currentBusinessSelection, fetching, failedToLoad, invalidTin, resetTinVerification, setIsBusinessSelection, handleSelectBusiness, handleConfirmSelection, }: BusinessInformationCardProps): import("preact").JSX.Element;
17
+ export declare function BusinessInformationCard({ result, selectedBusinessId, currentBusinessSelection, fetchStatus, verifyStatus, invalidTin, resetTinVerification, setIsBusinessSelection, handleSelectBusiness, handleConfirmSelection, }: BusinessInformationCardProps): import("preact").JSX.Element;
17
18
  export {};
@@ -1,3 +1,3 @@
1
1
  import './BusinessSelectionComponent.scss';
2
2
  import type { BusinessSelectionProps } from '../types';
3
- export declare function BusinessSelectionComponent({ showCompanyStructure, isSearching, isFetching, isVerifying, isClearingTrustedData, searchResults, invalidTin, fetchBusinessData, verifyBusinessData, resetTinVerification, proceedToManualDataEntry, handleNextClick, setIsBusinessSelection, setShowCompanyStructure, }: BusinessSelectionProps): import("preact").JSX.Element;
3
+ export declare function BusinessSelectionComponent({ showCompanyStructure, searching, fetching, verifying, resettingTrustedData, searchResults, invalidTin, fetchBusinessData, verifyBusinessData, resetTinVerification, proceedToManualDataEntry, handleNextClick, setIsBusinessSelection, setShowCompanyStructure, }: BusinessSelectionProps): import("preact").JSX.Element;
@@ -3,10 +3,10 @@ import type { HookStatus } from '../../core/hooks/types';
3
3
  import type { CompanyDatasetResponse, CompanySearchResult } from '../../core/models/api/company-search';
4
4
  export interface BusinessSelectionProps {
5
5
  showCompanyStructure: boolean;
6
- isSearching: HookStatus;
7
- isFetching: HookStatus;
8
- isVerifying: HookStatus;
9
- isClearingTrustedData: HookStatus;
6
+ searching: HookStatus;
7
+ fetching: HookStatus;
8
+ verifying: HookStatus;
9
+ resettingTrustedData: HookStatus;
10
10
  searchResults: CompanySearchResult[] | undefined;
11
11
  invalidTin: boolean;
12
12
  fetchBusinessData: (company: CompanySearchResult) => Promise<CompanyDatasetResponse | undefined>;
@@ -1,2 +1,2 @@
1
1
  import { type BusinessDetailsDropinProps } from '../types';
2
- export declare function BusinessDetailsDropinComponent({ country, problems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, capabilities, accountHolder, taskName, hideDropinLayout, homeButtonLabel, taskType, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, handleClearCompanyData, onTypeSwitch, }: BusinessDetailsDropinProps): import("preact").JSX.Element;
2
+ export declare function BusinessDetailsDropinComponent({ country, problems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, capabilities, taskName, hideDropinLayout, homeButtonLabel, taskType, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, handleClearCompanyData, onTypeSwitch, }: BusinessDetailsDropinProps): import("preact").JSX.Element;
@@ -32,13 +32,12 @@ export type BusinessDetailsDropinApihandler = Required<Pick<DropinAPIHandlers, '
32
32
  handleVerifyTin?: DropinAPIHandlers['handleVerifyTin'];
33
33
  handleClearCompanyData?: DropinAPIHandlers['handleClearCompanyData'];
34
34
  };
35
- export type BusinessDetailsDropin = Omit<BusinessDetailsProps, 'isTopLevelEntity' | 'baseTrackingPayload' | 'handleNextClick' | 'showCompanyStructure' | 'showBusinessSelection' | 'isSearching' | 'isFetching' | 'isVerifying' | 'isClearingTrustedData' | 'searchResults' | 'invalidTin' | 'resetTinVerification' | 'verifiedBusiness' | 'searchForBusiness' | 'fetchBusinessData' | 'verifyBusinessData' | 'proceedToManualDataEntry' | 'setShowBusinessSelection' | 'setShowCompanyStructure'>;
35
+ export type BusinessDetailsDropin = Omit<BusinessDetailsProps, 'isTopLevelEntity' | 'baseTrackingPayload' | 'handleNextClick' | 'showCompanyStructure' | 'showBusinessSelection' | 'searching' | 'fetching' | 'verifying' | 'resettingTrustedData' | 'searchResults' | 'invalidTin' | 'resetTinVerification' | 'verifiedBusiness' | 'searchForBusiness' | 'fetchBusinessData' | 'verifyBusinessData' | 'proceedToManualDataEntry' | 'setShowBusinessSelection' | 'setShowCompanyStructure'>;
36
36
  export interface BusinessDetailsDropinProps extends BusinessDetailsDropin, BusinessDetailsDropinApihandler, DropinProps {
37
37
  legalEntityResponse: ExistingLegalEntity;
38
38
  isTargetLegalEntityType?: boolean;
39
39
  parentLegalEntity?: LegalEntity;
40
40
  associationDetail?: TrustMember;
41
- accountHolder?: AccountHolderOption;
42
41
  }
43
42
  export interface SubmitDocumentsProps {
44
43
  data: BusinessDetailsSchema;
@@ -62,4 +61,5 @@ export interface SubmitProps {
62
61
  clearToasts: () => void;
63
62
  handleUpdateLegalEntity: Required<DropinAPIHandlers>['handleUpdateLegalEntity'];
64
63
  onExternalSubmit: ((data: BusinessDetailsSchema) => void) | undefined;
64
+ accountHolder?: AccountHolderOption;
65
65
  }
@@ -10,4 +10,4 @@ export declare const isDocumentsRequired: (forms: FormModelWithValidity[]) => bo
10
10
  export declare const removeConditionalForms: (forms: FormModelWithValidity[], isSkippingCompanyStructure: boolean) => FormModelWithValidity[];
11
11
  export declare const formatDataForSummary: (data: BusinessDetailsSchema, forms: FormModelWithValidity[], labels: OuterFormLabels<BusinessDetailsSchema>, i18n: Language) => {};
12
12
  export declare function submitDocuments({ data, legalEntity, forms, documentUtils, baseTrackingPayload, }: SubmitDocumentsProps): Promise<void>;
13
- export declare function submit({ data, legalEntityResponse, isTargetLegalEntityType, baseTrackingPayload, forms, problems, documentUtils, i18n, setLoadingStatus, setProblems, showToast, clearToasts, handleUpdateLegalEntity, onExternalSubmit, }: SubmitProps): Promise<void>;
13
+ export declare function submit({ data, legalEntityResponse, isTargetLegalEntityType, baseTrackingPayload, forms, problems, documentUtils, i18n, setLoadingStatus, setProblems, showToast, clearToasts, handleUpdateLegalEntity, onExternalSubmit, accountHolder, }: SubmitProps): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import type { CompanySearchDropinProps } from '../types';
2
- export declare function CompanySearchDropinComponent({ country: parentCountry, problems: propProblems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, taskType, capabilities, taskName, hideDropinLayout, homeButtonLabel, accountHolder, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, onTypeSwitch, trustedFields, }: CompanySearchDropinProps): import("preact").JSX.Element;
2
+ export declare function CompanySearchDropinComponent({ country: parentCountry, problems: propProblems, legalEntityResponse, isTargetLegalEntityType, parentLegalEntity, trackingConfig, taskType, capabilities, taskName, hideDropinLayout, homeButtonLabel, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, onTypeSwitch, trustedFields, }: CompanySearchDropinProps): import("preact").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import type { ExistingLegalEntity, LegalEntity } from '../../../core/models/api/legal-entity';
2
2
  import type { CompanySearchProps } from '../../CompanySearch/types';
3
- import type { AccountHolderOption } from '../../internal/AccountHolder/types';
4
3
  import type { TrustMember } from '../../TrustMembers/types';
5
4
  import type { DropinAPIHandlers, DropinProps } from '../types';
6
5
  export declare enum CompanySearchEvents {
@@ -22,5 +21,4 @@ export interface CompanySearchDropinProps extends Omit<CompanySearchProps, 'isTo
22
21
  isTargetLegalEntityType?: boolean;
23
22
  parentLegalEntity?: LegalEntity;
24
23
  associationDetail?: TrustMember;
25
- accountHolder?: AccountHolderOption;
26
24
  }
@@ -16,10 +16,10 @@ export type UseBusinessData = {
16
16
  clearTrustedBusinessData: () => Promise<void>;
17
17
  resetBusinessData: () => void;
18
18
  resetTinVerification: () => void;
19
- isSearching: HookStatus;
20
- isFetching: HookStatus;
21
- isVerifying: HookStatus;
22
- isClearingTrustedData: HookStatus;
19
+ searching: HookStatus;
20
+ fetching: HookStatus;
21
+ verifying: HookStatus;
22
+ resettingTrustedData: HookStatus;
23
23
  currentSearchName: string | undefined;
24
24
  searchResults: CompanySearchResult[] | undefined;
25
25
  verifiedBusiness: CompanyDatasetResponse | undefined;
@@ -1,6 +1,7 @@
1
1
  import type { Dispatch, StateUpdater } from 'preact/hooks';
2
2
  import type { CompanySearchSchema } from '../../components/CompanySearch/types';
3
3
  import type { DropinAPIHandlers } from '../../components/Dropins/types';
4
+ import type { AccountHolderOption } from '../../components/internal/AccountHolder/types';
4
5
  import type { LoadingStatus } from '../../components/internal/LoaderWrapper/constants';
5
6
  import { TaskTypes } from '../../components/TaskList/types';
6
7
  import type { DocumentApiUtils } from '../../utils/api/documentUtils';
@@ -27,8 +28,9 @@ export interface FormTaskSubmitOptions {
27
28
  setLoadingStatus: Dispatch<StateUpdater<LoadingStatus>>;
28
29
  onExternalSubmit?: (company: CompanySearchSchema) => void;
29
30
  handleUpdateLegalEntity: Required<DropinAPIHandlers>['handleUpdateLegalEntity'];
31
+ accountHolder: AccountHolderOption | null;
30
32
  }
31
33
  export type FormTaskSubmit<FormTaskSchema> = {
32
34
  submit: (options: SubmitOptions<FormTaskSchema>) => Promise<void>;
33
35
  };
34
- export declare function useCompanySearchTaskSubmit<FormTaskSchema extends CompanySearchSchema>({ task, forms, legalEntityResponse, problems, baseTrackingPayload, isTargetLegalEntityType, documentUtils, setProblems, setLoadingStatus, onExternalSubmit, handleUpdateLegalEntity, }: FormTaskSubmitOptions): FormTaskSubmit<FormTaskSchema>;
36
+ export declare function useCompanySearchTaskSubmit<FormTaskSchema extends CompanySearchSchema>({ task, forms, legalEntityResponse, problems, baseTrackingPayload, isTargetLegalEntityType, documentUtils, setProblems, setLoadingStatus, onExternalSubmit, handleUpdateLegalEntity, accountHolder, }: FormTaskSubmitOptions): FormTaskSubmit<FormTaskSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.28.0",
3
+ "version": "3.28.1",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",