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