import { jsx as c } from "@emotion/react/jsx-runtime";
import { getPropDataTestId as u } from "../../../../test/getNameDataTestId.js";
import { useComponentSize as C } from "../../../../hooks/useComponentSize/index.js";
import { getComponentSlotRoot as b } from "../../../../utils/getComponentSlotRoot.js";
import { BADGE_LABEL_KEY_COMPONENT as r } from "./constants.js";
import { BadgeRootStyled as S } from "./slots/BadgeSlots.js";
import { BadgeSlots as y } from "./slots/BadgeEnum.js";
const v = (a) => {
  const {
    color: n = "default",
    size: d = "medium",
    variant: t = "standard",
    dataTestId: m,
    children: i,
    badgeContent: e,
    max: s,
    showZero: p,
    invisible: g,
    ...l
  } = a, { currentSize: f } = C(d), o = typeof e == "number" && e > 9 ? "+9" : e, B = {
    BadgeColor: n,
    BadgeVariant: t,
    BadgeSize: f,
    displayBadgeContent: typeof e == "number" && e > 9
  };
  return /* @__PURE__ */ c(
    S,
    {
      role: "badge-role",
      className: b(r),
      ...u(r, y.rootBadge, m),
      ownerState: B,
      max: s,
      showZero: p,
      invisible: g,
      badgeContent: typeof o == "number" && o < 0 ? 0 : o,
      variant: t,
      ...l,
      children: i
    }
  );
};
export {
  v as Badge
};
