@adyen/kyc-components 3.7.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/es/adyen-kyc-components.es.js +200 -182
  2. package/dist/style.css +6 -0
  3. package/dist/types/components/BankVerification/BankVerification.d.ts +1 -1
  4. package/dist/types/components/BankVerification/types.d.ts +5 -5
  5. package/dist/types/components/BusinessTypeSelection/utils.d.ts +2 -1
  6. package/dist/types/components/CompanyBasics/types.d.ts +3 -3
  7. package/dist/types/components/CompanyLookup/types.d.ts +4 -4
  8. package/dist/types/components/Individual/types.d.ts +2 -2
  9. package/dist/types/components/PayoutDetails/types.d.ts +2 -2
  10. package/dist/types/components/TaskList/component/TaskListComponent.d.ts +1 -1
  11. package/dist/types/components/TaskList/types.d.ts +3 -2
  12. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  13. package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +2 -2
  14. package/dist/types/components/internal/EntityAssociation/types.d.ts +2 -2
  15. package/dist/types/components/internal/Remove/types.d.ts +3 -3
  16. package/dist/types/components/internal/TaxInformationField/types.d.ts +2 -2
  17. package/dist/types/components/internal/VatNumberField/types.d.ts +2 -2
  18. package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiContext.d.ts +1 -1
  19. package/dist/types/core/Context/ExperimentContext/types.d.ts +2 -1
  20. package/dist/types/core/Services/componentApi/validate-account-identification.d.ts +4 -0
  21. package/dist/types/core/Services/kycExternalApi/index.d.ts +1 -1
  22. package/dist/types/core/Services/kycExternalApi/{account-identification.d.ts → validate-account-identification.d.ts} +1 -1
  23. package/dist/types/core/hooks/introduction/useHasSeenIntroduction.d.ts +1 -1
  24. package/dist/types/core/hooks/useCompanySearch/types.d.ts +2 -2
  25. package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -3
  26. package/dist/types/core/hooks/useForm/types.d.ts +8 -8
  27. package/dist/types/core/hooks/useFormComposer.d.ts +2 -2
  28. package/dist/types/core/hooks/useLocalStorage.d.ts +2 -2
  29. package/dist/types/core/hooks/useTrust.d.ts +11 -0
  30. package/dist/types/language/config.d.ts +2 -1256
  31. package/dist/types/language/types.d.ts +1 -1
  32. package/dist/types/utils/entity-status-util.d.ts +1 -1
  33. package/dist/types/utils/trust-util.d.ts +2 -1
  34. package/dist/types/utils/useStateFromProp.d.ts +2 -2
  35. package/package.json +3 -5
@@ -16,6 +16,15 @@ const useConfigurationApi = () => {
16
16
  }
17
17
  return configurationApi;
18
18
  };
19
+ const smartling = {
20
+ placeholder_format: "YAML",
21
+ translate_paths: [
22
+ {
23
+ path: "*",
24
+ key: "{*}"
25
+ }
26
+ ]
27
+ };
19
28
  const close = "Close";
20
29
  const individual = "Individual";
21
30
  const payoutAccount = "Payout account";
@@ -1261,6 +1270,7 @@ const completeAddingAccount = "Complete adding account";
1261
1270
  const removeThisBankAccount = "Remove this bank account";
1262
1271
  const editDetails = "Edit details";
1263
1272
  const defaultTrans = {
1273
+ smartling,
1264
1274
  close,
1265
1275
  individual,
1266
1276
  payoutAccount,
@@ -2515,7 +2525,10 @@ const defaultTrans = {
2515
2525
  editDetails
2516
2526
  };
2517
2527
  const FALLBACK_LOCALE = "en-US";
2518
- const defaultTranslation = defaultTrans;
2528
+ const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
2529
+ ...acc,
2530
+ [translationKey]: translationValue
2531
+ } : acc, {});
2519
2532
  const determineAllowedAttributes = (allowedTags) => {
2520
2533
  const allowedAttributes = [];
2521
2534
  if (allowedTags.includes("a")) {
@@ -3004,7 +3017,7 @@ const icons = {
3004
3017
  warning: lazy(() => import("./warning-99uFf1WU.js")),
3005
3018
  wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
3006
3019
  };
3007
- const logger$x = createLogger("Icon");
3020
+ const logger$y = createLogger("Icon");
3008
3021
  const Icon = ({
3009
3022
  className,
3010
3023
  name,
@@ -3012,7 +3025,7 @@ const Icon = ({
3012
3025
  }) => {
3013
3026
  const LazyLoadedIcon = icons[name];
3014
3027
  if (!LazyLoadedIcon) {
3015
- logger$x.error(`No such icon: "${name}"`);
3028
+ logger$y.error(`No such icon: "${name}"`);
3016
3029
  return null;
3017
3030
  }
3018
3031
  return jsx("span", {
@@ -3216,7 +3229,7 @@ function useFormRouterContext() {
3216
3229
  }
3217
3230
  return context;
3218
3231
  }
3219
- const logger$w = createLogger("Link");
3232
+ const logger$x = createLogger("Link");
3220
3233
  const getIconClass = (icon, external) => {
3221
3234
  if (external) {
3222
3235
  return "adl-link__icon adyen-kyc-icon-external-link";
@@ -3228,7 +3241,7 @@ const getIconClass = (icon, external) => {
3228
3241
  };
3229
3242
  const isValidLink = (href) => {
3230
3243
  if (href === "#") {
3231
- logger$w.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3244
+ logger$x.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3232
3245
  return false;
3233
3246
  }
3234
3247
  return true;
@@ -3516,7 +3529,7 @@ const useSetting = (settingName) => {
3516
3529
  } = context;
3517
3530
  return getSetting(settingName);
3518
3531
  };
3519
- const logger$v = createLogger("useAllowedCountries");
3532
+ const logger$w = createLogger("useAllowedCountries");
3520
3533
  const useAllowedCountries = () => {
3521
3534
  const acceptedCountries = useSetting("acceptedCountries");
3522
3535
  const {
@@ -3526,7 +3539,7 @@ const useAllowedCountries = () => {
3526
3539
  useEffect(() => {
3527
3540
  if (acceptedCountries !== void 0)
3528
3541
  return;
3529
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$v.error);
3542
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$w.error);
3530
3543
  }, [acceptedCountries]);
3531
3544
  return allowedCountries;
3532
3545
  };
@@ -3865,7 +3878,7 @@ class ValidationResult {
3865
3878
  return this.validationResults.filter((result) => result.hasError);
3866
3879
  }
3867
3880
  }
3868
- const logger$u = createLogger("useAsyncValidator");
3881
+ const logger$v = createLogger("useAsyncValidator");
3869
3882
  const useAsyncValidator = (asyncRules) => {
3870
3883
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3871
3884
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3888,7 +3901,7 @@ const useAsyncValidator = (asyncRules) => {
3888
3901
  hasError: !isValid
3889
3902
  }])
3890
3903
  });
3891
- }).catch(logger$u.error);
3904
+ }).catch(logger$v.error);
3892
3905
  }, [asyncRules, clearAsyncValidationResults]);
3893
3906
  return {
3894
3907
  asyncValidationResults,
@@ -5319,7 +5332,7 @@ function useIsElementVisible(ref, fallback = true) {
5319
5332
  }, [ref]);
5320
5333
  return isOnScreen;
5321
5334
  }
5322
- const logger$t = createLogger("Flag");
5335
+ const logger$u = createLogger("Flag");
5323
5336
  const flagImports = /* @__PURE__ */ Object.assign({
5324
5337
  "../../../../assets/flags/ad.svg": () => import("./ad-DT4vRaBJ.js"),
5325
5338
  "../../../../assets/flags/ae.svg": () => import("./ae-BOcuAHGY.js"),
@@ -5576,7 +5589,7 @@ const flagImports = /* @__PURE__ */ Object.assign({
5576
5589
  const getLazyLoadedSvgComponent = (country2) => {
5577
5590
  const importForCountry = flagImports[`../../../../assets/flags/${country2.toLowerCase()}.svg`];
5578
5591
  if (!importForCountry) {
5579
- logger$t.error(`No flag available for ${country2}`);
5592
+ logger$u.error(`No flag available for ${country2}`);
5580
5593
  return void 0;
5581
5594
  }
5582
5595
  return lazy(importForCountry);
@@ -6365,7 +6378,7 @@ const deriveInputState = (isValid, isFocused, hasBlurred, isDisabled, errorMessa
6365
6378
  };
6366
6379
  };
6367
6380
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
6368
- const logger$s = createLogger("MaskedInputText");
6381
+ const logger$t = createLogger("MaskedInputText");
6369
6382
  const MaskedInputText = ({
6370
6383
  value,
6371
6384
  onInput,
@@ -6407,7 +6420,7 @@ const MaskedInputText = ({
6407
6420
  };
6408
6421
  useEffect(() => {
6409
6422
  if (!mask) {
6410
- logger$s.warn("`mask` is undefined. No masking of input will take place.");
6423
+ logger$t.warn("`mask` is undefined. No masking of input will take place.");
6411
6424
  }
6412
6425
  }, [mask]);
6413
6426
  const getMaskResult = useCallback((pureValue) => {
@@ -6434,7 +6447,7 @@ const MaskedInputText = ({
6434
6447
  return;
6435
6448
  }
6436
6449
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
6437
- logger$s.warn(`Value received "${value}" does not match mask`, maskResult, `
6450
+ logger$t.warn(`Value received "${value}" does not match mask`, maskResult, `
6438
6451
  Falling back to partially valid value "${fallback}"`);
6439
6452
  onInput(fallback);
6440
6453
  }
@@ -10542,7 +10555,7 @@ const accountHolderValidationRules = {
10542
10555
  }
10543
10556
  };
10544
10557
  const accountHolderFields = ["accountHolder"];
10545
- const logger$r = createLogger("AccountHolder");
10558
+ const logger$s = createLogger("AccountHolder");
10546
10559
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
10547
10560
  switch (legalEntityType) {
10548
10561
  case LegalEntityType.ORGANIZATION: {
@@ -10552,7 +10565,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
10552
10565
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
10553
10566
  }
10554
10567
  default:
10555
- logger$r.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10568
+ logger$s.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10556
10569
  return [];
10557
10570
  }
10558
10571
  }
@@ -11295,7 +11308,7 @@ function Dropzone(props) {
11295
11308
  })]
11296
11309
  });
11297
11310
  }
11298
- const logger$q = createLogger("TextArea");
11311
+ const logger$r = createLogger("TextArea");
11299
11312
  function TextArea(props) {
11300
11313
  const {
11301
11314
  classNameModifiers,
@@ -11316,7 +11329,7 @@ function TextArea(props) {
11316
11329
  } = useI18nContext();
11317
11330
  const [value, setValue] = useState("");
11318
11331
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11319
- logger$q.error("Error: Form fields that rely on InputBase may not have an onChange property");
11332
+ logger$r.error("Error: Form fields that rely on InputBase may not have an onChange property");
11320
11333
  }
11321
11334
  const handleInput = (e) => {
11322
11335
  var _a;
@@ -11729,7 +11742,7 @@ function FieldContainer(props) {
11729
11742
  }
11730
11743
  return renderField(fieldName);
11731
11744
  }
11732
- const logger$p = createLogger("SearchAddress");
11745
+ const logger$q = createLogger("SearchAddress");
11733
11746
  const SearchAddress = ({
11734
11747
  data,
11735
11748
  legalEntityId,
@@ -11772,7 +11785,7 @@ const SearchAddress = ({
11772
11785
  const response = await handleFindAddress(selectedAddressId);
11773
11786
  autocompleteAddressForm(response);
11774
11787
  } catch (e) {
11775
- logger$p.error(e);
11788
+ logger$q.error(e);
11776
11789
  }
11777
11790
  };
11778
11791
  const onDrilldown = async (selectedAddress) => {
@@ -11784,7 +11797,7 @@ const SearchAddress = ({
11784
11797
  }, legalEntityId);
11785
11798
  setItems((response == null ? void 0 : response.results) || []);
11786
11799
  } catch (e) {
11787
- logger$p.error(e);
11800
+ logger$q.error(e);
11788
11801
  }
11789
11802
  };
11790
11803
  const onChange = (e) => {
@@ -11839,7 +11852,7 @@ const SearchAddress = ({
11839
11852
  setItems([]);
11840
11853
  }
11841
11854
  } catch (e) {
11842
- logger$p.error(e);
11855
+ logger$q.error(e);
11843
11856
  }
11844
11857
  setLoading(false);
11845
11858
  }
@@ -14875,7 +14888,7 @@ const initOnfido = async ({
14875
14888
  language: getOnfidoLocaleConfig(i18n)
14876
14889
  });
14877
14890
  };
14878
- const logger$o = createLogger("IdVerificationComponent");
14891
+ const logger$p = createLogger("IdVerificationComponent");
14879
14892
  function IdVerificationComponent({
14880
14893
  userDetails,
14881
14894
  legalEntityId,
@@ -14908,7 +14921,7 @@ function IdVerificationComponent({
14908
14921
  onIdVerificationError,
14909
14922
  onIdVerificationComplete
14910
14923
  });
14911
- })().catch(logger$o.error);
14924
+ })().catch(logger$p.error);
14912
14925
  return () => {
14913
14926
  if (onfidoSdk.current)
14914
14927
  onfidoSdk.current.tearDown();
@@ -14960,7 +14973,7 @@ function IdDocumentAlreadyUpload(props) {
14960
14973
  })]
14961
14974
  });
14962
14975
  }
14963
- const logger$n = createLogger("IdDocumentInstantVerificationComponent");
14976
+ const logger$o = createLogger("IdDocumentInstantVerificationComponent");
14964
14977
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
14965
14978
  const documentTypeValidationRules = {
14966
14979
  instantIdVerificationData: {
@@ -15042,7 +15055,7 @@ function IdDocumentInstantVerificationComponent(props) {
15042
15055
  userDetails: props.userDetails,
15043
15056
  legalEntityId: props.legalEntityId,
15044
15057
  onIdVerificationComplete: handleIdVerificationComplete,
15045
- onIdVerificationError: logger$n.error
15058
+ onIdVerificationError: logger$o.error
15046
15059
  }), jsxs("div", {
15047
15060
  className: "adyen-kyc-document-upload__manual-upload",
15048
15061
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -17793,7 +17806,7 @@ function IndividualComponent(props) {
17793
17806
  }
17794
17807
  const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccountNumberMasked2) => {
17795
17808
  const {
17796
- accountIdentification: accountIdentification2
17809
+ validateAccountIdentification: validateAccountIdentification2
17797
17810
  } = useConfigurationApi();
17798
17811
  const [accountValidationData, setAccountValidationData] = useState({
17799
17812
  invalidFields: [],
@@ -17802,7 +17815,7 @@ const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccou
17802
17815
  useEffect(() => {
17803
17816
  const fetchAccountDetails = async (accountIdentificationPayload) => {
17804
17817
  try {
17805
- const accountIdentificationResponse = await accountIdentification2(accountIdentificationPayload);
17818
+ const accountIdentificationResponse = await validateAccountIdentification2(accountIdentificationPayload);
17806
17819
  setAccountValidationData(accountIdentificationResponse);
17807
17820
  } catch (error) {
17808
17821
  console.error("Error fetching account details:", error);
@@ -17811,7 +17824,7 @@ const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccou
17811
17824
  if (payload && !hasEmptyFields2 && !isAccountNumberMasked2) {
17812
17825
  fetchAccountDetails(payload);
17813
17826
  }
17814
- }, [accountIdentification2, hasEmptyFields2, payload]);
17827
+ }, [validateAccountIdentification2, hasEmptyFields2, payload]);
17815
17828
  return accountValidationData;
17816
17829
  };
17817
17830
  const getLegalEntityNameBasedOnType = (legalEntityResponse) => {
@@ -18509,7 +18522,7 @@ class AdyenKycSdkError extends Error {
18509
18522
  }
18510
18523
  let sdkToken;
18511
18524
  let fetchSdkToken;
18512
- const logger$m = createLogger("Session");
18525
+ const logger$n = createLogger("Session");
18513
18526
  const setSdkToken = (token) => {
18514
18527
  sdkToken = token;
18515
18528
  };
@@ -18532,7 +18545,7 @@ const refreshSession = async () => {
18532
18545
  setSdkToken(token);
18533
18546
  isSessionRefreshed = true;
18534
18547
  } catch (e) {
18535
- logger$m.error("Failed to fetch sdk token", e);
18548
+ logger$n.error("Failed to fetch sdk token", e);
18536
18549
  }
18537
18550
  return isSessionRefreshed;
18538
18551
  };
@@ -18542,7 +18555,7 @@ const addAnimationStartListener = (element, listener) => {
18542
18555
  const removeAnimationStartListener = (element, listener) => {
18543
18556
  element.removeEventListener("animationstart", listener, false);
18544
18557
  };
18545
- const logger$l = createLogger("Fetch");
18558
+ const logger$m = createLogger("Fetch");
18546
18559
  const getRequestObject = (options, data) => {
18547
18560
  const {
18548
18561
  headers = [],
@@ -18589,10 +18602,10 @@ const logFetchError = (message, level) => {
18589
18602
  case "info":
18590
18603
  case "warn":
18591
18604
  case "error":
18592
- logger$l[level](message);
18605
+ logger$m[level](message);
18593
18606
  break;
18594
18607
  default:
18595
- logger$l.error(message);
18608
+ logger$m.error(message);
18596
18609
  }
18597
18610
  };
18598
18611
  const handleFetchResponse = async (response, responseType) => {
@@ -18692,7 +18705,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
18692
18705
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
18693
18706
  const MOUNT_TIMEOUT = 10 * 1e3;
18694
18707
  const TINK_VENDOR = "Tink";
18695
- const logger$k = createLogger("iframeWidget");
18708
+ const logger$l = createLogger("iframeWidget");
18696
18709
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
18697
18710
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
18698
18711
  const parseMessageJson = (message) => {
@@ -18711,7 +18724,7 @@ const callbackErrorHandler = async (response) => {
18711
18724
  try {
18712
18725
  await response;
18713
18726
  } catch (ex) {
18714
- logger$k.error(ex);
18727
+ logger$l.error(ex);
18715
18728
  }
18716
18729
  return {
18717
18730
  error: "UNKNOWN_ERROR",
@@ -18820,7 +18833,7 @@ class IFrameWidget {
18820
18833
  message = responseData.errorMessage;
18821
18834
  }
18822
18835
  } catch (ex) {
18823
- logger$k.error(ex);
18836
+ logger$l.error(ex);
18824
18837
  }
18825
18838
  throw new AdyenKycSdkError(reason, jsonData.error);
18826
18839
  }
@@ -19008,7 +19021,7 @@ function BankVerificationWidget({
19008
19021
  ref: widgetContainerRef
19009
19022
  });
19010
19023
  }
19011
- const logger$j = createLogger("BankVerification");
19024
+ const logger$k = createLogger("BankVerification");
19012
19025
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
19013
19026
  const InstantVerificationErrorContext = createContext(null);
19014
19027
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -19042,7 +19055,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
19042
19055
  const vendor = vendors[0];
19043
19056
  setPreferredVendor(vendor.name ? vendor : void 0);
19044
19057
  };
19045
- getPreferredVendor().catch(logger$j.error);
19058
+ getPreferredVendor().catch(logger$k.error);
19046
19059
  }, [country2, getBankVerificationVendors]);
19047
19060
  return preferredVendor;
19048
19061
  };
@@ -20316,7 +20329,7 @@ const makePayoutVerificationMethodsMetadata = (svgPath, instantVerificationProvi
20316
20329
  }
20317
20330
  });
20318
20331
  const payoutVerificationMethods = ["instantVerification", "manualVerification"];
20319
- const logger$i = createLogger("useLocalStorage");
20332
+ const logger$j = createLogger("useLocalStorage");
20320
20333
  const useLocalStorage = (key, defaultValue, options) => {
20321
20334
  const {
20322
20335
  serializer,
@@ -20337,7 +20350,7 @@ const useLocalStorage = (key, defaultValue, options) => {
20337
20350
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
20338
20351
  return res;
20339
20352
  } catch (err) {
20340
- logger$i.error(err);
20353
+ logger$j.error(err);
20341
20354
  return defaultValue;
20342
20355
  }
20343
20356
  });
@@ -20369,7 +20382,7 @@ const useLocalStorage = (key, defaultValue, options) => {
20369
20382
  try {
20370
20383
  updateLocalStorage();
20371
20384
  } catch (err) {
20372
- logger$i.error(err);
20385
+ logger$j.error(err);
20373
20386
  }
20374
20387
  }, [value]);
20375
20388
  useEffect(() => {
@@ -20384,7 +20397,7 @@ const useLocalStorage = (key, defaultValue, options) => {
20384
20397
  setValue(event.newValue ? parser(event.newValue) : void 0);
20385
20398
  }
20386
20399
  } catch (err) {
20387
- logger$i.error(err);
20400
+ logger$j.error(err);
20388
20401
  }
20389
20402
  };
20390
20403
  if (typeof window === "undefined")
@@ -21363,30 +21376,10 @@ const hasMinRequiredDecisionMakerCount = (rootLegalEntity) => {
21363
21376
  return roleTypes.some((role2) => min ? (existingDecisionMakerCount == null ? void 0 : existingDecisionMakerCount[role2]) ?? min <= 0 : true);
21364
21377
  });
21365
21378
  };
21366
- const TRUST_MEMBER_COUNT_RANGE = {
21367
- [TrustMemberTypes.DEFINED_BENEFICIARY]: {
21368
- min: 1
21369
- },
21370
- [TrustMemberTypes.SETTLOR]: {
21371
- min: 1
21372
- }
21373
- };
21374
21379
  const isPartOfTrustFromLegalEntity = (legalEntity) => {
21375
21380
  var _a;
21376
21381
  return (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.entityType === LegalEntityType.TRUST && ea.associatorId === legalEntity.id);
21377
21382
  };
21378
- const getTrustLegalEntityId = (rootLegalEntity) => {
21379
- var _a;
21380
- if (!rootLegalEntity.entityAssociations)
21381
- return void 0;
21382
- return (_a = rootLegalEntity.entityAssociations.find((entityAssociation) => entityAssociation.type === LegalEntityType.TRUST)) == null ? void 0 : _a.legalEntityId;
21383
- };
21384
- const getOwnTrustMembers = (rootLegalEntity) => {
21385
- const trustLegalEntityId = getTrustLegalEntityId(rootLegalEntity);
21386
- if (!trustLegalEntityId || !rootLegalEntity.entityAssociations)
21387
- return [];
21388
- return rootLegalEntity.entityAssociations.filter((entityAssociation) => Object.values(TrustMemberTypes).includes(entityAssociation.type) && trustLegalEntityId === entityAssociation.associatorId);
21389
- };
21390
21383
  const getOwnTrustMembersLegalEntityIds = (rootLegalEntity) => {
21391
21384
  const trustLegalEntityId = getOwnTrustLegalEntityId(rootLegalEntity);
21392
21385
  if (!trustLegalEntityId)
@@ -21414,17 +21407,23 @@ const getOwnTrustProblems = (legalEntity, capabilityProblems) => {
21414
21407
  return (_a = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _a[trustLegalEntityId];
21415
21408
  }
21416
21409
  };
21417
- const getTrustMemberCount = (rootLegalEntity) => {
21418
- const trustMembers2 = getOwnTrustMembers(rootLegalEntity);
21419
- return trustMembers2.reduce((trustMemberCount, trustMember) => {
21420
- trustMemberCount[trustMember.type] = (trustMemberCount[trustMember.type] ?? 0) + 1;
21421
- return trustMemberCount;
21422
- }, {});
21423
- };
21424
- const hasMinRequiredTrustMemberCount = (rootLegalEntity) => {
21425
- const existingTrustMemberCount = getTrustMemberCount(rootLegalEntity);
21426
- const countRangeEntries = Object.entries(TRUST_MEMBER_COUNT_RANGE);
21427
- return countRangeEntries.every(([trustMemberType, requiredRange]) => requiredRange.min ? (existingTrustMemberCount == null ? void 0 : existingTrustMemberCount[trustMemberType]) ?? requiredRange.min <= 0 : true);
21410
+ const hasRequiredTrustMemberCount = (trustMembers2) => {
21411
+ if (!trustMembers2.length) {
21412
+ return false;
21413
+ }
21414
+ return DEFAULT_TRUST_MEMBER_REQUIREMENTS.every(({
21415
+ roleTypes,
21416
+ min
21417
+ }) => {
21418
+ var _a;
21419
+ if (min === 0) {
21420
+ return true;
21421
+ }
21422
+ const actualCount = ((_a = trustMembers2.filter(({
21423
+ roles
21424
+ }) => roleTypes.some((label) => roles.includes(label)))) == null ? void 0 : _a.length) ?? 0;
21425
+ return actualCount >= min;
21426
+ });
21428
21427
  };
21429
21428
  const getCountrySpecificTrustTypeOptions = (country2) => {
21430
21429
  const countrySpecificTrustTypes = countryToTrustTypes[country2];
@@ -22748,7 +22747,7 @@ const defaultPayoutAccountFormat = {
22748
22747
  [CountryCodes.Sweden]: "local",
22749
22748
  [CountryCodes.UnitedKingdom]: "local"
22750
22749
  };
22751
- const logger$h = createLogger("useScenarioConfiguration");
22750
+ const logger$i = createLogger("useScenarioConfiguration");
22752
22751
  const useScenarioConfiguration = ({
22753
22752
  getConfigurationData,
22754
22753
  getPayoutAccountFormatData,
@@ -22771,12 +22770,12 @@ const useScenarioConfiguration = ({
22771
22770
  const response = await getConfigurationData();
22772
22771
  setConfigurationResponse(response);
22773
22772
  } catch (err) {
22774
- logger$h.warn("WARNING: Configuration request failed - error:", err);
22773
+ logger$i.warn("WARNING: Configuration request failed - error:", err);
22775
22774
  } finally {
22776
22775
  setLoadingStatus("success");
22777
22776
  }
22778
22777
  };
22779
- makeConfigCallAndSave().catch(logger$h.error);
22778
+ makeConfigCallAndSave().catch(logger$i.error);
22780
22779
  }, [getConfigurationData, setLoadingStatus]);
22781
22780
  useEffect(() => {
22782
22781
  setLoadingStatus("loading");
@@ -22795,12 +22794,12 @@ const useScenarioConfiguration = ({
22795
22794
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
22796
22795
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
22797
22796
  } catch (err) {
22798
- logger$h.warn("WARNING: Payout format request failed - error:", err);
22797
+ logger$i.warn("WARNING: Payout format request failed - error:", err);
22799
22798
  } finally {
22800
22799
  setLoadingStatus("success");
22801
22800
  }
22802
22801
  };
22803
- makePayoutFormatCallAndSave().catch(logger$h.error);
22802
+ makePayoutFormatCallAndSave().catch(logger$i.error);
22804
22803
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
22805
22804
  const {
22806
22805
  fieldConfigurations,
@@ -23479,12 +23478,20 @@ const legalArrangementItems = [{
23479
23478
  name: "associationIncorporated",
23480
23479
  description: "groupOfPeopleActingTogetherForNonCommercialPurpose"
23481
23480
  }];
23482
- const getLegalArrangementOptions = (country2) => legalArrangementItems.filter((legalArrangementItem) => legalArrangementItem.id !== "aTrust" || country2 && TRUST_COUNTRIES.includes(country2));
23483
- const getSelectionOptions = (legalEntityResponse) => {
23481
+ const getLegalArrangementOptions = (country2, experiments) => legalArrangementItems.filter((legalArrangementItem) => {
23482
+ if (legalArrangementItem.id !== "aTrust" && legalArrangementItem.id !== "partnershipUnincorporated") {
23483
+ return true;
23484
+ }
23485
+ if (legalArrangementItem.id === "partnershipUnincorporated" && (experiments == null ? void 0 : experiments.ShowUnsupportedEntityType)) {
23486
+ return true;
23487
+ }
23488
+ return country2 && TRUST_COUNTRIES.includes(country2);
23489
+ });
23490
+ const getSelectionOptions = (legalEntityResponse, experiments) => {
23484
23491
  var _a, _b, _c, _d;
23485
23492
  const country2 = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? (_b = (_a = legalEntityResponse.individual) == null ? void 0 : _a.residentialAddress) == null ? void 0 : _b.country : (_d = (_c = legalEntityResponse.organization) == null ? void 0 : _c.registeredAddress) == null ? void 0 : _d.country;
23486
23493
  const businessTypeOptions = getBusinessTypeOptions(country2);
23487
- const legalArrangementOptions = getLegalArrangementOptions(country2);
23494
+ const legalArrangementOptions = getLegalArrangementOptions(country2, experiments);
23488
23495
  return {
23489
23496
  businessTypeOptions,
23490
23497
  legalArrangementOptions
@@ -23534,7 +23541,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
23534
23541
  ToastType2["ERROR"] = "error";
23535
23542
  return ToastType2;
23536
23543
  })(ToastType || {});
23537
- const logger$g = createLogger("FormRouterContextProvider");
23544
+ const logger$h = createLogger("FormRouterContextProvider");
23538
23545
  function FormRouterContextProvider({
23539
23546
  children,
23540
23547
  forms: forms2,
@@ -23554,7 +23561,7 @@ function FormRouterContextProvider({
23554
23561
  if (formIndex > -1) {
23555
23562
  setFormIndex(formIndex);
23556
23563
  } else {
23557
- logger$g.error("No form was found to have that field so form navigation failed.");
23564
+ logger$h.error("No form was found to have that field so form navigation failed.");
23558
23565
  }
23559
23566
  }
23560
23567
  }), [forms2, handleGetIdVerificationToken, setFormIndex]);
@@ -24167,7 +24174,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
24167
24174
  CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
24168
24175
  return CompanySearchEvents2;
24169
24176
  })(CompanySearchEvents || {});
24170
- const logger$f = createLogger("useCompanySearch");
24177
+ const logger$g = createLogger("useCompanySearch");
24171
24178
  const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
24172
24179
  function useCompanySearch({
24173
24180
  defaultData,
@@ -24204,30 +24211,19 @@ function useCompanySearch({
24204
24211
  deepSearch
24205
24212
  }) => {
24206
24213
  try {
24207
- if (!indexSearch || !deepSearch)
24214
+ if (!deepSearch)
24208
24215
  return;
24209
24216
  setStatus("loading");
24210
24217
  setCompaniesList([]);
24211
24218
  const {
24212
- results: indexSearchResults
24213
- } = await indexSearch({
24219
+ results: deepSearchResults
24220
+ } = await deepSearch({
24214
24221
  text: companyName2,
24215
24222
  country: companyCountry2,
24216
24223
  state: companyState,
24217
24224
  limit: resultsLimit
24218
24225
  });
24219
- if (!(indexSearchResults == null ? void 0 : indexSearchResults.length)) {
24220
- const {
24221
- results: deepSearchResults
24222
- } = await deepSearch({
24223
- text: companyName2,
24224
- country: companyCountry2,
24225
- state: companyState,
24226
- limit: resultsLimit
24227
- });
24228
- return setCompaniesList(deepSearchResults);
24229
- }
24230
- return setCompaniesList(indexSearchResults);
24226
+ return setCompaniesList(deepSearchResults);
24231
24227
  } catch (e) {
24232
24228
  setStatus("error");
24233
24229
  setError(e);
@@ -24240,37 +24236,26 @@ function useCompanySearch({
24240
24236
  return setStatus("idle");
24241
24237
  }
24242
24238
  try {
24243
- if (!handleCompanyIndexSearch || !handleCompanyDeepSearch)
24239
+ if (!handleCompanyDeepSearch)
24244
24240
  return;
24245
24241
  setStatus("loading");
24246
24242
  setSelectedCompanyId(void 0);
24247
24243
  const {
24248
- results: indexSearchResults
24249
- } = await handleCompanyIndexSearch({
24244
+ results: deepSearchResults
24245
+ } = await handleCompanyDeepSearch({
24250
24246
  text: legalCompanyName2,
24251
24247
  country: country2,
24252
24248
  state: stateOrProvince2,
24253
24249
  limit
24254
24250
  });
24255
- if (!(indexSearchResults == null ? void 0 : indexSearchResults.length)) {
24256
- const {
24257
- results: deepSearchResults
24258
- } = await handleCompanyDeepSearch({
24259
- text: legalCompanyName2,
24260
- country: country2,
24261
- state: stateOrProvince2,
24262
- limit
24263
- });
24264
- return setCompaniesList(deepSearchResults);
24265
- }
24266
- return setCompaniesList(indexSearchResults);
24251
+ return setCompaniesList(deepSearchResults);
24267
24252
  } catch (e) {
24268
24253
  setStatus("error");
24269
24254
  setError(e);
24270
24255
  } finally {
24271
24256
  setStatus((prevStatus) => prevStatus !== "error" ? "loaded" : prevStatus);
24272
24257
  }
24273
- }, [handleCompanyIndexSearch, handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
24258
+ }, [handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
24274
24259
  const verify2 = useCallback(async (companyTIN, company2) => {
24275
24260
  try {
24276
24261
  if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
@@ -24317,7 +24302,7 @@ function useCompanySearch({
24317
24302
  state: companyData.state ?? stateOrProvince2
24318
24303
  });
24319
24304
  } catch (e) {
24320
- logger$f.error(e);
24305
+ logger$g.error(e);
24321
24306
  setError(e);
24322
24307
  setStatus("error");
24323
24308
  } finally {
@@ -24350,7 +24335,7 @@ function useCompanySearch({
24350
24335
  indexSearch: handleCompanyIndexSearch,
24351
24336
  deepSearch: handleCompanyDeepSearch,
24352
24337
  resultsLimit: limit
24353
- })) == null ? void 0 : _a.catch((e) => logger$f.error(e));
24338
+ })) == null ? void 0 : _a.catch((e) => logger$g.error(e));
24354
24339
  }
24355
24340
  }, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
24356
24341
  useEffect(() => {
@@ -26127,7 +26112,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity) => {
26127
26112
  }
26128
26113
  }, {});
26129
26114
  };
26130
- const logger$e = createLogger("useFormTaskSubmit");
26115
+ const logger$f = createLogger("useFormTaskSubmit");
26131
26116
  function useCompanySearchTaskSubmit({
26132
26117
  task,
26133
26118
  forms: forms2,
@@ -26173,7 +26158,7 @@ function useCompanySearchTaskSubmit({
26173
26158
  });
26174
26159
  }
26175
26160
  } catch (e) {
26176
- logger$e.error(e);
26161
+ logger$f.error(e);
26177
26162
  userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
26178
26163
  segmentation: {
26179
26164
  ...baseTrackingPayload,
@@ -26225,7 +26210,7 @@ function useCompanySearchTaskSubmit({
26225
26210
  ...trackingPayload
26226
26211
  }
26227
26212
  });
26228
- logger$e.log(submittedLegalEntity);
26213
+ logger$f.log(submittedLegalEntity);
26229
26214
  setAccountHolder(entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type]);
26230
26215
  clearToasts();
26231
26216
  onExternalSubmit == null ? void 0 : onExternalSubmit(data);
@@ -26250,7 +26235,7 @@ function useCompanySearchTaskSubmit({
26250
26235
  type: ToastType.ERROR
26251
26236
  });
26252
26237
  }
26253
- logger$e.error(e);
26238
+ logger$f.error(e);
26254
26239
  userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
26255
26240
  segmentation: {
26256
26241
  ...baseTrackingPayload,
@@ -26683,7 +26668,7 @@ const useShouldShowIntroduction = ({
26683
26668
  });
26684
26669
  return canSeeIntroduction && !hasSeenIntroduction;
26685
26670
  };
26686
- const logger$d = createLogger("useAssociatedLegalArrangement");
26671
+ const logger$e = createLogger("useAssociatedLegalArrangement");
26687
26672
  function useAssociatedLegalArrangement({
26688
26673
  rootLegalEntity,
26689
26674
  getLegalEntity: getLegalEntity2
@@ -26694,14 +26679,14 @@ function useAssociatedLegalArrangement({
26694
26679
  var _a;
26695
26680
  const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
26696
26681
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
26697
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$d.error);
26682
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$e.error);
26698
26683
  }
26699
26684
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
26700
26685
  return {
26701
26686
  associatedLegalArrangement
26702
26687
  };
26703
26688
  }
26704
- const logger$c = createLogger("useExemptSettlor");
26689
+ const logger$d = createLogger("useExemptSettlor");
26705
26690
  const useExemptSettlor = ({
26706
26691
  trust: trust2,
26707
26692
  handleGetLegalEntity
@@ -26715,7 +26700,7 @@ const useExemptSettlor = ({
26715
26700
  useEffect(() => {
26716
26701
  if (!trust2)
26717
26702
  return;
26718
- updateExemptSettlor(trust2).catch(logger$c.error);
26703
+ updateExemptSettlor(trust2).catch(logger$d.error);
26719
26704
  }, [trust2, updateExemptSettlor]);
26720
26705
  return exemptSettlor;
26721
26706
  };
@@ -26745,6 +26730,26 @@ function useSalesChannelsSettings() {
26745
26730
  return settings;
26746
26731
  }, [isSettingEnabled]);
26747
26732
  }
26733
+ const logger$c = createLogger("useTrust");
26734
+ const useTrust = ({
26735
+ rootLegalEntity,
26736
+ handleGetLegalEntity
26737
+ }) => {
26738
+ const [trust2, setTrust] = useState();
26739
+ const refreshTrust = useCallback(async () => {
26740
+ var _a, _b;
26741
+ const trustId = (_b = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((association2) => association2.type === LegalEntityType.TRUST)) == null ? void 0 : _b.legalEntityId;
26742
+ const trustLE = trustId ? await handleGetLegalEntity(trustId) : void 0;
26743
+ setTrust(trustLE);
26744
+ return trustLE;
26745
+ }, [handleGetLegalEntity]);
26746
+ useEffect(() => {
26747
+ if (hasOwnEntityAssociationOfType(LegalEntityType.TRUST, rootLegalEntity.entityAssociations, rootLegalEntity.id)) {
26748
+ refreshTrust().catch(logger$c.error);
26749
+ }
26750
+ }, [refreshTrust]);
26751
+ return [trust2, refreshTrust];
26752
+ };
26748
26753
  const downloadFile = async (base64, filename) => {
26749
26754
  saveBlobAsFile(base64ToBlob(base64), filename);
26750
26755
  };
@@ -26844,7 +26849,7 @@ const mapEntityAssociationsToTrustMembers = (trustEntityId, entityAssociations,
26844
26849
  };
26845
26850
  const mapRootLegalEntityToTrustMember = (rootLegalEntity) => ({
26846
26851
  trustMemberType: "rootTrustee",
26847
- roles: [],
26852
+ roles: [TrustMemberTypes.TRUSTEE],
26848
26853
  legalEntityType: rootLegalEntity.type,
26849
26854
  legalEntityId: rootLegalEntity.id,
26850
26855
  name: getLegalEntityNameBasedOnType(rootLegalEntity)
@@ -27170,6 +27175,9 @@ const BusinessTypeSelection = ({
27170
27175
  const {
27171
27176
  showToast
27172
27177
  } = useToastContext();
27178
+ const {
27179
+ isExperimentEnabled
27180
+ } = useExperimentsContext();
27173
27181
  const [loadingStatus, setLoadingStatus] = useState();
27174
27182
  const [currentStep, setCurrentStep] = useState(
27175
27183
  0
@@ -27185,7 +27193,9 @@ const BusinessTypeSelection = ({
27185
27193
  const {
27186
27194
  businessTypeOptions,
27187
27195
  legalArrangementOptions
27188
- } = getSelectionOptions(legalEntityResponse);
27196
+ } = getSelectionOptions(legalEntityResponse, {
27197
+ ShowUnsupportedEntityType: isExperimentEnabled("ShowUnsupportedEntityType")
27198
+ });
27189
27199
  const currentLegalEntityType = legalEntityResponse == null ? void 0 : legalEntityResponse.type;
27190
27200
  const currentCompanyTypesValue = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
27191
27201
  const defaultBusinessType = getBusinessType(businessTypeOptions, accountHolder2, legalEntityResponse == null ? void 0 : legalEntityResponse.type, (_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
@@ -28793,6 +28803,7 @@ function TaskListComponent({
28793
28803
  pciStatus,
28794
28804
  serviceAgreementTypes,
28795
28805
  serviceAgreementAcceptanceInfos,
28806
+ hasRequiredTrustMemberCount: hasRequiredTrustMemberCount2,
28796
28807
  onTransferInstrumentDelete
28797
28808
  }) {
28798
28809
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
@@ -28942,7 +28953,7 @@ function TaskListComponent({
28942
28953
  onNavigateToTask: handleOnNavigateToTaskTrustMember,
28943
28954
  icon: "decision-maker",
28944
28955
  title: i18n.get("trustMembers"),
28945
- status: hasMinRequiredTrustMemberCount(legalEntityResponse) ? getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntityResponse, getOwnTrustMembersLegalEntityIds(legalEntityResponse)) : TaskStatus.DETAILS_REQUIRED
28956
+ status: hasRequiredTrustMemberCount2 ? getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, legalEntityResponse, getOwnTrustMembersLegalEntityIds(legalEntityResponse)) : TaskStatus.DETAILS_REQUIRED
28946
28957
  })]
28947
28958
  }), (tasks.includes(TaskTypes.PAYOUT) || tasks.includes(TaskTypes.PAYIN)) && jsx(TaskListGroup, {
28948
28959
  title: isEnableNewEntryFlowEnabled ? i18n.get("letUsKnowTheBankAccountToSendReceiveFunds") : i18n.get(hasPayinTaskNotPayout ? "payinAccountsDescription" : payoutTaskDescriptionKey),
@@ -32104,7 +32115,7 @@ function TrustDropinComponent({
32104
32115
  ...derivedProps,
32105
32116
  activeForm,
32106
32117
  capabilities,
32107
- data,
32118
+ data: dataFromResponse,
32108
32119
  country: ((_a = data == null ? void 0 : data.trustRegistrationDetails) == null ? void 0 : _a.country) ?? country2,
32109
32120
  problems,
32110
32121
  handleAddressSearch,
@@ -32179,7 +32190,10 @@ function DropinComposerComponent({
32179
32190
  const [associatedLegalEntityParent, setAssociatedLegalEntityParent] = useState(null);
32180
32191
  const [legalEntityType, setLegalEntityType] = useState(null);
32181
32192
  const [solePropietor, setSolePropietor] = useState(null);
32182
- const [trust2, setTrust] = useState(null);
32193
+ const [trust2, refreshTrust] = useTrust({
32194
+ rootLegalEntity,
32195
+ handleGetLegalEntity: args.handleGetLegalEntity
32196
+ });
32183
32197
  const exemptSettlor = useExemptSettlor({
32184
32198
  trust: trust2,
32185
32199
  handleGetLegalEntity: args.handleGetLegalEntity
@@ -32198,6 +32212,7 @@ function DropinComposerComponent({
32198
32212
  const additionalSalesChannels = useSalesChannelsSettings();
32199
32213
  const isOrganizationSettlorWithExemptionEnabled = isOrganizationSettlorWithExemptionReasonEnabled(isExperimentEnabled("AllowOrganizationSettlorWithExemptionReason"), trust2 == null ? void 0 : trust2.trust.countryOfGoverningLaw);
32200
32214
  const allowMoreRolesForMainRootTrustee = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
32215
+ const trustMembers2 = trust2 ? allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust2, rootLegalEntity, exemptSettlor) : getTrustMembers(trust2, rootLegalEntity, exemptSettlor) : [];
32201
32216
  const getLegalEntityProblems = (le) => {
32202
32217
  var _a2;
32203
32218
  if (le == null ? void 0 : le.id) {
@@ -32307,18 +32322,6 @@ function DropinComposerComponent({
32307
32322
  }
32308
32323
  return void 0;
32309
32324
  }, [i18n, rootLegalEntity.id]);
32310
- const refreshTrust = async () => {
32311
- if (trust2.id && (args == null ? void 0 : args.handleGetLegalEntity)) {
32312
- try {
32313
- const response = await (args == null ? void 0 : args.handleGetLegalEntity(trust2.id));
32314
- setTrust(response);
32315
- return response;
32316
- } catch (e) {
32317
- logger$a.warn(i18n.get("failedToFetchTrustDetails"));
32318
- }
32319
- }
32320
- return void 0;
32321
- };
32322
32325
  const deleteTransferInstrument2 = async (id2) => {
32323
32326
  if (id2 && (args == null ? void 0 : args.handleDeleteTransferInstrument)) {
32324
32327
  try {
@@ -32510,21 +32513,18 @@ function DropinComposerComponent({
32510
32513
  }
32511
32514
  };
32512
32515
  const onNavigateToTrust = async (task = TaskTypes.TRUST) => {
32513
- var _a2, _b2;
32514
- const trustId = (_b2 = (_a2 = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a2.find((association2) => association2.type === LegalEntityType.TRUST)) == null ? void 0 : _b2.legalEntityId;
32515
- if (trustId) {
32516
- try {
32517
- const currentTrust = await (args == null ? void 0 : args.handleGetLegalEntity(trustId));
32518
- setTrust(currentTrust);
32516
+ try {
32517
+ const trust22 = await refreshTrust();
32518
+ if (trust22) {
32519
32519
  onNavigateTo(task);
32520
- } catch (e) {
32521
- showToast({
32522
- label: i18n.get("failedToFetchTrustDetails"),
32523
- type: ToastType.ERROR
32524
- });
32520
+ } else {
32521
+ onNavigateTo(TaskTypes.TRUST);
32525
32522
  }
32526
- } else {
32527
- onNavigateTo(TaskTypes.TRUST);
32523
+ } catch (e) {
32524
+ showToast({
32525
+ label: i18n.get("failedToFetchTrustDetails"),
32526
+ type: ToastType.ERROR
32527
+ });
32528
32528
  }
32529
32529
  };
32530
32530
  const onNavigateToTrustMember = async (tm) => {
@@ -32748,6 +32748,7 @@ function DropinComposerComponent({
32748
32748
  serviceAgreementTypes,
32749
32749
  serviceAgreementAcceptanceInfos,
32750
32750
  isReview: reviewRequired,
32751
+ hasRequiredTrustMemberCount: hasRequiredTrustMemberCount(trustMembers2),
32751
32752
  onTransferInstrumentDelete: deleteTransferInstrument2
32752
32753
  });
32753
32754
  case TaskTypes.DECISION_MAKER_OVERVIEW:
@@ -33016,7 +33017,7 @@ function DropinComposerComponent({
33016
33017
  });
33017
33018
  case TaskTypes.TRUST_MEMBER_OVERVIEW:
33018
33019
  return jsx(TrustMembersOverview, {
33019
- trustMembers: allowMoreRolesForMainRootTrustee ? getRootTrusteeTrustMembers(trust2, rootLegalEntity, exemptSettlor) : getTrustMembers(trust2, rootLegalEntity, exemptSettlor),
33020
+ trustMembers: trustMembers2,
33020
33021
  getTrustMemberTaskStatus: (member) => getTaskStatus(EntityType.LEGAL_ENTITY, capabilityProblems, rootLegalEntity, member.trustMemberType === "undefinedBeneficiary" ? void 0 : [member.legalEntityId, ...getDirectEntityAssociations(rootLegalEntity, member.legalEntityId).map((association2) => association2.legalEntityId)]),
33021
33022
  navigateBackToTaskList: navigateBack,
33022
33023
  navigateToEditTrustMember: onNavigateToTrustMemberRoleAndType,
@@ -34291,17 +34292,32 @@ const getSupportedCountries = async (context) => {
34291
34292
  }
34292
34293
  });
34293
34294
  };
34294
- const validatePhoneNumber$1 = async (context, phoneNumber2) => {
34295
+ const validateAccountIdentification$1 = async (context, payoutAccountDetails) => {
34295
34296
  const {
34297
+ loadingContext
34298
+ } = context;
34299
+ return httpPost({
34296
34300
  loadingContext,
34297
- legalEntityId
34301
+ authentication: "jwt",
34302
+ errorLevel: "warn",
34303
+ errorMessage: "Account Identification is not available",
34304
+ path: `validations/accountidentification`
34305
+ }, {
34306
+ accountIdentification: {
34307
+ ...payoutAccountDetails
34308
+ }
34309
+ });
34310
+ };
34311
+ const validatePhoneNumber$1 = async (context, phoneNumber2) => {
34312
+ const {
34313
+ loadingContext
34298
34314
  } = context;
34299
34315
  return httpPost({
34300
34316
  loadingContext,
34301
34317
  authentication: "jwt",
34302
34318
  errorLevel: "warn",
34303
34319
  errorMessage: "Phone validation is not available",
34304
- path: `${legalEntityId}/validations/phonenumber`
34320
+ path: `validations/phonenumber`
34305
34321
  }, {
34306
34322
  number: phoneNumber2
34307
34323
  });
@@ -34356,9 +34372,6 @@ const getEmbeddedApi = ({
34356
34372
  legalEntityId: rootLegalEntityId
34357
34373
  };
34358
34374
  return {
34359
- accountIdentification: () => {
34360
- throw new Error("accountIdentification: Not implemented in onboarding component api");
34361
- },
34362
34375
  getConfiguration: async ({
34363
34376
  legalEntityType
34364
34377
  }) => {
@@ -34378,27 +34391,15 @@ const getEmbeddedApi = ({
34378
34391
  getImageUrl: () => `${base}static/images/`,
34379
34392
  getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
34380
34393
  getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
34381
- validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1(baseRequestContext, phoneNumber2),
34394
+ validateAccountIdentification: async (accountIdentificationDetails) => validateAccountIdentification$1({
34395
+ loadingContext
34396
+ }, accountIdentificationDetails),
34397
+ validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1({
34398
+ loadingContext
34399
+ }, phoneNumber2),
34382
34400
  verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request)
34383
34401
  };
34384
34402
  };
34385
- const accountIdentification = async (context, payoutAccountDetails) => {
34386
- const {
34387
- loadingContext,
34388
- clientKey
34389
- } = context;
34390
- return httpPost({
34391
- loadingContext,
34392
- clientKey,
34393
- errorLevel: "warn",
34394
- errorMessage: "Account Identification is not available",
34395
- path: "v1/validations/accountidentification"
34396
- }, {
34397
- accountIdentification: {
34398
- ...payoutAccountDetails
34399
- }
34400
- });
34401
- };
34402
34403
  const getAllowedCountries = async (context) => {
34403
34404
  const {
34404
34405
  loadingContext,
@@ -34462,6 +34463,23 @@ const getDataset = async (context, name, locale) => {
34462
34463
  return datasetResponse;
34463
34464
  });
34464
34465
  };
34466
+ const validateAccountIdentification = async (context, payoutAccountDetails) => {
34467
+ const {
34468
+ loadingContext,
34469
+ clientKey
34470
+ } = context;
34471
+ return httpPost({
34472
+ loadingContext,
34473
+ clientKey,
34474
+ errorLevel: "warn",
34475
+ errorMessage: "Account Identification is not available",
34476
+ path: "v1/validations/accountidentification"
34477
+ }, {
34478
+ accountIdentification: {
34479
+ ...payoutAccountDetails
34480
+ }
34481
+ });
34482
+ };
34465
34483
  const validatePhoneNumber = async (context, phoneNumber2) => {
34466
34484
  const {
34467
34485
  loadingContext,
@@ -34517,7 +34535,7 @@ const getKycExternalApi = ({
34517
34535
  loadingContext,
34518
34536
  clientKey
34519
34537
  }) => ({
34520
- accountIdentification: async (accountIdentificationDetails) => accountIdentification({
34538
+ validateAccountIdentification: async (accountIdentificationDetails) => validateAccountIdentification({
34521
34539
  loadingContext,
34522
34540
  clientKey
34523
34541
  }, accountIdentificationDetails),