;
{
  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] = "9eaa76c3-a56e-4bd4-9a8d-9589f7bc245e", e._sentryDebugIdIdentifier = "sentry-dbid-9eaa76c3-a56e-4bd4-9a8d-9589f7bc245e");
  } catch (e) {
  }
}
;
import { jsx, jsxs } from "preact/jsx-runtime";
import { T as Tag } from "./Tag-DdkVScyr.js";
import { br as getDecisionMakerDescriptionMap, j as TaskTypes, bs as TRUST_DEFAULT_DESCRIPTIONS_MAP, r as Icon, u as useTranslation, aB as Trans } from "./StoreProvider-CqQrndhS.js";
import { U as UnincorporatedPartnershipMemberTypes } from "./unincorporated-partnership-MeN1dp53.js";
import { g as getRoleName, a as getRoleTagVariant } from "./roleMetadata-BhGtDULY.js";
const UNINCORPORATED_PARTNERSHIP__DEFAULT_DESCRIPTIONS_MAP = {
  [UnincorporatedPartnershipMemberTypes.SECONDARY_PARTNER]: "provideAtLeastOneSecondaryPartner",
  [UnincorporatedPartnershipMemberTypes.OWNER]: "provideAllOwners",
  [UnincorporatedPartnershipMemberTypes.CONTROLLING_PERSON]: "ifNoOwnersSpecifyControllingPersons"
};
const iconStatus = (current, min) => {
  const isSatisfied = current > 0 && current >= min;
  return isSatisfied ? "satisfied" : "empty";
};
const getEntityStatusRuleDescription = (country, currentTask, entityLabel) => {
  const defaultMessage = getDecisionMakerDescriptionMap(country)[entityLabel];
  switch (currentTask) {
    case TaskTypes.TRUST_MEMBER_OVERVIEW: {
      return TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel];
    }
    case TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_OVERVIEW: {
      return UNINCORPORATED_PARTNERSHIP__DEFAULT_DESCRIPTIONS_MAP[entityLabel] || defaultMessage;
    }
    default: {
      return defaultMessage;
    }
  }
};
const EntityStatusIcon = ({ status }) => {
  switch (status) {
    case "empty":
      return /* @__PURE__ */ jsx(
        Icon,
        {
          name: "checkmark-circle",
          className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
          testId: "empty-icon"
        }
      );
    case "satisfied":
      return /* @__PURE__ */ jsx(
        Icon,
        {
          name: "checkmark",
          className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--satisfied",
          testId: "satisfied-icon"
        }
      );
    default:
      return /* @__PURE__ */ jsx(
        Icon,
        {
          name: "circle",
          className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
          testId: "empty-icon"
        }
      );
  }
};
const EntityGuidanceStatus = ({
  country,
  currentTask,
  entityLabel,
  status
}) => {
  const { t } = useTranslation("common");
  return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-entity-status__container", children: [
    /* @__PURE__ */ jsx(EntityStatusIcon, { status }),
    /* @__PURE__ */ jsx(
      Tag,
      {
        className: "adyen-kyc-entity-status__tag",
        variant: getRoleTagVariant(entityLabel),
        children: t(($) => $[getRoleName(entityLabel)])
      },
      entityLabel
    ),
    /* @__PURE__ */ jsx(
      "span",
      {
        className: "adyen-kyc-entity-status--text",
        "data-testid": `${entityLabel}-rule--description`,
        children: /* @__PURE__ */ jsx(
          Trans,
          {
            t,
            i18nKey: ($) => $[getEntityStatusRuleDescription(country, currentTask, entityLabel)]
          }
        )
      }
    )
  ] });
};
export {
  EntityGuidanceStatus as E,
  iconStatus as i
};
