//#region src/internal/infinite/infiniteLoad.ts
var e = ({ enabled: e, hasNext: t, isLoading: n }) => e && t && !n, t = ({ enabled: t, hasNext: n, isLoading: r, autoLoad: i, isCoolingDown: a }) => i && !a && e({
	enabled: t,
	hasNext: n,
	isLoading: r
}), n = ({ thresholdPx: e = 800, rootMargin: t, axis: n = "vertical" }) => t ?? (n === "both" ? `${e}px` : `0px 0px ${e}px 0px`), r = ({ cooldownMs: e }) => {
	let t = !1, n = null;
	return {
		isCoolingDown: () => t,
		run: (r) => {
			t || (t = !0, r(), n = setTimeout(() => {
				t = !1, n = null;
			}, e));
		},
		clear: () => {
			n != null && clearTimeout(n), n = null, t = !1;
		}
	};
};
//#endregion
export { r as createInfiniteCooldown, n as resolveInfiniteRootMargin, e as shouldObserveInfiniteTrigger, t as shouldTriggerInfiniteLoad };

//# sourceMappingURL=infiniteLoad.js.map