;
{
  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] = "35dfc19f-6447-40f2-ab0d-b97a8a4d8412", e._sentryDebugIdIdentifier = "sentry-dbid-35dfc19f-6447-40f2-ab0d-b97a8a4d8412");
  } catch (e) {
  }
}
;
import { useMemo } from "preact/hooks";
import { u as useTranslation, a8 as EntityTypes, bm as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING, j as TaskTypes } from "./StoreProvider-CqQrndhS.js";
function useDataMissingRemediations({
  legalEntityId,
  problems
}) {
  const { t } = useTranslation("common");
  const decisionMakersRemediationMessage = useMemo(() => {
    const remediationCodes = problems[EntityTypes.LEGAL_ENTITY]?.[legalEntityId]?.missingData?.reduce((remediations, error) => {
      const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
      return remediation ? [...remediations, remediation] : remediations;
    }, []);
    const uniqueRemediations = [...new Set(remediationCodes)];
    switch (uniqueRemediations?.length) {
      case void 0:
      case 0:
        return void 0;
      case 1:
        return uniqueRemediations[0] ? t(($) => $[`remediationMessage_${uniqueRemediations[0]}`]) : t(($) => $["missingMultipleDecisionMakers"]);
      default:
        return t(($) => $["missingMultipleDecisionMakers"]);
    }
  }, [problems, t, legalEntityId]);
  return {
    remediationMessages: {
      [TaskTypes.DECISION_MAKER]: decisionMakersRemediationMessage
    }
  };
}
export {
  useDataMissingRemediations as u
};
