@tanstack/react-router-devtools 0.0.1-beta.69 → 0.0.1-beta.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.development.js","sources":["../../../../node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../../router/build/esm/index.js","../../../react-store/build/esm/index.js","../../../react-router/build/esm/index.js","../../src/useLocalStorage.ts","../../src/theme.tsx","../../src/useMediaQuery.ts","../../src/utils.ts","../../src/styledComponents.ts","../../src/Explorer.tsx","../../src/devtools.tsx"],"sourcesContent":["var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","/**\n * router\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport invariant from 'tiny-invariant';\nexport { default as invariant } from 'tiny-invariant';\nimport { Store } from '@tanstack/store';\n\n// While the public API was clearly inspired by the \"history\" npm package,\n// This implementation attempts to be more lightweight by\n// making assumptions about the way TanStack Router works\n\nconst popStateEvent = 'popstate';\nfunction createHistory(opts) {\n let currentLocation = opts.getLocation();\n let unsub = () => {};\n let listeners = new Set();\n const onUpdate = () => {\n currentLocation = opts.getLocation();\n listeners.forEach(listener => listener());\n };\n return {\n get location() {\n return currentLocation;\n },\n listen: cb => {\n if (listeners.size === 0) {\n unsub = opts.listener(onUpdate);\n }\n listeners.add(cb);\n return () => {\n listeners.delete(cb);\n if (listeners.size === 0) {\n unsub();\n }\n };\n },\n push: (path, state) => {\n opts.pushState(path, state);\n onUpdate();\n },\n replace: (path, state) => {\n opts.replaceState(path, state);\n onUpdate();\n },\n go: index => {\n opts.go(index);\n onUpdate();\n },\n back: () => {\n opts.back();\n onUpdate();\n },\n forward: () => {\n opts.forward();\n onUpdate();\n }\n };\n}\nfunction createBrowserHistory(opts) {\n const getHref = opts?.getHref ?? (() => `${window.location.pathname}${window.location.hash}${window.location.search}`);\n const createHref = opts?.createHref ?? (path => path);\n const getLocation = () => parseLocation(getHref(), history.state);\n return createHistory({\n getLocation,\n listener: onUpdate => {\n window.addEventListener(popStateEvent, onUpdate);\n return () => {\n window.removeEventListener(popStateEvent, onUpdate);\n };\n },\n pushState: (path, state) => {\n window.history.pushState({\n ...state,\n key: createRandomKey()\n }, '', createHref(path));\n },\n replaceState: (path, state) => {\n window.history.replaceState({\n ...state,\n key: createRandomKey()\n }, '', createHref(path));\n },\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n go: n => window.history.go(n)\n });\n}\nfunction createHashHistory() {\n return createBrowserHistory({\n getHref: () => window.location.hash.substring(1),\n createHref: path => `#${path}`\n });\n}\nfunction createMemoryHistory(opts = {\n initialEntries: ['/']\n}) {\n const entries = opts.initialEntries;\n let index = opts.initialIndex ?? entries.length - 1;\n let currentState = {};\n const getLocation = () => parseLocation(entries[index], currentState);\n return createHistory({\n getLocation,\n listener: () => {\n return () => {};\n },\n pushState: (path, state) => {\n currentState = {\n ...state,\n key: createRandomKey()\n };\n entries.push(path);\n index++;\n },\n replaceState: (path, state) => {\n currentState = {\n ...state,\n key: createRandomKey()\n };\n entries[index] = path;\n },\n back: () => {\n index--;\n },\n forward: () => {\n index = Math.min(index + 1, entries.length - 1);\n },\n go: n => window.history.go(n)\n });\n}\nfunction parseLocation(href, state) {\n let hashIndex = href.indexOf('#');\n let searchIndex = href.indexOf('?');\n return {\n href,\n pathname: href.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length),\n hash: hashIndex > -1 ? href.substring(hashIndex, searchIndex) : '',\n search: searchIndex > -1 ? href.substring(searchIndex) : '',\n state\n };\n}\n\n// Thanks co-pilot!\nfunction createRandomKey() {\n return (Math.random() + 1).toString(36).substring(7);\n}\n\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nfunction warning(cond, message) {\n if (cond) {\n if (typeof console !== 'undefined') console.warn(message);\n try {\n throw new Error(message);\n } catch {}\n }\n return true;\n}\nfunction isFunction(d) {\n return typeof d === 'function';\n}\nfunction functionalUpdate(updater, previous) {\n if (isFunction(updater)) {\n return updater(previous);\n }\n return updater;\n}\nfunction pick(parent, keys) {\n return keys.reduce((obj, key) => {\n obj[key] = parent[key];\n return obj;\n }, {});\n}\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between immutable JSON values for example.\n * Do not use this with signals\n */\nfunction replaceEqualDeep(prev, _next) {\n if (prev === _next) {\n return prev;\n }\n const next = _next;\n const array = Array.isArray(prev) && Array.isArray(next);\n if (array || isPlainObject(prev) && isPlainObject(next)) {\n const prevSize = array ? prev.length : Object.keys(prev).length;\n const nextItems = array ? next : Object.keys(next);\n const nextSize = nextItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < nextSize; i++) {\n const key = array ? i : nextItems[i];\n copy[key] = replaceEqualDeep(prev[key], next[key]);\n if (copy[key] === prev[key]) {\n equalItems++;\n }\n }\n return prevSize === nextSize && equalItems === prevSize ? prev : copy;\n }\n return next;\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n\n // If has modified constructor\n const ctor = o.constructor;\n if (typeof ctor === 'undefined') {\n return true;\n }\n\n // If has modified prototype\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\nfunction partialDeepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n return !Object.keys(b).some(key => !partialDeepEqual(a[key], b[key]));\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, index) => partialDeepEqual(item, b[index]));\n }\n return false;\n}\n\nfunction joinPaths(paths) {\n return cleanPath(paths.filter(Boolean).join('/'));\n}\nfunction cleanPath(path) {\n // remove double slashes\n return path.replace(/\\/{2,}/g, '/');\n}\nfunction trimPathLeft(path) {\n return path === '/' ? path : path.replace(/^\\/{1,}/, '');\n}\nfunction trimPathRight(path) {\n return path === '/' ? path : path.replace(/\\/{1,}$/, '');\n}\nfunction trimPath(path) {\n return trimPathRight(trimPathLeft(path));\n}\nfunction resolvePath(basepath, base, to) {\n base = base.replace(new RegExp(`^${basepath}`), '/');\n to = to.replace(new RegExp(`^${basepath}`), '/');\n let baseSegments = parsePathname(base);\n const toSegments = parsePathname(to);\n toSegments.forEach((toSegment, index) => {\n if (toSegment.value === '/') {\n if (!index) {\n // Leading slash\n baseSegments = [toSegment];\n } else if (index === toSegments.length - 1) {\n // Trailing Slash\n baseSegments.push(toSegment);\n } else ;\n } else if (toSegment.value === '..') {\n // Extra trailing slash? pop it off\n if (baseSegments.length > 1 && last(baseSegments)?.value === '/') {\n baseSegments.pop();\n }\n baseSegments.pop();\n } else if (toSegment.value === '.') {\n return;\n } else {\n baseSegments.push(toSegment);\n }\n });\n const joined = joinPaths([basepath, ...baseSegments.map(d => d.value)]);\n return cleanPath(joined);\n}\nfunction parsePathname(pathname) {\n if (!pathname) {\n return [];\n }\n pathname = cleanPath(pathname);\n const segments = [];\n if (pathname.slice(0, 1) === '/') {\n pathname = pathname.substring(1);\n segments.push({\n type: 'pathname',\n value: '/'\n });\n }\n if (!pathname) {\n return segments;\n }\n\n // Remove empty segments and '.' segments\n const split = pathname.split('/').filter(Boolean);\n segments.push(...split.map(part => {\n if (part === '$') {\n return {\n type: 'wildcard',\n value: part\n };\n }\n if (part.charAt(0) === '$') {\n return {\n type: 'param',\n value: part\n };\n }\n return {\n type: 'pathname',\n value: part\n };\n }));\n if (pathname.slice(-1) === '/') {\n pathname = pathname.substring(1);\n segments.push({\n type: 'pathname',\n value: '/'\n });\n }\n return segments;\n}\nfunction interpolatePath(path, params, leaveWildcard) {\n const interpolatedPathSegments = parsePathname(path);\n return joinPaths(interpolatedPathSegments.map(segment => {\n if (segment.value === '$' && !leaveWildcard) {\n return '';\n }\n if (segment.type === 'param') {\n return params[segment.value.substring(1)] ?? '';\n }\n return segment.value;\n }));\n}\nfunction matchPathname(basepath, currentPathname, matchLocation) {\n const pathParams = matchByPath(basepath, currentPathname, matchLocation);\n // const searchMatched = matchBySearch(currentLocation.search, matchLocation)\n\n if (matchLocation.to && !pathParams) {\n return;\n }\n return pathParams ?? {};\n}\nfunction matchByPath(basepath, from, matchLocation) {\n if (!from.startsWith(basepath)) {\n return undefined;\n }\n from = basepath != '/' ? from.substring(basepath.length) : from;\n const baseSegments = parsePathname(from);\n const to = `${matchLocation.to ?? '$'}`;\n const routeSegments = parsePathname(to);\n const params = {};\n let isMatch = (() => {\n for (let i = 0; i < Math.max(baseSegments.length, routeSegments.length); i++) {\n const baseSegment = baseSegments[i];\n const routeSegment = routeSegments[i];\n const isLastRouteSegment = i === routeSegments.length - 1;\n const isLastBaseSegment = i === baseSegments.length - 1;\n if (routeSegment) {\n if (routeSegment.type === 'wildcard') {\n if (baseSegment?.value) {\n params['$'] = joinPaths(baseSegments.slice(i).map(d => d.value));\n return true;\n }\n return false;\n }\n if (routeSegment.type === 'pathname') {\n if (routeSegment.value === '/' && !baseSegment?.value) {\n return true;\n }\n if (baseSegment) {\n if (matchLocation.caseSensitive) {\n if (routeSegment.value !== baseSegment.value) {\n return false;\n }\n } else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase()) {\n return false;\n }\n }\n }\n if (!baseSegment) {\n return false;\n }\n if (routeSegment.type === 'param') {\n if (baseSegment?.value === '/') {\n return false;\n }\n if (baseSegment.value.charAt(0) !== '$') {\n params[routeSegment.value.substring(1)] = baseSegment.value;\n }\n }\n }\n if (isLastRouteSegment && !isLastBaseSegment) {\n return !!matchLocation.fuzzy;\n }\n }\n return true;\n })();\n return isMatch ? params : undefined;\n}\n\n// @ts-nocheck\n\n// qss has been slightly modified and inlined here for our use cases (and compression's sake). We've included it as a hard dependency for MIT license attribution.\n\nfunction encode(obj, pfx) {\n var k,\n i,\n tmp,\n str = '';\n for (k in obj) {\n if ((tmp = obj[k]) !== void 0) {\n if (Array.isArray(tmp)) {\n for (i = 0; i < tmp.length; i++) {\n str && (str += '&');\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n }\n } else {\n str && (str += '&');\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n }\n }\n }\n return (pfx || '') + str;\n}\nfunction toValue(mix) {\n if (!mix) return '';\n var str = decodeURIComponent(mix);\n if (str === 'false') return false;\n if (str === 'true') return true;\n if (str.charAt(0) === '0') return str;\n return +str * 0 === 0 ? +str : str;\n}\nfunction decode(str) {\n var tmp,\n k,\n out = {},\n arr = str.split('&');\n while (tmp = arr.shift()) {\n tmp = tmp.split('=');\n k = tmp.shift();\n if (out[k] !== void 0) {\n out[k] = [].concat(out[k], toValue(tmp.shift()));\n } else {\n out[k] = toValue(tmp.shift());\n }\n }\n return out;\n}\n\nconst rootRouteId = '__root__';\nclass Route {\n // Set up in this.init()\n\n // customId!: TCustomId\n\n // Optional\n\n constructor(options) {\n this.options = options || {};\n this.isRoot = !options?.getParentRoute;\n }\n init = opts => {\n this.originalIndex = opts.originalIndex;\n this.router = opts.router;\n const allOptions = this.options;\n const isRoot = !allOptions?.path && !allOptions?.id;\n const parent = this.options?.getParentRoute?.();\n if (isRoot) {\n this.path = rootRouteId;\n } else {\n invariant(parent, `Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);\n }\n let path = isRoot ? rootRouteId : allOptions.path;\n\n // If the path is anything other than an index path, trim it up\n if (path && path !== '/') {\n path = trimPath(path);\n }\n const customId = allOptions?.id || path;\n\n // Strip the parentId prefix from the first level of children\n let id = isRoot ? rootRouteId : joinPaths([parent.id === rootRouteId ? '' : parent.id, customId]);\n if (path === rootRouteId) {\n path = '/';\n }\n if (id !== rootRouteId) {\n id = joinPaths(['/', id]);\n }\n const fullPath = id === rootRouteId ? '/' : trimPathRight(joinPaths([parent.fullPath, path]));\n this.path = path;\n this.id = id;\n // this.customId = customId as TCustomId\n this.fullPath = fullPath;\n };\n addChildren = children => {\n this.children = children;\n return this;\n };\n generate = options => {\n invariant(false, `route.generate() is used by TanStack Router's file-based routing code generation and should not actually be called during runtime. `);\n };\n}\nclass RootRoute extends Route {\n constructor(options) {\n super(options);\n }\n static withRouterContext = () => {\n return options => new RootRoute(options);\n };\n}\n\n// const rootRoute = new RootRoute({\n// validateSearch: () => null as unknown as { root?: boolean },\n// })\n\n// const aRoute = new Route({\n// getParentRoute: () => rootRoute,\n// path: 'a',\n// validateSearch: () => null as unknown as { a?: string },\n// })\n\n// const bRoute = new Route({\n// getParentRoute: () => aRoute,\n// path: 'b',\n// })\n\n// const rootIsRoot = rootRoute.isRoot\n// // ^?\n// const aIsRoot = aRoute.isRoot\n// // ^?\n\n// const rId = rootRoute.id\n// // ^?\n// const aId = aRoute.id\n// // ^?\n// const bId = bRoute.id\n// // ^?\n\n// const rPath = rootRoute.fullPath\n// // ^?\n// const aPath = aRoute.fullPath\n// // ^?\n// const bPath = bRoute.fullPath\n// // ^?\n\n// const rSearch = rootRoute.__types.fullSearchSchema\n// // ^?\n// const aSearch = aRoute.__types.fullSearchSchema\n// // ^?\n// const bSearch = bRoute.__types.fullSearchSchema\n// // ^?\n\n// const config = rootRoute.addChildren([aRoute.addChildren([bRoute])])\n// // ^?\n\nconst componentTypes = ['component', 'errorComponent', 'pendingComponent'];\nclass RouteMatch {\n abortController = new AbortController();\n onLoaderDataListeners = new Set();\n constructor(router, route, opts) {\n Object.assign(this, {\n route,\n router,\n id: opts.id,\n pathname: opts.pathname,\n params: opts.params,\n store: new Store({\n updatedAt: 0,\n routeSearch: {},\n search: {},\n status: 'idle'\n }, {\n onUpdate: next => {\n this.state = next;\n }\n })\n });\n this.state = this.store.state;\n componentTypes.map(async type => {\n const component = this.route.options[type];\n if (typeof this[type] !== 'function') {\n this[type] = component;\n }\n });\n if (this.state.status === 'idle' && !this.#hasLoaders()) {\n this.store.setState(s => ({\n ...s,\n status: 'success'\n }));\n }\n }\n #hasLoaders = () => {\n return !!(this.route.options.onLoad || componentTypes.some(d => this.route.options[d]?.preload));\n };\n __commit = () => {\n const {\n routeSearch,\n search,\n context,\n routeContext\n } = this.#resolveInfo({\n location: this.router.state.currentLocation\n });\n this.context = context;\n this.routeContext = routeContext;\n this.store.setState(s => ({\n ...s,\n routeSearch: replaceEqualDeep(s.routeSearch, routeSearch),\n search: replaceEqualDeep(s.search, search)\n }));\n };\n cancel = () => {\n this.abortController?.abort();\n };\n #resolveSearchInfo = opts => {\n // Validate the search params and stabilize them\n const parentSearchInfo = this.parentMatch ? this.parentMatch.#resolveSearchInfo(opts) : {\n search: opts.location.search,\n routeSearch: opts.location.search\n };\n try {\n const validator = typeof this.route.options.validateSearch === 'object' ? this.route.options.validateSearch.parse : this.route.options.validateSearch;\n const routeSearch = validator?.(parentSearchInfo.search) ?? {};\n const search = {\n ...parentSearchInfo.search,\n ...routeSearch\n };\n return {\n routeSearch,\n search\n };\n } catch (err) {\n this.route.options.onValidateSearchError?.(err);\n const error = new Error('Invalid search params found', {\n cause: err\n });\n error.code = 'INVALID_SEARCH_PARAMS';\n throw error;\n }\n };\n #resolveInfo = opts => {\n const {\n search,\n routeSearch\n } = this.#resolveSearchInfo(opts);\n const routeContext = this.route.options.getContext?.({\n parentContext: this.parentMatch?.routeContext ?? {},\n context: this.parentMatch?.context ?? this.router?.options.context ?? {},\n params: this.params,\n search\n }) || {};\n const context = {\n ...(this.parentMatch?.context ?? this.router?.options.context),\n ...routeContext\n };\n return {\n routeSearch,\n search,\n context,\n routeContext\n };\n };\n __load = async opts => {\n this.parentMatch = opts.parentMatch;\n let info;\n try {\n info = this.#resolveInfo(opts);\n } catch (err) {\n this.route.options.onError?.(err);\n this.store.setState(s => ({\n ...s,\n status: 'error',\n error: err\n }));\n\n // Do not proceed with loading the route\n return;\n }\n const {\n routeSearch,\n search,\n context,\n routeContext\n } = info;\n\n // If the match is invalid, errored or idle, trigger it to load\n if (this.state.status === 'pending') {\n return;\n }\n\n // TODO: Should load promises be tracked based on location?\n this.__loadPromise = Promise.resolve().then(async () => {\n const loadId = '' + Date.now() + Math.random();\n this.#latestId = loadId;\n const checkLatest = () => {\n return loadId !== this.#latestId ? this.__loadPromise : undefined;\n };\n let latestPromise;\n\n // If the match was in an error state, set it\n // to a loading state again. Otherwise, keep it\n // as loading or resolved\n if (this.state.status === 'idle') {\n this.store.setState(s => ({\n ...s,\n status: 'pending'\n }));\n }\n const componentsPromise = (async () => {\n // then run all component and data loaders in parallel\n // For each component type, potentially load it asynchronously\n\n await Promise.all(componentTypes.map(async type => {\n const component = this.route.options[type];\n if (this[type]?.preload) {\n this[type] = await this.router.options.loadComponent(component);\n }\n }));\n })();\n const dataPromise = Promise.resolve().then(() => {\n if (this.route.options.onLoad) {\n return this.route.options.onLoad({\n params: this.params,\n routeSearch,\n search,\n signal: this.abortController.signal,\n preload: !!opts?.preload,\n routeContext: routeContext,\n context: context\n });\n }\n return;\n });\n try {\n await Promise.all([componentsPromise, dataPromise]);\n if (latestPromise = checkLatest()) return await latestPromise;\n this.store.setState(s => ({\n ...s,\n error: undefined,\n status: 'success',\n updatedAt: Date.now()\n }));\n } catch (err) {\n this.route.options.onLoadError?.(err);\n this.route.options.onError?.(err);\n this.store.setState(s => ({\n ...s,\n error: err,\n status: 'error',\n updatedAt: Date.now()\n }));\n } finally {\n delete this.__loadPromise;\n }\n });\n return this.__loadPromise;\n };\n #latestId = '';\n}\n\nconst defaultParseSearch = parseSearchWith(JSON.parse);\nconst defaultStringifySearch = stringifySearchWith(JSON.stringify);\nfunction parseSearchWith(parser) {\n return searchStr => {\n if (searchStr.substring(0, 1) === '?') {\n searchStr = searchStr.substring(1);\n }\n let query = decode(searchStr);\n\n // Try to parse any query params that might be json\n for (let key in query) {\n const value = query[key];\n if (typeof value === 'string') {\n try {\n query[key] = parser(value);\n } catch (err) {\n //\n }\n }\n }\n return query;\n };\n}\nfunction stringifySearchWith(stringify) {\n return search => {\n search = {\n ...search\n };\n if (search) {\n Object.keys(search).forEach(key => {\n const val = search[key];\n if (typeof val === 'undefined' || val === undefined) {\n delete search[key];\n } else if (val && typeof val === 'object' && val !== null) {\n try {\n search[key] = stringify(val);\n } catch (err) {\n // silent\n }\n }\n });\n }\n const searchStr = encode(search).toString();\n return searchStr ? `?${searchStr}` : '';\n };\n}\n\nconst defaultFetchServerDataFn = async ({\n router,\n routeMatch\n}) => {\n const next = router.buildNext({\n to: '.',\n search: d => ({\n ...(d ?? {}),\n __data: {\n matchId: routeMatch.id\n }\n })\n });\n const res = await fetch(next.href, {\n method: 'GET',\n signal: routeMatch.abortController.signal\n });\n if (res.ok) {\n return res.json();\n }\n throw new Error('Failed to fetch match data');\n};\nclass Router {\n #unsubHistory;\n startedLoadingAt = Date.now();\n resolveNavigation = () => {};\n constructor(options) {\n this.options = {\n defaultPreloadDelay: 50,\n context: undefined,\n ...options,\n stringifySearch: options?.stringifySearch ?? defaultStringifySearch,\n parseSearch: options?.parseSearch ?? defaultParseSearch,\n fetchServerDataFn: options?.fetchServerDataFn ?? defaultFetchServerDataFn\n };\n this.store = new Store(getInitialRouterState(), {\n onUpdate: state => {\n this.state = state;\n }\n });\n this.state = this.store.state;\n this.basepath = '';\n this.update(options);\n\n // Allow frameworks to hook into the router creation\n this.options.Router?.(this);\n }\n reset = () => {\n this.store.setState(s => Object.assign(s, getInitialRouterState()));\n };\n mount = () => {\n // Mount only does anything on the client\n if (!isServer) {\n // If the router matches are empty, load the matches\n if (!this.state.currentMatches.length) {\n this.load();\n }\n const visibilityChangeEvent = 'visibilitychange';\n const focusEvent = 'focus';\n\n // addEventListener does not exist in React Native, but window does\n // In the future, we might need to invert control here for more adapters\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (window.addEventListener) {\n // Listen to visibilitychange and focus\n window.addEventListener(visibilityChangeEvent, this.#onFocus, false);\n window.addEventListener(focusEvent, this.#onFocus, false);\n }\n return () => {\n if (window.removeEventListener) {\n // Be sure to unsubscribe if a new handler is set\n\n window.removeEventListener(visibilityChangeEvent, this.#onFocus);\n window.removeEventListener(focusEvent, this.#onFocus);\n }\n };\n }\n return () => {};\n };\n update = opts => {\n Object.assign(this.options, opts);\n if (!this.history || this.options.history && this.options.history !== this.history) {\n if (this.#unsubHistory) {\n this.#unsubHistory();\n }\n this.history = this.options.history ?? (isServer ? createMemoryHistory() : createBrowserHistory());\n const parsedLocation = this.#parseLocation();\n this.store.setState(s => ({\n ...s,\n latestLocation: parsedLocation,\n currentLocation: parsedLocation\n }));\n this.#unsubHistory = this.history.listen(() => {\n this.load({\n next: this.#parseLocation(this.state.latestLocation)\n });\n });\n }\n const {\n basepath,\n routeTree\n } = this.options;\n this.basepath = `/${trimPath(basepath ?? '') ?? ''}`;\n if (routeTree) {\n this.routesById = {};\n this.routeTree = this.#buildRouteTree(routeTree);\n }\n return this;\n };\n buildNext = opts => {\n const next = this.#buildLocation(opts);\n const matches = this.matchRoutes(next.pathname);\n const __preSearchFilters = matches.map(match => match.route.options.preSearchFilters ?? []).flat().filter(Boolean);\n const __postSearchFilters = matches.map(match => match.route.options.postSearchFilters ?? []).flat().filter(Boolean);\n return this.#buildLocation({\n ...opts,\n __preSearchFilters,\n __postSearchFilters\n });\n };\n cancelMatches = () => {\n [...this.state.currentMatches, ...(this.state.pendingMatches || [])].forEach(match => {\n match.cancel();\n });\n };\n load = async opts => {\n let now = Date.now();\n const startedAt = now;\n this.startedLoadingAt = startedAt;\n\n // Cancel any pending matches\n this.cancelMatches();\n let matches;\n this.store.batch(() => {\n if (opts?.next) {\n // Ingest the new location\n this.store.setState(s => ({\n ...s,\n latestLocation: opts.next\n }));\n }\n\n // Match the routes\n matches = this.matchRoutes(this.state.latestLocation.pathname, {\n strictParseParams: true\n });\n this.store.setState(s => ({\n ...s,\n status: 'pending',\n pendingMatches: matches,\n pendingLocation: this.state.latestLocation\n }));\n });\n\n // Load the matches\n try {\n await this.loadMatches(matches, this.state.pendingLocation\n // opts\n );\n } catch (err) {\n console.warn(err);\n invariant(false, 'Matches failed to load due to error above ☝️. Navigation cancelled!');\n }\n if (this.startedLoadingAt !== startedAt) {\n // Ignore side-effects of outdated side-effects\n return this.navigationPromise;\n }\n const previousMatches = this.state.currentMatches;\n const exiting = [],\n staying = [];\n previousMatches.forEach(d => {\n if (matches.find(dd => dd.id === d.id)) {\n staying.push(d);\n } else {\n exiting.push(d);\n }\n });\n const entering = matches.filter(d => {\n return !previousMatches.find(dd => dd.id === d.id);\n });\n now = Date.now();\n exiting.forEach(d => {\n d.__onExit?.({\n params: d.params,\n search: d.state.routeSearch\n });\n\n // Clear non-loading error states when match leaves\n if (d.state.status === 'error') {\n this.store.setState(s => ({\n ...s,\n status: 'idle',\n error: undefined\n }));\n }\n });\n staying.forEach(d => {\n d.route.options.onTransition?.({\n params: d.params,\n search: d.state.routeSearch\n });\n });\n entering.forEach(d => {\n d.__onExit = d.route.options.onLoaded?.({\n params: d.params,\n search: d.state.search\n });\n });\n const prevLocation = this.state.currentLocation;\n this.store.setState(s => ({\n ...s,\n status: 'idle',\n currentLocation: this.state.latestLocation,\n currentMatches: matches,\n pendingLocation: undefined,\n pendingMatches: undefined\n }));\n matches.forEach(match => {\n match.__commit();\n });\n if (prevLocation.href !== this.state.currentLocation.href) {\n this.options.onRouteChange?.();\n }\n this.resolveNavigation();\n };\n getRoute = id => {\n const route = this.routesById[id];\n invariant(route, `Route with id \"${id}\" not found`);\n return route;\n };\n loadRoute = async (navigateOpts = this.state.latestLocation) => {\n const next = this.buildNext(navigateOpts);\n const matches = this.matchRoutes(next.pathname, {\n strictParseParams: true\n });\n await this.loadMatches(matches, next);\n return matches;\n };\n preloadRoute = async (navigateOpts = this.state.latestLocation) => {\n const next = this.buildNext(navigateOpts);\n const matches = this.matchRoutes(next.pathname, {\n strictParseParams: true\n });\n await this.loadMatches(matches, next, {\n preload: true\n });\n return matches;\n };\n matchRoutes = (pathname, opts) => {\n const matches = [];\n if (!this.routeTree) {\n return matches;\n }\n const existingMatches = [...this.state.currentMatches, ...(this.state.pendingMatches ?? [])];\n const findInRouteTree = async routes => {\n const parentMatch = last(matches);\n let params = parentMatch?.params ?? {};\n const filteredRoutes = this.options.filterRoutes?.(routes) ?? routes;\n let matchingRoutes = [];\n const findMatchInRoutes = (parentRoutes, routes) => {\n routes.some(route => {\n const children = route.children;\n if (!route.path && children?.length) {\n return findMatchInRoutes([...matchingRoutes, route], children);\n }\n const fuzzy = !!(route.path !== '/' || children?.length);\n const matchParams = matchPathname(this.basepath, pathname, {\n to: route.fullPath,\n fuzzy,\n caseSensitive: route.options.caseSensitive ?? this.options.caseSensitive\n });\n if (matchParams) {\n let parsedParams;\n try {\n parsedParams = route.options.parseParams?.(matchParams) ?? matchParams;\n } catch (err) {\n if (opts?.strictParseParams) {\n throw err;\n }\n }\n params = {\n ...params,\n ...parsedParams\n };\n }\n if (!!matchParams) {\n matchingRoutes = [...parentRoutes, route];\n }\n return !!matchingRoutes.length;\n });\n return !!matchingRoutes.length;\n };\n findMatchInRoutes([], filteredRoutes);\n if (!matchingRoutes.length) {\n return;\n }\n matchingRoutes.forEach(foundRoute => {\n const interpolatedPath = interpolatePath(foundRoute.path, params);\n const matchId = interpolatePath(foundRoute.id, params, true);\n const match = existingMatches.find(d => d.id === matchId) || new RouteMatch(this, foundRoute, {\n id: matchId,\n params,\n pathname: joinPaths([this.basepath, interpolatedPath])\n });\n matches.push(match);\n });\n const foundRoute = last(matchingRoutes);\n const foundChildren = foundRoute.children;\n if (foundChildren?.length) {\n findInRouteTree(foundChildren);\n }\n };\n findInRouteTree([this.routeTree]);\n return matches;\n };\n loadMatches = async (resolvedMatches, location, opts) => {\n // Check each match middleware to see if the route can be accessed\n await Promise.all(resolvedMatches.map(async match => {\n try {\n await match.route.options.beforeLoad?.({\n router: this,\n match\n });\n } catch (err) {\n if (!opts?.preload) {\n match.route.options.onBeforeLoadError?.(err);\n }\n match.route.options.onError?.(err);\n throw err;\n }\n }));\n const matchPromises = resolvedMatches.map(async (match, index) => {\n const parentMatch = resolvedMatches[index - 1];\n match.__load({\n preload: opts?.preload,\n location,\n parentMatch\n });\n await match.__loadPromise;\n if (parentMatch) {\n await parentMatch.__loadPromise;\n }\n });\n await Promise.all(matchPromises);\n };\n reload = () => {\n this.navigate({\n fromCurrent: true,\n replace: true,\n search: true\n });\n };\n resolvePath = (from, path) => {\n return resolvePath(this.basepath, from, cleanPath(path));\n };\n navigate = async ({\n from,\n to = '',\n search,\n hash,\n replace,\n params\n }) => {\n // If this link simply reloads the current route,\n // make sure it has a new key so it will trigger a data refresh\n\n // If this `to` is a valid external URL, return\n // null for LinkUtils\n const toString = String(to);\n const fromString = typeof from === 'undefined' ? from : String(from);\n let isExternal;\n try {\n new URL(`${toString}`);\n isExternal = true;\n } catch (e) {}\n invariant(!isExternal, 'Attempting to navigate to external url with this.navigate!');\n return this.#commitLocation({\n from: fromString,\n to: toString,\n search,\n hash,\n replace,\n params\n });\n };\n matchRoute = (location, opts) => {\n location = {\n ...location,\n to: location.to ? this.resolvePath(location.from ?? '', location.to) : undefined\n };\n const next = this.buildNext(location);\n const baseLocation = opts?.pending ? this.state.pendingLocation : this.state.currentLocation;\n if (!baseLocation) {\n return false;\n }\n const match = matchPathname(this.basepath, baseLocation.pathname, {\n ...opts,\n to: next.pathname\n });\n if (!match) {\n return false;\n }\n if (opts?.includeSearch ?? true) {\n return partialDeepEqual(baseLocation.search, next.search) ? match : false;\n }\n return match;\n };\n buildLink = ({\n from,\n to = '.',\n search,\n params,\n hash,\n target,\n replace,\n activeOptions,\n preload,\n preloadDelay: userPreloadDelay,\n disabled\n }) => {\n // If this link simply reloads the current route,\n // make sure it has a new key so it will trigger a data refresh\n\n // If this `to` is a valid external URL, return\n // null for LinkUtils\n\n try {\n new URL(`${to}`);\n return {\n type: 'external',\n href: to\n };\n } catch (e) {}\n const nextOpts = {\n from,\n to,\n search,\n params,\n hash,\n replace\n };\n const next = this.buildNext(nextOpts);\n preload = preload ?? this.options.defaultPreload;\n const preloadDelay = userPreloadDelay ?? this.options.defaultPreloadDelay ?? 0;\n\n // Compare path/hash for matches\n const currentPathSplit = this.state.currentLocation.pathname.split('/');\n const nextPathSplit = next.pathname.split('/');\n const pathIsFuzzyEqual = nextPathSplit.every((d, i) => d === currentPathSplit[i]);\n // Combine the matches based on user options\n const pathTest = activeOptions?.exact ? this.state.currentLocation.pathname === next.pathname : pathIsFuzzyEqual;\n const hashTest = activeOptions?.includeHash ? this.state.currentLocation.hash === next.hash : true;\n const searchTest = activeOptions?.includeSearch ?? true ? partialDeepEqual(this.state.currentLocation.search, next.search) : true;\n\n // The final \"active\" test\n const isActive = pathTest && hashTest && searchTest;\n\n // The click handler\n const handleClick = e => {\n if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!target || target === '_self') && e.button === 0) {\n e.preventDefault();\n\n // All is well? Navigate!\n this.#commitLocation(nextOpts);\n }\n };\n\n // The click handler\n const handleFocus = e => {\n if (preload) {\n this.preloadRoute(nextOpts).catch(err => {\n console.warn(err);\n console.warn('Error preloading route! ☝️');\n });\n }\n };\n const handleTouchStart = e => {\n this.preloadRoute(nextOpts).catch(err => {\n console.warn(err);\n console.warn('Error preloading route! ☝️');\n });\n };\n const handleEnter = e => {\n const target = e.target || {};\n if (preload) {\n if (target.preloadTimeout) {\n return;\n }\n target.preloadTimeout = setTimeout(() => {\n target.preloadTimeout = null;\n this.preloadRoute(nextOpts).catch(err => {\n console.warn(err);\n console.warn('Error preloading route! ☝️');\n });\n }, preloadDelay);\n }\n };\n const handleLeave = e => {\n const target = e.target || {};\n if (target.preloadTimeout) {\n clearTimeout(target.preloadTimeout);\n target.preloadTimeout = null;\n }\n };\n return {\n type: 'internal',\n next,\n handleFocus,\n handleClick,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n disabled\n };\n };\n dehydrate = () => {\n return {\n state: {\n ...pick(this.state, ['latestLocation', 'currentLocation', 'status', 'lastUpdated']),\n currentMatches: this.state.currentMatches.map(match => ({\n id: match.id,\n state: {\n status: match.state.status\n }\n }))\n }\n };\n };\n hydrate = dehydratedRouter => {\n this.store.setState(s => {\n // Match the routes\n const currentMatches = this.matchRoutes(dehydratedRouter.state.latestLocation.pathname, {\n strictParseParams: true\n });\n currentMatches.forEach((match, index) => {\n const dehydratedMatch = dehydratedRouter.state.currentMatches[index];\n invariant(dehydratedMatch && dehydratedMatch.id === match.id, 'Oh no! There was a hydration mismatch when attempting to hydrate the state of the router! 😬');\n match.store.setState(s => ({\n ...s,\n ...dehydratedMatch.state\n }));\n });\n return {\n ...s,\n ...dehydratedRouter.state,\n currentMatches\n };\n });\n };\n #buildRouteTree = routeTree => {\n const recurseRoutes = routes => {\n routes.forEach((route, i) => {\n route.init({\n originalIndex: i,\n router: this\n });\n const existingRoute = this.routesById[route.id];\n if (existingRoute) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Duplicate routes found with id: ${String(route.id)}`, this.routesById, route);\n }\n throw new Error();\n }\n this.routesById[route.id] = route;\n const children = route.children;\n if (children?.length) recurseRoutes(children);\n });\n };\n recurseRoutes([routeTree]);\n return routeTree;\n };\n #parseLocation = previousLocation => {\n let {\n pathname,\n search,\n hash,\n state\n } = this.history.location;\n const parsedSearch = this.options.parseSearch(search);\n return {\n pathname: pathname,\n searchStr: search,\n search: replaceEqualDeep(previousLocation?.search, parsedSearch),\n hash: hash.split('#').reverse()[0] ?? '',\n href: `${pathname}${search}${hash}`,\n state: state,\n key: state?.key || '__init__'\n };\n };\n #onFocus = () => {\n this.load();\n };\n #buildLocation = (dest = {}) => {\n dest.fromCurrent = dest.fromCurrent ?? dest.to === '';\n const fromPathname = dest.fromCurrent ? this.state.latestLocation.pathname : dest.from ?? this.state.latestLocation.pathname;\n let pathname = resolvePath(this.basepath ?? '/', fromPathname, `${dest.to ?? ''}`);\n const fromMatches = this.matchRoutes(this.state.latestLocation.pathname, {\n strictParseParams: true\n });\n const toMatches = this.matchRoutes(pathname);\n const prevParams = {\n ...last(fromMatches)?.params\n };\n let nextParams = (dest.params ?? true) === true ? prevParams : functionalUpdate(dest.params, prevParams);\n if (nextParams) {\n toMatches.map(d => d.route.options.stringifyParams).filter(Boolean).forEach(fn => {\n Object.assign({}, nextParams, fn(nextParams));\n });\n }\n pathname = interpolatePath(pathname, nextParams ?? {});\n\n // Pre filters first\n const preFilteredSearch = dest.__preSearchFilters?.length ? dest.__preSearchFilters?.reduce((prev, next) => next(prev), this.state.latestLocation.search) : this.state.latestLocation.search;\n\n // Then the link/navigate function\n const destSearch = dest.search === true ? preFilteredSearch // Preserve resolvedFrom true\n : dest.search ? functionalUpdate(dest.search, preFilteredSearch) ?? {} // Updater\n : dest.__preSearchFilters?.length ? preFilteredSearch // Preserve resolvedFrom filters\n : {};\n\n // Then post filters\n const postFilteredSearch = dest.__postSearchFilters?.length ? dest.__postSearchFilters.reduce((prev, next) => next(prev), destSearch) : destSearch;\n const search = replaceEqualDeep(this.state.latestLocation.search, postFilteredSearch);\n const searchStr = this.options.stringifySearch(search);\n let hash = dest.hash === true ? this.state.latestLocation.hash : functionalUpdate(dest.hash, this.state.latestLocation.hash);\n hash = hash ? `#${hash}` : '';\n return {\n pathname,\n search,\n searchStr,\n state: this.state.latestLocation.state,\n hash,\n href: `${pathname}${searchStr}${hash}`,\n key: dest.key\n };\n };\n #commitLocation = async location => {\n const next = this.buildNext(location);\n const id = '' + Date.now() + Math.random();\n if (this.navigateTimeout) clearTimeout(this.navigateTimeout);\n let nextAction = 'replace';\n if (!location.replace) {\n nextAction = 'push';\n }\n const isSameUrl = this.state.latestLocation.href === next.href;\n if (isSameUrl && !next.key) {\n nextAction = 'replace';\n }\n const href = `${next.pathname}${next.searchStr}${next.hash ? `#${next.hash}` : ''}`;\n this.history[nextAction === 'push' ? 'push' : 'replace'](href, {\n id,\n ...next.state\n });\n\n // this.load(this.#parseLocation(this.state.latestLocation))\n\n return this.navigationPromise = new Promise(resolve => {\n const previousNavigationResolve = this.resolveNavigation;\n this.resolveNavigation = () => {\n previousNavigationResolve();\n resolve();\n };\n });\n };\n}\n\n// Detect if we're in the DOM\nconst isServer = typeof window === 'undefined' || !window.document.createElement;\nfunction getInitialRouterState() {\n return {\n status: 'idle',\n latestLocation: null,\n currentLocation: null,\n currentMatches: [],\n lastUpdated: Date.now()\n };\n}\nfunction isCtrlEvent(e) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);\n}\n\nexport { RootRoute, Route, RouteMatch, Router, cleanPath, createBrowserHistory, createHashHistory, createMemoryHistory, decode, defaultFetchServerDataFn, defaultParseSearch, defaultStringifySearch, encode, functionalUpdate, interpolatePath, isPlainObject, joinPaths, last, matchByPath, matchPathname, parsePathname, parseSearchWith, partialDeepEqual, pick, replaceEqualDeep, resolvePath, rootRouteId, stringifySearchWith, trimPath, trimPathLeft, trimPathRight, warning };\n//# sourceMappingURL=index.js.map\n","/**\n * react-store\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\n\nfunction useStore(store, selector = d => d, compareShallow) {\n const slice = useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, compareShallow ? shallow : undefined);\n return slice;\n}\nfunction shallow(objA, objB) {\n if (Object.is(objA, objB)) {\n return true;\n }\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n // if (objA instanceof Map && objB instanceof Map) {\n // if (objA.size !== objB.size) return false\n\n // for (const [key, value] of objA) {\n // if (!Object.is(value, objB.get(key))) {\n // return false\n // }\n // }\n // return true\n // }\n\n // if (objA instanceof Set && objB instanceof Set) {\n // if (objA.size !== objB.size) return false\n\n // for (const value of objA) {\n // if (!objB.has(value)) {\n // return false\n // }\n // }\n // return true\n // }\n\n const keysA = Object.keys(objA);\n if (keysA.length !== Object.keys(objB).length) {\n return false;\n }\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\nexport { useStore };\n//# sourceMappingURL=index.js.map\n","/**\n * react-router\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { functionalUpdate, Router, warning, invariant, last } from '@tanstack/router';\nexport * from '@tanstack/router';\nimport { useStore } from '@tanstack/react-store';\nexport { useStore } from '@tanstack/react-store';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n//\n\nfunction lazy(importer) {\n const lazyComp = /*#__PURE__*/React.lazy(importer);\n const finalComp = lazyComp;\n finalComp.preload = async () => {\n {\n await importer();\n }\n };\n return finalComp;\n}\n//\n\nfunction useLinkProps(options) {\n const router = useRouterContext();\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({\n className: 'active'\n }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to = '.',\n preload,\n preloadDelay,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options;\n const linkInfo = router.buildLink(options);\n if (linkInfo.type === 'external') {\n const {\n href\n } = linkInfo;\n return {\n href\n };\n }\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n next\n } = linkInfo;\n const reactHandleClick = e => {\n if (React.startTransition) {\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e);\n });\n } else {\n handleClick(e);\n }\n };\n const composeHandlers = handlers => e => {\n if (e.persist) e.persist();\n handlers.filter(Boolean).forEach(handler => {\n if (e.defaultPrevented) return;\n handler(e);\n });\n };\n\n // Get the active props\n const resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? {} : {};\n\n // Get the inactive props\n const resolvedInactiveProps = isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {};\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([onClick, reactHandleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style\n },\n className: [className, resolvedActiveProps.className, resolvedInactiveProps.className].filter(Boolean).join(' ') || undefined,\n ...(disabled ? {\n role: 'link',\n 'aria-disabled': true\n } : undefined),\n ['data-status']: isActive ? 'active' : undefined\n };\n}\nconst Link = /*#__PURE__*/React.forwardRef((props, ref) => {\n const linkProps = useLinkProps(props);\n return /*#__PURE__*/React.createElement(\"a\", _extends({\n ref: ref\n }, linkProps, {\n children: typeof props.children === 'function' ? props.children({\n isActive: linkProps['data-status'] === 'active'\n }) : props.children\n }));\n});\nfunction Navigate(props) {\n const router = useRouterContext();\n React.useLayoutEffect(() => {\n router.navigate(props);\n }, []);\n return null;\n}\nconst matchesContext = /*#__PURE__*/React.createContext(null);\nconst routerContext = /*#__PURE__*/React.createContext(null);\nclass ReactRouter extends Router {\n constructor(opts) {\n super({\n ...opts,\n loadComponent: async component => {\n if (component.preload) {\n await component.preload();\n }\n return component;\n }\n });\n }\n}\nfunction RouterProvider({\n router,\n ...rest\n}) {\n router.update(rest);\n const currentMatches = useStore(router.store, s => s.currentMatches);\n React.useEffect(router.mount, [router]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(routerContext.Provider, {\n value: {\n router: router\n }\n }, /*#__PURE__*/React.createElement(matchesContext.Provider, {\n value: [undefined, ...currentMatches]\n }, /*#__PURE__*/React.createElement(Outlet, null))));\n}\nfunction useRouterContext() {\n const value = React.useContext(routerContext);\n warning(!value, 'useRouter must be used inside a <Router> component!');\n useStore(value.router.store);\n return value.router;\n}\nfunction useRouter(track, shallow) {\n const router = useRouterContext();\n useStore(router.store, track, shallow);\n return router;\n}\nfunction useMatches() {\n return React.useContext(matchesContext);\n}\nfunction useMatch(opts) {\n const router = useRouterContext();\n const nearestMatch = useMatches()[0];\n const match = opts?.from ? router.state.currentMatches.find(d => d.route.id === opts?.from) : nearestMatch;\n invariant(match, `Could not find ${opts?.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`);\n if (opts?.strict ?? true) {\n invariant(nearestMatch.route.id == match?.route.id, `useMatch(\"${match?.route.id}\") is being called in a component that is meant to render the '${nearestMatch.route.id}' route. Did you mean to 'useMatch(\"${match?.route.id}\", { strict: false })' or 'useRoute(\"${match?.route.id}\")' instead?`);\n }\n useStore(match.store, d => opts?.track?.(match) ?? match, opts?.shallow);\n return match;\n}\nfunction useRoute(routeId) {\n const router = useRouterContext();\n const resolvedRoute = router.getRoute(routeId);\n invariant(resolvedRoute, `Could not find a route for route \"${routeId}\"! Did you forget to add it to your route?`);\n return resolvedRoute;\n}\nfunction useSearch(opts) {\n const match = useMatch(opts);\n useStore(match.store, d => opts?.track?.(d.search) ?? d.search, true);\n return match.state.search;\n}\nfunction useParams(opts) {\n const router = useRouterContext();\n useStore(router.store, d => {\n const params = last(d.currentMatches)?.params;\n return opts?.track?.(params) ?? params;\n }, true);\n return last(router.state.currentMatches)?.params;\n}\nfunction useNavigate(defaultOpts) {\n const router = useRouterContext();\n return React.useCallback(opts => {\n return router.navigate({\n ...defaultOpts,\n ...opts\n });\n }, []);\n}\nfunction useMatchRoute() {\n const router = useRouterContext();\n return React.useCallback(opts => {\n const {\n pending,\n caseSensitive,\n ...rest\n } = opts;\n return router.matchRoute(rest, {\n pending,\n caseSensitive\n });\n }, []);\n}\nfunction MatchRoute(props) {\n const matchRoute = useMatchRoute();\n const params = matchRoute(props);\n if (!params) {\n return null;\n }\n if (typeof props.children === 'function') {\n return props.children(params);\n }\n return params ? props.children : null;\n}\nfunction Outlet() {\n const matches = useMatches().slice(1);\n const match = matches[0];\n if (!match) {\n return null;\n }\n return /*#__PURE__*/React.createElement(SubOutlet, {\n matches: matches,\n match: match\n });\n}\nfunction SubOutlet({\n matches,\n match\n}) {\n const router = useRouterContext();\n useStore(match.store, store => [store.status, store.error], true);\n const defaultPending = React.useCallback(() => null, []);\n const Inner = React.useCallback(props => {\n if (props.match.state.status === 'error') {\n throw props.match.state.error;\n }\n if (props.match.state.status === 'success') {\n return /*#__PURE__*/React.createElement(props.match.component ?? router.options.defaultComponent ?? Outlet);\n }\n if (props.match.state.status === 'pending') {\n throw props.match.__loadPromise;\n }\n invariant(false, 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!');\n }, []);\n const PendingComponent = match.pendingComponent ?? router.options.defaultPendingComponent ?? defaultPending;\n const errorComponent = match.errorComponent ?? router.options.defaultErrorComponent;\n return /*#__PURE__*/React.createElement(matchesContext.Provider, {\n value: matches\n }, match.route.options.wrapInSuspense ?? true ? /*#__PURE__*/React.createElement(React.Suspense, {\n fallback: /*#__PURE__*/React.createElement(PendingComponent, null)\n }, /*#__PURE__*/React.createElement(CatchBoundary, {\n key: match.route.id,\n errorComponent: errorComponent,\n match: match\n }, /*#__PURE__*/React.createElement(Inner, {\n match: match\n }))) : /*#__PURE__*/React.createElement(CatchBoundary, {\n key: match.route.id,\n errorComponent: errorComponent,\n match: match\n }, /*#__PURE__*/React.createElement(Inner, {\n match: match\n })));\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\n\nclass CatchBoundary extends React.Component {\n state = {\n error: false,\n info: undefined\n };\n componentDidCatch(error, info) {\n console.error(`Error in route match: ${this.props.match.id}`);\n console.error(error);\n this.setState({\n error,\n info\n });\n }\n render() {\n return /*#__PURE__*/React.createElement(CatchBoundaryInner, _extends({}, this.props, {\n errorState: this.state,\n reset: () => this.setState({})\n }));\n }\n}\nfunction CatchBoundaryInner(props) {\n const [activeErrorState, setActiveErrorState] = React.useState(props.errorState);\n const router = useRouterContext();\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary;\n const prevKeyRef = React.useRef('');\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({});\n }\n }\n prevKeyRef.current = router.state.currentLocation.key;\n }, [activeErrorState, router.state.currentLocation.key]);\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState);\n }\n // props.reset()\n }, [props.errorState.error]);\n if (props.errorState.error && activeErrorState.error) {\n return /*#__PURE__*/React.createElement(errorComponent, activeErrorState);\n }\n return props.children;\n}\nfunction DefaultErrorBoundary({\n error\n}) {\n return /*#__PURE__*/React.createElement(\"div\", {\n style: {\n padding: '.5rem',\n maxWidth: '100%'\n }\n }, /*#__PURE__*/React.createElement(\"strong\", {\n style: {\n fontSize: '1.2rem'\n }\n }, \"Something went wrong!\"), /*#__PURE__*/React.createElement(\"div\", {\n style: {\n height: '.5rem'\n }\n }), /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(\"pre\", null, error.message ? /*#__PURE__*/React.createElement(\"code\", {\n style: {\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red'\n }\n }, error.message) : null)));\n}\n\n// TODO: While we migrate away from the history package, these need to be disabled\n// export function usePrompt(message: string, when: boolean | any): void {\n// const router = useRouter()\n\n// React.useEffect(() => {\n// if (!when) return\n\n// let unblock = router.getHistory().block((transition) => {\n// if (window.confirm(message)) {\n// unblock()\n// transition.retry()\n// } else {\n// router.setStore((s) => {\n// s.currentLocation.pathname = window.location.pathname\n// })\n// }\n// })\n\n// return unblock\n// }, [when, message])\n// }\n\n// export function Prompt({ message, when, children }: PromptProps) {\n// usePrompt(message, when ?? true)\n// return (children ?? null) as ReactNode\n// }\n\nexport { DefaultErrorBoundary, Link, MatchRoute, Navigate, Outlet, ReactRouter, RouterProvider, lazy, matchesContext, routerContext, useLinkProps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterContext, useSearch };\n//# sourceMappingURL=index.js.map\n","import React from 'react'\n\nconst getItem = (key: string): unknown => {\n try {\n const itemValue = localStorage.getItem(key)\n if (typeof itemValue === 'string') {\n return JSON.parse(itemValue)\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\nexport default function useLocalStorage<T>(\n key: string,\n defaultValue: T | undefined,\n): [T | undefined, (newVal: T | ((prevVal: T) => T)) => void] {\n const [value, setValue] = React.useState<T>()\n\n React.useEffect(() => {\n const initialValue = getItem(key) as T | undefined\n\n if (typeof initialValue === 'undefined' || initialValue === null) {\n setValue(\n typeof defaultValue === 'function' ? defaultValue() : defaultValue,\n )\n } else {\n setValue(initialValue)\n }\n }, [defaultValue, key])\n\n const setter = React.useCallback(\n (updater: any) => {\n setValue((old) => {\n let newVal = updater\n\n if (typeof updater == 'function') {\n newVal = updater(old)\n }\n try {\n localStorage.setItem(key, JSON.stringify(newVal))\n } catch {}\n\n return newVal\n })\n },\n [key],\n )\n\n return [value, setter]\n}\n","import React from 'react'\n\nexport const defaultTheme = {\n background: '#0b1521',\n backgroundAlt: '#132337',\n foreground: 'white',\n gray: '#3f4e60',\n grayAlt: '#222e3e',\n inputBackgroundColor: '#fff',\n inputTextColor: '#000',\n success: '#00ab52',\n danger: '#ff0085',\n active: '#006bff',\n warning: '#ffb200',\n} as const\n\nexport type Theme = typeof defaultTheme\ninterface ProviderProps {\n theme: Theme\n children?: React.ReactNode\n}\n\nconst ThemeContext = React.createContext(defaultTheme)\n\nexport function ThemeProvider({ theme, ...rest }: ProviderProps) {\n return <ThemeContext.Provider value={theme} {...rest} />\n}\n\nexport function useTheme() {\n return React.useContext(ThemeContext)\n}\n","import React from 'react'\n\nexport default function useMediaQuery(query: string): boolean | undefined {\n // Keep track of the preference in state, start with the current match\n const [isMatch, setIsMatch] = React.useState(() => {\n if (typeof window !== 'undefined') {\n return window.matchMedia && window.matchMedia(query).matches\n }\n return\n })\n\n // Watch for changes\n React.useEffect(() => {\n if (typeof window !== 'undefined') {\n if (!window.matchMedia) {\n return\n }\n\n // Create a matcher\n const matcher = window.matchMedia(query)\n\n // Create our handler\n const onChange = ({ matches }: { matches: boolean }) =>\n setIsMatch(matches)\n\n // Listen for changes\n matcher.addListener(onChange)\n\n return () => {\n // Stop listening for changes\n matcher.removeListener(onChange)\n }\n }\n\n return\n }, [isMatch, query, setIsMatch])\n\n return isMatch\n}\n","import React from 'react'\nimport { AnyRouteMatch, RouteMatch } from '@tanstack/react-router'\n\nimport { Theme, useTheme } from './theme'\nimport useMediaQuery from './useMediaQuery'\n\nexport const isServer = typeof window === 'undefined'\n\ntype StyledComponent<T> = T extends 'button'\n ? React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >\n : T extends 'input'\n ? React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >\n : T extends 'select'\n ? React.DetailedHTMLProps<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n HTMLSelectElement\n >\n : T extends keyof HTMLElementTagNameMap\n ? React.HTMLAttributes<HTMLElementTagNameMap[T]>\n : never\n\nexport function getStatusColor(match: AnyRouteMatch, theme: Theme) {\n return match.state.status === 'pending'\n ? theme.active\n : match.state.status === 'error'\n ? theme.danger\n : match.state.status === 'success'\n ? theme.success\n : theme.gray\n}\n\ntype Styles =\n | React.CSSProperties\n | ((props: Record<string, any>, theme: Theme) => React.CSSProperties)\n\nexport function styled<T extends keyof HTMLElementTagNameMap>(\n type: T,\n newStyles: Styles,\n queries: Record<string, Styles> = {},\n) {\n return React.forwardRef<HTMLElementTagNameMap[T], StyledComponent<T>>(\n ({ style, ...rest }, ref) => {\n const theme = useTheme()\n\n const mediaStyles = Object.entries(queries).reduce(\n (current, [key, value]) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useMediaQuery(key)\n ? {\n ...current,\n ...(typeof value === 'function' ? value(rest, theme) : value),\n }\n : current\n },\n {},\n )\n\n return React.createElement(type, {\n ...rest,\n style: {\n ...(typeof newStyles === 'function'\n ? newStyles(rest, theme)\n : newStyles),\n ...style,\n ...mediaStyles,\n },\n ref,\n })\n },\n )\n}\n\nexport function useIsMounted() {\n const mountedRef = React.useRef(false)\n const isMounted = React.useCallback(() => mountedRef.current, [])\n\n React[isServer ? 'useEffect' : 'useLayoutEffect'](() => {\n mountedRef.current = true\n return () => {\n mountedRef.current = false\n }\n }, [])\n\n return isMounted\n}\n\n/**\n * Displays a string regardless the type of the data\n * @param {unknown} value Value to be stringified\n */\nexport const displayValue = (value: unknown) => {\n const name = Object.getOwnPropertyNames(Object(value))\n const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value\n\n return JSON.stringify(newValue, name)\n}\n\n/**\n * This hook is a safe useState version which schedules state updates in microtasks\n * to prevent updating a component state while React is rendering different components\n * or when the component is not mounted anymore.\n */\nexport function useSafeState<T>(initialState: T): [T, (value: T) => void] {\n const isMounted = useIsMounted()\n const [state, setState] = React.useState(initialState)\n\n const safeSetState = React.useCallback(\n (value: T) => {\n scheduleMicrotask(() => {\n if (isMounted()) {\n setState(value)\n }\n })\n },\n [isMounted],\n )\n\n return [state, safeSetState]\n}\n\n/**\n * Schedules a microtask.\n * This can be useful to schedule state updates after rendering.\n */\nfunction scheduleMicrotask(callback: () => void) {\n Promise.resolve()\n .then(callback)\n .catch((error) =>\n setTimeout(() => {\n throw error\n }),\n )\n}\n\nexport function multiSortBy<T>(\n arr: T[],\n accessors: ((item: T) => any)[] = [(d) => d],\n): T[] {\n return arr\n .map((d, i) => [d, i] as const)\n .sort(([a, ai], [b, bi]) => {\n for (const accessor of accessors) {\n const ao = accessor(a)\n const bo = accessor(b)\n\n if (typeof ao === 'undefined') {\n if (typeof bo === 'undefined') {\n continue\n }\n return 1\n }\n\n if (ao === bo) {\n continue\n }\n\n return ao > bo ? 1 : -1\n }\n\n return ai - bi\n })\n .map(([d]) => d)\n}\n","import { styled } from './utils'\n\nexport const Panel = styled(\n 'div',\n (_props, theme) => ({\n fontSize: 'clamp(12px, 1.5vw, 14px)',\n fontFamily: `sans-serif`,\n display: 'flex',\n backgroundColor: theme.background,\n color: theme.foreground,\n }),\n {\n '(max-width: 700px)': {\n flexDirection: 'column',\n },\n '(max-width: 600px)': {\n fontSize: '.9em',\n // flexDirection: 'column',\n },\n },\n)\n\nexport const ActivePanel = styled(\n 'div',\n () => ({\n flex: '1 1 500px',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n height: '100%',\n }),\n {\n '(max-width: 700px)': (_props, theme) => ({\n borderTop: `2px solid ${theme.gray}`,\n }),\n },\n)\n\nexport const Button = styled('button', (props, theme) => ({\n appearance: 'none',\n fontSize: '.9em',\n fontWeight: 'bold',\n background: theme.gray,\n border: '0',\n borderRadius: '.3em',\n color: 'white',\n padding: '.5em',\n opacity: props.disabled ? '.5' : undefined,\n cursor: 'pointer',\n}))\n\n// export const QueryKeys = styled('span', {\n// display: 'inline-block',\n// fontSize: '0.9em',\n// })\n\n// export const QueryKey = styled('span', {\n// display: 'inline-flex',\n// alignItems: 'center',\n// padding: '.2em .4em',\n// fontWeight: 'bold',\n// textShadow: '0 0 10px black',\n// borderRadius: '.2em',\n// })\n\nexport const Code = styled('code', {\n fontSize: '.9em',\n})\n\nexport const Input = styled('input', (_props, theme) => ({\n backgroundColor: theme.inputBackgroundColor,\n border: 0,\n borderRadius: '.2em',\n color: theme.inputTextColor,\n fontSize: '.9em',\n lineHeight: `1.3`,\n padding: '.3em .4em',\n}))\n\nexport const Select = styled(\n 'select',\n (_props, theme) => ({\n display: `inline-block`,\n fontSize: `.9em`,\n fontFamily: `sans-serif`,\n fontWeight: 'normal',\n lineHeight: `1.3`,\n padding: `.3em 1.5em .3em .5em`,\n height: 'auto',\n border: 0,\n borderRadius: `.2em`,\n appearance: `none`,\n WebkitAppearance: 'none',\n backgroundColor: theme.inputBackgroundColor,\n backgroundImage: `url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")`,\n backgroundRepeat: `no-repeat`,\n backgroundPosition: `right .55em center`,\n backgroundSize: `.65em auto, 100%`,\n color: theme.inputTextColor,\n }),\n {\n '(max-width: 500px)': {\n display: 'none',\n },\n },\n)\n","import * as React from 'react'\n\nimport { displayValue, styled } from './utils'\n\nexport const Entry = styled('div', {\n fontFamily: 'Menlo, monospace',\n fontSize: '.7rem',\n lineHeight: '1.7',\n outline: 'none',\n wordBreak: 'break-word',\n})\n\nexport const Label = styled('span', {\n color: 'white',\n})\n\nexport const LabelButton = styled('button', {\n cursor: 'pointer',\n color: 'white',\n})\n\nexport const ExpandButton = styled('button', {\n cursor: 'pointer',\n color: 'inherit',\n font: 'inherit',\n outline: 'inherit',\n background: 'transparent',\n border: 'none',\n padding: 0,\n})\n\nexport const Value = styled('span', (_props, theme) => ({\n color: theme.danger,\n}))\n\nexport const SubEntries = styled('div', {\n marginLeft: '.1em',\n paddingLeft: '1em',\n borderLeft: '2px solid rgba(0,0,0,.15)',\n})\n\nexport const Info = styled('span', {\n color: 'grey',\n fontSize: '.7em',\n})\n\ntype ExpanderProps = {\n expanded: boolean\n style?: React.CSSProperties\n}\n\nexport const Expander = ({ expanded, style = {} }: ExpanderProps) => (\n <span\n style={{\n display: 'inline-block',\n transition: 'all .1s ease',\n transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,\n ...style,\n }}\n >\n ▶\n </span>\n)\n\ntype Entry = {\n label: string\n}\n\ntype RendererProps = {\n handleEntry: HandleEntryFn\n label?: React.ReactNode\n value: unknown\n subEntries: Entry[]\n subEntryPages: Entry[][]\n type: string\n expanded: boolean\n toggleExpanded: () => void\n pageSize: number\n renderer?: Renderer\n}\n\n/**\n * Chunk elements in the array by size\n *\n * when the array cannot be chunked evenly by size, the last chunk will be\n * filled with the remaining elements\n *\n * @example\n * chunkArray(['a','b', 'c', 'd', 'e'], 2) // returns [['a','b'], ['c', 'd'], ['e']]\n */\nexport function chunkArray<T>(array: T[], size: number): T[][] {\n if (size < 1) return []\n let i = 0\n const result: T[][] = []\n while (i < array.length) {\n result.push(array.slice(i, i + size))\n i = i + size\n }\n return result\n}\n\ntype Renderer = (props: RendererProps) => JSX.Element\n\nexport const DefaultRenderer: Renderer = ({\n handleEntry,\n label,\n value,\n subEntries = [],\n subEntryPages = [],\n type,\n expanded = false,\n toggleExpanded,\n pageSize,\n renderer,\n}) => {\n const [expandedPages, setExpandedPages] = React.useState<number[]>([])\n const [valueSnapshot, setValueSnapshot] = React.useState(undefined)\n\n const refreshValueSnapshot = () => {\n setValueSnapshot((value as () => any)())\n }\n\n return (\n <Entry>\n {subEntryPages.length ? (\n <>\n <ExpandButton onClick={() => toggleExpanded()}>\n <Expander expanded={expanded} /> {label}{' '}\n <Info>\n {String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : ''}\n {subEntries.length} {subEntries.length > 1 ? `items` : `item`}\n </Info>\n </ExpandButton>\n {expanded ? (\n subEntryPages.length === 1 ? (\n <SubEntries>\n {subEntries.map((entry, index) => handleEntry(entry))}\n </SubEntries>\n ) : (\n <SubEntries>\n {subEntryPages.map((entries, index) => (\n <div key={index}>\n <Entry>\n <LabelButton\n onClick={() =>\n setExpandedPages((old) =>\n old.includes(index)\n ? old.filter((d) => d !== index)\n : [...old, index],\n )\n }\n >\n <Expander expanded={expanded} /> [{index * pageSize} ...{' '}\n {index * pageSize + pageSize - 1}]\n </LabelButton>\n {expandedPages.includes(index) ? (\n <SubEntries>\n {entries.map((entry) => handleEntry(entry))}\n </SubEntries>\n ) : null}\n </Entry>\n </div>\n ))}\n </SubEntries>\n )\n ) : null}\n </>\n ) : type === 'function' ? (\n <>\n <Explorer\n renderer={renderer}\n label={\n <button\n onClick={refreshValueSnapshot}\n style={{\n appearance: 'none',\n border: '0',\n background: 'transparent',\n }}\n >\n <Label>{label}</Label> 🔄{' '}\n </button>\n }\n value={valueSnapshot}\n defaultExpanded={{}}\n />\n </>\n ) : (\n <>\n <Label>{label}:</Label> <Value>{displayValue(value)}</Value>\n </>\n )}\n </Entry>\n )\n}\n\ntype HandleEntryFn = (entry: Entry) => JSX.Element\n\ntype ExplorerProps = Partial<RendererProps> & {\n renderer?: Renderer\n defaultExpanded?: true | Record<string, boolean>\n}\n\ntype Property = {\n defaultExpanded?: boolean | Record<string, boolean>\n label: string\n value: unknown\n}\n\nfunction isIterable(x: any): x is Iterable<unknown> {\n return Symbol.iterator in x\n}\n\nexport default function Explorer({\n value,\n defaultExpanded,\n renderer = DefaultRenderer,\n pageSize = 100,\n ...rest\n}: ExplorerProps) {\n const [expanded, setExpanded] = React.useState(Boolean(defaultExpanded))\n const toggleExpanded = React.useCallback(() => setExpanded((old) => !old), [])\n\n let type: string = typeof value\n let subEntries: Property[] = []\n\n const makeProperty = (sub: { label: string; value: unknown }): Property => {\n const subDefaultExpanded =\n defaultExpanded === true\n ? { [sub.label]: true }\n : defaultExpanded?.[sub.label]\n return {\n ...sub,\n defaultExpanded: subDefaultExpanded,\n }\n }\n\n if (Array.isArray(value)) {\n type = 'array'\n subEntries = value.map((d, i) =>\n makeProperty({\n label: i.toString(),\n value: d,\n }),\n )\n } else if (\n value !== null &&\n typeof value === 'object' &&\n isIterable(value) &&\n typeof value[Symbol.iterator] === 'function'\n ) {\n type = 'Iterable'\n subEntries = Array.from(value, (val, i) =>\n makeProperty({\n label: i.toString(),\n value: val,\n }),\n )\n } else if (typeof value === 'object' && value !== null) {\n type = 'object'\n subEntries = Object.entries(value).map(([key, val]) =>\n makeProperty({\n label: key,\n value: val,\n }),\n )\n }\n\n const subEntryPages = chunkArray(subEntries, pageSize)\n\n return renderer({\n handleEntry: (entry) => (\n <Explorer\n key={entry.label}\n value={value}\n renderer={renderer}\n {...rest}\n {...entry}\n />\n ),\n type,\n subEntries,\n subEntryPages,\n value,\n expanded,\n toggleExpanded,\n pageSize,\n ...rest,\n })\n}\n","import React from 'react'\nimport {\n Router,\n last,\n routerContext,\n invariant,\n useRouter,\n AnyRouter,\n} from '@tanstack/react-router'\n\nimport useLocalStorage from './useLocalStorage'\nimport {\n getStatusColor,\n multiSortBy,\n useIsMounted,\n useSafeState,\n} from './utils'\nimport { Panel, Button, Code, ActivePanel } from './styledComponents'\nimport { ThemeProvider, defaultTheme as theme } from './theme'\n// import { getQueryStatusLabel, getQueryStatusColor } from './utils'\nimport Explorer from './Explorer'\n\nexport type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>\n\ninterface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * Use this to add props to the panel. For example, you can add className, style (merge and override default style), etc.\n */\n panelProps?: React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >\n /**\n * Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n closeButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >\n /**\n * Use this to add props to the toggle button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n toggleButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >\n /**\n * The position of the TanStack Router logo to open and close the devtools panel.\n * Defaults to 'bottom-left'.\n */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n /**\n * Use this to render the devtools inside a different type of container element for a11y purposes.\n * Any string which corresponds to a valid intrinsic JSX element is allowed.\n * Defaults to 'footer'.\n */\n containerElement?: string | any\n /**\n * A boolean variable indicating if the \"lite\" version of the library is being used\n */\n router?: AnyRouter\n}\n\ninterface DevtoolsPanelOptions {\n /**\n * The standard React style object used to style a component with inline styles\n */\n style?: React.CSSProperties\n /**\n * The standard React className property used to style a component with classes\n */\n className?: string\n /**\n * A boolean variable indicating whether the panel is open or closed\n */\n isOpen?: boolean\n /**\n * A function that toggles the open and close state of the panel\n */\n setIsOpen: (isOpen: boolean) => void\n /**\n * Handles the opening and closing the devtools panel\n */\n handleDragStart: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n /**\n * A boolean variable indicating if the \"lite\" version of the library is being used\n */\n router?: AnyRouter\n}\n\nconst isServer = typeof window === 'undefined'\n\nfunction Logo(props: React.HTMLProps<HTMLDivElement>) {\n return (\n <div\n {...props}\n style={{\n ...(props.style ?? {}),\n display: 'flex',\n alignItems: 'center',\n flexDirection: 'column',\n fontSize: '0.8rem',\n fontWeight: 'bolder',\n lineHeight: '1',\n }}\n >\n <div\n style={{\n letterSpacing: '-0.05rem',\n }}\n >\n TANSTACK\n </div>\n <div\n style={{\n backgroundImage:\n 'linear-gradient(to right, var(--tw-gradient-stops))',\n // @ts-ignore\n '--tw-gradient-from': '#84cc16',\n '--tw-gradient-stops':\n 'var(--tw-gradient-from), var(--tw-gradient-to)',\n '--tw-gradient-to': '#10b981',\n WebkitBackgroundClip: 'text',\n color: 'transparent',\n letterSpacing: '0.1rem',\n marginRight: '-0.2rem',\n }}\n >\n ROUTER\n </div>\n </div>\n )\n}\n\nexport function TanStackRouterDevtools({\n initialIsOpen,\n panelProps = {},\n closeButtonProps = {},\n toggleButtonProps = {},\n position = 'bottom-left',\n containerElement: Container = 'footer',\n router,\n}: DevtoolsOptions): React.ReactElement | null {\n const rootRef = React.useRef<HTMLDivElement>(null)\n const panelRef = React.useRef<HTMLDivElement>(null)\n const [isOpen, setIsOpen] = useLocalStorage(\n 'tanstackRouterDevtoolsOpen',\n initialIsOpen,\n )\n const [devtoolsHeight, setDevtoolsHeight] = useLocalStorage<number | null>(\n 'tanstackRouterDevtoolsHeight',\n null,\n )\n const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false)\n const [isResizing, setIsResizing] = useSafeState(false)\n const isMounted = useIsMounted()\n\n const handleDragStart = (\n panelElement: HTMLDivElement | null,\n startEvent: React.MouseEvent<HTMLDivElement, MouseEvent>,\n ) => {\n if (startEvent.button !== 0) return // Only allow left click for drag\n\n setIsResizing(true)\n\n const dragInfo = {\n originalHeight: panelElement?.getBoundingClientRect().height ?? 0,\n pageY: startEvent.pageY,\n }\n\n const run = (moveEvent: MouseEvent) => {\n const delta = dragInfo.pageY - moveEvent.pageY\n const newHeight = dragInfo?.originalHeight + delta\n\n setDevtoolsHeight(newHeight)\n\n if (newHeight < 70) {\n setIsOpen(false)\n } else {\n setIsOpen(true)\n }\n }\n\n const unsub = () => {\n setIsResizing(false)\n document.removeEventListener('mousemove', run)\n document.removeEventListener('mouseUp', unsub)\n }\n\n document.addEventListener('mousemove', run)\n document.addEventListener('mouseup', unsub)\n }\n\n React.useEffect(() => {\n setIsResolvedOpen(isOpen ?? false)\n }, [isOpen, isResolvedOpen, setIsResolvedOpen])\n\n // Toggle panel visibility before/after transition (depending on direction).\n // Prevents focusing in a closed panel.\n React.useEffect(() => {\n const ref = panelRef.current\n\n if (ref) {\n const handlePanelTransitionStart = () => {\n if (ref && isResolvedOpen) {\n ref.style.visibility = 'visible'\n }\n }\n\n const handlePanelTransitionEnd = () => {\n if (ref && !isResolvedOpen) {\n ref.style.visibility = 'hidden'\n }\n }\n\n ref.addEventListener('transitionstart', handlePanelTransitionStart)\n ref.addEventListener('transitionend', handlePanelTransitionEnd)\n\n return () => {\n ref.removeEventListener('transitionstart', handlePanelTransitionStart)\n ref.removeEventListener('transitionend', handlePanelTransitionEnd)\n }\n }\n\n return\n }, [isResolvedOpen])\n\n React[isServer ? 'useEffect' : 'useLayoutEffect'](() => {\n if (isResolvedOpen) {\n const previousValue = rootRef.current?.parentElement?.style.paddingBottom\n\n const run = () => {\n const containerHeight = panelRef.current?.getBoundingClientRect().height\n if (rootRef.current?.parentElement) {\n rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`\n }\n }\n\n run()\n\n if (typeof window !== 'undefined') {\n window.addEventListener('resize', run)\n\n return () => {\n window.removeEventListener('resize', run)\n if (\n rootRef.current?.parentElement &&\n typeof previousValue === 'string'\n ) {\n rootRef.current.parentElement.style.paddingBottom = previousValue\n }\n }\n }\n }\n return\n }, [isResolvedOpen])\n\n const { style: panelStyle = {}, ...otherPanelProps } = panelProps\n\n const {\n style: closeButtonStyle = {},\n onClick: onCloseClick,\n ...otherCloseButtonProps\n } = closeButtonProps\n\n const {\n style: toggleButtonStyle = {},\n onClick: onToggleClick,\n ...otherToggleButtonProps\n } = toggleButtonProps\n\n // Do not render on the server\n if (!isMounted()) return null\n\n return (\n <Container ref={rootRef} className=\"TanStackRouterDevtools\">\n <ThemeProvider theme={theme}>\n <TanStackRouterDevtoolsPanel\n ref={panelRef as any}\n {...otherPanelProps}\n router={router}\n style={{\n position: 'fixed',\n bottom: '0',\n right: '0',\n zIndex: 99999,\n width: '100%',\n height: devtoolsHeight ?? 500,\n maxHeight: '90%',\n boxShadow: '0 0 20px rgba(0,0,0,.3)',\n borderTop: `1px solid ${theme.gray}`,\n transformOrigin: 'top',\n // visibility will be toggled after transitions, but set initial state here\n visibility: isOpen ? 'visible' : 'hidden',\n ...panelStyle,\n ...(isResizing\n ? {\n transition: `none`,\n }\n : { transition: `all .2s ease` }),\n ...(isResolvedOpen\n ? {\n opacity: 1,\n pointerEvents: 'all',\n transform: `translateY(0) scale(1)`,\n }\n : {\n opacity: 0,\n pointerEvents: 'none',\n transform: `translateY(15px) scale(1.02)`,\n }),\n }}\n isOpen={isResolvedOpen}\n setIsOpen={setIsOpen}\n handleDragStart={(e) => handleDragStart(panelRef.current, e)}\n />\n {isResolvedOpen ? (\n <Button\n type=\"button\"\n aria-label=\"Close TanStack Router Devtools\"\n {...(otherCloseButtonProps as any)}\n onClick={(e) => {\n setIsOpen(false)\n onCloseClick && onCloseClick(e)\n }}\n style={{\n position: 'fixed',\n zIndex: 99999,\n margin: '.5em',\n bottom: 0,\n ...(position === 'top-right'\n ? {\n right: '0',\n }\n : position === 'top-left'\n ? {\n left: '0',\n }\n : position === 'bottom-right'\n ? {\n right: '0',\n }\n : {\n left: '0',\n }),\n ...closeButtonStyle,\n }}\n >\n Close\n </Button>\n ) : null}\n </ThemeProvider>\n {!isResolvedOpen ? (\n <button\n type=\"button\"\n {...otherToggleButtonProps}\n aria-label=\"Open TanStack Router Devtools\"\n onClick={(e) => {\n setIsOpen(true)\n onToggleClick && onToggleClick(e)\n }}\n style={{\n appearance: 'none',\n background: 'none',\n border: 0,\n padding: 0,\n position: 'fixed',\n zIndex: 99999,\n display: 'inline-flex',\n fontSize: '1.5em',\n margin: '.5em',\n cursor: 'pointer',\n width: 'fit-content',\n ...(position === 'top-right'\n ? {\n top: '0',\n right: '0',\n }\n : position === 'top-left'\n ? {\n top: '0',\n left: '0',\n }\n : position === 'bottom-right'\n ? {\n bottom: '0',\n right: '0',\n }\n : {\n bottom: '0',\n left: '0',\n }),\n ...toggleButtonStyle,\n }}\n >\n <Logo aria-hidden />\n </button>\n ) : null}\n </Container>\n )\n}\n\nexport const TanStackRouterDevtoolsPanel = React.forwardRef<\n HTMLDivElement,\n DevtoolsPanelOptions\n>(function TanStackRouterDevtoolsPanel(props, ref): React.ReactElement {\n const {\n isOpen = true,\n setIsOpen,\n handleDragStart,\n router: userRouter,\n ...panelProps\n } = props\n\n const routerContextValue = React.useContext(routerContext)\n const router = userRouter ?? routerContextValue?.router\n\n invariant(\n router,\n 'No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.',\n )\n\n useRouter()\n\n const [activeRouteId, setActiveRouteId] = useLocalStorage(\n 'tanstackRouterDevtoolsActiveRouteId',\n '',\n )\n\n const [activeMatchId, setActiveMatchId] = useLocalStorage(\n 'tanstackRouterDevtoolsActiveMatchId',\n '',\n )\n\n React.useEffect(() => {\n setActiveMatchId('')\n }, [activeRouteId])\n\n const allMatches = React.useMemo(\n () => [\n ...Object.values(router.state.currentMatches),\n ...Object.values(router.state.pendingMatches ?? []),\n ],\n [router.state.currentMatches, router.state.pendingMatches],\n )\n\n const activeMatch =\n allMatches?.find((d) => d.id === activeMatchId) ||\n allMatches?.find((d) => d.route.id === activeRouteId)\n\n // const matchCacheValues = multiSortBy(\n // Object.keys(router.state.matchCache)\n // .filter((key) => {\n // const cacheEntry = router.state.matchCache[key]!\n // return cacheEntry.gc > Date.now()\n // })\n // .map((key) => router.state.matchCache[key]!),\n // [\n // (d) => (d.match.state.isFetching ? -1 : 1),\n // (d) => -d.match.state.updatedAt!,\n // ],\n // )\n\n return (\n <ThemeProvider theme={theme}>\n <Panel ref={ref} className=\"TanStackRouterDevtoolsPanel\" {...panelProps}>\n <style\n dangerouslySetInnerHTML={{\n __html: `\n\n .TanStackRouterDevtoolsPanel * {\n scrollbar-color: ${theme.backgroundAlt} ${theme.gray};\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {\n background: ${theme.backgroundAlt};\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {\n background: ${theme.gray};\n border-radius: .5em;\n border: 3px solid ${theme.backgroundAlt};\n }\n\n .TanStackRouterDevtoolsPanel table {\n width: 100%;\n }\n\n .TanStackRouterDevtoolsPanel table tr {\n border-bottom: 2px dotted rgba(255, 255, 255, .2);\n }\n\n .TanStackRouterDevtoolsPanel table tr:last-child {\n border-bottom: none\n }\n\n .TanStackRouterDevtoolsPanel table td {\n padding: .25rem .5rem;\n border-right: 2px dotted rgba(255, 255, 255, .05);\n }\n\n .TanStackRouterDevtoolsPanel table td:last-child {\n border-right: none\n }\n\n `,\n }}\n />\n <div\n style={{\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '4px',\n marginBottom: '-4px',\n cursor: 'row-resize',\n zIndex: 100000,\n }}\n onMouseDown={handleDragStart}\n ></div>\n <div\n style={{\n flex: '1 1 500px',\n minHeight: '40%',\n maxHeight: '100%',\n overflow: 'auto',\n borderRight: `1px solid ${theme.grayAlt}`,\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <div\n style={{\n display: 'flex',\n justifyContent: 'start',\n gap: '1rem',\n padding: '1rem',\n alignItems: 'center',\n background: theme.backgroundAlt,\n }}\n >\n <Logo aria-hidden />\n <div\n style={{\n fontSize: 'clamp(.8rem, 2vw, 1.3rem)',\n fontWeight: 'bold',\n }}\n >\n <span\n style={{\n fontWeight: 100,\n }}\n >\n Devtools\n </span>\n </div>\n </div>\n <div\n style={{\n overflowY: 'auto',\n flex: '1',\n }}\n >\n <div\n style={{\n padding: '.5em',\n }}\n >\n <Explorer label=\"Router\" value={router} defaultExpanded={{}} />\n </div>\n </div>\n </div>\n <div\n style={{\n flex: '1 1 500px',\n minHeight: '40%',\n maxHeight: '100%',\n overflow: 'auto',\n borderRight: `1px solid ${theme.grayAlt}`,\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Active Matches\n </div>\n {router.state.currentMatches.map((match, i) => {\n return (\n <div\n key={match.route.id || i}\n role=\"button\"\n aria-label={`Open match details for ${match.route.id}`}\n onClick={() =>\n setActiveRouteId(\n activeRouteId === match.route.id ? '' : match.route.id,\n )\n }\n style={{\n display: 'flex',\n borderBottom: `solid 1px ${theme.grayAlt}`,\n cursor: 'pointer',\n alignItems: 'center',\n background:\n match === activeMatch ? 'rgba(255,255,255,.1)' : undefined,\n }}\n >\n <div\n style={{\n flex: '0 0 auto',\n width: '1.3rem',\n height: '1.3rem',\n marginLeft: '.25rem',\n background: getStatusColor(match, theme),\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n transition: 'all .2s ease-out',\n }}\n />\n\n <Code\n style={{\n padding: '.5em',\n }}\n >\n {`${match.id}`}\n </Code>\n </div>\n )\n })}\n {router.state.pendingMatches?.length ? (\n <>\n <div\n style={{\n marginTop: '2rem',\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Pending Matches\n </div>\n {router.state.pendingMatches?.map((match, i) => {\n return (\n <div\n key={match.route.id || i}\n role=\"button\"\n aria-label={`Open match details for ${match.route.id}`}\n onClick={() =>\n setActiveRouteId(\n activeRouteId === match.route.id ? '' : match.route.id,\n )\n }\n style={{\n display: 'flex',\n borderBottom: `solid 1px ${theme.grayAlt}`,\n cursor: 'pointer',\n background:\n match === activeMatch\n ? 'rgba(255,255,255,.1)'\n : undefined,\n }}\n >\n <div\n style={{\n flex: '0 0 auto',\n width: '1.3rem',\n height: '1.3rem',\n marginLeft: '.25rem',\n background: getStatusColor(match, theme),\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n transition: 'all .2s ease-out',\n }}\n />\n\n <Code\n style={{\n padding: '.5em',\n }}\n >\n {`${match.id}`}\n </Code>\n </div>\n )\n })}\n </>\n ) : null}\n {/* {matchCacheValues.length ? (\n <>\n <div\n style={{\n marginTop: '2rem',\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }}\n >\n <div>Match Cache</div>\n <Button\n onClick={() => {\n router.store.setState((s) => (s.matchCache = {}))\n }}\n >\n Clear\n </Button>\n </div>\n {matchCacheValues.map((d, i) => {\n const { match, gc } = d\n\n return (\n <div\n key={match.id || i}\n role=\"button\"\n aria-label={`Open match details for ${match.id}`}\n onClick={() =>\n setActiveMatchId(\n activeMatchId === match.id ? '' : match.id,\n )\n }\n style={{\n display: 'flex',\n borderBottom: `solid 1px ${theme.grayAlt}`,\n cursor: 'pointer',\n background:\n match === activeMatch\n ? 'rgba(255,255,255,.1)'\n : undefined,\n }}\n >\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n padding: '.5rem',\n gap: '.3rem',\n }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '.5rem',\n }}\n >\n <div\n style={{\n flex: '0 0 auto',\n width: '1.3rem',\n height: '1.3rem',\n background: getStatusColor(match, theme),\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n transition: 'all .2s ease-out',\n }}\n />\n <Code>{`${match.id}`}</Code>\n </div>\n <span\n style={{\n fontSize: '.7rem',\n opacity: '.5',\n lineHeight: 1,\n }}\n >\n Expires{' '}\n {formatDistanceStrict(new Date(gc), new Date(), {\n addSuffix: true,\n })}\n </span>\n </div>\n </div>\n )\n })}\n </>\n ) : null} */}\n </div>\n\n {activeMatch ? (\n <ActivePanel>\n <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Match Details\n </div>\n <div>\n <table>\n <tbody>\n <tr>\n <td style={{ opacity: '.5' }}>ID</td>\n <td>\n <Code\n style={{\n lineHeight: '1.8em',\n }}\n >\n {JSON.stringify(activeMatch.id, null, 2)}\n </Code>\n </td>\n </tr>\n <tr>\n <td style={{ opacity: '.5' }}>Status</td>\n <td>{activeMatch.state.status}</td>\n </tr>\n {/* <tr>\n <td style={{ opacity: '.5' }}>Invalid</td>\n <td>{activeMatch.getIsInvalid().toString()}</td>\n </tr> */}\n <tr>\n <td style={{ opacity: '.5' }}>Last Updated</td>\n <td>\n {activeMatch.state.updatedAt\n ? new Date(\n activeMatch.state.updatedAt as number,\n ).toLocaleTimeString()\n : 'N/A'}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div\n style={{\n background: theme.backgroundAlt,\n padding: '.5em',\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Actions\n </div>\n <div\n style={{\n padding: '0.5em',\n }}\n >\n <Button\n type=\"button\"\n onClick={() => activeMatch.load()}\n style={{\n background: theme.gray,\n }}\n >\n Reload\n </Button>\n </div>\n <div\n style={{\n background: theme.backgroundAlt,\n padding: '.5em',\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Explorer\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n <Explorer\n label=\"Match\"\n value={activeMatch}\n defaultExpanded={{}}\n />\n </div>\n </ActivePanel>\n ) : null}\n <div\n style={{\n flex: '1 1 500px',\n minHeight: '40%',\n maxHeight: '100%',\n overflow: 'auto',\n borderRight: `1px solid ${theme.grayAlt}`,\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n {/* <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n All Loader Data\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n {Object.keys(\n last(router.state.currentMatches)?.state.loaderData ||\n {},\n ).length ? (\n <Explorer\n value={\n last(router.state.currentMatches)?.state\n .loaderData || {}\n }\n defaultExpanded={Object.keys(\n (last(router.state.currentMatches)?.state\n .loaderData as {}) || {},\n ).reduce((obj: any, next) => {\n obj[next] = {}\n return obj\n }, {})}\n />\n ) : (\n <em style={{ opacity: 0.5 }}>{'{ }'}</em>\n )}\n </div> */}\n <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Search Params\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n {Object.keys(last(router.state.currentMatches)?.state.search || {})\n .length ? (\n <Explorer\n value={last(router.state.currentMatches)?.state.search || {}}\n defaultExpanded={Object.keys(\n (last(router.state.currentMatches)?.state.search as {}) || {},\n ).reduce((obj: any, next) => {\n obj[next] = {}\n return obj\n }, {})}\n />\n ) : (\n <em style={{ opacity: 0.5 }}>{'{ }'}</em>\n )}\n </div>\n </div>\n </Panel>\n </ThemeProvider>\n )\n})\n"],"names":["useSyncExternalStoreWithSelector","React","getItem","key","itemValue","localStorage","JSON","parse","undefined","useLocalStorage","defaultValue","value","setValue","useState","useEffect","initialValue","setter","useCallback","updater","old","newVal","setItem","stringify","defaultTheme","background","backgroundAlt","foreground","gray","grayAlt","inputBackgroundColor","inputTextColor","success","danger","active","warning","ThemeContext","createContext","ThemeProvider","theme","rest","useTheme","useContext","useMediaQuery","query","isMatch","setIsMatch","window","matchMedia","matches","matcher","onChange","addListener","removeListener","isServer","getStatusColor","match","state","status","styled","type","newStyles","queries","forwardRef","style","ref","mediaStyles","Object","entries","reduce","current","createElement","useIsMounted","mountedRef","useRef","isMounted","displayValue","name","getOwnPropertyNames","newValue","toString","useSafeState","initialState","setState","safeSetState","scheduleMicrotask","callback","Promise","resolve","then","catch","error","setTimeout","Panel","_props","fontSize","fontFamily","display","backgroundColor","color","flexDirection","ActivePanel","flex","overflow","height","borderTop","Button","props","appearance","fontWeight","border","borderRadius","padding","opacity","disabled","cursor","Code","Entry","lineHeight","outline","wordBreak","Label","LabelButton","ExpandButton","font","Value","SubEntries","marginLeft","paddingLeft","borderLeft","Info","Expander","expanded","transition","transform","chunkArray","array","size","i","result","length","push","slice","DefaultRenderer","handleEntry","label","subEntries","subEntryPages","toggleExpanded","pageSize","renderer","expandedPages","setExpandedPages","valueSnapshot","setValueSnapshot","refreshValueSnapshot","String","toLowerCase","map","entry","index","includes","filter","d","isIterable","x","Symbol","iterator","Explorer","defaultExpanded","setExpanded","Boolean","makeProperty","sub","subDefaultExpanded","Array","isArray","from","val","Logo","alignItems","letterSpacing","backgroundImage","WebkitBackgroundClip","marginRight","TanStackRouterDevtools","initialIsOpen","panelProps","closeButtonProps","toggleButtonProps","position","containerElement","Container","router","rootRef","panelRef","isOpen","setIsOpen","devtoolsHeight","setDevtoolsHeight","isResolvedOpen","setIsResolvedOpen","isResizing","setIsResizing","handleDragStart","panelElement","startEvent","button","dragInfo","originalHeight","getBoundingClientRect","pageY","run","moveEvent","delta","newHeight","unsub","document","removeEventListener","addEventListener","handlePanelTransitionStart","visibility","handlePanelTransitionEnd","previousValue","parentElement","paddingBottom","containerHeight","panelStyle","otherPanelProps","closeButtonStyle","onClick","onCloseClick","otherCloseButtonProps","toggleButtonStyle","onToggleClick","otherToggleButtonProps","bottom","right","zIndex","width","maxHeight","boxShadow","transformOrigin","pointerEvents","e","margin","left","top","TanStackRouterDevtoolsPanel","userRouter","routerContextValue","routerContext","invariant","useRouter","activeRouteId","setActiveRouteId","activeMatchId","setActiveMatchId","allMatches","useMemo","values","currentMatches","pendingMatches","activeMatch","find","id","route","__html","marginBottom","minHeight","borderRight","justifyContent","gap","overflowY","borderBottom","marginTop","updatedAt","Date","toLocaleTimeString","load","keys","last","search","obj","next"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACA,IAAI,MAAM,GAAG,kBAAkB,CAAC;EAChC,SAAS,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE;EACvC,IAAI,IAAI,SAAS,EAAE;EACnB,QAAQ,OAAO;EACf,KAAK;EAIL,IAAI,IAAI,QAAQ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,eAAA,CAGE,eACN5O,yBAAA,CAAA,aAAA,CAAA,KAAA,EAAA;EACE,IAAA,KAAK,EAAE;EACL8G,MAAAA,OAAO,EAAE,MAAA;EACX,KAAA;KAEC7C,EAAAA,MAAM,CAACqN,IAAI,CAACC,IAAI,CAACxF,MAAM,CAACxI,KAAK,CAAC4M,cAAc,CAAC,EAAE5M,KAAK,CAACiO,MAAM,IAAI,EAAE,CAAC,CAChE9I,MAAM,gBACP1I,yBAAA,CAAA,aAAA,CAAC,QAAQ,EAAA;EACP,IAAA,KAAK,EAAEuR,IAAI,CAACxF,MAAM,CAACxI,KAAK,CAAC4M,cAAc,CAAC,EAAE5M,KAAK,CAACiO,MAAM,IAAI,EAAG;EAC7D,IAAA,eAAe,EAAEvN,MAAM,CAACqN,IAAI,CACzBC,IAAI,CAACxF,MAAM,CAACxI,KAAK,CAAC4M,cAAc,CAAC,EAAE5M,KAAK,CAACiO,MAAM,IAAW,EAAE,CAC9D,CAACrN,MAAM,CAAC,CAACsN,GAAQ,EAAEC,IAAI,KAAK;EAC3BD,MAAAA,GAAG,CAACC,IAAI,CAAC,GAAG,EAAE,CAAA;EACd,MAAA,OAAOD,GAAG,CAAA;OACX,EAAE,EAAE,CAAA;EAAE,GAAA,CACP,gBAEFzR,yBAAA,CAAA,aAAA,CAAA,IAAA,EAAA;EAAI,IAAA,KAAK,EAAE;EAAE+G,MAAAA,OAAO,EAAE,GAAA;EAAI,KAAA;EAAE,GAAA,EAAE,KAAK,CACpC,CACG,CACF,CACA,CACM,CAAA;EAEpB,CAAC;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.development.js","sources":["../../../../node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../../../node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js","../../../router/build/esm/index.js","../../../react-store/build/esm/index.js","../../../react-router/build/esm/index.js","../../src/useLocalStorage.ts","../../src/theme.tsx","../../src/useMediaQuery.ts","../../src/utils.ts","../../src/styledComponents.ts","../../src/Explorer.tsx","../../src/devtools.tsx"],"sourcesContent":["var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;\n","/**\n * router\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport invariant from 'tiny-invariant';\nexport { default as invariant } from 'tiny-invariant';\nexport { default as warning } from 'tiny-warning';\nimport { Store } from '@tanstack/store';\n\n// While the public API was clearly inspired by the \"history\" npm package,\n// This implementation attempts to be more lightweight by\n// making assumptions about the way TanStack Router works\n\nconst popStateEvent = 'popstate';\nfunction createHistory(opts) {\n let currentLocation = opts.getLocation();\n let unsub = () => {};\n let listeners = new Set();\n const onUpdate = () => {\n currentLocation = opts.getLocation();\n listeners.forEach(listener => listener());\n };\n return {\n get location() {\n return currentLocation;\n },\n listen: cb => {\n if (listeners.size === 0) {\n unsub = opts.listener(onUpdate);\n }\n listeners.add(cb);\n return () => {\n listeners.delete(cb);\n if (listeners.size === 0) {\n unsub();\n }\n };\n },\n push: (path, state) => {\n opts.pushState(path, state);\n onUpdate();\n },\n replace: (path, state) => {\n opts.replaceState(path, state);\n onUpdate();\n },\n go: index => {\n opts.go(index);\n onUpdate();\n },\n back: () => {\n opts.back();\n onUpdate();\n },\n forward: () => {\n opts.forward();\n onUpdate();\n }\n };\n}\nfunction createBrowserHistory(opts) {\n const getHref = opts?.getHref ?? (() => `${window.location.pathname}${window.location.hash}${window.location.search}`);\n const createHref = opts?.createHref ?? (path => path);\n const getLocation = () => parseLocation(getHref(), history.state);\n return createHistory({\n getLocation,\n listener: onUpdate => {\n window.addEventListener(popStateEvent, onUpdate);\n return () => {\n window.removeEventListener(popStateEvent, onUpdate);\n };\n },\n pushState: (path, state) => {\n window.history.pushState({\n ...state,\n key: createRandomKey()\n }, '', createHref(path));\n },\n replaceState: (path, state) => {\n window.history.replaceState({\n ...state,\n key: createRandomKey()\n }, '', createHref(path));\n },\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n go: n => window.history.go(n)\n });\n}\nfunction createHashHistory() {\n return createBrowserHistory({\n getHref: () => window.location.hash.substring(1),\n createHref: path => `#${path}`\n });\n}\nfunction createMemoryHistory(opts = {\n initialEntries: ['/']\n}) {\n const entries = opts.initialEntries;\n let index = opts.initialIndex ?? entries.length - 1;\n let currentState = {};\n const getLocation = () => parseLocation(entries[index], currentState);\n return createHistory({\n getLocation,\n listener: () => {\n return () => {};\n },\n pushState: (path, state) => {\n currentState = {\n ...state,\n key: createRandomKey()\n };\n entries.push(path);\n index++;\n },\n replaceState: (path, state) => {\n currentState = {\n ...state,\n key: createRandomKey()\n };\n entries[index] = path;\n },\n back: () => {\n index--;\n },\n forward: () => {\n index = Math.min(index + 1, entries.length - 1);\n },\n go: n => window.history.go(n)\n });\n}\nfunction parseLocation(href, state) {\n let hashIndex = href.indexOf('#');\n let searchIndex = href.indexOf('?');\n return {\n href,\n pathname: href.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length),\n hash: hashIndex > -1 ? href.substring(hashIndex, searchIndex) : '',\n search: searchIndex > -1 ? href.substring(searchIndex) : '',\n state\n };\n}\n\n// Thanks co-pilot!\nfunction createRandomKey() {\n return (Math.random() + 1).toString(36).substring(7);\n}\n\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nfunction isFunction(d) {\n return typeof d === 'function';\n}\nfunction functionalUpdate(updater, previous) {\n if (isFunction(updater)) {\n return updater(previous);\n }\n return updater;\n}\nfunction pick(parent, keys) {\n return keys.reduce((obj, key) => {\n obj[key] = parent[key];\n return obj;\n }, {});\n}\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between immutable JSON values for example.\n * Do not use this with signals\n */\nfunction replaceEqualDeep(prev, _next) {\n if (prev === _next) {\n return prev;\n }\n const next = _next;\n const array = Array.isArray(prev) && Array.isArray(next);\n if (array || isPlainObject(prev) && isPlainObject(next)) {\n const prevSize = array ? prev.length : Object.keys(prev).length;\n const nextItems = array ? next : Object.keys(next);\n const nextSize = nextItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < nextSize; i++) {\n const key = array ? i : nextItems[i];\n copy[key] = replaceEqualDeep(prev[key], next[key]);\n if (copy[key] === prev[key]) {\n equalItems++;\n }\n }\n return prevSize === nextSize && equalItems === prevSize ? prev : copy;\n }\n return next;\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n\n // If has modified constructor\n const ctor = o.constructor;\n if (typeof ctor === 'undefined') {\n return true;\n }\n\n // If has modified prototype\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\nfunction partialDeepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n return !Object.keys(b).some(key => !partialDeepEqual(a[key], b[key]));\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, index) => partialDeepEqual(item, b[index]));\n }\n return false;\n}\n\nfunction joinPaths(paths) {\n return cleanPath(paths.filter(Boolean).join('/'));\n}\nfunction cleanPath(path) {\n // remove double slashes\n return path.replace(/\\/{2,}/g, '/');\n}\nfunction trimPathLeft(path) {\n return path === '/' ? path : path.replace(/^\\/{1,}/, '');\n}\nfunction trimPathRight(path) {\n return path === '/' ? path : path.replace(/\\/{1,}$/, '');\n}\nfunction trimPath(path) {\n return trimPathRight(trimPathLeft(path));\n}\nfunction resolvePath(basepath, base, to) {\n base = base.replace(new RegExp(`^${basepath}`), '/');\n to = to.replace(new RegExp(`^${basepath}`), '/');\n let baseSegments = parsePathname(base);\n const toSegments = parsePathname(to);\n toSegments.forEach((toSegment, index) => {\n if (toSegment.value === '/') {\n if (!index) {\n // Leading slash\n baseSegments = [toSegment];\n } else if (index === toSegments.length - 1) {\n // Trailing Slash\n baseSegments.push(toSegment);\n } else ;\n } else if (toSegment.value === '..') {\n // Extra trailing slash? pop it off\n if (baseSegments.length > 1 && last(baseSegments)?.value === '/') {\n baseSegments.pop();\n }\n baseSegments.pop();\n } else if (toSegment.value === '.') {\n return;\n } else {\n baseSegments.push(toSegment);\n }\n });\n const joined = joinPaths([basepath, ...baseSegments.map(d => d.value)]);\n return cleanPath(joined);\n}\nfunction parsePathname(pathname) {\n if (!pathname) {\n return [];\n }\n pathname = cleanPath(pathname);\n const segments = [];\n if (pathname.slice(0, 1) === '/') {\n pathname = pathname.substring(1);\n segments.push({\n type: 'pathname',\n value: '/'\n });\n }\n if (!pathname) {\n return segments;\n }\n\n // Remove empty segments and '.' segments\n const split = pathname.split('/').filter(Boolean);\n segments.push(...split.map(part => {\n if (part === '$' || part === '*') {\n return {\n type: 'wildcard',\n value: part\n };\n }\n if (part.charAt(0) === '$') {\n return {\n type: 'param',\n value: part\n };\n }\n return {\n type: 'pathname',\n value: part\n };\n }));\n if (pathname.slice(-1) === '/') {\n pathname = pathname.substring(1);\n segments.push({\n type: 'pathname',\n value: '/'\n });\n }\n return segments;\n}\nfunction interpolatePath(path, params, leaveWildcard) {\n const interpolatedPathSegments = parsePathname(path);\n return joinPaths(interpolatedPathSegments.map(segment => {\n if (['$', '*'].includes(segment.value) && !leaveWildcard) {\n return '';\n }\n if (segment.type === 'param') {\n return params[segment.value.substring(1)] ?? '';\n }\n return segment.value;\n }));\n}\nfunction matchPathname(basepath, currentPathname, matchLocation) {\n const pathParams = matchByPath(basepath, currentPathname, matchLocation);\n // const searchMatched = matchBySearch(currentLocation.search, matchLocation)\n\n if (matchLocation.to && !pathParams) {\n return;\n }\n return pathParams ?? {};\n}\nfunction matchByPath(basepath, from, matchLocation) {\n if (!from.startsWith(basepath)) {\n return undefined;\n }\n from = basepath != '/' ? from.substring(basepath.length) : from;\n const baseSegments = parsePathname(from);\n const to = `${matchLocation.to ?? '$'}`;\n const routeSegments = parsePathname(to);\n if (last(baseSegments)?.value === '/') {\n baseSegments.pop();\n }\n const params = {};\n let isMatch = (() => {\n for (let i = 0; i < Math.max(baseSegments.length, routeSegments.length); i++) {\n const baseSegment = baseSegments[i];\n const routeSegment = routeSegments[i];\n const isLastRouteSegment = i === routeSegments.length - 1;\n const isLastBaseSegment = i === baseSegments.length - 1;\n if (routeSegment) {\n if (routeSegment.type === 'wildcard') {\n if (baseSegment?.value) {\n params['*'] = joinPaths(baseSegments.slice(i).map(d => d.value));\n return true;\n }\n return false;\n }\n if (routeSegment.type === 'pathname') {\n if (routeSegment.value === '/' && !baseSegment?.value) {\n return true;\n }\n if (baseSegment) {\n if (matchLocation.caseSensitive) {\n if (routeSegment.value !== baseSegment.value) {\n return false;\n }\n } else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase()) {\n return false;\n }\n }\n }\n if (!baseSegment) {\n return false;\n }\n if (routeSegment.type === 'param') {\n if (baseSegment?.value === '/') {\n return false;\n }\n if (baseSegment.value.charAt(0) !== '$') {\n params[routeSegment.value.substring(1)] = baseSegment.value;\n }\n }\n }\n if (isLastRouteSegment && !isLastBaseSegment) {\n return !!matchLocation.fuzzy;\n }\n }\n return true;\n })();\n return isMatch ? params : undefined;\n}\n\n// @ts-nocheck\n\n// qss has been slightly modified and inlined here for our use cases (and compression's sake). We've included it as a hard dependency for MIT license attribution.\n\nfunction encode(obj, pfx) {\n var k,\n i,\n tmp,\n str = '';\n for (k in obj) {\n if ((tmp = obj[k]) !== void 0) {\n if (Array.isArray(tmp)) {\n for (i = 0; i < tmp.length; i++) {\n str && (str += '&');\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n }\n } else {\n str && (str += '&');\n str += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n }\n }\n }\n return (pfx || '') + str;\n}\nfunction toValue(mix) {\n if (!mix) return '';\n var str = decodeURIComponent(mix);\n if (str === 'false') return false;\n if (str === 'true') return true;\n if (str.charAt(0) === '0') return str;\n return +str * 0 === 0 ? +str : str;\n}\nfunction decode(str) {\n var tmp,\n k,\n out = {},\n arr = str.split('&');\n while (tmp = arr.shift()) {\n tmp = tmp.split('=');\n k = tmp.shift();\n if (out[k] !== void 0) {\n out[k] = [].concat(out[k], toValue(tmp.shift()));\n } else {\n out[k] = toValue(tmp.shift());\n }\n }\n return out;\n}\n\nconst rootRouteId = '__root__';\nclass Route {\n // Set up in this.init()\n\n // customId!: TCustomId\n\n // Optional\n\n constructor(options) {\n this.options = options || {};\n this.isRoot = !options?.getParentRoute;\n }\n init = opts => {\n this.originalIndex = opts.originalIndex;\n this.router = opts.router;\n const allOptions = this.options;\n const isRoot = !allOptions?.path && !allOptions?.id;\n const parent = this.options?.getParentRoute?.();\n if (isRoot) {\n this.path = rootRouteId;\n } else {\n invariant(parent, `Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);\n }\n let path = isRoot ? rootRouteId : allOptions.path;\n\n // If the path is anything other than an index path, trim it up\n if (path && path !== '/') {\n path = trimPath(path);\n }\n const customId = allOptions?.id || path;\n\n // Strip the parentId prefix from the first level of children\n let id = isRoot ? rootRouteId : joinPaths([parent.id === rootRouteId ? '' : parent.id, customId]);\n if (path === rootRouteId) {\n path = '/';\n }\n if (id !== rootRouteId) {\n id = joinPaths(['/', id]);\n }\n const fullPath = id === rootRouteId ? '/' : trimPathRight(joinPaths([parent.fullPath, path]));\n this.path = path;\n this.id = id;\n // this.customId = customId as TCustomId\n this.fullPath = fullPath;\n };\n addChildren = children => {\n this.children = children;\n return this;\n };\n generate = options => {\n invariant(false, `route.generate() is used by TanStack Router's file-based routing code generation and should not actually be called during runtime. `);\n };\n}\nclass RootRoute extends Route {\n constructor(options) {\n super(options);\n }\n static withRouterContext = () => {\n return options => new RootRoute(options);\n };\n}\n\n// const rootRoute = new RootRoute({\n// validateSearch: () => null as unknown as { root?: boolean },\n// })\n\n// const aRoute = new Route({\n// getParentRoute: () => rootRoute,\n// path: 'a',\n// validateSearch: () => null as unknown as { a?: string },\n// })\n\n// const bRoute = new Route({\n// getParentRoute: () => aRoute,\n// path: 'b',\n// })\n\n// const rootIsRoot = rootRoute.isRoot\n// // ^?\n// const aIsRoot = aRoute.isRoot\n// // ^?\n\n// const rId = rootRoute.id\n// // ^?\n// const aId = aRoute.id\n// // ^?\n// const bId = bRoute.id\n// // ^?\n\n// const rPath = rootRoute.fullPath\n// // ^?\n// const aPath = aRoute.fullPath\n// // ^?\n// const bPath = bRoute.fullPath\n// // ^?\n\n// const rSearch = rootRoute.__types.fullSearchSchema\n// // ^?\n// const aSearch = aRoute.__types.fullSearchSchema\n// // ^?\n// const bSearch = bRoute.__types.fullSearchSchema\n// // ^?\n\n// const config = rootRoute.addChildren([aRoute.addChildren([bRoute])])\n// // ^?\n\nconst defaultParseSearch = parseSearchWith(JSON.parse);\nconst defaultStringifySearch = stringifySearchWith(JSON.stringify);\nfunction parseSearchWith(parser) {\n return searchStr => {\n if (searchStr.substring(0, 1) === '?') {\n searchStr = searchStr.substring(1);\n }\n let query = decode(searchStr);\n\n // Try to parse any query params that might be json\n for (let key in query) {\n const value = query[key];\n if (typeof value === 'string') {\n try {\n query[key] = parser(value);\n } catch (err) {\n //\n }\n }\n }\n return query;\n };\n}\nfunction stringifySearchWith(stringify) {\n return search => {\n search = {\n ...search\n };\n if (search) {\n Object.keys(search).forEach(key => {\n const val = search[key];\n if (typeof val === 'undefined' || val === undefined) {\n delete search[key];\n } else if (val && typeof val === 'object' && val !== null) {\n try {\n search[key] = stringify(val);\n } catch (err) {\n // silent\n }\n }\n });\n }\n const searchStr = encode(search).toString();\n return searchStr ? `?${searchStr}` : '';\n };\n}\n\nconst defaultFetchServerDataFn = async ({\n router,\n routeMatch\n}) => {\n const next = router.buildNext({\n to: '.',\n search: d => ({\n ...(d ?? {}),\n __data: {\n matchId: routeMatch.id\n }\n })\n });\n const res = await fetch(next.href, {\n method: 'GET',\n signal: routeMatch.abortController.signal\n });\n if (res.ok) {\n return res.json();\n }\n throw new Error('Failed to fetch match data');\n};\nclass Router {\n #unsubHistory;\n startedLoadingAt = Date.now();\n resolveNavigation = () => {};\n constructor(options) {\n this.options = {\n defaultPreloadDelay: 50,\n context: undefined,\n ...options,\n stringifySearch: options?.stringifySearch ?? defaultStringifySearch,\n parseSearch: options?.parseSearch ?? defaultParseSearch,\n fetchServerDataFn: options?.fetchServerDataFn ?? defaultFetchServerDataFn\n };\n this.store = new Store(getInitialRouterState(), {\n onUpdate: state => {\n this.state = state;\n }\n });\n this.state = this.store.state;\n this.basepath = '';\n this.update(options);\n\n // Allow frameworks to hook into the router creation\n this.options.Router?.(this);\n }\n reset = () => {\n this.store.setState(s => Object.assign(s, getInitialRouterState()));\n };\n mount = () => {\n // Mount only does anything on the client\n if (!isServer) {\n // If the router matches are empty, start loading the matches\n if (!this.state.currentMatches.length) {\n this.safeLoad();\n }\n }\n return () => {};\n };\n update = opts => {\n Object.assign(this.options, opts);\n if (!this.history || this.options.history && this.options.history !== this.history) {\n if (this.#unsubHistory) {\n this.#unsubHistory();\n }\n this.history = this.options.history ?? (isServer ? createMemoryHistory() : createBrowserHistory());\n const parsedLocation = this.#parseLocation();\n this.store.setState(s => ({\n ...s,\n latestLocation: parsedLocation,\n currentLocation: parsedLocation\n }));\n this.#unsubHistory = this.history.listen(() => {\n this.safeLoad({\n next: this.#parseLocation(this.state.latestLocation)\n });\n });\n }\n const {\n basepath,\n routeTree\n } = this.options;\n this.basepath = `/${trimPath(basepath ?? '') ?? ''}`;\n if (routeTree) {\n this.routesById = {};\n this.routeTree = this.#buildRouteTree(routeTree);\n }\n return this;\n };\n buildNext = opts => {\n const next = this.#buildLocation(opts);\n const matches = this.matchRoutes(next.pathname);\n const __preSearchFilters = matches.map(match => match.route.options.preSearchFilters ?? []).flat().filter(Boolean);\n const __postSearchFilters = matches.map(match => match.route.options.postSearchFilters ?? []).flat().filter(Boolean);\n return this.#buildLocation({\n ...opts,\n __preSearchFilters,\n __postSearchFilters\n });\n };\n cancelMatches = () => {\n [...this.state.currentMatches, ...(this.state.pendingMatches || [])].forEach(match => {\n match.cancel();\n });\n };\n safeLoad = opts => {\n this.load(opts).catch(err => {\n console.warn(err);\n invariant(false, 'Encountered an error during router.load()! ☝️.');\n });\n };\n load = async opts => {\n let now = Date.now();\n const startedAt = now;\n this.startedLoadingAt = startedAt;\n\n // Cancel any pending matches\n this.cancelMatches();\n let matches;\n this.store.batch(() => {\n if (opts?.next) {\n // Ingest the new location\n this.store.setState(s => ({\n ...s,\n latestLocation: opts.next\n }));\n }\n\n // Match the routes\n matches = this.matchRoutes(this.state.latestLocation.pathname, {\n strictParseParams: true\n });\n this.store.setState(s => ({\n ...s,\n status: 'pending',\n pendingMatches: matches,\n pendingLocation: this.state.latestLocation\n }));\n });\n\n // Load the matches\n await this.loadMatches(matches, this.state.pendingLocation\n // opts\n );\n\n if (this.startedLoadingAt !== startedAt) {\n // Ignore side-effects of outdated side-effects\n return this.navigationPromise;\n }\n const previousMatches = this.state.currentMatches;\n const exiting = [],\n staying = [];\n previousMatches.forEach(d => {\n if (matches.find(dd => dd.id === d.id)) {\n staying.push(d);\n } else {\n exiting.push(d);\n }\n });\n const entering = matches.filter(d => {\n return !previousMatches.find(dd => dd.id === d.id);\n });\n now = Date.now();\n exiting.forEach(d => {\n d.__onExit?.({\n params: d.params,\n search: d.state.routeSearch\n });\n\n // Clear non-loading error states when match leaves\n if (d.state.status === 'error') {\n this.store.setState(s => ({\n ...s,\n status: 'idle',\n error: undefined\n }));\n }\n });\n staying.forEach(d => {\n d.route.options.onTransition?.({\n params: d.params,\n search: d.state.routeSearch\n });\n });\n entering.forEach(d => {\n d.__onExit = d.route.options.onLoaded?.({\n params: d.params,\n search: d.state.search\n });\n });\n const prevLocation = this.state.currentLocation;\n this.store.setState(s => ({\n ...s,\n status: 'idle',\n currentLocation: this.state.latestLocation,\n currentMatches: matches,\n pendingLocation: undefined,\n pendingMatches: undefined\n }));\n matches.forEach(match => {\n match.__commit();\n });\n if (prevLocation.href !== this.state.currentLocation.href) {\n this.options.onRouteChange?.();\n }\n this.resolveNavigation();\n };\n getRoute = id => {\n const route = this.routesById[id];\n invariant(route, `Route with id \"${id}\" not found`);\n return route;\n };\n loadRoute = async (navigateOpts = this.state.latestLocation) => {\n const next = this.buildNext(navigateOpts);\n const matches = this.matchRoutes(next.pathname, {\n strictParseParams: true\n });\n await this.loadMatches(matches, next);\n return matches;\n };\n preloadRoute = async (navigateOpts = this.state.latestLocation) => {\n const next = this.buildNext(navigateOpts);\n const matches = this.matchRoutes(next.pathname, {\n strictParseParams: true\n });\n await this.loadMatches(matches, next, {\n preload: true\n });\n return matches;\n };\n matchRoutes = (pathname, opts) => {\n const matches = [];\n if (!this.routeTree) {\n return matches;\n }\n const existingMatches = [...this.state.currentMatches, ...(this.state.pendingMatches ?? [])];\n const findInRouteTree = async routes => {\n const parentMatch = last(matches);\n let params = parentMatch?.params ?? {};\n const filteredRoutes = this.options.filterRoutes?.(routes) ?? routes;\n let matchingRoutes = [];\n const findMatchInRoutes = (parentRoutes, routes) => {\n routes.some(route => {\n const children = route.children;\n if (!route.path && children?.length) {\n return findMatchInRoutes([...matchingRoutes, route], children);\n }\n const fuzzy = !!(route.path !== '/' || children?.length);\n const matchParams = matchPathname(this.basepath, pathname, {\n to: route.fullPath,\n fuzzy,\n caseSensitive: route.options.caseSensitive ?? this.options.caseSensitive\n });\n if (matchParams) {\n let parsedParams;\n try {\n parsedParams = route.options.parseParams?.(matchParams) ?? matchParams;\n } catch (err) {\n if (opts?.strictParseParams) {\n throw err;\n }\n }\n params = {\n ...params,\n ...parsedParams\n };\n }\n if (!!matchParams) {\n matchingRoutes = [...parentRoutes, route];\n }\n return !!matchingRoutes.length;\n });\n return !!matchingRoutes.length;\n };\n findMatchInRoutes([], filteredRoutes);\n if (!matchingRoutes.length) {\n return;\n }\n matchingRoutes.forEach(foundRoute => {\n const interpolatedPath = interpolatePath(foundRoute.path, params);\n const matchId = interpolatePath(foundRoute.id, params, true);\n const match = existingMatches.find(d => d.id === matchId) || new RouteMatch(this, foundRoute, {\n id: matchId,\n params,\n pathname: joinPaths([this.basepath, interpolatedPath])\n });\n matches.push(match);\n });\n const foundRoute = last(matchingRoutes);\n const foundChildren = foundRoute.children;\n if (foundChildren?.length) {\n findInRouteTree(foundChildren);\n }\n };\n findInRouteTree([this.routeTree]);\n return matches;\n };\n loadMatches = async (resolvedMatches, location, opts) => {\n // Check each match middleware to see if the route can be accessed\n await Promise.all(resolvedMatches.map(async match => {\n try {\n await match.route.options.beforeLoad?.({\n router: this,\n match\n });\n } catch (err) {\n if (!opts?.preload) {\n match.route.options.onBeforeLoadError?.(err);\n }\n match.route.options.onError?.(err);\n throw err;\n }\n }));\n const matchPromises = resolvedMatches.map(async (match, index) => {\n const parentMatch = resolvedMatches[index - 1];\n match.__load({\n preload: opts?.preload,\n location,\n parentMatch\n });\n await match.__loadPromise;\n if (parentMatch) {\n await parentMatch.__loadPromise;\n }\n });\n await Promise.all(matchPromises);\n };\n reload = () => {\n this.navigate({\n fromCurrent: true,\n replace: true,\n search: true\n });\n };\n resolvePath = (from, path) => {\n return resolvePath(this.basepath, from, cleanPath(path));\n };\n navigate = async ({\n from,\n to = '',\n search,\n hash,\n replace,\n params\n }) => {\n // If this link simply reloads the current route,\n // make sure it has a new key so it will trigger a data refresh\n\n // If this `to` is a valid external URL, return\n // null for LinkUtils\n const toString = String(to);\n const fromString = typeof from === 'undefined' ? from : String(from);\n let isExternal;\n try {\n new URL(`${toString}`);\n isExternal = true;\n } catch (e) {}\n invariant(!isExternal, 'Attempting to navigate to external url with this.navigate!');\n return this.#commitLocation({\n from: fromString,\n to: toString,\n search,\n hash,\n replace,\n params\n });\n };\n matchRoute = (location, opts) => {\n location = {\n ...location,\n to: location.to ? this.resolvePath(location.from ?? '', location.to) : undefined\n };\n const next = this.buildNext(location);\n const baseLocation = opts?.pending ? this.state.pendingLocation : this.state.currentLocation;\n if (!baseLocation) {\n return false;\n }\n const match = matchPathname(this.basepath, baseLocation.pathname, {\n ...opts,\n to: next.pathname\n });\n if (!match) {\n return false;\n }\n if (opts?.includeSearch ?? true) {\n return partialDeepEqual(baseLocation.search, next.search) ? match : false;\n }\n return match;\n };\n buildLink = ({\n from,\n to = '.',\n search,\n params,\n hash,\n target,\n replace,\n activeOptions,\n preload,\n preloadDelay: userPreloadDelay,\n disabled\n }) => {\n // If this link simply reloads the current route,\n // make sure it has a new key so it will trigger a data refresh\n\n // If this `to` is a valid external URL, return\n // null for LinkUtils\n\n try {\n new URL(`${to}`);\n return {\n type: 'external',\n href: to\n };\n } catch (e) {}\n const nextOpts = {\n from,\n to,\n search,\n params,\n hash,\n replace\n };\n const next = this.buildNext(nextOpts);\n preload = preload ?? this.options.defaultPreload;\n const preloadDelay = userPreloadDelay ?? this.options.defaultPreloadDelay ?? 0;\n\n // Compare path/hash for matches\n const currentPathSplit = this.state.currentLocation.pathname.split('/');\n const nextPathSplit = next.pathname.split('/');\n const pathIsFuzzyEqual = nextPathSplit.every((d, i) => d === currentPathSplit[i]);\n // Combine the matches based on user options\n const pathTest = activeOptions?.exact ? this.state.currentLocation.pathname === next.pathname : pathIsFuzzyEqual;\n const hashTest = activeOptions?.includeHash ? this.state.currentLocation.hash === next.hash : true;\n const searchTest = activeOptions?.includeSearch ?? true ? partialDeepEqual(this.state.currentLocation.search, next.search) : true;\n\n // The final \"active\" test\n const isActive = pathTest && hashTest && searchTest;\n\n // The click handler\n const handleClick = e => {\n if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!target || target === '_self') && e.button === 0) {\n e.preventDefault();\n\n // All is well? Navigate!\n this.#commitLocation(nextOpts);\n }\n };\n\n // The click handler\n const handleFocus = e => {\n if (preload) {\n this.preloadRoute(nextOpts).catch(err => {\n console.warn(err);\n console.warn('Error preloading route! ☝️');\n });\n }\n };\n const handleTouchStart = e => {\n this.preloadRoute(nextOpts).catch(err => {\n console.warn(err);\n console.warn('Error preloading route! ☝️');\n });\n };\n const handleEnter = e => {\n const target = e.target || {};\n if (preload) {\n if (target.preloadTimeout) {\n return;\n }\n target.preloadTimeout = setTimeout(() => {\n target.preloadTimeout = null;\n this.preloadRoute(nextOpts).catch(err => {\n console.warn(err);\n console.warn('Error preloading route! ☝️');\n });\n }, preloadDelay);\n }\n };\n const handleLeave = e => {\n const target = e.target || {};\n if (target.preloadTimeout) {\n clearTimeout(target.preloadTimeout);\n target.preloadTimeout = null;\n }\n };\n return {\n type: 'internal',\n next,\n handleFocus,\n handleClick,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n disabled\n };\n };\n dehydrate = () => {\n return {\n state: {\n ...pick(this.state, ['latestLocation', 'currentLocation', 'status', 'lastUpdated']),\n currentMatches: this.state.currentMatches.map(match => ({\n id: match.id,\n state: {\n status: match.state.status\n }\n }))\n }\n };\n };\n hydrate = dehydratedRouter => {\n this.store.setState(s => {\n // Match the routes\n const currentMatches = this.matchRoutes(dehydratedRouter.state.latestLocation.pathname, {\n strictParseParams: true\n });\n currentMatches.forEach((match, index) => {\n const dehydratedMatch = dehydratedRouter.state.currentMatches[index];\n invariant(dehydratedMatch && dehydratedMatch.id === match.id, 'Oh no! There was a hydration mismatch when attempting to hydrate the state of the router! 😬');\n match.store.setState(s => ({\n ...s,\n ...dehydratedMatch.state\n }));\n });\n return {\n ...s,\n ...dehydratedRouter.state,\n currentMatches\n };\n });\n };\n #buildRouteTree = routeTree => {\n const recurseRoutes = routes => {\n routes.forEach((route, i) => {\n route.init({\n originalIndex: i,\n router: this\n });\n const existingRoute = this.routesById[route.id];\n if (existingRoute) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Duplicate routes found with id: ${String(route.id)}`, this.routesById, route);\n }\n throw new Error();\n }\n this.routesById[route.id] = route;\n const children = route.children;\n if (children?.length) {\n recurseRoutes(children);\n route.children = children.map((d, i) => {\n const parsed = parsePathname(trimPathLeft(cleanPath(d.path ?? '/')));\n while (parsed.length > 1 && parsed[0]?.value === '/') {\n parsed.shift();\n }\n let score = 0;\n parsed.forEach((d, i) => {\n let modifier = 1;\n while (i--) {\n modifier *= 0.001;\n }\n if (d.type === 'pathname' && d.value !== '/') {\n score += 1 * modifier;\n } else if (d.type === 'param') {\n score += 2 * modifier;\n } else if (d.type === 'wildcard') {\n score += 3 * modifier;\n }\n });\n return {\n child: d,\n parsed,\n index: i,\n score\n };\n }).sort((a, b) => {\n if (a.score !== b.score) {\n return a.score - b.score;\n }\n return a.index - b.index;\n }).map(d => d.child);\n }\n });\n };\n recurseRoutes([routeTree]);\n return routeTree;\n };\n #parseLocation = previousLocation => {\n let {\n pathname,\n search,\n hash,\n state\n } = this.history.location;\n const parsedSearch = this.options.parseSearch(search);\n return {\n pathname: pathname,\n searchStr: search,\n search: replaceEqualDeep(previousLocation?.search, parsedSearch),\n hash: hash.split('#').reverse()[0] ?? '',\n href: `${pathname}${search}${hash}`,\n state: state,\n key: state?.key || '__init__'\n };\n };\n #buildLocation = (dest = {}) => {\n dest.fromCurrent = dest.fromCurrent ?? dest.to === '';\n const fromPathname = dest.fromCurrent ? this.state.latestLocation.pathname : dest.from ?? this.state.latestLocation.pathname;\n let pathname = resolvePath(this.basepath ?? '/', fromPathname, `${dest.to ?? ''}`);\n const fromMatches = this.matchRoutes(this.state.latestLocation.pathname, {\n strictParseParams: true\n });\n const toMatches = this.matchRoutes(pathname);\n const prevParams = {\n ...last(fromMatches)?.params\n };\n let nextParams = (dest.params ?? true) === true ? prevParams : functionalUpdate(dest.params, prevParams);\n if (nextParams) {\n toMatches.map(d => d.route.options.stringifyParams).filter(Boolean).forEach(fn => {\n Object.assign({}, nextParams, fn(nextParams));\n });\n }\n pathname = interpolatePath(pathname, nextParams ?? {});\n\n // Pre filters first\n const preFilteredSearch = dest.__preSearchFilters?.length ? dest.__preSearchFilters?.reduce((prev, next) => next(prev), this.state.latestLocation.search) : this.state.latestLocation.search;\n\n // Then the link/navigate function\n const destSearch = dest.search === true ? preFilteredSearch // Preserve resolvedFrom true\n : dest.search ? functionalUpdate(dest.search, preFilteredSearch) ?? {} // Updater\n : dest.__preSearchFilters?.length ? preFilteredSearch // Preserve resolvedFrom filters\n : {};\n\n // Then post filters\n const postFilteredSearch = dest.__postSearchFilters?.length ? dest.__postSearchFilters.reduce((prev, next) => next(prev), destSearch) : destSearch;\n const search = replaceEqualDeep(this.state.latestLocation.search, postFilteredSearch);\n const searchStr = this.options.stringifySearch(search);\n let hash = dest.hash === true ? this.state.latestLocation.hash : functionalUpdate(dest.hash, this.state.latestLocation.hash);\n hash = hash ? `#${hash}` : '';\n return {\n pathname,\n search,\n searchStr,\n state: this.state.latestLocation.state,\n hash,\n href: `${pathname}${searchStr}${hash}`,\n key: dest.key\n };\n };\n #commitLocation = async location => {\n const next = this.buildNext(location);\n const id = '' + Date.now() + Math.random();\n if (this.navigateTimeout) clearTimeout(this.navigateTimeout);\n let nextAction = 'replace';\n if (!location.replace) {\n nextAction = 'push';\n }\n const isSameUrl = this.state.latestLocation.href === next.href;\n if (isSameUrl && !next.key) {\n nextAction = 'replace';\n }\n const href = `${next.pathname}${next.searchStr}${next.hash ? `#${next.hash}` : ''}`;\n this.history[nextAction === 'push' ? 'push' : 'replace'](href, {\n id,\n ...next.state\n });\n return this.navigationPromise = new Promise(resolve => {\n const previousNavigationResolve = this.resolveNavigation;\n this.resolveNavigation = () => {\n previousNavigationResolve();\n resolve();\n };\n });\n };\n}\n\n// Detect if we're in the DOM\nconst isServer = typeof window === 'undefined' || !window.document.createElement;\nfunction getInitialRouterState() {\n return {\n status: 'idle',\n latestLocation: null,\n currentLocation: null,\n currentMatches: [],\n lastUpdated: Date.now()\n };\n}\nfunction isCtrlEvent(e) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);\n}\nfunction redirect(opts) {\n opts.isRedirect = true;\n return opts;\n}\nfunction isRedirect(obj) {\n return !!obj?.isRedirect;\n}\n\nconst componentTypes = ['component', 'errorComponent', 'pendingComponent'];\nclass RouteMatch {\n abortController = new AbortController();\n onLoaderDataListeners = new Set();\n constructor(router, route, opts) {\n Object.assign(this, {\n route,\n router,\n id: opts.id,\n pathname: opts.pathname,\n params: opts.params,\n store: new Store({\n updatedAt: 0,\n routeSearch: {},\n search: {},\n status: 'idle'\n }, {\n onUpdate: next => {\n this.state = next;\n }\n })\n });\n this.state = this.store.state;\n componentTypes.map(async type => {\n const component = this.route.options[type];\n if (typeof this[type] !== 'function') {\n this[type] = component;\n }\n });\n if (this.state.status === 'idle' && !this.#hasLoaders()) {\n this.store.setState(s => ({\n ...s,\n status: 'success'\n }));\n }\n }\n #hasLoaders = () => {\n return !!(this.route.options.onLoad || componentTypes.some(d => this.route.options[d]?.preload));\n };\n __commit = () => {\n const {\n routeSearch,\n search,\n context,\n routeContext\n } = this.#resolveInfo({\n location: this.router.state.currentLocation\n });\n this.context = context;\n this.routeContext = routeContext;\n this.store.setState(s => ({\n ...s,\n routeSearch: replaceEqualDeep(s.routeSearch, routeSearch),\n search: replaceEqualDeep(s.search, search)\n }));\n };\n cancel = () => {\n this.abortController?.abort();\n };\n #resolveSearchInfo = opts => {\n // Validate the search params and stabilize them\n const parentSearchInfo = this.parentMatch ? this.parentMatch.#resolveSearchInfo(opts) : {\n search: opts.location.search,\n routeSearch: opts.location.search\n };\n try {\n const validator = typeof this.route.options.validateSearch === 'object' ? this.route.options.validateSearch.parse : this.route.options.validateSearch;\n const routeSearch = validator?.(parentSearchInfo.search) ?? {};\n const search = {\n ...parentSearchInfo.search,\n ...routeSearch\n };\n return {\n routeSearch,\n search\n };\n } catch (err) {\n if (isRedirect(err)) {\n throw err;\n }\n this.route.options.onValidateSearchError?.(err);\n const error = new Error('Invalid search params found', {\n cause: err\n });\n error.code = 'INVALID_SEARCH_PARAMS';\n throw error;\n }\n };\n #resolveInfo = opts => {\n const {\n search,\n routeSearch\n } = this.#resolveSearchInfo(opts);\n const routeContext = this.route.options.getContext?.({\n parentContext: this.parentMatch?.routeContext ?? {},\n context: this.parentMatch?.context ?? this.router?.options.context ?? {},\n params: this.params,\n search\n }) || {};\n const context = {\n ...(this.parentMatch?.context ?? this.router?.options.context),\n ...routeContext\n };\n return {\n routeSearch,\n search,\n context,\n routeContext\n };\n };\n __load = async opts => {\n this.parentMatch = opts.parentMatch;\n let info;\n try {\n info = this.#resolveInfo(opts);\n } catch (err) {\n if (isRedirect(err)) {\n this.router.navigate(err);\n return;\n }\n this.route.options.onError?.(err);\n this.store.setState(s => ({\n ...s,\n status: 'error',\n error: err\n }));\n\n // Do not proceed with loading the route\n return;\n }\n const {\n routeSearch,\n search,\n context,\n routeContext\n } = info;\n\n // If the match is invalid, errored or idle, trigger it to load\n if (this.state.status === 'pending') {\n return;\n }\n\n // TODO: Should load promises be tracked based on location?\n this.__loadPromise = Promise.resolve().then(async () => {\n const loadId = '' + Date.now() + Math.random();\n this.#latestId = loadId;\n const checkLatest = () => {\n return loadId !== this.#latestId ? this.__loadPromise : undefined;\n };\n let latestPromise;\n\n // If the match was in an error state, set it\n // to a loading state again. Otherwise, keep it\n // as loading or resolved\n if (this.state.status === 'idle') {\n this.store.setState(s => ({\n ...s,\n status: 'pending'\n }));\n }\n const componentsPromise = (async () => {\n // then run all component and data loaders in parallel\n // For each component type, potentially load it asynchronously\n\n await Promise.all(componentTypes.map(async type => {\n const component = this.route.options[type];\n if (this[type]?.preload) {\n this[type] = await this.router.options.loadComponent(component);\n }\n }));\n })();\n const dataPromise = Promise.resolve().then(() => {\n if (this.route.options.onLoad) {\n return this.route.options.onLoad({\n params: this.params,\n routeSearch,\n search,\n signal: this.abortController.signal,\n preload: !!opts?.preload,\n routeContext: routeContext,\n context: context\n });\n }\n return;\n });\n try {\n await Promise.all([componentsPromise, dataPromise]);\n if (latestPromise = checkLatest()) return await latestPromise;\n this.store.setState(s => ({\n ...s,\n error: undefined,\n status: 'success',\n updatedAt: Date.now()\n }));\n } catch (err) {\n if (isRedirect(err)) {\n this.router.navigate(err);\n return;\n }\n this.route.options.onLoadError?.(err);\n this.route.options.onError?.(err);\n this.store.setState(s => ({\n ...s,\n error: err,\n status: 'error',\n updatedAt: Date.now()\n }));\n } finally {\n delete this.__loadPromise;\n }\n });\n return this.__loadPromise;\n };\n #latestId = '';\n}\n\nexport { RootRoute, Route, RouteMatch, Router, cleanPath, createBrowserHistory, createHashHistory, createMemoryHistory, decode, defaultFetchServerDataFn, defaultParseSearch, defaultStringifySearch, encode, functionalUpdate, interpolatePath, isPlainObject, isRedirect, joinPaths, last, matchByPath, matchPathname, parsePathname, parseSearchWith, partialDeepEqual, pick, redirect, replaceEqualDeep, resolvePath, rootRouteId, stringifySearchWith, trimPath, trimPathLeft, trimPathRight };\n//# sourceMappingURL=index.js.map\n","/**\n * react-store\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\n\nfunction useStore(store, selector = d => d, compareShallow) {\n const slice = useSyncExternalStoreWithSelector(store.subscribe, () => store.state, () => store.state, selector, compareShallow ? shallow : undefined);\n return slice;\n}\nfunction shallow(objA, objB) {\n if (Object.is(objA, objB)) {\n return true;\n }\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n // if (objA instanceof Map && objB instanceof Map) {\n // if (objA.size !== objB.size) return false\n\n // for (const [key, value] of objA) {\n // if (!Object.is(value, objB.get(key))) {\n // return false\n // }\n // }\n // return true\n // }\n\n // if (objA instanceof Set && objB instanceof Set) {\n // if (objA.size !== objB.size) return false\n\n // for (const value of objA) {\n // if (!objB.has(value)) {\n // return false\n // }\n // }\n // return true\n // }\n\n const keysA = Object.keys(objA);\n if (keysA.length !== Object.keys(objB).length) {\n return false;\n }\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\nexport { useStore };\n//# sourceMappingURL=index.js.map\n","/**\n * react-router\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { functionalUpdate, Router, warning, invariant, last } from '@tanstack/router';\nexport * from '@tanstack/router';\nimport { useStore } from '@tanstack/react-store';\nexport { useStore } from '@tanstack/react-store';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n//\n\nfunction lazy(importer) {\n const lazyComp = /*#__PURE__*/React.lazy(importer);\n const finalComp = lazyComp;\n finalComp.preload = async () => {\n {\n await importer();\n }\n };\n return finalComp;\n}\n//\n\nfunction useLinkProps(options) {\n const router = useRouterContext();\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({\n className: 'active'\n }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to = '.',\n preload,\n preloadDelay,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n ...rest\n } = options;\n const linkInfo = router.buildLink(options);\n if (linkInfo.type === 'external') {\n const {\n href\n } = linkInfo;\n return {\n href\n };\n }\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n handleTouchStart,\n isActive,\n next\n } = linkInfo;\n const reactHandleClick = e => {\n if (React.startTransition) {\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e);\n });\n } else {\n handleClick(e);\n }\n };\n const composeHandlers = handlers => e => {\n if (e.persist) e.persist();\n handlers.filter(Boolean).forEach(handler => {\n if (e.defaultPrevented) return;\n handler(e);\n });\n };\n\n // Get the active props\n const resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? {} : {};\n\n // Get the inactive props\n const resolvedInactiveProps = isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {};\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([onClick, reactHandleClick]),\n onFocus: composeHandlers([onFocus, handleFocus]),\n onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),\n onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),\n onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style\n },\n className: [className, resolvedActiveProps.className, resolvedInactiveProps.className].filter(Boolean).join(' ') || undefined,\n ...(disabled ? {\n role: 'link',\n 'aria-disabled': true\n } : undefined),\n ['data-status']: isActive ? 'active' : undefined\n };\n}\nconst Link = /*#__PURE__*/React.forwardRef((props, ref) => {\n const linkProps = useLinkProps(props);\n return /*#__PURE__*/React.createElement(\"a\", _extends({\n ref: ref\n }, linkProps, {\n children: typeof props.children === 'function' ? props.children({\n isActive: linkProps['data-status'] === 'active'\n }) : props.children\n }));\n});\nfunction Navigate(props) {\n const router = useRouterContext();\n React.useLayoutEffect(() => {\n router.navigate(props);\n }, []);\n return null;\n}\nconst matchesContext = /*#__PURE__*/React.createContext(null);\nconst routerContext = /*#__PURE__*/React.createContext(null);\nclass ReactRouter extends Router {\n constructor(opts) {\n super({\n ...opts,\n loadComponent: async component => {\n if (component.preload) {\n await component.preload();\n }\n return component;\n }\n });\n }\n}\nfunction RouterProvider({\n router,\n ...rest\n}) {\n router.update(rest);\n const currentMatches = useStore(router.store, s => s.currentMatches);\n React.useEffect(router.mount, [router]);\n return /*#__PURE__*/React.createElement(routerContext.Provider, {\n value: {\n router: router\n }\n }, /*#__PURE__*/React.createElement(matchesContext.Provider, {\n value: [undefined, ...currentMatches]\n }, /*#__PURE__*/React.createElement(CatchBoundary, {\n errorComponent: ErrorComponent,\n onCatch: () => {\n warning(false, `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`);\n }\n }, /*#__PURE__*/React.createElement(Outlet, null))));\n}\nfunction useRouterContext() {\n const value = React.useContext(routerContext);\n warning(value, 'useRouter must be used inside a <Router> component!');\n useStore(value.router.store);\n return value.router;\n}\nfunction useRouter(track, shallow) {\n const router = useRouterContext();\n useStore(router.store, track, shallow);\n return router;\n}\nfunction useMatches() {\n return React.useContext(matchesContext);\n}\nfunction useMatch(opts) {\n const router = useRouterContext();\n const nearestMatch = useMatches()[0];\n const match = opts?.from ? router.state.currentMatches.find(d => d.route.id === opts?.from) : nearestMatch;\n invariant(match, `Could not find ${opts?.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`);\n if (opts?.strict ?? true) {\n invariant(nearestMatch.route.id == match?.route.id, `useMatch(\"${match?.route.id}\") is being called in a component that is meant to render the '${nearestMatch.route.id}' route. Did you mean to 'useMatch(\"${match?.route.id}\", { strict: false })' or 'useRoute(\"${match?.route.id}\")' instead?`);\n }\n useStore(match.store, d => opts?.track?.(match) ?? match, opts?.shallow);\n return match;\n}\nfunction useRoute(routeId) {\n const router = useRouterContext();\n const resolvedRoute = router.getRoute(routeId);\n invariant(resolvedRoute, `Could not find a route for route \"${routeId}\"! Did you forget to add it to your route?`);\n return resolvedRoute;\n}\nfunction useSearch(opts) {\n const match = useMatch(opts);\n useStore(match.store, d => opts?.track?.(d.search) ?? d.search, true);\n return match.state.search;\n}\nfunction useParams(opts) {\n const router = useRouterContext();\n useStore(router.store, d => {\n const params = last(d.currentMatches)?.params;\n return opts?.track?.(params) ?? params;\n }, true);\n return last(router.state.currentMatches)?.params;\n}\nfunction useNavigate(defaultOpts) {\n const router = useRouterContext();\n return React.useCallback(opts => {\n return router.navigate({\n ...defaultOpts,\n ...opts\n });\n }, []);\n}\nfunction useMatchRoute() {\n const router = useRouterContext();\n return React.useCallback(opts => {\n const {\n pending,\n caseSensitive,\n ...rest\n } = opts;\n return router.matchRoute(rest, {\n pending,\n caseSensitive\n });\n }, []);\n}\nfunction MatchRoute(props) {\n const matchRoute = useMatchRoute();\n const params = matchRoute(props);\n if (!params) {\n return null;\n }\n if (typeof props.children === 'function') {\n return props.children(params);\n }\n return params ? props.children : null;\n}\nfunction Outlet() {\n const matches = useMatches().slice(1);\n const match = matches[0];\n if (!match) {\n return null;\n }\n return /*#__PURE__*/React.createElement(SubOutlet, {\n matches: matches,\n match: match\n });\n}\nfunction SubOutlet({\n matches,\n match\n}) {\n const router = useRouterContext();\n useStore(match.store, store => [store.status, store.error], true);\n const defaultPending = React.useCallback(() => null, []);\n const Inner = React.useCallback(props => {\n if (props.match.state.status === 'error') {\n throw props.match.state.error;\n }\n if (props.match.state.status === 'success') {\n return /*#__PURE__*/React.createElement(props.match.component ?? router.options.defaultComponent ?? Outlet);\n }\n if (props.match.state.status === 'pending') {\n throw props.match.__loadPromise;\n }\n invariant(false, 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!');\n }, []);\n const PendingComponent = match.pendingComponent ?? router.options.defaultPendingComponent ?? defaultPending;\n const errorComponent = match.errorComponent ?? router.options.defaultErrorComponent;\n const ResolvedSuspenseBoundary = match.route.options.wrapInSuspense ?? true ? React.Suspense : SafeFragment;\n const ResolvedCatchBoundary = errorComponent ? CatchBoundary : SafeFragment;\n return /*#__PURE__*/React.createElement(matchesContext.Provider, {\n value: matches\n }, /*#__PURE__*/React.createElement(ResolvedSuspenseBoundary, {\n fallback: /*#__PURE__*/React.createElement(PendingComponent, null)\n }, /*#__PURE__*/React.createElement(ResolvedCatchBoundary, {\n key: match.route.id,\n errorComponent: errorComponent,\n onCatch: () => {\n warning(false, `Error in route match: ${match.id}`);\n }\n }, /*#__PURE__*/React.createElement(Inner, {\n match: match\n }))));\n}\nfunction SafeFragment(props) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\n\nclass CatchBoundary extends React.Component {\n state = {\n error: false,\n info: undefined\n };\n componentDidCatch(error, info) {\n this.props.onCatch(error, info);\n console.error(error);\n this.setState({\n error,\n info\n });\n }\n render() {\n return /*#__PURE__*/React.createElement(CatchBoundaryInner, _extends({}, this.props, {\n errorState: this.state,\n reset: () => this.setState({})\n }));\n }\n}\nfunction CatchBoundaryInner(props) {\n const [activeErrorState, setActiveErrorState] = React.useState(props.errorState);\n const router = useRouterContext();\n const errorComponent = props.errorComponent ?? ErrorComponent;\n const prevKeyRef = React.useRef('');\n React.useEffect(() => {\n if (activeErrorState) {\n if (router.state.currentLocation.key !== prevKeyRef.current) {\n setActiveErrorState({});\n }\n }\n prevKeyRef.current = router.state.currentLocation.key;\n }, [activeErrorState, router.state.currentLocation.key]);\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState);\n }\n // props.reset()\n }, [props.errorState.error]);\n if (props.errorState.error && activeErrorState.error) {\n return /*#__PURE__*/React.createElement(errorComponent, activeErrorState);\n }\n return props.children;\n}\nfunction ErrorComponent({\n error\n}) {\n return /*#__PURE__*/React.createElement(\"div\", {\n style: {\n padding: '.5rem',\n maxWidth: '100%'\n }\n }, /*#__PURE__*/React.createElement(\"strong\", {\n style: {\n fontSize: '1.2rem'\n }\n }, \"Something went wrong!\"), /*#__PURE__*/React.createElement(\"div\", {\n style: {\n height: '.5rem'\n }\n }), /*#__PURE__*/React.createElement(\"div\", null, /*#__PURE__*/React.createElement(\"pre\", {\n style: {\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n overflow: 'auto'\n }\n }, error.message ? /*#__PURE__*/React.createElement(\"code\", null, error.message) : null)));\n}\n\n// TODO: While we migrate away from the history package, these need to be disabled\n// export function usePrompt(message: string, when: boolean | any): void {\n// const router = useRouter()\n\n// React.useEffect(() => {\n// if (!when) return\n\n// let unblock = router.getHistory().block((transition) => {\n// if (window.confirm(message)) {\n// unblock()\n// transition.retry()\n// } else {\n// router.setStore((s) => {\n// s.currentLocation.pathname = window.location.pathname\n// })\n// }\n// })\n\n// return unblock\n// }, [when, message])\n// }\n\n// export function Prompt({ message, when, children }: PromptProps) {\n// usePrompt(message, when ?? true)\n// return (children ?? null) as ReactNode\n// }\n\nexport { ErrorComponent, Link, MatchRoute, Navigate, Outlet, ReactRouter, RouterProvider, lazy, matchesContext, routerContext, useLinkProps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterContext, useSearch };\n//# sourceMappingURL=index.js.map\n","import React from 'react'\n\nconst getItem = (key: string): unknown => {\n try {\n const itemValue = localStorage.getItem(key)\n if (typeof itemValue === 'string') {\n return JSON.parse(itemValue)\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\nexport default function useLocalStorage<T>(\n key: string,\n defaultValue: T | undefined,\n): [T | undefined, (newVal: T | ((prevVal: T) => T)) => void] {\n const [value, setValue] = React.useState<T>()\n\n React.useEffect(() => {\n const initialValue = getItem(key) as T | undefined\n\n if (typeof initialValue === 'undefined' || initialValue === null) {\n setValue(\n typeof defaultValue === 'function' ? defaultValue() : defaultValue,\n )\n } else {\n setValue(initialValue)\n }\n }, [defaultValue, key])\n\n const setter = React.useCallback(\n (updater: any) => {\n setValue((old) => {\n let newVal = updater\n\n if (typeof updater == 'function') {\n newVal = updater(old)\n }\n try {\n localStorage.setItem(key, JSON.stringify(newVal))\n } catch {}\n\n return newVal\n })\n },\n [key],\n )\n\n return [value, setter]\n}\n","import React from 'react'\n\nexport const defaultTheme = {\n background: '#0b1521',\n backgroundAlt: '#132337',\n foreground: 'white',\n gray: '#3f4e60',\n grayAlt: '#222e3e',\n inputBackgroundColor: '#fff',\n inputTextColor: '#000',\n success: '#00ab52',\n danger: '#ff0085',\n active: '#006bff',\n warning: '#ffb200',\n} as const\n\nexport type Theme = typeof defaultTheme\ninterface ProviderProps {\n theme: Theme\n children?: React.ReactNode\n}\n\nconst ThemeContext = React.createContext(defaultTheme)\n\nexport function ThemeProvider({ theme, ...rest }: ProviderProps) {\n return <ThemeContext.Provider value={theme} {...rest} />\n}\n\nexport function useTheme() {\n return React.useContext(ThemeContext)\n}\n","import React from 'react'\n\nexport default function useMediaQuery(query: string): boolean | undefined {\n // Keep track of the preference in state, start with the current match\n const [isMatch, setIsMatch] = React.useState(() => {\n if (typeof window !== 'undefined') {\n return window.matchMedia && window.matchMedia(query).matches\n }\n return\n })\n\n // Watch for changes\n React.useEffect(() => {\n if (typeof window !== 'undefined') {\n if (!window.matchMedia) {\n return\n }\n\n // Create a matcher\n const matcher = window.matchMedia(query)\n\n // Create our handler\n const onChange = ({ matches }: { matches: boolean }) =>\n setIsMatch(matches)\n\n // Listen for changes\n matcher.addListener(onChange)\n\n return () => {\n // Stop listening for changes\n matcher.removeListener(onChange)\n }\n }\n\n return\n }, [isMatch, query, setIsMatch])\n\n return isMatch\n}\n","import React from 'react'\nimport { AnyRouteMatch, RouteMatch } from '@tanstack/react-router'\n\nimport { Theme, useTheme } from './theme'\nimport useMediaQuery from './useMediaQuery'\n\nexport const isServer = typeof window === 'undefined'\n\ntype StyledComponent<T> = T extends 'button'\n ? React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >\n : T extends 'input'\n ? React.DetailedHTMLProps<\n React.InputHTMLAttributes<HTMLInputElement>,\n HTMLInputElement\n >\n : T extends 'select'\n ? React.DetailedHTMLProps<\n React.SelectHTMLAttributes<HTMLSelectElement>,\n HTMLSelectElement\n >\n : T extends keyof HTMLElementTagNameMap\n ? React.HTMLAttributes<HTMLElementTagNameMap[T]>\n : never\n\nexport function getStatusColor(match: AnyRouteMatch, theme: Theme) {\n return match.state.status === 'pending'\n ? theme.active\n : match.state.status === 'error'\n ? theme.danger\n : match.state.status === 'success'\n ? theme.success\n : theme.gray\n}\n\ntype Styles =\n | React.CSSProperties\n | ((props: Record<string, any>, theme: Theme) => React.CSSProperties)\n\nexport function styled<T extends keyof HTMLElementTagNameMap>(\n type: T,\n newStyles: Styles,\n queries: Record<string, Styles> = {},\n) {\n return React.forwardRef<HTMLElementTagNameMap[T], StyledComponent<T>>(\n ({ style, ...rest }, ref) => {\n const theme = useTheme()\n\n const mediaStyles = Object.entries(queries).reduce(\n (current, [key, value]) => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useMediaQuery(key)\n ? {\n ...current,\n ...(typeof value === 'function' ? value(rest, theme) : value),\n }\n : current\n },\n {},\n )\n\n return React.createElement(type, {\n ...rest,\n style: {\n ...(typeof newStyles === 'function'\n ? newStyles(rest, theme)\n : newStyles),\n ...style,\n ...mediaStyles,\n },\n ref,\n })\n },\n )\n}\n\nexport function useIsMounted() {\n const mountedRef = React.useRef(false)\n const isMounted = React.useCallback(() => mountedRef.current, [])\n\n React[isServer ? 'useEffect' : 'useLayoutEffect'](() => {\n mountedRef.current = true\n return () => {\n mountedRef.current = false\n }\n }, [])\n\n return isMounted\n}\n\n/**\n * Displays a string regardless the type of the data\n * @param {unknown} value Value to be stringified\n */\nexport const displayValue = (value: unknown) => {\n const name = Object.getOwnPropertyNames(Object(value))\n const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value\n\n return JSON.stringify(newValue, name)\n}\n\n/**\n * This hook is a safe useState version which schedules state updates in microtasks\n * to prevent updating a component state while React is rendering different components\n * or when the component is not mounted anymore.\n */\nexport function useSafeState<T>(initialState: T): [T, (value: T) => void] {\n const isMounted = useIsMounted()\n const [state, setState] = React.useState(initialState)\n\n const safeSetState = React.useCallback(\n (value: T) => {\n scheduleMicrotask(() => {\n if (isMounted()) {\n setState(value)\n }\n })\n },\n [isMounted],\n )\n\n return [state, safeSetState]\n}\n\n/**\n * Schedules a microtask.\n * This can be useful to schedule state updates after rendering.\n */\nfunction scheduleMicrotask(callback: () => void) {\n Promise.resolve()\n .then(callback)\n .catch((error) =>\n setTimeout(() => {\n throw error\n }),\n )\n}\n\nexport function multiSortBy<T>(\n arr: T[],\n accessors: ((item: T) => any)[] = [(d) => d],\n): T[] {\n return arr\n .map((d, i) => [d, i] as const)\n .sort(([a, ai], [b, bi]) => {\n for (const accessor of accessors) {\n const ao = accessor(a)\n const bo = accessor(b)\n\n if (typeof ao === 'undefined') {\n if (typeof bo === 'undefined') {\n continue\n }\n return 1\n }\n\n if (ao === bo) {\n continue\n }\n\n return ao > bo ? 1 : -1\n }\n\n return ai - bi\n })\n .map(([d]) => d)\n}\n","import { styled } from './utils'\n\nexport const Panel = styled(\n 'div',\n (_props, theme) => ({\n fontSize: 'clamp(12px, 1.5vw, 14px)',\n fontFamily: `sans-serif`,\n display: 'flex',\n backgroundColor: theme.background,\n color: theme.foreground,\n }),\n {\n '(max-width: 700px)': {\n flexDirection: 'column',\n },\n '(max-width: 600px)': {\n fontSize: '.9em',\n // flexDirection: 'column',\n },\n },\n)\n\nexport const ActivePanel = styled(\n 'div',\n () => ({\n flex: '1 1 500px',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n height: '100%',\n }),\n {\n '(max-width: 700px)': (_props, theme) => ({\n borderTop: `2px solid ${theme.gray}`,\n }),\n },\n)\n\nexport const Button = styled('button', (props, theme) => ({\n appearance: 'none',\n fontSize: '.9em',\n fontWeight: 'bold',\n background: theme.gray,\n border: '0',\n borderRadius: '.3em',\n color: 'white',\n padding: '.5em',\n opacity: props.disabled ? '.5' : undefined,\n cursor: 'pointer',\n}))\n\n// export const QueryKeys = styled('span', {\n// display: 'inline-block',\n// fontSize: '0.9em',\n// })\n\n// export const QueryKey = styled('span', {\n// display: 'inline-flex',\n// alignItems: 'center',\n// padding: '.2em .4em',\n// fontWeight: 'bold',\n// textShadow: '0 0 10px black',\n// borderRadius: '.2em',\n// })\n\nexport const Code = styled('code', {\n fontSize: '.9em',\n})\n\nexport const Input = styled('input', (_props, theme) => ({\n backgroundColor: theme.inputBackgroundColor,\n border: 0,\n borderRadius: '.2em',\n color: theme.inputTextColor,\n fontSize: '.9em',\n lineHeight: `1.3`,\n padding: '.3em .4em',\n}))\n\nexport const Select = styled(\n 'select',\n (_props, theme) => ({\n display: `inline-block`,\n fontSize: `.9em`,\n fontFamily: `sans-serif`,\n fontWeight: 'normal',\n lineHeight: `1.3`,\n padding: `.3em 1.5em .3em .5em`,\n height: 'auto',\n border: 0,\n borderRadius: `.2em`,\n appearance: `none`,\n WebkitAppearance: 'none',\n backgroundColor: theme.inputBackgroundColor,\n backgroundImage: `url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")`,\n backgroundRepeat: `no-repeat`,\n backgroundPosition: `right .55em center`,\n backgroundSize: `.65em auto, 100%`,\n color: theme.inputTextColor,\n }),\n {\n '(max-width: 500px)': {\n display: 'none',\n },\n },\n)\n","import * as React from 'react'\n\nimport { displayValue, styled } from './utils'\n\nexport const Entry = styled('div', {\n fontFamily: 'Menlo, monospace',\n fontSize: '.7rem',\n lineHeight: '1.7',\n outline: 'none',\n wordBreak: 'break-word',\n})\n\nexport const Label = styled('span', {\n color: 'white',\n})\n\nexport const LabelButton = styled('button', {\n cursor: 'pointer',\n color: 'white',\n})\n\nexport const ExpandButton = styled('button', {\n cursor: 'pointer',\n color: 'inherit',\n font: 'inherit',\n outline: 'inherit',\n background: 'transparent',\n border: 'none',\n padding: 0,\n})\n\nexport const Value = styled('span', (_props, theme) => ({\n color: theme.danger,\n}))\n\nexport const SubEntries = styled('div', {\n marginLeft: '.1em',\n paddingLeft: '1em',\n borderLeft: '2px solid rgba(0,0,0,.15)',\n})\n\nexport const Info = styled('span', {\n color: 'grey',\n fontSize: '.7em',\n})\n\ntype ExpanderProps = {\n expanded: boolean\n style?: React.CSSProperties\n}\n\nexport const Expander = ({ expanded, style = {} }: ExpanderProps) => (\n <span\n style={{\n display: 'inline-block',\n transition: 'all .1s ease',\n transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,\n ...style,\n }}\n >\n ▶\n </span>\n)\n\ntype Entry = {\n label: string\n}\n\ntype RendererProps = {\n handleEntry: HandleEntryFn\n label?: React.ReactNode\n value: unknown\n subEntries: Entry[]\n subEntryPages: Entry[][]\n type: string\n expanded: boolean\n toggleExpanded: () => void\n pageSize: number\n renderer?: Renderer\n}\n\n/**\n * Chunk elements in the array by size\n *\n * when the array cannot be chunked evenly by size, the last chunk will be\n * filled with the remaining elements\n *\n * @example\n * chunkArray(['a','b', 'c', 'd', 'e'], 2) // returns [['a','b'], ['c', 'd'], ['e']]\n */\nexport function chunkArray<T>(array: T[], size: number): T[][] {\n if (size < 1) return []\n let i = 0\n const result: T[][] = []\n while (i < array.length) {\n result.push(array.slice(i, i + size))\n i = i + size\n }\n return result\n}\n\ntype Renderer = (props: RendererProps) => JSX.Element\n\nexport const DefaultRenderer: Renderer = ({\n handleEntry,\n label,\n value,\n subEntries = [],\n subEntryPages = [],\n type,\n expanded = false,\n toggleExpanded,\n pageSize,\n renderer,\n}) => {\n const [expandedPages, setExpandedPages] = React.useState<number[]>([])\n const [valueSnapshot, setValueSnapshot] = React.useState(undefined)\n\n const refreshValueSnapshot = () => {\n setValueSnapshot((value as () => any)())\n }\n\n return (\n <Entry>\n {subEntryPages.length ? (\n <>\n <ExpandButton onClick={() => toggleExpanded()}>\n <Expander expanded={expanded} /> {label}{' '}\n <Info>\n {String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : ''}\n {subEntries.length} {subEntries.length > 1 ? `items` : `item`}\n </Info>\n </ExpandButton>\n {expanded ? (\n subEntryPages.length === 1 ? (\n <SubEntries>\n {subEntries.map((entry, index) => handleEntry(entry))}\n </SubEntries>\n ) : (\n <SubEntries>\n {subEntryPages.map((entries, index) => (\n <div key={index}>\n <Entry>\n <LabelButton\n onClick={() =>\n setExpandedPages((old) =>\n old.includes(index)\n ? old.filter((d) => d !== index)\n : [...old, index],\n )\n }\n >\n <Expander expanded={expanded} /> [{index * pageSize} ...{' '}\n {index * pageSize + pageSize - 1}]\n </LabelButton>\n {expandedPages.includes(index) ? (\n <SubEntries>\n {entries.map((entry) => handleEntry(entry))}\n </SubEntries>\n ) : null}\n </Entry>\n </div>\n ))}\n </SubEntries>\n )\n ) : null}\n </>\n ) : type === 'function' ? (\n <>\n <Explorer\n renderer={renderer}\n label={\n <button\n onClick={refreshValueSnapshot}\n style={{\n appearance: 'none',\n border: '0',\n background: 'transparent',\n }}\n >\n <Label>{label}</Label> 🔄{' '}\n </button>\n }\n value={valueSnapshot}\n defaultExpanded={{}}\n />\n </>\n ) : (\n <>\n <Label>{label}:</Label> <Value>{displayValue(value)}</Value>\n </>\n )}\n </Entry>\n )\n}\n\ntype HandleEntryFn = (entry: Entry) => JSX.Element\n\ntype ExplorerProps = Partial<RendererProps> & {\n renderer?: Renderer\n defaultExpanded?: true | Record<string, boolean>\n}\n\ntype Property = {\n defaultExpanded?: boolean | Record<string, boolean>\n label: string\n value: unknown\n}\n\nfunction isIterable(x: any): x is Iterable<unknown> {\n return Symbol.iterator in x\n}\n\nexport default function Explorer({\n value,\n defaultExpanded,\n renderer = DefaultRenderer,\n pageSize = 100,\n ...rest\n}: ExplorerProps) {\n const [expanded, setExpanded] = React.useState(Boolean(defaultExpanded))\n const toggleExpanded = React.useCallback(() => setExpanded((old) => !old), [])\n\n let type: string = typeof value\n let subEntries: Property[] = []\n\n const makeProperty = (sub: { label: string; value: unknown }): Property => {\n const subDefaultExpanded =\n defaultExpanded === true\n ? { [sub.label]: true }\n : defaultExpanded?.[sub.label]\n return {\n ...sub,\n defaultExpanded: subDefaultExpanded,\n }\n }\n\n if (Array.isArray(value)) {\n type = 'array'\n subEntries = value.map((d, i) =>\n makeProperty({\n label: i.toString(),\n value: d,\n }),\n )\n } else if (\n value !== null &&\n typeof value === 'object' &&\n isIterable(value) &&\n typeof value[Symbol.iterator] === 'function'\n ) {\n type = 'Iterable'\n subEntries = Array.from(value, (val, i) =>\n makeProperty({\n label: i.toString(),\n value: val,\n }),\n )\n } else if (typeof value === 'object' && value !== null) {\n type = 'object'\n subEntries = Object.entries(value).map(([key, val]) =>\n makeProperty({\n label: key,\n value: val,\n }),\n )\n }\n\n const subEntryPages = chunkArray(subEntries, pageSize)\n\n return renderer({\n handleEntry: (entry) => (\n <Explorer\n key={entry.label}\n value={value}\n renderer={renderer}\n {...rest}\n {...entry}\n />\n ),\n type,\n subEntries,\n subEntryPages,\n value,\n expanded,\n toggleExpanded,\n pageSize,\n ...rest,\n })\n}\n","import React from 'react'\nimport {\n Router,\n last,\n routerContext,\n invariant,\n useRouter,\n AnyRouter,\n} from '@tanstack/react-router'\n\nimport useLocalStorage from './useLocalStorage'\nimport {\n getStatusColor,\n multiSortBy,\n useIsMounted,\n useSafeState,\n} from './utils'\nimport { Panel, Button, Code, ActivePanel } from './styledComponents'\nimport { ThemeProvider, defaultTheme as theme } from './theme'\n// import { getQueryStatusLabel, getQueryStatusColor } from './utils'\nimport Explorer from './Explorer'\n\nexport type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>\n\ninterface DevtoolsOptions {\n /**\n * Set this true if you want the dev tools to default to being open\n */\n initialIsOpen?: boolean\n /**\n * Use this to add props to the panel. For example, you can add className, style (merge and override default style), etc.\n */\n panelProps?: React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >\n /**\n * Use this to add props to the close button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n closeButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >\n /**\n * Use this to add props to the toggle button. For example, you can add className, style (merge and override default style), onClick (extend default handler), etc.\n */\n toggleButtonProps?: React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n >\n /**\n * The position of the TanStack Router logo to open and close the devtools panel.\n * Defaults to 'bottom-left'.\n */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n /**\n * Use this to render the devtools inside a different type of container element for a11y purposes.\n * Any string which corresponds to a valid intrinsic JSX element is allowed.\n * Defaults to 'footer'.\n */\n containerElement?: string | any\n /**\n * A boolean variable indicating if the \"lite\" version of the library is being used\n */\n router?: AnyRouter\n}\n\ninterface DevtoolsPanelOptions {\n /**\n * The standard React style object used to style a component with inline styles\n */\n style?: React.CSSProperties\n /**\n * The standard React className property used to style a component with classes\n */\n className?: string\n /**\n * A boolean variable indicating whether the panel is open or closed\n */\n isOpen?: boolean\n /**\n * A function that toggles the open and close state of the panel\n */\n setIsOpen: (isOpen: boolean) => void\n /**\n * Handles the opening and closing the devtools panel\n */\n handleDragStart: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void\n /**\n * A boolean variable indicating if the \"lite\" version of the library is being used\n */\n router?: AnyRouter\n}\n\nconst isServer = typeof window === 'undefined'\n\nfunction Logo(props: React.HTMLProps<HTMLDivElement>) {\n return (\n <div\n {...props}\n style={{\n ...(props.style ?? {}),\n display: 'flex',\n alignItems: 'center',\n flexDirection: 'column',\n fontSize: '0.8rem',\n fontWeight: 'bolder',\n lineHeight: '1',\n }}\n >\n <div\n style={{\n letterSpacing: '-0.05rem',\n }}\n >\n TANSTACK\n </div>\n <div\n style={{\n backgroundImage:\n 'linear-gradient(to right, var(--tw-gradient-stops))',\n // @ts-ignore\n '--tw-gradient-from': '#84cc16',\n '--tw-gradient-stops':\n 'var(--tw-gradient-from), var(--tw-gradient-to)',\n '--tw-gradient-to': '#10b981',\n WebkitBackgroundClip: 'text',\n color: 'transparent',\n letterSpacing: '0.1rem',\n marginRight: '-0.2rem',\n }}\n >\n ROUTER\n </div>\n </div>\n )\n}\n\nexport function TanStackRouterDevtools({\n initialIsOpen,\n panelProps = {},\n closeButtonProps = {},\n toggleButtonProps = {},\n position = 'bottom-left',\n containerElement: Container = 'footer',\n router,\n}: DevtoolsOptions): React.ReactElement | null {\n const rootRef = React.useRef<HTMLDivElement>(null)\n const panelRef = React.useRef<HTMLDivElement>(null)\n const [isOpen, setIsOpen] = useLocalStorage(\n 'tanstackRouterDevtoolsOpen',\n initialIsOpen,\n )\n const [devtoolsHeight, setDevtoolsHeight] = useLocalStorage<number | null>(\n 'tanstackRouterDevtoolsHeight',\n null,\n )\n const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false)\n const [isResizing, setIsResizing] = useSafeState(false)\n const isMounted = useIsMounted()\n\n const handleDragStart = (\n panelElement: HTMLDivElement | null,\n startEvent: React.MouseEvent<HTMLDivElement, MouseEvent>,\n ) => {\n if (startEvent.button !== 0) return // Only allow left click for drag\n\n setIsResizing(true)\n\n const dragInfo = {\n originalHeight: panelElement?.getBoundingClientRect().height ?? 0,\n pageY: startEvent.pageY,\n }\n\n const run = (moveEvent: MouseEvent) => {\n const delta = dragInfo.pageY - moveEvent.pageY\n const newHeight = dragInfo?.originalHeight + delta\n\n setDevtoolsHeight(newHeight)\n\n if (newHeight < 70) {\n setIsOpen(false)\n } else {\n setIsOpen(true)\n }\n }\n\n const unsub = () => {\n setIsResizing(false)\n document.removeEventListener('mousemove', run)\n document.removeEventListener('mouseUp', unsub)\n }\n\n document.addEventListener('mousemove', run)\n document.addEventListener('mouseup', unsub)\n }\n\n React.useEffect(() => {\n setIsResolvedOpen(isOpen ?? false)\n }, [isOpen, isResolvedOpen, setIsResolvedOpen])\n\n // Toggle panel visibility before/after transition (depending on direction).\n // Prevents focusing in a closed panel.\n React.useEffect(() => {\n const ref = panelRef.current\n\n if (ref) {\n const handlePanelTransitionStart = () => {\n if (ref && isResolvedOpen) {\n ref.style.visibility = 'visible'\n }\n }\n\n const handlePanelTransitionEnd = () => {\n if (ref && !isResolvedOpen) {\n ref.style.visibility = 'hidden'\n }\n }\n\n ref.addEventListener('transitionstart', handlePanelTransitionStart)\n ref.addEventListener('transitionend', handlePanelTransitionEnd)\n\n return () => {\n ref.removeEventListener('transitionstart', handlePanelTransitionStart)\n ref.removeEventListener('transitionend', handlePanelTransitionEnd)\n }\n }\n\n return\n }, [isResolvedOpen])\n\n React[isServer ? 'useEffect' : 'useLayoutEffect'](() => {\n if (isResolvedOpen) {\n const previousValue = rootRef.current?.parentElement?.style.paddingBottom\n\n const run = () => {\n const containerHeight = panelRef.current?.getBoundingClientRect().height\n if (rootRef.current?.parentElement) {\n rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`\n }\n }\n\n run()\n\n if (typeof window !== 'undefined') {\n window.addEventListener('resize', run)\n\n return () => {\n window.removeEventListener('resize', run)\n if (\n rootRef.current?.parentElement &&\n typeof previousValue === 'string'\n ) {\n rootRef.current.parentElement.style.paddingBottom = previousValue\n }\n }\n }\n }\n return\n }, [isResolvedOpen])\n\n const { style: panelStyle = {}, ...otherPanelProps } = panelProps\n\n const {\n style: closeButtonStyle = {},\n onClick: onCloseClick,\n ...otherCloseButtonProps\n } = closeButtonProps\n\n const {\n style: toggleButtonStyle = {},\n onClick: onToggleClick,\n ...otherToggleButtonProps\n } = toggleButtonProps\n\n // Do not render on the server\n if (!isMounted()) return null\n\n return (\n <Container ref={rootRef} className=\"TanStackRouterDevtools\">\n <ThemeProvider theme={theme}>\n <TanStackRouterDevtoolsPanel\n ref={panelRef as any}\n {...otherPanelProps}\n router={router}\n style={{\n position: 'fixed',\n bottom: '0',\n right: '0',\n zIndex: 99999,\n width: '100%',\n height: devtoolsHeight ?? 500,\n maxHeight: '90%',\n boxShadow: '0 0 20px rgba(0,0,0,.3)',\n borderTop: `1px solid ${theme.gray}`,\n transformOrigin: 'top',\n // visibility will be toggled after transitions, but set initial state here\n visibility: isOpen ? 'visible' : 'hidden',\n ...panelStyle,\n ...(isResizing\n ? {\n transition: `none`,\n }\n : { transition: `all .2s ease` }),\n ...(isResolvedOpen\n ? {\n opacity: 1,\n pointerEvents: 'all',\n transform: `translateY(0) scale(1)`,\n }\n : {\n opacity: 0,\n pointerEvents: 'none',\n transform: `translateY(15px) scale(1.02)`,\n }),\n }}\n isOpen={isResolvedOpen}\n setIsOpen={setIsOpen}\n handleDragStart={(e) => handleDragStart(panelRef.current, e)}\n />\n {isResolvedOpen ? (\n <Button\n type=\"button\"\n aria-label=\"Close TanStack Router Devtools\"\n {...(otherCloseButtonProps as any)}\n onClick={(e) => {\n setIsOpen(false)\n onCloseClick && onCloseClick(e)\n }}\n style={{\n position: 'fixed',\n zIndex: 99999,\n margin: '.5em',\n bottom: 0,\n ...(position === 'top-right'\n ? {\n right: '0',\n }\n : position === 'top-left'\n ? {\n left: '0',\n }\n : position === 'bottom-right'\n ? {\n right: '0',\n }\n : {\n left: '0',\n }),\n ...closeButtonStyle,\n }}\n >\n Close\n </Button>\n ) : null}\n </ThemeProvider>\n {!isResolvedOpen ? (\n <button\n type=\"button\"\n {...otherToggleButtonProps}\n aria-label=\"Open TanStack Router Devtools\"\n onClick={(e) => {\n setIsOpen(true)\n onToggleClick && onToggleClick(e)\n }}\n style={{\n appearance: 'none',\n background: 'none',\n border: 0,\n padding: 0,\n position: 'fixed',\n zIndex: 99999,\n display: 'inline-flex',\n fontSize: '1.5em',\n margin: '.5em',\n cursor: 'pointer',\n width: 'fit-content',\n ...(position === 'top-right'\n ? {\n top: '0',\n right: '0',\n }\n : position === 'top-left'\n ? {\n top: '0',\n left: '0',\n }\n : position === 'bottom-right'\n ? {\n bottom: '0',\n right: '0',\n }\n : {\n bottom: '0',\n left: '0',\n }),\n ...toggleButtonStyle,\n }}\n >\n <Logo aria-hidden />\n </button>\n ) : null}\n </Container>\n )\n}\n\nexport const TanStackRouterDevtoolsPanel = React.forwardRef<\n HTMLDivElement,\n DevtoolsPanelOptions\n>(function TanStackRouterDevtoolsPanel(props, ref): React.ReactElement {\n const {\n isOpen = true,\n setIsOpen,\n handleDragStart,\n router: userRouter,\n ...panelProps\n } = props\n\n const routerContextValue = React.useContext(routerContext)\n const router = userRouter ?? routerContextValue?.router\n\n invariant(\n router,\n 'No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.',\n )\n\n useRouter()\n\n const [activeRouteId, setActiveRouteId] = useLocalStorage(\n 'tanstackRouterDevtoolsActiveRouteId',\n '',\n )\n\n const [activeMatchId, setActiveMatchId] = useLocalStorage(\n 'tanstackRouterDevtoolsActiveMatchId',\n '',\n )\n\n React.useEffect(() => {\n setActiveMatchId('')\n }, [activeRouteId])\n\n const allMatches = React.useMemo(\n () => [\n ...Object.values(router.state.currentMatches),\n ...Object.values(router.state.pendingMatches ?? []),\n ],\n [router.state.currentMatches, router.state.pendingMatches],\n )\n\n const activeMatch =\n allMatches?.find((d) => d.id === activeMatchId) ||\n allMatches?.find((d) => d.route.id === activeRouteId)\n\n // const matchCacheValues = multiSortBy(\n // Object.keys(router.state.matchCache)\n // .filter((key) => {\n // const cacheEntry = router.state.matchCache[key]!\n // return cacheEntry.gc > Date.now()\n // })\n // .map((key) => router.state.matchCache[key]!),\n // [\n // (d) => (d.match.state.isFetching ? -1 : 1),\n // (d) => -d.match.state.updatedAt!,\n // ],\n // )\n\n return (\n <ThemeProvider theme={theme}>\n <Panel ref={ref} className=\"TanStackRouterDevtoolsPanel\" {...panelProps}>\n <style\n dangerouslySetInnerHTML={{\n __html: `\n\n .TanStackRouterDevtoolsPanel * {\n scrollbar-color: ${theme.backgroundAlt} ${theme.gray};\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {\n background: ${theme.backgroundAlt};\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {\n background: ${theme.gray};\n border-radius: .5em;\n border: 3px solid ${theme.backgroundAlt};\n }\n\n .TanStackRouterDevtoolsPanel table {\n width: 100%;\n }\n\n .TanStackRouterDevtoolsPanel table tr {\n border-bottom: 2px dotted rgba(255, 255, 255, .2);\n }\n\n .TanStackRouterDevtoolsPanel table tr:last-child {\n border-bottom: none\n }\n\n .TanStackRouterDevtoolsPanel table td {\n padding: .25rem .5rem;\n border-right: 2px dotted rgba(255, 255, 255, .05);\n }\n\n .TanStackRouterDevtoolsPanel table td:last-child {\n border-right: none\n }\n\n `,\n }}\n />\n <div\n style={{\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '4px',\n marginBottom: '-4px',\n cursor: 'row-resize',\n zIndex: 100000,\n }}\n onMouseDown={handleDragStart}\n ></div>\n <div\n style={{\n flex: '1 1 500px',\n minHeight: '40%',\n maxHeight: '100%',\n overflow: 'auto',\n borderRight: `1px solid ${theme.grayAlt}`,\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <div\n style={{\n display: 'flex',\n justifyContent: 'start',\n gap: '1rem',\n padding: '1rem',\n alignItems: 'center',\n background: theme.backgroundAlt,\n }}\n >\n <Logo aria-hidden />\n <div\n style={{\n fontSize: 'clamp(.8rem, 2vw, 1.3rem)',\n fontWeight: 'bold',\n }}\n >\n <span\n style={{\n fontWeight: 100,\n }}\n >\n Devtools\n </span>\n </div>\n </div>\n <div\n style={{\n overflowY: 'auto',\n flex: '1',\n }}\n >\n <div\n style={{\n padding: '.5em',\n }}\n >\n <Explorer label=\"Router\" value={router} defaultExpanded={{}} />\n </div>\n </div>\n </div>\n <div\n style={{\n flex: '1 1 500px',\n minHeight: '40%',\n maxHeight: '100%',\n overflow: 'auto',\n borderRight: `1px solid ${theme.grayAlt}`,\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Active Matches\n </div>\n {router.state.currentMatches.map((match, i) => {\n return (\n <div\n key={match.route.id || i}\n role=\"button\"\n aria-label={`Open match details for ${match.route.id}`}\n onClick={() =>\n setActiveRouteId(\n activeRouteId === match.route.id ? '' : match.route.id,\n )\n }\n style={{\n display: 'flex',\n borderBottom: `solid 1px ${theme.grayAlt}`,\n cursor: 'pointer',\n alignItems: 'center',\n background:\n match === activeMatch ? 'rgba(255,255,255,.1)' : undefined,\n }}\n >\n <div\n style={{\n flex: '0 0 auto',\n width: '1.3rem',\n height: '1.3rem',\n marginLeft: '.25rem',\n background: getStatusColor(match, theme),\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n transition: 'all .2s ease-out',\n }}\n />\n\n <Code\n style={{\n padding: '.5em',\n }}\n >\n {`${match.id}`}\n </Code>\n </div>\n )\n })}\n {router.state.pendingMatches?.length ? (\n <>\n <div\n style={{\n marginTop: '2rem',\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n zIndex: 1,\n }}\n >\n Pending Matches\n </div>\n {router.state.pendingMatches?.map((match, i) => {\n return (\n <div\n key={match.route.id || i}\n role=\"button\"\n aria-label={`Open match details for ${match.route.id}`}\n onClick={() =>\n setActiveRouteId(\n activeRouteId === match.route.id ? '' : match.route.id,\n )\n }\n style={{\n display: 'flex',\n borderBottom: `solid 1px ${theme.grayAlt}`,\n cursor: 'pointer',\n background:\n match === activeMatch\n ? 'rgba(255,255,255,.1)'\n : undefined,\n }}\n >\n <div\n style={{\n flex: '0 0 auto',\n width: '1.3rem',\n height: '1.3rem',\n marginLeft: '.25rem',\n background: getStatusColor(match, theme),\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n transition: 'all .2s ease-out',\n }}\n />\n\n <Code\n style={{\n padding: '.5em',\n }}\n >\n {`${match.id}`}\n </Code>\n </div>\n )\n })}\n </>\n ) : null}\n {/* {matchCacheValues.length ? (\n <>\n <div\n style={{\n marginTop: '2rem',\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n }}\n >\n <div>Match Cache</div>\n <Button\n onClick={() => {\n router.store.setState((s) => (s.matchCache = {}))\n }}\n >\n Clear\n </Button>\n </div>\n {matchCacheValues.map((d, i) => {\n const { match, gc } = d\n\n return (\n <div\n key={match.id || i}\n role=\"button\"\n aria-label={`Open match details for ${match.id}`}\n onClick={() =>\n setActiveMatchId(\n activeMatchId === match.id ? '' : match.id,\n )\n }\n style={{\n display: 'flex',\n borderBottom: `solid 1px ${theme.grayAlt}`,\n cursor: 'pointer',\n background:\n match === activeMatch\n ? 'rgba(255,255,255,.1)'\n : undefined,\n }}\n >\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n padding: '.5rem',\n gap: '.3rem',\n }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '.5rem',\n }}\n >\n <div\n style={{\n flex: '0 0 auto',\n width: '1.3rem',\n height: '1.3rem',\n background: getStatusColor(match, theme),\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 'bold',\n borderRadius: '.25rem',\n transition: 'all .2s ease-out',\n }}\n />\n <Code>{`${match.id}`}</Code>\n </div>\n <span\n style={{\n fontSize: '.7rem',\n opacity: '.5',\n lineHeight: 1,\n }}\n >\n Expires{' '}\n {formatDistanceStrict(new Date(gc), new Date(), {\n addSuffix: true,\n })}\n </span>\n </div>\n </div>\n )\n })}\n </>\n ) : null} */}\n </div>\n\n {activeMatch ? (\n <ActivePanel>\n <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Match Details\n </div>\n <div>\n <table>\n <tbody>\n <tr>\n <td style={{ opacity: '.5' }}>ID</td>\n <td>\n <Code\n style={{\n lineHeight: '1.8em',\n }}\n >\n {JSON.stringify(activeMatch.id, null, 2)}\n </Code>\n </td>\n </tr>\n <tr>\n <td style={{ opacity: '.5' }}>Status</td>\n <td>{activeMatch.state.status}</td>\n </tr>\n {/* <tr>\n <td style={{ opacity: '.5' }}>Invalid</td>\n <td>{activeMatch.getIsInvalid().toString()}</td>\n </tr> */}\n <tr>\n <td style={{ opacity: '.5' }}>Last Updated</td>\n <td>\n {activeMatch.state.updatedAt\n ? new Date(\n activeMatch.state.updatedAt as number,\n ).toLocaleTimeString()\n : 'N/A'}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div\n style={{\n background: theme.backgroundAlt,\n padding: '.5em',\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Actions\n </div>\n <div\n style={{\n padding: '0.5em',\n }}\n >\n <Button\n type=\"button\"\n onClick={() => activeMatch.load()}\n style={{\n background: theme.gray,\n }}\n >\n Reload\n </Button>\n </div>\n <div\n style={{\n background: theme.backgroundAlt,\n padding: '.5em',\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Explorer\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n <Explorer\n label=\"Match\"\n value={activeMatch}\n defaultExpanded={{}}\n />\n </div>\n </ActivePanel>\n ) : null}\n <div\n style={{\n flex: '1 1 500px',\n minHeight: '40%',\n maxHeight: '100%',\n overflow: 'auto',\n borderRight: `1px solid ${theme.grayAlt}`,\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n {/* <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n All Loader Data\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n {Object.keys(\n last(router.state.currentMatches)?.state.loaderData ||\n {},\n ).length ? (\n <Explorer\n value={\n last(router.state.currentMatches)?.state\n .loaderData || {}\n }\n defaultExpanded={Object.keys(\n (last(router.state.currentMatches)?.state\n .loaderData as {}) || {},\n ).reduce((obj: any, next) => {\n obj[next] = {}\n return obj\n }, {})}\n />\n ) : (\n <em style={{ opacity: 0.5 }}>{'{ }'}</em>\n )}\n </div> */}\n <div\n style={{\n padding: '.5em',\n background: theme.backgroundAlt,\n position: 'sticky',\n top: 0,\n bottom: 0,\n zIndex: 1,\n }}\n >\n Search Params\n </div>\n <div\n style={{\n padding: '.5em',\n }}\n >\n {Object.keys(last(router.state.currentMatches)?.state.search || {})\n .length ? (\n <Explorer\n value={last(router.state.currentMatches)?.state.search || {}}\n defaultExpanded={Object.keys(\n (last(router.state.currentMatches)?.state.search as {}) || {},\n ).reduce((obj: any, next) => {\n obj[next] = {}\n return obj\n }, {})}\n />\n ) : (\n <em style={{ opacity: 0.5 }}>{'{ }'}</em>\n )}\n </div>\n </div>\n </Panel>\n </ThemeProvider>\n )\n})\n"],"names":["useSyncExternalStoreWithSelector","React","getItem","key","itemValue","localStorage","JSON","parse","undefined","useLocalStorage","defaultValue","value","setValue","useState","useEffect","initialValue","setter","useCallback","updater","old","newVal","setItem","stringify","defaultTheme","background","backgroundAlt","foreground","gray","grayAlt","inputBackgroundColor","inputTextColor","success","danger","active","warning","ThemeContext","createContext","ThemeProvider","theme","rest","useTheme","useContext","useMediaQuery","query","isMatch","setIsMatch","window","matchMedia","matches","matcher","onChange","addListener","removeListener","isServer","getStatusColor","match","state","status","styled","type","newStyles","queries","forwardRef","style","ref","mediaStyles","Object","entries","reduce","current","createElement","useIsMounted","mountedRef","useRef","isMounted","displayValue","name","getOwnPropertyNames","newValue","toString","useSafeState","initialState","setState","safeSetState","scheduleMicrotask","callback","Promise","resolve","then","catch","error","setTimeout","Panel","_props","fontSize","fontFamily","display","backgroundColor","color","flexDirection","ActivePanel","flex","overflow","height","borderTop","Button","props","appearance","fontWeight","border","borderRadius","padding","opacity","disabled","cursor","Code","Entry","lineHeight","outline","wordBreak","Label","LabelButton","ExpandButton","font","Value","SubEntries","marginLeft","paddingLeft","borderLeft","Info","Expander","expanded","transition","transform","chunkArray","array","size","i","result","length","push","slice","DefaultRenderer","handleEntry","label","subEntries","subEntryPages","toggleExpanded","pageSize","renderer","expandedPages","setExpandedPages","valueSnapshot","setValueSnapshot","refreshValueSnapshot","String","toLowerCase","map","entry","index","includes","filter","d","isIterable","x","Symbol","iterator","Explorer","defaultExpanded","setExpanded","Boolean","makeProperty","sub","subDefaultExpanded","Array","isArray","from","val","Logo","alignItems","letterSpacing","backgroundImage","WebkitBackgroundClip","marginRight","TanStackRouterDevtools","initialIsOpen","panelProps","closeButtonProps","toggleButtonProps","position","containerElement","Container","router","rootRef","panelRef","isOpen","setIsOpen","devtoolsHeight","setDevtoolsHeight","isResolvedOpen","setIsResolvedOpen","isResizing","setIsResizing","handleDragStart","panelElement","startEvent","button","dragInfo","originalHeight","getBoundingClientRect","pageY","run","moveEvent","delta","newHeight","unsub","document","removeEventListener","addEventListener","handlePanelTransitionStart","visibility","handlePanelTransitionEnd","previousValue","parentElement","paddingBottom","containerHeight","panelStyle","otherPanelProps","closeButtonStyle","onClick","onCloseClick","otherCloseButtonProps","toggleButtonStyle","onToggleClick","otherToggleButtonProps","bottom","right","zIndex","width","maxHeight","boxShadow","transformOrigin","pointerEvents","e","margin","left","top","TanStackRouterDevtoolsPanel","userRouter","routerContextValue","routerContext","invariant","useRouter","activeRouteId","setActiveRouteId","activeMatchId","setActiveMatchId","allMatches","useMemo","values","currentMatches","pendingMatches","activeMatch","find","id","route","__html","marginBottom","minHeight","borderRight","justifyContent","gap","overflowY","borderBottom","marginTop","updatedAt","Date","toLocaleTimeString","load","keys","last","search","obj","next"],"mappings":";;;;;;;;;;;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