import { cn } from "../../lib/utils.js";
import { c } from "react/compiler-runtime";
import "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { XIcon } from "lucide-react";
import * as DialogPrimitive from "@radix-ui/react-dialog";
function Dialog(e) {
	let i = c(4), a;
	i[0] === e ? a = i[1] : ({...a} = e, i[0] = e, i[1] = a);
	let s;
	return i[2] === a ? s = i[3] : (s = /* @__PURE__ */ jsx(DialogPrimitive.Root, {
		"data-slot": "dialog",
		...a
	}), i[2] = a, i[3] = s), s;
}
function DialogTrigger(e) {
	let i = c(4), a;
	i[0] === e ? a = i[1] : ({...a} = e, i[0] = e, i[1] = a);
	let s;
	return i[2] === a ? s = i[3] : (s = /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
		"data-slot": "dialog-trigger",
		...a
	}), i[2] = a, i[3] = s), s;
}
function DialogPortal(e) {
	let i = c(4), a;
	i[0] === e ? a = i[1] : ({...a} = e, i[0] = e, i[1] = a);
	let s;
	return i[2] === a ? s = i[3] : (s = /* @__PURE__ */ jsx(DialogPrimitive.Portal, {
		"data-slot": "dialog-portal",
		...a
	}), i[2] = a, i[3] = s), s;
}
function DialogClose(e) {
	let i = c(4), a;
	i[0] === e ? a = i[1] : ({...a} = e, i[0] = e, i[1] = a);
	let s;
	return i[2] === a ? s = i[3] : (s = /* @__PURE__ */ jsx(DialogPrimitive.Close, {
		"data-slot": "dialog-close",
		...a
	}), i[2] = a, i[3] = s), s;
}
function DialogOverlay(i) {
	let a = c(8), s, l;
	a[0] === i ? (s = a[1], l = a[2]) : ({className: s, ...l} = i, a[0] = i, a[1] = s, a[2] = l);
	let u;
	a[3] === s ? u = a[4] : (u = 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 bg-black/50", s), a[3] = s, a[4] = u);
	let d;
	return a[5] !== l || a[6] !== u ? (d = /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
		"data-slot": "dialog-overlay",
		className: u,
		...l
	}), a[5] = l, a[6] = u, a[7] = d) : d = a[7], d;
}
function DialogContent(s) {
	let l = c(15), d, f, p, m;
	l[0] === s ? (d = l[1], f = l[2], p = l[3], m = l[4]) : ({className: f, children: d, showCloseButton: m, ...p} = s, l[0] = s, l[1] = d, l[2] = f, l[3] = p, l[4] = m);
	let h = m === void 0 ? !0 : m, g;
	l[5] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(DialogOverlay, {}), l[5] = g) : g = l[5];
	let _;
	l[6] === f ? _ = l[7] : (_ = cn("bg-background 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 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", f), l[6] = f, l[7] = _);
	let v;
	l[8] === h ? v = l[9] : (v = h && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
		"data-slot": "dialog-close",
		className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
		children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
			className: "sr-only",
			children: "Close"
		})]
	}), l[8] = h, l[9] = v);
	let y;
	return l[10] !== d || l[11] !== p || l[12] !== _ || l[13] !== v ? (y = /* @__PURE__ */ jsxs(DialogPortal, {
		"data-slot": "dialog-portal",
		children: [g, /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
			"data-slot": "dialog-content",
			className: _,
			...p,
			children: [d, v]
		})]
	}), l[10] = d, l[11] = p, l[12] = _, l[13] = v, l[14] = y) : y = l[14], y;
}
function DialogHeader(i) {
	let a = c(8), o, s;
	a[0] === i ? (o = a[1], s = a[2]) : ({className: o, ...s} = i, a[0] = i, a[1] = o, a[2] = s);
	let l;
	a[3] === o ? l = a[4] : (l = cn("flex flex-col gap-2 text-center sm:text-left", o), a[3] = o, a[4] = l);
	let u;
	return a[5] !== s || a[6] !== l ? (u = /* @__PURE__ */ jsx("div", {
		"data-slot": "dialog-header",
		className: l,
		...s
	}), a[5] = s, a[6] = l, a[7] = u) : u = a[7], u;
}
function DialogFooter(i) {
	let a = c(8), o, s;
	a[0] === i ? (o = a[1], s = a[2]) : ({className: o, ...s} = i, a[0] = i, a[1] = o, a[2] = s);
	let l;
	a[3] === o ? l = a[4] : (l = cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", o), a[3] = o, a[4] = l);
	let u;
	return a[5] !== s || a[6] !== l ? (u = /* @__PURE__ */ jsx("div", {
		"data-slot": "dialog-footer",
		className: l,
		...s
	}), a[5] = s, a[6] = l, a[7] = u) : u = a[7], u;
}
function DialogTitle$1(i) {
	let a = c(8), s, l;
	a[0] === i ? (s = a[1], l = a[2]) : ({className: s, ...l} = i, a[0] = i, a[1] = s, a[2] = l);
	let u;
	a[3] === s ? u = a[4] : (u = cn("text-lg leading-none font-semibold", s), a[3] = s, a[4] = u);
	let d;
	return a[5] !== l || a[6] !== u ? (d = /* @__PURE__ */ jsx(DialogPrimitive.Title, {
		"data-slot": "dialog-title",
		className: u,
		...l
	}), a[5] = l, a[6] = u, a[7] = d) : d = a[7], d;
}
function DialogDescription(i) {
	let a = c(8), s, l;
	a[0] === i ? (s = a[1], l = a[2]) : ({className: s, ...l} = i, a[0] = i, a[1] = s, a[2] = l);
	let u;
	a[3] === s ? u = a[4] : (u = cn("text-muted-foreground text-sm", s), a[3] = s, a[4] = u);
	let d;
	return a[5] !== l || a[6] !== u ? (d = /* @__PURE__ */ jsx(DialogPrimitive.Description, {
		"data-slot": "dialog-description",
		className: u,
		...l
	}), a[5] = l, a[6] = u, a[7] = d) : d = a[7], d;
}
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle$1 as DialogTitle, DialogTrigger };
