"use client";
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { Slot } from '@radix-ui/react-slot';
import { cva } from 'class-variance-authority';
import { Loader2 } from 'lucide-react';
import * as React from 'react';
import { jsxs, jsx } from 'react/jsx-runtime';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
__name(cn, "cn");
var buttonVariants = cva(
  "inline-flex items-center 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 shadow hover:bg-primary/90",
        destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
        outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
        secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
        ghost: "hover:bg-accent hover:text-accent-foreground",
        link: "text-primary underline-offset-4 hover:underline",
        // Keep the additional Hanzo variants for backward compatibility
        primary: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
        linkFG: "text-primary underline-offset-4 hover:underline",
        linkMuted: "text-muted-foreground underline-offset-4 hover:underline hover:text-foreground"
      },
      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"
    }
  }
);
var Button = React.forwardRef(
  ({ className, variant, size, asChild = false, isLoading = false, children, ...props }, ref) => {
    const Comp = asChild ? Slot : "button";
    return /* @__PURE__ */ jsxs(
      Comp,
      {
        className: cn(buttonVariants({ variant, size, className })),
        ref,
        ...props,
        children: [
          isLoading ? /* @__PURE__ */ jsx(
            Loader2,
            {
              className: cn("h-4 w-4 animate-spin", size !== "icon" && "mr-2")
            }
          ) : null,
          isLoading && size === "icon" ? null : children
        ]
      }
    );
  }
);
Button.displayName = "Button";
var AlertDialog = AlertDialogPrimitive.Root;
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
var AlertDialogPortal = AlertDialogPrimitive.Portal;
var AlertDialogOverlay = /* @__PURE__ */ __name(({
  className,
  children,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(
  AlertDialogPrimitive.Overlay,
  {
    className: cn(
      "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",
      "bg-bg-dark/90",
      className
    ),
    ...props,
    ref
  }
), "AlertDialogOverlay");
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
var AlertDialogContent = /* @__PURE__ */ __name(({
  className,
  ref,
  ...props
}) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
  /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
  /* @__PURE__ */ jsx(
    AlertDialogPrimitive.Content,
    {
      className: cn(
        "bg-bg-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-divider fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
        className
      ),
      ref,
      ...props
    }
  )
] }), "AlertDialogContent");
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
var AlertDialogHeader = /* @__PURE__ */ __name(({
  className,
  ...props
}) => /* @__PURE__ */ jsx(
  "div",
  {
    className: cn(
      "flex flex-col space-y-2 text-center sm:text-left",
      className
    ),
    ...props
  }
), "AlertDialogHeader");
AlertDialogHeader.displayName = "AlertDialogHeader";
var AlertDialogFooter = /* @__PURE__ */ __name(({
  className,
  ...props
}) => /* @__PURE__ */ jsx("div", { className: cn("flex", className), ...props }), "AlertDialogFooter");
AlertDialogFooter.displayName = "AlertDialogFooter";
var AlertDialogTitle = /* @__PURE__ */ __name(({
  className,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(
  AlertDialogPrimitive.Title,
  {
    className: cn("text-lg font-semibold", className),
    ref,
    ...props
  }
), "AlertDialogTitle");
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
var AlertDialogDescription = /* @__PURE__ */ __name(({
  className,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(
  AlertDialogPrimitive.Description,
  {
    className: cn("text-text-secondary text-sm", className),
    ref,
    ...props
  }
), "AlertDialogDescription");
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
var AlertDialogAction = /* @__PURE__ */ __name(({
  className,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(
  AlertDialogPrimitive.Action,
  {
    className: cn(
      buttonVariants({ variant: "default", size: "sm" }),
      className
    ),
    ref,
    ...props
  }
), "AlertDialogAction");
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
var AlertDialogCancel = /* @__PURE__ */ __name(({
  className,
  ref,
  ...props
}) => /* @__PURE__ */ jsx(
  AlertDialogPrimitive.Cancel,
  {
    className: cn(
      buttonVariants({ variant: "outline", size: "sm" }),
      className
    ),
    ref,
    ...props
  }
), "AlertDialogCancel");
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;

export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
