import * as l from "react";
import j from "../../../classnames/index.mjs";
import { composeRef as w } from "../../../rc-util/es/ref.mjs";
import { devUseWarning as R } from "../_util/warning.mjs";
import "../config-provider/index.mjs";
import E from "./style/index.mjs";
import { ConfigContext as P } from "../config-provider/context.mjs";
var S = globalThis && globalThis.__rest || function(t, n) {
  var s = {};
  for (var e in t)
    Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (s[e] = t[e]);
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
    for (var o = 0, e = Object.getOwnPropertySymbols(t); o < e.length; o++)
      n.indexOf(e[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[o]) && (s[e[o]] = t[e[o]]);
  return s;
};
const f = /* @__PURE__ */ l.forwardRef((t, n) => {
  const {
    prefixCls: s,
    component: e = "article",
    className: o,
    rootClassName: m,
    setContentRef: a,
    children: y,
    direction: i,
    style: d
  } = t, g = S(t, ["prefixCls", "component", "className", "rootClassName", "setContentRef", "children", "direction", "style"]), {
    getPrefixCls: C,
    direction: h,
    typography: r
  } = l.useContext(P), u = i ?? h;
  let p = n;
  a && (p = w(n, a)), process.env.NODE_ENV !== "production" && R("Typography").deprecated(!a, "setContentRef", "ref");
  const c = C("typography", s), [O, N, b] = E(c), v = j(c, r == null ? void 0 : r.className, {
    [`${c}-rtl`]: u === "rtl"
  }, o, m, N, b), x = Object.assign(Object.assign({}, r == null ? void 0 : r.style), d);
  return O(
    // @ts-expect-error: Expression produces a union type that is too complex to represent.
    /* @__PURE__ */ l.createElement(e, Object.assign({
      className: v,
      style: x,
      ref: p
    }, g), y)
  );
});
process.env.NODE_ENV !== "production" && (f.displayName = "Typography");
const W = f;
export {
  W as default
};
