import { useState as c, useCallback as i } from "react";
import { THEME_DATA_ATTRIBUTE as e, THEME_DARK as o } from "../utils/colorScheme.js";
import n from "./useEffectOnce.js";
import f from "./useMutationObserver.js";
const M = () => {
  const [u, r] = c(!1);
  n(() => {
    document.documentElement.getAttribute(e) === o && r(!0);
  });
  const a = i((s) => {
    s.forEach((t) => {
      if (t.type === "attributes" && t.attributeName === e) {
        const m = t.target.getAttribute(e);
        r(m === o);
      }
    });
  }, []);
  return f(document.documentElement, a, {
    attributes: !0,
    childList: !1,
    subtree: !1
  }), u;
};
export {
  M as default
};
//# sourceMappingURL=useDarkMode.js.map
