import { WaterfallChart as e } from "../../charts/waterfall/index.js";
import { t } from "../../utils-B7XIe3qq.js";
import * as n from "react";
import { jsx as r } from "react/jsx-runtime";
//#region src/react/primitives/chart-waterfall.tsx
function i({ className: i, ...a }) {
	let o = n.useRef(null), s = n.useRef(null);
	return n.useEffect(() => {
		if (o.current) return s.current = new e({
			...a,
			container: o.current
		}), () => {
			s.current?.destroy(), s.current = null;
		};
	}, []), n.useEffect(() => {
		s.current && a.items && s.current.update(a.items);
	}, [a.items]), /* @__PURE__ */ r("div", {
		ref: o,
		"data-slot": "waterfall-chart",
		className: t("w-full", i)
	});
}
//#endregion
export { i as WaterfallChart };

//# sourceMappingURL=chart-waterfall.js.map