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