@adyen/kyc-components 2.13.4 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/es/{HK-0561cac3.mjs → HK-675b8651.mjs} +0 -6
  2. package/dist/es/adyen-kyc-components.es.js +548 -449
  3. package/dist/types/components/DocumentUpload/types.d.ts +2 -1
  4. package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
  5. package/dist/types/components/EmbeddedDropins/TransferInstrumentComponent/TransferInstrumentComponent.d.ts +2 -1
  6. package/dist/types/components/IdDocumentUpload/types.d.ts +4 -3
  7. package/dist/types/components/PayoutBankStatement/types.d.ts +2 -1
  8. package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/ProofOfIdentityCard.d.ts +1 -1
  9. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  10. package/dist/types/components/internal/CountryField/CountryField.d.ts +2 -2
  11. package/dist/types/components/internal/FormFields/Dropzone/FilePicker.d.ts +3 -2
  12. package/dist/types/components/internal/FormFields/Dropzone/types.d.ts +2 -6
  13. package/dist/types/components/internal/FormFields/Dropzone/validate.d.ts +2 -1
  14. package/dist/types/components/internal/LegalCompanyNameField/LegalCompanyNameField.d.ts +2 -3
  15. package/dist/types/components/internal/Remove/Remove.d.ts +1 -1
  16. package/dist/types/components/internal/Remove/types.d.ts +6 -4
  17. package/dist/types/components/internal/StateField/StateField.d.ts +2 -2
  18. package/dist/types/core/Context/AuthContext/AuthContext.d.ts +0 -1
  19. package/dist/types/core/Context/AuthContext/AuthProvider.d.ts +5 -2
  20. package/dist/types/core/Context/ConfigurationApiContext/getEmbeddedApi.d.ts +1 -2
  21. package/dist/types/core/Context/StateContext/types.d.ts +1 -0
  22. package/dist/types/core/Services/kycExternalApi/company-deep-search.d.ts +2 -4
  23. package/dist/types/core/Services/kycExternalApi/company-index-search.d.ts +2 -4
  24. package/dist/types/core/Services/kycExternalApi/get-company-data.d.ts +2 -4
  25. package/dist/types/core/Services/kycExternalApi/refresh-company-data.d.ts +2 -4
  26. package/dist/types/core/Services/kycExternalApi/verify-tin.d.ts +2 -4
  27. package/dist/types/core/Services/session.d.ts +5 -0
  28. package/dist/types/core/Services/types.d.ts +1 -2
  29. package/dist/types/core/Services/utils.d.ts +3 -0
  30. package/dist/types/core/core.d.ts +1 -0
  31. package/dist/types/core/hooks/useForm/types.d.ts +23 -8
  32. package/dist/types/core/hooks/useForm/useForm.d.ts +2 -1
  33. package/dist/types/core/hooks/useForm/utils.d.ts +12 -1
  34. package/dist/types/core/hooks/useFormComposer.d.ts +3 -2
  35. package/dist/types/core/models/api/company-search.d.ts +18 -22
  36. package/dist/types/core/models/api/organization.d.ts +6 -6
  37. package/dist/types/core/models/country-code.d.ts +1 -1
  38. package/dist/types/core/models/file.d.ts +8 -0
  39. package/dist/types/core/models/state-code.d.ts +32 -1
  40. package/dist/types/core/types.d.ts +2 -1
  41. package/dist/types/language/config.d.ts +16 -14
  42. package/dist/types/utils/api/documentUtils.d.ts +3 -2
  43. package/dist/types/utils/company-util.d.ts +2 -1
  44. package/dist/types/utils/decision-maker-roles.d.ts +1 -1
  45. package/dist/types/utils/entity-status-util.d.ts +2 -2
  46. package/dist/types/utils/formUtils.d.ts +11 -3
  47. package/dist/types/utils/mapping/mapping.d.ts +2 -0
  48. package/dist/types/utils/trust-util.d.ts +1 -1
  49. package/package.json +3 -3
  50. package/dist/types/core/Services/auth/refresh-sdkToken.d.ts +0 -6
  51. package/dist/types/core/hooks/useSdkToken.d.ts +0 -5
@@ -62,6 +62,7 @@ const uploadDocument = "Upload Document";
62
62
  const individualDetails = "Individual details";
63
63
  const socialSecurityNumber = "Last 4 digits of Social Security Number (SSN)";
64
64
  const socialSecurityNumber9Digits = "Social Security Number (SSN)";
65
+ const socialInsuranceNumber = "Social Insurance Number (SIN)";
65
66
  const codiceFiscale = "Codice fiscale";
66
67
  const personnummer = "Personnummer";
67
68
  const dni = "DNI";
@@ -121,6 +122,8 @@ const nationality$1 = "Nationality";
121
122
  const dateOfIncorporation = "Date of incorporation";
122
123
  const passportExpiryDate = "Passport expiry date";
123
124
  const proofOfNationality = "Proof of nationality";
125
+ const identityNumberExempt__US = "I don't have an SSN";
126
+ const identityNumberExempt__CA = "I don't have an SIN";
124
127
  const uploadDocumentForSsn = "Upload an ID document instead of SSN";
125
128
  const uploadDocumentForNric = "Upload an ID document instead of NRIC";
126
129
  const operationalAddressHeader = "Additional address";
@@ -224,13 +227,6 @@ const pleaseNote = "Please note:";
224
227
  const byClickingSubmitReview = "By clicking 'Submit review', you confirm that all of your information has been reviewed, and that all newly provided or already existing data is accurate and up-to-date.";
225
228
  const nameAndCountry = "Name and country";
226
229
  const companyCountry = "Where is your business located?";
227
- const legalCompanyName = "Legal name of the company";
228
- const legalCompanyNameHelper = "Enter the name exactly as it is on your company's official registration documents.";
229
- const legalCompanyNameHelper__AU = "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC)";
230
- const legalCompanyNameHelper__NL = "Enter the name exactly as it is on your Chamber of Commerce registration.";
231
- const legalCompanyNameHelper__US = "Enter the name exactly as it is on on your Secretary of State registration.";
232
- const legalCompanyNameHelper__SG = "Enter the name exactly as it is on your Accounting and Corporate Regulatory Authority (ACRA) BizFile";
233
- const legalCompanyNameHelper__HK = "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation";
234
230
  const accountDetailsDescription = "Provide a few details about you to start accepting live payments.";
235
231
  const provideDetails = "Provide details";
236
232
  const payoutAccountsDescription = "To set up your account, let us know where to send your payouts.";
@@ -676,12 +672,12 @@ const documentIssuedWithinLastYear = "Note! The document needs to be issued with
676
672
  const learnMore = "Learn more";
677
673
  const doingBusinessAsNameFiling = "Doing business as-name filling";
678
674
  const taxFiling = "Tax-filling";
679
- const continueAsCompany = "Continue as a company?";
680
- const continueAsIndividual = "Continue as an individual?";
681
- const indicatedPayoutToCompany = "You indicated that you want to be paid out to a bank account that is owned by a company, such as a private company, public company, partnership, or non-profit organization. This means that we need to collect some information about your company too.";
682
- const continueSigningUpAsCompany = "Do you want to continue signing up with your company information?";
683
- const indicatedPayoutToPersonalAccount = "You indicated that you want to be paid out to a bank account that is owned by you personally. This means you will continue as an individual, not a company. However, if you operate as a private company, public company, partnership, or non-profit organization, then you cannot continue as an individual.";
684
- const continueSigningUpAsIndividual = "Do you want to continue signing up as an individual?";
675
+ const areYouACompany = "Are you a company?";
676
+ const singingUpAsIndividualButLooksLikeYouAreACompany = "You’re now signing up as an individual. But it looks like you’re a company that uses a company bank account to receive payouts.";
677
+ const wouldYouLikeToSignUpAsCompanyInstead = "Would you like to sign up as a company instead? (You’ll have to re-enter some information from before.)";
678
+ const areYouAnIndividual = "Are you an individual?";
679
+ const singingUpAsCompanyButLooksLikeYouAreAnIndividual = "You’re now signing up as an company. But it looks like you’re an individual who uses your personal bank account to receive payouts.";
680
+ const wouldYouLikeToSignUpAsIndividualInstead = "Would you like to sign up as an individual instead? (You’ll have to re-enter some information from before.)";
685
681
  const noGoBack = "No, go back";
686
682
  const continueCompany = "Continue as company";
687
683
  const continueIndividual = "Continue as individual";
@@ -692,7 +688,6 @@ const addresses = "Addresses";
692
688
  const loading = "Loading";
693
689
  const businessIncorporationNumber = "Business incorporation number";
694
690
  const doNotHaveBusinessIncorporationNumber = "I do not have a Business incorporation number";
695
- const socialInsuranceNumber = "Social insurance number";
696
691
  const verificationMethod = "Verification method";
697
692
  const verifyViaMobileBankAppOrBankWebsite = "Verify the account via mobile bank app or bank website";
698
693
  const provideAccountDetailsAndUploadBankStatement = "Provide account details and upload a scan of a bank statement";
@@ -761,6 +756,13 @@ const passportPhotoPage = "Passport photo page";
761
756
  const residencePermitBack = "Residence permit (back)";
762
757
  const residencePermitFront = "Residence permit (front)";
763
758
  const manualUpload = "Manual upload";
759
+ const legalCompanyName = "Legal name of the company";
760
+ const legalCompanyName__helperText = "Enter the name exactly as it is on your company's official registration documents.";
761
+ const legalCompanyName__helperText__AU = "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC).";
762
+ const legalCompanyName__helperText__NL = "Enter the name exactly as it is on your Chamber of Commerce registration.";
763
+ const legalCompanyName__helperText__US = "Enter the name exactly as it appears on your Secretary of State Registration.";
764
+ const legalCompanyName__helperText__SG = "Enter the name exactly as it is on your Accounting and Corporate Regulatory Authority (ACRA) BizFile.";
765
+ const legalCompanyName__helperText__HK = "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation.";
764
766
  const errorMessage_1_10 = "Information couldn’t be verified";
765
767
  const errorMessage_1_11 = "Document didn’t meet requirements";
766
768
  const errorMessage_1_12 = "Legal entity declined";
@@ -1119,6 +1121,7 @@ const defaultTrans = {
1119
1121
  individualDetails,
1120
1122
  socialSecurityNumber,
1121
1123
  socialSecurityNumber9Digits,
1124
+ socialInsuranceNumber,
1122
1125
  codiceFiscale,
1123
1126
  personnummer,
1124
1127
  dni,
@@ -1178,6 +1181,8 @@ const defaultTrans = {
1178
1181
  dateOfIncorporation,
1179
1182
  passportExpiryDate,
1180
1183
  proofOfNationality,
1184
+ identityNumberExempt__US,
1185
+ identityNumberExempt__CA,
1181
1186
  uploadDocumentForSsn,
1182
1187
  uploadDocumentForNric,
1183
1188
  operationalAddressHeader,
@@ -1281,13 +1286,6 @@ const defaultTrans = {
1281
1286
  byClickingSubmitReview,
1282
1287
  nameAndCountry,
1283
1288
  companyCountry,
1284
- legalCompanyName,
1285
- legalCompanyNameHelper,
1286
- legalCompanyNameHelper__AU,
1287
- legalCompanyNameHelper__NL,
1288
- legalCompanyNameHelper__US,
1289
- legalCompanyNameHelper__SG,
1290
- legalCompanyNameHelper__HK,
1291
1289
  accountDetailsDescription,
1292
1290
  provideDetails,
1293
1291
  payoutAccountsDescription,
@@ -1747,12 +1745,12 @@ const defaultTrans = {
1747
1745
  learnMore,
1748
1746
  doingBusinessAsNameFiling,
1749
1747
  taxFiling,
1750
- continueAsCompany,
1751
- continueAsIndividual,
1752
- indicatedPayoutToCompany,
1753
- continueSigningUpAsCompany,
1754
- indicatedPayoutToPersonalAccount,
1755
- continueSigningUpAsIndividual,
1748
+ areYouACompany,
1749
+ singingUpAsIndividualButLooksLikeYouAreACompany,
1750
+ wouldYouLikeToSignUpAsCompanyInstead,
1751
+ areYouAnIndividual,
1752
+ singingUpAsCompanyButLooksLikeYouAreAnIndividual,
1753
+ wouldYouLikeToSignUpAsIndividualInstead,
1756
1754
  "continue": "Continue",
1757
1755
  noGoBack,
1758
1756
  continueCompany,
@@ -1764,7 +1762,6 @@ const defaultTrans = {
1764
1762
  loading,
1765
1763
  businessIncorporationNumber,
1766
1764
  doNotHaveBusinessIncorporationNumber,
1767
- socialInsuranceNumber,
1768
1765
  verificationMethod,
1769
1766
  verifyViaMobileBankAppOrBankWebsite,
1770
1767
  provideAccountDetailsAndUploadBankStatement,
@@ -1835,6 +1832,13 @@ const defaultTrans = {
1835
1832
  residencePermitBack,
1836
1833
  residencePermitFront,
1837
1834
  manualUpload,
1835
+ legalCompanyName,
1836
+ legalCompanyName__helperText,
1837
+ legalCompanyName__helperText__AU,
1838
+ legalCompanyName__helperText__NL,
1839
+ legalCompanyName__helperText__US,
1840
+ legalCompanyName__helperText__SG,
1841
+ legalCompanyName__helperText__HK,
1838
1842
  errorMessage_1_10,
1839
1843
  errorMessage_1_11,
1840
1844
  errorMessage_1_12,
@@ -2363,12 +2367,26 @@ const useCoreContext = () => {
2363
2367
  return context;
2364
2368
  };
2365
2369
  const Summary$1 = "";
2370
+ const omitKeys = (obj, omit) => Object.keys(obj).filter((k) => !omit.includes(k)).reduce((a, c) => {
2371
+ a[c] = obj[c];
2372
+ return a;
2373
+ }, {});
2374
+ const addKeys = (obj, add2, initialValue, defaultData, pendingData) => add2.reduce((a, c) => ({
2375
+ ...a,
2376
+ [c]: a[c] ?? (pendingData == null ? void 0 : pendingData[c]) ?? (defaultData == null ? void 0 : defaultData[c]) ?? initialValue
2377
+ }), obj);
2378
+ function getDataByFields(formData, fieldKeys) {
2379
+ return entriesOf(formData).reduce((acc, [key, val]) => {
2380
+ if (fieldKeys.includes(key)) {
2381
+ return {
2382
+ ...acc,
2383
+ [key]: val
2384
+ };
2385
+ }
2386
+ return acc;
2387
+ }, {});
2388
+ }
2366
2389
  const formUtilities = (props, i18n) => ({
2367
- getPlaceholder: (field, fallbackPlaceholderKey) => {
2368
- var _a, _b;
2369
- const translationKey = fallbackPlaceholderKey ? ((_a = props.placeholders) == null ? void 0 : _a[field]) ?? fallbackPlaceholderKey : (_b = props.placeholders) == null ? void 0 : _b[field];
2370
- return translationKey ? i18n.get(translationKey) : "";
2371
- },
2372
2390
  getLabel: (field, fallbackLabelKey) => {
2373
2391
  var _a, _b;
2374
2392
  let translationKey = ((_a = props.labels) == null ? void 0 : _a[field]) ?? fallbackLabelKey ?? field;
@@ -2384,6 +2402,11 @@ const formUtilities = (props, i18n) => ({
2384
2402
  }
2385
2403
  return i18n.get(translationKey);
2386
2404
  },
2405
+ getPlaceholder: (field, fallbackPlaceholderKey) => {
2406
+ var _a, _b;
2407
+ const translationKey = fallbackPlaceholderKey ? ((_a = props.placeholders) == null ? void 0 : _a[field]) ?? fallbackPlaceholderKey : (_b = props.placeholders) == null ? void 0 : _b[field];
2408
+ return translationKey ? i18n.get(translationKey) : "";
2409
+ },
2387
2410
  getHelperText: (field, fallbackHelperTextKey) => {
2388
2411
  var _a, _b;
2389
2412
  const translationKey = fallbackHelperTextKey ? ((_a = props.helperText) == null ? void 0 : _a[field]) ?? fallbackHelperTextKey : (_b = props.helperText) == null ? void 0 : _b[field];
@@ -2423,7 +2446,70 @@ const formUtilities = (props, i18n) => ({
2423
2446
  return i18n.get(translationKey, translationObject);
2424
2447
  }
2425
2448
  return errorMessage ? i18n.get(errorMessage) : Boolean(fieldProblems == null ? void 0 : fieldProblems[field]);
2426
- }
2449
+ },
2450
+ getFieldData: (formData, fieldKeys) => getDataByFields(formData, fieldKeys),
2451
+ getFieldValid: (formValid, fieldKeys) => entriesOf(formValid).reduce((acc, [key, val]) => fieldKeys.includes(key) ? {
2452
+ ...acc,
2453
+ [key]: val
2454
+ } : acc, {}),
2455
+ getFieldErrors: (formErrors, fieldProblems, fieldKeys) => Object.keys(formErrors).reduce((acc, key) => {
2456
+ var _a;
2457
+ if (fieldKeys.includes(key)) {
2458
+ const error = (_a = formErrors == null ? void 0 : formErrors[key]) == null ? void 0 : _a.errorMessage;
2459
+ if (typeof error === "object") {
2460
+ const {
2461
+ translationKey,
2462
+ translationObject
2463
+ } = error;
2464
+ return {
2465
+ ...acc,
2466
+ [key]: i18n.get(translationKey, translationObject)
2467
+ };
2468
+ }
2469
+ return error ? {
2470
+ ...acc,
2471
+ [key]: i18n.get(error)
2472
+ } : {
2473
+ ...acc,
2474
+ [key]: Boolean(fieldProblems == null ? void 0 : fieldProblems[key])
2475
+ };
2476
+ }
2477
+ return acc;
2478
+ }, {}),
2479
+ getFieldLabels: (fieldKeys, fallbackLabelKeys) => fieldKeys.reduce((acc, field) => {
2480
+ var _a, _b;
2481
+ let translationKey = ((_a = props.labels) == null ? void 0 : _a[field]) ?? (fallbackLabelKeys == null ? void 0 : fallbackLabelKeys[field]) ?? field;
2482
+ if (props.labels && !((_b = props.labels) == null ? void 0 : _b[field]) && Object.keys(props.labels).length) {
2483
+ const parentKey = Object.keys(props.labels).find((fieldKey) => {
2484
+ var _a2;
2485
+ return typeof ((_a2 = props.labels) == null ? void 0 : _a2[fieldKey]) === "object";
2486
+ });
2487
+ if (parentKey) {
2488
+ const nestedLabel = props.labels[parentKey][field];
2489
+ translationKey = nestedLabel ?? translationKey;
2490
+ }
2491
+ }
2492
+ return {
2493
+ ...acc,
2494
+ [field]: i18n.get(translationKey)
2495
+ };
2496
+ }, {}),
2497
+ getFieldPlaceholders: (fieldKeys, fallbackPlaceholderKeys) => fieldKeys.reduce((acc, field) => {
2498
+ var _a, _b;
2499
+ const translationKey = (fallbackPlaceholderKeys == null ? void 0 : fallbackPlaceholderKeys[field]) ? ((_a = props.placeholders) == null ? void 0 : _a[field]) ?? (fallbackPlaceholderKeys == null ? void 0 : fallbackPlaceholderKeys[field]) : (_b = props.placeholders) == null ? void 0 : _b[field];
2500
+ return translationKey ? {
2501
+ ...acc,
2502
+ [field]: i18n.get(translationKey)
2503
+ } : acc;
2504
+ }, {}),
2505
+ getFieldHelperText: (fieldKeys, fallbackHelperTextKeys) => fieldKeys.reduce((acc, field) => {
2506
+ var _a, _b;
2507
+ const translationKey = (fallbackHelperTextKeys == null ? void 0 : fallbackHelperTextKeys[field]) ? ((_a = props.helperText) == null ? void 0 : _a[field]) ?? (fallbackHelperTextKeys == null ? void 0 : fallbackHelperTextKeys[field]) : (_b = props.helperText) == null ? void 0 : _b[field];
2508
+ return translationKey ? {
2509
+ ...acc,
2510
+ [field]: i18n.get(translationKey)
2511
+ } : acc;
2512
+ }, {})
2427
2513
  });
2428
2514
  const MAX_LENGTH = 30;
2429
2515
  const getMaxLengthByFormatRuleset = (formattingRules, field) => {
@@ -3041,14 +3127,6 @@ function useResetGlobalData(caller) {
3041
3127
  }
3042
3128
  }), [dispatch, caller]);
3043
3129
  }
3044
- const omitKeys = (obj, omit) => Object.keys(obj).filter((k) => !omit.includes(k)).reduce((a, c) => {
3045
- a[c] = obj[c];
3046
- return a;
3047
- }, {});
3048
- const addKeys = (obj, add2, initialValue, defaultData, pendingData) => add2.reduce((a, c) => ({
3049
- ...a,
3050
- [c]: a[c] ?? (pendingData == null ? void 0 : pendingData[c]) ?? (defaultData == null ? void 0 : defaultData[c]) ?? initialValue
3051
- }), obj);
3052
3130
  const processField = ({
3053
3131
  key,
3054
3132
  value = null,
@@ -3463,6 +3541,7 @@ function useForm({
3463
3541
  asyncRules,
3464
3542
  fieldProblems,
3465
3543
  maskedFields,
3544
+ optionalFields,
3466
3545
  formatters,
3467
3546
  shouldValidate = false
3468
3547
  }) {
@@ -3474,20 +3553,26 @@ function useForm({
3474
3553
  asyncValidationResults
3475
3554
  } = useAsyncValidator(asyncRules);
3476
3555
  const getRequiredFields = useMemo(() => typeof schema === "function" ? schema : () => schema, [schema]);
3556
+ const getSchema = useMemo(() => {
3557
+ if (optionalFields) {
3558
+ return defaultData ? [...getRequiredFields(defaultData), ...optionalFields] : [];
3559
+ }
3560
+ return defaultData ? getRequiredFields(defaultData) : [];
3561
+ }, [optionalFields, defaultData, getRequiredFields]);
3477
3562
  const getReducer = useCallback(() => reducer({
3478
3563
  staticValidate: triggerStaticValidation,
3479
3564
  asyncValidate: triggerAsyncValidation,
3480
3565
  formatters
3481
3566
  }), [triggerStaticValidation, triggerAsyncValidation, formatters]);
3482
3567
  const getInitialData = useCallback(() => ({
3483
- schema: defaultData ? getRequiredFields(defaultData) : [],
3568
+ schema: getSchema,
3484
3569
  defaultData,
3485
3570
  fieldProblems,
3486
3571
  maskedFields,
3487
3572
  formatters,
3488
3573
  staticValidate: triggerStaticValidation,
3489
3574
  asyncValidate: triggerAsyncValidation
3490
- }), [defaultData, fieldProblems, maskedFields, formatters, getRequiredFields, triggerStaticValidation, triggerAsyncValidation]);
3575
+ }), [getSchema, defaultData, fieldProblems, maskedFields, formatters, triggerStaticValidation, triggerAsyncValidation]);
3491
3576
  const [state2, dispatch] = useReducer(getReducer(), getInitialData(), init);
3492
3577
  const isValid = useMemo(() => {
3493
3578
  var _a;
@@ -4822,12 +4907,12 @@ const Select = ({
4822
4907
  });
4823
4908
  };
4824
4909
  const logger$k = createLogger("CountryField");
4825
- const COUNTRY_FIELD = "country";
4910
+ const COUNTRY_FIELD = ["country"];
4826
4911
  function CountryField({
4827
4912
  data,
4828
4913
  valid,
4829
- error,
4830
- label,
4914
+ errors,
4915
+ labels: labels2,
4831
4916
  readonly,
4832
4917
  handleChangeFor,
4833
4918
  helperText,
@@ -4850,27 +4935,21 @@ function CountryField({
4850
4935
  ...item,
4851
4936
  sprite: `#adl-flag-${item.id.toLowerCase()}`
4852
4937
  }));
4853
- const handleCompanyChangeFor = useCallback((e) => {
4854
- const {
4855
- value
4856
- } = e.target;
4857
- handleChangeFor(COUNTRY_FIELD)(value);
4858
- }, [handleChangeFor]);
4859
4938
  return jsx(Field, {
4860
- name: COUNTRY_FIELD,
4861
- label: label || i18n.get(COUNTRY_FIELD),
4862
- errorMessage: error,
4939
+ name: "country",
4940
+ label: (labels2 == null ? void 0 : labels2.country) || i18n.get("country"),
4941
+ errorMessage: errors.country,
4863
4942
  classNameModifiers,
4864
- isValid: valid,
4865
- helper: helperText,
4943
+ isValid: valid.country,
4944
+ helper: helperText == null ? void 0 : helperText.country,
4866
4945
  children: (childProps) => jsx(Select, {
4867
4946
  ...childProps,
4868
- name: COUNTRY_FIELD,
4947
+ name: "country",
4869
4948
  placeholder: i18n.get("selectCountry"),
4870
- selected: data,
4949
+ selected: data.country,
4871
4950
  items: countries,
4872
4951
  readonly: (countries.length === 1 || readonly) && !!data,
4873
- onChange: handleCompanyChangeFor
4952
+ onChange: handleChangeFor("country")
4874
4953
  })
4875
4954
  });
4876
4955
  }
@@ -5002,46 +5081,34 @@ const InputText = forwardRef(({
5002
5081
  );
5003
5082
  });
5004
5083
  InputText.displayName = "InputText";
5005
- const LEGAL_COMPANY_NAME_FIELD = "legalCompanyName";
5084
+ const LEGAL_COMPANY_NAME_FIELD = ["legalCompanyName"];
5006
5085
  function LegalCompanyNameField({
5007
5086
  data,
5008
5087
  valid,
5009
- error,
5010
- label,
5088
+ errors,
5089
+ labels: labels2,
5011
5090
  helperText,
5012
5091
  readonly,
5013
5092
  handleChangeFor
5014
5093
  }) {
5015
- const handleLegalCompanyNameInput = useCallback((e) => {
5016
- const {
5017
- value
5018
- } = e.target;
5019
- handleChangeFor(LEGAL_COMPANY_NAME_FIELD, "input")(value);
5020
- }, [handleChangeFor]);
5021
- const handleLegalCompanyNameBlur = useCallback((e) => {
5022
- const {
5023
- value
5024
- } = e.target;
5025
- handleChangeFor(LEGAL_COMPANY_NAME_FIELD, "blur")(value);
5026
- }, [handleChangeFor]);
5027
5094
  return jsx(Field, {
5028
- name: LEGAL_COMPANY_NAME_FIELD,
5029
- label,
5030
- helper: helperText,
5031
- classNameModifiers: [LEGAL_COMPANY_NAME_FIELD],
5032
- errorMessage: error,
5033
- isValid: valid,
5095
+ name: "legalCompanyName",
5096
+ label: labels2.legalCompanyName,
5097
+ helper: helperText == null ? void 0 : helperText.legalCompanyName,
5098
+ errorMessage: errors.legalCompanyName,
5099
+ isValid: valid.legalCompanyName,
5100
+ classNameModifiers: ["legalCompanyName"],
5034
5101
  children: (childProps) => jsx(InputText, {
5035
5102
  ...childProps,
5036
5103
  "aria-required": true,
5037
- "aria-label": label,
5038
- "aria-invalid": !valid,
5039
- name: LEGAL_COMPANY_NAME_FIELD,
5040
- value: data,
5104
+ "aria-label": labels2.legalCompanyName,
5105
+ "aria-invalid": !valid.legalCompanyName,
5106
+ name: "legalCompanyName",
5107
+ value: data.legalCompanyName,
5041
5108
  readonly,
5042
- classNameModifiers: [LEGAL_COMPANY_NAME_FIELD],
5043
- onInput: handleLegalCompanyNameInput,
5044
- onBlur: handleLegalCompanyNameBlur
5109
+ classNameModifiers: ["legalCompanyName"],
5110
+ onInput: handleChangeFor("legalCompanyName", "input"),
5111
+ onBlur: handleChangeFor("legalCompanyName", "blur")
5045
5112
  })
5046
5113
  });
5047
5114
  }
@@ -5084,7 +5151,7 @@ const companyCountryValidationRules = {
5084
5151
  errorMessage: "fieldIsRequired"
5085
5152
  }
5086
5153
  };
5087
- const companyNameAndCountryFields = [LEGAL_COMPANY_NAME_FIELD, COUNTRY_FIELD];
5154
+ const companyNameAndCountryFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD];
5088
5155
  function CompanyNameAndCountry(props) {
5089
5156
  const {
5090
5157
  i18n
@@ -5133,22 +5200,24 @@ function CompanyNameAndCountry(props) {
5133
5200
  validationErrors: props == null ? void 0 : props.fieldValidationErrors,
5134
5201
  formUtils,
5135
5202
  id: "ariaErrorField"
5136
- }), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField(COUNTRY_FIELD) && jsx(CountryField, {
5137
- data: formData.country,
5138
- valid: formValid.country,
5139
- error: formUtils.getErrorMessage(COUNTRY_FIELD, formErrors, formFieldProblems),
5140
- label: formUtils.getLabel(COUNTRY_FIELD),
5203
+ }), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField("country") && jsx(CountryField, {
5204
+ data: formUtils.getFieldData(formData, COUNTRY_FIELD),
5205
+ valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
5206
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
5207
+ labels: formUtils.getFieldLabels(COUNTRY_FIELD),
5141
5208
  readonly: !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
5142
- classNameModifiers: [COUNTRY_FIELD],
5209
+ classNameModifiers: ["country"],
5143
5210
  allowedCountries: [],
5144
5211
  handleChangeFor
5145
- }), formUtils.isRequiredField(LEGAL_COMPANY_NAME_FIELD) && jsx(LegalCompanyNameField, {
5146
- data: formData.legalCompanyName,
5147
- valid: formValid.legalCompanyName,
5148
- error: formUtils.getErrorMessage(LEGAL_COMPANY_NAME_FIELD, formErrors, formFieldProblems),
5149
- label: formUtils.getLabel(LEGAL_COMPANY_NAME_FIELD),
5150
- helperText: formUtils.getHelperText(LEGAL_COMPANY_NAME_FIELD, "legalCompanyNameHelper"),
5151
- readonly: formUtils.isReadOnly(LEGAL_COMPANY_NAME_FIELD),
5212
+ }), formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
5213
+ data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
5214
+ valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
5215
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
5216
+ labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
5217
+ helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
5218
+ legalCompanyName: "legalCompanyName__helperText"
5219
+ }),
5220
+ readonly: formUtils.isReadOnly("legalCompanyName"),
5152
5221
  handleChangeFor
5153
5222
  })]
5154
5223
  });
@@ -7860,7 +7929,7 @@ const fieldsPerScenario$3 = {
7860
7929
  const countryConfig$4 = {
7861
7930
  [CountryCodes.Australia]: {
7862
7931
  legalCompanyName: {
7863
- helperText: "legalCompanyNameHelper__AU"
7932
+ helperText: "legalCompanyName__helperText__AU"
7864
7933
  },
7865
7934
  legalEntityType: {
7866
7935
  label: "companyType"
@@ -8056,7 +8125,7 @@ const countryConfig$4 = {
8056
8125
  },
8057
8126
  [CountryCodes.HongKong]: {
8058
8127
  legalCompanyName: {
8059
- helperText: "legalCompanyNameHelper__HK"
8128
+ helperText: "legalCompanyName__helperText__HK"
8060
8129
  },
8061
8130
  legalEntityType: {
8062
8131
  label: "typeOfCompany"
@@ -8215,7 +8284,7 @@ const countryConfig$4 = {
8215
8284
  label: "chamberOfCommerceRegistrationNumber"
8216
8285
  },
8217
8286
  legalCompanyName: {
8218
- helperText: "legalCompanyNameHelper__NL"
8287
+ helperText: "legalCompanyName__helperText__NL"
8219
8288
  },
8220
8289
  exemptedFromVat: {
8221
8290
  label: "vatNumberExempted"
@@ -8346,7 +8415,7 @@ const countryConfig$4 = {
8346
8415
  label: "uen"
8347
8416
  },
8348
8417
  legalCompanyName: {
8349
- helperText: "legalCompanyNameHelper__SG"
8418
+ helperText: "legalCompanyName__helperText__SG"
8350
8419
  },
8351
8420
  legalEntityType: {
8352
8421
  label: "companyType"
@@ -8402,7 +8471,7 @@ const countryConfig$4 = {
8402
8471
  },
8403
8472
  [CountryCodes.UnitedStates]: {
8404
8473
  legalCompanyName: {
8405
- helperText: "legalCompanyNameHelper__US"
8474
+ helperText: "legalCompanyName__helperText__US"
8406
8475
  },
8407
8476
  tradingName: {
8408
8477
  label: "doingBusinessAs"
@@ -8619,14 +8688,14 @@ const rules$3 = ({
8619
8688
  }
8620
8689
  },
8621
8690
  isProofOfResidenceRequired: () => {
8622
- var _a;
8623
- if ((_a = data.proofOfResidence) == null ? void 0 : _a.proofOfResidence) {
8691
+ var _a, _b;
8692
+ if ((_b = (_a = data.proofOfResidence) == null ? void 0 : _a.proofOfResidence) == null ? void 0 : _b.length) {
8624
8693
  return REQUIRED;
8625
8694
  }
8626
8695
  },
8627
8696
  isProofOfNationalIdRequired: () => {
8628
- var _a;
8629
- if ((_a = data.proofOfNationalId) == null ? void 0 : _a.proofOfNationalId) {
8697
+ var _a, _b;
8698
+ if ((_b = (_a = data.proofOfNationalId) == null ? void 0 : _a.proofOfNationalId) == null ? void 0 : _b.length) {
8630
8699
  return REQUIRED;
8631
8700
  }
8632
8701
  },
@@ -9127,6 +9196,8 @@ function bytesToSize(bytes) {
9127
9196
  return `${(bytes / 1024 ** i).toFixed()} ${sizes[i]}`;
9128
9197
  }
9129
9198
  const DropzoneFile$1 = "";
9199
+ const isExistingFile = (file) => "existing" in file && file.existing;
9200
+ const isNewlyUploadedFile = (file) => !isExistingFile(file);
9130
9201
  function DropzoneFile(props) {
9131
9202
  const {
9132
9203
  file,
@@ -9176,7 +9247,7 @@ function DropzoneFile(props) {
9176
9247
  className: "adyen-kyc-dropzone-file__size",
9177
9248
  children: [jsxs("span", {
9178
9249
  children: [i18n.get("complete"), " "]
9179
- }), formatSize(file.size)]
9250
+ }), isNewlyUploadedFile(file) ? formatSize(file.size) : void 0]
9180
9251
  })]
9181
9252
  }), jsx("button", {
9182
9253
  type: "button",
@@ -9196,6 +9267,7 @@ const defaultFileValidationOptions = {
9196
9267
  // 4MB by default
9197
9268
  isOptional: false
9198
9269
  };
9270
+ const filterOnlyNewlyUploadedFiles = (files) => files.filter(isNewlyUploadedFile);
9199
9271
  const fileValidationRules = ({
9200
9272
  allowedFileTypes,
9201
9273
  maxNumberOfFiles,
@@ -9229,7 +9301,7 @@ const fileValidationRules = ({
9229
9301
  validate: (files) => {
9230
9302
  if (!files)
9231
9303
  return true;
9232
- return files.every((file) => allowedFileTypes.some((filetype) => file.name.toLowerCase().endsWith(filetype.toLowerCase())));
9304
+ return filterOnlyNewlyUploadedFiles(files).every((file) => allowedFileTypes.some((filetype) => file.name.toLowerCase().endsWith(filetype.toLowerCase())));
9233
9305
  },
9234
9306
  errorMessage: "unsupportedFiletype",
9235
9307
  modes: ["blur", "input"]
@@ -9237,7 +9309,7 @@ const fileValidationRules = ({
9237
9309
  validate: (files) => {
9238
9310
  if (!files)
9239
9311
  return true;
9240
- return files.every((file) => !file.size || file.size < maxSize);
9312
+ return filterOnlyNewlyUploadedFiles(files).every((file) => !file.size || file.size < maxSize);
9241
9313
  },
9242
9314
  errorMessage: "maximumFileSizeExceeded",
9243
9315
  modes: ["blur", "input"]
@@ -9734,12 +9806,11 @@ const mapAddressLabels = (data, datasetUtils) => {
9734
9806
  }
9735
9807
  return data;
9736
9808
  };
9737
- const STATE_FIELD = "stateOrProvince";
9738
9809
  function StateField({
9739
9810
  data,
9740
9811
  valid,
9741
- error,
9742
- label,
9812
+ errors,
9813
+ labels: labels2,
9743
9814
  readonly,
9744
9815
  handleChangeFor,
9745
9816
  selectedCountry,
@@ -9752,30 +9823,24 @@ function StateField({
9752
9823
  dataset: states,
9753
9824
  loaded
9754
9825
  } = useDataset(datasetIdentifier.state(selectedCountry), !selectedCountry || !COUNTRIES_WITH_STATES_DATASET.includes(selectedCountry));
9755
- const handleStateChangeFor = useCallback((e) => {
9756
- const {
9757
- value
9758
- } = e.target;
9759
- handleChangeFor(STATE_FIELD)(value);
9760
- }, [handleChangeFor]);
9761
- const labelKey = getKeyForField(STATE_FIELD, selectedCountry);
9826
+ const labelKey = getKeyForField("stateOrProvince", selectedCountry);
9762
9827
  const placeholderKey = getKeyForField("stateOrProvincePlaceholder", selectedCountry);
9763
9828
  if (!loaded || !states.length)
9764
9829
  return null;
9765
9830
  return jsx(Field, {
9766
- name: STATE_FIELD,
9767
- label: label || i18n.get(labelKey),
9831
+ name: "stateOrProvince",
9832
+ label: (labels2 == null ? void 0 : labels2.stateOrProvince) || i18n.get(labelKey),
9768
9833
  classNameModifiers,
9769
- errorMessage: error,
9770
- isValid: valid,
9834
+ errorMessage: errors.stateOrProvince,
9835
+ isValid: valid.stateOrProvince,
9771
9836
  children: (childProps) => jsx(Select, {
9772
9837
  ...childProps,
9773
- name: STATE_FIELD,
9774
- selected: data,
9838
+ name: "stateOrProvince",
9839
+ selected: data.stateOrProvince,
9775
9840
  placeholder: i18n.get(placeholderKey),
9776
9841
  items: states,
9777
- readonly: readonly && !!data,
9778
- onChange: handleStateChangeFor
9842
+ readonly: readonly && !!data.stateOrProvince,
9843
+ onChange: handleChangeFor("stateOrProvince")
9779
9844
  })
9780
9845
  });
9781
9846
  }
@@ -9804,10 +9869,18 @@ function FieldContainer(props) {
9804
9869
  switch (field) {
9805
9870
  case "country":
9806
9871
  return jsx(CountryField, {
9807
- data: value,
9808
- valid: valid == null ? void 0 : valid.country,
9809
- error: errorMessage,
9810
- label: formUtils.getLabel(field),
9872
+ data: {
9873
+ country: value
9874
+ },
9875
+ valid: {
9876
+ country: valid == null ? void 0 : valid.country
9877
+ },
9878
+ errors: {
9879
+ country: errorMessage
9880
+ },
9881
+ labels: {
9882
+ country: formUtils.getLabel(field)
9883
+ },
9811
9884
  readonly: formUtils.isReadOnly(field),
9812
9885
  classNameModifiers,
9813
9886
  allowedCountries,
@@ -9816,10 +9889,18 @@ function FieldContainer(props) {
9816
9889
  });
9817
9890
  case "stateOrProvince":
9818
9891
  return jsx(StateField, {
9819
- data: value,
9820
- valid: valid == null ? void 0 : valid.stateOrProvince,
9821
- error: errorMessage,
9822
- label: formUtils.getLabel(field),
9892
+ data: {
9893
+ stateOrProvince: value
9894
+ },
9895
+ valid: {
9896
+ stateOrProvince: valid == null ? void 0 : valid.stateOrProvince
9897
+ },
9898
+ errors: {
9899
+ stateOrProvince: errorMessage
9900
+ },
9901
+ labels: {
9902
+ stateOrProvince: formUtils.getLabel(field)
9903
+ },
9823
9904
  readonly: formUtils.isReadOnly(field),
9824
9905
  classNameModifiers,
9825
9906
  selectedCountry: data.country,
@@ -10689,7 +10770,8 @@ function RegistrationAddressComponent(props) {
10689
10770
  heading,
10690
10771
  description: description2,
10691
10772
  handleAddressSearch,
10692
- handleFindAddress
10773
+ handleFindAddress,
10774
+ optionalFields
10693
10775
  } = props;
10694
10776
  const {
10695
10777
  data: formData,
@@ -10702,7 +10784,8 @@ function RegistrationAddressComponent(props) {
10702
10784
  schema: ["operationalAddressIsSame"],
10703
10785
  defaultData: data,
10704
10786
  rules: validators || registrationAddressValidationRules,
10705
- maskedFields: []
10787
+ maskedFields: [],
10788
+ optionalFields
10706
10789
  });
10707
10790
  const formUtils = formUtilities(props, i18n);
10708
10791
  const stateRef = useRef({
@@ -10979,7 +11062,7 @@ const idDocumentTypeOptions = [{
10979
11062
  hasBackPage: false
10980
11063
  }, {
10981
11064
  id: DocumentType.IDENTITY_CARD,
10982
- name: "id",
11065
+ name: "identityCard",
10983
11066
  hasBackPage: true
10984
11067
  }];
10985
11068
  const onfidoDocumentTypeMapping = [{
@@ -10988,7 +11071,7 @@ const onfidoDocumentTypeMapping = [{
10988
11071
  hasBackPage: true
10989
11072
  }, {
10990
11073
  id: DocumentType.NATIONAL_IDENTITY_CARD,
10991
- name: "id",
11074
+ name: "identityCard",
10992
11075
  hasBackPage: true
10993
11076
  }, {
10994
11077
  id: DocumentType.PASSPORT,
@@ -11079,9 +11162,10 @@ const createDocumentRequest = async ({
11079
11162
  description: description2,
11080
11163
  existingDocument
11081
11164
  }) => {
11082
- const promises = [fileToBase64(page1), fileToBase64(page2)].filter(Boolean);
11083
- const [encodedFront, encodedBack] = await Promise.all(promises);
11084
- if (!encodedFront) {
11165
+ const pagesToUpload = [page1, page2].filter((page) => page !== void 0 && isNewlyUploadedFile(page));
11166
+ const [page1ToUpload, page2ToUpload] = pagesToUpload;
11167
+ const [encodedPage1, encodedPage2] = await Promise.all(pagesToUpload.map(fileToBase64));
11168
+ if (!encodedPage1) {
11085
11169
  if (existingDocument && existingDocument.description !== description2) {
11086
11170
  return {
11087
11171
  owner: {
@@ -11101,7 +11185,7 @@ const createDocumentRequest = async ({
11101
11185
  },
11102
11186
  type: documentType2,
11103
11187
  description: description2 || `Document type: ${documentType2}`,
11104
- attachments: [...page1 && page2 && encodedFront && encodedBack ? [createAttachment(encodedFront, page1.name, "front"), createAttachment(encodedBack, page2.name, "back")] : [createAttachment(encodedFront, page1.name)]]
11188
+ attachments: [...page1ToUpload && page2ToUpload && encodedPage1 && encodedPage2 ? [createAttachment(encodedPage1, page1ToUpload.name, "front"), createAttachment(encodedPage2, page2ToUpload.name, "back")] : [createAttachment(encodedPage1, page1ToUpload.name)]]
11105
11189
  };
11106
11190
  };
11107
11191
  const createAttachment = (content, pageName, pageType) => ({
@@ -11122,15 +11206,10 @@ const hasDocumentChanged = (newDocument, entityId) => {
11122
11206
  return true;
11123
11207
  };
11124
11208
  const fileToBase64 = (file) => new Promise((resolve, reject) => {
11125
- if (!file || !(file instanceof Blob)) {
11126
- resolve();
11127
- return;
11128
- }
11129
11209
  const reader = new FileReader();
11130
11210
  reader.readAsDataURL(file);
11131
11211
  reader.onload = () => {
11132
- var _a;
11133
- const base64String = (_a = reader.result) == null ? void 0 : _a.toString().split(";base64,")[1];
11212
+ const base64String = reader.result.toString().split(";base64,")[1];
11134
11213
  resolve(base64String);
11135
11214
  };
11136
11215
  reader.onerror = (error) => reject(error);
@@ -11529,10 +11608,17 @@ const isPartOfTrustFromLegalEntity = (legalEntity) => {
11529
11608
  var _a;
11530
11609
  return (_a = legalEntity == null ? void 0 : legalEntity.entityAssociations) == null ? void 0 : _a.some((ea) => ea.entityType === LegalEntityType.TRUST && ea.associatorId === legalEntity.id);
11531
11610
  };
11611
+ const getRootTrusteeLegalEntityId = (trustEntity) => {
11612
+ var _a;
11613
+ if (!trustEntity.entityAssociations)
11614
+ return "";
11615
+ return (_a = trustEntity.entityAssociations.filter((entityAssociation) => entityAssociation.type === LegalEntityType.TRUST)[0]) == null ? void 0 : _a.legalEntityId;
11616
+ };
11532
11617
  const getOwnTrustMembers = (trustEntity) => {
11533
11618
  if (!trustEntity.entityAssociations)
11534
11619
  return [];
11535
- return trustEntity.entityAssociations.filter((entityAssociation) => Object.values(TrustMemberTypes).includes(entityAssociation.type) && entityAssociation.associatorId === trustEntity.id);
11620
+ const rootTrusteeLegalEntityId = getRootTrusteeLegalEntityId(trustEntity);
11621
+ return trustEntity.entityAssociations.filter((entityAssociation) => Object.values(TrustMemberTypes).includes(entityAssociation.type) && rootTrusteeLegalEntityId === (entityAssociation == null ? void 0 : entityAssociation.associatorId));
11536
11622
  };
11537
11623
  const getOwnTrustMembersLegalEntityIds = (legalEntity) => getOwnTrustMembers(legalEntity).map((ea) => ea.legalEntityId).filter((id2) => id2 !== void 0);
11538
11624
  const getOwnTrustLegalEntityId = (legalEntity) => {
@@ -12390,6 +12476,10 @@ const mapIndividualDocumentToApiDocument = async (data, entityId) => {
12390
12476
  return documents2.filter(Boolean);
12391
12477
  }
12392
12478
  };
12479
+ const mapExistingFile = (name) => ({
12480
+ name,
12481
+ existing: true
12482
+ });
12393
12483
  const mapApiIdDocumentToSchema = (idDocument2) => {
12394
12484
  const {
12395
12485
  hasBackPage
@@ -12400,14 +12490,10 @@ const mapApiIdDocumentToSchema = (idDocument2) => {
12400
12490
  const backPage2 = hasBackPage ? getPage(idDocument2, "back") : void 0;
12401
12491
  return {
12402
12492
  ...frontPage2 ? {
12403
- idFrontPage: [{
12404
- name: frontPage2.pageName
12405
- }]
12493
+ idFrontPage: [mapExistingFile(frontPage2.pageName)]
12406
12494
  } : {},
12407
12495
  ...backPage2 ? {
12408
- idBackPage: [{
12409
- name: backPage2.pageName
12410
- }]
12496
+ idBackPage: [mapExistingFile(backPage2.pageName)]
12411
12497
  } : {},
12412
12498
  idDocumentType: idDocument2.type
12413
12499
  };
@@ -12418,12 +12504,12 @@ const mapApiDocumentToIndividualDocuments = (entityId) => {
12418
12504
  const proofOfNationalId2 = getDocument$1(entityId, DocumentType.PROOF_OF_NATIONAL_ID_NUMBER) || null;
12419
12505
  return {
12420
12506
  idDocument: idDocument2 ? mapApiIdDocumentToSchema(idDocument2) : null,
12421
- proofOfResidence: proofOfResidence2 ? [{
12422
- name: getPageName(proofOfResidence2)
12423
- }] : null,
12424
- proofOfNationalId: proofOfNationalId2 ? [{
12425
- name: getPageName(proofOfNationalId2)
12426
- }] : null
12507
+ proofOfResidence: proofOfResidence2 ? {
12508
+ proofOfResidence: [mapExistingFile(getPageName(proofOfResidence2))]
12509
+ } : null,
12510
+ proofOfNationalId: proofOfNationalId2 ? {
12511
+ proofOfNationalId: [mapExistingFile(getPageName(proofOfNationalId2))]
12512
+ } : null
12427
12513
  };
12428
12514
  };
12429
12515
  const mapCompanyDocumentToApiDocument = async (data, entityId) => {
@@ -12460,14 +12546,10 @@ const mapApiDocumentToCompanyDocuments = (entityId) => {
12460
12546
  const taxDocument2 = getDocument$1(entityId, DocumentType.VAT_DOCUMENT) ?? getDocument$1(entityId, DocumentType.PROOF_OF_ORGANIZATION_TAX_INFO) ?? null;
12461
12547
  return {
12462
12548
  companyRegistrationDocument: registrationDocument2 ? {
12463
- registrationDocument: [{
12464
- name: getPageName(registrationDocument2)
12465
- }]
12549
+ registrationDocument: [mapExistingFile(getPageName(registrationDocument2))]
12466
12550
  } : null,
12467
12551
  companyTaxDocument: taxDocument2 ? {
12468
- taxDocument: [{
12469
- name: getPageName(taxDocument2)
12470
- }]
12552
+ taxDocument: [mapExistingFile(getPageName(taxDocument2))]
12471
12553
  } : null
12472
12554
  };
12473
12555
  };
@@ -12487,9 +12569,7 @@ const mapApiDocumentToTrustDocument = (entityId) => {
12487
12569
  const constitutionalDocument2 = getDocument$1(entityId, DocumentType.CONSTITUTIONAL_DOCUMENT) || null;
12488
12570
  return {
12489
12571
  trustConstitutionalDocument: constitutionalDocument2 ? {
12490
- constitutionalDocument: [{
12491
- name: getPageName(constitutionalDocument2)
12492
- }]
12572
+ constitutionalDocument: [mapExistingFile(getPageName(constitutionalDocument2))]
12493
12573
  } : null
12494
12574
  };
12495
12575
  };
@@ -12509,9 +12589,7 @@ const mapApiDocumentToSolePropDocuments = (entityId) => {
12509
12589
  const constitutionalDocument2 = getDocument$1(entityId, DocumentType.CONSTITUTIONAL_DOCUMENT) || null;
12510
12590
  return {
12511
12591
  solePropConstitutionalDocument: constitutionalDocument2 ? {
12512
- constitutionalDocument: [{
12513
- name: getPageName(constitutionalDocument2)
12514
- }]
12592
+ constitutionalDocument: [mapExistingFile(getPageName(constitutionalDocument2))]
12515
12593
  } : null
12516
12594
  };
12517
12595
  };
@@ -12538,9 +12616,7 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
12538
12616
  const mapApiDocumentToPayoutDocuments = (entityId) => {
12539
12617
  const bankStatement2 = getDocument$1(entityId, DocumentType.BANK_STATEMENT) || null;
12540
12618
  return {
12541
- bankStatementDocument: bankStatement2 ? [{
12542
- name: getPageName(bankStatement2)
12543
- }] : null,
12619
+ bankStatementDocument: bankStatement2 ? [mapExistingFile(getPageName(bankStatement2))] : null,
12544
12620
  description: bankStatement2.description
12545
12621
  };
12546
12622
  };
@@ -12633,27 +12709,21 @@ function IdDocumentManualUploadComponent(props) {
12633
12709
  const document2 = idDocumentType ? getDocument$1(props.legalEntityId, idDocumentType) : void 0;
12634
12710
  if (!document2) {
12635
12711
  setIdFrontPage({
12636
- idFrontPage: null
12712
+ idFrontPage: void 0
12637
12713
  });
12638
12714
  setIdBackPage({
12639
- idBackPage: null
12715
+ idBackPage: void 0
12640
12716
  });
12641
12717
  } else if (hasBackPage(idDocumentType)) {
12642
12718
  setIdFrontPage({
12643
- idFrontPage: [{
12644
- name: getPageName(document2, "front")
12645
- }]
12719
+ idFrontPage: [mapExistingFile(getPageName(document2, "front"))]
12646
12720
  });
12647
12721
  setIdBackPage({
12648
- idBackPage: [{
12649
- name: getPageName(document2, "back")
12650
- }]
12722
+ idBackPage: [mapExistingFile(getPageName(document2, "back"))]
12651
12723
  });
12652
12724
  } else {
12653
12725
  setIdFrontPage({
12654
- idFrontPage: [{
12655
- name: getPageName(document2)
12656
- }]
12726
+ idFrontPage: [mapExistingFile(getPageName(document2))]
12657
12727
  });
12658
12728
  }
12659
12729
  }
@@ -12755,7 +12825,7 @@ const useIdVerificationToken = ({
12755
12825
  lastName: lastName2,
12756
12826
  residencyCountry: residencyCountry2
12757
12827
  } = userDetails;
12758
- const [sdkToken, setSdkToken] = useState();
12828
+ const [sdkToken2, setSdkToken2] = useState();
12759
12829
  const [loadingStatus, setLoadingStatus] = useState();
12760
12830
  const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
12761
12831
  useEffect(() => {
@@ -12781,9 +12851,9 @@ const useIdVerificationToken = ({
12781
12851
  // Do not include legalEntityId if we don't know yet. Eg.: decision-makers flow the associated legalEntityId.
12782
12852
  };
12783
12853
  const {
12784
- sdkToken: sdkToken2
12854
+ sdkToken: sdkToken22
12785
12855
  } = await handleGetIdVerificationToken("", data);
12786
- setSdkToken(sdkToken2);
12856
+ setSdkToken2(sdkToken22);
12787
12857
  } catch (e) {
12788
12858
  onIdVerificationError == null ? void 0 : onIdVerificationError(e);
12789
12859
  } finally {
@@ -12792,7 +12862,7 @@ const useIdVerificationToken = ({
12792
12862
  })().catch(console.error);
12793
12863
  }, [firstName2, lastName2, residencyCountry2, hasAllUserDetails]);
12794
12864
  return {
12795
- sdkToken,
12865
+ sdkToken: sdkToken2,
12796
12866
  loadingStatus
12797
12867
  };
12798
12868
  };
@@ -13336,7 +13406,7 @@ function IdVerificationComponent({
13336
13406
  i18n
13337
13407
  } = useI18nContext();
13338
13408
  const {
13339
- sdkToken,
13409
+ sdkToken: sdkToken2,
13340
13410
  loadingStatus
13341
13411
  } = useIdVerificationToken({
13342
13412
  userDetails,
@@ -13347,10 +13417,10 @@ function IdVerificationComponent({
13347
13417
  const onfidoSdk = useRef();
13348
13418
  useEffect(() => {
13349
13419
  (async () => {
13350
- if (!sdkToken)
13420
+ if (!sdkToken2)
13351
13421
  return;
13352
13422
  onfidoSdk.current = await initOnfido({
13353
- token: sdkToken,
13423
+ token: sdkToken2,
13354
13424
  i18n,
13355
13425
  onIdVerificationClose,
13356
13426
  onIdVerificationError,
@@ -13361,7 +13431,7 @@ function IdVerificationComponent({
13361
13431
  if (onfidoSdk.current)
13362
13432
  onfidoSdk.current.tearDown();
13363
13433
  };
13364
- }, [sdkToken]);
13434
+ }, [sdkToken2]);
13365
13435
  useEffect(() => {
13366
13436
  if (!onfidoSdk.current)
13367
13437
  return;
@@ -15652,10 +15722,18 @@ function PersonalDetailsComponent(props) {
15652
15722
  max: formatDateObj(/* @__PURE__ */ new Date())
15653
15723
  })
15654
15724
  }), formUtils.isRequiredField("residencyCountry") && jsx(CountryField, {
15655
- data: data.residencyCountry,
15656
- valid: valid == null ? void 0 : valid.residencyCountry,
15657
- error: formUtils.getErrorMessage("residencyCountry", errors, fieldProblems),
15658
- label: formUtils.getLabel("residencyCountry"),
15725
+ data: {
15726
+ country: data.residencyCountry
15727
+ },
15728
+ valid: {
15729
+ country: valid.residencyCountry
15730
+ },
15731
+ errors: {
15732
+ country: formUtils.getErrorMessage("residencyCountry", errors, fieldProblems)
15733
+ },
15734
+ labels: {
15735
+ country: formUtils.getLabel("residencyCountry")
15736
+ },
15659
15737
  readonly: !isAllowedEditPrefilledCountry && !isDecisionMakerTask,
15660
15738
  allowedCountries: [],
15661
15739
  classNameModifiers: ["country"],
@@ -15665,10 +15743,18 @@ function PersonalDetailsComponent(props) {
15665
15743
  country: data.residencyCountry,
15666
15744
  errors: externalErrors
15667
15745
  }), (data.residencyCountry === "SG" || data.residencyCountry === "HK") && formUtils.isRequiredField("nationality") && jsx(CountryField, {
15668
- data: data.nationality,
15669
- valid: valid == null ? void 0 : valid.nationality,
15670
- error: formUtils.getErrorMessage("nationality", errors, fieldProblems),
15671
- label: formUtils.getLabel("nationality"),
15746
+ data: {
15747
+ country: data.nationality
15748
+ },
15749
+ valid: {
15750
+ country: valid.nationality
15751
+ },
15752
+ errors: {
15753
+ country: formUtils.getErrorMessage("nationality", errors, fieldProblems)
15754
+ },
15755
+ labels: {
15756
+ country: formUtils.getLabel("nationality")
15757
+ },
15672
15758
  readonly: formUtils.isReadOnly("nationality"),
15673
15759
  classNameModifiers: ["nationality"],
15674
15760
  handleChangeFor: () => handleChangeFor("nationality", "input")
@@ -16162,6 +16248,29 @@ class AdyenKycSdkError extends Error {
16162
16248
  this.stack = stack.join("\n");
16163
16249
  }
16164
16250
  }
16251
+ let sdkToken;
16252
+ let fetchSdkToken;
16253
+ const logger$e = createLogger("Session");
16254
+ const setSdkToken = (token) => {
16255
+ sdkToken = token;
16256
+ };
16257
+ const setSdkTokenHandler = (handler) => {
16258
+ fetchSdkToken = handler;
16259
+ };
16260
+ const getSdkToken = () => sdkToken;
16261
+ const refreshSession = async () => {
16262
+ if (!fetchSdkToken) {
16263
+ throw Error("Not able to extend session, fetch handler not provided ");
16264
+ }
16265
+ try {
16266
+ const {
16267
+ token
16268
+ } = await fetchSdkToken();
16269
+ setSdkToken(token);
16270
+ } catch (e) {
16271
+ logger$e.error("Failed to fetch sdk token", e);
16272
+ }
16273
+ };
16165
16274
  const OpenBankingSDKStyles = "";
16166
16275
  const WIDGET_IFRAME_CLASS$1 = "adyen-open-banking-sdk-widget";
16167
16276
  const WIDGET_CONTAINER_CLASS$1 = `${WIDGET_IFRAME_CLASS$1}-container`;
@@ -16227,17 +16336,18 @@ const removeAnimationStartListener = (element, listener) => {
16227
16336
  element.removeEventListener("MSAnimationStart", listener, false);
16228
16337
  element.removeEventListener("webkitAnimationStart", listener, false);
16229
16338
  };
16230
- const logger$e = createLogger("Fetch");
16339
+ const logger$d = createLogger("Fetch");
16231
16340
  const getRequestObject = (options, data) => {
16232
16341
  const {
16233
16342
  headers = [],
16234
16343
  method = "GET",
16235
- sdkToken
16344
+ authentication
16236
16345
  } = options;
16237
16346
  let authHeaders;
16238
- if (options.sdkToken) {
16347
+ if (authentication === "jwt") {
16348
+ const sdkToken2 = getSdkToken();
16239
16349
  authHeaders = {
16240
- Authorization: `Bearer ${sdkToken}`,
16350
+ Authorization: `Bearer ${sdkToken2}`,
16241
16351
  Origin: window.location.origin
16242
16352
  };
16243
16353
  }
@@ -16273,10 +16383,10 @@ const logFetchError = (message, level) => {
16273
16383
  case "info":
16274
16384
  case "warn":
16275
16385
  case "error":
16276
- logger$e[level](message);
16386
+ logger$d[level](message);
16277
16387
  break;
16278
16388
  default:
16279
- logger$e.error(message);
16389
+ logger$d.error(message);
16280
16390
  }
16281
16391
  };
16282
16392
  const handleFetchResponse = async (response, responseType) => {
@@ -16292,11 +16402,17 @@ const handleFetchResponse = async (response, responseType) => {
16292
16402
  }
16293
16403
  };
16294
16404
  const isValidationErrorResponse = (response) => (response == null ? void 0 : response.status) === 422;
16405
+ const isSessionExpiredResponse = (response) => (response == null ? void 0 : response.status) === 401;
16406
+ const processValidationErrors$1 = async (response) => {
16407
+ const responseData = await response.json();
16408
+ throw new ValidationError(responseData.errorCode, responseData);
16409
+ };
16295
16410
  class ValidationError extends Error {
16296
16411
  constructor(message, validationDetails) {
16297
16412
  super(message);
16298
16413
  this.invalidFields = validationDetails == null ? void 0 : validationDetails.invalidFields;
16299
16414
  this.errorCode = validationDetails == null ? void 0 : validationDetails.errorCode;
16415
+ this.sourceError = validationDetails;
16300
16416
  }
16301
16417
  }
16302
16418
  const http = async (options, data, responseType = "json") => {
@@ -16308,6 +16424,7 @@ const http = async (options, data, responseType = "json") => {
16308
16424
  } = options;
16309
16425
  const request = getRequestObject(options, data);
16310
16426
  const url = getRequestUrl(loadingContext, path, clientKey);
16427
+ const needsAuthGuard = options.authentication === "jwt";
16311
16428
  let response;
16312
16429
  try {
16313
16430
  response = await fetch(url, request);
@@ -16328,8 +16445,11 @@ const http = async (options, data, responseType = "json") => {
16328
16445
  return options.errorHandler(handleFetchResponse(response, responseType));
16329
16446
  }
16330
16447
  if (isValidationErrorResponse(response)) {
16331
- const responseData = await response.json();
16332
- throw new ValidationError(responseData.errorCode, responseData);
16448
+ return processValidationErrors$1(response);
16449
+ }
16450
+ if (needsAuthGuard && isSessionExpiredResponse(response)) {
16451
+ await refreshSession();
16452
+ return http(options, data, responseType);
16333
16453
  }
16334
16454
  logFetchError(errorMessage, errorLevel);
16335
16455
  throw new Error(errorMessage);
@@ -16355,7 +16475,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
16355
16475
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
16356
16476
  const MOUNT_TIMEOUT = 10 * 1e3;
16357
16477
  const TINK_VENDOR = "Tink";
16358
- const logger$d = createLogger("iframeWidget");
16478
+ const logger$c = createLogger("iframeWidget");
16359
16479
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
16360
16480
  const isTerminalMessageData = (data) => Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
16361
16481
  const parseMessageJson = (message) => {
@@ -16374,7 +16494,7 @@ const callbackErrorHandler = async (response) => {
16374
16494
  try {
16375
16495
  await response;
16376
16496
  } catch (ex) {
16377
- logger$d.error(ex);
16497
+ logger$c.error(ex);
16378
16498
  }
16379
16499
  return {
16380
16500
  error: "UNKNOWN_ERROR",
@@ -16383,7 +16503,7 @@ const callbackErrorHandler = async (response) => {
16383
16503
  };
16384
16504
  let activeWidget;
16385
16505
  class IFrameWidget {
16386
- constructor(iframeElement, url, vendor, sdkToken) {
16506
+ constructor(iframeElement, url, vendor, sdkToken2) {
16387
16507
  this.mountInProgress = false;
16388
16508
  this.waitForResponse = async () => new Promise((resolve, reject) => {
16389
16509
  this.listener = async (message) => {
@@ -16406,7 +16526,7 @@ class IFrameWidget {
16406
16526
  this.iframeElement = iframeElement;
16407
16527
  this.iframeWindow = iframeElement.contentWindow;
16408
16528
  this.vendor = vendor;
16409
- this.sdkToken = sdkToken;
16529
+ this.sdkToken = sdkToken2;
16410
16530
  }
16411
16531
  removeMessageEventListener() {
16412
16532
  if (!this.listener)
@@ -16480,7 +16600,7 @@ class IFrameWidget {
16480
16600
  message = responseData.errorMessage;
16481
16601
  }
16482
16602
  } catch (ex) {
16483
- logger$d.error(ex);
16603
+ logger$c.error(ex);
16484
16604
  }
16485
16605
  throw new AdyenKycSdkError(reason, jsonData.error);
16486
16606
  }
@@ -16566,7 +16686,7 @@ function BankVerificationWidget({
16566
16686
  const {
16567
16687
  isEmbeddedDropin
16568
16688
  } = context;
16569
- const sdkToken = isEmbeddedDropin ? context.sdkToken : void 0;
16689
+ const sdkToken2 = isEmbeddedDropin ? getSdkToken() : void 0;
16570
16690
  useEffect(
16571
16691
  () => {
16572
16692
  const container = widgetContainerRef.current;
@@ -16609,7 +16729,7 @@ function BankVerificationWidget({
16609
16729
  requestAnimationFrame(async () => {
16610
16730
  var _a, _b;
16611
16731
  try {
16612
- iFrameWidget = new IFrameWidget(iFrame, url, vendor, sdkToken);
16732
+ iFrameWidget = new IFrameWidget(iFrame, url, vendor, sdkToken2);
16613
16733
  const result = await iFrameWidget.mountAndWaitForResponse();
16614
16734
  widgetCallback({
16615
16735
  action: "verification_success",
@@ -16666,7 +16786,7 @@ function BankVerificationWidget({
16666
16786
  ref: widgetContainerRef
16667
16787
  });
16668
16788
  }
16669
- const logger$c = createLogger("BankVerification");
16789
+ const logger$b = createLogger("BankVerification");
16670
16790
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
16671
16791
  const InstantVerificationErrorContext = createContext(null);
16672
16792
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -16700,7 +16820,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
16700
16820
  const preferredVendor2 = vendors[0];
16701
16821
  setPreferredVendor(preferredVendor2.name ? preferredVendor2 : null);
16702
16822
  };
16703
- getPreferredVendor().catch(logger$c.error);
16823
+ getPreferredVendor().catch(logger$b.error);
16704
16824
  }, [country2, getBankVerificationVendors]);
16705
16825
  return preferredVendor;
16706
16826
  };
@@ -18274,15 +18394,25 @@ function PayoutVerificationMethod(props) {
18274
18394
  }
18275
18395
  })]
18276
18396
  }), jsx(CountryField, {
18277
- data: data.bankCountry,
18278
- valid: valid == null ? void 0 : valid.bankCountry,
18279
- error: formUtils.getErrorMessage("bankCountry", errors, fieldProblems),
18280
- label: formUtils.getLabel("bankCountry", "bankAccountCountry"),
18397
+ data: {
18398
+ country: data.bankCountry
18399
+ },
18400
+ valid: {
18401
+ country: valid == null ? void 0 : valid.bankCountry
18402
+ },
18403
+ errors: {
18404
+ country: formUtils.getErrorMessage("bankCountry", errors, fieldProblems)
18405
+ },
18406
+ labels: {
18407
+ country: formUtils.getLabel("bankCountry", "bankAccountCountry")
18408
+ },
18281
18409
  readonly: !intraRegionCrossBorderPayoutsAllowed || allowedBankCountries.length === 1,
18282
18410
  allowedCountries: allowedBankCountries,
18283
18411
  classNameModifiers: ["country"],
18284
18412
  handleChangeFor: () => handleChangeFor("bankCountry", "input"),
18285
- helperText: intraRegionCrossBorderPayoutsAllowed ? void 0 : i18n.get(props.legalEntityType === LegalEntityType.INDIVIDUAL ? "youCanOnlyUseABankAccountInTheCountryWhereYouLive" : "youCanOnlyUseABankAccountInTheCountryWhereYourCompanyIsRegistered")
18413
+ helperText: {
18414
+ country: intraRegionCrossBorderPayoutsAllowed ? void 0 : i18n.get(props.legalEntityType === LegalEntityType.INDIVIDUAL ? "youCanOnlyUseABankAccountInTheCountryWhereYouLive" : "youCanOnlyUseABankAccountInTheCountryWhereYourCompanyIsRegistered")
18415
+ }
18286
18416
  }), jsx(Field, {
18287
18417
  name: "verificationMethods",
18288
18418
  label: formUtils.getLabel("payoutVerificationMethod", "verificationMethod"),
@@ -18779,14 +18909,16 @@ function TrustRegistrationDetailsComponent(props) {
18779
18909
  id: "ariaErrorField"
18780
18910
  }), jsx(ContextHelper, {
18781
18911
  content: i18n.get("makeSureToHaveYourTrustDeed")
18782
- }), formUtils.isRequiredField(COUNTRY_FIELD) && jsx(CountryField, {
18783
- data: country2,
18784
- valid: valid == null ? void 0 : valid.country,
18785
- error: formUtils.getErrorMessage(COUNTRY_FIELD, errors, fieldProblems),
18786
- label: formUtils.getLabel(COUNTRY_FIELD, "countryOfEstablishment"),
18787
- readonly: formUtils.isReadOnly(COUNTRY_FIELD),
18912
+ }), formUtils.isRequiredField("country") && jsx(CountryField, {
18913
+ data: formUtils.getFieldData(data, COUNTRY_FIELD),
18914
+ valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
18915
+ errors: formUtils.getFieldErrors(errors, fieldProblems, COUNTRY_FIELD),
18916
+ labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
18917
+ country: "countryOfEstablishment"
18918
+ }),
18919
+ readonly: formUtils.isReadOnly("country"),
18788
18920
  allowedCountries: ALLOWED_TRUST_COUNTRIES,
18789
- classNameModifiers: [COUNTRY_FIELD],
18921
+ classNameModifiers: ["country"],
18790
18922
  handleChangeFor: () => (e) => {
18791
18923
  handleChangeFor("country", "input")(e);
18792
18924
  if (onCountryChange)
@@ -19587,6 +19719,7 @@ const useFormComposer = ({
19587
19719
  forms,
19588
19720
  formRef,
19589
19721
  submitButtonLabel,
19722
+ externalBackClick,
19590
19723
  onSubmit,
19591
19724
  skipSubmit,
19592
19725
  onSkipSubmit
@@ -19600,6 +19733,7 @@ const useFormComposer = ({
19600
19733
  const [hasAlreadyNavigatedForm, setHasAlreadyNavigatedForm] = useState(false);
19601
19734
  const getFormIndex = (formId) => forms.findIndex((form) => form.formId === formId);
19602
19735
  const isFinalStep = getFormIndex(activeForm.formId) === forms.length - 1;
19736
+ const isFirstStep = getFormIndex(activeForm.formId) === 0;
19603
19737
  useEffect(() => {
19604
19738
  setActiveForm((activeForm2) => forms.find(({
19605
19739
  formId
@@ -19644,11 +19778,11 @@ const useFormComposer = ({
19644
19778
  return;
19645
19779
  }
19646
19780
  if (isFormSummaryStep(activeForm)) {
19647
- if (skipSubmit && onSkipSubmit) {
19648
- onSkipSubmit();
19649
- return;
19781
+ if (skipSubmit) {
19782
+ onSkipSubmit == null ? void 0 : onSkipSubmit();
19783
+ } else {
19784
+ onSubmit == null ? void 0 : onSubmit();
19650
19785
  }
19651
- onSubmit();
19652
19786
  return;
19653
19787
  }
19654
19788
  if (!activeForm.isValid) {
@@ -19689,8 +19823,9 @@ const useFormComposer = ({
19689
19823
  }
19690
19824
  };
19691
19825
  const nextButtonLabel = isFinalStep ? i18n.get(submitButtonLabel ?? "submit") : i18n.get("next");
19826
+ const backClickHandler = isFirstStep ? externalBackClick : handleBackClick;
19692
19827
  return {
19693
- handleBackClick,
19828
+ handleBackClick: backClickHandler,
19694
19829
  handleNextClick,
19695
19830
  nextButtonLabel,
19696
19831
  gotoFormByFormIndex,
@@ -19884,7 +20019,7 @@ const defaultPayoutAccountFormat = {
19884
20019
  [CountryCodes.Sweden]: "local",
19885
20020
  [CountryCodes.UnitedKingdom]: "local"
19886
20021
  };
19887
- const logger$b = createLogger("useScenarioConfiguration");
20022
+ const logger$a = createLogger("useScenarioConfiguration");
19888
20023
  const useScenarioConfiguration = ({
19889
20024
  getConfigurationData,
19890
20025
  getPayoutAccountFormatData,
@@ -19906,12 +20041,12 @@ const useScenarioConfiguration = ({
19906
20041
  const response = await getConfigurationData();
19907
20042
  setConfigurationResponse(response);
19908
20043
  } catch (err) {
19909
- logger$b.warn("WARNING: Configuration request failed - error:", err);
20044
+ logger$a.warn("WARNING: Configuration request failed - error:", err);
19910
20045
  } finally {
19911
20046
  setLoadingStatus("success");
19912
20047
  }
19913
20048
  };
19914
- makeConfigCallAndSave().catch(logger$b.error);
20049
+ makeConfigCallAndSave().catch(logger$a.error);
19915
20050
  }, [getConfigurationData, setLoadingStatus]);
19916
20051
  useEffect(() => {
19917
20052
  setLoadingStatus("loading");
@@ -19927,12 +20062,12 @@ const useScenarioConfiguration = ({
19927
20062
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
19928
20063
  setAccountFormat(defaultAccountFormat);
19929
20064
  } catch (err) {
19930
- logger$b.warn("WARNING: Payout format request failed - error:", err);
20065
+ logger$a.warn("WARNING: Payout format request failed - error:", err);
19931
20066
  } finally {
19932
20067
  setLoadingStatus("success");
19933
20068
  }
19934
20069
  };
19935
- makePayoutFormatCallAndSave().catch(logger$b.error);
20070
+ makePayoutFormatCallAndSave().catch(logger$a.error);
19936
20071
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus]);
19937
20072
  const {
19938
20073
  fieldConfigurations,
@@ -20099,7 +20234,7 @@ const countryConfig$1 = {
20099
20234
  placeholder: "SSNFormatUS"
20100
20235
  },
20101
20236
  idNumberExempt: {
20102
- label: "uploadDocumentForSsn"
20237
+ label: "identityNumberExempt__US"
20103
20238
  }
20104
20239
  },
20105
20240
  CA: {
@@ -20108,7 +20243,7 @@ const countryConfig$1 = {
20108
20243
  placeholder: "SINFormatCA"
20109
20244
  },
20110
20245
  idNumberExempt: {
20111
- label: "uploadDocumentForSsn"
20246
+ label: "identityNumberExempt__CA"
20112
20247
  }
20113
20248
  },
20114
20249
  IT: {
@@ -20588,7 +20723,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
20588
20723
  return ToastType2;
20589
20724
  })(ToastType || {});
20590
20725
  const FormComposer = "";
20591
- const logger$a = createLogger("FormRouterContextProvider");
20726
+ const logger$9 = createLogger("FormRouterContextProvider");
20592
20727
  function FormRouterContextProvider({
20593
20728
  children,
20594
20729
  forms,
@@ -20608,7 +20743,7 @@ function FormRouterContextProvider({
20608
20743
  if (formIndex > -1) {
20609
20744
  setFormIndex(formIndex);
20610
20745
  } else {
20611
- logger$a.error("No form was found to have that field so form navigation failed.");
20746
+ logger$9.error("No form was found to have that field so form navigation failed.");
20612
20747
  }
20613
20748
  }
20614
20749
  }), [forms, handleGetIdVerificationToken, setFormIndex]);
@@ -20852,16 +20987,18 @@ const canSubmit = (data) => mandatoryApiFields.ORGANIZATION.every((detail) => {
20852
20987
  });
20853
20988
  const isDocumentsRequired = (forms) => forms.some((form) => [companyForms.companyRegistrationDocument.formId, companyForms.companyTaxDocument.formId].includes(form.formId));
20854
20989
  const formatFileSummaryData = (companyRegistrationDocument2, companyTaxDocument) => {
20855
- var _a, _b, _c, _d;
20990
+ var _a, _b;
20991
+ const registrationDocument2 = (_a = companyRegistrationDocument2 == null ? void 0 : companyRegistrationDocument2.registrationDocument) == null ? void 0 : _a[0];
20992
+ const taxDocument2 = (_b = companyTaxDocument == null ? void 0 : companyTaxDocument.taxDocument) == null ? void 0 : _b[0];
20856
20993
  return {
20857
- ...(companyRegistrationDocument2 == null ? void 0 : companyRegistrationDocument2.registrationDocument) && {
20994
+ ...registrationDocument2 && {
20858
20995
  companyRegistrationDocument: {
20859
- fileName: (_b = (_a = companyRegistrationDocument2.registrationDocument) == null ? void 0 : _a[0]) == null ? void 0 : _b.name
20996
+ fileName: registrationDocument2.name
20860
20997
  }
20861
20998
  },
20862
- ...(companyTaxDocument == null ? void 0 : companyTaxDocument.taxDocument) && {
20999
+ ...taxDocument2 && {
20863
21000
  companyTaxDocument: {
20864
- fileName: (_d = (_c = companyTaxDocument.taxDocument) == null ? void 0 : _c[0]) == null ? void 0 : _d.name
21001
+ fileName: taxDocument2.name
20865
21002
  }
20866
21003
  }
20867
21004
  };
@@ -21205,7 +21342,7 @@ function CompanyDropinComponent({
21205
21342
  })
21206
21343
  });
21207
21344
  }
21208
- const logger$9 = createLogger("useLocalStorage");
21345
+ const logger$8 = createLogger("useLocalStorage");
21209
21346
  function useLocalStorage(key, defaultValue, options) {
21210
21347
  const {
21211
21348
  serializer,
@@ -21226,7 +21363,7 @@ function useLocalStorage(key, defaultValue, options) {
21226
21363
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
21227
21364
  return res;
21228
21365
  } catch (err) {
21229
- logger$9.error(err);
21366
+ logger$8.error(err);
21230
21367
  return defaultValue;
21231
21368
  }
21232
21369
  });
@@ -21258,7 +21395,7 @@ function useLocalStorage(key, defaultValue, options) {
21258
21395
  try {
21259
21396
  updateLocalStorage();
21260
21397
  } catch (err) {
21261
- logger$9.error(err);
21398
+ logger$8.error(err);
21262
21399
  }
21263
21400
  }, [value]);
21264
21401
  useEffect(() => {
@@ -21273,7 +21410,7 @@ function useLocalStorage(key, defaultValue, options) {
21273
21410
  setValue(event.newValue ? parser(event.newValue) : void 0);
21274
21411
  }
21275
21412
  } catch (err) {
21276
- logger$9.error(err);
21413
+ logger$8.error(err);
21277
21414
  }
21278
21415
  };
21279
21416
  if (typeof window === "undefined")
@@ -21309,7 +21446,7 @@ const useShouldShowIntro = (legalEntity) => {
21309
21446
  } = useHasSeenIntro(legalEntity.id);
21310
21447
  return canSeeIntro && !hasSeenIntro;
21311
21448
  };
21312
- const logger$8 = createLogger("useExemptSettlor");
21449
+ const logger$7 = createLogger("useExemptSettlor");
21313
21450
  const useExemptSettlor = ({
21314
21451
  trust,
21315
21452
  handleGetLegalEntity
@@ -21321,7 +21458,7 @@ const useExemptSettlor = ({
21321
21458
  setExemptSettlor(exemptSettlorLE);
21322
21459
  }, [handleGetLegalEntity]);
21323
21460
  useEffect(() => {
21324
- updateExemptSettlor(trust).catch(logger$8.error);
21461
+ updateExemptSettlor(trust).catch(logger$7.error);
21325
21462
  }, [trust, updateExemptSettlor]);
21326
21463
  return exemptSettlor;
21327
21464
  };
@@ -21955,14 +22092,16 @@ const ActionsMenu = ({
21955
22092
  const Remove = ({
21956
22093
  onRemove,
21957
22094
  onRemoveStatusChange,
21958
- isRemoveDisabled,
21959
- handleIsRemoveDisabled
22095
+ isRemoveDisabled = false,
22096
+ handleIsRemoveDisabled,
22097
+ label
21960
22098
  }) => {
21961
22099
  const {
21962
22100
  i18n
21963
22101
  } = useI18nContext();
21964
22102
  const [undoTimer, setUndoTimer] = useState(5);
21965
22103
  const [isRemoving, setIsRemoving] = useState(false);
22104
+ const hasLabel = Boolean(label);
21966
22105
  useEffect(() => {
21967
22106
  let undoInterval;
21968
22107
  if (isRemoving && undoTimer > 0) {
@@ -21979,27 +22118,30 @@ const Remove = ({
21979
22118
  event.preventDefault();
21980
22119
  if (!isRemoving) {
21981
22120
  setIsRemoving(true);
21982
- onRemoveStatusChange(true);
21983
- handleIsRemoveDisabled(true);
22121
+ onRemoveStatusChange == null ? void 0 : onRemoveStatusChange(true);
22122
+ handleIsRemoveDisabled == null ? void 0 : handleIsRemoveDisabled(true);
21984
22123
  } else {
21985
22124
  setUndoTimer(5);
21986
22125
  setIsRemoving(false);
21987
- onRemoveStatusChange(false);
21988
- handleIsRemoveDisabled(false);
22126
+ onRemoveStatusChange == null ? void 0 : onRemoveStatusChange(false);
22127
+ handleIsRemoveDisabled == null ? void 0 : handleIsRemoveDisabled(false);
21989
22128
  }
21990
22129
  };
21991
22130
  useEffect(() => {
21992
22131
  if (undoTimer === 0 && isRemoving) {
21993
- setIsRemoving(false);
21994
- onRemoveStatusChange(false);
21995
- handleIsRemoveDisabled(false);
21996
- onRemove();
22132
+ (async () => {
22133
+ setIsRemoving(false);
22134
+ await onRemove();
22135
+ onRemoveStatusChange == null ? void 0 : onRemoveStatusChange(false);
22136
+ handleIsRemoveDisabled == null ? void 0 : handleIsRemoveDisabled(false);
22137
+ })();
21997
22138
  }
21998
22139
  }, [undoTimer, isRemoving, onRemoveStatusChange, handleIsRemoveDisabled, onRemove]);
21999
22140
  return isRemoving ? jsx(Button, {
22000
- showAsLink: isRemoving,
22141
+ showAsLink: !hasLabel && isRemoving,
22001
22142
  type: "button",
22002
- ghost: true,
22143
+ ghost: !hasLabel,
22144
+ secondary: hasLabel,
22003
22145
  onClick: onClickHandler,
22004
22146
  onKeyDown: handleKeys(["Enter"], noop),
22005
22147
  label: i18n.get("undoWithTimer", {
@@ -22009,11 +22151,14 @@ const Remove = ({
22009
22151
  })
22010
22152
  }) : jsx(Button, {
22011
22153
  type: "button",
22012
- icon: "bin",
22013
- ghost: true,
22154
+ icon: !hasLabel ? "bin" : "",
22155
+ ghost: !hasLabel,
22156
+ secondary: hasLabel,
22157
+ negative: hasLabel,
22014
22158
  onClick: onClickHandler,
22015
22159
  onKeyDown: handleKeys(["Enter"], noop),
22016
- disabled: isRemoveDisabled
22160
+ disabled: isRemoveDisabled,
22161
+ label: label ? i18n.get(label) : ""
22017
22162
  });
22018
22163
  };
22019
22164
  const EntityAssociation = ({
@@ -22403,11 +22548,11 @@ function LegalEntityTypeSwitcher({
22403
22548
  children: [jsx("h2", {
22404
22549
  className: "adyen-kyc-form-header__heading",
22405
22550
  "data-testid": LegalEntityType.ORGANIZATION,
22406
- children: i18n.get("continueAsCompany")
22551
+ children: i18n.get("areYouACompany")
22407
22552
  }), jsx("span", {
22408
- children: i18n.get("indicatedPayoutToCompany")
22553
+ children: i18n.get("singingUpAsIndividualButLooksLikeYouAreACompany")
22409
22554
  }), jsx("p", {
22410
- children: i18n.get("continueSigningUpAsCompany")
22555
+ children: i18n.get("wouldYouLikeToSignUpAsCompanyInstead")
22411
22556
  })]
22412
22557
  });
22413
22558
  case LegalEntityType.INDIVIDUAL:
@@ -22415,11 +22560,11 @@ function LegalEntityTypeSwitcher({
22415
22560
  children: [jsx("h2", {
22416
22561
  className: "adyen-kyc-form-header__heading",
22417
22562
  "data-testid": LegalEntityType.INDIVIDUAL,
22418
- children: i18n.get("continueAsIndividual")
22563
+ children: i18n.get("areYouAnIndividual")
22419
22564
  }), jsx("span", {
22420
- children: i18n.get("indicatedPayoutToPersonalAccount")
22565
+ children: i18n.get("singingUpAsCompanyButLooksLikeYouAreAnIndividual")
22421
22566
  }), jsx("p", {
22422
- children: i18n.get("continueSigningUpAsIndividual")
22567
+ children: i18n.get("wouldYouLikeToSignUpAsIndividualInstead")
22423
22568
  })]
22424
22569
  });
22425
22570
  default:
@@ -23664,42 +23809,50 @@ function IndividualDropinComponent({
23664
23809
  };
23665
23810
  const datasetUtils = datasetUtilities(i18n.locale);
23666
23811
  const formatIdDocument = (idDocument2) => {
23667
- var _a2, _b2, _c2, _d2, _e, _f;
23668
- if (idDocument2) {
23669
- const documentType2 = hasInstantIdVerification({
23670
- idDocument: idDocument2
23671
- }) ? onfidoDocumentTypeMapping.find((document2) => idDocument2.instantIdVerificationData.document_front.type === document2.id) : idDocumentTypeOptions.find(({
23672
- id: id2
23673
- }) => (idDocument2 == null ? void 0 : idDocument2.idDocumentType) === id2);
23674
- return {
23675
- documentType: i18n.get(documentType2 == null ? void 0 : documentType2.name),
23676
- ...(documentType2 == null ? void 0 : documentType2.hasBackPage) ? {
23677
- frontPage: (_b2 = (_a2 = idDocument2 == null ? void 0 : idDocument2.idFrontPage) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.name,
23678
- backPage: (_d2 = (_c2 = idDocument2 == null ? void 0 : idDocument2.idBackPage) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.name
23679
- } : {
23680
- fileName: (_f = (_e = idDocument2 == null ? void 0 : idDocument2.idFrontPage) == null ? void 0 : _e[0]) == null ? void 0 : _f.name
23681
- }
23682
- };
23683
- }
23812
+ var _a2, _b2;
23813
+ if (!idDocument2)
23814
+ return void 0;
23815
+ const documentType2 = hasInstantIdVerification({
23816
+ idDocument: idDocument2
23817
+ }) ? onfidoDocumentTypeMapping.find((document2) => idDocument2.instantIdVerificationData.document_front.type === document2.id) : idDocumentTypeOptions.find(({
23818
+ id: id2
23819
+ }) => idDocument2.idDocumentType === id2);
23820
+ if (!documentType2)
23821
+ return void 0;
23822
+ const frontPage2 = (_a2 = idDocument2.idFrontPage) == null ? void 0 : _a2[0];
23823
+ const backPage2 = (_b2 = idDocument2.idBackPage) == null ? void 0 : _b2[0];
23824
+ if (!frontPage2)
23825
+ return void 0;
23826
+ return {
23827
+ documentType: i18n.get(documentType2.name),
23828
+ ...backPage2 && documentType2.hasBackPage ? {
23829
+ frontPage: frontPage2.name,
23830
+ backPage: backPage2.name
23831
+ } : {
23832
+ fileName: frontPage2.name
23833
+ }
23834
+ };
23684
23835
  };
23685
23836
  const formatFileSummaryData2 = ({
23686
23837
  idDocument: idDocument2,
23687
23838
  proofOfNationalId: proofOfNationalId2,
23688
23839
  proofOfResidence: proofOfResidence2
23689
23840
  }) => {
23690
- var _a2, _b2, _c2, _d2;
23841
+ var _a2, _b2;
23842
+ const proofOfNationalIdFile = (_a2 = proofOfNationalId2 == null ? void 0 : proofOfNationalId2.proofOfNationalId) == null ? void 0 : _a2[0];
23843
+ const proofOfResidenceFile = (_b2 = proofOfResidence2 == null ? void 0 : proofOfResidence2.proofOfResidence) == null ? void 0 : _b2[0];
23691
23844
  return {
23692
23845
  ...((idDocument2 == null ? void 0 : idDocument2.idDocumentType) || (idDocument2 == null ? void 0 : idDocument2.instantIdVerificationData)) && {
23693
23846
  idDocument: formatIdDocument(idDocument2)
23694
23847
  },
23695
- ...(proofOfNationalId2 == null ? void 0 : proofOfNationalId2.proofOfNationalId) && {
23848
+ ...proofOfNationalIdFile && {
23696
23849
  proofOfNationalId: {
23697
- fileName: (_b2 = (_a2 = proofOfNationalId2.proofOfNationalId) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.name
23850
+ fileName: proofOfNationalIdFile.name
23698
23851
  }
23699
23852
  },
23700
- ...(proofOfResidence2 == null ? void 0 : proofOfResidence2.proofOfResidence) && {
23853
+ ...proofOfResidenceFile && {
23701
23854
  proofOfResidence: {
23702
- fileName: (_d2 = (_c2 = proofOfResidence2.proofOfResidence) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.name
23855
+ fileName: proofOfResidenceFile.name
23703
23856
  }
23704
23857
  }
23705
23858
  };
@@ -23929,7 +24082,8 @@ function PayoutDetailsDropinComponent({
23929
24082
  refreshLegalEntity,
23930
24083
  navigateBackToTaskList,
23931
24084
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
23932
- handleBankVerificationError: handleBankVerificationError2
24085
+ handleBankVerificationError: handleBankVerificationError2,
24086
+ handleBackClick: externalBackClick
23933
24087
  }) {
23934
24088
  var _a, _b, _c;
23935
24089
  const {
@@ -24189,11 +24343,12 @@ function PayoutDetailsDropinComponent({
24189
24343
  };
24190
24344
  const isDocumentsRequired2 = (forms2) => forms2.some((form) => form.formId === payoutDetailsSteps.payoutAccountDocuments.formId);
24191
24345
  const formatFileSummaryData2 = (documents22) => {
24192
- var _a2, _b2;
24346
+ var _a2;
24347
+ const bankStatementDocument2 = (_a2 = documents22 == null ? void 0 : documents22.bankStatementDocument) == null ? void 0 : _a2[0];
24193
24348
  return {
24194
- ...(documents22 == null ? void 0 : documents22.bankStatementDocument) && {
24349
+ ...bankStatementDocument2 && {
24195
24350
  bankStatementDocument: {
24196
- fileName: (_b2 = (_a2 = documents22.bankStatementDocument) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.name
24351
+ fileName: bankStatementDocument2.name
24197
24352
  }
24198
24353
  }
24199
24354
  };
@@ -24231,6 +24386,7 @@ function PayoutDetailsDropinComponent({
24231
24386
  baseTrackingPayload,
24232
24387
  forms,
24233
24388
  submitButtonLabel,
24389
+ externalBackClick,
24234
24390
  onSubmit,
24235
24391
  skipSubmit,
24236
24392
  onSkipSubmit: navigateBackToTaskList
@@ -25265,7 +25421,7 @@ const serviceAgreementValidationRules = {
25265
25421
  errorMessage: "fieldIsRequired"
25266
25422
  }
25267
25423
  };
25268
- const logger$7 = createLogger("useServiceAgreement");
25424
+ const logger$6 = createLogger("useServiceAgreement");
25269
25425
  const FALLBACK_LANGUAGE_CODE = "en";
25270
25426
  const useServiceAgreement = ({
25271
25427
  handleGetServiceAgreement,
@@ -25294,7 +25450,7 @@ const useServiceAgreement = ({
25294
25450
  language: agreementLanguage
25295
25451
  });
25296
25452
  if (!document2) {
25297
- logger$7.log('"document" field was missing in response');
25453
+ logger$6.log('"document" field was missing in response');
25298
25454
  return;
25299
25455
  }
25300
25456
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -25312,7 +25468,7 @@ const useServiceAgreement = ({
25312
25468
  throw err;
25313
25469
  }
25314
25470
  };
25315
- requestServiceAgreement().catch(logger$7.error);
25471
+ requestServiceAgreement().catch(logger$6.error);
25316
25472
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
25317
25473
  return {
25318
25474
  loading: loading2,
@@ -26394,11 +26550,12 @@ function SolePropDropinComponent({
26394
26550
  return summaryData;
26395
26551
  };
26396
26552
  const formatFileSummaryData2 = (solePropConstitutionalDocument) => {
26397
- var _a2, _b;
26553
+ var _a2;
26554
+ const constitutionalDocument2 = (_a2 = solePropConstitutionalDocument == null ? void 0 : solePropConstitutionalDocument.constitutionalDocument) == null ? void 0 : _a2[0];
26398
26555
  return {
26399
- ...(solePropConstitutionalDocument == null ? void 0 : solePropConstitutionalDocument.constitutionalDocument) && {
26556
+ ...constitutionalDocument2 && {
26400
26557
  solePropConstitutionalDocument: {
26401
- fileName: (_b = (_a2 = solePropConstitutionalDocument.constitutionalDocument) == null ? void 0 : _a2[0]) == null ? void 0 : _b.name
26558
+ fileName: constitutionalDocument2.name
26402
26559
  }
26403
26560
  }
26404
26561
  };
@@ -26608,11 +26765,12 @@ function TrustDropinComponent(props) {
26608
26765
  return summaryData;
26609
26766
  };
26610
26767
  const formatFileSummaryData2 = (trustConstitutionalDocument) => {
26611
- var _a, _b;
26768
+ var _a;
26769
+ const constitutionalDocument2 = (_a = trustConstitutionalDocument == null ? void 0 : trustConstitutionalDocument.constitutionalDocument) == null ? void 0 : _a[0];
26612
26770
  return {
26613
- ...(trustConstitutionalDocument == null ? void 0 : trustConstitutionalDocument.constitutionalDocument) && {
26771
+ ...constitutionalDocument2 && {
26614
26772
  trustConstitutionalDocument: {
26615
- fileName: (_b = (_a = trustConstitutionalDocument.constitutionalDocument) == null ? void 0 : _a[0]) == null ? void 0 : _b.name
26773
+ fileName: constitutionalDocument2.name
26616
26774
  }
26617
26775
  }
26618
26776
  };
@@ -26648,7 +26806,7 @@ function TrustDropinComponent(props) {
26648
26806
  }
26649
26807
  const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
26650
26808
  const POLLING_INTERVAL = 3e3;
26651
- const logger$6 = createLogger("DropinComposerComponent");
26809
+ const logger$5 = createLogger("DropinComposerComponent");
26652
26810
  function DropinComposerComponent({
26653
26811
  capabilities,
26654
26812
  legalEntityResponse,
@@ -26725,7 +26883,7 @@ function DropinComposerComponent({
26725
26883
  setPciStatus(response);
26726
26884
  return response;
26727
26885
  } catch (e) {
26728
- logger$6.warn(i18n.get("failedToGetPciStatus"));
26886
+ logger$5.warn(i18n.get("failedToGetPciStatus"));
26729
26887
  }
26730
26888
  }
26731
26889
  return void 0;
@@ -26754,7 +26912,7 @@ function DropinComposerComponent({
26754
26912
  useEffect(() => {
26755
26913
  if (!tasks.includes(TaskTypes.PCI_DSS))
26756
26914
  return;
26757
- getPciTemplate().catch(logger$6.error);
26915
+ getPciTemplate().catch(logger$5.error);
26758
26916
  }, [getPciTemplate, tasks]);
26759
26917
  const getServiceAgreementAcceptanceInfos = async () => {
26760
26918
  if (legalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
@@ -26762,7 +26920,7 @@ function DropinComposerComponent({
26762
26920
  const response = await args.handleGetServiceAgreementAcceptanceInfos(legalEntity.id);
26763
26921
  setServiceAgreementAcceptanceInfos(response.data);
26764
26922
  } catch (e) {
26765
- logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
26923
+ logger$5.warn(i18n.get("failedToGetServiceAgreementStatus"));
26766
26924
  }
26767
26925
  }
26768
26926
  };
@@ -26772,7 +26930,7 @@ function DropinComposerComponent({
26772
26930
  const response = await args.handleGetServiceAgreementStatus(legalEntity.id);
26773
26931
  setServiceAgreementTypes(response.termsOfServiceTypes);
26774
26932
  } catch (e) {
26775
- logger$6.warn(i18n.get("failedToGetServiceAgreementStatus"));
26933
+ logger$5.warn(i18n.get("failedToGetServiceAgreementStatus"));
26776
26934
  }
26777
26935
  }
26778
26936
  };
@@ -26811,7 +26969,7 @@ function DropinComposerComponent({
26811
26969
  setCapabilityProblems(getCapabilityProblems(response));
26812
26970
  return response;
26813
26971
  } catch (e) {
26814
- logger$6.warn(i18n.get("failedToFetchLegalEntityDetails"));
26972
+ logger$5.warn(i18n.get("failedToFetchLegalEntityDetails"));
26815
26973
  }
26816
26974
  }
26817
26975
  return void 0;
@@ -26823,7 +26981,7 @@ function DropinComposerComponent({
26823
26981
  setTrust(response);
26824
26982
  return response;
26825
26983
  } catch (e) {
26826
- logger$6.warn(i18n.get("failedToFetchTrustDetails"));
26984
+ logger$5.warn(i18n.get("failedToFetchTrustDetails"));
26827
26985
  }
26828
26986
  }
26829
26987
  return void 0;
@@ -26873,7 +27031,7 @@ function DropinComposerComponent({
26873
27031
  label: i18n.get("successFullyRemovedTrustMember")
26874
27032
  });
26875
27033
  } catch (err) {
26876
- logger$6.error(`Failed to delete trust member`, err);
27034
+ logger$5.error(`Failed to delete trust member`, err);
26877
27035
  showToast({
26878
27036
  type: ToastType.ERROR,
26879
27037
  label: i18n.get("failedToRemoveTrustMember")
@@ -26925,7 +27083,7 @@ function DropinComposerComponent({
26925
27083
  break;
26926
27084
  case "rootTrustee":
26927
27085
  default:
26928
- logger$6.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
27086
+ logger$5.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
26929
27087
  }
26930
27088
  showToast({
26931
27089
  label: i18n.get("successfullyUpdatedDetails"),
@@ -26933,7 +27091,7 @@ function DropinComposerComponent({
26933
27091
  });
26934
27092
  await refreshTrustAndRunOnSubmit(trust, 1);
26935
27093
  } catch (err) {
26936
- logger$6.error(err);
27094
+ logger$5.error(err);
26937
27095
  showToast({
26938
27096
  label: i18n.get("failedToUpdateDetails"),
26939
27097
  type: ToastType.ERROR
@@ -27156,7 +27314,7 @@ function DropinComposerComponent({
27156
27314
  }
27157
27315
  };
27158
27316
  setIsLoadingConfiguration(true);
27159
- fetchConfiguration().catch(logger$6.error).finally(() => {
27317
+ fetchConfiguration().catch(logger$5.error).finally(() => {
27160
27318
  setIsLoadingConfiguration(false);
27161
27319
  onLoad();
27162
27320
  });
@@ -27512,7 +27670,6 @@ function DropinComposerComponent({
27512
27670
  const createDocument = async (context, document2, ownerId) => {
27513
27671
  const {
27514
27672
  loadingContext,
27515
- sdkToken,
27516
27673
  legalEntityId
27517
27674
  } = context;
27518
27675
  return httpPost({
@@ -27520,7 +27677,7 @@ const createDocument = async (context, document2, ownerId) => {
27520
27677
  errorLevel: "warn",
27521
27678
  errorMessage: `Failed to create document`,
27522
27679
  path: `${legalEntityId}/documents/${ownerId}`,
27523
- sdkToken,
27680
+ authentication: "jwt",
27524
27681
  headers: {
27525
27682
  "Content-Type": "application/json"
27526
27683
  }
@@ -27529,7 +27686,6 @@ const createDocument = async (context, document2, ownerId) => {
27529
27686
  const createTransferInstrument = async (context, transferInstrument) => {
27530
27687
  const {
27531
27688
  loadingContext,
27532
- sdkToken,
27533
27689
  legalEntityId
27534
27690
  } = context;
27535
27691
  return httpPost({
@@ -27537,7 +27693,7 @@ const createTransferInstrument = async (context, transferInstrument) => {
27537
27693
  errorLevel: "warn",
27538
27694
  errorMessage: `Failed to create transferInstrument`,
27539
27695
  path: `${legalEntityId}/transferInstruments`,
27540
- sdkToken,
27696
+ authentication: "jwt",
27541
27697
  headers: {
27542
27698
  "Content-Type": "application/json"
27543
27699
  }
@@ -27546,7 +27702,6 @@ const createTransferInstrument = async (context, transferInstrument) => {
27546
27702
  const getBankVerificationVendor = async (context, country2) => {
27547
27703
  const {
27548
27704
  loadingContext,
27549
- sdkToken,
27550
27705
  legalEntityId
27551
27706
  } = context;
27552
27707
  return httpGet({
@@ -27554,7 +27709,7 @@ const getBankVerificationVendor = async (context, country2) => {
27554
27709
  errorLevel: "warn",
27555
27710
  errorMessage: `Bank verification vendor not available`,
27556
27711
  path: `${legalEntityId}/transferInstruments/trusted/providers?country=${country2}`,
27557
- sdkToken,
27712
+ authentication: "jwt",
27558
27713
  headers: {
27559
27714
  "Content-Type": "application/json"
27560
27715
  }
@@ -27562,8 +27717,7 @@ const getBankVerificationVendor = async (context, country2) => {
27562
27717
  };
27563
27718
  const getDataset$1 = async (context, name, locale) => {
27564
27719
  const {
27565
- loadingContext,
27566
- sdkToken
27720
+ loadingContext
27567
27721
  } = context;
27568
27722
  const datasetUtils = datasetUtilities(locale);
27569
27723
  const dataset = datasetUtils.getDataset(name);
@@ -27578,7 +27732,7 @@ const getDataset$1 = async (context, name, locale) => {
27578
27732
  errorLevel: "warn",
27579
27733
  errorMessage: `Dataset ${name} is not available`,
27580
27734
  path,
27581
- sdkToken,
27735
+ authentication: "jwt",
27582
27736
  headers: {
27583
27737
  "Content-Type": "application/json"
27584
27738
  }
@@ -27590,7 +27744,6 @@ const getDataset$1 = async (context, name, locale) => {
27590
27744
  const getDocument = async (context, documentId) => {
27591
27745
  const {
27592
27746
  loadingContext,
27593
- sdkToken,
27594
27747
  legalEntityId
27595
27748
  } = context;
27596
27749
  return httpGet({
@@ -27598,7 +27751,7 @@ const getDocument = async (context, documentId) => {
27598
27751
  errorLevel: "warn",
27599
27752
  errorMessage: `Failed to fetch document`,
27600
27753
  path: `${legalEntityId}/documents/${documentId}`,
27601
- sdkToken,
27754
+ authentication: "jwt",
27602
27755
  headers: {
27603
27756
  "Content-Type": "application/json"
27604
27757
  }
@@ -27607,7 +27760,6 @@ const getDocument = async (context, documentId) => {
27607
27760
  const getLegalEntity = async (context) => {
27608
27761
  const {
27609
27762
  loadingContext,
27610
- sdkToken,
27611
27763
  legalEntityId
27612
27764
  } = context;
27613
27765
  return httpGet({
@@ -27615,7 +27767,7 @@ const getLegalEntity = async (context) => {
27615
27767
  errorLevel: "warn",
27616
27768
  errorMessage: `LegalEntity not available`,
27617
27769
  path: `${legalEntityId}`,
27618
- sdkToken,
27770
+ authentication: "jwt",
27619
27771
  headers: {
27620
27772
  "Content-Type": "application/json"
27621
27773
  }
@@ -27624,7 +27776,6 @@ const getLegalEntity = async (context) => {
27624
27776
  const getScenarios = async (context) => {
27625
27777
  const {
27626
27778
  loadingContext,
27627
- sdkToken,
27628
27779
  legalEntityId
27629
27780
  } = context;
27630
27781
  return httpGet({
@@ -27632,7 +27783,7 @@ const getScenarios = async (context) => {
27632
27783
  errorLevel: "warn",
27633
27784
  errorMessage: `Scenarios not available`,
27634
27785
  path: `${legalEntityId}/configurations/scenarios`,
27635
- sdkToken,
27786
+ authentication: "jwt",
27636
27787
  headers: {
27637
27788
  "Content-Type": "application/json"
27638
27789
  }
@@ -27641,7 +27792,6 @@ const getScenarios = async (context) => {
27641
27792
  const getTasks = async (context) => {
27642
27793
  const {
27643
27794
  loadingContext,
27644
- sdkToken,
27645
27795
  legalEntityId
27646
27796
  } = context;
27647
27797
  return httpGet({
@@ -27649,7 +27799,7 @@ const getTasks = async (context) => {
27649
27799
  errorLevel: "warn",
27650
27800
  errorMessage: `Tasks not available`,
27651
27801
  path: `${legalEntityId}/configurations/tasks`,
27652
- sdkToken,
27802
+ authentication: "jwt",
27653
27803
  headers: {
27654
27804
  "Content-Type": "application/json"
27655
27805
  }
@@ -27658,7 +27808,6 @@ const getTasks = async (context) => {
27658
27808
  const getTransferInstrument = async (context, transferInstrumentId) => {
27659
27809
  const {
27660
27810
  loadingContext,
27661
- sdkToken,
27662
27811
  legalEntityId
27663
27812
  } = context;
27664
27813
  return httpGet({
@@ -27666,9 +27815,8 @@ const getTransferInstrument = async (context, transferInstrumentId) => {
27666
27815
  errorLevel: "warn",
27667
27816
  errorMessage: `TransferInstrument not available`,
27668
27817
  path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
27818
+ authentication: "jwt",
27669
27819
  headers: {
27670
- Authorization: `Bearer ${sdkToken}`,
27671
- Origin: window.location.origin,
27672
27820
  "Content-Type": "application/json"
27673
27821
  }
27674
27822
  });
@@ -27676,7 +27824,6 @@ const getTransferInstrument = async (context, transferInstrumentId) => {
27676
27824
  const updateDocument = async (context, document2, documentId, ownerId) => {
27677
27825
  const {
27678
27826
  loadingContext,
27679
- sdkToken,
27680
27827
  legalEntityId
27681
27828
  } = context;
27682
27829
  return httpPost({
@@ -27684,7 +27831,7 @@ const updateDocument = async (context, document2, documentId, ownerId) => {
27684
27831
  errorLevel: "warn",
27685
27832
  errorMessage: `Failed to update document`,
27686
27833
  path: `${legalEntityId}/documents/${documentId}/${ownerId}`,
27687
- sdkToken,
27834
+ authentication: "jwt",
27688
27835
  headers: {
27689
27836
  "Content-Type": "application/json"
27690
27837
  }
@@ -27693,7 +27840,6 @@ const updateDocument = async (context, document2, documentId, ownerId) => {
27693
27840
  const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
27694
27841
  const {
27695
27842
  loadingContext,
27696
- sdkToken,
27697
27843
  legalEntityId
27698
27844
  } = context;
27699
27845
  return httpPost({
@@ -27701,7 +27847,7 @@ const updateTransferInstrument = async (context, transferInstrument, transferIns
27701
27847
  errorLevel: "warn",
27702
27848
  errorMessage: `Failed to update transferInstrument`,
27703
27849
  path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
27704
- sdkToken,
27850
+ authentication: "jwt",
27705
27851
  headers: {
27706
27852
  "Content-Type": "application/json"
27707
27853
  }
@@ -27710,7 +27856,6 @@ const updateTransferInstrument = async (context, transferInstrument, transferIns
27710
27856
  const createTrustedTransferInstrument = async (context, code2, state2) => {
27711
27857
  const {
27712
27858
  loadingContext,
27713
- sdkToken,
27714
27859
  legalEntityId
27715
27860
  } = context;
27716
27861
  const path = `${legalEntityId}/transferInstruments/trusted`;
@@ -27719,7 +27864,7 @@ const createTrustedTransferInstrument = async (context, code2, state2) => {
27719
27864
  errorLevel: "warn",
27720
27865
  errorMessage: `Failed to create trusted transferInstrument`,
27721
27866
  path,
27722
- sdkToken,
27867
+ authentication: "jwt",
27723
27868
  headers: {
27724
27869
  "Content-Type": "application/json"
27725
27870
  }
@@ -27731,7 +27876,6 @@ const createTrustedTransferInstrument = async (context, code2, state2) => {
27731
27876
  const handleBankVerificationError = async (context, errorCode, errorMessage, state2, metadata) => {
27732
27877
  const {
27733
27878
  loadingContext,
27734
- sdkToken,
27735
27879
  legalEntityId
27736
27880
  } = context;
27737
27881
  const path = `${legalEntityId}/transferInstruments/trusted/error`;
@@ -27740,7 +27884,7 @@ const handleBankVerificationError = async (context, errorCode, errorMessage, sta
27740
27884
  errorLevel: "warn",
27741
27885
  errorMessage: `Failed to create trusted transferInstrument`,
27742
27886
  path,
27743
- sdkToken,
27887
+ authentication: "jwt",
27744
27888
  headers: {
27745
27889
  "Content-Type": "application/json"
27746
27890
  }
@@ -27758,7 +27902,6 @@ const useComponentApi = (rootLegalEntityId) => {
27758
27902
  throw new Error("Cannot use component API outside an embedded dropin");
27759
27903
  }
27760
27904
  const {
27761
- sdkToken,
27762
27905
  loadingContext: base
27763
27906
  } = authContext;
27764
27907
  return useMemo(() => {
@@ -27766,8 +27909,7 @@ const useComponentApi = (rootLegalEntityId) => {
27766
27909
  const loadingContextWithRootLEAuth = `${loadingContext}legalEntities/`;
27767
27910
  const baseRequestContext = {
27768
27911
  loadingContext: loadingContextWithRootLEAuth,
27769
- legalEntityId: rootLegalEntityId,
27770
- sdkToken
27912
+ legalEntityId: rootLegalEntityId
27771
27913
  };
27772
27914
  return {
27773
27915
  getLegalEntity: async (legalEntityId) => getLegalEntity({
@@ -27784,7 +27926,7 @@ const useComponentApi = (rootLegalEntityId) => {
27784
27926
  createTrustedTransferInstrument: async (code2, state2) => createTrustedTransferInstrument(baseRequestContext, code2, state2),
27785
27927
  handleBankVerificationError: async (errorCode, errorMessage, state2, metadata) => handleBankVerificationError(baseRequestContext, errorCode, errorMessage, state2, metadata)
27786
27928
  };
27787
- }, [base, rootLegalEntityId, sdkToken]);
27929
+ }, [base, rootLegalEntityId]);
27788
27930
  };
27789
27931
  class EventEmitter {
27790
27932
  constructor() {
@@ -27805,12 +27947,13 @@ class EventEmitter {
27805
27947
  };
27806
27948
  }
27807
27949
  }
27808
- const logger$5 = createLogger("TransferInstrumentComponent");
27950
+ const logger$4 = createLogger("TransferInstrumentComponent");
27809
27951
  function TransferInstrumentComponent({
27810
27952
  legalEntityId,
27811
27953
  transferInstrumentId,
27812
27954
  onChange,
27813
27955
  onSubmit,
27956
+ handleBackClick,
27814
27957
  eventEmitter
27815
27958
  }) {
27816
27959
  const {
@@ -27839,8 +27982,8 @@ function TransferInstrumentComponent({
27839
27982
  const ti = await getTransferInstrument2(transferInstrumentId);
27840
27983
  setTransferInstrument(ti);
27841
27984
  }
27842
- })().catch(logger$5.error);
27843
- }, [transferInstrumentId]);
27985
+ })().catch(logger$4.error);
27986
+ }, [transferInstrumentId, fetchLegalEntity]);
27844
27987
  return legalEntity ? jsx(PayoutDetailsDropinComponent, {
27845
27988
  eventEmitter: eventEmitter ?? new EventEmitter(),
27846
27989
  transferInstrument,
@@ -27852,6 +27995,7 @@ function TransferInstrumentComponent({
27852
27995
  handleUpdateDocument: updateDocument2,
27853
27996
  handleCreateTransferInstrument: createTransferInstrument2,
27854
27997
  handleUpdateTransferInstrument: updateTransferInstrument2,
27998
+ handleBackClick,
27855
27999
  hideNavigation: true,
27856
28000
  refreshLegalEntity: fetchLegalEntity,
27857
28001
  onChange,
@@ -27871,85 +28015,17 @@ const componentsMap = {
27871
28015
  pci: PciDropinComponent,
27872
28016
  transferInstrumentComponent: TransferInstrumentComponent
27873
28017
  };
27874
- const refreshSdkToken = async (context, refreshToken) => {
27875
- const {
27876
- loadingContext,
27877
- sdkToken
27878
- } = context;
27879
- return httpPost({
27880
- loadingContext,
27881
- errorLevel: "warn",
27882
- errorMessage: `Failed to refresh token`,
27883
- path: `sessions/refresh`,
27884
- sdkToken,
27885
- headers: {
27886
- "Content-Type": "application/json"
27887
- }
27888
- }, {
27889
- refreshToken
27890
- });
27891
- };
27892
- const SDK_TOKEN_TTL = 6e4;
27893
- const REFRESH_INTERVAL = SDK_TOKEN_TTL - 5e3;
27894
- const RETRY_LIMIT = 2;
27895
- const logger$4 = createLogger("useSdkToken");
27896
- const useSdkToken = ({
27897
- initialSdkToken,
27898
- refreshToken,
27899
- autheBase
27900
- }) => {
27901
- const [sdkToken, setSdkToken] = useState(initialSdkToken);
27902
- const doRefresh = async (sdkToken2, refreshToken2, retries) => {
27903
- try {
27904
- const {
27905
- token: newSdkToken
27906
- } = await refreshSdkToken({
27907
- loadingContext: autheBase,
27908
- sdkToken: sdkToken2
27909
- }, refreshToken2);
27910
- setSdkToken(newSdkToken);
27911
- } catch (e) {
27912
- if (!retries) {
27913
- throw new Error("Unable to refresh token after retries", e);
27914
- }
27915
- logger$4.warn("Failed to refresh token. Retrying..", e);
27916
- await doRefresh(sdkToken2, refreshToken2, retries - 1);
27917
- }
27918
- };
27919
- useEffect(() => {
27920
- if (!sdkToken || !refreshToken) {
27921
- return;
27922
- }
27923
- const refreshHandler = setInterval(() => {
27924
- doRefresh(sdkToken, refreshToken, RETRY_LIMIT).catch(() => {
27925
- clearInterval(refreshHandler);
27926
- });
27927
- }, REFRESH_INTERVAL);
27928
- return () => {
27929
- clearInterval(refreshHandler);
27930
- };
27931
- }, [sdkToken]);
27932
- return sdkToken;
27933
- };
27934
- const AUTHE_API_VERSION = "v1";
27935
28018
  const AuthProvider = ({
27936
28019
  children,
27937
- sdkToken: initialSdkToken,
27938
- refreshToken,
28020
+ sdkToken: sdkToken2,
28021
+ getSdkToken: getSdkToken2,
27939
28022
  clientKey,
27940
28023
  loadingContext
27941
28024
  }) => {
27942
- const autheBase = `${loadingContext}authe/api/${AUTHE_API_VERSION}/`;
27943
- const sdkToken = useSdkToken({
27944
- initialSdkToken,
27945
- refreshToken,
27946
- autheBase
27947
- });
27948
28025
  const contextValue = useMemo(() => {
27949
- if (sdkToken && refreshToken) {
28026
+ if (sdkToken2 && getSdkToken2) {
27950
28027
  return {
27951
28028
  isEmbeddedDropin: true,
27952
- sdkToken,
27953
28029
  loadingContext: `${loadingContext}onboardingcomponents/`
27954
28030
  };
27955
28031
  }
@@ -27960,14 +28036,14 @@ const AuthProvider = ({
27960
28036
  loadingContext
27961
28037
  };
27962
28038
  }
27963
- throw new Error("Must provide either `sdkToken` and `refreshToken` or `clientKey`");
27964
- }, [sdkToken, clientKey]);
28039
+ throw new Error("Must provide either `sdkToken` and `getSdkToken` or `clientKey`");
28040
+ }, [sdkToken2, clientKey]);
27965
28041
  return jsx(AuthContext.Provider, {
27966
28042
  value: contextValue,
27967
28043
  children
27968
28044
  });
27969
28045
  };
27970
- const accountFormatsImports = /* @__PURE__ */ Object.assign({ "./AD.json": () => import("./AD-43128b9f.mjs"), "./AE.json": () => import("./AE-81598d61.mjs"), "./AG.json": () => import("./AG-ed98ae0e.mjs"), "./AI.json": () => import("./AI-3e78c886.mjs"), "./AL.json": () => import("./AL-3ad2778a.mjs"), "./AM.json": () => import("./AM-6a5175fb.mjs"), "./AN.json": () => import("./AN-311f7139.mjs"), "./AO.json": () => import("./AO-99b5ef59.mjs"), "./AQ.json": () => import("./AQ-effe27c7.mjs"), "./AR.json": () => import("./AR-4013d95c.mjs"), "./AS.json": () => import("./AS-f15d56b2.mjs"), "./AT.json": () => import("./AT-d4d62b74.mjs"), "./AU.json": () => import("./AU-b9cba969.mjs"), "./AW.json": () => import("./AW-581f73fb.mjs"), "./AX.json": () => import("./AX-07af957a.mjs"), "./AZ.json": () => import("./AZ-be214142.mjs"), "./BA.json": () => import("./BA-af4be83f.mjs"), "./BB.json": () => import("./BB-df28f015.mjs"), "./BD.json": () => import("./BD-7aef0af6.mjs"), "./BE.json": () => import("./BE-fc7cf8d5.mjs"), "./BF.json": () => import("./BF-090b06e2.mjs"), "./BG.json": () => import("./BG-1f54cf4f.mjs"), "./BH.json": () => import("./BH-1e9cc2b9.mjs"), "./BJ.json": () => import("./BJ-d5dd5c6f.mjs"), "./BM.json": () => import("./BM-a808b13f.mjs"), "./BN.json": () => import("./BN-b13f6f6a.mjs"), "./BR.json": () => import("./BR-55d93100.mjs"), "./BS.json": () => import("./BS-db6a5bce.mjs"), "./BT.json": () => import("./BT-dfed2604.mjs"), "./BV.json": () => import("./BV-e123b0a8.mjs"), "./BW.json": () => import("./BW-08473bd7.mjs"), "./BY.json": () => import("./BY-2762d989.mjs"), "./BZ.json": () => import("./BZ-7f28b1ff.mjs"), "./CA.json": () => import("./CA-aa1f78ab.mjs"), "./CC.json": () => import("./CC-2cc6ac39.mjs"), "./CF.json": () => import("./CF-78ae0244.mjs"), "./CH.json": () => import("./CH-47f538c0.mjs"), "./CI.json": () => import("./CI-10feb889.mjs"), "./CK.json": () => import("./CK-e308c734.mjs"), "./CL.json": () => import("./CL-4a6c3e0b.mjs"), "./CM.json": () => import("./CM-fddc630d.mjs"), "./CN.json": () => import("./CN-46bb9203.mjs"), "./CO.json": () => import("./CO-1b150cda.mjs"), "./CR.json": () => import("./CR-2bf50f66.mjs"), "./CU.json": () => import("./CU-904aea8f.mjs"), "./CX.json": () => import("./CX-750ccd92.mjs"), "./CY.json": () => import("./CY-1508b23e.mjs"), "./CZ.json": () => import("./CZ-b6eaa1d5.mjs"), "./DE.json": () => import("./DE-e02051d4.mjs"), "./DJ.json": () => import("./DJ-0032728a.mjs"), "./DK.json": () => import("./DK-6116657e.mjs"), "./DM.json": () => import("./DM-a2c158c9.mjs"), "./DO.json": () => import("./DO-cedffa27.mjs"), "./DZ.json": () => import("./DZ-d44be6f8.mjs"), "./EC.json": () => import("./EC-c2e5813b.mjs"), "./EE.json": () => import("./EE-1a10f52d.mjs"), "./EG.json": () => import("./EG-8f29aebd.mjs"), "./EH.json": () => import("./EH-2dafda3e.mjs"), "./ES.json": () => import("./ES-42b3562e.mjs"), "./ET.json": () => import("./ET-ffa87ef0.mjs"), "./FI.json": () => import("./FI-8e3bb2bb.mjs"), "./FJ.json": () => import("./FJ-088ea689.mjs"), "./FK.json": () => import("./FK-16d84ff5.mjs"), "./FM.json": () => import("./FM-32616e6f.mjs"), "./FO.json": () => import("./FO-62c08e45.mjs"), "./FR.json": () => import("./FR-3db03e20.mjs"), "./GA.json": () => import("./GA-4de2f994.mjs"), "./GB.json": () => import("./GB-28ea0b5a.mjs"), "./GD.json": () => import("./GD-0ad67069.mjs"), "./GE.json": () => import("./GE-0f594b35.mjs"), "./GF.json": () => import("./GF-a062cea7.mjs"), "./GG.json": () => import("./GG-e00581ea.mjs"), "./GH.json": () => import("./GH-80209e7e.mjs"), "./GI.json": () => import("./GI-b0f7c8b3.mjs"), "./GL.json": () => import("./GL-8f5e8ba9.mjs"), "./GM.json": () => import("./GM-ff3ca013.mjs"), "./GN.json": () => import("./GN-fc7c0f8c.mjs"), "./GP.json": () => import("./GP-68f23382.mjs"), "./GQ.json": () => import("./GQ-f9867fbd.mjs"), "./GR.json": () => import("./GR-64a2d25c.mjs"), "./GS.json": () => import("./GS-49ce0f4c.mjs"), "./GT.json": () => import("./GT-fa779b14.mjs"), "./GU.json": () => import("./GU-f0dceb37.mjs"), "./GW.json": () => import("./GW-471336ea.mjs"), "./GY.json": () => import("./GY-2889ae39.mjs"), "./HK.json": () => import("./HK-0561cac3.mjs"), "./HM.json": () => import("./HM-924a724f.mjs"), "./HN.json": () => import("./HN-6dae206e.mjs"), "./HR.json": () => import("./HR-85763090.mjs"), "./HT.json": () => import("./HT-a659da85.mjs"), "./HU.json": () => import("./HU-f9ea5037.mjs"), "./ID.json": () => import("./ID-cb5cfce1.mjs"), "./IE.json": () => import("./IE-b341cbd2.mjs"), "./IL.json": () => import("./IL-657901df.mjs"), "./IM.json": () => import("./IM-5bd6279a.mjs"), "./IN.json": () => import("./IN-3c11df0e.mjs"), "./IO.json": () => import("./IO-24f6d2e7.mjs"), "./IQ.json": () => import("./IQ-241c0148.mjs"), "./IS.json": () => import("./IS-4a7e436f.mjs"), "./IT.json": () => import("./IT-f9755e76.mjs"), "./JE.json": () => import("./JE-46968fa2.mjs"), "./JM.json": () => import("./JM-a6657a34.mjs"), "./JO.json": () => import("./JO-bd1eabea.mjs"), "./JP.json": () => import("./JP-9b5a30fa.mjs"), "./KE.json": () => import("./KE-2a866579.mjs"), "./KG.json": () => import("./KG-7713761d.mjs"), "./KH.json": () => import("./KH-a5f0f831.mjs"), "./KI.json": () => import("./KI-8376e298.mjs"), "./KM.json": () => import("./KM-48c8c9c0.mjs"), "./KN.json": () => import("./KN-b34777c7.mjs"), "./KR.json": () => import("./KR-8bcf8499.mjs"), "./KW.json": () => import("./KW-4dd6ab01.mjs"), "./KY.json": () => import("./KY-4f921c93.mjs"), "./KZ.json": () => import("./KZ-68b655f3.mjs"), "./LA.json": () => import("./LA-582a34e2.mjs"), "./LB.json": () => import("./LB-7e5023a3.mjs"), "./LC.json": () => import("./LC-4e610f91.mjs"), "./LI.json": () => import("./LI-3979434e.mjs"), "./LK.json": () => import("./LK-23f5002d.mjs"), "./LT.json": () => import("./LT-2076ca77.mjs"), "./LU.json": () => import("./LU-b0538582.mjs"), "./LV.json": () => import("./LV-440617df.mjs"), "./MA.json": () => import("./MA-f2af9aa6.mjs"), "./MC.json": () => import("./MC-f619d821.mjs"), "./MD.json": () => import("./MD-ffe4e2f4.mjs"), "./ME.json": () => import("./ME-46686aa8.mjs"), "./MH.json": () => import("./MH-c535387d.mjs"), "./MK.json": () => import("./MK-11442cf1.mjs"), "./ML.json": () => import("./ML-b2c3720e.mjs"), "./MM.json": () => import("./MM-0ae1a124.mjs"), "./MN.json": () => import("./MN-baba0d9d.mjs"), "./MO.json": () => import("./MO-2c51f9f7.mjs"), "./MP.json": () => import("./MP-55044c4b.mjs"), "./MQ.json": () => import("./MQ-aaefd2b2.mjs"), "./MR.json": () => import("./MR-f122a6f0.mjs"), "./MS.json": () => import("./MS-7623ec5f.mjs"), "./MT.json": () => import("./MT-315c76bb.mjs"), "./MU.json": () => import("./MU-126673fe.mjs"), "./MV.json": () => import("./MV-d8748aca.mjs"), "./MW.json": () => import("./MW-26492427.mjs"), "./MX.json": () => import("./MX-ca79b44b.mjs"), "./MY.json": () => import("./MY-443e729e.mjs"), "./MZ.json": () => import("./MZ-192a5094.mjs"), "./NC.json": () => import("./NC-3849aac0.mjs"), "./NE.json": () => import("./NE-bf76bc84.mjs"), "./NF.json": () => import("./NF-46f5dffa.mjs"), "./NG.json": () => import("./NG-458396e5.mjs"), "./NI.json": () => import("./NI-efe8c864.mjs"), "./NL.json": () => import("./NL-3e38d0eb.mjs"), "./NO.json": () => import("./NO-088fac56.mjs"), "./NP.json": () => import("./NP-26b20587.mjs"), "./NR.json": () => import("./NR-ba1f7da1.mjs"), "./NU.json": () => import("./NU-6dc3ed45.mjs"), "./NZ.json": () => import("./NZ-12ed2cb9.mjs"), "./OM.json": () => import("./OM-4976855b.mjs"), "./PA.json": () => import("./PA-3b45122a.mjs"), "./PE.json": () => import("./PE-ad6e8281.mjs"), "./PF.json": () => import("./PF-2b1b6f30.mjs"), "./PG.json": () => import("./PG-b94ea47f.mjs"), "./PH.json": () => import("./PH-1b96a1eb.mjs"), "./PK.json": () => import("./PK-35cadd30.mjs"), "./PL.json": () => import("./PL-6a490cd1.mjs"), "./PM.json": () => import("./PM-d508f3c5.mjs"), "./PN.json": () => import("./PN-1f6ccf43.mjs"), "./PR.json": () => import("./PR-730f2830.mjs"), "./PS.json": () => import("./PS-f3ef78cd.mjs"), "./PT.json": () => import("./PT-66954cea.mjs"), "./PW.json": () => import("./PW-0d1c7797.mjs"), "./PY.json": () => import("./PY-c8e58794.mjs"), "./QA.json": () => import("./QA-35be8b1e.mjs"), "./RE.json": () => import("./RE-9f92ed9b.mjs"), "./RO.json": () => import("./RO-5c62edb1.mjs"), "./RS.json": () => import("./RS-bc256d90.mjs"), "./RU.json": () => import("./RU-bbee5e73.mjs"), "./RW.json": () => import("./RW-95b5d859.mjs"), "./SA.json": () => import("./SA-69b2f72a.mjs"), "./SB.json": () => import("./SB-567c239a.mjs"), "./SC.json": () => import("./SC-9e5a0d31.mjs"), "./SE.json": () => import("./SE-4ed53265.mjs"), "./SG.json": () => import("./SG-970463e3.mjs"), "./SH.json": () => import("./SH-d8ab21b7.mjs"), "./SI.json": () => import("./SI-3b6d3545.mjs"), "./SJ.json": () => import("./SJ-e3430cfd.mjs"), "./SK.json": () => import("./SK-2385e057.mjs"), "./SL.json": () => import("./SL-92bf45d9.mjs"), "./SM.json": () => import("./SM-bafbc267.mjs"), "./SN.json": () => import("./SN-5733e740.mjs"), "./SO.json": () => import("./SO-d5b69054.mjs"), "./SR.json": () => import("./SR-0a8c71c0.mjs"), "./ST.json": () => import("./ST-d40d86c1.mjs"), "./TC.json": () => import("./TC-ccbc7116.mjs"), "./TD.json": () => import("./TD-679d137c.mjs"), "./TF.json": () => import("./TF-6bfcf75d.mjs"), "./TG.json": () => import("./TG-a20ef9ed.mjs"), "./TH.json": () => import("./TH-e39a447c.mjs"), "./TK.json": () => import("./TK-89a81d38.mjs"), "./TL.json": () => import("./TL-8d6ca9b7.mjs"), "./TN.json": () => import("./TN-6e746476.mjs"), "./TO.json": () => import("./TO-a8c55d73.mjs"), "./TR.json": () => import("./TR-b1175ddc.mjs"), "./TT.json": () => import("./TT-5c4a3940.mjs"), "./TV.json": () => import("./TV-e1a267b9.mjs"), "./TW.json": () => import("./TW-9e0e34fa.mjs"), "./TZ.json": () => import("./TZ-c8a8159b.mjs"), "./UA.json": () => import("./UA-7014199a.mjs"), "./UG.json": () => import("./UG-1fe39fa7.mjs"), "./UM.json": () => import("./UM-3fcbf872.mjs"), "./US.json": () => import("./US-6fbdfc0c.mjs"), "./UY.json": () => import("./UY-e6d05d75.mjs"), "./UZ.json": () => import("./UZ-433656c8.mjs"), "./VA.json": () => import("./VA-e8e13d32.mjs"), "./VC.json": () => import("./VC-331669c0.mjs"), "./VE.json": () => import("./VE-5e7b0d3b.mjs"), "./VG.json": () => import("./VG-43e85e33.mjs"), "./VI.json": () => import("./VI-3d9d6d8b.mjs"), "./VN.json": () => import("./VN-9442a8c1.mjs"), "./VU.json": () => import("./VU-96fae02f.mjs"), "./WF.json": () => import("./WF-90a27056.mjs"), "./WS.json": () => import("./WS-ddcb2b71.mjs"), "./YE.json": () => import("./YE-02c4c81e.mjs"), "./YT.json": () => import("./YT-33751cc9.mjs"), "./ZA.json": () => import("./ZA-0084b083.mjs"), "./ZM.json": () => import("./ZM-c6a4d6cc.mjs") });
28046
+ const accountFormatsImports = /* @__PURE__ */ Object.assign({ "./AD.json": () => import("./AD-43128b9f.mjs"), "./AE.json": () => import("./AE-81598d61.mjs"), "./AG.json": () => import("./AG-ed98ae0e.mjs"), "./AI.json": () => import("./AI-3e78c886.mjs"), "./AL.json": () => import("./AL-3ad2778a.mjs"), "./AM.json": () => import("./AM-6a5175fb.mjs"), "./AN.json": () => import("./AN-311f7139.mjs"), "./AO.json": () => import("./AO-99b5ef59.mjs"), "./AQ.json": () => import("./AQ-effe27c7.mjs"), "./AR.json": () => import("./AR-4013d95c.mjs"), "./AS.json": () => import("./AS-f15d56b2.mjs"), "./AT.json": () => import("./AT-d4d62b74.mjs"), "./AU.json": () => import("./AU-b9cba969.mjs"), "./AW.json": () => import("./AW-581f73fb.mjs"), "./AX.json": () => import("./AX-07af957a.mjs"), "./AZ.json": () => import("./AZ-be214142.mjs"), "./BA.json": () => import("./BA-af4be83f.mjs"), "./BB.json": () => import("./BB-df28f015.mjs"), "./BD.json": () => import("./BD-7aef0af6.mjs"), "./BE.json": () => import("./BE-fc7cf8d5.mjs"), "./BF.json": () => import("./BF-090b06e2.mjs"), "./BG.json": () => import("./BG-1f54cf4f.mjs"), "./BH.json": () => import("./BH-1e9cc2b9.mjs"), "./BJ.json": () => import("./BJ-d5dd5c6f.mjs"), "./BM.json": () => import("./BM-a808b13f.mjs"), "./BN.json": () => import("./BN-b13f6f6a.mjs"), "./BR.json": () => import("./BR-55d93100.mjs"), "./BS.json": () => import("./BS-db6a5bce.mjs"), "./BT.json": () => import("./BT-dfed2604.mjs"), "./BV.json": () => import("./BV-e123b0a8.mjs"), "./BW.json": () => import("./BW-08473bd7.mjs"), "./BY.json": () => import("./BY-2762d989.mjs"), "./BZ.json": () => import("./BZ-7f28b1ff.mjs"), "./CA.json": () => import("./CA-aa1f78ab.mjs"), "./CC.json": () => import("./CC-2cc6ac39.mjs"), "./CF.json": () => import("./CF-78ae0244.mjs"), "./CH.json": () => import("./CH-47f538c0.mjs"), "./CI.json": () => import("./CI-10feb889.mjs"), "./CK.json": () => import("./CK-e308c734.mjs"), "./CL.json": () => import("./CL-4a6c3e0b.mjs"), "./CM.json": () => import("./CM-fddc630d.mjs"), "./CN.json": () => import("./CN-46bb9203.mjs"), "./CO.json": () => import("./CO-1b150cda.mjs"), "./CR.json": () => import("./CR-2bf50f66.mjs"), "./CU.json": () => import("./CU-904aea8f.mjs"), "./CX.json": () => import("./CX-750ccd92.mjs"), "./CY.json": () => import("./CY-1508b23e.mjs"), "./CZ.json": () => import("./CZ-b6eaa1d5.mjs"), "./DE.json": () => import("./DE-e02051d4.mjs"), "./DJ.json": () => import("./DJ-0032728a.mjs"), "./DK.json": () => import("./DK-6116657e.mjs"), "./DM.json": () => import("./DM-a2c158c9.mjs"), "./DO.json": () => import("./DO-cedffa27.mjs"), "./DZ.json": () => import("./DZ-d44be6f8.mjs"), "./EC.json": () => import("./EC-c2e5813b.mjs"), "./EE.json": () => import("./EE-1a10f52d.mjs"), "./EG.json": () => import("./EG-8f29aebd.mjs"), "./EH.json": () => import("./EH-2dafda3e.mjs"), "./ES.json": () => import("./ES-42b3562e.mjs"), "./ET.json": () => import("./ET-ffa87ef0.mjs"), "./FI.json": () => import("./FI-8e3bb2bb.mjs"), "./FJ.json": () => import("./FJ-088ea689.mjs"), "./FK.json": () => import("./FK-16d84ff5.mjs"), "./FM.json": () => import("./FM-32616e6f.mjs"), "./FO.json": () => import("./FO-62c08e45.mjs"), "./FR.json": () => import("./FR-3db03e20.mjs"), "./GA.json": () => import("./GA-4de2f994.mjs"), "./GB.json": () => import("./GB-28ea0b5a.mjs"), "./GD.json": () => import("./GD-0ad67069.mjs"), "./GE.json": () => import("./GE-0f594b35.mjs"), "./GF.json": () => import("./GF-a062cea7.mjs"), "./GG.json": () => import("./GG-e00581ea.mjs"), "./GH.json": () => import("./GH-80209e7e.mjs"), "./GI.json": () => import("./GI-b0f7c8b3.mjs"), "./GL.json": () => import("./GL-8f5e8ba9.mjs"), "./GM.json": () => import("./GM-ff3ca013.mjs"), "./GN.json": () => import("./GN-fc7c0f8c.mjs"), "./GP.json": () => import("./GP-68f23382.mjs"), "./GQ.json": () => import("./GQ-f9867fbd.mjs"), "./GR.json": () => import("./GR-64a2d25c.mjs"), "./GS.json": () => import("./GS-49ce0f4c.mjs"), "./GT.json": () => import("./GT-fa779b14.mjs"), "./GU.json": () => import("./GU-f0dceb37.mjs"), "./GW.json": () => import("./GW-471336ea.mjs"), "./GY.json": () => import("./GY-2889ae39.mjs"), "./HK.json": () => import("./HK-675b8651.mjs"), "./HM.json": () => import("./HM-924a724f.mjs"), "./HN.json": () => import("./HN-6dae206e.mjs"), "./HR.json": () => import("./HR-85763090.mjs"), "./HT.json": () => import("./HT-a659da85.mjs"), "./HU.json": () => import("./HU-f9ea5037.mjs"), "./ID.json": () => import("./ID-cb5cfce1.mjs"), "./IE.json": () => import("./IE-b341cbd2.mjs"), "./IL.json": () => import("./IL-657901df.mjs"), "./IM.json": () => import("./IM-5bd6279a.mjs"), "./IN.json": () => import("./IN-3c11df0e.mjs"), "./IO.json": () => import("./IO-24f6d2e7.mjs"), "./IQ.json": () => import("./IQ-241c0148.mjs"), "./IS.json": () => import("./IS-4a7e436f.mjs"), "./IT.json": () => import("./IT-f9755e76.mjs"), "./JE.json": () => import("./JE-46968fa2.mjs"), "./JM.json": () => import("./JM-a6657a34.mjs"), "./JO.json": () => import("./JO-bd1eabea.mjs"), "./JP.json": () => import("./JP-9b5a30fa.mjs"), "./KE.json": () => import("./KE-2a866579.mjs"), "./KG.json": () => import("./KG-7713761d.mjs"), "./KH.json": () => import("./KH-a5f0f831.mjs"), "./KI.json": () => import("./KI-8376e298.mjs"), "./KM.json": () => import("./KM-48c8c9c0.mjs"), "./KN.json": () => import("./KN-b34777c7.mjs"), "./KR.json": () => import("./KR-8bcf8499.mjs"), "./KW.json": () => import("./KW-4dd6ab01.mjs"), "./KY.json": () => import("./KY-4f921c93.mjs"), "./KZ.json": () => import("./KZ-68b655f3.mjs"), "./LA.json": () => import("./LA-582a34e2.mjs"), "./LB.json": () => import("./LB-7e5023a3.mjs"), "./LC.json": () => import("./LC-4e610f91.mjs"), "./LI.json": () => import("./LI-3979434e.mjs"), "./LK.json": () => import("./LK-23f5002d.mjs"), "./LT.json": () => import("./LT-2076ca77.mjs"), "./LU.json": () => import("./LU-b0538582.mjs"), "./LV.json": () => import("./LV-440617df.mjs"), "./MA.json": () => import("./MA-f2af9aa6.mjs"), "./MC.json": () => import("./MC-f619d821.mjs"), "./MD.json": () => import("./MD-ffe4e2f4.mjs"), "./ME.json": () => import("./ME-46686aa8.mjs"), "./MH.json": () => import("./MH-c535387d.mjs"), "./MK.json": () => import("./MK-11442cf1.mjs"), "./ML.json": () => import("./ML-b2c3720e.mjs"), "./MM.json": () => import("./MM-0ae1a124.mjs"), "./MN.json": () => import("./MN-baba0d9d.mjs"), "./MO.json": () => import("./MO-2c51f9f7.mjs"), "./MP.json": () => import("./MP-55044c4b.mjs"), "./MQ.json": () => import("./MQ-aaefd2b2.mjs"), "./MR.json": () => import("./MR-f122a6f0.mjs"), "./MS.json": () => import("./MS-7623ec5f.mjs"), "./MT.json": () => import("./MT-315c76bb.mjs"), "./MU.json": () => import("./MU-126673fe.mjs"), "./MV.json": () => import("./MV-d8748aca.mjs"), "./MW.json": () => import("./MW-26492427.mjs"), "./MX.json": () => import("./MX-ca79b44b.mjs"), "./MY.json": () => import("./MY-443e729e.mjs"), "./MZ.json": () => import("./MZ-192a5094.mjs"), "./NC.json": () => import("./NC-3849aac0.mjs"), "./NE.json": () => import("./NE-bf76bc84.mjs"), "./NF.json": () => import("./NF-46f5dffa.mjs"), "./NG.json": () => import("./NG-458396e5.mjs"), "./NI.json": () => import("./NI-efe8c864.mjs"), "./NL.json": () => import("./NL-3e38d0eb.mjs"), "./NO.json": () => import("./NO-088fac56.mjs"), "./NP.json": () => import("./NP-26b20587.mjs"), "./NR.json": () => import("./NR-ba1f7da1.mjs"), "./NU.json": () => import("./NU-6dc3ed45.mjs"), "./NZ.json": () => import("./NZ-12ed2cb9.mjs"), "./OM.json": () => import("./OM-4976855b.mjs"), "./PA.json": () => import("./PA-3b45122a.mjs"), "./PE.json": () => import("./PE-ad6e8281.mjs"), "./PF.json": () => import("./PF-2b1b6f30.mjs"), "./PG.json": () => import("./PG-b94ea47f.mjs"), "./PH.json": () => import("./PH-1b96a1eb.mjs"), "./PK.json": () => import("./PK-35cadd30.mjs"), "./PL.json": () => import("./PL-6a490cd1.mjs"), "./PM.json": () => import("./PM-d508f3c5.mjs"), "./PN.json": () => import("./PN-1f6ccf43.mjs"), "./PR.json": () => import("./PR-730f2830.mjs"), "./PS.json": () => import("./PS-f3ef78cd.mjs"), "./PT.json": () => import("./PT-66954cea.mjs"), "./PW.json": () => import("./PW-0d1c7797.mjs"), "./PY.json": () => import("./PY-c8e58794.mjs"), "./QA.json": () => import("./QA-35be8b1e.mjs"), "./RE.json": () => import("./RE-9f92ed9b.mjs"), "./RO.json": () => import("./RO-5c62edb1.mjs"), "./RS.json": () => import("./RS-bc256d90.mjs"), "./RU.json": () => import("./RU-bbee5e73.mjs"), "./RW.json": () => import("./RW-95b5d859.mjs"), "./SA.json": () => import("./SA-69b2f72a.mjs"), "./SB.json": () => import("./SB-567c239a.mjs"), "./SC.json": () => import("./SC-9e5a0d31.mjs"), "./SE.json": () => import("./SE-4ed53265.mjs"), "./SG.json": () => import("./SG-970463e3.mjs"), "./SH.json": () => import("./SH-d8ab21b7.mjs"), "./SI.json": () => import("./SI-3b6d3545.mjs"), "./SJ.json": () => import("./SJ-e3430cfd.mjs"), "./SK.json": () => import("./SK-2385e057.mjs"), "./SL.json": () => import("./SL-92bf45d9.mjs"), "./SM.json": () => import("./SM-bafbc267.mjs"), "./SN.json": () => import("./SN-5733e740.mjs"), "./SO.json": () => import("./SO-d5b69054.mjs"), "./SR.json": () => import("./SR-0a8c71c0.mjs"), "./ST.json": () => import("./ST-d40d86c1.mjs"), "./TC.json": () => import("./TC-ccbc7116.mjs"), "./TD.json": () => import("./TD-679d137c.mjs"), "./TF.json": () => import("./TF-6bfcf75d.mjs"), "./TG.json": () => import("./TG-a20ef9ed.mjs"), "./TH.json": () => import("./TH-e39a447c.mjs"), "./TK.json": () => import("./TK-89a81d38.mjs"), "./TL.json": () => import("./TL-8d6ca9b7.mjs"), "./TN.json": () => import("./TN-6e746476.mjs"), "./TO.json": () => import("./TO-a8c55d73.mjs"), "./TR.json": () => import("./TR-b1175ddc.mjs"), "./TT.json": () => import("./TT-5c4a3940.mjs"), "./TV.json": () => import("./TV-e1a267b9.mjs"), "./TW.json": () => import("./TW-9e0e34fa.mjs"), "./TZ.json": () => import("./TZ-c8a8159b.mjs"), "./UA.json": () => import("./UA-7014199a.mjs"), "./UG.json": () => import("./UG-1fe39fa7.mjs"), "./UM.json": () => import("./UM-3fcbf872.mjs"), "./US.json": () => import("./US-6fbdfc0c.mjs"), "./UY.json": () => import("./UY-e6d05d75.mjs"), "./UZ.json": () => import("./UZ-433656c8.mjs"), "./VA.json": () => import("./VA-e8e13d32.mjs"), "./VC.json": () => import("./VC-331669c0.mjs"), "./VE.json": () => import("./VE-5e7b0d3b.mjs"), "./VG.json": () => import("./VG-43e85e33.mjs"), "./VI.json": () => import("./VI-3d9d6d8b.mjs"), "./VN.json": () => import("./VN-9442a8c1.mjs"), "./VU.json": () => import("./VU-96fae02f.mjs"), "./WF.json": () => import("./WF-90a27056.mjs"), "./WS.json": () => import("./WS-ddcb2b71.mjs"), "./YE.json": () => import("./YE-02c4c81e.mjs"), "./YT.json": () => import("./YT-33751cc9.mjs"), "./ZA.json": () => import("./ZA-0084b083.mjs"), "./ZM.json": () => import("./ZM-c6a4d6cc.mjs") });
27971
28047
  const getAccountFormatsForCountry = async (country2) => {
27972
28048
  const importForCountry = accountFormatsImports[`./${country2}.json`];
27973
28049
  if (!importForCountry) {
@@ -27979,7 +28055,6 @@ const getPayoutAccountFormat = async (country2) => getAccountFormatsForCountry(c
27979
28055
  const getAllowedLocales$1 = async (context) => {
27980
28056
  const {
27981
28057
  loadingContext,
27982
- sdkToken,
27983
28058
  legalEntityId
27984
28059
  } = context;
27985
28060
  return httpGet({
@@ -27987,7 +28062,7 @@ const getAllowedLocales$1 = async (context) => {
27987
28062
  errorLevel: "warn",
27988
28063
  errorMessage: `Supported locales not available`,
27989
28064
  path: `${legalEntityId}/configurations/supportedLocales`,
27990
- sdkToken,
28065
+ authentication: "jwt",
27991
28066
  headers: {
27992
28067
  "Content-Type": "application/json"
27993
28068
  }
@@ -27995,15 +28070,13 @@ const getAllowedLocales$1 = async (context) => {
27995
28070
  };
27996
28071
  const getEmbeddedApi = ({
27997
28072
  base,
27998
- sdkToken,
27999
28073
  rootLegalEntityId
28000
28074
  }) => {
28001
28075
  const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/`;
28002
28076
  const loadingContextWithRootLEAuth = `${loadingContext}legalEntities/`;
28003
28077
  const baseRequestContext = {
28004
28078
  loadingContext: loadingContextWithRootLEAuth,
28005
- legalEntityId: rootLegalEntityId,
28006
- sdkToken
28079
+ legalEntityId: rootLegalEntityId
28007
28080
  };
28008
28081
  return {
28009
28082
  getConfiguration: async ({
@@ -28062,6 +28135,10 @@ const companyDeepSearch = async (context, data) => {
28062
28135
  clientKey,
28063
28136
  errorLevel: "warn",
28064
28137
  errorMessage: "Failed to use companyDeepSearch",
28138
+ errorHandler: async (response) => {
28139
+ const error = await response;
28140
+ throw new AdyenKycSdkError(error.message, error);
28141
+ },
28065
28142
  path: "v1/companyIndex/deepSearch",
28066
28143
  headers: {
28067
28144
  "Content-Type": "application/json"
@@ -28078,6 +28155,10 @@ const companyIndexSearch = async (context, data) => {
28078
28155
  clientKey,
28079
28156
  errorLevel: "warn",
28080
28157
  errorMessage: "Failed to use companyIndexSearch",
28158
+ errorHandler: async (response) => {
28159
+ const error = await response;
28160
+ throw new AdyenKycSdkError(error.message, error);
28161
+ },
28081
28162
  path: "v1/companyIndex/indexSearch",
28082
28163
  headers: {
28083
28164
  "Content-Type": "application/json"
@@ -28120,6 +28201,10 @@ const getCompanyData = async (context, data) => {
28120
28201
  clientKey,
28121
28202
  errorLevel: "warn",
28122
28203
  errorMessage: "Failed to use getCompanyData",
28204
+ errorHandler: async (response) => {
28205
+ const error = await response;
28206
+ throw new AdyenKycSdkError(error.message, error);
28207
+ },
28123
28208
  path: "v1/companyData/fullDataset",
28124
28209
  headers: {
28125
28210
  "Content-Type": "application/json"
@@ -28173,6 +28258,10 @@ const refreshCompanyData = async (context, data) => {
28173
28258
  clientKey,
28174
28259
  errorLevel: "warn",
28175
28260
  errorMessage: "Failed to use refreshCompanyData",
28261
+ errorHandler: async (response) => {
28262
+ const error = await response;
28263
+ throw new AdyenKycSdkError(error.message, error);
28264
+ },
28176
28265
  path: "v1/companyData/refreshDataset",
28177
28266
  headers: {
28178
28267
  "Content-Type": "application/json"
@@ -28240,6 +28329,10 @@ const verifyTin = async (context, data) => {
28240
28329
  clientKey,
28241
28330
  errorLevel: "warn",
28242
28331
  errorMessage: "Failed to use verifyTin",
28332
+ errorHandler: async (response) => {
28333
+ const error = await response;
28334
+ throw new AdyenKycSdkError(error.message, error);
28335
+ },
28243
28336
  path: "v1/tinVerification/verifyTin",
28244
28337
  headers: {
28245
28338
  "Content-Type": "application/json"
@@ -28306,7 +28399,6 @@ const ConfigurationApiProvider = ({
28306
28399
  const authContext = useAuthContext();
28307
28400
  const contextValue = useMemo(() => authContext.isEmbeddedDropin ? getEmbeddedApi({
28308
28401
  base: authContext.loadingContext,
28309
- sdkToken: authContext.sdkToken,
28310
28402
  rootLegalEntityId
28311
28403
  }) : getKycExternalApi({
28312
28404
  loadingContext: authContext.loadingContext,
@@ -28590,7 +28682,7 @@ class UIElement extends BaseElement {
28590
28682
  const Component = this.props.component;
28591
28683
  return jsx(AuthProvider, {
28592
28684
  sdkToken: this.props.sdkToken,
28593
- refreshToken: this.props.refreshToken,
28685
+ getSdkToken: this.props.getSdkToken,
28594
28686
  clientKey: this.props.clientKey,
28595
28687
  loadingContext: this.props.loadingContext,
28596
28688
  children: jsx(ConfigurationApiProvider, {
@@ -29157,10 +29249,10 @@ const validateComponentName = (componentName) => {
29157
29249
  const validateCoreOptions = (coreOptions) => {
29158
29250
  const requiredOptions = ["locale", "environment", "country"];
29159
29251
  const missing = requiredOptions.filter((option) => !coreOptions[option]);
29160
- if (!(coreOptions.sdkToken && coreOptions.refreshToken) && !coreOptions.clientKey) {
29252
+ if (!(coreOptions.sdkToken && coreOptions.getSdkToken) && !coreOptions.clientKey) {
29161
29253
  throw new Error(`
29162
29254
 
29163
- Please specify either sdkToken and a refreshToken or a clientKey for the SDK to initialize!
29255
+ Please specify either sdkToken and getSdkToken handler or a clientKey for the SDK to initialize!
29164
29256
 
29165
29257
 
29166
29258
  - For more information please check: https://github.com/Adyen/adyen-kyc-components#configuration.`);
@@ -29297,7 +29389,14 @@ class Core {
29297
29389
  newOptions.locale = FALLBACK_LOCALE;
29298
29390
  return newOptions;
29299
29391
  };
29392
+ this.initializeSession = () => {
29393
+ if (this.options.sdkToken && this.options.getSdkToken) {
29394
+ setSdkToken(this.options.sdkToken);
29395
+ setSdkTokenHandler(this.options.getSdkToken);
29396
+ }
29397
+ };
29300
29398
  this.options = this.getUpdatedOptions(coreOptions);
29399
+ this.initializeSession();
29301
29400
  }
29302
29401
  }
29303
29402
  export {