import { cn } from "../../lib/utils.js";
import * as React$1 from "react";
import { jsx, jsxs } from "react/jsx-runtime";
import * as SliderPrimitive from "@radix-ui/react-slider";
function Slider({ className: a, defaultValue: o, value: s, min: c = 0, max: l = 100, ...u }) {
	let d = React$1.useMemo(() => Array.isArray(s) ? s : Array.isArray(o) ? o : [c, l], [
		s,
		o,
		c,
		l
	]);
	return /* @__PURE__ */ jsxs(SliderPrimitive.Root, {
		"data-slot": "slider",
		defaultValue: o,
		value: s,
		min: c,
		max: l,
		className: cn("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", a),
		...u,
		children: [/* @__PURE__ */ jsx(SliderPrimitive.Track, {
			"data-slot": "slider-track",
			className: cn("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),
			children: /* @__PURE__ */ jsx(SliderPrimitive.Range, {
				"data-slot": "slider-range",
				className: cn("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")
			})
		}), Array.from({ length: d.length }, (e, i) => /* @__PURE__ */ jsx(SliderPrimitive.Thumb, {
			"data-slot": "slider-thumb",
			className: "border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50",
			"aria-label": u["aria-label"],
			"aria-labelledby": u["aria-labelledby"]
		}, i))]
	});
}
export { Slider };
