@adyen/kyc-components 2.18.0 → 2.18.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.
@@ -316,9 +316,9 @@ const directorDescription = "Someone appointed to manage a company's business an
316
316
  const provideAllDirectors = "Add <strong>all directors</strong>. You should have at least 1 director.";
317
317
  const addDecisionMaker = "Add decision-maker";
318
318
  const decisionMakers = "Decision-makers";
319
- const goToIntro = "How does it work?";
319
+ const goToIntroduction = "How does it work?";
320
320
  const goToOverview = "Go to overview";
321
- const goToOverviewFromIntro = "Skip intro";
321
+ const goToOverviewFromIntroduction = "Skip intro";
322
322
  const saveAndGoToOverview = "Save and go to overview";
323
323
  const pleaseEnsureTheFollowing = "Please ensure the following section is fulfilled to complete the review of your data.";
324
324
  const edit = "Edit";
@@ -1091,31 +1091,41 @@ const firstNameOfSettlor = "First name of settlor";
1091
1091
  const lastNameOfSettlor = "Last name of settlor";
1092
1092
  const enterSettlorsFirstNameExactlyAsItAppearsInID = "Enter the settlor's first name(s) exactly as it appears on their identity document";
1093
1093
  const enterSettlorsLastNameExactlyAsItAppearsInID = "Enter the settlor's last name(s) exactly as it appears on their identity document";
1094
- const taskIntroPrologueTitle = "Before you begin...";
1095
- const taskIntroPrologueDescriptionP1 = "We'll ask for some details about your business as part of financial regulations.";
1096
- const taskIntroPrologueDescriptionP2 = "Our advice? Have these details on hand so you can get verified quickly.";
1097
- const taskIntroCompanyTitle = "Company details";
1098
- const taskIntroCompanyDescriptionP1 = "For example, your company name and registration number.";
1099
- const taskIntroCompanyDescriptionP2 = "Where to find this information";
1100
- const taskIntroCompanyDescriptionLI1 = "Your company registration document";
1101
- const taskIntroDecisionMakerTitle = "Decision-makers";
1102
- const taskIntroDecisionMakerDescriptionP1 = "For example, the name and address of important people in your company.";
1103
- const taskIntroDecisionMakerDescriptionP2 = "Where to find this information";
1104
- const taskIntroDecisionMakerDescriptionLI1 = "Driver's license";
1105
- const taskIntroDecisionMakerDescriptionLI2 = "Passport";
1106
- const taskIntroDecisionMakerDescriptionLI3 = "ID document";
1107
- const taskIntroIndividualTitle = "Personal details";
1108
- const taskIntroIndividualDescriptionP1 = "For example, your name and residential address.";
1109
- const taskIntroIndividualDescriptionP2 = "Where to find this information";
1110
- const taskIntroIndividualDescriptionLI1 = "Driver's license";
1111
- const taskIntroIndividualDescriptionLI2 = "Passport";
1112
- const taskIntroIndividualDescriptionLI3 = "ID document";
1113
- const taskIntroPayoutTitle = "Bank account details";
1114
- const taskIntroPayoutDescriptionP1 = "For example, the account holder name and account number.";
1115
- const taskIntroPayoutDescriptionP2 = "This is the bank account you use to send or receive funds.";
1116
- const taskIntroEpilogueTitle = "Why do we need this information?";
1117
- const taskIntroEpilogueDescriptionP1 = "We check all this information against official records to verify your identity and comply with financial regulations.";
1118
- const taskIntroEpilogueDescriptionP2 = "Your information will be used only for these purposes.";
1094
+ const introductionScreenPrologueTitle = "Before you begin...";
1095
+ const introductionScreenPrologueDescriptionP1 = "Well ask for some details about your business as part of financial regulations.";
1096
+ const introductionScreenPrologueDescriptionP2 = "Our advice? Have these details on hand so you can get verified quickly.";
1097
+ const introductionScreenCompanyTitle = "Company details";
1098
+ const introductionScreenCompanyDescriptionP1 = "For example, your company name and registration number.";
1099
+ const introductionScreenCompanyDescriptionP2 = "Where to find this information";
1100
+ const introductionScreenCompanyDescriptionLI1 = "Your company registration document";
1101
+ const introductionScreenIndividualTitle = "Personal details";
1102
+ const introductionScreenIndividualDescriptionP1 = "For example, your name and residential address.";
1103
+ const introductionScreenIndividualDescriptionP2 = "Where to find this information";
1104
+ const introductionScreenIndividualDescriptionLI1 = "Drivers license";
1105
+ const introductionScreenIndividualDescriptionLI2 = "Passport";
1106
+ const introductionScreenIndividualDescriptionLI3 = "ID document";
1107
+ const introductionScreenDecisionMakerTitle = "Decision-makers";
1108
+ const introductionScreenDecisionMakerDescriptionP1 = "For example, the name and address of important people in your company.";
1109
+ const introductionScreenDecisionMakerDescriptionP2 = "Where to find this information";
1110
+ const introductionScreenDecisionMakerDescriptionLI1 = "Drivers license";
1111
+ const introductionScreenDecisionMakerDescriptionLI2 = "Passport";
1112
+ const introductionScreenDecisionMakerDescriptionLI3 = "ID document";
1113
+ const introductionScreenTrustTitle = "Trust details";
1114
+ const introductionScreenTrustDescriptionP1 = "For example, your trust’s name and business number. You’ll also need to upload your trust deed.";
1115
+ const introductionScreenTrustDescriptionP2 = "Where to find this information";
1116
+ const introductionScreenTrustDescriptionLI1 = "Your trust registration document";
1117
+ const introductionScreenTrustMemberTitle = "Trust members";
1118
+ const introductionScreenTrustMemberDescriptionP1 = "The name, date of birth, and address of trust members such as settlors and beneficiaries.";
1119
+ const introductionScreenTrustMemberDescriptionP2 = "Where to find this information";
1120
+ const introductionScreenTrustMemberDescriptionLI1 = "Driver’s license";
1121
+ const introductionScreenTrustMemberDescriptionLI2 = "Passport";
1122
+ const introductionScreenTrustMemberDescriptionLI3 = "ID document";
1123
+ const introductionScreenAccountTitle = "Bank account details";
1124
+ const introductionScreenAccountDescriptionP1 = "For example, the account holder name and account number.";
1125
+ const introductionScreenAccountDescriptionP2 = "This is the bank account you use to send or receive funds.";
1126
+ const introductionScreenEpilogueTitle = "Why do we need this information?";
1127
+ const introductionScreenEpilogueDescriptionP1 = "We check all this information against official records to verify your identity and comply with financial regulations.";
1128
+ const introductionScreenEpilogueDescriptionP2 = "Your information will be used only for these purposes.";
1119
1129
  const defaultTrans = {
1120
1130
  close,
1121
1131
  individual,
@@ -1419,9 +1429,9 @@ const defaultTrans = {
1419
1429
  provideAllDirectors,
1420
1430
  addDecisionMaker,
1421
1431
  decisionMakers,
1422
- goToIntro,
1432
+ goToIntroduction,
1423
1433
  goToOverview,
1424
- goToOverviewFromIntro,
1434
+ goToOverviewFromIntroduction,
1425
1435
  saveAndGoToOverview,
1426
1436
  pleaseEnsureTheFollowing,
1427
1437
  edit,
@@ -2211,31 +2221,41 @@ const defaultTrans = {
2211
2221
  lastNameOfSettlor,
2212
2222
  enterSettlorsFirstNameExactlyAsItAppearsInID,
2213
2223
  enterSettlorsLastNameExactlyAsItAppearsInID,
2214
- taskIntroPrologueTitle,
2215
- taskIntroPrologueDescriptionP1,
2216
- taskIntroPrologueDescriptionP2,
2217
- taskIntroCompanyTitle,
2218
- taskIntroCompanyDescriptionP1,
2219
- taskIntroCompanyDescriptionP2,
2220
- taskIntroCompanyDescriptionLI1,
2221
- taskIntroDecisionMakerTitle,
2222
- taskIntroDecisionMakerDescriptionP1,
2223
- taskIntroDecisionMakerDescriptionP2,
2224
- taskIntroDecisionMakerDescriptionLI1,
2225
- taskIntroDecisionMakerDescriptionLI2,
2226
- taskIntroDecisionMakerDescriptionLI3,
2227
- taskIntroIndividualTitle,
2228
- taskIntroIndividualDescriptionP1,
2229
- taskIntroIndividualDescriptionP2,
2230
- taskIntroIndividualDescriptionLI1,
2231
- taskIntroIndividualDescriptionLI2,
2232
- taskIntroIndividualDescriptionLI3,
2233
- taskIntroPayoutTitle,
2234
- taskIntroPayoutDescriptionP1,
2235
- taskIntroPayoutDescriptionP2,
2236
- taskIntroEpilogueTitle,
2237
- taskIntroEpilogueDescriptionP1,
2238
- taskIntroEpilogueDescriptionP2
2224
+ introductionScreenPrologueTitle,
2225
+ introductionScreenPrologueDescriptionP1,
2226
+ introductionScreenPrologueDescriptionP2,
2227
+ introductionScreenCompanyTitle,
2228
+ introductionScreenCompanyDescriptionP1,
2229
+ introductionScreenCompanyDescriptionP2,
2230
+ introductionScreenCompanyDescriptionLI1,
2231
+ introductionScreenIndividualTitle,
2232
+ introductionScreenIndividualDescriptionP1,
2233
+ introductionScreenIndividualDescriptionP2,
2234
+ introductionScreenIndividualDescriptionLI1,
2235
+ introductionScreenIndividualDescriptionLI2,
2236
+ introductionScreenIndividualDescriptionLI3,
2237
+ introductionScreenDecisionMakerTitle,
2238
+ introductionScreenDecisionMakerDescriptionP1,
2239
+ introductionScreenDecisionMakerDescriptionP2,
2240
+ introductionScreenDecisionMakerDescriptionLI1,
2241
+ introductionScreenDecisionMakerDescriptionLI2,
2242
+ introductionScreenDecisionMakerDescriptionLI3,
2243
+ introductionScreenTrustTitle,
2244
+ introductionScreenTrustDescriptionP1,
2245
+ introductionScreenTrustDescriptionP2,
2246
+ introductionScreenTrustDescriptionLI1,
2247
+ introductionScreenTrustMemberTitle,
2248
+ introductionScreenTrustMemberDescriptionP1,
2249
+ introductionScreenTrustMemberDescriptionP2,
2250
+ introductionScreenTrustMemberDescriptionLI1,
2251
+ introductionScreenTrustMemberDescriptionLI2,
2252
+ introductionScreenTrustMemberDescriptionLI3,
2253
+ introductionScreenAccountTitle,
2254
+ introductionScreenAccountDescriptionP1,
2255
+ introductionScreenAccountDescriptionP2,
2256
+ introductionScreenEpilogueTitle,
2257
+ introductionScreenEpilogueDescriptionP1,
2258
+ introductionScreenEpilogueDescriptionP2
2239
2259
  };
2240
2260
  const FALLBACK_LOCALE = "en-US";
2241
2261
  const defaultTranslation = defaultTrans;
@@ -3162,11 +3182,15 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
3162
3182
  SettingNames2["AllowIntraRegionCrossBorderPayout"] = "allowIntraRegionCrossBorderPayout";
3163
3183
  SettingNames2["AllowLegalEntityTypeChange"] = "changeLegalEntityType";
3164
3184
  SettingNames2["AllowPrefilledCountryEdit"] = "editPrefilledCountry";
3165
- SettingNames2["ViewOnboardingGuidance"] = "viewOnboardingGuidance";
3166
3185
  SettingNames2["RequirePciSignEcommerce"] = "requirePciSignEcommerce";
3167
3186
  SettingNames2["RequirePciSignPos"] = "requirePciSignPos";
3168
3187
  SettingNames2["RequirePciSignEcomMoto"] = "requirePciSignEcomMoto";
3169
3188
  SettingNames2["RequirePciSignPosMoto"] = "requirePciSignPosMoto";
3189
+ SettingNames2["HideOnboardingIntroductionIndividual"] = "hideOnboardingIntroductionIndividual";
3190
+ SettingNames2["HideOnboardingIntroductionOrganization"] = "hideOnboardingIntroductionOrganization";
3191
+ SettingNames2["HideOnboardingIntroductionTrust"] = "hideOnboardingIntroductionTrust";
3192
+ SettingNames2["HideOnboardingIntroductionSoleProprietor"] = "hideOnboardingIntroductionSoleProprietor";
3193
+ SettingNames2["ViewOnboardingGuidance"] = "viewOnboardingGuidance";
3170
3194
  return SettingNames2;
3171
3195
  })(SettingNames || {});
3172
3196
  const ON_CHANGE_DEBOUNCE_DURATION = 200;
@@ -8716,7 +8740,7 @@ var DecisionMakerType = /* @__PURE__ */ ((DecisionMakerType2) => {
8716
8740
  })(DecisionMakerType || {});
8717
8741
  var TaskTypes = /* @__PURE__ */ ((TaskTypes2) => {
8718
8742
  TaskTypes2["BUSINESS_TYPE_SELECTION"] = "BUSINESS_TYPE_SELECTION";
8719
- TaskTypes2["INTRO"] = "INTRO";
8743
+ TaskTypes2["INTRODUCTION"] = "INTRODUCTION";
8720
8744
  TaskTypes2["TASKS_OVERVIEW"] = "TASKS_OVERVIEW";
8721
8745
  TaskTypes2["REVIEW"] = "REVIEW";
8722
8746
  TaskTypes2["INDIVIDUAL"] = "INDIVIDUAL";
@@ -19311,7 +19335,7 @@ const entityProblemInitialState = {
19311
19335
  // default status - if the entity is not listed in the problems array
19312
19336
  validationErrors: {}
19313
19337
  };
19314
- const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036"];
19338
+ const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8189"];
19315
19339
  const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
19316
19340
  function getCapabilityProblems(response) {
19317
19341
  const capabilities = (response == null ? void 0 : response.capabilities) || {};
@@ -19352,9 +19376,7 @@ function setVerificationError(error, entityProblems) {
19352
19376
  break;
19353
19377
  }
19354
19378
  case VerificationErrorType.DATA_MISSING: {
19355
- if (!isUnRelatedErrorCode(error)) {
19356
- setMissingDataError(error, entityProblems);
19357
- }
19379
+ setMissingDataError(error, entityProblems);
19358
19380
  break;
19359
19381
  }
19360
19382
  case VerificationErrorType.DATA_REVIEW:
@@ -19368,7 +19390,9 @@ function setVerificationError(error, entityProblems) {
19368
19390
  const isUnRelatedErrorCode = (error) => UNRELATED_DATA_MISSING_ERROR_CODES.includes(error == null ? void 0 : error.code) || UNRELATED_INVALID_INPUT_ERROR_CODES.includes(error == null ? void 0 : error.code);
19369
19391
  function setMissingDataError(verificationError, entityProblems) {
19370
19392
  entityProblems.missingData = entityProblems.missingData ? [...entityProblems.missingData, verificationError] : [verificationError];
19371
- setPriorityStatus(entityProblems, TaskStatus.DETAILS_REQUIRED);
19393
+ if (!isUnRelatedErrorCode(verificationError)) {
19394
+ setPriorityStatus(entityProblems, TaskStatus.DETAILS_REQUIRED);
19395
+ }
19372
19396
  }
19373
19397
  const setReviewRequiredError = (verificationError, entityProblems) => {
19374
19398
  entityProblems.isReviewRequired = true;
@@ -21432,7 +21456,7 @@ function CompanyDropinComponent({
21432
21456
  });
21433
21457
  }
21434
21458
  const logger$8 = createLogger("useLocalStorage");
21435
- function useLocalStorage(key, defaultValue, options) {
21459
+ const useLocalStorage = (key, defaultValue, options) => {
21436
21460
  const {
21437
21461
  serializer,
21438
21462
  parser,
@@ -21508,32 +21532,74 @@ function useLocalStorage(key, defaultValue, options) {
21508
21532
  return () => window.removeEventListener("storage", handleStorageChange);
21509
21533
  }, [key, syncData]);
21510
21534
  return [value, setValue];
21511
- }
21512
- const isIntroForLE = (legalEntity) => Boolean(legalEntity.type) && (legalEntity.type === LegalEntityType.INDIVIDUAL || legalEntity.type === LegalEntityType.ORGANIZATION) && !(hasOwnEntityAssociationOfType(LegalEntityType.SOLE_PROPRIETORSHIP, legalEntity.entityAssociations, legalEntity.id) || hasOwnEntityAssociationOfType(LegalEntityType.TRUST, legalEntity.entityAssociations, legalEntity.id));
21513
- const useCanSeeIntro = (legalEntity) => {
21514
- const {
21515
- isSettingEnabled
21516
- } = useSettingsContext();
21517
- return {
21518
- canSeeIntro: isSettingEnabled("viewOnboardingGuidance") && isIntroForLE(legalEntity)
21519
- };
21520
21535
  };
21521
- const getHasSeenIntroStorageKey = (legalEntityId) => `COMPLETED_INTRO-${legalEntityId}`;
21522
- const useHasSeenIntro = (legalEntityId) => {
21523
- const [hasSeenIntro, setHasSeenIntro] = useLocalStorage(getHasSeenIntroStorageKey(legalEntityId), false);
21536
+ const getHasSeenIntroductionStorageKey = (legalEntityId) => `COMPLETED_INTRO-${legalEntityId}`;
21537
+ const useHasSeenIntroduction = ({
21538
+ legalEntityId
21539
+ }) => {
21540
+ const [hasSeenIntroduction, setHasSeenIntroduction] = useLocalStorage(getHasSeenIntroductionStorageKey(legalEntityId), false);
21524
21541
  return {
21525
- hasSeenIntro,
21526
- setHasSeenIntro
21542
+ hasSeenIntroduction,
21543
+ setHasSeenIntroduction
21527
21544
  };
21528
21545
  };
21529
- const useShouldShowIntro = (legalEntity) => {
21546
+ const useLegalEntityType = ({
21547
+ legalEntity
21548
+ }) => {
21549
+ const {
21550
+ isExperimentEnabled
21551
+ } = useExperimentsContext();
21552
+ const isTrust = isPartOfTrustFromLegalEntity(legalEntity);
21553
+ const isSoleProprietor = hasSolePropInLegalEntity(legalEntity);
21554
+ const hasLegalAssociation = isTrust || isSoleProprietor;
21555
+ switch (legalEntity.type) {
21556
+ case LegalEntityType.INDIVIDUAL:
21557
+ case LegalEntityType.ORGANIZATION:
21558
+ if (!hasLegalAssociation)
21559
+ return legalEntity.type;
21560
+ if (isSoleProprietor)
21561
+ return LegalEntityType.SOLE_PROPRIETORSHIP;
21562
+ if (isTrust)
21563
+ return isExperimentEnabled(ExperimentNames.EnableTrustFlow) ? LegalEntityType.TRUST : legalEntity.type;
21564
+ break;
21565
+ default:
21566
+ return void 0;
21567
+ }
21568
+ };
21569
+ const useCanSeeIntroduction = ({
21570
+ legalEntity
21571
+ }) => {
21572
+ const legalEntityType = useLegalEntityType({
21573
+ legalEntity
21574
+ });
21530
21575
  const {
21531
- canSeeIntro
21532
- } = useCanSeeIntro(legalEntity);
21576
+ isSettingEnabled
21577
+ } = useSettingsContext();
21578
+ switch (legalEntityType) {
21579
+ case LegalEntityType.INDIVIDUAL:
21580
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionIndividual);
21581
+ case LegalEntityType.ORGANIZATION:
21582
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionOrganization);
21583
+ case LegalEntityType.SOLE_PROPRIETORSHIP:
21584
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionSoleProprietor);
21585
+ case LegalEntityType.TRUST:
21586
+ return !isSettingEnabled(SettingNames.HideOnboardingIntroductionTrust);
21587
+ default:
21588
+ return false;
21589
+ }
21590
+ };
21591
+ const useShouldShowIntroduction = ({
21592
+ legalEntity
21593
+ }) => {
21594
+ const canSeeIntroduction = useCanSeeIntroduction({
21595
+ legalEntity
21596
+ });
21533
21597
  const {
21534
- hasSeenIntro
21535
- } = useHasSeenIntro(legalEntity.id);
21536
- return canSeeIntro && !hasSeenIntro;
21598
+ hasSeenIntroduction
21599
+ } = useHasSeenIntroduction({
21600
+ legalEntityId: legalEntity.id
21601
+ });
21602
+ return canSeeIntroduction && !hasSeenIntroduction;
21537
21603
  };
21538
21604
  const useShouldShowBusinessTypeSelection = (accountHolder2) => {
21539
21605
  const {
@@ -22412,12 +22478,13 @@ function useDataMissingRemediations({
22412
22478
  const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
22413
22479
  return remediation ? [...remediations, remediation] : remediations;
22414
22480
  }, []);
22415
- switch (remediationCodes == null ? void 0 : remediationCodes.length) {
22481
+ const uniqueRemediations = [...new Set(remediationCodes)];
22482
+ switch (uniqueRemediations == null ? void 0 : uniqueRemediations.length) {
22416
22483
  case void 0:
22417
22484
  case 0:
22418
22485
  return void 0;
22419
22486
  case 1:
22420
- return remediationCodes[0] ? i18n.get(`remediationMessage_${remediationCodes[0]}`) : i18n.get("missingMultipleDecisionMakers");
22487
+ return uniqueRemediations[0] ? i18n.get(`remediationMessage_${uniqueRemediations[0]}`) : i18n.get("missingMultipleDecisionMakers");
22421
22488
  default:
22422
22489
  return i18n.get("missingMultipleDecisionMakers");
22423
22490
  }
@@ -23293,7 +23360,47 @@ function ReviewComponent({
23293
23360
  footer
23294
23361
  });
23295
23362
  }
23296
- const _taskIntros_component = "";
23363
+ const _introduction_component = "";
23364
+ var IntroductionScreens = ((IntroductionScreens2) => {
23365
+ IntroductionScreens2["PROLOGUE"] = "PROLOGUE";
23366
+ IntroductionScreens2[IntroductionScreens2["COMPANY"] = TaskTypes.COMPANY] = "COMPANY";
23367
+ IntroductionScreens2[IntroductionScreens2["INDIVIDUAL"] = TaskTypes.INDIVIDUAL] = "INDIVIDUAL";
23368
+ IntroductionScreens2[IntroductionScreens2["DECISION_MAKER"] = TaskTypes.DECISION_MAKER] = "DECISION_MAKER";
23369
+ IntroductionScreens2[IntroductionScreens2["TRUST"] = TaskTypes.TRUST] = "TRUST";
23370
+ IntroductionScreens2[IntroductionScreens2["TRUST_MEMBER_OVERVIEW"] = TaskTypes.TRUST_MEMBER_OVERVIEW] = "TRUST_MEMBER_OVERVIEW";
23371
+ IntroductionScreens2["ACCOUNT"] = "ACCOUNT";
23372
+ IntroductionScreens2["EPILOGUE"] = "EPILOGUE";
23373
+ return IntroductionScreens2;
23374
+ })(IntroductionScreens || {});
23375
+ const introductionScreensByLegalEntityType = {
23376
+ [LegalEntityType.INDIVIDUAL]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
23377
+ [LegalEntityType.ORGANIZATION]: [IntroductionScreens.PROLOGUE, IntroductionScreens.COMPANY, IntroductionScreens.DECISION_MAKER, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
23378
+ [LegalEntityType.SOLE_PROPRIETORSHIP]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
23379
+ [LegalEntityType.TRUST]: [IntroductionScreens.PROLOGUE, IntroductionScreens.COMPANY, IntroductionScreens.INDIVIDUAL, IntroductionScreens.DECISION_MAKER, IntroductionScreens.TRUST, IntroductionScreens.TRUST_MEMBER_OVERVIEW, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE]
23380
+ };
23381
+ const useIntroductionScreens = ({
23382
+ legalEntity,
23383
+ tasks
23384
+ }) => {
23385
+ const canSeeIntroduction = useCanSeeIntroduction({
23386
+ legalEntity
23387
+ });
23388
+ const legalEntityType = useLegalEntityType({
23389
+ legalEntity
23390
+ });
23391
+ const introductionScreens = useMemo$1(() => legalEntityType ? introductionScreensByLegalEntityType[legalEntityType].filter((screen) => {
23392
+ const isAccountScreen = screen === IntroductionScreens.ACCOUNT;
23393
+ const hasAccountTask = tasks.includes(TaskTypes.PAYIN) || tasks.includes(TaskTypes.PAYOUT);
23394
+ const isTrustScreen = screen === IntroductionScreens.TRUST || screen === IntroductionScreens.TRUST_MEMBER_OVERVIEW;
23395
+ const isTrust = legalEntityType === LegalEntityType.TRUST;
23396
+ if (isAccountScreen)
23397
+ return hasAccountTask;
23398
+ if (isTrustScreen)
23399
+ return isTrust;
23400
+ return tasks.some((task) => screen === task);
23401
+ }) : [], [legalEntityType, tasks]);
23402
+ return canSeeIntroduction && (introductionScreens == null ? void 0 : introductionScreens.length) > 0 ? [IntroductionScreens.PROLOGUE, ...introductionScreens, IntroductionScreens.EPILOGUE] : void 0;
23403
+ };
23297
23404
  const StepProgressIndicator$1 = "";
23298
23405
  const StepProgressIndicator = ({
23299
23406
  activeStepIndex,
@@ -23321,51 +23428,54 @@ const StepProgressIndicator = ({
23321
23428
  }) : null;
23322
23429
  const toCapitalized = (s) => `${s[0].toUpperCase()}${s.slice(1).toLowerCase()}`;
23323
23430
  const toPascalCase = (s) => s.split(/[^A-Za-z]/).map((word) => toCapitalized(word)).join("");
23324
- var IntroDescriptionTranslationKeyElements = /* @__PURE__ */ ((IntroDescriptionTranslationKeyElements2) => {
23325
- IntroDescriptionTranslationKeyElements2["ListItem"] = "LI";
23326
- IntroDescriptionTranslationKeyElements2["Paragraph"] = "P";
23327
- return IntroDescriptionTranslationKeyElements2;
23328
- })(IntroDescriptionTranslationKeyElements || {});
23329
- const getIntroDescriptionTranslationKeys = (translations, factors) => {
23431
+ var IntroductionScreenTranslationKeyElements = /* @__PURE__ */ ((IntroductionScreenTranslationKeyElements2) => {
23432
+ IntroductionScreenTranslationKeyElements2["ListItem"] = "LI";
23433
+ IntroductionScreenTranslationKeyElements2["Paragraph"] = "P";
23434
+ return IntroductionScreenTranslationKeyElements2;
23435
+ })(IntroductionScreenTranslationKeyElements || {});
23436
+ const getIntroductionScreenTranslationKeys = (translations, factors) => {
23330
23437
  const elForKey = (factors.elementType || "").toUpperCase();
23331
23438
  const lForKey = toPascalCase(factors.legalEntityType || "");
23332
- const iForKey = toPascalCase(factors.introType);
23333
- const keyPrefix = `taskIntro${iForKey}Description${elForKey}`;
23334
- const keyPrefixWithL = `taskIntro${iForKey}${lForKey}Description${elForKey}`;
23439
+ const iForKey = toPascalCase(factors.introductionScreen);
23440
+ const keyPrefix = `introductionScreen${iForKey}Description${elForKey}`;
23441
+ const keyPrefixWithL = `introductionScreen${iForKey}${lForKey}Description${elForKey}`;
23335
23442
  const keys = getTranslationKeysByPrefix(translations, keyPrefix);
23336
23443
  const keysWithL = getTranslationKeysByPrefix(translations, keyPrefixWithL);
23337
23444
  return (keysWithL.length ? keysWithL : keys).sort((a, b) => Number(a.charAt(a.length - 1)) - Number(b.charAt(b.length - 1)));
23338
23445
  };
23339
- const TaskIntro = ({
23340
- intro,
23341
- legalEntityType,
23446
+ const IntroductionScreen = ({
23447
+ introductionScreen,
23448
+ legalEntity,
23342
23449
  number: number2
23343
23450
  }) => {
23344
23451
  const {
23345
23452
  i18n
23346
23453
  } = useI18nContext();
23347
- const paragraphKeys = useMemo(() => getIntroDescriptionTranslationKeys(i18n.translations, {
23348
- introType: intro,
23454
+ const legalEntityType = useLegalEntityType({
23455
+ legalEntity
23456
+ });
23457
+ const paragraphKeys = useMemo(() => legalEntityType ? getIntroductionScreenTranslationKeys(i18n.translations, {
23458
+ introductionScreen,
23349
23459
  legalEntityType,
23350
- elementType: IntroDescriptionTranslationKeyElements.Paragraph
23351
- }), [i18n, intro, legalEntityType]);
23352
- const listItemKeys = useMemo(() => getIntroDescriptionTranslationKeys(i18n.translations, {
23353
- introType: intro,
23460
+ elementType: IntroductionScreenTranslationKeyElements.Paragraph
23461
+ }) : void 0, [i18n, introductionScreen, legalEntityType]);
23462
+ const listItemKeys = useMemo(() => legalEntityType ? getIntroductionScreenTranslationKeys(i18n.translations, {
23463
+ introductionScreen,
23354
23464
  legalEntityType,
23355
- elementType: IntroDescriptionTranslationKeyElements.ListItem
23356
- }), [i18n, intro, legalEntityType]);
23465
+ elementType: IntroductionScreenTranslationKeyElements.ListItem
23466
+ }) : void 0, [i18n, introductionScreen, legalEntityType]);
23357
23467
  return jsxs(Fragment, {
23358
23468
  children: [jsx("div", {
23359
- className: "adyen-kyc-task-intros__number",
23469
+ className: "adyen-kyc-introduction__number",
23360
23470
  children: number2
23361
23471
  }), jsx("div", {
23362
- className: "adyen-kyc-task-intros__title",
23363
- children: i18n.get(`taskIntro${toPascalCase(intro)}Title`)
23472
+ className: "adyen-kyc-introduction__title",
23473
+ children: i18n.get(`introductionScreen${toPascalCase(introductionScreen)}Title`)
23364
23474
  }), jsxs("div", {
23365
- className: "adyen-kyc-task-intros__description",
23366
- children: [paragraphKeys.map((key) => jsx("p", {
23475
+ className: "adyen-kyc-introduction__description",
23476
+ children: [!!(paragraphKeys == null ? void 0 : paragraphKeys.length) && paragraphKeys.map((key) => jsx("p", {
23367
23477
  children: i18n.get(key)
23368
- }, key)), !!listItemKeys.length && jsx("ul", {
23478
+ }, key)), !!(listItemKeys == null ? void 0 : listItemKeys.length) && jsx("ul", {
23369
23479
  children: listItemKeys.map((key) => jsx("li", {
23370
23480
  children: i18n.get(key)
23371
23481
  }, key))
@@ -23373,62 +23483,52 @@ const TaskIntro = ({
23373
23483
  })]
23374
23484
  });
23375
23485
  };
23376
- const taskIntrosInOrder = [
23377
- TaskTypes.COMPANY,
23378
- TaskTypes.DECISION_MAKER,
23379
- TaskTypes.INDIVIDUAL,
23380
- // TaskTypes.PAYIN,
23381
- TaskTypes.PAYOUT
23382
- ];
23383
- var ExtraIntroTypes = /* @__PURE__ */ ((ExtraIntroTypes2) => {
23384
- ExtraIntroTypes2["PROLOGUE"] = "prologue";
23385
- ExtraIntroTypes2["EPILOGUE"] = "epilogue";
23386
- return ExtraIntroTypes2;
23387
- })(ExtraIntroTypes || {});
23388
- const TaskIntros = ({
23389
- legalEntityType,
23390
- onExitIntro,
23486
+ const Introduction = ({
23487
+ legalEntity,
23488
+ onExitIntroduction,
23391
23489
  tasks
23392
23490
  }) => {
23393
23491
  const {
23394
23492
  i18n
23395
23493
  } = useI18nContext();
23494
+ const introductionScreens = useIntroductionScreens({
23495
+ legalEntity,
23496
+ tasks
23497
+ });
23396
23498
  const [activeIndex, setActiveIndex] = useState(0);
23397
- const taskIntros = useMemo(() => taskIntrosInOrder.filter((taskIntro) => tasks.some((t) => t === taskIntro)), [tasks]);
23398
- const allIntros = useMemo(() => (taskIntros == null ? void 0 : taskIntros.length) ? [ExtraIntroTypes.PROLOGUE, ...taskIntros, ExtraIntroTypes.EPILOGUE] : void 0, [taskIntros]);
23399
23499
  useEffect(() => {
23400
- if (!taskIntros.length)
23401
- onExitIntro();
23402
- }, [onExitIntro, taskIntros]);
23403
- return (allIntros == null ? void 0 : allIntros.length) ? jsxs("div", {
23404
- className: "adyen-kyc-task-intros",
23500
+ if (!(introductionScreens == null ? void 0 : introductionScreens.length))
23501
+ onExitIntroduction();
23502
+ }, [onExitIntroduction, introductionScreens]);
23503
+ return (introductionScreens == null ? void 0 : introductionScreens.length) ? jsxs("div", {
23504
+ className: "adyen-kyc-introduction",
23405
23505
  children: [jsx(StepProgressIndicator, {
23406
23506
  activeStepIndex: activeIndex,
23407
- stepsCount: allIntros.length
23507
+ stepsCount: introductionScreens.length
23408
23508
  }), jsx("div", {
23409
- className: "adyen-kyc-task-intros__skip",
23509
+ className: "adyen-kyc-introduction__skip",
23410
23510
  children: jsx(Button, {
23411
- label: i18n.get("goToOverviewFromIntro"),
23412
- onClick: () => onExitIntro(),
23511
+ label: i18n.get("goToOverviewFromIntroduction"),
23512
+ onClick: () => onExitIntroduction(),
23413
23513
  showAsLink: true,
23414
23514
  type: "button"
23415
23515
  })
23416
- }), jsx(TaskIntro, {
23417
- intro: allIntros[activeIndex],
23418
- legalEntityType,
23419
- number: activeIndex > 0 && activeIndex < allIntros.length - 1 ? activeIndex : void 0
23516
+ }), jsx(IntroductionScreen, {
23517
+ introductionScreen: introductionScreens[activeIndex],
23518
+ legalEntity,
23519
+ number: activeIndex > 0 && activeIndex < introductionScreens.length - 1 ? activeIndex : void 0
23420
23520
  // prologue and epilogue should not be numbered
23421
- }, allIntros[activeIndex]), jsxs("div", {
23422
- className: "adyen-kyc-task-intros__nav",
23521
+ }, introductionScreens[activeIndex]), jsxs("div", {
23522
+ className: "adyen-kyc-introduction__nav",
23423
23523
  children: [jsx(Button, {
23424
23524
  disabled: activeIndex === 0,
23425
23525
  label: "Back",
23426
23526
  onClick: () => setActiveIndex((currentValue) => currentValue - 1),
23427
23527
  secondary: true,
23428
23528
  type: "button"
23429
- }), activeIndex + 1 === allIntros.length ? jsx(Button, {
23529
+ }), activeIndex + 1 === introductionScreens.length ? jsx(Button, {
23430
23530
  label: "Start",
23431
- onClick: () => onExitIntro(),
23531
+ onClick: () => onExitIntroduction(),
23432
23532
  type: "button"
23433
23533
  }) : jsx(Button, {
23434
23534
  label: "Next",
@@ -23652,9 +23752,9 @@ function TaskListComponent({
23652
23752
  const {
23653
23753
  isExperimentEnabled
23654
23754
  } = useExperimentsContext();
23655
- const {
23656
- canSeeIntro
23657
- } = useCanSeeIntro(legalEntityResponse);
23755
+ const canSeeIntroduction = useCanSeeIntroduction({
23756
+ legalEntity: legalEntityResponse
23757
+ });
23658
23758
  const {
23659
23759
  remediationMessages
23660
23760
  } = useDataMissingRemediations({
@@ -23696,11 +23796,11 @@ function TaskListComponent({
23696
23796
  const companyTaskDescriptionKey = isReview ? "businessAccountDetailsDescriptionReview" : "businessAccountDetailsDescription";
23697
23797
  const payoutTaskDescriptionKey = isReview ? "payoutAccountsDescriptionReview" : "payoutAccountsDescription";
23698
23798
  return jsxs("div", {
23699
- children: [canSeeIntro && jsx("div", {
23799
+ children: [canSeeIntroduction && jsx("div", {
23700
23800
  className: "adyen-task-list__nav",
23701
23801
  children: jsx(Button, {
23702
- label: i18n.get("goToIntro"),
23703
- onClick: () => onNavigateToTask(TaskTypes.INTRO),
23802
+ label: i18n.get("goToIntroduction"),
23803
+ onClick: () => onNavigateToTask(TaskTypes.INTRODUCTION),
23704
23804
  showAsLink: true,
23705
23805
  type: "button"
23706
23806
  })
@@ -27708,18 +27808,22 @@ function DropinComposerComponent({
27708
27808
  const [isLoadingConfiguration, setIsLoadingConfiguration] = useState(false);
27709
27809
  const [pollingId, setPollingId] = useState(null);
27710
27810
  const showBusinessTypeSelection = useShouldShowBusinessTypeSelection(accountHolder2);
27711
- const showIntro = useShouldShowIntro(legalEntityResponse);
27811
+ const showIntroduction = useShouldShowIntroduction({
27812
+ legalEntity: legalEntityResponse
27813
+ });
27712
27814
  const {
27713
- setHasSeenIntro
27714
- } = useHasSeenIntro(legalEntityResponse.id);
27815
+ setHasSeenIntroduction
27816
+ } = useHasSeenIntroduction({
27817
+ legalEntityId: legalEntityResponse.id
27818
+ });
27715
27819
  const [tasks, setTasks] = useState([]);
27716
27820
  const initialTask = useMemo(() => {
27717
27821
  if (showBusinessTypeSelection)
27718
27822
  return TaskTypes.BUSINESS_TYPE_SELECTION;
27719
- if (showIntro)
27720
- return TaskTypes.INTRO;
27823
+ if (showIntroduction)
27824
+ return TaskTypes.INTRODUCTION;
27721
27825
  return TaskTypes.TASKS_OVERVIEW;
27722
- }, [showBusinessTypeSelection, showIntro]);
27826
+ }, [showBusinessTypeSelection, showIntroduction]);
27723
27827
  const [taskHistory, setTaskHistory] = useState([initialTask]);
27724
27828
  const [legalEntity, setLegalEntity] = useState(legalEntityResponse);
27725
27829
  const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
@@ -28262,14 +28366,14 @@ function DropinComposerComponent({
28262
28366
  onAccountHolderSelect: async (newAccountHolder) => {
28263
28367
  setAccountHolder(newAccountHolder);
28264
28368
  await refreshLegalEntity();
28265
- onNavigateTo(showIntro ? TaskTypes.INTRO : TaskTypes.TASKS_OVERVIEW);
28369
+ onNavigateTo(showIntroduction ? TaskTypes.INTRODUCTION : TaskTypes.TASKS_OVERVIEW);
28266
28370
  }
28267
28371
  });
28268
- case TaskTypes.INTRO:
28269
- return jsx(TaskIntros, {
28270
- legalEntityType: legalEntity.type,
28271
- onExitIntro: () => {
28272
- setHasSeenIntro(true);
28372
+ case TaskTypes.INTRODUCTION:
28373
+ return jsx(Introduction, {
28374
+ legalEntity,
28375
+ onExitIntroduction: () => {
28376
+ setHasSeenIntroduction(true);
28273
28377
  onNavigateTo(TaskTypes.TASKS_OVERVIEW);
28274
28378
  },
28275
28379
  tasks
@@ -29484,6 +29588,10 @@ const I18nProvider = ({
29484
29588
  const settingsDefaults = {
29485
29589
  changeLegalEntityType: true,
29486
29590
  editPrefilledCountry: true,
29591
+ hideOnboardingIntroductionIndividual: true,
29592
+ hideOnboardingIntroductionOrganization: true,
29593
+ hideOnboardingIntroductionTrust: true,
29594
+ hideOnboardingIntroductionSoleProprietor: true,
29487
29595
  viewOnboardingGuidance: false
29488
29596
  };
29489
29597
  function SettingsContextProvider({