@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
108 lines (107 loc) • 7.01 kB
JavaScript
try {
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "87e0be81-7c54-4845-94a4-cf4da5fb7393", e._sentryDebugIdIdentifier = "sentry-dbid-87e0be81-7c54-4845-94a4-cf4da5fb7393");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-BFxyJ1c5.js";
import { r as Loader } from "./Button-oj6H8OrC.js";
import { r as useLegalEntity } from "./useLegalEntity-yxi9XhLi.js";
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-C6bSV6sB.js";
import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-rq_tsyLP.js";
import { C as EntityTypes } from "./processCapabilities-DlZY9-Jc.js";
import { p as TaskTypes } from "./entityAssociationUtil-BEzUdPbm.js";
import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-BLcIg3x_.js";
import { t as useTrustMembers } from "./useTrustMembers-NwUmFfVc.js";
import { n as BusinessDetailsDropin, t as useBusinessDetailsData } from "./useBusinessDetailsData-DGPg34HR.js";
import { jsx } from "preact/jsx-runtime";
import { skipToken } from "@tanstack/preact-query";
import { useParams } from "wouter-preact";
//#region src/components/Trust/pages/TrustMemberCompanyPage.tsx
function TrustMemberCompanyPage({ trustId, trustMemberCompanyId: trustMemberCompanyIdProp, newMember, onSubmit, handleHomeClick }) {
const routeParams = useParams();
const trustMemberCompanyId = trustMemberCompanyIdProp ?? routeParams.memberId;
const { i18n } = useTranslation();
const { data: trustLe } = useLegalEntity(trustId ?? skipToken);
const { data: trustMemberCompanyLe } = useLegalEntity(trustMemberCompanyId ?? skipToken);
const trustMembers = useTrustMembers();
const capabilityProblems = useCapabilityProblems();
const { data, isLoading } = useBusinessDetailsData(TaskTypes.TRUST_MEMBER_COMPANY, trustLe, trustMemberCompanyLe);
addResourceBundles(i18n, [{
ns: "business",
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
"../../Business/language/bg-BG.json": () => import("./bg-BG-CodTfJR6.js"),
"../../Business/language/cs-CZ.json": () => import("./cs-CZ-BLE9aLKg.js"),
"../../Business/language/da-DK.json": () => import("./da-DK-DtAW2xZE.js"),
"../../Business/language/de-DE.json": () => import("./de-DE-DXNTaizu.js"),
"../../Business/language/el-GR.json": () => import("./el-GR-qH2iIn7-.js"),
"../../Business/language/en-US.json": () => import("./en-US-DBiYkRmE.js"),
"../../Business/language/es-ES.json": () => import("./es-ES-yxJhxnWV.js"),
"../../Business/language/et-EE.json": () => import("./et-EE-C3h50xW-.js"),
"../../Business/language/fi-FI.json": () => import("./fi-FI-wGXRm-tZ.js"),
"../../Business/language/fr-FR.json": () => import("./fr-FR-mFwC-nNY.js"),
"../../Business/language/hr-HR.json": () => import("./hr-HR-BAeB6ZDz.js"),
"../../Business/language/hu-HU.json": () => import("./hu-HU-Bb1gk4Jr.js"),
"../../Business/language/it-IT.json": () => import("./it-IT-CmoZrxWa.js"),
"../../Business/language/ja-JP.json": () => import("./ja-JP-CyP1sKap.js"),
"../../Business/language/lt-LT.json": () => import("./lt-LT-D0_qhzNo.js"),
"../../Business/language/lv-LV.json": () => import("./lv-LV-Bfkan_1O.js"),
"../../Business/language/nl-NL.json": () => import("./nl-NL-DXnNGqSV.js"),
"../../Business/language/no-NO.json": () => import("./no-NO-B1v42GMO2.js"),
"../../Business/language/pl-PL.json": () => import("./pl-PL-C5u2-nG22.js"),
"../../Business/language/pt-BR.json": () => import("./pt-BR-9jLurhS32.js"),
"../../Business/language/pt-PT.json": () => import("./pt-PT-B6DsKlac2.js"),
"../../Business/language/ro-RO.json": () => import("./ro-RO-9TjoIVJf2.js"),
"../../Business/language/sk-SK.json": () => import("./sk-SK-D5_Q4Djr2.js"),
"../../Business/language/sl-SI.json": () => import("./sl-SI-CuNIMCGx2.js"),
"../../Business/language/sv-SE.json": () => import("./sv-SE-C11kwGTV2.js")
}), `../../Business/language/${lang}.json`, 5)
}, {
ns: "trust",
importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
"../language/bg-BG.json": () => import("./bg-BG-Doq5SqNZ.js"),
"../language/cs-CZ.json": () => import("./cs-CZ-CNCOzk0z.js"),
"../language/da-DK.json": () => import("./da-DK-Dq9DBbxy.js"),
"../language/de-DE.json": () => import("./de-DE-BnAkTJpS.js"),
"../language/el-GR.json": () => import("./el-GR-WE5RvoaZ.js"),
"../language/en-US.json": () => import("./en-US-Y8C6Dmuq.js"),
"../language/es-ES.json": () => import("./es-ES-DyrLbt2G.js"),
"../language/et-EE.json": () => import("./et-EE-CjKIw3AU.js"),
"../language/fi-FI.json": () => import("./fi-FI-YpLcMuZy.js"),
"../language/fr-FR.json": () => import("./fr-FR-CWBeJe7e.js"),
"../language/hr-HR.json": () => import("./hr-HR-B0eeXkQr.js"),
"../language/hu-HU.json": () => import("./hu-HU-DmlhDBmZ.js"),
"../language/it-IT.json": () => import("./it-IT-C3AVk1uR.js"),
"../language/ja-JP.json": () => import("./ja-JP-ogtt9tGy.js"),
"../language/lt-LT.json": () => import("./lt-LT-948HQZhZ.js"),
"../language/lv-LV.json": () => import("./lv-LV-CrfpEaoB.js"),
"../language/nl-NL.json": () => import("./nl-NL-CQYif340.js"),
"../language/no-NO.json": () => import("./no-NO-DKzoUIzk.js"),
"../language/pl-PL.json": () => import("./pl-PL-CWLfHfaM.js"),
"../language/pt-BR.json": () => import("./pt-BR-BWN_WzRl.js"),
"../language/pt-PT.json": () => import("./pt-PT-wBADnHVq.js"),
"../language/ro-RO.json": () => import("./ro-RO-C2tZmDar.js"),
"../language/sk-SK.json": () => import("./sk-SK-BsanrSCF.js"),
"../language/sl-SI.json": () => import("./sl-SI-BsiDU3hz.js"),
"../language/sv-SE.json": () => import("./sv-SE-DDCAUQsX.js")
}), `../language/${lang}.json`, 3)
}]);
if (isLoading || !trustLe || trustMemberCompanyId && !trustMemberCompanyLe) return /* @__PURE__ */ jsx(Loader, {});
const { rootLe, efpBusinessLines, documents } = data;
const problems = capabilityProblems && trustMemberCompanyId ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, trustMemberCompanyId) : void 0;
const country = getLegalEntityCountry(trustMemberCompanyLe ?? trustLe);
const trustMember = newMember ?? trustMembers.find((tm) => tm.trustMemberType !== "undefinedBeneficiary" && tm.legalEntityId === trustMemberCompanyId);
return /* @__PURE__ */ jsx(BusinessDetailsDropin, {
taskType: TaskTypes.TRUST_MEMBER_COMPANY,
legalEntityResponse: rootLe,
efpBusinessLines,
documents,
associatedLegalArrangement: trustLe,
nestedLegalEntity: trustMemberCompanyLe,
nestedLegalEntityDetails: trustMember,
problems,
country,
onSubmit,
handleHomeClick
});
}
//#endregion
export { TrustMemberCompanyPage };