import { j as u } from "./jsx-runtime-NmMXPjeo.js";
import { forwardRef as p, createElement as E } from "react";
import { d as M, C as t } from "./css-M9deYuc0.js";
const k = ({ el: e, children: a, ...s }, r) => E(e, { ...s, ref: r }, a), x = p(k), O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Element: x
}, Symbol.toStringTag, { value: "Module" })), R = ["start", "center", "end", "stretch"], _ = [
  "start",
  "center",
  "end",
  "spaceBetween",
  "spaceAround",
  "spaceEvenly"
], g = (e, a) => a ?? (e === "right" || e === "bottom"), C = ({
  style: e,
  align: a,
  className: s,
  grow: r,
  shrink: c,
  empty: l = !1,
  size: n = "medium",
  justify: f = "start",
  reverse: o,
  direction: d = "y",
  wrap: b = !1,
  bordered: j = !1,
  rounded: B = !1,
  el: N = "div",
  ...w
}, y) => {
  const i = M.construct(d);
  o = g(d, o);
  let m;
  return l ? [n, m] = [0, 0] : typeof n == "number" && (m = `${n}rem`), e = {
    gap: m,
    flexDirection: v(i, o),
    justifyContent: A[f],
    alignItems: a,
    flexWrap: b ? "wrap" : "nowrap",
    ...e
  }, r != null && (e.flexGrow = Number(r)), c != null && (e.flexShrink = Number(c)), // @ts-expect-error - TODO: fix generic element props
  /* @__PURE__ */ u.jsx(
    x,
    {
      el: N,
      ref: y,
      className: t(
        t.B("space"),
        t.dir(i),
        t.bordered(j),
        t.rounded(B),
        typeof n == "string" && t.BM("space", n),
        s
      ),
      style: e,
      ...w
    }
  );
};
C.displayName = "Space";
const S = p(C), v = (e, a) => {
  const s = e === "x" ? "row" : "column";
  return a ? s + "-reverse" : s;
}, A = {
  start: "flex-start",
  center: "center",
  end: "flex-end",
  spaceBetween: "space-between",
  spaceAround: "space-around",
  spaceEvenly: "space-evenly"
}, I = ({
  className: e,
  size: a = "medium",
  reverse: s = !1,
  direction: r = "x",
  bordered: c = !0,
  rounded: l = !0,
  shadow: n = !1,
  ...f
}, o) => (
  // @ts-expect-error
  /* @__PURE__ */ u.jsx(
    S,
    {
      ref: o,
      direction: r,
      reverse: s,
      className: t(
        t.B("pack"),
        n && t.BM("pack", "shadow"),
        t.dir(r),
        typeof a != "number" && t.BM("pack", a),
        s && t.BM("pack", "reverse"),
        e
      ),
      bordered: c,
      rounded: l,
      ...f,
      empty: !0
    }
  )
), D = p(I), h = ({ className: e, justify: a = "center", align: s = "center", ...r }, c) => (
  // @ts-expect-error
  /* @__PURE__ */ u.jsx(
    S,
    {
      ref: c,
      justify: a,
      align: s,
      className: t(t.BM("space", "centered"), e),
      ...r
    }
  )
), J = p(h);
export {
  R as A,
  J as C,
  x as E,
  O as G,
  _ as J,
  D as P,
  S,
  h as a,
  g as s
};
//# sourceMappingURL=Center-ZEYtK6iF.js.map
