import { useState as i } from "react";
import { z as n } from "zod";
const a = (t) => typeof t == "function", m = (t, e) => a(t) ? t(e) : t, h = (t) => (e) => e == null ? void 0 : t(e), u = (t) => c(t) ? t() : t, c = (t) => typeof t == "function", g = ({
  initial: t,
  value: e,
  onChange: r
}) => {
  const [o, s] = i(e ?? t);
  return e != null && r != null ? [e, r] : [o, s];
}, f = ({
  initial: t,
  value: e,
  onChange: r
}) => {
  const [o, s] = i(
    u(e ?? t)
  );
  return e != null && r != null ? [e, r] : [o, s];
}, S = (t, e) => {
  const [r, o] = i(() => {
    const s = localStorage.getItem(e);
    return s == null ? u(t) : JSON.parse(s);
  });
  return [
    r,
    (s) => {
      o(s), localStorage.setItem(e, JSON.stringify(s));
    }
  ];
}, b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  executeInitialSetter: u,
  executeSetter: m,
  isInitialSetter: c,
  isSetter: a,
  skipNull: h,
  usePassthrough: g,
  usePersisted: S,
  usePurePassthrough: f
}, Symbol.toStringTag, { value: "Module" })), l = ["h1", "h2", "h3", "h4", "h5", "p", "small"], E = n.enum(l), I = (t) => {
  const e = l.indexOf(t);
  return e === -1 || e === l.length - 1 ? t : l[e + 1];
}, O = n.union([
  n.number(),
  n.enum(["normal", "bold", "bolder", "lighter"])
]), L = n.object({
  size: n.number(),
  weight: n.union([n.number(), n.string()]),
  lineHeight: n.number(),
  textTransform: n.string().optional()
}), _ = {
  tiny: "small",
  small: "small",
  medium: "p",
  large: "h5",
  huge: "h2"
}, N = {
  h1: "huge",
  h2: "huge",
  h3: "huge",
  h4: "large",
  h5: "small",
  p: "medium",
  small: "small"
};
export {
  _ as C,
  l as L,
  N as a,
  g as b,
  m as c,
  I as d,
  u as e,
  h as f,
  b as g,
  E as l,
  L as s,
  f as u,
  O as w
};
