"use client";
import { cn as e } from "../../lib/utils.js";
import { motion as t } from "../../node_modules/motion/dist/es/react.js";
import { memo as n, useMemo as r } from "react";
import { jsx as i } from "react/jsx-runtime";
var a = n(({ children: n, as: a = "p", className: o, duration: s = 2, spread: c = 2 }) => {
	let l = t.create(a), u = r(() => (n?.length ?? 0) * c, [n, c]);
	return /* @__PURE__ */ i(l, {
		animate: { backgroundPosition: "0% center" },
		className: e("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", "[background-repeat:no-repeat,padding-box] [--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))]", o),
		initial: { backgroundPosition: "100% center" },
		style: {
			"--spread": `${u}px`,
			backgroundImage: "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"
		},
		transition: {
			repeat: Infinity,
			duration: s,
			ease: "linear"
		},
		children: n
	});
});
//#endregion
export { a as Shimmer };
