/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../_virtual/_rolldown/runtime.cjs");
let react = require("react");
//#region src/hooks/usePrefersReducedMotion.ts
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
/**
* Module-level singleton store so every consumer of the hook shares a single
* MediaQueryList `change` listener instead of registering one per hook instance.
*/
const subscribers = /* @__PURE__ */ new Set();
let mediaQueryList = null;
const getMediaQueryList = () => {
	if (!mediaQueryList && typeof window !== "undefined" && typeof window.matchMedia === "function") mediaQueryList = window.matchMedia(REDUCED_MOTION_QUERY);
	return mediaQueryList;
};
const notifySubscribers = () => {
	subscribers.forEach((notify) => notify());
};
const subscribe = (notify) => {
	const currentMediaQueryList = getMediaQueryList();
	if (currentMediaQueryList && subscribers.size === 0) currentMediaQueryList.addEventListener("change", notifySubscribers);
	subscribers.add(notify);
	return () => {
		subscribers.delete(notify);
		if (subscribers.size === 0 && mediaQueryList) {
			mediaQueryList.removeEventListener("change", notifySubscribers);
			mediaQueryList = null;
		}
	};
};
const getSnapshot = () => getMediaQueryList()?.matches ?? false;
const getServerSnapshot = () => false;
const usePrefersReducedMotion = () => (0, react.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
//#endregion
exports.usePrefersReducedMotion = usePrefersReducedMotion;
