import { t as e } from "./utils-B7XIe3qq.js";
import { n as t } from "./dist-CTlQcJNK.js";
import { a as n, o as r, t as i } from "./dist-koa_pEtu.js";
import { t as a } from "./dist-C0wG5dwG.js";
import { t as o } from "./dist-DxtM7vvP.js";
import { t as s } from "./dist-CVCn7F_m.js";
import { t as c } from "./dist-D5o6xae2.js";
import { n as l, r as u, t as d } from "./dist-B1veE5DO.js";
import { t as f } from "./dist-Cao8o5bZ.js";
import * as p from "react";
import { jsx as m, jsxs as h } from "react/jsx-runtime";
//#region node_modules/@radix-ui/react-radio-group/dist/index.mjs
var g = "Radio", [_, v] = n(g), [y, b] = _(g), x = p.forwardRef((e, n) => {
	let { __scopeRadio: a, name: o, checked: s = !1, required: c, disabled: l, value: u = "on", onCheck: d, form: f, ...g } = e, [_, v] = p.useState(null), b = t(n, (e) => v(e)), x = p.useRef(!1), S = _ ? f || !!_.closest("form") : !0;
	return /* @__PURE__ */ h(y, {
		scope: a,
		checked: s,
		disabled: l,
		children: [/* @__PURE__ */ m(i.button, {
			type: "button",
			role: "radio",
			"aria-checked": s,
			"data-state": E(s),
			"data-disabled": l ? "" : void 0,
			disabled: l,
			value: u,
			...g,
			ref: b,
			onClick: r(e.onClick, (e) => {
				s || d?.(), S && (x.current = e.isPropagationStopped(), x.current || e.stopPropagation());
			})
		}), S && /* @__PURE__ */ m(T, {
			control: _,
			bubbles: !x.current,
			name: o,
			value: u,
			checked: s,
			required: c,
			disabled: l,
			form: f,
			style: { transform: "translateX(-100%)" }
		})]
	});
});
x.displayName = g;
var S = "RadioIndicator", C = p.forwardRef((e, t) => {
	let { __scopeRadio: n, forceMount: r, ...a } = e, s = b(S, n);
	return /* @__PURE__ */ m(o, {
		present: r || s.checked,
		children: /* @__PURE__ */ m(i.span, {
			"data-state": E(s.checked),
			"data-disabled": s.disabled ? "" : void 0,
			...a,
			ref: t
		})
	});
});
C.displayName = S;
var w = "RadioBubbleInput", T = p.forwardRef(({ __scopeRadio: e, control: n, checked: r, bubbles: a = !0, ...o }, s) => {
	let l = p.useRef(null), u = t(l, s), d = f(r), h = c(n);
	return p.useEffect(() => {
		let e = l.current;
		if (!e) return;
		let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
		if (d !== r && n) {
			let t = new Event("click", { bubbles: a });
			n.call(e, r), e.dispatchEvent(t);
		}
	}, [
		d,
		r,
		a
	]), /* @__PURE__ */ m(i.input, {
		type: "radio",
		"aria-hidden": !0,
		defaultChecked: r,
		...o,
		tabIndex: -1,
		ref: u,
		style: {
			...o.style,
			...h,
			position: "absolute",
			pointerEvents: "none",
			opacity: 0,
			margin: 0
		}
	});
});
T.displayName = w;
function E(e) {
	return e ? "checked" : "unchecked";
}
var D = [
	"ArrowUp",
	"ArrowDown",
	"ArrowLeft",
	"ArrowRight"
], O = "RadioGroup", [k, A] = n(O, [u, v]), j = u(), M = v(), [N, P] = k(O), F = p.forwardRef((e, t) => {
	let { __scopeRadioGroup: n, name: r, defaultValue: o, value: c, required: u = !1, disabled: d = !1, orientation: f, dir: p, loop: h = !0, onValueChange: g, ..._ } = e, v = j(n), y = s(p), [b, x] = a({
		prop: c,
		defaultProp: o ?? null,
		onChange: g,
		caller: O
	});
	return /* @__PURE__ */ m(N, {
		scope: n,
		name: r,
		required: u,
		disabled: d,
		value: b,
		onValueChange: x,
		children: /* @__PURE__ */ m(l, {
			asChild: !0,
			...v,
			orientation: f,
			dir: y,
			loop: h,
			children: /* @__PURE__ */ m(i.div, {
				role: "radiogroup",
				"aria-required": u,
				"aria-orientation": f,
				"data-disabled": d ? "" : void 0,
				dir: y,
				..._,
				ref: t
			})
		})
	});
});
F.displayName = O;
var I = "RadioGroupItem", L = p.forwardRef((e, n) => {
	let { __scopeRadioGroup: i, disabled: a, ...o } = e, s = P(I, i), c = s.disabled || a, l = j(i), u = M(i), f = p.useRef(null), h = t(n, f), g = s.value === o.value, _ = p.useRef(!1);
	return p.useEffect(() => {
		let e = (e) => {
			D.includes(e.key) && (_.current = !0);
		}, t = () => _.current = !1;
		return document.addEventListener("keydown", e), document.addEventListener("keyup", t), () => {
			document.removeEventListener("keydown", e), document.removeEventListener("keyup", t);
		};
	}, []), /* @__PURE__ */ m(d, {
		asChild: !0,
		...l,
		focusable: !c,
		active: g,
		children: /* @__PURE__ */ m(x, {
			disabled: c,
			required: s.required,
			checked: g,
			...u,
			...o,
			name: s.name,
			ref: h,
			onCheck: () => s.onValueChange(o.value),
			onKeyDown: r((e) => {
				e.key === "Enter" && e.preventDefault();
			}),
			onFocus: r(o.onFocus, () => {
				_.current && f.current?.click();
			})
		})
	});
});
L.displayName = I;
var R = "RadioGroupIndicator", z = p.forwardRef((e, t) => {
	let { __scopeRadioGroup: n, ...r } = e;
	return /* @__PURE__ */ m(C, {
		...M(n),
		...r,
		ref: t
	});
});
z.displayName = R;
var B = F, V = L, H = z;
//#endregion
//#region src/react/primitives/radio-group.tsx
function U({ className: t, ...n }) {
	return /* @__PURE__ */ m(B, {
		"data-slot": "radio-group",
		className: e("flex flex-col gap-3", t),
		...n
	});
}
function W({ className: t, ...n }) {
	return /* @__PURE__ */ m(V, {
		"data-slot": "radio-group-item",
		className: e("border-border-glass text-primary aspect-square h-4 w-4 shrink-0 rounded-full border shadow-sm", "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", t),
		...n,
		children: /* @__PURE__ */ m(H, {
			"data-slot": "radio-group-indicator",
			className: "flex items-center justify-center",
			children: /* @__PURE__ */ m("span", { className: "bg-primary h-2 w-2 rounded-full" })
		})
	});
}
//#endregion
export { W as n, U as t };

//# sourceMappingURL=radio-group-Dum8cfXo.js.map