{"version":3,"file":"environmentManager.cjs","names":["defaultIsServer"],"sources":["../../src/environmentManager.ts"],"sourcesContent":["import { isServer as defaultIsServer } from './utils'\n\n/**\n * A function that returns whether the code is running on the server.\n */\nexport type IsServerValue = () => boolean\n\nlet isServerFn: IsServerValue = () => defaultIsServer\n\n/**\n * Returns whether the current runtime should be treated as a server environment.\n * @returns `true` if the runtime is treated as a server.\n */\nexport const isServer = (): boolean => isServerFn()\n\n/**\n * Manages how TanStack Query detects whether the current runtime should be treated as\n * server-side, which disables scheduling refetch timers and changes the default `retry` count\n * and `gcTime`. By default, the detection treats a missing `window` (or the presence of a\n * `Deno` global) as server.\n *\n * Override this for runtimes where that default detection would give the wrong answer — for\n * example, a Service Worker, where `window` is undefined even though the environment should\n * behave like a client.\n * @example\n * ```ts\n * import { environmentManager } from '@tanstack/query-core'\n *\n * environmentManager.setIsServer(() => false)\n * ```\n */\nexport const environmentManager = {\n  isServer,\n  /**\n   * Overrides the server check globally.\n   * @param isServerValue - A function that returns whether the runtime should be treated as a\n   * server.\n   */\n  setIsServer(isServerValue: IsServerValue): void {\n    isServerFn = isServerValue\n  },\n}\n"],"mappings":";;;AAOA,IAAI,mBAAkCA,cAAAA;;;;;AAMtC,MAAa,iBAA0B,WAAW;;;;;;;;;;;;;;;;;AAkBlD,MAAa,qBAAqB;CAChC;;;;;;CAMA,YAAY,eAAoC;EAC9C,aAAa;CACf;AACF"}