import { j as $ } from "./jsx-runtime-tc70JA_2.js";
import { direction as w } from "@synnaxlabs/x";
import x from "zod";
import { C as e } from "./css-D90kZTM8.js";
import { createElement as z } from "react";
const d = ({
  el: r,
  children: t,
  ...u
}) => z(r, u, t), H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Element: d
}, Symbol.toStringTag, { value: "Module" })), j = ["start", "center", "end", "stretch"], C = x.enum(j), _ = [
  "start",
  "center",
  "end",
  "between",
  "around",
  "evenly"
], F = x.enum(_), g = (r, t) => t ?? (r === "right" || r === "bottom"), v = (r, t, u, o) => {
  if (t === !0) return "x";
  if (u === !0) return "y";
  if (r != null) return w.construct(r);
  if (o == !0) return "x";
}, P = (r) => r == null || r === !1 ? !1 : r === !0 ? e.M("full") : e.M("full", r), Z = ({
  style: r,
  align: t,
  className: u,
  grow: o,
  shrink: a,
  gap: l,
  color: s,
  justify: p,
  reverse: y,
  empty: E,
  pack: c,
  wrap: N,
  center: O,
  direction: M,
  rounded: m,
  sharp: T,
  borderWidth: B,
  borderColor: f,
  full: G,
  background: i,
  bordered: I,
  x: A,
  y: R,
  size: b,
  square: V = !1,
  ...h
}) => {
  const S = v(M, A, R, c), n = [
    u,
    e.B("flex"),
    S != null && e.M("direction", S),
    g(M, y) && e.M("reverse"),
    P(G),
    c && e.M("pack"),
    p != null && e.M("justify", p),
    t != null && e.M("align", t),
    N === !0 && e.M("wrap"),
    E === !0 && e.M("empty"),
    O === !0 && e.M("center"),
    I === !0 && e.M("bordered"),
    T === !0 && e.M("sharp"),
    b != null && e.M("height", b),
    V === !0 && e.M("square")
  ];
  return r = { borderWidth: B, ...r }, typeof s == "number" ? n.push(e.M("color", s.toString())) : s != null && s !== !1 && (r.color = e.colorVar(s)), typeof i == "number" ? n.push(e.M("bg", i.toString())) : i != null && i !== !1 && (r.backgroundColor = e.colorVar(i)), typeof f == "number" ? n.push(e.M("border-color", f.toString())) : f != null && (r.borderColor = e.colorVar(f)), m === !0 ? n.push(e.M("rounded")) : typeof m == "number" && (r.borderRadius = `${m}rem`), typeof l == "number" ? r.gap = `${l}rem` : l != null && n.push(e.M("gap", l)), typeof o == "number" ? r.flexGrow = o : o === !0 && n.push(e.M("grow")), typeof a == "number" ? r.flexShrink = a : a === !0 && n.push(e.M("shrink")), /* @__PURE__ */ $.jsx(
    d,
    {
      className: e(...n),
      style: r,
      ...h,
      el: h.el ?? "div"
    }
  );
}, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ALIGNMENTS: j,
  Box: Z,
  JUSTIFICATIONS: _,
  alignmentZ: C,
  justificationZ: F,
  parseDirection: v,
  shouldReverse: g
}, Symbol.toStringTag, { value: "Module" }));
export {
  j as A,
  K as B,
  d as E,
  H as G,
  Z as a,
  v as p
};
