loomrail 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +4 -0
  3. package/README.md +266 -0
  4. package/apps/cli/dist/index.js +11154 -0
  5. package/apps/cli/migrations/0001_initial.sql +99 -0
  6. package/apps/cli/migrations/0002_mock_workflow.sql +169 -0
  7. package/apps/cli/migrations/0003_budget_pause_recovery.sql +154 -0
  8. package/apps/cli/migrations/0004_pipeline_started_budget_backfill.sql +72 -0
  9. package/apps/cli/migrations/0005_acceptance_evidence.sql +129 -0
  10. package/apps/cli/migrations/0006_session_handoff.sql +166 -0
  11. package/apps/cli/migrations/0007_pack_share_backoff.sql +11 -0
  12. package/apps/cli/migrations/0008_stage_attempt_counter_backfill.sql +169 -0
  13. package/apps/cli/migrations/0009_session_window_occupancy.sql +44 -0
  14. package/apps/cli/migrations/0010_provider_session_pid.sql +5 -0
  15. package/apps/cli/migrations/0011_work_item_workspaces.sql +94 -0
  16. package/apps/cli/migrations/0012_registered_repository_projects.sql +54 -0
  17. package/apps/cli/migrations/0013_stage_attempt_result_tree.sql +166 -0
  18. package/apps/cli/migrations/0014_live_evidence_provider.sql +49 -0
  19. package/apps/web/dist/assets/index-DjwvCSSY.js +5 -0
  20. package/apps/web/dist/assets/index-DjwvCSSY.js.map +1 -0
  21. package/apps/web/dist/assets/index-Z88TqCIf.css +1 -0
  22. package/apps/web/dist/assets/radix-vendor-CRdHXIPR.js +42 -0
  23. package/apps/web/dist/assets/radix-vendor-CRdHXIPR.js.map +1 -0
  24. package/apps/web/dist/assets/react-vendor-BicOiEU0.js +10 -0
  25. package/apps/web/dist/assets/react-vendor-BicOiEU0.js.map +1 -0
  26. package/apps/web/dist/assets/rolldown-runtime-CbXtAM7H.js +1 -0
  27. package/apps/web/dist/assets/tanstack-vendor-ec08LVZ_.js +2 -0
  28. package/apps/web/dist/assets/tanstack-vendor-ec08LVZ_.js.map +1 -0
  29. package/apps/web/dist/assets/validation-vendor-CGrOSWd3.js +65 -0
  30. package/apps/web/dist/assets/validation-vendor-CGrOSWd3.js.map +1 -0
  31. package/apps/web/dist/favicon.svg +5 -0
  32. package/apps/web/dist/index.html +60 -0
  33. package/apps/web/dist/theme-bootstrap.js +46 -0
  34. package/fixtures/projects/api-service-b/README.md +3 -0
  35. package/fixtures/projects/api-service-b/loomrail-fixture.json +6 -0
  36. package/fixtures/projects/web-app-a/README.md +3 -0
  37. package/fixtures/projects/web-app-a/loomrail-fixture.json +6 -0
  38. package/package.json +46 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tanstack-vendor-ec08LVZ_.js","names":["#setup","#cleanup","#focused","#provider","functionalUpdate","isPlainObject","hasOwn","replaceEqualDeep","isPlainArray","hasObjectPrototype","#setup","#cleanup","#online","#gcTimeout","#abortSignalConsumed","#defaultOptions","#client","#cache","#initialState","getDefaultState","#queryType","#retryer","#dispatch","#isInitialPausedFetch","#revertState","#client","#selectError","#currentThenable","#currentQuery","#executeFetch","#updateTimers","#clearStaleTimeout","#clearRefetchInterval","#updateQuery","#updateStaleTimeout","#computeRefetchInterval","#currentRefetchInterval","#updateRefetchInterval","#currentResult","#currentResultOptions","#currentResultState","#trackedProps","#staleTimeoutId","#refetchIntervalId","#currentQueryInitialState","#lastQueryWithDefinedData","#selectFn","#selectResult","#notify","#client","#mutationCache","#observers","#retryer","#dispatch","#mutations","#scopes","#mutationId","#client","#updateResult","#currentMutation","#notify","#currentResult","#mutateOptions","#queries","#queryCache","#mutationCache","#defaultOptions","#queryDefaults","#mutationDefaults","#mountCount","#unsubscribeFocus","#unsubscribeOnline","functionalUpdate","trimPathRight","useCallback","useSyncExternalStoreWithSelector","Fragment","jsx","jsx","Fragment"],"sources":["../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/subscribable.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/focusManager.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/timeoutManager.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/utils.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/environmentManager.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/thenable.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/notifyManager.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/onlineManager.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/retryer.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/removable.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/query.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/queryObserver.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/mutation.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/mutationCache.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/mutationObserver.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/queryCache.js","../../../../node_modules/.pnpm/@tanstack+query-core@5.101.4/node_modules/@tanstack/query-core/build/modern/queryClient.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/suspense.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useQuery.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/queryOptions.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useMutation.js","../../../../node_modules/.pnpm/@tanstack+react-query@5.101.4_react@19.2.8/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/utils.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/utils.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/invariant.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/lru-cache.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/path.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/not-found.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/qss.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/searchParams.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/root.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/redirect.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/rewrite.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/stores.js","../../../../node_modules/.pnpm/@tanstack+history@1.162.1/node_modules/@tanstack/history/dist/esm/index.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/router.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/load-client.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/link.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/route.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/CatchBoundary.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/ClientOnly.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/routerContext.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useRouter.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/matchContext.js","../../../../node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/alien.js","../../../../node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/atom.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.8/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.8/node_modules/use-sync-external-store/shim/index.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.8/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.8/node_modules/use-sync-external-store/shim/with-selector.js","../../../../node_modules/.pnpm/@tanstack+react-store@0.9.3_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-store/dist/esm/useStore.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useMatch.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useLoaderData.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useLoaderDeps.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useParams.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useSearch.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useNavigate.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useRouteContext.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/link.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/route.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/not-found.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/ScriptOnce.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/SafeFragment.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/renderRouteNotFound.js","../../../../node_modules/.pnpm/@tanstack+router-core@1.171.26/node_modules/@tanstack/router-core/dist/esm/scroll-restoration-script/client.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/scroll-restoration.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/Match.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/Transitioner.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/Matches.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/routerStores.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/router.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/RouterProvider.js","../../../../node_modules/.pnpm/@tanstack+react-router@1.170.31_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@tanstack/react-router/dist/esm/useLocation.js"],"sourcesContent":["// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (typeof window !== \"undefined\" && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup((focused) => {\n if (typeof focused === \"boolean\") {\n this.setFocused(focused);\n } else {\n this.onFocus();\n }\n });\n }\n setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/timeoutManager.ts\nvar defaultTimeoutProvider = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId)\n};\nvar TimeoutManager = class {\n // We cannot have TimeoutManager<T> as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support the default provider's concrete timer ID, which is\n // infeasible across environments.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider = defaultTimeoutProvider;\n #providerCalled = false;\n setTimeoutProvider(provider) {\n if (process.env.NODE_ENV !== \"production\") {\n if (this.#providerCalled && provider !== this.#provider) {\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider }\n );\n }\n }\n this.#provider = provider;\n if (process.env.NODE_ENV !== \"production\") {\n this.#providerCalled = false;\n }\n }\n setTimeout(callback, delay) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#providerCalled = true;\n }\n return this.#provider.setTimeout(callback, delay);\n }\n clearTimeout(timeoutId) {\n this.#provider.clearTimeout(timeoutId);\n }\n setInterval(callback, delay) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#providerCalled = true;\n }\n return this.#provider.setInterval(callback, delay);\n }\n clearInterval(intervalId) {\n this.#provider.clearInterval(intervalId);\n }\n};\nvar timeoutManager = new TimeoutManager();\nfunction systemSetTimeoutZero(callback) {\n setTimeout(callback, 0);\n}\nexport {\n TimeoutManager,\n defaultTimeoutProvider,\n systemSetTimeoutZero,\n timeoutManager\n};\n//# sourceMappingURL=timeoutManager.js.map","// src/utils.ts\nimport { timeoutManager } from \"./timeoutManager.js\";\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction resolveStaleTime(staleTime, query) {\n return typeof staleTime === \"function\" ? staleTime(query) : staleTime;\n}\nfunction resolveQueryBoolean(option, query) {\n return typeof option === \"function\" ? option(query) : option;\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n if (Array.isArray(a) && Array.isArray(b)) {\n for (let i = 0; i < b.length; i++) {\n if (!partialMatchKey(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n const bKeys = Object.keys(b);\n for (const key of bKeys) {\n if (!partialMatchKey(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\nfunction replaceEqualDeep(a, b, depth = 0) {\n if (a === b) {\n return a;\n }\n if (depth > 500) return b;\n const array = isPlainArray(a) && isPlainArray(b);\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b;\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? new Array(bSize) : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n const aItem = a[key];\n const bItem = b[key];\n if (aItem === bItem) {\n copy[key] = aItem;\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++;\n continue;\n }\n if (aItem === null || bItem === null || typeof aItem !== \"object\" || typeof bItem !== \"object\") {\n copy[key] = bItem;\n continue;\n }\n const v = replaceEqualDeep(aItem, bItem, depth + 1);\n copy[key] = v;\n if (v === aItem) equalItems++;\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(timeout) {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n return replaceEqualDeep(prevData, data);\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`\n );\n throw error;\n }\n }\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = /* @__PURE__ */ Symbol();\nfunction ensureQueryFn(options, fetchOptions) {\n if (process.env.NODE_ENV !== \"production\") {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`\n );\n }\n }\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise;\n }\n if (!options.queryFn || options.queryFn === skipToken) {\n return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`));\n }\n return options.queryFn;\n}\nfunction shouldThrowError(throwOnError, params) {\n if (typeof throwOnError === \"function\") {\n return throwOnError(...params);\n }\n return !!throwOnError;\n}\nfunction addConsumeAwareSignal(object, getSignal, onCancelled) {\n let consumed = false;\n let signal;\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n signal ??= getSignal();\n if (consumed) {\n return signal;\n }\n consumed = true;\n if (signal.aborted) {\n onCancelled();\n } else {\n signal.addEventListener(\"abort\", onCancelled, { once: true });\n }\n return signal;\n }\n });\n return object;\n}\nexport {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n resolveQueryBoolean,\n resolveStaleTime,\n shallowEqualObjects,\n shouldThrowError,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/environmentManager.ts\nimport { isServer } from \"./utils.js\";\nvar environmentManager = /* @__PURE__ */ (() => {\n let isServerFn = () => isServer;\n return {\n /**\n * Returns whether the current runtime should be treated as a server environment.\n */\n isServer() {\n return isServerFn();\n },\n /**\n * Overrides the server check globally.\n */\n setIsServer(isServerValue) {\n isServerFn = isServerValue;\n }\n };\n})();\nexport {\n environmentManager\n};\n//# sourceMappingURL=environmentManager.js.map","// src/thenable.ts\nimport { noop } from \"./utils.js\";\nfunction pendingThenable() {\n let resolve;\n let reject;\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n thenable.status = \"pending\";\n thenable.catch(() => {\n });\n function finalize(data) {\n Object.assign(thenable, data);\n delete thenable.resolve;\n delete thenable.reject;\n }\n thenable.resolve = (value) => {\n finalize({\n status: \"fulfilled\",\n value\n });\n resolve(value);\n };\n thenable.reject = (reason) => {\n finalize({\n status: \"rejected\",\n reason\n });\n reject(reason);\n };\n return thenable;\n}\nfunction tryResolveSync(promise) {\n let data;\n promise.then((result) => {\n data = result;\n return result;\n }, noop)?.catch(noop);\n if (data !== void 0) {\n return { data };\n }\n return void 0;\n}\nexport {\n pendingThenable,\n tryResolveSync\n};\n//# sourceMappingURL=thenable.js.map","// src/notifyManager.ts\nimport { systemSetTimeoutZero } from \"./timeoutManager.js\";\nvar defaultScheduler = systemSetTimeoutZero;\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = defaultScheduler;\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n return {\n batch: (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn) => {\n notifyFn = fn;\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn) => {\n batchNotifyFn = fn;\n },\n setScheduler: (fn) => {\n scheduleFn = fn;\n }\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n defaultScheduler,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (typeof window !== \"undefined\" && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport { environmentManager } from \"./environmentManager.js\";\nimport { sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class extends Error {\n constructor(options) {\n super(\"CancelledError\");\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let continueFn;\n const thenable = pendingThenable();\n const isResolved = () => thenable.status !== \"pending\";\n const cancel = (cancelOptions) => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions);\n reject(error);\n config.onCancel?.(error);\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const canContinue = () => focusManager.isFocused() && (config.networkMode === \"always\" || onlineManager.isOnline()) && config.canRun();\n const canStart = () => canFetch(config.networkMode) && config.canRun();\n const resolve = (value) => {\n if (!isResolved()) {\n continueFn?.();\n thenable.resolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved()) {\n continueFn?.();\n thenable.reject(value);\n }\n };\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value);\n }\n };\n config.onPause?.();\n }).then(() => {\n continueFn = void 0;\n if (!isResolved()) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved()) {\n return;\n }\n let promiseOrValue;\n const initialPromise = failureCount === 0 ? config.initialPromise : void 0;\n try {\n promiseOrValue = initialPromise ?? config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved()) {\n return;\n }\n const retry = config.retry ?? (environmentManager.isServer() ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n return canContinue() ? void 0 : pause();\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.();\n return thenable;\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n if (canStart()) {\n run();\n } else {\n pause().then(run);\n }\n return thenable;\n }\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/removable.ts\nimport { timeoutManager } from \"./timeoutManager.js\";\nimport { environmentManager } from \"./environmentManager.js\";\nimport { isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (environmentManager.isServer() ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout !== void 0) {\n timeoutManager.clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/infiniteQueryBehavior.ts\nimport {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn\n} from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n return {\n onFetch: (context, query) => {\n const options = context.options;\n const direction = context.fetchOptions?.meta?.fetchMore?.direction;\n const oldPages = context.state.data?.pages || [];\n const oldPageParams = context.state.data?.pageParams || [];\n let result = { pages: [], pageParams: [] };\n let currentPage = 0;\n const fetchFn = async () => {\n let cancelled = false;\n const addSignalProperty = (object) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => cancelled = true\n );\n };\n const queryFn = ensureQueryFn(context.options, context.fetchOptions);\n const fetchPage = async (data, param, previous) => {\n if (cancelled) {\n return Promise.reject(context.signal.reason);\n }\n if (param == null && data.pages.length) {\n return Promise.resolve(data);\n }\n const createQueryFnContext = () => {\n const queryFnContext2 = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? \"backward\" : \"forward\",\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext2);\n return queryFnContext2;\n };\n const queryFnContext = createQueryFnContext();\n const page = await queryFn(queryFnContext);\n const { maxPages } = context.options;\n const addTo = previous ? addToStart : addToEnd;\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages)\n };\n };\n if (direction && oldPages.length) {\n const previous = direction === \"backward\";\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams\n };\n const param = pageParamFn(options, oldData);\n result = await fetchPage(oldData, param, previous);\n } else {\n const remainingPages = pages ?? oldPages.length;\n do {\n const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result);\n if (currentPage > 0 && param == null) {\n break;\n }\n result = await fetchPage(result, param);\n currentPage++;\n } while (currentPage < remainingPages);\n }\n return result;\n };\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal\n },\n query\n );\n };\n } else {\n context.fetchFn = fetchFn;\n }\n }\n };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n const lastIndex = pages.length - 1;\n return pages.length > 0 ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams\n ) : void 0;\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0;\n}\nfunction hasNextPage(options, data) {\n if (!data) return false;\n return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n if (!data || !options.getPreviousPageParam) return false;\n return getPreviousPageParam(options, data) != null;\n}\nexport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/query.ts\nimport {\n ensureQueryFn,\n noop,\n replaceData,\n resolveQueryBoolean,\n resolveStaleTime,\n skipToken,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { CancelledError, canFetch, createRetryer } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar Query = class extends Removable {\n #queryType;\n #initialState;\n #revertState;\n #cache;\n #client;\n #retryer;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.#client = config.client;\n this.#cache = this.#client.getQueryCache();\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = getDefaultState(this.options);\n this.state = config.state ?? this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n get queryType() {\n return this.#queryType;\n }\n get promise() {\n return this.#retryer?.promise;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n if (options?._type) {\n this.#queryType = options._type;\n }\n this.updateGcTime(this.options.gcTime);\n if (this.state && this.state.data === void 0) {\n const defaultState = getDefaultState(this.options);\n if (defaultState.data !== void 0) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt)\n );\n this.#initialState = defaultState;\n }\n }\n }\n optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state) {\n this.#dispatch({ type: \"setState\", state });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n get resetState() {\n return this.#initialState;\n }\n reset() {\n this.destroy();\n this.setState(this.resetState);\n }\n isActive() {\n return this.observers.some(\n (observer) => resolveQueryBoolean(observer.options.enabled, this) !== false\n );\n }\n isDisabled() {\n if (this.getObserversCount() > 0) {\n return !this.isActive();\n }\n return this.options.queryFn === skipToken || !this.isFetched();\n }\n isFetched() {\n return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;\n }\n isStatic() {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => resolveStaleTime(observer.options.staleTime, this) === \"static\"\n );\n }\n return false;\n }\n isStale() {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0 || this.state.isInvalidated;\n }\n isStaleByTime(staleTime = 0) {\n if (this.state.data === void 0) {\n return true;\n }\n if (staleTime === \"static\") {\n return false;\n }\n if (this.state.isInvalidated) {\n return true;\n }\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer);\n if (!this.observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed || this.#isInitialPausedFetch()) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.observers.length;\n }\n #isInitialPausedFetch() {\n return this.state.fetchStatus === \"paused\" && this.state.status === \"pending\";\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n async fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\" && // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== \"rejected\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions);\n const createQueryFnContext = () => {\n const queryFnContext2 = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta\n };\n addSignalProperty(queryFnContext2);\n return queryFnContext2;\n };\n const queryFnContext = createQueryFnContext();\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this\n );\n }\n return queryFn(queryFnContext);\n };\n const createFetchContext = () => {\n const context2 = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context2);\n return context2;\n };\n const context = createFetchContext();\n const behavior = this.#queryType === \"infinite\" ? infiniteQueryBehavior(\n this.options.pages\n ) : this.options.behavior;\n behavior?.onFetch(context, this);\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise,\n fn: context.fetchFn,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: \"idle\"\n });\n }\n abortController.abort();\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true\n });\n try {\n const data = await this.#retryer.start();\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n throw new Error(`${this.queryHash} data is undefined`);\n }\n this.setData(data);\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n return data;\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n return this.#retryer.promise;\n } else if (error.revert) {\n if (this.state.data === void 0) {\n throw error;\n }\n return this.state.data;\n }\n }\n this.#dispatch({\n type: \"error\",\n error\n });\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n throw error;\n } finally {\n this.scheduleGc();\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n this.#revertState = action.manual ? newState : void 0;\n return newState;\n case \"error\":\n const error = action.error;\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\",\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction successState(data, dataUpdatedAt) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\"\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map","// src/queryObserver.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { environmentManager } from \"./environmentManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { fetchState } from \"./query.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { pendingThenable } from \"./thenable.js\";\nimport {\n isValidTimeout,\n noop,\n replaceData,\n resolveQueryBoolean,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nimport { timeoutManager } from \"./timeoutManager.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.#currentThenable = pendingThenable();\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #currentThenable;\n #selectError;\n #selectFn;\n #selectResult;\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\" && typeof this.options.enabled !== \"function\" && typeof resolveQueryBoolean(this.options.enabled, this.#currentQuery) !== \"boolean\") {\n throw new Error(\n \"Expected enabled to be a boolean or a callback that returns a boolean\"\n );\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult();\n if (mounted && (this.#currentQuery !== prevQuery || resolveQueryBoolean(this.options.enabled, this.#currentQuery) !== resolveQueryBoolean(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || resolveQueryBoolean(this.options.enabled, this.#currentQuery) !== resolveQueryBoolean(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key);\n onPropTracked?.(key);\n if (key === \"promise\") {\n this.trackProp(\"data\");\n if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === \"pending\") {\n this.#currentThenable.reject(\n new Error(\n \"experimental_prefetchInRender feature flag is not enabled\"\n )\n );\n }\n }\n return Reflect.get(target, key);\n }\n });\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery\n );\n if (environmentManager.isServer() || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return;\n }\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime);\n const timeout = time + 1;\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (environmentManager.isServer() || resolveQueryBoolean(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId !== void 0) {\n timeoutManager.clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId !== void 0) {\n timeoutManager.clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options)\n };\n }\n if (options._optimisticResults === \"isRestoring\") {\n newState.fetchStatus = \"idle\";\n }\n }\n let { error, errorUpdatedAt, status } = newState;\n data = newState.data;\n let skipSelect = false;\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n skipSelect = true;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (options.select && data !== void 0 && !skipSelect) {\n if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === \"success\",\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: query.isFetched(),\n isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === \"paused\",\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveQueryBoolean(options.enabled, query) !== false\n };\n const nextResult = result;\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== void 0;\n const isErrorWithoutData = nextResult.status === \"error\" && !hasResultData;\n const finalizeThenableIfPossible = (thenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error);\n } else if (hasResultData) {\n thenable.resolve(nextResult.data);\n }\n };\n const recreateThenable = () => {\n const pending = this.#currentThenable = nextResult.promise = pendingThenable();\n finalizeThenableIfPossible(pending);\n };\n const prevThenable = this.#currentThenable;\n switch (prevThenable.status) {\n case \"pending\":\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable);\n }\n break;\n case \"fulfilled\":\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable();\n }\n break;\n case \"rejected\":\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable();\n }\n break;\n }\n }\n return nextResult;\n }\n updateResult() {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n this.#notify({ listeners: shouldNotifyListeners() });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return resolveQueryBoolean(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === \"error\" && resolveQueryBoolean(options.retryOnMount, query) === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (resolveQueryBoolean(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== \"static\") {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || resolveQueryBoolean(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return resolveQueryBoolean(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map","// src/infiniteQueryObserver.ts\nimport { QueryObserver } from \"./queryObserver.js\";\nimport { hasNextPage, hasPreviousPage } from \"./infiniteQueryBehavior.js\";\nvar InfiniteQueryObserver = class extends QueryObserver {\n constructor(client, options) {\n super(client, options);\n }\n bindMethods() {\n super.bindMethods();\n this.fetchNextPage = this.fetchNextPage.bind(this);\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this);\n }\n setOptions(options) {\n options._type = \"infinite\";\n super.setOptions(options);\n }\n getOptimisticResult(options) {\n options._type = \"infinite\";\n return super.getOptimisticResult(options);\n }\n fetchNextPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"forward\" }\n }\n });\n }\n fetchPreviousPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"backward\" }\n }\n });\n }\n createResult(query, options) {\n const { state } = query;\n const parentResult = super.createResult(query, options);\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult;\n const fetchDirection = state.fetchMeta?.fetchMore?.direction;\n const isFetchNextPageError = isError && fetchDirection === \"forward\";\n const isFetchingNextPage = isFetching && fetchDirection === \"forward\";\n const isFetchPreviousPageError = isError && fetchDirection === \"backward\";\n const isFetchingPreviousPage = isFetching && fetchDirection === \"backward\";\n const result = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage\n };\n return result;\n }\n};\nexport {\n InfiniteQueryObserver\n};\n//# sourceMappingURL=infiniteQueryObserver.js.map","// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #client;\n #observers;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.#client = config.client;\n this.mutationId = config.mutationId;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = options;\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const onContinue = () => {\n this.#dispatch({ type: \"continue\" });\n };\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables, mutationFnContext);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this)\n });\n const restored = this.state.status === \"pending\";\n const isPaused = !this.#retryer.canStart();\n try {\n if (restored) {\n onContinue();\n } else {\n this.#dispatch({ type: \"pending\", variables, isPaused });\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this,\n mutationFnContext\n );\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext\n );\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables,\n isPaused\n });\n }\n }\n const data = await this.#retryer.start();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context,\n mutationFnContext\n );\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext\n );\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.options.onError?.(\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context,\n mutationFnContext\n );\n } catch (e) {\n void Promise.reject(e);\n }\n this.#dispatch({ type: \"error\", error });\n throw error;\n } finally {\n this.#mutationCache.runNext(this);\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#mutations = /* @__PURE__ */ new Set();\n this.#scopes = /* @__PURE__ */ new Map();\n this.#mutationId = 0;\n }\n #mutations;\n #scopes;\n #mutationId;\n build(client, options, state) {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state\n });\n this.add(mutation);\n return mutation;\n }\n add(mutation) {\n this.#mutations.add(mutation);\n const scope = scopeFor(mutation);\n if (typeof scope === \"string\") {\n const scopedMutations = this.#scopes.get(scope);\n if (scopedMutations) {\n scopedMutations.push(mutation);\n } else {\n this.#scopes.set(scope, [mutation]);\n }\n }\n this.notify({ type: \"added\", mutation });\n }\n remove(mutation) {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation);\n if (typeof scope === \"string\") {\n const scopedMutations = this.#scopes.get(scope);\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation);\n if (index !== -1) {\n scopedMutations.splice(index, 1);\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope);\n }\n }\n }\n }\n this.notify({ type: \"removed\", mutation });\n }\n canRun(mutation) {\n const scope = scopeFor(mutation);\n if (typeof scope === \"string\") {\n const mutationsWithSameScope = this.#scopes.get(scope);\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === \"pending\"\n );\n return !firstPendingMutation || firstPendingMutation === mutation;\n } else {\n return true;\n }\n }\n runNext(mutation) {\n const scope = scopeFor(mutation);\n if (typeof scope === \"string\") {\n const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused);\n return foundMutation?.continue() ?? Promise.resolve();\n } else {\n return Promise.resolve();\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: \"removed\", mutation });\n });\n this.#mutations.clear();\n this.#scopes.clear();\n });\n }\n getAll() {\n return Array.from(this.#mutations);\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (mutation) => matchMutation(defaultedFilters, mutation)\n );\n }\n findAll(filters = {}) {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation));\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n resumePausedMutations() {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused);\n return notifyManager.batch(\n () => Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop))\n )\n );\n }\n};\nfunction scopeFor(mutation) {\n return mutation.options.scope?.id;\n}\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/mutationObserver.ts\nimport { getDefaultState } from \"./mutation.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { hashKey, shallowEqualObjects } from \"./utils.js\";\nvar MutationObserver = class extends Subscribable {\n #client;\n #currentResult = void 0;\n #currentMutation;\n #mutateOptions;\n constructor(client, options) {\n super();\n this.#client = client;\n this.setOptions(options);\n this.bindMethods();\n this.#updateResult();\n }\n bindMethods() {\n this.mutate = this.mutate.bind(this);\n this.reset = this.reset.bind(this);\n }\n setOptions(options) {\n const prevOptions = this.options;\n this.options = this.#client.defaultMutationOptions(options);\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: \"observerOptionsUpdated\",\n mutation: this.#currentMutation,\n observer: this\n });\n }\n if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) {\n this.reset();\n } else if (this.#currentMutation?.state.status === \"pending\") {\n this.#currentMutation.setOptions(this.options);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this);\n }\n }\n onMutationUpdate(action) {\n this.#updateResult();\n this.#notify(action);\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n reset() {\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = void 0;\n this.#updateResult();\n this.#notify();\n }\n mutate(variables, options) {\n this.#mutateOptions = options;\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);\n this.#currentMutation.addObserver(this);\n return this.#currentMutation.execute(variables);\n }\n #updateResult() {\n const state = this.#currentMutation?.state ?? getDefaultState();\n this.#currentResult = {\n ...state,\n isPending: state.status === \"pending\",\n isSuccess: state.status === \"success\",\n isError: state.status === \"error\",\n isIdle: state.status === \"idle\",\n mutate: this.mutate,\n reset: this.reset\n };\n }\n #notify(action) {\n notifyManager.batch(() => {\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables;\n const onMutateResult = this.#currentResult.context;\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n if (action?.type === \"success\") {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n } else if (action?.type === \"error\") {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n this.#mutateOptions.onSettled?.(\n void 0,\n action.error,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n }\n }\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n });\n }\n};\nexport {\n MutationObserver\n};\n//# sourceMappingURL=mutationObserver.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#queries = /* @__PURE__ */ new Map();\n }\n #queries;\n build(client, options, state) {\n const queryKey = options.queryKey;\n const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n return query;\n }\n add(query) {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query);\n this.notify({\n type: \"added\",\n query\n });\n }\n }\n remove(query) {\n const queryInMap = this.#queries.get(query.queryHash);\n if (queryInMap) {\n query.destroy();\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash);\n }\n this.notify({ type: \"removed\", query });\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query);\n });\n });\n }\n get(queryHash) {\n return this.#queries.get(queryHash);\n }\n getAll() {\n return [...this.#queries.values()];\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (query) => matchQuery(defaultedFilters, query)\n );\n }\n findAll(filters = {}) {\n const queries = this.getAll();\n return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n onFocus() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus();\n });\n });\n }\n onOnline() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline();\n });\n });\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/queryClient.ts\nimport {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nvar QueryClient = class {\n #queryCache;\n #mutationCache;\n #defaultOptions;\n #queryDefaults;\n #mutationDefaults;\n #mountCount;\n #unsubscribeFocus;\n #unsubscribeOnline;\n constructor(config = {}) {\n this.#queryCache = config.queryCache || new QueryCache();\n this.#mutationCache = config.mutationCache || new MutationCache();\n this.#defaultOptions = config.defaultOptions || {};\n this.#queryDefaults = /* @__PURE__ */ new Map();\n this.#mutationDefaults = /* @__PURE__ */ new Map();\n this.#mountCount = 0;\n }\n mount() {\n this.#mountCount++;\n if (this.#mountCount !== 1) return;\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations();\n this.#queryCache.onFocus();\n }\n });\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations();\n this.#queryCache.onOnline();\n }\n });\n }\n unmount() {\n this.#mountCount--;\n if (this.#mountCount !== 0) return;\n this.#unsubscribeFocus?.();\n this.#unsubscribeFocus = void 0;\n this.#unsubscribeOnline?.();\n this.#unsubscribeOnline = void 0;\n }\n isFetching(filters) {\n return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n }\n isMutating(filters) {\n return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n }\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state.data;\n }\n ensureQueryData(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n const cachedData = query.state.data;\n if (cachedData === void 0) {\n return this.fetchQuery(options);\n }\n if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\n }\n getQueriesData(filters) {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n setQueryData(queryKey, updater, options) {\n const defaultedOptions = this.defaultQueryOptions({ queryKey });\n const query = this.#queryCache.get(\n defaultedOptions.queryHash\n );\n const prevData = query?.state.data;\n const data = functionalUpdate(updater, prevData);\n if (data === void 0) {\n return void 0;\n }\n return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n }\n setQueriesData(filters, updater, options) {\n return notifyManager.batch(\n () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options)\n ])\n );\n }\n getQueryState(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(\n options.queryHash\n )?.state;\n }\n removeQueries(filters) {\n const queryCache = this.#queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query);\n });\n });\n }\n resetQueries(filters, options) {\n const queryCache = this.#queryCache;\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset();\n });\n return this.refetchQueries(\n {\n type: \"active\",\n ...filters\n },\n options\n );\n });\n }\n cancelQueries(filters, cancelOptions = {}) {\n const defaultedCancelOptions = { revert: true, ...cancelOptions };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n );\n return Promise.all(promises).then(noop).catch(noop);\n }\n invalidateQueries(filters, options = {}) {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate();\n });\n if (filters?.refetchType === \"none\") {\n return Promise.resolve();\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? \"active\"\n },\n options\n );\n });\n }\n refetchQueries(filters, options = {}) {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true\n };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => {\n let promise = query.fetch(void 0, fetchOptions);\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop);\n }\n return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n })\n );\n return Promise.all(promises).then(noop);\n }\n fetchQuery(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n if (defaultedOptions.retry === void 0) {\n defaultedOptions.retry = false;\n }\n const query = this.#queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query)\n ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n prefetchQuery(options) {\n return this.fetchQuery(options).then(noop).catch(noop);\n }\n fetchInfiniteQuery(options) {\n options._type = \"infinite\";\n return this.fetchQuery(options);\n }\n prefetchInfiniteQuery(options) {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n }\n ensureInfiniteQueryData(options) {\n options._type = \"infinite\";\n return this.ensureQueryData(options);\n }\n resumePausedMutations() {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations();\n }\n return Promise.resolve();\n }\n getQueryCache() {\n return this.#queryCache;\n }\n getMutationCache() {\n return this.#mutationCache;\n }\n getDefaultOptions() {\n return this.#defaultOptions;\n }\n setDefaultOptions(options) {\n this.#defaultOptions = options;\n }\n setQueryDefaults(queryKey, options) {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options\n });\n }\n getQueryDefaults(queryKey) {\n const defaults = [...this.#queryDefaults.values()];\n const result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions);\n }\n });\n return result;\n }\n setMutationDefaults(mutationKey, options) {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options\n });\n }\n getMutationDefaults(mutationKey) {\n const defaults = [...this.#mutationDefaults.values()];\n const result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions);\n }\n });\n return result;\n }\n defaultQueryOptions(options) {\n if (options._defaulted) {\n return options;\n }\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true\n };\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions\n );\n }\n if (defaultedOptions.refetchOnReconnect === void 0) {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n }\n if (defaultedOptions.throwOnError === void 0) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n }\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = \"offlineFirst\";\n }\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false;\n }\n return defaultedOptions;\n }\n defaultMutationOptions(options) {\n if (options?._defaulted) {\n return options;\n }\n return {\n ...this.#defaultOptions.mutations,\n ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n clear() {\n this.#queryCache.clear();\n this.#mutationCache.clear();\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","\"use client\";\n\n// src/QueryClientProvider.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar QueryClientContext = React.createContext(\n void 0\n);\nvar useQueryClient = (queryClient) => {\n const client = React.useContext(QueryClientContext);\n if (queryClient) {\n return queryClient;\n }\n if (!client) {\n throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n }\n return client;\n};\nvar QueryClientProvider = ({\n client,\n children\n}) => {\n React.useEffect(() => {\n client.mount();\n return () => {\n client.unmount();\n };\n }, [client]);\n return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children });\n};\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient\n};\n//# sourceMappingURL=QueryClientProvider.js.map","\"use client\";\n\n// src/IsRestoringProvider.ts\nimport * as React from \"react\";\nvar IsRestoringContext = React.createContext(false);\nvar useIsRestoring = () => React.useContext(IsRestoringContext);\nvar IsRestoringProvider = IsRestoringContext.Provider;\nexport {\n IsRestoringProvider,\n useIsRestoring\n};\n//# sourceMappingURL=IsRestoringProvider.js.map","\"use client\";\n\n// src/QueryErrorResetBoundary.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createValue() {\n let isReset = false;\n return {\n clearReset: () => {\n isReset = false;\n },\n reset: () => {\n isReset = true;\n },\n isReset: () => {\n return isReset;\n }\n };\n}\nvar QueryErrorResetBoundaryContext = React.createContext(createValue());\nvar useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\nvar QueryErrorResetBoundary = ({\n children\n}) => {\n const [value] = React.useState(() => createValue());\n return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === \"function\" ? children(value) : children });\n};\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary\n};\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"@tanstack/query-core\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {\n const throwOnError = query?.state.error && typeof options.throwOnError === \"function\" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;\n if (options.suspense || options.experimental_prefetchInRender || throwOnError) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\nvar defaultThrowOnError = (_error, query) => query.state.data === void 0;\nvar ensureSuspenseTimers = (defaultedOptions) => {\n if (defaultedOptions.suspense) {\n const MIN_SUSPENSE_TIME_MS = 1e3;\n const clamp = (value) => value === \"static\" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);\n const originalStaleTime = defaultedOptions.staleTime;\n defaultedOptions.staleTime = typeof originalStaleTime === \"function\" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);\n if (typeof defaultedOptions.gcTime === \"number\") {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS\n );\n }\n }\n};\nvar willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;\nvar shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\nvar fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset();\n});\nexport {\n defaultThrowOnError,\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n};\n//# sourceMappingURL=suspense.js.map","\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { environmentManager, noop, notifyManager } from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { useIsRestoring } from \"./IsRestoringProvider.js\";\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n} from \"./suspense.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'\n );\n }\n }\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const client = useQueryClient(queryClient);\n const defaultedOptions = client.defaultQueryOptions(options);\n client.getDefaultOptions().queries?._experimental_beforeQuery?.(\n defaultedOptions\n );\n const query = client.getQueryCache().get(defaultedOptions.queryHash);\n if (process.env.NODE_ENV !== \"production\") {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`\n );\n }\n }\n const subscribed = options.subscribed !== false;\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : subscribed ? \"optimistic\" : void 0;\n ensureSuspenseTimers(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);\n useClearResetErrorBoundary(errorResetBoundary);\n const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n const shouldSubscribe = !isRestoring && subscribed;\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;\n observer.updateResult();\n return unsubscribe;\n },\n [observer, shouldSubscribe]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions);\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense\n })) {\n throw result.error;\n }\n ;\n client.getDefaultOptions().queries?._experimental_afterQuery?.(\n defaultedOptions,\n result\n );\n if (defaultedOptions.experimental_prefetchInRender && !environmentManager.isServer() && willFetch(result, isRestoring)) {\n const promise = isNewCacheEntry ? (\n // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n ) : (\n // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n );\n promise?.catch(noop).finally(() => {\n observer.updateResult();\n });\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\n\n// src/useQuery.ts\nimport { QueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useQuery(options, queryClient) {\n return useBaseQuery(options, QueryObserver, queryClient);\n}\nexport {\n useQuery\n};\n//# sourceMappingURL=useQuery.js.map","// src/queryOptions.ts\nfunction queryOptions(options) {\n return options;\n}\nexport {\n queryOptions\n};\n//# sourceMappingURL=queryOptions.js.map","\"use client\";\n\n// src/useMutation.ts\nimport * as React from \"react\";\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError\n} from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nfunction useMutation(options, queryClient) {\n const client = useQueryClient(queryClient);\n const [observer] = React.useState(\n () => new MutationObserver(\n client,\n options\n )\n );\n React.useEffect(() => {\n observer.setOptions(options);\n }, [observer, options]);\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n const mutate = React.useCallback(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop);\n },\n [observer]\n );\n if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) {\n throw result.error;\n }\n return { ...result, mutate, mutateAsync: result.mutate };\n}\nexport {\n useMutation\n};\n//# sourceMappingURL=useMutation.js.map","\"use client\";\n\n// src/useInfiniteQuery.ts\nimport { InfiniteQueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useInfiniteQuery(options, queryClient) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver,\n queryClient\n );\n}\nexport {\n useInfiniteQuery\n};\n//# sourceMappingURL=useInfiniteQuery.js.map","\"use client\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\n/**\n* React.use if available (React 19+), undefined otherwise.\n* Use dynamic lookup to avoid Webpack compilation errors with React 18.\n*/\nvar reactUse = React$1[\"use\"];\nvar useLayoutEffect = isServer ?? typeof window === \"undefined\" ? React$1.useEffect : React$1.useLayoutEffect;\n/**\n* React hook to wrap `IntersectionObserver`.\n*\n* This hook will create an `IntersectionObserver` and observe the ref passed to it.\n*\n* When the intersection changes, the callback will be called with the `IntersectionObserverEntry`.\n*\n* @param ref - The ref to observe\n* @param callback - The callback to call when the intersection changes\n* @param disabled - Whether observation is disabled\n* @returns The IntersectionObserver instance\n* @example\n* ```tsx\n* const MyComponent = () => {\n* const ref = React.useRef<HTMLDivElement>(null)\n* useIntersectionObserver(\n* ref,\n* (entry) => { doSomething(entry) },\n* false\n* )\n* return <div ref={ref} />\n* ```\n*/\nfunction useIntersectionObserver(ref, callback, disabled) {\n\tReact$1.useEffect(() => {\n\t\tif (!ref.current || disabled || typeof IntersectionObserver !== \"function\") return () => callback();\n\t\tconst observer = new IntersectionObserver((entries) => {\n\t\t\tcallback(entries.pop());\n\t\t}, { rootMargin: \"100px\" });\n\t\tobserver.observe(ref.current);\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t\tcallback();\n\t\t};\n\t}, [\n\t\tcallback,\n\t\tdisabled,\n\t\tref\n\t]);\n}\n/**\n* React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element.\n*\n* @param ref - The forwarded ref\n* @returns The inner ref returned by `useRef`\n* @example\n* ```tsx\n* const MyComponent = React.forwardRef((props, ref) => {\n* const innerRef = useForwardedRef(ref)\n* return <div ref={innerRef} />\n* })\n* ```\n*/\nfunction useForwardedRef(ref) {\n\tconst innerRef = React$1.useRef(null);\n\tReact$1.useImperativeHandle(ref, () => innerRef.current, []);\n\treturn innerRef;\n}\n//#endregion\nexport { reactUse, useForwardedRef, useIntersectionObserver, useLayoutEffect };\n\n//# sourceMappingURL=utils.js.map","import { isServer } from \"@tanstack/router-core/isServer\";\n//#region src/utils.ts\n/**\n* Return the last element of an array.\n* Intended for non-empty arrays used within router internals.\n*/\nfunction last(arr) {\n\treturn arr[arr.length - 1];\n}\n/**\n* Apply a value-or-updater to a previous value.\n* Accepts either a literal value or a function of the previous value.\n*/\nfunction functionalUpdate(updater, previous) {\n\tif (typeof updater === \"function\") return updater(previous);\n\treturn updater;\n}\nconst hasOwn = Object.prototype.hasOwnProperty;\nconst isEnumerable = Object.prototype.propertyIsEnumerable;\nfunction hasKeys(obj) {\n\tfor (const key in obj) if (hasOwn.call(obj, key)) return true;\n\treturn false;\n}\nconst createNull = () => Object.create(null);\nconst nullReplaceEqualDeep = (prev, next) => replaceEqualDeep(prev, next, createNull);\n/**\n* This function returns `prev` if `_next` is deeply equal.\n* If not, it will replace any deeply equal children of `b` with those of `a`.\n* This can be used for structural sharing between immutable JSON values for example.\n* Do not use this with signals\n*/\nfunction replaceEqualDeep(prev, _next, _makeObj = () => ({}), _depth = 0) {\n\tif (isServer) return _next;\n\tif (prev === _next) return prev;\n\tif (_depth > 500) return _next;\n\tconst next = _next;\n\tconst array = isPlainArray(prev) && isPlainArray(next);\n\tif (!array && !(isPlainObject(prev) && isPlainObject(next))) return next;\n\tconst prevItems = array ? prev : getEnumerableOwnKeys(prev);\n\tif (!prevItems) return next;\n\tconst nextItems = array ? next : getEnumerableOwnKeys(next);\n\tif (!nextItems) return next;\n\tconst prevSize = prevItems.length;\n\tconst nextSize = nextItems.length;\n\tconst copy = array ? new Array(nextSize) : _makeObj();\n\tlet equalItems = 0;\n\tfor (let i = 0; i < nextSize; i++) {\n\t\tconst key = array ? i : nextItems[i];\n\t\tconst p = prev[key];\n\t\tconst n = next[key];\n\t\tif (p === n) {\n\t\t\tcopy[key] = p;\n\t\t\tif (array ? i < prevSize : hasOwn.call(prev, key)) equalItems++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (p === null || n === null || typeof p !== \"object\" || typeof n !== \"object\") {\n\t\t\tcopy[key] = n;\n\t\t\tcontinue;\n\t\t}\n\t\tconst v = replaceEqualDeep(p, n, _makeObj, _depth + 1);\n\t\tcopy[key] = v;\n\t\tif (v === p) equalItems++;\n\t}\n\treturn prevSize === nextSize && equalItems === prevSize ? prev : copy;\n}\n/**\n* Equivalent to `Reflect.ownKeys`, but ensures that objects are \"clone-friendly\":\n* will return false if object has any non-enumerable properties.\n*\n* Optimized for the common case where objects have no symbol properties.\n*/\nfunction getEnumerableOwnKeys(o) {\n\tconst keys = Object.keys(o);\n\tif (keys.length !== Object.getOwnPropertyNames(o).length) return false;\n\tconst symbols = Object.getOwnPropertySymbols(o);\n\tif (symbols.length === 0) return keys;\n\tfor (const symbol of symbols) {\n\t\tif (!isEnumerable.call(o, symbol)) return false;\n\t\tkeys.push(symbol);\n\t}\n\treturn keys;\n}\nfunction isPlainObject(o) {\n\tif (!hasObjectPrototype(o)) return false;\n\tconst ctor = o.constructor;\n\tif (typeof ctor === \"undefined\") return true;\n\tconst prot = ctor.prototype;\n\tif (!hasObjectPrototype(prot)) return false;\n\tif (!prot.hasOwnProperty(\"isPrototypeOf\")) return false;\n\treturn true;\n}\nfunction hasObjectPrototype(o) {\n\treturn Object.prototype.toString.call(o) === \"[object Object]\";\n}\n/**\n* Check if a value is a \"plain\" array (no extra enumerable keys).\n*/\nfunction isPlainArray(value) {\n\treturn Array.isArray(value) && value.length === Object.keys(value).length;\n}\n/**\n* Perform a deep equality check with options for partial comparison and\n* ignoring `undefined` values. Optimized for router state comparisons.\n*/\nfunction deepEqual(a, b, opts) {\n\tif (a === b) return true;\n\tif (typeof a !== typeof b) return false;\n\tif (Array.isArray(a) && Array.isArray(b)) {\n\t\tif (a.length !== b.length) return false;\n\t\tfor (let i = 0, l = a.length; i < l; i++) if (!deepEqual(a[i], b[i], opts)) return false;\n\t\treturn true;\n\t}\n\tif (isPlainObject(a) && isPlainObject(b)) {\n\t\tconst ignoreUndefined = opts?.ignoreUndefined ?? true;\n\t\tif (opts?.partial) {\n\t\t\tfor (const k in b) if (!ignoreUndefined || b[k] !== void 0) {\n\t\t\t\tif (!deepEqual(a[k], b[k], opts)) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tlet aCount = 0;\n\t\tif (!ignoreUndefined) aCount = Object.keys(a).length;\n\t\telse for (const k in a) if (a[k] !== void 0) aCount++;\n\t\tlet bCount = 0;\n\t\tfor (const k in b) if (!ignoreUndefined || b[k] !== void 0) {\n\t\t\tbCount++;\n\t\t\tif (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false;\n\t\t}\n\t\treturn aCount === bCount;\n\t}\n\treturn false;\n}\n/**\n* Create a promise with exposed resolve/reject and status fields.\n* Useful for coordinating async router lifecycle operations.\n*/\nfunction createControlledPromise(onResolve) {\n\tlet resolveLoadPromise;\n\tlet rejectLoadPromise;\n\tconst controlledPromise = new Promise((resolve, reject) => {\n\t\tresolveLoadPromise = resolve;\n\t\trejectLoadPromise = reject;\n\t});\n\tcontrolledPromise.status = \"pending\";\n\tcontrolledPromise.resolve = (value) => {\n\t\tcontrolledPromise.status = \"resolved\";\n\t\tcontrolledPromise.value = value;\n\t\tresolveLoadPromise(value);\n\t\tonResolve?.(value);\n\t};\n\tcontrolledPromise.reject = (e) => {\n\t\tcontrolledPromise.status = \"rejected\";\n\t\trejectLoadPromise(e);\n\t};\n\treturn controlledPromise;\n}\n/**\n* Heuristically detect dynamic import \"module not found\" errors\n* across major browsers for lazy route component handling.\n*/\nfunction isModuleNotFoundError(error) {\n\tif (typeof error?.message !== \"string\") return false;\n\treturn error.message.startsWith(\"Failed to fetch dynamically imported module\") || error.message.startsWith(\"error loading dynamically imported module\") || error.message.startsWith(\"Importing a module script failed\");\n}\nfunction findLast(array, predicate) {\n\tfor (let i = array.length - 1; i >= 0; i--) {\n\t\tconst item = array[i];\n\t\tif (predicate(item)) return item;\n\t}\n}\n/**\n* Re-encode characters that are unsafe in URL paths.\n* Includes ASCII control characters (0x00-0x1F, 0x7F) and a subset of the\n* WHATWG URL \"path percent-encode set\" (\", <, >, `, {, }).\n*\n* Space (0x20) is intentionally excluded — decodeURI decodes %20 to space\n* and the router stores decoded spaces in location.pathname. The existing\n* encodePathLikeUrl already handles re-encoding spaces for outgoing URLs.\n*\n* These characters are decoded by decodeURI but must remain percent-encoded\n* in paths to match how upstream layers (CDNs, edge middleware, browsers)\n* interpret the URL, preventing infinite redirect loops and path mismatches.\n*/\nconst PATH_UNSAFE_RE = /[\\x00-\\x1f\\x7f\"<>`{}]/g;\nfunction sanitizePathSegment(segment) {\n\treturn segment.replace(PATH_UNSAFE_RE, (ch) => \"%\" + ch.charCodeAt(0).toString(16).toUpperCase().padStart(2, \"0\"));\n}\nfunction decodeSegment(segment) {\n\tlet decoded;\n\ttry {\n\t\tdecoded = decodeURI(segment);\n\t} catch {\n\t\tdecoded = segment.replaceAll(/%[0-9A-F]{2}/gi, (match) => {\n\t\t\ttry {\n\t\t\t\treturn decodeURI(match);\n\t\t\t} catch {\n\t\t\t\treturn match;\n\t\t\t}\n\t\t});\n\t}\n\treturn sanitizePathSegment(decoded);\n}\n/**\n* Default list of URL protocols to allow in links, redirects, and navigation.\n* Any absolute URL protocol not in this list is treated as dangerous by default.\n*/\nconst DEFAULT_PROTOCOL_ALLOWLIST = [\n\t\"http:\",\n\t\"https:\",\n\t\"mailto:\",\n\t\"tel:\"\n];\n/**\n* Check if a URL string uses a protocol that is not in the allowlist.\n* Returns true for blocked protocols like javascript:, blob:, data:, etc.\n*\n* The URL constructor correctly normalizes:\n* - Mixed case (JavaScript: → javascript:)\n* - Whitespace/control characters (java\\nscript: → javascript:)\n* - Leading whitespace\n*\n* For relative URLs (no protocol), returns false (safe).\n*\n* @param url - The URL string to check\n* @param allowlist - Set of protocols to allow\n* @returns true if the URL uses a protocol that is not allowed\n*/\nfunction isDangerousProtocol(url, allowlist) {\n\tif (!url) return false;\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\treturn !allowlist.has(parsed.protocol);\n\t} catch {\n\t\treturn false;\n\t}\n}\nconst HTML_ESCAPE_LOOKUP = {\n\t\"&\": \"\\\\u0026\",\n\t\">\": \"\\\\u003e\",\n\t\"<\": \"\\\\u003c\",\n\t\"\\u2028\": \"\\\\u2028\",\n\t\"\\u2029\": \"\\\\u2029\"\n};\nconst HTML_ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\n/**\n* Escape HTML special characters in a string to prevent XSS attacks\n* when embedding strings in script tags during SSR.\n*\n* This is essential for preventing XSS vulnerabilities when user-controlled\n* content is embedded in inline scripts.\n*/\nfunction escapeHtml(str) {\n\treturn str.replace(HTML_ESCAPE_REGEX, (match) => HTML_ESCAPE_LOOKUP[match]);\n}\nfunction decodePath(path) {\n\tif (!path) return {\n\t\tpath,\n\t\thandledProtocolRelativeURL: false\n\t};\n\tif (!/[%\\\\\\x00-\\x1f\\x7f]/.test(path) && !path.startsWith(\"//\")) return {\n\t\tpath,\n\t\thandledProtocolRelativeURL: false\n\t};\n\tconst re = /%25|%5C/gi;\n\tlet cursor = 0;\n\tlet result = \"\";\n\tlet match;\n\twhile (null !== (match = re.exec(path))) {\n\t\tresult += decodeSegment(path.slice(cursor, match.index)) + match[0];\n\t\tcursor = re.lastIndex;\n\t}\n\tresult = result + decodeSegment(cursor ? path.slice(cursor) : path);\n\tlet handledProtocolRelativeURL = false;\n\tif (result.startsWith(\"//\")) {\n\t\thandledProtocolRelativeURL = true;\n\t\tresult = \"/\" + result.replace(/^\\/+/, \"\");\n\t}\n\treturn {\n\t\tpath: result,\n\t\thandledProtocolRelativeURL\n\t};\n}\n/**\n* Encodes a path the same way `new URL()` would, but without the overhead of full URL parsing.\n*\n* This function encodes:\n* - Whitespace characters (spaces → %20, tabs → %09, etc.)\n* - Non-ASCII/Unicode characters (emojis, accented characters, etc.)\n*\n* It preserves:\n* - Already percent-encoded sequences (won't double-encode %2F, %25, etc.)\n* - ASCII special characters valid in URL paths (@, $, &, +, etc.)\n* - Forward slashes as path separators\n*\n* Used to generate proper href values for SSR without constructing URL objects.\n*\n* @example\n* encodePathLikeUrl('/path/file name.pdf') // '/path/file%20name.pdf'\n* encodePathLikeUrl('/path/日本語') // '/path/%E6%97%A5%E6%9C%AC%E8%AA%9E'\n* encodePathLikeUrl('/path/already%20encoded') // '/path/already%20encoded' (preserved)\n*/\nfunction encodePathLikeUrl(path) {\n\tif (!/\\s|[^\\u0000-\\u007F]/.test(path)) return path;\n\treturn path.replace(/\\s|[^\\u0000-\\u007F]/gu, encodeURIComponent);\n}\n/**\n* Builds the dev-mode CSS styles URL for route-scoped CSS collection.\n* Used by HeadContent components in all framework implementations to construct\n* the URL for the `/@tanstack-start/styles.css` endpoint.\n*\n* @param basepath - The router's basepath (may or may not have leading slash)\n* @param routeIds - Array of matched route IDs to include in the CSS collection\n* @returns The full URL path for the dev styles CSS endpoint\n*/\nfunction buildDevStylesUrl(basepath, routeIds) {\n\tconst trimmedBasepath = basepath.replace(/^\\/+|\\/+$/g, \"\");\n\treturn `${trimmedBasepath === \"\" ? \"\" : `/${trimmedBasepath}`}/@tanstack-start/styles.css?routes=${encodeURIComponent(routeIds.join(\",\"))}`;\n}\nfunction arraysEqual(a, b) {\n\tif (a === b) return true;\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n\treturn true;\n}\n//#endregion\nexport { DEFAULT_PROTOCOL_ALLOWLIST, arraysEqual, buildDevStylesUrl, createControlledPromise, decodePath, deepEqual, encodePathLikeUrl, escapeHtml, findLast, functionalUpdate, hasKeys, hasOwn, isDangerousProtocol, isModuleNotFoundError, isPlainArray, isPlainObject, last, nullReplaceEqualDeep, replaceEqualDeep };\n\n//# sourceMappingURL=utils.js.map","//#region src/invariant.ts\nfunction invariant() {\n\tthrow new Error(\"Invariant failed\");\n}\n//#endregion\nexport { invariant };\n\n//# sourceMappingURL=invariant.js.map","//#region src/lru-cache.ts\nfunction createLRUCache(max) {\n\tconst cache = /* @__PURE__ */ new Map();\n\tlet oldest;\n\tlet newest;\n\tconst touch = (entry) => {\n\t\tif (!entry.next) return;\n\t\tif (!entry.prev) {\n\t\t\tentry.next.prev = void 0;\n\t\t\toldest = entry.next;\n\t\t\tentry.next = void 0;\n\t\t\tif (newest) {\n\t\t\t\tentry.prev = newest;\n\t\t\t\tnewest.next = entry;\n\t\t\t}\n\t\t} else {\n\t\t\tentry.prev.next = entry.next;\n\t\t\tentry.next.prev = entry.prev;\n\t\t\tentry.next = void 0;\n\t\t\tif (newest) {\n\t\t\t\tnewest.next = entry;\n\t\t\t\tentry.prev = newest;\n\t\t\t}\n\t\t}\n\t\tnewest = entry;\n\t};\n\treturn {\n\t\tget(key) {\n\t\t\tconst entry = cache.get(key);\n\t\t\tif (!entry) return void 0;\n\t\t\ttouch(entry);\n\t\t\treturn entry.value;\n\t\t},\n\t\tset(key, value) {\n\t\t\tif (cache.size >= max && oldest) {\n\t\t\t\tconst toDelete = oldest;\n\t\t\t\tcache.delete(toDelete.key);\n\t\t\t\tif (toDelete.next) {\n\t\t\t\t\toldest = toDelete.next;\n\t\t\t\t\ttoDelete.next.prev = void 0;\n\t\t\t\t}\n\t\t\t\tif (toDelete === newest) newest = void 0;\n\t\t\t}\n\t\t\tconst existing = cache.get(key);\n\t\t\tif (existing) {\n\t\t\t\texisting.value = value;\n\t\t\t\ttouch(existing);\n\t\t\t} else {\n\t\t\t\tconst entry = {\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue,\n\t\t\t\t\tprev: newest\n\t\t\t\t};\n\t\t\t\tif (newest) newest.next = entry;\n\t\t\t\tnewest = entry;\n\t\t\t\tif (!oldest) oldest = entry;\n\t\t\t\tcache.set(key, entry);\n\t\t\t}\n\t\t},\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t\toldest = void 0;\n\t\t\tnewest = void 0;\n\t\t}\n\t};\n}\n//#endregion\nexport { createLRUCache };\n\n//# sourceMappingURL=lru-cache.js.map","import { last } from \"./utils.js\";\nimport { invariant } from \"./invariant.js\";\nimport { createLRUCache } from \"./lru-cache.js\";\nconst SEGMENT_TYPE_INDEX = 4;\nconst SEGMENT_TYPE_PATHLESS = 5;\n/**\n* Populates the `output` array with the parsed representation of the given `segment` string.\n*\n* Usage:\n* ```ts\n* let output\n* let cursor = 0\n* while (cursor < path.length) {\n* output = parseSegment(path, cursor, output)\n* const end = output[5]\n* cursor = end + 1\n* ```\n*\n* `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed\n* or initialized, it will be done automatically.\n*/\nfunction parseSegment(path, start, output = new Uint16Array(6)) {\n\tconst next = path.indexOf(\"/\", start);\n\tconst end = next === -1 ? path.length : next;\n\tconst part = path.substring(start, end);\n\tif (!part || !part.includes(\"$\")) {\n\t\toutput[0] = 0;\n\t\toutput[1] = start;\n\t\toutput[2] = start;\n\t\toutput[3] = end;\n\t\toutput[4] = end;\n\t\toutput[5] = end;\n\t\treturn output;\n\t}\n\tif (part === \"$\") {\n\t\tconst total = path.length;\n\t\toutput[0] = 2;\n\t\toutput[1] = start;\n\t\toutput[2] = start;\n\t\toutput[3] = total;\n\t\toutput[4] = total;\n\t\toutput[5] = total;\n\t\treturn output;\n\t}\n\tif (part.charCodeAt(0) === 36) {\n\t\toutput[0] = 1;\n\t\toutput[1] = start;\n\t\toutput[2] = start + 1;\n\t\toutput[3] = end;\n\t\toutput[4] = end;\n\t\toutput[5] = end;\n\t\treturn output;\n\t}\n\tconst openBrace = part.indexOf(\"{\");\n\tlet closeBrace;\n\tif (openBrace !== -1 && openBrace + 1 < part.length && (closeBrace = part.indexOf(\"}\", openBrace)) !== -1) {\n\t\tconst firstChar = part.charCodeAt(openBrace + 1);\n\t\tif (firstChar === 45) {\n\t\t\tif (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) {\n\t\t\t\tconst paramStart = openBrace + 3;\n\t\t\t\tconst paramEnd = closeBrace;\n\t\t\t\tif (paramStart < paramEnd) {\n\t\t\t\t\toutput[0] = 3;\n\t\t\t\t\toutput[1] = start + openBrace;\n\t\t\t\t\toutput[2] = start + paramStart;\n\t\t\t\t\toutput[3] = start + paramEnd;\n\t\t\t\t\toutput[4] = start + closeBrace + 1;\n\t\t\t\t\toutput[5] = end;\n\t\t\t\t\treturn output;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (firstChar === 36) {\n\t\t\tconst dollarPos = openBrace + 1;\n\t\t\tconst afterDollar = openBrace + 2;\n\t\t\tif (afterDollar === closeBrace) {\n\t\t\t\toutput[0] = 2;\n\t\t\t\toutput[1] = start + openBrace;\n\t\t\t\toutput[2] = start + dollarPos;\n\t\t\t\toutput[3] = start + afterDollar;\n\t\t\t\toutput[4] = start + closeBrace + 1;\n\t\t\t\toutput[5] = path.length;\n\t\t\t\treturn output;\n\t\t\t}\n\t\t\toutput[0] = 1;\n\t\t\toutput[1] = start + openBrace;\n\t\t\toutput[2] = start + afterDollar;\n\t\t\toutput[3] = start + closeBrace;\n\t\t\toutput[4] = start + closeBrace + 1;\n\t\t\toutput[5] = end;\n\t\t\treturn output;\n\t\t}\n\t}\n\toutput[0] = 0;\n\toutput[1] = start;\n\toutput[2] = start;\n\toutput[3] = end;\n\toutput[4] = end;\n\toutput[5] = end;\n\treturn output;\n}\n/**\n* Recursively parses the segments of the given route tree and populates a segment trie.\n*\n* @param data A reusable Uint16Array for parsing segments. (non important, we're just avoiding allocations)\n* @param route The current route to parse.\n* @param start The starting index for parsing within the route's full path.\n* @param node The current segment node in the trie to populate.\n* @param onRoute Callback invoked for each route processed.\n*/\nfunction parseSegments(defaultCaseSensitive, data, route, start, node, depth, dynamicListsToSort, onRoute) {\n\tonRoute?.(route);\n\tlet cursor = start;\n\t{\n\t\tconst path = route.fullPath ?? route.from;\n\t\tconst options = route.options;\n\t\tconst length = path.length;\n\t\tconst caseSensitive = options?.caseSensitive ?? defaultCaseSensitive;\n\t\tconst parseParams = options?.params?.parse ?? options?.parseParams;\n\t\twhile (cursor < length) {\n\t\t\tconst segment = parseSegment(path, cursor, data);\n\t\t\tlet nextNode;\n\t\t\tconst start = cursor;\n\t\t\tconst end = segment[5];\n\t\t\tcursor = end + 1;\n\t\t\tdepth++;\n\t\t\tconst kind = segment[0];\n\t\t\tswitch (kind) {\n\t\t\t\tcase 0: {\n\t\t\t\t\tconst value = path.substring(segment[2], segment[3]);\n\t\t\t\t\tlet name = value;\n\t\t\t\t\tlet staticChildren;\n\t\t\t\t\tif (caseSensitive) staticChildren = node.static ??= /* @__PURE__ */ new Map();\n\t\t\t\t\telse {\n\t\t\t\t\t\tname = value.toLowerCase();\n\t\t\t\t\t\tstaticChildren = node.staticInsensitive ??= /* @__PURE__ */ new Map();\n\t\t\t\t\t}\n\t\t\t\t\tconst existingNode = staticChildren.get(name);\n\t\t\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst next = createStaticNode(path);\n\t\t\t\t\t\tnext.parent = node;\n\t\t\t\t\t\tnext.depth = depth;\n\t\t\t\t\t\tnextNode = next;\n\t\t\t\t\t\tstaticChildren.set(name, next);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 1:\n\t\t\t\tcase 3:\n\t\t\t\tcase 2: {\n\t\t\t\t\tconst prefix_raw = path.substring(start, segment[1]);\n\t\t\t\t\tconst suffix_raw = path.substring(segment[4], end);\n\t\t\t\t\tconst actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);\n\t\t\t\t\tconst prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();\n\t\t\t\t\tconst suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();\n\t\t\t\t\tconst siblings = kind === 1 ? node.dynamic : kind === 3 ? node.optional : node.wildcard;\n\t\t\t\t\tconst existingNode = kind !== 2 && !parseParams && siblings?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);\n\t\t\t\t\tif (existingNode) nextNode = existingNode;\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst next = createDynamicNode(kind, path, actuallyCaseSensitive, prefix, suffix);\n\t\t\t\t\t\tnextNode = next;\n\t\t\t\t\t\tnext.parent = node;\n\t\t\t\t\t\tnext.depth = depth;\n\t\t\t\t\t\tlet nodes;\n\t\t\t\t\t\tif (kind === 1) nodes = node.dynamic ??= [];\n\t\t\t\t\t\telse if (kind === 3) nodes = node.optional ??= [];\n\t\t\t\t\t\telse nodes = node.wildcard ??= [];\n\t\t\t\t\t\tnodes.push(next);\n\t\t\t\t\t\tif (nodes.length === 2) dynamicListsToSort?.push(nodes);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode = nextNode;\n\t\t}\n\t\tif (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf(\"/\") + 1) === 95) {\n\t\t\tconst pathlessNode = createStaticNode(path);\n\t\t\tpathlessNode.kind = SEGMENT_TYPE_PATHLESS;\n\t\t\tpathlessNode.parent = node;\n\t\t\tdepth++;\n\t\t\tpathlessNode.depth = depth;\n\t\t\tnode.pathless ??= [];\n\t\t\tnode.pathless.push(pathlessNode);\n\t\t\tnode = pathlessNode;\n\t\t}\n\t\tconst isLeaf = (route.path || !route.children) && !route.isRoot;\n\t\tif (isLeaf && path.endsWith(\"/\")) {\n\t\t\tconst indexNode = createStaticNode(path);\n\t\t\tindexNode.kind = SEGMENT_TYPE_INDEX;\n\t\t\tindexNode.parent = node;\n\t\t\tdepth++;\n\t\t\tindexNode.depth = depth;\n\t\t\tnode.index = indexNode;\n\t\t\tnode = indexNode;\n\t\t}\n\t\tnode.parse = parseParams ?? null;\n\t\tnode.priority = options?.params?.priority ?? 0;\n\t\tif (isLeaf && !node.route) {\n\t\t\tnode.route = route;\n\t\t\tnode.fullPath = path;\n\t\t}\n\t}\n\tif (route.children) for (const child of route.children) parseSegments(defaultCaseSensitive, data, child, cursor, node, depth, dynamicListsToSort, onRoute);\n}\nfunction sortDynamic(a, b) {\n\tif (a.parse && !b.parse) return -1;\n\tif (!a.parse && b.parse) return 1;\n\tif (a.parse && b.parse && (a.priority || b.priority)) return b.priority - a.priority;\n\tif (a.prefix && b.prefix && a.prefix !== b.prefix) {\n\t\tif (a.prefix.startsWith(b.prefix)) return -1;\n\t\tif (b.prefix.startsWith(a.prefix)) return 1;\n\t}\n\tif (a.suffix && b.suffix && a.suffix !== b.suffix) {\n\t\tif (a.suffix.endsWith(b.suffix)) return -1;\n\t\tif (b.suffix.endsWith(a.suffix)) return 1;\n\t}\n\tif (a.prefix && !b.prefix) return -1;\n\tif (!a.prefix && b.prefix) return 1;\n\tif (a.suffix && !b.suffix) return -1;\n\tif (!a.suffix && b.suffix) return 1;\n\tif (a.caseSensitive && !b.caseSensitive) return -1;\n\tif (!a.caseSensitive && b.caseSensitive) return 1;\n\treturn 0;\n}\nfunction createStaticNode(fullPath) {\n\treturn {\n\t\tkind: 0,\n\t\tdepth: 0,\n\t\tpathless: null,\n\t\tindex: null,\n\t\tstatic: null,\n\t\tstaticInsensitive: null,\n\t\tdynamic: null,\n\t\toptional: null,\n\t\twildcard: null,\n\t\troute: null,\n\t\tfullPath,\n\t\tparent: null,\n\t\tparse: null,\n\t\tpriority: 0\n\t};\n}\n/**\n* Keys must be declared in the same order as in `SegmentNode` type,\n* to ensure they are represented as the same object class in the engine.\n*/\nfunction createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) {\n\treturn {\n\t\tkind,\n\t\tdepth: 0,\n\t\tpathless: null,\n\t\tindex: null,\n\t\tstatic: null,\n\t\tstaticInsensitive: null,\n\t\tdynamic: null,\n\t\toptional: null,\n\t\twildcard: null,\n\t\troute: null,\n\t\tfullPath,\n\t\tparent: null,\n\t\tparse: null,\n\t\tpriority: 0,\n\t\tcaseSensitive,\n\t\tprefix,\n\t\tsuffix\n\t};\n}\nfunction processRouteMasks(routeList, processedTree) {\n\tconst segmentTree = createStaticNode(\"/\");\n\tconst data = new Uint16Array(6);\n\tconst dynamicListsToSort = [];\n\tfor (const route of routeList) parseSegments(false, data, route, 1, segmentTree, 0, dynamicListsToSort);\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\tprocessedTree.masksTree = segmentTree;\n\tprocessedTree.flatCache = createLRUCache(1e3);\n}\n/**\n* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.\n*/\nfunction findFlatMatch(path, processedTree) {\n\tpath ||= \"/\";\n\tconst cached = processedTree.flatCache.get(path);\n\tif (cached !== void 0) return cached;\n\tconst result = findMatch(path, processedTree.masksTree);\n\tprocessedTree.flatCache.set(path, result);\n\treturn result;\n}\n/**\n* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree\n*/\nfunction findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {\n\tfrom ||= \"/\";\n\tpath ||= \"/\";\n\tconst key = caseSensitive ? `case\\0${from}` : from;\n\tlet tree = processedTree.singleCache.get(key);\n\tif (!tree) {\n\t\ttree = createStaticNode(\"/\");\n\t\tparseSegments(caseSensitive, new Uint16Array(6), { from }, 1, tree, 0);\n\t\tprocessedTree.singleCache.set(key, tree);\n\t}\n\treturn findMatch(path, tree, fuzzy);\n}\nfunction findRouteMatch(path, processedTree, fuzzy = false) {\n\tconst key = fuzzy ? path : `nofuzz\\0${path}`;\n\tconst cached = processedTree.matchCache.get(key);\n\tif (cached !== void 0) return cached;\n\tpath ||= \"/\";\n\tlet result;\n\ttry {\n\t\tresult = findMatch(path, processedTree.segmentTree, fuzzy);\n\t} catch (err) {\n\t\tif (err instanceof URIError) result = null;\n\t\telse throw err;\n\t}\n\tif (result) result.branch = buildRouteBranch(result.route);\n\tprocessedTree.matchCache.set(key, result);\n\treturn result;\n}\n/** Trim trailing slashes (except preserving root '/'). */\nfunction trimPathRight(path) {\n\treturn path === \"/\" ? path : path.replace(/\\/{1,}$/, \"\");\n}\n/**\n* Processes a route tree into a segment trie for efficient path matching.\n* Also builds lookup maps for routes by ID and by trimmed full path.\n*/\nfunction processRouteTree(routeTree, caseSensitive = false, initRoute) {\n\tconst segmentTree = createStaticNode(routeTree.fullPath);\n\tconst data = new Uint16Array(6);\n\tconst dynamicListsToSort = [];\n\tconst routesById = {};\n\tconst routesByPath = {};\n\tlet index = 0;\n\tparseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, dynamicListsToSort, (route) => {\n\t\tinitRoute?.(route, index);\n\t\tif (route.id in routesById) {\n\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Duplicate routes found with id: ${String(route.id)}`);\n\t\t\tinvariant();\n\t\t}\n\t\troutesById[route.id] = route;\n\t\tif (index !== 0 && route.path) {\n\t\t\tconst trimmedFullPath = trimPathRight(route.fullPath);\n\t\t\tif (!routesByPath[trimmedFullPath] || route.fullPath.endsWith(\"/\")) routesByPath[trimmedFullPath] = route;\n\t\t}\n\t\tindex++;\n\t});\n\tfor (const nodes of dynamicListsToSort) nodes.sort(sortDynamic);\n\treturn {\n\t\tprocessedTree: {\n\t\t\tsegmentTree,\n\t\t\tsingleCache: createLRUCache(1e3),\n\t\t\tmatchCache: createLRUCache(1e3),\n\t\t\tflatCache: null,\n\t\t\tmasksTree: null\n\t\t},\n\t\troutesById,\n\t\troutesByPath\n\t};\n}\nfunction findMatch(path, segmentTree, fuzzy = false) {\n\tconst parts = path.split(\"/\");\n\tconst leaf = getNodeMatch(path, parts, segmentTree, fuzzy);\n\tif (!leaf) return null;\n\tconst [rawParams] = extractParams(path, parts, leaf);\n\treturn {\n\t\troute: leaf.node.route,\n\t\trawParams\n\t};\n}\n/**\n* This function is \"resumable\":\n* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call\n* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off\n*\n* Inputs are *not* mutated.\n*/\nfunction extractParams(path, parts, leaf) {\n\tconst list = buildBranch(leaf.node);\n\tlet nodeParts = null;\n\tconst rawParams = Object.create(null);\n\t/** which segment of the path we're currently processing */\n\tlet partIndex = leaf.extract?.part ?? 0;\n\t/** which node of the route tree branch we're currently processing */\n\tlet nodeIndex = leaf.extract?.node ?? 0;\n\t/** index of the 1st character of the segment we're processing in the path string */\n\tlet pathIndex = leaf.extract?.path ?? 0;\n\t/** which fullPath segment we're currently processing */\n\tlet segmentCount = leaf.extract?.segment ?? 0;\n\tfor (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) {\n\t\tconst node = list[nodeIndex];\n\t\tif (node.kind === SEGMENT_TYPE_INDEX) break;\n\t\tif (node.kind === SEGMENT_TYPE_PATHLESS) {\n\t\t\tsegmentCount--;\n\t\t\tpartIndex--;\n\t\t\tpathIndex--;\n\t\t\tcontinue;\n\t\t}\n\t\tconst part = parts[partIndex];\n\t\tconst currentPathIndex = pathIndex;\n\t\tif (part) pathIndex += part.length;\n\t\tif (node.kind === 1) {\n\t\t\tnodeParts ??= leaf.node.fullPath.split(\"/\");\n\t\t\tconst nodePart = nodeParts[segmentCount];\n\t\t\tconst preLength = node.prefix?.length ?? 0;\n\t\t\tif (nodePart.charCodeAt(preLength) === 123) {\n\t\t\t\tconst sufLength = node.suffix?.length ?? 0;\n\t\t\t\tconst name = nodePart.substring(preLength + 2, nodePart.length - sufLength - 1);\n\t\t\t\tconst value = part.substring(preLength, part.length - sufLength);\n\t\t\t\trawParams[name] = decodeURIComponent(value);\n\t\t\t} else {\n\t\t\t\tconst name = nodePart.substring(1);\n\t\t\t\trawParams[name] = decodeURIComponent(part);\n\t\t\t}\n\t\t} else if (node.kind === 3) {\n\t\t\tif (leaf.skipped & 1 << nodeIndex) {\n\t\t\t\tpartIndex--;\n\t\t\t\tpathIndex = currentPathIndex - 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnodeParts ??= leaf.node.fullPath.split(\"/\");\n\t\t\tconst nodePart = nodeParts[segmentCount];\n\t\t\tconst preLength = node.prefix?.length ?? 0;\n\t\t\tconst sufLength = node.suffix?.length ?? 0;\n\t\t\tconst name = nodePart.substring(preLength + 3, nodePart.length - sufLength - 1);\n\t\t\tconst value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part;\n\t\t\tif (value) rawParams[name] = decodeURIComponent(value);\n\t\t} else if (node.kind === 2) {\n\t\t\tconst n = node;\n\t\t\tconst value = path.substring(currentPathIndex + (n.prefix?.length ?? 0), path.length - (n.suffix?.length ?? 0));\n\t\t\tconst splat = decodeURIComponent(value);\n\t\t\trawParams[\"*\"] = splat;\n\t\t\trawParams._splat = splat;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);\n\treturn [rawParams, {\n\t\tpart: partIndex,\n\t\tnode: nodeIndex,\n\t\tpath: pathIndex,\n\t\tsegment: segmentCount\n\t}];\n}\nfunction buildRouteBranch(route) {\n\tconst list = [route];\n\twhile (route.parentRoute) {\n\t\troute = route.parentRoute;\n\t\tlist.push(route);\n\t}\n\tlist.reverse();\n\treturn list;\n}\nfunction buildBranch(node) {\n\tconst list = Array(node.depth + 1);\n\tdo {\n\t\tlist[node.depth] = node;\n\t\tnode = node.parent;\n\t} while (node);\n\treturn list;\n}\nfunction getNodeMatch(path, parts, segmentTree, fuzzy) {\n\tif (path === \"/\" && segmentTree.index) return {\n\t\tnode: segmentTree.index,\n\t\tskipped: 0\n\t};\n\tconst trailingSlash = !last(parts);\n\tconst pathIsIndex = trailingSlash && path !== \"/\";\n\tconst partsLength = parts.length - (trailingSlash ? 1 : 0);\n\tconst stack = [{\n\t\tnode: segmentTree,\n\t\tindex: 1,\n\t\tskipped: 0,\n\t\tstatics: 0,\n\t\tdynamics: 0,\n\t\toptionals: 0\n\t}];\n\tlet bestFuzzy = null;\n\tlet bestMatch = null;\n\twhile (stack.length) {\n\t\tconst frame = stack.pop();\n\t\tconst { node, index, skipped, statics, dynamics, optionals } = frame;\n\t\tlet { extract, rawParams } = frame;\n\t\tif (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;\n\t\tif (node.parse) {\n\t\t\tif (!validateParseParams(path, parts, frame)) continue;\n\t\t\trawParams = frame.rawParams;\n\t\t\textract = frame.extract;\n\t\t}\n\t\tif (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;\n\t\tconst isBeyondPath = index === partsLength;\n\t\tif (isBeyondPath) {\n\t\t\tif (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;\n\t\t\tif (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;\n\t\t}\n\t\tconst part = isBeyondPath ? void 0 : parts[index];\n\t\tlet lowerPart;\n\t\tif (isBeyondPath && node.index) {\n\t\t\tconst indexFrame = {\n\t\t\t\tnode: node.index,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t};\n\t\t\tlet indexValid = true;\n\t\t\tif (node.index.parse) {\n\t\t\t\tif (!validateParseParams(path, parts, indexFrame)) indexValid = false;\n\t\t\t}\n\t\t\tif (indexValid) {\n\t\t\t\tif (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;\n\t\t\t\tif (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;\n\t\t\t}\n\t\t}\n\t\tif (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.wildcard[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tif (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;\n\t\t\t}\n\t\t\tif (suffix) {\n\t\t\t\tif (isBeyondPath) continue;\n\t\t\t\tconst end = parts.slice(index).join(\"/\").slice(-suffix.length);\n\t\t\t\tif ((segment.caseSensitive ? end : end.toLowerCase()) !== suffix) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: partsLength,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.optional) {\n\t\t\tconst nextSkipped = skipped | 1 << node.depth + 1;\n\t\t\tfor (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex,\n\t\t\t\t\tskipped: nextSkipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals,\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {\n\t\t\t\tconst segment = node.optional[i];\n\t\t\t\tconst { prefix, suffix } = segment;\n\t\t\t\tif (prefix || suffix) {\n\t\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\t\tif (suffix && !casePart.endsWith(suffix)) continue;\n\t\t\t\t}\n\t\t\t\tstack.push({\n\t\t\t\t\tnode: segment,\n\t\t\t\t\tindex: index + 1,\n\t\t\t\t\tskipped,\n\t\t\t\t\tstatics,\n\t\t\t\t\tdynamics,\n\t\t\t\t\toptionals: optionals + segmentScore(partsLength, index),\n\t\t\t\t\textract,\n\t\t\t\t\trawParams\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.dynamic[i];\n\t\t\tconst { prefix, suffix } = segment;\n\t\t\tif (prefix || suffix) {\n\t\t\t\tconst casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();\n\t\t\t\tif (prefix && !casePart.startsWith(prefix)) continue;\n\t\t\t\tif (suffix && !casePart.endsWith(suffix)) continue;\n\t\t\t}\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics: dynamics + segmentScore(partsLength, index),\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.staticInsensitive) {\n\t\t\tconst match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (!isBeyondPath && node.static) {\n\t\t\tconst match = node.static.get(part);\n\t\t\tif (match) stack.push({\n\t\t\t\tnode: match,\n\t\t\t\tindex: index + 1,\n\t\t\t\tskipped,\n\t\t\t\tstatics: statics + segmentScore(partsLength, index),\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t\tif (node.pathless) for (let i = node.pathless.length - 1; i >= 0; i--) {\n\t\t\tconst segment = node.pathless[i];\n\t\t\tstack.push({\n\t\t\t\tnode: segment,\n\t\t\t\tindex,\n\t\t\t\tskipped,\n\t\t\t\tstatics,\n\t\t\t\tdynamics,\n\t\t\t\toptionals,\n\t\t\t\textract,\n\t\t\t\trawParams\n\t\t\t});\n\t\t}\n\t}\n\tif (bestMatch) return bestMatch;\n\tif (fuzzy && bestFuzzy) {\n\t\tlet sliceIndex = bestFuzzy.index;\n\t\tfor (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;\n\t\tconst splat = sliceIndex === path.length ? \"/\" : path.slice(sliceIndex);\n\t\tbestFuzzy.rawParams ??= Object.create(null);\n\t\tbestFuzzy.rawParams[\"**\"] = decodeURIComponent(splat);\n\t\treturn bestFuzzy;\n\t}\n\treturn null;\n}\nfunction segmentScore(partsLength, index) {\n\treturn 2 ** (partsLength - index - 1);\n}\nfunction isPerfectStaticMatch(statics, partsLength) {\n\treturn statics === 2 ** (partsLength - 1) - 1;\n}\nfunction validateParseParams(path, parts, frame) {\n\tlet rawParams;\n\tlet state;\n\ttry {\n\t\t[rawParams, state] = extractParams(path, parts, frame);\n\t} catch {\n\t\treturn null;\n\t}\n\tframe.rawParams = rawParams;\n\tframe.extract = state;\n\tif (!frame.node.parse) return true;\n\ttry {\n\t\tif (frame.node.parse(rawParams) === false) return null;\n\t} catch {}\n\treturn true;\n}\nfunction isFrameMoreSpecific(prev, next) {\n\tif (!prev) return true;\n\treturn next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.node.depth > prev.node.depth)));\n}\n//#endregion\nexport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegment, processRouteMasks, processRouteTree };\n\n//# sourceMappingURL=new-process-route-tree.js.map","import { last } from \"./utils.js\";\nimport { parseSegment } from \"./new-process-route-tree.js\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\n//#region src/path.ts\n/** Join path segments, cleaning duplicate slashes between parts. */\nfunction joinPaths(paths) {\n\treturn cleanPath(paths.filter((val) => {\n\t\treturn val !== void 0;\n\t}).join(\"/\"));\n}\n/** Remove repeated slashes from a path string. */\nfunction cleanPath(path) {\n\treturn path.replace(/\\/{2,}/g, \"/\");\n}\n/** Trim leading slashes (except preserving root '/'). */\nfunction trimPathLeft(path) {\n\treturn path === \"/\" ? path : path.replace(/^\\/{1,}/, \"\");\n}\n/** Trim trailing slashes (except preserving root '/'). */\nfunction trimPathRight(path) {\n\tconst len = path.length;\n\treturn len > 1 && path[len - 1] === \"/\" ? path.replace(/\\/{1,}$/, \"\") : path;\n}\n/** Trim both leading and trailing slashes. */\nfunction trimPath(path) {\n\treturn trimPathRight(trimPathLeft(path));\n}\n/** Remove a trailing slash from value when appropriate for comparisons. */\nfunction removeTrailingSlash(value, basepath) {\n\tif (value?.endsWith(\"/\") && value !== \"/\" && value !== `${basepath}/`) return value.slice(0, -1);\n\treturn value;\n}\n/**\n* Compare two pathnames for exact equality after normalizing trailing slashes\n* relative to the provided `basepath`.\n*/\nfunction exactPathTest(pathName1, pathName2, basepath) {\n\treturn removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);\n}\n/**\n* Resolve a destination path against a base, honoring trailing-slash policy\n* and supporting relative segments (`.`/`..`) and absolute `to` values.\n*/\nfunction resolvePath({ base, to, trailingSlash = \"never\", cache }) {\n\tif (to.includes(\"//\")) to = cleanPath(to);\n\tif (to.startsWith(\"/\")) {\n\t\tif (to.length === 1 || trailingSlash === \"preserve\") return to;\n\t\tif (trailingSlash === \"always\") return to.endsWith(\"/\") ? to : `${to}/`;\n\t\treturn to.endsWith(\"/\") ? to.slice(0, -1) : to;\n\t}\n\tconst isBase = to === \".\";\n\tlet key;\n\tif (cache) {\n\t\tkey = isBase ? base : base + \"\\0\" + to;\n\t\tconst cached = cache.get(key);\n\t\tif (cached) return cached;\n\t}\n\tlet baseSegments;\n\tif (isBase) baseSegments = base.split(\"/\");\n\telse {\n\t\tif (base.includes(\"//\")) base = cleanPath(base);\n\t\tbaseSegments = base.split(\"/\");\n\t\twhile (baseSegments.length > 1 && last(baseSegments) === \"\") baseSegments.pop();\n\t\tconst toSegments = to.split(\"/\");\n\t\tfor (let index = 0, length = toSegments.length; index < length; index++) {\n\t\t\tconst value = toSegments[index];\n\t\t\tif (value === \"\") {\n\t\t\t\tif (!index) baseSegments = [value];\n\t\t\t\telse if (index === length - 1) baseSegments.push(value);\n\t\t\t} else if (value === \"..\") if (baseSegments.length > 1) baseSegments.pop();\n\t\t\telse baseSegments = [\"\"];\n\t\t\telse if (value === \".\") {} else baseSegments.push(value);\n\t\t}\n\t}\n\tif (baseSegments.length > 1) {\n\t\tif (last(baseSegments) === \"\") {\n\t\t\tif (trailingSlash === \"never\") baseSegments.pop();\n\t\t} else if (trailingSlash === \"always\") baseSegments.push(\"\");\n\t}\n\tconst joined = baseSegments.join(\"/\");\n\tconst result = (isBase ? cleanPath(joined) : joined) || \"/\";\n\tif (key && cache) cache.set(key, result);\n\treturn result;\n}\n/**\n* Create a pre-compiled decode config from allowed characters.\n* This should be called once at router initialization.\n*/\nfunction compileDecodeCharMap(pathParamsAllowedCharacters) {\n\tconst charMap = new Map(pathParamsAllowedCharacters.map((char) => [encodeURIComponent(char), char]));\n\tconst pattern = Array.from(charMap.keys()).map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\");\n\tconst regex = new RegExp(pattern, \"g\");\n\treturn (encoded) => encoded.replace(regex, (match) => charMap.get(match) ?? match);\n}\nfunction encodeParam(key, params, decoder) {\n\tconst value = params[key];\n\tif (typeof value !== \"string\") return value;\n\tif (key === \"_splat\") {\n\t\tif (/^[a-zA-Z0-9\\-._~!/]*$/.test(value)) return value;\n\t\treturn value.split(\"/\").map((segment) => encodePathParam(segment, decoder)).join(\"/\");\n\t} else return encodePathParam(value, decoder);\n}\n/**\n* Interpolate params and wildcards into a route path template.\n*\n* - Encodes params safely (configurable allowed characters)\n* - Supports `{-$optional}` segments, `{prefix{$id}suffix}` and `{$}` wildcards\n*/\nfunction interpolatePath({ path, params, decoder, ...rest }) {\n\tlet isMissingParams = false;\n\tconst usedParams = Object.create(null);\n\tif (!path || path === \"/\") return {\n\t\tinterpolatedPath: \"/\",\n\t\tusedParams,\n\t\tisMissingParams\n\t};\n\tif (!path.includes(\"$\")) return {\n\t\tinterpolatedPath: path,\n\t\tusedParams,\n\t\tisMissingParams\n\t};\n\tif (isServer ?? rest.server) {\n\t\tif (path.indexOf(\"{\") === -1) {\n\t\t\tconst length = path.length;\n\t\t\tlet cursor = 0;\n\t\t\tlet joined = \"\";\n\t\t\twhile (cursor < length) {\n\t\t\t\twhile (cursor < length && path.charCodeAt(cursor) === 47) cursor++;\n\t\t\t\tif (cursor >= length) break;\n\t\t\t\tconst start = cursor;\n\t\t\t\tlet end = path.indexOf(\"/\", cursor);\n\t\t\t\tif (end === -1) end = length;\n\t\t\t\tcursor = end;\n\t\t\t\tconst part = path.substring(start, end);\n\t\t\t\tif (!part) continue;\n\t\t\t\tif (part.charCodeAt(0) === 36) if (part.length === 1) {\n\t\t\t\t\tconst splat = params._splat;\n\t\t\t\t\tusedParams._splat = splat;\n\t\t\t\t\tusedParams[\"*\"] = splat;\n\t\t\t\t\tif (!splat) {\n\t\t\t\t\t\tisMissingParams = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst value = encodeParam(\"_splat\", params, decoder);\n\t\t\t\t\tjoined += \"/\" + value;\n\t\t\t\t} else {\n\t\t\t\t\tconst key = part.substring(1);\n\t\t\t\t\tif (!isMissingParams && !(key in params)) isMissingParams = true;\n\t\t\t\t\tusedParams[key] = params[key];\n\t\t\t\t\tconst value = encodeParam(key, params, decoder) ?? \"undefined\";\n\t\t\t\t\tjoined += \"/\" + value;\n\t\t\t\t}\n\t\t\t\telse joined += \"/\" + part;\n\t\t\t}\n\t\t\tif (path.endsWith(\"/\")) joined += \"/\";\n\t\t\treturn {\n\t\t\t\tusedParams,\n\t\t\t\tinterpolatedPath: joined || \"/\",\n\t\t\t\tisMissingParams\n\t\t\t};\n\t\t}\n\t}\n\tconst length = path.length;\n\tlet cursor = 0;\n\tlet segment;\n\tlet joined = \"\";\n\twhile (cursor < length) {\n\t\tconst start = cursor;\n\t\tsegment = parseSegment(path, start, segment);\n\t\tconst end = segment[5];\n\t\tcursor = end + 1;\n\t\tif (start === end) continue;\n\t\tconst kind = segment[0];\n\t\tif (kind === 0) {\n\t\t\tjoined += \"/\" + path.substring(start, end);\n\t\t\tcontinue;\n\t\t}\n\t\tif (kind === 2) {\n\t\t\tconst splat = params._splat;\n\t\t\tusedParams._splat = splat;\n\t\t\tusedParams[\"*\"] = splat;\n\t\t\tconst prefix = path.substring(start, segment[1]);\n\t\t\tconst suffix = path.substring(segment[4], end);\n\t\t\tif (!splat) {\n\t\t\t\tisMissingParams = true;\n\t\t\t\tif (prefix || suffix) joined += \"/\" + prefix + suffix;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst value = encodeParam(\"_splat\", params, decoder);\n\t\t\tjoined += \"/\" + prefix + value + suffix;\n\t\t\tcontinue;\n\t\t}\n\t\tif (kind === 1) {\n\t\t\tconst key = path.substring(segment[2], segment[3]);\n\t\t\tif (!isMissingParams && !(key in params)) isMissingParams = true;\n\t\t\tusedParams[key] = params[key];\n\t\t\tconst prefix = path.substring(start, segment[1]);\n\t\t\tconst suffix = path.substring(segment[4], end);\n\t\t\tconst value = encodeParam(key, params, decoder) ?? \"undefined\";\n\t\t\tjoined += \"/\" + prefix + value + suffix;\n\t\t\tcontinue;\n\t\t}\n\t\tif (kind === 3) {\n\t\t\tconst key = path.substring(segment[2], segment[3]);\n\t\t\tconst valueRaw = params[key];\n\t\t\tif (valueRaw == null) continue;\n\t\t\tusedParams[key] = valueRaw;\n\t\t\tconst prefix = path.substring(start, segment[1]);\n\t\t\tconst suffix = path.substring(segment[4], end);\n\t\t\tconst value = encodeParam(key, params, decoder) ?? \"\";\n\t\t\tjoined += \"/\" + prefix + value + suffix;\n\t\t\tcontinue;\n\t\t}\n\t}\n\tif (path.endsWith(\"/\")) joined += \"/\";\n\treturn {\n\t\tusedParams,\n\t\tinterpolatedPath: joined || \"/\",\n\t\tisMissingParams\n\t};\n}\nfunction encodePathParam(value, decoder) {\n\tconst encoded = encodeURIComponent(value);\n\treturn decoder?.(encoded) ?? encoded;\n}\n//#endregion\nexport { cleanPath, compileDecodeCharMap, exactPathTest, interpolatePath, joinPaths, removeTrailingSlash, resolvePath, trimPath, trimPathLeft, trimPathRight };\n\n//# sourceMappingURL=path.js.map","//#region src/not-found.ts\n/**\n* Create a not-found error object recognized by TanStack Router.\n*\n* Throw this from loaders/actions to trigger the nearest `notFoundComponent`.\n* Use `routeId` to target a specific route's not-found boundary. If `throw`\n* is true, the error is thrown instead of returned.\n*\n* @param options Optional settings including `routeId`, `headers`, and `throw`.\n* @returns A not-found error object that can be thrown or returned.\n* @link https://tanstack.com/router/latest/docs/router/framework/react/api/router/notFoundFunction\n*/\nfunction notFound(options = {}) {\n\toptions.isNotFound = true;\n\tif (options.throw) throw options;\n\treturn options;\n}\n/** Determine if a value is a TanStack Router not-found error. */\nfunction isNotFound(obj) {\n\treturn obj?.isNotFound === true;\n}\n//#endregion\nexport { isNotFound, notFound };\n\n//# sourceMappingURL=not-found.js.map","import { isServer } from \"@tanstack/router-core/isServer\";\n//#region src/scroll-restoration.ts\nfunction getSafeSessionStorage() {\n\ttry {\n\t\treturn sessionStorage;\n\t} catch {\n\t\treturn;\n\t}\n}\nconst storageKey = \"tsr-scroll-restoration-v1_3\";\nconst safeSessionStorage = getSafeSessionStorage();\nfunction createScrollRestorationCache() {\n\ttry {\n\t\treturn JSON.parse(safeSessionStorage?.getItem(\"tsr-scroll-restoration-v1_3\") || \"{}\");\n\t} catch {\n\t\treturn {};\n\t}\n}\nfunction persistScrollRestorationCache() {\n\ttry {\n\t\tsafeSessionStorage?.setItem(storageKey, JSON.stringify(scrollRestorationCache));\n\t} catch {\n\t\tif (process.env.NODE_ENV !== \"production\") console.warn(\"[ts-router] Could not persist scroll restoration state to sessionStorage.\");\n\t}\n}\nconst scrollRestorationCache = /* @__PURE__ */ createScrollRestorationCache();\nconst scrollRestorationIdAttribute = \"data-scroll-restoration-id\";\n/**\n* The default `getKey` function for `useScrollRestoration`.\n* It returns the `key` from the location state or the `href` of the location.\n*\n* The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render.\n*/\nconst defaultGetScrollRestorationKey = (location) => {\n\treturn location.state.__TSR_key || location.href;\n};\nfunction getScrollRestorationSelector(element) {\n\tconst attrId = element.getAttribute(scrollRestorationIdAttribute);\n\tif (attrId) return `[${scrollRestorationIdAttribute}=\"${attrId}\"]`;\n\tlet selector = \"\";\n\tlet el = element;\n\tlet parent;\n\twhile (parent = el.parentNode) {\n\t\tlet index = 1;\n\t\tlet sibling = el;\n\t\twhile (sibling = sibling.previousElementSibling) index++;\n\t\tconst part = `${el.localName}:nth-child(${index})`;\n\t\tselector = selector ? `${part} > ${selector}` : part;\n\t\tel = parent;\n\t}\n\treturn selector;\n}\nfunction getElementScrollRestorationEntry(router, options) {\n\tconst entries = scrollRestorationCache[(options.getKey || defaultGetScrollRestorationKey)(router.latestLocation)];\n\tif (!entries) return;\n\tif (options.id) return entries[`[${scrollRestorationIdAttribute}=\"${options.id}\"]`];\n\tconst element = options.getElement?.();\n\tif (!element) return;\n\treturn entries[element === window ? windowScrollTarget : getScrollRestorationSelector(element)];\n}\nlet ignoreScroll = false;\nconst windowScrollTarget = \"window\";\nfunction getElement(selector) {\n\ttry {\n\t\treturn typeof selector === \"function\" ? selector() : document.querySelector(selector);\n\t} catch {}\n}\nfunction getScrollToTopElements(scrollToTopSelectors) {\n\tconst elements = /* @__PURE__ */ new Set();\n\tfor (const selector of scrollToTopSelectors) {\n\t\tif (selector === windowScrollTarget) continue;\n\t\tconst element = getElement(selector);\n\t\tif (element) elements.add(element);\n\t}\n\treturn elements;\n}\nfunction setupScrollRestoration(router, force) {\n\tconst shouldSetupScrollRestoration = force ?? router.options.scrollRestoration;\n\tconst scroll = router._scroll;\n\tif (shouldSetupScrollRestoration) scroll.restoring = true;\n\tif (isServer ?? router.isServer) return;\n\tconst getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey;\n\tconst trackedScrollTargets = /* @__PURE__ */ new Set();\n\tconst snapshotCurrentScrollTargets = (restoreKey) => {\n\t\tconst keyEntry = scrollRestorationCache[restoreKey] ||= {};\n\t\tfor (const target of trackedScrollTargets) if (target === document) keyEntry[windowScrollTarget] = {\n\t\t\tscrollX,\n\t\t\tscrollY\n\t\t};\n\t\telse if (target.isConnected) keyEntry[getScrollRestorationSelector(target)] = {\n\t\t\tscrollX: target.scrollLeft,\n\t\t\tscrollY: target.scrollTop\n\t\t};\n\t};\n\tif (shouldSetupScrollRestoration && !scroll.restoration) {\n\t\tscroll.restoration = true;\n\t\tignoreScroll = false;\n\t\thistory.scrollRestoration = \"manual\";\n\t\tdocument.addEventListener(\"scroll\", (event) => {\n\t\t\tif (ignoreScroll) return;\n\t\t\ttrackedScrollTargets.add(event.target);\n\t\t}, true);\n\t\trouter.subscribe(\"onBeforeLoad\", (event) => {\n\t\t\tif (event.fromLocation) snapshotCurrentScrollTargets(getKey(event.fromLocation));\n\t\t\ttrackedScrollTargets.clear();\n\t\t});\n\t\taddEventListener(\"pagehide\", () => {\n\t\t\tsnapshotCurrentScrollTargets(getKey(router.stores.resolvedLocation.get() ?? router.stores.location.get()));\n\t\t\tpersistScrollRestorationCache();\n\t\t});\n\t}\n\tif (scroll.reset) return;\n\tscroll.reset = true;\n\trouter.subscribe(\"onRendered\", (event) => {\n\t\tconst behavior = router.options.scrollRestorationBehavior;\n\t\tconst scrollToTopSelectors = router.options.scrollToTopSelectors;\n\t\tconst shouldResetScroll = scroll.next;\n\t\tconst hashNavigation = scroll.hash;\n\t\tlet scrollToTopElements;\n\t\ttrackedScrollTargets.clear();\n\t\tscroll.next = true;\n\t\tscroll.hash = false;\n\t\tif (typeof router.options.scrollRestoration === \"function\" && !router.options.scrollRestoration({ location: router.latestLocation })) return;\n\t\tconst cacheKey = getKey(event.toLocation);\n\t\tconst fromCacheKey = event.fromLocation && getKey(event.fromLocation);\n\t\tif (scroll.restoring && fromCacheKey && fromCacheKey !== cacheKey) {\n\t\t\tconst fromElementEntries = scrollRestorationCache[fromCacheKey];\n\t\t\tif (fromElementEntries) {\n\t\t\t\tlet toElementEntries = scrollRestorationCache[cacheKey];\n\t\t\t\tfor (const elementSelector in fromElementEntries) {\n\t\t\t\t\tif (elementSelector === windowScrollTarget) {\n\t\t\t\t\t\tif (shouldResetScroll) continue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst element = getElement(elementSelector);\n\t\t\t\t\t\tif (!element) continue;\n\t\t\t\t\t\tif (shouldResetScroll && scrollToTopSelectors) {\n\t\t\t\t\t\t\tscrollToTopElements ??= getScrollToTopElements(scrollToTopSelectors);\n\t\t\t\t\t\t\tif (scrollToTopElements.has(element)) continue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!toElementEntries) toElementEntries = scrollRestorationCache[cacheKey] = {};\n\t\t\t\t\ttoElementEntries[elementSelector] ??= fromElementEntries[elementSelector];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tignoreScroll = true;\n\t\ttry {\n\t\t\tconst hash = event.toLocation.hash;\n\t\t\tconst hashScrollIntoViewOptions = event.toLocation.state.__hashScrollIntoViewOptions ?? true;\n\t\t\tlet windowRestored = false;\n\t\t\tif (shouldResetScroll) {\n\t\t\t\tif (!hash && scrollToTopSelectors) scrollToTopElements ??= getScrollToTopElements(scrollToTopSelectors);\n\t\t\t\tconst skipWindowRestore = hash && hashScrollIntoViewOptions && hashNavigation;\n\t\t\t\tconst elementEntries = scroll.restoring ? scrollRestorationCache[cacheKey] : void 0;\n\t\t\t\tif (elementEntries) for (const elementSelector in elementEntries) {\n\t\t\t\t\tconst { scrollX, scrollY } = elementEntries[elementSelector];\n\t\t\t\t\tif (elementSelector === windowScrollTarget) {\n\t\t\t\t\t\tif (skipWindowRestore) continue;\n\t\t\t\t\t\tscrollTo({\n\t\t\t\t\t\t\ttop: scrollY,\n\t\t\t\t\t\t\tleft: scrollX,\n\t\t\t\t\t\t\tbehavior\n\t\t\t\t\t\t});\n\t\t\t\t\t\twindowRestored = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst element = getElement(elementSelector);\n\t\t\t\t\t\tif (element) {\n\t\t\t\t\t\t\telement.scrollLeft = scrollX;\n\t\t\t\t\t\t\telement.scrollTop = scrollY;\n\t\t\t\t\t\t\tscrollToTopElements?.delete(element);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!hash) {\n\t\t\t\t\tconst scrollOptions = {\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\tbehavior\n\t\t\t\t\t};\n\t\t\t\t\tif (!windowRestored) scrollTo(scrollOptions);\n\t\t\t\t\tif (scrollToTopElements) for (const element of scrollToTopElements) element.scrollTo(scrollOptions);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!windowRestored && hash && hashScrollIntoViewOptions) document.getElementById(hash)?.scrollIntoView(hashScrollIntoViewOptions);\n\t\t} finally {\n\t\t\tignoreScroll = false;\n\t\t}\n\t});\n}\n//#endregion\nexport { defaultGetScrollRestorationKey, getElementScrollRestorationEntry, setupScrollRestoration, storageKey };\n\n//# sourceMappingURL=scroll-restoration.js.map","//#region src/qss.ts\n/**\n* Program is a reimplementation of the `qss` package:\n* Copyright (c) Luke Edwards luke.edwards05@gmail.com, MIT License\n* https://github.com/lukeed/qss/blob/master/license.md\n*\n* This reimplementation uses modern browser APIs\n* (namely URLSearchParams) and TypeScript while still\n* maintaining the original functionality and interface.\n*\n* Update: this implementation has also been mangled to\n* fit exactly our use-case (single value per key in encoding).\n*/\n/**\n* Encodes an object into a query string.\n* @param obj - The object to encode into a query string.\n* @param stringify - An optional custom stringify function.\n* @returns The encoded query string.\n* @example\n* ```\n* // Example input: encode({ token: 'foo', key: 'value' })\n* // Expected output: \"token=foo&key=value\"\n* ```\n*/\nfunction encode(obj, stringify = String) {\n\tconst result = new URLSearchParams();\n\tfor (const key in obj) {\n\t\tconst val = obj[key];\n\t\tif (val !== void 0) result.set(key, stringify(val));\n\t}\n\treturn result.toString();\n}\n/**\n* Converts a string value to its appropriate type (string, number, boolean).\n* @param mix - The string value to convert.\n* @returns The converted value.\n* @example\n* // Example input: toValue(\"123\")\n* // Expected output: 123\n*/\nfunction toValue(str) {\n\tif (!str) return \"\";\n\tif (str === \"false\") return false;\n\tif (str === \"true\") return true;\n\treturn +str * 0 === 0 && +str + \"\" === str ? +str : str;\n}\n/**\n* Decodes a query string into an object.\n* @param str - The query string to decode.\n* @returns The decoded key-value pairs in an object format.\n* @example\n* // Example input: decode(\"token=foo&key=value\")\n* // Expected output: { \"token\": \"foo\", \"key\": \"value\" }\n*/\nfunction decode(str) {\n\tconst searchParams = new URLSearchParams(str);\n\tconst result = Object.create(null);\n\tfor (const [key, value] of searchParams.entries()) {\n\t\tconst previousValue = result[key];\n\t\tif (previousValue == null) result[key] = toValue(value);\n\t\telse if (Array.isArray(previousValue)) previousValue.push(toValue(value));\n\t\telse result[key] = [previousValue, toValue(value)];\n\t}\n\treturn result;\n}\n//#endregion\nexport { decode, encode };\n\n//# sourceMappingURL=qss.js.map","import { decode, encode } from \"./qss.js\";\n//#region src/searchParams.ts\nconst jsonStart = /^(?:\\s|[\"[{\\d-]|fa|nu|tr)/;\n/** Default `parseSearch` that strips leading '?' and JSON-parses values. */\nconst defaultParseSearch = parseSearchWith(JSON.parse);\n/** Default `stringifySearch` using JSON.stringify for complex values. */\nconst defaultStringifySearch = stringifySearchWith(JSON.stringify, JSON.parse);\n/**\n* Build a `parseSearch` function using a provided JSON-like parser.\n*\n* The returned function strips a leading `?`, decodes values, and attempts to\n* JSON-parse string values using the given `parser`.\n*\n* @param parser Function to parse a string value (e.g. `JSON.parse`).\n* @returns A `parseSearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction parseSearchWith(parser) {\n\treturn (searchStr) => {\n\t\tif (searchStr[0] === \"?\") searchStr = searchStr.substring(1);\n\t\tconst query = decode(searchStr);\n\t\tfor (const key in query) {\n\t\t\tconst value = query[key];\n\t\t\tif (typeof value === \"string\") try {\n\t\t\t\tquery[key] = parser(value);\n\t\t\t} catch (_err) {}\n\t\t}\n\t\treturn query;\n\t};\n}\n/**\n* Build a `stringifySearch` function using a provided serializer.\n*\n* Non-primitive values are serialized with `stringify`. If a `parser` is\n* supplied, string values that are parseable are re-serialized to ensure\n* symmetry with `parseSearch`.\n*\n* @param stringify Function to serialize a value (e.g. `JSON.stringify`).\n* @param parser Optional parser to detect parseable strings.\n* @returns A `stringifySearch` function compatible with `Router` options.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization\n*/\nfunction stringifySearchWith(stringify, parser) {\n\tconst isJsonParser = parser === JSON.parse;\n\tfunction stringifyValue(val) {\n\t\tif (val && typeof val === \"object\") try {\n\t\t\treturn stringify(val);\n\t\t} catch (_err) {}\n\t\telse if (parser && typeof val === \"string\") {\n\t\t\tif (isJsonParser && !jsonStart.test(val)) return val;\n\t\t\ttry {\n\t\t\t\tparser(val);\n\t\t\t\treturn stringify(val);\n\t\t\t} catch (_err) {}\n\t\t}\n\t\treturn val;\n\t}\n\treturn (search) => {\n\t\tconst searchStr = encode(search, stringifyValue);\n\t\treturn searchStr ? `?${searchStr}` : \"\";\n\t};\n}\n//#endregion\nexport { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith };\n\n//# sourceMappingURL=searchParams.js.map","//#region src/root.ts\n/** Stable identifier used for the root route in a route tree. */\nconst rootRouteId = \"__root__\";\n//#endregion\nexport { rootRouteId };\n\n//# sourceMappingURL=root.js.map","//#region src/redirect.ts\n/**\n* Create a redirect Response understood by TanStack Router.\n*\n* Use from route `loader`/`beforeLoad` or server functions to trigger a\n* navigation. If `throw: true` is set, the redirect is thrown instead of\n* returned. When an absolute `href` is supplied and `reloadDocument` is not\n* set, a full-document navigation is inferred.\n*\n* @param opts Options for the redirect. Common fields:\n* - `href`: absolute URL for external redirects; infers `reloadDocument`.\n* - `statusCode`: HTTP status code to use (defaults to 307).\n* - `headers`: additional headers to include on the Response.\n* - Standard navigation options like `to`, `params`, `search`, `replace`,\n* and `reloadDocument` for internal redirects.\n* @returns A Response augmented with router navigation options.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction\n*/\nfunction redirect(opts) {\n\topts.statusCode = opts.statusCode || opts.code || 307;\n\tif (!opts.reloadDocument && typeof opts.href === \"string\") try {\n\t\tnew URL(opts.href);\n\t\topts.reloadDocument = true;\n\t} catch {}\n\tconst headers = new Headers(opts.headers);\n\tif (opts.href && headers.get(\"Location\") === null) headers.set(\"Location\", opts.href);\n\tconst response = new Response(null, {\n\t\tstatus: opts.statusCode,\n\t\theaders\n\t});\n\tresponse.options = opts;\n\tif (opts.throw) throw response;\n\treturn response;\n}\n/** Check whether a value is a TanStack Router redirect Response. */\n/** Check whether a value is a TanStack Router redirect Response. */\nfunction isRedirect(obj) {\n\treturn obj instanceof Response && !!obj.options;\n}\n/** True if value is a redirect with a resolved `href` location. */\n/** True if value is a redirect with a resolved `href` location. */\nfunction isResolvedRedirect(obj) {\n\treturn isRedirect(obj) && !!obj.options.href;\n}\n/** Parse a serialized redirect object back into a redirect Response. */\n/** Parse a serialized redirect object back into a redirect Response. */\nfunction parseRedirect(obj) {\n\tif (obj !== null && typeof obj === \"object\" && obj.isSerializedRedirect) return redirect(obj);\n}\n//#endregion\nexport { isRedirect, isResolvedRedirect, parseRedirect, redirect };\n\n//# sourceMappingURL=redirect.js.map","import { joinPaths, trimPath } from \"./path.js\";\n//#region src/rewrite.ts\n/** Compose multiple rewrite pairs into a single in/out rewrite. */\nfunction composeRewrites(rewrites) {\n\treturn {\n\t\tinput: ({ url }) => {\n\t\t\tfor (const rewrite of rewrites) url = executeRewriteInput(rewrite, url);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\tfor (let i = rewrites.length - 1; i >= 0; i--) url = executeRewriteOutput(rewrites[i], url);\n\t\t\treturn url;\n\t\t}\n\t};\n}\n/** Create a rewrite pair that strips/adds a basepath on input/output. */\nfunction rewriteBasepath(opts) {\n\tconst trimmedBasepath = trimPath(opts.basepath);\n\tconst normalizedBasepath = `/${trimmedBasepath}`;\n\tconst checkBasepath = opts.caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase();\n\tconst checkBasepathWithSlash = `${checkBasepath}/`;\n\treturn {\n\t\tinput: ({ url }) => {\n\t\t\tconst pathname = opts.caseSensitive ? url.pathname : url.pathname.toLowerCase();\n\t\t\tif (pathname === checkBasepath) url.pathname = \"/\";\n\t\t\telse if (pathname.startsWith(checkBasepathWithSlash)) url.pathname = url.pathname.slice(normalizedBasepath.length);\n\t\t\treturn url;\n\t\t},\n\t\toutput: ({ url }) => {\n\t\t\turl.pathname = joinPaths([\n\t\t\t\t\"/\",\n\t\t\t\ttrimmedBasepath,\n\t\t\t\turl.pathname\n\t\t\t]);\n\t\t\treturn url;\n\t\t}\n\t};\n}\n/** Execute a location input rewrite if provided. */\nfunction executeRewriteInput(rewrite, url) {\n\tconst res = rewrite?.input?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n/** Execute a location output rewrite if provided. */\nfunction executeRewriteOutput(rewrite, url) {\n\tconst res = rewrite?.output?.({ url });\n\tif (res) {\n\t\tif (typeof res === \"string\") return new URL(res);\n\t\telse if (res instanceof URL) return res;\n\t}\n\treturn url;\n}\n//#endregion\nexport { composeRewrites, executeRewriteInput, executeRewriteOutput, rewriteBasepath };\n\n//# sourceMappingURL=rewrite.js.map","import { arraysEqual, functionalUpdate } from \"./utils.js\";\n//#region src/stores.ts\n/** SSR non-reactive createMutableStore */\nfunction createNonReactiveMutableStore(initialValue) {\n\tlet value = initialValue;\n\treturn {\n\t\tget() {\n\t\t\treturn value;\n\t\t},\n\t\tset(nextOrUpdater) {\n\t\t\tvalue = functionalUpdate(nextOrUpdater, value);\n\t\t}\n\t};\n}\n/** SSR non-reactive createReadonlyStore */\nfunction createNonReactiveReadonlyStore(read) {\n\treturn { get() {\n\t\treturn read();\n\t} };\n}\nfunction createRouterStores(initialLocation, config) {\n\tconst { createMutableStore, createReadonlyStore, batch } = config;\n\tconst byRoute = /* @__PURE__ */ new Map();\n\tconst status = createMutableStore(\"idle\");\n\tconst location = createMutableStore(initialLocation);\n\tconst resolvedLocation = createMutableStore(void 0);\n\tconst ids = createMutableStore([]);\n\tconst matches = createReadonlyStore(() => ids.get().map((id) => byRoute.get(id).get()));\n\tconst __store = createReadonlyStore(() => ({\n\t\tstatus: status.get(),\n\t\tisLoading: status.get() === \"pending\",\n\t\tmatches: matches.get(),\n\t\tlocation: location.get(),\n\t\tresolvedLocation: resolvedLocation.get()\n\t}));\n\tfunction getMatchStore(routeId) {\n\t\tlet matchStore = byRoute.get(routeId);\n\t\tif (!matchStore) {\n\t\t\tmatchStore = createMutableStore(void 0);\n\t\t\tbyRoute.set(routeId, matchStore);\n\t\t}\n\t\treturn matchStore;\n\t}\n\tconst store = {\n\t\tstatus,\n\t\tlocation,\n\t\tresolvedLocation,\n\t\tids,\n\t\tmatches,\n\t\tbyRoute,\n\t\t__store,\n\t\tgetMatchStore,\n\t\tsetMatches\n\t};\n\tfunction setMatches(nextMatches) {\n\t\tconst previousIds = ids.get();\n\t\tconst nextIds = nextMatches.map((match) => match.routeId);\n\t\tbatch(() => {\n\t\t\tif (!arraysEqual(previousIds, nextIds)) ids.set(nextIds);\n\t\t\tfor (const id of previousIds) if (!nextIds.includes(id)) byRoute.get(id).set(() => void 0);\n\t\t\tfor (const nextMatch of nextMatches) {\n\t\t\t\tconst matchStore = getMatchStore(nextMatch.routeId);\n\t\t\t\tif (matchStore.get() !== nextMatch) matchStore.set(nextMatch);\n\t\t\t}\n\t\t});\n\t}\n\treturn store;\n}\n//#endregion\nexport { createNonReactiveMutableStore, createNonReactiveReadonlyStore, createRouterStores };\n\n//# sourceMappingURL=stores.js.map","//#region src/index.ts\nvar stateIndexKey = \"__TSR_index\";\nvar popStateEvent = \"popstate\";\nvar beforeUnloadEvent = \"beforeunload\";\nfunction createHistory(opts) {\n\tlet location = opts.getLocation();\n\tconst subscribers = /* @__PURE__ */ new Set();\n\tconst notify = (action) => {\n\t\tlocation = opts.getLocation();\n\t\tsubscribers.forEach((subscriber) => subscriber({\n\t\t\tlocation,\n\t\t\taction\n\t\t}));\n\t};\n\tconst handleIndexChange = (action) => {\n\t\tif (opts.notifyOnIndexChange ?? true) notify(action);\n\t\telse location = opts.getLocation();\n\t};\n\tconst tryNavigation = async ({ task, navigateOpts, ...actionInfo }) => {\n\t\tif (navigateOpts?.ignoreBlocker ?? false) {\n\t\t\ttask();\n\t\t\treturn;\n\t\t}\n\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\tconst isPushOrReplace = actionInfo.type === \"PUSH\" || actionInfo.type === \"REPLACE\";\n\t\tif (typeof document !== \"undefined\" && blockers.length && isPushOrReplace) for (const blocker of blockers) {\n\t\t\tconst nextLocation = parseHref(actionInfo.path, actionInfo.state);\n\t\t\tif (await blocker.blockerFn({\n\t\t\t\tcurrentLocation: location,\n\t\t\t\tnextLocation,\n\t\t\t\taction: actionInfo.type\n\t\t\t})) {\n\t\t\t\topts.onBlocked?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\ttask();\n\t};\n\treturn {\n\t\tget location() {\n\t\t\treturn location;\n\t\t},\n\t\tget length() {\n\t\t\treturn opts.getLength();\n\t\t},\n\t\tsubscribers,\n\t\tsubscribe: (cb) => {\n\t\t\tsubscribers.add(cb);\n\t\t\treturn () => {\n\t\t\t\tsubscribers.delete(cb);\n\t\t\t};\n\t\t},\n\t\tpush: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex + 1, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.pushState(path, state);\n\t\t\t\t\tnotify({ type: \"PUSH\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"PUSH\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\treplace: (path, state, navigateOpts) => {\n\t\t\tconst currentIndex = location.state[stateIndexKey];\n\t\t\tstate = assignKeyAndIndex(currentIndex, state);\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.replaceState(path, state);\n\t\t\t\t\tnotify({ type: \"REPLACE\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"REPLACE\",\n\t\t\t\tpath,\n\t\t\t\tstate\n\t\t\t});\n\t\t},\n\t\tgo: (index, navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.go(index);\n\t\t\t\t\thandleIndexChange({\n\t\t\t\t\t\ttype: \"GO\",\n\t\t\t\t\t\tindex\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"GO\"\n\t\t\t});\n\t\t},\n\t\tback: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.back(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"BACK\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"BACK\"\n\t\t\t});\n\t\t},\n\t\tforward: (navigateOpts) => {\n\t\t\ttryNavigation({\n\t\t\t\ttask: () => {\n\t\t\t\t\topts.forward(navigateOpts?.ignoreBlocker ?? false);\n\t\t\t\t\thandleIndexChange({ type: \"FORWARD\" });\n\t\t\t\t},\n\t\t\t\tnavigateOpts,\n\t\t\t\ttype: \"FORWARD\"\n\t\t\t});\n\t\t},\n\t\tcanGoBack: () => location.state[stateIndexKey] !== 0,\n\t\tcreateHref: (str) => opts.createHref(str),\n\t\tblock: (blocker) => {\n\t\t\tif (!opts.setBlockers) return () => {};\n\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\topts.setBlockers([...blockers, blocker]);\n\t\t\treturn () => {\n\t\t\t\tconst blockers = opts.getBlockers?.() ?? [];\n\t\t\t\topts.setBlockers?.(blockers.filter((b) => b !== blocker));\n\t\t\t};\n\t\t},\n\t\tflush: () => opts.flush?.(),\n\t\tdestroy: () => opts.destroy?.(),\n\t\tnotify\n\t};\n}\nfunction assignKeyAndIndex(index, state) {\n\tif (!state) state = {};\n\tconst key = createRandomKey();\n\treturn {\n\t\t...state,\n\t\tkey,\n\t\t__TSR_key: key,\n\t\t[stateIndexKey]: index\n\t};\n}\n/**\n* Creates a history object that can be used to interact with the browser's\n* navigation. This is a lightweight API wrapping the browser's native methods.\n* It is designed to work with TanStack Router, but could be used as a standalone API as well.\n* IMPORTANT: This API implements history throttling via a microtask to prevent\n* excessive calls to the history API. In some browsers, calling history.pushState or\n* history.replaceState in quick succession can cause the browser to ignore subsequent\n* calls. This API smooths out those differences and ensures that your application\n* state will *eventually* match the browser state. In most cases, this is not a problem,\n* but if you need to ensure that the browser state is up to date, you can use the\n* `history.flush` method to immediately flush all pending state changes to the browser URL.\n* @param opts\n* @param opts.getHref A function that returns the current href (path + search + hash)\n* @param opts.createHref A function that takes a path and returns a href (path + search + hash)\n* @returns A history instance\n*/\nfunction createBrowserHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\tconst originalPushState = win.history.pushState;\n\tconst originalReplaceState = win.history.replaceState;\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\tconst createHref = opts?.createHref ?? ((path) => path);\n\tconst parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));\n\tif (!win.history.state?.__TSR_key && !win.history.state?.key) {\n\t\tconst addedKey = createRandomKey();\n\t\twin.history.replaceState({\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey: addedKey,\n\t\t\t__TSR_key: addedKey\n\t\t}, \"\");\n\t}\n\tlet currentLocation = parseLocation();\n\tlet rollbackLocation;\n\tlet nextPopIsGo = false;\n\tlet ignoreNextPop = false;\n\tlet skipBlockerNextPop = false;\n\tlet ignoreNextBeforeUnload = false;\n\tconst getLocation = () => currentLocation;\n\tlet next;\n\tconst flush = () => {\n\t\tif (!next) return;\n\t\thistory._ignoreSubscribers = true;\n\t\t(next[2] ? win.history.pushState : win.history.replaceState)(next[1], \"\", next[0]);\n\t\thistory._ignoreSubscribers = false;\n\t\tnext = void 0;\n\t\trollbackLocation = void 0;\n\t};\n\tconst queueHistoryAction = (isPush, destHref, state) => {\n\t\tconst href = createHref(destHref);\n\t\tconst hasPendingAction = !!next;\n\t\tif (!hasPendingAction) rollbackLocation = currentLocation;\n\t\tcurrentLocation = parseHref(destHref, state);\n\t\tnext = [\n\t\t\thref,\n\t\t\tstate,\n\t\t\tnext?.[2] || isPush\n\t\t];\n\t\tif (!hasPendingAction) queueMicrotask(() => flush());\n\t};\n\tconst onPushPop = (type) => {\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify({ type });\n\t};\n\tconst onPushPopEvent = async () => {\n\t\tif (ignoreNextPop) {\n\t\t\tignoreNextPop = false;\n\t\t\treturn;\n\t\t}\n\t\tconst nextLocation = parseLocation();\n\t\tconst delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];\n\t\tconst isForward = delta === 1;\n\t\tconst isBack = delta === -1;\n\t\tconst isGo = !isForward && !isBack || nextPopIsGo;\n\t\tnextPopIsGo = false;\n\t\tconst action = isGo ? \"GO\" : isBack ? \"BACK\" : \"FORWARD\";\n\t\tconst notify = isGo ? {\n\t\t\ttype: \"GO\",\n\t\t\tindex: delta\n\t\t} : { type: isBack ? \"BACK\" : \"FORWARD\" };\n\t\tif (skipBlockerNextPop) skipBlockerNextPop = false;\n\t\telse {\n\t\t\tconst blockers = _getBlockers();\n\t\t\tif (typeof document !== \"undefined\" && blockers.length) {\n\t\t\t\tfor (const blocker of blockers) if (await blocker.blockerFn({\n\t\t\t\t\tcurrentLocation,\n\t\t\t\t\tnextLocation,\n\t\t\t\t\taction\n\t\t\t\t})) {\n\t\t\t\t\tignoreNextPop = true;\n\t\t\t\t\twin.history.go(1);\n\t\t\t\t\thistory.notify(notify);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcurrentLocation = parseLocation();\n\t\thistory.notify(notify);\n\t};\n\tconst onBeforeUnload = (e) => {\n\t\tif (ignoreNextBeforeUnload) {\n\t\t\tignoreNextBeforeUnload = false;\n\t\t\treturn;\n\t\t}\n\t\tlet shouldBlock = false;\n\t\tconst blockers = _getBlockers();\n\t\tif (typeof document !== \"undefined\" && blockers.length) for (const blocker of blockers) {\n\t\t\tconst shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true;\n\t\t\tif (shouldHaveBeforeUnload === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (typeof shouldHaveBeforeUnload === \"function\" && shouldHaveBeforeUnload() === true) {\n\t\t\t\tshouldBlock = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (shouldBlock) {\n\t\t\te.preventDefault();\n\t\t\treturn e.returnValue = \"\";\n\t\t}\n\t};\n\tconst history = createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => win.history.length,\n\t\tpushState: (href, state) => queueHistoryAction(true, href, state),\n\t\treplaceState: (href, state) => queueHistoryAction(false, href, state),\n\t\tback: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) skipBlockerNextPop = true;\n\t\t\tignoreNextBeforeUnload = true;\n\t\t\treturn win.history.back();\n\t\t},\n\t\tforward: (ignoreBlocker) => {\n\t\t\tif (ignoreBlocker) skipBlockerNextPop = true;\n\t\t\tignoreNextBeforeUnload = true;\n\t\t\twin.history.forward();\n\t\t},\n\t\tgo: (n) => {\n\t\t\tnextPopIsGo = true;\n\t\t\twin.history.go(n);\n\t\t},\n\t\tcreateHref: (href) => createHref(href),\n\t\tflush,\n\t\tdestroy: () => {\n\t\t\twin.history.pushState = originalPushState;\n\t\t\twin.history.replaceState = originalReplaceState;\n\t\t\twin.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\t\t\twin.removeEventListener(popStateEvent, onPushPopEvent);\n\t\t},\n\t\tonBlocked: () => {\n\t\t\tif (rollbackLocation && currentLocation !== rollbackLocation) currentLocation = rollbackLocation;\n\t\t},\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers,\n\t\tnotifyOnIndexChange: false\n\t});\n\twin.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });\n\twin.addEventListener(popStateEvent, onPushPopEvent);\n\twin.history.pushState = function(...args) {\n\t\tconst res = originalPushState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"PUSH\");\n\t\treturn res;\n\t};\n\twin.history.replaceState = function(...args) {\n\t\tconst res = originalReplaceState.apply(win.history, args);\n\t\tif (!history._ignoreSubscribers) onPushPop(\"REPLACE\");\n\t\treturn res;\n\t};\n\treturn history;\n}\n/**\n* Create a hash-based history implementation.\n* Useful for static hosts or environments without server URL rewriting.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createHashHistory(opts) {\n\tconst win = opts?.window ?? (typeof document !== \"undefined\" ? window : void 0);\n\treturn createBrowserHistory({\n\t\twindow: win,\n\t\tparseLocation: () => {\n\t\t\tconst hashSplit = win.location.hash.split(\"#\").slice(1);\n\t\t\tconst pathPart = hashSplit[0] ?? \"/\";\n\t\t\tconst searchPart = win.location.search;\n\t\t\tconst hashEntries = hashSplit.slice(1);\n\t\t\treturn parseHref(`${pathPart}${searchPart}${hashEntries.length === 0 ? \"\" : `#${hashEntries.join(\"#\")}`}`, win.history.state);\n\t\t},\n\t\tcreateHref: (href) => `${win.location.pathname}${win.location.search}#${href}`\n\t});\n}\n/**\n* Create an in-memory history implementation.\n* Ideal for server rendering, tests, and non-DOM environments.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/history-types\n*/\nfunction createMemoryHistory(opts = { initialEntries: [\"/\"] }) {\n\tconst entries = opts.initialEntries;\n\tlet index = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;\n\tconst states = entries.map((_entry, index) => assignKeyAndIndex(index, void 0));\n\tconst getLocation = () => parseHref(entries[index], states[index]);\n\tlet blockers = [];\n\tconst _getBlockers = () => blockers;\n\tconst _setBlockers = (newBlockers) => blockers = newBlockers;\n\treturn createHistory({\n\t\tgetLocation,\n\t\tgetLength: () => entries.length,\n\t\tpushState: (path, state) => {\n\t\t\tif (index < entries.length - 1) {\n\t\t\t\tentries.splice(index + 1);\n\t\t\t\tstates.splice(index + 1);\n\t\t\t}\n\t\t\tstates.push(state);\n\t\t\tentries.push(path);\n\t\t\tindex = Math.max(entries.length - 1, 0);\n\t\t},\n\t\treplaceState: (path, state) => {\n\t\t\tstates[index] = state;\n\t\t\tentries[index] = path;\n\t\t},\n\t\tback: () => {\n\t\t\tindex = Math.max(index - 1, 0);\n\t\t},\n\t\tforward: () => {\n\t\t\tindex = Math.min(index + 1, entries.length - 1);\n\t\t},\n\t\tgo: (n) => {\n\t\t\tindex = Math.min(Math.max(index + n, 0), entries.length - 1);\n\t\t},\n\t\tcreateHref: (path) => path,\n\t\tgetBlockers: _getBlockers,\n\t\tsetBlockers: _setBlockers\n\t});\n}\n/**\n* Sanitize a path to prevent open redirect vulnerabilities.\n* Removes control characters and collapses leading double slashes.\n*/\nfunction sanitizePath(path) {\n\tlet sanitized = path.replace(/[\\x00-\\x1f\\x7f]/g, \"\");\n\tif (sanitized.startsWith(\"//\")) sanitized = \"/\" + sanitized.replace(/^\\/+/, \"\");\n\treturn sanitized;\n}\nfunction parseHref(href, state) {\n\tconst sanitizedHref = sanitizePath(href);\n\tconst hashIndex = sanitizedHref.indexOf(\"#\");\n\tconst searchIndex = sanitizedHref.indexOf(\"?\");\n\tconst addedKey = createRandomKey();\n\treturn {\n\t\thref: sanitizedHref,\n\t\tpathname: sanitizedHref.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length),\n\t\thash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : \"\",\n\t\tsearch: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : \"\",\n\t\tstate: state || {\n\t\t\t[stateIndexKey]: 0,\n\t\t\tkey: addedKey,\n\t\t\t__TSR_key: addedKey\n\t\t}\n\t};\n}\nfunction createRandomKey() {\n\treturn (Math.random() + 1).toString(36).substring(7);\n}\n//#endregion\nexport { createBrowserHistory, createHashHistory, createHistory, createMemoryHistory, parseHref };\n\n//# sourceMappingURL=index.js.map","import { DEFAULT_PROTOCOL_ALLOWLIST, decodePath, deepEqual, encodePathLikeUrl, findLast, functionalUpdate, hasKeys, isDangerousProtocol, last, nullReplaceEqualDeep, replaceEqualDeep } from \"./utils.js\";\nimport { createLRUCache } from \"./lru-cache.js\";\nimport { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, processRouteMasks, processRouteTree } from \"./new-process-route-tree.js\";\nimport { compileDecodeCharMap, interpolatePath, resolvePath, trimPath, trimPathRight } from \"./path.js\";\nimport { isNotFound } from \"./not-found.js\";\nimport { setupScrollRestoration } from \"./scroll-restoration.js\";\nimport { defaultParseSearch, defaultStringifySearch } from \"./searchParams.js\";\nimport { rootRouteId } from \"./root.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { loadClientRoute, loadRouteChunk, preloadClientRoute, refreshClientRoute, replaceRouteChunk } from \"./load-client.js\";\nimport { composeRewrites, executeRewriteInput, executeRewriteOutput, rewriteBasepath } from \"./rewrite.js\";\nimport { createRouterStores } from \"./stores.js\";\nimport { createBrowserHistory, parseHref } from \"@tanstack/history\";\nimport { isServer, loadServerRoute } from \"@tanstack/router-core/isServer\";\n//#region src/router.ts\nfunction routeNeedsLoad(route) {\n\treturn route.options.loader || route.options.beforeLoad || route.lazyFn || route.options.component?.preload || route.options.pendingComponent?.preload;\n}\n/**\n* Convert an unknown error into a minimal, serializable object.\n* Includes name and message (and stack in development).\n*/\nfunction defaultSerializeError(err) {\n\tif (err instanceof Error) {\n\t\tconst obj = {\n\t\t\tname: err.name,\n\t\t\tmessage: err.message\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") obj.stack = err.stack;\n\t\treturn obj;\n\t}\n\treturn { data: err };\n}\n/** Options for configuring trailing-slash behavior. */\nconst trailingSlashOptions = {\n\talways: \"always\",\n\tnever: \"never\",\n\tpreserve: \"preserve\"\n};\n/**\n* Compute whether path, href or hash changed between previous and current\n* resolved locations.\n*/\nfunction getLocationChangeInfo(location, resolvedLocation) {\n\treturn {\n\t\tfromLocation: resolvedLocation,\n\t\ttoLocation: location,\n\t\tpathChanged: resolvedLocation?.pathname !== location.pathname,\n\t\threfChanged: resolvedLocation?.href !== location.href,\n\t\thashChanged: resolvedLocation?.hash !== location.hash\n\t};\n}\n/**\n* Return only state owned by the application, excluding volatile history\n* bookkeeping. Mask payloads (`__tempLocation`/`__tempKey`) are kept: they\n* distinguish otherwise-identical locations.\n*/\nfunction _getUserHistoryState({ key: _key, __TSR_key: _tsrKey, __TSR_index: _tsrIndex, __hashScrollIntoViewOptions: _hashScroll, ...state }) {\n\treturn state;\n}\n/** Run route lifecycle callbacks in leave/enter/stay phases. */\nfunction runRouteLifecycle(router, previous, matches, owner) {\n\tfor (const match of previous) {\n\t\tif (owner && router._tx !== owner) return;\n\t\tif (!matches.some((candidate) => candidate.routeId === match.routeId)) router.routesById[match.routeId].options.onLeave?.(match);\n\t}\n\tfor (const match of matches) {\n\t\tif (owner && router._tx !== owner) return;\n\t\trouter.routesById[match.routeId].options[previous.some((candidate) => candidate.routeId === match.routeId) ? \"onStay\" : \"onEnter\"]?.(match);\n\t}\n}\n/**\n* Core, framework-agnostic router engine that powers TanStack Router.\n*\n* Provides navigation, matching, loading, preloading, caching and event APIs\n* used by framework adapters (React/Solid). Prefer framework helpers like\n* `createRouter` in app code.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType\n*/\nvar RouterCore = class {\n\t/**\n\t* @deprecated Use the `createRouter` function instead\n\t*/\n\tconstructor(options, getStoreConfig) {\n\t\tthis.tempLocationKey = `${Math.round(Math.random() * 1e7)}`;\n\t\tthis._scroll = { next: true };\n\t\tthis.subscribers = /* @__PURE__ */ new Set();\n\t\tthis._cache = /* @__PURE__ */ new Map();\n\t\tthis._committed = [];\n\t\tthis.routeBranchCache = /* @__PURE__ */ new WeakMap();\n\t\tthis.lightweightCache = /* @__PURE__ */ new WeakMap();\n\t\tthis.startTransition = async (fn) => {\n\t\t\tfn();\n\t\t\treturn false;\n\t\t};\n\t\tthis.update = (newOptions) => {\n\t\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\t\tif (newOptions.notFoundRoute) console.warn(\"The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.\");\n\t\t\t}\n\t\t\tconst prevOptions = this.options;\n\t\t\tconst prevBasepath = this.basepath ?? prevOptions?.basepath ?? \"/\";\n\t\t\tconst basepathWasUnset = this.basepath === void 0;\n\t\t\tconst prevRewriteOption = prevOptions?.rewrite;\n\t\t\tthis.options = {\n\t\t\t\t...prevOptions,\n\t\t\t\t...newOptions\n\t\t\t};\n\t\t\tthis.isServer = this.options.isServer ?? isServer ?? typeof document === \"undefined\";\n\t\t\tthis.protocolAllowlist = new Set(this.options.protocolAllowlist);\n\t\t\tif (this.options.pathParamsAllowedCharacters) this.pathParamsDecoder = compileDecodeCharMap(this.options.pathParamsAllowedCharacters);\n\t\t\tif (!this.history || this.options.history && this.options.history !== this.history) if (!this.options.history) {\n\t\t\t\tif (!(isServer ?? this.isServer)) this.history = createBrowserHistory();\n\t\t\t} else this.history = this.options.history;\n\t\t\tthis.origin = this.options.origin;\n\t\t\tif (!this.origin) if (!(isServer ?? this.isServer) && window?.origin && window.origin !== \"null\") this.origin = window.origin;\n\t\t\telse this.origin = \"http://localhost\";\n\t\t\tif (this.history) this.updateLatestLocation();\n\t\t\tif (this.options.routeTree !== this.routeTree) {\n\t\t\t\tthis.routeTree = this.options.routeTree;\n\t\t\t\tlet processRouteTreeResult;\n\t\t\t\tif ((isServer ?? this.isServer) && process.env.NODE_ENV !== \"development\" && globalThis.__TSR_CACHE__ && globalThis.__TSR_CACHE__.routeTree === this.routeTree) {\n\t\t\t\t\tconst cached = globalThis.__TSR_CACHE__;\n\t\t\t\t\tthis.resolvePathCache = cached.resolvePathCache;\n\t\t\t\t\tprocessRouteTreeResult = cached.processRouteTreeResult;\n\t\t\t\t} else {\n\t\t\t\t\tthis.resolvePathCache = createLRUCache(1e3);\n\t\t\t\t\tprocessRouteTreeResult = this.buildRouteTree();\n\t\t\t\t\tif ((isServer ?? this.isServer) && process.env.NODE_ENV !== \"development\" && globalThis.__TSR_CACHE__ === void 0) globalThis.__TSR_CACHE__ = {\n\t\t\t\t\t\trouteTree: this.routeTree,\n\t\t\t\t\t\tprocessRouteTreeResult,\n\t\t\t\t\t\tresolvePathCache: this.resolvePathCache\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tthis.setRoutes(processRouteTreeResult);\n\t\t\t}\n\t\t\tif (!this.stores && this.latestLocation) {\n\t\t\t\tconst config = this.getStoreConfig(this);\n\t\t\t\tthis.batch = config.batch;\n\t\t\t\tthis.stores = createRouterStores(this.latestLocation, config);\n\t\t\t\tif (!(isServer ?? this.isServer)) setupScrollRestoration(this);\n\t\t\t}\n\t\t\tconst nextBasepath = this.options.basepath ?? \"/\";\n\t\t\tconst nextRewriteOption = this.options.rewrite;\n\t\t\tif (basepathWasUnset || prevBasepath !== nextBasepath || prevRewriteOption !== nextRewriteOption) {\n\t\t\t\tthis.basepath = nextBasepath;\n\t\t\t\tconst rewrites = [];\n\t\t\t\tconst trimmed = trimPath(nextBasepath);\n\t\t\t\tif (trimmed && trimmed !== \"/\") rewrites.push(rewriteBasepath({ basepath: nextBasepath }));\n\t\t\t\tif (nextRewriteOption) rewrites.push(nextRewriteOption);\n\t\t\t\tthis.rewrite = rewrites.length === 0 ? void 0 : rewrites.length === 1 ? rewrites[0] : composeRewrites(rewrites);\n\t\t\t\tif (this.history) this.updateLatestLocation();\n\t\t\t\tif (this.stores) this.stores.location.set(this.latestLocation);\n\t\t\t}\n\t\t};\n\t\tthis.updateLatestLocation = () => {\n\t\t\tthis.latestLocation = this.parseLocation(this.history.location, this.latestLocation);\n\t\t};\n\t\tthis.buildRouteTree = () => {\n\t\t\tconst result = processRouteTree(this.routeTree, this.options.caseSensitive, (route, i) => {\n\t\t\t\troute.init({ originalIndex: i });\n\t\t\t});\n\t\t\tif (this.options.routeMasks) processRouteMasks(this.options.routeMasks, result.processedTree);\n\t\t\treturn result;\n\t\t};\n\t\tthis.subscribe = (eventType, fn) => {\n\t\t\tconst listener = {\n\t\t\t\teventType,\n\t\t\t\tfn\n\t\t\t};\n\t\t\tthis.subscribers.add(listener);\n\t\t\treturn () => {\n\t\t\t\tthis.subscribers.delete(listener);\n\t\t\t};\n\t\t};\n\t\tthis.emit = (routerEvent) => {\n\t\t\tfor (const listener of this.subscribers) if (listener.eventType === routerEvent.type) try {\n\t\t\t\tlistener.fn(routerEvent);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t};\n\t\tthis.parseLocation = (locationToParse, previousLocation) => {\n\t\t\tconst parse = ({ pathname, search, hash, href, state }) => {\n\t\t\t\tif (!this.rewrite && !/[ \\x00-\\x1f\\x7f\\u0080-\\uffff]/.test(pathname)) {\n\t\t\t\t\tconst parsedSearch = this.options.parseSearch(search);\n\t\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\t\treturn {\n\t\t\t\t\t\thref: pathname + searchStr + hash,\n\t\t\t\t\t\tpublicHref: pathname + searchStr + hash,\n\t\t\t\t\t\tpathname: decodePath(pathname).path,\n\t\t\t\t\t\texternal: false,\n\t\t\t\t\t\tsearchStr,\n\t\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\t\thash: decodePath(hash.slice(1)).path,\n\t\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst fullUrl = new URL(href, this.origin);\n\t\t\t\tconst url = executeRewriteInput(this.rewrite, fullUrl);\n\t\t\t\tconst parsedSearch = this.options.parseSearch(url.search);\n\t\t\t\tconst searchStr = this.options.stringifySearch(parsedSearch);\n\t\t\t\turl.search = searchStr;\n\t\t\t\treturn {\n\t\t\t\t\thref: url.href.replace(url.origin, \"\"),\n\t\t\t\t\tpublicHref: href,\n\t\t\t\t\tpathname: decodePath(url.pathname).path,\n\t\t\t\t\texternal: !!this.rewrite && url.origin !== this.origin,\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tsearch: nullReplaceEqualDeep(previousLocation?.search, parsedSearch),\n\t\t\t\t\thash: decodePath(url.hash.slice(1)).path,\n\t\t\t\t\tstate: replaceEqualDeep(previousLocation?.state, state)\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst location = parse(locationToParse);\n\t\t\tconst { __tempLocation, __tempKey } = location.state;\n\t\t\tif (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {\n\t\t\t\tconst parsedTempLocation = parse(__tempLocation);\n\t\t\t\tparsedTempLocation.state.key = location.state.key;\n\t\t\t\tparsedTempLocation.state.__TSR_key = location.state.__TSR_key;\n\t\t\t\tdelete parsedTempLocation.state.__tempLocation;\n\t\t\t\treturn {\n\t\t\t\t\t...parsedTempLocation,\n\t\t\t\t\tmaskedLocation: location\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn location;\n\t\t};\n\t\tthis.resolvePathWithBase = (from, path) => {\n\t\t\treturn resolvePath({\n\t\t\t\tbase: from,\n\t\t\t\tto: path,\n\t\t\t\ttrailingSlash: this.options.trailingSlash,\n\t\t\t\tcache: this.resolvePathCache\n\t\t\t});\n\t\t};\n\t\tthis.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => {\n\t\t\tif (typeof pathnameOrNext === \"string\") return this.matchRoutesInternal({\n\t\t\t\tpathname: pathnameOrNext,\n\t\t\t\tsearch: locationSearchOrOpts\n\t\t\t}, opts);\n\t\t\treturn this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts);\n\t\t};\n\t\tthis.getMatchedRoutes = (pathname) => {\n\t\t\tconst rawParams = Object.create(null);\n\t\t\tconst match = findRouteMatch(trimPathRight(pathname), this.processedTree, true);\n\t\t\tif (match) Object.assign(rawParams, match.rawParams);\n\t\t\treturn [\n\t\t\t\tmatch?.branch || [this.routesById[\"__root__\"]],\n\t\t\t\trawParams,\n\t\t\t\tmatch?.route\n\t\t\t];\n\t\t};\n\t\tthis.buildLocation = (opts) => {\n\t\t\tconst build = (dest = {}) => {\n\t\t\t\tif (dest.href) {\n\t\t\t\t\tconst parsed = parseHref(dest.href, {});\n\t\t\t\t\tdest = {\n\t\t\t\t\t\t...dest,\n\t\t\t\t\t\tto: executeRewriteInput(this.rewrite, new URL(parsed.pathname, this.origin)).pathname,\n\t\t\t\t\t\tsearch: this.options.parseSearch(parsed.search),\n\t\t\t\t\t\thash: parsed.hash.slice(1)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst currentLocation = dest._fromLocation || this._pendingLocation || this.latestLocation;\n\t\t\t\tconst lightweightResult = this.matchRoutesLightweight(currentLocation);\n\t\t\t\tif (dest.from && process.env.NODE_ENV !== \"production\" && dest._isNavigate) {\n\t\t\t\t\tconst [allFromMatches] = this.getMatchedRoutes(dest.from);\n\t\t\t\t\tconst matchedFrom = findLast(lightweightResult[0], (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, dest.from);\n\t\t\t\t\t});\n\t\t\t\t\tconst matchedCurrent = findLast(allFromMatches, (d) => {\n\t\t\t\t\t\treturn comparePaths(d.fullPath, lightweightResult[1]);\n\t\t\t\t\t});\n\t\t\t\t\tif (!matchedFrom && !matchedCurrent) console.warn(`Could not find match for from: ${dest.from}`);\n\t\t\t\t}\n\t\t\t\tconst defaultedFromPath = dest.unsafeRelative === \"path\" ? currentLocation.pathname : dest.from ?? lightweightResult[1];\n\t\t\t\tconst fromSearch = lightweightResult[2];\n\t\t\t\tconst fromParams = lightweightResult[3];\n\t\t\t\tconst nextTo = this.resolvePathWithBase(defaultedFromPath, dest.to ? `${dest.to}` : \".\");\n\t\t\t\tlet nextParams = resolveNextParams(dest.params, fromParams);\n\t\t\t\tconst destRoute = this.routesByPath[trimPathRight(nextTo)];\n\t\t\t\tlet destRoutes;\n\t\t\t\tif (destRoute) destRoutes = this.getRouteBranch(destRoute);\n\t\t\t\telse if (nextTo.includes(\"$\")) destRoutes = [];\n\t\t\t\telse {\n\t\t\t\t\tconst [matchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(nextTo);\n\t\t\t\t\tdestRoutes = matchedRoutes;\n\t\t\t\t\tif (this.options.notFoundRoute && (!foundRoute || foundRoute.path !== \"/\" && rawParams[\"**\"])) destRoutes = [...destRoutes, this.options.notFoundRoute];\n\t\t\t\t}\n\t\t\t\tif (destRoutes.length && hasKeys(nextParams)) for (const route of destRoutes) {\n\t\t\t\t\tconst fn = route.options.params?.stringify ?? route.options.stringifyParams;\n\t\t\t\t\tif (fn) {\n\t\t\t\t\t\tif (nextParams === fromParams) nextParams = Object.assign(Object.create(null), nextParams);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tObject.assign(nextParams, fn(nextParams));\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst nextPathname = opts.leaveParams ? nextTo : decodePath(interpolatePath({\n\t\t\t\t\tpath: nextTo,\n\t\t\t\t\tparams: nextParams,\n\t\t\t\t\tdecoder: this.pathParamsDecoder,\n\t\t\t\t\tserver: this.isServer\n\t\t\t\t}).interpolatedPath).path;\n\t\t\t\tif (process.env.NODE_ENV !== \"production\" && destRoute && !opts.leaveParams) try {\n\t\t\t\t\tconst foundRoute = this.getMatchedRoutes(nextPathname)[2];\n\t\t\t\t\tif (foundRoute?.id !== destRoute.id) console.warn(`Generated path \"${nextPathname}\" for route \"${destRoute.id}\" matched route \"${foundRoute?.id}\" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`);\n\t\t\t\t} catch {}\n\t\t\t\tlet nextSearch = fromSearch;\n\t\t\t\tif (opts._includeValidateSearch && this.options.search?.strict) {\n\t\t\t\t\tconst validatedSearch = {};\n\t\t\t\t\tdestRoutes.forEach((route) => {\n\t\t\t\t\t\tif (route.options.validateSearch) try {\n\t\t\t\t\t\t\tObject.assign(validatedSearch, validateSearch(route.options.validateSearch, {\n\t\t\t\t\t\t\t\t...validatedSearch,\n\t\t\t\t\t\t\t\t...nextSearch\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t});\n\t\t\t\t\tnextSearch = validatedSearch;\n\t\t\t\t}\n\t\t\t\tnextSearch = applySearchMiddleware(nextSearch, dest, destRoutes, opts._includeValidateSearch);\n\t\t\t\tnextSearch = nullReplaceEqualDeep(fromSearch, nextSearch);\n\t\t\t\tconst searchStr = this.options.stringifySearch(nextSearch);\n\t\t\t\tconst hash = dest.hash === true ? currentLocation.hash : dest.hash ? functionalUpdate(dest.hash, currentLocation.hash) : void 0;\n\t\t\t\tconst hashStr = hash ? `#${hash}` : \"\";\n\t\t\t\tlet nextState = dest.state === true ? currentLocation.state : dest.state ? functionalUpdate(dest.state, currentLocation.state) : {};\n\t\t\t\tif (dest.state) nextState = replaceEqualDeep(currentLocation.state, nextState);\n\t\t\t\tconst fullPath = `${nextPathname}${searchStr}${hashStr}`;\n\t\t\t\tlet href;\n\t\t\t\tlet publicHref;\n\t\t\t\tlet external = false;\n\t\t\t\tif (this.rewrite) {\n\t\t\t\t\tconst url = new URL(fullPath, this.origin);\n\t\t\t\t\tconst rewrittenUrl = executeRewriteOutput(this.rewrite, url);\n\t\t\t\t\thref = url.href.replace(url.origin, \"\");\n\t\t\t\t\tif (rewrittenUrl.origin !== this.origin) {\n\t\t\t\t\t\tpublicHref = rewrittenUrl.href;\n\t\t\t\t\t\texternal = true;\n\t\t\t\t\t} else publicHref = rewrittenUrl.pathname + rewrittenUrl.search + rewrittenUrl.hash;\n\t\t\t\t} else {\n\t\t\t\t\thref = encodePathLikeUrl(fullPath);\n\t\t\t\t\tpublicHref = href;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tpublicHref,\n\t\t\t\t\thref,\n\t\t\t\t\tpathname: nextPathname,\n\t\t\t\t\tsearch: nextSearch,\n\t\t\t\t\tsearchStr,\n\t\t\t\t\tstate: nextState,\n\t\t\t\t\thash: hash ?? \"\",\n\t\t\t\t\texternal,\n\t\t\t\t\tunmaskOnReload: dest.unmaskOnReload\n\t\t\t\t};\n\t\t\t};\n\t\t\tconst next = build(opts);\n\t\t\tif (opts.mask) next.maskedLocation = build({\n\t\t\t\tfrom: opts.from,\n\t\t\t\t...opts.mask\n\t\t\t});\n\t\t\telse if (this.options.routeMasks) {\n\t\t\t\tconst match = findFlatMatch(next.pathname, this.processedTree);\n\t\t\t\tif (match) {\n\t\t\t\t\tconst params = Object.assign(Object.create(null), match.rawParams);\n\t\t\t\t\tconst { from: _from, params: maskParams, ...maskProps } = match.route;\n\t\t\t\t\tconst nextParams = resolveNextParams(maskParams, params);\n\t\t\t\t\tnext.maskedLocation = build({\n\t\t\t\t\t\tfrom: opts.from,\n\t\t\t\t\t\t...maskProps,\n\t\t\t\t\t\tparams: nextParams\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn next;\n\t\t};\n\t\tthis.commitLocation = async ({ viewTransition, ignoreBlocker, ...next }) => {\n\t\t\tlet historyAction;\n\t\t\tconst isSameLocation = trimPathRight(this.latestLocation.href) === trimPathRight(next.href) && deepEqual(_getUserHistoryState(next.state), _getUserHistoryState(this.latestLocation.state));\n\t\t\tconst previousCommitPromise = this._commitPromise;\n\t\t\tlet resolve;\n\t\t\tconst commitPromise = new Promise((done) => {\n\t\t\t\tresolve = done;\n\t\t\t});\n\t\t\tcommitPromise.resolve = () => {\n\t\t\t\tresolve();\n\t\t\t\tpreviousCommitPromise?.resolve();\n\t\t\t};\n\t\t\tthis._commitPromise = commitPromise;\n\t\t\tif (isSameLocation) this.load();\n\t\t\telse {\n\t\t\t\tlet { maskedLocation, hashScrollIntoView, ...nextHistory } = next;\n\t\t\t\tif (maskedLocation) {\n\t\t\t\t\tnextHistory = {\n\t\t\t\t\t\t...maskedLocation,\n\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t...maskedLocation.state,\n\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t__tempLocation: {\n\t\t\t\t\t\t\t\t...nextHistory,\n\t\t\t\t\t\t\t\tsearch: nextHistory.searchStr,\n\t\t\t\t\t\t\t\tstate: {\n\t\t\t\t\t\t\t\t\t...nextHistory.state,\n\t\t\t\t\t\t\t\t\t__tempKey: void 0,\n\t\t\t\t\t\t\t\t\t__tempLocation: void 0,\n\t\t\t\t\t\t\t\t\t__TSR_key: void 0,\n\t\t\t\t\t\t\t\t\tkey: void 0\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tif (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) nextHistory.state.__tempKey = this.tempLocationKey;\n\t\t\t\t}\n\t\t\t\tnextHistory.state.__hashScrollIntoViewOptions = hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true;\n\t\t\t\tthis.shouldViewTransition = viewTransition;\n\t\t\t\thistoryAction = next.replace ? \"REPLACE\" : \"PUSH\";\n\t\t\t\tthis.history[historyAction === \"REPLACE\" ? \"replace\" : \"push\"](nextHistory.publicHref, nextHistory.state, { ignoreBlocker });\n\t\t\t\tif (!this.history.subscribers.size) this.load({ action: { type: historyAction } });\n\t\t\t}\n\t\t\tthis._scroll.next = next.resetScroll ?? true;\n\t\t\treturn this._commitPromise;\n\t\t};\n\t\tthis.buildAndCommitLocation = ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, ...rest } = {}) => {\n\t\t\tconst location = this.buildLocation({\n\t\t\t\t...rest,\n\t\t\t\t_includeValidateSearch: true\n\t\t\t});\n\t\t\tthis._pendingLocation = location;\n\t\t\tconst commitPromise = this.commitLocation({\n\t\t\t\t...location,\n\t\t\t\tviewTransition,\n\t\t\t\treplace,\n\t\t\t\tresetScroll,\n\t\t\t\thashScrollIntoView,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (this._pendingLocation === location) this._pendingLocation = void 0;\n\t\t\t});\n\t\t\treturn commitPromise;\n\t\t};\n\t\tthis.navigate = async ({ to, reloadDocument, href, publicHref, ...rest }) => {\n\t\t\tlet hrefIsUrl = false;\n\t\t\tif (href) try {\n\t\t\t\tnew URL(`${href}`);\n\t\t\t\threfIsUrl = true;\n\t\t\t} catch {}\n\t\t\tif (hrefIsUrl && !reloadDocument) reloadDocument = true;\n\t\t\tif (reloadDocument) {\n\t\t\t\tif (to !== void 0 || !href) {\n\t\t\t\t\tconst location = this.buildLocation({\n\t\t\t\t\t\tto,\n\t\t\t\t\t\t...rest\n\t\t\t\t\t});\n\t\t\t\t\thref = href ?? location.publicHref;\n\t\t\t\t\tpublicHref = publicHref ?? location.publicHref;\n\t\t\t\t}\n\t\t\t\tconst reloadHref = !hrefIsUrl && publicHref ? publicHref : href;\n\t\t\t\tif (isDangerousProtocol(reloadHref, this.protocolAllowlist)) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked navigation to dangerous protocol: ${reloadHref}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!rest.ignoreBlocker) {\n\t\t\t\t\tconst blockers = this.history.getBlockers?.() ?? [];\n\t\t\t\t\tfor (const blocker of blockers) if (blocker?.blockerFn) {\n\t\t\t\t\t\tif (await blocker.blockerFn({\n\t\t\t\t\t\t\tcurrentLocation: this.latestLocation,\n\t\t\t\t\t\t\tnextLocation: this.latestLocation,\n\t\t\t\t\t\t\taction: \"PUSH\"\n\t\t\t\t\t\t})) return;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (rest.replace) window.location.replace(reloadHref);\n\t\t\t\telse window.location.href = reloadHref;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn this.buildAndCommitLocation({\n\t\t\t\t...rest,\n\t\t\t\thref,\n\t\t\t\tto,\n\t\t\t\t_isNavigate: true\n\t\t\t});\n\t\t};\n\t\tthis.load = async (opts) => {\n\t\t\tif (isServer ?? this.isServer) return loadServerRoute(this, opts);\n\t\t\tthis.updateLatestLocation();\n\t\t\tif (opts?.action) this._scroll.hash = opts.action.type === \"PUSH\" || opts.action.type === \"REPLACE\";\n\t\t\tawait loadClientRoute(this, opts);\n\t\t};\n\t\tthis.startViewTransition = (fn) => {\n\t\t\tconst shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition;\n\t\t\tthis.shouldViewTransition = void 0;\n\t\t\tif (shouldViewTransition && !(isServer ?? typeof document === \"undefined\") && typeof document.startViewTransition === \"function\") {\n\t\t\t\tlet startViewTransitionParams;\n\t\t\t\tif (typeof shouldViewTransition === \"object\" && window.CSS?.supports?.(\"selector(:active-view-transition-type(a))\")) {\n\t\t\t\t\tconst next = this.latestLocation;\n\t\t\t\t\tconst prevLocation = this.stores.resolvedLocation.get();\n\t\t\t\t\tconst resolvedViewTransitionTypes = typeof shouldViewTransition.types === \"function\" ? shouldViewTransition.types(getLocationChangeInfo(next, prevLocation)) : shouldViewTransition.types;\n\t\t\t\t\tif (resolvedViewTransitionTypes === false) return fn();\n\t\t\t\t\tstartViewTransitionParams = {\n\t\t\t\t\t\tupdate: fn,\n\t\t\t\t\t\ttypes: resolvedViewTransitionTypes\n\t\t\t\t\t};\n\t\t\t\t} else startViewTransitionParams = fn;\n\t\t\t\treturn document.startViewTransition(startViewTransitionParams).updateCallbackDone;\n\t\t\t}\n\t\t\treturn fn();\n\t\t};\n\t\tthis.invalidate = (opts) => {\n\t\t\tconst committedMatches = this._committed;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst invalidIds = new Set([\n\t\t\t\t...committedMatches,\n\t\t\t\t...this._cache.values(),\n\t\t\t\t...[...preloads?.values() ?? []].flat(),\n\t\t\t\t...this._tx?.[3] ?? []\n\t\t\t].filter((match) => !filter || filter(match)).map((match) => match.id));\n\t\t\tconst discardedPreloads = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (matches.some((match) => invalidIds.has(match.id))) {\n\t\t\t\tpreloads.delete(controller);\n\t\t\t\tdiscardedPreloads.push(controller);\n\t\t\t}\n\t\t\tconst invalidate = (d) => {\n\t\t\t\tif (invalidIds.has(d.id)) {\n\t\t\t\t\tconst route = this.routesById[d.routeId];\n\t\t\t\t\tconst next = {\n\t\t\t\t\t\t...d,\n\t\t\t\t\t\tinvalid: true,\n\t\t\t\t\t\t...(opts?.forcePending || d.status === \"error\" || d.status === \"notFound\") && routeNeedsLoad(route) ? {\n\t\t\t\t\t\t\tstatus: \"pending\",\n\t\t\t\t\t\t\terror: void 0\n\t\t\t\t\t\t} : void 0\n\t\t\t\t\t};\n\t\t\t\t\td._flight = void 0;\n\t\t\t\t\treturn next;\n\t\t\t\t}\n\t\t\t\treturn d;\n\t\t\t};\n\t\t\tthis._committed = committedMatches.map(invalidate);\n\t\t\tfor (const [id, match] of this._cache) if (invalidIds.has(id)) {\n\t\t\t\tmatch.invalid = true;\n\t\t\t\tif (opts?.forcePending) match.status = \"pending\";\n\t\t\t}\n\t\t\tfor (const id of invalidIds) this._flights?.delete(id);\n\t\t\tfor (const controller of discardedPreloads) controller.abort();\n\t\t\tthis.shouldViewTransition = false;\n\t\t\treturn this.load({ sync: opts?.sync });\n\t\t};\n\t\tthis.resolveRedirect = (redirect) => {\n\t\t\tconst locationHeader = redirect.headers.get(\"Location\");\n\t\t\tif (!redirect.options.href) {\n\t\t\t\tconst href = this.buildLocation(redirect.options).publicHref || \"/\";\n\t\t\t\tredirect.options.href = href;\n\t\t\t\tredirect.headers.set(\"Location\", href);\n\t\t\t} else if (locationHeader) try {\n\t\t\t\tconst url = new URL(locationHeader);\n\t\t\t\tif (this.origin && url.origin === this.origin) {\n\t\t\t\t\tconst href = url.pathname + url.search + url.hash;\n\t\t\t\t\tredirect.options.href = href;\n\t\t\t\t\tredirect.headers.set(\"Location\", href);\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t\tif (redirect.options.href && isDangerousProtocol(redirect.options.href, this.protocolAllowlist)) throw new Error(process.env.NODE_ENV !== \"production\" ? `Redirect blocked: unsafe protocol in href \"${redirect.options.href}\". Allowed protocols: ${Array.from(this.protocolAllowlist).join(\", \")}.` : \"Redirect blocked: unsafe protocol\");\n\t\t\tif (!redirect.headers.get(\"Location\")) redirect.headers.set(\"Location\", redirect.options.href);\n\t\t\treturn redirect;\n\t\t};\n\t\tthis.clearCache = (opts) => {\n\t\t\tconst cached = this._cache;\n\t\t\tconst preloads = this._preloads;\n\t\t\tconst filter = opts?.filter;\n\t\t\tconst discarded = [];\n\t\t\tconst discardedIds = [];\n\t\t\tfor (const [id, match] of cached) if (!filter || filter(match)) {\n\t\t\t\tdiscardedIds.push(id);\n\t\t\t\tdiscarded.push(match);\n\t\t\t}\n\t\t\tconst abort = [];\n\t\t\tfor (const [controller, matches] of preloads ?? []) if (!filter || matches.some(filter)) {\n\t\t\t\tabort.push(controller);\n\t\t\t\tdiscarded.push(...matches);\n\t\t\t}\n\t\t\tfor (const id of discardedIds) cached.delete(id);\n\t\t\tfor (const controller of abort) preloads.delete(controller);\n\t\t\tfor (const match of discarded) {\n\t\t\t\tconst flight = match._flight;\n\t\t\t\tmatch._flight = void 0;\n\t\t\t\tif (flight && !--flight[2]) {\n\t\t\t\t\tif (this._flights?.get(match.id) === flight) this._flights.delete(match.id);\n\t\t\t\t\tabort.push(flight[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t};\n\t\tthis.loadRouteChunk = loadRouteChunk;\n\t\tthis.preloadRoute = (opts, builtLocation) => preloadClientRoute(this, opts, 0, builtLocation);\n\t\tthis.matchRoute = (location, opts) => {\n\t\t\tconst matchLocation = {\n\t\t\t\t...location,\n\t\t\t\tto: location.to ? this.resolvePathWithBase(location.from || \"\", location.to) : void 0,\n\t\t\t\tparams: location.params || {},\n\t\t\t\tleaveParams: true\n\t\t\t};\n\t\t\tconst next = this.buildLocation(matchLocation);\n\t\t\tconst isPending = this.stores.status.get() === \"pending\";\n\t\t\tif (opts?.pending && !isPending) return false;\n\t\t\tconst baseLocation = opts?.pending ?? !isPending ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get();\n\t\t\tconst match = findSingleMatch(next.pathname, opts?.caseSensitive ?? false, opts?.fuzzy ?? false, baseLocation.pathname, this.processedTree);\n\t\t\tif (!match) return false;\n\t\t\tif (location.params) {\n\t\t\t\tif (!deepEqual(match.rawParams, location.params, { partial: true })) return false;\n\t\t\t}\n\t\t\tif (opts?.includeSearch ?? true) return deepEqual(baseLocation.search, next.search, { partial: true }) ? match.rawParams : false;\n\t\t\treturn match.rawParams;\n\t\t};\n\t\tthis.getStoreConfig = getStoreConfig;\n\t\tthis.update({\n\t\t\tdefaultPreloadDelay: 50,\n\t\t\tdefaultPendingMs: 1e3,\n\t\t\tdefaultPendingMinMs: 500,\n\t\t\tcontext: void 0,\n\t\t\t...options,\n\t\t\tcaseSensitive: options.caseSensitive ?? false,\n\t\t\tnotFoundMode: options.notFoundMode ?? \"fuzzy\",\n\t\t\tstringifySearch: options.stringifySearch ?? defaultStringifySearch,\n\t\t\tparseSearch: options.parseSearch ?? defaultParseSearch,\n\t\t\tprotocolAllowlist: options.protocolAllowlist ?? DEFAULT_PROTOCOL_ALLOWLIST\n\t\t});\n\t\tif (!(isServer ?? typeof document === \"undefined\")) self.__TSR_ROUTER__ = this;\n\t}\n\tisShell() {\n\t\treturn !!this.options.isShell;\n\t}\n\tget state() {\n\t\treturn this.stores.__store.get();\n\t}\n\tsetRoutes({ routesById, routesByPath, processedTree }) {\n\t\tthis.routesById = routesById;\n\t\tthis.routesByPath = routesByPath;\n\t\tthis.processedTree = processedTree;\n\t\tconst notFoundRoute = this.options.notFoundRoute;\n\t\tif (notFoundRoute) {\n\t\t\tnotFoundRoute.init({ originalIndex: 99999999999 });\n\t\t\tthis.routesById[notFoundRoute.id] = notFoundRoute;\n\t\t}\n\t}\n\tgetRouteBranch(route) {\n\t\tlet branch = this.routeBranchCache.get(route);\n\t\tif (!branch) {\n\t\t\tbranch = buildRouteBranch(route);\n\t\t\tthis.routeBranchCache.set(route, branch);\n\t\t}\n\t\treturn branch;\n\t}\n\tmatchRoutesInternal(next, opts) {\n\t\tconst [initialMatchedRoutes, rawParams, foundRoute] = this.getMatchedRoutes(next.pathname);\n\t\tlet matchedRoutes = initialMatchedRoutes;\n\t\tlet isGlobalNotFound = false;\n\t\tif (foundRoute ? foundRoute.path !== \"/\" && rawParams[\"**\"] : trimPathRight(next.pathname)) if (this.options.notFoundRoute) matchedRoutes = [...matchedRoutes, this.options.notFoundRoute];\n\t\telse isGlobalNotFound = true;\n\t\tconst _notFoundRouteId = isGlobalNotFound ? findGlobalNotFoundRouteId(this.options.notFoundMode, matchedRoutes) : void 0;\n\t\tconst matches = new Array(matchedRoutes.length);\n\t\tconst committed = this._committed;\n\t\tconst previousAt = (route, index) => {\n\t\t\tconst match = committed[index];\n\t\t\treturn match?.routeId === route.id ? match : route === this.options.notFoundRoute ? committed.find((candidate) => candidate.routeId === route.id) : void 0;\n\t\t};\n\t\tlet strictParams;\n\t\tfor (let index = 0; index < matchedRoutes.length; index++) {\n\t\t\tconst route = matchedRoutes[index];\n\t\t\tconst parentMatch = matches[index - 1];\n\t\t\tlet preMatchSearch;\n\t\t\tlet strictMatchSearch;\n\t\t\tlet searchError;\n\t\t\t{\n\t\t\t\tconst parentSearch = parentMatch?.search ?? next.search;\n\t\t\t\tconst parentStrictSearch = parentMatch?._strictSearch ?? void 0;\n\t\t\t\ttry {\n\t\t\t\t\tconst strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? void 0;\n\t\t\t\t\tpreMatchSearch = {\n\t\t\t\t\t\t...parentSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t\tstrictMatchSearch = {\n\t\t\t\t\t\t...parentStrictSearch,\n\t\t\t\t\t\t...strictSearch\n\t\t\t\t\t};\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlet searchParamError = err;\n\t\t\t\t\tif (!(err instanceof SearchParamError)) searchParamError = new SearchParamError(err.message, { cause: err });\n\t\t\t\t\tif (opts?.throwOnError) throw searchParamError;\n\t\t\t\t\tpreMatchSearch = parentSearch;\n\t\t\t\t\tstrictMatchSearch = {};\n\t\t\t\t\tsearchError = searchParamError;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet loaderDeps = \"\";\n\t\t\tlet loaderDepsHash = \"\";\n\t\t\ttry {\n\t\t\t\tloaderDeps = route.options.loaderDeps?.({ search: preMatchSearch }) ?? \"\";\n\t\t\t\tloaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) || \"\" : \"\";\n\t\t\t} catch (cause) {\n\t\t\t\tif (opts?.throwOnError) throw cause;\n\t\t\t\tsearchError ??= cause;\n\t\t\t}\n\t\t\tconst { interpolatedPath, usedParams } = interpolatePath({\n\t\t\t\tpath: route.fullPath,\n\t\t\t\tparams: rawParams,\n\t\t\t\tdecoder: this.pathParamsDecoder,\n\t\t\t\tserver: this.isServer\n\t\t\t});\n\t\t\tconst matchId = route.id + interpolatedPath + loaderDepsHash;\n\t\t\tconst previousMatch = previousAt(route, index);\n\t\t\tconst existingMatch = process.env.NODE_ENV !== \"production\" && opts?._rematerialize ? void 0 : this._cache.get(matchId) ?? (previousMatch?.id === matchId ? previousMatch : void 0);\n\t\t\tstrictParams = existingMatch?._strictParams ?? Object.assign(usedParams, strictParams);\n\t\t\tlet paramsError;\n\t\t\tif (!existingMatch) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch (err) {\n\t\t\t\tif (isNotFound(err) || isRedirect(err)) paramsError = err;\n\t\t\t\telse paramsError = new PathParamError(err.message, { cause: err });\n\t\t\t\tif (opts?.throwOnError) throw paramsError;\n\t\t\t}\n\t\t\tconst cause = previousMatch ? \"stay\" : \"enter\";\n\t\t\tlet match;\n\t\t\tif (existingMatch) match = {\n\t\t\t\t...existingMatch,\n\t\t\t\tcause,\n\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : nullReplaceEqualDeep(existingMatch.search, preMatchSearch),\n\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\tsearchError\n\t\t\t};\n\t\t\telse {\n\t\t\t\tconst status = routeNeedsLoad(route) ? \"pending\" : \"success\";\n\t\t\t\tmatch = {\n\t\t\t\t\tid: matchId,\n\t\t\t\t\tssr: isServer ?? this.isServer ? void 0 : route.options.ssr,\n\t\t\t\t\tindex,\n\t\t\t\t\trouteId: route.id,\n\t\t\t\t\tparams: previousMatch?.params ?? strictParams,\n\t\t\t\t\t_strictParams: strictParams,\n\t\t\t\t\tpathname: interpolatedPath,\n\t\t\t\t\tupdatedAt: Date.now(),\n\t\t\t\t\tsearch: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch,\n\t\t\t\t\t_strictSearch: strictMatchSearch,\n\t\t\t\t\tsearchError,\n\t\t\t\t\tstatus,\n\t\t\t\t\tisFetching: false,\n\t\t\t\t\terror: void 0,\n\t\t\t\t\tparamsError,\n\t\t\t\t\tcontext: {},\n\t\t\t\t\tabortController: opts?._controller ?? new AbortController(),\n\t\t\t\t\tcause,\n\t\t\t\t\tloaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps,\n\t\t\t\t\tinvalid: false,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tstaticData: route.options.staticData || {},\n\t\t\t\t\tfullPath: route.fullPath\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst _notFound = _notFoundRouteId === route.id;\n\t\t\tif (match._notFound && !_notFound) match.error = void 0;\n\t\t\tmatch._notFound = _notFound;\n\t\t\tmatches[index] = match;\n\t\t}\n\t\tfor (let index = 0; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tmatch.params = match.cause === \"stay\" ? nullReplaceEqualDeep(match.params, strictParams) : strictParams;\n\t\t\tif (opts?._controller) match.context = {};\n\t\t}\n\t\treturn matches;\n\t}\n\t/**\n\t* Lightweight route matching for buildLocation.\n\t* Only computes fullPath, accumulated search, and params - skipping expensive\n\t* operations like AbortController, loaderDeps, and full match objects.\n\t*/\n\tmatchRoutesLightweight(location) {\n\t\tconst lastRouteId = last(this.stores.ids.get());\n\t\tconst lastStateMatch = lastRouteId ? this.stores.byRoute.get(lastRouteId).get() : void 0;\n\t\tconst lastStateMatchId = lastStateMatch?.id;\n\t\tconst cached = this.lightweightCache.get(location);\n\t\tif (cached && cached[0] === lastStateMatchId) return cached[1];\n\t\tconst [matchedRoutes, rawParams] = this.getMatchedRoutes(location.pathname);\n\t\tconst lastRoute = last(matchedRoutes);\n\t\tconst accumulatedSearch = { ...location.search };\n\t\tfor (const route of matchedRoutes) try {\n\t\t\tObject.assign(accumulatedSearch, validateSearch(route.options.validateSearch, accumulatedSearch));\n\t\t} catch {}\n\t\tconst canReuseParams = lastStateMatch && lastStateMatch.routeId === lastRoute.id && lastStateMatch.pathname === location.pathname;\n\t\tlet params;\n\t\tif (canReuseParams) params = lastStateMatch.params;\n\t\telse {\n\t\t\tconst strictParams = Object.assign(Object.create(null), rawParams);\n\t\t\tfor (const route of matchedRoutes) try {\n\t\t\t\textractStrictParams(route, strictParams);\n\t\t\t} catch {}\n\t\t\tparams = strictParams;\n\t\t}\n\t\tconst result = [\n\t\t\tmatchedRoutes,\n\t\t\tlastRoute.fullPath,\n\t\t\taccumulatedSearch,\n\t\t\tparams\n\t\t];\n\t\tthis.lightweightCache.set(location, [lastStateMatchId, result]);\n\t\treturn result;\n\t}\n};\n/**\n* In non-production environments,\n* augment the RouterCore class with a `_refreshRoute` method\n* dedicated to HMR.\n*/\nif (process.env.NODE_ENV !== \"production\") {\n\tRouterCore.prototype._replaceRouteChunk = replaceRouteChunk;\n\tRouterCore.prototype._refreshRoute = async function() {\n\t\tthis._serverResult = void 0;\n\t\tthis.updateLatestLocation();\n\t\tawait refreshClientRoute(this);\n\t};\n}\n/** Error thrown when search parameter validation fails. */\nvar SearchParamError = class extends Error {};\n/** Error thrown when path parameter parsing/validation fails. */\nvar PathParamError = class extends Error {};\nconst normalize = (str) => str.endsWith(\"/\") && str.length > 1 ? str.slice(0, -1) : str;\nfunction comparePaths(a, b) {\n\treturn normalize(a) === normalize(b);\n}\n/**\n* Lazily import a module function and forward arguments to it, retaining\n* parameter and return types for the selected export key.\n*/\nfunction lazyFn(fn, key) {\n\treturn async (...args) => {\n\t\treturn (await fn())[key || \"default\"](...args);\n\t};\n}\n/** Create an initial RouterState from a parsed location. */\nfunction getInitialRouterState(location) {\n\treturn {\n\t\tisLoading: false,\n\t\tstatus: \"idle\",\n\t\tresolvedLocation: void 0,\n\t\tlocation,\n\t\tmatches: []\n\t};\n}\nfunction validateSearch(validateSearch, input) {\n\tif (validateSearch == null) return {};\n\tif (\"~standard\" in validateSearch) {\n\t\tconst result = validateSearch[\"~standard\"].validate(input);\n\t\tif (result instanceof Promise) throw new SearchParamError(\"Async validation not supported\");\n\t\tif (result.issues) throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { cause: result });\n\t\treturn result.value;\n\t}\n\tif (\"parse\" in validateSearch) return validateSearch.parse(input);\n\tif (typeof validateSearch === \"function\") return validateSearch(input);\n\treturn {};\n}\nfunction applySearchMiddleware(search, dest, destRoutes, includeValidateSearch) {\n\tconst middlewares = [];\n\tfor (const route of destRoutes) {\n\t\tconst routeOptions = route.options;\n\t\tif (\"search\" in routeOptions) {\n\t\t\tif (routeOptions.search?.middlewares) middlewares.push(...routeOptions.search.middlewares);\n\t\t} else if (routeOptions.preSearchFilters || routeOptions.postSearchFilters) {\n\t\t\tconst legacyMiddleware = ({ search, next }) => {\n\t\t\t\tconst result = next(routeOptions.preSearchFilters ? routeOptions.preSearchFilters.reduce((prev, next) => next(prev), search) : search);\n\t\t\t\treturn routeOptions.postSearchFilters ? routeOptions.postSearchFilters.reduce((prev, next) => next(prev), result) : result;\n\t\t\t};\n\t\t\tmiddlewares.push(legacyMiddleware);\n\t\t}\n\t\tconst routeValidateSearch = routeOptions.validateSearch;\n\t\tif (includeValidateSearch && routeValidateSearch) {\n\t\t\tconst validate = ({ search, next, meta }) => {\n\t\t\t\tconst result = next(search);\n\t\t\t\ttry {\n\t\t\t\t\tconst validated = validateSearch(routeValidateSearch, result);\n\t\t\t\t\tif (meta && validated) {\n\t\t\t\t\t\tfor (const key in validated) if (!(key in result)) (meta.defaulted ||= /* @__PURE__ */ new Map()).set(key, validated[key]);\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...result,\n\t\t\t\t\t\t...validated\n\t\t\t\t\t};\n\t\t\t\t} catch {}\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\tmiddlewares.push(validate);\n\t\t}\n\t}\n\tconst applyNext = (index, currentSearch, meta) => {\n\t\tif (index >= middlewares.length) {\n\t\t\tif (!dest.search) return {};\n\t\t\tif (dest.search === true) return currentSearch;\n\t\t\tconst result = functionalUpdate(dest.search, currentSearch);\n\t\t\tif (meta) meta.explicit = result;\n\t\t\treturn result;\n\t\t}\n\t\tconst next = (newSearch, collectMeta) => {\n\t\t\tif (collectMeta) {\n\t\t\t\tconst nextMeta = meta || {};\n\t\t\t\treturn {\n\t\t\t\t\tsearch: applyNext(index + 1, newSearch, nextMeta),\n\t\t\t\t\tmeta: nextMeta\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn applyNext(index + 1, newSearch, meta);\n\t\t};\n\t\treturn middlewares[index]({\n\t\t\tsearch: currentSearch,\n\t\t\tnext,\n\t\t\tmeta\n\t\t});\n\t};\n\treturn applyNext(0, search);\n}\nfunction findGlobalNotFoundRouteId(notFoundMode, routes) {\n\tif (notFoundMode !== \"root\") {\n\t\tlet fallback;\n\t\tfor (let i = routes.length - 1; i >= 0; i--) {\n\t\t\tconst route = routes[i];\n\t\t\tif (route.options.notFoundComponent) return route.id;\n\t\t\tfallback ||= route.children && route.id;\n\t\t}\n\t\tif (fallback) return fallback;\n\t}\n\treturn rootRouteId;\n}\nfunction resolveNextParams(spec, base) {\n\tif (spec === false || spec === null) return Object.create(null);\n\tif ((spec ?? true) === true) return base;\n\tconst next = Object.assign(Object.create(null), base);\n\treturn Object.assign(next, functionalUpdate(spec, next));\n}\nfunction extractStrictParams(route, accumulatedParams) {\n\tconst parseParams = route.options.params?.parse ?? route.options.parseParams;\n\tif (parseParams) Object.assign(accumulatedParams, parseParams(accumulatedParams));\n}\n//#endregion\nexport { PathParamError, RouterCore, SearchParamError, defaultSerializeError, getInitialRouterState, getLocationChangeInfo, lazyFn, runRouteLifecycle, trailingSlashOptions };\n\n//# sourceMappingURL=router.js.map","import { isNotFound } from \"./not-found.js\";\nimport { isRedirect } from \"./redirect.js\";\nimport { hydrateSsrMatchId } from \"./ssr/ssr-match-id.js\";\nimport { getLocationChangeInfo, runRouteLifecycle } from \"./router.js\";\n//#region src/load-client.ts\nfunction replaceRouteChunk(route, lazyFn) {\n\troute.lazyFn = lazyFn ?? route.lazyFn;\n\troute._lazy = void 0;\n}\nfunction preloadComponent(route, type) {\n\treturn route.options[type]?.preload?.();\n}\nfunction loadComponents(route, onPendingReady) {\n\tconst component = preloadComponent(route, \"component\");\n\tconst pending = preloadComponent(route, \"pendingComponent\");\n\tconst pendingReady = onPendingReady && pending ? pending.then(onPendingReady) : pending;\n\tif (onPendingReady && !pending) onPendingReady();\n\tif (component && pendingReady) return Promise.all([component, pendingReady]).then(() => {});\n\treturn component ?? pendingReady;\n}\nfunction loadRouteChunk(route, componentType, onPendingReady) {\n\tconst afterLazy = () => componentType === false ? void 0 : componentType ? preloadComponent(route, componentType) : loadComponents(route, onPendingReady);\n\tconst current = route._lazy;\n\tif (current) return current === true ? afterLazy() : current.then(afterLazy);\n\tif (!route.lazyFn) return afterLazy();\n\tconst promise = route.lazyFn().then((lazyRoute) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) {\n\t\t\tconst { id: _id, ...options } = lazyRoute.options;\n\t\t\tObject.assign(route.options, options);\n\t\t\troute._lazy = true;\n\t\t}\n\t}, (error) => {\n\t\tif (process.env.NODE_ENV === \"production\" || route._lazy === promise) route._lazy = void 0;\n\t\tthrow error;\n\t});\n\troute._lazy = promise;\n\treturn promise.then(afterLazy);\n}\n/** Return the structural lane through the first terminal render boundary. */\nfunction _getRenderedMatches(matches) {\n\tconst end = matches.findIndex((match) => match.status !== \"success\" || match._notFound) + 1;\n\treturn end && end < matches.length ? matches.slice(0, end) : matches;\n}\n/** Return the lane whose document assets belong to the current presentation. */\nfunction _getAssetMatches(matches) {\n\tlet end = matches.length;\n\tfor (let index = 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tif (match._assetEnd !== void 0) {\n\t\t\tend = Math.min(end, Math.max(index + 1, match._assetEnd));\n\t\t\tcontinue;\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) {\n\t\t\tend = index + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn end < matches.length ? matches.slice(0, end) : matches;\n}\nconst SUCCESS = 0;\nconst ERROR = 1;\nconst NOT_FOUND = 2;\nconst REDIRECTED = 3;\nconst CANCELED_OUTCOME = [4];\nfunction isControl(result) {\n\treturn typeof result[0] === \"number\";\n}\nfunction waitFor(value, signal) {\n\tif (signal.aborted) return Promise.race([Promise.reject(signal), value]);\n\treturn new Promise((resolve, reject) => {\n\t\tconst abort = () => reject(signal);\n\t\tsignal.addEventListener(\"abort\", abort, { once: true });\n\t\tPromise.resolve(value).then(resolve, reject).finally(() => signal.removeEventListener(\"abort\", abort));\n\t});\n}\nfunction getRoute(router, match) {\n\treturn router.routesById[match.routeId];\n}\nfunction normalize(value, rejected, routeId) {\n\tif (isRedirect(value)) return [REDIRECTED, value];\n\tif (isNotFound(value)) {\n\t\tvalue.routeId ||= routeId;\n\t\treturn [NOT_FOUND, value];\n\t}\n\tif (rejected && typeof value?.then === \"function\") value = new Error(\"A Promise was thrown\", { cause: value });\n\treturn rejected ? [ERROR, value] : [SUCCESS, value];\n}\nfunction normalizeError(route, cause) {\n\tlet outcome = normalize(cause, true, route.id);\n\tif (outcome[0] !== ERROR) return outcome;\n\ttry {\n\t\troute.options.onError?.(outcome[1]);\n\t} catch (onErrorCause) {\n\t\toutcome = normalize(onErrorCause, true, route.id);\n\t}\n\treturn outcome;\n}\nfunction normalizeLaneError(router, lane, route, cause, options) {\n\tif (options[0].signal.aborted) return CANCELED_OUTCOME;\n\treturn materializeRedirect(router, lane, route, normalizeError(route, cause), options);\n}\nasync function contextualize(router, lane, options, end, planSuccessfulLane, retainedEnd) {\n\tconst [location, matches] = lane;\n\tconst signal = options[0].signal;\n\tconst preload = !!options[3];\n\tfor (let index = options[6] ?? 0; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst route = getRoute(router, match);\n\t\tmatch.abortController = options[0];\n\t\tconst parentContext = matches[index - 1]?.context ?? router.options.context ?? {};\n\t\tconst common = {\n\t\t\tparams: match.params,\n\t\t\tlocation,\n\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t...opts,\n\t\t\t\t_fromLocation: location\n\t\t\t}),\n\t\t\tbuildLocation: router.buildLocation,\n\t\t\tcause: preload ? \"preload\" : match.cause,\n\t\t\tabortController: options[0],\n\t\t\tpreload,\n\t\t\tmatches,\n\t\t\trouteId: route.id\n\t\t};\n\t\tlet context = parentContext;\n\t\ttry {\n\t\t\tlet routeContext = match._ctx;\n\t\t\tif (!routeContext && route.options.context) routeContext = match._ctx = route.options.context({\n\t\t\t\t...common,\n\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\tcontext: parentContext\n\t\t\t}) || {};\n\t\t\tcontext = {\n\t\t\t\t...parentContext,\n\t\t\t\t...routeContext\n\t\t\t};\n\t\t\tmatch.context = context;\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t}\n\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\tconst validationError = match.paramsError ?? match.searchError;\n\t\tif (validationError !== void 0) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, validationError, options)];\n\t\t}\n\t\tconst beforeLoad = route.options.beforeLoad;\n\t\tif (!beforeLoad) continue;\n\t\tconst beforeLoadContext = {\n\t\t\t...common,\n\t\t\tsearch: match.search,\n\t\t\tcontext,\n\t\t\t...router.options.additionalContext\n\t\t};\n\t\tconst previousStatus = match.status;\n\t\tif (index >= retainedEnd) {\n\t\t\tmatch.status = \"pending\";\n\t\t\toptions[7]?.();\n\t\t}\n\t\ttry {\n\t\t\tsetFetching(router, match, \"beforeLoad\", options[0]);\n\t\t\tconst result = await waitFor(beforeLoad(beforeLoadContext), signal);\n\t\t\tif (signal.aborted) return [index, CANCELED_OUTCOME];\n\t\t\tconst outcome = materializeRedirect(router, lane, route, normalize(result, false, route.id), options);\n\t\t\tif (outcome[0] !== SUCCESS) {\n\t\t\t\treleaseFlight(router, match);\n\t\t\t\treturn [index, outcome];\n\t\t\t}\n\t\t\tmatch.context = {\n\t\t\t\t...context,\n\t\t\t\t...result\n\t\t\t};\n\t\t} catch (cause) {\n\t\t\treleaseFlight(router, match);\n\t\t\treturn [index, normalizeLaneError(router, lane, route, cause, options)];\n\t\t} finally {\n\t\t\tif (match.status === \"pending\") match.status = previousStatus;\n\t\t\tsetFetching(router, match, false, options[0]);\n\t\t}\n\t}\n\tplanSuccessfulLane();\n}\nfunction releaseOwnedFlight(router, match, flight) {\n\tif (!flight || --flight[2]) return;\n\tif (router._flights?.get(match.id) === flight) {\n\t\tconst current = router._tx;\n\t\tif (current && !current[0].signal.aborted && !current[3].includes(match) && current[3].some((candidate) => candidate.id === match.id) && current[3].some((candidate) => candidate.isFetching === \"beforeLoad\")) return;\n\t\trouter._flights.delete(match.id);\n\t}\n\treturn flight[1];\n}\nfunction releaseFlight(router, match) {\n\tconst flight = match._flight;\n\tmatch._flight = void 0;\n\treleaseOwnedFlight(router, match, flight)?.abort();\n}\n/**\n* Not passing in a `next` ownership recipient\n* is equivalent to discarding the match resources\n*/\nfunction transferMatchResources(router, previous, next, deferSameIdFlight) {\n\tconst abort = [];\n\tfor (const match of previous) if (!next?.includes(match)) {\n\t\tconst flight = match._flight;\n\t\tmatch._flight = void 0;\n\t\tif (deferSameIdFlight && flight?.[2] === 1 && router._flights?.get(match.id) === flight && next?.some((candidate) => candidate.id === match.id)) flight[2] = 0;\n\t\telse {\n\t\t\tconst controller = releaseOwnedFlight(router, match, flight);\n\t\t\tif (controller) abort.push(controller);\n\t\t}\n\t}\n\tfor (const controller of abort) controller.abort();\n}\nfunction acquireMatchResources(matches) {\n\tfor (const match of matches) {\n\t\tconst flight = match._flight;\n\t\tif (flight) flight[2]++;\n\t}\n}\nfunction setFetching(router, match, value, owner) {\n\tmatch.isFetching = value;\n\tif (owner && router._tx?.[0] !== owner) return;\n\tconst store = router.stores.byRoute.get(match.routeId);\n\tconst presented = store?.get();\n\tif (presented?.id === match.id) store.set({\n\t\t...presented,\n\t\tisFetching: value\n\t});\n}\nfunction getLoaderContext(router, lane, match, route, controller, parentMatchPromise, preload) {\n\tconst location = lane[0];\n\treturn {\n\t\tparams: match.params,\n\t\tlocation,\n\t\tnavigate: (opts) => router.navigate({\n\t\t\t...opts,\n\t\t\t_fromLocation: location\n\t\t}),\n\t\tcause: preload ? \"preload\" : match.cause,\n\t\tabortController: controller,\n\t\tpreload,\n\t\tdeps: match.loaderDeps,\n\t\tparentMatchPromise,\n\t\tcontext: match.context,\n\t\troute,\n\t\t...router.options.additionalContext\n\t};\n}\nasync function loadResource(router, lane, match, route, loader, parentMatchPromise, options) {\n\tconst owner = options[0];\n\tconst signal = owner.signal;\n\tif (signal.aborted) return CANCELED_OUTCOME;\n\tif (!loader) return [SUCCESS, void 0];\n\tlet flight = match._flight;\n\tsetFetching(router, match, \"loader\", owner);\n\ttry {\n\t\tif (!flight) {\n\t\t\tconst controller = new AbortController();\n\t\t\tflight = [\n\t\t\t\tPromise.resolve().then(() => loader(getLoaderContext(router, lane, match, route, controller, parentMatchPromise, !!options[3]))).then((value) => normalize(value, false, route.id), (cause) => normalize(cause, true, route.id)).then((result) => {\n\t\t\t\t\tif (result[0] !== SUCCESS && router._flights?.get(match.id) === flight) {\n\t\t\t\t\t\trouter._flights.delete(match.id);\n\t\t\t\t\t\tif (!flight[2]) controller.abort();\n\t\t\t\t\t}\n\t\t\t\t\treturn result[0] === ERROR && flight[2] ? normalizeError(route, result[1]) : result;\n\t\t\t\t}),\n\t\t\t\tcontroller,\n\t\t\t\t1\n\t\t\t];\n\t\t\t(router._flights ??= /* @__PURE__ */ new Map()).set(match.id, flight);\n\t\t}\n\t\tmatch._flight = flight;\n\t\tmatch.abortController = flight[1];\n\t\treturn materializeRedirect(router, lane, route, await waitFor(flight[0], signal), options);\n\t} catch (cause) {\n\t\tif (cause !== signal || !signal.aborted) throw cause;\n\t\treleaseFlight(router, match);\n\t\treturn CANCELED_OUTCOME;\n\t} finally {\n\t\tsetFetching(router, match, false, owner);\n\t}\n}\nfunction settleInto(match, result, preload) {\n\tif (result[0] === SUCCESS) {\n\t\tmatch.loaderData = result[1];\n\t\tmatch.error = void 0;\n\t\tmatch.status = \"success\";\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t\tmatch.preload = preload;\n\t} else if (result[0] !== REDIRECTED) {\n\t\tmatch.status = \"success\";\n\t\tmatch.error = void 0;\n\t\tmatch.invalid = true;\n\t}\n}\nfunction cacheLoaderMatch(router, match, planned) {\n\tconst current = router._cache.get(match.id);\n\tif (current !== planned || router._committed.some((candidate) => candidate.id === match.id && candidate._flight === match._flight)) return;\n\tconst cached = {\n\t\t...match,\n\t\t_notFound: void 0,\n\t\tcontext: {}\n\t};\n\tif (cached._flight) cached._flight[2]++;\n\trouter._cache.set(match.id, cached);\n\tif (current) releaseFlight(router, current);\n}\nfunction getParentSnapshot(match, outcome) {\n\tif (outcome[0] === ERROR || outcome[0] === NOT_FOUND) return {\n\t\t...match,\n\t\tstatus: outcome[0] === ERROR ? \"error\" : \"notFound\",\n\t\terror: outcome[1],\n\t\t_flight: void 0\n\t};\n\treturn match;\n}\nfunction createLoaderTask(router, lane, index, tasks, semanticParent, options, retainedEnd) {\n\tconst match = lane[1][index];\n\tconst route = getRoute(router, match);\n\tconst preload = !!options[3];\n\tconst plannedCacheMatch = router._cache.get(match.id);\n\tlet configured;\n\tlet reload = false;\n\tlet reloadFailure;\n\ttry {\n\t\tif (match.status === \"success\") {\n\t\t\tconfigured = route.options.shouldReload;\n\t\t\tif (typeof configured === \"function\") configured = configured(getLoaderContext(router, lane, match, route, options[0], semanticParent, preload));\n\t\t\tif (options[0].signal.aborted) reloadFailure = CANCELED_OUTCOME;\n\t\t}\n\t\tif (!reloadFailure) if (match.status !== \"success\") reload = true;\n\t\telse {\n\t\t\tconst staleAge = options[3] || match.preload ? route.options.preloadStaleTime ?? router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? router.options.defaultStaleTime ?? 0;\n\t\t\treload = !!(match.invalid || configured || configured === void 0 && Date.now() - match.updatedAt >= staleAge && (options[5] || match.cause === \"enter\" || options[2].some((candidate) => candidate.routeId === match.routeId && candidate.id !== match.id)));\n\t\t}\n\t} catch (cause) {\n\t\tmatch.invalid = true;\n\t\treleaseFlight(router, match);\n\t\treloadFailure = normalizeLaneError(router, lane, route, cause, options);\n\t}\n\tconst routeLoader = route.options.loader;\n\tconst loader = typeof routeLoader === \"function\" ? routeLoader : routeLoader?.handler;\n\tlet donor = (!preload || route.options.preload !== false) && routeLoader && !(process.env.NODE_ENV !== \"production\" && router._tx?.[6]) ? router._flights?.get(match.id) : void 0;\n\tif (donor === match._flight || reloadFailure) donor = void 0;\n\telse if (donor && !reload && !preload && configured === void 0) reload = true;\n\telse if (!reload) donor = void 0;\n\tconst background = !!(routeLoader && reload && match.status === \"success\" && !preload && !options[4] && ((typeof routeLoader === \"function\" ? void 0 : routeLoader?.staleReloadMode) ?? router.options.defaultStaleReloadMode) !== \"blocking\");\n\tconst loaded = reload && (!preload || route.options.preload !== false);\n\tconst blocking = loaded && !background && (match.status !== \"success\" || !!routeLoader);\n\tconst onReady = index >= retainedEnd ? options[7] : void 0;\n\tconst onLazyReady = route.lazyFn && route._lazy !== true ? onReady : void 0;\n\tif (loaded && !routeLoader) {\n\t\tmatch.invalid = false;\n\t\tmatch.updatedAt = Date.now();\n\t}\n\tif (donor) donor[2]++;\n\tif (blocking) {\n\t\tconst acceptedFlight = match._flight;\n\t\tmatch._flight = donor;\n\t\treleaseOwnedFlight(router, match, acceptedFlight)?.abort();\n\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\tonReady?.();\n\t}\n\tif (!loaded) match.isFetching = false;\n\tconst outcome = (reloadFailure ? Promise.resolve(reloadFailure) : !blocking ? Promise.resolve([SUCCESS, match.loaderData]) : loadResource(router, lane, match, route, loader, semanticParent, options)).then((result) => {\n\t\tif (blocking) {\n\t\t\tsettleInto(match, result, preload);\n\t\t\tif (result[0] === SUCCESS) {\n\t\t\t\tif (routeLoader && !options[0].signal.aborted) cacheLoaderMatch(router, match, plannedCacheMatch);\n\t\t\t\tif (index >= retainedEnd) match.status = \"pending\";\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t});\n\tconst chunkFailure = waitFor(Promise.resolve().then(() => loadRouteChunk(route, void 0, onLazyReady)), options[0].signal).then(() => void 0, (cause) => lane[1].some((candidate, candidateIndex) => candidateIndex <= index && (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound)) ? void 0 : [index, normalizeLaneError(router, lane, route, cause, options)]).then((failure) => outcome.then((result) => {\n\t\tif (blocking && !failure && result[0] === SUCCESS && match.status === \"pending\" && !options[0].signal.aborted) {\n\t\t\tmatch.status = \"success\";\n\t\t\tonReady?.();\n\t\t}\n\t\treturn failure;\n\t}));\n\ttasks.push([\n\t\tindex,\n\t\toutcome,\n\t\tchunkFailure\n\t]);\n\tif (!background) return outcome.then((result) => getParentSnapshot(match, result));\n\tconst candidate = {\n\t\t...match,\n\t\tstatus: \"pending\",\n\t\tpreload: false,\n\t\t_flight: donor\n\t};\n\tmatch.invalid = false;\n\tmatch.isFetching = \"loader\";\n\tconst backgroundOutcome = loadResource(router, lane, candidate, route, loader, semanticParent, options).then((result) => {\n\t\tmatch.isFetching = false;\n\t\tsettleInto(candidate, result, false);\n\t\treturn result;\n\t});\n\t(lane[2] ??= []).push([\n\t\tindex,\n\t\tbackgroundOutcome,\n\t\tchunkFailure,\n\t\tcandidate\n\t]);\n\treturn backgroundOutcome.then((result) => getParentSnapshot(candidate, result));\n}\nasync function getNotFoundBoundary(router, matches, indexed, signal, fallback = 0) {\n\tconst cause = indexed?.[1][1];\n\tlet index = cause?.routeId ? matches.findIndex((match) => match.routeId === cause.routeId) : indexed?.[0] ?? matches.length - 1;\n\tif (index < 0) index = 0;\n\tfor (let i = index; i >= 0; i--) {\n\t\tconst route = getRoute(router, matches[i]);\n\t\ttry {\n\t\t\tconst loading = loadRouteChunk(route, false);\n\t\t\tif (loading) await waitFor(loading, signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) throw cause;\n\t\t}\n\t\tif (route.options.notFoundComponent) return i;\n\t}\n\treturn cause?.routeId ? index : fallback;\n}\nfunction discardBackground(router, lane) {\n\tif (lane[2]) {\n\t\ttransferMatchResources(router, lane[2].map((task) => task[3]));\n\t\tlane[2] = void 0;\n\t}\n}\nasync function settleTasks(tasks, serialFailure, redirectTasks, gate) {\n\tlet loaderFailure;\n\ttry {\n\t\tawait Promise.all(tasks.map((task) => task[1].then(async (outcome) => {\n\t\t\tconst taskIndex = task[0];\n\t\t\tif (gate && taskIndex >= await gate) return;\n\t\t\tif (outcome[0] >= REDIRECTED) throw [taskIndex, outcome];\n\t\t\tif (!loaderFailure && outcome[0] !== SUCCESS) {\n\t\t\t\tloaderFailure = [taskIndex, outcome];\n\t\t\t\tawait Promise.all((redirectTasks ?? []).map((nextTask) => {\n\t\t\t\t\tif (nextTask[0] <= taskIndex) return;\n\t\t\t\t\treturn nextTask[1].then((nextOutcome) => {\n\t\t\t\t\t\tif (nextOutcome[0] === REDIRECTED) throw [nextTask[0], nextOutcome];\n\t\t\t\t\t});\n\t\t\t\t}));\n\t\t\t}\n\t\t})));\n\t} catch (cause) {\n\t\treturn cause;\n\t}\n\treturn serialFailure ?? loaderFailure;\n}\nfunction materializeRedirect(router, lane, route, outcome, options, failed) {\n\twhile (outcome[0] === REDIRECTED) {\n\t\tconst redirect = outcome[1];\n\t\tif (redirect.options.reloadDocument ? options[3] : options[1] >= 20) return outcome;\n\t\ttry {\n\t\t\tif (redirect.options.href && redirect.options.reloadDocument) {\n\t\t\t\trouter.resolveRedirect(redirect);\n\t\t\t\treturn outcome;\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tREDIRECTED,\n\t\t\t\tredirect,\n\t\t\t\trouter.buildLocation({\n\t\t\t\t\t...redirect.options,\n\t\t\t\t\t_fromLocation: lane[0],\n\t\t\t\t\t_includeValidateSearch: true\n\t\t\t\t})\n\t\t\t];\n\t\t} catch (cause) {\n\t\t\toutcome = failed ? [ERROR, cause] : normalizeError(route, cause);\n\t\t\tfailed = true;\n\t\t}\n\t}\n\treturn outcome;\n}\nasync function reduceLane(router, lane, tasks, controller, settlement, onReady) {\n\tconst matches = lane[1];\n\tlet failure = await settlement;\n\tlet redirectLimitExceeded = false;\n\tconst plannedBoundary = matches.findIndex((match) => match._notFound);\n\tconst boundaryOf = (found) => found[1][0] === NOT_FOUND ? getNotFoundBoundary(router, matches, found, controller.signal) : found[0];\n\tlet readinessEnd = plannedBoundary < 0 ? matches.length : plannedBoundary;\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) readinessEnd = 0;\n\telse if (failure) {\n\t\treadinessEnd = failure[2] ??= await boundaryOf(failure);\n\t\tfor (const task of tasks) {\n\t\t\tif (task[0] >= readinessEnd) break;\n\t\t\tconst outcome = await task[1];\n\t\t\tif (outcome[0] !== SUCCESS && outcome[0] < REDIRECTED && !(\"loaderData\" in matches[task[0]])) {\n\t\t\t\tfailure = [task[0], outcome];\n\t\t\t\treadinessEnd = failure[2] = await boundaryOf(failure);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfor (const task of tasks) {\n\t\tif (task[0] >= readinessEnd) break;\n\t\tconst chunkFailure = await task[2];\n\t\tif (!chunkFailure) continue;\n\t\tfailure = chunkFailure;\n\t\tbreak;\n\t}\n\tif ((failure?.[1][0] ?? 0) >= REDIRECTED) {\n\t\tconst outcome = failure[1];\n\t\tif (outcome[0] !== REDIRECTED || outcome[1].options.reloadDocument || outcome[2]) {\n\t\t\tdiscardBackground(router, lane);\n\t\t\treturn outcome;\n\t\t}\n\t\tredirectLimitExceeded = true;\n\t\tfailure = [0, [ERROR, /* @__PURE__ */ new Error(\"Too many redirects\")]];\n\t}\n\tconst boundary = failure ? failure[2] ?? await boundaryOf(failure) : plannedBoundary;\n\tif (boundary >= 0) {\n\t\tconst outcome = failure?.[1];\n\t\tconst kind = outcome?.[0];\n\t\tconst match = matches[boundary];\n\t\tconst cause = outcome?.[1];\n\t\tconst install = () => {\n\t\t\tif (outcome) {\n\t\t\t\tmatch._notFound = void 0;\n\t\t\t\tif (kind === ERROR) match.status = \"error\";\n\t\t\t\telse {\n\t\t\t\t\tcause.routeId = match.routeId;\n\t\t\t\t\tif (match.routeId === router.routeTree.id) {\n\t\t\t\t\t\tmatch.status = \"success\";\n\t\t\t\t\t\tmatch._notFound = true;\n\t\t\t\t\t} else match.status = \"notFound\";\n\t\t\t\t}\n\t\t\t\tmatch.error = cause;\n\t\t\t\tmatch.isFetching = false;\n\t\t\t}\n\t\t};\n\t\tinstall();\n\t\tif (!outcome) onReady?.();\n\t\tconst route = getRoute(router, match);\n\t\ttry {\n\t\t\tawait waitFor(outcome ? Promise.resolve().then(() => loadRouteChunk(route, kind === ERROR ? \"errorComponent\" : \"notFoundComponent\")) : Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]), controller.signal);\n\t\t} catch (cause) {\n\t\t\tif (cause === controller.signal && controller.signal.aborted) {\n\t\t\t\tdiscardBackground(router, lane);\n\t\t\t\treturn CANCELED_OUTCOME;\n\t\t\t}\n\t\t}\n\t\tif (!outcome) match.status = \"success\";\n\t\telse if (redirectLimitExceeded) {\n\t\t\tcontroller.abort();\n\t\t\tawait Promise.all([\n\t\t\t\t...tasks.map((task) => task[1]),\n\t\t\t\t...tasks.map((task) => task[2]),\n\t\t\t\t...(lane[2] ?? []).map((task) => task[1])\n\t\t\t]);\n\t\t\tdiscardBackground(router, lane);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tinstall();\n\t\t}\n\t}\n\treturn lane;\n}\nasync function projectLane(router, lane, signal, start = 0, end = lane[1].length) {\n\tconst matches = lane[1];\n\tfor (let index = start; index < end; index++) {\n\t\tconst match = matches[index];\n\t\tconst routeOptions = getRoute(router, match).options;\n\t\tif (routeOptions.head || routeOptions.scripts) try {\n\t\t\tconst context = {\n\t\t\t\tssr: router.options.ssr,\n\t\t\t\tmatches,\n\t\t\t\tmatch,\n\t\t\t\tparams: match.params,\n\t\t\t\tloaderData: match.loaderData\n\t\t\t};\n\t\t\tconst [head, scripts] = await waitFor(Promise.all([routeOptions.head?.(context), routeOptions.scripts?.(context)]), signal);\n\t\t\tmatch.meta = head?.meta;\n\t\t\tmatch.links = head?.links;\n\t\t\tmatch.headScripts = head?.scripts;\n\t\t\tmatch.styles = head?.styles;\n\t\t\tmatch.scripts = scripts;\n\t\t} catch (cause) {\n\t\t\tif (cause === signal && signal.aborted) break;\n\t\t\tconsole.error(cause);\n\t\t}\n\t\tif (match.status !== \"success\" || match._notFound) break;\n\t}\n\treturn lane;\n}\nasync function executeClientLane(router, location, matches, options) {\n\tconst matched = [location, matches];\n\tconst signal = options[0].signal;\n\tlet reduced;\n\ttry {\n\t\tconst presented = router.stores.matches.get();\n\t\tlet plannedBoundary = matches.findIndex((match) => match._notFound);\n\t\tif (router.options.notFoundMode !== \"root\" && plannedBoundary >= 0) {\n\t\t\tconst boundary = await getNotFoundBoundary(router, matched[1], void 0, signal, plannedBoundary);\n\t\t\tif (boundary !== plannedBoundary) {\n\t\t\t\tmatches[plannedBoundary]._notFound = void 0;\n\t\t\t\tmatches[boundary]._notFound = true;\n\t\t\t}\n\t\t\tplannedBoundary = boundary;\n\t\t}\n\t\tlet end = plannedBoundary < 0 ? matches.length : plannedBoundary + 1;\n\t\tlet retainedEnd = 0;\n\t\twhile (retainedEnd < end && retainedEnd !== plannedBoundary) {\n\t\t\tconst match = matches[retainedEnd];\n\t\t\tconst committed = options[2][retainedEnd];\n\t\t\tconst visible = presented[retainedEnd];\n\t\t\tif (committed?.id !== match.id || committed.status !== \"success\" || committed._notFound || match.preload || visible?.id !== match.id || visible.status !== \"success\" || visible._notFound) break;\n\t\t\tretainedEnd++;\n\t\t}\n\t\tconst tasks = [];\n\t\tconst start = options[6] ?? 0;\n\t\tlet semanticParent = start ? Promise.resolve(matched[1][start - 1]) : void 0;\n\t\tconst planSuccessfulLane = () => {\n\t\t\tfor (let index = start; index < end; index++) {\n\t\t\t\tif (signal.aborted) break;\n\t\t\t\tsemanticParent = createLoaderTask(router, matched, index, tasks, semanticParent, options, retainedEnd);\n\t\t\t}\n\t\t};\n\t\tconst failure = await contextualize(router, matched, options, end, planSuccessfulLane, retainedEnd);\n\t\tif (failure) {\n\t\t\toptions[4] = true;\n\t\t\tend = failure[0];\n\t\t\tif (failure[1][0] === NOT_FOUND) {\n\t\t\t\tconst boundary = await getNotFoundBoundary(router, matched[1], failure, signal);\n\t\t\t\tfailure[2] = boundary;\n\t\t\t\tend = Math.min(end, boundary + 1);\n\t\t\t} else if (failure[1][0] >= REDIRECTED) end = 0;\n\t\t\tplanSuccessfulLane();\n\t\t}\n\t\tif (!signal.aborted && !options[3]) {\n\t\t\tconst abort = [];\n\t\t\tfor (const [id, flight] of router._flights ?? []) if (!flight[2]) {\n\t\t\t\trouter._flights.delete(id);\n\t\t\t\tabort.push(flight[1]);\n\t\t\t}\n\t\t\tfor (const controller of abort) controller.abort();\n\t\t}\n\t\tconst reduction = reduceLane(router, matched, tasks, options[0], settleTasks(tasks, failure, matched[2]), options[7]);\n\t\tif (matched[2]?.length) matched[3] = settleTasks(matched[2], void 0, void 0, reduction.then((foreground) => isControl(foreground) ? 0 : _getRenderedMatches(foreground[1]).length, () => 0));\n\t\treduced = await reduction;\n\t} catch (cause) {\n\t\tdiscardBackground(router, matched);\n\t\tif (cause === signal && signal.aborted) return CANCELED_OUTCOME;\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) return reduced;\n\treturn projectLane(router, reduced, signal, options[6] === reduced[1].length ? options[6] : 0);\n}\n/**\n* Waits for `pendingMs`, then presents the complete lane. Rendering applies the\n* selected boundary cutoff while retaining every match's structural state.\n* A replacement load for the same match keeps the timer; choosing a different\n* match resets it. `pendingMinMs` starts after the fallback renders.\n*/\nfunction offerPending(router, tx) {\n\tif (router._tx !== tx) return;\n\tconst matches = tx[3];\n\tconst presented = router.stores.matches.get();\n\tlet session = router._pending;\n\tfor (let index = 0; index < matches.length; index++) {\n\t\tconst match = matches[index];\n\t\tconst success = match.status === \"success\" && !match._notFound;\n\t\tconst presentedPending = presented[index]?.id === match.id && presented[index]?.status === \"pending\";\n\t\tif (success && !presentedPending) continue;\n\t\tconst route = getRoute(router, match);\n\t\tconst delay = success && presentedPending || match.invalid ? 0 : route.options.pendingMs ?? router.options.defaultPendingMs;\n\t\tconst component = route.options.pendingComponent ?? router.options.defaultPendingComponent;\n\t\tif (!component || typeof delay !== \"number\" || delay === Infinity) {\n\t\t\tif (session) {\n\t\t\t\tsession[0] = tx;\n\t\t\t\tsession[2] = 0;\n\t\t\t\tsession[4] = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst min = route.options.pendingMinMs ?? router.options.defaultPendingMinMs ?? 0;\n\t\tlet tookOver = false;\n\t\tif (session?.[1] === match.id) {\n\t\t\ttookOver = session[0] !== tx;\n\t\t\tsession[0] = tx;\n\t\t} else {\n\t\t\tclearTimeout(session?.[3]);\n\t\t\trouter._pending = session = void 0;\n\t\t}\n\t\tif (!session) router._pending = session = [\n\t\t\ttx,\n\t\t\tmatch.id,\n\t\t\tpresentedPending ? Date.now() + min : tx[4] + delay,\n\t\t\tvoid 0,\n\t\t\tpresentedPending || void 0,\n\t\t\tcomponent\n\t\t];\n\t\tif (session[4] && !tookOver && session[5] === component) return;\n\t\tsession[5] = component;\n\t\tif (!session[4]) {\n\t\t\tclearTimeout(session[3]);\n\t\t\tconst remaining = session[2] - Date.now();\n\t\t\tif (remaining > 0) {\n\t\t\t\tsession[3] = setTimeout(() => offerPending(router, tx), remaining);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsession[2] = 0;\n\t\t}\n\t\tconst offered = matches.map((match) => ({\n\t\t\t...match,\n\t\t\t_flight: void 0\n\t\t}));\n\t\toffered[index].status = \"pending\";\n\t\tconst ack = session[4] = router.startTransition(() => router.stores.setMatches(offered), offered).then((rendered) => {\n\t\t\tif (rendered && router._pending === session && session[4] === ack && !session[2]) session[2] = Date.now() + min;\n\t\t\treturn rendered;\n\t\t});\n\t\treturn;\n\t}\n}\n/**\n* Cancels pending UI timing unless the current successor can take over the\n* same boundary that remains painted.\n*/\nfunction finishPending(router, tx) {\n\tconst session = router._pending;\n\tif (router._tx === tx || !router._tx?.[3].some((match) => match.id === session?.[1])) {\n\t\tclearTimeout(session?.[3]);\n\t\trouter._pending = void 0;\n\t}\n}\nasync function awaitPendingMinimum(router, tx) {\n\tconst session = router._pending;\n\tif (!session) return;\n\tclearTimeout(session[3]);\n\tconst remaining = session[2] - Date.now();\n\tif (!session[4] || remaining <= 0 || !_getRenderedMatches(tx[3]).some((match) => match.id === session[1])) return;\n\tlet timer;\n\ttry {\n\t\tawait waitFor(new Promise((resolve) => {\n\t\t\ttimer = setTimeout(resolve, remaining);\n\t\t}), tx[0].signal);\n\t} catch {}\n\tclearTimeout(timer);\n}\nfunction publishMatches(router, matches) {\n\trouter._committed = matches;\n\trouter.stores.setMatches(matches);\n}\nfunction commitMatches(router, tx, matches, resolvedPrefix) {\n\tconst previous = router._committed;\n\tconst previousCached = router._cache;\n\tfor (const match of matches) {\n\t\tmatch.preload = false;\n\t\tif (resolvedPrefix) match._assetEnd = void 0;\n\t}\n\tconst cut = _getRenderedMatches(matches).length;\n\tconst cached = /* @__PURE__ */ new Map();\n\tif (process.env.NODE_ENV === \"production\" || !tx[6]) {\n\t\tconst now = Date.now();\n\t\tfor (const match of [...previous, ...previousCached.values()]) {\n\t\t\tif (match.status !== \"success\" || matches.some((candidate, index) => candidate.id === match.id && (index < cut || candidate.status === \"success\"))) continue;\n\t\t\tconst route = getRoute(router, match);\n\t\t\tif (!route.options.loader || now - match.updatedAt >= (match.preload ? route.options.preloadGcTime ?? router.options.defaultPreloadGcTime ?? 3e5 : route.options.gcTime ?? router.options.defaultGcTime ?? 3e5)) continue;\n\t\t\tcached.set(match.id, previousCached.get(match.id) === match ? match : {\n\t\t\t\t...match,\n\t\t\t\t_flight: void 0,\n\t\t\t\tisFetching: false,\n\t\t\t\tcontext: {}\n\t\t\t});\n\t\t}\n\t}\n\ttx[3] = [];\n\trouter._cache = cached;\n\tpublishMatches(router, matches);\n\ttransferMatchResources(router, [...previousCached.values(), ...previous], [...matches, ...cached.values()]);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst handoff = tx[6]?.[0];\n\t\tif (handoff && router._handoff === handoff) handoff[1]();\n\t}\n\trunRouteLifecycle(router, previous, matches, tx);\n}\nasync function awaitCurrent(router, owner) {\n\tlet current = router._tx;\n\twhile (current && current !== owner) {\n\t\tawait current[5];\n\t\tif (router._tx === current) return;\n\t\tcurrent = router._tx;\n\t}\n}\nasync function followRedirect(router, tx, outcome) {\n\tconst redirect = outcome[1];\n\tconst location = outcome[2];\n\tif (!location) {\n\t\tawait router.navigate({\n\t\t\t...redirect.options,\n\t\t\treplace: true,\n\t\t\tignoreBlocker: true\n\t\t});\n\t\treturn;\n\t}\n\tif (redirect.options.reloadDocument) {\n\t\tawait router.navigate({\n\t\t\thref: location.publicHref,\n\t\t\treloadDocument: true,\n\t\t\treplace: true,\n\t\t\tignoreBlocker: true\n\t\t});\n\t\treturn;\n\t}\n\tlocation._redirects = tx[1] + 1;\n\trouter._pendingLocation = location;\n\tconst committed = router.commitLocation({\n\t\t...location,\n\t\tviewTransition: redirect.options.viewTransition,\n\t\treplace: true,\n\t\tresetScroll: redirect.options.resetScroll,\n\t\thashScrollIntoView: redirect.options.hashScrollIntoView,\n\t\tignoreBlocker: true\n\t});\n\tqueueMicrotask(() => {\n\t\tif (router._pendingLocation === location) router._pendingLocation = void 0;\n\t});\n\tawait committed;\n}\nasync function runBackground(router, tx, base, tasks, settlement) {\n\tconst next = base.map((match) => ({ ...match }));\n\tacquireMatchResources(next);\n\tfor (const task of tasks) {\n\t\treleaseFlight(router, next[task[0]]);\n\t\tnext[task[0]] = task[3];\n\t}\n\tconst lane = [tx[2], next];\n\tlet reduced;\n\ttry {\n\t\treduced = await reduceLane(router, lane, tasks, tx[0], settlement);\n\t} catch (cause) {\n\t\ttransferMatchResources(router, next);\n\t\tthrow cause;\n\t}\n\tif (isControl(reduced)) {\n\t\ttransferMatchResources(router, next);\n\t\tif (reduced[0] === REDIRECTED && router._tx === tx && router._committed === base) await followRedirect(router, tx, reduced);\n\t\treturn;\n\t}\n\tconst projected = await projectLane(router, reduced, tx[0].signal);\n\tif (router._tx !== tx || router._committed !== base) {\n\t\ttransferMatchResources(router, projected[1]);\n\t\treturn;\n\t}\n\tfor (const match of projected[1]) {\n\t\tconst cached = router._cache.get(match.id);\n\t\tif (cached?._flight && cached._flight === match._flight) {\n\t\t\trouter._cache.delete(match.id);\n\t\t\treleaseFlight(router, cached);\n\t\t}\n\t}\n\tpublishMatches(router, projected[1]);\n\ttransferMatchResources(router, base, projected[1]);\n}\nasync function runClientTransaction(router, tx, forceStaleReload, onReady, sync, resolvedPrefix) {\n\tconst options = [\n\t\ttx[0],\n\t\ttx[1],\n\t\trouter._committed,\n\t\tvoid 0,\n\t\tsync,\n\t\tforceStaleReload,\n\t\tresolvedPrefix,\n\t\tonReady\n\t];\n\tconst result = await executeClientLane(router, tx[2], tx[3], options);\n\tif (isControl(result)) {\n\t\tconst follow = result[0] === REDIRECTED && router._tx === tx;\n\t\tif (!follow || result[1].options.reloadDocument) finishPending(router, tx);\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tif (!follow) return;\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\treturn;\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) router._refreshNextLoad = true;\n\t\tawait followRedirect(router, tx, result);\n\t\treturn;\n\t}\n\tif (router._tx !== tx) {\n\t\tfinishPending(router, tx);\n\t\ttransferMatchResources(router, result[1]);\n\t\tdiscardBackground(router, result);\n\t\treturn;\n\t}\n\tawait awaitPendingMinimum(router, tx);\n\tif (router._tx !== tx) {\n\t\tfinishPending(router, tx);\n\t\ttransferMatchResources(router, result[1]);\n\t\tdiscardBackground(router, result);\n\t\treturn;\n\t}\n\tconst toLocation = tx[2];\n\tconst changeInfo = getLocationChangeInfo(toLocation, router.stores.resolvedLocation.get());\n\tconst background = result[2];\n\tawait router.startViewTransition(async () => {\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\ttransferMatchResources(router, result[1]);\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tawait awaitPendingMinimum(router, tx);\n\t\tif (router._tx !== tx) {\n\t\t\tfinishPending(router, tx);\n\t\t\ttransferMatchResources(router, result[1]);\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tconst commit = () => {\n\t\t\tfinishPending(router, tx);\n\t\t\tcommitMatches(router, tx, result[1], resolvedPrefix);\n\t\t\tif (router._tx !== tx) return;\n\t\t\trouter.emit({\n\t\t\t\ttype: \"onLoad\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onBeforeRouteMount\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t};\n\t\tconst rendered = await router.startTransition(commit, result[1]);\n\t\tif (process.env.NODE_ENV !== \"production\" && tx[6]) tx[6] = void 0;\n\t\tif (router._tx !== tx) {\n\t\t\tdiscardBackground(router, result);\n\t\t\treturn;\n\t\t}\n\t\tif (background?.length) runBackground(router, tx, result[1], background, result[3]).catch(console.error);\n\t\trouter.batch(() => {\n\t\t\trouter.stores.resolvedLocation.set(toLocation);\n\t\t\trouter.stores.status.set(\"idle\");\n\t\t\tif (router._tx === tx) router.emit({\n\t\t\t\ttype: \"onResolved\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t\tif (rendered && router._tx === tx) router.emit({\n\t\t\t\ttype: \"onRendered\",\n\t\t\t\t...changeInfo\n\t\t\t});\n\t\t});\n\t\tif (router._tx !== tx) return;\n\t\trouter._commitPromise?.resolve();\n\t\trouter._commitPromise = void 0;\n\t});\n}\nasync function loadClientRoute(router, opts) {\n\tlet rematerialize = false;\n\tif (process.env.NODE_ENV !== \"production\") rematerialize = !!router._refreshNextLoad || !!router._tx?.[6];\n\tconst previousOwner = router._tx;\n\tconst resolvedLocation = router.stores.resolvedLocation.get();\n\tconst previousLocation = resolvedLocation ?? router.stores.location.get();\n\tconst location = router.latestLocation;\n\tconst pendingLocation = router._pendingLocation;\n\tconst redirects = pendingLocation?.href === location.href ? pendingLocation._redirects ?? 0 : 0;\n\tconst handoff = router._handoff;\n\tconst hydrationController = rematerialize ? void 0 : handoff?.[0]();\n\tconst preflight = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = preflight;\n\tif (!rematerialize && !hydrationController) handoff?.[1]();\n\tpreviousPreflight?.abort();\n\tif (preflight.signal.aborted) {\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\tconst changeInfo = getLocationChangeInfo(location, resolvedLocation);\n\trouter.emit({\n\t\ttype: \"onBeforeNavigate\",\n\t\t...changeInfo\n\t});\n\tif (!preflight.signal.aborted) router.emit({\n\t\ttype: \"onBeforeLoad\",\n\t\t...changeInfo\n\t});\n\tif (preflight.signal.aborted) {\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\tconst sameHref = previousLocation.href === location.href;\n\tlet controller = preflight;\n\tconst matches = process.env.NODE_ENV !== \"production\" && rematerialize ? router.matchRoutes(location, {\n\t\t_controller: preflight,\n\t\t_rematerialize: true\n\t}) : router.matchRoutes(location, { _controller: preflight });\n\tacquireMatchResources(matches);\n\tconst resolvedPrefix = hydrationController ? handoff[1](matches) : void 0;\n\tif (resolvedPrefix) controller = hydrationController;\n\telse hydrationController?.abort();\n\tif (preflight.signal.aborted) {\n\t\ttransferMatchResources(router, matches);\n\t\tawait awaitCurrent(router, previousOwner);\n\t\treturn;\n\t}\n\trouter._preflight = void 0;\n\tconst tx = [\n\t\tcontroller,\n\t\tredirects,\n\t\tlocation,\n\t\tmatches,\n\t\tDate.now(),\n\t\tPromise.resolve().then(() => runClientTransaction(router, tx, sameHref, () => offerPending(router, tx), opts?.sync, resolvedPrefix)).then()\n\t];\n\tif (process.env.NODE_ENV !== \"production\" && rematerialize) {\n\t\ttx[6] = [handoff];\n\t\trouter._refreshNextLoad = void 0;\n\t}\n\trouter._tx = tx;\n\tif (previousOwner) {\n\t\tfor (const match of router.stores.matches.get()) {\n\t\t\tif (router._tx !== tx) break;\n\t\t\tif (match.isFetching) setFetching(router, match, false);\n\t\t}\n\t\tpreviousOwner[0].abort();\n\t\ttransferMatchResources(router, previousOwner[3], tx[3], true);\n\t}\n\tif (router._tx !== tx) {\n\t\ttransferMatchResources(router, tx[3]);\n\t\ttx[3] = [];\n\t\tawait awaitCurrent(router, tx);\n\t\treturn;\n\t}\n\trouter.batch(() => {\n\t\trouter.stores.status.set(\"pending\");\n\t\trouter.stores.location.set(location);\n\t});\n\tif (resolvedPrefix || !router._committed.length && !matches.some((match) => match._notFound)) offerPending(router, tx);\n\tawait tx[5];\n\tawait awaitCurrent(router, tx);\n}\nasync function refreshClientRoute(router) {\n\tconst pending = router._tx;\n\tif (pending && !pending[6] && router.stores.status.get() === \"pending\") {\n\t\tawait pending[5];\n\t\tif (router._tx !== pending) await awaitCurrent(router, pending);\n\t}\n\trouter._flights?.clear();\n\trouter.clearCache();\n\trouter._refreshNextLoad = true;\n\tawait loadClientRoute(router, { sync: true });\n}\nasync function preloadClientRoute(router, opts, redirects = 0, builtLocation) {\n\tif (process.env.NODE_ENV !== \"production\" && (router._refreshNextLoad || router._tx?.[6])) return;\n\tconst location = builtLocation ?? router.buildLocation(opts);\n\tconst base = router._committed;\n\tconst controller = new AbortController();\n\tlet matches;\n\ttry {\n\t\tmatches = router.matchRoutes(location, { _controller: controller });\n\t\tacquireMatchResources(matches);\n\t} catch (cause) {\n\t\tcontroller.abort();\n\t\tif (!isNotFound(cause)) console.error(cause);\n\t\treturn;\n\t}\n\t(router._preloads ??= /* @__PURE__ */ new Map()).set(controller, matches);\n\tlet active;\n\ttry {\n\t\tlet result;\n\t\ttry {\n\t\t\tresult = await executeClientLane(router, location, matches, [\n\t\t\t\tcontroller,\n\t\t\t\tredirects,\n\t\t\t\tbase,\n\t\t\t\ttrue\n\t\t\t]);\n\t\t} finally {\n\t\t\tactive = router._preloads.delete(controller);\n\t\t\ttransferMatchResources(router, matches);\n\t\t\tcontroller.abort();\n\t\t}\n\t\tif (!isControl(result)) return result[1];\n\t\tif (active && result[0] === REDIRECTED && !result[1].options.reloadDocument) return preloadClientRoute(router, result[1].options, redirects + 1, result[2]);\n\t} catch (cause) {\n\t\tif (!isNotFound(cause)) console.error(cause);\n\t}\n}\nasync function hydrate(router) {\n\tif (process.env.NODE_ENV !== \"production\" && !window.$_TSR) throw new Error(\"Invariant failed: Expected to find bootstrap data on window.$_TSR, but we did not. Please file an issue!\");\n\tconst tsr = window.$_TSR;\n\tconst adapters = router.options.serializationAdapters;\n\tif (adapters?.length) {\n\t\ttsr.t = new Map(adapters.map((adapter) => [adapter.key, adapter.fromSerializable]));\n\t\ttsr.buffer.forEach((script) => script());\n\t}\n\ttsr.initialized = true;\n\tconst dehydratedRouter = tsr.router;\n\tif (process.env.NODE_ENV !== \"production\" && !dehydratedRouter) throw new Error(\"Invariant failed: Expected to find a dehydrated data on window.$_TSR.router, but we did not. Please file an issue!\");\n\trouter.ssr = { manifest: dehydratedRouter.manifest };\n\trouter.options.ssr = { nonce: document.querySelector(\"meta[property=\\\"csp-nonce\\\"]\")?.content };\n\tconst dehydratedMatches = dehydratedRouter.matches;\n\tconst controller = new AbortController();\n\tconst previousPreflight = router._preflight;\n\trouter._preflight = controller;\n\tpreviousPreflight?.abort();\n\tconst isCurrent = () => router._preflight === controller;\n\tlet location;\n\tlet candidates;\n\tlet handoffHistoryHref;\n\tlet handoffHistoryState;\n\ttry {\n\t\tawait waitFor(router.options.hydrate?.(dehydratedRouter.dehydratedData), controller.signal);\n\t\tif (!isCurrent()) return;\n\t\tconst historyLocation = router.history.location;\n\t\thandoffHistoryHref = historyLocation.href;\n\t\thandoffHistoryState = historyLocation.state;\n\t\trouter.updateLatestLocation();\n\t\tlocation = router.latestLocation;\n\t\trouter.stores.location.set(location);\n\t\tcandidates = router.matchRoutes(location, { _controller: controller });\n\t} catch (cause) {\n\t\tif (isCurrent()) router._preflight = void 0;\n\t\tcontroller.abort(cause);\n\t\tif (cause !== controller.signal) throw cause;\n\t}\n\tif (!isCurrent()) return;\n\tconst committed = [];\n\tlet pendingBoundary;\n\tlet verifiedAssetEnd = 0;\n\tconst retryFrom = (index) => {\n\t\tverifiedAssetEnd = Math.min(verifiedAssetEnd, index + 1);\n\t\tconst removed = committed.splice(index);\n\t\tfor (const match of removed) if (getRoute(router, match).options.loader && (match.status === \"success\" || !match.invalid && \"loaderData\" in match)) cacheLoaderMatch(router, {\n\t\t\t...match,\n\t\t\tstatus: \"success\",\n\t\t\terror: void 0,\n\t\t\tpreload: true\n\t\t}, router._cache.get(match.id));\n\t\ttransferMatchResources(router, removed);\n\t};\n\tconst shared = dehydratedMatches.length > candidates.length ? candidates.findIndex((match) => match._notFound) + 1 : dehydratedMatches.length;\n\tlet isTerminal = false;\n\tfor (let index = 0; index < shared; index++) {\n\t\tconst candidate = candidates[index];\n\t\tconst dehydrated = dehydratedMatches[index];\n\t\tif (typeof dehydrated.i !== \"string\" || hydrateSsrMatchId(dehydrated.i) !== candidate.id) {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tverifiedAssetEnd = index + 1;\n\t\tconst route = getRoute(router, candidate);\n\t\tif (\"l\" in dehydrated || dehydrated.s === \"success\" && dehydrated.e === void 0 && route.options.loader) candidate.loaderData = dehydrated.l;\n\t\tcandidate.status = dehydrated.s;\n\t\tcandidate.ssr = dehydrated.ssr;\n\t\troute.options.ssr = candidate.ssr;\n\t\tcandidate.updatedAt = dehydrated.u;\n\t\tcandidate.error = dehydrated.e;\n\t\tcandidate._notFound ||= dehydrated.g;\n\t\tif (candidate.status === \"error\" || candidate.status === \"notFound\" || candidate._notFound) {\n\t\t\tisTerminal = true;\n\t\t\tcommitted.push(candidate);\n\t\t\tif (candidate.ssr === false || candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tif (candidate.status === \"pending\") {\n\t\t\tpendingBoundary ??= index;\n\t\t\tbreak;\n\t\t}\n\t\tcommitted.push(candidate);\n\t\tif (candidate.ssr === \"data-only\") pendingBoundary ??= index;\n\t}\n\tif (!isTerminal && committed.length === shared && shared < candidates.length) pendingBoundary = shared;\n\tconst chunks = committed.map(async (match) => {\n\t\ttry {\n\t\t\tconst route = getRoute(router, match);\n\t\t\tif (match._notFound) await Promise.all([loadRouteChunk(route), loadRouteChunk(route, \"notFoundComponent\")]);\n\t\t\telse await loadRouteChunk(route, match.status === \"error\" ? \"errorComponent\" : match.status === \"notFound\" ? \"notFoundComponent\" : void 0);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t});\n\tlet chunkFailure = 0;\n\ttry {\n\t\twhile (chunkFailure < chunks.length && await waitFor(chunks[chunkFailure], controller.signal)) chunkFailure++;\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isCurrent()) return;\n\tif (chunkFailure < committed.length) retryFrom(chunkFailure);\n\tconst contextEnd = Math.max(pendingBoundary === committed.length ? committed.length + 1 : committed.length, chunkFailure < chunks.length ? chunkFailure : verifiedAssetEnd);\n\tfor (let index = 0; index < contextEnd; index++) {\n\t\tconst match = candidates[index];\n\t\tconst route = getRoute(router, match);\n\t\tconst parentContext = candidates[index - 1]?.context ?? router.options.context ?? {};\n\t\tlet routeContext;\n\t\tif (route.options.context) {\n\t\t\ttry {\n\t\t\t\trouteContext = match._ctx = route.options.context({\n\t\t\t\t\tdeps: match.loaderDeps,\n\t\t\t\t\tparams: match.params,\n\t\t\t\t\tcontext: parentContext,\n\t\t\t\t\tlocation,\n\t\t\t\t\tnavigate: (opts) => router.navigate({\n\t\t\t\t\t\t...opts,\n\t\t\t\t\t\t_fromLocation: location\n\t\t\t\t\t}),\n\t\t\t\t\tbuildLocation: router.buildLocation,\n\t\t\t\t\tcause: match.cause,\n\t\t\t\t\tabortController: controller,\n\t\t\t\t\tpreload: false,\n\t\t\t\t\tmatches: candidates,\n\t\t\t\t\trouteId: route.id\n\t\t\t\t}) || {};\n\t\t\t} catch {\n\t\t\t\tif (!isCurrent()) return;\n\t\t\t\tif (match.status !== \"error\" && match.status !== \"notFound\" && !match._notFound) {\n\t\t\t\t\tretryFrom(index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isCurrent()) return;\n\t\t}\n\t\tmatch.context = {\n\t\t\t...parentContext,\n\t\t\t...routeContext,\n\t\t\t...committed[index] && dehydratedMatches[index].b\n\t\t};\n\t}\n\tawait projectLane(router, [location, candidates], controller.signal, 0, verifiedAssetEnd);\n\tif (!isCurrent()) return;\n\tconst needsClientLoad = pendingBoundary !== void 0 || committed.length < shared;\n\tconst committedMatches = isTerminal && committed.length === shared ? candidates : committed;\n\tlet presented = needsClientLoad ? candidates : committedMatches;\n\tlet dataOnlyAssetEnd;\n\tif (needsClientLoad && pendingBoundary !== void 0) {\n\t\tconst boundary = presented[pendingBoundary];\n\t\tdataOnlyAssetEnd = boundary.ssr === \"data-only\" && verifiedAssetEnd > pendingBoundary + 1 ? verifiedAssetEnd : void 0;\n\t\tpresented = presented.slice();\n\t\tpresented[pendingBoundary] = {\n\t\t\t...boundary,\n\t\t\tstatus: \"pending\",\n\t\t\tssr: boundary.ssr === \"data-only\" ? \"data-only\" : false,\n\t\t\t_assetEnd: dataOnlyAssetEnd\n\t\t};\n\t}\n\tconst claim = () => {\n\t\tconst historyLocation = router.history.location;\n\t\treturn needsClientLoad && !router._tx && historyLocation.href === handoffHistoryHref && historyLocation.state === handoffHistoryState && router._committed === committedMatches && committedMatches.length && !controller.signal.aborted ? controller : void 0;\n\t};\n\tconst handoff = [claim, (matches) => {\n\t\tif (router._handoff !== handoff) return;\n\t\trouter._handoff = void 0;\n\t\tconst prefix = committedMatches.length;\n\t\tif (!matches || !claim() || committedMatches.some((match, index) => match.id !== matches[index]?.id)) {\n\t\t\tcontroller.abort();\n\t\t\treturn;\n\t\t}\n\t\tlet handoffAssetEnd = dataOnlyAssetEnd;\n\t\tif (handoffAssetEnd !== void 0) {\n\t\t\tfor (let index = prefix; index < handoffAssetEnd; index++) if (candidates[index]?.id !== matches[index]?.id) {\n\t\t\t\thandoffAssetEnd = index > pendingBoundary + 1 ? index : void 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst clones = committedMatches.map((match) => ({ ...match }));\n\t\tif (handoffAssetEnd !== void 0) clones[pendingBoundary]._assetEnd = handoffAssetEnd;\n\t\ttransferMatchResources(router, matches.splice(0, prefix, ...clones));\n\t\tfor (let index = prefix; index < matches.length; index++) {\n\t\t\tconst match = matches[index];\n\t\t\tconst hydrated = candidates[index];\n\t\t\tif (hydrated?.id === match.id && hydrated._ctx) match._ctx = hydrated._ctx;\n\t\t\tmatch.abortController = controller;\n\t\t}\n\t\treturn prefix;\n\t}];\n\trouter._committed = committedMatches;\n\trouter._handoff = handoff;\n\trouter._preflight = void 0;\n\trouter.batch(() => {\n\t\trouter.stores.setMatches(presented);\n\t\trouter.stores.status.set(\"idle\");\n\t\tif (!needsClientLoad) router.stores.resolvedLocation.set(router.stores.location.get());\n\t});\n}\n//#endregion\nexport { _getAssetMatches, _getRenderedMatches, hydrate, loadClientRoute, loadRouteChunk, preloadClientRoute, refreshClientRoute, replaceRouteChunk };\n\n//# sourceMappingURL=load-client.js.map","//#region src/link.ts\nconst preloadWarning = \"Error preloading route! ☝️\";\n//#endregion\nexport { preloadWarning };\n\n//# sourceMappingURL=link.js.map","import { invariant } from \"./invariant.js\";\nimport { joinPaths, trimPathLeft, trimPathRight } from \"./path.js\";\nimport { notFound } from \"./not-found.js\";\nimport { rootRouteId } from \"./root.js\";\nimport { redirect } from \"./redirect.js\";\n//#region src/route.ts\nvar BaseRoute = class {\n\tget to() {\n\t\treturn this._to;\n\t}\n\tget id() {\n\t\treturn this._id;\n\t}\n\tget path() {\n\t\treturn this._path;\n\t}\n\tget fullPath() {\n\t\treturn this._fullPath;\n\t}\n\tconstructor(options) {\n\t\tthis.init = (opts) => {\n\t\t\tthis.originalIndex = opts.originalIndex;\n\t\t\tconst options = this.options;\n\t\t\tconst isRoot = !options?.path && !options?.id;\n\t\t\tthis.parentRoute = this.options.getParentRoute?.();\n\t\t\tif (isRoot) this._path = rootRouteId;\n\t\t\telse if (!this.parentRoute) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);\n\t\t\t\tinvariant();\n\t\t\t}\n\t\t\tlet path = isRoot ? rootRouteId : options?.path;\n\t\t\tif (path && path !== \"/\") path = trimPathLeft(path);\n\t\t\tconst customId = options?.id || path;\n\t\t\tlet id = isRoot ? rootRouteId : joinPaths([this.parentRoute.id === \"__root__\" ? \"\" : this.parentRoute.id, customId]);\n\t\t\tif (path === \"__root__\") path = \"/\";\n\t\t\tif (id !== \"__root__\") id = joinPaths([\"/\", id]);\n\t\t\tconst fullPath = id === \"__root__\" ? \"/\" : joinPaths([this.parentRoute.fullPath, path]);\n\t\t\tthis._path = path;\n\t\t\tthis._id = id;\n\t\t\tthis._fullPath = fullPath;\n\t\t\tthis._to = trimPathRight(fullPath);\n\t\t};\n\t\tthis.addChildren = (children) => {\n\t\t\treturn this._addFileChildren(children);\n\t\t};\n\t\tthis._addFileChildren = (children) => {\n\t\t\tif (Array.isArray(children)) this.children = children;\n\t\t\tif (typeof children === \"object\" && children !== null) this.children = Object.values(children);\n\t\t\treturn this;\n\t\t};\n\t\tthis._addFileTypes = () => {\n\t\t\treturn this;\n\t\t};\n\t\tthis.updateLoader = (options) => {\n\t\t\tObject.assign(this.options, options);\n\t\t\treturn this;\n\t\t};\n\t\tthis.update = (options) => {\n\t\t\tObject.assign(this.options, options);\n\t\t\treturn this;\n\t\t};\n\t\tthis.lazy = (lazyFn) => {\n\t\t\tthis.lazyFn = lazyFn;\n\t\t\treturn this;\n\t\t};\n\t\tthis.redirect = (opts) => redirect({\n\t\t\tfrom: this.fullPath,\n\t\t\t...opts\n\t\t});\n\t\tthis.options = options || {};\n\t\tthis.isRoot = !options?.getParentRoute;\n\t\tif (options?.id && options?.path) throw new Error(`Route cannot have both an 'id' and a 'path' option.`);\n\t}\n};\nvar BaseRouteApi = class {\n\tconstructor({ id }) {\n\t\tthis.notFound = (opts) => {\n\t\t\treturn notFound({\n\t\t\t\trouteId: this.id,\n\t\t\t\t...opts\n\t\t\t});\n\t\t};\n\t\tthis.redirect = (opts) => redirect({\n\t\t\tfrom: this.id,\n\t\t\t...opts\n\t\t});\n\t\tthis.id = id;\n\t}\n};\nvar BaseRootRoute = class extends BaseRoute {\n\tconstructor(options) {\n\t\tsuper(options);\n\t}\n};\n//#endregion\nexport { BaseRootRoute, BaseRoute, BaseRouteApi };\n\n//# sourceMappingURL=route.js.map","\"use client\";\nimport { wrapInNonRouteComponentContext } from \"./nonRouteComponentContext.js\";\nimport * as React$1 from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/CatchBoundary.tsx\nvar CatchBoundary = class extends React$1.Component {\n\tconstructor(..._args) {\n\t\tsuper(..._args);\n\t\tthis.state = { error: null };\n\t\tthis.reset = () => {\n\t\t\tthis.setState({ error: null });\n\t\t};\n\t}\n\tstatic getDerivedStateFromProps(props, state) {\n\t\tconst resetKey = props.getResetKey();\n\t\tif (state.error && state.resetKey !== resetKey) return {\n\t\t\tresetKey,\n\t\t\terror: null\n\t\t};\n\t\treturn { resetKey };\n\t}\n\tstatic getDerivedStateFromError(error) {\n\t\treturn { error };\n\t}\n\tcomponentDidCatch(error, errorInfo) {\n\t\tthis.props.onCatch?.(error, errorInfo);\n\t}\n\trender() {\n\t\tconst error = this.state.error;\n\t\tif (error) {\n\t\t\tconst element = React$1.createElement(this.props.errorComponent ?? ErrorComponent, {\n\t\t\t\terror,\n\t\t\t\treset: this.reset\n\t\t\t});\n\t\t\treturn process.env.NODE_ENV !== \"production\" ? wrapInNonRouteComponentContext(element, \"errorComponent\") : element;\n\t\t}\n\t\treturn this.props.children;\n\t}\n};\nfunction ErrorComponent({ error }) {\n\tconst [show, setShow] = React$1.useState(process.env.NODE_ENV !== \"production\");\n\treturn /* @__PURE__ */ jsxs(\"div\", {\n\t\tstyle: {\n\t\t\tpadding: \".5rem\",\n\t\t\tmaxWidth: \"100%\"\n\t\t},\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\tstyle: {\n\t\t\t\t\tdisplay: \"flex\",\n\t\t\t\t\talignItems: \"center\",\n\t\t\t\t\tgap: \".5rem\"\n\t\t\t\t},\n\t\t\t\tchildren: [/* @__PURE__ */ jsx(\"strong\", {\n\t\t\t\t\tstyle: { fontSize: \"1rem\" },\n\t\t\t\t\tchildren: \"Something went wrong!\"\n\t\t\t\t}), /* @__PURE__ */ jsx(\"button\", {\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tappearance: \"none\",\n\t\t\t\t\t\tfontSize: \".6em\",\n\t\t\t\t\t\tborder: \"1px solid currentColor\",\n\t\t\t\t\t\tpadding: \".1rem .2rem\",\n\t\t\t\t\t\tfontWeight: \"bold\",\n\t\t\t\t\t\tborderRadius: \".25rem\"\n\t\t\t\t\t},\n\t\t\t\t\tonClick: () => setShow((d) => !d),\n\t\t\t\t\tchildren: show ? \"Hide Error\" : \"Show Error\"\n\t\t\t\t})]\n\t\t\t}),\n\t\t\t/* @__PURE__ */ jsx(\"div\", { style: { height: \".25rem\" } }),\n\t\t\tshow ? /* @__PURE__ */ jsx(\"div\", { children: /* @__PURE__ */ jsx(\"pre\", {\n\t\t\t\tstyle: {\n\t\t\t\t\tfontSize: \".7em\",\n\t\t\t\t\tborder: \"1px solid red\",\n\t\t\t\t\tborderRadius: \".25rem\",\n\t\t\t\t\tpadding: \".3rem\",\n\t\t\t\t\tcolor: \"red\",\n\t\t\t\t\toverflow: \"auto\"\n\t\t\t\t},\n\t\t\t\tchildren: error.message ? /* @__PURE__ */ jsx(\"code\", { children: error.message }) : null\n\t\t\t}) }) : null\n\t\t]\n\t});\n}\n//#endregion\nexport { CatchBoundary, ErrorComponent };\n\n//# sourceMappingURL=CatchBoundary.js.map","\"use client\";\nimport React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/ClientOnly.tsx\n/**\n* Render the children only after the JS has loaded client-side. Use an optional\n* fallback component if the JS is not yet loaded.\n*\n* @example\n* Render a Chart component if JS loads, renders a simple FakeChart\n* component server-side or if there is no JS. The FakeChart can have only the\n* UI without the behavior or be a loading spinner or skeleton.\n*\n* ```tsx\n* return (\n* <ClientOnly fallback={<FakeChart />}>\n* <Chart />\n* </ClientOnly>\n* )\n* ```\n*/\nfunction ClientOnly({ children, fallback = null }) {\n\treturn /* @__PURE__ */ jsx(React.Fragment, { children: useHydrated() ? children : fallback });\n}\n/**\n* Return a boolean indicating if the JS has been hydrated already.\n* When doing Server-Side Rendering, the result will always be false.\n* When doing Client-Side Rendering, the result will always be false on the\n* first render and true from then on. Even if a new component renders it will\n* always start with true.\n*\n* @example\n* ```tsx\n* // Disable a button that needs JS to work.\n* let hydrated = useHydrated()\n* return (\n* <button type=\"button\" disabled={!hydrated} onClick={doSomethingCustom}>\n* Click me\n* </button>\n* )\n* ```\n* @returns True if the JS has been hydrated already, false otherwise.\n*/\nfunction useHydrated() {\n\treturn React.useSyncExternalStore(subscribe, () => true, () => false);\n}\nfunction subscribe() {\n\treturn () => {};\n}\n//#endregion\nexport { ClientOnly, useHydrated };\n\n//# sourceMappingURL=ClientOnly.js.map","\"use client\";\nimport * as React$1 from \"react\";\n//#region src/routerContext.tsx\nvar routerContext = React$1.createContext(null);\n//#endregion\nexport { routerContext };\n\n//# sourceMappingURL=routerContext.js.map","\"use client\";\nimport { routerContext } from \"./routerContext.js\";\nimport * as React$1 from \"react\";\n//#region src/useRouter.tsx\n/**\n* Access the current TanStack Router instance from React context.\n* Must be used within a `RouterProvider`.\n*\n* Options:\n* - `warn`: Log a warning if no router context is found (default: true).\n*\n* @returns The registered router instance.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook\n*/\nfunction useRouter(opts) {\n\tconst value = React$1.useContext(routerContext);\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tif ((opts?.warn ?? true) && !value) console.warn(\"Warning: useRouter must be used inside a <RouterProvider> component!\");\n\t}\n\treturn value;\n}\n//#endregion\nexport { useRouter };\n\n//# sourceMappingURL=useRouter.js.map","\"use client\";\nimport * as React$1 from \"react\";\n//#region src/matchContext.tsx\nvar matchContext = React$1.createContext(void 0);\nvar dummyMatchContext = React$1.createContext(void 0);\n//#endregion\nexport { dummyMatchContext, matchContext };\n\n//# sourceMappingURL=matchContext.js.map","var ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => {\n ReactiveFlags2[ReactiveFlags2[\"None\"] = 0] = \"None\";\n ReactiveFlags2[ReactiveFlags2[\"Mutable\"] = 1] = \"Mutable\";\n ReactiveFlags2[ReactiveFlags2[\"Watching\"] = 2] = \"Watching\";\n ReactiveFlags2[ReactiveFlags2[\"RecursedCheck\"] = 4] = \"RecursedCheck\";\n ReactiveFlags2[ReactiveFlags2[\"Recursed\"] = 8] = \"Recursed\";\n ReactiveFlags2[ReactiveFlags2[\"Dirty\"] = 16] = \"Dirty\";\n ReactiveFlags2[ReactiveFlags2[\"Pending\"] = 32] = \"Pending\";\n return ReactiveFlags2;\n})(ReactiveFlags || {});\n// @__NO_SIDE_EFFECTS__\nfunction createReactiveSystem({\n update,\n notify,\n unwatched\n}) {\n return {\n link,\n unlink,\n propagate,\n checkDirty,\n shallowPropagate\n };\n function link(dep, sub, version) {\n const prevDep = sub.depsTail;\n if (prevDep !== void 0 && prevDep.dep === dep) {\n return;\n }\n const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;\n if (nextDep !== void 0 && nextDep.dep === dep) {\n nextDep.version = version;\n sub.depsTail = nextDep;\n return;\n }\n const prevSub = dep.subsTail;\n if (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) {\n return;\n }\n const newLink = sub.depsTail = dep.subsTail = {\n version,\n dep,\n sub,\n prevDep,\n nextDep,\n prevSub,\n nextSub: void 0\n };\n if (nextDep !== void 0) {\n nextDep.prevDep = newLink;\n }\n if (prevDep !== void 0) {\n prevDep.nextDep = newLink;\n } else {\n sub.deps = newLink;\n }\n if (prevSub !== void 0) {\n prevSub.nextSub = newLink;\n } else {\n dep.subs = newLink;\n }\n }\n function unlink(link2, sub = link2.sub) {\n const dep = link2.dep;\n const prevDep = link2.prevDep;\n const nextDep = link2.nextDep;\n const nextSub = link2.nextSub;\n const prevSub = link2.prevSub;\n if (nextDep !== void 0) {\n nextDep.prevDep = prevDep;\n } else {\n sub.depsTail = prevDep;\n }\n if (prevDep !== void 0) {\n prevDep.nextDep = nextDep;\n } else {\n sub.deps = nextDep;\n }\n if (nextSub !== void 0) {\n nextSub.prevSub = prevSub;\n } else {\n dep.subsTail = prevSub;\n }\n if (prevSub !== void 0) {\n prevSub.nextSub = nextSub;\n } else if ((dep.subs = nextSub) === void 0) {\n unwatched(dep);\n }\n return nextDep;\n }\n function propagate(link2) {\n let next = link2.nextSub;\n let stack;\n top: do {\n const sub = link2.sub;\n let flags = sub.flags;\n if (!(flags & (4 | 8 | 16 | 32))) {\n sub.flags = flags | 32;\n } else if (!(flags & (4 | 8))) {\n flags = 0;\n } else if (!(flags & 4)) {\n sub.flags = flags & -9 | 32;\n } else if (!(flags & (16 | 32)) && isValidLink(link2, sub)) {\n sub.flags = flags | (8 | 32);\n flags &= 1;\n } else {\n flags = 0;\n }\n if (flags & 2) {\n notify(sub);\n }\n if (flags & 1) {\n const subSubs = sub.subs;\n if (subSubs !== void 0) {\n const nextSub = (link2 = subSubs).nextSub;\n if (nextSub !== void 0) {\n stack = { value: next, prev: stack };\n next = nextSub;\n }\n continue;\n }\n }\n if ((link2 = next) !== void 0) {\n next = link2.nextSub;\n continue;\n }\n while (stack !== void 0) {\n link2 = stack.value;\n stack = stack.prev;\n if (link2 !== void 0) {\n next = link2.nextSub;\n continue top;\n }\n }\n break;\n } while (true);\n }\n function checkDirty(link2, sub) {\n let stack;\n let checkDepth = 0;\n let dirty = false;\n top: do {\n const dep = link2.dep;\n const flags = dep.flags;\n if (sub.flags & 16) {\n dirty = true;\n } else if ((flags & (1 | 16)) === (1 | 16)) {\n if (update(dep)) {\n const subs = dep.subs;\n if (subs.nextSub !== void 0) {\n shallowPropagate(subs);\n }\n dirty = true;\n }\n } else if ((flags & (1 | 32)) === (1 | 32)) {\n if (link2.nextSub !== void 0 || link2.prevSub !== void 0) {\n stack = { value: link2, prev: stack };\n }\n link2 = dep.deps;\n sub = dep;\n ++checkDepth;\n continue;\n }\n if (!dirty) {\n const nextDep = link2.nextDep;\n if (nextDep !== void 0) {\n link2 = nextDep;\n continue;\n }\n }\n while (checkDepth--) {\n const firstSub = sub.subs;\n const hasMultipleSubs = firstSub.nextSub !== void 0;\n if (hasMultipleSubs) {\n link2 = stack.value;\n stack = stack.prev;\n } else {\n link2 = firstSub;\n }\n if (dirty) {\n if (update(sub)) {\n if (hasMultipleSubs) {\n shallowPropagate(firstSub);\n }\n sub = link2.sub;\n continue;\n }\n dirty = false;\n } else {\n sub.flags &= -33;\n }\n sub = link2.sub;\n const nextDep = link2.nextDep;\n if (nextDep !== void 0) {\n link2 = nextDep;\n continue top;\n }\n }\n return dirty;\n } while (true);\n }\n function shallowPropagate(link2) {\n do {\n const sub = link2.sub;\n const flags = sub.flags;\n if ((flags & (32 | 16)) === 32) {\n sub.flags = flags | 16;\n if ((flags & (2 | 4)) === 2) {\n notify(sub);\n }\n }\n } while ((link2 = link2.nextSub) !== void 0);\n }\n function isValidLink(checkLink, sub) {\n let link2 = sub.depsTail;\n while (link2 !== void 0) {\n if (link2 === checkLink) {\n return true;\n }\n link2 = link2.prevDep;\n }\n return false;\n }\n}\nexport {\n ReactiveFlags,\n createReactiveSystem\n};\n//# sourceMappingURL=alien.js.map\n","import { createReactiveSystem, ReactiveFlags } from \"./alien.js\";\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n const isObserver = typeof nextHandler === \"object\";\n const self = isObserver ? nextHandler : void 0;\n return {\n next: (isObserver ? nextHandler.next : nextHandler)?.bind(self),\n error: (isObserver ? nextHandler.error : errorHandler)?.bind(self),\n complete: (isObserver ? nextHandler.complete : completionHandler)?.bind(\n self\n )\n };\n}\nconst queuedEffects = [];\nlet cycle = 0;\nconst { link, unlink, propagate, checkDirty, shallowPropagate } = createReactiveSystem({\n update(atom) {\n return atom._update();\n },\n // eslint-disable-next-line no-shadow\n notify(effect2) {\n queuedEffects[queuedEffectsLength++] = effect2;\n effect2.flags &= ~ReactiveFlags.Watching;\n },\n unwatched(atom) {\n if (atom.depsTail !== void 0) {\n atom.depsTail = void 0;\n atom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n purgeDeps(atom);\n }\n }\n});\nlet notifyIndex = 0;\nlet queuedEffectsLength = 0;\nlet activeSub;\nlet batchDepth = 0;\nfunction batch(fn) {\n try {\n ++batchDepth;\n fn();\n } finally {\n if (!--batchDepth) {\n flush();\n }\n }\n}\nfunction purgeDeps(sub) {\n const depsTail = sub.depsTail;\n let dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;\n while (dep !== void 0) {\n dep = unlink(dep, sub);\n }\n}\nfunction flush() {\n if (batchDepth > 0) {\n return;\n }\n while (notifyIndex < queuedEffectsLength) {\n const effect2 = queuedEffects[notifyIndex];\n queuedEffects[notifyIndex++] = void 0;\n effect2.notify();\n }\n notifyIndex = 0;\n queuedEffectsLength = 0;\n}\nfunction createAsyncAtom(getValue, options) {\n const ref = {};\n const atom = createAtom(() => {\n getValue().then(\n (data) => {\n const internalAtom = ref.current;\n if (internalAtom._update({ status: \"done\", data })) {\n const subs = internalAtom.subs;\n if (subs !== void 0) {\n propagate(subs);\n shallowPropagate(subs);\n flush();\n }\n }\n },\n (error) => {\n const internalAtom = ref.current;\n if (internalAtom._update({ status: \"error\", error })) {\n const subs = internalAtom.subs;\n if (subs !== void 0) {\n propagate(subs);\n shallowPropagate(subs);\n flush();\n }\n }\n }\n );\n return { status: \"pending\" };\n }, options);\n ref.current = atom;\n return atom;\n}\nfunction createAtom(valueOrFn, options) {\n const isComputed = typeof valueOrFn === \"function\";\n const getter = valueOrFn;\n const atom = {\n _snapshot: isComputed ? void 0 : valueOrFn,\n subs: void 0,\n subsTail: void 0,\n deps: void 0,\n depsTail: void 0,\n flags: isComputed ? ReactiveFlags.None : ReactiveFlags.Mutable,\n get() {\n if (activeSub !== void 0) {\n link(atom, activeSub, cycle);\n }\n return atom._snapshot;\n },\n subscribe(observerOrFn) {\n const obs = toObserver(observerOrFn);\n const observed = { current: false };\n const e = effect(() => {\n atom.get();\n if (!observed.current) {\n observed.current = true;\n } else {\n obs.next?.(atom._snapshot);\n }\n });\n return {\n unsubscribe: () => {\n e.stop();\n }\n };\n },\n _update(getValue) {\n const prevSub = activeSub;\n const compare = options?.compare ?? Object.is;\n if (isComputed) {\n activeSub = atom;\n ++cycle;\n atom.depsTail = void 0;\n } else if (getValue === void 0) {\n return false;\n }\n if (isComputed) {\n atom.flags = ReactiveFlags.Mutable | ReactiveFlags.RecursedCheck;\n }\n try {\n const oldValue = atom._snapshot;\n const newValue = typeof getValue === \"function\" ? getValue(oldValue) : getValue === void 0 && isComputed ? getter(oldValue) : getValue;\n if (oldValue === void 0 || !compare(oldValue, newValue)) {\n atom._snapshot = newValue;\n return true;\n }\n return false;\n } finally {\n activeSub = prevSub;\n if (isComputed) {\n atom.flags &= ~ReactiveFlags.RecursedCheck;\n }\n purgeDeps(atom);\n }\n }\n };\n if (isComputed) {\n atom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n atom.get = function() {\n const flags = atom.flags;\n if (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(atom.deps, atom)) {\n if (atom._update()) {\n const subs = atom.subs;\n if (subs !== void 0) {\n shallowPropagate(subs);\n }\n }\n } else if (flags & ReactiveFlags.Pending) {\n atom.flags = flags & ~ReactiveFlags.Pending;\n }\n if (activeSub !== void 0) {\n link(atom, activeSub, cycle);\n }\n return atom._snapshot;\n };\n } else {\n atom.set = function(valueOrFn2) {\n if (atom._update(valueOrFn2)) {\n const subs = atom.subs;\n if (subs !== void 0) {\n propagate(subs);\n shallowPropagate(subs);\n flush();\n }\n }\n };\n }\n return atom;\n}\nfunction effect(fn) {\n const run = () => {\n const prevSub = activeSub;\n activeSub = effectObj;\n ++cycle;\n effectObj.depsTail = void 0;\n effectObj.flags = ReactiveFlags.Watching | ReactiveFlags.RecursedCheck;\n try {\n return fn();\n } finally {\n activeSub = prevSub;\n effectObj.flags &= ~ReactiveFlags.RecursedCheck;\n purgeDeps(effectObj);\n }\n };\n const effectObj = {\n deps: void 0,\n depsTail: void 0,\n subs: void 0,\n subsTail: void 0,\n flags: ReactiveFlags.Watching | ReactiveFlags.RecursedCheck,\n notify() {\n const flags = this.flags;\n if (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(this.deps, this)) {\n run();\n } else {\n this.flags = ReactiveFlags.Watching;\n }\n },\n stop() {\n this.flags = ReactiveFlags.None;\n this.depsTail = void 0;\n purgeDeps(this);\n }\n };\n run();\n return effectObj;\n}\nexport {\n batch,\n createAsyncAtom,\n createAtom,\n flush,\n toObserver\n};\n//# sourceMappingURL=atom.js.map\n","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import { useCallback } from \"react\";\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/shim/with-selector\";\nfunction defaultCompare(a, b) {\n return a === b;\n}\nfunction useStore(atom, selector, compare = defaultCompare) {\n const subscribe = useCallback(\n (handleStoreChange) => {\n if (!atom) {\n return () => {\n };\n }\n const { unsubscribe } = atom.subscribe(handleStoreChange);\n return unsubscribe;\n },\n [atom]\n );\n const boundGetSnapshot = useCallback(() => atom?.get(), [atom]);\n const selectedSnapshot = useSyncExternalStoreWithSelector(\n subscribe,\n boundGetSnapshot,\n boundGetSnapshot,\n selector,\n compare\n );\n return selectedSnapshot;\n}\nexport {\n useStore\n};\n//# sourceMappingURL=useStore.js.map\n","\"use client\";\nimport { dummyMatchContext, matchContext } from \"./matchContext.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { invariant, replaceEqualDeep } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { useStore } from \"@tanstack/react-store\";\n//#region src/useMatch.tsx\nvar dummyMatch = {};\nfunction useStructuralSharing(opts, router) {\n\tconst previousResult = React$1.useRef();\n\treturn (slice) => {\n\t\tconst selected = opts?.select ? opts.select(slice) : slice;\n\t\tif (opts?.structuralSharing ?? router.options.defaultStructuralSharing) return previousResult.current = replaceEqualDeep(previousResult.current, selected);\n\t\treturn selected;\n\t};\n}\n/**\n* Read and select the nearest or targeted route match.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook\n*/\nfunction useMatch(opts) {\n\tconst router = useRouter();\n\tconst nearestRouteId = React$1.useContext(opts.from ? dummyMatchContext : matchContext);\n\tconst routeId = opts.from ?? nearestRouteId;\n\tconst matchStore = router.stores.getMatchStore(routeId);\n\tif (isServer ?? router.isServer) {\n\t\tconst match = matchStore.get();\n\t\tif (!match) {\n\t\t\tif (opts.shouldThrow ?? true) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : \"a nearest match!\"}`);\n\t\t\t\tinvariant();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\treturn opts.select ? opts.select(match) : match;\n\t}\n\tconst selector = useStructuralSharing(opts, router);\n\tconst matchSelection = useStore(matchStore, (match) => match ? selector(match) : dummyMatch);\n\tif (matchSelection !== dummyMatch) return matchSelection;\n\tif (opts.shouldThrow ?? true) {\n\t\tif (process.env.NODE_ENV !== \"production\") throw new Error(`Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : \"a nearest match!\"}`);\n\t\tinvariant();\n\t}\n}\n//#endregion\nexport { useMatch, useStructuralSharing };\n\n//# sourceMappingURL=useMatch.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useLoaderData.tsx\n/**\n* Read and select the current route's loader data with type‑safety.\n*\n* Options:\n* - `from`/`strict`: Choose which route's data to read and strictness\n* - `select`: Map the loader data to a derived value\n* - `structuralSharing`: Enable structural sharing for stable references\n*\n* @returns The loader data (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook\n*/\nfunction useLoaderData(opts) {\n\treturn useMatch({\n\t\tfrom: opts.from,\n\t\tstrict: opts.strict,\n\t\tstructuralSharing: opts.structuralSharing,\n\t\tselect: (match) => {\n\t\t\treturn opts.select ? opts.select(match.loaderData) : match.loaderData;\n\t\t}\n\t});\n}\n//#endregion\nexport { useLoaderData };\n\n//# sourceMappingURL=useLoaderData.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useLoaderDeps.tsx\n/**\n* Read and select the current route's loader dependencies object.\n*\n* Options:\n* - `from`: Choose which route's loader deps to read\n* - `select`: Map the deps to a derived value\n* - `structuralSharing`: Enable structural sharing for stable references\n*\n* @returns The loader deps (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook\n*/\nfunction useLoaderDeps(opts) {\n\tconst { select, ...rest } = opts;\n\treturn useMatch({\n\t\t...rest,\n\t\tselect: (match) => {\n\t\t\treturn select ? select(match.loaderDeps) : match.loaderDeps;\n\t\t}\n\t});\n}\n//#endregion\nexport { useLoaderDeps };\n\n//# sourceMappingURL=useLoaderDeps.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useParams.tsx\n/**\n* Access the current route's path parameters with type-safety.\n*\n* Options:\n* - `from`/`strict`: Specify the matched route and whether to enforce strict typing\n* - `select`: Project the params object to a derived value for memoized renders\n* - `structuralSharing`: Enable structural sharing for stable references\n* - `shouldThrow`: Throw if the route is not found in strict contexts\n*\n* @returns The params object (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook\n*/\nfunction useParams(opts) {\n\treturn useMatch({\n\t\tfrom: opts.from,\n\t\tshouldThrow: opts.shouldThrow,\n\t\tstructuralSharing: opts.structuralSharing,\n\t\tstrict: opts.strict,\n\t\tselect: (match) => {\n\t\t\tconst params = opts.strict === false ? match.params : match._strictParams;\n\t\t\treturn opts.select ? opts.select(params) : params;\n\t\t}\n\t});\n}\n//#endregion\nexport { useParams };\n\n//# sourceMappingURL=useParams.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useSearch.tsx\n/**\n* Read and select the current route's search parameters with type-safety.\n*\n* Options:\n* - `from`/`strict`: Control which route's search is read and how strictly it's typed\n* - `select`: Map the search object to a derived value for render optimization\n* - `structuralSharing`: Enable structural sharing for stable references\n* - `shouldThrow`: Throw when the route is not found (strict contexts)\n*\n* @returns The search object (or selected value) for the matched route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook\n*/\nfunction useSearch(opts) {\n\treturn useMatch({\n\t\tfrom: opts.from,\n\t\tstrict: opts.strict,\n\t\tshouldThrow: opts.shouldThrow,\n\t\tstructuralSharing: opts.structuralSharing,\n\t\tselect: (match) => {\n\t\t\treturn opts.select ? opts.select(match.search) : match.search;\n\t\t}\n\t});\n}\n//#endregion\nexport { useSearch };\n\n//# sourceMappingURL=useSearch.js.map","\"use client\";\nimport { useLayoutEffect } from \"./utils.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport * as React$1 from \"react\";\n//#region src/useNavigate.tsx\n/**\n* Imperative navigation hook.\n*\n* Returns a stable `navigate(options)` function to change the current location\n* programmatically. Prefer the `Link` component for user-initiated navigation,\n* and use this hook from effects, callbacks, or handlers where imperative\n* navigation is required.\n*\n* Options:\n* - `from`: Optional route base used to resolve relative `to` paths.\n*\n* @returns A function that accepts `NavigateOptions`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook\n*/\nfunction useNavigate(_defaultOpts) {\n\tconst router = useRouter();\n\treturn React$1.useCallback((options) => {\n\t\treturn router.navigate({\n\t\t\t...options,\n\t\t\tfrom: options.from ?? _defaultOpts?.from\n\t\t});\n\t}, [_defaultOpts?.from, router]);\n}\n/**\n* Component that triggers a navigation when rendered. Navigation executes\n* in an effect after mount/update.\n*\n* Props are the same as `NavigateOptions` used by `navigate()`.\n*\n* @returns null\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/navigateComponent\n*/\nfunction Navigate(props) {\n\tconst router = useRouter();\n\tconst navigate = useNavigate();\n\tconst previousPropsRef = React$1.useRef(null);\n\tuseLayoutEffect(() => {\n\t\tif (previousPropsRef.current !== props) {\n\t\t\tnavigate(props);\n\t\t\tpreviousPropsRef.current = props;\n\t\t}\n\t}, [\n\t\trouter,\n\t\tprops,\n\t\tnavigate\n\t]);\n\treturn null;\n}\n//#endregion\nexport { Navigate, useNavigate };\n\n//# sourceMappingURL=useNavigate.js.map","import { useMatch } from \"./useMatch.js\";\n//#region src/useRouteContext.ts\nfunction useRouteContext(opts) {\n\treturn useMatch({\n\t\t...opts,\n\t\tselect: (match) => opts.select ? opts.select(match.context) : match.context\n\t});\n}\n//#endregion\nexport { useRouteContext };\n\n//# sourceMappingURL=useRouteContext.js.map","\"use client\";\nimport { useForwardedRef, useIntersectionObserver } from \"./utils.js\";\nimport { useHydrated } from \"./ClientOnly.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { deepEqual, exactPathTest, functionalUpdate, hasKeys, isDangerousProtocol, preloadWarning, removeTrailingSlash } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useStore } from \"@tanstack/react-store\";\n//#region src/link.tsx\nfunction useValueStable(value) {\n\tconst ref = React$1.useRef(value);\n\tif (!deepEqual(ref.current, value, { ignoreUndefined: false })) ref.current = value;\n\treturn ref.current;\n}\nfunction compareLinkState(a, b) {\n\treturn a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\nfunction resolveExternalLink(hrefOption, to, protocolAllowlist) {\n\tif (hrefOption?.external) {\n\t\tif (isDangerousProtocol(hrefOption.href, protocolAllowlist)) {\n\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${hrefOption.href}`);\n\t\t\treturn;\n\t\t}\n\t\treturn hrefOption.href;\n\t}\n\tif (isSafeInternal(to)) return;\n\tif (typeof to !== \"string\" || to.indexOf(\":\") === -1) return;\n\ttry {\n\t\tnew URL(to);\n\t\tif (isDangerousProtocol(to, protocolAllowlist)) {\n\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\t\treturn;\n\t\t}\n\t\treturn to;\n\t} catch {}\n}\nfunction resolveIsActive(location, next, activeOptions, basepath, isHydrated, isExternal) {\n\tif (isExternal) return false;\n\tif (activeOptions?.exact) {\n\t\tif (!exactPathTest(location.pathname, next.pathname, basepath)) return false;\n\t} else {\n\t\tconst currentPathSplit = removeTrailingSlash(location.pathname, basepath);\n\t\tconst nextPathSplit = removeTrailingSlash(next.pathname, basepath);\n\t\tif (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === \"/\"))) return false;\n\t}\n\tif (activeOptions?.includeSearch ?? true) {\n\t\tif (!deepEqual(location.search, next.search, {\n\t\t\tpartial: !activeOptions?.exact,\n\t\t\tignoreUndefined: !activeOptions?.explicitUndefined\n\t\t})) return false;\n\t}\n\tif (activeOptions?.includeHash) return isHydrated && location.hash === next.hash;\n\treturn true;\n}\n/**\n* Build anchor-like props for declarative navigation and preloading.\n*\n* Returns stable `href`, event handlers and accessibility props derived from\n* router options and active state. Used internally by `Link` and custom links.\n*\n* Options cover `to`, `params`, `search`, `hash`, `state`, `preload`,\n* `activeProps`, `inactiveProps`, and more.\n*\n* @returns React anchor props suitable for `<a>` or custom components.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook\n*/\nfunction useLinkProps(options, forwardedRef) {\n\tconst router = useRouter();\n\tconst innerRef = useForwardedRef(forwardedRef);\n\tconst { activeProps, inactiveProps, activeOptions, to, preload: userPreload, preloadDelay: userPreloadDelay, preloadIntentProximity: _preloadIntentProximity, hashScrollIntoView, replace, startTransition, resetScroll, viewTransition, children, target, disabled, style, className, onClick, onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart, ignoreBlocker, params: _params, search: _search, hash: _hash, state: _state, mask: _mask, reloadDocument: _reloadDocument, unsafeRelative: _unsafeRelative, from: _from, _fromLocation, ...propsSafeToSpread } = options;\n\tif (isServer ?? router.isServer) {\n\t\tconst safeInternal = isSafeInternal(to);\n\t\tif (typeof to === \"string\" && !safeInternal && to.indexOf(\":\") > -1) try {\n\t\t\tnew URL(to);\n\t\t\tif (isDangerousProtocol(to, router.protocolAllowlist)) {\n\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\t\t\treturn {\n\t\t\t\t\t...propsSafeToSpread,\n\t\t\t\t\tref: innerRef,\n\t\t\t\t\thref: void 0,\n\t\t\t\t\t...children && { children },\n\t\t\t\t\t...target && { target },\n\t\t\t\t\t...disabled && { disabled },\n\t\t\t\t\t...style && { style },\n\t\t\t\t\t...className && { className }\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...propsSafeToSpread,\n\t\t\t\tref: innerRef,\n\t\t\t\thref: to,\n\t\t\t\t...children && { children },\n\t\t\t\t...target && { target },\n\t\t\t\t...disabled && { disabled },\n\t\t\t\t...style && { style },\n\t\t\t\t...className && { className }\n\t\t\t};\n\t\t} catch {}\n\t\tconst next = router.buildLocation({\n\t\t\t...options,\n\t\t\tfrom: options.from\n\t\t});\n\t\tconst hrefOption = getHrefOption(next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref, next.maskedLocation ? next.maskedLocation.external : next.external, router.history, disabled);\n\t\tconst externalLink = (() => {\n\t\t\tif (hrefOption?.external) {\n\t\t\t\tif (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${hrefOption.href}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn hrefOption.href;\n\t\t\t}\n\t\t\tif (safeInternal) return void 0;\n\t\t\tif (typeof to === \"string\" && to.indexOf(\":\") > -1) try {\n\t\t\t\tnew URL(to);\n\t\t\t\tif (isDangerousProtocol(to, router.protocolAllowlist)) {\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Blocked Link with dangerous protocol: ${to}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn to;\n\t\t\t} catch {}\n\t\t})();\n\t\tconst isActive = (() => {\n\t\t\tif (externalLink) return false;\n\t\t\tconst currentLocation = router.stores.location.get();\n\t\t\tconst exact = activeOptions?.exact ?? false;\n\t\t\tif (exact) {\n\t\t\t\tif (!exactPathTest(currentLocation.pathname, next.pathname, router.basepath)) return false;\n\t\t\t} else {\n\t\t\t\tconst currentPathSplit = removeTrailingSlash(currentLocation.pathname, router.basepath);\n\t\t\t\tconst nextPathSplit = removeTrailingSlash(next.pathname, router.basepath);\n\t\t\t\tif (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === \"/\"))) return false;\n\t\t\t}\n\t\t\tif (activeOptions?.includeSearch ?? true) {\n\t\t\t\tif (currentLocation.search !== next.search) {\n\t\t\t\t\tconst currentSearchEmpty = !currentLocation.search || typeof currentLocation.search === \"object\" && !hasKeys(currentLocation.search);\n\t\t\t\t\tconst nextSearchEmpty = !next.search || typeof next.search === \"object\" && !hasKeys(next.search);\n\t\t\t\t\tif (!(currentSearchEmpty && nextSearchEmpty)) {\n\t\t\t\t\t\tif (!deepEqual(currentLocation.search, next.search, {\n\t\t\t\t\t\t\tpartial: !exact,\n\t\t\t\t\t\t\tignoreUndefined: !activeOptions?.explicitUndefined\n\t\t\t\t\t\t})) return false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (activeOptions?.includeHash) return false;\n\t\t\treturn true;\n\t\t})();\n\t\tif (externalLink) return {\n\t\t\t...propsSafeToSpread,\n\t\t\tref: innerRef,\n\t\t\thref: externalLink,\n\t\t\t...children && { children },\n\t\t\t...target && { target },\n\t\t\t...disabled && { disabled },\n\t\t\t...style && { style },\n\t\t\t...className && { className }\n\t\t};\n\t\tconst resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;\n\t\tconst resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;\n\t\tconst resolvedStyle = (() => {\n\t\t\tconst baseStyle = style;\n\t\t\tconst activeStyle = resolvedActiveProps.style;\n\t\t\tconst inactiveStyle = resolvedInactiveProps.style;\n\t\t\tif (!baseStyle && !activeStyle && !inactiveStyle) return;\n\t\t\tif (baseStyle && !activeStyle && !inactiveStyle) return baseStyle;\n\t\t\tif (!baseStyle && activeStyle && !inactiveStyle) return activeStyle;\n\t\t\tif (!baseStyle && !activeStyle && inactiveStyle) return inactiveStyle;\n\t\t\treturn {\n\t\t\t\t...baseStyle,\n\t\t\t\t...activeStyle,\n\t\t\t\t...inactiveStyle\n\t\t\t};\n\t\t})();\n\t\tconst resolvedClassName = (() => {\n\t\t\tconst baseClassName = className;\n\t\t\tconst activeClassName = resolvedActiveProps.className;\n\t\t\tconst inactiveClassName = resolvedInactiveProps.className;\n\t\t\tif (!baseClassName && !activeClassName && !inactiveClassName) return \"\";\n\t\t\tlet out = \"\";\n\t\t\tif (baseClassName) out = baseClassName;\n\t\t\tif (activeClassName) out = out ? `${out} ${activeClassName}` : activeClassName;\n\t\t\tif (inactiveClassName) out = out ? `${out} ${inactiveClassName}` : inactiveClassName;\n\t\t\treturn out;\n\t\t})();\n\t\treturn {\n\t\t\t...propsSafeToSpread,\n\t\t\t...resolvedActiveProps,\n\t\t\t...resolvedInactiveProps,\n\t\t\thref: hrefOption?.href,\n\t\t\tref: innerRef,\n\t\t\tdisabled: !!disabled,\n\t\t\ttarget,\n\t\t\t...resolvedStyle && { style: resolvedStyle },\n\t\t\t...resolvedClassName && { className: resolvedClassName },\n\t\t\t...disabled && STATIC_DISABLED_PROPS,\n\t\t\t...isActive && STATIC_ACTIVE_PROPS\n\t\t};\n\t}\n\tconst isHydrated = useHydrated();\n\tconst stableSearch = useValueStable(options.search);\n\tconst stableParams = useValueStable(options.params);\n\tconst stableActiveOptions = useValueStable(activeOptions);\n\tconst _options = React$1.useMemo(() => options, [\n\t\trouter,\n\t\toptions.from,\n\t\toptions._fromLocation,\n\t\toptions.hash,\n\t\toptions.to,\n\t\tstableSearch,\n\t\tstableParams,\n\t\toptions.state,\n\t\toptions.mask,\n\t\toptions.unsafeRelative\n\t]);\n\tconst selectLinkState = React$1.useCallback((location) => {\n\t\tconst next = router.buildLocation({\n\t\t\t_fromLocation: location,\n\t\t\t..._options\n\t\t});\n\t\tconst hrefOption = getHrefOption(next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref, next.maskedLocation ? next.maskedLocation.external : next.external, router.history, disabled);\n\t\tconst externalLink = resolveExternalLink(hrefOption, to, router.protocolAllowlist);\n\t\treturn [\n\t\t\threfOption?.href,\n\t\t\texternalLink,\n\t\t\tresolveIsActive(location, next, stableActiveOptions, router.basepath, isHydrated, externalLink !== void 0)\n\t\t];\n\t}, [\n\t\tstableActiveOptions,\n\t\tdisabled,\n\t\tisHydrated,\n\t\t_options,\n\t\trouter,\n\t\tto\n\t]);\n\tconst [href, externalLink, isActive] = useStore(router.stores.location, selectLinkState, compareLinkState);\n\tconst resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;\n\tconst resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT;\n\tconst resolvedClassName = [\n\t\tclassName,\n\t\tresolvedActiveProps.className,\n\t\tresolvedInactiveProps.className\n\t].filter(Boolean).join(\" \");\n\tconst resolvedStyle = (style || resolvedActiveProps.style || resolvedInactiveProps.style) && {\n\t\t...style,\n\t\t...resolvedActiveProps.style,\n\t\t...resolvedInactiveProps.style\n\t};\n\tconst hasRenderFetched = React$1.useRef(false);\n\tconst preload = options.reloadDocument || externalLink || disabled ? false : userPreload ?? router.options.defaultPreload;\n\tconst preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0;\n\tconst doPreload = React$1.useCallback(() => {\n\t\trouter.preloadRoute(_options).catch((err) => {\n\t\t\tconsole.warn(err);\n\t\t\tconsole.warn(preloadWarning);\n\t\t});\n\t}, [router, _options]);\n\tconst enqueuePreload = React$1.useCallback((e) => {\n\t\tif (!e) {\n\t\t\tcancelPreload(innerRef);\n\t\t\treturn;\n\t\t}\n\t\tif (!(e.isIntersecting ?? preload === \"intent\")) {\n\t\t\tif (e.isIntersecting === false) cancelPreload(innerRef);\n\t\t\treturn;\n\t\t}\n\t\tif (!preloadDelay) {\n\t\t\tdoPreload();\n\t\t\treturn;\n\t\t}\n\t\tif (timeoutMap.has(innerRef)) return;\n\t\ttimeoutMap.set(innerRef, setTimeout(() => {\n\t\t\ttimeoutMap.delete(innerRef);\n\t\t\tdoPreload();\n\t\t}, preloadDelay));\n\t}, [\n\t\tdoPreload,\n\t\tinnerRef,\n\t\tpreload,\n\t\tpreloadDelay\n\t]);\n\tuseIntersectionObserver(innerRef, enqueuePreload, preload !== \"viewport\");\n\tReact$1.useEffect(() => {\n\t\tif (hasRenderFetched.current) return;\n\t\tif (preload === \"render\") {\n\t\t\tdoPreload();\n\t\t\thasRenderFetched.current = true;\n\t\t}\n\t}, [doPreload, preload]);\n\tconst handleClick = (e) => {\n\t\tconst elementTarget = e.currentTarget.getAttribute(\"target\");\n\t\tconst effectiveTarget = target !== void 0 ? target : elementTarget;\n\t\tif (!disabled && !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === \"_self\") && e.button === 0) {\n\t\t\te.preventDefault();\n\t\t\trouter.navigate({\n\t\t\t\t..._options,\n\t\t\t\treplace,\n\t\t\t\tresetScroll,\n\t\t\t\thashScrollIntoView,\n\t\t\t\tstartTransition,\n\t\t\t\tviewTransition,\n\t\t\t\tignoreBlocker\n\t\t\t});\n\t\t}\n\t};\n\tif (externalLink) return {\n\t\t...propsSafeToSpread,\n\t\tref: innerRef,\n\t\thref: externalLink,\n\t\t...children && { children },\n\t\t...target && { target },\n\t\t...disabled && { disabled },\n\t\t...style && { style },\n\t\t...className && { className },\n\t\t...onClick && { onClick },\n\t\t...onBlur && { onBlur },\n\t\t...onFocus && { onFocus },\n\t\t...onMouseEnter && { onMouseEnter },\n\t\t...onMouseLeave && { onMouseLeave },\n\t\t...onTouchStart && { onTouchStart }\n\t};\n\tconst handleTouchStart = () => {\n\t\tif (preload !== \"intent\") return;\n\t\tdoPreload();\n\t};\n\tconst handleLeave = () => {\n\t\tif (preload === \"intent\") cancelPreload(innerRef);\n\t};\n\treturn {\n\t\t...propsSafeToSpread,\n\t\t...resolvedActiveProps,\n\t\t...resolvedInactiveProps,\n\t\thref,\n\t\tref: innerRef,\n\t\tonClick: composeHandlers([onClick, handleClick]),\n\t\tonBlur: composeHandlers([onBlur, handleLeave]),\n\t\tonFocus: composeHandlers([onFocus, enqueuePreload]),\n\t\tonMouseEnter: composeHandlers([onMouseEnter, enqueuePreload]),\n\t\tonMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n\t\tonTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n\t\tdisabled: !!disabled,\n\t\ttarget,\n\t\t...resolvedStyle && { style: resolvedStyle },\n\t\t...resolvedClassName && { className: resolvedClassName },\n\t\t...disabled && STATIC_DISABLED_PROPS,\n\t\t...isActive && STATIC_ACTIVE_PROPS\n\t};\n}\nvar STATIC_EMPTY_OBJECT = {};\nvar STATIC_ACTIVE_OBJECT = { className: \"active\" };\nvar STATIC_DISABLED_PROPS = {\n\trole: \"link\",\n\t\"aria-disabled\": true\n};\nvar STATIC_ACTIVE_PROPS = {\n\t\"data-status\": \"active\",\n\t\"aria-current\": \"page\"\n};\nvar timeoutMap = /* @__PURE__ */ new WeakMap();\nvar cancelPreload = (eventTarget) => {\n\tclearTimeout(timeoutMap.get(eventTarget));\n\ttimeoutMap.delete(eventTarget);\n};\nvar composeHandlers = (handlers) => (e) => {\n\tfor (const handler of handlers) {\n\t\tif (!handler) continue;\n\t\tif (e.defaultPrevented) return;\n\t\thandler(e);\n\t}\n};\nfunction getHrefOption(publicHref, external, history, disabled) {\n\tif (disabled) return void 0;\n\tif (external) return {\n\t\thref: publicHref,\n\t\texternal: true\n\t};\n\treturn {\n\t\thref: history.createHref(publicHref) || \"/\",\n\t\texternal: false\n\t};\n}\nfunction isSafeInternal(to) {\n\tif (typeof to !== \"string\") return false;\n\tconst zero = to.charCodeAt(0);\n\tif (zero === 47) return to.charCodeAt(1) !== 47;\n\treturn zero === 46;\n}\n/**\n* Creates a typed Link-like component that preserves TanStack Router's\n* navigation semantics and type-safety while delegating rendering to the\n* provided host component.\n*\n* Useful for integrating design system anchors/buttons while keeping\n* router-aware props (eg. `to`, `params`, `search`, `preload`).\n*\n* @param Comp The host component to render (eg. a design-system Link/Button)\n* @returns A router-aware component with the same API as `Link`.\n* @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-link\n*/\nfunction createLink(Comp) {\n\treturn React$1.forwardRef(function CreatedLink(props, ref) {\n\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t...props,\n\t\t\t_asChild: Comp,\n\t\t\tref\n\t\t});\n\t});\n}\n/**\n* A strongly-typed anchor component for declarative navigation.\n* Handles path, search, hash and state updates with optional route preloading\n* and active-state styling.\n*\n* Props:\n* - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false)\n* - `preloadDelay`: Delay in ms before preloading on focus, hover, or viewport entry\n* - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive\n* - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation\n* - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation\n* - `ignoreBlocker`: Bypass registered blockers\n*\n* @returns An anchor-like element that navigates without full page reloads.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent\n*/\nvar Link = React$1.forwardRef((props, ref) => {\n\tconst { _asChild, ...rest } = props;\n\tconst { type: _type, ...linkProps } = useLinkProps(rest, ref);\n\tconst children = typeof rest.children === \"function\" ? rest.children({ isActive: linkProps[\"data-status\"] === \"active\" }) : rest.children;\n\tif (!_asChild) {\n\t\tconst { disabled: _, ...rest } = linkProps;\n\t\treturn React$1.createElement(\"a\", rest, children);\n\t}\n\treturn React$1.createElement(_asChild, linkProps, children);\n});\n/**\n* Validate and reuse navigation options for `Link`, `navigate` or `redirect`.\n* Accepts a literal options object and returns it typed for later spreading.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\nvar linkOptions = (options) => {\n\treturn options;\n};\n/**\n* Type-check a literal object for use with `Link`, `navigate` or `redirect`.\n* Use to validate and reuse navigation options across your app.\n* @example\n* const opts = linkOptions({ to: '/dashboard', search: { tab: 'home' } })\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkOptions\n*/\n//#endregion\nexport { Link, createLink, linkOptions, useLinkProps };\n\n//# sourceMappingURL=link.js.map","import { useRouter } from \"./useRouter.js\";\nimport { useMatch } from \"./useMatch.js\";\nimport { useLoaderData } from \"./useLoaderData.js\";\nimport { useLoaderDeps } from \"./useLoaderDeps.js\";\nimport { useParams } from \"./useParams.js\";\nimport { useSearch } from \"./useSearch.js\";\nimport { useNavigate } from \"./useNavigate.js\";\nimport { useRouteContext } from \"./useRouteContext.js\";\nimport { Link } from \"./link.js\";\nimport { BaseRootRoute, BaseRoute, BaseRouteApi, notFound } from \"@tanstack/router-core\";\nimport React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/route.tsx\n/**\n* Returns a route-specific API that exposes type-safe hooks pre-bound\n* to a single route ID. Useful for consuming a route's APIs from files\n* where the route object isn't directly imported (e.g. code-split files).\n*\n* @param id Route ID string literal for the target route.\n* @returns A `RouteApi` instance bound to the given route ID.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/getRouteApiFunction\n*/\nfunction getRouteApi(id) {\n\treturn new RouteApi({ id });\n}\nvar RouteApi = class extends BaseRouteApi {\n\t/**\n\t* @deprecated Use the `getRouteApi` function instead.\n\t*/\n\tconstructor({ id }) {\n\t\tsuper({ id });\n\t\tthis.useMatch = (opts) => {\n\t\t\treturn useMatch({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tfrom: this.id,\n\t\t\t\tstructuralSharing: opts?.structuralSharing\n\t\t\t});\n\t\t};\n\t\tthis.useRouteContext = (opts) => {\n\t\t\treturn useRouteContext({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useSearch = (opts) => {\n\t\t\treturn useSearch({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tstructuralSharing: opts?.structuralSharing,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useParams = (opts) => {\n\t\t\treturn useParams({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tstructuralSharing: opts?.structuralSharing,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderDeps = (opts) => {\n\t\t\treturn useLoaderDeps({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id,\n\t\t\t\tstrict: false\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderData = (opts) => {\n\t\t\treturn useLoaderData({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id,\n\t\t\t\tstrict: false\n\t\t\t});\n\t\t};\n\t\tthis.useNavigate = () => {\n\t\t\treturn useNavigate({ from: useRouter().routesById[this.id].fullPath });\n\t\t};\n\t\tthis.notFound = (opts) => {\n\t\t\treturn notFound({\n\t\t\t\trouteId: this.id,\n\t\t\t\t...opts\n\t\t\t});\n\t\t};\n\t\tthis.Link = React.forwardRef((props, ref) => {\n\t\t\tconst fullPath = useRouter().routesById[this.id].fullPath;\n\t\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t\tref,\n\t\t\t\tfrom: fullPath,\n\t\t\t\t...props\n\t\t\t});\n\t\t});\n\t}\n};\nvar Route = class extends BaseRoute {\n\t/**\n\t* @deprecated Use the `createRoute` function instead.\n\t*/\n\tconstructor(options) {\n\t\tsuper(options);\n\t\tthis.useMatch = (opts) => {\n\t\t\treturn useMatch({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tfrom: this.id,\n\t\t\t\tstructuralSharing: opts?.structuralSharing\n\t\t\t});\n\t\t};\n\t\tthis.useRouteContext = (opts) => {\n\t\t\treturn useRouteContext({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useSearch = (opts) => {\n\t\t\treturn useSearch({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tstructuralSharing: opts?.structuralSharing,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useParams = (opts) => {\n\t\t\treturn useParams({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tstructuralSharing: opts?.structuralSharing,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderDeps = (opts) => {\n\t\t\treturn useLoaderDeps({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderData = (opts) => {\n\t\t\treturn useLoaderData({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useNavigate = () => {\n\t\t\treturn useNavigate({ from: this.fullPath });\n\t\t};\n\t\tthis.Link = React.forwardRef((props, ref) => {\n\t\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t\tref,\n\t\t\t\tfrom: this.fullPath,\n\t\t\t\t...props\n\t\t\t});\n\t\t});\n\t}\n};\n/**\n* Creates a non-root Route instance for code-based routing.\n*\n* Use this to define a route that will be composed into a route tree\n* (typically via a parent route's `addChildren`). If you're using file-based\n* routing, prefer `createFileRoute`.\n*\n* @param options Route options (path, component, loader, context, etc.).\n* @returns A Route instance to be attached to the route tree.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction\n*/\nfunction createRoute(options) {\n\treturn new Route(options);\n}\n/**\n* Creates a root route factory that requires a router context type.\n*\n* Use when your root route expects `context` to be provided to `createRouter`.\n* The returned function behaves like `createRootRoute` but enforces a context type.\n*\n* @returns A factory function to configure and return a root route.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction\n*/\nfunction createRootRouteWithContext() {\n\treturn (options) => {\n\t\treturn createRootRoute(options);\n\t};\n}\n/**\n* @deprecated Use the `createRootRouteWithContext` function instead.\n*/\nvar rootRouteWithContext = createRootRouteWithContext;\nvar RootRoute = class extends BaseRootRoute {\n\t/**\n\t* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n\t*/\n\tconstructor(options) {\n\t\tsuper(options);\n\t\tthis.useMatch = (opts) => {\n\t\t\treturn useMatch({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tfrom: this.id,\n\t\t\t\tstructuralSharing: opts?.structuralSharing\n\t\t\t});\n\t\t};\n\t\tthis.useRouteContext = (opts) => {\n\t\t\treturn useRouteContext({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useSearch = (opts) => {\n\t\t\treturn useSearch({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tstructuralSharing: opts?.structuralSharing,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useParams = (opts) => {\n\t\t\treturn useParams({\n\t\t\t\tselect: opts?.select,\n\t\t\t\tstructuralSharing: opts?.structuralSharing,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderDeps = (opts) => {\n\t\t\treturn useLoaderDeps({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useLoaderData = (opts) => {\n\t\t\treturn useLoaderData({\n\t\t\t\t...opts,\n\t\t\t\tfrom: this.id\n\t\t\t});\n\t\t};\n\t\tthis.useNavigate = () => {\n\t\t\treturn useNavigate({ from: this.fullPath });\n\t\t};\n\t\tthis.Link = React.forwardRef((props, ref) => {\n\t\t\treturn /* @__PURE__ */ jsx(Link, {\n\t\t\t\tref,\n\t\t\t\tfrom: this.fullPath,\n\t\t\t\t...props\n\t\t\t});\n\t\t});\n\t}\n};\n/**\n* Creates a root Route instance used to build your route tree.\n*\n* Typically paired with `createRouter({ routeTree })`. If you need to require\n* a typed router context, use `createRootRouteWithContext` instead.\n*\n* @param options Root route options (component, error, pending, etc.).\n* @returns A root route instance.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction\n*/\nfunction createRootRoute(options) {\n\treturn new RootRoute(options);\n}\nfunction createRouteMask(opts) {\n\treturn opts;\n}\nvar NotFoundRoute = class extends Route {\n\tconstructor(options) {\n\t\tsuper({\n\t\t\t...options,\n\t\t\tid: \"404\"\n\t\t});\n\t}\n};\n//#endregion\nexport { NotFoundRoute, RootRoute, Route, RouteApi, createRootRoute, createRootRouteWithContext, createRoute, createRouteMask, getRouteApi, rootRouteWithContext };\n\n//# sourceMappingURL=route.js.map","import { CatchBoundary } from \"./CatchBoundary.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { isNotFound } from \"@tanstack/router-core\";\nimport \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { useStore } from \"@tanstack/react-store\";\n//#region src/not-found.tsx\nfunction CatchNotFound(props) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) {\n\t\tconst resetKey = `not-found-${router.stores.location.get().pathname}-${router.stores.status.get()}`;\n\t\treturn /* @__PURE__ */ jsx(CatchBoundary, {\n\t\t\tgetResetKey: () => resetKey,\n\t\t\tonCatch: (error, errorInfo) => {\n\t\t\t\tif (isNotFound(error)) props.onCatch?.(error, errorInfo);\n\t\t\t\telse throw error;\n\t\t\t},\n\t\t\terrorComponent: ({ error }) => {\n\t\t\t\tif (isNotFound(error)) return props.fallback?.(error);\n\t\t\t\telse throw error;\n\t\t\t},\n\t\t\tchildren: props.children\n\t\t});\n\t}\n\tconst resetKey = `not-found-${useStore(router.stores.location, (location) => location.pathname)}-${useStore(router.stores.status, (status) => status)}`;\n\treturn /* @__PURE__ */ jsx(CatchBoundary, {\n\t\tgetResetKey: () => resetKey,\n\t\tonCatch: (error, errorInfo) => {\n\t\t\tif (isNotFound(error)) props.onCatch?.(error, errorInfo);\n\t\t\telse throw error;\n\t\t},\n\t\terrorComponent: ({ error }) => {\n\t\t\tif (isNotFound(error)) return props.fallback?.(error);\n\t\t\telse throw error;\n\t\t},\n\t\tchildren: props.children\n\t});\n}\nfunction DefaultGlobalNotFound() {\n\treturn /* @__PURE__ */ jsx(\"p\", { children: \"Not Found\" });\n}\n//#endregion\nexport { CatchNotFound, DefaultGlobalNotFound };\n\n//# sourceMappingURL=not-found.js.map","import { useRouter } from \"./useRouter.js\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/ScriptOnce.tsx\n/**\n* Server-only helper to emit a script tag exactly once during SSR.\n*/\nfunction ScriptOnce({ children }) {\n\tconst router = useRouter();\n\tif (!(isServer ?? router.isServer)) return null;\n\treturn /* @__PURE__ */ jsx(\"script\", {\n\t\tnonce: router.options.ssr?.nonce,\n\t\tdangerouslySetInnerHTML: { __html: children + \";document.currentScript.remove()\" }\n\t});\n}\n//#endregion\nexport { ScriptOnce };\n\n//# sourceMappingURL=ScriptOnce.js.map","import \"react\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\n//#region src/SafeFragment.tsx\nfunction SafeFragment(props) {\n\treturn /* @__PURE__ */ jsx(Fragment, { children: props.children });\n}\n//#endregion\nexport { SafeFragment };\n\n//# sourceMappingURL=SafeFragment.js.map","import { wrapInNonRouteComponentContext } from \"./nonRouteComponentContext.js\";\nimport { DefaultGlobalNotFound } from \"./not-found.js\";\nimport \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/renderRouteNotFound.tsx\n/**\n* Renders a not found component for a route when no matching route is found.\n*\n* @param router - The router instance containing the route configuration\n* @param route - The route that triggered the not found state\n* @param data - Additional data to pass to the not found component\n* @returns The rendered not found component or a default fallback component\n*/\nfunction renderRouteNotFound(router, route, data) {\n\tif (!route.options.notFoundComponent) {\n\t\tif (router.options.defaultNotFoundComponent) {\n\t\t\tconst notFoundElement = /* @__PURE__ */ jsx(router.options.defaultNotFoundComponent, { ...data });\n\t\t\treturn process.env.NODE_ENV !== \"production\" ? wrapInNonRouteComponentContext(notFoundElement, \"notFoundComponent\") : notFoundElement;\n\t\t}\n\t\tif (process.env.NODE_ENV !== \"production\") {\n\t\t\tif (!route.options.notFoundComponent) console.warn(`Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`);\n\t\t}\n\t\treturn /* @__PURE__ */ jsx(DefaultGlobalNotFound, {});\n\t}\n\tconst notFoundElement = /* @__PURE__ */ jsx(route.options.notFoundComponent, { ...data });\n\treturn process.env.NODE_ENV !== \"production\" ? wrapInNonRouteComponentContext(notFoundElement, \"notFoundComponent\") : notFoundElement;\n}\n//#endregion\nexport { renderRouteNotFound };\n\n//# sourceMappingURL=renderRouteNotFound.js.map","//#region src/scroll-restoration-script/client.ts\nfunction getScrollRestorationScriptForRouter(_router) {\n\treturn null;\n}\n//#endregion\nexport { getScrollRestorationScriptForRouter };\n\n//# sourceMappingURL=client.js.map","import { useRouter } from \"./useRouter.js\";\nimport { ScriptOnce } from \"./ScriptOnce.js\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { getScrollRestorationScriptForRouter } from \"@tanstack/router-core/scroll-restoration-script\";\n//#region src/scroll-restoration.tsx\nfunction ScrollRestoration() {\n\tconst script = getScrollRestorationScriptForRouter(useRouter());\n\tif (!script) return null;\n\treturn /* @__PURE__ */ jsx(ScriptOnce, { children: script });\n}\n//#endregion\nexport { ScrollRestoration };\n\n//# sourceMappingURL=scroll-restoration.js.map","\"use client\";\nimport { nonRouteComponentContext, wrapInNonRouteComponentContext } from \"./nonRouteComponentContext.js\";\nimport { CatchBoundary, ErrorComponent } from \"./CatchBoundary.js\";\nimport { ClientOnly } from \"./ClientOnly.js\";\nimport { matchContext } from \"./matchContext.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { CatchNotFound } from \"./not-found.js\";\nimport { SafeFragment } from \"./SafeFragment.js\";\nimport { renderRouteNotFound } from \"./renderRouteNotFound.js\";\nimport { ScrollRestoration } from \"./scroll-restoration.js\";\nimport { isNotFound, rootRouteId } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { useStore } from \"@tanstack/react-store\";\n//#region src/Match.tsx\nfunction renderPending(router, route) {\n\tconst PendingComponent = route?.options.pendingComponent ?? router.options.defaultPendingComponent;\n\tif (!PendingComponent) return null;\n\tconst pendingElement = /* @__PURE__ */ jsx(PendingComponent, {});\n\treturn process.env.NODE_ENV !== \"production\" ? wrapInNonRouteComponentContext(pendingElement, \"pendingComponent\") : pendingElement;\n}\nvar outletMatchSelectionEqual = (a, b) => a[0] === b[0] && a[1] === b[1];\nvar canWrapInSuspense = (router, route, ssr) => !route.isRoot || route.options.shellComponent || route.options.wrapInSuspense || ssr === false || ssr === \"data-only\" || !((isServer ?? router.isServer) || router.ssr);\nvar Match = React$1.memo(function MatchImpl({ routeId }) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) return /* @__PURE__ */ jsx(MatchView, {\n\t\trouter,\n\t\tmatch: router.stores.byRoute.get(routeId).get()\n\t});\n\treturn /* @__PURE__ */ jsx(MatchView, {\n\t\trouter,\n\t\tmatch: useStore(router.stores.getMatchStore(routeId), (value) => value)\n\t});\n});\nfunction MatchView({ router, match }) {\n\tconst route = router.routesById[match.routeId];\n\tconst pendingElement = renderPending(router, route);\n\tconst routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent;\n\tconst routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch;\n\tconst routeNotFoundComponent = route.isRoot ? route.options.notFoundComponent ?? router.options.notFoundRoute?.options.component : route.options.notFoundComponent;\n\tconst resolvedNoSsr = match.ssr === false || match.ssr === \"data-only\";\n\tconst ResolvedSuspenseBoundary = canWrapInSuspense(router, route, match.ssr) && (route.options.wrapInSuspense ?? pendingElement ?? (route.options.errorComponent?.preload || resolvedNoSsr)) ? React$1.Suspense : SafeFragment;\n\tconst ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment;\n\tconst ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment;\n\treturn /* @__PURE__ */ jsxs(route.isRoot ? route.options.shellComponent ?? SafeFragment : SafeFragment, { children: [/* @__PURE__ */ jsx(matchContext.Provider, {\n\t\tvalue: match.routeId,\n\t\tchildren: /* @__PURE__ */ jsx(ResolvedSuspenseBoundary, {\n\t\t\tfallback: pendingElement,\n\t\t\tchildren: /* @__PURE__ */ jsx(ResolvedCatchBoundary, {\n\t\t\t\tgetResetKey: () => match,\n\t\t\t\terrorComponent: routeErrorComponent,\n\t\t\t\tonCatch: (error, errorInfo) => {\n\t\t\t\t\tif (isNotFound(error)) {\n\t\t\t\t\t\terror.routeId ??= match.routeId;\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t\tif (process.env.NODE_ENV !== \"production\") console.warn(`Warning: Error in route match: ${match.id}`);\n\t\t\t\t\trouteOnCatch?.(error, errorInfo);\n\t\t\t\t},\n\t\t\t\tchildren: /* @__PURE__ */ jsx(ResolvedNotFoundBoundary, {\n\t\t\t\t\tfallback: (error) => {\n\t\t\t\t\t\terror.routeId ??= match.routeId;\n\t\t\t\t\t\tif (error.routeId !== match.routeId) throw error;\n\t\t\t\t\t\tconst notFoundElement = React$1.createElement(routeNotFoundComponent, error);\n\t\t\t\t\t\treturn process.env.NODE_ENV !== \"production\" ? wrapInNonRouteComponentContext(notFoundElement, \"notFoundComponent\") : notFoundElement;\n\t\t\t\t\t},\n\t\t\t\t\tchildren: resolvedNoSsr ? /* @__PURE__ */ jsx(ClientOnly, {\n\t\t\t\t\t\tfallback: pendingElement,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ jsx(MatchInner, { match })\n\t\t\t\t\t}) : /* @__PURE__ */ jsx(MatchInner, { match })\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\t}), (isServer ?? router.isServer) && route.parentRoute?.id === rootRouteId && router.options.scrollRestoration ? /* @__PURE__ */ jsx(ScrollRestoration, {}) : null] });\n}\nvar MatchInner = React$1.memo(function MatchInnerImpl({ match }) {\n\tconst router = useRouter();\n\tconst routeId = match.routeId;\n\tconst route = router.routesById[routeId];\n\tconst key = React$1.useMemo(() => {\n\t\tconst remountDeps = (route.options.remountDeps ?? router.options.defaultRemountDeps)?.({\n\t\t\trouteId,\n\t\t\tloaderDeps: match.loaderDeps,\n\t\t\tparams: match._strictParams,\n\t\t\tsearch: match._strictSearch\n\t\t});\n\t\treturn remountDeps ? JSON.stringify(remountDeps) : void 0;\n\t}, [\n\t\trouteId,\n\t\tmatch.loaderDeps,\n\t\tmatch._strictParams,\n\t\tmatch._strictSearch,\n\t\troute.options.remountDeps,\n\t\trouter.options.defaultRemountDeps\n\t]);\n\tconst out = React$1.useMemo(() => {\n\t\tconst Comp = route.options.component ?? router.options.defaultComponent;\n\t\treturn Comp ? /* @__PURE__ */ jsx(Comp, {}, key) : /* @__PURE__ */ jsx(Outlet, {});\n\t}, [\n\t\tkey,\n\t\troute.options.component,\n\t\trouter.options.defaultComponent\n\t]);\n\tif (match.status === \"pending\") {\n\t\tif (router.ssr && !canWrapInSuspense(router, route, match.ssr)) return out;\n\t\tif (router._tx) throw router._tx[5];\n\t\treturn renderPending(router, route);\n\t}\n\tif (match.status === \"notFound\") return renderRouteNotFound(router, route, match.error);\n\tif (match.status === \"error\") {\n\t\tif (isServer ?? router.isServer) {\n\t\t\tconst errorElement = /* @__PURE__ */ jsx((route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent, {\n\t\t\t\terror: match.error,\n\t\t\t\treset: void 0,\n\t\t\t\tinfo: { componentStack: \"\" }\n\t\t\t});\n\t\t\treturn process.env.NODE_ENV !== \"production\" ? wrapInNonRouteComponentContext(errorElement, \"errorComponent\") : errorElement;\n\t\t}\n\t\tthrow match.error;\n\t}\n\treturn out;\n});\n/**\n* Render the next child match in the route tree. Typically used inside\n* a route component to render nested routes.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/outletComponent\n*/\nvar Outlet = React$1.memo(function OutletImpl() {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst nonRouteComponent = React$1.useContext(nonRouteComponentContext);\n\t\tif (nonRouteComponent) console.warn(`Warning: An <Outlet /> was rendered inside a ${nonRouteComponent}. <Outlet /> should only be rendered inside a route component.`);\n\t}\n\tconst router = useRouter();\n\tconst routeId = React$1.useContext(matchContext);\n\tlet parentGlobalNotFound;\n\tlet parentNotFoundError;\n\tlet childRouteId;\n\tif (isServer ?? router.isServer) {\n\t\tconst matches = router.stores.matches.get();\n\t\tconst parentIndex = matches.findIndex((match) => match.routeId === routeId);\n\t\tconst parentMatch = matches[parentIndex];\n\t\tparentGlobalNotFound = !!parentMatch._notFound;\n\t\tparentNotFoundError = parentMatch.error;\n\t\tchildRouteId = matches[parentIndex + 1]?.routeId;\n\t} else {\n\t\tconst parentMatchStore = router.stores.getMatchStore(routeId);\n\t\t[parentGlobalNotFound, parentNotFoundError] = useStore(parentMatchStore, (match) => [!!match._notFound, match.error], outletMatchSelectionEqual);\n\t\tchildRouteId = useStore(router.stores.ids, (ids) => {\n\t\t\treturn ids[ids.indexOf(routeId) + 1];\n\t\t});\n\t}\n\tif (parentGlobalNotFound) return renderRouteNotFound(router, router.routesById[routeId], parentNotFoundError);\n\tif (!childRouteId) return null;\n\tconst nextMatch = /* @__PURE__ */ jsx(Match, { routeId: childRouteId });\n\tif (routeId === rootRouteId) return /* @__PURE__ */ jsx(React$1.Suspense, {\n\t\tfallback: renderPending(router),\n\t\tchildren: nextMatch\n\t});\n\treturn nextMatch;\n});\n//#endregion\nexport { Match, Outlet, renderPending };\n\n//# sourceMappingURL=Match.js.map","\"use client\";\nimport { useLayoutEffect } from \"./utils.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { getLocationChangeInfo, trimPathRight } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\n//#region src/Transitioner.tsx\nfunction settleOwner(owner, rendered) {\n\tconst settle = owner[1];\n\towner.length = 0;\n\tsettle?.(rendered);\n}\nfunction Transitioner({ t }) {\n\tconst router = useRouter();\n\tconst acknowledgement = router._rendered ??= [];\n\tconst mounted = process.env.NODE_ENV !== \"production\" ? React$1.useRef(false) : void 0;\n\trouter.startTransition = (fn, expected) => new Promise((resolve) => {\n\t\tsettleOwner(acknowledgement, false);\n\t\tacknowledgement.push(expected, resolve);\n\t\tt(router);\n\t\tReact$1.startTransition(fn);\n\t});\n\tuseLayoutEffect(() => {\n\t\tconst unsub = router.history.subscribe(router.load);\n\t\tif (mounted?.current) return unsub;\n\t\tif (mounted) mounted.current = true;\n\t\trouter.updateLatestLocation();\n\t\tconst location = router.latestLocation;\n\t\tconst nextLocation = router.buildLocation({\n\t\t\tto: location.pathname,\n\t\t\tsearch: true,\n\t\t\tparams: true,\n\t\t\thash: true,\n\t\t\tstate: true,\n\t\t\t_includeValidateSearch: true\n\t\t});\n\t\tif (trimPathRight(location.publicHref) !== trimPathRight(nextLocation.publicHref)) {\n\t\t\trouter.commitLocation({\n\t\t\t\t...nextLocation,\n\t\t\t\treplace: true,\n\t\t\t\tignoreBlocker: true\n\t\t\t});\n\t\t\treturn unsub;\n\t\t}\n\t\tconst resolvedLocation = router.stores.resolvedLocation.get();\n\t\tif (resolvedLocation?.href === location.href && resolvedLocation.state.__TSR_key === location.state.__TSR_key) acknowledgement.push(router.stores.matches.get(), (rendered) => {\n\t\t\tif (rendered) router.emit({\n\t\t\t\ttype: \"onRendered\",\n\t\t\t\t...getLocationChangeInfo(resolvedLocation, resolvedLocation)\n\t\t\t});\n\t\t});\n\t\telse if (!router._tx) router.load().catch(console.error);\n\t\treturn unsub;\n\t}, [router, router.history]);\n\treturn null;\n}\n//#endregion\nexport { Transitioner, settleOwner };\n\n//# sourceMappingURL=Transitioner.js.map","\"use client\";\nimport { useLayoutEffect } from \"./utils.js\";\nimport { CatchBoundary } from \"./CatchBoundary.js\";\nimport { matchContext } from \"./matchContext.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { useStructuralSharing } from \"./useMatch.js\";\nimport { Transitioner, settleOwner } from \"./Transitioner.js\";\nimport { SafeFragment } from \"./SafeFragment.js\";\nimport { Match, renderPending } from \"./Match.js\";\nimport { rootRouteId } from \"@tanstack/router-core\";\nimport * as React$1 from \"react\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { useStore } from \"@tanstack/react-store\";\n//#region src/Matches.tsx\n/**\n* Internal component that renders the router's active match tree with\n* suspense, error, and not-found boundaries. Rendered by `RouterProvider`.\n*/\nfunction Matches() {\n\tconst router = useRouter();\n\tconst rootRoute = router.routesById[rootRouteId];\n\tconst pendingElement = renderPending(router, rootRoute);\n\tconst ResolvedSuspense = (isServer ?? router.isServer) || router.ssr ? SafeFragment : React$1.Suspense;\n\tconst inner = /* @__PURE__ */ jsxs(Fragment, { children: [!(isServer ?? router.isServer) && /* @__PURE__ */ jsx(Transitioner, { t: React$1.useState()[1] }), /* @__PURE__ */ jsx(ResolvedSuspense, {\n\t\tfallback: pendingElement,\n\t\tchildren: /* @__PURE__ */ jsx(MatchesInner, {})\n\t})] });\n\treturn router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner;\n}\nfunction MatchesInner() {\n\tconst router = useRouter();\n\tconst acknowledgement = router._rendered;\n\tconst matches = isServer ?? router.isServer ? router.stores.matches.get() : useStore(router.stores.matches, (value) => acknowledgement[0] ?? value);\n\tconst match = matches[0];\n\tconst routeId = match?.routeId;\n\tuseLayoutEffect(() => {\n\t\tif (acknowledgement[0] === matches) settleOwner(acknowledgement, true);\n\t}, [acknowledgement, matches]);\n\tconst matchComponent = routeId ? /* @__PURE__ */ jsx(Match, { routeId }) : null;\n\treturn /* @__PURE__ */ jsx(matchContext.Provider, {\n\t\tvalue: routeId,\n\t\tchildren: router.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ jsx(CatchBoundary, {\n\t\t\tgetResetKey: () => match,\n\t\t\tonCatch: process.env.NODE_ENV !== \"production\" ? (error) => {\n\t\t\t\tconsole.warn(`Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`);\n\t\t\t\tconsole.warn(`Warning: ${error.message || error.toString()}`);\n\t\t\t} : void 0,\n\t\t\tchildren: matchComponent\n\t\t})\n\t});\n}\n/**\n* Create a matcher function for testing locations against route definitions.\n*\n* The returned function accepts standard navigation options (`to`, `params`,\n* `search`, etc.) and returns either `false` (no match) or the matched params\n* object when the route matches the current or pending location.\n*\n* Useful for conditional rendering and active UI states because it subscribes\n* the component to the router state used for matching. The returned function's\n* identity changes when that state changes. For imperative checks in event\n* handlers, get the router with `useRouter` and call `router.matchRoute(...)`\n* to avoid that subscription.\n*\n* @returns A `matchRoute(options)` function that returns `false` or params.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchRouteHook\n*/\nfunction useMatchRoute() {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) return (opts) => {\n\t\tconst { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts;\n\t\treturn router.matchRoute(rest, {\n\t\t\tpending,\n\t\t\tcaseSensitive,\n\t\t\tfuzzy,\n\t\t\tincludeSearch\n\t\t});\n\t};\n\treturn React$1.useCallback((opts) => {\n\t\tconst { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts;\n\t\treturn router.matchRoute(rest, {\n\t\t\tpending,\n\t\t\tcaseSensitive,\n\t\t\tfuzzy,\n\t\t\tincludeSearch\n\t\t});\n\t}, [\n\t\trouter,\n\t\tuseStore(router.stores.location, (location) => location.href),\n\t\tuseStore(router.stores.resolvedLocation, (location) => location?.href),\n\t\tuseStore(router.stores.status, (status) => status)\n\t]);\n}\n/**\n* Component that conditionally renders its children based on whether a route\n* matches the provided `from`/`to` options. If `children` is a function, it\n* receives the matched params object.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/matchRouteComponent\n*/\nfunction MatchRoute(props) {\n\tconst params = useMatchRoute()(props);\n\tif (typeof props.children === \"function\") return props.children(params);\n\treturn params ? props.children : null;\n}\nfunction useMatches(opts) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) {\n\t\tconst matches = router.stores.matches.get();\n\t\treturn opts?.select ? opts.select(matches) : matches;\n\t}\n\treturn useStore(router.stores.matches, useStructuralSharing(opts, router));\n}\n/**\n* Read the presented route matches above the current match, or select a\n* derived value from them.\n*/\nfunction useParentMatches(opts) {\n\tconst contextRouteId = React$1.useContext(matchContext);\n\treturn useMatches({\n\t\tselect: (matches) => {\n\t\t\tmatches = matches.slice(0, matches.findIndex((d) => d.routeId === contextRouteId));\n\t\t\treturn opts?.select ? opts.select(matches) : matches;\n\t\t},\n\t\tstructuralSharing: opts?.structuralSharing\n\t});\n}\n/**\n* Read the presented route matches below the current match, or select a\n* derived value from them.\n*/\nfunction useChildMatches(opts) {\n\tconst contextRouteId = React$1.useContext(matchContext);\n\treturn useMatches({\n\t\tselect: (matches) => {\n\t\t\tmatches = matches.slice(matches.findIndex((d) => d.routeId === contextRouteId) + 1);\n\t\t\treturn opts?.select ? opts.select(matches) : matches;\n\t\t},\n\t\tstructuralSharing: opts?.structuralSharing\n\t});\n}\n//#endregion\nexport { MatchRoute, Matches, useChildMatches, useMatchRoute, useMatches, useParentMatches };\n\n//# sourceMappingURL=Matches.js.map","import { createNonReactiveMutableStore, createNonReactiveReadonlyStore } from \"@tanstack/router-core\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { batch, createAtom } from \"@tanstack/react-store\";\n//#region src/routerStores.ts\nvar getStoreFactory = (opts) => {\n\tif (isServer ?? opts.isServer) return {\n\t\tcreateMutableStore: createNonReactiveMutableStore,\n\t\tcreateReadonlyStore: createNonReactiveReadonlyStore,\n\t\tbatch: (fn) => fn()\n\t};\n\treturn {\n\t\tcreateMutableStore: createAtom,\n\t\tcreateReadonlyStore: createAtom,\n\t\tbatch\n\t};\n};\n//#endregion\nexport { getStoreFactory };\n\n//# sourceMappingURL=routerStores.js.map","import { getStoreFactory } from \"./routerStores.js\";\nimport { RouterCore } from \"@tanstack/router-core\";\n//#region src/router.ts\n/**\n* Creates a new Router instance for React.\n*\n* Pass the returned router to `RouterProvider` to enable routing.\n* Notable options: `routeTree` (your route definitions) and `context`\n* (required if the root route was created with `createRootRouteWithContext`).\n*\n* @param options Router options used to configure the router.\n* @returns A Router instance to be provided to `RouterProvider`.\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n*/\nvar createRouter = (options) => {\n\treturn new Router(options);\n};\nvar Router = class extends RouterCore {\n\tconstructor(options) {\n\t\tsuper(options, getStoreFactory);\n\t}\n};\n//#endregion\nexport { Router, createRouter };\n\n//# sourceMappingURL=router.js.map","\"use client\";\nimport { routerContext } from \"./routerContext.js\";\nimport { Matches } from \"./Matches.js\";\nimport { hasKeys } from \"@tanstack/router-core\";\nimport \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/RouterProvider.tsx\n/**\n* Low-level provider that places the router into React context and optionally\n* updates router options from props. Most apps should use `RouterProvider`.\n*/\nfunction RouterContextProvider({ router, children, ...rest }) {\n\tif (hasKeys(rest)) router.update({\n\t\t...router.options,\n\t\t...rest,\n\t\tcontext: {\n\t\t\t...router.options.context,\n\t\t\t...rest.context\n\t\t}\n\t});\n\tconst provider = /* @__PURE__ */ jsx(routerContext.Provider, {\n\t\tvalue: router,\n\t\tchildren\n\t});\n\tif (router.options.Wrap) return /* @__PURE__ */ jsx(router.options.Wrap, { children: provider });\n\treturn provider;\n}\n/**\n* Renders the current match presentation and provides the router to the React\n* tree via context.\n*\n* Accepts the same options as `createRouter` via props to update the router\n* instance after creation.\n*\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction\n*/\nfunction RouterProvider({ router, ...rest }) {\n\treturn /* @__PURE__ */ jsx(RouterContextProvider, {\n\t\trouter,\n\t\t...rest,\n\t\tchildren: /* @__PURE__ */ jsx(Matches, {})\n\t});\n}\n//#endregion\nexport { RouterContextProvider, RouterProvider };\n\n//# sourceMappingURL=RouterProvider.js.map","\"use client\";\nimport { useRouter } from \"./useRouter.js\";\nimport { useStructuralSharing } from \"./useMatch.js\";\nimport { isServer } from \"@tanstack/router-core/isServer\";\nimport { useStore } from \"@tanstack/react-store\";\n//#region src/useLocation.tsx\n/**\n* Read the current location from the router state with optional selection.\n* Useful for subscribing to just the pieces of location you care about.\n*\n* Options:\n* - `select`: Project the `location` object to a derived value\n* - `structuralSharing`: Enable structural sharing for stable references\n*\n* @returns The current location (or selected value).\n* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook\n*/\nfunction useLocation(opts) {\n\tconst router = useRouter();\n\tif (isServer ?? router.isServer) {\n\t\tconst location = router.stores.location.get();\n\t\treturn opts?.select ? opts.select(location) : location;\n\t}\n\treturn useStore(router.stores.location, useStructuralSharing(opts, router));\n}\n//#endregion\nexport { useLocation };\n\n//# sourceMappingURL=useLocation.js.map"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81],"mappings":"2GACA,IAAI,EAAe,KAAM,CACvB,aAAc,CACZ,KAAK,UAA4B,IAAI,IACrC,KAAK,UAAY,KAAK,UAAU,KAAK,IAAI,CAC3C,CACA,UAAU,EAAU,CAGlB,OAFA,KAAK,UAAU,IAAI,CAAQ,EAC3B,KAAK,YAAY,MACJ,CACX,KAAK,UAAU,OAAO,CAAQ,EAC9B,KAAK,cAAc,CACrB,CACF,CACA,cAAe,CACb,OAAO,KAAK,UAAU,KAAO,CAC/B,CACA,aAAc,CACd,CACA,eAAgB,CAChB,CACF,ECwCI,EAAe,IAAI,cA3DU,CAAa,CAC5C,GACA,GACA,GACA,aAAc,CACZ,MAAM,EACN,KAAKA,GAAU,GAAY,CACzB,GAAI,OAAO,OAAW,KAAe,OAAO,iBAAkB,CAC5D,IAAM,MAAiB,EAAQ,EAE/B,OADA,OAAO,iBAAiB,mBAAoB,EAAU,EAAK,MAC9C,CACX,OAAO,oBAAoB,mBAAoB,CAAQ,CACzD,CACF,CAEF,CACF,CACA,aAAc,CACP,KAAKC,IACR,KAAK,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