gemi 0.58.0 → 0.58.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider-li1J_igh.js","names":["_options","C","#i","#t","#n","#e","#s","#o","#b","#f","#r","#h","#u","#d","#A","#T","#P","#C","#E","#g","#S","#x","#O","#y","#p","#w","#k","#c","#R","#l","#m","#a","URLPattern","l","y","d"],"sources":["../../utils/Subject.ts","../../client/QueryError.ts","../../client/QueryResource.ts","../../client/QueryManagerContext.tsx","../../utils/applyParams.ts","../../utils/omitNullishValues.ts","../../utils/variantKey.ts","../../client/RouteStateContext.tsx","../../client/useParams.ts","../../../../node_modules/.bun/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/esm/extends.js","../../../../node_modules/.bun/history@5.3.0/node_modules/history/index.js","../../../../node_modules/.bun/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.js","../../../../node_modules/.bun/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.js","../../utils/sleep.ts","../../client/ProgressManager.ts","../../client/useLocation.ts","../../client/ServerDataProvider.tsx","../../client/I18nContext.tsx","../../client/useNavigate.ts","../../client/useSearchParams.ts","../../client/useRoute.ts","../../client/HttpReload.tsx","../../client/PrefetchCache.ts","../../client/helpers/routeDataUrl.ts","../../client/helpers/readRoutePayload.ts","../../i18n/dictionaryRegistry.ts","../../client/helpers/flattenComponentTree.ts","../../client/ComponentContext.tsx","../../client/ClientRouterContext.tsx","../../client/RouteTransitionProvider.tsx","../../../../node_modules/.bun/react-error-boundary@6.1.1+83d5fd7b249dbeef/node_modules/react-error-boundary/dist/react-error-boundary.js","../../client/WebsocketContext.tsx","../../client/ThemeProvider.tsx"],"sourcesContent":["export class Subject<T> {\n subscribers = new Set<(value: T) => void>();\n value: T;\n\n constructor(initialValue: T) {\n this.value = initialValue;\n // Bound once, per instance, because these are read as plain functions:\n // `useSyncExternalStore(subject.subscribe, subject.getValue, …)` calls them\n // with no receiver, and an unbound method throws on `this.value`.\n //\n // Here rather than at each call site, and that part matters. Binding in a\n // hook body allocates a fresh function every render, and\n // `useSyncExternalStore` tears down and re-creates its subscription\n // whenever `subscribe` changes identity — so a component rendering a\n // navigation spinner would churn its entry in `subscribers` on every pass.\n // `next` iterates that set, and `Set.forEach` visits entries inserted\n // during iteration, so a value landing mid-resubscribe could notify both\n // the outgoing and the incoming subscriber. Binding here keeps the stable\n // prototype-method identity the call sites used to rely on.\n this.subscribe = this.subscribe.bind(this);\n this.next = this.next.bind(this);\n this.getValue = this.getValue.bind(this);\n }\n\n public subscribe(subscriber: (value: T) => void) {\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n }\n\n public next(value: T) {\n this.value = value;\n this.subscribers.forEach((subscriber) => subscriber(value));\n }\n\n public getValue() {\n return this.value;\n }\n}\n","/**\n * An HTTP failure from a query endpoint, in a shape an error boundary can\n * work with. `resolveVariant` used to store the parsed response body as the\n * error; boundaries expect an `Error`, so the body moves to a field.\n */\nexport class QueryError extends Error {\n constructor(\n public path: string,\n public variantKey: string,\n public status: number,\n public body: any,\n ) {\n super(\n typeof body?.message === \"string\"\n ? body.message\n : `Request to /api${path} failed with status ${status}`,\n );\n this.name = \"QueryError\";\n }\n}\n","import { Subject } from \"../utils/Subject\";\nimport { QueryError } from \"./QueryError\";\n\ntype State = {\n loading: boolean;\n data: any;\n /**\n * Whether `data` is a value the server actually produced — `null`, `0`,\n * `false` and `\"\"` are all legitimate response bodies. Every presence check\n * in the cache goes through this flag, never through `data`'s truthiness:\n * inferring presence from the value made a falsy body look permanently\n * unfetched, which under suspense meant an unbounded fetch/suspend loop.\n */\n hasData: boolean;\n error: any;\n version: number;\n};\n\ntype Deferred = { promise: Promise<void>; resolve: () => void };\n\nexport const DEFAULT_STALE_TIME = 5000;\n\nexport class QueryResource {\n store: Subject<Map<string, State>>;\n staleVariants = new Set<string>();\n lastFetchRecord = new Map<string, number>();\n key: string;\n /**\n * Variants with a request on the wire. React discards and retries a\n * suspended render, so `read` runs many times for one commit — this is what\n * collapses those attempts onto a single fetch. The `loading` flag can't do\n * it: render-initiated fetches are silent and never write to the store.\n */\n private inflight = new Set<string>();\n /**\n * One promise per suspended variant, handed to `use()`. Settled by whatever\n * write lands first — the variant's own fetch or a `hydrate` from a route\n * payload — so a prefetch that arrives mid-suspension wakes the reader\n * without waiting on the wire.\n */\n private pending = new Map<string, Deferred>();\n\n constructor(key: string, initialState: Record<string, any>) {\n this.key = key;\n this.store = new Subject(new Map());\n this.hydrate(initialState);\n }\n\n /**\n * Adopt server-prefetched data into the cache.\n *\n * Called once from the constructor for the SSR payload, and again on every\n * client-side navigation with the `prefetchedData` the server just produced —\n * otherwise the resource cache (which is keyed by path for the lifetime of\n * the app) would keep serving the first payload and revalidate it over `/api`.\n */\n hydrate(initialState: Record<string, any> | null | undefined) {\n const store = this.store.getValue();\n const now = Date.now();\n let changed = false;\n\n for (const [variantKey, data] of Object.entries(initialState ?? {})) {\n // `undefined` means \"no value\" (JSON can't produce it); everything else\n // — including `null`, `0`, `false`, `\"\"` — is a real response body, and\n // a suspended reader may be waiting on exactly this write to settle.\n if (data === undefined) continue;\n const current = store.get(variantKey);\n // Never clobber an in-flight fetch — `resolveVariant` flips `loading`\n // before its first await, so this also covers an optimistic `mutate`\n // whose refetch hasn't landed yet.\n if (current?.loading) continue;\n // Idempotent re-hydration (e.g. StrictMode's double invoke).\n if (current?.hasData && current.data === data) continue;\n\n store.set(variantKey, {\n loading: false,\n data,\n hasData: true,\n error: null,\n version: now,\n });\n this.staleVariants.delete(variantKey);\n this.lastFetchRecord.set(variantKey, now);\n // Wake a reader suspended on this variant — the payload the server just\n // shipped is the answer it was waiting on.\n this.settle(variantKey);\n changed = true;\n }\n\n if (changed) {\n this.store.next(store);\n }\n }\n\n private pendingFor(variantKey: string): Deferred {\n let deferred = this.pending.get(variantKey);\n if (!deferred) {\n let resolve!: () => void;\n const promise = new Promise<void>((r) => {\n resolve = r;\n });\n deferred = { promise, resolve };\n this.pending.set(variantKey, deferred);\n }\n return deferred;\n }\n\n private settle(variantKey: string) {\n const deferred = this.pending.get(variantKey);\n if (deferred) {\n this.pending.delete(variantKey);\n deferred.resolve();\n }\n }\n\n private isStale(variantKey: string, staleTime: number) {\n if (this.staleVariants.has(variantKey)) return true;\n const now = Date.now();\n // `>=` so `staleTime: 0` means \"always revalidate\" and\n // `staleTime: Infinity` means \"never\".\n return now - (this.lastFetchRecord.get(variantKey) ?? now) >= staleTime;\n }\n\n /**\n * The cached state for a variant, or `undefined` — a plain read that never\n * fetches and never revalidates.\n *\n * `getVariant` is the read that keeps the cache honest, and it starts a\n * request when it has to. That makes it the wrong thing to call while\n * rendering: React throws away a render whose subtree suspends and retries\n * it, so every discarded attempt would leak a request. Renders read with\n * this; effects, which only run for a render that committed, use\n * `getVariant`.\n */\n peek(variantKey: string) {\n return this.store.getValue().get(variantKey);\n }\n\n /**\n * The read a render performs. Never suspends when data is in hand (stale\n * data revalidates in the background instead), dedupes across the render\n * attempts React throws away, and hands back a promise that resolves off\n * any write to the variant — its own fetch or a `hydrate`.\n *\n * Safe during render: it never writes to the store synchronously, so the\n * snapshot `useSyncExternalStore` read stays valid for the whole attempt.\n */\n read(\n variantKey: string,\n staleTime: number = DEFAULT_STALE_TIME,\n ): { state?: State; promise?: Promise<void> } {\n const state = this.peek(variantKey);\n\n // Data in hand: stale-while-revalidate, never suspend.\n if (state?.hasData) {\n if (\n !this.inflight.has(variantKey) &&\n this.isStale(variantKey, staleTime)\n ) {\n this.lastFetchRecord.set(variantKey, Date.now());\n this.resolveVariant(variantKey, true);\n }\n return { state };\n }\n if (state?.error) {\n // The caller throws it into the nearest error boundary.\n return { state };\n }\n if (typeof window === \"undefined\") {\n // SSR never fetches and never suspends; the server renders whatever the\n // prefetch payload seeded.\n return { state };\n }\n\n const deferred = this.pendingFor(variantKey);\n if (!this.inflight.has(variantKey)) {\n this.resolveVariant(variantKey, true);\n }\n return { state, promise: deferred.promise };\n }\n\n getVariant(variantKey: string, staleTime: number = DEFAULT_STALE_TIME) {\n const store = this.store.getValue();\n if (!store.has(variantKey)) {\n // Join a render-initiated fetch instead of racing it — silent reads\n // never flip `loading`, so the flag alone can't dedupe here.\n if (!this.inflight.has(variantKey)) {\n this.resolveVariant(variantKey);\n }\n } else {\n const variant = store.get(variantKey);\n\n if (!variant.loading && !this.inflight.has(variantKey)) {\n // Don't have data\n if (!variant.hasData) {\n this.resolveVariant(variantKey);\n return store.get(variantKey);\n }\n if (this.isStale(variantKey, staleTime)) {\n this.lastFetchRecord.set(variantKey, Date.now());\n this.resolveVariant(variantKey, true);\n return store.get(variantKey);\n }\n }\n }\n return store.get(variantKey);\n }\n\n /**\n * A background revalidation: the staleness gate `getVariant` applies, but\n * the fetch is *always* silent — `loading: true` is never written to the\n * cache, so what the caller renders is untouched until the new data lands.\n *\n * That is the difference from `getVariant`, which only takes the silent path\n * for a variant that already `hasData`: a variant sitting on a failed fetch\n * (`hasData: false`, an error stored) would otherwise flip `loading` on for\n * the duration of the request. Focus revalidation reads through here so its\n * \"never changes what's on screen\" contract holds in that case too.\n */\n revalidate(variantKey: string, staleTime: number = DEFAULT_STALE_TIME) {\n if (typeof window === \"undefined\") return;\n // Joining beats racing — a render-initiated read or the mount effect may\n // already have this variant on the wire.\n if (this.inflight.has(variantKey)) return;\n const state = this.peek(variantKey);\n if (state?.loading) return;\n if (state?.hasData) {\n if (!this.isStale(variantKey, staleTime)) return;\n this.lastFetchRecord.set(variantKey, Date.now());\n }\n this.resolveVariant(variantKey, true);\n }\n\n /**\n * Drop the error for one variant (or every variant when omitted), so an\n * error boundary reset re-renders into a clean read instead of instantly\n * re-throwing the stored failure.\n */\n clearError(variantKey?: string) {\n const store = this.store.getValue();\n let changed = false;\n for (const [key, state] of store) {\n if (variantKey !== undefined && key !== variantKey) continue;\n if (state.error) {\n store.set(key, { ...state, error: null });\n changed = true;\n }\n }\n if (changed) {\n this.store.next(store);\n }\n }\n\n mutate(variantKey: string, fn: (data: any) => any = (data) => data) {\n const cacheKey = [\n typeof window !== \"undefined\" && window.location?.origin\n ? window.location.origin\n : \"\",\n this.key,\n variantKey,\n ]\n .filter((s) => s.length > 0)\n .join(\"?\");\n try {\n if (caches) {\n caches?.delete(cacheKey);\n }\n } catch (err) {}\n\n const store = this.store.getValue();\n const state = store.get(variantKey);\n if (!state || !state.hasData) {\n // Nothing is cached yet to update optimistically — e.g. a lazy query, or\n // one that hasn't resolved. Fall through to a refetch so `mutate(fn)` is\n // not a silent no-op (it still means \"go get the latest data\").\n this.resolveVariant(variantKey, false, false);\n return;\n }\n const data = fn(state.data);\n\n this.staleVariants.add(variantKey);\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data,\n hasData: true,\n error: null,\n version: state.version,\n }),\n );\n this.resolveVariant(variantKey, false, false);\n }\n\n refetch(variantKey: string) {\n this.resolveVariant(variantKey, false, false);\n }\n\n private async resolveVariant(\n variantKey: string,\n silent = false,\n cache = true,\n ) {\n if (typeof window === \"undefined\") {\n return;\n }\n // Synchronous with the call, so every read in the same render pass sees\n // the request as already on the wire.\n this.inflight.add(variantKey);\n try {\n const store = this.store.getValue();\n const previousState = store.get(variantKey);\n\n if (!silent) {\n store.set(variantKey, {\n loading: true,\n data: previousState?.data,\n hasData: previousState?.hasData ?? false,\n error: previousState?.error,\n version: previousState?.version,\n });\n }\n\n let data = null;\n let response: Response | null = null;\n const fullUrl = [this.key, variantKey].filter((s) => s.length).join(\"?\");\n try {\n response = await fetch(`/api${fullUrl}`, {\n cache: cache ? \"default\" : \"reload\",\n });\n data = await response.json();\n } catch (error) {\n console.error(`Error fetching url /api${fullUrl}`, error);\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data: previousState?.data,\n hasData: previousState?.hasData ?? false,\n error,\n version: previousState?.version,\n }),\n );\n return;\n }\n\n if (response!.ok) {\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data,\n hasData: true,\n error: null,\n version: Date.now(),\n }),\n );\n this.staleVariants.delete(variantKey);\n this.lastFetchRecord.set(variantKey, Date.now());\n } else {\n // this.lastFetchRecord.set(variantKey, 0);\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data: previousState?.data,\n hasData: previousState?.hasData ?? false,\n error: new QueryError(this.key, variantKey, response!.status, data),\n version: previousState?.version,\n }),\n );\n }\n } finally {\n this.inflight.delete(variantKey);\n // Settle on failure too — a suspended reader has to wake up to throw.\n this.settle(variantKey);\n }\n }\n}\n","import {\n createContext,\n type PropsWithChildren,\n useCallback,\n useMemo,\n useRef,\n} from \"react\";\nimport { QueryResource } from \"./QueryResource\";\n\n/** One streamed query payload: `[path, variantKey, data]`. */\ntype StreamedQueryPayload = [string, string, any];\n\n/**\n * App-wide `useQuery` defaults, threaded from `createRoot(RootLayout, {\n * queryConfig })` (and `init` on the client). Resolution order is per-call\n * config → these defaults → framework defaults, so a call site always wins.\n * Only keys with app-wide meaning are accepted — `lazy`, `fallbackData` and\n * `refetchUntil` stay call-site-only. Framework-internal hooks (`useUser`,\n * `useSignIn`) never see these.\n */\nexport interface QueryConfig {\n /**\n * App-wide suspense switch. `suspense: false` makes every unconfigured\n * `useQuery` behave like pre-0.49: `loading` flags instead of suspension,\n * errors returned instead of thrown. Pair it with the `GemiQueryDefaults`\n * module augmentation so `data`'s nullability matches.\n */\n suspense?: boolean;\n /** How long cached data stays fresh before a read revalidates it, in ms. */\n staleTime?: number;\n keepPreviousData?: boolean;\n retryIntervalOnError?: number;\n refreshInterval?: number;\n /**\n * Revalidate every query when the tab comes back to the foreground, gated by\n * `staleTime`. Off by default.\n */\n revalidateOnFocus?: boolean;\n /**\n * Minimum gap between two focus revalidations of the same query, in ms\n * (default 5000).\n */\n focusThrottleInterval?: number;\n}\n\nexport const QueryConfigContext = createContext<QueryConfig | null>(null);\n\n/**\n * The runtime mirror of the `QueryConfig` type: TS excess-property checking\n * only fires on fresh object literals, so a dynamically built (or plain-JS)\n * config could smuggle call-site-only keys (`lazy`, `fallbackData`,\n * `refetchUntil`) into every query. The provider picks these keys — and only\n * these — before the value enters the context. Keys whose value is\n * `undefined` are dropped too, so an absent value (e.g. an unset env-derived\n * `staleTime`) falls through to the framework default instead of shadowing it.\n */\nconst APP_WIDE_QUERY_CONFIG_KEYS = [\n \"suspense\",\n \"staleTime\",\n \"keepPreviousData\",\n \"retryIntervalOnError\",\n \"refreshInterval\",\n \"revalidateOnFocus\",\n \"focusThrottleInterval\",\n] as const satisfies ReadonlyArray<keyof QueryConfig>;\n\nexport function pickAppWideQueryConfig(\n queryConfig: QueryConfig | null | undefined,\n): QueryConfig | null {\n if (!queryConfig) return null;\n const picked: QueryConfig = {};\n for (const key of APP_WIDE_QUERY_CONFIG_KEYS) {\n if (queryConfig[key] !== undefined) {\n (picked as Record<string, unknown>)[key] = queryConfig[key];\n }\n }\n return picked;\n}\n\nexport type PrefetchedData = Record<string, Record<string, any>>;\n\nexport interface QueryManagerContextValue {\n getResource: (\n key: string,\n initialState?: Record<string, any>,\n ) => QueryResource;\n hydrate: (prefetchedData?: PrefetchedData | null) => void;\n clearErrors: () => void;\n}\n\nexport const QueryManagerContext = createContext<QueryManagerContextValue>({\n getResource: (key: string, initialState: Record<string, any> = {}) => {\n return new QueryResource(key, initialState);\n },\n hydrate: () => {},\n clearErrors: () => {},\n});\n\nexport const QueryManagerProvider = ({\n children,\n queryConfig = null,\n}: PropsWithChildren<{ queryConfig?: QueryConfig | null }>) => {\n const resourcesRef = useRef<Map<string, QueryResource>>(new Map());\n\n // Sanitized once at the choke point every query reads through, so the\n // \"only app-wide keys\" contract holds at runtime, not just in the types.\n const appQueryConfig = useMemo(\n () => pickAppWideQueryConfig(queryConfig),\n [queryConfig],\n );\n\n const getResource = useCallback(\n (key: string, initialState?: Record<string, any>) => {\n let resource = resourcesRef.current.get(key);\n if (!resource) {\n resource = new QueryResource(key, initialState ?? {});\n resourcesRef.current.set(key, resource);\n }\n return resource;\n },\n [],\n );\n\n // Resources are cached by path for the lifetime of the app, so `initialState`\n // above only ever applies to the first load. Every navigation ships a fresh\n // `prefetchedData` payload that has to be pushed into the existing resources,\n // otherwise the components mounting on the new surface refetch it over `/api`.\n const hydrate = useCallback((prefetchedData?: PrefetchedData | null) => {\n if (!prefetchedData) return;\n for (const [key, initialState] of Object.entries(prefetchedData)) {\n if (!initialState || typeof initialState !== \"object\") continue;\n const resource = resourcesRef.current.get(key);\n if (resource) {\n resource.hydrate(initialState);\n } else {\n resourcesRef.current.set(key, new QueryResource(key, initialState));\n }\n }\n }, []);\n\n // Used by the route-level error boundary's reset: without this, the retried\n // render would read the stored failure back out of the cache and re-throw.\n const clearErrors = useCallback(() => {\n for (const resource of resourcesRef.current.values()) {\n resource.clearError();\n }\n }, []);\n\n // Streaming SSR delivers late-resolving queries as inline\n // `__GEMI_STREAM__.push([path, variant, data])` scripts interleaved with\n // React's chunks. Payloads that ran before this rendered sit buffered in a\n // plain array; from here on, `push` hydrates directly — and `hydrate`\n // settles any reader suspended on that variant.\n //\n // Drained synchronously during the FIRST render, not in an effect:\n // suspension happens during the render phase, so a segment hydrating in\n // this very pass must already find its streamed data in the cache — an\n // effect-timed drain would let it suspend and start a duplicate `/api`\n // fetch for data the document already carries. Safe here: it runs once\n // (idempotent under StrictMode's double-invoke), and nothing is subscribed\n // to the store yet, so no render is invalidated mid-pass.\n const drainedStreamRef = useRef(false);\n if (typeof window !== \"undefined\" && !drainedStreamRef.current) {\n drainedStreamRef.current = true;\n const w = window as unknown as {\n __GEMI_STREAM__?:\n | StreamedQueryPayload[]\n | { push: (p: StreamedQueryPayload) => void };\n };\n const adopt = ([path, variantKey, data]: StreamedQueryPayload) => {\n hydrate({ [path]: { [variantKey]: data } });\n };\n const buffered = Array.isArray(w.__GEMI_STREAM__) ? w.__GEMI_STREAM__ : [];\n w.__GEMI_STREAM__ = { push: adopt };\n for (const payload of buffered) {\n adopt(payload);\n }\n }\n\n const value = useMemo(\n () => ({ getResource, hydrate, clearErrors }),\n [getResource, hydrate, clearErrors],\n );\n\n return (\n <QueryManagerContext.Provider value={value}>\n <QueryConfigContext.Provider value={appQueryConfig}>\n {children}\n </QueryConfigContext.Provider>\n </QueryManagerContext.Provider>\n );\n};\n","export function applyParams<T extends string>(\n url: T,\n params: Record<string, string | number | undefined>,\n): string {\n return (\n url\n .replace(/:([^/]+[*?]?)/g, (_, key) => {\n const hasSuffix = key.endsWith(\"?\") || key.endsWith(\"*\");\n const paramName = hasSuffix ? key.slice(0, -1) : key;\n const value = params[paramName];\n\n if (value === undefined) {\n if (hasSuffix) {\n return \"\"; // Remove the optional segment if no value is provided\n }\n // @ts-ignore\n if (import.meta.env.DEV) {\n throw new Error(`Missing parameter: ${paramName}`);\n }\n console.error(`Missing parameter: ${paramName} in URL: ${url}`);\n }\n\n return String(value);\n })\n // remove double slashes\n .replace(/\\/\\//g, \"/\")\n // remove trailing slash\n .replace(/\\/$/, \"\")\n );\n}\n","export function omitNullishValues<T>(input: T) {\n return Object.fromEntries(\n Object.entries(input).filter(([, value]) => {\n return value !== null && value !== undefined;\n }),\n ) as T;\n}\n","import { omitNullishValues } from \"./omitNullishValues\";\n\n/**\n * The key one search-param combination is cached under, inside a query's\n * resource: the params sorted and serialized, empty when there are none.\n *\n * Sorted because `?b=2&a=1` and `?a=1&b=2` are the same request, and a cache\n * that keyed them separately would fetch twice and hydrate one of them from a\n * payload the server produced for the other. Nullish values are dropped for\n * the same reason: an optional filter left `undefined` is absent, not the\n * string `\"undefined\"`.\n *\n * Every site that reads or writes the cache derives its key from here —\n * `useQuery` (the read), `useMutate` (the write), and `gemi/testing`'s `<Page>`\n * (the seed). They used to hold a copy each, which is the kind of duplication\n * that fails quietly: a seed built by an old copy simply misses, and the test\n * that should have read it fetches over the network and asserts an empty state\n * with nothing pointing at the mismatch.\n */\nexport function toVariantKey(\n search: string | Record<string, unknown> | null | undefined,\n): string {\n const searchParams = new URLSearchParams(\n typeof search === \"string\"\n ? search\n : (omitNullishValues(search ?? {}) as Record<string, string>),\n );\n searchParams.sort();\n return searchParams.toString();\n}\n","import type { Action } from \"history\";\nimport { createContext, type PropsWithChildren } from \"react\";\n\nexport interface RouteState {\n views: string[];\n params: Record<string, string>;\n search: string;\n state: Record<string, unknown>;\n pathname: string;\n hash: string;\n action: Action | null;\n routePath: string;\n locale: string | null;\n}\n\nexport type PageData = {\n data: Record<string, unknown>;\n i18n: {\n currentLocale: string;\n dictionary: Record<string, Record<string, unknown>>;\n supportedLocales: string[];\n };\n prefetchedData: Record<string, unknown>;\n breadcrumbs: any;\n appId: string;\n /**\n * Evaluated features, replaced on every navigation.\n *\n * Lives here rather than only on `ServerDataContext` for the same reason\n * `i18n` does: the server re-evaluates on each navigation payload, so reading\n * from route state is what makes switching a feature on land without a hard\n * reload.\n */\n features: Record<string, boolean>;\n};\n\nexport const RouteStateContext = createContext({} as RouteState & PageData);\n\nexport const RouteStateProvider = (\n props: PropsWithChildren<{\n state: RouteState & PageData;\n }>,\n) => {\n return (\n <RouteStateContext.Provider value={props.state}>\n {props.children}\n </RouteStateContext.Provider>\n );\n};\n","import { useContext } from \"react\";\nimport { RouteStateContext } from \"./RouteStateContext\";\n\nexport function useParams() {\n const { params = {} } = useContext(RouteStateContext);\n return params;\n}\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import _extends from '@babel/runtime/helpers/esm/extends';\n\n/**\r\n * Actions represent the type of change to a location value.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action\r\n */\nvar Action;\n\n(function (Action) {\n /**\r\n * A POP indicates a change to an arbitrary index in the history stack, such\r\n * as a back or forward navigation. It does not describe the direction of the\r\n * navigation, only that the current index changed.\r\n *\r\n * Note: This is the default action for newly created history objects.\r\n */\n Action[\"Pop\"] = \"POP\";\n /**\r\n * A PUSH indicates a new entry being added to the history stack, such as when\r\n * a link is clicked and a new page loads. When this happens, all subsequent\r\n * entries in the stack are lost.\r\n */\n\n Action[\"Push\"] = \"PUSH\";\n /**\r\n * A REPLACE indicates the entry at the current index in the history stack\r\n * being replaced by a new one.\r\n */\n\n Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\n\nvar readOnly = process.env.NODE_ENV !== \"production\" ? function (obj) {\n return Object.freeze(obj);\n} : function (obj) {\n return obj;\n};\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== 'undefined') console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nvar BeforeUnloadEventType = 'beforeunload';\nvar HashChangeEventType = 'hashchange';\nvar PopStateEventType = 'popstate';\n/**\r\n * Browser history stores the location in regular URLs. This is the standard for\r\n * most web apps, but it requires some configuration on the server to ensure you\r\n * serve the same app at multiple URLs.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\r\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$window = _options.window,\n window = _options$window === void 0 ? document.defaultView : _options$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation[0],\n nextLocation = _getIndexAndLocation[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better what\n // is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n var action = Action.Pop;\n\n var _getIndexAndLocation2 = getIndexAndLocation(),\n index = _getIndexAndLocation2[0],\n location = _getIndexAndLocation2[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n } // state defaults to `null` because `window.history.state` does\n\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation3 = getIndexAndLocation();\n\n index = _getIndexAndLocation3[0];\n location = _getIndexAndLocation3[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr[0],\n url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr2[0],\n url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Hash history stores the location in window.location.hash. This makes it ideal\r\n * for situations where you don't want to send the location to the server for\r\n * some reason, either because you do cannot configure it or the URL space is\r\n * reserved for something else.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\r\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options2 = options,\n _options2$window = _options2.window,\n window = _options2$window === void 0 ? document.defaultView : _options2$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _parsePath = parsePath(window.location.hash.substr(1)),\n _parsePath$pathname = _parsePath.pathname,\n pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname,\n _parsePath$search = _parsePath.search,\n search = _parsePath$search === void 0 ? '' : _parsePath$search,\n _parsePath$hash = _parsePath.hash,\n hash = _parsePath$hash === void 0 ? '' : _parsePath$hash;\n\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation4 = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation4[0],\n nextLocation = _getIndexAndLocation4[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better\n // what is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop); // popstate does not fire on hashchange in IE 11 and old (trident) Edge\n // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event\n\n window.addEventListener(HashChangeEventType, function () {\n var _getIndexAndLocation5 = getIndexAndLocation(),\n nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events.\n\n\n if (createPath(nextLocation) !== createPath(location)) {\n handlePop();\n }\n });\n var action = Action.Pop;\n\n var _getIndexAndLocation6 = getIndexAndLocation(),\n index = _getIndexAndLocation6[0],\n location = _getIndexAndLocation6[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function getBaseHref() {\n var base = document.querySelector('base');\n var href = '';\n\n if (base && base.getAttribute('href')) {\n var url = window.location.href;\n var hashIndex = url.indexOf('#');\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href;\n }\n\n function createHref(to) {\n return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to));\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation7 = getIndexAndLocation();\n\n index = _getIndexAndLocation7[0];\n location = _getIndexAndLocation7[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr3[0],\n url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr4[0],\n url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Memory history stores the current location in memory. It is designed for use\r\n * in stateful non-browser environments like tests and React Native.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory\r\n */\n\nfunction createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options3 = options,\n _options3$initialEntr = _options3.initialEntries,\n initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr,\n initialIndex = _options3.initialIndex;\n var entries = initialEntries.map(function (entry) {\n var location = readOnly(_extends({\n pathname: '/',\n search: '',\n hash: '',\n state: null,\n key: createKey()\n }, typeof entry === 'string' ? parsePath(entry) : entry));\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: \" + JSON.stringify(entry) + \")\") : void 0;\n return location;\n });\n var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);\n var action = Action.Pop;\n var location = entries[index];\n var listeners = createEvents();\n var blockers = createEvents();\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n search: '',\n hash: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction, nextLocation) {\n action = nextAction;\n location = nextLocation;\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n applyTx(nextAction, nextLocation);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n entries[index] = nextLocation;\n applyTx(nextAction, nextLocation);\n }\n }\n\n function go(delta) {\n var nextIndex = clamp(index + delta, 0, entries.length - 1);\n var nextAction = Action.Pop;\n var nextLocation = entries[nextIndex];\n\n function retry() {\n go(delta);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index = nextIndex;\n applyTx(nextAction, nextLocation);\n }\n }\n\n var history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n return blockers.push(blocker);\n }\n };\n return history;\n} ////////////////////////////////////////////////////////////////////////////////\n// UTILS\n////////////////////////////////////////////////////////////////////////////////\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n\nfunction promptBeforeUnload(event) {\n // Cancel the event.\n event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set.\n\n event.returnValue = '';\n}\n\nfunction createEvents() {\n var handlers = [];\n return {\n get length() {\n return handlers.length;\n },\n\n push: function push(fn) {\n handlers.push(fn);\n return function () {\n handlers = handlers.filter(function (handler) {\n return handler !== fn;\n });\n };\n },\n call: function call(arg) {\n handlers.forEach(function (fn) {\n return fn && fn(arg);\n });\n }\n };\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\r\n * Creates a string URL path from the given pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath\r\n */\n\n\nfunction createPath(_ref) {\n var _ref$pathname = _ref.pathname,\n pathname = _ref$pathname === void 0 ? '/' : _ref$pathname,\n _ref$search = _ref.search,\n search = _ref$search === void 0 ? '' : _ref$search,\n _ref$hash = _ref.hash,\n hash = _ref$hash === void 0 ? '' : _ref$hash;\n if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search;\n if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash;\n return pathname;\n}\n/**\r\n * Parses a string URL path into its separate pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath\r\n */\n\nfunction parsePath(path) {\n var parsedPath = {};\n\n if (path) {\n var hashIndex = path.indexOf('#');\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n var searchIndex = path.indexOf('?');\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath };\n//# sourceMappingURL=index.js.map\n","var Pe=Object.defineProperty;var a=(e,t)=>Pe(e,\"name\",{value:t,configurable:!0});var P=class{type=3;name=\"\";prefix=\"\";value=\"\";suffix=\"\";modifier=3;constructor(t,r,n,c,l,f){this.type=t,this.name=r,this.prefix=n,this.value=c,this.suffix=l,this.modifier=f}hasCustomName(){return this.name!==\"\"&&typeof this.name!=\"number\"}};a(P,\"Part\");var Re=/[$_\\p{ID_Start}]/u,Ee=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,v=\".*\";function Oe(e,t){return(t?/^[\\x00-\\xFF]*$/:/^[\\x00-\\x7F]*$/).test(e)}a(Oe,\"isASCII\");function D(e,t=!1){let r=[],n=0;for(;n<e.length;){let c=e[n],l=a(function(f){if(!t)throw new TypeError(f);r.push({type:\"INVALID_CHAR\",index:n,value:e[n++]})},\"ErrorOrInvalid\");if(c===\"*\"){r.push({type:\"ASTERISK\",index:n,value:e[n++]});continue}if(c===\"+\"||c===\"?\"){r.push({type:\"OTHER_MODIFIER\",index:n,value:e[n++]});continue}if(c===\"\\\\\"){r.push({type:\"ESCAPED_CHAR\",index:n++,value:e[n++]});continue}if(c===\"{\"){r.push({type:\"OPEN\",index:n,value:e[n++]});continue}if(c===\"}\"){r.push({type:\"CLOSE\",index:n,value:e[n++]});continue}if(c===\":\"){let f=\"\",s=n+1;for(;s<e.length;){let i=e.substr(s,1);if(s===n+1&&Re.test(i)||s!==n+1&&Ee.test(i)){f+=e[s++];continue}break}if(!f){l(`Missing parameter name at ${n}`);continue}r.push({type:\"NAME\",index:n,value:f}),n=s;continue}if(c===\"(\"){let f=1,s=\"\",i=n+1,o=!1;if(e[i]===\"?\"){l(`Pattern cannot start with \"?\" at ${i}`);continue}for(;i<e.length;){if(!Oe(e[i],!1)){l(`Invalid character '${e[i]}' at ${i}.`),o=!0;break}if(e[i]===\"\\\\\"){s+=e[i++]+e[i++];continue}if(e[i]===\")\"){if(f--,f===0){i++;break}}else if(e[i]===\"(\"&&(f++,e[i+1]!==\"?\")){l(`Capturing groups are not allowed at ${i}`),o=!0;break}s+=e[i++]}if(o)continue;if(f){l(`Unbalanced pattern at ${n}`);continue}if(!s){l(`Missing pattern at ${n}`);continue}r.push({type:\"REGEX\",index:n,value:s}),n=i;continue}r.push({type:\"CHAR\",index:n,value:e[n++]})}return r.push({type:\"END\",index:n,value:\"\"}),r}a(D,\"lexer\");function F(e,t={}){let r=D(e);t.delimiter??=\"/#?\",t.prefixes??=\"./\";let n=`[^${x(t.delimiter)}]+?`,c=[],l=0,f=0,s=\"\",i=new Set,o=a(u=>{if(f<r.length&&r[f].type===u)return r[f++].value},\"tryConsume\"),h=a(()=>o(\"OTHER_MODIFIER\")??o(\"ASTERISK\"),\"tryConsumeModifier\"),p=a(u=>{let d=o(u);if(d!==void 0)return d;let{type:g,index:y}=r[f];throw new TypeError(`Unexpected ${g} at ${y}, expected ${u}`)},\"mustConsume\"),A=a(()=>{let u=\"\",d;for(;d=o(\"CHAR\")??o(\"ESCAPED_CHAR\");)u+=d;return u},\"consumeText\"),xe=a(u=>u,\"DefaultEncodePart\"),N=t.encodePart||xe,H=\"\",$=a(u=>{H+=u},\"appendToPendingFixedValue\"),M=a(()=>{H.length&&(c.push(new P(3,\"\",\"\",N(H),\"\",3)),H=\"\")},\"maybeAddPartFromPendingFixedValue\"),X=a((u,d,g,y,Z)=>{let m=3;switch(Z){case\"?\":m=1;break;case\"*\":m=0;break;case\"+\":m=2;break}if(!d&&!g&&m===3){$(u);return}if(M(),!d&&!g){if(!u)return;c.push(new P(3,\"\",\"\",N(u),\"\",m));return}let S;g?g===\"*\"?S=v:S=g:S=n;let k=2;S===n?(k=1,S=\"\"):S===v&&(k=0,S=\"\");let E;if(d?E=d:g&&(E=l++),i.has(E))throw new TypeError(`Duplicate name '${E}'.`);i.add(E),c.push(new P(k,E,N(u),S,N(y),m))},\"addPart\");for(;f<r.length;){let u=o(\"CHAR\"),d=o(\"NAME\"),g=o(\"REGEX\");if(!d&&!g&&(g=o(\"ASTERISK\")),d||g){let m=u??\"\";t.prefixes.indexOf(m)===-1&&($(m),m=\"\"),M();let S=h();X(m,d,g,\"\",S);continue}let y=u??o(\"ESCAPED_CHAR\");if(y){$(y);continue}if(o(\"OPEN\")){let m=A(),S=o(\"NAME\"),k=o(\"REGEX\");!S&&!k&&(k=o(\"ASTERISK\"));let E=A();p(\"CLOSE\");let be=h();X(m,S,k,E,be);continue}M(),p(\"END\")}return c}a(F,\"parse\");function x(e){return e.replace(/([.+*?^${}()[\\]|/\\\\])/g,\"\\\\$1\")}a(x,\"escapeString\");function B(e){return e&&e.ignoreCase?\"ui\":\"u\"}a(B,\"flags\");function q(e,t,r){return W(F(e,r),t,r)}a(q,\"stringToRegexp\");function T(e){switch(e){case 0:return\"*\";case 1:return\"?\";case 2:return\"+\";case 3:return\"\"}}a(T,\"modifierToString\");function W(e,t,r={}){r.delimiter??=\"/#?\",r.prefixes??=\"./\",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith=\"\";let n=r.start?\"^\":\"\";for(let s of e){if(s.type===3){s.modifier===3?n+=x(s.value):n+=`(?:${x(s.value)})${T(s.modifier)}`;continue}t&&t.push(s.name);let i=`[^${x(r.delimiter)}]+?`,o=s.value;if(s.type===1?o=i:s.type===0&&(o=v),!s.prefix.length&&!s.suffix.length){s.modifier===3||s.modifier===1?n+=`(${o})${T(s.modifier)}`:n+=`((?:${o})${T(s.modifier)})`;continue}if(s.modifier===3||s.modifier===1){n+=`(?:${x(s.prefix)}(${o})${x(s.suffix)})`,n+=T(s.modifier);continue}n+=`(?:${x(s.prefix)}`,n+=`((?:${o})(?:`,n+=x(s.suffix),n+=x(s.prefix),n+=`(?:${o}))*)${x(s.suffix)})`,s.modifier===0&&(n+=\"?\")}let c=`[${x(r.endsWith)}]|$`,l=`[${x(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${l}?`),r.endsWith.length?n+=`(?=${c})`:n+=\"$\",new RegExp(n,B(r));r.strict||(n+=`(?:${l}(?=${c}))?`);let f=!1;if(e.length){let s=e[e.length-1];s.type===3&&s.modifier===3&&(f=r.delimiter.indexOf(s)>-1)}return f||(n+=`(?=${l}|${c})`),new RegExp(n,B(r))}a(W,\"partsToRegexp\");var b={delimiter:\"\",prefixes:\"\",sensitive:!0,strict:!0},J={delimiter:\".\",prefixes:\"\",sensitive:!0,strict:!0},Q={delimiter:\"/\",prefixes:\"/\",sensitive:!0,strict:!0};function ee(e,t){return e.length?e[0]===\"/\"?!0:!t||e.length<2?!1:(e[0]==\"\\\\\"||e[0]==\"{\")&&e[1]==\"/\":!1}a(ee,\"isAbsolutePathname\");function te(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}a(te,\"maybeStripPrefix\");function ke(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}a(ke,\"maybeStripSuffix\");function _(e){return!e||e.length<2?!1:e[0]===\"[\"||(e[0]===\"\\\\\"||e[0]===\"{\")&&e[1]===\"[\"}a(_,\"treatAsIPv6Hostname\");var re=[\"ftp\",\"file\",\"http\",\"https\",\"ws\",\"wss\"];function U(e){if(!e)return!0;for(let t of re)if(e.test(t))return!0;return!1}a(U,\"isSpecialScheme\");function ne(e,t){if(e=te(e,\"#\"),t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):\"\"}a(ne,\"canonicalizeHash\");function se(e,t){if(e=te(e,\"?\"),t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.search=e,r.search?r.search.substring(1,r.search.length):\"\"}a(se,\"canonicalizeSearch\");function ie(e,t){return t||e===\"\"?e:_(e)?K(e):j(e)}a(ie,\"canonicalizeHostname\");function ae(e,t){if(t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.password=e,r.password}a(ae,\"canonicalizePassword\");function oe(e,t){if(t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.username=e,r.username}a(oe,\"canonicalizeUsername\");function ce(e,t,r){if(r||e===\"\")return e;if(t&&!re.includes(t))return new URL(`${t}:${e}`).pathname;let n=e[0]==\"/\";return e=new URL(n?e:\"/-\"+e,\"https://example.com\").pathname,n||(e=e.substring(2,e.length)),e}a(ce,\"canonicalizePathname\");function le(e,t,r){return z(t)===e&&(e=\"\"),r||e===\"\"?e:G(e)}a(le,\"canonicalizePort\");function fe(e,t){return e=ke(e,\":\"),t||e===\"\"?e:w(e)}a(fe,\"canonicalizeProtocol\");function z(e){switch(e){case\"ws\":case\"http\":return\"80\";case\"wws\":case\"https\":return\"443\";case\"ftp\":return\"21\";default:return\"\"}}a(z,\"defaultPortForProtocol\");function w(e){if(e===\"\")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}a(w,\"protocolEncodeCallback\");function he(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.username=e,t.username}a(he,\"usernameEncodeCallback\");function ue(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.password=e,t.password}a(ue,\"passwordEncodeCallback\");function j(e){if(e===\"\")return e;if(/[\\t\\n\\r #%/:<>?@[\\]^\\\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL(\"https://example.com\");return t.hostname=e,t.hostname}a(j,\"hostnameEncodeCallback\");function K(e){if(e===\"\")return e;if(/[^0-9a-fA-F[\\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}a(K,\"ipv6HostnameEncodeCallback\");function G(e){if(e===\"\"||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}a(G,\"portEncodeCallback\");function de(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.pathname=e[0]!==\"/\"?\"/-\"+e:e,e[0]!==\"/\"?t.pathname.substring(2,t.pathname.length):t.pathname}a(de,\"standardURLPathnameEncodeCallback\");function pe(e){return e===\"\"?e:new URL(`data:${e}`).pathname}a(pe,\"pathURLPathnameEncodeCallback\");function ge(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.search=e,t.search.substring(1,t.search.length)}a(ge,\"searchEncodeCallback\");function me(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.hash=e,t.hash.substring(1,t.hash.length)}a(me,\"hashEncodeCallback\");var C=class{#i;#n=[];#t={};#e=0;#s=1;#l=0;#o=0;#d=0;#p=0;#g=!1;constructor(t){this.#i=t}get result(){return this.#t}parse(){for(this.#n=D(this.#i,!0);this.#e<this.#n.length;this.#e+=this.#s){if(this.#s=1,this.#n[this.#e].type===\"END\"){if(this.#o===0){this.#b(),this.#f()?this.#r(9,1):this.#h()?this.#r(8,1):this.#r(7,0);continue}else if(this.#o===2){this.#u(5);continue}this.#r(10,0);break}if(this.#d>0)if(this.#A())this.#d-=1;else continue;if(this.#T()){this.#d+=1;continue}switch(this.#o){case 0:this.#P()&&this.#u(1);break;case 1:if(this.#P()){this.#C();let t=7,r=1;this.#E()?(t=2,r=3):this.#g&&(t=2),this.#r(t,r)}break;case 2:this.#S()?this.#u(3):(this.#x()||this.#h()||this.#f())&&this.#u(5);break;case 3:this.#O()?this.#r(4,1):this.#S()&&this.#r(5,1);break;case 4:this.#S()&&this.#r(5,1);break;case 5:this.#y()?this.#p+=1:this.#w()&&(this.#p-=1),this.#k()&&!this.#p?this.#r(6,1):this.#x()?this.#r(7,0):this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 6:this.#x()?this.#r(7,0):this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 7:this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 8:this.#f()&&this.#r(9,1);break;case 9:break;case 10:break}}this.#t.hostname!==void 0&&this.#t.port===void 0&&(this.#t.port=\"\")}#r(t,r){switch(this.#o){case 0:break;case 1:this.#t.protocol=this.#c();break;case 2:break;case 3:this.#t.username=this.#c();break;case 4:this.#t.password=this.#c();break;case 5:this.#t.hostname=this.#c();break;case 6:this.#t.port=this.#c();break;case 7:this.#t.pathname=this.#c();break;case 8:this.#t.search=this.#c();break;case 9:this.#t.hash=this.#c();break;case 10:break}this.#o!==0&&t!==10&&([1,2,3,4].includes(this.#o)&&[6,7,8,9].includes(t)&&(this.#t.hostname??=\"\"),[1,2,3,4,5,6].includes(this.#o)&&[8,9].includes(t)&&(this.#t.pathname??=this.#g?\"/\":\"\"),[1,2,3,4,5,6,7].includes(this.#o)&&t===9&&(this.#t.search??=\"\")),this.#R(t,r)}#R(t,r){this.#o=t,this.#l=this.#e+r,this.#e+=r,this.#s=0}#b(){this.#e=this.#l,this.#s=0}#u(t){this.#b(),this.#o=t}#m(t){return t<0&&(t=this.#n.length-t),t<this.#n.length?this.#n[t]:this.#n[this.#n.length-1]}#a(t,r){let n=this.#m(t);return n.value===r&&(n.type===\"CHAR\"||n.type===\"ESCAPED_CHAR\"||n.type===\"INVALID_CHAR\")}#P(){return this.#a(this.#e,\":\")}#E(){return this.#a(this.#e+1,\"/\")&&this.#a(this.#e+2,\"/\")}#S(){return this.#a(this.#e,\"@\")}#O(){return this.#a(this.#e,\":\")}#k(){return this.#a(this.#e,\":\")}#x(){return this.#a(this.#e,\"/\")}#h(){if(this.#a(this.#e,\"?\"))return!0;if(this.#n[this.#e].value!==\"?\")return!1;let t=this.#m(this.#e-1);return t.type!==\"NAME\"&&t.type!==\"REGEX\"&&t.type!==\"CLOSE\"&&t.type!==\"ASTERISK\"}#f(){return this.#a(this.#e,\"#\")}#T(){return this.#n[this.#e].type==\"OPEN\"}#A(){return this.#n[this.#e].type==\"CLOSE\"}#y(){return this.#a(this.#e,\"[\")}#w(){return this.#a(this.#e,\"]\")}#c(){let t=this.#n[this.#e],r=this.#m(this.#l).index;return this.#i.substring(r,t.index)}#C(){let t={};Object.assign(t,b),t.encodePart=w;let r=q(this.#c(),void 0,t);this.#g=U(r)}};a(C,\"Parser\");var V=[\"protocol\",\"username\",\"password\",\"hostname\",\"port\",\"pathname\",\"search\",\"hash\"],O=\"*\";function Se(e,t){if(typeof e!=\"string\")throw new TypeError(\"parameter 1 is not of type 'string'.\");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==\"\"?r.search.substring(1,r.search.length):void 0,hash:r.hash!==\"\"?r.hash.substring(1,r.hash.length):void 0}}a(Se,\"extractValues\");function R(e,t){return t?I(e):e}a(R,\"processBaseURLString\");function L(e,t,r){let n;if(typeof t.baseURL==\"string\")try{n=new URL(t.baseURL),t.protocol===void 0&&(e.protocol=R(n.protocol.substring(0,n.protocol.length-1),r)),!r&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&(e.username=R(n.username,r)),!r&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&t.password===void 0&&(e.password=R(n.password,r)),t.protocol===void 0&&t.hostname===void 0&&(e.hostname=R(n.hostname,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&(e.port=R(n.port,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&(e.pathname=R(n.pathname,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&(e.search=R(n.search.substring(1,n.search.length),r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&t.hash===void 0&&(e.hash=R(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol==\"string\"&&(e.protocol=fe(t.protocol,r)),typeof t.username==\"string\"&&(e.username=oe(t.username,r)),typeof t.password==\"string\"&&(e.password=ae(t.password,r)),typeof t.hostname==\"string\"&&(e.hostname=ie(t.hostname,r)),typeof t.port==\"string\"&&(e.port=le(t.port,e.protocol,r)),typeof t.pathname==\"string\"){if(e.pathname=t.pathname,n&&!ee(e.pathname,r)){let c=n.pathname.lastIndexOf(\"/\");c>=0&&(e.pathname=R(n.pathname.substring(0,c+1),r)+e.pathname)}e.pathname=ce(e.pathname,e.protocol,r)}return typeof t.search==\"string\"&&(e.search=se(t.search,r)),typeof t.hash==\"string\"&&(e.hash=ne(t.hash,r)),e}a(L,\"applyInit\");function I(e){return e.replace(/([+*?:{}()\\\\])/g,\"\\\\$1\")}a(I,\"escapePatternString\");function Te(e){return e.replace(/([.+*?^${}()[\\]|/\\\\])/g,\"\\\\$1\")}a(Te,\"escapeRegexpString\");function Ae(e,t){t.delimiter??=\"/#?\",t.prefixes??=\"./\",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith=\"\";let r=\".*\",n=`[^${Te(t.delimiter)}]+?`,c=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,l=\"\";for(let f=0;f<e.length;++f){let s=e[f];if(s.type===3){if(s.modifier===3){l+=I(s.value);continue}l+=`{${I(s.value)}}${T(s.modifier)}`;continue}let i=s.hasCustomName(),o=!!s.suffix.length||!!s.prefix.length&&(s.prefix.length!==1||!t.prefixes.includes(s.prefix)),h=f>0?e[f-1]:null,p=f<e.length-1?e[f+1]:null;if(!o&&i&&s.type===1&&s.modifier===3&&p&&!p.prefix.length&&!p.suffix.length)if(p.type===3){let A=p.value.length>0?p.value[0]:\"\";o=c.test(A)}else o=!p.hasCustomName();if(!o&&!s.prefix.length&&h&&h.type===3){let A=h.value[h.value.length-1];o=t.prefixes.includes(A)}o&&(l+=\"{\"),l+=I(s.prefix),i&&(l+=`:${s.name}`),s.type===2?l+=`(${s.value})`:s.type===1?i||(l+=`(${n})`):s.type===0&&(!i&&(!h||h.type===3||h.modifier!==3||o||s.prefix!==\"\")?l+=\"*\":l+=`(${r})`),s.type===1&&i&&s.suffix.length&&c.test(s.suffix[0])&&(l+=\"\\\\\"),l+=I(s.suffix),o&&(l+=\"}\"),s.modifier!==3&&(l+=T(s.modifier))}return l}a(Ae,\"partsToPattern\");var Y=class{#i;#n={};#t={};#e={};#s={};#l=!1;constructor(t={},r,n){try{let c;if(typeof r==\"string\"?c=r:n=r,typeof t==\"string\"){let i=new C(t);if(i.parse(),t=i.result,c===void 0&&typeof t.protocol!=\"string\")throw new TypeError(\"A base URL must be provided for a relative constructor string.\");t.baseURL=c}else{if(!t||typeof t!=\"object\")throw new TypeError(\"parameter 1 is not of type 'string' and cannot convert to dictionary.\");if(c)throw new TypeError(\"parameter 1 is not of type 'string'.\")}typeof n>\"u\"&&(n={ignoreCase:!1});let l={ignoreCase:n.ignoreCase===!0},f={pathname:O,protocol:O,username:O,password:O,hostname:O,port:O,search:O,hash:O};this.#i=L(f,t,!0),z(this.#i.protocol)===this.#i.port&&(this.#i.port=\"\");let s;for(s of V){if(!(s in this.#i))continue;let i={},o=this.#i[s];switch(this.#t[s]=[],s){case\"protocol\":Object.assign(i,b),i.encodePart=w;break;case\"username\":Object.assign(i,b),i.encodePart=he;break;case\"password\":Object.assign(i,b),i.encodePart=ue;break;case\"hostname\":Object.assign(i,J),_(o)?i.encodePart=K:i.encodePart=j;break;case\"port\":Object.assign(i,b),i.encodePart=G;break;case\"pathname\":U(this.#n.protocol)?(Object.assign(i,Q,l),i.encodePart=de):(Object.assign(i,b,l),i.encodePart=pe);break;case\"search\":Object.assign(i,b,l),i.encodePart=ge;break;case\"hash\":Object.assign(i,b,l),i.encodePart=me;break}try{this.#s[s]=F(o,i),this.#n[s]=W(this.#s[s],this.#t[s],i),this.#e[s]=Ae(this.#s[s],i),this.#l=this.#l||this.#s[s].some(h=>h.type===2)}catch{throw new TypeError(`invalid ${s} pattern '${this.#i[s]}'.`)}}}catch(c){throw new TypeError(`Failed to construct 'URLPattern': ${c.message}`)}}get[Symbol.toStringTag](){return\"URLPattern\"}test(t={},r){let n={pathname:\"\",protocol:\"\",username:\"\",password:\"\",hostname:\"\",port:\"\",search:\"\",hash:\"\"};if(typeof t!=\"string\"&&r)throw new TypeError(\"parameter 1 is not of type 'string'.\");if(typeof t>\"u\")return!1;try{typeof t==\"object\"?n=L(n,t,!1):n=L(n,Se(t,r),!1)}catch{return!1}let c;for(c of V)if(!this.#n[c].exec(n[c]))return!1;return!0}exec(t={},r){let n={pathname:\"\",protocol:\"\",username:\"\",password:\"\",hostname:\"\",port:\"\",search:\"\",hash:\"\"};if(typeof t!=\"string\"&&r)throw new TypeError(\"parameter 1 is not of type 'string'.\");if(typeof t>\"u\")return;try{typeof t==\"object\"?n=L(n,t,!1):n=L(n,Se(t,r),!1)}catch{return null}let c={};r?c.inputs=[t,r]:c.inputs=[t];let l;for(l of V){let f=this.#n[l].exec(n[l]);if(!f)return null;let s={};for(let[i,o]of this.#t[l].entries())if(typeof o==\"string\"||typeof o==\"number\"){let h=f[i+1];s[o]=h}c[l]={input:n[l]??\"\",groups:s}}return c}static compareComponent(t,r,n){let c=a((i,o)=>{for(let h of[\"type\",\"modifier\",\"prefix\",\"value\",\"suffix\"]){if(i[h]<o[h])return-1;if(i[h]===o[h])continue;return 1}return 0},\"comparePart\"),l=new P(3,\"\",\"\",\"\",\"\",3),f=new P(0,\"\",\"\",\"\",\"\",3),s=a((i,o)=>{let h=0;for(;h<Math.min(i.length,o.length);++h){let p=c(i[h],o[h]);if(p)return p}return i.length===o.length?0:c(i[h]??l,o[h]??l)},\"comparePartList\");return!r.#e[t]&&!n.#e[t]?0:r.#e[t]&&!n.#e[t]?s(r.#s[t],[f]):!r.#e[t]&&n.#e[t]?s([f],n.#s[t]):s(r.#s[t],n.#s[t])}get protocol(){return this.#e.protocol}get username(){return this.#e.username}get password(){return this.#e.password}get hostname(){return this.#e.hostname}get port(){return this.#e.port}get pathname(){return this.#e.pathname}get search(){return this.#e.search}get hash(){return this.#e.hash}get hasRegExpGroups(){return this.#l}};a(Y,\"URLPattern\");export{Y as URLPattern};\n","import { URLPattern } from \"./dist/urlpattern.js\";\n\nexport { URLPattern };\n\nif (!globalThis.URLPattern) {\n globalThis.URLPattern = URLPattern;\n}\n","export function sleep(time: number) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}\n","import { Subject } from \"../utils/Subject\";\nimport { sleep } from \"../utils/sleep\";\n\nexport class ProgressManager {\n state = new Subject(100);\n unsubscribe: ReturnType<InstanceType<typeof Subject>[\"subscribe\"]>;\n timer: ReturnType<typeof setInterval>;\n tick = 0;\n isTicking = false;\n\n constructor(subject: Subject<boolean>) {\n this.unsubscribe = subject.subscribe((state) => {\n if (state) {\n this.start();\n } else {\n this.end();\n }\n });\n }\n\n getNextIncrement() {\n const current = this.state.getValue();\n if (current === 100) {\n return Math.ceil(Math.random() * 10);\n }\n\n if (current <= 20) {\n if (Math.ceil(Math.random() * 100) > 80) {\n return current;\n }\n return current + Math.ceil(Math.random() * 5) + 1;\n }\n\n if (current <= 50) {\n if (Math.ceil(Math.random() * 100) > 50) {\n return current;\n }\n return Math.min(current + Math.ceil(Math.random() * 10), 70);\n }\n\n if (current <= 70) {\n if (Math.ceil(Math.random() * 100) > 60) {\n return current;\n }\n return Math.min(current + Math.ceil(Math.random() * 3), 80);\n }\n\n if (current <= 80) {\n return Math.min(current + Math.ceil(Math.random() * 1), 90);\n }\n\n if (current <= 90) {\n const x = Math.ceil(Math.random() * 100) > 50 ? 0 : 1;\n return Math.min(current + x, 94);\n }\n\n if (current <= 94) {\n const x = Math.ceil(Math.random() * 100) > 20 ? 0 : 1;\n return Math.min(current + x, 99);\n }\n }\n\n getNextInterval() {\n if (this.tick === 0) {\n this.tick = 1;\n return 200;\n }\n const current = this.state.getValue();\n\n if (current >= 88) {\n return 400;\n }\n if (current >= 94) {\n return 1000;\n }\n if (current >= 98) {\n return 2000;\n }\n return 100;\n }\n\n async nextTick() {\n if (!this.isTicking) {\n return;\n }\n await sleep(this.getNextInterval());\n\n if (!this.isTicking) {\n return;\n }\n\n const increment = this.getNextIncrement();\n this.state.next(Math.min(increment, 96));\n\n await this.nextTick();\n }\n\n start() {\n this.isTicking = true;\n this.nextTick();\n }\n\n end() {\n this.state.next(99);\n this.isTicking = false;\n this.tick = 0;\n setTimeout(() => {\n this.state.next(100);\n }, 200);\n }\n\n destroy() {\n this.end();\n this.unsubscribe();\n }\n}\n","import { useContext } from \"react\";\nimport { RouteStateContext } from \"./RouteStateContext\";\n\nexport function useLocation() {\n const ctx = useContext(RouteStateContext);\n if (!ctx) {\n throw new Error(\"Router context not found\");\n }\n const { hash, pathname, search, state, locale } = ctx;\n return {\n hash,\n key: pathname,\n pathname,\n search,\n state,\n locale,\n };\n}\n","import { createContext, type PropsWithChildren } from \"react\";\nimport type { Translations } from \"./I18nContext\";\nimport type { ComponentTree } from \"./types\";\nimport type { User } from \"../auth/types\";\n\ntype Data = Record<string, any>;\n\nexport interface ServerDataContextValue {\n routeManifest: Record<string, string[]>;\n pageData: Record<string, Record<string, Data>>;\n breadcrumbs: Record<string, { label: string; href: string }>;\n prefetchedData: Record<string, Data>;\n router: {\n pathname: string;\n params: Record<string, any>;\n currentPath: string;\n is404: boolean;\n searchParams: string;\n urlLocaleSegment: string | null;\n };\n i18n: {\n dictionary: Translations;\n currentLocale: string;\n supportedLocales: string[];\n defaultLocale: string;\n };\n componentTree: ComponentTree;\n auth: {\n user: User;\n };\n /**\n * Evaluated features for this request: `key -> boolean`, nothing else.\n *\n * Never the targeting or the reason a feature resolved the way it did — those\n * stay on the server. Read through `useFeature` rather than directly.\n */\n features: Record<string, boolean>;\n __csrf: string;\n cssManifest: Record<string, string[]>;\n /** Built chunk URLs per view name, for warming a navigation's imports. */\n modulePreloadManifest: Record<string, string[]>;\n meta: any;\n appId: string;\n}\n\nexport const ServerDataContext = createContext({} as ServerDataContextValue);\n\ninterface ServerDataProviderProps {\n value?: ServerDataContextValue;\n}\n\nexport const ServerDataProvider = (\n props: PropsWithChildren<ServerDataProviderProps>,\n) => {\n let _value = props.value;\n // Server\n if (props.value) {\n _value = props.value;\n } else {\n // Client\n _value = (window as any).__GEMI_DATA__;\n }\n\n return (\n <ServerDataContext.Provider value={_value}>\n {props.children}\n </ServerDataContext.Provider>\n );\n};\n","import {\n createContext,\n type PropsWithChildren,\n useContext,\n useRef,\n useState,\n} from \"react\";\nimport { ServerDataContext } from \"./ServerDataProvider\";\n\ntype TranslationScope = Record<string, string>;\ntype TranslationScopes = Record<string, TranslationScope>;\nexport type Translations = Record<string, TranslationScopes>;\n\ninterface I18nContextValue {\n locale: string;\n changeLocale: (locale: string) => void;\n updateDictionary: (\n translations: Record<string, Record<string, Record<string, string>>>,\n locale?: string,\n ) => void;\n fetchTranslations: (\n pathname: string,\n locale?: string,\n signal?: AbortSignal,\n ) => Promise<void>;\n getComponentTranslations: (key: string) => Record<string, string>;\n supportedLocales: string[];\n defaultLocale: string;\n}\n\nexport type CreateI18nDictionary<T> = {\n [K in keyof T]: T[K];\n};\n\nexport const I18nContext = createContext({} as I18nContextValue);\n\nexport type Dictionary = Map<string, Map<string, Record<string, string>>>;\n\nexport const I18nProvider = (props: PropsWithChildren) => {\n const { i18n } = useContext(ServerDataContext);\n\n const [currentLocale, setCurrentLocale] = useState(i18n.currentLocale);\n\n const dictionary = useRef<Dictionary>(\n (() => {\n const dictionary = new Map();\n for (const [locale, value] of Object.entries(i18n?.dictionary ?? {})) {\n const components = new Map();\n for (const [component, translations] of Object.entries(value)) {\n components.set(component, translations);\n }\n dictionary.set(locale, components);\n }\n return dictionary;\n })(),\n );\n\n function updateDictionary(\n translations: Record<string, Record<string, Record<string, string>>> = {},\n locale?: string,\n ) {\n for (const [locale, value] of Object.entries(translations)) {\n if (!dictionary.current.has(locale)) {\n dictionary.current.set(locale, new Map());\n }\n const scopes = dictionary.current.get(locale);\n for (const [scope, translations] of Object.entries(value)) {\n if (!scopes.has(scope)) {\n scopes.set(scope, {});\n }\n scopes.set(scope, translations);\n }\n }\n changeLocale(locale);\n }\n\n const changeLocale = (locale: string) => {\n if (dictionary.current.has(locale)) {\n setCurrentLocale(locale);\n }\n };\n\n const getTranslations = (locale: string) => {\n return (component: string) => {\n return dictionary.current.get(locale).get(component);\n };\n };\n\n const fetchTranslations = async (\n pathname: string,\n locale?: string,\n signal?: AbortSignal,\n ) => {\n if (Object.keys(i18n).length === 0) {\n return;\n }\n const response = await fetch(\n `/api/__gemi__/services/i18n/translations/${\n locale || currentLocale\n }${pathname === \"/\" ? \"\" : pathname}`,\n {\n signal,\n },\n );\n const translations = await response.json();\n updateDictionary(translations);\n };\n\n return (\n <I18nContext.Provider\n value={{\n getComponentTranslations: getTranslations(currentLocale),\n locale: currentLocale,\n changeLocale,\n updateDictionary,\n fetchTranslations,\n supportedLocales: i18n.supportedLocales,\n defaultLocale: i18n.defaultLocale,\n }}\n >\n {props.children}\n </I18nContext.Provider>\n );\n};\n","import { useContext } from \"react\";\nimport { ClientRouterContext } from \"./ClientRouterContext\";\nimport type { UrlParser, ViewPaths } from \"./types\";\nimport { applyParams } from \"../utils/applyParams\";\nimport { useLocation } from \"./useLocation\";\nimport { I18nContext } from \"./I18nContext\";\n\ntype Options<T extends ViewPaths> = UrlParser<T> extends Record<string, never>\n ? {\n search?: Record<string, string | number | boolean | undefined | null>;\n shallow?: boolean;\n hash?: string;\n locale?: string;\n }\n : {\n search?: Record<string, string | number | boolean | undefined | null>;\n params: UrlParser<T>;\n hash?: string;\n shallow?: boolean;\n locale?: string;\n };\n\nexport function useNavigate() {\n const { history, setNavigationAbortController } =\n useContext(ClientRouterContext);\n const { defaultLocale } = useContext(I18nContext);\n const location = useLocation();\n\n function action(pushOrReplace: \"push\" | \"replace\") {\n return async <T extends ViewPaths>(\n path: T | (string & {}),\n ...args: UrlParser<T> extends Record<string, never>\n ? [options?: Options<T>]\n : [options: Options<T>]\n ) => {\n const navigationAbortController = new AbortController();\n if (setNavigationAbortController) {\n setNavigationAbortController(navigationAbortController);\n }\n\n const [options = {}] = args;\n const {\n search = {},\n params = {},\n shallow,\n locale,\n hash,\n } = {\n params: {},\n shallow: false,\n locale: null,\n hash: \"\",\n ...options,\n };\n\n const urlSearchParams = new URLSearchParams(search);\n let localeSegment = location.locale;\n if (locale) {\n localeSegment = locale;\n }\n if (localeSegment === defaultLocale) {\n localeSegment = \"\";\n }\n\n const routePath = applyParams(path, params);\n const navigationPath = [\n `${localeSegment ? `/${localeSegment}` : \"\"}${routePath === \"/\" ? \"\" : routePath}`,\n urlSearchParams.toString(),\n ]\n .filter((s) => s.length > 0)\n .join(\"?\");\n\n const finalPath = [navigationPath, hash].filter(Boolean).join(\"\");\n\n if (shallow) {\n history?.[pushOrReplace](finalPath, { shallow });\n return;\n }\n\n history?.[pushOrReplace](finalPath === '' ? '/' : finalPath);\n };\n }\n\n return {\n push: action(\"push\"),\n replace: action(\"replace\"),\n };\n}\n","import { useContext } from \"react\";\nimport { useNavigate } from \"./useNavigate\";\nimport { RouteStateContext } from \"./RouteStateContext\";\nimport { useParams } from \"./useParams\";\n\ntype SearchParamsCallback = (\n search: Record<string, any>,\n shallow: boolean,\n) => void;\n\nclass SearchParams {\n constructor(\n private searchParams: URLSearchParams,\n private callback: SearchParamsCallback,\n ) {}\n\n get(key: string) {\n return this.searchParams.get(key);\n }\n\n set(key: Record<string, string | ((state: string) => string)>): SearchParams;\n set(key: string, value: string | ((state: string) => string)): SearchParams;\n set(key: any, value?: any) {\n let entries: Record<string, any> = {};\n if (typeof key === \"string\") {\n let _value: string = value;\n if (typeof value === \"function\") {\n _value = value(this.get(key) ?? \"\");\n }\n entries[key] = _value;\n } else {\n entries = (key as any) ?? {};\n }\n for (const [key, value] of Object.entries(entries)) {\n let _value: string = value;\n if (typeof value === \"function\") {\n _value = value(this.get(key) ?? \"\");\n }\n this.searchParams.set(key, _value);\n }\n return this;\n }\n\n append(key: string, value: string) {\n this.searchParams.append(key, value);\n return this;\n }\n\n sort() {\n this.searchParams.sort();\n return this;\n }\n\n clear() {\n this.searchParams = new URLSearchParams();\n return this;\n }\n\n delete(key: string | string[]) {\n const keys = Array.isArray(key) ? key : [key];\n for (const key of keys) {\n this.searchParams.delete(key);\n }\n return this;\n }\n\n toJSON() {\n const map = new Map<string, string | string[]>();\n // @ts-ignore\n for (const [key, value] of this.searchParams) {\n if (map.has(key)) {\n const currentValue = map.get(key);\n if (Array.isArray(currentValue)) {\n currentValue.push(value);\n map.set(key, currentValue);\n } else {\n map.set(key, [currentValue, value]);\n }\n } else {\n map.set(key, value);\n }\n }\n\n return Object.fromEntries(map.entries());\n }\n\n toString() {\n return this.searchParams.toString();\n }\n\n push(mode: \"soft\" | \"hard\" = \"soft\") {\n this.callback(this.toJSON(), mode === \"soft\");\n }\n}\n\nexport function useSearchParams() {\n const { push } = useNavigate();\n const { search, pathname } = useContext(RouteStateContext);\n const params = useParams();\n\n const callback = (search: Record<string, never>, shallow: boolean) => {\n push(\n pathname as never,\n {\n params,\n search,\n shallow,\n } as any,\n );\n };\n\n const searchParams = new SearchParams(new URLSearchParams(search), callback);\n\n return searchParams;\n}\n","import { useContext } from \"react\";\nimport type { ViewPaths } from \"./types\";\nimport { RouteStateContext } from \"./RouteStateContext\";\n\ntype Pathname = ViewPaths;\n\nexport function useRoute() {\n const { pathname: _pathname } = useContext(RouteStateContext);\n return {\n pathname: _pathname,\n startsWith: (pathname: Pathname) => {\n return _pathname.startsWith(pathname);\n },\n };\n}\n","import { useEffect, useState } from \"react\";\nimport { useNavigate } from \"./useNavigate\";\nimport { useSearchParams } from \"./useSearchParams\";\nimport { useRoute } from \"./useRoute\";\nimport { useParams } from \"./useParams\";\nimport { createPortal } from \"react-dom\";\n\nexport const HttpReload = () => {\n const { replace } = useNavigate();\n const searchParams = useSearchParams();\n const { pathname } = useRoute();\n const params = useParams();\n const [reloading, setReloading] = useState(false);\n\n const handleReload = () => {\n // The server recovered, so dismiss any Vite error overlay left on the page\n // (each element exposes a `close()` that also tears down its listeners).\n if (typeof document !== \"undefined\") {\n document.querySelectorAll(\"vite-error-overlay\").forEach((el: any) => {\n if (typeof el.close === \"function\") el.close();\n else el.remove();\n });\n }\n setReloading(true);\n // replace(pathname, {\n // params: params,\n // search: searchParams.toJSON(),\n // } as any)\n // .catch(console.log)\n // .finally(() => {\n // setReloading(false);\n // });\n };\n\n useEffect(() => {\n // @ts-ignore\n if (import.meta.hot) {\n // @ts-ignore\n import.meta.hot.on(\"http-reload\", handleReload);\n }\n return () => {\n // @ts-ignore\n if (import.meta.hot) {\n // @ts-ignore\n import.meta.hot.off(\"http-reload\", handleReload);\n }\n };\n }, [handleReload]);\n\n if (!reloading || typeof document === \"undefined\") {\n return null;\n }\n return createPortal(\n <div className=\"fixed z-[1000] bottom-0 right-0 p-2\">\n <div className=\"p-2 bg-white text-black rounded-md shadow-md\">...</div>\n </div>,\n document.body,\n );\n};\n","/**\n * How long a prefetched payload stays usable. Long enough to cover the gap\n * between hovering a link and clicking it, short enough that a navigation is\n * not served a snapshot the visitor would notice as out of date.\n *\n * A payload cached here is committed wholesale on navigation — including into\n * the query cache via `hydrate` — so anything that invalidates page data has to\n * `clear()` this too. `useMutation` does exactly that on every successful\n * write; locale needs no such call, since the locale segment is part of the key.\n */\nexport const PREFETCH_TTL = 10_000;\n\n/**\n * Ceiling on retained payloads. Entries only leave on their own when a\n * navigation consumes them, and `viewport`/`render` on a long list warms links\n * that are mostly never clicked — each one a full page payload. Oldest goes\n * first, which is also the one closest to expiry.\n */\nexport const PREFETCH_MAX_ENTRIES = 12;\n\ninterface Entry {\n promise: Promise<unknown>;\n createdAt: number;\n}\n\n/**\n * Payloads fetched ahead of a navigation, keyed by the `.json` URL that\n * navigation would request. Entries are handed over once — a navigation that\n * consumes one becomes the live route data, so keeping a copy around would only\n * let a later visit render from a stale snapshot.\n */\nexport class PrefetchCache {\n private entries = new Map<string, Entry>();\n\n private isFresh(entry: Entry) {\n return Date.now() - entry.createdAt < PREFETCH_TTL;\n }\n\n /** Drops what has expired, then the oldest of whatever is still over budget. */\n private evict() {\n for (const [url, entry] of this.entries) {\n if (!this.isFresh(entry)) {\n this.entries.delete(url);\n }\n }\n while (this.entries.size >= PREFETCH_MAX_ENTRIES) {\n const oldest = this.entries.keys().next().value;\n if (oldest === undefined) {\n return;\n }\n this.entries.delete(oldest);\n }\n }\n\n /**\n * Runs `load` unless the same URL is already in flight or freshly cached, so\n * a link hovered repeatedly — or a screenful of eagerly prefetched links\n * pointing at one route — costs a single request.\n */\n prime(url: string, load: () => Promise<unknown>): Promise<unknown> {\n const existing = this.entries.get(url);\n if (existing && this.isFresh(existing)) {\n return existing.promise;\n }\n\n this.evict();\n\n const entry: Entry = { createdAt: Date.now(), promise: null as never };\n entry.promise = load()\n .catch(() => null)\n .then((payload) => {\n // A failed prefetch is dropped rather than remembered: the navigation\n // falls back to its own request and the next hover gets to retry.\n if (payload == null && this.entries.get(url) === entry) {\n this.entries.delete(url);\n }\n return payload;\n });\n\n this.entries.set(url, entry);\n return entry.promise;\n }\n\n /**\n * Hands the payload for `url` to a navigation, if one was prefetched and is\n * still fresh. Resolves to `null` when the prefetch failed, which callers\n * must treat as a miss.\n */\n take(url: string): Promise<unknown> | null {\n const entry = this.entries.get(url);\n if (!entry) {\n return null;\n }\n this.entries.delete(url);\n return this.isFresh(entry) ? entry.promise : null;\n }\n\n /**\n * Drops everything, for when the data behind these payloads may have moved\n * on. In-flight loads still settle; their entries are simply gone by then.\n */\n clear() {\n this.entries.clear();\n }\n\n /** Retained entries, fresh or not. Exposed for tests. */\n get size() {\n return this.entries.size;\n }\n}\n","/**\n * The `.json` URL a route's page data is served from.\n *\n * Prefetching and navigation have to agree on this string exactly — the\n * prefetch cache is keyed by it, and any disagreement silently turns every\n * prefetch into a wasted request plus a full fetch on click.\n */\nexport function routeDataUrl(options: {\n /** Concrete pathname, without the locale segment. */\n pathname: string;\n /** Query string including the leading `?`, or empty. */\n search?: string;\n /** `/tr-TR` style prefix, or empty for the default locale. */\n localeSegment?: string;\n}) {\n const { pathname, search = \"\", localeSegment = \"\" } = options;\n // `/tr-TR/.json` names nothing — the locale segment is the whole path there.\n const path = localeSegment.length > 0 && pathname === \"/\" ? \"\" : pathname;\n return `${localeSegment}${path}.json${search}`;\n}\n","/** One streamed query result: `[path, variantKey, data]`. */\nexport type RouteQueryPayload = [string, string, any];\n\n/**\n * Reads a navigation payload response (#290).\n *\n * The body is NDJSON: the first line is the envelope (route data, meta,\n * partial info, already-resolved `prefetchedData`), later lines are\n * `[path, variantKey, data]` query results streamed as they settle\n * server-side. The returned promise resolves with the envelope as soon as\n * its line arrives — the caller commits the navigation immediately — while\n * the remaining lines keep draining in the background into `onQueryPayload`,\n * whose `hydrate()` settles any segment that suspended on that variant.\n *\n * Tolerates two other body shapes so every producer keeps working: a plain\n * single-JSON body with no trailing newline (error-path responses, buffering\n * proxies) parses as the envelope at end-of-stream, and a `Response` without\n * a readable `body` (test doubles) falls back to `.json()`.\n */\nexport async function readRoutePayload(\n response: Response,\n onQueryPayload?: (payload: RouteQueryPayload) => void,\n): Promise<any | null> {\n const reader = response.body?.getReader?.();\n if (!reader) {\n try {\n return await response.json();\n } catch {\n return null;\n }\n }\n\n const decoder = new TextDecoder();\n let buffer = \"\";\n\n return await new Promise<any | null>((resolve) => {\n let envelopeResolved = false;\n const emitEnvelope = (value: any | null) => {\n if (envelopeResolved) return;\n envelopeResolved = true;\n resolve(value);\n };\n\n const handleLine = (line: string) => {\n if (line.trim().length === 0) return;\n let value: unknown;\n try {\n value = JSON.parse(line);\n } catch (error) {\n console.error(\"[gemi] Unparseable route payload line\", error);\n emitEnvelope(null);\n return;\n }\n if (!envelopeResolved) {\n emitEnvelope(value);\n return;\n }\n if (Array.isArray(value) && value.length === 3) {\n onQueryPayload?.(value as RouteQueryPayload);\n }\n };\n\n (async () => {\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n buffer += decoder.decode(value, { stream: true });\n let newline = buffer.indexOf(\"\\n\");\n while (newline !== -1) {\n const line = buffer.slice(0, newline);\n buffer = buffer.slice(newline + 1);\n handleLine(line);\n newline = buffer.indexOf(\"\\n\");\n }\n }\n buffer += decoder.decode();\n // A plain-JSON body has no trailing newline: the whole buffer is the\n // envelope. (For NDJSON bodies the buffer is empty here.)\n handleLine(buffer);\n emitEnvelope(null);\n } catch (error) {\n console.error(\"[gemi] Route payload stream failed\", error);\n emitEnvelope(null);\n }\n })();\n });\n}\n\n/**\n * Reads the response to the very end and returns the envelope with every\n * streamed query result merged into its `prefetchedData` — the settled\n * aggregate a `<Link prefetch>` warms ahead of a click, equivalent to what\n * the old blocking payload contained. Buffering is the point here: a hover\n * prefetch has time, and the cache stores one complete payload.\n */\nexport async function readSettledRoutePayload(\n response: Response,\n): Promise<any | null> {\n if (typeof response.text !== \"function\") {\n // Test doubles that only implement `.json()`.\n try {\n return await response.json();\n } catch {\n return null;\n }\n }\n\n let text: string;\n try {\n text = await response.text();\n } catch {\n return null;\n }\n\n const lines = text.split(\"\\n\").filter((line) => line.trim().length > 0);\n if (lines.length === 0) return null;\n\n let envelope: any;\n try {\n envelope = JSON.parse(lines[0]);\n } catch {\n return null;\n }\n\n for (const line of lines.slice(1)) {\n let value: unknown;\n try {\n value = JSON.parse(line);\n } catch {\n continue;\n }\n if (Array.isArray(value) && value.length === 3) {\n const [path, variantKey, data] = value as RouteQueryPayload;\n envelope.prefetchedData ??= {};\n envelope.prefetchedData[path] ??= {};\n envelope.prefetchedData[path][variantKey] = data;\n }\n }\n return envelope;\n}\n","/**\n * The process-wide store behind `defineDictionary`.\n *\n * Every handle registers itself here when its module is *evaluated*, not when\n * it is first rendered. That ordering is the whole point: the view router\n * already awaits a view's module import before rendering it, so by the time it\n * calls `preloadDictionaries()` every dictionary reachable from that view has\n * announced itself and can be warmed in one pass. `useDictionary` then reads\n * resolved strings synchronously and the render never suspends — on the server\n * that keeps the SSR stream from fragmenting into a reveal chunk per\n * dictionary, and on the client it keeps navigations flash-free.\n *\n * `use()` in the hook is the correctness net for what a preload pass cannot\n * see: a dictionary inside a `lazy()` subtree, or a locale switch.\n */\n\nimport type { LocaleStrings } from \"./dictionaryShape\";\n\nexport type { LocaleStrings };\n\nexport interface RegisteredDictionary {\n id: string;\n /** Locales this dictionary declares. Empty when it is not known up front. */\n locales: string[];\n load: (locale: string) => Promise<LocaleStrings> | LocaleStrings;\n}\n\ninterface RegistryState {\n /** Every handle that has been constructed, by id. */\n registry: Map<string, RegisteredDictionary>;\n /** Resolved strings: id -> locale -> strings. */\n resolved: Map<string, Map<string, LocaleStrings>>;\n /** In-flight loads, so N components sharing a dictionary share one request. */\n inFlight: Map<string, Promise<LocaleStrings>>;\n /**\n * Never-rejecting promises for the render path; see\n * `loadDictionaryForRender`. `use()` needs a stable reference, so these\n * cannot be built per render.\n */\n degraded: Map<string, Promise<LocaleStrings>>;\n /**\n * Registration order, so `preloadDictionaries` can warm only what a freshly\n * imported module added instead of re-walking every dictionary in the app on\n * every navigation.\n */\n order: string[];\n /**\n * Per locale, how far into `order` an unmarked `preloadDictionaries` has\n * already warmed. Lets the server's per-request call cost O(newly imported)\n * rather than O(every dictionary in the app).\n */\n warmed: Map<string, number>;\n /**\n * The locale currently being rendered, recorded by `useDictionary`. The\n * initial payload is in `__GEMI_DATA__`, but that snapshot is frozen at the\n * first load — after a locale switch it is stale, and the view loader needs\n * to know which locale's chunks to warm.\n */\n activeLocale: string | null;\n}\n\n/**\n * Parked on `globalThis` rather than in module scope, because this module gets\n * bundled more than once and the copies have to agree.\n *\n * gemi ships `gemi/client` from one Vite lib build and `gemi/dictionary` from a\n * separate Bun build, an SSR view graph externalizes some gemi subpaths and\n * bundles others, and a dictionary imported by both a view and a controller is\n * evaluated on both sides. Every one of those splits would otherwise produce a\n * second registry: views would register into one Map while the view router\n * preloaded and snapshotted from another, and the hydration payload would come\n * out empty. Module identity is not something this can depend on; a global key\n * is.\n */\nconst GLOBAL_KEY = \"__GEMI_DICTIONARY_REGISTRY__\";\n\nconst state: RegistryState = ((globalThis as any)[GLOBAL_KEY] ??= {\n registry: new Map(),\n resolved: new Map(),\n inFlight: new Map(),\n degraded: new Map(),\n order: [],\n warmed: new Map(),\n activeLocale: null,\n});\n\nconst { registry, resolved, inFlight, degraded, order, warmed } = state;\n\nfunction cacheKey(id: string, locale: string) {\n return `${id}\\0${locale}`;\n}\n\nexport function registerDictionary(entry: RegisteredDictionary) {\n // A dictionary module can be evaluated twice with the same id — e.g. the\n // Vite-processed copy pulled in by a view and the plain copy a controller\n // imports outside the bundler. Same id means same source literal, so the\n // first registration wins and the duplicate is a no-op rather than a reset\n // that would drop already-resolved strings.\n if (registry.has(entry.id)) {\n return;\n }\n registry.set(entry.id, entry);\n order.push(entry.id);\n}\n\n/** A marker for \"everything registered so far\", for `preloadDictionaries`. */\nexport function dictionaryRegistrationMark(): number {\n return order.length;\n}\n\nexport function getResolved(\n id: string,\n locale: string,\n): LocaleStrings | undefined {\n return resolved.get(id)?.get(locale);\n}\n\nfunction putResolved(id: string, locale: string, strings: LocaleStrings) {\n let byLocale = resolved.get(id);\n if (!byLocale) {\n byLocale = new Map();\n resolved.set(id, byLocale);\n }\n byLocale.set(locale, strings);\n}\n\n/**\n * Load one dictionary's locale, de-duplicating concurrent callers. Returns the\n * strings directly (not a promise) when they are already resolved, so the hook\n * can take a synchronous path without a microtask hop.\n */\nexport function loadDictionary(\n id: string,\n locale: string,\n): LocaleStrings | Promise<LocaleStrings> {\n const already = getResolved(id, locale);\n if (already) {\n return already;\n }\n\n const key = cacheKey(id, locale);\n const pending = inFlight.get(key);\n if (pending) {\n return pending;\n }\n\n const entry = registry.get(id);\n if (!entry) {\n throw new Error(\n `Unknown dictionary \"${id}\". A dictionary must be created with defineDictionary() and its module must have been evaluated before it is read.`,\n );\n }\n\n const result = entry.load(locale);\n\n // The untransformed path holds every locale in memory and answers\n // synchronously — no reason to make callers await a resolved promise.\n if (!(result instanceof Promise)) {\n putResolved(id, locale, result);\n return result;\n }\n\n const promise = result.then(\n (strings) => {\n putResolved(id, locale, strings);\n inFlight.delete(key);\n return strings;\n },\n (err) => {\n inFlight.delete(key);\n throw err;\n },\n );\n inFlight.set(key, promise);\n return promise;\n}\n\n/**\n * The same load, but as something safe to hand React's `use()`.\n *\n * A rejecting promise passed to `use()` rethrows during render, which unmounts\n * the whole route into its error boundary — or, before the shell is ready,\n * fails the server render outright. A missing locale chunk is a routine event\n * (a browser holding stale HTML after a rolling deploy requests a hashed\n * filename that no longer exists), and the deprecated `useTranslator` degraded\n * every i18n failure to rendering the raw key. This keeps that behaviour: the\n * returned promise resolves to no strings, and the per-key lookup in\n * `useDictionary` then logs and falls back to the key.\n *\n * The degraded promise is cached because `use()` requires a stable reference —\n * a fresh `.then()` per render would suspend forever. It is only consulted\n * after `getResolved` misses, so a later successful load supersedes it without\n * needing to be evicted.\n */\nexport function loadDictionaryForRender(\n id: string,\n locale: string,\n): LocaleStrings | Promise<LocaleStrings> {\n const already = getResolved(id, locale);\n if (already) {\n return already;\n }\n\n const key = cacheKey(id, locale);\n const cached = degraded.get(key);\n if (cached) {\n return cached;\n }\n\n const result = loadDictionary(id, locale);\n if (!(result instanceof Promise)) {\n return result;\n }\n\n const safe = result.then(\n (strings) => strings,\n (err) => {\n console.error(\n `Failed to load dictionary ${id} for locale ${locale}; rendering keys instead.`,\n err,\n );\n return EMPTY_STRINGS;\n },\n );\n degraded.set(key, safe);\n return safe;\n}\n\nconst EMPTY_STRINGS: LocaleStrings = {};\n\n/**\n * Warm dictionaries for `locale`, so a subsequent render reads them\n * synchronously instead of suspending.\n *\n * With a `mark` — the value taken *before* importing a view module — only that\n * view's newly announced dictionaries are loaded. That is the client's use: it\n * knows exactly which chunk just arrived.\n *\n * Without one, it resumes from where this locale last got to. The server calls\n * it per request and has no mark to give (view modules were imported long\n * before the request arrived), so a plain scan from zero would walk every\n * dictionary in the app on every request — re-deriving the per-request cost this\n * whole change exists to remove, just with a smaller constant.\n *\n * An empty `locale` means the app configured none, and each dictionary is warmed\n * under its own source language — the same key `useDictionary` will ask for, so\n * the warmed entry is the one the render actually reads.\n *\n * Failures are swallowed: a dictionary that cannot load should surface at the\n * component that actually reads it, where the error names the key, rather than\n * take down an unrelated navigation.\n */\nexport async function preloadDictionaries(locale: string, mark?: number) {\n const from = mark ?? warmed.get(locale) ?? 0;\n const ids = order.slice(from);\n if (ids.length === 0) {\n return;\n }\n\n const settled = await Promise.all(\n ids.map(async (id) => {\n try {\n await loadDictionary(id, localeFor(id, locale));\n return true;\n } catch {\n // Deliberately ignored — see above.\n return false;\n }\n }),\n );\n\n if (mark === undefined) {\n // Advanced *after* the loads settle, and only across the leading run that\n // resolved. Moving it up front — as this first did — is a correctness bug\n // twice over: a second request arriving mid-flight reads the raised mark,\n // finds an empty slice, returns immediately and then suspends on the\n // in-flight promises anyway, which is the stream fragmentation the preload\n // exists to prevent; and a swallowed failure would be marked warm and never\n // retried. Stopping at the first failure keeps \"below the watermark\" and\n // \"resolved\" the same statement.\n const firstFailure = settled.indexOf(false);\n const reached = firstFailure === -1 ? ids.length : firstFailure;\n warmed.set(locale, Math.max(warmed.get(locale) ?? 0, from + reached));\n }\n}\n\n/**\n * Which locale a given dictionary should be warmed under.\n *\n * `useDictionary` falls back to the dictionary's own source language when the\n * app has no locale configured, so the preload has to make the same choice or\n * it caches under a key no render ever reads — warming `\"\"`, then suspending on\n * `\"en-US\"` a moment later.\n */\nfunction localeFor(id: string, locale: string): string {\n if (locale) {\n return locale;\n }\n return registry.get(id)?.locales[0] ?? locale;\n}\n\n/**\n * Seed already-known strings, skipping the loader entirely. The client calls\n * this with the SSR payload before hydration so the first render matches the\n * server without a single dictionary request.\n */\nexport function seedDictionaries(\n dictionaries: Record<string, LocaleStrings> | undefined,\n locale: string,\n) {\n if (!dictionaries) {\n return;\n }\n for (const [id, strings] of Object.entries(dictionaries)) {\n putResolved(id, locale, strings);\n }\n}\n\nexport function setActiveLocale(locale: string | undefined | null) {\n if (locale) {\n state.activeLocale = locale;\n }\n}\n\nexport function getActiveLocale(): string | null {\n return state.activeLocale;\n}\n\n/**\n * Adopt strings the server streamed into the document.\n *\n * Mirrors `__GEMI_STREAM__` in `QueryManagerContext`: scripts that already ran\n * sit buffered in a plain array, and from here on `push` seeds directly. Both\n * halves are needed because dictionary scripts interleave with React's chunks —\n * a segment that reveals late carries its dictionary late too.\n *\n * Installed at module scope rather than during a render: seeding is idempotent\n * and touches no React state, and doing it here means it is already in place\n * before hydration reads anything.\n */\ntype StreamedDictionary = [id: string, locale: string, strings: LocaleStrings];\n\nif (typeof window !== \"undefined\") {\n const w = window as unknown as {\n __GEMI_DICT__?: StreamedDictionary[] | { push: (p: StreamedDictionary) => void };\n };\n const adopt = ([id, locale, strings]: StreamedDictionary) => {\n putResolved(id, locale, strings);\n };\n const buffered = Array.isArray(w.__GEMI_DICT__) ? w.__GEMI_DICT__ : [];\n w.__GEMI_DICT__ = { push: adopt };\n for (const entry of buffered) {\n adopt(entry);\n }\n}\n\n/** Test-only: drop all state so cases do not leak into one another. */\nexport function __resetDictionaryRegistry() {\n registry.clear();\n resolved.clear();\n inFlight.clear();\n degraded.clear();\n warmed.clear();\n order.length = 0;\n state.activeLocale = null;\n}\n","import type { ComponentTree } from \"../types\";\n\nexport function flattenComponentTree(componentTree: ComponentTree): string[] {\n let out: string[] = [];\n for (const [root, branches] of componentTree) {\n out.push(root, ...flattenComponentTree(branches).flat());\n }\n return Array.from(new Set(out));\n}\n","import { createContext, lazy, useMemo, type PropsWithChildren } from \"react\";\nimport {\n dictionaryRegistrationMark,\n getActiveLocale,\n preloadDictionaries,\n} from \"../i18n/dictionaryRegistry\";\nimport { flattenComponentTree } from \"./helpers/flattenComponentTree\";\nimport type { ServerDataContextValue } from \"./ServerDataProvider\";\n\ndeclare const window: {\n __GEMI_DATA__: ServerDataContextValue;\n loaders: Record<\n string,\n () => Promise<{\n default: React.ComponentType<unknown>;\n }>\n >;\n} & Window;\n\n/**\n * Resolved view modules, not just their default exports. A route segment's\n * `Suspense` fallback and error UI come from optional named exports\n * (`Loading`, `Error`), and those have to be readable synchronously\n * while rendering — so every path that loads a view chunk records the module\n * here. Browsers dedupe the underlying dynamic import, so calling\n * `loadViewModule` repeatedly is free.\n */\nconst viewModules = new Map<string, Record<string, any>>();\nconst viewModuleListeners = new Set<() => void>();\n\nexport function loadViewModule(name: string): Promise<any> {\n const loader =\n typeof window !== \"undefined\" ? window.loaders?.[name] : undefined;\n if (!loader) return Promise.resolve(null);\n // Taken before the import starts: a `defineDictionary` handle registers when\n // its module evaluates, so everything past this mark once the chunk lands is\n // exactly what this view brought with it.\n const mark = dictionaryRegistrationMark();\n return Promise.resolve(loader()).then(async (mod) => {\n const isNew = !viewModules.has(name);\n viewModules.set(name, mod);\n\n // Notify on first registration so a `Route` that rendered before its\n // module arrived re-reads it — otherwise a hard load could suspend into\n // a `null` fallback while the view's `Loading` export sits in the module.\n //\n // Before the dictionary await, not after: this exists to surface the view's\n // `Loading` export the moment it lands, and holding it behind a network\n // fetch would put back the very `null` flash it removes.\n if (isNew) {\n for (const listener of viewModuleListeners) listener();\n }\n\n // The single choke point every view chunk passes through — prefetch,\n // navigation and hydration alike — so it is where a view's dictionaries get\n // warmed. Awaited before the module is handed back, which folds the\n // dictionary fetch into the loading state the route already shows instead\n // of letting the view render and suspend a beat later.\n await preloadDictionaries(currentLocale(), mark);\n\n return mod;\n });\n}\n\nfunction currentLocale(): string {\n // `getActiveLocale` is whatever the last render used, which survives a locale\n // switch; `__GEMI_DATA__` covers the first navigation, before any\n // `useDictionary` has run.\n return (\n getActiveLocale() ??\n (typeof window !== \"undefined\"\n ? (window.__GEMI_DATA__?.i18n?.currentLocale ?? \"\")\n : \"\")\n );\n}\n\nexport function subscribeViewModules(listener: () => void) {\n viewModuleListeners.add(listener);\n return () => {\n viewModuleListeners.delete(listener);\n };\n}\n\nexport function getViewModule(name: string) {\n return viewModules.get(name);\n}\n\nlet viewImportMap: Record<string, ReturnType<typeof lazy>> | null = null;\nif (typeof window !== \"undefined\" && process.env.NODE_ENV !== \"test\") {\n viewImportMap = {};\n const { componentTree = [] } = window.__GEMI_DATA__ ?? {};\n\n for (const viewName of flattenComponentTree(componentTree)) {\n viewImportMap[viewName] = lazy(() => loadViewModule(viewName));\n }\n}\n\nexport const ComponentsContext = createContext({\n viewImportMap,\n getViewModule,\n});\n\nexport const ComponentsProvider = (\n props: PropsWithChildren<{\n viewImportMap: typeof viewImportMap;\n /**\n * Server only: the fully-loaded view modules, so `Loading`/`Error`\n * exports resolve during a streaming render. The browser leaves this\n * unset and reads the registry `loadViewModule` fills instead.\n */\n modules?: Record<string, Record<string, any>>;\n }>,\n) => {\n const { modules } = props;\n const value = useMemo(\n () => ({\n viewImportMap: props.viewImportMap ?? viewImportMap,\n getViewModule: modules\n ? (name: string) => modules[name] ?? getViewModule(name)\n : getViewModule,\n }),\n [props.viewImportMap, modules],\n );\n return (\n <ComponentsContext.Provider value={value}>\n {props.children}\n </ComponentsContext.Provider>\n );\n};\n","import { type Action, type History, createBrowserHistory } from \"history\";\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n} from \"react\";\nimport { Subject } from \"../utils/Subject\";\n// @ts-ignore\nimport { URLPattern } from \"urlpattern-polyfill\";\nimport { ProgressManager } from \"./ProgressManager\";\nimport { HttpReload } from \"./HttpReload\";\nimport type { Breadcrumb } from \"./useBreadcrumbs\";\nimport type { RouteState } from \"./RouteStateContext\";\nimport { I18nContext } from \"./I18nContext\";\nimport { PrefetchCache } from \"./PrefetchCache\";\nimport { routeDataUrl } from \"./helpers/routeDataUrl\";\nimport { readSettledRoutePayload } from \"./helpers/readRoutePayload\";\nimport { loadViewModule } from \"./ComponentContext\";\n\nexport interface PrefetchTarget {\n /** Concrete pathname, without the locale segment. */\n pathname: string;\n /** Query string including the leading `?`, or empty. */\n search?: string;\n /** `/tr-TR` style prefix, or empty for the default locale. */\n localeSegment?: string;\n}\n\ndeclare global {\n interface Window {\n scrollHistory: Map<string, number>;\n }\n}\n\ninterface ClientRouterContextValue {\n viewEntriesSubject: Subject<string[]>;\n history: History | null;\n updatePageData: (\n pageData: Record<string, unknown>,\n breadcrumbs: Record<string, Breadcrumb>,\n ) => void;\n getPageData: (key: string, pathname: string) => Record<string, unknown>;\n getScrollPosition: (path: string) => number;\n getViewPathsFromPathname: (pathname: string) => string[];\n getRoutePathnameFromHref: (href: string) => string | null;\n isNavigatingSubject: Subject<boolean>;\n setNavigationAbortController: (controller: AbortController) => void;\n progressManager: ProgressManager;\n fetchRouteCSS: (routePath: string) => Promise<void>;\n preloadRouteModules: (routePath: string) => void;\n prefetchRoute: (target: PrefetchTarget) => Promise<void>;\n takePrefetched: (url: string) => Promise<unknown> | null;\n clearPrefetchCache: () => void;\n breadcrumbsCache: Map<string, Breadcrumb>;\n routerSubject: Subject<RouteState>;\n urlLocaleSegment: string | null;\n}\n\nexport const ClientRouterContext = createContext(\n {} as ClientRouterContextValue,\n);\n\ninterface ClientRouterProviderProps {\n pathname: string;\n routeManifest: Record<string, string[]>;\n cssManifest: Record<string, string[]>;\n modulePreloadManifest: Record<string, string[]>;\n pageData: Record<string, unknown>;\n currentPath: string;\n urlLocaleSegment: string | null;\n params: Record<string, string>;\n searchParams: string;\n is404: boolean;\n is500: boolean;\n breadcrumbs: Record<string, Breadcrumb>;\n}\n\nexport const ClientRouterProvider = (\n props: PropsWithChildren<ClientRouterProviderProps>,\n) => {\n const {\n children,\n pathname,\n currentPath,\n is404,\n is500,\n routeManifest,\n cssManifest,\n modulePreloadManifest,\n pageData,\n params,\n searchParams,\n breadcrumbs,\n urlLocaleSegment,\n } = props;\n const navigationAbortControllerRef = useRef(new AbortController());\n const [isNavigatingSubject] = useState(() => {\n return new Subject<boolean>(false);\n });\n\n const { supportedLocales = [], locale } = useContext(I18nContext);\n\n const [progressManager] = useState(new ProgressManager(isNavigatingSubject));\n const [prefetchCache] = useState(() => new PrefetchCache());\n const pageDataRef = useRef(structuredClone(pageData));\n const scrollHistoryRef = useRef<Map<string, number>>(new Map());\n /** Hrefs already announced; `null` until seeded from the shell's own hints. */\n const preloadedModulesRef = useRef<Set<string> | null>(null);\n const breadcrumbsCache = useRef<Map<string, Breadcrumb>>(\n new Map(Object.entries(breadcrumbs)),\n );\n\n const initalViewEntries = is404\n ? [\"404\"]\n : is500\n ? [\"500\"]\n : (routeManifest[pathname] ?? [\"404\"]);\n const viewEntriesSubject = useRef(new Subject<string[]>(initalViewEntries));\n\n const [routerSubject] = useState(() => {\n return new Subject<RouteState>({\n views: initalViewEntries,\n params,\n search: searchParams,\n state: {},\n pathname,\n hash: \"\",\n action: null as Action | null,\n routePath: currentPath,\n locale,\n });\n });\n\n const [history] = useState<History | null>(() => {\n let history: History | null = null;\n\n if (typeof window !== \"undefined\") {\n history = createBrowserHistory();\n }\n return history;\n });\n\n const findMatchingRouteFromParams = useMemo(\n () => (pathname: string) => {\n let routePath = pathname.replace(\"/en-US\", \"\").replace(\"/tr-TR\", \"\");\n routePath = routePath === \"\" ? \"/\" : routePath;\n const candidates: string[] = [];\n for (const route of Object.keys(routeManifest)) {\n const urlPattern = new URLPattern({ pathname: route });\n if (urlPattern.test({ pathname: routePath })) {\n candidates.push(route);\n }\n }\n const sortedCandidates = candidates.sort((a, b) => {\n const x = a.split(\"/\").length + a.split(\":\").length;\n const y = b.split(\"/\").length + b.split(\":\").length;\n return x - y;\n });\n\n return (sortedCandidates ?? [])[0];\n },\n [routeManifest],\n );\n\n const getViewPathsFromPathname = useMemo(\n () => (pathname: string) => {\n const route = findMatchingRouteFromParams(pathname);\n return routeManifest[route] ?? [];\n },\n [findMatchingRouteFromParams, routeManifest],\n );\n\n const getRoutePathnameFromHref = useMemo(\n () => (href: string) => {\n const route = findMatchingRouteFromParams(href);\n return route;\n },\n [findMatchingRouteFromParams],\n );\n\n const getParams = useMemo(\n () => (pathname: string) => {\n const route = findMatchingRouteFromParams(pathname);\n const urlPattern = new URLPattern({ pathname: route });\n return urlPattern.exec({ pathname })?.pathname.groups ?? {};\n },\n [findMatchingRouteFromParams],\n );\n\n useEffect(() => {\n history?.listen(({ location, action }) => {\n if (!window.scrollHistory) {\n window.scrollHistory = new Map();\n }\n const { hash, pathname, search } = routerSubject.getValue();\n const key = [pathname, search, hash].join(\"\");\n window.scrollHistory.set(key, window.scrollY);\n let _pathname = location.pathname;\n let _locale = null;\n for (const locale of supportedLocales) {\n if (_pathname.startsWith(`/${locale}`)) {\n _locale = locale;\n _pathname = _pathname.replace(`/${locale}`, \"\");\n break;\n }\n }\n _pathname = _pathname === \"\" ? \"/\" : _pathname;\n const routePath = getRoutePathnameFromHref(_pathname);\n routerSubject.next({\n views: getViewPathsFromPathname(_pathname),\n params: getParams(_pathname),\n search: location.search,\n state: location.state as Record<string, unknown>,\n pathname: _pathname,\n action,\n routePath,\n hash: location.hash,\n locale: _locale,\n });\n });\n }, [\n supportedLocales,\n history,\n routerSubject,\n getParams,\n getRoutePathnameFromHref,\n getViewPathsFromPathname,\n ]);\n\n const updatePageData = (\n newPageData: Record<string, unknown>,\n breadcrumbs: Record<string, Breadcrumb>,\n ) => {\n const [key, value] = Object.entries(newPageData)[0];\n if (!pageDataRef.current?.[key]) {\n pageDataRef.current[key] = {};\n }\n for (const b in breadcrumbs) {\n breadcrumbsCache.current.set(b, breadcrumbs[b]);\n }\n\n pageDataRef.current[key] = value;\n };\n\n const getPageData = (key: string, pathname: string) => {\n return pageDataRef.current[pathname]?.[key];\n };\n\n const setNavigationAbortController = (controller: AbortController) => {\n navigationAbortControllerRef.current.abort();\n navigationAbortControllerRef.current = controller;\n };\n\n const fetchRouteCSS = async (routePath: string) => {\n const views = routeManifest[routePath];\n if (!views) {\n return;\n }\n const cssFiles = views\n .flatMap((view) => {\n return cssManifest?.[view];\n })\n .filter(Boolean)\n .filter((file) => !document.getElementById(file));\n\n if (cssFiles.length === 0) {\n return;\n }\n\n async function fetchCSS(path: string) {\n const response = await fetch(`/${path}`);\n const content = response.text();\n return {\n content,\n id: path,\n };\n }\n const result = await Promise.all(cssFiles?.map((file) => fetchCSS(file)));\n for (const { content, id } of result) {\n const style = document.createElement(\"style\");\n style.id = id;\n style.textContent = await content;\n document.head.appendChild(style);\n }\n };\n\n /**\n * Announces every chunk a navigation to `routePath` will import.\n *\n * `loadViewModule` starts each view's own chunk, but a chunk's static\n * imports are discoverable only once it has arrived and parsed — so a\n * `layout -> view -> components` route still costs a round trip per level on\n * every navigation, holding the transition open for exactly the interval the\n * shell's head hints remove from the first load (#352). These are the same\n * per-view lists the shell renders, shipped in the document payload.\n *\n * `modulepreload` rather than `import()`: it fills the HTTP cache without\n * evaluating anything, so warming a link that is never clicked costs a\n * download and no side effects.\n */\n const preloadRouteModules = (routePath: string) => {\n if (typeof document === \"undefined\") {\n return;\n }\n if (!preloadedModulesRef.current) {\n // Seeded from the document because the shell already announced the\n // landing route's chunks — re-announcing them would append dead\n // <link> elements on every navigation back to it.\n preloadedModulesRef.current = new Set(\n Array.from(\n document.querySelectorAll('link[rel=\"modulepreload\"]'),\n (link) => link.getAttribute(\"href\") ?? \"\",\n ),\n );\n }\n const preloaded = preloadedModulesRef.current;\n\n for (const view of routeManifest[routePath] ?? []) {\n for (const href of modulePreloadManifest?.[view] ?? []) {\n if (preloaded.has(href)) {\n continue;\n }\n preloaded.add(href);\n const link = document.createElement(\"link\");\n link.rel = \"modulepreload\";\n link.href = href;\n document.head.appendChild(link);\n }\n }\n };\n\n /**\n * Warms everything a navigation to `target` would need: the route's page\n * data, its stylesheets and its component chunks.\n *\n * The payload is requested *without* the partial-render header, because the\n * route on screen when the link is prefetched is not necessarily the one it\n * will be clicked from — a partial response computed against the wrong base\n * has nothing sound to merge onto. A full payload is always safe to commit.\n *\n * It carries `Purpose: prefetch` so applications can tell speculative traffic\n * from a real visit — a route's handlers run either way, and a `viewport`\n * page multiplies that by the number of links on it.\n */\n const prefetchRoute = async (target: PrefetchTarget) => {\n if (typeof window === \"undefined\") {\n return;\n }\n const { pathname, search = \"\", localeSegment = \"\" } = target;\n const routePath = getRoutePathnameFromHref(pathname);\n if (!routePath) {\n return;\n }\n\n const url = routeDataUrl({ pathname, search, localeSegment });\n\n // Alongside the payload rather than joined to it: a stylesheet that 404s\n // must not throw away page data that arrived perfectly well.\n fetchRouteCSS(routePath).catch(() => {});\n preloadRouteModules(routePath);\n // Through `loadViewModule` so each view's `Loading`/`Error`\n // exports are registered by the time the route commits.\n for (const view of routeManifest[routePath] ?? []) {\n loadViewModule(view);\n }\n\n await prefetchCache.prime(url, async () => {\n const response = await fetch(url, {\n headers: { Purpose: \"prefetch\" },\n });\n if (!response.ok) {\n return null;\n }\n // The settled aggregate: every streamed query result merged back into\n // the envelope's `prefetchedData` — a warmed payload is stored whole,\n // exactly as the blocking response used to arrive (#290).\n return await readSettledRoutePayload(response);\n });\n };\n\n return (\n <ClientRouterContext.Provider\n value={{\n isNavigatingSubject,\n prefetchRoute,\n takePrefetched: (url: string) => prefetchCache.take(url),\n clearPrefetchCache: () => prefetchCache.clear(),\n getViewPathsFromPathname,\n history,\n getScrollPosition: (path: string) => {\n return scrollHistoryRef.current.get(path) || 0;\n },\n viewEntriesSubject: viewEntriesSubject.current,\n updatePageData,\n getPageData,\n getRoutePathnameFromHref,\n setNavigationAbortController,\n progressManager,\n fetchRouteCSS,\n preloadRouteModules,\n breadcrumbsCache: breadcrumbsCache.current,\n routerSubject,\n urlLocaleSegment,\n }}\n >\n {children}\n {/* @ts-ignore */}\n {import.meta.hot && <HttpReload />}\n </ClientRouterContext.Provider>\n );\n};\n","import { createContext, useContext, type PropsWithChildren } from \"react\";\n\nconst RouteTransitionContext = createContext<{\n isTransitioning: boolean;\n targetPath: string;\n currentPath: string;\n}>({\n isTransitioning: false,\n targetPath: \"\",\n currentPath: \"\",\n});\n\ninterface RouteTransitionProviderProps {\n isPending: boolean;\n isFetching: boolean;\n transitionPath: [string, string];\n}\n\nexport const RouteTransitionProvider = (\n props: PropsWithChildren<RouteTransitionProviderProps>,\n) => {\n const { isPending, isFetching, transitionPath } = props;\n\n return (\n <RouteTransitionContext.Provider\n value={{\n isTransitioning: isPending || isFetching,\n targetPath: transitionPath[1],\n currentPath: transitionPath[0] || \"\",\n }}\n >\n {props.children}\n </RouteTransitionContext.Provider>\n );\n};\n\nexport function useRouteTransition() {\n const context = useContext(RouteTransitionContext);\n if (!context) {\n throw new Error(\n \"useRouteTransition must be used within a RouteTransitionProvider\",\n );\n }\n return context;\n}\n","\"use client\";\nimport { createContext as l, Component as y, createElement as d, useContext as f, useState as p, useMemo as E, forwardRef as B } from \"react\";\nconst h = l(null), c = {\n didCatch: !1,\n error: null\n};\nclass m extends y {\n constructor(e) {\n super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = c;\n }\n static getDerivedStateFromError(e) {\n return { didCatch: !0, error: e };\n }\n resetErrorBoundary(...e) {\n const { error: t } = this.state;\n t !== null && (this.props.onReset?.({\n args: e,\n reason: \"imperative-api\"\n }), this.setState(c));\n }\n componentDidCatch(e, t) {\n this.props.onError?.(e, t);\n }\n componentDidUpdate(e, t) {\n const { didCatch: o } = this.state, { resetKeys: s } = this.props;\n o && t.error !== null && C(e.resetKeys, s) && (this.props.onReset?.({\n next: s,\n prev: e.resetKeys,\n reason: \"keys\"\n }), this.setState(c));\n }\n render() {\n const { children: e, fallbackRender: t, FallbackComponent: o, fallback: s } = this.props, { didCatch: n, error: a } = this.state;\n let i = e;\n if (n) {\n const u = {\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof t == \"function\")\n i = t(u);\n else if (o)\n i = d(o, u);\n else if (s !== void 0)\n i = s;\n else\n throw a;\n }\n return d(\n h.Provider,\n {\n value: {\n didCatch: n,\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n }\n },\n i\n );\n }\n}\nfunction C(r = [], e = []) {\n return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));\n}\nfunction g(r) {\n return r !== null && typeof r == \"object\" && \"didCatch\" in r && typeof r.didCatch == \"boolean\" && \"error\" in r && \"resetErrorBoundary\" in r && typeof r.resetErrorBoundary == \"function\";\n}\nfunction x(r) {\n if (!g(r))\n throw new Error(\"ErrorBoundaryContext not found\");\n}\nfunction k() {\n const r = f(h);\n x(r);\n const { error: e, resetErrorBoundary: t } = r, [o, s] = p({\n error: null,\n hasError: !1\n }), n = E(\n () => ({\n error: e,\n resetBoundary: () => {\n t(), s({ error: null, hasError: !1 });\n },\n showBoundary: (a) => s({\n error: a,\n hasError: !0\n })\n }),\n [e, t]\n );\n if (o.hasError)\n throw o.error;\n return n;\n}\nfunction S(r) {\n switch (typeof r) {\n case \"object\": {\n if (r !== null && \"message\" in r && typeof r.message == \"string\")\n return r.message;\n break;\n }\n case \"string\":\n return r;\n }\n}\nfunction w(r, e) {\n const t = B(\n (s, n) => d(\n m,\n e,\n d(r, { ...s, ref: n })\n )\n ), o = r.displayName || r.name || \"Unknown\";\n return t.displayName = `withErrorBoundary(${o})`, t;\n}\nexport {\n m as ErrorBoundary,\n h as ErrorBoundaryContext,\n S as getErrorMessage,\n k as useErrorBoundary,\n w as withErrorBoundary\n};\n//# sourceMappingURL=react-error-boundary.js.map\n","import {\n createContext,\n type PropsWithChildren,\n useEffect,\n useRef,\n} from \"react\";\n\ntype Subscribe = (\n topic: string,\n handler: (event: any) => void,\n) => Promise<void>;\n\nexport const WebSocketContext = createContext(\n {} as {\n broadcast: (topic: string, payload: Record<string, any>) => void;\n subscribe: Subscribe;\n unsubscribe: (\n topic: string,\n handler: (event: any) => void,\n ) => Promise<void>;\n },\n);\n\nexport const WebSocketContextProvider = (props: PropsWithChildren) => {\n const wsRef = useRef<WebSocket>(null);\n\n function getWS() {\n return new Promise<WebSocket>((resolve) => {\n if (wsRef.current) {\n resolve(wsRef.current);\n } else {\n const ws = new WebSocket(\"ws://localhost:5173/\");\n ws.onopen = () => {\n wsRef.current = ws;\n console.log(\"ws opened\");\n ws.addEventListener(\"close\", () => {\n console.log(\"ws closed\");\n wsRef.current = null;\n });\n resolve(ws);\n };\n }\n });\n }\n\n const subscribe = async (\n topic: string,\n handler: (event: MessageEvent<any>) => void,\n ) => {\n const ws = await getWS();\n ws.send(JSON.stringify({ type: \"subscribe\", topic }));\n ws.addEventListener(\"message\", handler);\n };\n\n const unsubscribe = async (\n topic: string,\n handler: (event: MessageEvent<any>) => void,\n ) => {\n const ws = await getWS();\n ws.send(JSON.stringify({ type: \"unsubscribe\", topic }));\n ws.removeEventListener(\"message\", handler);\n };\n\n const broadcast = async (topic: string, payload = {}) => {\n const ws = await getWS();\n ws.send(\n JSON.stringify({\n type: \"broadcast\",\n topic,\n payload,\n }),\n );\n };\n\n useEffect(() => {\n return () => {\n if (wsRef.current) {\n wsRef.current.close();\n wsRef.current = null;\n }\n };\n }, []);\n\n return (\n <WebSocketContext.Provider value={{ subscribe, unsubscribe, broadcast }}>\n {props.children}\n </WebSocketContext.Provider>\n );\n};\n","import {\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useState,\n} from \"react\";\n\ntype Theme = \"light\" | \"dark\" | \"system\";\n\nconst ThemeContext = createContext({\n theme: \"light\" as Theme,\n setTheme: (theme: Theme) => {}, // Function to set the theme\n});\n\nfunction storeTheme(theme: string) {\n try {\n localStorage.setItem(\"theme\", theme);\n } catch (error) {\n console.error(\"Failed to store theme in localStorage:\", error);\n }\n}\n\nexport const ThemeProvider = (props: {\n children: ReactNode;\n /**\n * The theme to start on, ahead of the stored one. The app leaves this unset —\n * a visitor's choice lives in `localStorage` — but a test has no browser\n * session to have made that choice in, so `gemi/testing`'s `<Page>` passes\n * it through to render a component in a theme without writing to storage.\n */\n theme?: Theme;\n}) => {\n const [theme, setTheme] = useState(() => {\n if (props.theme) {\n return props.theme;\n }\n if (typeof window === \"undefined\") {\n return \"light\"; // Default theme for server-side rendering\n }\n return localStorage.getItem(\"theme\") || \"light\";\n });\n\n useEffect(() => {\n if (theme === \"system\") {\n window\n .matchMedia(\"(prefers-color-scheme: dark)\")\n .addEventListener(\"change\", ({ matches }) => {\n document.documentElement.classList.remove(\"light\", \"dark\");\n document.documentElement.classList.add(matches ? \"dark\" : \"light\");\n });\n }\n }, [theme]);\n\n return (\n <ThemeContext.Provider\n value={{\n theme: theme as Theme,\n setTheme: (newTheme: Theme) => {\n setTheme(newTheme);\n storeTheme(newTheme);\n\n let documentTheme = newTheme as Theme;\n if (newTheme === \"system\") {\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\");\n documentTheme = media.matches ? \"dark\" : \"light\";\n }\n document.documentElement.classList.remove(\"light\", \"dark\");\n document.documentElement.classList.add(documentTheme);\n },\n }}\n >\n {props.children}\n </ThemeContext.Provider>\n );\n};\n\nexport function useTheme() {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n\n return context;\n}\n"],"x_google_ignoreList":[9,10,11,12,30],"mappings":";;;;AAAA,IAAa,UAAb,MAAwB;CACtB,8BAAc,IAAI,IAAwB;CAC1C;CAEA,YAAY,cAAiB;EAC3B,KAAK,QAAQ;EAcb,KAAK,YAAY,KAAK,UAAU,KAAK,IAAI;EACzC,KAAK,OAAO,KAAK,KAAK,KAAK,IAAI;EAC/B,KAAK,WAAW,KAAK,SAAS,KAAK,IAAI;CACzC;CAEA,UAAiB,YAAgC;EAC/C,KAAK,YAAY,IAAI,UAAU;EAC/B,aAAa;GACX,KAAK,YAA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,8CAA8C;CAGhE,OAAO;AACT"}
1
+ {"version":3,"file":"ThemeProvider-ByU4BQdL.js","names":["_options","C","#i","#t","#n","#e","#s","#o","#b","#f","#r","#h","#u","#d","#A","#T","#P","#C","#E","#g","#S","#x","#O","#y","#p","#w","#k","#c","#R","#l","#m","#a","URLPattern","l","y","d"],"sources":["../../utils/Subject.ts","../../client/QueryError.ts","../../client/QueryResource.ts","../../client/QueryManagerContext.tsx","../../utils/applyParams.ts","../../utils/omitNullishValues.ts","../../utils/variantKey.ts","../../client/RouteStateContext.tsx","../../client/useParams.ts","../../../../node_modules/.bun/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/esm/extends.js","../../../../node_modules/.bun/history@5.3.0/node_modules/history/index.js","../../../../node_modules/.bun/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.js","../../../../node_modules/.bun/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.js","../../utils/sleep.ts","../../client/ProgressManager.ts","../../client/useLocation.ts","../../client/ServerDataProvider.tsx","../../client/I18nContext.tsx","../../client/useNavigate.ts","../../client/useSearchParams.ts","../../client/useRoute.ts","../../client/HttpReload.tsx","../../client/PrefetchCache.ts","../../client/helpers/routeDataUrl.ts","../../client/helpers/readRoutePayload.ts","../../i18n/dictionaryRegistry.ts","../../client/helpers/flattenComponentTree.ts","../../client/ComponentContext.tsx","../../client/ClientRouterContext.tsx","../../client/RouteTransitionProvider.tsx","../../../../node_modules/.bun/react-error-boundary@6.1.1+83d5fd7b249dbeef/node_modules/react-error-boundary/dist/react-error-boundary.js","../../client/WebsocketContext.tsx","../../client/ThemeProvider.tsx"],"sourcesContent":["export class Subject<T> {\n subscribers = new Set<(value: T) => void>();\n value: T;\n\n constructor(initialValue: T) {\n this.value = initialValue;\n // Bound once, per instance, because these are read as plain functions:\n // `useSyncExternalStore(subject.subscribe, subject.getValue, …)` calls them\n // with no receiver, and an unbound method throws on `this.value`.\n //\n // Here rather than at each call site, and that part matters. Binding in a\n // hook body allocates a fresh function every render, and\n // `useSyncExternalStore` tears down and re-creates its subscription\n // whenever `subscribe` changes identity — so a component rendering a\n // navigation spinner would churn its entry in `subscribers` on every pass.\n // `next` iterates that set, and `Set.forEach` visits entries inserted\n // during iteration, so a value landing mid-resubscribe could notify both\n // the outgoing and the incoming subscriber. Binding here keeps the stable\n // prototype-method identity the call sites used to rely on.\n this.subscribe = this.subscribe.bind(this);\n this.next = this.next.bind(this);\n this.getValue = this.getValue.bind(this);\n }\n\n public subscribe(subscriber: (value: T) => void) {\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n }\n\n public next(value: T) {\n this.value = value;\n this.subscribers.forEach((subscriber) => subscriber(value));\n }\n\n public getValue() {\n return this.value;\n }\n}\n","/**\n * An HTTP failure from a query endpoint, in a shape an error boundary can\n * work with. `resolveVariant` used to store the parsed response body as the\n * error; boundaries expect an `Error`, so the body moves to a field.\n */\nexport class QueryError extends Error {\n constructor(\n public path: string,\n public variantKey: string,\n public status: number,\n public body: any,\n ) {\n super(\n typeof body?.message === \"string\"\n ? body.message\n : `Request to /api${path} failed with status ${status}`,\n );\n this.name = \"QueryError\";\n }\n}\n","import { Subject } from \"../utils/Subject\";\nimport { QueryError } from \"./QueryError\";\n\ntype State = {\n loading: boolean;\n data: any;\n /**\n * Whether `data` is a value the server actually produced — `null`, `0`,\n * `false` and `\"\"` are all legitimate response bodies. Every presence check\n * in the cache goes through this flag, never through `data`'s truthiness:\n * inferring presence from the value made a falsy body look permanently\n * unfetched, which under suspense meant an unbounded fetch/suspend loop.\n */\n hasData: boolean;\n error: any;\n version: number;\n};\n\ntype Deferred = { promise: Promise<void>; resolve: () => void };\n\nexport const DEFAULT_STALE_TIME = 5000;\n\nexport class QueryResource {\n store: Subject<Map<string, State>>;\n staleVariants = new Set<string>();\n lastFetchRecord = new Map<string, number>();\n key: string;\n /**\n * Variants with a request on the wire. React discards and retries a\n * suspended render, so `read` runs many times for one commit — this is what\n * collapses those attempts onto a single fetch. The `loading` flag can't do\n * it: render-initiated fetches are silent and never write to the store.\n */\n private inflight = new Set<string>();\n /**\n * One promise per suspended variant, handed to `use()`. Settled by whatever\n * write lands first — the variant's own fetch or a `hydrate` from a route\n * payload — so a prefetch that arrives mid-suspension wakes the reader\n * without waiting on the wire.\n */\n private pending = new Map<string, Deferred>();\n\n constructor(key: string, initialState: Record<string, any>) {\n this.key = key;\n this.store = new Subject(new Map());\n this.hydrate(initialState);\n }\n\n /**\n * Adopt server-prefetched data into the cache.\n *\n * Called once from the constructor for the SSR payload, and again on every\n * client-side navigation with the `prefetchedData` the server just produced —\n * otherwise the resource cache (which is keyed by path for the lifetime of\n * the app) would keep serving the first payload and revalidate it over `/api`.\n */\n hydrate(initialState: Record<string, any> | null | undefined) {\n const store = this.store.getValue();\n const now = Date.now();\n let changed = false;\n\n for (const [variantKey, data] of Object.entries(initialState ?? {})) {\n // `undefined` means \"no value\" (JSON can't produce it); everything else\n // — including `null`, `0`, `false`, `\"\"` — is a real response body, and\n // a suspended reader may be waiting on exactly this write to settle.\n if (data === undefined) continue;\n const current = store.get(variantKey);\n // Never clobber an in-flight fetch — `resolveVariant` flips `loading`\n // before its first await, so this also covers an optimistic `mutate`\n // whose refetch hasn't landed yet.\n if (current?.loading) continue;\n // Idempotent re-hydration (e.g. StrictMode's double invoke).\n if (current?.hasData && current.data === data) continue;\n\n store.set(variantKey, {\n loading: false,\n data,\n hasData: true,\n error: null,\n version: now,\n });\n this.staleVariants.delete(variantKey);\n this.lastFetchRecord.set(variantKey, now);\n // Wake a reader suspended on this variant — the payload the server just\n // shipped is the answer it was waiting on.\n this.settle(variantKey);\n changed = true;\n }\n\n if (changed) {\n this.store.next(store);\n }\n }\n\n private pendingFor(variantKey: string): Deferred {\n let deferred = this.pending.get(variantKey);\n if (!deferred) {\n let resolve!: () => void;\n const promise = new Promise<void>((r) => {\n resolve = r;\n });\n deferred = { promise, resolve };\n this.pending.set(variantKey, deferred);\n }\n return deferred;\n }\n\n private settle(variantKey: string) {\n const deferred = this.pending.get(variantKey);\n if (deferred) {\n this.pending.delete(variantKey);\n deferred.resolve();\n }\n }\n\n private isStale(variantKey: string, staleTime: number) {\n if (this.staleVariants.has(variantKey)) return true;\n const now = Date.now();\n // `>=` so `staleTime: 0` means \"always revalidate\" and\n // `staleTime: Infinity` means \"never\".\n return now - (this.lastFetchRecord.get(variantKey) ?? now) >= staleTime;\n }\n\n /**\n * The cached state for a variant, or `undefined` — a plain read that never\n * fetches and never revalidates.\n *\n * `getVariant` is the read that keeps the cache honest, and it starts a\n * request when it has to. That makes it the wrong thing to call while\n * rendering: React throws away a render whose subtree suspends and retries\n * it, so every discarded attempt would leak a request. Renders read with\n * this; effects, which only run for a render that committed, use\n * `getVariant`.\n */\n peek(variantKey: string) {\n return this.store.getValue().get(variantKey);\n }\n\n /**\n * The read a render performs. Never suspends when data is in hand (stale\n * data revalidates in the background instead), dedupes across the render\n * attempts React throws away, and hands back a promise that resolves off\n * any write to the variant — its own fetch or a `hydrate`.\n *\n * Safe during render: it never writes to the store synchronously, so the\n * snapshot `useSyncExternalStore` read stays valid for the whole attempt.\n */\n read(\n variantKey: string,\n staleTime: number = DEFAULT_STALE_TIME,\n ): { state?: State; promise?: Promise<void> } {\n const state = this.peek(variantKey);\n\n // Data in hand: stale-while-revalidate, never suspend.\n if (state?.hasData) {\n if (\n !this.inflight.has(variantKey) &&\n this.isStale(variantKey, staleTime)\n ) {\n this.lastFetchRecord.set(variantKey, Date.now());\n this.resolveVariant(variantKey, true);\n }\n return { state };\n }\n if (state?.error) {\n // The caller throws it into the nearest error boundary.\n return { state };\n }\n if (typeof window === \"undefined\") {\n // SSR never fetches and never suspends; the server renders whatever the\n // prefetch payload seeded.\n return { state };\n }\n\n const deferred = this.pendingFor(variantKey);\n if (!this.inflight.has(variantKey)) {\n this.resolveVariant(variantKey, true);\n }\n return { state, promise: deferred.promise };\n }\n\n getVariant(variantKey: string, staleTime: number = DEFAULT_STALE_TIME) {\n const store = this.store.getValue();\n if (!store.has(variantKey)) {\n // Join a render-initiated fetch instead of racing it — silent reads\n // never flip `loading`, so the flag alone can't dedupe here.\n if (!this.inflight.has(variantKey)) {\n this.resolveVariant(variantKey);\n }\n } else {\n const variant = store.get(variantKey);\n\n if (!variant.loading && !this.inflight.has(variantKey)) {\n // Don't have data\n if (!variant.hasData) {\n this.resolveVariant(variantKey);\n return store.get(variantKey);\n }\n if (this.isStale(variantKey, staleTime)) {\n this.lastFetchRecord.set(variantKey, Date.now());\n this.resolveVariant(variantKey, true);\n return store.get(variantKey);\n }\n }\n }\n return store.get(variantKey);\n }\n\n /**\n * A background revalidation: the staleness gate `getVariant` applies, but\n * the fetch is *always* silent — `loading: true` is never written to the\n * cache, so what the caller renders is untouched until the new data lands.\n *\n * That is the difference from `getVariant`, which only takes the silent path\n * for a variant that already `hasData`: a variant sitting on a failed fetch\n * (`hasData: false`, an error stored) would otherwise flip `loading` on for\n * the duration of the request. Focus revalidation reads through here so its\n * \"never changes what's on screen\" contract holds in that case too.\n */\n revalidate(variantKey: string, staleTime: number = DEFAULT_STALE_TIME) {\n if (typeof window === \"undefined\") return;\n // Joining beats racing — a render-initiated read or the mount effect may\n // already have this variant on the wire.\n if (this.inflight.has(variantKey)) return;\n const state = this.peek(variantKey);\n if (state?.loading) return;\n if (state?.hasData) {\n if (!this.isStale(variantKey, staleTime)) return;\n this.lastFetchRecord.set(variantKey, Date.now());\n }\n this.resolveVariant(variantKey, true);\n }\n\n /**\n * Drop the error for one variant (or every variant when omitted), so an\n * error boundary reset re-renders into a clean read instead of instantly\n * re-throwing the stored failure.\n */\n clearError(variantKey?: string) {\n const store = this.store.getValue();\n let changed = false;\n for (const [key, state] of store) {\n if (variantKey !== undefined && key !== variantKey) continue;\n if (state.error) {\n store.set(key, { ...state, error: null });\n changed = true;\n }\n }\n if (changed) {\n this.store.next(store);\n }\n }\n\n mutate(variantKey: string, fn: (data: any) => any = (data) => data) {\n const cacheKey = [\n typeof window !== \"undefined\" && window.location?.origin\n ? window.location.origin\n : \"\",\n this.key,\n variantKey,\n ]\n .filter((s) => s.length > 0)\n .join(\"?\");\n try {\n if (caches) {\n caches?.delete(cacheKey);\n }\n } catch (err) {}\n\n const store = this.store.getValue();\n const state = store.get(variantKey);\n if (!state || !state.hasData) {\n // Nothing is cached yet to update optimistically — e.g. a lazy query, or\n // one that hasn't resolved. Fall through to a refetch so `mutate(fn)` is\n // not a silent no-op (it still means \"go get the latest data\").\n this.resolveVariant(variantKey, false, false);\n return;\n }\n const data = fn(state.data);\n\n this.staleVariants.add(variantKey);\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data,\n hasData: true,\n error: null,\n version: state.version,\n }),\n );\n this.resolveVariant(variantKey, false, false);\n }\n\n refetch(variantKey: string) {\n this.resolveVariant(variantKey, false, false);\n }\n\n private async resolveVariant(\n variantKey: string,\n silent = false,\n cache = true,\n ) {\n if (typeof window === \"undefined\") {\n return;\n }\n // Synchronous with the call, so every read in the same render pass sees\n // the request as already on the wire.\n this.inflight.add(variantKey);\n try {\n const store = this.store.getValue();\n const previousState = store.get(variantKey);\n\n if (!silent) {\n store.set(variantKey, {\n loading: true,\n data: previousState?.data,\n hasData: previousState?.hasData ?? false,\n error: previousState?.error,\n version: previousState?.version,\n });\n }\n\n let data = null;\n let response: Response | null = null;\n const fullUrl = [this.key, variantKey].filter((s) => s.length).join(\"?\");\n try {\n response = await fetch(`/api${fullUrl}`, {\n cache: cache ? \"default\" : \"reload\",\n });\n data = await response.json();\n } catch (error) {\n console.error(`Error fetching url /api${fullUrl}`, error);\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data: previousState?.data,\n hasData: previousState?.hasData ?? false,\n error,\n version: previousState?.version,\n }),\n );\n return;\n }\n\n if (response!.ok) {\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data,\n hasData: true,\n error: null,\n version: Date.now(),\n }),\n );\n this.staleVariants.delete(variantKey);\n this.lastFetchRecord.set(variantKey, Date.now());\n } else {\n // this.lastFetchRecord.set(variantKey, 0);\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data: previousState?.data,\n hasData: previousState?.hasData ?? false,\n error: new QueryError(this.key, variantKey, response!.status, data),\n version: previousState?.version,\n }),\n );\n }\n } finally {\n this.inflight.delete(variantKey);\n // Settle on failure too — a suspended reader has to wake up to throw.\n this.settle(variantKey);\n }\n }\n}\n","import {\n createContext,\n type PropsWithChildren,\n useCallback,\n useMemo,\n useRef,\n} from \"react\";\nimport { QueryResource } from \"./QueryResource\";\n\n/** One streamed query payload: `[path, variantKey, data]`. */\ntype StreamedQueryPayload = [string, string, any];\n\n/**\n * App-wide `useQuery` defaults, threaded from `createRoot(RootLayout, {\n * queryConfig })` (and `init` on the client). Resolution order is per-call\n * config → these defaults → framework defaults, so a call site always wins.\n * Only keys with app-wide meaning are accepted — `lazy`, `fallbackData` and\n * `refetchUntil` stay call-site-only. Framework-internal hooks (`useUser`,\n * `useSignIn`) never see these.\n */\nexport interface QueryConfig {\n /**\n * App-wide suspense switch. `suspense: false` makes every unconfigured\n * `useQuery` behave like pre-0.49: `loading` flags instead of suspension,\n * errors returned instead of thrown. Pair it with the `GemiQueryDefaults`\n * module augmentation so `data`'s nullability matches.\n */\n suspense?: boolean;\n /** How long cached data stays fresh before a read revalidates it, in ms. */\n staleTime?: number;\n keepPreviousData?: boolean;\n retryIntervalOnError?: number;\n refreshInterval?: number;\n /**\n * Revalidate every query when the tab comes back to the foreground, gated by\n * `staleTime`. Off by default.\n */\n revalidateOnFocus?: boolean;\n /**\n * Minimum gap between two focus revalidations of the same query, in ms\n * (default 5000).\n */\n focusThrottleInterval?: number;\n}\n\nexport const QueryConfigContext = createContext<QueryConfig | null>(null);\n\n/**\n * The runtime mirror of the `QueryConfig` type: TS excess-property checking\n * only fires on fresh object literals, so a dynamically built (or plain-JS)\n * config could smuggle call-site-only keys (`lazy`, `fallbackData`,\n * `refetchUntil`) into every query. The provider picks these keys — and only\n * these — before the value enters the context. Keys whose value is\n * `undefined` are dropped too, so an absent value (e.g. an unset env-derived\n * `staleTime`) falls through to the framework default instead of shadowing it.\n */\nconst APP_WIDE_QUERY_CONFIG_KEYS = [\n \"suspense\",\n \"staleTime\",\n \"keepPreviousData\",\n \"retryIntervalOnError\",\n \"refreshInterval\",\n \"revalidateOnFocus\",\n \"focusThrottleInterval\",\n] as const satisfies ReadonlyArray<keyof QueryConfig>;\n\nexport function pickAppWideQueryConfig(\n queryConfig: QueryConfig | null | undefined,\n): QueryConfig | null {\n if (!queryConfig) return null;\n const picked: QueryConfig = {};\n for (const key of APP_WIDE_QUERY_CONFIG_KEYS) {\n if (queryConfig[key] !== undefined) {\n (picked as Record<string, unknown>)[key] = queryConfig[key];\n }\n }\n return picked;\n}\n\nexport type PrefetchedData = Record<string, Record<string, any>>;\n\nexport interface QueryManagerContextValue {\n getResource: (\n key: string,\n initialState?: Record<string, any>,\n ) => QueryResource;\n hydrate: (prefetchedData?: PrefetchedData | null) => void;\n clearErrors: () => void;\n}\n\nexport const QueryManagerContext = createContext<QueryManagerContextValue>({\n getResource: (key: string, initialState: Record<string, any> = {}) => {\n return new QueryResource(key, initialState);\n },\n hydrate: () => {},\n clearErrors: () => {},\n});\n\nexport const QueryManagerProvider = ({\n children,\n queryConfig = null,\n}: PropsWithChildren<{ queryConfig?: QueryConfig | null }>) => {\n const resourcesRef = useRef<Map<string, QueryResource>>(new Map());\n\n // Sanitized once at the choke point every query reads through, so the\n // \"only app-wide keys\" contract holds at runtime, not just in the types.\n const appQueryConfig = useMemo(\n () => pickAppWideQueryConfig(queryConfig),\n [queryConfig],\n );\n\n const getResource = useCallback(\n (key: string, initialState?: Record<string, any>) => {\n let resource = resourcesRef.current.get(key);\n if (!resource) {\n resource = new QueryResource(key, initialState ?? {});\n resourcesRef.current.set(key, resource);\n }\n return resource;\n },\n [],\n );\n\n // Resources are cached by path for the lifetime of the app, so `initialState`\n // above only ever applies to the first load. Every navigation ships a fresh\n // `prefetchedData` payload that has to be pushed into the existing resources,\n // otherwise the components mounting on the new surface refetch it over `/api`.\n const hydrate = useCallback((prefetchedData?: PrefetchedData | null) => {\n if (!prefetchedData) return;\n for (const [key, initialState] of Object.entries(prefetchedData)) {\n if (!initialState || typeof initialState !== \"object\") continue;\n const resource = resourcesRef.current.get(key);\n if (resource) {\n resource.hydrate(initialState);\n } else {\n resourcesRef.current.set(key, new QueryResource(key, initialState));\n }\n }\n }, []);\n\n // Used by the route-level error boundary's reset: without this, the retried\n // render would read the stored failure back out of the cache and re-throw.\n const clearErrors = useCallback(() => {\n for (const resource of resourcesRef.current.values()) {\n resource.clearError();\n }\n }, []);\n\n // Streaming SSR delivers late-resolving queries as inline\n // `__GEMI_STREAM__.push([path, variant, data])` scripts interleaved with\n // React's chunks. Payloads that ran before this rendered sit buffered in a\n // plain array; from here on, `push` hydrates directly — and `hydrate`\n // settles any reader suspended on that variant.\n //\n // Drained synchronously during the FIRST render, not in an effect:\n // suspension happens during the render phase, so a segment hydrating in\n // this very pass must already find its streamed data in the cache — an\n // effect-timed drain would let it suspend and start a duplicate `/api`\n // fetch for data the document already carries. Safe here: it runs once\n // (idempotent under StrictMode's double-invoke), and nothing is subscribed\n // to the store yet, so no render is invalidated mid-pass.\n const drainedStreamRef = useRef(false);\n if (typeof window !== \"undefined\" && !drainedStreamRef.current) {\n drainedStreamRef.current = true;\n const w = window as unknown as {\n __GEMI_STREAM__?:\n | StreamedQueryPayload[]\n | { push: (p: StreamedQueryPayload) => void };\n };\n const adopt = ([path, variantKey, data]: StreamedQueryPayload) => {\n hydrate({ [path]: { [variantKey]: data } });\n };\n const buffered = Array.isArray(w.__GEMI_STREAM__) ? w.__GEMI_STREAM__ : [];\n w.__GEMI_STREAM__ = { push: adopt };\n for (const payload of buffered) {\n adopt(payload);\n }\n }\n\n const value = useMemo(\n () => ({ getResource, hydrate, clearErrors }),\n [getResource, hydrate, clearErrors],\n );\n\n return (\n <QueryManagerContext.Provider value={value}>\n <QueryConfigContext.Provider value={appQueryConfig}>\n {children}\n </QueryConfigContext.Provider>\n </QueryManagerContext.Provider>\n );\n};\n","export function applyParams<T extends string>(\n url: T,\n params: Record<string, string | number | undefined>,\n): string {\n return (\n url\n .replace(/:([^/]+[*?]?)/g, (_, key) => {\n const hasSuffix = key.endsWith(\"?\") || key.endsWith(\"*\");\n const paramName = hasSuffix ? key.slice(0, -1) : key;\n const value = params[paramName];\n\n if (value === undefined) {\n if (hasSuffix) {\n return \"\"; // Remove the optional segment if no value is provided\n }\n // @ts-ignore\n if (import.meta.env.DEV) {\n throw new Error(`Missing parameter: ${paramName}`);\n }\n console.error(`Missing parameter: ${paramName} in URL: ${url}`);\n }\n\n return String(value);\n })\n // remove double slashes\n .replace(/\\/\\//g, \"/\")\n // remove trailing slash\n .replace(/\\/$/, \"\")\n );\n}\n","export function omitNullishValues<T>(input: T) {\n return Object.fromEntries(\n Object.entries(input).filter(([, value]) => {\n return value !== null && value !== undefined;\n }),\n ) as T;\n}\n","import { omitNullishValues } from \"./omitNullishValues\";\n\n/**\n * The key one search-param combination is cached under, inside a query's\n * resource: the params sorted and serialized, empty when there are none.\n *\n * Sorted because `?b=2&a=1` and `?a=1&b=2` are the same request, and a cache\n * that keyed them separately would fetch twice and hydrate one of them from a\n * payload the server produced for the other. Nullish values are dropped for\n * the same reason: an optional filter left `undefined` is absent, not the\n * string `\"undefined\"`.\n *\n * Every site that reads or writes the cache derives its key from here —\n * `useQuery` (the read), `useMutate` (the write), and `gemi/testing`'s `<Page>`\n * (the seed). They used to hold a copy each, which is the kind of duplication\n * that fails quietly: a seed built by an old copy simply misses, and the test\n * that should have read it fetches over the network and asserts an empty state\n * with nothing pointing at the mismatch.\n */\nexport function toVariantKey(\n search: string | Record<string, unknown> | null | undefined,\n): string {\n const searchParams = new URLSearchParams(\n typeof search === \"string\"\n ? search\n : (omitNullishValues(search ?? {}) as Record<string, string>),\n );\n searchParams.sort();\n return searchParams.toString();\n}\n","import type { Action } from \"history\";\nimport { createContext, type PropsWithChildren } from \"react\";\n\nexport interface RouteState {\n views: string[];\n params: Record<string, string>;\n search: string;\n state: Record<string, unknown>;\n pathname: string;\n hash: string;\n action: Action | null;\n routePath: string;\n locale: string | null;\n}\n\nexport type PageData = {\n data: Record<string, unknown>;\n i18n: {\n currentLocale: string;\n dictionary: Record<string, Record<string, unknown>>;\n supportedLocales: string[];\n };\n prefetchedData: Record<string, unknown>;\n breadcrumbs: any;\n appId: string;\n /**\n * Evaluated features, replaced on every navigation.\n *\n * Lives here rather than only on `ServerDataContext` for the same reason\n * `i18n` does: the server re-evaluates on each navigation payload, so reading\n * from route state is what makes switching a feature on land without a hard\n * reload.\n */\n features: Record<string, boolean>;\n};\n\nexport const RouteStateContext = createContext({} as RouteState & PageData);\n\nexport const RouteStateProvider = (\n props: PropsWithChildren<{\n state: RouteState & PageData;\n }>,\n) => {\n return (\n <RouteStateContext.Provider value={props.state}>\n {props.children}\n </RouteStateContext.Provider>\n );\n};\n","import { useContext } from \"react\";\nimport { RouteStateContext } from \"./RouteStateContext\";\n\nexport function useParams() {\n const { params = {} } = useContext(RouteStateContext);\n return params;\n}\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import _extends from '@babel/runtime/helpers/esm/extends';\n\n/**\r\n * Actions represent the type of change to a location value.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action\r\n */\nvar Action;\n\n(function (Action) {\n /**\r\n * A POP indicates a change to an arbitrary index in the history stack, such\r\n * as a back or forward navigation. It does not describe the direction of the\r\n * navigation, only that the current index changed.\r\n *\r\n * Note: This is the default action for newly created history objects.\r\n */\n Action[\"Pop\"] = \"POP\";\n /**\r\n * A PUSH indicates a new entry being added to the history stack, such as when\r\n * a link is clicked and a new page loads. When this happens, all subsequent\r\n * entries in the stack are lost.\r\n */\n\n Action[\"Push\"] = \"PUSH\";\n /**\r\n * A REPLACE indicates the entry at the current index in the history stack\r\n * being replaced by a new one.\r\n */\n\n Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\n\nvar readOnly = process.env.NODE_ENV !== \"production\" ? function (obj) {\n return Object.freeze(obj);\n} : function (obj) {\n return obj;\n};\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== 'undefined') console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nvar BeforeUnloadEventType = 'beforeunload';\nvar HashChangeEventType = 'hashchange';\nvar PopStateEventType = 'popstate';\n/**\r\n * Browser history stores the location in regular URLs. This is the standard for\r\n * most web apps, but it requires some configuration on the server to ensure you\r\n * serve the same app at multiple URLs.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\r\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$window = _options.window,\n window = _options$window === void 0 ? document.defaultView : _options$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation[0],\n nextLocation = _getIndexAndLocation[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better what\n // is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n var action = Action.Pop;\n\n var _getIndexAndLocation2 = getIndexAndLocation(),\n index = _getIndexAndLocation2[0],\n location = _getIndexAndLocation2[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n } // state defaults to `null` because `window.history.state` does\n\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation3 = getIndexAndLocation();\n\n index = _getIndexAndLocation3[0];\n location = _getIndexAndLocation3[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr[0],\n url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr2[0],\n url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Hash history stores the location in window.location.hash. This makes it ideal\r\n * for situations where you don't want to send the location to the server for\r\n * some reason, either because you do cannot configure it or the URL space is\r\n * reserved for something else.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\r\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options2 = options,\n _options2$window = _options2.window,\n window = _options2$window === void 0 ? document.defaultView : _options2$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _parsePath = parsePath(window.location.hash.substr(1)),\n _parsePath$pathname = _parsePath.pathname,\n pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname,\n _parsePath$search = _parsePath.search,\n search = _parsePath$search === void 0 ? '' : _parsePath$search,\n _parsePath$hash = _parsePath.hash,\n hash = _parsePath$hash === void 0 ? '' : _parsePath$hash;\n\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation4 = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation4[0],\n nextLocation = _getIndexAndLocation4[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better\n // what is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop); // popstate does not fire on hashchange in IE 11 and old (trident) Edge\n // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event\n\n window.addEventListener(HashChangeEventType, function () {\n var _getIndexAndLocation5 = getIndexAndLocation(),\n nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events.\n\n\n if (createPath(nextLocation) !== createPath(location)) {\n handlePop();\n }\n });\n var action = Action.Pop;\n\n var _getIndexAndLocation6 = getIndexAndLocation(),\n index = _getIndexAndLocation6[0],\n location = _getIndexAndLocation6[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function getBaseHref() {\n var base = document.querySelector('base');\n var href = '';\n\n if (base && base.getAttribute('href')) {\n var url = window.location.href;\n var hashIndex = url.indexOf('#');\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href;\n }\n\n function createHref(to) {\n return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to));\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation7 = getIndexAndLocation();\n\n index = _getIndexAndLocation7[0];\n location = _getIndexAndLocation7[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr3[0],\n url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr4[0],\n url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Memory history stores the current location in memory. It is designed for use\r\n * in stateful non-browser environments like tests and React Native.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory\r\n */\n\nfunction createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options3 = options,\n _options3$initialEntr = _options3.initialEntries,\n initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr,\n initialIndex = _options3.initialIndex;\n var entries = initialEntries.map(function (entry) {\n var location = readOnly(_extends({\n pathname: '/',\n search: '',\n hash: '',\n state: null,\n key: createKey()\n }, typeof entry === 'string' ? parsePath(entry) : entry));\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: \" + JSON.stringify(entry) + \")\") : void 0;\n return location;\n });\n var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);\n var action = Action.Pop;\n var location = entries[index];\n var listeners = createEvents();\n var blockers = createEvents();\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n search: '',\n hash: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction, nextLocation) {\n action = nextAction;\n location = nextLocation;\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n applyTx(nextAction, nextLocation);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n entries[index] = nextLocation;\n applyTx(nextAction, nextLocation);\n }\n }\n\n function go(delta) {\n var nextIndex = clamp(index + delta, 0, entries.length - 1);\n var nextAction = Action.Pop;\n var nextLocation = entries[nextIndex];\n\n function retry() {\n go(delta);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index = nextIndex;\n applyTx(nextAction, nextLocation);\n }\n }\n\n var history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n return blockers.push(blocker);\n }\n };\n return history;\n} ////////////////////////////////////////////////////////////////////////////////\n// UTILS\n////////////////////////////////////////////////////////////////////////////////\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n\nfunction promptBeforeUnload(event) {\n // Cancel the event.\n event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set.\n\n event.returnValue = '';\n}\n\nfunction createEvents() {\n var handlers = [];\n return {\n get length() {\n return handlers.length;\n },\n\n push: function push(fn) {\n handlers.push(fn);\n return function () {\n handlers = handlers.filter(function (handler) {\n return handler !== fn;\n });\n };\n },\n call: function call(arg) {\n handlers.forEach(function (fn) {\n return fn && fn(arg);\n });\n }\n };\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\r\n * Creates a string URL path from the given pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath\r\n */\n\n\nfunction createPath(_ref) {\n var _ref$pathname = _ref.pathname,\n pathname = _ref$pathname === void 0 ? '/' : _ref$pathname,\n _ref$search = _ref.search,\n search = _ref$search === void 0 ? '' : _ref$search,\n _ref$hash = _ref.hash,\n hash = _ref$hash === void 0 ? '' : _ref$hash;\n if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search;\n if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash;\n return pathname;\n}\n/**\r\n * Parses a string URL path into its separate pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath\r\n */\n\nfunction parsePath(path) {\n var parsedPath = {};\n\n if (path) {\n var hashIndex = path.indexOf('#');\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n var searchIndex = path.indexOf('?');\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath };\n//# sourceMappingURL=index.js.map\n","var Pe=Object.defineProperty;var a=(e,t)=>Pe(e,\"name\",{value:t,configurable:!0});var P=class{type=3;name=\"\";prefix=\"\";value=\"\";suffix=\"\";modifier=3;constructor(t,r,n,c,l,f){this.type=t,this.name=r,this.prefix=n,this.value=c,this.suffix=l,this.modifier=f}hasCustomName(){return this.name!==\"\"&&typeof this.name!=\"number\"}};a(P,\"Part\");var Re=/[$_\\p{ID_Start}]/u,Ee=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,v=\".*\";function Oe(e,t){return(t?/^[\\x00-\\xFF]*$/:/^[\\x00-\\x7F]*$/).test(e)}a(Oe,\"isASCII\");function D(e,t=!1){let r=[],n=0;for(;n<e.length;){let c=e[n],l=a(function(f){if(!t)throw new TypeError(f);r.push({type:\"INVALID_CHAR\",index:n,value:e[n++]})},\"ErrorOrInvalid\");if(c===\"*\"){r.push({type:\"ASTERISK\",index:n,value:e[n++]});continue}if(c===\"+\"||c===\"?\"){r.push({type:\"OTHER_MODIFIER\",index:n,value:e[n++]});continue}if(c===\"\\\\\"){r.push({type:\"ESCAPED_CHAR\",index:n++,value:e[n++]});continue}if(c===\"{\"){r.push({type:\"OPEN\",index:n,value:e[n++]});continue}if(c===\"}\"){r.push({type:\"CLOSE\",index:n,value:e[n++]});continue}if(c===\":\"){let f=\"\",s=n+1;for(;s<e.length;){let i=e.substr(s,1);if(s===n+1&&Re.test(i)||s!==n+1&&Ee.test(i)){f+=e[s++];continue}break}if(!f){l(`Missing parameter name at ${n}`);continue}r.push({type:\"NAME\",index:n,value:f}),n=s;continue}if(c===\"(\"){let f=1,s=\"\",i=n+1,o=!1;if(e[i]===\"?\"){l(`Pattern cannot start with \"?\" at ${i}`);continue}for(;i<e.length;){if(!Oe(e[i],!1)){l(`Invalid character '${e[i]}' at ${i}.`),o=!0;break}if(e[i]===\"\\\\\"){s+=e[i++]+e[i++];continue}if(e[i]===\")\"){if(f--,f===0){i++;break}}else if(e[i]===\"(\"&&(f++,e[i+1]!==\"?\")){l(`Capturing groups are not allowed at ${i}`),o=!0;break}s+=e[i++]}if(o)continue;if(f){l(`Unbalanced pattern at ${n}`);continue}if(!s){l(`Missing pattern at ${n}`);continue}r.push({type:\"REGEX\",index:n,value:s}),n=i;continue}r.push({type:\"CHAR\",index:n,value:e[n++]})}return r.push({type:\"END\",index:n,value:\"\"}),r}a(D,\"lexer\");function F(e,t={}){let r=D(e);t.delimiter??=\"/#?\",t.prefixes??=\"./\";let n=`[^${x(t.delimiter)}]+?`,c=[],l=0,f=0,s=\"\",i=new Set,o=a(u=>{if(f<r.length&&r[f].type===u)return r[f++].value},\"tryConsume\"),h=a(()=>o(\"OTHER_MODIFIER\")??o(\"ASTERISK\"),\"tryConsumeModifier\"),p=a(u=>{let d=o(u);if(d!==void 0)return d;let{type:g,index:y}=r[f];throw new TypeError(`Unexpected ${g} at ${y}, expected ${u}`)},\"mustConsume\"),A=a(()=>{let u=\"\",d;for(;d=o(\"CHAR\")??o(\"ESCAPED_CHAR\");)u+=d;return u},\"consumeText\"),xe=a(u=>u,\"DefaultEncodePart\"),N=t.encodePart||xe,H=\"\",$=a(u=>{H+=u},\"appendToPendingFixedValue\"),M=a(()=>{H.length&&(c.push(new P(3,\"\",\"\",N(H),\"\",3)),H=\"\")},\"maybeAddPartFromPendingFixedValue\"),X=a((u,d,g,y,Z)=>{let m=3;switch(Z){case\"?\":m=1;break;case\"*\":m=0;break;case\"+\":m=2;break}if(!d&&!g&&m===3){$(u);return}if(M(),!d&&!g){if(!u)return;c.push(new P(3,\"\",\"\",N(u),\"\",m));return}let S;g?g===\"*\"?S=v:S=g:S=n;let k=2;S===n?(k=1,S=\"\"):S===v&&(k=0,S=\"\");let E;if(d?E=d:g&&(E=l++),i.has(E))throw new TypeError(`Duplicate name '${E}'.`);i.add(E),c.push(new P(k,E,N(u),S,N(y),m))},\"addPart\");for(;f<r.length;){let u=o(\"CHAR\"),d=o(\"NAME\"),g=o(\"REGEX\");if(!d&&!g&&(g=o(\"ASTERISK\")),d||g){let m=u??\"\";t.prefixes.indexOf(m)===-1&&($(m),m=\"\"),M();let S=h();X(m,d,g,\"\",S);continue}let y=u??o(\"ESCAPED_CHAR\");if(y){$(y);continue}if(o(\"OPEN\")){let m=A(),S=o(\"NAME\"),k=o(\"REGEX\");!S&&!k&&(k=o(\"ASTERISK\"));let E=A();p(\"CLOSE\");let be=h();X(m,S,k,E,be);continue}M(),p(\"END\")}return c}a(F,\"parse\");function x(e){return e.replace(/([.+*?^${}()[\\]|/\\\\])/g,\"\\\\$1\")}a(x,\"escapeString\");function B(e){return e&&e.ignoreCase?\"ui\":\"u\"}a(B,\"flags\");function q(e,t,r){return W(F(e,r),t,r)}a(q,\"stringToRegexp\");function T(e){switch(e){case 0:return\"*\";case 1:return\"?\";case 2:return\"+\";case 3:return\"\"}}a(T,\"modifierToString\");function W(e,t,r={}){r.delimiter??=\"/#?\",r.prefixes??=\"./\",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith=\"\";let n=r.start?\"^\":\"\";for(let s of e){if(s.type===3){s.modifier===3?n+=x(s.value):n+=`(?:${x(s.value)})${T(s.modifier)}`;continue}t&&t.push(s.name);let i=`[^${x(r.delimiter)}]+?`,o=s.value;if(s.type===1?o=i:s.type===0&&(o=v),!s.prefix.length&&!s.suffix.length){s.modifier===3||s.modifier===1?n+=`(${o})${T(s.modifier)}`:n+=`((?:${o})${T(s.modifier)})`;continue}if(s.modifier===3||s.modifier===1){n+=`(?:${x(s.prefix)}(${o})${x(s.suffix)})`,n+=T(s.modifier);continue}n+=`(?:${x(s.prefix)}`,n+=`((?:${o})(?:`,n+=x(s.suffix),n+=x(s.prefix),n+=`(?:${o}))*)${x(s.suffix)})`,s.modifier===0&&(n+=\"?\")}let c=`[${x(r.endsWith)}]|$`,l=`[${x(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${l}?`),r.endsWith.length?n+=`(?=${c})`:n+=\"$\",new RegExp(n,B(r));r.strict||(n+=`(?:${l}(?=${c}))?`);let f=!1;if(e.length){let s=e[e.length-1];s.type===3&&s.modifier===3&&(f=r.delimiter.indexOf(s)>-1)}return f||(n+=`(?=${l}|${c})`),new RegExp(n,B(r))}a(W,\"partsToRegexp\");var b={delimiter:\"\",prefixes:\"\",sensitive:!0,strict:!0},J={delimiter:\".\",prefixes:\"\",sensitive:!0,strict:!0},Q={delimiter:\"/\",prefixes:\"/\",sensitive:!0,strict:!0};function ee(e,t){return e.length?e[0]===\"/\"?!0:!t||e.length<2?!1:(e[0]==\"\\\\\"||e[0]==\"{\")&&e[1]==\"/\":!1}a(ee,\"isAbsolutePathname\");function te(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}a(te,\"maybeStripPrefix\");function ke(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}a(ke,\"maybeStripSuffix\");function _(e){return!e||e.length<2?!1:e[0]===\"[\"||(e[0]===\"\\\\\"||e[0]===\"{\")&&e[1]===\"[\"}a(_,\"treatAsIPv6Hostname\");var re=[\"ftp\",\"file\",\"http\",\"https\",\"ws\",\"wss\"];function U(e){if(!e)return!0;for(let t of re)if(e.test(t))return!0;return!1}a(U,\"isSpecialScheme\");function ne(e,t){if(e=te(e,\"#\"),t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):\"\"}a(ne,\"canonicalizeHash\");function se(e,t){if(e=te(e,\"?\"),t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.search=e,r.search?r.search.substring(1,r.search.length):\"\"}a(se,\"canonicalizeSearch\");function ie(e,t){return t||e===\"\"?e:_(e)?K(e):j(e)}a(ie,\"canonicalizeHostname\");function ae(e,t){if(t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.password=e,r.password}a(ae,\"canonicalizePassword\");function oe(e,t){if(t||e===\"\")return e;let r=new URL(\"https://example.com\");return r.username=e,r.username}a(oe,\"canonicalizeUsername\");function ce(e,t,r){if(r||e===\"\")return e;if(t&&!re.includes(t))return new URL(`${t}:${e}`).pathname;let n=e[0]==\"/\";return e=new URL(n?e:\"/-\"+e,\"https://example.com\").pathname,n||(e=e.substring(2,e.length)),e}a(ce,\"canonicalizePathname\");function le(e,t,r){return z(t)===e&&(e=\"\"),r||e===\"\"?e:G(e)}a(le,\"canonicalizePort\");function fe(e,t){return e=ke(e,\":\"),t||e===\"\"?e:w(e)}a(fe,\"canonicalizeProtocol\");function z(e){switch(e){case\"ws\":case\"http\":return\"80\";case\"wws\":case\"https\":return\"443\";case\"ftp\":return\"21\";default:return\"\"}}a(z,\"defaultPortForProtocol\");function w(e){if(e===\"\")return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}a(w,\"protocolEncodeCallback\");function he(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.username=e,t.username}a(he,\"usernameEncodeCallback\");function ue(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.password=e,t.password}a(ue,\"passwordEncodeCallback\");function j(e){if(e===\"\")return e;if(/[\\t\\n\\r #%/:<>?@[\\]^\\\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL(\"https://example.com\");return t.hostname=e,t.hostname}a(j,\"hostnameEncodeCallback\");function K(e){if(e===\"\")return e;if(/[^0-9a-fA-F[\\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}a(K,\"ipv6HostnameEncodeCallback\");function G(e){if(e===\"\"||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}a(G,\"portEncodeCallback\");function de(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.pathname=e[0]!==\"/\"?\"/-\"+e:e,e[0]!==\"/\"?t.pathname.substring(2,t.pathname.length):t.pathname}a(de,\"standardURLPathnameEncodeCallback\");function pe(e){return e===\"\"?e:new URL(`data:${e}`).pathname}a(pe,\"pathURLPathnameEncodeCallback\");function ge(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.search=e,t.search.substring(1,t.search.length)}a(ge,\"searchEncodeCallback\");function me(e){if(e===\"\")return e;let t=new URL(\"https://example.com\");return t.hash=e,t.hash.substring(1,t.hash.length)}a(me,\"hashEncodeCallback\");var C=class{#i;#n=[];#t={};#e=0;#s=1;#l=0;#o=0;#d=0;#p=0;#g=!1;constructor(t){this.#i=t}get result(){return this.#t}parse(){for(this.#n=D(this.#i,!0);this.#e<this.#n.length;this.#e+=this.#s){if(this.#s=1,this.#n[this.#e].type===\"END\"){if(this.#o===0){this.#b(),this.#f()?this.#r(9,1):this.#h()?this.#r(8,1):this.#r(7,0);continue}else if(this.#o===2){this.#u(5);continue}this.#r(10,0);break}if(this.#d>0)if(this.#A())this.#d-=1;else continue;if(this.#T()){this.#d+=1;continue}switch(this.#o){case 0:this.#P()&&this.#u(1);break;case 1:if(this.#P()){this.#C();let t=7,r=1;this.#E()?(t=2,r=3):this.#g&&(t=2),this.#r(t,r)}break;case 2:this.#S()?this.#u(3):(this.#x()||this.#h()||this.#f())&&this.#u(5);break;case 3:this.#O()?this.#r(4,1):this.#S()&&this.#r(5,1);break;case 4:this.#S()&&this.#r(5,1);break;case 5:this.#y()?this.#p+=1:this.#w()&&(this.#p-=1),this.#k()&&!this.#p?this.#r(6,1):this.#x()?this.#r(7,0):this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 6:this.#x()?this.#r(7,0):this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 7:this.#h()?this.#r(8,1):this.#f()&&this.#r(9,1);break;case 8:this.#f()&&this.#r(9,1);break;case 9:break;case 10:break}}this.#t.hostname!==void 0&&this.#t.port===void 0&&(this.#t.port=\"\")}#r(t,r){switch(this.#o){case 0:break;case 1:this.#t.protocol=this.#c();break;case 2:break;case 3:this.#t.username=this.#c();break;case 4:this.#t.password=this.#c();break;case 5:this.#t.hostname=this.#c();break;case 6:this.#t.port=this.#c();break;case 7:this.#t.pathname=this.#c();break;case 8:this.#t.search=this.#c();break;case 9:this.#t.hash=this.#c();break;case 10:break}this.#o!==0&&t!==10&&([1,2,3,4].includes(this.#o)&&[6,7,8,9].includes(t)&&(this.#t.hostname??=\"\"),[1,2,3,4,5,6].includes(this.#o)&&[8,9].includes(t)&&(this.#t.pathname??=this.#g?\"/\":\"\"),[1,2,3,4,5,6,7].includes(this.#o)&&t===9&&(this.#t.search??=\"\")),this.#R(t,r)}#R(t,r){this.#o=t,this.#l=this.#e+r,this.#e+=r,this.#s=0}#b(){this.#e=this.#l,this.#s=0}#u(t){this.#b(),this.#o=t}#m(t){return t<0&&(t=this.#n.length-t),t<this.#n.length?this.#n[t]:this.#n[this.#n.length-1]}#a(t,r){let n=this.#m(t);return n.value===r&&(n.type===\"CHAR\"||n.type===\"ESCAPED_CHAR\"||n.type===\"INVALID_CHAR\")}#P(){return this.#a(this.#e,\":\")}#E(){return this.#a(this.#e+1,\"/\")&&this.#a(this.#e+2,\"/\")}#S(){return this.#a(this.#e,\"@\")}#O(){return this.#a(this.#e,\":\")}#k(){return this.#a(this.#e,\":\")}#x(){return this.#a(this.#e,\"/\")}#h(){if(this.#a(this.#e,\"?\"))return!0;if(this.#n[this.#e].value!==\"?\")return!1;let t=this.#m(this.#e-1);return t.type!==\"NAME\"&&t.type!==\"REGEX\"&&t.type!==\"CLOSE\"&&t.type!==\"ASTERISK\"}#f(){return this.#a(this.#e,\"#\")}#T(){return this.#n[this.#e].type==\"OPEN\"}#A(){return this.#n[this.#e].type==\"CLOSE\"}#y(){return this.#a(this.#e,\"[\")}#w(){return this.#a(this.#e,\"]\")}#c(){let t=this.#n[this.#e],r=this.#m(this.#l).index;return this.#i.substring(r,t.index)}#C(){let t={};Object.assign(t,b),t.encodePart=w;let r=q(this.#c(),void 0,t);this.#g=U(r)}};a(C,\"Parser\");var V=[\"protocol\",\"username\",\"password\",\"hostname\",\"port\",\"pathname\",\"search\",\"hash\"],O=\"*\";function Se(e,t){if(typeof e!=\"string\")throw new TypeError(\"parameter 1 is not of type 'string'.\");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:r.search!==\"\"?r.search.substring(1,r.search.length):void 0,hash:r.hash!==\"\"?r.hash.substring(1,r.hash.length):void 0}}a(Se,\"extractValues\");function R(e,t){return t?I(e):e}a(R,\"processBaseURLString\");function L(e,t,r){let n;if(typeof t.baseURL==\"string\")try{n=new URL(t.baseURL),t.protocol===void 0&&(e.protocol=R(n.protocol.substring(0,n.protocol.length-1),r)),!r&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&(e.username=R(n.username,r)),!r&&t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.username===void 0&&t.password===void 0&&(e.password=R(n.password,r)),t.protocol===void 0&&t.hostname===void 0&&(e.hostname=R(n.hostname,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&(e.port=R(n.port,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&(e.pathname=R(n.pathname,r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&(e.search=R(n.search.substring(1,n.search.length),r)),t.protocol===void 0&&t.hostname===void 0&&t.port===void 0&&t.pathname===void 0&&t.search===void 0&&t.hash===void 0&&(e.hash=R(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if(typeof t.protocol==\"string\"&&(e.protocol=fe(t.protocol,r)),typeof t.username==\"string\"&&(e.username=oe(t.username,r)),typeof t.password==\"string\"&&(e.password=ae(t.password,r)),typeof t.hostname==\"string\"&&(e.hostname=ie(t.hostname,r)),typeof t.port==\"string\"&&(e.port=le(t.port,e.protocol,r)),typeof t.pathname==\"string\"){if(e.pathname=t.pathname,n&&!ee(e.pathname,r)){let c=n.pathname.lastIndexOf(\"/\");c>=0&&(e.pathname=R(n.pathname.substring(0,c+1),r)+e.pathname)}e.pathname=ce(e.pathname,e.protocol,r)}return typeof t.search==\"string\"&&(e.search=se(t.search,r)),typeof t.hash==\"string\"&&(e.hash=ne(t.hash,r)),e}a(L,\"applyInit\");function I(e){return e.replace(/([+*?:{}()\\\\])/g,\"\\\\$1\")}a(I,\"escapePatternString\");function Te(e){return e.replace(/([.+*?^${}()[\\]|/\\\\])/g,\"\\\\$1\")}a(Te,\"escapeRegexpString\");function Ae(e,t){t.delimiter??=\"/#?\",t.prefixes??=\"./\",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith=\"\";let r=\".*\",n=`[^${Te(t.delimiter)}]+?`,c=/[$_\\u200C\\u200D\\p{ID_Continue}]/u,l=\"\";for(let f=0;f<e.length;++f){let s=e[f];if(s.type===3){if(s.modifier===3){l+=I(s.value);continue}l+=`{${I(s.value)}}${T(s.modifier)}`;continue}let i=s.hasCustomName(),o=!!s.suffix.length||!!s.prefix.length&&(s.prefix.length!==1||!t.prefixes.includes(s.prefix)),h=f>0?e[f-1]:null,p=f<e.length-1?e[f+1]:null;if(!o&&i&&s.type===1&&s.modifier===3&&p&&!p.prefix.length&&!p.suffix.length)if(p.type===3){let A=p.value.length>0?p.value[0]:\"\";o=c.test(A)}else o=!p.hasCustomName();if(!o&&!s.prefix.length&&h&&h.type===3){let A=h.value[h.value.length-1];o=t.prefixes.includes(A)}o&&(l+=\"{\"),l+=I(s.prefix),i&&(l+=`:${s.name}`),s.type===2?l+=`(${s.value})`:s.type===1?i||(l+=`(${n})`):s.type===0&&(!i&&(!h||h.type===3||h.modifier!==3||o||s.prefix!==\"\")?l+=\"*\":l+=`(${r})`),s.type===1&&i&&s.suffix.length&&c.test(s.suffix[0])&&(l+=\"\\\\\"),l+=I(s.suffix),o&&(l+=\"}\"),s.modifier!==3&&(l+=T(s.modifier))}return l}a(Ae,\"partsToPattern\");var Y=class{#i;#n={};#t={};#e={};#s={};#l=!1;constructor(t={},r,n){try{let c;if(typeof r==\"string\"?c=r:n=r,typeof t==\"string\"){let i=new C(t);if(i.parse(),t=i.result,c===void 0&&typeof t.protocol!=\"string\")throw new TypeError(\"A base URL must be provided for a relative constructor string.\");t.baseURL=c}else{if(!t||typeof t!=\"object\")throw new TypeError(\"parameter 1 is not of type 'string' and cannot convert to dictionary.\");if(c)throw new TypeError(\"parameter 1 is not of type 'string'.\")}typeof n>\"u\"&&(n={ignoreCase:!1});let l={ignoreCase:n.ignoreCase===!0},f={pathname:O,protocol:O,username:O,password:O,hostname:O,port:O,search:O,hash:O};this.#i=L(f,t,!0),z(this.#i.protocol)===this.#i.port&&(this.#i.port=\"\");let s;for(s of V){if(!(s in this.#i))continue;let i={},o=this.#i[s];switch(this.#t[s]=[],s){case\"protocol\":Object.assign(i,b),i.encodePart=w;break;case\"username\":Object.assign(i,b),i.encodePart=he;break;case\"password\":Object.assign(i,b),i.encodePart=ue;break;case\"hostname\":Object.assign(i,J),_(o)?i.encodePart=K:i.encodePart=j;break;case\"port\":Object.assign(i,b),i.encodePart=G;break;case\"pathname\":U(this.#n.protocol)?(Object.assign(i,Q,l),i.encodePart=de):(Object.assign(i,b,l),i.encodePart=pe);break;case\"search\":Object.assign(i,b,l),i.encodePart=ge;break;case\"hash\":Object.assign(i,b,l),i.encodePart=me;break}try{this.#s[s]=F(o,i),this.#n[s]=W(this.#s[s],this.#t[s],i),this.#e[s]=Ae(this.#s[s],i),this.#l=this.#l||this.#s[s].some(h=>h.type===2)}catch{throw new TypeError(`invalid ${s} pattern '${this.#i[s]}'.`)}}}catch(c){throw new TypeError(`Failed to construct 'URLPattern': ${c.message}`)}}get[Symbol.toStringTag](){return\"URLPattern\"}test(t={},r){let n={pathname:\"\",protocol:\"\",username:\"\",password:\"\",hostname:\"\",port:\"\",search:\"\",hash:\"\"};if(typeof t!=\"string\"&&r)throw new TypeError(\"parameter 1 is not of type 'string'.\");if(typeof t>\"u\")return!1;try{typeof t==\"object\"?n=L(n,t,!1):n=L(n,Se(t,r),!1)}catch{return!1}let c;for(c of V)if(!this.#n[c].exec(n[c]))return!1;return!0}exec(t={},r){let n={pathname:\"\",protocol:\"\",username:\"\",password:\"\",hostname:\"\",port:\"\",search:\"\",hash:\"\"};if(typeof t!=\"string\"&&r)throw new TypeError(\"parameter 1 is not of type 'string'.\");if(typeof t>\"u\")return;try{typeof t==\"object\"?n=L(n,t,!1):n=L(n,Se(t,r),!1)}catch{return null}let c={};r?c.inputs=[t,r]:c.inputs=[t];let l;for(l of V){let f=this.#n[l].exec(n[l]);if(!f)return null;let s={};for(let[i,o]of this.#t[l].entries())if(typeof o==\"string\"||typeof o==\"number\"){let h=f[i+1];s[o]=h}c[l]={input:n[l]??\"\",groups:s}}return c}static compareComponent(t,r,n){let c=a((i,o)=>{for(let h of[\"type\",\"modifier\",\"prefix\",\"value\",\"suffix\"]){if(i[h]<o[h])return-1;if(i[h]===o[h])continue;return 1}return 0},\"comparePart\"),l=new P(3,\"\",\"\",\"\",\"\",3),f=new P(0,\"\",\"\",\"\",\"\",3),s=a((i,o)=>{let h=0;for(;h<Math.min(i.length,o.length);++h){let p=c(i[h],o[h]);if(p)return p}return i.length===o.length?0:c(i[h]??l,o[h]??l)},\"comparePartList\");return!r.#e[t]&&!n.#e[t]?0:r.#e[t]&&!n.#e[t]?s(r.#s[t],[f]):!r.#e[t]&&n.#e[t]?s([f],n.#s[t]):s(r.#s[t],n.#s[t])}get protocol(){return this.#e.protocol}get username(){return this.#e.username}get password(){return this.#e.password}get hostname(){return this.#e.hostname}get port(){return this.#e.port}get pathname(){return this.#e.pathname}get search(){return this.#e.search}get hash(){return this.#e.hash}get hasRegExpGroups(){return this.#l}};a(Y,\"URLPattern\");export{Y as URLPattern};\n","import { URLPattern } from \"./dist/urlpattern.js\";\n\nexport { URLPattern };\n\nif (!globalThis.URLPattern) {\n globalThis.URLPattern = URLPattern;\n}\n","export function sleep(time: number) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}\n","import { Subject } from \"../utils/Subject\";\nimport { sleep } from \"../utils/sleep\";\n\nexport class ProgressManager {\n state = new Subject(100);\n unsubscribe: ReturnType<InstanceType<typeof Subject>[\"subscribe\"]>;\n timer: ReturnType<typeof setInterval>;\n tick = 0;\n isTicking = false;\n\n constructor(subject: Subject<boolean>) {\n this.unsubscribe = subject.subscribe((state) => {\n if (state) {\n this.start();\n } else {\n this.end();\n }\n });\n }\n\n getNextIncrement() {\n const current = this.state.getValue();\n if (current === 100) {\n return Math.ceil(Math.random() * 10);\n }\n\n if (current <= 20) {\n if (Math.ceil(Math.random() * 100) > 80) {\n return current;\n }\n return current + Math.ceil(Math.random() * 5) + 1;\n }\n\n if (current <= 50) {\n if (Math.ceil(Math.random() * 100) > 50) {\n return current;\n }\n return Math.min(current + Math.ceil(Math.random() * 10), 70);\n }\n\n if (current <= 70) {\n if (Math.ceil(Math.random() * 100) > 60) {\n return current;\n }\n return Math.min(current + Math.ceil(Math.random() * 3), 80);\n }\n\n if (current <= 80) {\n return Math.min(current + Math.ceil(Math.random() * 1), 90);\n }\n\n if (current <= 90) {\n const x = Math.ceil(Math.random() * 100) > 50 ? 0 : 1;\n return Math.min(current + x, 94);\n }\n\n if (current <= 94) {\n const x = Math.ceil(Math.random() * 100) > 20 ? 0 : 1;\n return Math.min(current + x, 99);\n }\n }\n\n getNextInterval() {\n if (this.tick === 0) {\n this.tick = 1;\n return 200;\n }\n const current = this.state.getValue();\n\n if (current >= 88) {\n return 400;\n }\n if (current >= 94) {\n return 1000;\n }\n if (current >= 98) {\n return 2000;\n }\n return 100;\n }\n\n async nextTick() {\n if (!this.isTicking) {\n return;\n }\n await sleep(this.getNextInterval());\n\n if (!this.isTicking) {\n return;\n }\n\n const increment = this.getNextIncrement();\n this.state.next(Math.min(increment, 96));\n\n await this.nextTick();\n }\n\n start() {\n this.isTicking = true;\n this.nextTick();\n }\n\n end() {\n this.state.next(99);\n this.isTicking = false;\n this.tick = 0;\n setTimeout(() => {\n this.state.next(100);\n }, 200);\n }\n\n destroy() {\n this.end();\n this.unsubscribe();\n }\n}\n","import { useContext } from \"react\";\nimport { RouteStateContext } from \"./RouteStateContext\";\n\nexport function useLocation() {\n const ctx = useContext(RouteStateContext);\n if (!ctx) {\n throw new Error(\"Router context not found\");\n }\n const { hash, pathname, search, state, locale } = ctx;\n return {\n hash,\n key: pathname,\n pathname,\n search,\n state,\n locale,\n };\n}\n","import { createContext, type PropsWithChildren } from \"react\";\nimport type { Translations } from \"./I18nContext\";\nimport type { ComponentTree } from \"./types\";\nimport type { User } from \"../auth/types\";\n\ntype Data = Record<string, any>;\n\nexport interface ServerDataContextValue {\n routeManifest: Record<string, string[]>;\n pageData: Record<string, Record<string, Data>>;\n breadcrumbs: Record<string, { label: string; href: string }>;\n prefetchedData: Record<string, Data>;\n router: {\n pathname: string;\n params: Record<string, any>;\n currentPath: string;\n is404: boolean;\n searchParams: string;\n urlLocaleSegment: string | null;\n };\n i18n: {\n dictionary: Translations;\n currentLocale: string;\n supportedLocales: string[];\n defaultLocale: string;\n };\n componentTree: ComponentTree;\n auth: {\n user: User;\n };\n /**\n * Evaluated features for this request: `key -> boolean`, nothing else.\n *\n * Never the targeting or the reason a feature resolved the way it did — those\n * stay on the server. Read through `useFeature` rather than directly.\n */\n features: Record<string, boolean>;\n __csrf: string;\n cssManifest: Record<string, string[]>;\n /** Built chunk URLs per view name, for warming a navigation's imports. */\n modulePreloadManifest: Record<string, string[]>;\n meta: any;\n appId: string;\n}\n\nexport const ServerDataContext = createContext({} as ServerDataContextValue);\n\ninterface ServerDataProviderProps {\n value?: ServerDataContextValue;\n}\n\nexport const ServerDataProvider = (\n props: PropsWithChildren<ServerDataProviderProps>,\n) => {\n let _value = props.value;\n // Server\n if (props.value) {\n _value = props.value;\n } else {\n // Client\n _value = (window as any).__GEMI_DATA__;\n }\n\n return (\n <ServerDataContext.Provider value={_value}>\n {props.children}\n </ServerDataContext.Provider>\n );\n};\n","import {\n createContext,\n type PropsWithChildren,\n useContext,\n useRef,\n useState,\n} from \"react\";\nimport { ServerDataContext } from \"./ServerDataProvider\";\n\ntype TranslationScope = Record<string, string>;\ntype TranslationScopes = Record<string, TranslationScope>;\nexport type Translations = Record<string, TranslationScopes>;\n\ninterface I18nContextValue {\n locale: string;\n changeLocale: (locale: string) => void;\n updateDictionary: (\n translations: Record<string, Record<string, Record<string, string>>>,\n locale?: string,\n ) => void;\n fetchTranslations: (\n pathname: string,\n locale?: string,\n signal?: AbortSignal,\n ) => Promise<void>;\n getComponentTranslations: (key: string) => Record<string, string>;\n supportedLocales: string[];\n defaultLocale: string;\n}\n\nexport type CreateI18nDictionary<T> = {\n [K in keyof T]: T[K];\n};\n\nexport const I18nContext = createContext({} as I18nContextValue);\n\nexport type Dictionary = Map<string, Map<string, Record<string, string>>>;\n\nexport const I18nProvider = (props: PropsWithChildren) => {\n const { i18n } = useContext(ServerDataContext);\n\n const [currentLocale, setCurrentLocale] = useState(i18n.currentLocale);\n\n const dictionary = useRef<Dictionary>(\n (() => {\n const dictionary = new Map();\n for (const [locale, value] of Object.entries(i18n?.dictionary ?? {})) {\n const components = new Map();\n for (const [component, translations] of Object.entries(value)) {\n components.set(component, translations);\n }\n dictionary.set(locale, components);\n }\n return dictionary;\n })(),\n );\n\n function updateDictionary(\n translations: Record<string, Record<string, Record<string, string>>> = {},\n locale?: string,\n ) {\n for (const [locale, value] of Object.entries(translations)) {\n if (!dictionary.current.has(locale)) {\n dictionary.current.set(locale, new Map());\n }\n const scopes = dictionary.current.get(locale);\n for (const [scope, translations] of Object.entries(value)) {\n if (!scopes.has(scope)) {\n scopes.set(scope, {});\n }\n scopes.set(scope, translations);\n }\n }\n changeLocale(locale);\n }\n\n const changeLocale = (locale: string) => {\n if (dictionary.current.has(locale)) {\n setCurrentLocale(locale);\n }\n };\n\n const getTranslations = (locale: string) => {\n return (component: string) => {\n return dictionary.current.get(locale).get(component);\n };\n };\n\n const fetchTranslations = async (\n pathname: string,\n locale?: string,\n signal?: AbortSignal,\n ) => {\n if (Object.keys(i18n).length === 0) {\n return;\n }\n const response = await fetch(\n `/api/__gemi__/services/i18n/translations/${\n locale || currentLocale\n }${pathname === \"/\" ? \"\" : pathname}`,\n {\n signal,\n },\n );\n const translations = await response.json();\n updateDictionary(translations);\n };\n\n return (\n <I18nContext.Provider\n value={{\n getComponentTranslations: getTranslations(currentLocale),\n locale: currentLocale,\n changeLocale,\n updateDictionary,\n fetchTranslations,\n supportedLocales: i18n.supportedLocales,\n defaultLocale: i18n.defaultLocale,\n }}\n >\n {props.children}\n </I18nContext.Provider>\n );\n};\n","import { useContext } from \"react\";\nimport { ClientRouterContext } from \"./ClientRouterContext\";\nimport type { UrlParser, ViewPaths } from \"./types\";\nimport { applyParams } from \"../utils/applyParams\";\nimport { useLocation } from \"./useLocation\";\nimport { I18nContext } from \"./I18nContext\";\n\ntype Options<T extends ViewPaths> = UrlParser<T> extends Record<string, never>\n ? {\n search?: Record<string, string | number | boolean | undefined | null>;\n shallow?: boolean;\n hash?: string;\n locale?: string;\n }\n : {\n search?: Record<string, string | number | boolean | undefined | null>;\n params: UrlParser<T>;\n hash?: string;\n shallow?: boolean;\n locale?: string;\n };\n\nexport function useNavigate() {\n const { history, setNavigationAbortController } =\n useContext(ClientRouterContext);\n const { defaultLocale } = useContext(I18nContext);\n const location = useLocation();\n\n function action(pushOrReplace: \"push\" | \"replace\") {\n return async <T extends ViewPaths>(\n path: T | (string & {}),\n ...args: UrlParser<T> extends Record<string, never>\n ? [options?: Options<T>]\n : [options: Options<T>]\n ) => {\n const navigationAbortController = new AbortController();\n if (setNavigationAbortController) {\n setNavigationAbortController(navigationAbortController);\n }\n\n const [options = {}] = args;\n const {\n search = {},\n params = {},\n shallow,\n locale,\n hash,\n } = {\n params: {},\n shallow: false,\n locale: null,\n hash: \"\",\n ...options,\n };\n\n const urlSearchParams = new URLSearchParams(search);\n let localeSegment = location.locale;\n if (locale) {\n localeSegment = locale;\n }\n if (localeSegment === defaultLocale) {\n localeSegment = \"\";\n }\n\n const routePath = applyParams(path, params);\n const navigationPath = [\n `${localeSegment ? `/${localeSegment}` : \"\"}${routePath === \"/\" ? \"\" : routePath}`,\n urlSearchParams.toString(),\n ]\n .filter((s) => s.length > 0)\n .join(\"?\");\n\n const finalPath = [navigationPath, hash].filter(Boolean).join(\"\");\n\n if (shallow) {\n history?.[pushOrReplace](finalPath, { shallow });\n return;\n }\n\n history?.[pushOrReplace](finalPath === '' ? '/' : finalPath);\n };\n }\n\n return {\n push: action(\"push\"),\n replace: action(\"replace\"),\n };\n}\n","import { useContext } from \"react\";\nimport { useNavigate } from \"./useNavigate\";\nimport { RouteStateContext } from \"./RouteStateContext\";\nimport { useParams } from \"./useParams\";\n\ntype SearchParamsCallback = (\n search: Record<string, any>,\n shallow: boolean,\n) => void;\n\nclass SearchParams {\n constructor(\n private searchParams: URLSearchParams,\n private callback: SearchParamsCallback,\n ) {}\n\n get(key: string) {\n return this.searchParams.get(key);\n }\n\n set(key: Record<string, string | ((state: string) => string)>): SearchParams;\n set(key: string, value: string | ((state: string) => string)): SearchParams;\n set(key: any, value?: any) {\n let entries: Record<string, any> = {};\n if (typeof key === \"string\") {\n let _value: string = value;\n if (typeof value === \"function\") {\n _value = value(this.get(key) ?? \"\");\n }\n entries[key] = _value;\n } else {\n entries = (key as any) ?? {};\n }\n for (const [key, value] of Object.entries(entries)) {\n let _value: string = value;\n if (typeof value === \"function\") {\n _value = value(this.get(key) ?? \"\");\n }\n this.searchParams.set(key, _value);\n }\n return this;\n }\n\n append(key: string, value: string) {\n this.searchParams.append(key, value);\n return this;\n }\n\n sort() {\n this.searchParams.sort();\n return this;\n }\n\n clear() {\n this.searchParams = new URLSearchParams();\n return this;\n }\n\n delete(key: string | string[]) {\n const keys = Array.isArray(key) ? key : [key];\n for (const key of keys) {\n this.searchParams.delete(key);\n }\n return this;\n }\n\n toJSON() {\n const map = new Map<string, string | string[]>();\n // @ts-ignore\n for (const [key, value] of this.searchParams) {\n if (map.has(key)) {\n const currentValue = map.get(key);\n if (Array.isArray(currentValue)) {\n currentValue.push(value);\n map.set(key, currentValue);\n } else {\n map.set(key, [currentValue, value]);\n }\n } else {\n map.set(key, value);\n }\n }\n\n return Object.fromEntries(map.entries());\n }\n\n toString() {\n return this.searchParams.toString();\n }\n\n push(mode: \"soft\" | \"hard\" = \"soft\") {\n this.callback(this.toJSON(), mode === \"soft\");\n }\n}\n\nexport function useSearchParams() {\n const { push } = useNavigate();\n const { search, pathname } = useContext(RouteStateContext);\n const params = useParams();\n\n const callback = (search: Record<string, never>, shallow: boolean) => {\n push(\n pathname as never,\n {\n params,\n search,\n shallow,\n } as any,\n );\n };\n\n const searchParams = new SearchParams(new URLSearchParams(search), callback);\n\n return searchParams;\n}\n","import { useContext } from \"react\";\nimport type { ViewPaths } from \"./types\";\nimport { RouteStateContext } from \"./RouteStateContext\";\n\ntype Pathname = ViewPaths;\n\nexport function useRoute() {\n const { pathname: _pathname } = useContext(RouteStateContext);\n return {\n pathname: _pathname,\n startsWith: (pathname: Pathname) => {\n return _pathname.startsWith(pathname);\n },\n };\n}\n","import { useEffect, useState } from \"react\";\nimport { useNavigate } from \"./useNavigate\";\nimport { useSearchParams } from \"./useSearchParams\";\nimport { useRoute } from \"./useRoute\";\nimport { useParams } from \"./useParams\";\nimport { createPortal } from \"react-dom\";\n\nexport const HttpReload = () => {\n const { replace } = useNavigate();\n const searchParams = useSearchParams();\n const { pathname } = useRoute();\n const params = useParams();\n const [reloading, setReloading] = useState(false);\n\n const handleReload = () => {\n // The server recovered, so dismiss any Vite error overlay left on the page\n // (each element exposes a `close()` that also tears down its listeners).\n if (typeof document !== \"undefined\") {\n document.querySelectorAll(\"vite-error-overlay\").forEach((el: any) => {\n if (typeof el.close === \"function\") el.close();\n else el.remove();\n });\n }\n setReloading(true);\n // replace(pathname, {\n // params: params,\n // search: searchParams.toJSON(),\n // } as any)\n // .catch(console.log)\n // .finally(() => {\n // setReloading(false);\n // });\n };\n\n useEffect(() => {\n // @ts-ignore\n if (import.meta.hot) {\n // @ts-ignore\n import.meta.hot.on(\"http-reload\", handleReload);\n }\n return () => {\n // @ts-ignore\n if (import.meta.hot) {\n // @ts-ignore\n import.meta.hot.off(\"http-reload\", handleReload);\n }\n };\n }, [handleReload]);\n\n if (!reloading || typeof document === \"undefined\") {\n return null;\n }\n return createPortal(\n <div className=\"fixed z-[1000] bottom-0 right-0 p-2\">\n <div className=\"p-2 bg-white text-black rounded-md shadow-md\">...</div>\n </div>,\n document.body,\n );\n};\n","/**\n * How long a prefetched payload stays usable. Long enough to cover the gap\n * between hovering a link and clicking it, short enough that a navigation is\n * not served a snapshot the visitor would notice as out of date.\n *\n * A payload cached here is committed wholesale on navigation — including into\n * the query cache via `hydrate` — so anything that invalidates page data has to\n * `clear()` this too. `useMutation` does exactly that on every successful\n * write; locale needs no such call, since the locale segment is part of the key.\n */\nexport const PREFETCH_TTL = 10_000;\n\n/**\n * Ceiling on retained payloads. Entries only leave on their own when a\n * navigation consumes them, and `viewport`/`render` on a long list warms links\n * that are mostly never clicked — each one a full page payload. Oldest goes\n * first, which is also the one closest to expiry.\n */\nexport const PREFETCH_MAX_ENTRIES = 12;\n\ninterface Entry {\n promise: Promise<unknown>;\n createdAt: number;\n}\n\n/**\n * Payloads fetched ahead of a navigation, keyed by the `.json` URL that\n * navigation would request. Entries are handed over once — a navigation that\n * consumes one becomes the live route data, so keeping a copy around would only\n * let a later visit render from a stale snapshot.\n */\nexport class PrefetchCache {\n private entries = new Map<string, Entry>();\n\n private isFresh(entry: Entry) {\n return Date.now() - entry.createdAt < PREFETCH_TTL;\n }\n\n /** Drops what has expired, then the oldest of whatever is still over budget. */\n private evict() {\n for (const [url, entry] of this.entries) {\n if (!this.isFresh(entry)) {\n this.entries.delete(url);\n }\n }\n while (this.entries.size >= PREFETCH_MAX_ENTRIES) {\n const oldest = this.entries.keys().next().value;\n if (oldest === undefined) {\n return;\n }\n this.entries.delete(oldest);\n }\n }\n\n /**\n * Runs `load` unless the same URL is already in flight or freshly cached, so\n * a link hovered repeatedly — or a screenful of eagerly prefetched links\n * pointing at one route — costs a single request.\n */\n prime(url: string, load: () => Promise<unknown>): Promise<unknown> {\n const existing = this.entries.get(url);\n if (existing && this.isFresh(existing)) {\n return existing.promise;\n }\n\n this.evict();\n\n const entry: Entry = { createdAt: Date.now(), promise: null as never };\n entry.promise = load()\n .catch(() => null)\n .then((payload) => {\n // A failed prefetch is dropped rather than remembered: the navigation\n // falls back to its own request and the next hover gets to retry.\n if (payload == null && this.entries.get(url) === entry) {\n this.entries.delete(url);\n }\n return payload;\n });\n\n this.entries.set(url, entry);\n return entry.promise;\n }\n\n /**\n * Hands the payload for `url` to a navigation, if one was prefetched and is\n * still fresh. Resolves to `null` when the prefetch failed, which callers\n * must treat as a miss.\n */\n take(url: string): Promise<unknown> | null {\n const entry = this.entries.get(url);\n if (!entry) {\n return null;\n }\n this.entries.delete(url);\n return this.isFresh(entry) ? entry.promise : null;\n }\n\n /**\n * Drops everything, for when the data behind these payloads may have moved\n * on. In-flight loads still settle; their entries are simply gone by then.\n */\n clear() {\n this.entries.clear();\n }\n\n /** Retained entries, fresh or not. Exposed for tests. */\n get size() {\n return this.entries.size;\n }\n}\n","/**\n * The `.json` URL a route's page data is served from.\n *\n * Prefetching and navigation have to agree on this string exactly — the\n * prefetch cache is keyed by it, and any disagreement silently turns every\n * prefetch into a wasted request plus a full fetch on click.\n */\nexport function routeDataUrl(options: {\n /** Concrete pathname, without the locale segment. */\n pathname: string;\n /** Query string including the leading `?`, or empty. */\n search?: string;\n /** `/tr-TR` style prefix, or empty for the default locale. */\n localeSegment?: string;\n}) {\n const { pathname, search = \"\", localeSegment = \"\" } = options;\n // `/tr-TR/.json` names nothing — the locale segment is the whole path there.\n const path = localeSegment.length > 0 && pathname === \"/\" ? \"\" : pathname;\n return `${localeSegment}${path}.json${search}`;\n}\n","/** One streamed query result: `[path, variantKey, data]`. */\nexport type RouteQueryPayload = [string, string, any];\n\n/**\n * Reads a navigation payload response (#290).\n *\n * The body is NDJSON: the first line is the envelope (route data, meta,\n * partial info, already-resolved `prefetchedData`), later lines are\n * `[path, variantKey, data]` query results streamed as they settle\n * server-side. The returned promise resolves with the envelope as soon as\n * its line arrives — the caller commits the navigation immediately — while\n * the remaining lines keep draining in the background into `onQueryPayload`,\n * whose `hydrate()` settles any segment that suspended on that variant.\n *\n * Tolerates two other body shapes so every producer keeps working: a plain\n * single-JSON body with no trailing newline (error-path responses, buffering\n * proxies) parses as the envelope at end-of-stream, and a `Response` without\n * a readable `body` (test doubles) falls back to `.json()`.\n */\nexport async function readRoutePayload(\n response: Response,\n onQueryPayload?: (payload: RouteQueryPayload) => void,\n): Promise<any | null> {\n const reader = response.body?.getReader?.();\n if (!reader) {\n try {\n return await response.json();\n } catch {\n return null;\n }\n }\n\n const decoder = new TextDecoder();\n let buffer = \"\";\n\n return await new Promise<any | null>((resolve) => {\n let envelopeResolved = false;\n const emitEnvelope = (value: any | null) => {\n if (envelopeResolved) return;\n envelopeResolved = true;\n resolve(value);\n };\n\n const handleLine = (line: string) => {\n if (line.trim().length === 0) return;\n let value: unknown;\n try {\n value = JSON.parse(line);\n } catch (error) {\n console.error(\"[gemi] Unparseable route payload line\", error);\n emitEnvelope(null);\n return;\n }\n if (!envelopeResolved) {\n emitEnvelope(value);\n return;\n }\n if (Array.isArray(value) && value.length === 3) {\n onQueryPayload?.(value as RouteQueryPayload);\n }\n };\n\n (async () => {\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n buffer += decoder.decode(value, { stream: true });\n let newline = buffer.indexOf(\"\\n\");\n while (newline !== -1) {\n const line = buffer.slice(0, newline);\n buffer = buffer.slice(newline + 1);\n handleLine(line);\n newline = buffer.indexOf(\"\\n\");\n }\n }\n buffer += decoder.decode();\n // A plain-JSON body has no trailing newline: the whole buffer is the\n // envelope. (For NDJSON bodies the buffer is empty here.)\n handleLine(buffer);\n emitEnvelope(null);\n } catch (error) {\n console.error(\"[gemi] Route payload stream failed\", error);\n emitEnvelope(null);\n }\n })();\n });\n}\n\n/**\n * Reads the response to the very end and returns the envelope with every\n * streamed query result merged into its `prefetchedData` — the settled\n * aggregate a `<Link prefetch>` warms ahead of a click, equivalent to what\n * the old blocking payload contained. Buffering is the point here: a hover\n * prefetch has time, and the cache stores one complete payload.\n */\nexport async function readSettledRoutePayload(\n response: Response,\n): Promise<any | null> {\n if (typeof response.text !== \"function\") {\n // Test doubles that only implement `.json()`.\n try {\n return await response.json();\n } catch {\n return null;\n }\n }\n\n let text: string;\n try {\n text = await response.text();\n } catch {\n return null;\n }\n\n const lines = text.split(\"\\n\").filter((line) => line.trim().length > 0);\n if (lines.length === 0) return null;\n\n let envelope: any;\n try {\n envelope = JSON.parse(lines[0]);\n } catch {\n return null;\n }\n\n for (const line of lines.slice(1)) {\n let value: unknown;\n try {\n value = JSON.parse(line);\n } catch {\n continue;\n }\n if (Array.isArray(value) && value.length === 3) {\n const [path, variantKey, data] = value as RouteQueryPayload;\n envelope.prefetchedData ??= {};\n envelope.prefetchedData[path] ??= {};\n envelope.prefetchedData[path][variantKey] = data;\n }\n }\n return envelope;\n}\n","/**\n * The process-wide store behind `defineDictionary`.\n *\n * Every handle registers itself here when its module is *evaluated*, not when\n * it is first rendered. That ordering is the whole point: the view router\n * already awaits a view's module import before rendering it, so by the time it\n * calls `preloadDictionaries()` every dictionary reachable from that view has\n * announced itself and can be warmed in one pass. `useDictionary` then reads\n * resolved strings synchronously and the render never suspends — on the server\n * that keeps the SSR stream from fragmenting into a reveal chunk per\n * dictionary, and on the client it keeps navigations flash-free.\n *\n * `use()` in the hook is the correctness net for what a preload pass cannot\n * see: a dictionary inside a `lazy()` subtree, or a locale switch.\n */\n\nimport type { LocaleStrings } from \"./dictionaryShape\";\n\nexport type { LocaleStrings };\n\nexport interface RegisteredDictionary {\n id: string;\n /** Locales this dictionary declares. Empty when it is not known up front. */\n locales: string[];\n load: (locale: string) => Promise<LocaleStrings> | LocaleStrings;\n}\n\ninterface RegistryState {\n /** Every handle that has been constructed, by id. */\n registry: Map<string, RegisteredDictionary>;\n /** Resolved strings: id -> locale -> strings. */\n resolved: Map<string, Map<string, LocaleStrings>>;\n /** In-flight loads, so N components sharing a dictionary share one request. */\n inFlight: Map<string, Promise<LocaleStrings>>;\n /**\n * Never-rejecting promises for the render path; see\n * `loadDictionaryForRender`. `use()` needs a stable reference, so these\n * cannot be built per render.\n */\n degraded: Map<string, Promise<LocaleStrings>>;\n /**\n * Registration order, so `preloadDictionaries` can warm only what a freshly\n * imported module added instead of re-walking every dictionary in the app on\n * every navigation.\n */\n order: string[];\n /**\n * Per locale, how far into `order` an unmarked `preloadDictionaries` has\n * already warmed. Lets the server's per-request call cost O(newly imported)\n * rather than O(every dictionary in the app).\n */\n warmed: Map<string, number>;\n /**\n * The locale currently being rendered, recorded by `useDictionary`. The\n * initial payload is in `__GEMI_DATA__`, but that snapshot is frozen at the\n * first load — after a locale switch it is stale, and the view loader needs\n * to know which locale's chunks to warm.\n */\n activeLocale: string | null;\n}\n\n/**\n * Parked on `globalThis` rather than in module scope, because this module gets\n * bundled more than once and the copies have to agree.\n *\n * gemi ships `gemi/client` from one Vite lib build and `gemi/dictionary` from a\n * separate Bun build, an SSR view graph externalizes some gemi subpaths and\n * bundles others, and a dictionary imported by both a view and a controller is\n * evaluated on both sides. Every one of those splits would otherwise produce a\n * second registry: views would register into one Map while the view router\n * preloaded and snapshotted from another, and the hydration payload would come\n * out empty. Module identity is not something this can depend on; a global key\n * is.\n */\nconst GLOBAL_KEY = \"__GEMI_DICTIONARY_REGISTRY__\";\n\nconst state: RegistryState = ((globalThis as any)[GLOBAL_KEY] ??= {\n registry: new Map(),\n resolved: new Map(),\n inFlight: new Map(),\n degraded: new Map(),\n order: [],\n warmed: new Map(),\n activeLocale: null,\n});\n\nconst { registry, resolved, inFlight, degraded, order, warmed } = state;\n\nfunction cacheKey(id: string, locale: string) {\n return `${id}\\0${locale}`;\n}\n\nexport function registerDictionary(entry: RegisteredDictionary) {\n // A dictionary module can be evaluated twice with the same id — e.g. the\n // Vite-processed copy pulled in by a view and the plain copy a controller\n // imports outside the bundler. Same id means same source literal, so the\n // first registration wins and the duplicate is a no-op rather than a reset\n // that would drop already-resolved strings.\n if (registry.has(entry.id)) {\n return;\n }\n registry.set(entry.id, entry);\n order.push(entry.id);\n}\n\n/** A marker for \"everything registered so far\", for `preloadDictionaries`. */\nexport function dictionaryRegistrationMark(): number {\n return order.length;\n}\n\nexport function getResolved(\n id: string,\n locale: string,\n): LocaleStrings | undefined {\n return resolved.get(id)?.get(locale);\n}\n\nfunction putResolved(id: string, locale: string, strings: LocaleStrings) {\n let byLocale = resolved.get(id);\n if (!byLocale) {\n byLocale = new Map();\n resolved.set(id, byLocale);\n }\n byLocale.set(locale, strings);\n}\n\n/**\n * Load one dictionary's locale, de-duplicating concurrent callers. Returns the\n * strings directly (not a promise) when they are already resolved, so the hook\n * can take a synchronous path without a microtask hop.\n */\nexport function loadDictionary(\n id: string,\n locale: string,\n): LocaleStrings | Promise<LocaleStrings> {\n const already = getResolved(id, locale);\n if (already) {\n return already;\n }\n\n const key = cacheKey(id, locale);\n const pending = inFlight.get(key);\n if (pending) {\n return pending;\n }\n\n const entry = registry.get(id);\n if (!entry) {\n throw new Error(\n `Unknown dictionary \"${id}\". A dictionary must be created with defineDictionary() and its module must have been evaluated before it is read.`,\n );\n }\n\n const result = entry.load(locale);\n\n // The untransformed path holds every locale in memory and answers\n // synchronously — no reason to make callers await a resolved promise.\n if (!(result instanceof Promise)) {\n putResolved(id, locale, result);\n return result;\n }\n\n const promise = result.then(\n (strings) => {\n putResolved(id, locale, strings);\n inFlight.delete(key);\n return strings;\n },\n (err) => {\n inFlight.delete(key);\n throw err;\n },\n );\n inFlight.set(key, promise);\n return promise;\n}\n\n/**\n * The same load, but as something safe to hand React's `use()`.\n *\n * A rejecting promise passed to `use()` rethrows during render, which unmounts\n * the whole route into its error boundary — or, before the shell is ready,\n * fails the server render outright. A missing locale chunk is a routine event\n * (a browser holding stale HTML after a rolling deploy requests a hashed\n * filename that no longer exists), and the deprecated `useTranslator` degraded\n * every i18n failure to rendering the raw key. This keeps that behaviour: the\n * returned promise resolves to no strings, and the per-key lookup in\n * `useDictionary` then logs and falls back to the key.\n *\n * The degraded promise is cached because `use()` requires a stable reference —\n * a fresh `.then()` per render would suspend forever. It is only consulted\n * after `getResolved` misses, so a later successful load supersedes it without\n * needing to be evicted.\n */\nexport function loadDictionaryForRender(\n id: string,\n locale: string,\n): LocaleStrings | Promise<LocaleStrings> {\n const already = getResolved(id, locale);\n if (already) {\n return already;\n }\n\n const key = cacheKey(id, locale);\n const cached = degraded.get(key);\n if (cached) {\n return cached;\n }\n\n const result = loadDictionary(id, locale);\n if (!(result instanceof Promise)) {\n return result;\n }\n\n const safe = result.then(\n (strings) => strings,\n (err) => {\n console.error(\n `Failed to load dictionary ${id} for locale ${locale}; rendering keys instead.`,\n err,\n );\n return EMPTY_STRINGS;\n },\n );\n degraded.set(key, safe);\n return safe;\n}\n\nconst EMPTY_STRINGS: LocaleStrings = {};\n\n/**\n * Warm dictionaries for `locale`, so a subsequent render reads them\n * synchronously instead of suspending.\n *\n * With a `mark` — the value taken *before* importing a view module — only that\n * view's newly announced dictionaries are loaded. That is the client's use: it\n * knows exactly which chunk just arrived.\n *\n * Without one, it resumes from where this locale last got to. The server calls\n * it per request and has no mark to give (view modules were imported long\n * before the request arrived), so a plain scan from zero would walk every\n * dictionary in the app on every request — re-deriving the per-request cost this\n * whole change exists to remove, just with a smaller constant.\n *\n * An empty `locale` means the app configured none, and each dictionary is warmed\n * under its own source language — the same key `useDictionary` will ask for, so\n * the warmed entry is the one the render actually reads.\n *\n * Failures are swallowed: a dictionary that cannot load should surface at the\n * component that actually reads it, where the error names the key, rather than\n * take down an unrelated navigation.\n */\nexport async function preloadDictionaries(locale: string, mark?: number) {\n const from = mark ?? warmed.get(locale) ?? 0;\n const ids = order.slice(from);\n if (ids.length === 0) {\n return;\n }\n\n const settled = await Promise.all(\n ids.map(async (id) => {\n try {\n await loadDictionary(id, localeFor(id, locale));\n return true;\n } catch {\n // Deliberately ignored — see above.\n return false;\n }\n }),\n );\n\n if (mark === undefined) {\n // Advanced *after* the loads settle, and only across the leading run that\n // resolved. Moving it up front — as this first did — is a correctness bug\n // twice over: a second request arriving mid-flight reads the raised mark,\n // finds an empty slice, returns immediately and then suspends on the\n // in-flight promises anyway, which is the stream fragmentation the preload\n // exists to prevent; and a swallowed failure would be marked warm and never\n // retried. Stopping at the first failure keeps \"below the watermark\" and\n // \"resolved\" the same statement.\n const firstFailure = settled.indexOf(false);\n const reached = firstFailure === -1 ? ids.length : firstFailure;\n warmed.set(locale, Math.max(warmed.get(locale) ?? 0, from + reached));\n }\n}\n\n/**\n * Which locale a given dictionary should be warmed under.\n *\n * `useDictionary` falls back to the dictionary's own source language when the\n * app has no locale configured, so the preload has to make the same choice or\n * it caches under a key no render ever reads — warming `\"\"`, then suspending on\n * `\"en-US\"` a moment later.\n */\nfunction localeFor(id: string, locale: string): string {\n if (locale) {\n return locale;\n }\n return registry.get(id)?.locales[0] ?? locale;\n}\n\n/**\n * Seed already-known strings, skipping the loader entirely. The client calls\n * this with the SSR payload before hydration so the first render matches the\n * server without a single dictionary request.\n */\nexport function seedDictionaries(\n dictionaries: Record<string, LocaleStrings> | undefined,\n locale: string,\n) {\n if (!dictionaries) {\n return;\n }\n for (const [id, strings] of Object.entries(dictionaries)) {\n putResolved(id, locale, strings);\n }\n}\n\nexport function setActiveLocale(locale: string | undefined | null) {\n if (locale) {\n state.activeLocale = locale;\n }\n}\n\nexport function getActiveLocale(): string | null {\n return state.activeLocale;\n}\n\n/**\n * Adopt strings the server streamed into the document.\n *\n * Mirrors `__GEMI_STREAM__` in `QueryManagerContext`: scripts that already ran\n * sit buffered in a plain array, and from here on `push` seeds directly. Both\n * halves are needed because dictionary scripts interleave with React's chunks —\n * a segment that reveals late carries its dictionary late too.\n *\n * Installed at module scope rather than during a render: seeding is idempotent\n * and touches no React state, and doing it here means it is already in place\n * before hydration reads anything.\n */\ntype StreamedDictionary = [id: string, locale: string, strings: LocaleStrings];\n\nif (typeof window !== \"undefined\") {\n const w = window as unknown as {\n __GEMI_DICT__?: StreamedDictionary[] | { push: (p: StreamedDictionary) => void };\n };\n const adopt = ([id, locale, strings]: StreamedDictionary) => {\n putResolved(id, locale, strings);\n };\n const buffered = Array.isArray(w.__GEMI_DICT__) ? w.__GEMI_DICT__ : [];\n w.__GEMI_DICT__ = { push: adopt };\n for (const entry of buffered) {\n adopt(entry);\n }\n}\n\n/** Test-only: drop all state so cases do not leak into one another. */\nexport function __resetDictionaryRegistry() {\n registry.clear();\n resolved.clear();\n inFlight.clear();\n degraded.clear();\n warmed.clear();\n order.length = 0;\n state.activeLocale = null;\n}\n","import type { ComponentTree } from \"../types\";\n\nexport function flattenComponentTree(componentTree: ComponentTree): string[] {\n let out: string[] = [];\n for (const [root, branches] of componentTree) {\n out.push(root, ...flattenComponentTree(branches).flat());\n }\n return Array.from(new Set(out));\n}\n","import { createContext, lazy, useMemo, type PropsWithChildren } from \"react\";\nimport {\n dictionaryRegistrationMark,\n getActiveLocale,\n preloadDictionaries,\n} from \"../i18n/dictionaryRegistry\";\nimport { flattenComponentTree } from \"./helpers/flattenComponentTree\";\nimport type { ServerDataContextValue } from \"./ServerDataProvider\";\n\ndeclare const window: {\n __GEMI_DATA__: ServerDataContextValue;\n loaders: Record<\n string,\n () => Promise<{\n default: React.ComponentType<unknown>;\n }>\n >;\n} & Window;\n\n/**\n * Resolved view modules, not just their default exports. A route segment's\n * `Suspense` fallback and error UI come from optional named exports\n * (`Loading`, `Error`), and those have to be readable synchronously\n * while rendering — so every path that loads a view chunk records the module\n * here. Browsers dedupe the underlying dynamic import, so calling\n * `loadViewModule` repeatedly is free.\n */\nconst viewModules = new Map<string, Record<string, any>>();\nconst viewModuleListeners = new Set<() => void>();\n\nexport function loadViewModule(name: string): Promise<any> {\n const loader =\n typeof window !== \"undefined\" ? window.loaders?.[name] : undefined;\n if (!loader) return Promise.resolve(null);\n // Taken before the import starts: a `defineDictionary` handle registers when\n // its module evaluates, so everything past this mark once the chunk lands is\n // exactly what this view brought with it.\n const mark = dictionaryRegistrationMark();\n return Promise.resolve(loader()).then(async (mod) => {\n const isNew = !viewModules.has(name);\n viewModules.set(name, mod);\n\n // Notify on first registration so a `Route` that rendered before its\n // module arrived re-reads it — otherwise a hard load could suspend into\n // a `null` fallback while the view's `Loading` export sits in the module.\n //\n // Before the dictionary await, not after: this exists to surface the view's\n // `Loading` export the moment it lands, and holding it behind a network\n // fetch would put back the very `null` flash it removes.\n //\n // On a cold load this fires at the worst possible moment — the boundary it\n // wakes is still suspended on the very `lazy()` this module is resolving,\n // and an update there costs the boundary its server HTML. Wrapping it in a\n // transition does not help (`hydrationBlank.test.tsx` pins that); what\n // makes it harmless is `initialViewModulesReady`, which puts the initial\n // route's modules in the registry before anything subscribes to it.\n if (isNew) {\n for (const listener of viewModuleListeners) listener();\n }\n\n // The single choke point every view chunk passes through — prefetch,\n // navigation and hydration alike — so it is where a view's dictionaries get\n // warmed. Awaited before the module is handed back, which folds the\n // dictionary fetch into the loading state the route already shows instead\n // of letting the view render and suspend a beat later.\n await preloadDictionaries(currentLocale(), mark);\n\n return mod;\n });\n}\n\nfunction currentLocale(): string {\n // `getActiveLocale` is whatever the last render used, which survives a locale\n // switch; `__GEMI_DATA__` covers the first navigation, before any\n // `useDictionary` has run.\n return (\n getActiveLocale() ??\n (typeof window !== \"undefined\"\n ? (window.__GEMI_DATA__?.i18n?.currentLocale ?? \"\")\n : \"\")\n );\n}\n\nexport function subscribeViewModules(listener: () => void) {\n viewModuleListeners.add(listener);\n return () => {\n viewModuleListeners.delete(listener);\n };\n}\n\nexport function getViewModule(name: string) {\n return viewModules.get(name);\n}\n\nlet viewImportMap: Record<string, ReturnType<typeof lazy>> | null = null;\nif (typeof window !== \"undefined\" && process.env.NODE_ENV !== \"test\") {\n viewImportMap = {};\n const { componentTree = [] } = window.__GEMI_DATA__ ?? {};\n\n for (const viewName of flattenComponentTree(componentTree)) {\n viewImportMap[viewName] = lazy(() => loadViewModule(viewName));\n }\n}\n\n/**\n * How long hydration will wait for those modules before giving up on them.\n *\n * Only a load that never *settles* reaches this — a stalled HTTP/2 stream, a\n * service worker that never answers. A rejection is already handled. Without\n * a deadline that case costs the whole document: nothing hydrates, and\n * nothing is raised. Expiring it just puts the page back on the pre-#352 path\n * for one route, which is a bad outcome and not a dead one.\n */\nconst INITIAL_VIEW_MODULES_DEADLINE_MS = 2000;\n\n/**\n * Resolves once the views the document was server-rendered with are in the\n * registry — which is what `init` waits for before it hydrates.\n *\n * Hydrating before then is what made a cold load blank its own content. The\n * server renders each route segment through a real component, so the shell\n * ships complete `<Suspense>` boundaries; the browser renders the same\n * segments through `lazy()`, so on the first client render every one of them\n * suspends. React keeps the server HTML up while a boundary is merely\n * suspended, but the moment any update reaches one — the module registry\n * announcing the chunk, an effect, a settling query — it gives up on that\n * boundary and shows the fallback instead, which for a view without a\n * `Loading` export is `null`. The page then sits with its layout and no\n * content until the chunk's `import()` and dictionaries resolve.\n *\n * What this buys is NOT a synchronous `lazy()`. `lazy` suspends on its first\n * render no matter what: the initializer calls the ctor, attaches `.then`,\n * and re-reads a status its callback only sets a microtask later, so even an\n * already-settled promise goes to `Pending` and throws. The render still\n * suspends here — it just suspends *untouched*. `loadViewModule` notifies its\n * listeners only on a view's FIRST registration, so once the module is in\n * `viewModules` the call `lazy` makes during hydration is a silent one, the\n * boundary sees no update, and React keeps the server HTML until it settles.\n *\n * The invariant to preserve, then, is \"no first registration for a mounted\n * view happens during hydration\" — not anything about how `lazy` resolves.\n * Notifying on every call, or memoizing the promise so the `isNew` guard\n * stops being the discriminator, would reintroduce the flash while leaving\n * this preload apparently intact.\n *\n * It is not free. The view chunks themselves are already `modulepreload`ed by\n * the shell, but `loadViewModule` also awaits `preloadDictionaries`, and\n * dictionary locale chunks are dynamic imports, which `collectModulePreloads`\n * deliberately leaves out of those hints. So hydration is gated on a\n * serially-discovered round trip — view chunk, parse, dictionary chunk — and\n * the layout's own handlers stay dead across it. That wait is deliberate\n * rather than incidental: a view whose dictionary is still in flight suspends\n * on `use()` inside this same boundary, which is the same blank arriving by a\n * different route. Warming the current locale's dictionaries from the shell\n * would buy the interactivity back; awaiting less here would not.\n *\n * Never rejects and never waits forever: a chunk that fails or hangs must\n * still leave the app to hydrate and surface the error through the route's\n * error boundary.\n */\nexport const initialViewModulesReady: Promise<unknown> =\n typeof window !== \"undefined\" && process.env.NODE_ENV !== \"test\"\n ? Promise.race([\n Promise.all(\n initialViewNames(window.__GEMI_DATA__).map((name) =>\n loadViewModule(name).catch(() => null),\n ),\n ),\n new Promise((resolve) =>\n setTimeout(resolve, INITIAL_VIEW_MODULES_DEADLINE_MS),\n ),\n ])\n : Promise.resolve();\n\n/**\n * The view names the server rendered this document with — the same lookup\n * `ClientRouterProvider` seeds its route state from, so the two agree on what\n * the first render is going to mount.\n */\nfunction initialViewNames(data: ServerDataContextValue | undefined): string[] {\n if (!data?.router) return [];\n if (data.router.is404) return [\"404\"];\n return data.routeManifest?.[data.router.pathname] ?? [\"404\"];\n}\n\nexport const ComponentsContext = createContext({\n viewImportMap,\n getViewModule,\n});\n\nexport const ComponentsProvider = (\n props: PropsWithChildren<{\n viewImportMap: typeof viewImportMap;\n /**\n * Server only: the fully-loaded view modules, so `Loading`/`Error`\n * exports resolve during a streaming render. The browser leaves this\n * unset and reads the registry `loadViewModule` fills instead.\n */\n modules?: Record<string, Record<string, any>>;\n }>,\n) => {\n const { modules } = props;\n const value = useMemo(\n () => ({\n viewImportMap: props.viewImportMap ?? viewImportMap,\n getViewModule: modules\n ? (name: string) => modules[name] ?? getViewModule(name)\n : getViewModule,\n }),\n [props.viewImportMap, modules],\n );\n return (\n <ComponentsContext.Provider value={value}>\n {props.children}\n </ComponentsContext.Provider>\n );\n};\n","import { type Action, type History, createBrowserHistory } from \"history\";\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n} from \"react\";\nimport { Subject } from \"../utils/Subject\";\n// @ts-ignore\nimport { URLPattern } from \"urlpattern-polyfill\";\nimport { ProgressManager } from \"./ProgressManager\";\nimport { HttpReload } from \"./HttpReload\";\nimport type { Breadcrumb } from \"./useBreadcrumbs\";\nimport type { RouteState } from \"./RouteStateContext\";\nimport { I18nContext } from \"./I18nContext\";\nimport { PrefetchCache } from \"./PrefetchCache\";\nimport { routeDataUrl } from \"./helpers/routeDataUrl\";\nimport { readSettledRoutePayload } from \"./helpers/readRoutePayload\";\nimport { loadViewModule } from \"./ComponentContext\";\n\nexport interface PrefetchTarget {\n /** Concrete pathname, without the locale segment. */\n pathname: string;\n /** Query string including the leading `?`, or empty. */\n search?: string;\n /** `/tr-TR` style prefix, or empty for the default locale. */\n localeSegment?: string;\n}\n\ndeclare global {\n interface Window {\n scrollHistory: Map<string, number>;\n }\n}\n\ninterface ClientRouterContextValue {\n viewEntriesSubject: Subject<string[]>;\n history: History | null;\n updatePageData: (\n pageData: Record<string, unknown>,\n breadcrumbs: Record<string, Breadcrumb>,\n ) => void;\n getPageData: (key: string, pathname: string) => Record<string, unknown>;\n getScrollPosition: (path: string) => number;\n getViewPathsFromPathname: (pathname: string) => string[];\n getRoutePathnameFromHref: (href: string) => string | null;\n isNavigatingSubject: Subject<boolean>;\n setNavigationAbortController: (controller: AbortController) => void;\n progressManager: ProgressManager;\n fetchRouteCSS: (routePath: string) => Promise<void>;\n preloadRouteModules: (routePath: string) => void;\n prefetchRoute: (target: PrefetchTarget) => Promise<void>;\n takePrefetched: (url: string) => Promise<unknown> | null;\n clearPrefetchCache: () => void;\n breadcrumbsCache: Map<string, Breadcrumb>;\n routerSubject: Subject<RouteState>;\n urlLocaleSegment: string | null;\n}\n\nexport const ClientRouterContext = createContext(\n {} as ClientRouterContextValue,\n);\n\ninterface ClientRouterProviderProps {\n pathname: string;\n routeManifest: Record<string, string[]>;\n cssManifest: Record<string, string[]>;\n modulePreloadManifest: Record<string, string[]>;\n pageData: Record<string, unknown>;\n currentPath: string;\n urlLocaleSegment: string | null;\n params: Record<string, string>;\n searchParams: string;\n is404: boolean;\n is500: boolean;\n breadcrumbs: Record<string, Breadcrumb>;\n}\n\nexport const ClientRouterProvider = (\n props: PropsWithChildren<ClientRouterProviderProps>,\n) => {\n const {\n children,\n pathname,\n currentPath,\n is404,\n is500,\n routeManifest,\n cssManifest,\n modulePreloadManifest,\n pageData,\n params,\n searchParams,\n breadcrumbs,\n urlLocaleSegment,\n } = props;\n const navigationAbortControllerRef = useRef(new AbortController());\n const [isNavigatingSubject] = useState(() => {\n return new Subject<boolean>(false);\n });\n\n const { supportedLocales = [], locale } = useContext(I18nContext);\n\n const [progressManager] = useState(new ProgressManager(isNavigatingSubject));\n const [prefetchCache] = useState(() => new PrefetchCache());\n const pageDataRef = useRef(structuredClone(pageData));\n const scrollHistoryRef = useRef<Map<string, number>>(new Map());\n /** Hrefs already announced; `null` until seeded from the shell's own hints. */\n const preloadedModulesRef = useRef<Set<string> | null>(null);\n const breadcrumbsCache = useRef<Map<string, Breadcrumb>>(\n new Map(Object.entries(breadcrumbs)),\n );\n\n const initalViewEntries = is404\n ? [\"404\"]\n : is500\n ? [\"500\"]\n : (routeManifest[pathname] ?? [\"404\"]);\n const viewEntriesSubject = useRef(new Subject<string[]>(initalViewEntries));\n\n const [routerSubject] = useState(() => {\n return new Subject<RouteState>({\n views: initalViewEntries,\n params,\n search: searchParams,\n state: {},\n pathname,\n hash: \"\",\n action: null as Action | null,\n routePath: currentPath,\n locale,\n });\n });\n\n const [history] = useState<History | null>(() => {\n let history: History | null = null;\n\n if (typeof window !== \"undefined\") {\n history = createBrowserHistory();\n }\n return history;\n });\n\n const findMatchingRouteFromParams = useMemo(\n () => (pathname: string) => {\n let routePath = pathname.replace(\"/en-US\", \"\").replace(\"/tr-TR\", \"\");\n routePath = routePath === \"\" ? \"/\" : routePath;\n const candidates: string[] = [];\n for (const route of Object.keys(routeManifest)) {\n const urlPattern = new URLPattern({ pathname: route });\n if (urlPattern.test({ pathname: routePath })) {\n candidates.push(route);\n }\n }\n const sortedCandidates = candidates.sort((a, b) => {\n const x = a.split(\"/\").length + a.split(\":\").length;\n const y = b.split(\"/\").length + b.split(\":\").length;\n return x - y;\n });\n\n return (sortedCandidates ?? [])[0];\n },\n [routeManifest],\n );\n\n const getViewPathsFromPathname = useMemo(\n () => (pathname: string) => {\n const route = findMatchingRouteFromParams(pathname);\n return routeManifest[route] ?? [];\n },\n [findMatchingRouteFromParams, routeManifest],\n );\n\n const getRoutePathnameFromHref = useMemo(\n () => (href: string) => {\n const route = findMatchingRouteFromParams(href);\n return route;\n },\n [findMatchingRouteFromParams],\n );\n\n const getParams = useMemo(\n () => (pathname: string) => {\n const route = findMatchingRouteFromParams(pathname);\n const urlPattern = new URLPattern({ pathname: route });\n return urlPattern.exec({ pathname })?.pathname.groups ?? {};\n },\n [findMatchingRouteFromParams],\n );\n\n useEffect(() => {\n history?.listen(({ location, action }) => {\n if (!window.scrollHistory) {\n window.scrollHistory = new Map();\n }\n const { hash, pathname, search } = routerSubject.getValue();\n const key = [pathname, search, hash].join(\"\");\n window.scrollHistory.set(key, window.scrollY);\n let _pathname = location.pathname;\n let _locale = null;\n for (const locale of supportedLocales) {\n if (_pathname.startsWith(`/${locale}`)) {\n _locale = locale;\n _pathname = _pathname.replace(`/${locale}`, \"\");\n break;\n }\n }\n _pathname = _pathname === \"\" ? \"/\" : _pathname;\n const routePath = getRoutePathnameFromHref(_pathname);\n routerSubject.next({\n views: getViewPathsFromPathname(_pathname),\n params: getParams(_pathname),\n search: location.search,\n state: location.state as Record<string, unknown>,\n pathname: _pathname,\n action,\n routePath,\n hash: location.hash,\n locale: _locale,\n });\n });\n }, [\n supportedLocales,\n history,\n routerSubject,\n getParams,\n getRoutePathnameFromHref,\n getViewPathsFromPathname,\n ]);\n\n const updatePageData = (\n newPageData: Record<string, unknown>,\n breadcrumbs: Record<string, Breadcrumb>,\n ) => {\n const [key, value] = Object.entries(newPageData)[0];\n if (!pageDataRef.current?.[key]) {\n pageDataRef.current[key] = {};\n }\n for (const b in breadcrumbs) {\n breadcrumbsCache.current.set(b, breadcrumbs[b]);\n }\n\n pageDataRef.current[key] = value;\n };\n\n const getPageData = (key: string, pathname: string) => {\n return pageDataRef.current[pathname]?.[key];\n };\n\n const setNavigationAbortController = (controller: AbortController) => {\n navigationAbortControllerRef.current.abort();\n navigationAbortControllerRef.current = controller;\n };\n\n const fetchRouteCSS = async (routePath: string) => {\n const views = routeManifest[routePath];\n if (!views) {\n return;\n }\n const cssFiles = views\n .flatMap((view) => {\n return cssManifest?.[view];\n })\n .filter(Boolean)\n .filter((file) => !document.getElementById(file));\n\n if (cssFiles.length === 0) {\n return;\n }\n\n async function fetchCSS(path: string) {\n const response = await fetch(`/${path}`);\n const content = response.text();\n return {\n content,\n id: path,\n };\n }\n const result = await Promise.all(cssFiles?.map((file) => fetchCSS(file)));\n for (const { content, id } of result) {\n const style = document.createElement(\"style\");\n style.id = id;\n style.textContent = await content;\n document.head.appendChild(style);\n }\n };\n\n /**\n * Announces every chunk a navigation to `routePath` will import.\n *\n * `loadViewModule` starts each view's own chunk, but a chunk's static\n * imports are discoverable only once it has arrived and parsed — so a\n * `layout -> view -> components` route still costs a round trip per level on\n * every navigation, holding the transition open for exactly the interval the\n * shell's head hints remove from the first load (#352). These are the same\n * per-view lists the shell renders, shipped in the document payload.\n *\n * `modulepreload` rather than `import()`: it fills the HTTP cache without\n * evaluating anything, so warming a link that is never clicked costs a\n * download and no side effects.\n */\n const preloadRouteModules = (routePath: string) => {\n if (typeof document === \"undefined\") {\n return;\n }\n if (!preloadedModulesRef.current) {\n // Seeded from the document because the shell already announced the\n // landing route's chunks — re-announcing them would append dead\n // <link> elements on every navigation back to it.\n preloadedModulesRef.current = new Set(\n Array.from(\n document.querySelectorAll('link[rel=\"modulepreload\"]'),\n (link) => link.getAttribute(\"href\") ?? \"\",\n ),\n );\n }\n const preloaded = preloadedModulesRef.current;\n\n for (const view of routeManifest[routePath] ?? []) {\n for (const href of modulePreloadManifest?.[view] ?? []) {\n if (preloaded.has(href)) {\n continue;\n }\n preloaded.add(href);\n const link = document.createElement(\"link\");\n link.rel = \"modulepreload\";\n link.href = href;\n document.head.appendChild(link);\n }\n }\n };\n\n /**\n * Warms everything a navigation to `target` would need: the route's page\n * data, its stylesheets and its component chunks.\n *\n * The payload is requested *without* the partial-render header, because the\n * route on screen when the link is prefetched is not necessarily the one it\n * will be clicked from — a partial response computed against the wrong base\n * has nothing sound to merge onto. A full payload is always safe to commit.\n *\n * It carries `Purpose: prefetch` so applications can tell speculative traffic\n * from a real visit — a route's handlers run either way, and a `viewport`\n * page multiplies that by the number of links on it.\n */\n const prefetchRoute = async (target: PrefetchTarget) => {\n if (typeof window === \"undefined\") {\n return;\n }\n const { pathname, search = \"\", localeSegment = \"\" } = target;\n const routePath = getRoutePathnameFromHref(pathname);\n if (!routePath) {\n return;\n }\n\n const url = routeDataUrl({ pathname, search, localeSegment });\n\n // Alongside the payload rather than joined to it: a stylesheet that 404s\n // must not throw away page data that arrived perfectly well.\n fetchRouteCSS(routePath).catch(() => {});\n preloadRouteModules(routePath);\n // Through `loadViewModule` so each view's `Loading`/`Error`\n // exports are registered by the time the route commits.\n for (const view of routeManifest[routePath] ?? []) {\n loadViewModule(view);\n }\n\n await prefetchCache.prime(url, async () => {\n const response = await fetch(url, {\n headers: { Purpose: \"prefetch\" },\n });\n if (!response.ok) {\n return null;\n }\n // The settled aggregate: every streamed query result merged back into\n // the envelope's `prefetchedData` — a warmed payload is stored whole,\n // exactly as the blocking response used to arrive (#290).\n return await readSettledRoutePayload(response);\n });\n };\n\n return (\n <ClientRouterContext.Provider\n value={{\n isNavigatingSubject,\n prefetchRoute,\n takePrefetched: (url: string) => prefetchCache.take(url),\n clearPrefetchCache: () => prefetchCache.clear(),\n getViewPathsFromPathname,\n history,\n getScrollPosition: (path: string) => {\n return scrollHistoryRef.current.get(path) || 0;\n },\n viewEntriesSubject: viewEntriesSubject.current,\n updatePageData,\n getPageData,\n getRoutePathnameFromHref,\n setNavigationAbortController,\n progressManager,\n fetchRouteCSS,\n preloadRouteModules,\n breadcrumbsCache: breadcrumbsCache.current,\n routerSubject,\n urlLocaleSegment,\n }}\n >\n {children}\n {/* @ts-ignore */}\n {import.meta.hot && <HttpReload />}\n </ClientRouterContext.Provider>\n );\n};\n","import { createContext, useContext, type PropsWithChildren } from \"react\";\n\nconst RouteTransitionContext = createContext<{\n isTransitioning: boolean;\n targetPath: string;\n currentPath: string;\n}>({\n isTransitioning: false,\n targetPath: \"\",\n currentPath: \"\",\n});\n\ninterface RouteTransitionProviderProps {\n isPending: boolean;\n isFetching: boolean;\n transitionPath: [string, string];\n}\n\nexport const RouteTransitionProvider = (\n props: PropsWithChildren<RouteTransitionProviderProps>,\n) => {\n const { isPending, isFetching, transitionPath } = props;\n\n return (\n <RouteTransitionContext.Provider\n value={{\n isTransitioning: isPending || isFetching,\n targetPath: transitionPath[1],\n currentPath: transitionPath[0] || \"\",\n }}\n >\n {props.children}\n </RouteTransitionContext.Provider>\n );\n};\n\nexport function useRouteTransition() {\n const context = useContext(RouteTransitionContext);\n if (!context) {\n throw new Error(\n \"useRouteTransition must be used within a RouteTransitionProvider\",\n );\n }\n return context;\n}\n","\"use client\";\nimport { createContext as l, Component as y, createElement as d, useContext as f, useState as p, useMemo as E, forwardRef as B } from \"react\";\nconst h = l(null), c = {\n didCatch: !1,\n error: null\n};\nclass m extends y {\n constructor(e) {\n super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = c;\n }\n static getDerivedStateFromError(e) {\n return { didCatch: !0, error: e };\n }\n resetErrorBoundary(...e) {\n const { error: t } = this.state;\n t !== null && (this.props.onReset?.({\n args: e,\n reason: \"imperative-api\"\n }), this.setState(c));\n }\n componentDidCatch(e, t) {\n this.props.onError?.(e, t);\n }\n componentDidUpdate(e, t) {\n const { didCatch: o } = this.state, { resetKeys: s } = this.props;\n o && t.error !== null && C(e.resetKeys, s) && (this.props.onReset?.({\n next: s,\n prev: e.resetKeys,\n reason: \"keys\"\n }), this.setState(c));\n }\n render() {\n const { children: e, fallbackRender: t, FallbackComponent: o, fallback: s } = this.props, { didCatch: n, error: a } = this.state;\n let i = e;\n if (n) {\n const u = {\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof t == \"function\")\n i = t(u);\n else if (o)\n i = d(o, u);\n else if (s !== void 0)\n i = s;\n else\n throw a;\n }\n return d(\n h.Provider,\n {\n value: {\n didCatch: n,\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n }\n },\n i\n );\n }\n}\nfunction C(r = [], e = []) {\n return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));\n}\nfunction g(r) {\n return r !== null && typeof r == \"object\" && \"didCatch\" in r && typeof r.didCatch == \"boolean\" && \"error\" in r && \"resetErrorBoundary\" in r && typeof r.resetErrorBoundary == \"function\";\n}\nfunction x(r) {\n if (!g(r))\n throw new Error(\"ErrorBoundaryContext not found\");\n}\nfunction k() {\n const r = f(h);\n x(r);\n const { error: e, resetErrorBoundary: t } = r, [o, s] = p({\n error: null,\n hasError: !1\n }), n = E(\n () => ({\n error: e,\n resetBoundary: () => {\n t(), s({ error: null, hasError: !1 });\n },\n showBoundary: (a) => s({\n error: a,\n hasError: !0\n })\n }),\n [e, t]\n );\n if (o.hasError)\n throw o.error;\n return n;\n}\nfunction S(r) {\n switch (typeof r) {\n case \"object\": {\n if (r !== null && \"message\" in r && typeof r.message == \"string\")\n return r.message;\n break;\n }\n case \"string\":\n return r;\n }\n}\nfunction w(r, e) {\n const t = B(\n (s, n) => d(\n m,\n e,\n d(r, { ...s, ref: n })\n )\n ), o = r.displayName || r.name || \"Unknown\";\n return t.displayName = `withErrorBoundary(${o})`, t;\n}\nexport {\n m as ErrorBoundary,\n h as ErrorBoundaryContext,\n S as getErrorMessage,\n k as useErrorBoundary,\n w as withErrorBoundary\n};\n//# sourceMappingURL=react-error-boundary.js.map\n","import {\n createContext,\n type PropsWithChildren,\n useEffect,\n useRef,\n} from \"react\";\n\ntype Subscribe = (\n topic: string,\n handler: (event: any) => void,\n) => Promise<void>;\n\nexport const WebSocketContext = createContext(\n {} as {\n broadcast: (topic: string, payload: Record<string, any>) => void;\n subscribe: Subscribe;\n unsubscribe: (\n topic: string,\n handler: (event: any) => void,\n ) => Promise<void>;\n },\n);\n\nexport const WebSocketContextProvider = (props: PropsWithChildren) => {\n const wsRef = useRef<WebSocket>(null);\n\n function getWS() {\n return new Promise<WebSocket>((resolve) => {\n if (wsRef.current) {\n resolve(wsRef.current);\n } else {\n const ws = new WebSocket(\"ws://localhost:5173/\");\n ws.onopen = () => {\n wsRef.current = ws;\n console.log(\"ws opened\");\n ws.addEventListener(\"close\", () => {\n console.log(\"ws closed\");\n wsRef.current = null;\n });\n resolve(ws);\n };\n }\n });\n }\n\n const subscribe = async (\n topic: string,\n handler: (event: MessageEvent<any>) => void,\n ) => {\n const ws = await getWS();\n ws.send(JSON.stringify({ type: \"subscribe\", topic }));\n ws.addEventListener(\"message\", handler);\n };\n\n const unsubscribe = async (\n topic: string,\n handler: (event: MessageEvent<any>) => void,\n ) => {\n const ws = await getWS();\n ws.send(JSON.stringify({ type: \"unsubscribe\", topic }));\n ws.removeEventListener(\"message\", handler);\n };\n\n const broadcast = async (topic: string, payload = {}) => {\n const ws = await getWS();\n ws.send(\n JSON.stringify({\n type: \"broadcast\",\n topic,\n payload,\n }),\n );\n };\n\n useEffect(() => {\n return () => {\n if (wsRef.current) {\n wsRef.current.close();\n wsRef.current = null;\n }\n };\n }, []);\n\n return (\n <WebSocketContext.Provider value={{ subscribe, unsubscribe, broadcast }}>\n {props.children}\n </WebSocketContext.Provider>\n );\n};\n","import {\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useState,\n} from \"react\";\n\ntype Theme = \"light\" | \"dark\" | \"system\";\n\nconst ThemeContext = createContext({\n theme: \"light\" as Theme,\n setTheme: (theme: Theme) => {}, // Function to set the theme\n});\n\nfunction storeTheme(theme: string) {\n try {\n localStorage.setItem(\"theme\", theme);\n } catch (error) {\n console.error(\"Failed to store theme in localStorage:\", error);\n }\n}\n\nexport const ThemeProvider = (props: {\n children: ReactNode;\n /**\n * The theme to start on, ahead of the stored one. The app leaves this unset —\n * a visitor's choice lives in `localStorage` — but a test has no browser\n * session to have made that choice in, so `gemi/testing`'s `<Page>` passes\n * it through to render a component in a theme without writing to storage.\n */\n theme?: Theme;\n}) => {\n const [theme, setTheme] = useState(() => {\n if (props.theme) {\n return props.theme;\n }\n if (typeof window === \"undefined\") {\n return \"light\"; // Default theme for server-side rendering\n }\n return localStorage.getItem(\"theme\") || \"light\";\n });\n\n useEffect(() => {\n if (theme === \"system\") {\n window\n .matchMedia(\"(prefers-color-scheme: dark)\")\n .addEventListener(\"change\", ({ matches }) => {\n document.documentElement.classList.remove(\"light\", \"dark\");\n document.documentElement.classList.add(matches ? \"dark\" : \"light\");\n });\n }\n }, [theme]);\n\n return (\n <ThemeContext.Provider\n value={{\n theme: theme as Theme,\n setTheme: (newTheme: Theme) => {\n setTheme(newTheme);\n storeTheme(newTheme);\n\n let documentTheme = newTheme as Theme;\n if (newTheme === \"system\") {\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\");\n documentTheme = media.matches ? \"dark\" : \"light\";\n }\n document.documentElement.classList.remove(\"light\", \"dark\");\n document.documentElement.classList.add(documentTheme);\n },\n }}\n >\n {props.children}\n </ThemeContext.Provider>\n );\n};\n\nexport function useTheme() {\n const context = useContext(ThemeContext);\n if (!context) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n\n return context;\n}\n"],"x_google_ignoreList":[9,10,11,12,30],"mappings":";;;;AAAA,IAAa,UAAb,MAAwB;CACtB,8BAAc,IAAI,IAAwB;CAC1C;CAEA,YAAY,cAAiB;EAC3B,KAAK,QAAQ;EAcb,KAAK,YAAY,KAAK,UAAU,KAAK,IAAI;EACzC,KAAK,OAAO,KAAK,KAAK,KAAK,IAAI;EAC/B,KAAK,WAAW,KAAK,SAAS,KAAK,IAAI;CACzC;CAEA,UAAiB,YAAgC;EAC/C,KAAK,YAAY,IAAI,UAAU;EAC/B,aAAa;GACX,KAAK,YAAY,OAAO,UAAU;EACpC;CACF;CAEA,KAAY,OAAU;EACpB,KAAK,QAAQ;EACb,KAAK,YAAY,SAAS,eAAe,WAAW,KAAK,CAAC;CAC5D;CAEA,WAAkB;EAChB,OAAO,KAAK;CACd;AACF;;;;;;;;AClCA,IAAa,aAAb,cAAgC,MAAM;CAE3B;CACA;CACA;CACA;CAJT,YACE,MACA,YACA,QACA,MACA;EACA,MACE,OAAO,MAAM,YAAY,WACrB,KAAK,UACL,kBAAkB,KAAK,sBAAsB,QACnD;EATO,KAAA,OAAA;EACA,KAAA,aAAA;EACA,KAAA,SAAA;EACA,KAAA,OAAA;EAOP,KAAK,OAAO;CACd;AACF;;;ACCA,IAAa,qBAAqB;AAElC,IAAa,gBAAb,MAA2B;CACzB;CACA,gCAAgB,IAAI,IAAY;CAChC,k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