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] = "3056602b-0ae3-4b95-862e-fdfe3a771bb7", e._sentryDebugIdIdentifier = "sentry-dbid-3056602b-0ae3-4b95-862e-fdfe3a771bb7");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-DYpZlvOH.js";
import { r as Loader } from "./Button-DOLNhJTG.js";
import { r as useLegalEntity } from "./useLegalEntity-DFEptY6O.js";
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-C6bSV6sB.js";
import { t as _rolldown_dynamic_import_helper_default } from "./_rolldown_dynamic_import_helper-CCXvMgfE.js";
import { C as EntityTypes } from "./processCapabilities-CI_g2ItO.js";
import { t as TaskTypes } from "./taskTypes-DWaxzvnQ.js";
import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-DWdc4uXg.js";
import { t as useTrustMembers } from "./useTrustMembers-Ct1kgqYn.js";
import { n as BusinessDetailsDropin, t as useBusinessDetailsData } from "./useBusinessDetailsData-D4r7dLvh.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-ClQ8gVST.js"),
			"../../Business/language/cs-CZ.json": () => import("./cs-CZ-DhQcomjq.js"),
			"../../Business/language/da-DK.json": () => import("./da-DK-C1o_L_2y.js"),
			"../../Business/language/de-DE.json": () => import("./de-DE-DA8Kde6U.js"),
			"../../Business/language/el-GR.json": () => import("./el-GR-BIOa9u-k.js"),
			"../../Business/language/en-US.json": () => import("./en-US-CNZ6mn72.js"),
			"../../Business/language/es-ES.json": () => import("./es-ES-DqH_2BDZ.js"),
			"../../Business/language/et-EE.json": () => import("./et-EE-B4DF7PzU.js"),
			"../../Business/language/fi-FI.json": () => import("./fi-FI-Bj7jQFUu.js"),
			"../../Business/language/fr-FR.json": () => import("./fr-FR-VJhJdUR3.js"),
			"../../Business/language/hr-HR.json": () => import("./hr-HR-CL7kqD2b.js"),
			"../../Business/language/hu-HU.json": () => import("./hu-HU-DA9w7tO6.js"),
			"../../Business/language/it-IT.json": () => import("./it-IT-CY_vegId2.js"),
			"../../Business/language/ja-JP.json": () => import("./ja-JP-VcSPyl_32.js"),
			"../../Business/language/lt-LT.json": () => import("./lt-LT-DobhtEZs2.js"),
			"../../Business/language/lv-LV.json": () => import("./lv-LV-BtkNCMsa2.js"),
			"../../Business/language/nl-NL.json": () => import("./nl-NL-BSwNMg8Q2.js"),
			"../../Business/language/no-NO.json": () => import("./no-NO-Dh0N0tCB2.js"),
			"../../Business/language/pl-PL.json": () => import("./pl-PL-YkPY-Ggy2.js"),
			"../../Business/language/pt-BR.json": () => import("./pt-BR-hXUEDsBy2.js"),
			"../../Business/language/pt-PT.json": () => import("./pt-PT-x8WvjpVk2.js"),
			"../../Business/language/ro-RO.json": () => import("./ro-RO-DcsY_8JB2.js"),
			"../../Business/language/sk-SK.json": () => import("./sk-SK-7BtruJjk2.js"),
			"../../Business/language/sl-SI.json": () => import("./sl-SI-4QS5gF-j2.js"),
			"../../Business/language/sv-SE.json": () => import("./sv-SE-CevWvsYN2.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-YZ34LkMd.js"),
			"../language/cs-CZ.json": () => import("./cs-CZ-Bl8qBkx4.js"),
			"../language/da-DK.json": () => import("./da-DK-BOU9aCaN.js"),
			"../language/de-DE.json": () => import("./de-DE-B8D6bV3u.js"),
			"../language/el-GR.json": () => import("./el-GR-mGnv3b-O.js"),
			"../language/en-US.json": () => import("./en-US-aJtjsYKh.js"),
			"../language/es-ES.json": () => import("./es-ES-BAAL2h3R.js"),
			"../language/et-EE.json": () => import("./et-EE-C4U93xrJ.js"),
			"../language/fi-FI.json": () => import("./fi-FI-IwaR92iX.js"),
			"../language/fr-FR.json": () => import("./fr-FR-DwYX21r1.js"),
			"../language/hr-HR.json": () => import("./hr-HR-CFAySNqh.js"),
			"../language/hu-HU.json": () => import("./hu-HU-DXHf3uuK.js"),
			"../language/it-IT.json": () => import("./it-IT-BK6Yn4vc.js"),
			"../language/ja-JP.json": () => import("./ja-JP-B5fRnSzi.js"),
			"../language/lt-LT.json": () => import("./lt-LT-Dkvuak-E.js"),
			"../language/lv-LV.json": () => import("./lv-LV-Cz0igciN.js"),
			"../language/nl-NL.json": () => import("./nl-NL-BTuDiajY.js"),
			"../language/no-NO.json": () => import("./no-NO-D6C6Imfk.js"),
			"../language/pl-PL.json": () => import("./pl-PL-DNdGYT-E.js"),
			"../language/pt-BR.json": () => import("./pt-BR-BgiNMjMc.js"),
			"../language/pt-PT.json": () => import("./pt-PT-CWzCKCL8.js"),
			"../language/ro-RO.json": () => import("./ro-RO-DLtPW1MX.js"),
			"../language/sk-SK.json": () => import("./sk-SK-DNKyL6Hl.js"),
			"../language/sl-SI.json": () => import("./sl-SI-DNgxTuIJ.js"),
			"../language/sv-SE.json": () => import("./sv-SE-BM8WESGs.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 };
