import { i as __require, o as __toESM, t as __commonJSMin } from "../../_runtime.mjs"; import { h as require_react, m as require_jsx_runtime } from "../react+tanstack__react-query.mjs"; import { r as parseHref } from "../tanstack__history.mjs"; import { PassThrough, Readable } from "node:stream"; import { ReadableStream as ReadableStream$1 } from "node:stream/web"; //#region node_modules/@tanstack/react-router/dist/esm/utils.js var import_react = /* @__PURE__ */ __toESM(require_react(), 1); /** * React.use if available (React 19+), undefined otherwise. * Use dynamic lookup to avoid Webpack compilation errors with React 18. */ var reactUse = import_react.use; typeof window !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect; /** * React hook to wrap `IntersectionObserver`. * * This hook will create an `IntersectionObserver` and observe the ref passed to it. * * When the intersection changes, the callback will be called with the `IntersectionObserverEntry`. * * @param ref - The ref to observe * @param intersectionObserverOptions - The options to pass to the IntersectionObserver * @param options - The options to pass to the hook * @param callback - The callback to call when the intersection changes * @returns The IntersectionObserver instance * @example * ```tsx * const MyComponent = () => { * const ref = React.useRef(null) * useIntersectionObserver( * ref, * (entry) => { doSomething(entry) }, * { rootMargin: '10px' }, * { disabled: false } * ) * return
* ``` */ function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) { import_react.useEffect(() => { if (!ref.current || options.disabled || typeof IntersectionObserver !== "function") return; const observer = new IntersectionObserver(([entry]) => { callback(entry); }, intersectionObserverOptions); observer.observe(ref.current); return () => { observer.disconnect(); }; }, [ callback, intersectionObserverOptions, options.disabled, ref ]); } /** * React hook to take a `React.ForwardedRef` and returns a `ref` that can be used on a DOM element. * * @param ref - The forwarded ref * @returns The inner ref returned by `useRef` * @example * ```tsx * const MyComponent = React.forwardRef((props, ref) => { * const innerRef = useForwardedRef(ref) * return
* }) * ``` */ function useForwardedRef(ref) { const innerRef = import_react.useRef(null); import_react.useImperativeHandle(ref, () => innerRef.current, []); return innerRef; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/utils.js /** * Return the last element of an array. * Intended for non-empty arrays used within router internals. */ function last(arr) { return arr[arr.length - 1]; } function isFunction(d) { return typeof d === "function"; } /** * Apply a value-or-updater to a previous value. * Accepts either a literal value or a function of the previous value. */ function functionalUpdate(updater, previous) { if (isFunction(updater)) return updater(previous); return updater; } var hasOwn = Object.prototype.hasOwnProperty; function hasKeys(obj) { for (const key in obj) if (hasOwn.call(obj, key)) return true; return false; } var createNull = () => Object.create(null); var nullReplaceEqualDeep = (prev, next) => replaceEqualDeep(prev, next, createNull); /** * This function returns `prev` if `_next` is deeply equal. * If not, it will replace any deeply equal children of `b` with those of `a`. * This can be used for structural sharing between immutable JSON values for example. * Do not use this with signals */ function replaceEqualDeep(prev, _next, _makeObj = () => ({}), _depth = 0) { return _next; } function isPlainObject(o) { if (!hasObjectPrototype(o)) return false; const ctor = o.constructor; if (typeof ctor === "undefined") return true; const prot = ctor.prototype; if (!hasObjectPrototype(prot)) return false; if (!prot.hasOwnProperty("isPrototypeOf")) return false; return true; } function hasObjectPrototype(o) { return Object.prototype.toString.call(o) === "[object Object]"; } /** * Perform a deep equality check with options for partial comparison and * ignoring `undefined` values. Optimized for router state comparisons. */ function deepEqual(a, b, opts) { if (a === b) return true; if (typeof a !== typeof b) return false; if (Array.isArray(a) && Array.isArray(b)) { if (a.length !== b.length) return false; for (let i = 0, l = a.length; i < l; i++) if (!deepEqual(a[i], b[i], opts)) return false; return true; } if (isPlainObject(a) && isPlainObject(b)) { const ignoreUndefined = opts?.ignoreUndefined ?? true; if (opts?.partial) { for (const k in b) if (!ignoreUndefined || b[k] !== void 0) { if (!deepEqual(a[k], b[k], opts)) return false; } return true; } let aCount = 0; if (!ignoreUndefined) aCount = Object.keys(a).length; else for (const k in a) if (a[k] !== void 0) aCount++; let bCount = 0; for (const k in b) if (!ignoreUndefined || b[k] !== void 0) { bCount++; if (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false; } return aCount === bCount; } return false; } /** * Create a promise with exposed resolve/reject and status fields. * Useful for coordinating async router lifecycle operations. */ function createControlledPromise(onResolve) { let resolveLoadPromise; let rejectLoadPromise; const controlledPromise = new Promise((resolve, reject) => { resolveLoadPromise = resolve; rejectLoadPromise = reject; }); controlledPromise.status = "pending"; controlledPromise.resolve = (value) => { controlledPromise.status = "resolved"; controlledPromise.value = value; resolveLoadPromise(value); onResolve?.(value); }; controlledPromise.reject = (e) => { controlledPromise.status = "rejected"; rejectLoadPromise(e); }; return controlledPromise; } /** * Heuristically detect dynamic import "module not found" errors * across major browsers for lazy route component handling. */ function isModuleNotFoundError(error) { if (typeof error?.message !== "string") return false; return error.message.startsWith("Failed to fetch dynamically imported module") || error.message.startsWith("error loading dynamically imported module") || error.message.startsWith("Importing a module script failed"); } function isPromise(value) { return Boolean(value && typeof value === "object" && typeof value.then === "function"); } /** * Remove control characters that can cause open redirect vulnerabilities. * Characters like \r (CR) and \n (LF) can trick URL parsers into interpreting * paths like "/\r/evil.com" as "http://evil.com". */ function sanitizePathSegment(segment) { return segment.replace(/[\x00-\x1f\x7f]/g, ""); } function decodeSegment(segment) { let decoded; try { decoded = decodeURI(segment); } catch { decoded = segment.replaceAll(/%[0-9A-F]{2}/gi, (match) => { try { return decodeURI(match); } catch { return match; } }); } return sanitizePathSegment(decoded); } /** * Default list of URL protocols to allow in links, redirects, and navigation. * Any absolute URL protocol not in this list is treated as dangerous by default. */ var DEFAULT_PROTOCOL_ALLOWLIST = [ "http:", "https:", "mailto:", "tel:" ]; /** * Check if a URL string uses a protocol that is not in the allowlist. * Returns true for blocked protocols like javascript:, blob:, data:, etc. * * The URL constructor correctly normalizes: * - Mixed case (JavaScript: → javascript:) * - Whitespace/control characters (java\nscript: → javascript:) * - Leading whitespace * * For relative URLs (no protocol), returns false (safe). * * @param url - The URL string to check * @param allowlist - Set of protocols to allow * @returns true if the URL uses a protocol that is not allowed */ function isDangerousProtocol(url, allowlist) { if (!url) return false; try { const parsed = new URL(url); return !allowlist.has(parsed.protocol); } catch { return false; } } var HTML_ESCAPE_LOOKUP = { "&": "\\u0026", ">": "\\u003e", "<": "\\u003c", "\u2028": "\\u2028", "\u2029": "\\u2029" }; var HTML_ESCAPE_REGEX = /[&><\u2028\u2029]/g; /** * Escape HTML special characters in a string to prevent XSS attacks * when embedding strings in script tags during SSR. * * This is essential for preventing XSS vulnerabilities when user-controlled * content is embedded in inline scripts. */ function escapeHtml(str) { return str.replace(HTML_ESCAPE_REGEX, (match) => HTML_ESCAPE_LOOKUP[match]); } function decodePath(path) { if (!path) return { path, handledProtocolRelativeURL: false }; if (!/[%\\\x00-\x1f\x7f]/.test(path) && !path.startsWith("//")) return { path, handledProtocolRelativeURL: false }; const re = /%25|%5C/gi; let cursor = 0; let result = ""; let match; while (null !== (match = re.exec(path))) { result += decodeSegment(path.slice(cursor, match.index)) + match[0]; cursor = re.lastIndex; } result = result + decodeSegment(cursor ? path.slice(cursor) : path); let handledProtocolRelativeURL = false; if (result.startsWith("//")) { handledProtocolRelativeURL = true; result = "/" + result.replace(/^\/+/, ""); } return { path: result, handledProtocolRelativeURL }; } /** * Encodes a path the same way `new URL()` would, but without the overhead of full URL parsing. * * This function encodes: * - Whitespace characters (spaces → %20, tabs → %09, etc.) * - Non-ASCII/Unicode characters (emojis, accented characters, etc.) * * It preserves: * - Already percent-encoded sequences (won't double-encode %2F, %25, etc.) * - ASCII special characters valid in URL paths (@, $, &, +, etc.) * - Forward slashes as path separators * * Used to generate proper href values for SSR without constructing URL objects. * * @example * encodePathLikeUrl('/path/file name.pdf') // '/path/file%20name.pdf' * encodePathLikeUrl('/path/日本語') // '/path/%E6%97%A5%E6%9C%AC%E8%AA%9E' * encodePathLikeUrl('/path/already%20encoded') // '/path/already%20encoded' (preserved) */ function encodePathLikeUrl(path) { if (!/\s|[^\u0000-\u007F]/.test(path)) return path; return path.replace(/\s|[^\u0000-\u007F]/gu, encodeURIComponent); } function arraysEqual(a, b) { if (a === b) return true; if (a.length !== b.length) return false; for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false; return true; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/invariant.js function invariant() { throw new Error("Invariant failed"); } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/lru-cache.js function createLRUCache(max) { const cache = /* @__PURE__ */ new Map(); let oldest; let newest; const touch = (entry) => { if (!entry.next) return; if (!entry.prev) { entry.next.prev = void 0; oldest = entry.next; entry.next = void 0; if (newest) { entry.prev = newest; newest.next = entry; } } else { entry.prev.next = entry.next; entry.next.prev = entry.prev; entry.next = void 0; if (newest) { newest.next = entry; entry.prev = newest; } } newest = entry; }; return { get(key) { const entry = cache.get(key); if (!entry) return void 0; touch(entry); return entry.value; }, set(key, value) { if (cache.size >= max && oldest) { const toDelete = oldest; cache.delete(toDelete.key); if (toDelete.next) { oldest = toDelete.next; toDelete.next.prev = void 0; } if (toDelete === newest) newest = void 0; } const existing = cache.get(key); if (existing) { existing.value = value; touch(existing); } else { const entry = { key, value, prev: newest }; if (newest) newest.next = entry; newest = entry; if (!oldest) oldest = entry; cache.set(key, entry); } }, clear() { cache.clear(); oldest = void 0; newest = void 0; } }; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.js var SEGMENT_TYPE_INDEX = 4; var SEGMENT_TYPE_PATHLESS = 5; function getOpenAndCloseBraces(part) { const openBrace = part.indexOf("{"); if (openBrace === -1) return null; const closeBrace = part.indexOf("}", openBrace); if (closeBrace === -1) return null; if (openBrace + 1 >= part.length) return null; return [openBrace, closeBrace]; } /** * Populates the `output` array with the parsed representation of the given `segment` string. * * Usage: * ```ts * let output * let cursor = 0 * while (cursor < path.length) { * output = parseSegment(path, cursor, output) * const end = output[5] * cursor = end + 1 * ``` * * `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed * or initialized, it will be done automatically. */ function parseSegment(path, start, output = new Uint16Array(6)) { const next = path.indexOf("/", start); const end = next === -1 ? path.length : next; const part = path.substring(start, end); if (!part || !part.includes("$")) { output[0] = 0; output[1] = start; output[2] = start; output[3] = end; output[4] = end; output[5] = end; return output; } if (part === "$") { const total = path.length; output[0] = 2; output[1] = start; output[2] = start; output[3] = total; output[4] = total; output[5] = total; return output; } if (part.charCodeAt(0) === 36) { output[0] = 1; output[1] = start; output[2] = start + 1; output[3] = end; output[4] = end; output[5] = end; return output; } const braces = getOpenAndCloseBraces(part); if (braces) { const [openBrace, closeBrace] = braces; const firstChar = part.charCodeAt(openBrace + 1); if (firstChar === 45) { if (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) { const paramStart = openBrace + 3; const paramEnd = closeBrace; if (paramStart < paramEnd) { output[0] = 3; output[1] = start + openBrace; output[2] = start + paramStart; output[3] = start + paramEnd; output[4] = start + closeBrace + 1; output[5] = end; return output; } } } else if (firstChar === 36) { const dollarPos = openBrace + 1; const afterDollar = openBrace + 2; if (afterDollar === closeBrace) { output[0] = 2; output[1] = start + openBrace; output[2] = start + dollarPos; output[3] = start + afterDollar; output[4] = start + closeBrace + 1; output[5] = path.length; return output; } output[0] = 1; output[1] = start + openBrace; output[2] = start + afterDollar; output[3] = start + closeBrace; output[4] = start + closeBrace + 1; output[5] = end; return output; } } output[0] = 0; output[1] = start; output[2] = start; output[3] = end; output[4] = end; output[5] = end; return output; } /** * Recursively parses the segments of the given route tree and populates a segment trie. * * @param data A reusable Uint16Array for parsing segments. (non important, we're just avoiding allocations) * @param route The current route to parse. * @param start The starting index for parsing within the route's full path. * @param node The current segment node in the trie to populate. * @param onRoute Callback invoked for each route processed. */ function parseSegments(defaultCaseSensitive, data, route, start, node, depth, onRoute) { onRoute?.(route); let cursor = start; { const path = route.fullPath ?? route.from; const length = path.length; const caseSensitive = route.options?.caseSensitive ?? defaultCaseSensitive; const parseParams = route.options?.params?.parse ?? route.options?.parseParams; while (cursor < length) { const segment = parseSegment(path, cursor, data); let nextNode; const start = cursor; const end = segment[5]; cursor = end + 1; depth++; switch (segment[0]) { case 0: { const value = path.substring(segment[2], segment[3]); if (caseSensitive) { const existingNode = node.static?.get(value); if (existingNode) nextNode = existingNode; else { node.static ??= /* @__PURE__ */ new Map(); const next = createStaticNode(route.fullPath ?? route.from); next.parent = node; next.depth = depth; nextNode = next; node.static.set(value, next); } } else { const name = value.toLowerCase(); const existingNode = node.staticInsensitive?.get(name); if (existingNode) nextNode = existingNode; else { node.staticInsensitive ??= /* @__PURE__ */ new Map(); const next = createStaticNode(route.fullPath ?? route.from); next.parent = node; next.depth = depth; nextNode = next; node.staticInsensitive.set(name, next); } } break; } case 1: { const prefix_raw = path.substring(start, segment[1]); const suffix_raw = path.substring(segment[4], end); const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw); const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase(); const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase(); const existingNode = !parseParams && node.dynamic?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix); if (existingNode) nextNode = existingNode; else { const next = createDynamicNode(1, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix); nextNode = next; next.depth = depth; next.parent = node; node.dynamic ??= []; node.dynamic.push(next); } break; } case 3: { const prefix_raw = path.substring(start, segment[1]); const suffix_raw = path.substring(segment[4], end); const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw); const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase(); const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase(); const existingNode = !parseParams && node.optional?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix); if (existingNode) nextNode = existingNode; else { const next = createDynamicNode(3, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix); nextNode = next; next.parent = node; next.depth = depth; node.optional ??= []; node.optional.push(next); } break; } case 2: { const prefix_raw = path.substring(start, segment[1]); const suffix_raw = path.substring(segment[4], end); const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw); const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase(); const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase(); const next = createDynamicNode(2, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix); nextNode = next; next.parent = node; next.depth = depth; node.wildcard ??= []; node.wildcard.push(next); } } node = nextNode; } if (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf("/") + 1) === 95) { const pathlessNode = createStaticNode(route.fullPath ?? route.from); pathlessNode.kind = SEGMENT_TYPE_PATHLESS; pathlessNode.parent = node; depth++; pathlessNode.depth = depth; node.pathless ??= []; node.pathless.push(pathlessNode); node = pathlessNode; } const isLeaf = (route.path || !route.children) && !route.isRoot; if (isLeaf && path.endsWith("/")) { const indexNode = createStaticNode(route.fullPath ?? route.from); indexNode.kind = SEGMENT_TYPE_INDEX; indexNode.parent = node; depth++; indexNode.depth = depth; node.index = indexNode; node = indexNode; } node.parse = parseParams ?? null; if (isLeaf && !node.route) { node.route = route; node.fullPath = route.fullPath ?? route.from; } } if (route.children) for (const child of route.children) parseSegments(defaultCaseSensitive, data, child, cursor, node, depth, onRoute); } function sortDynamic(a, b) { if (a.parse && !b.parse) return -1; if (!a.parse && b.parse) return 1; if (a.prefix && b.prefix && a.prefix !== b.prefix) { if (a.prefix.startsWith(b.prefix)) return -1; if (b.prefix.startsWith(a.prefix)) return 1; } if (a.suffix && b.suffix && a.suffix !== b.suffix) { if (a.suffix.endsWith(b.suffix)) return -1; if (b.suffix.endsWith(a.suffix)) return 1; } if (a.prefix && !b.prefix) return -1; if (!a.prefix && b.prefix) return 1; if (a.suffix && !b.suffix) return -1; if (!a.suffix && b.suffix) return 1; if (a.caseSensitive && !b.caseSensitive) return -1; if (!a.caseSensitive && b.caseSensitive) return 1; return 0; } function sortTreeNodes(node) { if (node.pathless) for (const child of node.pathless) sortTreeNodes(child); if (node.static) for (const child of node.static.values()) sortTreeNodes(child); if (node.staticInsensitive) for (const child of node.staticInsensitive.values()) sortTreeNodes(child); if (node.dynamic?.length) { node.dynamic.sort(sortDynamic); for (const child of node.dynamic) sortTreeNodes(child); } if (node.optional?.length) { node.optional.sort(sortDynamic); for (const child of node.optional) sortTreeNodes(child); } if (node.wildcard?.length) { node.wildcard.sort(sortDynamic); for (const child of node.wildcard) sortTreeNodes(child); } } function createStaticNode(fullPath) { return { kind: 0, depth: 0, pathless: null, index: null, static: null, staticInsensitive: null, dynamic: null, optional: null, wildcard: null, route: null, fullPath, parent: null, parse: null }; } /** * Keys must be declared in the same order as in `SegmentNode` type, * to ensure they are represented as the same object class in the engine. */ function createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) { return { kind, depth: 0, pathless: null, index: null, static: null, staticInsensitive: null, dynamic: null, optional: null, wildcard: null, route: null, fullPath, parent: null, parse: null, caseSensitive, prefix, suffix }; } function processRouteMasks(routeList, processedTree) { const segmentTree = createStaticNode("/"); const data = new Uint16Array(6); for (const route of routeList) parseSegments(false, data, route, 1, segmentTree, 0); sortTreeNodes(segmentTree); processedTree.masksTree = segmentTree; processedTree.flatCache = createLRUCache(1e3); } /** * Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it. */ function findFlatMatch(path, processedTree) { path ||= "/"; const cached = processedTree.flatCache.get(path); if (cached) return cached; const result = findMatch(path, processedTree.masksTree); processedTree.flatCache.set(path, result); return result; } /** * @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree */ function findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) { from ||= "/"; path ||= "/"; const key = caseSensitive ? `case\0${from}` : from; let tree = processedTree.singleCache.get(key); if (!tree) { tree = createStaticNode("/"); parseSegments(caseSensitive, new Uint16Array(6), { from }, 1, tree, 0); processedTree.singleCache.set(key, tree); } return findMatch(path, tree, fuzzy); } function findRouteMatch(path, processedTree, fuzzy = false) { const key = fuzzy ? path : `nofuzz\0${path}`; const cached = processedTree.matchCache.get(key); if (cached !== void 0) return cached; path ||= "/"; let result; try { result = findMatch(path, processedTree.segmentTree, fuzzy); } catch (err) { if (err instanceof URIError) result = null; else throw err; } if (result) result.branch = buildRouteBranch(result.route); processedTree.matchCache.set(key, result); return result; } /** Trim trailing slashes (except preserving root '/'). */ function trimPathRight$1(path) { return path === "/" ? path : path.replace(/\/{1,}$/, ""); } /** * Processes a route tree into a segment trie for efficient path matching. * Also builds lookup maps for routes by ID and by trimmed full path. */ function processRouteTree(routeTree, caseSensitive = false, initRoute) { const segmentTree = createStaticNode(routeTree.fullPath); const data = new Uint16Array(6); const routesById = {}; const routesByPath = {}; let index = 0; parseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, (route) => { initRoute?.(route, index); if (route.id in routesById) invariant(); routesById[route.id] = route; if (index !== 0 && route.path) { const trimmedFullPath = trimPathRight$1(route.fullPath); if (!routesByPath[trimmedFullPath] || route.fullPath.endsWith("/")) routesByPath[trimmedFullPath] = route; } index++; }); sortTreeNodes(segmentTree); return { processedTree: { segmentTree, singleCache: createLRUCache(1e3), matchCache: createLRUCache(1e3), flatCache: null, masksTree: null }, routesById, routesByPath }; } function findMatch(path, segmentTree, fuzzy = false) { const parts = path.split("/"); const leaf = getNodeMatch(path, parts, segmentTree, fuzzy); if (!leaf) return null; const [rawParams] = extractParams(path, parts, leaf); return { route: leaf.node.route, rawParams }; } /** * This function is "resumable": * - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call * - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off * * Inputs are *not* mutated. */ function extractParams(path, parts, leaf) { const list = buildBranch(leaf.node); let nodeParts = null; const rawParams = Object.create(null); /** which segment of the path we're currently processing */ let partIndex = leaf.extract?.part ?? 0; /** which node of the route tree branch we're currently processing */ let nodeIndex = leaf.extract?.node ?? 0; /** index of the 1st character of the segment we're processing in the path string */ let pathIndex = leaf.extract?.path ?? 0; /** which fullPath segment we're currently processing */ let segmentCount = leaf.extract?.segment ?? 0; for (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) { const node = list[nodeIndex]; if (node.kind === SEGMENT_TYPE_INDEX) break; if (node.kind === SEGMENT_TYPE_PATHLESS) { segmentCount--; partIndex--; pathIndex--; continue; } const part = parts[partIndex]; const currentPathIndex = pathIndex; if (part) pathIndex += part.length; if (node.kind === 1) { nodeParts ??= leaf.node.fullPath.split("/"); const nodePart = nodeParts[segmentCount]; const preLength = node.prefix?.length ?? 0; if (nodePart.charCodeAt(preLength) === 123) { const sufLength = node.suffix?.length ?? 0; const name = nodePart.substring(preLength + 2, nodePart.length - sufLength - 1); const value = part.substring(preLength, part.length - sufLength); rawParams[name] = decodeURIComponent(value); } else { const name = nodePart.substring(1); rawParams[name] = decodeURIComponent(part); } } else if (node.kind === 3) { if (leaf.skipped & 1 << nodeIndex) { partIndex--; pathIndex = currentPathIndex - 1; continue; } nodeParts ??= leaf.node.fullPath.split("/"); const nodePart = nodeParts[segmentCount]; const preLength = node.prefix?.length ?? 0; const sufLength = node.suffix?.length ?? 0; const name = nodePart.substring(preLength + 3, nodePart.length - sufLength - 1); const value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part; if (value) rawParams[name] = decodeURIComponent(value); } else if (node.kind === 2) { const n = node; const value = path.substring(currentPathIndex + (n.prefix?.length ?? 0), path.length - (n.suffix?.length ?? 0)); const splat = decodeURIComponent(value); rawParams["*"] = splat; rawParams._splat = splat; break; } } if (leaf.rawParams) Object.assign(rawParams, leaf.rawParams); return [rawParams, { part: partIndex, node: nodeIndex, path: pathIndex, segment: segmentCount }]; } function buildRouteBranch(route) { const list = [route]; while (route.parentRoute) { route = route.parentRoute; list.push(route); } list.reverse(); return list; } function buildBranch(node) { const list = Array(node.depth + 1); do { list[node.depth] = node; node = node.parent; } while (node); return list; } function getNodeMatch(path, parts, segmentTree, fuzzy) { if (path === "/" && segmentTree.index) return { node: segmentTree.index, skipped: 0 }; const trailingSlash = !last(parts); const pathIsIndex = trailingSlash && path !== "/"; const partsLength = parts.length - (trailingSlash ? 1 : 0); const stack = [{ node: segmentTree, index: 1, skipped: 0, depth: 1, statics: 0, dynamics: 0, optionals: 0 }]; let bestFuzzy = null; let bestMatch = null; while (stack.length) { const frame = stack.pop(); const { node, index, skipped, depth, statics, dynamics, optionals } = frame; let { extract, rawParams } = frame; if (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue; if (node.parse) { if (!validateParseParams(path, parts, frame)) continue; rawParams = frame.rawParams; extract = frame.extract; } if (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame; const isBeyondPath = index === partsLength; if (isBeyondPath) { if (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame; if (!node.optional && !node.wildcard && !node.index && !node.pathless) continue; } const part = isBeyondPath ? void 0 : parts[index]; let lowerPart; if (isBeyondPath && node.index) { const indexFrame = { node: node.index, index, skipped, depth: depth + 1, statics, dynamics, optionals, extract, rawParams }; let indexValid = true; if (node.index.parse) { if (!validateParseParams(path, parts, indexFrame)) indexValid = false; } if (indexValid) { if (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame; if (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame; } } if (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) { const segment = node.wildcard[i]; const { prefix, suffix } = segment; if (prefix) { if (isBeyondPath) continue; if (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue; } if (suffix) { if (isBeyondPath) continue; const end = parts.slice(index).join("/").slice(-suffix.length); if ((segment.caseSensitive ? end : end.toLowerCase()) !== suffix) continue; } stack.push({ node: segment, index: partsLength, skipped, depth: depth + 1, statics, dynamics, optionals, extract, rawParams }); } if (node.optional) { const nextSkipped = skipped | 1 << depth; const nextDepth = depth + 1; for (let i = node.optional.length - 1; i >= 0; i--) { const segment = node.optional[i]; stack.push({ node: segment, index, skipped: nextSkipped, depth: nextDepth, statics, dynamics, optionals, extract, rawParams }); } if (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) { const segment = node.optional[i]; const { prefix, suffix } = segment; if (prefix || suffix) { const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase(); if (prefix && !casePart.startsWith(prefix)) continue; if (suffix && !casePart.endsWith(suffix)) continue; } stack.push({ node: segment, index: index + 1, skipped, depth: nextDepth, statics, dynamics, optionals: optionals + segmentScore(partsLength, index), extract, rawParams }); } } if (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) { const segment = node.dynamic[i]; const { prefix, suffix } = segment; if (prefix || suffix) { const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase(); if (prefix && !casePart.startsWith(prefix)) continue; if (suffix && !casePart.endsWith(suffix)) continue; } stack.push({ node: segment, index: index + 1, skipped, depth: depth + 1, statics, dynamics: dynamics + segmentScore(partsLength, index), optionals, extract, rawParams }); } if (!isBeyondPath && node.staticInsensitive) { const match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase()); if (match) stack.push({ node: match, index: index + 1, skipped, depth: depth + 1, statics: statics + segmentScore(partsLength, index), dynamics, optionals, extract, rawParams }); } if (!isBeyondPath && node.static) { const match = node.static.get(part); if (match) stack.push({ node: match, index: index + 1, skipped, depth: depth + 1, statics: statics + segmentScore(partsLength, index), dynamics, optionals, extract, rawParams }); } if (node.pathless) { const nextDepth = depth + 1; for (let i = node.pathless.length - 1; i >= 0; i--) { const segment = node.pathless[i]; stack.push({ node: segment, index, skipped, depth: nextDepth, statics, dynamics, optionals, extract, rawParams }); } } } if (bestMatch) return bestMatch; if (fuzzy && bestFuzzy) { let sliceIndex = bestFuzzy.index; for (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length; const splat = sliceIndex === path.length ? "/" : path.slice(sliceIndex); bestFuzzy.rawParams ??= Object.create(null); bestFuzzy.rawParams["**"] = decodeURIComponent(splat); return bestFuzzy; } return null; } function segmentScore(partsLength, index) { return 2 ** (partsLength - index - 1); } function isPerfectStaticMatch(statics, partsLength) { return statics === 2 ** (partsLength - 1) - 1; } function validateParseParams(path, parts, frame) { let rawParams; let state; try { [rawParams, state] = extractParams(path, parts, frame); } catch { return null; } frame.rawParams = rawParams; frame.extract = state; if (!frame.node.parse) return true; try { if (frame.node.parse(rawParams) === false) return null; } catch {} return true; } function isFrameMoreSpecific(prev, next) { if (!prev) return true; return next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.depth > prev.depth))); } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/path.js /** Join path segments, cleaning duplicate slashes between parts. */ function joinPaths(paths) { return cleanPath(paths.filter((val) => { return val !== void 0; }).join("/")); } /** Remove repeated slashes from a path string. */ function cleanPath(path) { return path.replace(/\/{2,}/g, "/"); } /** Trim leading slashes (except preserving root '/'). */ function trimPathLeft(path) { return path === "/" ? path : path.replace(/^\/{1,}/, ""); } /** Trim trailing slashes (except preserving root '/'). */ function trimPathRight(path) { const len = path.length; return len > 1 && path[len - 1] === "/" ? path.replace(/\/{1,}$/, "") : path; } /** Trim both leading and trailing slashes. */ function trimPath(path) { return trimPathRight(trimPathLeft(path)); } /** Remove a trailing slash from value when appropriate for comparisons. */ function removeTrailingSlash(value, basepath) { if (value?.endsWith("/") && value !== "/" && value !== `${basepath}/`) return value.slice(0, -1); return value; } /** * Compare two pathnames for exact equality after normalizing trailing slashes * relative to the provided `basepath`. */ function exactPathTest(pathName1, pathName2, basepath) { return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath); } /** * Resolve a destination path against a base, honoring trailing-slash policy * and supporting relative segments (`.`/`..`) and absolute `to` values. */ function resolvePath({ base, to, trailingSlash = "never", cache }) { const isAbsolute = to.startsWith("/"); const isBase = !isAbsolute && to === "."; let key; if (cache) { key = isAbsolute ? to : isBase ? base : base + "\0" + to; const cached = cache.get(key); if (cached) return cached; } let baseSegments; if (isBase) baseSegments = base.split("/"); else if (isAbsolute) baseSegments = to.split("/"); else { baseSegments = base.split("/"); while (baseSegments.length > 1 && last(baseSegments) === "") baseSegments.pop(); const toSegments = to.split("/"); for (let index = 0, length = toSegments.length; index < length; index++) { const value = toSegments[index]; if (value === "") { if (!index) baseSegments = [value]; else if (index === length - 1) baseSegments.push(value); } else if (value === "..") baseSegments.pop(); else if (value === ".") {} else baseSegments.push(value); } } if (baseSegments.length > 1) { if (last(baseSegments) === "") { if (trailingSlash === "never") baseSegments.pop(); } else if (trailingSlash === "always") baseSegments.push(""); } const result = cleanPath(baseSegments.join("/")) || "/"; if (key && cache) cache.set(key, result); return result; } /** * Create a pre-compiled decode config from allowed characters. * This should be called once at router initialization. */ function compileDecodeCharMap(pathParamsAllowedCharacters) { const charMap = new Map(pathParamsAllowedCharacters.map((char) => [encodeURIComponent(char), char])); const pattern = Array.from(charMap.keys()).map((key) => key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"); const regex = new RegExp(pattern, "g"); return (encoded) => encoded.replace(regex, (match) => charMap.get(match) ?? match); } function encodeParam(key, params, decoder) { const value = params[key]; if (typeof value !== "string") return value; if (key === "_splat") { if (/^[a-zA-Z0-9\-._~!/]*$/.test(value)) return value; return value.split("/").map((segment) => encodePathParam(segment, decoder)).join("/"); } else return encodePathParam(value, decoder); } /** * Interpolate params and wildcards into a route path template. * * - Encodes params safely (configurable allowed characters) * - Supports `{-$optional}` segments, `{prefix{$id}suffix}` and `{$}` wildcards */ function interpolatePath({ path, params, decoder, ...rest }) { let isMissingParams = false; const usedParams = Object.create(null); if (!path || path === "/") return { interpolatedPath: "/", usedParams, isMissingParams }; if (!path.includes("$")) return { interpolatedPath: path, usedParams, isMissingParams }; if (path.indexOf("{") === -1) { const length = path.length; let cursor = 0; let joined = ""; while (cursor < length) { while (cursor < length && path.charCodeAt(cursor) === 47) cursor++; if (cursor >= length) break; const start = cursor; let end = path.indexOf("/", cursor); if (end === -1) end = length; cursor = end; const part = path.substring(start, end); if (!part) continue; if (part.charCodeAt(0) === 36) if (part.length === 1) { const splat = params._splat; usedParams._splat = splat; usedParams["*"] = splat; if (!splat) { isMissingParams = true; continue; } const value = encodeParam("_splat", params, decoder); joined += "/" + value; } else { const key = part.substring(1); if (!isMissingParams && !(key in params)) isMissingParams = true; usedParams[key] = params[key]; const value = encodeParam(key, params, decoder) ?? "undefined"; joined += "/" + value; } else joined += "/" + part; } if (path.endsWith("/")) joined += "/"; return { usedParams, interpolatedPath: joined || "/", isMissingParams }; } const length = path.length; let cursor = 0; let segment; let joined = ""; while (cursor < length) { const start = cursor; segment = parseSegment(path, start, segment); const end = segment[5]; cursor = end + 1; if (start === end) continue; const kind = segment[0]; if (kind === 0) { joined += "/" + path.substring(start, end); continue; } if (kind === 2) { const splat = params._splat; usedParams._splat = splat; usedParams["*"] = splat; const prefix = path.substring(start, segment[1]); const suffix = path.substring(segment[4], end); if (!splat) { isMissingParams = true; if (prefix || suffix) joined += "/" + prefix + suffix; continue; } const value = encodeParam("_splat", params, decoder); joined += "/" + prefix + value + suffix; continue; } if (kind === 1) { const key = path.substring(segment[2], segment[3]); if (!isMissingParams && !(key in params)) isMissingParams = true; usedParams[key] = params[key]; const prefix = path.substring(start, segment[1]); const suffix = path.substring(segment[4], end); const value = encodeParam(key, params, decoder) ?? "undefined"; joined += "/" + prefix + value + suffix; continue; } if (kind === 3) { const key = path.substring(segment[2], segment[3]); const valueRaw = params[key]; if (valueRaw == null) continue; usedParams[key] = valueRaw; const prefix = path.substring(start, segment[1]); const suffix = path.substring(segment[4], end); const value = encodeParam(key, params, decoder) ?? ""; joined += "/" + prefix + value + suffix; continue; } } if (path.endsWith("/")) joined += "/"; return { usedParams, interpolatedPath: joined || "/", isMissingParams }; } function encodePathParam(value, decoder) { const encoded = encodeURIComponent(value); return decoder?.(encoded) ?? encoded; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/not-found.js /** Determine if a value is a TanStack Router not-found error. */ function isNotFound(obj) { return obj?.isNotFound === true; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/scroll-restoration.js function getSafeSessionStorage() { try { return typeof window !== "undefined" && typeof window.sessionStorage === "object" ? window.sessionStorage : void 0; } catch { return; } } var storageKey = "tsr-scroll-restoration-v1_3"; function createScrollRestorationCache() { const safeSessionStorage = getSafeSessionStorage(); if (!safeSessionStorage) return null; let state = {}; try { const parsed = JSON.parse(safeSessionStorage.getItem("tsr-scroll-restoration-v1_3") || "{}"); if (isPlainObject(parsed)) state = parsed; } catch {} const persist = () => { try { safeSessionStorage.setItem(storageKey, JSON.stringify(state)); } catch {} }; return { get state() { return state; }, set: (updater) => { state = functionalUpdate(updater, state) || state; }, persist }; } createScrollRestorationCache(); /** * The default `getKey` function for `useScrollRestoration`. * It returns the `key` from the location state or the `href` of the location. * * The `location.href` is used as a fallback to support the use case where the location state is not available like the initial render. */ var defaultGetScrollRestorationKey = (location) => { return location.state.__TSR_key || location.href; }; //#endregion //#region node_modules/@tanstack/router-core/dist/esm/qss.js /** * Program is a reimplementation of the `qss` package: * Copyright (c) Luke Edwards luke.edwards05@gmail.com, MIT License * https://github.com/lukeed/qss/blob/master/license.md * * This reimplementation uses modern browser APIs * (namely URLSearchParams) and TypeScript while still * maintaining the original functionality and interface. * * Update: this implementation has also been mangled to * fit exactly our use-case (single value per key in encoding). */ /** * Encodes an object into a query string. * @param obj - The object to encode into a query string. * @param stringify - An optional custom stringify function. * @returns The encoded query string. * @example * ``` * // Example input: encode({ token: 'foo', key: 'value' }) * // Expected output: "token=foo&key=value" * ``` */ function encode(obj, stringify = String) { const result = new URLSearchParams(); for (const key in obj) { const val = obj[key]; if (val !== void 0) result.set(key, stringify(val)); } return result.toString(); } /** * Converts a string value to its appropriate type (string, number, boolean). * @param mix - The string value to convert. * @returns The converted value. * @example * // Example input: toValue("123") * // Expected output: 123 */ function toValue(str) { if (!str) return ""; if (str === "false") return false; if (str === "true") return true; return +str * 0 === 0 && +str + "" === str ? +str : str; } /** * Decodes a query string into an object. * @param str - The query string to decode. * @returns The decoded key-value pairs in an object format. * @example * // Example input: decode("token=foo&key=value") * // Expected output: { "token": "foo", "key": "value" } */ function decode(str) { const searchParams = new URLSearchParams(str); const result = Object.create(null); for (const [key, value] of searchParams.entries()) { const previousValue = result[key]; if (previousValue == null) result[key] = toValue(value); else if (Array.isArray(previousValue)) previousValue.push(toValue(value)); else result[key] = [previousValue, toValue(value)]; } return result; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/searchParams.js /** Default `parseSearch` that strips leading '?' and JSON-parses values. */ var defaultParseSearch = parseSearchWith(JSON.parse); /** Default `stringifySearch` using JSON.stringify for complex values. */ var defaultStringifySearch = stringifySearchWith(JSON.stringify, JSON.parse); /** * Build a `parseSearch` function using a provided JSON-like parser. * * The returned function strips a leading `?`, decodes values, and attempts to * JSON-parse string values using the given `parser`. * * @param parser Function to parse a string value (e.g. `JSON.parse`). * @returns A `parseSearch` function compatible with `Router` options. * @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization */ function parseSearchWith(parser) { return (searchStr) => { if (searchStr[0] === "?") searchStr = searchStr.substring(1); const query = decode(searchStr); for (const key in query) { const value = query[key]; if (typeof value === "string") try { query[key] = parser(value); } catch (_err) {} } return query; }; } /** * Build a `stringifySearch` function using a provided serializer. * * Non-primitive values are serialized with `stringify`. If a `parser` is * supplied, string values that are parseable are re-serialized to ensure * symmetry with `parseSearch`. * * @param stringify Function to serialize a value (e.g. `JSON.stringify`). * @param parser Optional parser to detect parseable strings. * @returns A `stringifySearch` function compatible with `Router` options. * @link https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization */ function stringifySearchWith(stringify, parser) { const hasParser = typeof parser === "function"; function stringifyValue(val) { if (typeof val === "object" && val !== null) try { return stringify(val); } catch (_err) {} else if (hasParser && typeof val === "string") try { parser(val); return stringify(val); } catch (_err) {} return val; } return (search) => { const searchStr = encode(search, stringifyValue); return searchStr ? `?${searchStr}` : ""; }; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/root.js /** Stable identifier used for the root route in a route tree. */ var rootRouteId = "__root__"; //#endregion //#region node_modules/@tanstack/router-core/dist/esm/redirect.js /** * Create a redirect Response understood by TanStack Router. * * Use from route `loader`/`beforeLoad` or server functions to trigger a * navigation. If `throw: true` is set, the redirect is thrown instead of * returned. When an absolute `href` is supplied and `reloadDocument` is not * set, a full-document navigation is inferred. * * @param opts Options for the redirect. Common fields: * - `href`: absolute URL for external redirects; infers `reloadDocument`. * - `statusCode`: HTTP status code to use (defaults to 307). * - `headers`: additional headers to include on the Response. * - Standard navigation options like `to`, `params`, `search`, `replace`, * and `reloadDocument` for internal redirects. * @returns A Response augmented with router navigation options. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction */ function redirect(opts) { opts.statusCode = opts.statusCode || opts.code || 307; if (!opts._builtLocation && !opts.reloadDocument && typeof opts.href === "string") try { new URL(opts.href); opts.reloadDocument = true; } catch {} const headers = new Headers(opts.headers); if (opts.href && headers.get("Location") === null) headers.set("Location", opts.href); const response = new Response(null, { status: opts.statusCode, headers }); response.options = opts; if (opts.throw) throw response; return response; } /** Check whether a value is a TanStack Router redirect Response. */ /** Check whether a value is a TanStack Router redirect Response. */ function isRedirect(obj) { return obj instanceof Response && !!obj.options; } /** True if value is a redirect with a resolved `href` location. */ /** True if value is a redirect with a resolved `href` location. */ function isResolvedRedirect(obj) { return isRedirect(obj) && !!obj.options.href; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/rewrite.js /** Compose multiple rewrite pairs into a single in/out rewrite. */ /** Compose multiple rewrite pairs into a single in/out rewrite. */ function composeRewrites(rewrites) { return { input: ({ url }) => { for (const rewrite of rewrites) url = executeRewriteInput(rewrite, url); return url; }, output: ({ url }) => { for (let i = rewrites.length - 1; i >= 0; i--) url = executeRewriteOutput(rewrites[i], url); return url; } }; } /** Create a rewrite pair that strips/adds a basepath on input/output. */ /** Create a rewrite pair that strips/adds a basepath on input/output. */ function rewriteBasepath(opts) { const trimmedBasepath = trimPath(opts.basepath); const normalizedBasepath = `/${trimmedBasepath}`; const normalizedBasepathWithSlash = `${normalizedBasepath}/`; const checkBasepath = opts.caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase(); const checkBasepathWithSlash = opts.caseSensitive ? normalizedBasepathWithSlash : normalizedBasepathWithSlash.toLowerCase(); return { input: ({ url }) => { const pathname = opts.caseSensitive ? url.pathname : url.pathname.toLowerCase(); if (pathname === checkBasepath) url.pathname = "/"; else if (pathname.startsWith(checkBasepathWithSlash)) url.pathname = url.pathname.slice(normalizedBasepath.length); return url; }, output: ({ url }) => { url.pathname = joinPaths([ "/", trimmedBasepath, url.pathname ]); return url; } }; } /** Execute a location input rewrite if provided. */ /** Execute a location input rewrite if provided. */ function executeRewriteInput(rewrite, url) { const res = rewrite?.input?.({ url }); if (res) { if (typeof res === "string") return new URL(res); else if (res instanceof URL) return res; } return url; } /** Execute a location output rewrite if provided. */ /** Execute a location output rewrite if provided. */ function executeRewriteOutput(rewrite, url) { const res = rewrite?.output?.({ url }); if (res) { if (typeof res === "string") return new URL(res); else if (res instanceof URL) return res; } return url; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/stores.js /** SSR non-reactive createMutableStore */ function createNonReactiveMutableStore(initialValue) { let value = initialValue; return { get() { return value; }, set(nextOrUpdater) { value = functionalUpdate(nextOrUpdater, value); } }; } /** SSR non-reactive createReadonlyStore */ function createNonReactiveReadonlyStore(read) { return { get() { return read(); } }; } function createRouterStores(initialState, config) { const { createMutableStore, createReadonlyStore, batch, init } = config; const matchStores = /* @__PURE__ */ new Map(); const pendingMatchStores = /* @__PURE__ */ new Map(); const cachedMatchStores = /* @__PURE__ */ new Map(); const status = createMutableStore(initialState.status); const loadedAt = createMutableStore(initialState.loadedAt); const isLoading = createMutableStore(initialState.isLoading); const isTransitioning = createMutableStore(initialState.isTransitioning); const location = createMutableStore(initialState.location); const resolvedLocation = createMutableStore(initialState.resolvedLocation); const statusCode = createMutableStore(initialState.statusCode); const redirect = createMutableStore(initialState.redirect); const matchesId = createMutableStore([]); const pendingIds = createMutableStore([]); const cachedIds = createMutableStore([]); const matches = createReadonlyStore(() => readPoolMatches(matchStores, matchesId.get())); const pendingMatches = createReadonlyStore(() => readPoolMatches(pendingMatchStores, pendingIds.get())); const cachedMatches = createReadonlyStore(() => readPoolMatches(cachedMatchStores, cachedIds.get())); const firstId = createReadonlyStore(() => matchesId.get()[0]); const hasPending = createReadonlyStore(() => matchesId.get().some((matchId) => { return matchStores.get(matchId)?.get().status === "pending"; })); const matchRouteDeps = createReadonlyStore(() => ({ locationHref: location.get().href, resolvedLocationHref: resolvedLocation.get()?.href, status: status.get() })); const __store = createReadonlyStore(() => ({ status: status.get(), loadedAt: loadedAt.get(), isLoading: isLoading.get(), isTransitioning: isTransitioning.get(), matches: matches.get(), location: location.get(), resolvedLocation: resolvedLocation.get(), statusCode: statusCode.get(), redirect: redirect.get() })); const matchStoreByRouteIdCache = createLRUCache(64); function getRouteMatchStore(routeId) { let cached = matchStoreByRouteIdCache.get(routeId); if (!cached) { cached = createReadonlyStore(() => { const ids = matchesId.get(); for (const id of ids) { const matchStore = matchStores.get(id); if (matchStore && matchStore.routeId === routeId) return matchStore.get(); } }); matchStoreByRouteIdCache.set(routeId, cached); } return cached; } const store = { status, loadedAt, isLoading, isTransitioning, location, resolvedLocation, statusCode, redirect, matchesId, pendingIds, cachedIds, matches, pendingMatches, cachedMatches, firstId, hasPending, matchRouteDeps, matchStores, pendingMatchStores, cachedMatchStores, __store, getRouteMatchStore, setMatches, setPending, setCached }; setMatches(initialState.matches); init?.(store); function setMatches(nextMatches) { reconcileMatchPool(nextMatches, matchStores, matchesId, createMutableStore, batch); } function setPending(nextMatches) { reconcileMatchPool(nextMatches, pendingMatchStores, pendingIds, createMutableStore, batch); } function setCached(nextMatches) { reconcileMatchPool(nextMatches, cachedMatchStores, cachedIds, createMutableStore, batch); } return store; } function readPoolMatches(pool, ids) { const matches = []; for (const id of ids) { const matchStore = pool.get(id); if (matchStore) matches.push(matchStore.get()); } return matches; } function reconcileMatchPool(nextMatches, pool, idStore, createMutableStore, batch) { const nextIds = nextMatches.map((d) => d.id); const nextIdSet = new Set(nextIds); batch(() => { for (const id of pool.keys()) if (!nextIdSet.has(id)) pool.delete(id); for (const nextMatch of nextMatches) { const existing = pool.get(nextMatch.id); if (!existing) { const matchStore = createMutableStore(nextMatch); matchStore.routeId = nextMatch.routeId; pool.set(nextMatch.id, matchStore); continue; } existing.routeId = nextMatch.routeId; if (existing.get() !== nextMatch) existing.set(nextMatch); } if (!arraysEqual(idStore.get(), nextIds)) idStore.set(nextIds); }); } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/load-matches.js var triggerOnReady = (inner) => { if (!inner.rendered) { inner.rendered = true; return inner.onReady?.(); } }; var resolvePreload = (inner, matchId) => { return !!(inner.preload && !inner.router.stores.matchStores.has(matchId)); }; /** * Builds the accumulated context from router options and all matches up to (and optionally including) the given index. * Merges __routeContext and __beforeLoadContext from each match. */ var buildMatchContext = (inner, index, includeCurrentMatch = true) => { const context = { ...inner.router.options.context ?? {} }; const end = includeCurrentMatch ? index : index - 1; for (let i = 0; i <= end; i++) { const innerMatch = inner.matches[i]; if (!innerMatch) continue; const m = inner.router.getMatch(innerMatch.id); if (!m) continue; Object.assign(context, m.__routeContext, m.__beforeLoadContext); } return context; }; var getNotFoundBoundaryIndex = (inner, err) => { if (!inner.matches.length) return; const requestedRouteId = err.routeId; const matchedRootIndex = inner.matches.findIndex((m) => m.routeId === inner.router.routeTree.id); const rootIndex = matchedRootIndex >= 0 ? matchedRootIndex : 0; let startIndex = requestedRouteId ? inner.matches.findIndex((match) => match.routeId === requestedRouteId) : inner.firstBadMatchIndex ?? inner.matches.length - 1; if (startIndex < 0) startIndex = rootIndex; for (let i = startIndex; i >= 0; i--) { const match = inner.matches[i]; if (inner.router.looseRoutesById[match.routeId].options.notFoundComponent) return i; } return requestedRouteId ? startIndex : rootIndex; }; var handleRedirectAndNotFound = (inner, match, err) => { if (!isRedirect(err) && !isNotFound(err)) return; if (isRedirect(err) && err.redirectHandled && !err.options.reloadDocument) throw err; if (match) { match._nonReactive.beforeLoadPromise?.resolve(); match._nonReactive.loaderPromise?.resolve(); match._nonReactive.beforeLoadPromise = void 0; match._nonReactive.loaderPromise = void 0; match._nonReactive.error = err; inner.updateMatch(match.id, (prev) => ({ ...prev, status: isRedirect(err) ? "redirected" : isNotFound(err) ? "notFound" : prev.status === "pending" ? "success" : prev.status, context: buildMatchContext(inner, match.index), isFetching: false, error: err })); if (isNotFound(err) && !err.routeId) err.routeId = match.routeId; match._nonReactive.loadPromise?.resolve(); } if (isRedirect(err)) { inner.rendered = true; err.options._fromLocation = inner.location; err.redirectHandled = true; err = inner.router.resolveRedirect(err); } throw err; }; var shouldSkipLoader = (inner, matchId) => { const match = inner.router.getMatch(matchId); if (!match) return true; if (match.ssr === false) return true; return false; }; var syncMatchContext = (inner, matchId, index) => { const nextContext = buildMatchContext(inner, index); inner.updateMatch(matchId, (prev) => { return { ...prev, context: nextContext }; }); }; var handleSerialError = (inner, index, err, routerCode) => { const { id: matchId, routeId } = inner.matches[index]; const route = inner.router.looseRoutesById[routeId]; if (err instanceof Promise) throw err; err.routerCode = routerCode; inner.firstBadMatchIndex ??= index; handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err); try { route.options.onError?.(err); } catch (errorHandlerErr) { err = errorHandlerErr; handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err); } inner.updateMatch(matchId, (prev) => { prev._nonReactive.beforeLoadPromise?.resolve(); prev._nonReactive.beforeLoadPromise = void 0; prev._nonReactive.loadPromise?.resolve(); return { ...prev, error: err, status: "error", isFetching: false, updatedAt: Date.now(), abortController: new AbortController() }; }); if (!inner.preload && !isRedirect(err) && !isNotFound(err)) inner.serialError ??= err; }; var isBeforeLoadSsr = (inner, matchId, index, route) => { const existingMatch = inner.router.getMatch(matchId); const parentMatchId = inner.matches[index - 1]?.id; const parentMatch = parentMatchId ? inner.router.getMatch(parentMatchId) : void 0; if (inner.router.isShell()) { existingMatch.ssr = route.id === rootRouteId; return; } if (parentMatch?.ssr === false) { existingMatch.ssr = false; return; } const parentOverride = (tempSsr) => { if (tempSsr === true && parentMatch?.ssr === "data-only") return "data-only"; return tempSsr; }; const defaultSsr = inner.router.options.defaultSsr ?? true; if (route.options.ssr === void 0) { existingMatch.ssr = parentOverride(defaultSsr); return; } if (typeof route.options.ssr !== "function") { existingMatch.ssr = parentOverride(route.options.ssr); return; } const { search, params } = existingMatch; const ssrFnContext = { search: makeMaybe(search, existingMatch.searchError), params: makeMaybe(params, existingMatch.paramsError), location: inner.location, matches: inner.matches.map((match) => ({ index: match.index, pathname: match.pathname, fullPath: match.fullPath, staticData: match.staticData, id: match.id, routeId: match.routeId, search: makeMaybe(match.search, match.searchError), params: makeMaybe(match.params, match.paramsError), ssr: match.ssr })) }; const tempSsr = route.options.ssr(ssrFnContext); if (isPromise(tempSsr)) return tempSsr.then((ssr) => { existingMatch.ssr = parentOverride(ssr ?? defaultSsr); }); existingMatch.ssr = parentOverride(tempSsr ?? defaultSsr); }; var setupPendingTimeout = (inner, matchId, route, match) => { if (match._nonReactive.pendingTimeout !== void 0) return; route.options.pendingMs ?? inner.router.options.defaultPendingMs; if (!!(inner.onReady && false)); }; var preBeforeLoadSetup = (inner, matchId, route) => { const existingMatch = inner.router.getMatch(matchId); if (!existingMatch._nonReactive.beforeLoadPromise && !existingMatch._nonReactive.loaderPromise) return; setupPendingTimeout(inner, matchId, route, existingMatch); const then = () => { const match = inner.router.getMatch(matchId); if (match.preload && (match.status === "redirected" || match.status === "notFound")) handleRedirectAndNotFound(inner, match, match.error); }; return existingMatch._nonReactive.beforeLoadPromise ? existingMatch._nonReactive.beforeLoadPromise.then(then) : then(); }; var executeBeforeLoad = (inner, matchId, index, route) => { const match = inner.router.getMatch(matchId); let prevLoadPromise = match._nonReactive.loadPromise; match._nonReactive.loadPromise = createControlledPromise(() => { prevLoadPromise?.resolve(); prevLoadPromise = void 0; }); const { paramsError, searchError } = match; if (paramsError) handleSerialError(inner, index, paramsError, "PARSE_PARAMS"); if (searchError) handleSerialError(inner, index, searchError, "VALIDATE_SEARCH"); setupPendingTimeout(inner, matchId, route, match); const abortController = new AbortController(); let isPending = false; const pending = () => { if (isPending) return; isPending = true; inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: "beforeLoad", fetchCount: prev.fetchCount + 1, abortController })); }; const resolve = () => { match._nonReactive.beforeLoadPromise?.resolve(); match._nonReactive.beforeLoadPromise = void 0; inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: false })); }; if (!route.options.beforeLoad) { inner.router.batch(() => { pending(); resolve(); }); return; } match._nonReactive.beforeLoadPromise = createControlledPromise(); const context = { ...buildMatchContext(inner, index, false), ...match.__routeContext }; const { search, params, cause } = match; const preload = resolvePreload(inner, matchId); const beforeLoadFnContext = { search, abortController, params, preload, context, location: inner.location, navigate: (opts) => inner.router.navigate({ ...opts, _fromLocation: inner.location }), buildLocation: inner.router.buildLocation, cause: preload ? "preload" : cause, matches: inner.matches, routeId: route.id, ...inner.router.options.additionalContext }; const updateContext = (beforeLoadContext) => { if (beforeLoadContext === void 0) { inner.router.batch(() => { pending(); resolve(); }); return; } if (isRedirect(beforeLoadContext) || isNotFound(beforeLoadContext)) { pending(); handleSerialError(inner, index, beforeLoadContext, "BEFORE_LOAD"); } inner.router.batch(() => { pending(); inner.updateMatch(matchId, (prev) => ({ ...prev, __beforeLoadContext: beforeLoadContext })); resolve(); }); }; let beforeLoadContext; try { beforeLoadContext = route.options.beforeLoad(beforeLoadFnContext); if (isPromise(beforeLoadContext)) { pending(); return beforeLoadContext.catch((err) => { handleSerialError(inner, index, err, "BEFORE_LOAD"); }).then(updateContext); } } catch (err) { pending(); handleSerialError(inner, index, err, "BEFORE_LOAD"); } updateContext(beforeLoadContext); }; var handleBeforeLoad = (inner, index) => { const { id: matchId, routeId } = inner.matches[index]; const route = inner.router.looseRoutesById[routeId]; const serverSsr = () => { { const maybePromise = isBeforeLoadSsr(inner, matchId, index, route); if (isPromise(maybePromise)) return maybePromise.then(queueExecution); } return queueExecution(); }; const execute = () => executeBeforeLoad(inner, matchId, index, route); const queueExecution = () => { if (shouldSkipLoader(inner, matchId)) return; const result = preBeforeLoadSetup(inner, matchId, route); return isPromise(result) ? result.then(execute) : execute(); }; return serverSsr(); }; var executeHead = (inner, matchId, route) => { const match = inner.router.getMatch(matchId); if (!match) return; if (!route.options.head && !route.options.scripts && !route.options.headers) return; const assetContext = { ssr: inner.router.options.ssr, matches: inner.matches, match, params: match.params, loaderData: match.loaderData }; return Promise.all([ route.options.head?.(assetContext), route.options.scripts?.(assetContext), route.options.headers?.(assetContext) ]).then(([headFnContent, scripts, headers]) => { return { meta: headFnContent?.meta, links: headFnContent?.links, headScripts: headFnContent?.scripts, headers, scripts, styles: headFnContent?.styles }; }); }; var getLoaderContext = (inner, matchPromises, matchId, index, route) => { const parentMatchPromise = matchPromises[index - 1]; const { params, loaderDeps, abortController, cause } = inner.router.getMatch(matchId); const context = buildMatchContext(inner, index); const preload = resolvePreload(inner, matchId); return { params, deps: loaderDeps, preload: !!preload, parentMatchPromise, abortController, context, location: inner.location, navigate: (opts) => inner.router.navigate({ ...opts, _fromLocation: inner.location }), cause: preload ? "preload" : cause, route, ...inner.router.options.additionalContext }; }; var runLoader = async (inner, matchPromises, matchId, index, route) => { try { const match = inner.router.getMatch(matchId); try { if (match.ssr === true) loadRouteChunk(route); const routeLoader = route.options.loader; const loader = typeof routeLoader === "function" ? routeLoader : routeLoader?.handler; const loaderResult = loader?.(getLoaderContext(inner, matchPromises, matchId, index, route)); const loaderResultIsPromise = !!loader && isPromise(loaderResult); if (!!(loaderResultIsPromise || route._lazyPromise || route._componentsPromise || route.options.head || route.options.scripts || route.options.headers || match._nonReactive.minPendingPromise)) inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: "loader" })); if (loader) { const loaderData = loaderResultIsPromise ? await loaderResult : loaderResult; handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), loaderData); if (loaderData !== void 0) inner.updateMatch(matchId, (prev) => ({ ...prev, loaderData })); } if (route._lazyPromise) await route._lazyPromise; const pendingPromise = match._nonReactive.minPendingPromise; if (pendingPromise) await pendingPromise; if (route._componentsPromise) await route._componentsPromise; inner.updateMatch(matchId, (prev) => ({ ...prev, error: void 0, context: buildMatchContext(inner, index), status: "success", isFetching: false, updatedAt: Date.now() })); } catch (e) { let error = e; if (error?.name === "AbortError") { if (match.abortController.signal.aborted) { match._nonReactive.loaderPromise?.resolve(); match._nonReactive.loaderPromise = void 0; return; } inner.updateMatch(matchId, (prev) => ({ ...prev, status: prev.status === "pending" ? "success" : prev.status, isFetching: false, context: buildMatchContext(inner, index) })); return; } const pendingPromise = match._nonReactive.minPendingPromise; if (pendingPromise) await pendingPromise; if (isNotFound(e)) await route.options.notFoundComponent?.preload?.(); handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), e); try { route.options.onError?.(e); } catch (onErrorError) { error = onErrorError; handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), onErrorError); } if (!isRedirect(error) && !isNotFound(error)) await loadRouteChunk(route, ["errorComponent"]); inner.updateMatch(matchId, (prev) => ({ ...prev, error, context: buildMatchContext(inner, index), status: "error", isFetching: false })); } } catch (err) { const match = inner.router.getMatch(matchId); if (match) match._nonReactive.loaderPromise = void 0; handleRedirectAndNotFound(inner, match, err); } }; var loadRouteMatch = async (inner, matchPromises, index) => { async function handleLoader(preload, prevMatch, previousRouteMatchId, match, route) { const age = Date.now() - prevMatch.updatedAt; const staleAge = preload ? route.options.preloadStaleTime ?? inner.router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? inner.router.options.defaultStaleTime ?? 0; const shouldReloadOption = route.options.shouldReload; const shouldReload = typeof shouldReloadOption === "function" ? shouldReloadOption(getLoaderContext(inner, matchPromises, matchId, index, route)) : shouldReloadOption; const { status, invalid } = match; const staleMatchShouldReload = age >= staleAge && (!!inner.forceStaleReload || match.cause === "enter" || previousRouteMatchId !== void 0 && previousRouteMatchId !== match.id); loaderShouldRunAsync = status === "success" && (invalid || (shouldReload ?? staleMatchShouldReload)); if (preload && route.options.preload === false) {} else if (loaderShouldRunAsync && !inner.sync && shouldReloadInBackground) { loaderIsRunningAsync = true; (async () => { try { await runLoader(inner, matchPromises, matchId, index, route); const match = inner.router.getMatch(matchId); match._nonReactive.loaderPromise?.resolve(); match._nonReactive.loadPromise?.resolve(); match._nonReactive.loaderPromise = void 0; match._nonReactive.loadPromise = void 0; } catch (err) { if (isRedirect(err)) await inner.router.navigate(err.options); } })(); } else if (status !== "success" || loaderShouldRunAsync) await runLoader(inner, matchPromises, matchId, index, route); else syncMatchContext(inner, matchId, index); } const { id: matchId, routeId } = inner.matches[index]; let loaderShouldRunAsync = false; let loaderIsRunningAsync = false; const route = inner.router.looseRoutesById[routeId]; const routeLoader = route.options.loader; const shouldReloadInBackground = ((typeof routeLoader === "function" ? void 0 : routeLoader?.staleReloadMode) ?? inner.router.options.defaultStaleReloadMode) !== "blocking"; if (shouldSkipLoader(inner, matchId)) { if (!inner.router.getMatch(matchId)) return inner.matches[index]; syncMatchContext(inner, matchId, index); return inner.router.getMatch(matchId); } else { const prevMatch = inner.router.getMatch(matchId); const activeIdAtIndex = inner.router.stores.matchesId.get()[index]; const previousRouteMatchId = (activeIdAtIndex && inner.router.stores.matchStores.get(activeIdAtIndex) || null)?.routeId === routeId ? activeIdAtIndex : inner.router.stores.matches.get().find((d) => d.routeId === routeId)?.id; const preload = resolvePreload(inner, matchId); if (prevMatch._nonReactive.loaderPromise) { if (prevMatch.status === "success" && !inner.sync && !prevMatch.preload && shouldReloadInBackground) return prevMatch; await prevMatch._nonReactive.loaderPromise; const match = inner.router.getMatch(matchId); const error = match._nonReactive.error || match.error; if (error) handleRedirectAndNotFound(inner, match, error); if (match.status === "pending") await handleLoader(preload, prevMatch, previousRouteMatchId, match, route); } else { const nextPreload = preload && !inner.router.stores.matchStores.has(matchId); const match = inner.router.getMatch(matchId); match._nonReactive.loaderPromise = createControlledPromise(); if (nextPreload !== match.preload) inner.updateMatch(matchId, (prev) => ({ ...prev, preload: nextPreload })); await handleLoader(preload, prevMatch, previousRouteMatchId, match, route); } } const match = inner.router.getMatch(matchId); if (!loaderIsRunningAsync) { match._nonReactive.loaderPromise?.resolve(); match._nonReactive.loadPromise?.resolve(); match._nonReactive.loadPromise = void 0; } clearTimeout(match._nonReactive.pendingTimeout); match._nonReactive.pendingTimeout = void 0; if (!loaderIsRunningAsync) match._nonReactive.loaderPromise = void 0; match._nonReactive.dehydrated = void 0; const nextIsFetching = loaderIsRunningAsync ? match.isFetching : false; if (nextIsFetching !== match.isFetching || match.invalid !== false) { inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: nextIsFetching, invalid: false })); return inner.router.getMatch(matchId); } else return match; }; async function loadMatches(arg) { const inner = arg; const matchPromises = []; let beforeLoadNotFound; for (let i = 0; i < inner.matches.length; i++) { try { const beforeLoad = handleBeforeLoad(inner, i); if (isPromise(beforeLoad)) await beforeLoad; } catch (err) { if (isRedirect(err)) throw err; if (isNotFound(err)) beforeLoadNotFound = err; else if (!inner.preload) throw err; break; } if (inner.serialError || inner.firstBadMatchIndex != null) break; } const baseMaxIndexExclusive = inner.firstBadMatchIndex ?? inner.matches.length; const boundaryIndex = beforeLoadNotFound && !inner.preload ? getNotFoundBoundaryIndex(inner, beforeLoadNotFound) : void 0; const maxIndexExclusive = beforeLoadNotFound && inner.preload ? 0 : boundaryIndex !== void 0 ? Math.min(boundaryIndex + 1, baseMaxIndexExclusive) : baseMaxIndexExclusive; let firstNotFound; let firstUnhandledRejection; for (let i = 0; i < maxIndexExclusive; i++) matchPromises.push(loadRouteMatch(inner, matchPromises, i)); try { await Promise.all(matchPromises); } catch { const settled = await Promise.allSettled(matchPromises); for (const result of settled) { if (result.status !== "rejected") continue; const reason = result.reason; if (isRedirect(reason)) throw reason; if (isNotFound(reason)) firstNotFound ??= reason; else firstUnhandledRejection ??= reason; } if (firstUnhandledRejection !== void 0) throw firstUnhandledRejection; } const notFoundToThrow = firstNotFound ?? (beforeLoadNotFound && !inner.preload ? beforeLoadNotFound : void 0); let headMaxIndex = inner.firstBadMatchIndex !== void 0 ? inner.firstBadMatchIndex : inner.matches.length - 1; if (!notFoundToThrow && beforeLoadNotFound && inner.preload) return inner.matches; if (notFoundToThrow) { const renderedBoundaryIndex = getNotFoundBoundaryIndex(inner, notFoundToThrow); if (renderedBoundaryIndex === void 0) invariant(); const boundaryMatch = inner.matches[renderedBoundaryIndex]; const boundaryRoute = inner.router.looseRoutesById[boundaryMatch.routeId]; const defaultNotFoundComponent = inner.router.options?.defaultNotFoundComponent; if (!boundaryRoute.options.notFoundComponent && defaultNotFoundComponent) boundaryRoute.options.notFoundComponent = defaultNotFoundComponent; notFoundToThrow.routeId = boundaryMatch.routeId; const boundaryIsRoot = boundaryMatch.routeId === inner.router.routeTree.id; inner.updateMatch(boundaryMatch.id, (prev) => ({ ...prev, ...boundaryIsRoot ? { status: "success", globalNotFound: true, error: void 0 } : { status: "notFound", error: notFoundToThrow }, isFetching: false })); headMaxIndex = renderedBoundaryIndex; await loadRouteChunk(boundaryRoute, ["notFoundComponent"]); } else if (!inner.preload) { const rootMatch = inner.matches[0]; if (!rootMatch.globalNotFound) { if (inner.router.getMatch(rootMatch.id)?.globalNotFound) inner.updateMatch(rootMatch.id, (prev) => ({ ...prev, globalNotFound: false, error: void 0 })); } } if (inner.serialError && inner.firstBadMatchIndex !== void 0) { const errorRoute = inner.router.looseRoutesById[inner.matches[inner.firstBadMatchIndex].routeId]; await loadRouteChunk(errorRoute, ["errorComponent"]); } for (let i = 0; i <= headMaxIndex; i++) { const { id: matchId, routeId } = inner.matches[i]; const route = inner.router.looseRoutesById[routeId]; try { const headResult = executeHead(inner, matchId, route); if (headResult) { const head = await headResult; inner.updateMatch(matchId, (prev) => ({ ...prev, ...head })); } } catch (err) { console.error(`Error executing head for route ${routeId}:`, err); } } const readyPromise = triggerOnReady(inner); if (isPromise(readyPromise)) await readyPromise; if (notFoundToThrow) throw notFoundToThrow; if (inner.serialError && !inner.preload && !inner.onReady) throw inner.serialError; return inner.matches; } function preloadRouteComponents(route, componentTypesToLoad) { const preloads = componentTypesToLoad.map((type) => route.options[type]?.preload?.()).filter(Boolean); if (preloads.length === 0) return void 0; return Promise.all(preloads); } function loadRouteChunk(route, componentTypesToLoad = componentTypes) { if (!route._lazyLoaded && route._lazyPromise === void 0) if (route.lazyFn) route._lazyPromise = route.lazyFn().then((lazyRoute) => { const { id: _id, ...options } = lazyRoute.options; Object.assign(route.options, options); route._lazyLoaded = true; route._lazyPromise = void 0; }); else route._lazyLoaded = true; const runAfterLazy = () => route._componentsLoaded ? void 0 : componentTypesToLoad === componentTypes ? (() => { if (route._componentsPromise === void 0) { const componentsPromise = preloadRouteComponents(route, componentTypes); if (componentsPromise) route._componentsPromise = componentsPromise.then(() => { route._componentsLoaded = true; route._componentsPromise = void 0; }); else route._componentsLoaded = true; } return route._componentsPromise; })() : preloadRouteComponents(route, componentTypesToLoad); return route._lazyPromise ? route._lazyPromise.then(runAfterLazy) : runAfterLazy(); } function makeMaybe(value, error) { if (error) return { status: "error", error }; return { status: "success", value }; } function routeNeedsPreload(route) { for (const componentType of componentTypes) if (route.options[componentType]?.preload) return true; return false; } var componentTypes = [ "component", "errorComponent", "pendingComponent", "notFoundComponent" ]; //#endregion //#region node_modules/@tanstack/router-core/dist/esm/router.js /** * Compute whether path, href or hash changed between previous and current * resolved locations. */ function getLocationChangeInfo(location, resolvedLocation) { const fromLocation = resolvedLocation; const toLocation = location; return { fromLocation, toLocation, pathChanged: fromLocation?.pathname !== toLocation.pathname, hrefChanged: fromLocation?.href !== toLocation.href, hashChanged: fromLocation?.hash !== toLocation.hash }; } /** * Core, framework-agnostic router engine that powers TanStack Router. * * Provides navigation, matching, loading, preloading, caching and event APIs * used by framework adapters (React/Solid). Prefer framework helpers like * `createRouter` in app code. * * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType */ var RouterCore = class { /** * @deprecated Use the `createRouter` function instead */ constructor(options, getStoreConfig) { this.tempLocationKey = `${Math.round(Math.random() * 1e7)}`; this.resetNextScroll = true; this.shouldViewTransition = void 0; this.isViewTransitionTypesSupported = void 0; this.subscribers = /* @__PURE__ */ new Set(); this.isScrollRestoring = false; this.isScrollRestorationSetup = false; this.routeBranchCache = /* @__PURE__ */ new WeakMap(); this.startTransition = (fn) => fn(); this.update = (newOptions) => { const prevOptions = this.options; const prevBasepath = this.basepath ?? prevOptions?.basepath ?? "/"; const basepathWasUnset = this.basepath === void 0; const prevRewriteOption = prevOptions?.rewrite; this.options = { ...prevOptions, ...newOptions }; this.isServer = this.options.isServer ?? typeof document === "undefined"; this.protocolAllowlist = new Set(this.options.protocolAllowlist); if (this.options.pathParamsAllowedCharacters) this.pathParamsDecoder = compileDecodeCharMap(this.options.pathParamsAllowedCharacters); if (!this.history || this.options.history && this.options.history !== this.history) if (!this.options.history) {} else this.history = this.options.history; this.origin = this.options.origin; if (!this.origin) this.origin = "http://localhost"; if (this.history) this.updateLatestLocation(); if (this.options.routeTree !== this.routeTree) { this.routeTree = this.options.routeTree; let processRouteTreeResult; if (globalThis.__TSR_CACHE__ && globalThis.__TSR_CACHE__.routeTree === this.routeTree) { const cached = globalThis.__TSR_CACHE__; this.resolvePathCache = cached.resolvePathCache; processRouteTreeResult = cached.processRouteTreeResult; } else { this.resolvePathCache = createLRUCache(1e3); processRouteTreeResult = this.buildRouteTree(); if (globalThis.__TSR_CACHE__ === void 0) globalThis.__TSR_CACHE__ = { routeTree: this.routeTree, processRouteTreeResult, resolvePathCache: this.resolvePathCache }; } this.setRoutes(processRouteTreeResult); } if (!this.stores && this.latestLocation) { const config = this.getStoreConfig(this); this.batch = config.batch; this.stores = createRouterStores(getInitialRouterState(this.latestLocation), config); } let needsLocationUpdate = false; const nextBasepath = this.options.basepath ?? "/"; const nextRewriteOption = this.options.rewrite; if (basepathWasUnset || prevBasepath !== nextBasepath || prevRewriteOption !== nextRewriteOption) { this.basepath = nextBasepath; const rewrites = []; const trimmed = trimPath(nextBasepath); if (trimmed && trimmed !== "/") rewrites.push(rewriteBasepath({ basepath: nextBasepath })); if (nextRewriteOption) rewrites.push(nextRewriteOption); this.rewrite = rewrites.length === 0 ? void 0 : rewrites.length === 1 ? rewrites[0] : composeRewrites(rewrites); if (this.history) this.updateLatestLocation(); needsLocationUpdate = true; } if (needsLocationUpdate && this.stores) this.stores.location.set(this.latestLocation); if (typeof window !== "undefined" && "CSS" in window && typeof window.CSS?.supports === "function") this.isViewTransitionTypesSupported = window.CSS.supports("selector(:active-view-transition-type(a)"); }; this.updateLatestLocation = () => { this.latestLocation = this.parseLocation(this.history.location, this.latestLocation); }; this.buildRouteTree = () => { const result = processRouteTree(this.routeTree, this.options.caseSensitive, (route, i) => { route.init({ originalIndex: i }); }); if (this.options.routeMasks) processRouteMasks(this.options.routeMasks, result.processedTree); return result; }; this.subscribe = (eventType, fn) => { const listener = { eventType, fn }; this.subscribers.add(listener); return () => { this.subscribers.delete(listener); }; }; this.emit = (routerEvent) => { this.subscribers.forEach((listener) => { if (listener.eventType === routerEvent.type) listener.fn(routerEvent); }); }; this.parseLocation = (locationToParse, previousLocation) => { const parse = ({ pathname, search, hash, href, state }) => { if (!this.rewrite && !/[ \x00-\x1f\x7f\u0080-\uffff]/.test(pathname)) { const parsedSearch = this.options.parseSearch(search); const searchStr = this.options.stringifySearch(parsedSearch); return { href: pathname + searchStr + hash, publicHref: pathname + searchStr + hash, pathname: decodePath(pathname).path, external: false, searchStr, search: nullReplaceEqualDeep(previousLocation?.search, parsedSearch), hash: decodePath(hash.slice(1)).path, state: replaceEqualDeep(previousLocation?.state, state) }; } const fullUrl = new URL(href, this.origin); const url = executeRewriteInput(this.rewrite, fullUrl); const parsedSearch = this.options.parseSearch(url.search); const searchStr = this.options.stringifySearch(parsedSearch); url.search = searchStr; return { href: url.href.replace(url.origin, ""), publicHref: href, pathname: decodePath(url.pathname).path, external: !!this.rewrite && url.origin !== this.origin, searchStr, search: nullReplaceEqualDeep(previousLocation?.search, parsedSearch), hash: decodePath(url.hash.slice(1)).path, state: replaceEqualDeep(previousLocation?.state, state) }; }; const location = parse(locationToParse); const { __tempLocation, __tempKey } = location.state; if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) { const parsedTempLocation = parse(__tempLocation); parsedTempLocation.state.key = location.state.key; parsedTempLocation.state.__TSR_key = location.state.__TSR_key; delete parsedTempLocation.state.__tempLocation; return { ...parsedTempLocation, maskedLocation: location }; } return location; }; this.resolvePathWithBase = (from, path) => { return resolvePath({ base: from, to: path.includes("//") ? cleanPath(path) : path, trailingSlash: this.options.trailingSlash, cache: this.resolvePathCache }); }; this.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => { if (typeof pathnameOrNext === "string") return this.matchRoutesInternal({ pathname: pathnameOrNext, search: locationSearchOrOpts }, opts); return this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts); }; this.getMatchedRoutes = (pathname) => { return getMatchedRoutes({ pathname, routesById: this.routesById, processedTree: this.processedTree }); }; this.cancelMatch = (id) => { const match = this.getMatch(id); if (!match) return; match.abortController.abort(); clearTimeout(match._nonReactive.pendingTimeout); match._nonReactive.pendingTimeout = void 0; }; this.cancelMatches = () => { this.stores.pendingIds.get().forEach((matchId) => { this.cancelMatch(matchId); }); this.stores.matchesId.get().forEach((matchId) => { if (this.stores.pendingMatchStores.has(matchId)) return; const match = this.stores.matchStores.get(matchId)?.get(); if (!match) return; if (match.status === "pending" || match.isFetching === "loader") this.cancelMatch(matchId); }); }; this.buildLocation = (opts) => { const build = (dest = {}) => { const currentLocation = dest._fromLocation || this.pendingBuiltLocation || this.latestLocation; const lightweightResult = this.matchRoutesLightweight(currentLocation); if (dest.from && false); const defaultedFromPath = dest.unsafeRelative === "path" ? currentLocation.pathname : dest.from ?? lightweightResult.fullPath; const destTo = dest.to ? `${dest.to}` : void 0; const fromSearch = lightweightResult.search; const fromParams = Object.assign(Object.create(null), lightweightResult.params); const sourcePath = destTo?.charCodeAt(0) === 47 ? "/" : this.resolvePathWithBase(defaultedFromPath, "."); const nextTo = destTo ? this.resolvePathWithBase(sourcePath, destTo) : sourcePath; const nextParams = dest.params === false || dest.params === null ? Object.create(null) : (dest.params ?? true) === true ? fromParams : Object.assign(fromParams, functionalUpdate(dest.params, fromParams)); const destRoute = this.routesByPath[trimPathRight(nextTo)]; let destRoutes; if (destRoute) destRoutes = this.getRouteBranch(destRoute); else if (nextTo.includes("$")) destRoutes = []; else { const destMatchResult = this.getMatchedRoutes(nextTo); destRoutes = destMatchResult.matchedRoutes; if (this.options.notFoundRoute && (!destMatchResult.foundRoute || destMatchResult.foundRoute.path !== "/" && destMatchResult.routeParams["**"])) destRoutes = [...destRoutes, this.options.notFoundRoute]; } if (destRoutes.length && hasKeys(nextParams)) for (const route of destRoutes) { const fn = route.options.params?.stringify ?? route.options.stringifyParams; if (fn) try { Object.assign(nextParams, fn(nextParams)); } catch {} } const nextPathname = opts.leaveParams ? nextTo : decodePath(interpolatePath({ path: nextTo, params: nextParams, decoder: this.pathParamsDecoder, server: this.isServer }).interpolatedPath).path; let nextSearch = fromSearch; if (opts._includeValidateSearch && this.options.search?.strict) { const validatedSearch = {}; destRoutes.forEach((route) => { if (route.options.validateSearch) try { Object.assign(validatedSearch, validateSearch(route.options.validateSearch, { ...validatedSearch, ...nextSearch })); } catch {} }); nextSearch = validatedSearch; } nextSearch = applySearchMiddleware({ search: nextSearch, dest, destRoutes, _includeValidateSearch: opts._includeValidateSearch }); nextSearch = nullReplaceEqualDeep(fromSearch, nextSearch); const searchStr = this.options.stringifySearch(nextSearch); const hash = dest.hash === true ? currentLocation.hash : dest.hash ? functionalUpdate(dest.hash, currentLocation.hash) : void 0; const hashStr = hash ? `#${hash}` : ""; let nextState = dest.state === true ? currentLocation.state : dest.state ? functionalUpdate(dest.state, currentLocation.state) : {}; nextState = replaceEqualDeep(currentLocation.state, nextState); const fullPath = `${nextPathname}${searchStr}${hashStr}`; let href; let publicHref; let external = false; if (this.rewrite) { const url = new URL(fullPath, this.origin); const rewrittenUrl = executeRewriteOutput(this.rewrite, url); href = url.href.replace(url.origin, ""); if (rewrittenUrl.origin !== this.origin) { publicHref = rewrittenUrl.href; external = true; } else publicHref = rewrittenUrl.pathname + rewrittenUrl.search + rewrittenUrl.hash; } else { href = encodePathLikeUrl(fullPath); publicHref = href; } return { publicHref, href, pathname: nextPathname, search: nextSearch, searchStr, state: nextState, hash: hash ?? "", external, unmaskOnReload: dest.unmaskOnReload }; }; const buildWithMatches = (dest = {}, maskedDest) => { const next = build(dest); let maskedNext = maskedDest ? build(maskedDest) : void 0; if (!maskedNext) { const params = Object.create(null); if (this.options.routeMasks) { const match = findFlatMatch(next.pathname, this.processedTree); if (match) { Object.assign(params, match.rawParams); const { from: _from, params: maskParams, ...maskProps } = match.route; const nextParams = maskParams === false || maskParams === null ? Object.create(null) : (maskParams ?? true) === true ? params : Object.assign(params, functionalUpdate(maskParams, params)); maskedDest = { from: opts.from, ...maskProps, params: nextParams }; maskedNext = build(maskedDest); } } } if (maskedNext) next.maskedLocation = maskedNext; return next; }; if (opts.mask) return buildWithMatches(opts, { from: opts.from, ...opts.mask }); return buildWithMatches(opts); }; this.commitLocation = async ({ viewTransition, ignoreBlocker, ...next }) => { const isSameState = () => { const ignoredProps = [ "key", "__TSR_key", "__TSR_index", "__hashScrollIntoViewOptions" ]; ignoredProps.forEach((prop) => { next.state[prop] = this.latestLocation.state[prop]; }); const isEqual = deepEqual(next.state, this.latestLocation.state); ignoredProps.forEach((prop) => { delete next.state[prop]; }); return isEqual; }; const isSameUrl = trimPathRight(this.latestLocation.href) === trimPathRight(next.href); let previousCommitPromise = this.commitLocationPromise; this.commitLocationPromise = createControlledPromise(() => { previousCommitPromise?.resolve(); previousCommitPromise = void 0; }); if (isSameUrl && isSameState()) this.load(); else { let { maskedLocation, hashScrollIntoView, ...nextHistory } = next; if (maskedLocation) { nextHistory = { ...maskedLocation, state: { ...maskedLocation.state, __tempKey: void 0, __tempLocation: { ...nextHistory, search: nextHistory.searchStr, state: { ...nextHistory.state, __tempKey: void 0, __tempLocation: void 0, __TSR_key: void 0, key: void 0 } } } }; if (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) nextHistory.state.__tempKey = this.tempLocationKey; } nextHistory.state.__hashScrollIntoViewOptions = hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true; this.shouldViewTransition = viewTransition; this.history[next.replace ? "replace" : "push"](nextHistory.publicHref, nextHistory.state, { ignoreBlocker }); } this.resetNextScroll = next.resetScroll ?? true; if (!this.history.subscribers.size) this.load(); return this.commitLocationPromise; }; this.buildAndCommitLocation = ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, href, ...rest } = {}) => { if (href) { const currentIndex = this.history.location.state.__TSR_index; const parsed = parseHref(href, { __TSR_index: replace ? currentIndex : currentIndex + 1 }); const hrefUrl = new URL(parsed.pathname, this.origin); rest.to = executeRewriteInput(this.rewrite, hrefUrl).pathname; rest.search = this.options.parseSearch(parsed.search); rest.hash = parsed.hash.slice(1); } const location = this.buildLocation({ ...rest, _includeValidateSearch: true }); this.pendingBuiltLocation = location; const commitPromise = this.commitLocation({ ...location, viewTransition, replace, resetScroll, hashScrollIntoView, ignoreBlocker }); Promise.resolve().then(() => { if (this.pendingBuiltLocation === location) this.pendingBuiltLocation = void 0; }); return commitPromise; }; this.navigate = async ({ to, reloadDocument, href, publicHref, ...rest }) => { let hrefIsUrl = false; if (href) try { new URL(`${href}`); hrefIsUrl = true; } catch {} if (hrefIsUrl && !reloadDocument) reloadDocument = true; if (reloadDocument) { if (to !== void 0 || !href) { const location = this.buildLocation({ to, ...rest }); href = href ?? location.publicHref; publicHref = publicHref ?? location.publicHref; } const reloadHref = !hrefIsUrl && publicHref ? publicHref : href; if (isDangerousProtocol(reloadHref, this.protocolAllowlist)) return Promise.resolve(); if (!rest.ignoreBlocker) { const blockers = this.history.getBlockers?.() ?? []; for (const blocker of blockers) if (blocker?.blockerFn) { if (await blocker.blockerFn({ currentLocation: this.latestLocation, nextLocation: this.latestLocation, action: "PUSH" })) return Promise.resolve(); } } if (rest.replace) window.location.replace(reloadHref); else window.location.href = reloadHref; return Promise.resolve(); } return this.buildAndCommitLocation({ ...rest, href, to, _isNavigate: true }); }; this.beforeLoad = () => { this.cancelMatches(); this.updateLatestLocation(); { const nextLocation = this.buildLocation({ to: this.latestLocation.pathname, search: true, params: true, hash: true, state: true, _includeValidateSearch: true }); if (this.latestLocation.publicHref !== nextLocation.publicHref) { const href = this.getParsedLocationHref(nextLocation); if (nextLocation.external) throw redirect({ href }); else throw redirect({ href, _builtLocation: nextLocation }); } } const pendingMatches = this.matchRoutes(this.latestLocation); const nextCachedMatches = this.stores.cachedMatches.get().filter((d) => !pendingMatches.some((e) => e.id === d.id)); this.batch(() => { this.stores.status.set("pending"); this.stores.statusCode.set(200); this.stores.isLoading.set(true); this.stores.location.set(this.latestLocation); this.stores.setPending(pendingMatches); this.stores.setCached(nextCachedMatches); }); }; this.load = async (opts) => { let redirect; let notFound; let loadPromise; const previousLocation = this.stores.resolvedLocation.get() ?? this.stores.location.get(); loadPromise = new Promise((resolve) => { this.startTransition(async () => { try { this.beforeLoad(); const next = this.latestLocation; const locationChangeInfo = getLocationChangeInfo(next, this.stores.resolvedLocation.get()); if (!this.stores.redirect.get()) this.emit({ type: "onBeforeNavigate", ...locationChangeInfo }); this.emit({ type: "onBeforeLoad", ...locationChangeInfo }); await loadMatches({ router: this, sync: opts?.sync, forceStaleReload: previousLocation.href === next.href, matches: this.stores.pendingMatches.get(), location: next, updateMatch: this.updateMatch, onReady: async () => { this.startTransition(() => { this.startViewTransition(async () => { let exitingMatches = null; let hookExitingMatches = null; let hookEnteringMatches = null; let hookStayingMatches = null; this.batch(() => { const pendingMatches = this.stores.pendingMatches.get(); const mountPending = pendingMatches.length; const currentMatches = this.stores.matches.get(); exitingMatches = mountPending ? currentMatches.filter((match) => !this.stores.pendingMatchStores.has(match.id)) : null; const pendingRouteIds = /* @__PURE__ */ new Set(); for (const s of this.stores.pendingMatchStores.values()) if (s.routeId) pendingRouteIds.add(s.routeId); const activeRouteIds = /* @__PURE__ */ new Set(); for (const s of this.stores.matchStores.values()) if (s.routeId) activeRouteIds.add(s.routeId); hookExitingMatches = mountPending ? currentMatches.filter((match) => !pendingRouteIds.has(match.routeId)) : null; hookEnteringMatches = mountPending ? pendingMatches.filter((match) => !activeRouteIds.has(match.routeId)) : null; hookStayingMatches = mountPending ? pendingMatches.filter((match) => activeRouteIds.has(match.routeId)) : currentMatches; this.stores.isLoading.set(false); this.stores.loadedAt.set(Date.now()); /** * When committing new matches, cache any exiting matches that are still usable. * Routes that resolved with `status: 'error'` or `status: 'notFound'` are * deliberately excluded from `cachedMatches` so that subsequent invalidations * or reloads re-run their loaders instead of reusing the failed/not-found data. */ if (mountPending) { this.stores.setMatches(pendingMatches); this.stores.setPending([]); this.stores.setCached([...this.stores.cachedMatches.get(), ...exitingMatches.filter((d) => d.status !== "error" && d.status !== "notFound" && d.status !== "redirected")]); this.clearExpiredCache(); } }); for (const [matches, hook] of [ [hookExitingMatches, "onLeave"], [hookEnteringMatches, "onEnter"], [hookStayingMatches, "onStay"] ]) { if (!matches) continue; for (const match of matches) this.looseRoutesById[match.routeId].options[hook]?.(match); } }); }); } }); } catch (err) { if (isRedirect(err)) redirect = err; else if (isNotFound(err)) notFound = err; const nextStatusCode = redirect ? redirect.status : notFound ? 404 : this.stores.matches.get().some((d) => d.status === "error") ? 500 : 200; this.batch(() => { this.stores.statusCode.set(nextStatusCode); this.stores.redirect.set(redirect); }); } if (this.latestLoadPromise === loadPromise) { this.commitLocationPromise?.resolve(); this.latestLoadPromise = void 0; this.commitLocationPromise = void 0; } resolve(); }); }); this.latestLoadPromise = loadPromise; await loadPromise; while (this.latestLoadPromise && loadPromise !== this.latestLoadPromise) await this.latestLoadPromise; let newStatusCode = void 0; if (this.hasNotFoundMatch()) newStatusCode = 404; else if (this.stores.matches.get().some((d) => d.status === "error")) newStatusCode = 500; if (newStatusCode !== void 0) this.stores.statusCode.set(newStatusCode); }; this.startViewTransition = (fn) => { const shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition; this.shouldViewTransition = void 0; if (shouldViewTransition && typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function") { let startViewTransitionParams; if (typeof shouldViewTransition === "object" && this.isViewTransitionTypesSupported) { const next = this.latestLocation; const prevLocation = this.stores.resolvedLocation.get(); const resolvedViewTransitionTypes = typeof shouldViewTransition.types === "function" ? shouldViewTransition.types(getLocationChangeInfo(next, prevLocation)) : shouldViewTransition.types; if (resolvedViewTransitionTypes === false) { fn(); return; } startViewTransitionParams = { update: fn, types: resolvedViewTransitionTypes }; } else startViewTransitionParams = fn; document.startViewTransition(startViewTransitionParams); } else fn(); }; this.updateMatch = (id, updater) => { this.startTransition(() => { const pendingMatch = this.stores.pendingMatchStores.get(id); if (pendingMatch) { pendingMatch.set(updater); return; } const activeMatch = this.stores.matchStores.get(id); if (activeMatch) { activeMatch.set(updater); return; } const cachedMatch = this.stores.cachedMatchStores.get(id); if (cachedMatch) { const next = updater(cachedMatch.get()); if (next.status === "redirected") { if (this.stores.cachedMatchStores.delete(id)) this.stores.cachedIds.set((prev) => prev.filter((matchId) => matchId !== id)); } else cachedMatch.set(next); } }); }; this.getMatch = (matchId) => { return this.stores.cachedMatchStores.get(matchId)?.get() ?? this.stores.pendingMatchStores.get(matchId)?.get() ?? this.stores.matchStores.get(matchId)?.get(); }; this.invalidate = (opts) => { const invalidate = (d) => { if (opts?.filter?.(d) ?? true) return { ...d, invalid: true, ...opts?.forcePending || d.status === "error" || d.status === "notFound" ? { status: "pending", error: void 0 } : void 0 }; return d; }; this.batch(() => { this.stores.setMatches(this.stores.matches.get().map(invalidate)); this.stores.setCached(this.stores.cachedMatches.get().map(invalidate)); this.stores.setPending(this.stores.pendingMatches.get().map(invalidate)); }); this.shouldViewTransition = false; return this.load({ sync: opts?.sync }); }; this.getParsedLocationHref = (location) => { return location.publicHref || "/"; }; this.resolveRedirect = (redirect) => { const locationHeader = redirect.headers.get("Location"); if (!redirect.options.href || redirect.options._builtLocation) { const location = redirect.options._builtLocation ?? this.buildLocation(redirect.options); const href = this.getParsedLocationHref(location); redirect.options.href = href; redirect.headers.set("Location", href); } else if (locationHeader) try { const url = new URL(locationHeader); if (this.origin && url.origin === this.origin) { const href = url.pathname + url.search + url.hash; redirect.options.href = href; redirect.headers.set("Location", href); } } catch {} if (redirect.options.href && !redirect.options._builtLocation && isDangerousProtocol(redirect.options.href, this.protocolAllowlist)) throw new Error("Redirect blocked: unsafe protocol"); if (!redirect.headers.get("Location")) redirect.headers.set("Location", redirect.options.href); return redirect; }; this.clearCache = (opts) => { const filter = opts?.filter; if (filter !== void 0) this.stores.setCached(this.stores.cachedMatches.get().filter((m) => !filter(m))); else this.stores.setCached([]); }; this.clearExpiredCache = () => { const now = Date.now(); const filter = (d) => { const route = this.looseRoutesById[d.routeId]; if (!route.options.loader) return true; const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 300 * 1e3; if (d.status === "error") return true; return now - d.updatedAt >= gcTime; }; this.clearCache({ filter }); }; this.loadRouteChunk = loadRouteChunk; this.preloadRoute = async (opts) => { const next = opts._builtLocation ?? this.buildLocation(opts); let matches = this.matchRoutes(next, { throwOnError: true, preload: true, dest: opts }); const activeMatchIds = new Set([...this.stores.matchesId.get(), ...this.stores.pendingIds.get()]); const loadedMatchIds = new Set([...activeMatchIds, ...this.stores.cachedIds.get()]); const matchesToCache = matches.filter((match) => !loadedMatchIds.has(match.id)); if (matchesToCache.length) { const cachedMatches = this.stores.cachedMatches.get(); this.stores.setCached([...cachedMatches, ...matchesToCache]); } try { matches = await loadMatches({ router: this, matches, location: next, preload: true, updateMatch: (id, updater) => { if (activeMatchIds.has(id)) matches = matches.map((d) => d.id === id ? updater(d) : d); else this.updateMatch(id, updater); } }); return matches; } catch (err) { if (isRedirect(err)) { if (err.options.reloadDocument) return; return await this.preloadRoute({ ...err.options, _fromLocation: next }); } if (!isNotFound(err)) console.error(err); return; } }; this.matchRoute = (location, opts) => { const matchLocation = { ...location, to: location.to ? this.resolvePathWithBase(location.from || "", location.to) : void 0, params: location.params || {}, leaveParams: true }; const next = this.buildLocation(matchLocation); if (opts?.pending && this.stores.status.get() !== "pending") return false; const baseLocation = (opts?.pending === void 0 ? !this.stores.isLoading.get() : opts.pending) ? this.latestLocation : this.stores.resolvedLocation.get() || this.stores.location.get(); const match = findSingleMatch(next.pathname, opts?.caseSensitive ?? false, opts?.fuzzy ?? false, baseLocation.pathname, this.processedTree); if (!match) return false; if (location.params) { if (!deepEqual(match.rawParams, location.params, { partial: true })) return false; } if (opts?.includeSearch ?? true) return deepEqual(baseLocation.search, next.search, { partial: true }) ? match.rawParams : false; return match.rawParams; }; this.hasNotFoundMatch = () => { return this.stores.matches.get().some((d) => d.status === "notFound" || d.globalNotFound); }; this.getStoreConfig = getStoreConfig; this.update({ defaultPreloadDelay: 50, defaultPendingMs: 1e3, defaultPendingMinMs: 500, context: void 0, ...options, caseSensitive: options.caseSensitive ?? false, notFoundMode: options.notFoundMode ?? "fuzzy", stringifySearch: options.stringifySearch ?? defaultStringifySearch, parseSearch: options.parseSearch ?? defaultParseSearch, protocolAllowlist: options.protocolAllowlist ?? DEFAULT_PROTOCOL_ALLOWLIST }); if (typeof document !== "undefined") self.__TSR_ROUTER__ = this; } isShell() { return !!this.options.isShell; } isPrerendering() { return !!this.options.isPrerendering; } get state() { return this.stores.__store.get(); } setRoutes({ routesById, routesByPath, processedTree }) { this.routesById = routesById; this.routesByPath = routesByPath; this.processedTree = processedTree; const notFoundRoute = this.options.notFoundRoute; if (notFoundRoute) { notFoundRoute.init({ originalIndex: 99999999999 }); this.routesById[notFoundRoute.id] = notFoundRoute; } } getRouteBranch(route) { let branch = this.routeBranchCache.get(route); if (!branch) { branch = buildRouteBranch(route); this.routeBranchCache.set(route, branch); } return branch; } get looseRoutesById() { return this.routesById; } getParentContext(parentMatch) { return !parentMatch?.id ? this.options.context ?? void 0 : parentMatch.context ?? this.options.context ?? void 0; } matchRoutesInternal(next, opts) { const matchedRoutesResult = this.getMatchedRoutes(next.pathname); const { foundRoute, routeParams } = matchedRoutesResult; let { matchedRoutes } = matchedRoutesResult; let isGlobalNotFound = false; if (foundRoute ? foundRoute.path !== "/" && routeParams["**"] : trimPathRight(next.pathname)) if (this.options.notFoundRoute) matchedRoutes = [...matchedRoutes, this.options.notFoundRoute]; else isGlobalNotFound = true; const globalNotFoundRouteId = isGlobalNotFound ? findGlobalNotFoundRouteId(this.options.notFoundMode, matchedRoutes) : void 0; const matches = new Array(matchedRoutes.length); const previousActiveMatchesByRouteId = /* @__PURE__ */ new Map(); for (const store of this.stores.matchStores.values()) if (store.routeId) previousActiveMatchesByRouteId.set(store.routeId, store.get()); for (let index = 0; index < matchedRoutes.length; index++) { const route = matchedRoutes[index]; const parentMatch = matches[index - 1]; let preMatchSearch; let strictMatchSearch; let searchError; { const parentSearch = parentMatch?.search ?? next.search; const parentStrictSearch = parentMatch?._strictSearch ?? void 0; try { const strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? void 0; preMatchSearch = { ...parentSearch, ...strictSearch }; strictMatchSearch = { ...parentStrictSearch, ...strictSearch }; searchError = void 0; } catch (err) { let searchParamError = err; if (!(err instanceof SearchParamError)) searchParamError = new SearchParamError(err.message, { cause: err }); if (opts?.throwOnError) throw searchParamError; preMatchSearch = parentSearch; strictMatchSearch = {}; searchError = searchParamError; } } const loaderDeps = route.options.loaderDeps?.({ search: preMatchSearch }) ?? ""; const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : ""; const { interpolatedPath, usedParams } = interpolatePath({ path: route.fullPath, params: routeParams, decoder: this.pathParamsDecoder, server: this.isServer }); const matchId = route.id + interpolatedPath + loaderDepsHash; const existingMatch = this.getMatch(matchId); const previousMatch = previousActiveMatchesByRouteId.get(route.id); const strictParams = existingMatch?._strictParams ?? usedParams; let paramsError = void 0; if (!existingMatch) try { extractStrictParams(route, strictParams); } catch (err) { if (isNotFound(err) || isRedirect(err)) paramsError = err; else paramsError = new PathParamError(err.message, { cause: err }); if (opts?.throwOnError) throw paramsError; } Object.assign(routeParams, strictParams); const cause = previousMatch ? "stay" : "enter"; let match; if (existingMatch) match = { ...existingMatch, cause, params: previousMatch?.params ?? routeParams, _strictParams: strictParams, search: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : nullReplaceEqualDeep(existingMatch.search, preMatchSearch), _strictSearch: strictMatchSearch }; else { const status = route.options.loader || route.options.beforeLoad || route.lazyFn || routeNeedsPreload(route) ? "pending" : "success"; match = { id: matchId, ssr: void 0, index, routeId: route.id, params: previousMatch?.params ?? routeParams, _strictParams: strictParams, pathname: interpolatedPath, updatedAt: Date.now(), search: previousMatch ? nullReplaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch, _strictSearch: strictMatchSearch, searchError: void 0, status, isFetching: false, error: void 0, paramsError, __routeContext: void 0, _nonReactive: { loadPromise: createControlledPromise() }, __beforeLoadContext: void 0, context: {}, abortController: new AbortController(), fetchCount: 0, cause, loaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps, invalid: false, preload: false, links: void 0, scripts: void 0, headScripts: void 0, meta: void 0, staticData: route.options.staticData || {}, fullPath: route.fullPath }; } if (!opts?.preload) match.globalNotFound = globalNotFoundRouteId === route.id; match.searchError = searchError; const parentContext = this.getParentContext(parentMatch); match.context = { ...parentContext, ...match.__routeContext, ...match.__beforeLoadContext }; matches[index] = match; } for (let index = 0; index < matches.length; index++) { const match = matches[index]; const route = this.looseRoutesById[match.routeId]; const existingMatch = this.getMatch(match.id); const previousMatch = previousActiveMatchesByRouteId.get(match.routeId); match.params = previousMatch ? nullReplaceEqualDeep(previousMatch.params, routeParams) : routeParams; if (!existingMatch) { const parentMatch = matches[index - 1]; const parentContext = this.getParentContext(parentMatch); if (route.options.context) { const contextFnContext = { deps: match.loaderDeps, params: match.params, context: parentContext ?? {}, location: next, navigate: (opts) => this.navigate({ ...opts, _fromLocation: next }), buildLocation: this.buildLocation, cause: match.cause, abortController: match.abortController, preload: !!match.preload, matches, routeId: route.id }; match.__routeContext = route.options.context(contextFnContext) ?? void 0; } match.context = { ...parentContext, ...match.__routeContext, ...match.__beforeLoadContext }; } } return matches; } /** * Lightweight route matching for buildLocation. * Only computes fullPath, accumulated search, and params - skipping expensive * operations like AbortController, ControlledPromise, loaderDeps, and full match objects. */ matchRoutesLightweight(location) { const { matchedRoutes, routeParams } = this.getMatchedRoutes(location.pathname); const lastRoute = last(matchedRoutes); const accumulatedSearch = { ...location.search }; for (const route of matchedRoutes) try { Object.assign(accumulatedSearch, validateSearch(route.options.validateSearch, accumulatedSearch)); } catch {} const lastStateMatchId = last(this.stores.matchesId.get()); const lastStateMatch = lastStateMatchId && this.stores.matchStores.get(lastStateMatchId)?.get(); const canReuseParams = lastStateMatch && lastStateMatch.routeId === lastRoute.id && lastStateMatch.pathname === location.pathname; let params; if (canReuseParams) params = lastStateMatch.params; else { const strictParams = Object.assign(Object.create(null), routeParams); for (const route of matchedRoutes) try { extractStrictParams(route, strictParams); } catch {} params = strictParams; } return { matchedRoutes, fullPath: lastRoute.fullPath, search: accumulatedSearch, params }; } }; /** Error thrown when search parameter validation fails. */ var SearchParamError = class extends Error {}; /** Error thrown when path parameter parsing/validation fails. */ var PathParamError = class extends Error {}; /** Create an initial RouterState from a parsed location. */ function getInitialRouterState(location) { return { loadedAt: 0, isLoading: false, isTransitioning: false, status: "idle", resolvedLocation: void 0, location, matches: [], statusCode: 200 }; } function validateSearch(validateSearch, input) { if (validateSearch == null) return {}; if ("~standard" in validateSearch) { const result = validateSearch["~standard"].validate(input); if (result instanceof Promise) throw new SearchParamError("Async validation not supported"); if (result.issues) throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { cause: result }); return result.value; } if ("parse" in validateSearch) return validateSearch.parse(input); if (typeof validateSearch === "function") return validateSearch(input); return {}; } /** * Build the matched route chain and extract params for a pathname. * Falls back to the root route if no specific route is found. */ function getMatchedRoutes({ pathname, routesById, processedTree }) { const routeParams = Object.create(null); const trimmedPath = trimPathRight(pathname); let foundRoute = void 0; const match = findRouteMatch(trimmedPath, processedTree, true); if (match) { foundRoute = match.route; Object.assign(routeParams, match.rawParams); } return { matchedRoutes: match?.branch || [routesById["__root__"]], routeParams, foundRoute }; } /** * TODO: once caches are persisted across requests on the server, * we can cache the built middleware chain using `last(destRoutes)` as the key */ function applySearchMiddleware({ search, dest, destRoutes, _includeValidateSearch }) { return buildMiddlewareChain(destRoutes)(search, dest, _includeValidateSearch ?? false); } function buildMiddlewareChain(destRoutes) { const context = { dest: null, _includeValidateSearch: false, middlewares: [] }; for (const route of destRoutes) { if ("search" in route.options) { if (route.options.search?.middlewares) context.middlewares.push(...route.options.search.middlewares); } else if (route.options.preSearchFilters || route.options.postSearchFilters) { const legacyMiddleware = ({ search, next }) => { let nextSearch = search; if ("preSearchFilters" in route.options && route.options.preSearchFilters) nextSearch = route.options.preSearchFilters.reduce((prev, next) => next(prev), search); const result = next(nextSearch); if ("postSearchFilters" in route.options && route.options.postSearchFilters) return route.options.postSearchFilters.reduce((prev, next) => next(prev), result); return result; }; context.middlewares.push(legacyMiddleware); } if (route.options.validateSearch) { const validate = ({ search, next }) => { const result = next(search); if (!context._includeValidateSearch) return result; try { return { ...result, ...validateSearch(route.options.validateSearch, result) ?? void 0 }; } catch { return result; } }; context.middlewares.push(validate); } } const final = ({ search }) => { const dest = context.dest; if (!dest.search) return {}; if (dest.search === true) return search; return functionalUpdate(dest.search, search); }; context.middlewares.push(final); const applyNext = (index, currentSearch, middlewares) => { if (index >= middlewares.length) return currentSearch; const middleware = middlewares[index]; const next = (newSearch) => { return applyNext(index + 1, newSearch, middlewares); }; return middleware({ search: currentSearch, next }); }; return function middleware(search, dest, _includeValidateSearch) { context.dest = dest; context._includeValidateSearch = _includeValidateSearch; return applyNext(0, search, context.middlewares); }; } function findGlobalNotFoundRouteId(notFoundMode, routes) { if (notFoundMode !== "root") for (let i = routes.length - 1; i >= 0; i--) { const route = routes[i]; if (route.children) return route.id; } return rootRouteId; } function extractStrictParams(route, accumulatedParams) { const parseParams = route.options.params?.parse ?? route.options.parseParams; if (parseParams) { const result = parseParams(accumulatedParams); if (result === false) throw new Error("Route params.parse returned false for a matched route"); Object.assign(accumulatedParams, result); } } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/link.js var preloadWarning = "Error preloading route! ☝️"; //#endregion //#region node_modules/@tanstack/router-core/dist/esm/manifest.js function getAssetCrossOrigin(assetCrossOrigin, kind) { if (!assetCrossOrigin) return; if (typeof assetCrossOrigin === "string") return assetCrossOrigin; return assetCrossOrigin[kind]; } function resolveManifestAssetLink(link) { if (typeof link === "string") return { href: link, crossOrigin: void 0 }; return link; } function getStylesheetHref(asset) { if (asset.tag !== "link") return void 0; const rel = asset.attrs?.rel; const href = asset.attrs?.href; if (typeof href !== "string") return void 0; if (!(typeof rel === "string" ? rel.split(/\s+/) : []).includes("stylesheet")) return void 0; return href; } function isInlinableStylesheet(manifest, asset) { const href = getStylesheetHref(asset); return !!href && manifest?.inlineCss?.styles[href] !== void 0; } function createInlineCssStyleAsset(css) { return { tag: "style", attrs: { suppressHydrationWarning: true }, inlineCss: true, children: css }; } function createInlineCssPlaceholderAsset() { return { tag: "style", attrs: { suppressHydrationWarning: true }, inlineCss: true }; } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/route.js var BaseRoute = class { get to() { return this._to; } get id() { return this._id; } get path() { return this._path; } get fullPath() { return this._fullPath; } constructor(options) { this.init = (opts) => { this.originalIndex = opts.originalIndex; const options = this.options; const isRoot = !options?.path && !options?.id; this.parentRoute = this.options.getParentRoute?.(); if (isRoot) this._path = rootRouteId; else if (!this.parentRoute) invariant(); let path = isRoot ? rootRouteId : options?.path; if (path && path !== "/") path = trimPathLeft(path); const customId = options?.id || path; let id = isRoot ? rootRouteId : joinPaths([this.parentRoute.id === "__root__" ? "" : this.parentRoute.id, customId]); if (path === "__root__") path = "/"; if (id !== "__root__") id = joinPaths(["/", id]); const fullPath = id === "__root__" ? "/" : joinPaths([this.parentRoute.fullPath, path]); this._path = path; this._id = id; this._fullPath = fullPath; this._to = trimPathRight(fullPath); }; this.addChildren = (children) => { return this._addFileChildren(children); }; this._addFileChildren = (children) => { if (Array.isArray(children)) this.children = children; if (typeof children === "object" && children !== null) this.children = Object.values(children); return this; }; this._addFileTypes = () => { return this; }; this.updateLoader = (options) => { Object.assign(this.options, options); return this; }; this.update = (options) => { Object.assign(this.options, options); return this; }; this.lazy = (lazyFn) => { this.lazyFn = lazyFn; return this; }; this.redirect = (opts) => redirect({ from: this.fullPath, ...opts }); this.options = options || {}; this.isRoot = !options?.getParentRoute; if (options?.id && options?.path) throw new Error(`Route cannot have both an 'id' and a 'path' option.`); } }; var BaseRootRoute = class extends BaseRoute { constructor(options) { super(options); } }; //#endregion //#region node_modules/@tanstack/router-core/dist/esm/ssr/constants.js var import_jsx_runtime = require_jsx_runtime(); var GLOBAL_TSR = "$_TSR"; var TSR_SCRIPT_BARRIER_ID = "$tsr-stream-barrier"; //#endregion //#region node_modules/@tanstack/react-router/dist/esm/CatchBoundary.js function CatchBoundary(props) { const errorComponent = props.errorComponent ?? ErrorComponent; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CatchBoundaryImpl, { getResetKey: props.getResetKey, onCatch: props.onCatch, children: ({ error, reset }) => { if (error) return import_react.createElement(errorComponent, { error, reset }); return props.children; } }); } var CatchBoundaryImpl = class extends import_react.Component { constructor(..._args) { super(..._args); this.state = { error: null }; } static getDerivedStateFromProps(props, state) { const resetKey = props.getResetKey(); if (state.error && state.resetKey !== resetKey) return { resetKey, error: null }; return { resetKey }; } static getDerivedStateFromError(error) { return { error }; } reset() { this.setState({ error: null }); } componentDidCatch(error, errorInfo) { if (this.props.onCatch) this.props.onCatch(error, errorInfo); } render() { return this.props.children({ error: this.state.error, reset: () => { this.reset(); } }); } }; function ErrorComponent({ error }) { const [show, setShow] = import_react.useState(false); return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { style: { appearance: "none", fontSize: ".6em", border: "1px solid currentColor", padding: ".1rem .2rem", fontWeight: "bold", borderRadius: ".25rem" }, onClick: () => setShow((d) => !d), children: show ? "Hide Error" : "Show Error" })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { height: ".25rem" } }), show ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { style: { fontSize: ".7em", border: "1px solid red", borderRadius: ".25rem", padding: ".3rem", color: "red", overflow: "auto" }, children: error.message ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: error.message }) : null }) }) : null ] }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/ClientOnly.js /** * Render the children only after the JS has loaded client-side. Use an optional * fallback component if the JS is not yet loaded. * * @example * Render a Chart component if JS loads, renders a simple FakeChart * component server-side or if there is no JS. The FakeChart can have only the * UI without the behavior or be a loading spinner or skeleton. * * ```tsx * return ( * }> * * * ) * ``` */ function ClientOnly({ children, fallback = null }) { return useHydrated() ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: fallback }); } /** * Return a boolean indicating if the JS has been hydrated already. * When doing Server-Side Rendering, the result will always be false. * When doing Client-Side Rendering, the result will always be false on the * first render and true from then on. Even if a new component renders it will * always start with true. * * @example * ```tsx * // Disable a button that needs JS to work. * let hydrated = useHydrated() * return ( * * ) * ``` * @returns True if the JS has been hydrated already, false otherwise. */ function useHydrated() { return import_react.useSyncExternalStore(subscribe, () => true, () => false); } function subscribe() { return () => {}; } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/routerContext.js var routerContext = import_react.createContext(null); //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useRouter.js /** * Access the current TanStack Router instance from React context. * Must be used within a `RouterProvider`. * * Options: * - `warn`: Log a warning if no router context is found (default: true). * * @returns The registered router instance. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook */ function useRouter(opts) { return import_react.useContext(routerContext); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/matchContext.js var matchContext = import_react.createContext(void 0); var dummyMatchContext = import_react.createContext(void 0); //#endregion //#region node_modules/@tanstack/store/dist/esm/alien.js var ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => { ReactiveFlags2[ReactiveFlags2["None"] = 0] = "None"; ReactiveFlags2[ReactiveFlags2["Mutable"] = 1] = "Mutable"; ReactiveFlags2[ReactiveFlags2["Watching"] = 2] = "Watching"; ReactiveFlags2[ReactiveFlags2["RecursedCheck"] = 4] = "RecursedCheck"; ReactiveFlags2[ReactiveFlags2["Recursed"] = 8] = "Recursed"; ReactiveFlags2[ReactiveFlags2["Dirty"] = 16] = "Dirty"; ReactiveFlags2[ReactiveFlags2["Pending"] = 32] = "Pending"; return ReactiveFlags2; })(ReactiveFlags || {}); /* @__NO_SIDE_EFFECTS__ */ function createReactiveSystem({ update, notify, unwatched }) { return { link, unlink, propagate, checkDirty, shallowPropagate }; function link(dep, sub, version) { const prevDep = sub.depsTail; if (prevDep !== void 0 && prevDep.dep === dep) return; const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps; if (nextDep !== void 0 && nextDep.dep === dep) { nextDep.version = version; sub.depsTail = nextDep; return; } const prevSub = dep.subsTail; if (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) return; const newLink = sub.depsTail = dep.subsTail = { version, dep, sub, prevDep, nextDep, prevSub, nextSub: void 0 }; if (nextDep !== void 0) nextDep.prevDep = newLink; if (prevDep !== void 0) prevDep.nextDep = newLink; else sub.deps = newLink; if (prevSub !== void 0) prevSub.nextSub = newLink; else dep.subs = newLink; } function unlink(link2, sub = link2.sub) { const dep = link2.dep; const prevDep = link2.prevDep; const nextDep = link2.nextDep; const nextSub = link2.nextSub; const prevSub = link2.prevSub; if (nextDep !== void 0) nextDep.prevDep = prevDep; else sub.depsTail = prevDep; if (prevDep !== void 0) prevDep.nextDep = nextDep; else sub.deps = nextDep; if (nextSub !== void 0) nextSub.prevSub = prevSub; else dep.subsTail = prevSub; if (prevSub !== void 0) prevSub.nextSub = nextSub; else if ((dep.subs = nextSub) === void 0) unwatched(dep); return nextDep; } function propagate(link2) { let next = link2.nextSub; let stack; top: do { const sub = link2.sub; let flags = sub.flags; if (!(flags & 60)) sub.flags = flags | 32; else if (!(flags & 12)) flags = 0; else if (!(flags & 4)) sub.flags = flags & -9 | 32; else if (!(flags & 48) && isValidLink(link2, sub)) { sub.flags = flags | 40; flags &= 1; } else flags = 0; if (flags & 2) notify(sub); if (flags & 1) { const subSubs = sub.subs; if (subSubs !== void 0) { const nextSub = (link2 = subSubs).nextSub; if (nextSub !== void 0) { stack = { value: next, prev: stack }; next = nextSub; } continue; } } if ((link2 = next) !== void 0) { next = link2.nextSub; continue; } while (stack !== void 0) { link2 = stack.value; stack = stack.prev; if (link2 !== void 0) { next = link2.nextSub; continue top; } } break; } while (true); } function checkDirty(link2, sub) { let stack; let checkDepth = 0; let dirty = false; top: do { const dep = link2.dep; const flags = dep.flags; if (sub.flags & 16) dirty = true; else if ((flags & 17) === 17) { if (update(dep)) { const subs = dep.subs; if (subs.nextSub !== void 0) shallowPropagate(subs); dirty = true; } } else if ((flags & 33) === 33) { if (link2.nextSub !== void 0 || link2.prevSub !== void 0) stack = { value: link2, prev: stack }; link2 = dep.deps; sub = dep; ++checkDepth; continue; } if (!dirty) { const nextDep = link2.nextDep; if (nextDep !== void 0) { link2 = nextDep; continue; } } while (checkDepth--) { const firstSub = sub.subs; const hasMultipleSubs = firstSub.nextSub !== void 0; if (hasMultipleSubs) { link2 = stack.value; stack = stack.prev; } else link2 = firstSub; if (dirty) { if (update(sub)) { if (hasMultipleSubs) shallowPropagate(firstSub); sub = link2.sub; continue; } dirty = false; } else sub.flags &= -33; sub = link2.sub; const nextDep = link2.nextDep; if (nextDep !== void 0) { link2 = nextDep; continue top; } } return dirty; } while (true); } function shallowPropagate(link2) { do { const sub = link2.sub; const flags = sub.flags; if ((flags & 48) === 32) { sub.flags = flags | 16; if ((flags & 6) === 2) notify(sub); } } while ((link2 = link2.nextSub) !== void 0); } function isValidLink(checkLink, sub) { let link2 = sub.depsTail; while (link2 !== void 0) { if (link2 === checkLink) return true; link2 = link2.prevDep; } return false; } } var queuedEffects = []; var { link, unlink, propagate, checkDirty, shallowPropagate } = /* @__PURE__ */ createReactiveSystem({ update(atom) { return atom._update(); }, notify(effect2) { queuedEffects[queuedEffectsLength++] = effect2; effect2.flags &= ~ReactiveFlags.Watching; }, unwatched(atom) { if (atom.depsTail !== void 0) { atom.depsTail = void 0; atom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty; purgeDeps(atom); } } }); var queuedEffectsLength = 0; function purgeDeps(sub) { const depsTail = sub.depsTail; let dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps; while (dep !== void 0) dep = unlink(dep, sub); } //#endregion //#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js /** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var require_use_sync_external_store_shim_production = /* @__PURE__ */ __commonJSMin(((exports) => { var React = require_react(); function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue; function useSyncExternalStore$2(subscribe, getSnapshot) { var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1]; useLayoutEffect(function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [ subscribe, value, getSnapshot ]); useEffect(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe]); useDebugValue(value); return value; } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; inst = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); } catch (error) { return !0; } } function useSyncExternalStore$1(subscribe, getSnapshot) { return getSnapshot(); } var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; })); //#endregion //#region node_modules/use-sync-external-store/shim/index.js var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => { module.exports = require_use_sync_external_store_shim_production(); })); //#endregion //#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js /** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var require_with_selector_production = /* @__PURE__ */ __commonJSMin(((exports) => { var React = require_react(), shim = require_shim(); function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { var instRef = useRef(null); if (null === instRef.current) { var inst = { hasValue: !1, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo(function() { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = !0; memoizedSnapshot = nextSnapshot; nextSnapshot = selector(nextSnapshot); if (void 0 !== isEqual && inst.hasValue) { var currentSelection = inst.value; if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection; } return memoizedSelection = nextSnapshot; } currentSelection = memoizedSelection; if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; var nextSelection = selector(nextSnapshot); if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection; memoizedSnapshot = nextSnapshot; return memoizedSelection = nextSelection; } var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; return [function() { return memoizedSelector(getSnapshot()); }, null === maybeGetServerSnapshot ? void 0 : function() { return memoizedSelector(maybeGetServerSnapshot()); }]; }, [ getSnapshot, getServerSnapshot, selector, isEqual ]); var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); useEffect(function() { inst.hasValue = !0; inst.value = value; }, [value]); useDebugValue(value); return value; }; })); //#endregion //#region node_modules/@tanstack/react-store/dist/esm/useStore.js var import_with_selector = (/* @__PURE__ */ __commonJSMin(((exports, module) => { module.exports = require_with_selector_production(); })))(); function defaultCompare(a, b) { return a === b; } function useStore(atom, selector, compare = defaultCompare) { const subscribe = (0, import_react.useCallback)((handleStoreChange) => { if (!atom) return () => {}; const { unsubscribe } = atom.subscribe(handleStoreChange); return unsubscribe; }, [atom]); const boundGetSnapshot = (0, import_react.useCallback)(() => atom?.get(), [atom]); return (0, import_with_selector.useSyncExternalStoreWithSelector)(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useMatch.js var dummyStore = { get: () => void 0, subscribe: () => ({ unsubscribe: () => {} }) }; /** * Read and select the nearest or targeted route match. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook */ function useMatch(opts) { const router = useRouter(); const nearestMatchId = import_react.useContext(opts.from ? dummyMatchContext : matchContext); const key = opts.from ?? nearestMatchId; const matchStore = key ? opts.from ? router.stores.getRouteMatchStore(key) : router.stores.matchStores.get(key) : void 0; { const match = matchStore?.get(); if ((opts.shouldThrow ?? true) && !match) invariant(); if (match === void 0) return; return opts.select ? opts.select(match) : match; } const previousResult = import_react.useRef(void 0); return useStore(matchStore ?? dummyStore, (match) => { if ((opts.shouldThrow ?? true) && !match) invariant(); if (match === void 0) return; const selected = opts.select ? opts.select(match) : match; if (opts.structuralSharing ?? router.options.defaultStructuralSharing) { const shared = replaceEqualDeep(previousResult.current, selected); previousResult.current = shared; return shared; } return selected; }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useLoaderData.js /** * Read and select the current route's loader data with type‑safety. * * Options: * - `from`/`strict`: Choose which route's data to read and strictness * - `select`: Map the loader data to a derived value * - `structuralSharing`: Enable structural sharing for stable references * * @returns The loader data (or selected value) for the matched route. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook */ function useLoaderData(opts) { return useMatch({ from: opts.from, strict: opts.strict, structuralSharing: opts.structuralSharing, select: (s) => { return opts.select ? opts.select(s.loaderData) : s.loaderData; } }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useLoaderDeps.js /** * Read and select the current route's loader dependencies object. * * Options: * - `from`: Choose which route's loader deps to read * - `select`: Map the deps to a derived value * - `structuralSharing`: Enable structural sharing for stable references * * @returns The loader deps (or selected value) for the matched route. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook */ function useLoaderDeps(opts) { const { select, ...rest } = opts; return useMatch({ ...rest, select: (s) => { return select ? select(s.loaderDeps) : s.loaderDeps; } }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useParams.js /** * Access the current route's path parameters with type-safety. * * Options: * - `from`/`strict`: Specify the matched route and whether to enforce strict typing * - `select`: Project the params object to a derived value for memoized renders * - `structuralSharing`: Enable structural sharing for stable references * - `shouldThrow`: Throw if the route is not found in strict contexts * * @returns The params object (or selected value) for the matched route. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook */ function useParams(opts) { return useMatch({ from: opts.from, shouldThrow: opts.shouldThrow, structuralSharing: opts.structuralSharing, strict: opts.strict, select: (match) => { const params = opts.strict === false ? match.params : match._strictParams; return opts.select ? opts.select(params) : params; } }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useSearch.js /** * Read and select the current route's search parameters with type-safety. * * Options: * - `from`/`strict`: Control which route's search is read and how strictly it's typed * - `select`: Map the search object to a derived value for render optimization * - `structuralSharing`: Enable structural sharing for stable references * - `shouldThrow`: Throw when the route is not found (strict contexts) * * @returns The search object (or selected value) for the matched route. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook */ function useSearch(opts) { return useMatch({ from: opts.from, strict: opts.strict, shouldThrow: opts.shouldThrow, structuralSharing: opts.structuralSharing, select: (match) => { return opts.select ? opts.select(match.search) : match.search; } }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useNavigate.js /** * Imperative navigation hook. * * Returns a stable `navigate(options)` function to change the current location * programmatically. Prefer the `Link` component for user-initiated navigation, * and use this hook from effects, callbacks, or handlers where imperative * navigation is required. * * Options: * - `from`: Optional route base used to resolve relative `to` paths. * * @returns A function that accepts `NavigateOptions`. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useNavigateHook */ function useNavigate(_defaultOpts) { const router = useRouter(); return import_react.useCallback((options) => { return router.navigate({ ...options, from: options.from ?? _defaultOpts?.from }); }, [_defaultOpts?.from, router]); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/useRouteContext.js function useRouteContext(opts) { return useMatch({ ...opts, select: (match) => opts.select ? opts.select(match.context) : match.context }); } //#endregion //#region node_modules/react-dom/cjs/react-dom.production.js /** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var require_react_dom_production = /* @__PURE__ */ __commonJSMin(((exports) => { var React = require_react(); function formatProdErrorMessage(code) { var url = "https://react.dev/errors/" + code; if (1 < arguments.length) { url += "?args[]=" + encodeURIComponent(arguments[1]); for (var i = 2; i < arguments.length; i++) url += "&args[]=" + encodeURIComponent(arguments[i]); } return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; } function noop() {} var Internals = { d: { f: noop, r: function() { throw Error(formatProdErrorMessage(522)); }, D: noop, C: noop, L: noop, m: noop, X: noop, S: noop, M: noop }, p: 0, findDOMNode: null }, REACT_PORTAL_TYPE = Symbol.for("react.portal"); function createPortal$1(children, containerInfo, implementation) { var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; return { $$typeof: REACT_PORTAL_TYPE, key: null == key ? null : "" + key, children, containerInfo, implementation }; } var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; function getCrossOriginStringAs(as, input) { if ("font" === as) return ""; if ("string" === typeof input) return "use-credentials" === input ? input : ""; } exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals; exports.createPortal = function(children, container) { var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error(formatProdErrorMessage(299)); return createPortal$1(children, container, null, key); }; exports.flushSync = function(fn) { var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p; try { if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn(); } finally { ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f(); } }; exports.preconnect = function(href, options) { "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options)); }; exports.prefetchDNS = function(href) { "string" === typeof href && Internals.d.D(href); }; exports.preinit = function(href, options) { if ("string" === typeof href && options && "string" === typeof options.as) { var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0; "style" === as ? Internals.d.S(href, "string" === typeof options.precedence ? options.precedence : void 0, { crossOrigin, integrity, fetchPriority }) : "script" === as && Internals.d.X(href, { crossOrigin, integrity, fetchPriority, nonce: "string" === typeof options.nonce ? options.nonce : void 0 }); } }; exports.preinitModule = function(href, options) { if ("string" === typeof href) if ("object" === typeof options && null !== options) { if (null == options.as || "script" === options.as) { var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin); Internals.d.M(href, { crossOrigin, integrity: "string" === typeof options.integrity ? options.integrity : void 0, nonce: "string" === typeof options.nonce ? options.nonce : void 0 }); } } else options ?? Internals.d.M(href); }; exports.preload = function(href, options) { if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) { var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin); Internals.d.L(href, as, { crossOrigin, integrity: "string" === typeof options.integrity ? options.integrity : void 0, nonce: "string" === typeof options.nonce ? options.nonce : void 0, type: "string" === typeof options.type ? options.type : void 0, fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0, referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0, imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0, imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0, media: "string" === typeof options.media ? options.media : void 0 }); } }; exports.preloadModule = function(href, options) { if ("string" === typeof href) if (options) { var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin); Internals.d.m(href, { as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0, crossOrigin, integrity: "string" === typeof options.integrity ? options.integrity : void 0 }); } else Internals.d.m(href); }; exports.requestFormReset = function(form) { Internals.d.r(form); }; exports.unstable_batchedUpdates = function(fn, a) { return fn(a); }; exports.useFormState = function(action, initialState, permalink) { return ReactSharedInternals.H.useFormState(action, initialState, permalink); }; exports.useFormStatus = function() { return ReactSharedInternals.H.useHostTransitionStatus(); }; exports.version = "19.2.6"; })); //#endregion //#region node_modules/react-dom/index.js var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => { function checkDCE() { if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") return; try { __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); } catch (err) { console.error(err); } } checkDCE(); module.exports = require_react_dom_production(); })); //#endregion //#region node_modules/@tanstack/react-router/dist/esm/link.js var import_react_dom = require_react_dom(); /** * Build anchor-like props for declarative navigation and preloading. * * Returns stable `href`, event handlers and accessibility props derived from * router options and active state. Used internally by `Link` and custom links. * * Options cover `to`, `params`, `search`, `hash`, `state`, `preload`, * `activeProps`, `inactiveProps`, and more. * * @returns React anchor props suitable for `` or custom components. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook */ function useLinkProps(options, forwardedRef) { const router = useRouter(); const innerRef = useForwardedRef(forwardedRef); const { activeProps, inactiveProps, activeOptions, to, preload: userPreload, preloadDelay: userPreloadDelay, preloadIntentProximity: _preloadIntentProximity, hashScrollIntoView, replace, startTransition, resetScroll, viewTransition, children, target, disabled, style, className, onClick, onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart, ignoreBlocker, params: _params, search: _search, hash: _hash, state: _state, mask: _mask, reloadDocument: _reloadDocument, unsafeRelative: _unsafeRelative, from: _from, _fromLocation, ...propsSafeToSpread } = options; { const safeInternal = isSafeInternal(to); if (typeof to === "string" && !safeInternal && to.indexOf(":") > -1) try { new URL(to); if (isDangerousProtocol(to, router.protocolAllowlist)) return { ...propsSafeToSpread, ref: innerRef, href: void 0, ...children && { children }, ...target && { target }, ...disabled && { disabled }, ...style && { style }, ...className && { className } }; return { ...propsSafeToSpread, ref: innerRef, href: to, ...children && { children }, ...target && { target }, ...disabled && { disabled }, ...style && { style }, ...className && { className } }; } catch {} const next = router.buildLocation({ ...options, from: options.from }); const hrefOption = getHrefOption(next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref, next.maskedLocation ? next.maskedLocation.external : next.external, router.history, disabled); const externalLink = (() => { if (hrefOption?.external) { if (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) return; return hrefOption.href; } if (safeInternal) return void 0; if (typeof to === "string" && to.indexOf(":") > -1) try { new URL(to); if (isDangerousProtocol(to, router.protocolAllowlist)) return; return to; } catch {} })(); const isActive = (() => { if (externalLink) return false; const currentLocation = router.stores.location.get(); const exact = activeOptions?.exact ?? false; if (exact) { if (!exactPathTest(currentLocation.pathname, next.pathname, router.basepath)) return false; } else { const currentPathSplit = removeTrailingSlash(currentLocation.pathname, router.basepath); const nextPathSplit = removeTrailingSlash(next.pathname, router.basepath); if (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/"))) return false; } if (activeOptions?.includeSearch ?? true) { if (currentLocation.search !== next.search) { const currentSearchEmpty = !currentLocation.search || typeof currentLocation.search === "object" && !hasKeys(currentLocation.search); const nextSearchEmpty = !next.search || typeof next.search === "object" && !hasKeys(next.search); if (!(currentSearchEmpty && nextSearchEmpty)) { if (!deepEqual(currentLocation.search, next.search, { partial: !exact, ignoreUndefined: !activeOptions?.explicitUndefined })) return false; } } } if (activeOptions?.includeHash) return false; return true; })(); if (externalLink) return { ...propsSafeToSpread, ref: innerRef, href: externalLink, ...children && { children }, ...target && { target }, ...disabled && { disabled }, ...style && { style }, ...className && { className } }; const resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT; const resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT; const resolvedStyle = (() => { const baseStyle = style; const activeStyle = resolvedActiveProps.style; const inactiveStyle = resolvedInactiveProps.style; if (!baseStyle && !activeStyle && !inactiveStyle) return; if (baseStyle && !activeStyle && !inactiveStyle) return baseStyle; if (!baseStyle && activeStyle && !inactiveStyle) return activeStyle; if (!baseStyle && !activeStyle && inactiveStyle) return inactiveStyle; return { ...baseStyle, ...activeStyle, ...inactiveStyle }; })(); const resolvedClassName = (() => { const baseClassName = className; const activeClassName = resolvedActiveProps.className; const inactiveClassName = resolvedInactiveProps.className; if (!baseClassName && !activeClassName && !inactiveClassName) return ""; let out = ""; if (baseClassName) out = baseClassName; if (activeClassName) out = out ? `${out} ${activeClassName}` : activeClassName; if (inactiveClassName) out = out ? `${out} ${inactiveClassName}` : inactiveClassName; return out; })(); return { ...propsSafeToSpread, ...resolvedActiveProps, ...resolvedInactiveProps, href: hrefOption?.href, ref: innerRef, disabled: !!disabled, target, ...resolvedStyle && { style: resolvedStyle }, ...resolvedClassName && { className: resolvedClassName }, ...disabled && STATIC_DISABLED_PROPS, ...isActive && STATIC_ACTIVE_PROPS }; } const isHydrated = useHydrated(); const _options = import_react.useMemo(() => options, [ router, options.from, options._fromLocation, options.hash, options.to, options.search, options.params, options.state, options.mask, options.unsafeRelative ]); const currentLocation = useStore(router.stores.location, (l) => l, (prev, next) => prev.href === next.href); const next = import_react.useMemo(() => { const opts = { _fromLocation: currentLocation, ..._options }; return router.buildLocation(opts); }, [ router, currentLocation, _options ]); const hrefOptionPublicHref = next.maskedLocation ? next.maskedLocation.publicHref : next.publicHref; const hrefOptionExternal = next.maskedLocation ? next.maskedLocation.external : next.external; const hrefOption = import_react.useMemo(() => getHrefOption(hrefOptionPublicHref, hrefOptionExternal, router.history, disabled), [ disabled, hrefOptionExternal, hrefOptionPublicHref, router.history ]); const externalLink = import_react.useMemo(() => { if (hrefOption?.external) { if (isDangerousProtocol(hrefOption.href, router.protocolAllowlist)) return; return hrefOption.href; } if (isSafeInternal(to)) return void 0; if (typeof to !== "string" || to.indexOf(":") === -1) return void 0; try { new URL(to); if (isDangerousProtocol(to, router.protocolAllowlist)) return; return to; } catch {} }, [ to, hrefOption, router.protocolAllowlist ]); const isActive = import_react.useMemo(() => { if (externalLink) return false; if (activeOptions?.exact) { if (!exactPathTest(currentLocation.pathname, next.pathname, router.basepath)) return false; } else { const currentPathSplit = removeTrailingSlash(currentLocation.pathname, router.basepath); const nextPathSplit = removeTrailingSlash(next.pathname, router.basepath); if (!(currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/"))) return false; } if (activeOptions?.includeSearch ?? true) { if (!deepEqual(currentLocation.search, next.search, { partial: !activeOptions?.exact, ignoreUndefined: !activeOptions?.explicitUndefined })) return false; } if (activeOptions?.includeHash) return isHydrated && currentLocation.hash === next.hash; return true; }, [ activeOptions?.exact, activeOptions?.explicitUndefined, activeOptions?.includeHash, activeOptions?.includeSearch, currentLocation, externalLink, isHydrated, next.hash, next.pathname, next.search, router.basepath ]); const resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT; const resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT; const resolvedClassName = [ className, resolvedActiveProps.className, resolvedInactiveProps.className ].filter(Boolean).join(" "); const resolvedStyle = (style || resolvedActiveProps.style || resolvedInactiveProps.style) && { ...style, ...resolvedActiveProps.style, ...resolvedInactiveProps.style }; const [isTransitioning, setIsTransitioning] = import_react.useState(false); const hasRenderFetched = import_react.useRef(false); const preload = options.reloadDocument || externalLink ? false : userPreload ?? router.options.defaultPreload; const preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0; const doPreload = import_react.useCallback(() => { router.preloadRoute({ ..._options, _builtLocation: next }).catch((err) => { console.warn(err); console.warn(preloadWarning); }); }, [ router, _options, next ]); useIntersectionObserver(innerRef, import_react.useCallback((entry) => { if (entry?.isIntersecting) doPreload(); }, [doPreload]), intersectionObserverOptions, { disabled: !!disabled || !(preload === "viewport") }); import_react.useEffect(() => { if (hasRenderFetched.current) return; if (!disabled && preload === "render") { doPreload(); hasRenderFetched.current = true; } }, [ disabled, doPreload, preload ]); const handleClick = (e) => { const elementTarget = e.currentTarget.getAttribute("target"); const effectiveTarget = target !== void 0 ? target : elementTarget; if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === "_self") && e.button === 0) { e.preventDefault(); (0, import_react_dom.flushSync)(() => { setIsTransitioning(true); }); const unsub = router.subscribe("onResolved", () => { unsub(); setIsTransitioning(false); }); router.navigate({ ..._options, replace, resetScroll, hashScrollIntoView, startTransition, viewTransition, ignoreBlocker }); } }; if (externalLink) return { ...propsSafeToSpread, ref: innerRef, href: externalLink, ...children && { children }, ...target && { target }, ...disabled && { disabled }, ...style && { style }, ...className && { className }, ...onClick && { onClick }, ...onBlur && { onBlur }, ...onFocus && { onFocus }, ...onMouseEnter && { onMouseEnter }, ...onMouseLeave && { onMouseLeave }, ...onTouchStart && { onTouchStart } }; const enqueueIntentPreload = (e) => { if (disabled || preload !== "intent") return; if (!preloadDelay) { doPreload(); return; } const eventTarget = e.currentTarget; if (timeoutMap.has(eventTarget)) return; const id = setTimeout(() => { timeoutMap.delete(eventTarget); doPreload(); }, preloadDelay); timeoutMap.set(eventTarget, id); }; const handleTouchStart = (_) => { if (disabled || preload !== "intent") return; doPreload(); }; const handleLeave = (e) => { if (disabled || !preload || !preloadDelay) return; const eventTarget = e.currentTarget; const id = timeoutMap.get(eventTarget); if (id) { clearTimeout(id); timeoutMap.delete(eventTarget); } }; return { ...propsSafeToSpread, ...resolvedActiveProps, ...resolvedInactiveProps, href: hrefOption?.href, ref: innerRef, onClick: composeHandlers([onClick, handleClick]), onBlur: composeHandlers([onBlur, handleLeave]), onFocus: composeHandlers([onFocus, enqueueIntentPreload]), onMouseEnter: composeHandlers([onMouseEnter, enqueueIntentPreload]), onMouseLeave: composeHandlers([onMouseLeave, handleLeave]), onTouchStart: composeHandlers([onTouchStart, handleTouchStart]), disabled: !!disabled, target, ...resolvedStyle && { style: resolvedStyle }, ...resolvedClassName && { className: resolvedClassName }, ...disabled && STATIC_DISABLED_PROPS, ...isActive && STATIC_ACTIVE_PROPS, ...isHydrated && isTransitioning && STATIC_TRANSITIONING_PROPS }; } var STATIC_EMPTY_OBJECT = {}; var STATIC_ACTIVE_OBJECT = { className: "active" }; var STATIC_DISABLED_PROPS = { role: "link", "aria-disabled": true }; var STATIC_ACTIVE_PROPS = { "data-status": "active", "aria-current": "page" }; var STATIC_TRANSITIONING_PROPS = { "data-transitioning": "transitioning" }; var timeoutMap = /* @__PURE__ */ new WeakMap(); var intersectionObserverOptions = { rootMargin: "100px" }; var composeHandlers = (handlers) => (e) => { for (const handler of handlers) { if (!handler) continue; if (e.defaultPrevented) return; handler(e); } }; function getHrefOption(publicHref, external, history, disabled) { if (disabled) return void 0; if (external) return { href: publicHref, external: true }; return { href: history.createHref(publicHref) || "/", external: false }; } function isSafeInternal(to) { if (typeof to !== "string") return false; const zero = to.charCodeAt(0); if (zero === 47) return to.charCodeAt(1) !== 47; return zero === 46; } /** * A strongly-typed anchor component for declarative navigation. * Handles path, search, hash and state updates with optional route preloading * and active-state styling. * * Props: * - `preload`: Controls route preloading (eg. 'intent', 'render', 'viewport', true/false) * - `preloadDelay`: Delay in ms before preloading on hover * - `activeProps`/`inactiveProps`: Additional props merged when link is active/inactive * - `resetScroll`/`hashScrollIntoView`: Control scroll behavior on navigation * - `viewTransition`/`startTransition`: Use View Transitions/React transitions for navigation * - `ignoreBlocker`: Bypass registered blockers * * @returns An anchor-like element that navigates without full page reloads. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/linkComponent */ var Link = import_react.forwardRef((props, ref) => { const { _asChild, ...rest } = props; const { type: _type, ...linkProps } = useLinkProps(rest, ref); const children = typeof rest.children === "function" ? rest.children({ isActive: linkProps["data-status"] === "active" }) : rest.children; if (!_asChild) { const { disabled: _, ...rest } = linkProps; return import_react.createElement("a", rest, children); } return import_react.createElement(_asChild, linkProps, children); }); function isCtrlEvent(e) { return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/route.js var Route = class extends BaseRoute { /** * @deprecated Use the `createRoute` function instead. */ constructor(options) { super(options); this.useMatch = (opts) => { return useMatch({ select: opts?.select, from: this.id, structuralSharing: opts?.structuralSharing }); }; this.useRouteContext = (opts) => { return useRouteContext({ ...opts, from: this.id }); }; this.useSearch = (opts) => { return useSearch({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useParams = (opts) => { return useParams({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useLoaderDeps = (opts) => { return useLoaderDeps({ ...opts, from: this.id }); }; this.useLoaderData = (opts) => { return useLoaderData({ ...opts, from: this.id }); }; this.useNavigate = () => { return useNavigate({ from: this.fullPath }); }; this.Link = import_react.forwardRef((props, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { ref, from: this.fullPath, ...props }); }); } }; /** * Creates a non-root Route instance for code-based routing. * * Use this to define a route that will be composed into a route tree * (typically via a parent route's `addChildren`). If you're using file-based * routing, prefer `createFileRoute`. * * @param options Route options (path, component, loader, context, etc.). * @returns A Route instance to be attached to the route tree. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction */ function createRoute(options) { return new Route(options); } var RootRoute = class extends BaseRootRoute { /** * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead. */ constructor(options) { super(options); this.useMatch = (opts) => { return useMatch({ select: opts?.select, from: this.id, structuralSharing: opts?.structuralSharing }); }; this.useRouteContext = (opts) => { return useRouteContext({ ...opts, from: this.id }); }; this.useSearch = (opts) => { return useSearch({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useParams = (opts) => { return useParams({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useLoaderDeps = (opts) => { return useLoaderDeps({ ...opts, from: this.id }); }; this.useLoaderData = (opts) => { return useLoaderData({ ...opts, from: this.id }); }; this.useNavigate = () => { return useNavigate({ from: this.fullPath }); }; this.Link = import_react.forwardRef((props, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { ref, from: this.fullPath, ...props }); }); } }; /** * Creates a root Route instance used to build your route tree. * * Typically paired with `createRouter({ routeTree })`. If you need to require * a typed router context, use `createRootRouteWithContext` instead. * * @param options Root route options (component, error, pending, etc.). * @returns A root route instance. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction */ function createRootRoute(options) { return new RootRoute(options); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/fileRoute.js /** * Creates a file-based Route factory for a given path. * * Used by TanStack Router's file-based routing to associate a file with a * route. The returned function accepts standard route options. In normal usage * the `path` string is inserted and maintained by the `tsr` generator. * * @param path File path literal for the route (usually auto-generated). * @returns A function that accepts Route options and returns a Route instance. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction */ function createFileRoute(path) { return new FileRoute(path, { silent: true }).createRoute; } /** @deprecated It's no longer recommended to use the `FileRoute` class directly. Instead, use `createFileRoute('/path/to/file')(options)` to create a file route. */ var FileRoute = class { constructor(path, _opts) { this.path = path; this.createRoute = (options) => { const route = createRoute(options); route.isRoot = false; return route; }; this.silent = _opts?.silent; } }; //#endregion //#region node_modules/@tanstack/react-router/dist/esm/lazyRouteComponent.js /** * Wrap a dynamic import to create a route component that supports * `.preload()` and friendly reload-on-module-missing behavior. * * @param importer Function returning a module promise * @param exportName Named export to use (default: `default`) * @returns A lazy route component compatible with TanStack Router * @link https://tanstack.com/router/latest/docs/framework/react/api/router/lazyRouteComponentFunction */ function lazyRouteComponent(importer, exportName) { let loadPromise; let comp; let error; let reload; const load = () => { if (!loadPromise) loadPromise = importer().then((res) => { loadPromise = void 0; comp = res[exportName ?? "default"]; }).catch((err) => { error = err; if (isModuleNotFoundError(error)) { if (error instanceof Error && typeof window !== "undefined" && typeof sessionStorage !== "undefined") { const storageKey = `tanstack_router_reload:${error.message}`; if (!sessionStorage.getItem(storageKey)) { sessionStorage.setItem(storageKey, "1"); reload = true; } } } }); return loadPromise; }; const lazyComp = function Lazy(props) { if (reload) { window.location.reload(); throw new Promise(() => {}); } if (error) throw error; if (!comp) if (reactUse) reactUse(load()); else throw load(); return import_react.createElement(comp, props); }; lazyComp.preload = load; return lazyComp; } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/not-found.js function CatchNotFound(props) { const router = useRouter(); { const resetKey = `not-found-${router.stores.location.get().pathname}-${router.stores.status.get()}`; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CatchBoundary, { getResetKey: () => resetKey, onCatch: (error, errorInfo) => { if (isNotFound(error)) props.onCatch?.(error, errorInfo); else throw error; }, errorComponent: ({ error }) => { if (isNotFound(error)) return props.fallback?.(error); else throw error; }, children: props.children }); } const resetKey = `not-found-${useStore(router.stores.location, (location) => location.pathname)}-${useStore(router.stores.status, (status) => status)}`; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CatchBoundary, { getResetKey: () => resetKey, onCatch: (error, errorInfo) => { if (isNotFound(error)) props.onCatch?.(error, errorInfo); else throw error; }, errorComponent: ({ error }) => { if (isNotFound(error)) return props.fallback?.(error); else throw error; }, children: props.children }); } function DefaultGlobalNotFound() { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Not Found" }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/ScriptOnce.js /** * Server-only helper to emit a script tag exactly once during SSR. */ function ScriptOnce({ children }) { const router = useRouter(); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", { nonce: router.options.ssr?.nonce, dangerouslySetInnerHTML: { __html: children + ";document.currentScript.remove()" } }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/SafeFragment.js function SafeFragment(props) { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: props.children }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/renderRouteNotFound.js /** * Renders a not found component for a route when no matching route is found. * * @param router - The router instance containing the route configuration * @param route - The route that triggered the not found state * @param data - Additional data to pass to the not found component * @returns The rendered not found component or a default fallback component */ function renderRouteNotFound(router, route, data) { if (!route.options.notFoundComponent) { if (router.options.defaultNotFoundComponent) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(router.options.defaultNotFoundComponent, { ...data }); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultGlobalNotFound, {}); } return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(route.options.notFoundComponent, { ...data }); } //#endregion //#region node_modules/@tanstack/router-core/dist/esm/scroll-restoration-inline.js var scroll_restoration_inline_default = "function(t){let s;try{s=JSON.parse(sessionStorage.getItem(t.storageKey)||\"{}\")}catch(e){console.error(e);return}const c=t.key||window.history.state?.__TSR_key,r=c?s[c]:void 0;if(t.shouldScrollRestoration&&r&&typeof r==\"object\"&&Object.keys(r).length>0){for(const e in r){const o=r[e];if(!o||typeof o!=\"object\")continue;const l=o.scrollX,i=o.scrollY;if(!(!Number.isFinite(l)||!Number.isFinite(i))){if(e===\"window\")window.scrollTo({top:i,left:l,behavior:t.behavior});else if(e){let n;try{n=document.querySelector(e)}catch{continue}n&&(n.scrollLeft=l,n.scrollTop=i)}}}return}const a=window.location.hash.split(\"#\",2)[1];if(a){const e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){const o=document.getElementById(a);o&&o.scrollIntoView(e)}return}window.scrollTo({top:0,left:0,behavior:t.behavior})}"; //#endregion //#region node_modules/@tanstack/router-core/dist/esm/scroll-restoration-script/server.js var defaultInlineScrollRestorationScript = `(${scroll_restoration_inline_default})(${escapeHtml(JSON.stringify({ storageKey, shouldScrollRestoration: true }))})`; function getScrollRestorationScript(options) { if (options.storageKey === "tsr-scroll-restoration-v1_3" && options.shouldScrollRestoration === true && options.key === void 0 && options.behavior === void 0) return defaultInlineScrollRestorationScript; return `(${scroll_restoration_inline_default})(${escapeHtml(JSON.stringify(options))})`; } function getScrollRestorationScriptForRouter(router) { if (typeof router.options.scrollRestoration === "function" && !router.options.scrollRestoration({ location: router.latestLocation })) return null; const getKey = router.options.getScrollRestorationKey; if (!getKey) return defaultInlineScrollRestorationScript; const location = router.latestLocation; const userKey = getKey(location); if (userKey === defaultGetScrollRestorationKey(location)) return defaultInlineScrollRestorationScript; return getScrollRestorationScript({ storageKey, shouldScrollRestoration: true, key: userKey }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/scroll-restoration.js function ScrollRestoration() { const script = getScrollRestorationScriptForRouter(useRouter()); if (!script) return null; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScriptOnce, { children: script }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/Match.js var Match = import_react.memo(function MatchImpl({ matchId }) { const router = useRouter(); { const match = router.stores.matchStores.get(matchId)?.get(); if (!match) invariant(); const routeId = match.routeId; const parentRouteId = router.routesById[routeId].parentRoute?.id; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MatchView, { router, matchId, resetKey: router.stores.loadedAt.get(), matchState: { routeId, ssr: match.ssr, _displayPending: match._displayPending, parentRouteId } }); } const matchStore = router.stores.matchStores.get(matchId); if (!matchStore) invariant(); const resetKey = useStore(router.stores.loadedAt, (loadedAt) => loadedAt); const match = useStore(matchStore, (value) => value); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MatchView, { router, matchId, resetKey, matchState: import_react.useMemo(() => { const routeId = match.routeId; const parentRouteId = router.routesById[routeId].parentRoute?.id; return { routeId, ssr: match.ssr, _displayPending: match._displayPending, parentRouteId }; }, [ match._displayPending, match.routeId, match.ssr, router.routesById ]) }); }); function MatchView({ router, matchId, resetKey, matchState }) { const route = router.routesById[matchState.routeId]; const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent; const pendingElement = PendingComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PendingComponent, {}) : null; const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent; const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch; const routeNotFoundComponent = route.isRoot ? route.options.notFoundComponent ?? router.options.notFoundRoute?.options.component : route.options.notFoundComponent; const resolvedNoSsr = matchState.ssr === false || matchState.ssr === "data-only"; const ResolvedSuspenseBoundary = (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) && (route.options.wrapInSuspense ?? PendingComponent ?? (route.options.errorComponent?.preload || resolvedNoSsr)) ? import_react.Suspense : SafeFragment; const ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment; const ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment; return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(route.isRoot ? route.options.shellComponent ?? SafeFragment : SafeFragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResolvedSuspenseBoundary, { fallback: pendingElement, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResolvedCatchBoundary, { getResetKey: () => resetKey, errorComponent: routeErrorComponent || ErrorComponent, onCatch: (error, errorInfo) => { if (isNotFound(error)) { error.routeId ??= matchState.routeId; throw error; } routeOnCatch?.(error, errorInfo); }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResolvedNotFoundBoundary, { fallback: (error) => { error.routeId ??= matchState.routeId; if (!routeNotFoundComponent || error.routeId && error.routeId !== matchState.routeId || !error.routeId && !route.isRoot) throw error; return import_react.createElement(routeNotFoundComponent, error); }, children: resolvedNoSsr || matchState._displayPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClientOnly, { fallback: pendingElement, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MatchInner, { matchId }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MatchInner, { matchId }) }) }) }) }), matchState.parentRouteId === "__root__" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(OnRendered, { resetKey }), router.options.scrollRestoration && true ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollRestoration, {}) : null] }) : null] }); } function OnRendered({ resetKey }) { useRouter(); return null; } var MatchInner = import_react.memo(function MatchInnerImpl({ matchId }) { const router = useRouter(); const getMatchPromise = (match, key) => { return router.getMatch(match.id)?._nonReactive[key] ?? match._nonReactive[key]; }; { const match = router.stores.matchStores.get(matchId)?.get(); if (!match) invariant(); const routeId = match.routeId; const route = router.routesById[routeId]; const remountDeps = (router.routesById[routeId].options.remountDeps ?? router.options.defaultRemountDeps)?.({ routeId, loaderDeps: match.loaderDeps, params: match._strictParams, search: match._strictSearch }); const key = remountDeps ? JSON.stringify(remountDeps) : void 0; const Comp = route.options.component ?? router.options.defaultComponent; const out = Comp ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, {}, key) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Outlet, {}); if (match._displayPending) throw getMatchPromise(match, "displayPendingPromise"); if (match._forcePending) throw getMatchPromise(match, "minPendingPromise"); if (match.status === "pending") throw getMatchPromise(match, "loadPromise"); if (match.status === "notFound") { if (!isNotFound(match.error)) invariant(); return renderRouteNotFound(router, route, match.error); } if (match.status === "redirected") { if (!isRedirect(match.error)) invariant(); throw getMatchPromise(match, "loadPromise"); } if (match.status === "error") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)((route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent, { error: match.error, reset: void 0, info: { componentStack: "" } }); return out; } const matchStore = router.stores.matchStores.get(matchId); if (!matchStore) invariant(); const match = useStore(matchStore, (value) => value); const routeId = match.routeId; const route = router.routesById[routeId]; const key = import_react.useMemo(() => { const remountDeps = (router.routesById[routeId].options.remountDeps ?? router.options.defaultRemountDeps)?.({ routeId, loaderDeps: match.loaderDeps, params: match._strictParams, search: match._strictSearch }); return remountDeps ? JSON.stringify(remountDeps) : void 0; }, [ routeId, match.loaderDeps, match._strictParams, match._strictSearch, router.options.defaultRemountDeps, router.routesById ]); const out = import_react.useMemo(() => { const Comp = route.options.component ?? router.options.defaultComponent; if (Comp) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, {}, key); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Outlet, {}); }, [ key, route.options.component, router.options.defaultComponent ]); if (match._displayPending) throw getMatchPromise(match, "displayPendingPromise"); if (match._forcePending) throw getMatchPromise(match, "minPendingPromise"); if (match.status === "pending") { if (route.options.pendingMinMs ?? router.options.defaultPendingMinMs) { const routerMatch = router.getMatch(match.id); if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {} } throw getMatchPromise(match, "loadPromise"); } if (match.status === "notFound") { if (!isNotFound(match.error)) invariant(); return renderRouteNotFound(router, route, match.error); } if (match.status === "redirected") { if (!isRedirect(match.error)) invariant(); throw getMatchPromise(match, "loadPromise"); } if (match.status === "error") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)((route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent, { error: match.error, reset: void 0, info: { componentStack: "" } }); return out; }); /** * Render the next child match in the route tree. Typically used inside * a route component to render nested routes. * * @link https://tanstack.com/router/latest/docs/framework/react/api/router/outletComponent */ var Outlet = import_react.memo(function OutletImpl() { const router = useRouter(); const matchId = import_react.useContext(matchContext); let routeId; let parentGlobalNotFound = false; let childMatchId; { const matches = router.stores.matches.get(); const parentIndex = matchId ? matches.findIndex((match) => match.id === matchId) : -1; const parentMatch = parentIndex >= 0 ? matches[parentIndex] : void 0; routeId = parentMatch?.routeId; parentGlobalNotFound = parentMatch?.globalNotFound ?? false; childMatchId = parentIndex >= 0 ? matches[parentIndex + 1]?.id : void 0; } const route = routeId ? router.routesById[routeId] : void 0; const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(router.options.defaultPendingComponent, {}) : null; if (parentGlobalNotFound) { if (!route) invariant(); return renderRouteNotFound(router, route, void 0); } if (!childMatchId) return null; const nextMatch = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Match, { matchId: childMatchId }); if (routeId === "__root__") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: pendingElement, children: nextMatch }); return nextMatch; }); //#endregion //#region node_modules/@tanstack/react-router/dist/esm/Matches.js /** * Internal component that renders the router's active match tree with * suspense, error, and not-found boundaries. Rendered by `RouterProvider`. */ function Matches() { const router = useRouter(); const PendingComponent = router.routesById["__root__"].options.pendingComponent ?? router.options.defaultPendingComponent; const pendingElement = PendingComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PendingComponent, {}) : null; const inner = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SafeFragment, { fallback: pendingElement, children: [false, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MatchesInner, {})] }); return router.options.InnerWrap ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(router.options.InnerWrap, { children: inner }) : inner; } function MatchesInner() { const router = useRouter(); const matchId = router.stores.firstId.get(); const resetKey = router.stores.loadedAt.get(); const matchComponent = matchId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Match, { matchId }) : null; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(matchContext.Provider, { value: matchId, children: router.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CatchBoundary, { getResetKey: () => resetKey, errorComponent: ErrorComponent, onCatch: void 0, children: matchComponent }) }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/routerStores.js var getStoreFactory = (opts) => { return { createMutableStore: createNonReactiveMutableStore, createReadonlyStore: createNonReactiveReadonlyStore, batch: (fn) => fn() }; }; //#endregion //#region node_modules/@tanstack/react-router/dist/esm/router.js /** * Creates a new Router instance for React. * * Pass the returned router to `RouterProvider` to enable routing. * Notable options: `routeTree` (your route definitions) and `context` * (required if the root route was created with `createRootRouteWithContext`). * * @param options Router options used to configure the router. * @returns A Router instance to be provided to `RouterProvider`. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction */ var createRouter = (options) => { return new Router(options); }; var Router = class extends RouterCore { constructor(options) { super(options, getStoreFactory); } }; //#endregion //#region node_modules/@tanstack/react-router/dist/esm/RouterProvider.js /** * Low-level provider that places the router into React context and optionally * updates router options from props. Most apps should use `RouterProvider`. */ function RouterContextProvider({ router, children, ...rest }) { if (hasKeys(rest)) router.update({ ...router.options, ...rest, context: { ...router.options.context, ...rest.context } }); const provider = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(routerContext.Provider, { value: router, children }); if (router.options.Wrap) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(router.options.Wrap, { children: provider }); return provider; } /** * Top-level component that renders the active route matches and provides the * router to the React tree via context. * * Accepts the same options as `createRouter` via props to update the router * instance after creation. * * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction */ function RouterProvider({ router, ...rest }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouterContextProvider, { router, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Matches, {}) }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/Asset.js function Asset(asset) { const { attrs, children, nonce } = asset; switch (asset.tag) { case "title": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { ...attrs, suppressHydrationWarning: true, children }); case "meta": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("meta", { ...attrs, suppressHydrationWarning: true }); case "link": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("link", { ...attrs, precedence: attrs?.precedence ?? (attrs?.rel === "stylesheet" ? "default" : void 0), nonce, suppressHydrationWarning: true }); case "style": if (asset.inlineCss && false); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { ...attrs, dangerouslySetInnerHTML: { __html: children }, nonce }); case "script": return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Script, { attrs, children }); default: return null; } } function Script({ attrs, children }) { useRouter(); useHydrated(); const dataScript = typeof attrs?.type === "string" && attrs.type !== "" && attrs.type !== "text/javascript" && attrs.type !== "module"; import_react.useEffect(() => { if (dataScript) return; if (attrs?.src) { const normSrc = (() => { try { const base = document.baseURI || window.location.href; return new URL(attrs.src, base).href; } catch { return attrs.src; } })(); if (Array.from(document.querySelectorAll("script[src]")).find((el) => el.src === normSrc)) return; const script = document.createElement("script"); for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value)); document.head.appendChild(script); return () => { if (script.parentNode) script.parentNode.removeChild(script); }; } if (typeof children === "string") { const typeAttr = typeof attrs?.type === "string" ? attrs.type : "text/javascript"; const nonceAttr = typeof attrs?.nonce === "string" ? attrs.nonce : void 0; if (Array.from(document.querySelectorAll("script:not([src])")).find((el) => { if (!(el instanceof HTMLScriptElement)) return false; const sType = el.getAttribute("type") ?? "text/javascript"; const sNonce = el.getAttribute("nonce") ?? void 0; return el.textContent === children && sType === typeAttr && sNonce === nonceAttr; })) return; const script = document.createElement("script"); script.textContent = children; if (attrs) { for (const [key, value] of Object.entries(attrs)) if (key !== "suppressHydrationWarning" && value !== void 0 && value !== false) script.setAttribute(key, typeof value === "boolean" ? "" : String(value)); } document.head.appendChild(script); return () => { if (script.parentNode) script.parentNode.removeChild(script); }; } }, [ attrs, children, dataScript ]); if (attrs?.src) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", { ...attrs, suppressHydrationWarning: true }); if (typeof children === "string") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("script", { ...attrs, dangerouslySetInnerHTML: { __html: children }, suppressHydrationWarning: true }); return null; } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/headContentUtils.js function buildTagsFromMatches(router, nonce, matches, assetCrossOrigin) { const routeMeta = matches.map((match) => match.meta).filter(Boolean); const resultMeta = []; const metaByAttribute = {}; let title; for (let i = routeMeta.length - 1; i >= 0; i--) { const metas = routeMeta[i]; for (let j = metas.length - 1; j >= 0; j--) { const m = metas[j]; if (!m) continue; if (m.title) { if (!title) title = { tag: "title", children: m.title }; } else if ("script:ld+json" in m) try { const json = JSON.stringify(m["script:ld+json"]); resultMeta.push({ tag: "script", attrs: { type: "application/ld+json" }, children: escapeHtml(json) }); } catch {} else { const attribute = m.name ?? m.property; if (attribute) if (metaByAttribute[attribute]) continue; else metaByAttribute[attribute] = true; resultMeta.push({ tag: "meta", attrs: { ...m, nonce } }); } } } if (title) resultMeta.push(title); if (nonce) resultMeta.push({ tag: "meta", attrs: { property: "csp-nonce", content: nonce } }); resultMeta.reverse(); const constructedLinks = matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({ tag: "link", attrs: { ...link, nonce } })); const manifest = router.ssr?.manifest; const assetLinks = matches.map((match) => manifest?.routes[match.routeId]?.assets ?? []).filter(Boolean).flat(1).flatMap((asset) => { if (asset.tag === "link") { if (isInlinableStylesheet(manifest, asset)) return []; return [{ tag: "link", attrs: { ...asset.attrs, crossOrigin: getAssetCrossOrigin(assetCrossOrigin, "stylesheet") ?? asset.attrs?.crossOrigin, suppressHydrationWarning: true, nonce } }]; } if (asset.tag === "style") return [{ tag: "style", attrs: { ...asset.attrs, nonce }, children: asset.children, ...asset.inlineCss ? { inlineCss: true } : {} }]; return []; }); const preloadLinks = []; matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => router.ssr?.manifest?.routes[route.id]?.preloads?.filter(Boolean).forEach((preload) => { const preloadLink = resolveManifestAssetLink(preload); preloadLinks.push({ tag: "link", attrs: { rel: "modulepreload", href: preloadLink.href, crossOrigin: getAssetCrossOrigin(assetCrossOrigin, "modulepreload") ?? preloadLink.crossOrigin, nonce } }); })); const styles = matches.map((match) => match.styles).flat(1).filter(Boolean).map(({ children, ...attrs }) => ({ tag: "style", attrs: { ...attrs, nonce }, children })); const headScripts = matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({ tag: "script", attrs: { ...script, nonce }, children })); return uniqBy([ ...resultMeta, ...preloadLinks, ...constructedLinks, ...assetLinks, ...styles, ...headScripts ], (d) => JSON.stringify(d)); } /** * Build the list of head/link/meta/script tags to render for active matches. * Used internally by `HeadContent`. */ var useTags = (assetCrossOrigin) => { const router = useRouter(); const nonce = router.options.ssr?.nonce; return buildTagsFromMatches(router, nonce, router.stores.matches.get(), assetCrossOrigin); }; function uniqBy(arr, fn) { const seen = /* @__PURE__ */ new Set(); return arr.filter((item) => { const key = fn(item); if (seen.has(key)) return false; seen.add(key); return true; }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/HeadContent.js /** * Render route-managed head tags (title, meta, links, styles, head scripts). * Place inside the document head of your app shell. * @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management */ function HeadContent(props) { const tags = useTags(props.assetCrossOrigin); const nonce = useRouter().options.ssr?.nonce; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: tags.map((tag) => /* @__PURE__ */ (0, import_react.createElement)(Asset, { ...tag, key: `tsr-meta-${JSON.stringify(tag)}`, nonce })) }); } //#endregion //#region node_modules/@tanstack/react-router/dist/esm/Scripts.js /** * Render body script tags collected from route matches and SSR manifests. * Should be placed near the end of the document body. */ var Scripts = () => { const router = useRouter(); const nonce = router.options.ssr?.nonce; const getAssetScripts = (matches) => { const assetScripts = []; const manifest = router.ssr?.manifest; if (!manifest) return []; matches.map((match) => router.looseRoutesById[match.routeId]).forEach((route) => manifest.routes[route.id]?.assets?.filter((d) => d.tag === "script").forEach((asset) => { assetScripts.push({ tag: "script", attrs: { ...asset.attrs, nonce }, children: asset.children }); })); return assetScripts; }; const getScripts = (matches) => matches.map((match) => match.scripts).flat(1).filter(Boolean).map(({ children, ...script }) => ({ tag: "script", attrs: { ...script, suppressHydrationWarning: true, nonce }, children })); { const activeMatches = router.stores.matches.get(); const assetScripts = getAssetScripts(activeMatches); return renderScripts(router, getScripts(activeMatches), assetScripts); } const assetScripts = useStore(router.stores.matches, getAssetScripts, deepEqual); return renderScripts(router, useStore(router.stores.matches, getScripts, deepEqual), assetScripts); }; function renderScripts(router, scripts, assetScripts) { let serverBufferedScript = void 0; if (router.serverSsr) serverBufferedScript = router.serverSsr.takeBufferedScripts(); const allScripts = [...scripts, ...assetScripts]; if (serverBufferedScript) allScripts.unshift(serverBufferedScript); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: allScripts.map((asset, i) => /* @__PURE__ */ (0, import_react.createElement)(Asset, { ...asset, key: `tsr-scripts-${asset.tag}-${i}` })) }); } //#endregion //#region node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js /** * @license React * react-dom-server-legacy.node.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var require_react_dom_server_legacy_node_production = /* @__PURE__ */ __commonJSMin(((exports) => { var React = require_react(), ReactDOM = require_react_dom(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator; function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) return null; maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"]; return "function" === typeof maybeIterable ? maybeIterable : null; } var isArrayImpl = Array.isArray; function murmurhash3_32_gc(key, seed) { var remainder = key.length & 3; var bytes = key.length - remainder; var h1 = seed; for (seed = 0; seed < bytes;) { var k1 = key.charCodeAt(seed) & 255 | (key.charCodeAt(++seed) & 255) << 8 | (key.charCodeAt(++seed) & 255) << 16 | (key.charCodeAt(++seed) & 255) << 24; ++seed; k1 = 3432918353 * (k1 & 65535) + ((3432918353 * (k1 >>> 16) & 65535) << 16) & 4294967295; k1 = k1 << 15 | k1 >>> 17; k1 = 461845907 * (k1 & 65535) + ((461845907 * (k1 >>> 16) & 65535) << 16) & 4294967295; h1 ^= k1; h1 = h1 << 13 | h1 >>> 19; h1 = 5 * (h1 & 65535) + ((5 * (h1 >>> 16) & 65535) << 16) & 4294967295; h1 = (h1 & 65535) + 27492 + (((h1 >>> 16) + 58964 & 65535) << 16); } k1 = 0; switch (remainder) { case 3: k1 ^= (key.charCodeAt(seed + 2) & 255) << 16; case 2: k1 ^= (key.charCodeAt(seed + 1) & 255) << 8; case 1: k1 ^= key.charCodeAt(seed) & 255, k1 = 3432918353 * (k1 & 65535) + ((3432918353 * (k1 >>> 16) & 65535) << 16) & 4294967295, k1 = k1 << 15 | k1 >>> 17, h1 ^= 461845907 * (k1 & 65535) + ((461845907 * (k1 >>> 16) & 65535) << 16) & 4294967295; } h1 ^= key.length; h1 ^= h1 >>> 16; h1 = 2246822507 * (h1 & 65535) + ((2246822507 * (h1 >>> 16) & 65535) << 16) & 4294967295; h1 ^= h1 >>> 13; h1 = 3266489909 * (h1 & 65535) + ((3266489909 * (h1 >>> 16) & 65535) << 16) & 4294967295; return (h1 ^ h1 >>> 16) >>> 0; } var assign = Object.assign, hasOwnProperty = Object.prototype.hasOwnProperty, VALID_ATTRIBUTE_NAME_REGEX = RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"), illegalAttributeNameCache = {}, validatedAttributeNameCache = {}; function isAttributeNameSafe(attributeName) { if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) return !0; if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1; if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) return validatedAttributeNameCache[attributeName] = !0; illegalAttributeNameCache[attributeName] = !0; return !1; } var unitlessNumbers = new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")), aliases = new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"], ["crossOrigin", "crossorigin"], ["accentHeight", "accent-height"], ["alignmentBaseline", "alignment-baseline"], ["arabicForm", "arabic-form"], ["baselineShift", "baseline-shift"], ["capHeight", "cap-height"], ["clipPath", "clip-path"], ["clipRule", "clip-rule"], ["colorInterpolation", "color-interpolation"], ["colorInterpolationFilters", "color-interpolation-filters"], ["colorProfile", "color-profile"], ["colorRendering", "color-rendering"], ["dominantBaseline", "dominant-baseline"], ["enableBackground", "enable-background"], ["fillOpacity", "fill-opacity"], ["fillRule", "fill-rule"], ["floodColor", "flood-color"], ["floodOpacity", "flood-opacity"], ["fontFamily", "font-family"], ["fontSize", "font-size"], ["fontSizeAdjust", "font-size-adjust"], ["fontStretch", "font-stretch"], ["fontStyle", "font-style"], ["fontVariant", "font-variant"], ["fontWeight", "font-weight"], ["glyphName", "glyph-name"], ["glyphOrientationHorizontal", "glyph-orientation-horizontal"], ["glyphOrientationVertical", "glyph-orientation-vertical"], ["horizAdvX", "horiz-adv-x"], ["horizOriginX", "horiz-origin-x"], ["imageRendering", "image-rendering"], ["letterSpacing", "letter-spacing"], ["lightingColor", "lighting-color"], ["markerEnd", "marker-end"], ["markerMid", "marker-mid"], ["markerStart", "marker-start"], ["overlinePosition", "overline-position"], ["overlineThickness", "overline-thickness"], ["paintOrder", "paint-order"], ["panose-1", "panose-1"], ["pointerEvents", "pointer-events"], ["renderingIntent", "rendering-intent"], ["shapeRendering", "shape-rendering"], ["stopColor", "stop-color"], ["stopOpacity", "stop-opacity"], ["strikethroughPosition", "strikethrough-position"], ["strikethroughThickness", "strikethrough-thickness"], ["strokeDasharray", "stroke-dasharray"], ["strokeDashoffset", "stroke-dashoffset"], ["strokeLinecap", "stroke-linecap"], ["strokeLinejoin", "stroke-linejoin"], ["strokeMiterlimit", "stroke-miterlimit"], ["strokeOpacity", "stroke-opacity"], ["strokeWidth", "stroke-width"], ["textAnchor", "text-anchor"], ["textDecoration", "text-decoration"], ["textRendering", "text-rendering"], ["transformOrigin", "transform-origin"], ["underlinePosition", "underline-position"], ["underlineThickness", "underline-thickness"], ["unicodeBidi", "unicode-bidi"], ["unicodeRange", "unicode-range"], ["unitsPerEm", "units-per-em"], ["vAlphabetic", "v-alphabetic"], ["vHanging", "v-hanging"], ["vIdeographic", "v-ideographic"], ["vMathematical", "v-mathematical"], ["vectorEffect", "vector-effect"], ["vertAdvY", "vert-adv-y"], ["vertOriginX", "vert-origin-x"], ["vertOriginY", "vert-origin-y"], ["wordSpacing", "word-spacing"], ["writingMode", "writing-mode"], ["xmlnsXlink", "xmlns:xlink"], ["xHeight", "x-height"] ]), matchHtmlRegExp = /["'&<>]/; function escapeTextForBrowser(text) { if ("boolean" === typeof text || "number" === typeof text || "bigint" === typeof text) return "" + text; text = "" + text; var match = matchHtmlRegExp.exec(text); if (match) { var html = "", index, lastIndex = 0; for (index = match.index; index < text.length; index++) { switch (text.charCodeAt(index)) { case 34: match = """; break; case 38: match = "&"; break; case 39: match = "'"; break; case 60: match = "<"; break; case 62: match = ">"; break; default: continue; } lastIndex !== index && (html += text.slice(lastIndex, index)); lastIndex = index + 1; html += match; } text = lastIndex !== index ? html + text.slice(lastIndex, index) : html; } return text; } var uppercasePattern = /([A-Z])/g, msPattern = /^ms-/, isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i; function sanitizeURL(url) { return isJavaScriptProtocol.test("" + url) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : url; } var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, sharedNotPendingObject = { pending: !1, data: null, method: null, action: null }, previousDispatcher = ReactDOMSharedInternals.d; ReactDOMSharedInternals.d = { f: previousDispatcher.f, r: previousDispatcher.r, D: prefetchDNS, C: preconnect, L: preload, m: preloadModule, X: preinitScript, S: preinitStyle, M: preinitModuleScript }; var PRELOAD_NO_CREDS = [], currentlyFlushingRenderState = null, scriptRegex = /(<\/|<)(s)(cript)/gi; function scriptReplacer(match, prefix, s, suffix) { return "" + prefix + ("s" === s ? "\\u0073" : "\\u0053") + suffix; } function createResumableState(identifierPrefix, externalRuntimeConfig, bootstrapScriptContent, bootstrapScripts, bootstrapModules) { return { idPrefix: void 0 === identifierPrefix ? "" : identifierPrefix, nextFormID: 0, streamingFormat: 0, bootstrapScriptContent, bootstrapScripts, bootstrapModules, instructions: 0, hasBody: !1, hasHtml: !1, unknownResources: {}, dnsResources: {}, connectResources: { default: {}, anonymous: {}, credentials: {} }, imageResources: {}, styleResources: {}, scriptResources: {}, moduleUnknownResources: {}, moduleScriptResources: {} }; } function createFormatContext(insertionMode, selectedValue, tagScope, viewTransition) { return { insertionMode, selectedValue, tagScope, viewTransition }; } function getChildFormatContext(parentContext, type, props) { var subtreeScope = parentContext.tagScope & -25; switch (type) { case "noscript": return createFormatContext(2, null, subtreeScope | 1, null); case "select": return createFormatContext(2, null != props.value ? props.value : props.defaultValue, subtreeScope, null); case "svg": return createFormatContext(4, null, subtreeScope, null); case "picture": return createFormatContext(2, null, subtreeScope | 2, null); case "math": return createFormatContext(5, null, subtreeScope, null); case "foreignObject": return createFormatContext(2, null, subtreeScope, null); case "table": return createFormatContext(6, null, subtreeScope, null); case "thead": case "tbody": case "tfoot": return createFormatContext(7, null, subtreeScope, null); case "colgroup": return createFormatContext(9, null, subtreeScope, null); case "tr": return createFormatContext(8, null, subtreeScope, null); case "head": if (2 > parentContext.insertionMode) return createFormatContext(3, null, subtreeScope, null); break; case "html": if (0 === parentContext.insertionMode) return createFormatContext(1, null, subtreeScope, null); } return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode ? createFormatContext(2, null, subtreeScope, null) : parentContext.tagScope !== subtreeScope ? createFormatContext(parentContext.insertionMode, parentContext.selectedValue, subtreeScope, null) : parentContext; } function getSuspenseViewTransition(parentViewTransition) { return null === parentViewTransition ? null : { update: parentViewTransition.update, enter: "none", exit: "none", share: parentViewTransition.update, name: parentViewTransition.autoName, autoName: parentViewTransition.autoName, nameIdx: 0 }; } function getSuspenseFallbackFormatContext(resumableState, parentContext) { parentContext.tagScope & 32 && (resumableState.instructions |= 128); return createFormatContext(parentContext.insertionMode, parentContext.selectedValue, parentContext.tagScope | 12, getSuspenseViewTransition(parentContext.viewTransition)); } function getSuspenseContentFormatContext(resumableState, parentContext) { resumableState = getSuspenseViewTransition(parentContext.viewTransition); var subtreeScope = parentContext.tagScope | 16; null !== resumableState && "none" !== resumableState.share && (subtreeScope |= 64); return createFormatContext(parentContext.insertionMode, parentContext.selectedValue, subtreeScope, resumableState); } var styleNameCache = /* @__PURE__ */ new Map(); function pushStyleAttribute(target, style) { if ("object" !== typeof style) throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."); var isFirst = !0, styleName; for (styleName in style) if (hasOwnProperty.call(style, styleName)) { var styleValue = style[styleName]; if (null != styleValue && "boolean" !== typeof styleValue && "" !== styleValue) { if (0 === styleName.indexOf("--")) { var nameChunk = escapeTextForBrowser(styleName); styleValue = escapeTextForBrowser(("" + styleValue).trim()); } else nameChunk = styleNameCache.get(styleName), void 0 === nameChunk && (nameChunk = escapeTextForBrowser(styleName.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-")), styleNameCache.set(styleName, nameChunk)), styleValue = "number" === typeof styleValue ? 0 === styleValue || unitlessNumbers.has(styleName) ? "" + styleValue : styleValue + "px" : escapeTextForBrowser(("" + styleValue).trim()); isFirst ? (isFirst = !1, target.push(" style=\"", nameChunk, ":", styleValue)) : target.push(";", nameChunk, ":", styleValue); } } isFirst || target.push("\""); } function pushBooleanAttribute(target, name, value) { value && "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, "=\"\""); } function pushStringAttribute(target, name, value) { "function" !== typeof value && "symbol" !== typeof value && "boolean" !== typeof value && target.push(" ", name, "=\"", escapeTextForBrowser(value), "\""); } var actionJavaScriptURL = escapeTextForBrowser("javascript:throw new Error('React form unexpectedly submitted.')"); function pushAdditionalFormField(value, key) { this.push(""); } function validateAdditionalFormField(value) { if ("string" !== typeof value) throw Error("File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration."); } function getCustomFormFields(resumableState, formAction) { if ("function" === typeof formAction.$$FORM_ACTION) { var id = resumableState.nextFormID++; resumableState = resumableState.idPrefix + id; try { var customFields = formAction.$$FORM_ACTION(resumableState); if (customFields) customFields.data?.forEach(validateAdditionalFormField); return customFields; } catch (x) { if ("object" === typeof x && null !== x && "function" === typeof x.then) throw x; } } return null; } function pushFormActionAttribute(target, resumableState, renderState, formAction, formEncType, formMethod, formTarget, name) { var formData = null; if ("function" === typeof formAction) { var customFields = getCustomFormFields(resumableState, formAction); null !== customFields ? (name = customFields.name, formAction = customFields.action || "", formEncType = customFields.encType, formMethod = customFields.method, formTarget = customFields.target, formData = customFields.data) : (target.push(" ", "formAction", "=\"", actionJavaScriptURL, "\""), formTarget = formMethod = formEncType = formAction = name = null, injectFormReplayingRuntime(resumableState, renderState)); } null != name && pushAttribute(target, "name", name); null != formAction && pushAttribute(target, "formAction", formAction); null != formEncType && pushAttribute(target, "formEncType", formEncType); null != formMethod && pushAttribute(target, "formMethod", formMethod); null != formTarget && pushAttribute(target, "formTarget", formTarget); return formData; } function pushAttribute(target, name, value) { switch (name) { case "className": pushStringAttribute(target, "class", value); break; case "tabIndex": pushStringAttribute(target, "tabindex", value); break; case "dir": case "role": case "viewBox": case "width": case "height": pushStringAttribute(target, name, value); break; case "style": pushStyleAttribute(target, value); break; case "src": case "href": if ("" === value) break; case "action": case "formAction": if (null == value || "function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) break; value = sanitizeURL("" + value); target.push(" ", name, "=\"", escapeTextForBrowser(value), "\""); break; case "defaultValue": case "defaultChecked": case "innerHTML": case "suppressContentEditableWarning": case "suppressHydrationWarning": case "ref": break; case "autoFocus": case "multiple": case "muted": pushBooleanAttribute(target, name.toLowerCase(), value); break; case "xlinkHref": if ("function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) break; value = sanitizeURL("" + value); target.push(" ", "xlink:href", "=\"", escapeTextForBrowser(value), "\""); break; case "contentEditable": case "spellCheck": case "draggable": case "value": case "autoReverse": case "externalResourcesRequired": case "focusable": case "preserveAlpha": "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, "=\"", escapeTextForBrowser(value), "\""); break; case "inert": case "allowFullScreen": case "async": case "autoPlay": case "controls": case "default": case "defer": case "disabled": case "disablePictureInPicture": case "disableRemotePlayback": case "formNoValidate": case "hidden": case "loop": case "noModule": case "noValidate": case "open": case "playsInline": case "readOnly": case "required": case "reversed": case "scoped": case "seamless": case "itemScope": value && "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, "=\"\""); break; case "capture": case "download": !0 === value ? target.push(" ", name, "=\"\"") : !1 !== value && "function" !== typeof value && "symbol" !== typeof value && target.push(" ", name, "=\"", escapeTextForBrowser(value), "\""); break; case "cols": case "rows": case "size": case "span": "function" !== typeof value && "symbol" !== typeof value && !isNaN(value) && 1 <= value && target.push(" ", name, "=\"", escapeTextForBrowser(value), "\""); break; case "rowSpan": case "start": "function" === typeof value || "symbol" === typeof value || isNaN(value) || target.push(" ", name, "=\"", escapeTextForBrowser(value), "\""); break; case "xlinkActuate": pushStringAttribute(target, "xlink:actuate", value); break; case "xlinkArcrole": pushStringAttribute(target, "xlink:arcrole", value); break; case "xlinkRole": pushStringAttribute(target, "xlink:role", value); break; case "xlinkShow": pushStringAttribute(target, "xlink:show", value); break; case "xlinkTitle": pushStringAttribute(target, "xlink:title", value); break; case "xlinkType": pushStringAttribute(target, "xlink:type", value); break; case "xmlBase": pushStringAttribute(target, "xml:base", value); break; case "xmlLang": pushStringAttribute(target, "xml:lang", value); break; case "xmlSpace": pushStringAttribute(target, "xml:space", value); break; default: if (!(2 < name.length) || "o" !== name[0] && "O" !== name[0] || "n" !== name[1] && "N" !== name[1]) { if (name = aliases.get(name) || name, isAttributeNameSafe(name)) { switch (typeof value) { case "function": case "symbol": return; case "boolean": var prefix$8 = name.toLowerCase().slice(0, 5); if ("data-" !== prefix$8 && "aria-" !== prefix$8) return; } target.push(" ", name, "=\"", escapeTextForBrowser(value), "\""); } } } } function pushInnerHTML(target, innerHTML, children) { if (null != innerHTML) { if (null != children) throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`."); if ("object" !== typeof innerHTML || !("__html" in innerHTML)) throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information."); innerHTML = innerHTML.__html; null !== innerHTML && void 0 !== innerHTML && target.push("" + innerHTML); } } function flattenOptionChildren(children) { var content = ""; React.Children.forEach(children, function(child) { null != child && (content += child); }); return content; } function injectFormReplayingRuntime(resumableState, renderState) { if (0 === (resumableState.instructions & 16)) { resumableState.instructions |= 16; var preamble = renderState.preamble, bootstrapChunks = renderState.bootstrapChunks; (preamble.htmlChunks || preamble.headChunks) && 0 === bootstrapChunks.length ? (bootstrapChunks.push(renderState.startInlineScript), pushCompletedShellIdAttribute(bootstrapChunks, resumableState), bootstrapChunks.push(">", "addEventListener(\"submit\",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute(\"formAction\");null!=f&&(e=f,b=null)}\"javascript:throw new Error('React form unexpectedly submitted.')\"===e&&(a.preventDefault(),b?(a=document.createElement(\"input\"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});", "<\/script>")) : bootstrapChunks.unshift(renderState.startInlineScript, ">", "addEventListener(\"submit\",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute(\"formAction\");null!=f&&(e=f,b=null)}\"javascript:throw new Error('React form unexpectedly submitted.')\"===e&&(a.preventDefault(),b?(a=document.createElement(\"input\"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});", "<\/script>"); } } function pushLinkImpl(target, props) { target.push(startChunkForTag("link")); for (var propKey in props) if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { case "children": case "dangerouslySetInnerHTML": throw Error("link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."); default: pushAttribute(target, propKey, propValue); } } target.push("/>"); return null; } var styleRegex = /(<\/|<)(s)(tyle)/gi; function styleReplacer(match, prefix, s, suffix) { return "" + prefix + ("s" === s ? "\\73 " : "\\53 ") + suffix; } function pushSelfClosing(target, props, tag) { target.push(startChunkForTag(tag)); for (var propKey in props) if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { case "children": case "dangerouslySetInnerHTML": throw Error(tag + " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."); default: pushAttribute(target, propKey, propValue); } } target.push("/>"); return null; } function pushTitleImpl(target, props) { target.push(startChunkForTag("title")); var children = null, innerHTML = null, propKey; for (propKey in props) if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; default: pushAttribute(target, propKey, propValue); } } target.push(">"); props = Array.isArray(children) ? 2 > children.length ? children[0] : null : children; "function" !== typeof props && "symbol" !== typeof props && null !== props && void 0 !== props && target.push(escapeTextForBrowser("" + props)); pushInnerHTML(target, innerHTML, children); target.push(endChunkForTag("title")); return null; } function pushScriptImpl(target, props) { target.push(startChunkForTag("script")); var children = null, innerHTML = null, propKey; for (propKey in props) if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; default: pushAttribute(target, propKey, propValue); } } target.push(">"); pushInnerHTML(target, innerHTML, children); "string" === typeof children && target.push(("" + children).replace(scriptRegex, scriptReplacer)); target.push(endChunkForTag("script")); return null; } function pushStartSingletonElement(target, props, tag) { target.push(startChunkForTag(tag)); var innerHTML = tag = null, propKey; for (propKey in props) if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { case "children": tag = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; default: pushAttribute(target, propKey, propValue); } } target.push(">"); pushInnerHTML(target, innerHTML, tag); return tag; } function pushStartGenericElement(target, props, tag) { target.push(startChunkForTag(tag)); var innerHTML = tag = null, propKey; for (propKey in props) if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { case "children": tag = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; default: pushAttribute(target, propKey, propValue); } } target.push(">"); pushInnerHTML(target, innerHTML, tag); return "string" === typeof tag ? (target.push(escapeTextForBrowser(tag)), null) : tag; } var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, validatedTagCache = /* @__PURE__ */ new Map(); function startChunkForTag(tag) { var tagStartChunk = validatedTagCache.get(tag); if (void 0 === tagStartChunk) { if (!VALID_TAG_REGEX.test(tag)) throw Error("Invalid tag: " + tag); tagStartChunk = "<" + tag; validatedTagCache.set(tag, tagStartChunk); } return tagStartChunk; } function pushStartInstance(target$jscomp$0, type, props, resumableState, renderState, preambleState, hoistableState, formatContext, textEmbedded) { switch (type) { case "div": case "span": case "svg": case "path": break; case "a": target$jscomp$0.push(startChunkForTag("a")); var children = null, innerHTML = null, propKey; for (propKey in props) if (hasOwnProperty.call(props, propKey)) { var propValue = props[propKey]; if (null != propValue) switch (propKey) { case "children": children = propValue; break; case "dangerouslySetInnerHTML": innerHTML = propValue; break; case "href": "" === propValue ? pushStringAttribute(target$jscomp$0, "href", "") : pushAttribute(target$jscomp$0, propKey, propValue); break; default: pushAttribute(target$jscomp$0, propKey, propValue); } } target$jscomp$0.push(">"); pushInnerHTML(target$jscomp$0, innerHTML, children); if ("string" === typeof children) { target$jscomp$0.push(escapeTextForBrowser(children)); var JSCompiler_inline_result = null; } else JSCompiler_inline_result = children; return JSCompiler_inline_result; case "g": case "p": case "li": break; case "select": target$jscomp$0.push(startChunkForTag("select")); var children$jscomp$0 = null, innerHTML$jscomp$0 = null, propKey$jscomp$0; for (propKey$jscomp$0 in props) if (hasOwnProperty.call(props, propKey$jscomp$0)) { var propValue$jscomp$0 = props[propKey$jscomp$0]; if (null != propValue$jscomp$0) switch (propKey$jscomp$0) { case "children": children$jscomp$0 = propValue$jscomp$0; break; case "dangerouslySetInnerHTML": innerHTML$jscomp$0 = propValue$jscomp$0; break; case "defaultValue": case "value": break; default: pushAttribute(target$jscomp$0, propKey$jscomp$0, propValue$jscomp$0); } } target$jscomp$0.push(">"); pushInnerHTML(target$jscomp$0, innerHTML$jscomp$0, children$jscomp$0); return children$jscomp$0; case "option": var selectedValue = formatContext.selectedValue; target$jscomp$0.push(startChunkForTag("option")); var children$jscomp$1 = null, value = null, selected = null, innerHTML$jscomp$1 = null, propKey$jscomp$1; for (propKey$jscomp$1 in props) if (hasOwnProperty.call(props, propKey$jscomp$1)) { var propValue$jscomp$1 = props[propKey$jscomp$1]; if (null != propValue$jscomp$1) switch (propKey$jscomp$1) { case "children": children$jscomp$1 = propValue$jscomp$1; break; case "selected": selected = propValue$jscomp$1; break; case "dangerouslySetInnerHTML": innerHTML$jscomp$1 = propValue$jscomp$1; break; case "value": value = propValue$jscomp$1; default: pushAttribute(target$jscomp$0, propKey$jscomp$1, propValue$jscomp$1); } } if (null != selectedValue) { var stringValue = null !== value ? "" + value : flattenOptionChildren(children$jscomp$1); if (isArrayImpl(selectedValue)) { for (var i = 0; i < selectedValue.length; i++) if ("" + selectedValue[i] === stringValue) { target$jscomp$0.push(" selected=\"\""); break; } } else "" + selectedValue === stringValue && target$jscomp$0.push(" selected=\"\""); } else selected && target$jscomp$0.push(" selected=\"\""); target$jscomp$0.push(">"); pushInnerHTML(target$jscomp$0, innerHTML$jscomp$1, children$jscomp$1); return children$jscomp$1; case "textarea": target$jscomp$0.push(startChunkForTag("textarea")); var value$jscomp$0 = null, defaultValue = null, children$jscomp$2 = null, propKey$jscomp$2; for (propKey$jscomp$2 in props) if (hasOwnProperty.call(props, propKey$jscomp$2)) { var propValue$jscomp$2 = props[propKey$jscomp$2]; if (null != propValue$jscomp$2) switch (propKey$jscomp$2) { case "children": children$jscomp$2 = propValue$jscomp$2; break; case "value": value$jscomp$0 = propValue$jscomp$2; break; case "defaultValue": defaultValue = propValue$jscomp$2; break; case "dangerouslySetInnerHTML": throw Error("`dangerouslySetInnerHTML` does not make sense on