import { jsx as t, Fragment as S, jsxs as c } from "react/jsx-runtime";
import * as u from "react";
import { Root as x } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@19.2.8_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.es.js";
import { cva as f } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.es.js";
import { cn as d } from "../../utils/tailwindUtil.es.js";
const C = f(
  "inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground hover:bg-primary/90",
        destructive: "bg-destructive text-primary-foreground hover:bg-destructive/90",
        cool: "dark:inset-shadow-2xs dark:inset-shadow-white/10 bg-linear-to-t border border-b-2 border-zinc-950/40 from-primary to-primary/85 shadow-md shadow-primary/20 ring-1 ring-inset ring-white/25 transition-[filter] duration-200 hover:brightness-110 active:brightness-90 dark:border-x-0 text-primary-foreground dark:text-primary-foreground dark:border-t-0 dark:border-primary/50 dark:ring-white/5",
        outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
        secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
        ghost: "hover:bg-accent hover:text-accent-foreground",
        link: "text-primary underline-offset-4 hover:underline"
      },
      size: {
        default: "h-9 px-4 py-2",
        sm: "h-8 rounded-md px-3 text-xs",
        lg: "h-10 rounded-md px-8",
        icon: "h-9 w-9"
      }
    },
    defaultVariants: {
      variant: "default",
      size: "default"
    }
  }
), D = u.forwardRef(
  ({ className: o, variant: e, size: a, asChild: i = !1, ...r }, n) => /* @__PURE__ */ t(
    i ? x : "button",
    {
      className: d(C({ variant: e, size: a, className: o })),
      ref: n,
      ...r
    }
  )
);
D.displayName = "Button";
const k = f(
  "inline-flex items-center transition-colors justify-center cursor-pointer gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
  {
    variants: {
      variant: {
        default: "bg-transparent hover:scale-105 duration-300 transition text-primary",
        destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
        outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
        secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
        ghost: "hover:bg-accent hover:text-accent-foreground",
        link: "text-primary underline-offset-4 hover:underline"
      },
      size: {
        default: "h-9 px-4 py-2 has-[>svg]:px-3",
        sm: "h-8 text-xs gap-1.5 px-4 has-[>svg]:px-4",
        lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
        xl: "h-12 rounded-md px-8 has-[>svg]:px-6",
        xxl: "h-14 rounded-md px-10 has-[>svg]:px-8",
        icon: "size-9"
      }
    },
    defaultVariants: {
      variant: "default",
      size: "xxl"
    }
  }
);
function G({
  className: o,
  variant: e,
  size: a,
  asChild: i = !1,
  children: r,
  ...n
}) {
  return /* @__PURE__ */ t(S, { children: /* @__PURE__ */ c(
    i ? x : "button",
    {
      "data-slot": "button",
      className: d(
        "relative",
        k({ variant: e, size: a, className: o })
      ),
      ...n,
      children: [
        /* @__PURE__ */ t("div", { className: `absolute top-0 left-0 z-0 h-full w-full rounded-full 
            shadow-[0_0_6px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3px_rgba(0,0,0,0.9),inset_-3px_-3px_0.5px_-3px_rgba(0,0,0,0.85),inset_1px_1px_1px_-0.5px_rgba(0,0,0,0.6),inset_-1px_-1px_1px_-0.5px_rgba(0,0,0,0.6),inset_0_0_6px_6px_rgba(0,0,0,0.12),inset_0_0_2px_2px_rgba(0,0,0,0.06),0_0_12px_rgba(255,255,255,0.15)] 
        transition-all 
        dark:shadow-[0_0_8px_rgba(0,0,0,0.03),0_2px_6px_rgba(0,0,0,0.08),inset_3px_3px_0.5px_-3.5px_rgba(255,255,255,0.09),inset_-3px_-3px_0.5px_-3.5px_rgba(255,255,255,0.85),inset_1px_1px_1px_-0.5px_rgba(255,255,255,0.6),inset_-1px_-1px_1px_-0.5px_rgba(255,255,255,0.6),inset_0_0_6px_6px_rgba(255,255,255,0.12),inset_0_0_2px_2px_rgba(255,255,255,0.06),0_0_12px_rgba(0,0,0,0.15)]` }),
        /* @__PURE__ */ t(
          "div",
          {
            className: "absolute top-0 left-0 w-full h-full overflow-hidden rounded-md isolate -z-10",
            style: { backdropFilter: 'url("#container-glass")' }
          }
        ),
        /* @__PURE__ */ t("div", { className: "z-10 pointer-events-none ", children: r }),
        /* @__PURE__ */ t(A, {})
      ]
    }
  ) });
}
function A() {
  return /* @__PURE__ */ t("svg", { className: "hidden", children: /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ c(
    "filter",
    {
      id: "container-glass",
      x: "0%",
      y: "0%",
      width: "100%",
      height: "100%",
      colorInterpolationFilters: "sRGB",
      children: [
        /* @__PURE__ */ t(
          "feTurbulence",
          {
            type: "fractalNoise",
            baseFrequency: "0.05 0.05",
            numOctaves: "1",
            seed: "1",
            result: "turbulence"
          }
        ),
        /* @__PURE__ */ t("feGaussianBlur", { in: "turbulence", stdDeviation: "2", result: "blurredNoise" }),
        /* @__PURE__ */ t(
          "feDisplacementMap",
          {
            in: "SourceGraphic",
            in2: "blurredNoise",
            scale: "70",
            xChannelSelector: "R",
            yChannelSelector: "B",
            result: "displaced"
          }
        ),
        /* @__PURE__ */ t("feGaussianBlur", { in: "displaced", stdDeviation: "4", result: "finalBlur" }),
        /* @__PURE__ */ t("feComposite", { in: "finalBlur", in2: "finalBlur", operator: "over" })
      ]
    }
  ) }) });
}
const N = {
  default: {
    outer: "bg-gradient-to-b from-[#000] to-[#A0A0A0]",
    inner: "bg-gradient-to-b from-[#FAFAFA] via-[#3E3E3E] to-[#E5E5E5]",
    button: "bg-gradient-to-b from-[#B9B9B9] to-[#969696]",
    textColor: "text-white",
    textShadow: "[text-shadow:0-1px_0_rgb(80_80_80_/_100%)]"
  },
  primary: {
    outer: "bg-gradient-to-b from-[#000] to-[#A0A0A0]",
    inner: "bg-gradient-to-b from-primary via-secondary to-muted",
    button: "bg-gradient-to-b from-primary to-primary/40",
    textColor: "text-white",
    textShadow: "[text-shadow:0-1px_0_rgb(30_58_138_/_100%)]"
  },
  success: {
    outer: "bg-gradient-to-b from-[#005A43] to-[#7CCB9B]",
    inner: "bg-gradient-to-b from-[#E5F8F0] via-[#00352F] to-[#D1F0E6]",
    button: "bg-gradient-to-b from-[#9ADBC8] to-[#3E8F7C]",
    textColor: "text-[#FFF7F0]",
    textShadow: "[text-shadow:0-1px_0_rgb(6_78_59_/_100%)]"
  },
  error: {
    outer: "bg-gradient-to-b from-[#5A0000] to-[#FFAEB0]",
    inner: "bg-gradient-to-b from-[#FFDEDE] via-[#680002] to-[#FFE9E9]",
    button: "bg-gradient-to-b from-[#F08D8F] to-[#A45253]",
    textColor: "text-[#FFF7F0]",
    textShadow: "[text-shadow:0-1px_0_rgb(146_64_14_/_100%)]"
  },
  gold: {
    outer: "bg-gradient-to-b from-[#917100] to-[#EAD98F]",
    inner: "bg-gradient-to-b from-[#FFFDDD] via-[#856807] to-[#FFF1B3]",
    button: "bg-gradient-to-b from-[#FFEBA1] to-[#9B873F]",
    textColor: "text-[#FFFDE5]",
    textShadow: "[text-shadow:0-1px_0_rgb(178_140_2_/_100%)]"
  },
  bronze: {
    outer: "bg-gradient-to-b from-[#864813] to-[#E9B486]",
    inner: "bg-gradient-to-b from-[#EDC5A1] via-[#5F2D01] to-[#FFDEC1]",
    button: "bg-gradient-to-b from-[#FFE3C9] to-[#A36F3D]",
    textColor: "text-[#FFF7F0]",
    textShadow: "[text-shadow:0-1px_0_rgb(124_45_18_/_100%)]"
  }
}, z = (o = "default", e, a, i) => {
  const r = N[o], n = "all 250ms cubic-bezier(0.1, 0.4, 0.2, 1)";
  return {
    wrapper: d(
      "relative inline-flex transform-gpu rounded-md p-[1.25px] will-change-transform",
      r.outer
    ),
    wrapperStyle: {
      transform: e ? "translateY(2.5px) scale(0.99)" : "translateY(0) scale(1)",
      boxShadow: e ? "0 1px 2px rgba(0, 0, 0, 0.15)" : a && !i ? "0 4px 12px rgba(0, 0, 0, 0.12)" : "0 3px 8px rgba(0, 0, 0, 0.08)",
      transition: n,
      transformOrigin: "center center"
    },
    inner: d(
      "absolute inset-[1px] transform-gpu rounded-lg will-change-transform",
      r.inner
    ),
    innerStyle: {
      transition: n,
      transformOrigin: "center center",
      filter: a && !e && !i ? "brightness(1.05)" : "none"
    },
    button: d(
      "relative z-10 m-[1px] rounded-md inline-flex h-11 transform-gpu cursor-pointer items-center justify-center overflow-hidden rounded-md px-6 py-2 text-sm leading-none font-semibold will-change-transform outline-none",
      r.button,
      r.textColor,
      r.textShadow
    ),
    buttonStyle: {
      transform: e ? "scale(0.97)" : "scale(1)",
      transition: n,
      transformOrigin: "center center",
      filter: a && !e && !i ? "brightness(1.02)" : "none"
    }
  };
}, I = ({ isPressed: o }) => /* @__PURE__ */ t(
  "div",
  {
    className: d(
      "pointer-events-none absolute inset-0 z-20 overflow-hidden transition-opacity duration-300",
      o ? "opacity-20" : "opacity-0"
    ),
    children: /* @__PURE__ */ t("div", { className: "absolute inset-0 rounded-md bg-gradient-to-r from-transparent via-neutral-100 to-transparent" })
  }
), M = u.forwardRef(({ children: o, className: e, variant: a = "default", ...i }, r) => {
  const [n, s] = u.useState(!1), [g, b] = u.useState(!1), [p, _] = u.useState(!1);
  u.useEffect(() => {
    _("ontouchstart" in window || navigator.maxTouchPoints > 0);
  }, []);
  const m = o || "Button", l = z(
    a,
    n,
    g,
    p
  ), h = () => {
    s(!0);
  }, v = () => {
    s(!1);
  }, y = () => {
    s(!1), b(!1);
  }, w = () => {
    p || b(!0);
  }, F = () => {
    s(!0);
  }, E = () => {
    s(!1);
  }, B = () => {
    s(!1);
  };
  return /* @__PURE__ */ c("div", { className: l.wrapper, style: l.wrapperStyle, children: [
    /* @__PURE__ */ t("div", { className: l.inner, style: l.innerStyle }),
    /* @__PURE__ */ c(
      "button",
      {
        ref: r,
        className: d(l.button, e),
        style: l.buttonStyle,
        ...i,
        onMouseDown: h,
        onMouseUp: v,
        onMouseLeave: y,
        onMouseEnter: w,
        onTouchStart: F,
        onTouchEnd: E,
        onTouchCancel: B,
        children: [
          /* @__PURE__ */ t(I, { isPressed: n }),
          m,
          g && !n && !p && /* @__PURE__ */ t("div", { className: "absolute inset-0 rounded-lg pointer-events-none bg-gradient-to-t from-transparent to-white/5" })
        ]
      }
    )
  ] });
});
M.displayName = "MetalButton";
export {
  D as Button,
  G as LiquidButton,
  M as MetalButton,
  C as buttonVariants,
  k as liquidbuttonVariants
};
//# sourceMappingURL=button.es.js.map
