{"version":3,"sources":["../../src/client/production-runtime.ts","../../src/client/chunk-recovery.ts","../../src/client/island-runtime.ts","../../src/client/runtime-error-overlay.ts","../../src/components/error-styles.ts","../../package.json","../../src/version.ts","../../src/client/plugin.ts","../../src/search-params.ts","../../src/trailing-slash.ts","../../src/base-path.ts","../../src/client/hash-target.ts","../../src/client/document-head.ts","../../src/client/navigation-url.ts"],"sourcesContent":["export { installChunkErrorRecovery } from \"./chunk-recovery\";\nexport { scheduleFarmIslandHydration } from \"./island-runtime\";\nexport { createClientPluginManager } from \"./plugin\";\nexport { searchParamsToObject } from \"../search-params\";\nexport { setFarmTrailingSlashPreference } from \"../trailing-slash\";\nexport { setFarmBasePath, stripFarmBasePath } from \"../base-path\";\nexport { getHashTargetElement } from \"./hash-target\";\nexport { reconcileFarmDocumentHead } from \"./document-head\";\nexport { isFarmExternalNavigationURL } from \"./navigation-url\";\n","\"use client\";\n\nexport interface FarmChunkRecoveryOptions {\n  /**\n   * How long a page is considered already recovered before another chunk\n   * failure may trigger a reload. Defaults to 30 seconds.\n   */\n  maxAgeMs?: number;\n  /**\n   * Override the storage key. Mostly useful for tests and embedded runtimes.\n   */\n  storageKey?: string;\n  /**\n   * Called right before Farm reloads the page.\n   */\n  onRecover?: (error: unknown) => void;\n  /**\n   * Test hooks for browser globals.\n   */\n  reload?: () => void;\n  storage?: Pick<Storage, \"getItem\" | \"setItem\" | \"removeItem\"> | null;\n  location?: Pick<Location, \"pathname\" | \"search\" | \"reload\">;\n  now?: () => number;\n}\n\nconst DEFAULT_MAX_AGE_MS = 30_000;\nconst STORAGE_KEY_PREFIX = \"farm:chunk-recovery:\";\nconst CHUNK_ERROR_PATTERNS = [\n  /ChunkLoadError/i,\n  /Loading chunk [\\w-]+ failed/i,\n  /Loading CSS chunk [\\w-]+ failed/i,\n  /CSS_CHUNK_LOAD_FAILED/i,\n  /failed to fetch dynamically imported module/i,\n  /error loading dynamically imported module/i,\n  /importing a module script failed/i,\n  /unable to preload CSS/i,\n  /module script failed/i,\n];\n\nexport function isChunkLoadError(errorLike: unknown): boolean {\n  const values = collectErrorText(errorLike);\n  if (values.some((value) => CHUNK_ERROR_PATTERNS.some((pattern) => pattern.test(value)))) {\n    return true;\n  }\n\n  // Only treat same-origin script/style failures as chunk errors. A blocked\n  // or missing third-party asset (analytics, embeds) is not fixable by\n  // reloading, and reloading for it would loop for as long as it keeps\n  // failing.\n  const targetUrl = getEventTargetAssetUrl(errorLike);\n  return Boolean(\n    targetUrl && /\\.(?:m?js|css)(?:[?#].*)?$/i.test(targetUrl) && isSameOriginAssetUrl(targetUrl),\n  );\n}\n\nfunction isSameOriginAssetUrl(url: string): boolean {\n  if (typeof window === \"undefined\" || !window.location) {\n    return false;\n  }\n\n  try {\n    return new URL(url, window.location.href).origin === window.location.origin;\n  } catch {\n    return false;\n  }\n}\n\nexport function installChunkErrorRecovery(options: FarmChunkRecoveryOptions = {}): () => void {\n  if (typeof window === \"undefined\") {\n    return () => {};\n  }\n\n  const recover = (errorLike: unknown) => {\n    if (!isChunkLoadError(errorLike)) {\n      return;\n    }\n    if (!markRecovered(options)) {\n      return;\n    }\n\n    options.onRecover?.(errorLike);\n    getReload(options)();\n  };\n\n  const onError = (event: Event | ErrorEvent) => {\n    recover(getErrorEventPayload(event));\n  };\n  const onUnhandledRejection = (event: PromiseRejectionEvent) => {\n    recover(event.reason);\n  };\n\n  window.addEventListener(\"error\", onError, true);\n  window.addEventListener(\"unhandledrejection\", onUnhandledRejection);\n\n  return () => {\n    window.removeEventListener(\"error\", onError, true);\n    window.removeEventListener(\"unhandledrejection\", onUnhandledRejection);\n  };\n}\n\nfunction markRecovered(options: FarmChunkRecoveryOptions): boolean {\n  const now = getNow(options);\n  const maxAgeMs = options.maxAgeMs ?? DEFAULT_MAX_AGE_MS;\n  const storage = getStorage(options);\n  const key = getStorageKey(options);\n\n  if (!storage) {\n    return false;\n  }\n\n  try {\n    const previous = Number(storage.getItem(key));\n    if (Number.isFinite(previous) && previous > 0 && now - previous < maxAgeMs) {\n      return false;\n    }\n    storage.setItem(key, String(now));\n    return true;\n  } catch {\n    return false;\n  }\n}\n\nfunction getErrorEventPayload(event: Event | ErrorEvent): unknown {\n  if (\"error\" in event && event.error) {\n    return event.error;\n  }\n  if (\"message\" in event && event.message) {\n    return event.message;\n  }\n  return event;\n}\n\nfunction collectErrorText(value: unknown, seen = new Set<unknown>()): string[] {\n  if (value == null || seen.has(value)) {\n    return [];\n  }\n  seen.add(value);\n\n  if (typeof value === \"string\") {\n    return [value];\n  }\n  if (typeof value === \"number\" || typeof value === \"boolean\") {\n    return [String(value)];\n  }\n  if (typeof value !== \"object\") {\n    return [];\n  }\n\n  const record = value as Record<string, unknown>;\n  const output: string[] = [];\n\n  for (const key of [\"name\", \"message\", \"code\", \"type\", \"request\", \"src\", \"href\"]) {\n    const candidate = record[key];\n    if (typeof candidate === \"string\") {\n      output.push(candidate);\n    }\n  }\n\n  if (\"reason\" in record) {\n    output.push(...collectErrorText(record.reason, seen));\n  }\n  if (\"error\" in record) {\n    output.push(...collectErrorText(record.error, seen));\n  }\n\n  return output;\n}\n\nfunction getEventTargetAssetUrl(value: unknown): string | undefined {\n  if (!value || typeof value !== \"object\") {\n    return undefined;\n  }\n\n  const target = (value as Event).target as\n    | (EventTarget & { src?: string; href?: string; tagName?: string })\n    | null\n    | undefined;\n  if (!target || typeof target !== \"object\") {\n    return undefined;\n  }\n\n  const tagName = typeof target.tagName === \"string\" ? target.tagName.toLowerCase() : \"\";\n  if (tagName !== \"script\" && tagName !== \"link\") {\n    return undefined;\n  }\n\n  return typeof target.src === \"string\" && target.src\n    ? target.src\n    : typeof target.href === \"string\" && target.href\n      ? target.href\n      : undefined;\n}\n\nfunction getStorage(options: FarmChunkRecoveryOptions) {\n  if (\"storage\" in options) {\n    return options.storage;\n  }\n\n  try {\n    return window.sessionStorage;\n  } catch {\n    return null;\n  }\n}\n\nfunction getStorageKey(options: FarmChunkRecoveryOptions): string {\n  if (options.storageKey) {\n    return options.storageKey;\n  }\n\n  const location = getLocation(options);\n  return `${STORAGE_KEY_PREFIX}${location.pathname}${location.search}`;\n}\n\nfunction getLocation(options: FarmChunkRecoveryOptions) {\n  return options.location ?? window.location;\n}\n\nfunction getReload(options: FarmChunkRecoveryOptions): () => void {\n  if (options.reload) {\n    return options.reload;\n  }\n\n  const location = getLocation(options);\n  return () => location.reload();\n}\n\nfunction getNow(options: FarmChunkRecoveryOptions): number {\n  return options.now ? options.now() : Date.now();\n}\n","\"use client\";\n\nimport type { FarmIslandStrategy } from \"../island\";\n\nexport interface ScheduleFarmIslandHydrationOptions<T> {\n  container: Element;\n  strategy?: FarmIslandStrategy | null;\n  signal?: AbortSignal;\n  hydrate: () => T | Promise<T>;\n}\n\ninterface FarmQueuedClick {\n  target?: EventTarget | null;\n}\n\nfunction getPreHydrationClickQueue(): FarmQueuedClick[] | null {\n  const windowWithQueue = window as typeof window & {\n    __FARM_PREHYDRATION_CLICK_QUEUE__?: FarmQueuedClick[];\n  };\n  return Array.isArray(windowWithQueue.__FARM_PREHYDRATION_CLICK_QUEUE__)\n    ? windowWithQueue.__FARM_PREHYDRATION_CLICK_QUEUE__\n    : null;\n}\n\nfunction findQueuedTarget(container: Element): Element | null {\n  const queue = getPreHydrationClickQueue();\n  if (!queue) return null;\n  for (const item of queue) {\n    if (item?.target instanceof Element && container.contains(item.target)) return item.target;\n  }\n  return null;\n}\n\nfunction takeQueuedTargets(container: Element): Element[] {\n  const queue = getPreHydrationClickQueue();\n  if (!queue) return [];\n\n  const targets: Element[] = [];\n  for (let index = queue.length - 1; index >= 0; index--) {\n    const target = queue[index]?.target;\n    if (!(target instanceof Element) || !container.contains(target)) continue;\n    queue.splice(index, 1);\n    targets.unshift(target);\n  }\n  return targets;\n}\n\nfunction runWhenIdle(callback: () => void): () => void {\n  const windowWithIdleCallback = window as typeof window & {\n    requestIdleCallback?: (callback: () => void, options?: { timeout?: number }) => number;\n    cancelIdleCallback?: (handle: number) => void;\n  };\n\n  if (typeof windowWithIdleCallback.requestIdleCallback === \"function\") {\n    const handle = windowWithIdleCallback.requestIdleCallback(callback, { timeout: 2_000 });\n    return () => windowWithIdleCallback.cancelIdleCallback?.(handle);\n  }\n\n  const handle = window.setTimeout(callback, 1);\n  return () => window.clearTimeout(handle);\n}\n\nfunction replayClick(target: Element): void {\n  const clickable = target as Element & { click?: () => void };\n  if (typeof clickable.click === \"function\") {\n    clickable.click();\n    return;\n  }\n  target.dispatchEvent(new MouseEvent(\"click\", { bubbles: true, cancelable: true }));\n}\n\nfunction finishIslandHydration(container: Element, activatingTarget?: Element | null): void {\n  const targets = new Set<Element>();\n  if (activatingTarget?.isConnected) targets.add(activatingTarget);\n  for (const target of takeQueuedTargets(container)) if (target.isConnected) targets.add(target);\n\n  if (!container.isConnected) return;\n  container.setAttribute(\"data-farm-island-hydrated\", \"true\");\n\n  for (const target of targets) {\n    window.setTimeout(() => {\n      if (\n        container.getAttribute(\"data-farm-island-hydrated\") === \"true\" &&\n        container.isConnected &&\n        target.isConnected &&\n        container.contains(target)\n      ) {\n        replayClick(target);\n      }\n    }, 0);\n  }\n}\n\n/**\n * Defer importing and hydrating a server-rendered client boundary until its\n * configured trigger. The returned promise resolves with the hydration result.\n */\nexport function scheduleFarmIslandHydration<T>({\n  container,\n  strategy,\n  signal,\n  hydrate,\n}: ScheduleFarmIslandHydrationOptions<T>): Promise<T | undefined> {\n  const resolvedStrategy = strategy ?? \"load\";\n  if (signal?.aborted) return Promise.resolve(undefined);\n\n  if (resolvedStrategy === \"load\") {\n    return Promise.resolve()\n      .then(() => (signal?.aborted ? undefined : hydrate()))\n      .then((value) => {\n        if (signal?.aborted) return undefined;\n        finishIslandHydration(container);\n        return value;\n      });\n  }\n\n  return new Promise<T | undefined>((resolve, reject) => {\n    let started = false;\n    let cancelled = false;\n    let queuedClickTarget: Element | null = null;\n    const triggerCleanups = new Set<() => void>();\n    let removeAbortListener: (() => void) | null = null;\n\n    const cleanupTriggers = () => {\n      for (const dispose of triggerCleanups) dispose();\n      triggerCleanups.clear();\n    };\n    const cleanup = () => {\n      cleanupTriggers();\n      removeAbortListener?.();\n      removeAbortListener = null;\n    };\n\n    const start = () => {\n      if (started || cancelled) return;\n      started = true;\n      cleanupTriggers();\n      Promise.resolve()\n        .then(hydrate)\n        .then(\n          (value) => {\n            cleanup();\n            if (cancelled || signal?.aborted) return;\n            const target = queuedClickTarget;\n            queuedClickTarget = null;\n            finishIslandHydration(container, target);\n            resolve(value);\n          },\n          (error) => {\n            cleanup();\n            reject(error);\n          },\n        );\n    };\n\n    if (signal) {\n      const abort = () => {\n        cancelled = true;\n        cleanup();\n        takeQueuedTargets(container);\n        resolve(undefined);\n      };\n      signal.addEventListener(\"abort\", abort, { once: true });\n      removeAbortListener = () => signal.removeEventListener(\"abort\", abort);\n    }\n\n    if (resolvedStrategy === \"idle\") {\n      triggerCleanups.add(runWhenIdle(start));\n      return;\n    }\n\n    if (resolvedStrategy === \"visible\") {\n      if (typeof IntersectionObserver !== \"function\") {\n        start();\n        return;\n      }\n\n      // Isolated boundary markers render with display:contents, so the\n      // container itself has no box and can never intersect. Observe its\n      // element children instead; with nothing observable, start now.\n      const targets =\n        container.getClientRects().length > 0 ? [container] : Array.from(container.children);\n      if (targets.length === 0) {\n        start();\n        return;\n      }\n\n      const observer = new IntersectionObserver(\n        (entries) => {\n          if (entries.some((entry) => entry.isIntersecting)) start();\n        },\n        { rootMargin: \"200px\" },\n      );\n      for (const target of targets) observer.observe(target);\n      triggerCleanups.add(() => observer.disconnect());\n      return;\n    }\n\n    const queueActivatingClick = (event: MouseEvent) => {\n      const target =\n        event.target instanceof Element\n          ? event.target.closest(\n              'button,[role=\"button\"],input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"]',\n            )\n          : null;\n      if (\n        !target ||\n        !container.contains(target) ||\n        target.closest(\"a[href]\") ||\n        event.button !== 0 ||\n        event.metaKey ||\n        event.altKey ||\n        event.ctrlKey ||\n        event.shiftKey\n      ) {\n        return;\n      }\n      queuedClickTarget ??= target;\n      event.preventDefault();\n      event.stopImmediatePropagation();\n      start();\n    };\n    const activateFromQueuedClick = (event: Event) => {\n      const target = (event as CustomEvent<{ target?: EventTarget | null }>).detail?.target;\n      if (!(target instanceof Element) || !container.contains(target)) return;\n\n      queuedClickTarget ??= target;\n      start();\n    };\n\n    document.addEventListener(\"click\", queueActivatingClick, true);\n    triggerCleanups.add(() => document.removeEventListener(\"click\", queueActivatingClick, true));\n    document.addEventListener(\"farm:island-interaction\", activateFromQueuedClick);\n    triggerCleanups.add(() =>\n      document.removeEventListener(\"farm:island-interaction\", activateFromQueuedClick),\n    );\n\n    const queuedTarget = findQueuedTarget(container);\n    if (queuedTarget) {\n      queuedClickTarget = queuedTarget;\n      start();\n    }\n  });\n}\n","\"use client\";\n\nimport {\n  originalPositionFor,\n  sourceContentFor,\n  TraceMap,\n  type SourceMapInput,\n} from \"@jridgewell/trace-mapping\";\nimport { DEFAULT_ERROR_STYLES } from \"../components/error-styles\";\nimport { FARM_VERSION } from \"../version\";\nimport { isChunkLoadError } from \"./chunk-recovery\";\n\nexport interface FarmRuntimeErrorLocation {\n  href: string;\n  pathname: string;\n  search: string;\n  hash: string;\n}\n\nexport interface FarmRuntimeErrorOverlayContext {\n  phase: string;\n  location: FarmRuntimeErrorLocation;\n  sourceEvent?: Event;\n}\n\nexport interface FarmRuntimeErrorOverlayOptions {\n  window: Window;\n  farmVersion?: string;\n  reload?: () => void;\n  fetch?: typeof fetch;\n}\n\nexport interface FarmRuntimeErrorOverlay {\n  show(error: unknown, context: FarmRuntimeErrorOverlayContext): void;\n  dismiss(): void;\n  destroy(): void;\n}\n\ninterface NormalizedRuntimeError {\n  name: string;\n  message: string;\n  stack?: string;\n}\n\ninterface BrowserSourceLocation {\n  url: string;\n  displayPath: string;\n  line: number;\n  column: number;\n  stackLine?: string;\n}\n\ninterface BrowserSourceLine {\n  number?: number;\n  content: string;\n  highlight?: boolean;\n}\n\ninterface BrowserSourceFrame {\n  path: string;\n  line?: number;\n  column?: number;\n  lines: BrowserSourceLine[];\n  unavailable?: boolean;\n}\n\ninterface RuntimeErrorRecord {\n  error: NormalizedRuntimeError;\n  context: FarmRuntimeErrorOverlayContext;\n  fingerprint: string;\n  occurrences: number;\n  sourceLocation?: BrowserSourceLocation;\n  sourceFrame: BrowserSourceFrame;\n}\n\nconst OVERLAY_STYLES = `\n:host {\n  position: fixed;\n  inset: 0;\n  z-index: 2147483647;\n  display: block;\n  width: 100%;\n  height: 100%;\n  /* Owned by the overlay: the default error page's source marker is a neutral\n     accent, but the overlay uses this to mark the expression that threw. */\n  --farm-runtime-error-inline-code: #f87171;\n}\n\n@media (prefers-color-scheme: light) {\n  :host {\n    --farm-runtime-error-inline-code: #b91c1c;\n  }\n}\n\n:host([hidden]) {\n  display: none;\n}\n\n.farm-runtime-error__viewport {\n  width: 100%;\n  height: 100%;\n  overflow: auto;\n  overscroll-behavior: contain;\n}\n\n.farm-runtime-error__viewport .farm-default-error {\n  min-height: 100%;\n  padding: clamp(22px, 4vh, 36px) 24px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__code {\n  font-size: clamp(96px, 10vw, 120px);\n  line-height: 0.92;\n}\n\n.farm-runtime-error__viewport .farm-default-error__eyebrow {\n  margin-top: 22px;\n  margin-bottom: 18px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__summary {\n  margin-bottom: 20px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__row {\n  min-height: 48px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__details {\n  padding-top: 16px;\n  padding-bottom: 14px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__details-header {\n  margin-bottom: 8px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__source-path {\n  padding-top: 9px;\n  padding-bottom: 9px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__source-code {\n  padding-top: 6px;\n  padding-bottom: 6px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__meta {\n  margin-top: 10px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__actions {\n  margin-top: 20px;\n}\n\n.farm-runtime-error__occurrences {\n  display: inline-flex;\n  align-items: center;\n  min-height: 24px;\n  margin-right: auto;\n  padding: 0 8px;\n  border: 1px solid var(--farm-error-line);\n  color: var(--farm-error-muted);\n  font-family: var(--farm-error-font-mono);\n  font-size: 10px;\n  font-weight: 600;\n  letter-spacing: 0.08em;\n  text-transform: uppercase;\n}\n\n.farm-runtime-error__occurrences[hidden],\n.farm-runtime-error__action[hidden] {\n  display: none;\n}\n\n.farm-runtime-error__copy {\n  min-width: 166px;\n}\n\n.farm-runtime-error__action:focus {\n  outline: 1px solid var(--farm-error-fg);\n  outline-offset: 2px;\n}\n\n.farm-runtime-error__viewport .farm-default-error__panel {\n  border: 0;\n  box-shadow: inset 0 0 0 0.5px var(--farm-error-line-strong);\n}\n\n.farm-runtime-error__github-icon {\n  display: block;\n  width: 18px;\n  height: 18px;\n  flex: 0 0 auto;\n  margin-right: 10px;\n  color: currentColor;\n}\n\n.farm-runtime-error__message-value {\n  font-family: var(--farm-error-font-sans);\n}\n\n.farm-runtime-error__inline-code {\n  color: var(--farm-runtime-error-inline-code);\n  font-family: var(--farm-error-font-mono);\n  font-size: 0.94em;\n  font-weight: 600;\n  line-height: inherit;\n  overflow-wrap: anywhere;\n}\n\n@media (max-width: 620px) {\n  .farm-runtime-error__occurrences {\n    margin-right: 0;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__content,\n  .farm-runtime-error__viewport .farm-default-error__panel,\n  .farm-runtime-error__viewport .farm-default-error__details,\n  .farm-runtime-error__viewport .farm-default-error__source,\n  .farm-runtime-error__viewport .farm-default-error__actions {\n    min-width: 0;\n    max-width: 100%;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__actions {\n    width: 100%;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__action {\n    min-width: 0;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__code {\n    font-size: 80px;\n  }\n}\n\n@media (max-height: 760px) {\n  .farm-runtime-error__viewport .farm-default-error {\n    place-items: start center;\n    padding-top: 12px;\n    padding-bottom: 12px;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__code {\n    font-size: 88px;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__eyebrow {\n    margin-top: 14px;\n    margin-bottom: 12px;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__summary {\n    margin-bottom: 14px;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__row {\n    min-height: 42px;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__details {\n    padding-top: 12px;\n    padding-bottom: 10px;\n  }\n\n  .farm-runtime-error__viewport .farm-default-error__actions {\n    /* The redesigned page is taller than a short window. Rather than shrink it\n       until it is unreadable, keep the recovery controls pinned to the bottom\n       so they stay reachable while the rest of the report scrolls under them. */\n    position: sticky;\n    bottom: 0;\n    z-index: 1;\n    margin-top: 10px;\n    padding: 10px 0;\n    background: var(--farm-error-bg);\n  }\n}\n`;\n\nconst OVERLAY_MARKUP = `\n<div class=\"farm-runtime-error__viewport\" data-farm-runtime-error-viewport>\n  <main class=\"farm-default-error\" data-farm-runtime-error role=\"alertdialog\" aria-modal=\"true\" aria-labelledby=\"farm-runtime-error-title\" aria-describedby=\"farm-runtime-error-description\">\n    <div class=\"farm-default-error__content\">\n      <p class=\"farm-default-error__code\" aria-hidden=\"true\">500</p>\n      <p class=\"farm-default-error__eyebrow\">Runtime error</p>\n      <header class=\"farm-default-error__summary\">\n        <h1 id=\"farm-runtime-error-title\" class=\"farm-default-error__title\">Application failed in the browser</h1>\n      </header>\n      <section class=\"farm-default-error__panel\" aria-label=\"Error information\">\n        <div class=\"farm-default-error__row\">\n          <span class=\"farm-default-error__label\">Error type</span>\n          <span class=\"farm-default-error__value\" data-farm-runtime-error-type></span>\n        </div>\n        <div class=\"farm-default-error__row\">\n          <span class=\"farm-default-error__label\">Error message</span>\n          <span id=\"farm-runtime-error-description\" class=\"farm-default-error__value farm-runtime-error__message-value\" data-farm-runtime-error-message></span>\n        </div>\n        <div class=\"farm-default-error__row\">\n          <span class=\"farm-default-error__label\">Location</span>\n          <span class=\"farm-default-error__value\" data-farm-runtime-error-location></span>\n        </div>\n        <section class=\"farm-default-error__details\" aria-labelledby=\"farm-runtime-error-details-title\">\n          <div class=\"farm-default-error__details-header\">\n            <h2 id=\"farm-runtime-error-details-title\" class=\"farm-default-error__details-title\">Details</h2>\n            <span class=\"farm-runtime-error__occurrences\" data-farm-runtime-error-occurrences hidden></span>\n            <button class=\"farm-default-error__copy farm-runtime-error__copy\" type=\"button\" data-farm-runtime-error-copy>\n              <span data-farm-runtime-error-copy-label>Copy debug report</span>\n              <span class=\"farm-default-error__sr-only\" aria-live=\"polite\" data-farm-runtime-error-copy-status></span>\n            </button>\n          </div>\n          <div data-farm-runtime-error-source></div>\n          <p class=\"farm-default-error__meta\" data-farm-runtime-error-meta></p>\n        </section>\n      </section>\n      <div class=\"farm-default-error__actions\">\n        <a class=\"farm-default-error__action farm-default-error__action--primary farm-runtime-error__action\" data-farm-runtime-error-issue target=\"_blank\" rel=\"noopener noreferrer\"><svg class=\"farm-runtime-error__github-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M12 .7a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56v-2.23c-3.22.7-3.9-1.37-3.9-1.37-.52-1.34-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.57-.29-5.27-1.29-5.27-5.68 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.47.11-3.05 0 0 .96-.31 3.16 1.18A10.95 10.95 0 0 1 12 6.1c.98 0 1.95.13 2.87.39 2.2-1.49 3.16-1.18 3.16-1.18.62 1.58.23 2.76.11 3.05.74.81 1.18 1.83 1.18 3.09 0 4.4-2.71 5.38-5.29 5.67.42.36.79 1.07.79 2.16v3.27c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .7Z\" /></svg><span>Open GitHub issue</span></a>\n        <button class=\"farm-default-error__action farm-runtime-error__action\" type=\"button\" data-farm-runtime-error-reload>Reload page</button>\n        <button class=\"farm-default-error__action farm-runtime-error__action\" type=\"button\" data-farm-runtime-error-dismiss>Dismiss</button>\n      </div>\n    </div>\n  </main>\n</div>\n`;\n\nclass DefaultFarmRuntimeErrorOverlay implements FarmRuntimeErrorOverlay {\n  private readonly options: FarmRuntimeErrorOverlayOptions;\n  private readonly document: Document;\n  private readonly host: HTMLDivElement;\n  private readonly shadow: ShadowRoot;\n  private readonly dismissedFingerprints = new Set<string>();\n  private readonly themeObserver: MutationObserver;\n  private readonly colorSchemeQuery?: MediaQueryList;\n  private current?: RuntimeErrorRecord;\n  private previousFocus?: Element | null;\n  private renderSequence = 0;\n  private copyResetTimer?: number;\n  private destroyed = false;\n\n  constructor(options: FarmRuntimeErrorOverlayOptions) {\n    this.options = options;\n    this.document = options.window.document;\n    this.host = this.document.createElement(\"div\");\n    this.host.dataset.farmRuntimeErrorOverlay = \"\";\n    this.host.hidden = true;\n    this.shadow = this.host.attachShadow({ mode: \"open\" });\n    this.shadow.innerHTML = `<style>${DEFAULT_ERROR_STYLES}${OVERLAY_STYLES}</style>${OVERLAY_MARKUP}`;\n\n    this.getElement<HTMLButtonElement>(\"[data-farm-runtime-error-reload]\").addEventListener(\n      \"click\",\n      this.handleReload,\n    );\n    this.getElement<HTMLButtonElement>(\"[data-farm-runtime-error-dismiss]\").addEventListener(\n      \"click\",\n      this.handleDismiss,\n    );\n    this.getElement<HTMLButtonElement>(\"[data-farm-runtime-error-copy]\").addEventListener(\n      \"click\",\n      this.handleCopy,\n    );\n    this.shadow.addEventListener(\"keydown\", this.handleKeyDown);\n\n    this.themeObserver = new MutationObserver(this.updateTheme);\n    this.themeObserver.observe(this.document.documentElement, {\n      attributes: true,\n      attributeFilter: [\"class\", \"data-theme\", \"data-color-scheme\", \"style\"],\n    });\n    if (this.document.body) {\n      this.themeObserver.observe(this.document.body, {\n        attributes: true,\n        attributeFilter: [\"class\", \"data-theme\", \"data-color-scheme\", \"style\"],\n      });\n    }\n\n    this.colorSchemeQuery = options.window.matchMedia?.(\"(prefers-color-scheme: dark)\");\n    this.colorSchemeQuery?.addEventListener?.(\"change\", this.updateTheme);\n    this.updateTheme();\n  }\n\n  show(errorLike: unknown, context: FarmRuntimeErrorOverlayContext): void {\n    if (this.destroyed || isChunkLoadError(errorLike) || isChunkLoadError(context.sourceEvent)) {\n      return;\n    }\n\n    const error = normalizeRuntimeError(errorLike);\n    const sourceLocation = resolveBrowserSourceLocation(\n      error,\n      context.sourceEvent,\n      this.options.window,\n    );\n    if (sourceLocation && isBrowserExtensionUrl(sourceLocation.url)) return;\n    if (isRecoverableReactHydrationError(error, context, sourceLocation)) return;\n\n    const fingerprint = createErrorFingerprint(error, context, sourceLocation);\n    if (this.dismissedFingerprints.has(fingerprint)) return;\n\n    if (this.current?.fingerprint === fingerprint) {\n      this.current.occurrences += 1;\n      this.renderOccurrences(this.current.occurrences);\n      return;\n    }\n\n    const record: RuntimeErrorRecord = {\n      error,\n      context,\n      fingerprint,\n      occurrences: 1,\n      sourceLocation,\n      sourceFrame: createFallbackSourceFrame(error, sourceLocation),\n    };\n    this.current = record;\n    const sequence = ++this.renderSequence;\n    this.render(record);\n    this.mount();\n\n    if (sourceLocation) {\n      void loadBrowserSourceFrame(sourceLocation, this.options)\n        .then((sourceFrame) => {\n          if (\n            !sourceFrame ||\n            this.destroyed ||\n            sequence !== this.renderSequence ||\n            this.current !== record\n          ) {\n            return;\n          }\n          record.sourceFrame = sourceFrame;\n          this.renderSourceFrame(sourceFrame);\n          this.renderIssueLink(record);\n        })\n        .catch(() => {});\n    }\n  }\n\n  dismiss(): void {\n    if (this.destroyed || this.host.hidden) return;\n    if (this.current) this.dismissedFingerprints.add(this.current.fingerprint);\n    this.host.hidden = true;\n    this.renderSequence += 1;\n    if (this.previousFocus instanceof HTMLElement && this.previousFocus.isConnected) {\n      this.previousFocus.focus();\n    }\n    this.previousFocus = undefined;\n  }\n\n  destroy(): void {\n    if (this.destroyed) return;\n    this.destroyed = true;\n    this.renderSequence += 1;\n    this.themeObserver.disconnect();\n    this.colorSchemeQuery?.removeEventListener?.(\"change\", this.updateTheme);\n    this.shadow.removeEventListener(\"keydown\", this.handleKeyDown);\n    if (this.copyResetTimer !== undefined) {\n      this.options.window.clearTimeout(this.copyResetTimer);\n    }\n    this.host.remove();\n    this.current = undefined;\n  }\n\n  private mount(): void {\n    if (!this.host.isConnected) {\n      (this.document.body || this.document.documentElement).appendChild(this.host);\n    }\n    const wasHidden = this.host.hidden;\n    this.host.hidden = false;\n    if (wasHidden) {\n      this.previousFocus = this.document.activeElement;\n      this.options.window.setTimeout(() => {\n        if (!this.host.hidden && !this.destroyed) {\n          this.getElement<HTMLAnchorElement>(\"[data-farm-runtime-error-issue]\").focus({\n            preventScroll: true,\n          });\n        }\n      }, 0);\n    }\n  }\n\n  private render(record: RuntimeErrorRecord): void {\n    this.getElement(\"[data-farm-runtime-error-type]\").textContent = formatErrorType(\n      record.error,\n      record.context.phase,\n    );\n    renderErrorMessage(\n      this.getElement(\"[data-farm-runtime-error-message]\"),\n      record.error.message,\n      this.document,\n    );\n    this.getElement(\"[data-farm-runtime-error-location]\").textContent =\n      `${record.context.location.pathname}${record.context.location.search}` || \"/\";\n    this.getElement(\"[data-farm-runtime-error-meta]\").textContent =\n      `Farm.js v${this.options.farmVersion || FARM_VERSION} · development · browser`;\n    this.renderIssueLink(record);\n    this.renderOccurrences(record.occurrences);\n    this.renderSourceFrame(record.sourceFrame);\n    this.resetCopyStatus();\n  }\n\n  private renderOccurrences(occurrences: number): void {\n    const badge = this.getElement<HTMLElement>(\"[data-farm-runtime-error-occurrences]\");\n    badge.hidden = occurrences < 2;\n    badge.textContent = occurrences < 2 ? \"\" : `Repeated ×${occurrences}`;\n  }\n\n  private renderIssueLink(record: RuntimeErrorRecord): void {\n    this.getElement<HTMLAnchorElement>(\"[data-farm-runtime-error-issue]\").href =\n      createGithubIssueUrl(record, this.options.window, this.options.farmVersion || FARM_VERSION);\n  }\n\n  private renderSourceFrame(sourceFrame: BrowserSourceFrame): void {\n    const container = this.getElement<HTMLElement>(\"[data-farm-runtime-error-source]\");\n    container.replaceChildren();\n\n    const source = this.document.createElement(\"div\");\n    source.className = \"farm-default-error__source\";\n\n    const path = this.document.createElement(\"p\");\n    path.className = \"farm-default-error__source-path\";\n    path.textContent = formatSourcePath(sourceFrame);\n    source.appendChild(path);\n\n    const pre = this.document.createElement(\"pre\");\n    pre.className = \"farm-default-error__source-code\";\n    pre.tabIndex = 0;\n    const code = this.document.createElement(\"code\");\n    for (const line of sourceFrame.lines) {\n      const row = this.document.createElement(\"span\");\n      row.className = `farm-default-error__source-line${line.highlight ? \" farm-default-error__source-line--active\" : \"\"}`;\n\n      const gutter = this.document.createElement(\"span\");\n      gutter.className = \"farm-default-error__source-gutter\";\n      gutter.textContent = `${line.highlight ? \">\" : \" \"} ${line.number ?? \"\"}`;\n\n      const text = this.document.createElement(\"span\");\n      text.className = \"farm-default-error__source-text\";\n      text.textContent = line.content || \" \";\n\n      row.append(gutter, text);\n      code.appendChild(row);\n    }\n    pre.appendChild(code);\n    source.appendChild(pre);\n    container.appendChild(source);\n  }\n\n  private readonly handleReload = () => {\n    (this.options.reload || (() => this.options.window.location.reload()))();\n  };\n\n  private readonly handleDismiss = () => {\n    this.dismiss();\n  };\n\n  private readonly handleCopy = async () => {\n    if (!this.current) return;\n    const report = createFarmRuntimeErrorDebugReport(\n      this.current,\n      this.options.window,\n      this.options.farmVersion || FARM_VERSION,\n    );\n    const label = this.getElement<HTMLElement>(\"[data-farm-runtime-error-copy-label]\");\n    const status = this.getElement<HTMLElement>(\"[data-farm-runtime-error-copy-status]\");\n\n    try {\n      await copyText(report, this.options.window, this.document);\n      label.textContent = \"Copied\";\n      status.textContent = \"Debug report copied\";\n      if (this.copyResetTimer !== undefined) {\n        this.options.window.clearTimeout(this.copyResetTimer);\n      }\n      this.copyResetTimer = this.options.window.setTimeout(() => this.resetCopyStatus(), 1800);\n    } catch {\n      status.textContent = \"Unable to copy the debug report\";\n    }\n  };\n\n  private readonly handleKeyDown = (event: Event) => {\n    const keyboardEvent = event as KeyboardEvent;\n    if (keyboardEvent.key === \"Escape\") {\n      keyboardEvent.preventDefault();\n      this.dismiss();\n      return;\n    }\n    if (keyboardEvent.key !== \"Tab\") return;\n\n    const controls = Array.from(\n      this.shadow.querySelectorAll<HTMLElement>(\"a[href], button:not([hidden]):not([disabled])\"),\n    );\n    if (controls.length === 0) return;\n    const first = controls[0];\n    const last = controls[controls.length - 1];\n    const active = this.shadow.activeElement;\n\n    if (keyboardEvent.shiftKey && active === first) {\n      keyboardEvent.preventDefault();\n      last.focus();\n    } else if (!keyboardEvent.shiftKey && active === last) {\n      keyboardEvent.preventDefault();\n      first.focus();\n    }\n  };\n\n  private readonly updateTheme = () => {\n    this.getElement<HTMLElement>(\"[data-farm-runtime-error-viewport]\").dataset.theme =\n      resolveDocumentTheme(this.document, this.options.window);\n  };\n\n  private resetCopyStatus(): void {\n    this.getElement(\"[data-farm-runtime-error-copy-label]\").textContent = \"Copy debug report\";\n    this.getElement(\"[data-farm-runtime-error-copy-status]\").textContent = \"\";\n  }\n\n  private getElement<T extends Element = HTMLElement>(selector: string): T {\n    const element = this.shadow.querySelector<T>(selector);\n    if (!element) throw new Error(`Farm runtime error overlay is missing ${selector}`);\n    return element;\n  }\n}\n\nexport function createFarmRuntimeErrorOverlay(\n  options: FarmRuntimeErrorOverlayOptions,\n): FarmRuntimeErrorOverlay {\n  return new DefaultFarmRuntimeErrorOverlay(options);\n}\n\nfunction normalizeRuntimeError(errorLike: unknown): NormalizedRuntimeError {\n  if (errorLike instanceof Error) {\n    return {\n      name: errorLike.name || \"Error\",\n      message: errorLike.message || \"An unknown browser error occurred.\",\n      stack: errorLike.stack,\n    };\n  }\n\n  if (errorLike && typeof errorLike === \"object\") {\n    const error = errorLike as Record<string, unknown>;\n    const name = typeof error.name === \"string\" && error.name ? error.name : \"Error\";\n    const message =\n      typeof error.message === \"string\" && error.message\n        ? error.message\n        : typeof error.reason === \"string\" && error.reason\n          ? error.reason\n          : stringifyUnknown(errorLike);\n    return {\n      name,\n      message: message || \"An unknown browser error occurred.\",\n      stack: typeof error.stack === \"string\" ? error.stack : undefined,\n    };\n  }\n\n  return {\n    name: \"Error\",\n    message: stringifyUnknown(errorLike) || \"An unknown browser error occurred.\",\n  };\n}\n\nfunction stringifyUnknown(value: unknown): string {\n  if (typeof value === \"string\") return value;\n  if (value == null) return \"\";\n  try {\n    return JSON.stringify(value);\n  } catch {\n    return String(value);\n  }\n}\n\nfunction resolveBrowserSourceLocation(\n  error: NormalizedRuntimeError,\n  sourceEvent: Event | undefined,\n  clientWindow: Window,\n): BrowserSourceLocation | undefined {\n  if (sourceEvent && \"filename\" in sourceEvent) {\n    const event = sourceEvent as ErrorEvent;\n    if (event.filename && event.lineno) {\n      return createSourceLocation(event.filename, event.lineno, event.colno || 1, clientWindow);\n    }\n  }\n\n  if (!error.stack) return undefined;\n  for (const stackLine of error.stack.split(\"\\n\").slice(1)) {\n    const match = stackLine\n      .trim()\n      .match(/\\(?((?:[a-z][a-z\\d+.-]*):\\/\\/[^)\\s]+|\\/[^)\\s]+):(\\d+):(\\d+)\\)?$/i);\n    if (!match) continue;\n    return {\n      ...createSourceLocation(match[1], Number(match[2]), Number(match[3]), clientWindow),\n      stackLine: stackLine.trim(),\n    };\n  }\n  return undefined;\n}\n\nfunction createSourceLocation(\n  url: string,\n  line: number,\n  column: number,\n  clientWindow: Window,\n): BrowserSourceLocation {\n  let displayPath = url;\n  try {\n    const parsed = new URL(url, clientWindow.location.href);\n    displayPath = parsed.origin === clientWindow.location.origin ? parsed.pathname : parsed.href;\n  } catch {}\n\n  return { url, displayPath, line, column };\n}\n\nfunction createFallbackSourceFrame(\n  error: NormalizedRuntimeError,\n  location?: BrowserSourceLocation,\n): BrowserSourceFrame {\n  const firstStackLine =\n    location?.stackLine || error.stack?.split(\"\\n\").find((line) => line.trim().startsWith(\"at \"));\n  return {\n    path: location?.displayPath || \"Browser stack\",\n    line: location?.line,\n    column: location?.column,\n    unavailable: true,\n    lines: [\n      {\n        number: location?.line,\n        content: firstStackLine?.trim() || error.message,\n        highlight: true,\n      },\n    ],\n  };\n}\n\nasync function loadBrowserSourceFrame(\n  location: BrowserSourceLocation,\n  options: FarmRuntimeErrorOverlayOptions,\n): Promise<BrowserSourceFrame | undefined> {\n  const request = options.fetch || options.window.fetch?.bind(options.window);\n  if (!request) return undefined;\n\n  let sourceUrl: URL;\n  try {\n    sourceUrl = new URL(location.url, options.window.location.href);\n  } catch {\n    return undefined;\n  }\n  if (\n    sourceUrl.origin !== options.window.location.origin ||\n    (sourceUrl.protocol !== \"http:\" && sourceUrl.protocol !== \"https:\")\n  ) {\n    return undefined;\n  }\n\n  try {\n    const response = await request(sourceUrl.href, {\n      headers: { Accept: \"text/plain, application/javascript\" },\n    });\n    if (!response.ok) return undefined;\n    const source = await response.text();\n    if (source.length > 1_000_000) return undefined;\n\n    const mappedFrame = await createMappedSourceFrame(\n      source,\n      sourceUrl,\n      location,\n      request,\n      options.window,\n    );\n    if (mappedFrame) return mappedFrame;\n\n    return createSourceFrame(source, location.displayPath, location.line, location.column);\n  } catch {\n    return undefined;\n  }\n}\n\nasync function createMappedSourceFrame(\n  generatedSource: string,\n  generatedUrl: URL,\n  location: BrowserSourceLocation,\n  request: typeof fetch,\n  clientWindow: Window,\n): Promise<BrowserSourceFrame | undefined> {\n  const traceMap = await loadTraceMap(generatedSource, generatedUrl, request, clientWindow);\n  if (!traceMap) return undefined;\n\n  const original = originalPositionFor(traceMap, {\n    line: location.line,\n    column: Math.max(0, location.column - 1),\n  });\n  if (!original.source || original.line == null) return undefined;\n\n  const originalSource = sourceContentFor(traceMap, original.source);\n  if (originalSource == null) return undefined;\n\n  const originalLines = originalSource.split(/\\r?\\n/);\n  const generatedLine = generatedSource.split(/\\r?\\n/)[location.line - 1] || \"\";\n  const line = refineOriginalLine(generatedLine, originalLines, original.line);\n  const lineContent = originalLines[line - 1] || \"\";\n  const trimmedGeneratedLine = generatedLine.trim();\n  const column =\n    line !== original.line && trimmedGeneratedLine && lineContent.includes(trimmedGeneratedLine)\n      ? lineContent.indexOf(trimmedGeneratedLine) + 1\n      : (original.column ?? 0) + 1;\n\n  return createSourceFrame(\n    originalSource,\n    formatDisplaySourceUrl(original.source, clientWindow),\n    line,\n    column,\n  );\n}\n\nasync function loadTraceMap(\n  generatedSource: string,\n  generatedUrl: URL,\n  request: typeof fetch,\n  clientWindow: Window,\n): Promise<TraceMap | undefined> {\n  const matches = Array.from(generatedSource.matchAll(/\\/\\/[#@]\\s*sourceMappingURL=([^\\s]+)/g));\n  const reference = matches[matches.length - 1]?.[1];\n  if (!reference) return undefined;\n\n  let sourceMapJson: string;\n  if (reference.startsWith(\"data:\")) {\n    sourceMapJson = decodeSourceMapDataUrl(reference, clientWindow);\n  } else {\n    const sourceMapUrl = new URL(reference, generatedUrl);\n    if (sourceMapUrl.origin !== clientWindow.location.origin) return undefined;\n    const response = await request(sourceMapUrl.href, {\n      headers: { Accept: \"application/json, text/plain\" },\n    });\n    if (!response.ok) return undefined;\n    sourceMapJson = await response.text();\n    if (sourceMapJson.length > 2_000_000) return undefined;\n  }\n\n  return new TraceMap(JSON.parse(sourceMapJson) as SourceMapInput, generatedUrl.href);\n}\n\nfunction decodeSourceMapDataUrl(value: string, clientWindow: Window): string {\n  const separator = value.indexOf(\",\");\n  if (separator < 0) throw new Error(\"Invalid inline source map\");\n  const metadata = value.slice(0, separator);\n  const payload = value.slice(separator + 1);\n  if (!metadata.includes(\";base64\")) return decodeURIComponent(payload);\n\n  const binary = clientWindow.atob(payload);\n  const bytes = new Uint8Array(binary.length);\n  for (let index = 0; index < binary.length; index += 1) {\n    bytes[index] = binary.charCodeAt(index);\n  }\n  return new TextDecoder().decode(bytes);\n}\n\nfunction refineOriginalLine(\n  generatedLine: string,\n  originalLines: string[],\n  mappedLine: number,\n): number {\n  const normalizedGeneratedLine = normalizeSourceLine(generatedLine);\n  if (normalizedGeneratedLine.length < 8) return mappedLine;\n\n  let bestMatch = mappedLine;\n  let bestDistance = Number.POSITIVE_INFINITY;\n  for (let index = 0; index < originalLines.length; index += 1) {\n    if (normalizeSourceLine(originalLines[index]) !== normalizedGeneratedLine) continue;\n    const line = index + 1;\n    const distance = Math.abs(line - mappedLine);\n    if (distance < bestDistance) {\n      bestMatch = line;\n      bestDistance = distance;\n    }\n  }\n  return bestMatch;\n}\n\nfunction normalizeSourceLine(value: string): string {\n  return value.trim().replace(/\\s+/g, \" \");\n}\n\nfunction createSourceFrame(\n  source: string,\n  path: string,\n  line: number,\n  column: number,\n): BrowserSourceFrame | undefined {\n  const lines = source.split(/\\r?\\n/);\n  if (line < 1 || line > lines.length) return undefined;\n  const start = Math.max(1, line - 2);\n  const end = Math.min(lines.length, line + 2);\n  const frameLines: BrowserSourceLine[] = [];\n  for (let number = start; number <= end; number += 1) {\n    frameLines.push({\n      number,\n      content: lines[number - 1] || \" \",\n      highlight: number === line,\n    });\n  }\n\n  return { path, line, column, lines: frameLines };\n}\n\nfunction formatDisplaySourceUrl(url: string, clientWindow: Window): string {\n  try {\n    const parsed = new URL(url, clientWindow.location.href);\n    return parsed.origin === clientWindow.location.origin ? parsed.pathname : parsed.href;\n  } catch {\n    return url.replace(/[?#].*$/, \"\");\n  }\n}\n\nfunction isBrowserExtensionUrl(url: string): boolean {\n  try {\n    return [\n      \"chrome-extension:\",\n      \"moz-extension:\",\n      \"safari-web-extension:\",\n      \"ms-browser-extension:\",\n    ].includes(new URL(url).protocol);\n  } catch {\n    return /^(?:chrome|moz|safari-web|ms-browser)-extension:\\/\\//i.test(url);\n  }\n}\n\nfunction isRecoverableReactHydrationError(\n  error: NormalizedRuntimeError,\n  context: FarmRuntimeErrorOverlayContext,\n  location?: BrowserSourceLocation,\n): boolean {\n  if (context.phase !== \"window\") return false;\n\n  const isKnownRecoverableMessage = [\n    /^Hydration failed because the server rendered (?:text|HTML) didn't match the client\\b/i,\n    /^Text content does not match server-rendered HTML\\b/i,\n    /^There was an error while hydrating but React was able to recover\\b/i,\n  ].some((pattern) => pattern.test(error.message));\n  if (!isKnownRecoverableMessage) return false;\n\n  return /(?:react-dom(?:_client)?(?:\\.development)?\\.js|react-dom\\/|throwOnHydrationMismatch|onRecoverableError)/i.test(\n    `${location?.url || \"\"}\\n${error.stack || \"\"}`,\n  );\n}\n\nfunction renderErrorMessage(container: Element, message: string, document: Document): void {\n  const fragments: Node[] = [];\n  const codePattern = /`([^`\\n]+)`|\\b[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*){2,}\\b/g;\n  let offset = 0;\n\n  for (const match of message.matchAll(codePattern)) {\n    const index = match.index ?? 0;\n    if (index > offset) fragments.push(document.createTextNode(message.slice(offset, index)));\n\n    const code = document.createElement(\"code\");\n    code.className = \"farm-runtime-error__inline-code\";\n    code.textContent = match[1] || match[0];\n    fragments.push(code);\n    offset = index + match[0].length;\n  }\n\n  if (offset < message.length) fragments.push(document.createTextNode(message.slice(offset)));\n  container.replaceChildren(...fragments);\n}\n\nfunction createErrorFingerprint(\n  error: NormalizedRuntimeError,\n  context: FarmRuntimeErrorOverlayContext,\n  location?: BrowserSourceLocation,\n): string {\n  return [\n    context.phase,\n    context.location.pathname,\n    error.name,\n    error.message,\n    location?.displayPath || \"\",\n    location?.line || \"\",\n    error.stack?.split(\"\\n\")[1]?.trim() || \"\",\n  ].join(\"\\u0000\");\n}\n\nfunction formatPhase(phase: string): string {\n  return phase\n    .replace(/^plugin:/, \"Plugin · \")\n    .replace(/-/g, \" \")\n    .replace(/\\b\\w/g, (character) => character.toUpperCase());\n}\n\nfunction formatErrorType(error: NormalizedRuntimeError, phase: string): string {\n  const category =\n    phase === \"hydration\"\n      ? \"Hydration\"\n      : phase === \"navigation\"\n        ? \"Navigation\"\n        : phase === \"setup\" || phase.startsWith(\"plugin:\")\n          ? \"Plugin\"\n          : phase === \"performance\"\n            ? \"Performance\"\n            : \"Runtime\";\n  const name = error.name.trim() || \"Error\";\n  return `${category} ${name}`;\n}\n\nfunction formatSourcePath(sourceFrame: BrowserSourceFrame): string {\n  if (!sourceFrame.line) return sourceFrame.path;\n  return `${sourceFrame.path}:${sourceFrame.line}:${sourceFrame.column || 1}${\n    sourceFrame.unavailable ? \" · source preview unavailable\" : \"\"\n  }`;\n}\n\nfunction resolveDocumentTheme(document: Document, clientWindow: Window): \"light\" | \"dark\" {\n  for (const element of [document.documentElement, document.body]) {\n    if (!element) continue;\n    const explicit =\n      element.getAttribute(\"data-theme\") || element.getAttribute(\"data-color-scheme\");\n    if (explicit === \"dark\" || element.classList.contains(\"dark\")) return \"dark\";\n    if (explicit === \"light\" || element.classList.contains(\"light\")) return \"light\";\n  }\n\n  const colorScheme = clientWindow.getComputedStyle?.(document.documentElement).colorScheme;\n  if (colorScheme?.includes(\"dark\") && !colorScheme.includes(\"light\")) return \"dark\";\n  return clientWindow.matchMedia?.(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n\nfunction createFarmRuntimeErrorDebugReport(\n  record: RuntimeErrorRecord,\n  clientWindow: Window,\n  farmVersion: string,\n): string {\n  const source = record.sourceFrame.lines\n    .map(\n      (line) =>\n        `${line.highlight ? \">\" : \" \"} ${line.number ? String(line.number).padStart(4, \" \") : \"    \"} | ${line.content}`,\n    )\n    .join(\"\\n\");\n  const viewport = `${clientWindow.innerWidth}×${clientWindow.innerHeight}`;\n\n  return [\n    \"# Farm.js client runtime debug report\",\n    \"\",\n    \"## Error\",\n    `- Type: ${formatErrorType(record.error, record.context.phase)}`,\n    `- Message: ${record.error.message}`,\n    `- Phase: ${formatPhase(record.context.phase)}`,\n    `- Page: ${record.context.location.href}`,\n    `- Occurrences: ${record.occurrences}`,\n    \"\",\n    \"## Browser runtime\",\n    `- Farm.js: ${farmVersion}`,\n    `- User agent: ${clientWindow.navigator.userAgent}`,\n    `- Viewport: ${viewport}`,\n    `- Online: ${clientWindow.navigator.onLine === false ? \"no\" : \"yes\"}`,\n    \"\",\n    \"## Source\",\n    `\\`${formatSourcePath(record.sourceFrame)}\\``,\n    \"\",\n    \"```text\",\n    source,\n    \"```\",\n    \"\",\n    \"## Stack trace\",\n    \"```text\",\n    record.error.stack || \"Stack trace unavailable.\",\n    \"```\",\n    \"\",\n    \"## Diagnostic request\",\n    \"Identify the most likely root cause from the message, source frame, and stack trace. Explain the smallest safe fix and how to verify it.\",\n  ].join(\"\\n\");\n}\n\nfunction createGithubIssueUrl(\n  record: RuntimeErrorRecord,\n  clientWindow: Window,\n  farmVersion: string,\n): string {\n  const source = record.sourceFrame.lines\n    .map(\n      (line) =>\n        `${line.highlight ? \">\" : \" \"} ${line.number ? String(line.number).padStart(4, \" \") : \"    \"} | ${line.content}`,\n    )\n    .join(\"\\n\");\n  const body = truncateText(\n    [\n      \"## Runtime error report\",\n      \"\",\n      \"> This report was prefilled by the Farm.js development error overlay. Review it and remove sensitive information before submitting.\",\n      \"\",\n      \"### Error\",\n      `- Type: ${formatErrorType(record.error, record.context.phase)}`,\n      `- Message: ${record.error.message}`,\n      `- Phase: ${formatPhase(record.context.phase)}`,\n      `- Page path: ${record.context.location.pathname}`,\n      `- Occurrences: ${record.occurrences}`,\n      `- Farm.js: ${farmVersion}`,\n      `- Browser: ${clientWindow.navigator.userAgent}`,\n      `- Viewport: ${clientWindow.innerWidth}×${clientWindow.innerHeight}`,\n      `- Online: ${clientWindow.navigator.onLine === false ? \"no\" : \"yes\"}`,\n      \"\",\n      \"### Source\",\n      `\\`${formatSourcePath(record.sourceFrame)}\\``,\n      \"\",\n      \"```text\",\n      source,\n      \"```\",\n      \"\",\n      \"### Stack trace\",\n      \"```text\",\n      record.error.stack || \"Stack trace unavailable.\",\n      \"```\",\n      \"\",\n      \"### Expected behavior\",\n      \"Describe what you expected to happen and the steps needed to reproduce the failure.\",\n      \"\",\n      \"### Diagnostic request\",\n      \"Identify the most likely root cause from the message, source frame, and stack trace. Explain the smallest safe fix and how to verify it.\",\n    ].join(\"\\n\"),\n    6_000,\n  );\n  const issueUrl = new URL(\"https://github.com/farming-labs/farm.js/issues/new\");\n  issueUrl.searchParams.set(\"title\", truncateText(`[runtime error] ${record.error.message}`, 120));\n  issueUrl.searchParams.set(\"body\", body);\n  return issueUrl.href;\n}\n\nfunction truncateText(value: string, maxLength: number): string {\n  if (value.length <= maxLength) return value;\n  return `${value.slice(0, maxLength - 24)}\\n\\n[report truncated]`;\n}\n\nasync function copyText(value: string, clientWindow: Window, document: Document): Promise<void> {\n  if (clientWindow.navigator.clipboard && clientWindow.isSecureContext) {\n    await clientWindow.navigator.clipboard.writeText(value);\n    return;\n  }\n\n  const area = document.createElement(\"textarea\");\n  area.value = value;\n  area.readOnly = true;\n  area.style.position = \"fixed\";\n  area.style.opacity = \"0\";\n  document.body.appendChild(area);\n  area.select();\n  const copied = document.execCommand(\"copy\");\n  area.remove();\n  if (!copied) throw new Error(\"Copy command was rejected\");\n}\n","/**\n * Shared styles for Farm's default HTTP error page.\n *\n * Kept framework-agnostic so the same fallback can be used by the development\n * renderer and generated production runtimes.\n */\nexport const DEFAULT_ERROR_STYLES = `\nbody {\n  margin: 0;\n  background: #080808;\n}\n\n.farm-default-error {\n  --farm-error-bg: #080808;\n  --farm-error-panel: #0d0d0d;\n  --farm-error-fg: #f3f3f3;\n  --farm-error-muted: #9a9a9a;\n  --farm-error-subtle: #6f6f6f;\n  --farm-error-line: rgba(255, 255, 255, 0.1);\n  --farm-error-line-strong: rgba(255, 255, 255, 0.2);\n  --farm-error-button-bg: #f1f1f1;\n  --farm-error-button-fg: #0a0a0a;\n  --farm-error-source-line: rgba(255, 255, 255, 0.055);\n  --farm-error-source-marker: #f3f3f3;\n  --farm-error-font-sans: \"Geist Variable\", \"Geist Sans\", Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n  --farm-error-font-mono: \"Geist Mono Variable\", \"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n  min-height: 100vh;\n  min-height: 100svh;\n  display: grid;\n  color: var(--farm-error-fg);\n  background: var(--farm-error-bg);\n  font-family: var(--farm-error-font-sans);\n  font-synthesis: none;\n  color-scheme: dark;\n  text-rendering: optimizeLegibility;\n}\n\n.farm-default-error,\n.farm-default-error * {\n  box-sizing: border-box;\n}\n\n.farm-default-error__frame {\n  width: min(100%, 1180px);\n  min-height: 100vh;\n  min-height: 100svh;\n  display: grid;\n  grid-template-rows: auto minmax(0, 1fr) auto;\n  margin: 0 auto;\n  padding: clamp(24px, 4vw, 52px);\n}\n\n.farm-default-error__brand {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  color: var(--farm-error-muted);\n  font-family: var(--farm-error-font-mono);\n  font-size: 11px;\n  font-weight: 520;\n  line-height: 1;\n  letter-spacing: 0.08em;\n}\n\n.farm-default-error__brand > span:first-child {\n  color: var(--farm-error-fg);\n}\n\n.farm-default-error__brand-divider,\n.farm-default-error__status-divider,\n.farm-default-error__footer-divider {\n  color: var(--farm-error-subtle);\n}\n\n.farm-default-error__content {\n  width: min(100%, 680px);\n  min-width: 0;\n  align-self: center;\n  margin: 0 auto;\n  padding: clamp(64px, 10vh, 112px) 0;\n}\n\n.farm-default-error--development .farm-default-error__content {\n  width: min(100%, 900px);\n}\n\n.farm-default-error > .farm-default-error__content {\n  align-self: center;\n  padding-right: 24px;\n  padding-left: 24px;\n}\n\n.farm-default-error__status,\n.farm-default-error__eyebrow {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  margin: 0 0 24px;\n  color: var(--farm-error-muted);\n  font-family: var(--farm-error-font-mono);\n  font-size: 12px;\n  font-weight: 520;\n  line-height: 1.4;\n  letter-spacing: 0.055em;\n  text-transform: uppercase;\n}\n\n.farm-default-error__status-mark {\n  width: 6px;\n  height: 6px;\n  flex: 0 0 auto;\n  background: var(--farm-error-fg);\n}\n\n.farm-default-error__code {\n  margin: 0 0 18px;\n  color: var(--farm-error-fg);\n  font-family: var(--farm-error-font-mono);\n  font-size: clamp(48px, 8vw, 72px);\n  font-weight: 540;\n  line-height: 0.95;\n  letter-spacing: -0.055em;\n}\n\n.farm-default-error__summary {\n  margin: 0;\n}\n\n.farm-default-error__title {\n  max-width: 680px;\n  margin: 0;\n  color: var(--farm-error-fg);\n  font-family: var(--farm-error-font-sans);\n  font-size: clamp(36px, 5.2vw, 56px);\n  font-weight: 560;\n  line-height: 1.04;\n  letter-spacing: -0.052em;\n  text-wrap: balance;\n}\n\n.farm-default-error__message {\n  max-width: 590px;\n  margin: 18px 0 0;\n  color: var(--farm-error-muted);\n  font-family: var(--farm-error-font-sans);\n  font-size: clamp(16px, 2vw, 19px);\n  line-height: 1.55;\n  letter-spacing: -0.012em;\n  overflow-wrap: anywhere;\n}\n\n.farm-default-error__actions {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 10px;\n  margin-top: 30px;\n}\n\n.farm-default-error__action {\n  min-height: 44px;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0 17px;\n  border: 1px solid var(--farm-error-line-strong);\n  border-radius: 7px;\n  color: var(--farm-error-fg);\n  background: transparent;\n  font: inherit;\n  font-family: var(--farm-error-font-mono);\n  font-size: 13px;\n  font-weight: 560;\n  line-height: 1;\n  letter-spacing: 0.015em;\n  text-decoration: none;\n  cursor: pointer;\n  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out, transform 100ms ease-out;\n}\n\n.farm-default-error__action--primary {\n  border-color: var(--farm-error-button-bg);\n  color: var(--farm-error-button-fg);\n  background: var(--farm-error-button-bg);\n}\n\n.farm-default-error__panel {\n  margin-top: 42px;\n  border-top: 1px solid var(--farm-error-line-strong);\n}\n\n.farm-default-error__row {\n  min-height: 45px;\n  display: grid;\n  grid-template-columns: 92px minmax(0, 1fr);\n  align-items: center;\n  border-bottom: 1px solid var(--farm-error-line);\n}\n\n.farm-default-error__label,\n.farm-default-error__value,\n.farm-default-error__details-title,\n.farm-default-error__source-path,\n.farm-default-error__meta,\n.farm-default-error__footer-action {\n  font-family: var(--farm-error-font-mono);\n}\n\n.farm-default-error__label {\n  color: var(--farm-error-subtle);\n  font-size: 10px;\n  font-weight: 560;\n  letter-spacing: 0.09em;\n  text-transform: uppercase;\n}\n\n.farm-default-error__value {\n  min-width: 0;\n  padding: 11px 0;\n  color: var(--farm-error-muted);\n  font-size: 12px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n.farm-default-error__details {\n  padding: 24px 0 0;\n  border-bottom: 1px solid var(--farm-error-line);\n}\n\n.farm-default-error__details-header {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-bottom: 12px;\n}\n\n.farm-default-error__details-title {\n  margin: 0;\n  color: var(--farm-error-muted);\n  font-size: 10px;\n  font-weight: 560;\n  line-height: 1;\n  letter-spacing: 0.09em;\n  text-transform: uppercase;\n}\n\n.farm-default-error__copy {\n  min-height: 32px;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  padding: 0 10px;\n  border: 1px solid var(--farm-error-line);\n  border-radius: 6px;\n  color: var(--farm-error-muted);\n  background: transparent;\n  font: inherit;\n  font-size: 11px;\n  cursor: pointer;\n  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;\n}\n\n.farm-default-error__source {\n  overflow: hidden;\n  border: 1px solid var(--farm-error-line);\n  border-radius: 7px;\n  background: var(--farm-error-panel);\n}\n\n.farm-default-error__source-path {\n  margin: 0;\n  padding: 10px 13px;\n  border-bottom: 1px solid var(--farm-error-line);\n  color: var(--farm-error-muted);\n  font-size: 11px;\n  line-height: 1.45;\n  overflow-wrap: anywhere;\n}\n\n.farm-default-error__source-code {\n  margin: 0;\n  padding: 8px 0;\n  overflow-x: auto;\n  color: var(--farm-error-fg);\n  font-family: var(--farm-error-font-mono);\n  font-size: 12px;\n  line-height: 1.75;\n  tab-size: 2;\n}\n\n.farm-default-error__source-line {\n  min-width: max-content;\n  display: grid;\n  grid-template-columns: 68px minmax(0, 1fr);\n  padding: 0 14px 0 0;\n  border-left: 1px solid transparent;\n}\n\n.farm-default-error__source-line--active {\n  border-left-color: var(--farm-error-source-marker);\n  background: var(--farm-error-source-line);\n}\n\n.farm-default-error__source-gutter {\n  padding-right: 14px;\n  color: var(--farm-error-subtle);\n  text-align: right;\n  user-select: none;\n}\n\n.farm-default-error__source-line--active .farm-default-error__source-gutter {\n  color: var(--farm-error-source-marker);\n}\n\n.farm-default-error__source-text {\n  white-space: pre;\n}\n\n.farm-default-error__details-empty {\n  margin: 0;\n  padding: 14px;\n  border: 1px solid var(--farm-error-line);\n  border-radius: 7px;\n  color: var(--farm-error-muted);\n  background: var(--farm-error-panel);\n  font-family: var(--farm-error-font-mono);\n  font-size: 12px;\n  line-height: 1.5;\n}\n\n.farm-default-error__meta {\n  margin: 12px 0 20px;\n  color: var(--farm-error-subtle);\n  font-size: 10px;\n  line-height: 1.5;\n  letter-spacing: 0.035em;\n}\n\n.farm-default-error__footer {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 12px;\n  padding-top: 24px;\n}\n\n.farm-default-error__footer-action {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  padding: 0;\n  border: 0;\n  color: var(--farm-error-muted);\n  background: transparent;\n  font-size: 10px;\n  font-weight: 540;\n  line-height: 1.4;\n  letter-spacing: 0.065em;\n  text-decoration: none;\n  cursor: pointer;\n  transition: color 150ms ease-out;\n}\n\n.farm-default-error__docs-icon {\n  width: 14px;\n  height: 14px;\n  flex: 0 0 auto;\n  stroke: currentColor;\n  stroke-width: 1.25;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n\n.farm-default-error__sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border: 0;\n}\n\n@media (hover: hover) and (pointer: fine) {\n  .farm-default-error__action:hover {\n    border-color: var(--farm-error-fg);\n    background: var(--farm-error-source-line);\n  }\n\n  .farm-default-error__action--primary:hover {\n    border-color: var(--farm-error-muted);\n    background: var(--farm-error-muted);\n  }\n\n  .farm-default-error__copy:hover {\n    border-color: var(--farm-error-line-strong);\n    color: var(--farm-error-fg);\n    background: var(--farm-error-source-line);\n  }\n\n  .farm-default-error__footer-action:hover {\n    color: var(--farm-error-fg);\n  }\n}\n\n.farm-default-error__copy:active,\n.farm-default-error__action:active {\n  transform: translateY(1px);\n}\n\n.farm-default-error__copy:focus-visible,\n.farm-default-error__action:focus-visible,\n.farm-default-error__footer-action:focus-visible {\n  outline: 2px solid var(--farm-error-fg);\n  outline-offset: 3px;\n}\n\n@media (max-width: 620px) {\n  .farm-default-error__frame {\n    padding: 22px 18px 26px;\n  }\n\n  .farm-default-error__content {\n    padding: 56px 0 68px;\n  }\n\n  .farm-default-error > .farm-default-error__content {\n    padding: 48px 18px;\n  }\n\n  .farm-default-error__title {\n    font-size: clamp(34px, 11vw, 44px);\n  }\n\n  .farm-default-error__message {\n    margin-top: 15px;\n  }\n\n  .farm-default-error__actions {\n    display: grid;\n    grid-template-columns: 1fr;\n  }\n\n  .farm-default-error__action {\n    width: 100%;\n  }\n\n  .farm-default-error__row {\n    grid-template-columns: 1fr;\n    gap: 2px;\n    padding: 11px 0;\n  }\n\n  .farm-default-error__value {\n    padding: 0;\n  }\n\n  .farm-default-error__details-header {\n    align-items: flex-start;\n    flex-direction: column;\n  }\n\n  .farm-default-error__copy {\n    width: 100%;\n  }\n\n  .farm-default-error__source-line {\n    grid-template-columns: 54px minmax(0, 1fr);\n  }\n}\n\n@media (prefers-color-scheme: light) {\n  .farm-default-error {\n    --farm-error-bg: #f7f7f5;\n    --farm-error-panel: #ffffff;\n    --farm-error-fg: #141414;\n    --farm-error-muted: #666666;\n    --farm-error-subtle: #8a8a8a;\n    --farm-error-line: rgba(0, 0, 0, 0.1);\n    --farm-error-line-strong: rgba(0, 0, 0, 0.19);\n    --farm-error-button-bg: #141414;\n    --farm-error-button-fg: #ffffff;\n    --farm-error-source-line: rgba(0, 0, 0, 0.045);\n    --farm-error-source-marker: #141414;\n    color-scheme: light;\n  }\n}\n\n.dark .farm-default-error,\n[data-theme=\"dark\"] .farm-default-error,\n[data-color-scheme=\"dark\"] .farm-default-error {\n  --farm-error-bg: #080808;\n  --farm-error-panel: #0d0d0d;\n  --farm-error-fg: #f3f3f3;\n  --farm-error-muted: #9a9a9a;\n  --farm-error-subtle: #6f6f6f;\n  --farm-error-line: rgba(255, 255, 255, 0.1);\n  --farm-error-line-strong: rgba(255, 255, 255, 0.2);\n  --farm-error-button-bg: #f1f1f1;\n  --farm-error-button-fg: #0a0a0a;\n  --farm-error-source-line: rgba(255, 255, 255, 0.055);\n  --farm-error-source-marker: #f3f3f3;\n  color-scheme: dark;\n}\n\n.light .farm-default-error,\n[data-theme=\"light\"] .farm-default-error,\n[data-color-scheme=\"light\"] .farm-default-error {\n  --farm-error-bg: #f7f7f5;\n  --farm-error-panel: #ffffff;\n  --farm-error-fg: #141414;\n  --farm-error-muted: #666666;\n  --farm-error-subtle: #8a8a8a;\n  --farm-error-line: rgba(0, 0, 0, 0.1);\n  --farm-error-line-strong: rgba(0, 0, 0, 0.19);\n  --farm-error-button-bg: #141414;\n  --farm-error-button-fg: #ffffff;\n  --farm-error-source-line: rgba(0, 0, 0, 0.045);\n  --farm-error-source-marker: #141414;\n  color-scheme: light;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .farm-default-error__copy,\n  .farm-default-error__action,\n  .farm-default-error__footer-action {\n    transition: none;\n  }\n\n  .farm-default-error__copy:active,\n  .farm-default-error__action:active {\n    transform: none;\n  }\n}\n`;\n","{\n  \"name\": \"@farm.js/core\",\n  \"version\": \"0.1.0-beta.102\",\n  \"description\": \"Core Farm.js framework for modern integrated apps\",\n  \"keywords\": [\n    \"@farm.js/core\",\n    \"framework\",\n    \"react\",\n    \"rsc\",\n    \"server-components\",\n    \"ssr\",\n    \"vite\"\n  ],\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/farming-labs/farm.js\",\n    \"directory\": \"packages/farm\"\n  },\n  \"files\": [\n    \"dist\",\n    \"types\"\n  ],\n  \"main\": \"./dist/index.cjs\",\n  \"module\": \"./dist/index.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"typesVersions\": {\n    \"*\": {\n      \"middleware\": [\n        \"./types/middleware.d.ts\",\n        \"./dist/middleware.d.ts\"\n      ],\n      \"version\": [\n        \"./dist/version.d.ts\"\n      ],\n      \"router\": [\n        \"./dist/router.d.ts\"\n      ],\n      \"routes\": [\n        \"./dist/routes.d.ts\"\n      ],\n      \"storage\": [\n        \"./dist/storage.d.ts\"\n      ],\n      \"integrations\": [\n        \"./dist/integrations.d.ts\"\n      ],\n      \"schema\": [\n        \"./dist/schema.d.ts\"\n      ],\n      \"cache\": [\n        \"./dist/cache.d.ts\"\n      ],\n      \"deferred\": [\n        \"./dist/deferred.d.ts\"\n      ],\n      \"after\": [\n        \"./dist/after.d.ts\"\n      ],\n      \"navigation\": [\n        \"./dist/navigation.d.ts\"\n      ],\n      \"headers\": [\n        \"./dist/headers.d.ts\"\n      ],\n      \"theme\": [\n        \"./dist/theme/index.d.ts\"\n      ],\n      \"theme/client\": [\n        \"./dist/theme/client.d.ts\"\n      ],\n      \"theme/runtime\": [\n        \"./dist/theme/runtime.d.ts\"\n      ],\n      \"theme/server\": [\n        \"./dist/theme/server.d.ts\"\n      ],\n      \"docs\": [\n        \"./dist/docs.d.ts\"\n      ],\n      \"markdown\": [\n        \"./dist/markdown.d.ts\"\n      ],\n      \"app-markdown\": [\n        \"./dist/app-markdown.d.ts\"\n      ],\n      \"observability\": [\n        \"./dist/observability.d.ts\"\n      ],\n      \"instrumentation\": [\n        \"./dist/instrumentation.d.ts\"\n      ],\n      \"workflows\": [\n        \"./dist/workflows.d.ts\"\n      ],\n      \"cron\": [\n        \"./dist/cron.d.ts\"\n      ],\n      \"server-fn\": [\n        \"./dist/server-fn.d.ts\"\n      ],\n      \"server-fn/client\": [\n        \"./dist/server-fn-client.d.ts\"\n      ],\n      \"server-query\": [\n        \"./dist/server-query.d.ts\"\n      ],\n      \"server-query/client\": [\n        \"./dist/server-query-client.d.ts\"\n      ],\n      \"server-action-security\": [\n        \"./dist/server-action-security.d.ts\"\n      ],\n      \"deployment\": [\n        \"./dist/deployment.d.ts\"\n      ],\n      \"env\": [\n        \"./dist/env.d.ts\"\n      ],\n      \"env-types\": [\n        \"./dist/env-types.d.ts\"\n      ],\n      \"environment\": [\n        \"./dist/environment.d.ts\"\n      ],\n      \"environment/vite\": [\n        \"./dist/environment/vite.d.ts\"\n      ],\n      \"font\": [\n        \"./dist/font.d.ts\"\n      ],\n      \"testing\": [\n        \"./dist/testing.d.ts\"\n      ],\n      \"agent-runtime\": [\n        \"./dist/agent-runtime.d.ts\"\n      ],\n      \"css\": [\n        \"./types/css.d.ts\"\n      ],\n      \"image\": [\n        \"./types/image.d.ts\",\n        \"./dist/image.d.ts\"\n      ],\n      \"image/server\": [\n        \"./dist/image/server.d.ts\"\n      ],\n      \"image/sharp\": [\n        \"./dist/image/sharp.d.ts\"\n      ],\n      \"i18n\": [\n        \"./dist/i18n/index.d.ts\"\n      ],\n      \"i18n/server\": [\n        \"./dist/i18n/server.d.ts\"\n      ],\n      \"i18n/client\": [\n        \"./dist/i18n/client.d.ts\"\n      ],\n      \"internal/production-runtime\": [\n        \"./dist/internal/production-runtime.d.ts\"\n      ],\n      \"internal/product-telemetry-runtime\": [\n        \"./dist/internal/product-telemetry-runtime.d.ts\"\n      ],\n      \"internal/metadata-image-runtime\": [\n        \"./dist/internal/metadata-image-runtime.d.ts\"\n      ],\n      \"internal/client-runtime\": [\n        \"./dist/internal/client-runtime.d.ts\"\n      ],\n      \"internal/isolated-boundary\": [\n        \"./dist/internal/isolated-boundary.d.ts\"\n      ],\n      \"internal/build-runtime\": [\n        \"./dist/internal/build-runtime.d.ts\"\n      ],\n      \"internal/config-runtime\": [\n        \"./dist/internal/config-runtime.d.ts\"\n      ],\n      \"internal/production-node-env\": [\n        \"./dist/internal/production-node-env.d.ts\"\n      ],\n      \"config\": [\n        \"./dist/config.d.ts\"\n      ],\n      \"renderer\": [\n        \"./dist/renderer.d.ts\"\n      ],\n      \"renderer-client\": [\n        \"./dist/renderer-client.d.ts\"\n      ],\n      \"api\": [\n        \"./types/api.d.ts\",\n        \"./dist/api.d.ts\"\n      ],\n      \"api/client\": [\n        \"./dist/api/client.d.ts\"\n      ],\n      \"api/route-manager\": [\n        \"./dist/api/route-manager.d.ts\"\n      ],\n      \"api/runtime\": [\n        \"./dist/api/runtime.d.ts\"\n      ],\n      \"request\": [\n        \"./dist/request.d.ts\"\n      ],\n      \"client\": [\n        \"./types/client.d.ts\",\n        \"./dist/client.d.ts\"\n      ],\n      \"client/lifecycle\": [\n        \"./dist/client/lifecycle.d.ts\"\n      ],\n      \"server\": [\n        \"./dist/server.d.ts\"\n      ],\n      \"vite\": [\n        \"./dist/vite.d.ts\"\n      ],\n      \"plugin\": [\n        \"./dist/plugin.d.ts\"\n      ],\n      \"query\": [\n        \"./dist/query/index.d.ts\"\n      ],\n      \"*\": [\n        \"./dist/*.d.ts\"\n      ]\n    }\n  },\n  \"exports\": {\n    \".\": {\n      \"types\": \"./dist/index.d.ts\",\n      \"import\": \"./dist/index.mjs\",\n      \"require\": \"./dist/index.cjs\",\n      \"default\": \"./dist/index.mjs\"\n    },\n    \"./version\": {\n      \"types\": \"./dist/version.d.ts\",\n      \"import\": \"./dist/version.mjs\",\n      \"require\": \"./dist/version.cjs\"\n    },\n    \"./config\": {\n      \"types\": \"./dist/config.d.ts\",\n      \"import\": \"./dist/config.mjs\",\n      \"require\": \"./dist/config.cjs\"\n    },\n    \"./renderer\": {\n      \"types\": \"./dist/renderer.d.ts\",\n      \"import\": \"./dist/renderer.mjs\",\n      \"require\": \"./dist/renderer.cjs\"\n    },\n    \"./renderer-client\": {\n      \"types\": \"./dist/renderer-client.d.ts\",\n      \"import\": \"./dist/renderer-client.mjs\",\n      \"require\": \"./dist/renderer-client.cjs\"\n    },\n    \"./renderer/react/server\": {\n      \"types\": \"./dist/renderer/react/server.d.ts\",\n      \"import\": \"./dist/renderer/react/server.mjs\",\n      \"require\": \"./dist/renderer/react/server.cjs\"\n    },\n    \"./renderer/react/client\": {\n      \"types\": \"./dist/renderer/react/client.d.ts\",\n      \"import\": \"./dist/renderer/react/client.mjs\",\n      \"require\": \"./dist/renderer/react/client.cjs\"\n    },\n    \"./renderer/react/vite\": {\n      \"types\": \"./dist/renderer/react/vite.d.ts\",\n      \"import\": \"./dist/renderer/react/vite.mjs\",\n      \"require\": \"./dist/renderer/react/vite.cjs\"\n    },\n    \"./server\": {\n      \"types\": \"./dist/server.d.ts\",\n      \"import\": \"./dist/server.mjs\",\n      \"require\": \"./dist/server.cjs\"\n    },\n    \"./client\": {\n      \"types\": \"./types/client.d.ts\",\n      \"import\": \"./dist/client.mjs\",\n      \"require\": \"./dist/client.cjs\"\n    },\n    \"./client/lifecycle\": {\n      \"types\": \"./dist/client/lifecycle.d.ts\",\n      \"import\": \"./dist/client/lifecycle.mjs\",\n      \"require\": \"./dist/client/lifecycle.cjs\"\n    },\n    \"./storage\": {\n      \"types\": \"./dist/storage.d.ts\",\n      \"import\": \"./dist/storage.mjs\",\n      \"require\": \"./dist/storage.cjs\"\n    },\n    \"./integrations\": {\n      \"types\": \"./dist/integrations.d.ts\",\n      \"import\": \"./dist/integrations.mjs\",\n      \"require\": \"./dist/integrations.cjs\"\n    },\n    \"./schema\": {\n      \"types\": \"./dist/schema.d.ts\",\n      \"import\": \"./dist/schema.mjs\",\n      \"require\": \"./dist/schema.cjs\"\n    },\n    \"./cache\": {\n      \"types\": \"./dist/cache.d.ts\",\n      \"import\": \"./dist/cache.mjs\",\n      \"require\": \"./dist/cache.cjs\"\n    },\n    \"./deferred\": {\n      \"types\": \"./dist/deferred.d.ts\",\n      \"import\": \"./dist/deferred.mjs\",\n      \"require\": \"./dist/deferred.cjs\"\n    },\n    \"./after\": {\n      \"types\": \"./dist/after.d.ts\",\n      \"import\": \"./dist/after.mjs\",\n      \"require\": \"./dist/after.cjs\"\n    },\n    \"./navigation\": {\n      \"types\": \"./dist/navigation.d.ts\",\n      \"import\": \"./dist/navigation.mjs\",\n      \"require\": \"./dist/navigation.cjs\"\n    },\n    \"./headers\": {\n      \"types\": \"./dist/headers.d.ts\",\n      \"import\": \"./dist/headers.mjs\",\n      \"require\": \"./dist/headers.cjs\"\n    },\n    \"./theme\": {\n      \"types\": \"./dist/theme/index.d.ts\",\n      \"import\": \"./dist/theme/index.mjs\",\n      \"require\": \"./dist/theme/index.cjs\"\n    },\n    \"./theme/client\": {\n      \"types\": \"./dist/theme/client.d.ts\",\n      \"import\": \"./dist/theme/client.mjs\",\n      \"require\": \"./dist/theme/client.cjs\"\n    },\n    \"./theme/runtime\": {\n      \"types\": \"./dist/theme/runtime.d.ts\",\n      \"import\": \"./dist/theme/runtime.mjs\",\n      \"require\": \"./dist/theme/runtime.cjs\"\n    },\n    \"./theme/server\": {\n      \"types\": \"./dist/theme/server.d.ts\",\n      \"import\": \"./dist/theme/server.mjs\",\n      \"require\": \"./dist/theme/server.cjs\"\n    },\n    \"./docs\": {\n      \"types\": \"./dist/docs.d.ts\",\n      \"import\": \"./dist/docs.mjs\",\n      \"require\": \"./dist/docs.cjs\"\n    },\n    \"./markdown\": {\n      \"types\": \"./dist/markdown.d.ts\",\n      \"import\": \"./dist/markdown.mjs\",\n      \"require\": \"./dist/markdown.cjs\"\n    },\n    \"./app-markdown\": {\n      \"types\": \"./dist/app-markdown.d.ts\",\n      \"import\": \"./dist/app-markdown.mjs\",\n      \"require\": \"./dist/app-markdown.cjs\"\n    },\n    \"./observability\": {\n      \"types\": \"./dist/observability.d.ts\",\n      \"import\": \"./dist/observability.mjs\",\n      \"require\": \"./dist/observability.cjs\"\n    },\n    \"./instrumentation\": {\n      \"types\": \"./dist/instrumentation.d.ts\",\n      \"import\": \"./dist/instrumentation.mjs\",\n      \"require\": \"./dist/instrumentation.cjs\"\n    },\n    \"./workflows\": {\n      \"types\": \"./dist/workflows.d.ts\",\n      \"import\": \"./dist/workflows.mjs\",\n      \"require\": \"./dist/workflows.cjs\"\n    },\n    \"./cron\": {\n      \"types\": \"./dist/cron.d.ts\",\n      \"import\": \"./dist/cron.mjs\",\n      \"require\": \"./dist/cron.cjs\"\n    },\n    \"./server-fn\": {\n      \"types\": \"./dist/server-fn.d.ts\",\n      \"import\": \"./dist/server-fn.mjs\",\n      \"require\": \"./dist/server-fn.cjs\"\n    },\n    \"./server-fn/client\": {\n      \"types\": \"./dist/server-fn-client.d.ts\",\n      \"import\": \"./dist/server-fn-client.mjs\",\n      \"require\": \"./dist/server-fn-client.cjs\"\n    },\n    \"./server-query\": {\n      \"types\": \"./dist/server-query.d.ts\",\n      \"import\": \"./dist/server-query.mjs\",\n      \"require\": \"./dist/server-query.cjs\"\n    },\n    \"./server-query/client\": {\n      \"types\": \"./dist/server-query-client.d.ts\",\n      \"import\": \"./dist/server-query-client.mjs\",\n      \"require\": \"./dist/server-query-client.cjs\"\n    },\n    \"./server-action-security\": {\n      \"types\": \"./dist/server-action-security.d.ts\",\n      \"import\": \"./dist/server-action-security.mjs\",\n      \"require\": \"./dist/server-action-security.cjs\"\n    },\n    \"./deployment\": {\n      \"types\": \"./dist/deployment.d.ts\",\n      \"import\": \"./dist/deployment.mjs\",\n      \"require\": \"./dist/deployment.cjs\"\n    },\n    \"./env\": {\n      \"types\": \"./dist/env.d.ts\",\n      \"import\": \"./dist/env.mjs\",\n      \"require\": \"./dist/env.cjs\"\n    },\n    \"./env-types\": {\n      \"types\": \"./dist/env-types.d.ts\",\n      \"import\": \"./dist/env-types.mjs\",\n      \"require\": \"./dist/env-types.cjs\"\n    },\n    \"./environment\": {\n      \"types\": \"./dist/environment.d.ts\",\n      \"import\": \"./dist/environment.mjs\",\n      \"require\": \"./dist/environment.cjs\"\n    },\n    \"./environment/vite\": {\n      \"types\": \"./dist/environment/vite.d.ts\",\n      \"import\": \"./dist/environment/vite.mjs\",\n      \"require\": \"./dist/environment/vite.cjs\"\n    },\n    \"./font\": {\n      \"types\": \"./dist/font.d.ts\",\n      \"import\": \"./dist/font.mjs\",\n      \"require\": \"./dist/font.cjs\"\n    },\n    \"./vite\": {\n      \"types\": \"./dist/vite.d.ts\",\n      \"import\": \"./dist/vite.mjs\",\n      \"require\": \"./dist/vite.cjs\"\n    },\n    \"./plugin\": {\n      \"types\": \"./dist/plugin.d.ts\",\n      \"import\": \"./dist/plugin.mjs\",\n      \"require\": \"./dist/plugin.cjs\"\n    },\n    \"./plugin/server\": {\n      \"types\": \"./dist/server-plugins.d.ts\",\n      \"import\": \"./dist/server-plugins.mjs\",\n      \"require\": \"./dist/server-plugins.cjs\"\n    },\n    \"./plugin/client\": {\n      \"types\": \"./dist/client-plugins.d.ts\",\n      \"import\": \"./dist/client-plugins.mjs\",\n      \"require\": \"./dist/client-plugins.cjs\"\n    },\n    \"./query\": {\n      \"types\": \"./dist/query/index.d.ts\",\n      \"import\": \"./dist/query/index.mjs\",\n      \"require\": \"./dist/query/index.cjs\"\n    },\n    \"./query/parsers\": {\n      \"types\": \"./dist/query/parsers.d.ts\",\n      \"import\": \"./dist/query/parsers.mjs\",\n      \"require\": \"./dist/query/parsers.cjs\"\n    },\n    \"./query/client\": {\n      \"types\": \"./dist/query/client.d.ts\",\n      \"import\": \"./dist/query/client.mjs\",\n      \"require\": \"./dist/query/client.cjs\"\n    },\n    \"./query/server\": {\n      \"types\": \"./dist/query/server.d.ts\",\n      \"import\": \"./dist/query/server.mjs\",\n      \"require\": \"./dist/query/server.cjs\"\n    },\n    \"./middleware\": {\n      \"types\": \"./dist/middleware.d.ts\",\n      \"import\": \"./dist/middleware.mjs\",\n      \"require\": \"./dist/middleware.cjs\"\n    },\n    \"./api\": {\n      \"types\": \"./dist/api.d.ts\",\n      \"import\": \"./dist/api.mjs\",\n      \"require\": \"./dist/api.cjs\"\n    },\n    \"./api/client\": {\n      \"types\": \"./dist/api/client.d.ts\",\n      \"import\": \"./dist/api/client.mjs\",\n      \"require\": \"./dist/api/client.cjs\"\n    },\n    \"./api/route-manager\": {\n      \"types\": \"./dist/api/route-manager.d.ts\",\n      \"import\": \"./dist/api/route-manager.mjs\",\n      \"require\": \"./dist/api/route-manager.cjs\"\n    },\n    \"./api/runtime\": {\n      \"types\": \"./dist/api/runtime.d.ts\",\n      \"import\": \"./dist/api/runtime.mjs\",\n      \"require\": \"./dist/api/runtime.cjs\"\n    },\n    \"./request\": {\n      \"types\": \"./dist/request.d.ts\",\n      \"import\": \"./dist/request.mjs\",\n      \"require\": \"./dist/request.cjs\"\n    },\n    \"./router\": {\n      \"types\": \"./dist/router.d.ts\",\n      \"import\": \"./dist/router.mjs\",\n      \"require\": \"./dist/router.cjs\"\n    },\n    \"./routes\": {\n      \"types\": \"./dist/routes.d.ts\",\n      \"import\": \"./dist/routes.mjs\",\n      \"require\": \"./dist/routes.cjs\"\n    },\n    \"./testing\": {\n      \"types\": \"./dist/testing.d.ts\",\n      \"import\": \"./dist/testing.mjs\",\n      \"require\": \"./dist/testing.cjs\"\n    },\n    \"./agent-runtime\": {\n      \"types\": \"./dist/agent-runtime.d.ts\",\n      \"import\": \"./dist/agent-runtime.mjs\",\n      \"require\": \"./dist/agent-runtime.cjs\"\n    },\n    \"./css\": {\n      \"types\": \"./types/css.d.ts\"\n    },\n    \"./image\": {\n      \"types\": \"./types/image.d.ts\",\n      \"import\": \"./dist/image.mjs\",\n      \"require\": \"./dist/image.cjs\"\n    },\n    \"./image/server\": {\n      \"types\": \"./dist/image/server.d.ts\",\n      \"import\": \"./dist/image/server.mjs\",\n      \"require\": \"./dist/image/server.cjs\"\n    },\n    \"./image/sharp\": {\n      \"types\": \"./dist/image/sharp.d.ts\",\n      \"import\": \"./dist/image/sharp.mjs\",\n      \"require\": \"./dist/image/sharp.cjs\"\n    },\n    \"./i18n\": {\n      \"types\": \"./dist/i18n/index.d.ts\",\n      \"import\": \"./dist/i18n/index.mjs\",\n      \"require\": \"./dist/i18n/index.cjs\"\n    },\n    \"./i18n/server\": {\n      \"types\": \"./dist/i18n/server.d.ts\",\n      \"import\": \"./dist/i18n/server.mjs\",\n      \"require\": \"./dist/i18n/server.cjs\"\n    },\n    \"./i18n/client\": {\n      \"types\": \"./dist/i18n/client.d.ts\",\n      \"import\": \"./dist/i18n/client.mjs\",\n      \"require\": \"./dist/i18n/client.cjs\"\n    },\n    \"./internal/production-runtime\": {\n      \"types\": \"./dist/internal/production-runtime.d.ts\",\n      \"import\": \"./dist/internal/production-runtime.mjs\",\n      \"require\": \"./dist/internal/production-runtime.cjs\"\n    },\n    \"./internal/product-telemetry-runtime\": {\n      \"types\": \"./dist/internal/product-telemetry-runtime.d.ts\",\n      \"import\": \"./dist/internal/product-telemetry-runtime.mjs\",\n      \"require\": \"./dist/internal/product-telemetry-runtime.cjs\"\n    },\n    \"./internal/metadata-image-runtime\": {\n      \"types\": \"./dist/internal/metadata-image-runtime.d.ts\",\n      \"import\": \"./dist/internal/metadata-image-runtime.mjs\",\n      \"require\": \"./dist/internal/metadata-image-runtime.cjs\"\n    },\n    \"./internal/client-runtime\": {\n      \"types\": \"./dist/internal/client-runtime.d.ts\",\n      \"import\": \"./dist/internal/client-runtime.mjs\",\n      \"require\": \"./dist/internal/client-runtime.cjs\"\n    },\n    \"./internal/isolated-boundary\": {\n      \"types\": \"./dist/internal/isolated-boundary.d.ts\",\n      \"import\": \"./dist/internal/isolated-boundary.mjs\",\n      \"require\": \"./dist/internal/isolated-boundary.cjs\"\n    },\n    \"./internal/build-runtime\": {\n      \"types\": \"./dist/internal/build-runtime.d.ts\",\n      \"import\": \"./dist/internal/build-runtime.mjs\",\n      \"require\": \"./dist/internal/build-runtime.cjs\"\n    },\n    \"./internal/config-runtime\": {\n      \"types\": \"./dist/internal/config-runtime.d.ts\",\n      \"import\": \"./dist/internal/config-runtime.mjs\",\n      \"require\": \"./dist/internal/config-runtime.cjs\"\n    },\n    \"./internal/production-node-env\": {\n      \"types\": \"./dist/internal/production-node-env.d.ts\",\n      \"import\": \"./dist/internal/production-node-env.mjs\",\n      \"require\": \"./dist/internal/production-node-env.cjs\"\n    }\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"build\": \"tsup\",\n    \"build:runtime\": \"tsup --config tsup.runtime.config.ts\",\n    \"dev\": \"tsup --watch\",\n    \"test\": \"vitest run\",\n    \"test:coverage\": \"vitest --coverage\",\n    \"lint\": \"biome lint .\",\n    \"lint:fix\": \"biome lint --write .\",\n    \"format\": \"biome format --write .\",\n    \"type-check\": \"tsc --noEmit\",\n    \"clean\": \"rm -rf dist\"\n  },\n  \"dependencies\": {\n    \"@farming-labs/docs\": \"^0.2.44\",\n    \"@farming-labs/orm\": \"0.0.62\",\n    \"@farming-labs/orm-runtime\": \"0.0.62\",\n    \"@formatjs/icu-messageformat-parser\": \"3.5.15\",\n    \"@jridgewell/trace-mapping\": \"0.3.31\",\n    \"@mdx-js/mdx\": \"^3.1.1\",\n    \"@opentelemetry/api\": \"1.9.1\",\n    \"@scalar/api-reference\": \"^1.38.1\",\n    \"@scalar/openapi-parser\": \"^0.22.3\",\n    \"@tailwindcss/vite\": \"4.1.18\",\n    \"@vercel/og\": \"0.11.1\",\n    \"@vitejs/plugin-react\": \"^4.2.1\",\n    \"better-call\": \"^1.0.19\",\n    \"db0\": \"^0.3.4\",\n    \"es-module-lexer\": \"2.0.0\",\n    \"esbuild\": \"^0.28.0\",\n    \"fast-glob\": \"^3.3.2\",\n    \"h3\": \"2.0.1-rc.5\",\n    \"image-size\": \"^2.0.2\",\n    \"intl-messageformat\": \"11.2.12\",\n    \"marked\": \"^12.0.2\",\n    \"nitro\": \"3.0.1-alpha.0\",\n    \"pg\": \"^8.20.0\",\n    \"picocolors\": \"^1.0.0\",\n    \"remark-gfm\": \"^4.0.1\",\n    \"sirv\": \"^2.0.4\",\n    \"sugar-high\": \"^0.9.5\",\n    \"supports-color\": \"^10.2.2\",\n    \"tailwindcss\": \"4.1.18\",\n    \"unstorage\": \"^2.0.0-alpha.3\",\n    \"vite\": \"^5.0.10\",\n    \"zod\": \"^4.1.12\"\n  },\n  \"devDependencies\": {\n    \"@clerk/react\": \"^6.1.0\",\n    \"@farm.js/otel\": \"workspace:*\",\n    \"@farm.js/renderer-tests\": \"workspace:*\",\n    \"@opentelemetry/sdk-node\": \"0.221.0\",\n    \"@opentelemetry/sdk-trace-base\": \"2.10.0\",\n    \"@types/react\": \"^18.2.45\",\n    \"@types/react-dom\": \"^18.2.18\",\n    \"@vitest/coverage-v8\": \"^3.2.7\",\n    \"jsdom\": \"^25.0.0\",\n    \"react\": \"19.2.8\",\n    \"react-dom\": \"19.2.8\",\n    \"tsup\": \"^8.3.5\",\n    \"typescript\": \"^5.3.3\",\n    \"vitest\": \"^3.2.7\"\n  },\n  \"peerDependencies\": {\n    \"react\": \"^18.2.0 || ^19.0.0\",\n    \"react-dom\": \"^18.2.0 || ^19.0.0\"\n  },\n  \"peerDependenciesMeta\": {\n    \"react\": {\n      \"optional\": true\n    },\n    \"react-dom\": {\n      \"optional\": true\n    }\n  },\n  \"optionalDependencies\": {\n    \"rolldown\": \"1.2.0\",\n    \"sharp\": \"^0.34.5\",\n    \"vite-rolldown\": \"npm:vite@8.1.5\"\n  },\n  \"engines\": {\n    \"node\": \">=22.13.0\"\n  }\n}\n","import { version } from \"../package.json\";\n\nexport const FARM_VERSION = version;\n","\"use client\";\n\nimport {\n  createFarmRuntimeErrorOverlay,\n  type FarmRuntimeErrorOverlay,\n} from \"./runtime-error-overlay\";\n\ntype MaybePromise<T> = T | Promise<T>;\n\nexport type FarmClientPluginEnforce = \"pre\" | \"post\";\nexport type FarmClientNavigationAction = \"push\" | \"replace\" | \"pop\";\nexport type FarmClientHydrationMode = \"hydrate\" | \"render\";\n\nexport interface FarmClientLocation {\n  href: string;\n  pathname: string;\n  search: string;\n  hash: string;\n}\n\nexport interface FarmClientPluginRouter {\n  navigate(href: string, options?: Record<string, unknown>): MaybePromise<void>;\n  /** Re-render the current URL from fresh server data without replacing the document shell. */\n  refresh?(options?: Record<string, unknown>): MaybePromise<void>;\n  prefetch?(href: string): MaybePromise<void>;\n  clearCache?(): void;\n  getNavigationState?(): unknown;\n}\n\nexport interface FarmClientPluginMetadata {\n  name: string;\n  version?: string;\n}\n\nexport interface FarmClientPluginSetupEvent<TPublic = undefined> {\n  plugin: FarmClientPluginMetadata;\n  public: Readonly<TPublic>;\n  router: FarmClientPluginRouter;\n  isDev: boolean;\n  isProd: boolean;\n  deploymentId?: string;\n}\n\nexport interface FarmClientPluginStateEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientPluginSetupEvent<TPublic> {\n  state: TState;\n}\n\nexport interface FarmClientHydrationSession {\n  container: Element;\n  location: FarmClientLocation;\n  mode: FarmClientHydrationMode;\n  startedAt: number;\n}\n\nexport interface FarmClientHydrationEvent<TState = unknown, TPublic = undefined>\n  extends FarmClientPluginStateEvent<TState, TPublic>, FarmClientHydrationSession {}\n\nexport interface FarmClientHydrationCompleteEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientHydrationEvent<TState, TPublic> {\n  durationMs: number;\n  recovered: boolean;\n}\n\nexport interface FarmClientNavigationSession {\n  id: string;\n  from: FarmClientLocation | null;\n  to: FarmClientLocation;\n  action: FarmClientNavigationAction;\n  signal: AbortSignal;\n  startedAt: number;\n  route?: {\n    pattern?: string | null;\n    params?: Record<string, string>;\n  };\n}\n\nexport interface FarmClientNavigationEvent<TState = unknown, TPublic = undefined>\n  extends FarmClientPluginStateEvent<TState, TPublic>, FarmClientNavigationSession {}\n\nexport interface FarmClientNavigationLoadedEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientNavigationEvent<TState, TPublic> {\n  durationMs: number;\n  data?: unknown;\n}\n\nexport interface FarmClientNavigationResolvedEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientNavigationEvent<TState, TPublic> {\n  durationMs: number;\n}\n\nexport interface FarmClientNavigationErrorEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientNavigationResolvedEvent<TState, TPublic> {\n  error: unknown;\n}\n\nexport type FarmClientPluginErrorPhase =\n  | \"setup\"\n  | \"hydration\"\n  | \"navigation\"\n  | \"window\"\n  | \"unhandled-rejection\"\n  | \"performance\"\n  | `plugin:${string}`\n  | (string & {});\n\nexport interface FarmClientPluginErrorEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientPluginStateEvent<TState, TPublic> {\n  error: unknown;\n  phase: FarmClientPluginErrorPhase;\n  location: FarmClientLocation;\n  navigation?: FarmClientNavigationSession;\n}\n\nexport interface FarmClientPerformanceEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientPluginStateEvent<TState, TPublic> {\n  entry: PerformanceEntry;\n  location: FarmClientLocation;\n}\n\nexport interface FarmClientPluginCloseEvent<\n  TState = unknown,\n  TPublic = undefined,\n> extends FarmClientPluginStateEvent<TState, TPublic> {\n  reason: \"pagehide\" | \"hmr\" | \"manual\" | (string & {});\n}\n\nexport interface FarmClientPlugin<TState = unknown, TPublic = undefined> {\n  setup?(event: FarmClientPluginSetupEvent<TPublic>): MaybePromise<TState>;\n  hydration?: {\n    before?(event: FarmClientHydrationEvent<TState, TPublic>): MaybePromise<void>;\n    after?(event: FarmClientHydrationCompleteEvent<TState, TPublic>): MaybePromise<void>;\n  };\n  navigation?: {\n    before?(event: FarmClientNavigationEvent<TState, TPublic>): MaybePromise<void>;\n    loaded?(event: FarmClientNavigationLoadedEvent<TState, TPublic>): MaybePromise<void>;\n    resolved?(event: FarmClientNavigationResolvedEvent<TState, TPublic>): MaybePromise<void>;\n    rendered?(event: FarmClientNavigationResolvedEvent<TState, TPublic>): MaybePromise<void>;\n    error?(event: FarmClientNavigationErrorEvent<TState, TPublic>): MaybePromise<void>;\n  };\n  error?(event: FarmClientPluginErrorEvent<TState, TPublic>): MaybePromise<void>;\n  performance?(event: FarmClientPerformanceEvent<TState, TPublic>): MaybePromise<void>;\n  close?(event: FarmClientPluginCloseEvent<TState, TPublic>): MaybePromise<void>;\n}\n\nexport interface FarmClientPluginRegistration<TPublic = undefined> {\n  name: string;\n  version?: string;\n  enforce?: FarmClientPluginEnforce;\n  definition: FarmClientPlugin<any, TPublic>;\n  public?: TPublic;\n}\n\n/**\n * Define the lifecycle for an application's auto-discovered `src/client.ts`\n * entry. The identity helper preserves state inference while keeping the\n * module entirely in the browser bundle.\n */\nexport function defineClient<TState = unknown, TPublic = undefined>(\n  definition: FarmClientPlugin<TState, TPublic>,\n): FarmClientPlugin<TState, TPublic> {\n  return definition;\n}\n\nexport interface FarmClientPluginManagerOptions {\n  router: FarmClientPluginRouter;\n  isDev?: boolean;\n  isProd?: boolean;\n  deploymentId?: string;\n  window?: Window;\n}\n\ninterface FarmClientPluginInstance {\n  registration: FarmClientPluginRegistration<any>;\n  plugin: FarmClientPlugin<any, any>;\n  state: unknown;\n}\n\nconst PERFORMANCE_ENTRY_TYPES = [\n  \"navigation\",\n  \"paint\",\n  \"largest-contentful-paint\",\n  \"layout-shift\",\n  \"event\",\n];\n\nexport class FarmClientPluginManager {\n  private readonly registrations: FarmClientPluginRegistration[];\n  private readonly options: FarmClientPluginManagerOptions;\n  private readonly instances: FarmClientPluginInstance[] = [];\n  private readonly performanceObservers: PerformanceObserver[] = [];\n  private startPromise?: Promise<void>;\n  private closePromise?: Promise<void>;\n  private currentNavigation?: {\n    controller: AbortController;\n    session: FarmClientNavigationSession;\n  };\n  private navigationSequence = 0;\n  private starting = false;\n  private started = false;\n  private closed = false;\n  private readonly reportedErrors = new WeakSet<object>();\n  private readonly runtimeErrorOverlay?: FarmRuntimeErrorOverlay;\n\n  private readonly handleWindowError = (event: ErrorEvent) => {\n    const error = event.error ?? new Error(event.message || \"Unknown browser error\");\n    void this.reportError(error, \"window\", undefined, this.getLocation(), event);\n  };\n\n  private readonly handleUnhandledRejection = (event: PromiseRejectionEvent) => {\n    void this.reportError(\n      event.reason,\n      \"unhandled-rejection\",\n      undefined,\n      this.getLocation(),\n      event,\n    );\n  };\n\n  private readonly handlePageHide = (event: PageTransitionEvent) => {\n    // A persisted pagehide means the page is entering the back/forward cache and\n    // may be restored. close() is terminal — start() refuses to run again once\n    // closed — so tearing down here would hand the restored page dead scripts,\n    // PWA, and observability plugins with nothing able to revive them.\n    if (event.persisted) return;\n    void this.close(\"pagehide\");\n  };\n\n  constructor(\n    registrations: readonly FarmClientPluginRegistration[],\n    options: FarmClientPluginManagerOptions,\n  ) {\n    this.registrations = sortRegistrations(registrations);\n    this.options = {\n      ...options,\n      isDev: options.isDev ?? false,\n      isProd: options.isProd ?? !options.isDev,\n      window: options.window ?? (typeof window !== \"undefined\" ? window : undefined),\n    };\n    if (this.options.isDev && this.options.window) {\n      this.runtimeErrorOverlay = createFarmRuntimeErrorOverlay({\n        window: this.options.window,\n      });\n    }\n  }\n\n  start(): Promise<void> {\n    if (this.startPromise) return this.startPromise;\n\n    this.startPromise = Promise.resolve().then(() => this.startInternal());\n    return this.startPromise;\n  }\n\n  async beginHydration(input: {\n    container: Element;\n    mode: FarmClientHydrationMode;\n  }): Promise<FarmClientHydrationSession> {\n    await this.start();\n    const session: FarmClientHydrationSession = {\n      ...input,\n      location: this.getLocation(),\n      startedAt: now(),\n    };\n\n    await this.runHook(\"hydration.before\", (instance) =>\n      instance.plugin.hydration?.before?.({\n        ...this.createStateEvent(instance),\n        ...session,\n      }),\n    );\n\n    return session;\n  }\n\n  async completeHydration(\n    session: FarmClientHydrationSession,\n    options: { recovered?: boolean } = {},\n  ): Promise<void> {\n    await this.runHook(\"hydration.after\", (instance) =>\n      instance.plugin.hydration?.after?.({\n        ...this.createStateEvent(instance),\n        ...session,\n        durationMs: now() - session.startedAt,\n        recovered: options.recovered ?? false,\n      }),\n    );\n  }\n\n  async failHydration(session: FarmClientHydrationSession, error: unknown): Promise<void> {\n    await this.reportError(error, \"hydration\", undefined, session.location);\n  }\n\n  async beginNavigation(input: {\n    from?: string | URL | FarmClientLocation | null;\n    to: string | URL | FarmClientLocation;\n    action: FarmClientNavigationAction;\n    route?: FarmClientNavigationSession[\"route\"];\n  }): Promise<FarmClientNavigationSession> {\n    await this.start();\n    this.currentNavigation?.controller.abort(\"superseded\");\n\n    const controller = new AbortController();\n    const session: FarmClientNavigationSession = {\n      id: `navigation:${++this.navigationSequence}`,\n      from:\n        input.from === null\n          ? null\n          : toClientLocation(input.from ?? this.getLocation().href, this.getBaseUrl()),\n      to: toClientLocation(input.to, this.getBaseUrl()),\n      action: input.action,\n      signal: controller.signal,\n      startedAt: now(),\n      route: input.route,\n    };\n\n    this.currentNavigation = { controller, session };\n    await this.runHook(\"navigation.before\", (instance) =>\n      instance.plugin.navigation?.before?.({\n        ...this.createStateEvent(instance),\n        ...session,\n      }),\n    );\n\n    return session;\n  }\n\n  async markNavigationLoaded(session: FarmClientNavigationSession, data?: unknown): Promise<void> {\n    if (session.signal.aborted) return;\n    await this.runHook(\"navigation.loaded\", (instance) =>\n      instance.plugin.navigation?.loaded?.({\n        ...this.createStateEvent(instance),\n        ...session,\n        data,\n        durationMs: now() - session.startedAt,\n      }),\n    );\n  }\n\n  cancelNavigation(session?: FarmClientNavigationSession, reason: unknown = \"canceled\"): void {\n    const current = this.currentNavigation;\n    if (!current || (session && current.session !== session)) return;\n    current.controller.abort(reason);\n    this.currentNavigation = undefined;\n  }\n\n  async resolveNavigation(session: FarmClientNavigationSession): Promise<void> {\n    if (session.signal.aborted) return;\n    await this.runHook(\"navigation.resolved\", (instance) =>\n      instance.plugin.navigation?.resolved?.({\n        ...this.createStateEvent(instance),\n        ...session,\n        durationMs: now() - session.startedAt,\n      }),\n    );\n  }\n\n  scheduleNavigationRendered(session: FarmClientNavigationSession): Promise<void> {\n    if (session.signal.aborted) return Promise.resolve();\n    const clientWindow = this.options.window;\n    const schedule = clientWindow?.requestAnimationFrame\n      ? (callback: () => void) =>\n          clientWindow.requestAnimationFrame(() => clientWindow.requestAnimationFrame(callback))\n      : (callback: () => void) => setTimeout(callback, 0);\n\n    return new Promise((resolve) => {\n      schedule(() => {\n        if (session.signal.aborted || this.closed) {\n          resolve();\n          return;\n        }\n        void this.runHook(\"navigation.rendered\", (instance) =>\n          instance.plugin.navigation?.rendered?.({\n            ...this.createStateEvent(instance),\n            ...session,\n            durationMs: now() - session.startedAt,\n          }),\n        ).finally(() => {\n          if (this.currentNavigation?.session === session) {\n            this.currentNavigation = undefined;\n          }\n          resolve();\n        });\n      });\n    });\n  }\n\n  async failNavigation(session: FarmClientNavigationSession, error: unknown): Promise<void> {\n    if (!session.signal.aborted) {\n      await this.runHook(\"navigation.error\", (instance) =>\n        instance.plugin.navigation?.error?.({\n          ...this.createStateEvent(instance),\n          ...session,\n          durationMs: now() - session.startedAt,\n          error,\n        }),\n      );\n      await this.reportError(error, \"navigation\", session, session.to);\n    }\n\n    if (this.currentNavigation?.session === session) {\n      this.currentNavigation = undefined;\n    }\n  }\n\n  async reportError(\n    error: unknown,\n    phase: FarmClientPluginErrorPhase,\n    navigation?: FarmClientNavigationSession,\n    location = this.getLocation(),\n    sourceEvent?: Event,\n  ): Promise<void> {\n    if (this.closed) return;\n    if (isObject(error)) {\n      if (this.reportedErrors.has(error)) return;\n      this.reportedErrors.add(error);\n    }\n\n    if (!this.started && !this.starting) await this.start();\n    await this.runErrorHooks({ error, phase, navigation, location }, undefined, sourceEvent);\n  }\n\n  close(reason: FarmClientPluginCloseEvent[\"reason\"] = \"manual\"): Promise<void> {\n    if (this.closePromise) return this.closePromise;\n    this.closePromise = this.closeInternal(reason);\n    return this.closePromise;\n  }\n\n  getPlugins(): readonly FarmClientPluginMetadata[] {\n    return this.instances.map(({ registration }) => ({\n      name: registration.name,\n      version: registration.version,\n    }));\n  }\n\n  private async startInternal(): Promise<void> {\n    if (this.started || this.closed) return;\n    this.starting = true;\n\n    try {\n      for (const registration of this.registrations) {\n        try {\n          const definition = registration.definition;\n          if (!definition || typeof definition !== \"object\") {\n            throw new TypeError(\n              `Client plugin \"${registration.name}\" does not define a lifecycle object`,\n            );\n          }\n\n          const instance: FarmClientPluginInstance = {\n            registration,\n            plugin: definition,\n            state: undefined,\n          };\n          instance.state = await definition.setup?.(this.createSetupEvent(instance));\n          this.instances.push(instance);\n        } catch (error) {\n          this.logHookError(registration.name, \"setup\", error);\n          await this.runErrorHooks({\n            error,\n            phase: \"setup\",\n            location: this.getLocation(),\n          });\n        }\n      }\n\n      this.started = true;\n      this.installBrowserListeners();\n      this.installPerformanceObservers();\n    } finally {\n      this.starting = false;\n    }\n  }\n\n  private installBrowserListeners(): void {\n    const clientWindow = this.options.window;\n    if (!clientWindow) return;\n\n    if (this.runtimeErrorOverlay || this.instances.some(({ plugin }) => plugin.error)) {\n      clientWindow.addEventListener(\"error\", this.handleWindowError);\n      clientWindow.addEventListener(\"unhandledrejection\", this.handleUnhandledRejection);\n    }\n    // Not `once`: a persisted pagehide is ignored above, and the page can be\n    // restored and then genuinely unloaded later. close() is idempotent, so\n    // keeping the listener costs nothing and never disposes twice.\n    clientWindow.addEventListener(\"pagehide\", this.handlePageHide);\n  }\n\n  private installPerformanceObservers(): void {\n    if (!this.instances.some(({ plugin }) => plugin.performance)) return;\n    const Observer = typeof PerformanceObserver !== \"undefined\" ? PerformanceObserver : undefined;\n    if (!Observer) return;\n\n    const supported = new Set(Observer.supportedEntryTypes || []);\n    for (const type of PERFORMANCE_ENTRY_TYPES) {\n      if (!supported.has(type)) continue;\n      try {\n        const observer = new Observer((list: PerformanceObserverEntryList) => {\n          for (const entry of list.getEntries()) {\n            void this.runHook(\"performance\", (instance) =>\n              instance.plugin.performance?.({\n                ...this.createStateEvent(instance),\n                entry,\n                location: this.getLocation(),\n              }),\n            );\n          }\n        });\n        observer.observe({ type, buffered: true });\n        this.performanceObservers.push(observer);\n      } catch (error) {\n        void this.reportError(error, \"performance\");\n      }\n    }\n  }\n\n  private async closeInternal(reason: FarmClientPluginCloseEvent[\"reason\"]): Promise<void> {\n    if (this.closed) return;\n    if (this.startPromise) await this.startPromise;\n    this.closed = true;\n    this.currentNavigation?.controller.abort(reason);\n    this.currentNavigation = undefined;\n\n    const clientWindow = this.options.window;\n    clientWindow?.removeEventListener(\"error\", this.handleWindowError);\n    clientWindow?.removeEventListener(\"unhandledrejection\", this.handleUnhandledRejection);\n    clientWindow?.removeEventListener(\"pagehide\", this.handlePageHide);\n    for (const observer of this.performanceObservers) observer.disconnect();\n    this.performanceObservers.length = 0;\n    this.runtimeErrorOverlay?.destroy();\n\n    for (const instance of [...this.instances].reverse()) {\n      try {\n        await instance.plugin.close?.({\n          ...this.createStateEvent(instance),\n          reason,\n        });\n      } catch (error) {\n        this.logHookError(instance.registration.name, \"close\", error);\n      }\n    }\n  }\n\n  private async runHook(\n    hook: string,\n    invoke: (instance: FarmClientPluginInstance) => MaybePromise<void> | undefined,\n  ): Promise<void> {\n    for (const instance of this.instances) {\n      try {\n        await invoke(instance);\n      } catch (error) {\n        this.logHookError(instance.registration.name, hook, error);\n        await this.runErrorHooks(\n          {\n            error,\n            phase: `plugin:${hook}`,\n            location: this.getLocation(),\n          },\n          instance,\n        );\n      }\n    }\n  }\n\n  private async runErrorHooks(\n    event: Pick<FarmClientPluginErrorEvent, \"error\" | \"phase\" | \"location\" | \"navigation\">,\n    excluded?: FarmClientPluginInstance,\n    sourceEvent?: Event,\n  ): Promise<void> {\n    this.runtimeErrorOverlay?.show(event.error, {\n      phase: event.phase,\n      location: event.location,\n      sourceEvent,\n    });\n    for (const instance of this.instances) {\n      if (instance === excluded || !instance.plugin.error) continue;\n      try {\n        await instance.plugin.error({\n          ...this.createStateEvent(instance),\n          ...event,\n        });\n      } catch (error) {\n        this.logHookError(instance.registration.name, \"error\", error);\n      }\n    }\n  }\n\n  private createSetupEvent(\n    instance: Pick<FarmClientPluginInstance, \"registration\">,\n  ): FarmClientPluginSetupEvent<any> {\n    return {\n      plugin: {\n        name: instance.registration.name,\n        version: instance.registration.version,\n      },\n      public: readonlyPublicData(instance.registration.public),\n      router: this.options.router,\n      isDev: Boolean(this.options.isDev),\n      isProd: Boolean(this.options.isProd),\n      deploymentId: this.options.deploymentId,\n    };\n  }\n\n  private createStateEvent(\n    instance: FarmClientPluginInstance,\n  ): FarmClientPluginStateEvent<any, any> {\n    return {\n      ...this.createSetupEvent(instance),\n      state: instance.state,\n    };\n  }\n\n  private getLocation(): FarmClientLocation {\n    const href = this.options.window?.location.href ?? \"http://localhost/\";\n    return toClientLocation(href, href);\n  }\n\n  private getBaseUrl(): string {\n    return this.options.window?.location.href ?? \"http://localhost/\";\n  }\n\n  private logHookError(name: string, hook: string, error: unknown): void {\n    console.error(`[Farm.js] Client plugin \"${name}\" failed in ${hook}:`, error);\n  }\n}\n\nexport function createClientPluginManager(\n  registrations: readonly FarmClientPluginRegistration[],\n  options: FarmClientPluginManagerOptions,\n): FarmClientPluginManager {\n  return new FarmClientPluginManager(registrations, options);\n}\n\nfunction sortRegistrations(\n  registrations: readonly FarmClientPluginRegistration[],\n): FarmClientPluginRegistration[] {\n  const rank = (enforce?: FarmClientPluginEnforce) =>\n    enforce === \"pre\" ? 0 : enforce === \"post\" ? 2 : 1;\n  return registrations\n    .map((registration, index) => ({ registration, index }))\n    .sort(\n      (left, right) =>\n        rank(left.registration.enforce) - rank(right.registration.enforce) ||\n        left.index - right.index,\n    )\n    .map(({ registration }) => registration);\n}\n\nfunction toClientLocation(\n  input: string | URL | FarmClientLocation,\n  base: string,\n): FarmClientLocation {\n  if (typeof input === \"object\" && \"href\" in input && \"pathname\" in input) {\n    return {\n      href: input.href,\n      pathname: input.pathname,\n      search: input.search,\n      hash: input.hash,\n    };\n  }\n\n  const url = new URL(input, base);\n  return {\n    href: url.href,\n    pathname: url.pathname,\n    search: url.search,\n    hash: url.hash,\n  };\n}\n\nfunction readonlyPublicData<T>(value: T | undefined): Readonly<T> {\n  if (value && typeof value === \"object\") {\n    return Object.freeze(value);\n  }\n  return value as Readonly<T>;\n}\n\nfunction now(): number {\n  return typeof performance !== \"undefined\" ? performance.now() : Date.now();\n}\n\nfunction isObject(value: unknown): value is object {\n  return (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n}\n","/**\n * Convert URLSearchParams into the object handed to routes as `search` /\n * `searchParams`: single keys stay strings and repeated keys collect into\n * arrays, in order. The dev renderer, the production SSR entry, the SPA\n * page-data endpoint, and the generated client hydration runtime all share\n * this helper so every environment agrees on one representation.\n */\nexport function searchParamsToObject(\n  searchParams: URLSearchParams,\n): Record<string, string | string[] | undefined> {\n  const output: Record<string, string | string[] | undefined> = {};\n\n  searchParams.forEach((value, key) => {\n    // Keys come from the request URL. Writing \"__proto__\" onto a plain object\n    // replaces its prototype instead of adding an entry, so a crafted query\n    // string could reshape the object handed to pages and workflow handlers.\n    // The API route helper (entriesToObject in api/runtime.ts) already skips\n    // these names; keep both representations consistent.\n    if (key === \"__proto__\" || key === \"constructor\" || key === \"prototype\") return;\n    const existing = Object.prototype.hasOwnProperty.call(output, key) ? output[key] : undefined;\n    if (existing !== undefined) {\n      if (Array.isArray(existing)) {\n        existing.push(value);\n      } else {\n        output[key] = [existing, value];\n      }\n    } else {\n      output[key] = value;\n    }\n  });\n\n  return output;\n}\n","const FARM_TRAILING_SLASH_PREFERENCE = Symbol.for(\"farm.trailingSlashPreference\");\n\nfunction getFarmGlobalState(): Record<PropertyKey, unknown> {\n  return globalThis as unknown as Record<PropertyKey, unknown>;\n}\n\n/** @internal Configure the app-wide URL preference for framework link rendering. */\nexport function setFarmTrailingSlashPreference(enabled: boolean | undefined): void {\n  getFarmGlobalState()[FARM_TRAILING_SLASH_PREFERENCE] = enabled === true;\n}\n\n/** @internal Read the app-wide URL preference used by framework links. */\nexport function getFarmTrailingSlashPreference(): boolean {\n  return getFarmGlobalState()[FARM_TRAILING_SLASH_PREFERENCE] === true;\n}\n\nexport function normalizeFarmTrailingSlashPathname(pathname: string, enabled: boolean): string {\n  if (pathname === \"/\") return pathname;\n  if (enabled) return pathname.endsWith(\"/\") ? pathname : `${pathname}/`;\n  return pathname.replace(/\\/+$/, \"\") || \"/\";\n}\n\nexport function resolveFarmTrailingSlashRedirect(url: URL, enabled: boolean): string | null {\n  const pathname = normalizeFarmTrailingSlashPathname(url.pathname, enabled);\n  return pathname === url.pathname ? null : `${pathname}${url.search}`;\n}\n","const FARM_BASE_PATH = Symbol.for(\"farm.basePath\");\n\nfunction getFarmGlobalState(): Record<PropertyKey, unknown> {\n  return globalThis as unknown as Record<PropertyKey, unknown>;\n}\n\n/** @internal Configure the app-wide base path for framework link rendering. */\nexport function setFarmBasePath(basePath: string | undefined): void {\n  getFarmGlobalState()[FARM_BASE_PATH] = normalizeFarmBasePath(basePath);\n}\n\n/** @internal Read the app-wide base path used by framework links. */\nexport function getFarmBasePath(): string {\n  return (getFarmGlobalState()[FARM_BASE_PATH] as string | undefined) ?? \"\";\n}\n\nexport function applyFarmBasePath(href: string, basePath = getFarmBasePath()): string {\n  const normalizedBasePath = normalizeFarmBasePath(basePath);\n  if (!normalizedBasePath || !href.startsWith(\"/\") || href.startsWith(\"//\")) return href;\n  const canonicalHref = canonicalizeAppRelativeHref(href);\n  if (\n    canonicalHref === normalizedBasePath ||\n    canonicalHref.startsWith(`${normalizedBasePath}/`) ||\n    canonicalHref.startsWith(`${normalizedBasePath}?`) ||\n    canonicalHref.startsWith(`${normalizedBasePath}#`)\n  ) {\n    return canonicalHref;\n  }\n  return `${normalizedBasePath}${canonicalHref}`;\n}\n\nfunction canonicalizeAppRelativeHref(href: string): string {\n  const origin = \"http://farm.local\";\n  const resolved = new URL(href, origin);\n  if (resolved.origin !== origin) {\n    throw new Error(\"Farm app-relative href cannot change the URL origin.\");\n  }\n  return `${resolved.pathname}${resolved.search}${resolved.hash}`;\n}\n\nexport function stripFarmBasePath(pathname: string, basePath = getFarmBasePath()): string {\n  const normalizedBasePath = normalizeFarmBasePath(basePath);\n  if (!normalizedBasePath) return pathname || \"/\";\n  if (pathname === normalizedBasePath) return \"/\";\n  if (!pathname.startsWith(`${normalizedBasePath}/`)) return pathname || \"/\";\n  return pathname.slice(normalizedBasePath.length) || \"/\";\n}\n\nexport function normalizeFarmBasePath(basePath: string | undefined): string {\n  if (!basePath || basePath === \"/\") return \"\";\n\n  const hasUnstableCharacters = (candidate: string) =>\n    candidate.includes(\"\\\\\") ||\n    Array.from(candidate).some((character) => {\n      const code = character.charCodeAt(0);\n      return code <= 31 || (code >= 127 && code <= 159);\n    });\n\n  if (hasUnstableCharacters(basePath)) {\n    throw new Error(\"Farm basePath cannot contain backslashes or control characters.\");\n  }\n\n  const pathname = basePath.trim();\n  if (!pathname || pathname === \"/\") return \"\";\n  if (pathname.includes(\"?\") || pathname.includes(\"#\")) {\n    throw new Error(\"Farm basePath cannot contain a query string or hash.\");\n  }\n  if (pathname.startsWith(\"//\") || /^[a-z][a-z\\d+.-]*:\\/\\//i.test(pathname)) {\n    throw new Error('Farm basePath must be a pathname such as \"/docs\", not a URL.');\n  }\n\n  for (const segment of pathname.split(\"/\")) {\n    let decoded = segment;\n    try {\n      decoded = decodeURIComponent(segment);\n    } catch {\n      // Malformed escapes remain literal in URL pathnames and cannot be dot segments.\n    }\n    if (hasUnstableCharacters(decoded)) {\n      throw new Error(\"Farm basePath cannot contain backslashes or control characters.\");\n    }\n    if (decoded.includes(\"/\")) {\n      throw new Error(\"Farm basePath cannot contain percent-encoded path separators.\");\n    }\n    if (decoded === \".\" || decoded === \"..\") {\n      throw new Error('Farm basePath cannot contain \".\" or \"..\" path segments.');\n    }\n  }\n\n  return `/${pathname}`.replace(/\\/{2,}/g, \"/\").replace(/\\/+$/, \"\");\n}\n\n/** Normalize a configured application base path while preserving `/` for root. */\nexport function normalizeFarmConfigBasePath(basePath: string | undefined): string {\n  return normalizeFarmBasePath(basePath) || \"/\";\n}\n","export function getHashTargetElement(hash: string): Element | null {\n  // A fragment is not a CSS selector. Match by decoded id, raw id, then the\n  // legacy anchor name so SPA navigation follows native browser semantics.\n  const fragment = hash.startsWith(\"#\") ? hash.slice(1) : hash;\n  if (!fragment) return null;\n\n  let decoded = fragment;\n  try {\n    decoded = decodeURIComponent(fragment);\n  } catch {\n    // Keep the raw fragment when its percent-encoding is malformed.\n  }\n\n  return (\n    document.getElementById(decoded) ||\n    document.getElementById(fragment) ||\n    document.getElementsByName(decoded)[0] ||\n    null\n  );\n}\n","export const FARM_NAVIGATION_HEAD_SELECTOR = [\n  \"meta[name]\",\n  \"meta[property]\",\n  \"meta[http-equiv]\",\n  \"meta[charset]\",\n  \"meta[itemprop]\",\n  'link[rel~=\"author\"]',\n  'link[rel~=\"canonical\"]',\n  'link[rel~=\"alternate\"]',\n  'link[rel~=\"icon\"]',\n  'link[rel~=\"apple-touch-icon\"]',\n  'link[rel~=\"manifest\"]',\n  'link[rel~=\"search\"]',\n  'link[rel~=\"next\"]',\n  'link[rel~=\"prev\"]',\n  'link[rel~=\"publisher\"]',\n  'link[rel~=\"license\"]',\n  'link[rel~=\"help\"]',\n  'link[rel~=\"me\"]',\n  'link[rel~=\"pingback\"]',\n  'link[rel~=\"privacy-policy\"]',\n  'link[rel~=\"terms-of-service\"]',\n].join(\",\");\n\nexport function reconcileFarmDocumentHead(nextDocument: Document): void {\n  const nextTitle = nextDocument.querySelector(\"title\");\n  document.title = nextTitle?.textContent || \"\";\n\n  document.head.querySelectorAll(FARM_NAVIGATION_HEAD_SELECTOR).forEach((node) => node.remove());\n  nextDocument.head\n    .querySelectorAll(FARM_NAVIGATION_HEAD_SELECTOR)\n    .forEach((node) => document.head.appendChild(document.importNode(node, true)));\n}\n","export function isFarmExternalNavigationURL(url: URL, currentOrigin: string): boolean {\n  return (url.protocol !== \"http:\" && url.protocol !== \"https:\") || url.origin !== currentOrigin;\n}\n\n/**\n * Resolve a navigation target the way the platform does.\n *\n * Relative references resolve against the *document's* URL, not the origin.\n * Basing on the origin turns `?tab=2` into `/?tab=2` and `details` into\n * `/details`, discarding the directory the user is actually on, so every\n * navigation entry point has to resolve through here.\n *\n * Absolute paths and absolute URLs are unaffected by the choice of base.\n */\nexport function resolveFarmNavigationURL(href: string, documentUrl: string): URL {\n  return new URL(href, documentUrl);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACyBA,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,SAAS,iBAAiB,WAA6B;AAC5D,QAAM,SAAS,iBAAiB,SAAS;AACzC,MAAI,OAAO,KAAK,CAAC,UAAU,qBAAqB,KAAK,CAAC,YAAY,QAAQ,KAAK,KAAK,CAAC,CAAC,GAAG;AACvF,WAAO;AAAA,EACT;AAMA,QAAM,YAAY,uBAAuB,SAAS;AAClD,SAAO;AAAA,IACL,aAAa,8BAA8B,KAAK,SAAS,KAAK,qBAAqB,SAAS;AAAA,EAC9F;AACF;AAdgB;AAgBhB,SAAS,qBAAqB,KAAsB;AAClD,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,UAAU;AACrD,WAAO;AAAA,EACT;AAEA,MAAI;AACF,WAAO,IAAI,IAAI,KAAK,OAAO,SAAS,IAAI,EAAE,WAAW,OAAO,SAAS;AAAA,EACvE,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAVS;AAYF,SAAS,0BAA0B,UAAoC,CAAC,GAAe;AAC5F,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,MAAM;AAAA,IAAC;AAAA,EAChB;AAEA,QAAM,UAAU,wBAAC,cAAuB;AACtC,QAAI,CAAC,iBAAiB,SAAS,GAAG;AAChC;AAAA,IACF;AACA,QAAI,CAAC,cAAc,OAAO,GAAG;AAC3B;AAAA,IACF;AAEA,YAAQ,YAAY,SAAS;AAC7B,cAAU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