import { __read as n } from "../../../../tslib/tslib.es6.es.js";
import { useContext as i, useState as u } from "react";
import { MotionConfigContext as d } from "../context/MotionConfigContext.es.js";
import { isBrowser as a } from "./is-browser.es.js";
var t = { current: null }, o = !1;
function c() {
  if (o = !0, !!a)
    if (window.matchMedia) {
      var r = window.matchMedia("(prefers-reduced-motion)"), e = function() {
        return t.current = r.matches;
      };
      r.addListener(e), e();
    } else
      t.current = !1;
}
function f() {
  !o && c();
  var r = n(u(t.current), 1), e = r[0];
  return e;
}
function v() {
  var r = f(), e = i(d).reducedMotion;
  return e === "never" ? !1 : e === "always" ? !0 : r;
}
export {
  f as useReducedMotion,
  v as useReducedMotionConfig
};
//# sourceMappingURL=use-reduced-motion.es.js.map
