'use strict'; var web = require('solid-js/web'); var rootless = require('@solid-primitives/rootless'); var utils = require('@solid-primitives/utils'); var eventListener = require('@solid-primitives/event-listener'); // src/index.ts exports.createPageVisibility = () => { if (web.isServer) { return utils.trueFn; } const checkVisibility = () => document.visibilityState === "visible"; const [isVisible, setVisible] = utils.createHydratableSignal(true, checkVisibility); eventListener.makeEventListener(document, "visibilitychange", () => setVisible(checkVisibility)); return isVisible; }; exports.usePageVisibility = /* @__PURE__ */ rootless.createHydratableSingletonRoot(exports.createPageVisibility);