import { t as useIntersectionObserver } from "./useIntersectionObserver.js";
import { useState } from "react";
const useIsVisible = (ref, threshold = 1, options, initial = false) => {
	const [isVisible, setIsVisible] = useState(initial);
	const handleIntersectChange = (entries) => {
		setIsVisible(threshold === 0 ? entries[0].intersectionRatio !== threshold : entries[0].intersectionRatio >= threshold);
	};
	useIntersectionObserver(ref, handleIntersectChange, {
		threshold,
		...options
	});
	return isVisible;
};
export { useIsVisible as t };

//# sourceMappingURL=useIsVisible.js.map