@adyen/kyc-components 3.41.4 → 3.41.5

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.
@@ -1455,7 +1455,23 @@ const defaultLocaleTranslations = {
1455
1455
  yourIbanShouldBeginWith_: "Your IBAN should begin with %{countryCode}.",
1456
1456
  yourLoanApplicationHasBeenReceived: "Thank you for providing your additional information. The data provided is being reviewed. You'll be notified if anything else is needed.",
1457
1457
  zentralesVereinsregisterId: "Zentrales Vereinsregister ID",
1458
- zipCode: "ZIP code"
1458
+ zipCode: "ZIP code",
1459
+ invalidInputError: "There was an invalid input error:",
1460
+ bankAccountNeeded: "A bank account is needed.",
1461
+ noIssuesFound: "No issues found.",
1462
+ newEntityAlwaysEmpty: "We still need to create this entity.",
1463
+ missingRequiredDecisionMakers: "We don't yet have sufficient decision makers.",
1464
+ missingRequiredTrustMembers: "We don't yet have sufficient trust members.",
1465
+ rootLegalEntityIsEmpty: "The root legal entity only has the minimum data (is empty).",
1466
+ legalRepresentativeNeeded: "The user is underage, therefore a legal representative is needed.",
1467
+ dataMissingError: "We are missing required data.",
1468
+ dataReviewNeeded: "A data review is neeced.",
1469
+ pendingStatusError: "There is an error with a pending status.",
1470
+ pendingCapabilities: "Some capabilities are still pending.",
1471
+ invalidCapabilities: "Some capabilities are invalid.",
1472
+ allCapabilitiesValid: "All capabilities are valid",
1473
+ task: "Task",
1474
+ reason: "Reason"
1459
1475
  };
1460
1476
  const enUS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1461
1477
  __proto__: null,
@@ -12146,7 +12162,7 @@ const financialInfoValidationRules = {
12146
12162
  }
12147
12163
  };
12148
12164
  const financialInformationReportedValueOptions = "adyen-kyc-financial-information-reported-value-options";
12149
- const styles$8 = {
12165
+ const styles$a = {
12150
12166
  "financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
12151
12167
  financialInformationReportedValueOptions
12152
12168
  };
@@ -12194,7 +12210,7 @@ const InputCurrency = ({
12194
12210
  };
12195
12211
  const reportedValue = "adyen-kyc-reported-value";
12196
12212
  const reportedValueInput = "adyen-kyc-reported-value-input";
12197
- const styles$7 = {
12213
+ const styles$9 = {
12198
12214
  "reported-value": "adyen-kyc-reported-value",
12199
12215
  reportedValue,
12200
12216
  "reported-value-input": "adyen-kyc-reported-value-input",
@@ -12211,7 +12227,7 @@ const ReportedValue = ({
12211
12227
  isValid
12212
12228
  }) => {
12213
12229
  const { i18n } = useI18nContext();
12214
- return /* @__PURE__ */ jsx("div", { className: styles$7.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
12230
+ return /* @__PURE__ */ jsx("div", { className: styles$9.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
12215
12231
  InputCurrency,
12216
12232
  {
12217
12233
  ...childProps,
@@ -12219,7 +12235,7 @@ const ReportedValue = ({
12219
12235
  currency,
12220
12236
  amount,
12221
12237
  onAmountChanged,
12222
- className: styles$7.reportedValueInput,
12238
+ className: styles$9.reportedValueInput,
12223
12239
  "aria-label": label
12224
12240
  }
12225
12241
  ) }) });
@@ -12356,7 +12372,7 @@ function FinancialInformation(props) {
12356
12372
  ],
12357
12373
  onChange: updateReportedValueOption,
12358
12374
  showContentOnlyOnSelected: true,
12359
- className: styles$8.financialInformationReportedValueOptions
12375
+ className: styles$a.financialInformationReportedValueOptions
12360
12376
  }
12361
12377
  )
12362
12378
  }
@@ -14785,6 +14801,7 @@ var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
14785
14801
  TaskStatus2[TaskStatus2["SIGNED"] = 7] = "SIGNED";
14786
14802
  TaskStatus2[TaskStatus2["SUBMIT"] = 8] = "SUBMIT";
14787
14803
  TaskStatus2[TaskStatus2["REMOVING"] = 9] = "REMOVING";
14804
+ TaskStatus2[TaskStatus2["UNKNOWN"] = 10] = "UNKNOWN";
14788
14805
  return TaskStatus2;
14789
14806
  })(TaskStatus || {});
14790
14807
  const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [
@@ -16281,7 +16298,7 @@ const useIdVerificationToken = ({
16281
16298
  };
16282
16299
  const loaderWrapperLoader = "adyen-kyc-loader-wrapper-loader";
16283
16300
  const loaderWrapperLoaderActive = "adyen-kyc-loader-wrapper-loader-active";
16284
- const styles$6 = {
16301
+ const styles$8 = {
16285
16302
  "loader-wrapper-loader": "adyen-kyc-loader-wrapper-loader",
16286
16303
  loaderWrapperLoader,
16287
16304
  "loader-wrapper-loader-active": "adyen-kyc-loader-wrapper-loader-active",
@@ -16298,13 +16315,13 @@ const LoaderWrapper = ({
16298
16315
  const opacitySyle = status === "loading" ? {
16299
16316
  opacity: formOpacityWhenLoading
16300
16317
  } : { opacity: 1 };
16301
- const loaderWrapperClass = cx(styles$6.loaderWrapperLoader, {
16302
- [styles$6.loaderWrapperLoaderActive]: status === "loading" && showSpinner
16318
+ const loaderWrapperClass = cx(styles$8.loaderWrapperLoader, {
16319
+ [styles$8.loaderWrapperLoaderActive]: status === "loading" && showSpinner
16303
16320
  });
16304
- const overlayClass = cx(styles$6.loaderWrapper, className);
16321
+ const overlayClass = cx(styles$8.loaderWrapper, className);
16305
16322
  return /* @__PURE__ */ jsxs("div", { className: overlayClass, style: { position: "relative" }, children: [
16306
16323
  /* @__PURE__ */ jsx("div", { className: loaderWrapperClass, children: /* @__PURE__ */ jsx(Loader, { size: loaderSize }) }),
16307
- /* @__PURE__ */ jsx("div", { className: styles$6.loaderWrapperForm, style: opacitySyle, children })
16324
+ /* @__PURE__ */ jsx("div", { className: styles$8.loaderWrapperForm, style: opacitySyle, children })
16308
16325
  ] });
16309
16326
  };
16310
16327
  const containerId = "adyen-kyc-id-verification";
@@ -18161,7 +18178,7 @@ const roleMetadata = {
18161
18178
  name: TrustMemberGuidanceLabel.TRUSTEE
18162
18179
  }
18163
18180
  };
18164
- const getRoleTagVariant$1 = (role) => {
18181
+ const getRoleTagVariant = (role) => {
18165
18182
  var _a;
18166
18183
  return ((_a = roleMetadata[role]) == null ? void 0 : _a.variant) ?? "blue";
18167
18184
  };
@@ -22813,7 +22830,7 @@ function Card({
22813
22830
  const skeleton = "adyen-kyc-skeleton";
22814
22831
  const skeletonCircle = "adyen-kyc-skeleton-circle";
22815
22832
  const skeletonText = "adyen-kyc-skeleton-text";
22816
- const styles$5 = {
22833
+ const styles$7 = {
22817
22834
  skeleton,
22818
22835
  "skeleton-circle": "adyen-kyc-skeleton-circle",
22819
22836
  skeletonCircle,
@@ -22826,9 +22843,9 @@ const Skeleton = ({
22826
22843
  height = "1em",
22827
22844
  width
22828
22845
  }) => {
22829
- const classNames = cx(styles$5.skeleton, {
22830
- [styles$5.skeletonCircle]: circle,
22831
- [styles$5.skeletonText]: text
22846
+ const classNames = cx(styles$7.skeleton, {
22847
+ [styles$7.skeletonCircle]: circle,
22848
+ [styles$7.skeletonText]: text
22832
22849
  });
22833
22850
  return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
22834
22851
  };
@@ -22839,7 +22856,7 @@ const preferInstantVerificationMethodText = "adyen-kyc-prefer-instant-verificati
22839
22856
  const preferInstantVerificationMethodInstantButton = "adyen-kyc-prefer-instant-verification-method-instant-button";
22840
22857
  const preferInstantVerificationMethodActions = "adyen-kyc-prefer-instant-verification-method-actions";
22841
22858
  const preferInstantVerificationMethodManualButtonDarker = "adyen-kyc-prefer-instant-verification-method-manual-button-darker";
22842
- const styles$4 = {
22859
+ const styles$6 = {
22843
22860
  "prefer-instant-verification-method": "adyen-kyc-prefer-instant-verification-method",
22844
22861
  preferInstantVerificationMethod,
22845
22862
  "prefer-instant-verification-method-card": "adyen-kyc-prefer-instant-verification-method-card",
@@ -22889,13 +22906,13 @@ const PreferInstantVerificationMethod = ({
22889
22906
  setHideVerificationWidget(false);
22890
22907
  selectVerificationMethod("instantVerification");
22891
22908
  };
22892
- const providerBanner = provider && /* @__PURE__ */ jsx(Card, { background: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethodCard, children: [
22909
+ const providerBanner = provider && /* @__PURE__ */ jsx(Card, { background: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$6.preferInstantVerificationMethodCard, children: [
22893
22910
  /* @__PURE__ */ jsx(
22894
22911
  Svg,
22895
22912
  {
22896
22913
  type: "image",
22897
22914
  name: "instant-verification-method",
22898
- className: styles$4.preferInstantVerificationMethodImage
22915
+ className: styles$6.preferInstantVerificationMethodImage
22899
22916
  }
22900
22917
  ),
22901
22918
  /* @__PURE__ */ jsx(
@@ -22903,7 +22920,7 @@ const PreferInstantVerificationMethod = ({
22903
22920
  {
22904
22921
  el: "p",
22905
22922
  variant: "body-stronger",
22906
- className: styles$4.preferInstantVerificationMethodText,
22923
+ className: styles$6.preferInstantVerificationMethodText,
22907
22924
  children: i18n.get("instantlyConnectAndVerifyYourBankAccount")
22908
22925
  }
22909
22926
  ),
@@ -22914,7 +22931,7 @@ const PreferInstantVerificationMethod = ({
22914
22931
  label: i18n.get("connectWith", {
22915
22932
  values: { providerName: iconName ? "" : provider.name }
22916
22933
  }),
22917
- className: styles$4.preferInstantVerificationMethodInstantButton,
22934
+ className: styles$6.preferInstantVerificationMethodInstantButton,
22918
22935
  onClick: handleClickProviderButton,
22919
22936
  disabled: bankInfoValidated,
22920
22937
  icon: iconName,
@@ -22934,16 +22951,16 @@ const PreferInstantVerificationMethod = ({
22934
22951
  retrieveBankAccountInfo
22935
22952
  }
22936
22953
  );
22937
- return /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethod, children: [
22954
+ return /* @__PURE__ */ jsxs("div", { className: styles$6.preferInstantVerificationMethod, children: [
22938
22955
  loadingStatus === "loading" ? /* @__PURE__ */ jsx(Skeleton, { height: "21rem" }) : instantVerificationAvailable && (showVerificationWidget ? bankVerificationWidget : providerBanner),
22939
- /* @__PURE__ */ jsx("div", { className: styles$4.preferInstantVerificationMethodActions, children: /* @__PURE__ */ jsx(
22956
+ /* @__PURE__ */ jsx("div", { className: styles$6.preferInstantVerificationMethodActions, children: /* @__PURE__ */ jsx(
22940
22957
  Button,
22941
22958
  {
22942
22959
  type: "button",
22943
22960
  label: i18n.get("addAccountManually"),
22944
22961
  tertiary: instantVerificationAvailable,
22945
22962
  className: cx({
22946
- [styles$4.preferInstantVerificationMethodManualButtonDarker]: instantVerificationAvailable
22963
+ [styles$6.preferInstantVerificationMethodManualButtonDarker]: instantVerificationAvailable
22947
22964
  }),
22948
22965
  onClick: () => selectVerificationMethod("manualVerification"),
22949
22966
  disabled: bankInfoValidated
@@ -25089,7 +25106,8 @@ function getEntityProblems(verificationErrors, entityType, isExperimentEnabled)
25089
25106
  currEntityProblems.remediationActions = remediationActions;
25090
25107
  currEntityProblems.statusWithReason = getPriorityStatus(entityProblems, {
25091
25108
  status: TaskStatus.ERROR,
25092
- reason: "invalidInputError"
25109
+ reason: "invalidInputError",
25110
+ details: { verificationError }
25093
25111
  });
25094
25112
  }
25095
25113
  break;
@@ -25099,7 +25117,8 @@ function getEntityProblems(verificationErrors, entityType, isExperimentEnabled)
25099
25117
  if (!isUnRelatedErrorCode(verificationError)) {
25100
25118
  currEntityProblems.statusWithReason = getPriorityStatus(entityProblems, {
25101
25119
  status: TaskStatus.DETAILS_REQUIRED,
25102
- reason: "dataMissingError"
25120
+ reason: "dataMissingError",
25121
+ details: { verificationError }
25103
25122
  });
25104
25123
  }
25105
25124
  break;
@@ -26420,7 +26439,7 @@ const structuredListListItem = "adyen-kyc-structured-list-list-item";
26420
26439
  const adyenLayoutMd = "adyen-layout-md";
26421
26440
  const structuredListLabel = "adyen-kyc-structured-list-label";
26422
26441
  const structuredListValue = "adyen-kyc-structured-list-value";
26423
- const styles$3 = {
26442
+ const styles$5 = {
26424
26443
  "structured-list": "adyen-kyc-structured-list",
26425
26444
  structuredList,
26426
26445
  "structured-list-list-item": "adyen-kyc-structured-list-list-item",
@@ -26434,9 +26453,9 @@ const styles$3 = {
26434
26453
  };
26435
26454
  const StructuredList = ({ items }) => {
26436
26455
  const { i18n } = useI18nContext();
26437
- return /* @__PURE__ */ jsx("dl", { className: styles$3.structuredList, children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: styles$3.structuredListListItem, children: [
26438
- /* @__PURE__ */ jsx("dt", { className: styles$3.structuredListLabel, children: i18n.get(item.labelKey) }),
26439
- /* @__PURE__ */ jsx("dd", { className: styles$3.structuredListValue, children: item.value })
26456
+ return /* @__PURE__ */ jsx("dl", { className: styles$5.structuredList, children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: styles$5.structuredListListItem, children: [
26457
+ /* @__PURE__ */ jsx("dt", { className: styles$5.structuredListLabel, children: i18n.get(item.labelKey) }),
26458
+ /* @__PURE__ */ jsx("dd", { className: styles$5.structuredListValue, children: item.value })
26440
26459
  ] }, item.labelKey)) });
26441
26460
  };
26442
26461
  function VerifiedBusinessCard({
@@ -28777,7 +28796,7 @@ const ExpiredBanner = () => {
28777
28796
  return /* @__PURE__ */ jsx(Alert, { variant: "warning", title: i18n.get("thisPageIsNowInactive"), children: i18n.get("startANewSessionFromTheSamePlaceYouOriginallyAccessed") });
28778
28797
  };
28779
28798
  const Modal = ({
28780
- header,
28799
+ header: header2,
28781
28800
  children,
28782
28801
  footer,
28783
28802
  size = "medium",
@@ -28833,7 +28852,7 @@ const Modal = ({
28833
28852
  shaded: true
28834
28853
  }
28835
28854
  ) : /* @__PURE__ */ jsx("div", {}),
28836
- !movableHeader && header && /* @__PURE__ */ jsx("header", { className: "adyen-kyc-modal__header", children: header }),
28855
+ !movableHeader && header2 && /* @__PURE__ */ jsx("header", { className: "adyen-kyc-modal__header", children: header2 }),
28837
28856
  onClose ? /* @__PURE__ */ jsx(
28838
28857
  Button,
28839
28858
  {
@@ -28848,7 +28867,7 @@ const Modal = ({
28848
28867
  ]
28849
28868
  }
28850
28869
  ),
28851
- movableHeader && header && /* @__PURE__ */ jsx("header", { className: "adyen-kyc-modal__header", children: header }),
28870
+ movableHeader && header2 && /* @__PURE__ */ jsx("header", { className: "adyen-kyc-modal__header", children: header2 }),
28852
28871
  /* @__PURE__ */ jsx("section", { className: "adyen-kyc-modal__content", children })
28853
28872
  ] }),
28854
28873
  /* @__PURE__ */ jsx("div", { children: footer && /* @__PURE__ */ jsx("footer", { className: "adyen-kyc-modal__footer", children: footer }) })
@@ -29163,7 +29182,7 @@ function FormNavigation({
29163
29182
  gotoForm,
29164
29183
  validateForm,
29165
29184
  className,
29166
- taskName,
29185
+ taskName: taskName2,
29167
29186
  verificationErrors,
29168
29187
  trackNavigation: trackNavigation2 = noop
29169
29188
  }) {
@@ -29183,13 +29202,13 @@ function FormNavigation({
29183
29202
  return activeForm2.isValid ? void 0 : validateForm;
29184
29203
  };
29185
29204
  return /* @__PURE__ */ jsxs("div", { className: cx("adyen-kyc-form-navigation", className), children: [
29186
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-navigation__header", children: i18n.get(taskName) }),
29205
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-navigation__header", children: i18n.get(taskName2) }),
29187
29206
  /* @__PURE__ */ jsxs("ul", { className: "adyen-kyc-form-navigation__items", children: [
29188
29207
  forms && /* @__PURE__ */ jsx("li", { className: "adyen-kyc-form-navigation__home-button-item", children: /* @__PURE__ */ jsx("span", { className: "adyen-kyc-form-navigation__step-count", children: i18n.get("stepsX/YofForm", {
29189
29208
  values: {
29190
29209
  activeFormIndex: getFormIndex(activeForm) + 1,
29191
29210
  totalForms: forms.length,
29192
- taskNameTranslated: i18n.get(taskName)
29211
+ taskNameTranslated: i18n.get(taskName2)
29193
29212
  }
29194
29213
  }) }) }),
29195
29214
  forms.map((form) => /* @__PURE__ */ jsx(
@@ -29207,7 +29226,7 @@ function FormNavigation({
29207
29226
  }
29208
29227
  const FormWrapper = ({
29209
29228
  summary: summary2,
29210
- taskName,
29229
+ taskName: taskName2,
29211
29230
  children,
29212
29231
  handleNextClick,
29213
29232
  handleBackClick,
@@ -29250,13 +29269,13 @@ const FormWrapper = ({
29250
29269
  }
29251
29270
  };
29252
29271
  const showLegalCaption = ["solePropDetails", "companyDetails", "businessDetails"].includes(
29253
- taskName
29272
+ taskName2
29254
29273
  );
29255
29274
  const { isExperimentEnabled } = useExperimentsContext();
29256
29275
  const showExtraTaxExemptionReasons = isExperimentEnabled(
29257
29276
  ExperimentNames.ShowExtraTaxExemptionReasons
29258
29277
  );
29259
- const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason) && ["companyDetails", "businessDetails"].includes(taskName);
29278
+ const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason) && ["companyDetails", "businessDetails"].includes(taskName2);
29260
29279
  const summaryContent = /* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: /* @__PURE__ */ jsx(
29261
29280
  Summary,
29262
29281
  {
@@ -29353,7 +29372,7 @@ const FormWrapper = ({
29353
29372
  activeForm,
29354
29373
  gotoForm: gotoFormByFormIndex,
29355
29374
  validateForm,
29356
- taskName,
29375
+ taskName: taskName2,
29357
29376
  trackNavigation: ({ fromForm, toForm, component }) => trackNavigation({ fromForm, toForm, component, baseTrackingPayload, i18n }),
29358
29377
  verificationErrors: problems == null ? void 0 : problems.verificationErrors
29359
29378
  }
@@ -29815,7 +29834,7 @@ function BusinessDetailsDropinComponent({
29815
29834
  parentLegalEntity,
29816
29835
  trackingConfig,
29817
29836
  capabilities,
29818
- taskName,
29837
+ taskName: taskName2,
29819
29838
  hideDropinLayout,
29820
29839
  homeButtonLabel,
29821
29840
  taskType = TaskTypes.BUSINESS_DETAILS,
@@ -30271,7 +30290,7 @@ function BusinessDetailsDropinComponent({
30271
30290
  return /* @__PURE__ */ jsx(
30272
30291
  FormWrapper,
30273
30292
  {
30274
- taskName: taskName ?? "businessDetails",
30293
+ taskName: taskName2 ?? "businessDetails",
30275
30294
  gotoFormByFormIndex: goToForm,
30276
30295
  hideDropinLayout,
30277
30296
  hideHomeButton: hideHome,
@@ -30364,7 +30383,7 @@ function CompanyDropinComponent({
30364
30383
  country: parentCountry,
30365
30384
  problems: propProblems,
30366
30385
  hideDropinLayout,
30367
- taskName,
30386
+ taskName: taskName2,
30368
30387
  capabilities,
30369
30388
  homeButtonLabel,
30370
30389
  taskType = TaskTypes.COMPANY,
@@ -30710,7 +30729,7 @@ function CompanyDropinComponent({
30710
30729
  return /* @__PURE__ */ jsx(
30711
30730
  FormWrapper,
30712
30731
  {
30713
- taskName,
30732
+ taskName: taskName2,
30714
30733
  handleNextClick,
30715
30734
  gotoFormByFormIndex,
30716
30735
  handleHomeClick,
@@ -32126,8 +32145,9 @@ const TaskItemStatus = ({
32126
32145
  );
32127
32146
  case TaskStatus.DETAILS_REQUIRED:
32128
32147
  case TaskStatus.EMPTY:
32129
- default:
32130
32148
  return /* @__PURE__ */ jsx("span", { className: "adyen-kyc-task-status-details-required", children: statusLabel || i18n.get("add") });
32149
+ default:
32150
+ return /* @__PURE__ */ jsx("span", { className: "adyen-kyc-task-status-details-unknown", children: i18n.get("unknown") });
32131
32151
  }
32132
32152
  };
32133
32153
  const VerificationErrorAlert = ({
@@ -32346,7 +32366,7 @@ const EntityAssociation = ({
32346
32366
  Tag,
32347
32367
  {
32348
32368
  className: "adyen-kyc-entity-association__tag",
32349
- variant: getRoleTagVariant$1(type),
32369
+ variant: getRoleTagVariant(type),
32350
32370
  children: i18n.get(getRoleName(type))
32351
32371
  },
32352
32372
  type
@@ -32407,7 +32427,7 @@ const EntityGuidanceStatus = ({
32407
32427
  Tag,
32408
32428
  {
32409
32429
  className: "adyen-kyc-entity-status__tag",
32410
- variant: getRoleTagVariant$1(entityLabel),
32430
+ variant: getRoleTagVariant(entityLabel),
32411
32431
  children: i18n.get(getRoleName(entityLabel))
32412
32432
  },
32413
32433
  entityLabel
@@ -32714,6 +32734,7 @@ const splitTaskIdentifier = (taskIdentifier) => {
32714
32734
  const determineTaskIdentifiers = ({
32715
32735
  taskTypes: receivedTaskTypes,
32716
32736
  rootLegalEntity,
32737
+ accountHolder,
32717
32738
  capabilityProblems,
32718
32739
  trustMembers,
32719
32740
  transferInstruments
@@ -32734,7 +32755,11 @@ const determineTaskIdentifiers = ({
32734
32755
  const decisionMakers = getOwnDecisionMakersLegalEntityIds(rootLegalEntity);
32735
32756
  decisionMakers.forEach((id) => tasks.push(`DECISION_MAKER-${id}`));
32736
32757
  }
32737
- if (taskTypes.includes(TaskTypes.TRUST_MEMBER_OVERVIEW)) {
32758
+ if (accountHolder === "mySoleProprietorName") {
32759
+ tasks.push(TaskTypes.SOLE_PROPRIETOR_COMPANY);
32760
+ }
32761
+ if (accountHolder === "aTrust") {
32762
+ tasks.push(TaskTypes.TRUST_MEMBER_OVERVIEW);
32738
32763
  trustMembers.forEach((member) => {
32739
32764
  if (member.trustMemberType === "undefinedBeneficiary") {
32740
32765
  tasks.push(`TRUST_MEMBER-undefinedBeneficiary`);
@@ -32767,6 +32792,7 @@ const computed = dist.createComputed(
32767
32792
  ({
32768
32793
  taskTypes,
32769
32794
  rootLegalEntity,
32795
+ accountHolder,
32770
32796
  capabilityProblems,
32771
32797
  legalRepresentative,
32772
32798
  transferInstruments,
@@ -32775,6 +32801,7 @@ const computed = dist.createComputed(
32775
32801
  const tasks = determineTaskIdentifiers({
32776
32802
  taskTypes,
32777
32803
  rootLegalEntity,
32804
+ accountHolder,
32778
32805
  capabilityProblems,
32779
32806
  legalRepresentative,
32780
32807
  transferInstruments,
@@ -32803,12 +32830,14 @@ const createTaskStore = () => createStore(
32803
32830
  // Defaults
32804
32831
  taskTypes: [],
32805
32832
  rootLegalEntity: void 0,
32833
+ accountHolder: void 0,
32806
32834
  capabilityProblems: void 0,
32807
32835
  legalRepresentative: void 0,
32808
32836
  trustMembers: [],
32809
32837
  transferInstruments: [],
32810
32838
  setTaskTypes: (taskTypes) => set({ taskTypes }),
32811
32839
  setRootLegalEntity: (rootLegalEntity) => set({ rootLegalEntity }),
32840
+ setAccountHolder: (accountHolder) => set({ accountHolder }),
32812
32841
  setCapabilityProblems: (capabilityProblems) => set({ capabilityProblems }),
32813
32842
  setLegalRepresentative: (legalRepresentative) => set({ legalRepresentative }),
32814
32843
  setTrustMembers: (trustMembers) => set({ trustMembers }),
@@ -32838,8 +32867,8 @@ const useGetTaskStatus = () => {
32838
32867
  const taskIdentifier = id ? `${taskType}-${id}` : taskType;
32839
32868
  const status = (_a = taskStatuses[taskIdentifier]) == null ? void 0 : _a.status;
32840
32869
  if (!status) {
32841
- logger$r.warn(`No status for task '${taskIdentifier}', returning EMPTY`);
32842
- return TaskStatus.EMPTY;
32870
+ logger$r.warn(`No status for task '${taskIdentifier}', returning UNKNOWN`);
32871
+ return TaskStatus.UNKNOWN;
32843
32872
  }
32844
32873
  return status;
32845
32874
  },
@@ -34042,7 +34071,7 @@ function TaskList({
34042
34071
  onNavigateToTask: () => handleOnNavigateToTaskPayout(),
34043
34072
  icon: "payout",
34044
34073
  title: canChangeEntityType ? i18n.get("bankAccountDetails") : i18n.get(hasPayinTaskNotPayout ? "payinDetails" : "payoutDetails"),
34045
- status: getTaskStatus(hasPayinTaskNotPayout ? TaskTypes.PAYIN : TaskTypes.PAYOUT) ?? TaskStatus.EMPTY,
34074
+ status: getTaskStatus(hasPayinTaskNotPayout ? TaskTypes.PAYIN : TaskTypes.PAYOUT),
34046
34075
  disabled: !canAddPayoutAccount,
34047
34076
  problems: getEmptyBankAccountProblems()
34048
34077
  }
@@ -34567,7 +34596,7 @@ function IndividualDropinComponent({
34567
34596
  trackingConfig,
34568
34597
  parentLegalEntity,
34569
34598
  legalEntityResponse,
34570
- taskName,
34599
+ taskName: taskName2,
34571
34600
  handleHomeClick,
34572
34601
  handleCloseClick,
34573
34602
  homeButtonLabel,
@@ -35089,7 +35118,7 @@ function IndividualDropinComponent({
35089
35118
  return /* @__PURE__ */ jsx(
35090
35119
  FormWrapper,
35091
35120
  {
35092
- taskName: taskName ?? "individualDetails",
35121
+ taskName: taskName2 ?? "individualDetails",
35093
35122
  activeForm,
35094
35123
  summary: {
35095
35124
  data: formatDataForSummary2(),
@@ -35292,7 +35321,7 @@ function PayoutDetailsDropinComponent({
35292
35321
  onSubmit: externalOnSubmit,
35293
35322
  onChange,
35294
35323
  taskType: propTaskType,
35295
- taskName,
35324
+ taskName: taskName2,
35296
35325
  capabilities,
35297
35326
  handleHomeClick,
35298
35327
  homeButtonLabel,
@@ -35664,7 +35693,7 @@ function PayoutDetailsDropinComponent({
35664
35693
  return /* @__PURE__ */ jsx(
35665
35694
  FormWrapper,
35666
35695
  {
35667
- taskName: taskName ?? "bankAccountDetails",
35696
+ taskName: taskName2 ?? "bankAccountDetails",
35668
35697
  activeForm,
35669
35698
  summary: {
35670
35699
  data: formatDataForSummary2(),
@@ -35727,11 +35756,11 @@ function PayoutDetailsDropinComponent({
35727
35756
  );
35728
35757
  }
35729
35758
  const outlinedIcon = "adyen-kyc-outlined-icon";
35730
- const styles$2 = {
35759
+ const styles$4 = {
35731
35760
  "outlined-icon": "adyen-kyc-outlined-icon",
35732
35761
  outlinedIcon
35733
35762
  };
35734
- const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$2.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
35763
+ const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$4.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
35735
35764
  const Splashscreen = ({ title, subtitle, icon, buttonText, onClick }) => {
35736
35765
  const { i18n } = useI18nContext();
35737
35766
  return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-splashscreen", children: [
@@ -36431,12 +36460,12 @@ const TrustRoleAndEntityType = (props) => {
36431
36460
  ] });
36432
36461
  };
36433
36462
  const settlorExemptionReasonsList = "adyen-kyc-settlor-exemption-reasons-list";
36434
- const styles$1 = {
36463
+ const styles$3 = {
36435
36464
  "settlor-exemption-reasons-list": "adyen-kyc-settlor-exemption-reasons-list",
36436
36465
  settlorExemptionReasonsList
36437
36466
  };
36438
36467
  const formatRolesForSummary = (roles, i18n) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
36439
- const formatSettlorExemptionReasonsForSummary = (reasons, i18n) => /* @__PURE__ */ jsx("ul", { className: styles$1.settlorExemptionReasonsList, children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: i18n.get(reason) }, reason)) });
36468
+ const formatSettlorExemptionReasonsForSummary = (reasons, i18n) => /* @__PURE__ */ jsx("ul", { className: styles$3.settlorExemptionReasonsList, children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: i18n.get(reason) }, reason)) });
36440
36469
  const formatRoleAndEntityTypeSummary = (data, i18n, isOrganizationSettlorWithExemptionEnabled) => {
36441
36470
  var _a, _b;
36442
36471
  const { trustMemberType, roles } = data;
@@ -38559,6 +38588,7 @@ function DropinComposerComponent({
38559
38588
  transferInstruments: rootLegalEntity.transferInstruments ?? []
38560
38589
  });
38561
38590
  }, []);
38591
+ useEffect(() => taskStore.setAccountHolder(accountHolder), [accountHolder]);
38562
38592
  const singpassBanner = isEligibleForSingpass ? /* @__PURE__ */ jsx(
38563
38593
  SingpassBanner,
38564
38594
  {
@@ -40068,7 +40098,7 @@ const embeddedStatusAvatar = "adyen-kyc-embedded-status-avatar";
40068
40098
  const embeddedStatusLight = "adyen-kyc-embedded-status-light";
40069
40099
  const embeddedStatusActionIndicator = "adyen-kyc-embedded-status-action-indicator";
40070
40100
  const embeddedStatusInfo = "adyen-kyc-embedded-status-info";
40071
- const styles = {
40101
+ const styles$2 = {
40072
40102
  "embedded-status": "adyen-kyc-embedded-status",
40073
40103
  embeddedStatus,
40074
40104
  "embedded-status-loading": "adyen-kyc-embedded-status-loading",
@@ -40124,22 +40154,22 @@ const EmbeddedStatus = ({
40124
40154
  "button",
40125
40155
  {
40126
40156
  type: "button",
40127
- className: cx(className, styles.embeddedStatus, "adyen-kyc-externalComponent", {
40128
- [styles.embeddedStatusLoading]: loading,
40129
- [styles.embeddedStatusLight]: light
40157
+ className: cx(className, styles$2.embeddedStatus, "adyen-kyc-externalComponent", {
40158
+ [styles$2.embeddedStatusLoading]: loading,
40159
+ [styles$2.embeddedStatusLight]: light
40130
40160
  }),
40131
40161
  onClick,
40132
40162
  ...props,
40133
40163
  children: [
40134
- /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusAvatar, children: loading ? /* @__PURE__ */ jsx(Skeleton, { height: "100%", width: "100%", circle: true }) : /* @__PURE__ */ jsx(Icon, { className: styles.embeddedStatusIcon, name: iconName }) }),
40135
- /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusInfo, children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
40164
+ /* @__PURE__ */ jsx("section", { className: styles$2.embeddedStatusAvatar, children: loading ? /* @__PURE__ */ jsx(Skeleton, { height: "100%", width: "100%", circle: true }) : /* @__PURE__ */ jsx(Icon, { className: styles$2.embeddedStatusIcon, name: iconName }) }),
40165
+ /* @__PURE__ */ jsx("section", { className: styles$2.embeddedStatusInfo, children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
40136
40166
  /* @__PURE__ */ jsx(Skeleton, { text: true, width: "20ch", height: "1em" }),
40137
40167
  /* @__PURE__ */ jsx(Skeleton, { text: true, width: "90%", height: "1em" })
40138
40168
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
40139
40169
  /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", children: title }),
40140
40170
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: subtitle })
40141
40171
  ] }) }),
40142
- actionIndicator ? /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusButton, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "5em", height: "2em" }) : /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", className: styles.embeddedStatusActionIndicator, children: i18n.get(actionIndicator.labelKey) }) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
40172
+ actionIndicator ? /* @__PURE__ */ jsx("section", { className: styles$2.embeddedStatusButton, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "5em", height: "2em" }) : /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", className: styles$2.embeddedStatusActionIndicator, children: i18n.get(actionIndicator.labelKey) }) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles$2.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
40143
40173
  ]
40144
40174
  }
40145
40175
  );
@@ -40261,15 +40291,15 @@ function TermsOfServiceStatus({
40261
40291
  async () => getServiceAgreementAcceptanceInfos2(legalEntityId),
40262
40292
  [getServiceAgreementAcceptanceInfos2, legalEntityId]
40263
40293
  );
40264
- const getStatus2 = useCallback(async () => {
40294
+ const getStatus = useCallback(async () => {
40265
40295
  const [signedRes, unsignedRes] = await Promise.all([getSigned(), getUnsigned()]);
40266
40296
  const signed = signedRes.data.map((d) => d.type);
40267
40297
  const unsigned = unsignedRes.termsOfServiceTypes;
40268
40298
  return signed.length !== 0 && unsigned.length === 0;
40269
40299
  }, [getUnsigned, getSigned]);
40270
40300
  useEffect(() => {
40271
- getStatus2().then((allSigned) => setHasSignedAll(allSigned)).catch((e) => logger$i.error(e)).finally(() => setIsLoading(false));
40272
- }, [getStatus2]);
40301
+ getStatus().then((allSigned) => setHasSignedAll(allSigned)).catch((e) => logger$i.error(e)).finally(() => setIsLoading(false));
40302
+ }, [getStatus]);
40273
40303
  return hasSignedAll ? /* @__PURE__ */ jsx(
40274
40304
  EmbeddedStatus,
40275
40305
  {
@@ -43609,7 +43639,7 @@ const ConfigurationApiProvider = ({
43609
43639
  }) => {
43610
43640
  const authContext = useAuthContext();
43611
43641
  const { isEmbeddedDropin, loadingContext } = authContext;
43612
- const sdkVersion = "3.41.4";
43642
+ const sdkVersion = "3.41.5";
43613
43643
  useAnalytics({
43614
43644
  onUserEvent,
43615
43645
  legalEntityId: rootLegalEntityId,
@@ -44233,7 +44263,124 @@ class BaseElement {
44233
44263
  }
44234
44264
  }
44235
44265
  }
44236
- const getRoleTagVariant = (value) => {
44266
+ const header = "adyen-kyc-header";
44267
+ const taskName = "adyen-kyc-task-name";
44268
+ const table = "adyen-kyc-table";
44269
+ const styles$1 = {
44270
+ header,
44271
+ "task-name": "adyen-kyc-task-name",
44272
+ taskName,
44273
+ table
44274
+ };
44275
+ const DebugTaskStatuses = ({ taskStatuses }) => {
44276
+ const { i18n } = useI18nContext();
44277
+ return /* @__PURE__ */ jsxs("table", { className: styles$1.table, children: [
44278
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: styles$1.header, children: [
44279
+ /* @__PURE__ */ jsx("th", { children: i18n.get("task") }),
44280
+ /* @__PURE__ */ jsx("th", { children: i18n.get("status") }),
44281
+ /* @__PURE__ */ jsx("th", { children: i18n.get("reason") })
44282
+ ] }) }),
44283
+ /* @__PURE__ */ jsx("tbody", { children: entriesOf(taskStatuses).toSorted(([t1], [t2]) => t1.localeCompare(t2)).map(([task, status]) => {
44284
+ const { taskType, id } = splitTaskIdentifier(task);
44285
+ return /* @__PURE__ */ jsxs("tr", { children: [
44286
+ /* @__PURE__ */ jsxs("td", { className: styles$1.taskName, children: [
44287
+ taskType,
44288
+ id ? `: ${id}` : ""
44289
+ ] }),
44290
+ status ? /* @__PURE__ */ jsxs(Fragment, { children: [
44291
+ /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(TaskItemStatus, { status: status.status }) }),
44292
+ /* @__PURE__ */ jsxs("td", { children: [
44293
+ i18n.get(status.reason),
44294
+ /* @__PURE__ */ jsx(ExplainDetails, { status })
44295
+ ] })
44296
+ ] }) : /* @__PURE__ */ jsx(Fragment, {})
44297
+ ] }, task);
44298
+ }) })
44299
+ ] });
44300
+ };
44301
+ const ExplainDetails = ({ status }) => {
44302
+ const { reason, details } = status;
44303
+ switch (reason) {
44304
+ case "invalidInputError": {
44305
+ const verificationError = details.verificationError;
44306
+ const subErrors = verificationError.subErrors;
44307
+ return /* @__PURE__ */ jsxs("div", { children: [
44308
+ verificationError.code,
44309
+ ": ",
44310
+ verificationError.message,
44311
+ subErrors ? /* @__PURE__ */ jsx("ul", { children: (verificationError.subErrors ?? []).map((subError) => /* @__PURE__ */ jsxs("li", { children: [
44312
+ subError.code,
44313
+ ": ",
44314
+ subError.message
44315
+ ] }, subError.code)) }) : /* @__PURE__ */ jsx(Fragment, {})
44316
+ ] });
44317
+ }
44318
+ case "dataMissingError": {
44319
+ const verificationError = details.verificationError;
44320
+ const subErrors = verificationError.subErrors;
44321
+ return /* @__PURE__ */ jsxs("div", { children: [
44322
+ verificationError.code,
44323
+ ": ",
44324
+ verificationError.message,
44325
+ subErrors ? /* @__PURE__ */ jsx("ul", { children: (verificationError.subErrors ?? []).map((subError) => /* @__PURE__ */ jsxs("li", { children: [
44326
+ subError.code,
44327
+ ": ",
44328
+ subError.message
44329
+ ] }, subError.code)) }) : /* @__PURE__ */ jsx(Fragment, {})
44330
+ ] });
44331
+ }
44332
+ }
44333
+ };
44334
+ const tabs = "adyen-kyc-tabs";
44335
+ const styles = {
44336
+ tabs
44337
+ };
44338
+ const Tabs = ({ tabs: tabs2, activeTab, onChange }) => /* @__PURE__ */ jsx("div", { className: styles.tabs, children: tabs2.map(({ name, label, disabled }) => /* @__PURE__ */ jsx(
44339
+ Button,
44340
+ {
44341
+ onClick: () => onChange(name),
44342
+ label,
44343
+ secondary: activeTab === name ? true : void 0,
44344
+ disabled
44345
+ },
44346
+ name
44347
+ )) });
44348
+ const listToRecord = (list, getValue) => list.reduce(
44349
+ (acc, k) => ({
44350
+ ...acc,
44351
+ [k]: getValue(k)
44352
+ }),
44353
+ {}
44354
+ );
44355
+ const filterData = (data, searchTerm) => data.filter(({ key }) => key.toLowerCase().includes(searchTerm.toLowerCase()));
44356
+ const sortData = (data) => [...data].toSorted(({ key: keyA }, { key: keyB }) => keyA.localeCompare(keyB));
44357
+ const DebugTable = ({
44358
+ data,
44359
+ heading,
44360
+ searchTerm,
44361
+ tagPosition = "after",
44362
+ sort = false
44363
+ }) => {
44364
+ const filteredData = useMemo(() => {
44365
+ const filtered = searchTerm ? filterData(data, searchTerm) : data;
44366
+ return sort ? sortData(filtered) : filtered;
44367
+ }, [data, searchTerm]);
44368
+ return /* @__PURE__ */ jsxs("div", { children: [
44369
+ heading ? /* @__PURE__ */ jsx("h3", { children: heading }) : void 0,
44370
+ filteredData.length === 0 ? /* @__PURE__ */ jsxs("p", { children: [
44371
+ "No results found for ",
44372
+ /* @__PURE__ */ jsx("strong", { children: searchTerm })
44373
+ ] }) : /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children: filteredData.map(({ key, value, label, variant }) => /* @__PURE__ */ jsxs("tr", { children: [
44374
+ tagPosition === "before" ? /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Tag, { variant: variant ?? "grey", className: "adyen-kyc-tag--large", children: value }) }) : void 0,
44375
+ /* @__PURE__ */ jsxs("td", { children: [
44376
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: key }),
44377
+ label && /* @__PURE__ */ jsx("span", { children: label })
44378
+ ] }),
44379
+ tagPosition === "after" ? /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Tag, { variant: variant ?? "grey", className: "adyen-kyc-tag--large", children: value }) }) : void 0
44380
+ ] }, key)) }) })
44381
+ ] });
44382
+ };
44383
+ const getSettingVariant = (value) => {
44237
44384
  switch (value) {
44238
44385
  case void 0:
44239
44386
  return "orange";
@@ -44245,166 +44392,184 @@ const getRoleTagVariant = (value) => {
44245
44392
  return "blue";
44246
44393
  }
44247
44394
  };
44248
- const getStatus = (value) => {
44249
- switch (value) {
44250
- case void 0:
44251
- return "undefined";
44252
- case true:
44253
- return "Enabled";
44254
- case false:
44255
- return "Disabled";
44256
- default:
44257
- return String(value);
44258
- }
44395
+ const DebugExperimentsAndSettings = ({
44396
+ experiments,
44397
+ settings
44398
+ }) => {
44399
+ const [searchTerm, setSearchTerm] = useState("");
44400
+ const experimentRows = entriesOf(experiments).map(
44401
+ ([experimentName, enabled]) => ({
44402
+ key: `${experimentName}`,
44403
+ value: enabled ? "Enabled" : "Disabled",
44404
+ variant: enabled ? "green" : "red"
44405
+ })
44406
+ );
44407
+ const settingRows = entriesOf(settings).map(([settingName, value]) => ({
44408
+ key: settingName,
44409
+ value: `${value}`,
44410
+ variant: getSettingVariant(value)
44411
+ }));
44412
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
44413
+ /* @__PURE__ */ jsx(
44414
+ InputText,
44415
+ {
44416
+ name: "search",
44417
+ value: searchTerm,
44418
+ classNameModifiers: ["search"],
44419
+ onInput: (e) => setSearchTerm(e.target.value),
44420
+ placeholder: "Search for Experiments/Settings 🔎",
44421
+ trimOnBlur: true,
44422
+ spellCheck: false,
44423
+ "aria-label": "Search experiments or settings",
44424
+ "aria-invalid": false
44425
+ }
44426
+ ),
44427
+ /* @__PURE__ */ jsx(
44428
+ DebugTable,
44429
+ {
44430
+ tagPosition: "before",
44431
+ data: experimentRows,
44432
+ heading: "Experiments",
44433
+ searchTerm,
44434
+ sort: true
44435
+ }
44436
+ ),
44437
+ /* @__PURE__ */ jsx(DebugTable, { data: settingRows, heading: "Settings", searchTerm, sort: true })
44438
+ ] });
44259
44439
  };
44260
- const filterData = (data, searchTerm) => data.filter(([key]) => key.toLowerCase().includes(searchTerm.toLowerCase()));
44261
- const sortData = (data) => [...data].sort(([keyA], [keyB]) => keyA.localeCompare(keyB));
44262
- const DebugTable = ({ data, keyHeading, searchTerm }) => {
44263
- const filteredData = sortData(filterData(data, searchTerm));
44264
- return /* @__PURE__ */ jsxs("div", { children: [
44265
- /* @__PURE__ */ jsx("h2", { children: keyHeading }),
44266
- filteredData.length === 0 ? /* @__PURE__ */ jsxs("p", { children: [
44267
- "No results found for ",
44268
- /* @__PURE__ */ jsx("strong", { children: searchTerm })
44269
- ] }) : /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children: filteredData.map(([keyName, value, label]) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
44270
- /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: keyName }),
44271
- label && /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-label", children: label }),
44272
- /* @__PURE__ */ jsx(Tag, { variant: getRoleTagVariant(value), className: "adyen-kyc-tag--large", children: getStatus(value) })
44273
- ] }) }, keyName)) }) })
44440
+ const DebugLegalEntityData = ({ legalEntityData }) => {
44441
+ var _a;
44442
+ if (!legalEntityData) return /* @__PURE__ */ jsx(Fragment, {});
44443
+ const { rootLegalEntity, rootLegalEntityType } = legalEntityData;
44444
+ const uboDetails = ((_a = rootLegalEntity.entityAssociations) == null ? void 0 : _a.map(
44445
+ ({ name, type, jobTitle }) => (
44446
+ // If `name` is undefined, replace the tuple with `null` to easily filter it out later. Checking this to ensure that the 'data' for DebugTable always has a keyName.
44447
+ name ? {
44448
+ key: name,
44449
+ value: `${type}`,
44450
+ label: jobTitle,
44451
+ variant: "blue"
44452
+ } : null
44453
+ )
44454
+ ).filter(Boolean)) ?? [];
44455
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
44456
+ /* @__PURE__ */ jsxs("span", { children: [
44457
+ "Root legal entity type: ",
44458
+ /* @__PURE__ */ jsx(Tag, { children: rootLegalEntityType })
44459
+ ] }),
44460
+ uboDetails.length ? /* @__PURE__ */ jsx(DebugTable, { data: uboDetails, heading: "Decision Makers" }) : void 0,
44461
+ rootLegalEntity ? /* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLegalEntity, null, 2) }) : void 0
44274
44462
  ] });
44275
44463
  };
44464
+ const DebugMetadata = ({
44465
+ metadata: { sdkVersion, locale, rootLegalEntityId }
44466
+ }) => {
44467
+ const rows = [
44468
+ { key: "SDK version", value: sdkVersion, variant: "green" },
44469
+ { key: "Locale", value: locale, variant: "blue" },
44470
+ { key: "Root legal entity ID", value: rootLegalEntityId, variant: "teal" }
44471
+ ];
44472
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx(DebugTable, { data: rows }) });
44473
+ };
44276
44474
  const logger = createLogger("DebugModal");
44277
44475
  const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
44278
- var _a;
44279
44476
  const { isExperimentEnabled } = useExperimentsContext();
44280
44477
  const { getSetting } = useSettingsContext();
44281
- const [rootLeData, setRootLeData] = useState();
44478
+ const [legalEntityData, setLegalEntityData] = useState();
44282
44479
  const [debugInfoCopied, setDebugInfoCopied] = useState(false);
44283
- const [isRootLeDataEnabled, setIsRootLeDataEnabled] = useState(false);
44284
- const [searchTerm, setSearchTerm] = useState("");
44285
44480
  const { i18n } = useI18nContext();
44286
- const allExperimentsWithValues = valuesOf(ExperimentNames).map(
44287
- (experimentName) => [experimentName, isExperimentEnabled(experimentName)]
44288
- );
44289
- const allSettingsWithValues = valuesOf(SettingNames).map(
44290
- (settingName) => [settingName, getSetting(settingName)]
44291
- );
44292
- const debugModalMetaData = [
44293
- { key: "SDK version", value: "3.41.4", variant: "green" },
44294
- { key: "rootLegalEntityId", value: rootLegalEntityId, variant: "blue" },
44295
- { key: "Locale", value: i18n.locale, variant: "blue" },
44296
- { key: "Language", value: i18n.languageCode, variant: "blue" },
44297
- rootLeData && {
44298
- key: "rootLegalEntityType",
44299
- value: rootLeData.type,
44300
- variant: "blue"
44301
- }
44302
- ].filter(Boolean);
44303
- const fetchRootLeData = () => {
44481
+ const [tab, setTab] = useState("metadata");
44482
+ const metadata = {
44483
+ sdkVersion: "3.41.5",
44484
+ locale: i18n.locale,
44485
+ rootLegalEntityId
44486
+ };
44487
+ const experiments = listToRecord(valuesOf(ExperimentNames), isExperimentEnabled);
44488
+ const settings = listToRecord(valuesOf(SettingNames), getSetting);
44489
+ const taskStatuses = useTaskStatuses();
44490
+ const fetchLegalEntityData = async () => {
44304
44491
  if (!getRootLegalEntity) return;
44305
- getRootLegalEntity().then(setRootLeData).catch(logger.error);
44306
- };
44307
- const uboDetails = ((_a = rootLeData == null ? void 0 : rootLeData.entityAssociations) == null ? void 0 : _a.map(
44308
- ({ name, type, jobTitle }) => (
44309
- // If `name` is undefined, replace the tuple with `null` to easily filter it out later. Checking this to ensure that the 'data' for DebugTable always has a keyName.
44310
- name ? [name, type, jobTitle] : null
44311
- )
44312
- ).filter(
44313
- (item) => item !== null
44314
- )) ?? [];
44315
- const handleToggleRootLeData = () => {
44316
- if (!isRootLeDataEnabled) {
44317
- fetchRootLeData();
44318
- } else {
44319
- setRootLeData(void 0);
44320
- }
44321
- setIsRootLeDataEnabled(!isRootLeDataEnabled);
44492
+ const rootLegalEntity = await getRootLegalEntity();
44493
+ const data = {
44494
+ rootLegalEntity,
44495
+ rootLegalEntityType: rootLegalEntity.type
44496
+ };
44497
+ setLegalEntityData(data);
44498
+ return data;
44322
44499
  };
44323
44500
  const copyToClipboard = async () => {
44324
44501
  const toCopy = {
44325
- sdkVersion: "3.41.4",
44326
- experiments: Object.fromEntries(allExperimentsWithValues),
44327
- settings: Object.fromEntries(allSettingsWithValues)
44502
+ metadata,
44503
+ experiments,
44504
+ settings,
44505
+ taskStatuses,
44506
+ legalEntityData: await fetchLegalEntityData()
44328
44507
  };
44329
- if (getRootLegalEntity) {
44330
- toCopy.rootLegalEntity = await getRootLegalEntity();
44331
- }
44332
44508
  await window.navigator.clipboard.writeText(JSON.stringify(toCopy, null, 2));
44333
44509
  setDebugInfoCopied(true);
44334
44510
  setTimeout(() => {
44335
44511
  setDebugInfoCopied(false);
44336
44512
  }, 5e3);
44337
44513
  };
44338
- const header = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__header", children: [
44514
+ const changeTab = (tab2) => {
44515
+ if (tab2 === "legalEntityData") {
44516
+ fetchLegalEntityData().catch(logger.error);
44517
+ }
44518
+ setTab(tab2);
44519
+ };
44520
+ const header2 = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__header", children: [
44339
44521
  /* @__PURE__ */ jsx("h1", { children: "Debug" }),
44340
44522
  /* @__PURE__ */ jsx(
44341
- InputText,
44523
+ Tabs,
44342
44524
  {
44343
- name: "search",
44344
- value: searchTerm,
44345
- classNameModifiers: ["search"],
44346
- onInput: (e) => setSearchTerm(e.target.value),
44347
- placeholder: "Search for Experiments/Settings 🔎",
44348
- trimOnBlur: true,
44349
- spellCheck: false,
44350
- "aria-label": "Search experiments or settings",
44351
- "aria-invalid": false
44525
+ activeTab: tab,
44526
+ onChange: changeTab,
44527
+ tabs: [
44528
+ {
44529
+ name: "metadata",
44530
+ label: "Metadata"
44531
+ },
44532
+ {
44533
+ name: "experimentsSettings",
44534
+ label: "Experiments & Settings"
44535
+ },
44536
+ {
44537
+ name: "taskStatuses",
44538
+ label: "Task Statuses"
44539
+ },
44540
+ {
44541
+ name: "legalEntityData",
44542
+ label: "Legal Entity Data"
44543
+ }
44544
+ ]
44352
44545
  }
44353
44546
  )
44354
44547
  ] });
44355
- const footer = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__footer", children: [
44356
- /* @__PURE__ */ jsxs("div", { children: [
44357
- /* @__PURE__ */ jsx(
44358
- Button,
44359
- {
44360
- label: "Copy debug info",
44361
- "aria-label": "Copy debug info",
44362
- icon: "document",
44363
- onClick: () => {
44364
- copyToClipboard().catch((error) => {
44365
- logger.error("Error copying to clipboard:", error);
44366
- });
44367
- }
44368
- }
44369
- ),
44370
- debugInfoCopied ? /* @__PURE__ */ jsxs("span", { className: "adyen-kyc-debug-modal__footer--copy-status", children: [
44371
- /* @__PURE__ */ jsx(Icon, { name: "check" }),
44372
- " Copied!"
44373
- ] }) : void 0
44374
- ] }),
44548
+ const footer = /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__footer", children: /* @__PURE__ */ jsxs("div", { children: [
44375
44549
  /* @__PURE__ */ jsx(
44376
44550
  Button,
44377
44551
  {
44378
- icon: isRootLeDataEnabled ? "show" : "hide",
44379
- iconPosition: "left",
44380
- "aria-label": isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
44381
- label: isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
44382
- onClick: handleToggleRootLeData
44383
- }
44384
- )
44385
- ] });
44386
- return /* @__PURE__ */ jsx(Modal, { size: "fullscreen", header, footer, onClose: onExit, children: /* @__PURE__ */ jsxs(Fragment, { children: [
44387
- /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children: debugModalMetaData.map(({ key, value, variant }) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
44388
- /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: key }),
44389
- /* @__PURE__ */ jsx(Tag, { variant, className: "adyen-kyc-tag--large", children: value })
44390
- ] }) }, key)) }) }) }),
44391
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__content", children: [
44392
- rootLeData ? /* @__PURE__ */ jsxs(Fragment, { children: [
44393
- /* @__PURE__ */ jsx("h2", { children: "Legal Entity Data" }),
44394
- /* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLeData, null, 2) })
44395
- ] }) : void 0,
44396
- (uboDetails == null ? void 0 : uboDetails.length) ? /* @__PURE__ */ jsx(DebugTable, { data: uboDetails, keyHeading: "Decision Makers", searchTerm }) : "",
44397
- /* @__PURE__ */ jsx(
44398
- DebugTable,
44399
- {
44400
- data: allExperimentsWithValues,
44401
- keyHeading: "Experiments",
44402
- searchTerm
44552
+ label: "Copy debug info",
44553
+ "aria-label": "Copy debug info",
44554
+ icon: "document",
44555
+ onClick: () => {
44556
+ copyToClipboard().catch((error) => {
44557
+ logger.error("Error copying to clipboard:", error);
44558
+ });
44403
44559
  }
44404
- ),
44405
- /* @__PURE__ */ jsx(DebugTable, { data: allSettingsWithValues, keyHeading: "Settings", searchTerm })
44406
- ] })
44560
+ }
44561
+ ),
44562
+ debugInfoCopied ? /* @__PURE__ */ jsxs("span", { className: "adyen-kyc-debug-modal__footer--copy-status", children: [
44563
+ /* @__PURE__ */ jsx(Icon, { name: "check" }),
44564
+ " Copied!"
44565
+ ] }) : void 0
44407
44566
  ] }) });
44567
+ return /* @__PURE__ */ jsx(Modal, { size: "fullscreen", header: header2, footer, onClose: onExit, children: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__content", children: [
44568
+ tab === "metadata" ? /* @__PURE__ */ jsx(DebugMetadata, { metadata }) : void 0,
44569
+ tab === "taskStatuses" ? /* @__PURE__ */ jsx(DebugTaskStatuses, { taskStatuses }) : void 0,
44570
+ tab === "experimentsSettings" ? /* @__PURE__ */ jsx(DebugExperimentsAndSettings, { experiments, settings }) : void 0,
44571
+ tab === "legalEntityData" ? /* @__PURE__ */ jsx(DebugLegalEntityData, { legalEntityData }) : void 0
44572
+ ] }) }) });
44408
44573
  };
44409
44574
  const DebugWrapper = ({
44410
44575
  rootLegalEntityId,