;
{
  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] = "ded95bf8-4bfc-453a-9dd1-b6a022bfdc21", e._sentryDebugIdIdentifier = "sentry-dbid-ded95bf8-4bfc-453a-9dd1-b6a022bfdc21");
  } catch (e) {
  }
}
;
import { c as useLegalEntity, u as useTranslation, a as addResourceBundles, L as Loader, g as getLegalEntityCountry, a8 as EntityTypes, a7 as noop, j as TaskTypes, R as ROOT_LE, _ as __variableDynamicImportRuntimeHelper } from "./StoreProvider-CqQrndhS.js";
import { jsx } from "preact/jsx-runtime";
import { skipToken } from "@tanstack/preact-query";
import { u as useCapabilityProblems, g as getProblemsForEntity } from "./getProblemsForEntity-C1PgQbDM.js";
import { I as IndividualOnfidoDropin } from "./IndividualDropin-Dc6nJvrr.js";
function LegalRepresentativeDetailsPage({
  legalRepresentativeId,
  asModal = false,
  hideSidebar = false,
  onSubmit,
  /** below from {@link DropinProps} */
  handleBackClick,
  handleCloseClick,
  handleHomeClick = noop
}) {
  const { data: legalRepresentativeLe } = useLegalEntity(legalRepresentativeId ?? skipToken);
  const { data: rootLe } = useLegalEntity(ROOT_LE);
  const capabilityProblems = useCapabilityProblems();
  const { i18n } = useTranslation();
  addResourceBundles(i18n, [
    { ns: "individual", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-wMYXZGDQ.js"), "../language/cs-CZ.json": () => import("./cs-CZ-bkbdzIkF.js"), "../language/da-DK.json": () => import("./da-DK-DvZ431fC.js"), "../language/de-DE.json": () => import("./de-DE-0uSzhWg5.js"), "../language/el-GR.json": () => import("./el-GR-CWWBcvDM.js"), "../language/en-US.json": () => import("./en-US-cVpRgdC8.js"), "../language/es-ES.json": () => import("./es-ES-B7dt4cn7.js"), "../language/et-EE.json": () => import("./et-EE-D_3GB-yT.js"), "../language/fi-FI.json": () => import("./fi-FI-REMsyTSr.js"), "../language/fr-FR.json": () => import("./fr-FR-CvHWmim-.js"), "../language/hr-HR.json": () => import("./hr-HR-LO3oO8yb.js"), "../language/hu-HU.json": () => import("./hu-HU-DEKBPTur.js"), "../language/it-IT.json": () => import("./it-IT-BeX7-OcD.js"), "../language/ja-JP.json": () => import("./ja-JP-B3wVYIJU.js"), "../language/lt-LT.json": () => import("./lt-LT-3niAR3rI.js"), "../language/lv-LV.json": () => import("./lv-LV-K-KFPny2.js"), "../language/nl-NL.json": () => import("./nl-NL-CM5U8ODq.js"), "../language/no-NO.json": () => import("./no-NO-BQL_M1pn.js"), "../language/pl-PL.json": () => import("./pl-PL-DC_lIAnp.js"), "../language/pt-BR.json": () => import("./pt-BR-AZ3roErF.js"), "../language/pt-PT.json": () => import("./pt-PT-DVKtHjIY.js"), "../language/ro-RO.json": () => import("./ro-RO-CHcD-PGb.js"), "../language/sk-SK.json": () => import("./sk-SK-s9Xm01UD.js"), "../language/sl-SI.json": () => import("./sl-SI-C0wSbuau.js"), "../language/sv-SE.json": () => import("./sv-SE-DtKjf4Go.js") }), `../language/${lang}.json`, 3) }
  ]);
  if (!rootLe || legalRepresentativeId && !legalRepresentativeLe) {
    return /* @__PURE__ */ jsx(Loader, {});
  }
  const country = getLegalEntityCountry(legalRepresentativeLe ?? rootLe);
  const problems = capabilityProblems ? getProblemsForEntity(capabilityProblems, EntityTypes.LEGAL_ENTITY, rootLe.id) : void 0;
  const props = {
    taskType: TaskTypes.LEGAL_REPRESENTATIVE_DETAILS,
    taskName: "legalRepresentativeDetails",
    legalEntityResponse: legalRepresentativeLe,
    parentLegalEntity: rootLe,
    problems,
    country,
    asModal,
    hideSidebar,
    onSubmit,
    handleBackClick,
    handleCloseClick,
    handleHomeClick
  };
  return /* @__PURE__ */ jsx(IndividualOnfidoDropin, { ...props });
}
export {
  LegalRepresentativeDetailsPage
};
