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] = "18621658-fca7-432a-8831-72b6f36fcc8e", e._sentryDebugIdIdentifier = "sentry-dbid-18621658-fca7-432a-8831-72b6f36fcc8e");
} catch (e) {}
import { n as addResourceBundles, r as useTranslation } from "./translation-Br5wIPO-.js";
import { r as Loader } from "./Button-BDEdGXnd.js";
import { r as useLegalEntity } from "./useLegalEntity-Dm6g0wmt.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-CDSEJpB8.js";
import { t as TaskTypes } from "./taskTypes-DWaxzvnQ.js";
import { n as useCapabilityProblems, t as getProblemsForEntity } from "./getProblemsForEntity-COcJt47f.js";
import { t as useUnincorporatedPartnershipMembers } from "./useUnincorporatedPartnershipMembers-D7U6aM_k.js";
import { r as BusinessDetailsDropin, t as useBusinessDetailsData } from "./useBusinessDetailsData-Cw0gVS-u.js";
import { jsx } from "preact/jsx-runtime";
import { skipToken } from "@tanstack/preact-query";
import { useParams } from "wouter-preact";
//#region src/components/UnincorporatedPartnership/pages/UnincorporatedPartnershipMemberCompanyPage.tsx
function UnincorporatedPartnershipMemberCompanyPage({ partnershipId, partnershipMemberCompanyId: partnershipMemberCompanyIdProp, newMember, onSubmit, handleHomeClick }) {
	const routeParams = useParams();
	const partnershipMemberCompanyId = partnershipMemberCompanyIdProp ?? routeParams.memberId;
	const { i18n } = useTranslation();
	const { data: partnershipLe } = useLegalEntity(partnershipId || skipToken);
	const { data: partnershipMemberCompanyLe } = useLegalEntity(partnershipMemberCompanyId || skipToken);
	const partnershipMembers = useUnincorporatedPartnershipMembers();
	const capabilityProblems = useCapabilityProblems();
	const { data, isLoading } = useBusinessDetailsData(TaskTypes.TRUST_MEMBER_COMPANY, partnershipLe, partnershipMemberCompanyLe);
	addResourceBundles(i18n, [{
		ns: "business",
		importFn: (lang) => _rolldown_dynamic_import_helper_default(/* @__PURE__ */ Object.assign({
			"../../Business/language/bg-BG.json": () => import("./bg-BG-Cxa0jcnA.js"),
			"../../Business/language/cs-CZ.json": () => import("./cs-CZ-MU9Ub24D.js"),
			"../../Business/language/da-DK.json": () => import("./da-DK-Cx-Ux0WK.js"),
			"../../Business/language/de-DE.json": () => import("./de-DE-Cbpj1g3M.js"),
			"../../Business/language/el-GR.json": () => import("./el-GR-Dw8xMzqe.js"),
			"../../Business/language/en-US.json": () => import("./en-US-AkapGgCu.js"),
			"../../Business/language/es-ES.json": () => import("./es-ES-D7pe0Z8H.js"),
			"../../Business/language/et-EE.json": () => import("./et-EE-Dszx65le2.js"),
			"../../Business/language/fi-FI.json": () => import("./fi-FI-UJLb8Vk42.js"),
			"../../Business/language/fr-FR.json": () => import("./fr-FR-B6Moi9NF2.js"),
			"../../Business/language/hr-HR.json": () => import("./hr-HR-BZ31wjf92.js"),
			"../../Business/language/hu-HU.json": () => import("./hu-HU-BgRcKhFU2.js"),
			"../../Business/language/it-IT.json": () => import("./it-IT-D_ks7gfY2.js"),
			"../../Business/language/ja-JP.json": () => import("./ja-JP-B-5Ib5IT2.js"),
			"../../Business/language/lt-LT.json": () => import("./lt-LT-BJziTet92.js"),
			"../../Business/language/lv-LV.json": () => import("./lv-LV-C8O_oUFu2.js"),
			"../../Business/language/nl-NL.json": () => import("./nl-NL-BjbL2DHM2.js"),
			"../../Business/language/no-NO.json": () => import("./no-NO-DM2yevPv2.js"),
			"../../Business/language/pl-PL.json": () => import("./pl-PL-DC1Izk5I2.js"),
			"../../Business/language/pt-BR.json": () => import("./pt-BR-NPzViBFm2.js"),
			"../../Business/language/pt-PT.json": () => import("./pt-PT-BRLRSNh92.js"),
			"../../Business/language/ro-RO.json": () => import("./ro-RO-DsFDnuty2.js"),
			"../../Business/language/sk-SK.json": () => import("./sk-SK-CV-IEeZp2.js"),
			"../../Business/language/sl-SI.json": () => import("./sl-SI-Cg7e65lb2.js"),
			"../../Business/language/sv-SE.json": () => import("./sv-SE-Q7zk4V9W2.js")
		}), `../../Business/language/${lang}.json`, 5)
	}]);
	if (isLoading || !partnershipLe || partnershipMemberCompanyId && !partnershipMemberCompanyLe) return /* @__PURE__ */ jsx(Loader, {});
	const { rootLe, efpBusinessLines, documents } = data;
	const problems = capabilityProblems && partnershipMemberCompanyId ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, partnershipMemberCompanyId) : void 0;
	const country = getLegalEntityCountry(partnershipMemberCompanyLe ?? partnershipLe);
	const partnershipMember = newMember ?? partnershipMembers.find((member) => member.legalEntityId === partnershipMemberCompanyId);
	return /* @__PURE__ */ jsx(BusinessDetailsDropin, {
		taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY,
		legalEntityResponse: rootLe,
		efpBusinessLines,
		documents,
		associatedLegalArrangement: partnershipLe,
		nestedLegalEntity: partnershipMemberCompanyLe,
		nestedLegalEntityDetails: partnershipMember,
		problems,
		country,
		onSubmit,
		handleHomeClick
	});
}
//#endregion
export { UnincorporatedPartnershipMemberCompanyPage };
