import { jsx as c } from "react/jsx-runtime";
import r from "prop-types";
import { Typography as u } from "@mui/material";
import n from "lodash/isUndefined";
import o from "../Colors/themes/default.js";
import { mergeProps as b } from "../Util/index.js";
import { withDeprecated as w } from "../Util/deprecate.js";
import { styled as x } from "../Theme/index.js";
const s = {
  error: {
    color: o.common.white,
    backgroundColor: o.error.main
  },
  warning: {
    color: o.common.white,
    backgroundColor: o.warning.main
  },
  success: {
    color: o.common.white,
    backgroundColor: o.success.main
  },
  primary: {
    color: o.common.white,
    backgroundColor: o.primary.main
  },
  reverse: {
    color: o.common.white,
    backgroundColor: o.grey[900]
  }
};
function i({ ...t }) {
  const e = Object.assign({}, t);
  n(e.type) && (e.type = "primary"), n(e.content) && (e.content = ""), n(e.className) && (e.className = ""), n(e.style) && (e.style = {});
  const a = b(e, i, ["style"]), { type: m, content: p, children: l, style: y, className: d, forwardedRef: f, ...g } = a, h = Object.assign(s[m] || s.primary, y);
  return /* @__PURE__ */ c(k, { ref: f, component: "span", className: d, style: h, ...g, children: p || l });
}
i.propTypes = {
  children: r.any.isRequired,
  content: r.string,
  type: r.oneOf(Object.keys(s)),
  className: r.string,
  style: r.oneOfType([r.object, r.string])
};
const B = w(
  /**
   * @param {BadgeProps} props - Badge组件的属性
   * @param {React.Ref<HTMLSpanElement>} ref - 转发的ref
   * @returns {JSX.Element}
   */
  ({ ref: t, ...e }) => /* @__PURE__ */ c(i, { ...e, forwardedRef: t }),
  { name: "Badge", alternative: "@arcblock/ux/lib/Tag" }
), k = x(u)`
  && {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 2px 10px;
    height: 24px;
    line-height: 24px;
  }
`;
export {
  B as default
};
