const PRESENCE_TTL_MS = 45e3;
const KEY = "__shooter_presence";
function hasEverReported() {
  return store().everReported;
}
function isViewerPresent(now = Date.now(), ttlMs = PRESENCE_TTL_MS) {
  return now - store().lastForegroundAt < ttlMs;
}
function reportPresence(state, now = Date.now()) {
  const s = store();
  s.everReported = true;
  s.lastForegroundAt = state === "foreground" ? now : 0;
}
function store() {
  const g = globalThis;
  if (!g[KEY]) {
    g[KEY] = { everReported: false, lastForegroundAt: 0 };
  }
  return g[KEY];
}

export { hasEverReported as h, isViewerPresent as i, reportPresence as r };
//# sourceMappingURL=presence-store-Bx_g0-Gd.js.map
