{"version":3,"sources":["../src/client-revalidation.ts","../src/server-query-runtime.ts"],"sourcesContent":["export type FarmRevalidationListenerOptions = {\n  refetchOnWindowFocus?: boolean;\n  refetchOnReconnect?: boolean;\n};\n\n/**\n * Attach the shared window focus/reconnect revalidation listeners used by every\n * query consumer (React `useServerQuery` and the renderer-neutral\n * `createRendererQuery`). Connectivity-driven refresh behavior must live here\n * so all renderers observe the same triggers.\n *\n * Returns a disposer; a no-op outside the browser.\n */\nexport function attachRevalidationListeners(\n  refresh: () => void,\n  options: FarmRevalidationListenerOptions = {},\n): () => void {\n  if (typeof window === \"undefined\") return () => {};\n\n  const onFocus = options.refetchOnWindowFocus === false ? undefined : refresh;\n  const onOnline = options.refetchOnReconnect === false ? undefined : refresh;\n\n  if (onFocus) window.addEventListener(\"focus\", onFocus);\n  if (onOnline) window.addEventListener(\"online\", onOnline);\n  return () => {\n    if (onFocus) window.removeEventListener(\"focus\", onFocus);\n    if (onOnline) window.removeEventListener(\"online\", onOnline);\n  };\n}\n","\"use client\";\n\nimport { createFarmCacheKey } from \"./cache\";\nimport { getFarmClientDataCache, trackFarmClientCacheInvalidations } from \"./client-cache\";\nimport type { ServerQuery } from \"./server-query\";\nimport { isFarmServerQueryResult, type FarmServerQueryResult } from \"./server-query-protocol\";\n\nexport type ServerQueryFetchOptions = {\n  /** Used only when a non-Farm transport returns plain data. Farm transports use the declaration. */\n  staleTime?: number | false;\n  /** Return stale data immediately while refreshing it in the background. Default true. */\n  swr?: boolean;\n  /** Always wait for a new result. */\n  force?: boolean;\n};\n\nexport type FarmServerQueryActionInvocation = {\n  actionId: string;\n  args: readonly unknown[];\n  provisionalKey?: string;\n  owner?: object;\n};\n\ntype ActiveServerQueryInvocation = {\n  provisionalKey: string;\n  owner: object;\n};\n\ntype ServerQueryOwner = {\n  invalidations: ReturnType<typeof trackFarmClientCacheInvalidations>;\n  supersededKeys: Set<string>;\n};\n\ntype ServerQueryClientState = {\n  functionIds: WeakMap<Function, number>;\n  nextFunctionId: number;\n  active: ActiveServerQueryInvocation[];\n  latestOwners: Map<string, object>;\n  owners: Set<ServerQueryOwner>;\n};\n\nconst FARM_SERVER_QUERY_CLIENT_STATE = Symbol.for(\"farm.serverQueryClientState\");\nconst serverQueryClientGlobal = globalThis as typeof globalThis & {\n  [FARM_SERVER_QUERY_CLIENT_STATE]?: ServerQueryClientState;\n};\nconst serverQueryClientState: ServerQueryClientState = (serverQueryClientGlobal[\n  FARM_SERVER_QUERY_CLIENT_STATE\n] ??= {\n  functionIds: new WeakMap(),\n  nextFunctionId: 0,\n  active: [],\n  latestOwners: new Map(),\n  owners: new Set(),\n});\nserverQueryClientState.latestOwners ??= new Map();\nserverQueryClientState.owners ??= new Set();\n\nfunction isServerQueryOwnerSuperseded(owner: ServerQueryOwner, key: string): boolean {\n  const cache = getFarmClientDataCache();\n  const resolved = cache.resolveKey(key);\n  for (const superseded of owner.supersededKeys ?? []) {\n    if (cache.resolveKey(superseded) === resolved) return true;\n  }\n  return false;\n}\n\nfunction claimServerQueryKey(owner: ServerQueryOwner, key: string): boolean {\n  if (isServerQueryOwnerSuperseded(owner, key)) return false;\n  const resolved = getFarmClientDataCache().resolveKey(key);\n  // Set iteration follows request start order, not response timestamps. Record\n  // the claim on older live requests so it survives this owner's completion,\n  // even when an older reference only learns its canonical key afterward.\n  for (const older of serverQueryClientState.owners) {\n    if (older === owner) break;\n    older.supersededKeys.add(resolved);\n  }\n  return true;\n}\n\n// Global symbol registry key set on raw server query implementations by\n// createServerQuery. Referenced via Symbol.for instead of importing\n// server-query.ts, which would pull the server handler pipeline into the\n// client bundle.\nconst RAW_SERVER_QUERY_SYMBOL = Symbol.for(\"farm.server-query\");\n\n/**\n * A query reaching the browser should be a transformed server reference. The\n * raw implementation carries the server query symbol; executing it here would\n * run the server handler in the browser (#408). During SSR the raw\n * implementation is expected and runs directly.\n */\nfunction assertNotRawServerQueryInBrowser(query: unknown): void {\n  if (typeof window === \"undefined\" || typeof document === \"undefined\") return;\n  if (!(query as Record<symbol, unknown> | null)?.[RAW_SERVER_QUERY_SYMBOL]) return;\n  throw new Error(\n    [\n      \"useServerQuery received a raw server query implementation in the browser.\",\n      \"Server query handlers run only on the server. Enable the server-function transform (add @farm.js/plugin/rsc and set experimental.serverActions: true in farm.config.ts) so client imports become server references,\",\n      \"or call the query from server code / an API route (createAPIClient) instead.\",\n    ].join(\"\\n\"),\n  );\n}\n\nexport function beginFarmServerQueryAction(\n  actionId: string,\n  args: readonly unknown[],\n): FarmServerQueryActionInvocation {\n  const active = serverQueryClientState.active.at(-1);\n  return {\n    actionId,\n    args,\n    provisionalKey: active?.provisionalKey,\n    owner: active?.owner,\n  };\n}\n\nexport function completeFarmServerQueryAction<TData>(\n  invocation: FarmServerQueryActionInvocation,\n  value: TData | FarmServerQueryResult<TData>,\n): TData {\n  if (!isFarmServerQueryResult(value)) return value as TData;\n\n  const cache = getFarmClientDataCache();\n  const metadata = value.__farmServerQuery;\n  if (!shouldApplyFarmServerQueryActionResult(invocation)) {\n    return value.data as TData;\n  }\n  if (invocation.provisionalKey) {\n    cache.alias(invocation.provisionalKey, metadata.key);\n  }\n  const owner = invocation.owner as ServerQueryOwner | undefined;\n  if (\n    owner &&\n    serverQueryClientState.owners.has(owner) &&\n    !claimServerQueryKey(owner, metadata.key)\n  ) {\n    return value.data as TData;\n  }\n  const invalidated = (invocation.owner as ServerQueryOwner | undefined)?.invalidations?.has(\n    metadata.key,\n  );\n\n  cache.set(metadata.key, {\n    data: value.data,\n    updatedAt: metadata.updatedAt,\n    staleAt: invalidated\n      ? 0\n      : metadata.staleTime === false\n        ? Number.POSITIVE_INFINITY\n        : metadata.updatedAt + metadata.staleTime,\n    status: \"success\",\n    error: null,\n    fetching: false,\n    persist: metadata.persist === true ? true : undefined,\n  });\n\n  return value.data as TData;\n}\n\nexport function shouldApplyFarmServerQueryActionResult(\n  invocation: FarmServerQueryActionInvocation,\n): boolean {\n  if (!invocation.provisionalKey || !invocation.owner) return true;\n  return isCurrentServerQueryOwner(invocation.provisionalKey, invocation.owner);\n}\n\nfunction isCurrentServerQueryOwner(provisionalKey: string, owner: object): boolean {\n  return (\n    serverQueryClientState.latestOwners.get(provisionalKey) === owner &&\n    !isServerQueryOwnerSuperseded(owner as ServerQueryOwner, provisionalKey)\n  );\n}\n\nexport function createServerQueryCallKey<TInput, TData>(\n  query: ServerQuery<TInput, TData>,\n  input: TInput,\n): string {\n  let id = serverQueryClientState.functionIds.get(query);\n  if (!id) {\n    id = ++serverQueryClientState.nextFunctionId;\n    serverQueryClientState.functionIds.set(query, id);\n  }\n  return createFarmCacheKey([\"server-query-call\", id, input]);\n}\n\nexport async function fetchServerQuery<TInput, TData>(\n  query: ServerQuery<TInput, TData>,\n  input: TInput,\n  options: ServerQueryFetchOptions = {},\n): Promise<TData> {\n  const cache = getFarmClientDataCache();\n  const provisionalKey = createServerQueryCallKey(query, input);\n  const entry = cache.get<TData>(provisionalKey);\n  const stale = cache.isStale(provisionalKey);\n  const inflight = cache.getInflight<TData>(provisionalKey);\n\n  if (\n    !options.force &&\n    entry &&\n    stale &&\n    (entry.status !== \"pending\" || entry.updatedAt !== 0) &&\n    entry.status !== \"error\" &&\n    (options.swr ?? true)\n  ) {\n    // Every SWR reader can use the previous value, including while another\n    // reader owns the refresh. Initial pending reads still wait below.\n    if (!inflight) {\n      void executeServerQuery(query, input, provisionalKey, options).catch(() => undefined);\n    }\n    return entry.data;\n  }\n\n  if (inflight && !options.force) return inflight;\n  if (!options.force && entry && !stale && entry.status !== \"error\") return entry.data;\n\n  return executeServerQuery(query, input, provisionalKey, options);\n}\n\nexport function prefetchServerQuery<TInput, TData>(\n  query: ServerQuery<TInput, TData>,\n  input: TInput,\n  options: Omit<ServerQueryFetchOptions, \"force\"> = {},\n): Promise<TData> {\n  return fetchServerQuery(query, input, options);\n}\n\nasync function executeServerQuery<TInput, TData>(\n  query: ServerQuery<TInput, TData>,\n  input: TInput,\n  provisionalKey: string,\n  options: ServerQueryFetchOptions,\n): Promise<TData> {\n  assertNotRawServerQueryInBrowser(query);\n  const cache = getFarmClientDataCache();\n  const inflight = cache.getInflight<TData>(provisionalKey);\n  if (inflight && !options.force) return inflight;\n\n  const owner: ServerQueryOwner = {\n    invalidations: trackFarmClientCacheInvalidations(cache),\n    supersededKeys: new Set(),\n  };\n  serverQueryClientState.latestOwners.set(provisionalKey, owner);\n  serverQueryClientState.owners.add(owner);\n  claimServerQueryKey(owner, provisionalKey);\n\n  const previous = cache.get<TData>(provisionalKey);\n  cache.set(provisionalKey, {\n    data: previous?.data as TData,\n    updatedAt: previous?.updatedAt ?? 0,\n    staleAt: previous?.staleAt ?? 0,\n    gcAt: previous?.gcAt,\n    invalidatedAt: previous?.invalidatedAt,\n    status: \"pending\",\n    error: null,\n    fetching: true,\n  });\n\n  let promise!: Promise<TData>;\n  promise = (async () => {\n    // Let the promise be assigned and registered before a query implementation\n    // can throw synchronously and enter the cleanup path.\n    await Promise.resolve();\n    try {\n      serverQueryClientState.active.push({ provisionalKey, owner });\n      let pending: Promise<TData>;\n      try {\n        pending = query(input);\n      } finally {\n        serverQueryClientState.active.pop();\n      }\n\n      const data = await pending;\n      const transported = cache.get<TData>(provisionalKey);\n      if (\n        isCurrentServerQueryOwner(provisionalKey, owner) &&\n        (!transported || transported.fetching)\n      ) {\n        const updatedAt = Date.now();\n        cache.set(provisionalKey, {\n          data,\n          updatedAt,\n          staleAt: owner.invalidations.has(provisionalKey)\n            ? 0\n            : options.staleTime === false\n              ? Number.POSITIVE_INFINITY\n              : updatedAt + (options.staleTime ?? 0),\n          status: \"success\",\n          error: null,\n          fetching: false,\n        });\n      }\n      return data;\n    } catch (cause) {\n      const error = normalizeServerQueryError(cause);\n      if (isCurrentServerQueryOwner(provisionalKey, owner)) {\n        const current = cache.get<TData>(provisionalKey);\n        cache.set(provisionalKey, {\n          data: current?.data as TData,\n          updatedAt: current?.updatedAt ?? 0,\n          staleAt: current?.staleAt ?? 0,\n          gcAt: current?.gcAt,\n          invalidatedAt: current?.invalidatedAt,\n          status: \"error\",\n          error,\n          fetching: false,\n        });\n      }\n      throw error;\n    } finally {\n      const invalidated =\n        isCurrentServerQueryOwner(provisionalKey, owner) && owner.invalidations.has(provisionalKey);\n      owner.invalidations.dispose();\n      serverQueryClientState.owners.delete(owner);\n      owner.supersededKeys.clear();\n      if (cache.getInflight(provisionalKey) === promise) {\n        cache.deleteInflight(provisionalKey);\n      }\n      if (serverQueryClientState.latestOwners.get(provisionalKey) === owner) {\n        serverQueryClientState.latestOwners.delete(provisionalKey);\n      }\n      // Notify only after retiring old work: mounted consumers must start a new\n      // read, not rejoin the promise whose result has just been invalidated.\n      if (invalidated) cache.invalidate(provisionalKey);\n    }\n  })();\n\n  cache.setInflight(provisionalKey, promise);\n  return promise;\n}\n\nfunction normalizeServerQueryError(cause: unknown): Error {\n  if (cause instanceof Error) return cause;\n  const error = new Error(typeof cause === \"string\" ? cause : \"Server query failed\");\n  (error as Error & { cause?: unknown }).cause = cause;\n  return error;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaO,SAAS,4BACd,SACA,UAA2C,CAAC,GAChC;AACZ,MAAI,OAAO,WAAW,YAAa,QAAO,MAAM;AAAA,EAAC;AAEjD,QAAM,UAAU,QAAQ,yBAAyB,QAAQ,SAAY;AACrE,QAAM,WAAW,QAAQ,uBAAuB,QAAQ,SAAY;AAEpE,MAAI,QAAS,QAAO,iBAAiB,SAAS,OAAO;AACrD,MAAI,SAAU,QAAO,iBAAiB,UAAU,QAAQ;AACxD,SAAO,MAAM;AACX,QAAI,QAAS,QAAO,oBAAoB,SAAS,OAAO;AACxD,QAAI,SAAU,QAAO,oBAAoB,UAAU,QAAQ;AAAA,EAC7D;AACF;AAfgB;;;AC4BhB,IAAM,iCAAiC,uBAAO,IAAI,6BAA6B;AAC/E,IAAM,0BAA0B;AAGhC,IAAM,yBAAkD,sHAElD;AAAA,EACJ,aAAa,oBAAI,QAAQ;AAAA,EACzB,gBAAgB;AAAA,EAChB,QAAQ,CAAC;AAAA,EACT,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