Sign In

@tanstack/solid-router

Package Overview
Dependencies
Maintainers
3
Versions
478
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/solid-router - npm Package Compare versions

Comparing version
2.0.0-beta.24
to
2.0.0-beta.25
+22
-8
dist/cjs/Asset.cjs

@@ -6,3 +6,7 @@ const require_useRouter = require("./useRouter.cjs");

//#region src/Asset.tsx
var _tmpl$ = /* @__PURE__ */ (0, _solidjs_web.template)(`<style>`), _tmpl$2 = /* @__PURE__ */ (0, _solidjs_web.template)(`<meta>`), _tmpl$3 = /* @__PURE__ */ (0, _solidjs_web.template)(`<link>`), _tmpl$4 = /* @__PURE__ */ (0, _solidjs_web.template)(`<title>`), _tmpl$5 = /* @__PURE__ */ (0, _solidjs_web.template)(`<script>`);
var _tmpl$ = /* @__PURE__ */ (0, _solidjs_web.template)(`<style>`);
var _tmpl$2 = /* @__PURE__ */ (0, _solidjs_web.template)(`<meta>`);
var _tmpl$3 = /* @__PURE__ */ (0, _solidjs_web.template)(`<link>`);
var _tmpl$4 = /* @__PURE__ */ (0, _solidjs_web.template)(`<title>`);
var _tmpl$5 = /* @__PURE__ */ (0, _solidjs_web.template)(`<script>`);
var INLINE_CSS_HYDRATION_ATTR = "data-tsr-inline-css";

@@ -81,3 +85,5 @@ function Asset(asset) {

var _el$2 = _tmpl$2();
(0, _solidjs_web.spread)(_el$2, (0, _solidjs_web.mergeProps)(() => props.attrs), false);
(0, _solidjs_web.spread)(_el$2, (0, _solidjs_web.mergeProps)(() => {
return props.attrs;
}), false);
return _el$2;

@@ -88,3 +94,5 @@ })();

var _el$3 = _tmpl$3();
(0, _solidjs_web.spread)(_el$3, (0, _solidjs_web.mergeProps)(() => props.attrs), false);
(0, _solidjs_web.spread)(_el$3, (0, _solidjs_web.mergeProps)(() => {
return props.attrs;
}), false);
return _el$3;

@@ -103,5 +111,11 @@ })();

var _el$4 = _tmpl$4();
(0, _solidjs_web.ref)(() => (e) => el = e, _el$4);
(0, _solidjs_web.spread)(_el$4, (0, _solidjs_web.mergeProps)(() => props.attrs), true);
(0, _solidjs_web.insert)(_el$4, () => props.children);
(0, _solidjs_web.ref)(() => {
return (e) => el = e;
}, _el$4);
(0, _solidjs_web.spread)(_el$4, (0, _solidjs_web.mergeProps)(() => {
return props.attrs;
}), true);
(0, _solidjs_web.insert)(_el$4, () => {
return props.children;
});
return _el$4;

@@ -122,3 +136,3 @@ }

var _el$6 = _tmpl$5();
(0, _solidjs_web.spread)(_el$6, (0, _solidjs_web.mergeProps)(attrs, { "innerHTML": children }), false);
(0, _solidjs_web.spread)(_el$6, (0, _solidjs_web.mergeProps)(attrs, { innerHTML: children }), false);
return _el$6;

@@ -130,3 +144,3 @@ }

var _el$7 = _tmpl$5();
(0, _solidjs_web.spread)(_el$7, (0, _solidjs_web.mergeProps)(attrs, { "innerHTML": children }), false);
(0, _solidjs_web.spread)(_el$7, (0, _solidjs_web.mergeProps)(attrs, { innerHTML: children }), false);
return _el$7;

@@ -133,0 +147,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"Asset.cjs","names":["isServer","createEffect","onCleanup","onSettled","useRouter","RouterManagedTag","JSX","INLINE_CSS_HYDRATION_ATTR","Asset","asset","Element","tag","attrs","children","_$createComponent","Title","HeadElement","inlineCss","process","env","TSS_INLINE_CSS_ENABLED","undefined","InlineCssStyle","Script","useRelocateToHead","getEl","Node","el","parentNode","document","head","appendChild","removeChild","Record","isInlineCssPlaceholder","html","querySelector","HTMLStyleElement","textContent","ScriptAttrs","key","src","props","element","innerHTML","_el$","_tmpl$","_$spread","_el$2","_tmpl$2","_$mergeProps","_el$3","_tmpl$3","HTMLTitleElement","titleText","title","_el$4","_tmpl$4","_$ref","e","_$insert","router","dataScript","type","_el$5","_tmpl$5","_el$6","_el$7","const","script","HTMLScriptElement","normSrc","base","baseURI","window","location","href","URL","existingScript","Array","from","querySelectorAll","find","createElement","value","Object","entries","setAttribute","String","typeAttr","nonceAttr","nonce","sType","getAttribute","sNonce"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect, onCleanup, onSettled } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst INLINE_CSS_HYDRATION_ATTR = 'data-tsr-inline-css'\n\nexport function Asset(asset: RouterManagedTag): JSX.Element | null {\n const { tag, attrs, children } = asset\n\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <HeadElement tag=\"meta\" attrs={attrs} />\n case 'link':\n return <HeadElement tag=\"link\" attrs={attrs} />\n case 'style':\n if (\n asset.inlineCss &&\n (process.env.TSS_INLINE_CSS_ENABLED === 'true' ||\n (process.env.TSS_INLINE_CSS_ENABLED === undefined && isServer))\n ) {\n return <InlineCssStyle attrs={attrs}>{children}</InlineCssStyle>\n }\n\n return <HeadElement tag=\"style\" attrs={attrs} children={children} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\n// On the client, relocate a rendered head element into document.head so head\n// tags end up in the right place even when <HeadContent /> is rendered in\n// <body>. The *same* node that Solid rendered/hydrated is moved — never\n// recreated — so the server-rendered node stays claimed (its hydration id is\n// preserved) and stylesheets/scripts are not refetched or re-executed.\n//\n// When <HeadContent /> is placed in <head> (the SSR/hydration case), the node\n// is already in document.head, so this is a no-op and the element is left\n// exactly where Solid hydrated it.\nfunction useRelocateToHead(getEl: () => Node | undefined) {\n onSettled(() => {\n const el = getEl()\n if (el && el.parentNode !== document.head) {\n document.head.appendChild(el)\n }\n })\n\n onCleanup(() => {\n const el = getEl()\n if (el?.parentNode) {\n el.parentNode.removeChild(el)\n }\n })\n}\n\nfunction InlineCssStyle({\n attrs,\n children,\n}: {\n attrs?: Record<string, any>\n children?: RouterManagedTag['children']\n}) {\n const isInlineCssPlaceholder = children === undefined\n const html = isInlineCssPlaceholder\n ? typeof document === 'undefined'\n ? ''\n : (document.querySelector<HTMLStyleElement>(\n `style[${INLINE_CSS_HYDRATION_ATTR}]`,\n )?.textContent ?? '')\n : (children ?? '')\n\n return (\n <HeadElement\n tag=\"style\"\n attrs={{ ...attrs, [INLINE_CSS_HYDRATION_ATTR]: '' }}\n children={html}\n />\n )\n}\n\ninterface ScriptAttrs {\n [key: string]: string | boolean | undefined\n src?: string\n}\n\nfunction HeadElement(props: {\n tag: 'meta' | 'link' | 'style'\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n // Each branch must live in its own `case` block so the Solid compiler emits\n // exactly ONE getNextElement() per invocation. Sequential `if ... return`\n // statements compile to multiple getNextElement() calls that all execute,\n // desyncing the hydration key counter (causing \"expected <style>\" mismatches\n // and unclaimed nodes).\n //\n // We capture the element via the JSX return value (a real DOM node in Solid)\n // rather than a `ref` attribute: a `ref` compiles to a _$ref() call that\n // interferes with attribute spreading on hydration-claimed nodes (wiping the\n // SSR attributes).\n let element: Element\n switch (props.tag) {\n case 'style': {\n const attrs = {\n ...props.attrs,\n innerHTML:\n typeof props.children === 'string' ? props.children : undefined,\n }\n element = (<style {...attrs} />) as unknown as Element\n break\n }\n case 'meta':\n element = (<meta {...props.attrs} />) as unknown as Element\n break\n default:\n element = (<link {...props.attrs} />) as unknown as Element\n }\n\n // Move the rendered/hydrated element into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>. Called unconditionally so\n // server and client register the same primitives (see Title).\n useRelocateToHead(() => element)\n\n return element as unknown as JSX.Element\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n let el: HTMLTitleElement | undefined\n\n // IMPORTANT: call these hooks UNCONDITIONALLY (do not guard with isServer).\n // Solid's hydration relies on the component body registering the same\n // reactive primitives in the same order on the server and the client. An\n // `if (!isServer)` guard would skip them on the server but run them on the\n // client, desyncing the hydration owner tree and causing the server <title>\n // to be left unclaimed (and a duplicate appended). These hooks are no-ops\n // during SSR anyway.\n\n // Move the rendered/hydrated <title> into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>.\n useRelocateToHead(() => el)\n\n // Keep document.title in sync during client-side navigation.\n createEffect(\n () => props.children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n return (\n <title ref={(e) => (el = e)} {...props.attrs}>\n {props.children as string}\n </title>\n )\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation. The injection is\n // idempotent (it checks for an already-present matching script), so the\n // server-rendered script node is reused rather than duplicated.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;AAMA,IAAMO,4BAA4B;AAElC,SAAgBC,MAAMC,OAA6C;CACjE,MAAM,EAAEE,KAAKC,OAAOC,aAAaJ;CAEjC,QAAQE,KAAR;EACE,KAAK,SACH,QAAA,GAAA,aAAA,iBAAQI,OAAK;GAAQH;GAAiBC;EAAQ,CAAA;EAChD,KAAK,QACH,QAAA,GAAA,aAAA,iBAAQG,aAAW;GAACL,KAAG;GAAeC;EAAK,CAAA;EAC7C,KAAK,QACH,QAAA,GAAA,aAAA,iBAAQI,aAAW;GAACL,KAAG;GAAeC;EAAK,CAAA;EAC7C,KAAK;GACH,IACEH,MAAMQ,cACLC,QAAQC,IAAIC,2BAA2B,UACrCF,QAAQC,IAAIC,2BAA2BC,KAAAA,KAAarB,+BAAAA,WAEvD,QAAA,GAAA,aAAA,iBAAQsB,gBAAc;IAAQV;IAAQC;GAAQ,CAAA;GAGhD,QAAA,GAAA,aAAA,iBAAQG,aAAW;IAACL,KAAG;IAAgBC;IAAiBC;GAAQ,CAAA;EAClE,KAAK,UACH,QAAA,GAAA,aAAA,iBAAQU,QAAM;GAAQX;GAA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EA,cAAc2C,oBAAoB,OAAO;IAC/C,MAAMsB,QAAQjE,GAAGkE,aAAa,MAAM,KAAK;IACzC,MAAMC,SAASnE,GAAGkE,aAAa,OAAO,KAAKxE,KAAAA;IAC3C,OACEM,GAAGW,gBAAgBzB,YACnB+E,UAAUH,YACVK,WAAWJ;GAEf,CAEIZ,GACF;GAGFT,SAASxC,SAASsD,cAAc,QAAQ;GACxCd,OAAO/B,cAAczB;GAErB,IAAID;SACG,MAAM,CAAC4B,KAAK4C,UAAUC,OAAOC,QAAQ1E,KAAK,GAC7C,IAAIwE,UAAU/D,KAAAA,KAAa+D,UAAU,OACnCf,OAAOkB,aACL/C,KACA,OAAO4C,UAAU,YAAY,KAAKI,OAAOJ,KAAK,CAChD;GAAA;GAKNvD,SAASC,KAAKC,YAAYsC,MAAM;EAClC;EAEA,aAAa;GACX,IAAIA,QAAQzC,YACVyC,OAAOzC,WAAWI,YAAYqC,MAAM;EAExC;CACF,CACF;CAEA,OAAO;AACT"}
{"version":3,"file":"Asset.cjs","names":["<Title attrs={attrs} children={children} />","<HeadElement tag=\"meta\" attrs={attrs} />","tag=\"meta\"","<HeadElement tag=\"link\" attrs={attrs} />","tag=\"link\"","<InlineCssStyle attrs={attrs}>{children}</InlineCssStyle>","<HeadElement tag=\"style\" attrs={attrs} children={children} />","tag=\"style\"","<Script attrs={attrs} children={children} />","<HeadElement\n tag=\"style\"\n attrs={{ ...attrs, [INLINE_CSS_HYDRATION_ATTR]: '' }}\n children={html}\n />","children={html}","ref={(e) => (el = e)}","<title ref={(e) => (el = e)} {...props.attrs}>\n {props.children as string}\n </title>","<script {...attrs} />","innerHTML={children}","<script {...attrs} innerHTML={children} />"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect, onCleanup, onSettled } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst INLINE_CSS_HYDRATION_ATTR = 'data-tsr-inline-css'\n\nexport function Asset(asset: RouterManagedTag): JSX.Element | null {\n const { tag, attrs, children } = asset\n\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <HeadElement tag=\"meta\" attrs={attrs} />\n case 'link':\n return <HeadElement tag=\"link\" attrs={attrs} />\n case 'style':\n if (\n asset.inlineCss &&\n (process.env.TSS_INLINE_CSS_ENABLED === 'true' ||\n (process.env.TSS_INLINE_CSS_ENABLED === undefined && isServer))\n ) {\n return <InlineCssStyle attrs={attrs}>{children}</InlineCssStyle>\n }\n\n return <HeadElement tag=\"style\" attrs={attrs} children={children} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\n// On the client, relocate a rendered head element into document.head so head\n// tags end up in the right place even when <HeadContent /> is rendered in\n// <body>. The *same* node that Solid rendered/hydrated is moved — never\n// recreated — so the server-rendered node stays claimed (its hydration id is\n// preserved) and stylesheets/scripts are not refetched or re-executed.\n//\n// When <HeadContent /> is placed in <head> (the SSR/hydration case), the node\n// is already in document.head, so this is a no-op and the element is left\n// exactly where Solid hydrated it.\nfunction useRelocateToHead(getEl: () => Node | undefined) {\n onSettled(() => {\n const el = getEl()\n if (el && el.parentNode !== document.head) {\n document.head.appendChild(el)\n }\n })\n\n onCleanup(() => {\n const el = getEl()\n if (el?.parentNode) {\n el.parentNode.removeChild(el)\n }\n })\n}\n\nfunction InlineCssStyle({\n attrs,\n children,\n}: {\n attrs?: Record<string, any>\n children?: RouterManagedTag['children']\n}) {\n const isInlineCssPlaceholder = children === undefined\n const html = isInlineCssPlaceholder\n ? typeof document === 'undefined'\n ? ''\n : (document.querySelector<HTMLStyleElement>(\n `style[${INLINE_CSS_HYDRATION_ATTR}]`,\n )?.textContent ?? '')\n : (children ?? '')\n\n return (\n <HeadElement\n tag=\"style\"\n attrs={{ ...attrs, [INLINE_CSS_HYDRATION_ATTR]: '' }}\n children={html}\n />\n )\n}\n\ninterface ScriptAttrs {\n [key: string]: string | boolean | undefined\n src?: string\n}\n\nfunction HeadElement(props: {\n tag: 'meta' | 'link' | 'style'\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n // Each branch must live in its own `case` block so the Solid compiler emits\n // exactly ONE getNextElement() per invocation. Sequential `if ... return`\n // statements compile to multiple getNextElement() calls that all execute,\n // desyncing the hydration key counter (causing \"expected <style>\" mismatches\n // and unclaimed nodes).\n //\n // We capture the element via the JSX return value (a real DOM node in Solid)\n // rather than a `ref` attribute: a `ref` compiles to a _$ref() call that\n // interferes with attribute spreading on hydration-claimed nodes (wiping the\n // SSR attributes).\n let element: Element\n switch (props.tag) {\n case 'style': {\n const attrs = {\n ...props.attrs,\n innerHTML:\n typeof props.children === 'string' ? props.children : undefined,\n }\n element = (<style {...attrs} />) as unknown as Element\n break\n }\n case 'meta':\n element = (<meta {...props.attrs} />) as unknown as Element\n break\n default:\n element = (<link {...props.attrs} />) as unknown as Element\n }\n\n // Move the rendered/hydrated element into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>. Called unconditionally so\n // server and client register the same primitives (see Title).\n useRelocateToHead(() => element)\n\n return element as unknown as JSX.Element\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n let el: HTMLTitleElement | undefined\n\n // IMPORTANT: call these hooks UNCONDITIONALLY (do not guard with isServer).\n // Solid's hydration relies on the component body registering the same\n // reactive primitives in the same order on the server and the client. An\n // `if (!isServer)` guard would skip them on the server but run them on the\n // client, desyncing the hydration owner tree and causing the server <title>\n // to be left unclaimed (and a duplicate appended). These hooks are no-ops\n // during SSR anyway.\n\n // Move the rendered/hydrated <title> into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>.\n useRelocateToHead(() => el)\n\n // Keep document.title in sync during client-side navigation.\n createEffect(\n () => props.children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n return (\n <title ref={(e) => (el = e)} {...props.attrs}>\n {props.children as string}\n </title>\n )\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation. The injection is\n // idempotent (it checks for an already-present matching script), so the\n // server-rendered script node is reused rather than duplicated.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;;;;;AAMA,IAAM,4BAA4B;AAElC,SAAgB,MAAM,OAA6C;CACjE,MAAM,EAAE,KAAK,OAAO,aAAa;CAEjC,QAAQ,KAAR;EACE,KAAK,SACH,QAAA,GAAA,aAAA,iBAAOA,OAAAA;GAAc;GAAiB;GAAY;EACpD,KAAK,QACH,QAAA,GAAA,aAAA,iBAAOC,aAAAA;GAAaC,KAAI;GAAc;GAAS;EACjD,KAAK,QACH,QAAA,GAAA,aAAA,iBAAOC,aAAAA;GAAaC,KAAI;GAAc;GAAS;EACjD,KAAK;GACH,IACE,MAAM,cACL,QAAQ,IAAI,2BAA2B,UACrC,QAAQ,IAAI,2BAA2B,KAAA,KAAa,+BAAA,WAEvD,QAAA,GAAA,aAAA,iBAAOC,gBAAAA;IAAuB;IAAQ;IAA0B;GAGlE,QAAA,GAAA,aAAA,iBAAOC,aAAAA;IAAaC,KAAI;IAAe;IAAiB;IAAY;EACtE,KAAK,UACH,QAAA,GAAA,aAAA,iBAAOC,QAAAA;GAAe;GAAiB;GAAY;EACrD,SACE,OAAO;;;AAab,SAAS,kBAAkB,OAA+B;CACxD,CAAA,GAAA,SAAA,iBAAgB;EACd,MAAM,KAAK,MAAA;EACX,IAAI,MAAM,GAAG,eAAe,SAAS,MACnC,SAAS,KAAK,YAAY,EAAA;;CAI9B,CAAA,GAAA,SAAA,iBAAgB;EACd,MAAM,KAAK,MAAA;EACX,IAAI,IAAI,YACN,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MAAM,SAAS,GAAG,aAAa,OAAA,KAAY,KAAA;IAC3C,OACE,GAAG,gBAAgB,YACnB,UAAU,YACV,WAAW;IAIX,GACF;GAGF,SAAS,SAAS,cAAc,QAAA;GAChC,OAAO,cAAc;GAErB,IAAI;SACG,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAA,GACxC,IAAI,UAAU,KAAA,KAAa,UAAU,OACnC,OAAO,aACL,KACA,OAAO,UAAU,YAAY,KAAK,OAAO,KAAA,CAAM;GAAA;GAMvD,SAAS,KAAK,YAAY,MAAA;;EAG5B,aAAa;GACX,IAAI,QAAQ,YACV,OAAO,WAAW,YAAY,MAAA;;;CAMtC,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"awaited.cjs","names":["Solid","TSR_DEFERRED_PROMISE","defer","DeferredPromise","SolidNode","AwaitOptions","promise","Promise","T","useAwaited","_promise","data","createMemo","InnerAwait","props","deferred","ready","Accessor","children","res","state","status","error","Await","fallback","result","_$createComponent","Loading"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n const data = Solid.createMemo(async () => await promise)\n\n return [data(), promise]\n}\n\nfunction InnerAwait<T>(props: {\n deferred: DeferredPromise<T>\n ready: Solid.Accessor<unknown>\n children: (res: T) => SolidNode\n}) {\n props.ready()\n const state = props.deferred[TSR_DEFERRED_PROMISE]\n if (state.status === 'error') {\n throw state.error\n }\n return props.children(state.data as T) as any\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const deferred = defer(props.promise)\n const ready = Solid.createMemo(async () => {\n await deferred\n return true\n })\n\n return (\n <Solid.Loading fallback={props.fallback as any}>\n <InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>\n </Solid.Loading>\n )\n}\n"],"mappings":";;;;;;AAUA,SAAgBS,WAAc,EAC5BH,SAASI,YACkC;CAC3C,MAAMJ,WAAAA,GAAAA,sBAAAA,OAAgBI,QAAQ;CAG9B,OAAO,CAFMV,SAAMY,WAAW,YAAY,MAAMN,OAExCK,EAAK,GAAGL,OAAO;AACzB;AAEA,SAASO,WAAcC,OAIpB;CACDA,MAAME,MAAM;CACZ,MAAMI,QAAQN,MAAMC,SAASd,sBAAAA;CAC7B,IAAImB,MAAMC,WAAW,SACnB,MAAMD,MAAME;CAEd,OAAOR,MAAMI,SAASE,MAAMT,IAAS;AACvC;AAEA,SAAgBY,MACdT,OAIA;CACA,MAAMC,YAAAA,GAAAA,sBAAAA,OAAiBD,MAAMR,OAAO;CACpC,MAAMU,QAAQhB,SAAMY,WAAW,YAAY;EACzC,MAAMG;EACN,OAAO;CACT,CAAC;CAED,QAAA,GAAA,aAAA,iBACGf,SAAM2B,SAAO;EAAA,IAACH,WAAQ;GAAA,OAAEV,MAAMU;EAAe;EAAA,IAAAN,WAAA;GAAA,QAAA,GAAA,aAAA,iBAC3CL,YAAU;IAAWE;IAAiBC;IAAK,IAAAE,WAAA;KAAA,OACzCJ,MAAMI;IAAQ;GAAA,CAAA;EAAA;CAAA,CAAA;AAIvB"}
{"version":3,"file":"awaited.cjs","names":["<Solid.Loading fallback={props.fallback as any}>\n <InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>\n </Solid.Loading>","Solid.Loading","<InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n const data = Solid.createMemo(async () => await promise)\n\n return [data(), promise]\n}\n\nfunction InnerAwait<T>(props: {\n deferred: DeferredPromise<T>\n ready: Solid.Accessor<unknown>\n children: (res: T) => SolidNode\n}) {\n props.ready()\n const state = props.deferred[TSR_DEFERRED_PROMISE]\n if (state.status === 'error') {\n throw state.error\n }\n return props.children(state.data as T) as any\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const deferred = defer(props.promise)\n const ready = Solid.createMemo(async () => {\n await deferred\n return true\n })\n\n return (\n <Solid.Loading fallback={props.fallback as any}>\n <InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>\n </Solid.Loading>\n )\n}\n"],"mappings":";;;;;;AAUA,SAAgB,WAAc,EAC5B,SAAS,YACkC;CAC3C,MAAM,WAAA,GAAA,sBAAA,OAAgB,QAAA;CAGtB,OAAO,CAFM,SAAM,WAAW,YAAY,MAAM,OAExC,EAAA,GAAQ,OAAA;;AAGlB,SAAS,WAAc,OAIpB;CACD,MAAM,MAAA;CACN,MAAM,QAAQ,MAAM,SAAS,sBAAA;CAC7B,IAAI,MAAM,WAAW,SACnB,MAAM,MAAM;CAEd,OAAO,MAAM,SAAS,MAAM,IAAQ;;AAGtC,SAAgB,MACd,OAIA;CACA,MAAM,YAAA,GAAA,sBAAA,OAAiB,MAAM,OAAA;CAC7B,MAAM,QAAQ,SAAM,WAAW,YAAY;EACzC,MAAM;EACN,OAAO;;CAGT,QAAA,GAAA,aAAA,iBACEA,SAACC,SAAD;EAAe,IAAA,WAAA;UAAU,MAAM;;EAA/B,IAAA,WAAA;4CACEC,YAAAA;IAAsB;IAAiB;IAAvC,IAAA,WAAA;YACG,MAAM;;IACI;;EACC"}

@@ -6,3 +6,5 @@ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");

//#region src/CatchBoundary.tsx
var _tmpl$ = /* @__PURE__ */ (0, _solidjs_web.template)(`<div style=padding:.5rem;max-width:100%><div style=display:flex;align-items:center;gap:.5rem>∂<strong style=font-size:1rem>Something went wrong!</strong><button style="appearance:none;font-size:.6em;border:1px solid currentColor;padding:.1rem .2rem;font-weight:bold;border-radius:.25rem"></button></div><div style=height:.25rem>`), _tmpl$2 = /* @__PURE__ */ (0, _solidjs_web.template)(`<div><pre style="font-size:.7em;border:1px solid red;border-radius:.25rem;padding:.3rem;color:red;overflow:auto">`), _tmpl$3 = /* @__PURE__ */ (0, _solidjs_web.template)(`<code>`);
var _tmpl$ = /* @__PURE__ */ (0, _solidjs_web.template)(`<div style=padding:.5rem;max-width:100%><div style=display:flex;align-items:center;gap:.5rem>∂<strong style=font-size:1rem>Something went wrong!</strong><button style="appearance:none;font-size:.6em;border:1px solid currentColor;padding:.1rem .2rem;font-weight:bold;border-radius:.25rem"></button></div><div style=height:.25rem>`);
var _tmpl$2 = /* @__PURE__ */ (0, _solidjs_web.template)(`<div><pre style="font-size:.7em;border:1px solid red;border-radius:.25rem;padding:.3rem;color:red;overflow:auto">`);
var _tmpl$3 = /* @__PURE__ */ (0, _solidjs_web.template)(`<code>`);
function CatchBoundary(props) {

@@ -31,20 +33,35 @@ return (0, _solidjs_web.createComponent)(solid_js.Errored, {

const [show, setShow] = solid_js.createSignal(process.env.NODE_ENV !== "production");
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$5 = _el$2.firstChild.nextSibling.nextSibling;
var _el$ = _tmpl$();
var _el$2 = _el$.firstChild;
var _el$5 = _el$2.firstChild.nextSibling.nextSibling;
_el$2.nextSibling;
_el$5.$$click = () => setShow((d) => !d);
(0, _solidjs_web.insert)(_el$5, () => show() ? "Hide Error" : "Show Error");
(0, _solidjs_web.insert)(_el$5, () => {
return show() ? "Hide Error" : "Show Error";
});
(0, _solidjs_web.insert)(_el$, (() => {
var _c$ = (0, _solidjs_web.memo)(() => !!show());
return () => _c$() ? (() => {
var _el$7 = _tmpl$2(), _el$8 = _el$7.firstChild;
(0, _solidjs_web.insert)(_el$8, (() => {
var _c$2 = (0, _solidjs_web.memo)(() => !!error.message);
return () => _c$2() ? (() => {
var _el$9 = _tmpl$3();
(0, _solidjs_web.insert)(_el$9, () => error.message);
return _el$9;
})() : null;
})());
return _el$7;
})() : null;
var _c$ = (0, _solidjs_web.memo)(() => {
return !!show();
});
return () => {
return _c$() ? (() => {
var _el$7 = _tmpl$2();
var _el$8 = _el$7.firstChild;
(0, _solidjs_web.insert)(_el$8, (() => {
var _c$2 = (0, _solidjs_web.memo)(() => {
return !!error.message;
});
return () => {
return _c$2() ? (() => {
var _el$9 = _tmpl$3();
(0, _solidjs_web.insert)(_el$9, () => {
return error.message;
});
return _el$9;
})() : null;
};
})());
return _el$7;
})() : null;
};
})(), null);

@@ -51,0 +68,0 @@ return _el$;

@@ -1,1 +0,1 @@

{"version":3,"file":"CatchBoundary.cjs","names":["Solid","Dynamic","ErrorRouteComponent","JSX","CatchBoundary","props","getResetKey","children","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","Errored","fallback","reset","resolvedError","untrack","createEffect","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","$$click","d","_$insert","_c$","_$memo","_el$7","_tmpl$2","_el$8","_c$2","message","_el$9","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\nimport type { JSX } from '@solidjs/web'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;AAKA,SAAgBI,cACdC,OAMA;CACA,QAAA,GAAA,aAAA,iBACGL,SAAMe,SAAO;EACZC,WAAWL,OAAOM,UAAU;GAC1B,MAAMC,gBAAgBlB,SAAMmB,cAAcR,MAAM,CAAU;GAE1DN,MAAMK,UAAUQ,aAAa;GAE7BlB,SAAMoB,aAAaf,MAAMC,mBAAmB;IAG1CW,MAAM;GACR,CAAC;GAED,QAAA,GAAA,aAAA,iBACGhB,aAAAA,SAAO;IAAA,IACNoB,YAAS;KAAA,OAAEhB,MAAMI,kBAAkBa;IAAc;IACjDX,OAAOO;IACAD;GAAK,CAAA;EAGlB;EAAC,IAAAV,WAAA;GAAA,OAEAF,MAAME;EAAQ;CAAA,CAAA;AAGrB;AAEA,SAAgBe,eAAe,EAAEX,SAAyB;CACxD,MAAM,CAACY,MAAMC,WAAWxB,SAAMyB,aAAAA,QAAAA,IAAAA,aACH,YAC3B;CAAC,IAAAI,OAAAC,OAAA,GAAAC,QAAAF,KAAAG,YAAAI,QAAAL,MAAAC,WAAAG,YAAAA;CAAAJ,MAAAI;CAAAC,MAAAE,gBAesBd,SAASe,MAAM,CAACA,CAAC;CAACC,CAAAA,GAAAA,aAAAA,QAAAJ,aAEhCb,KAAK,IAAI,eAAe,YAAY;CAAAiB,CAAAA,GAAAA,aAAAA,QAAAX,aAAA;EAAA,IAAAY,OAAAA,GAAAA,aAAAA,YAAA,CAAA,CAIxClB,KAAK,CAAC;EAAA,aAANkB,IAAA,WAAA;GAAA,IAAAE,QAAAC,QAAA,GAAAC,QAAAF,MAAAX;GAAAQ,CAAAA,GAAAA,aAAAA,QAAAK,cAAA;IAAA,IAAAC,QAAAA,GAAAA,aAAAA,YAAA,CAAA,CAYMnC,MAAMoC,OAAO;IAAA,aAAbD,KAAA,WAAA;KAAA,IAAAE,QAAAC,QAAA;KAAAT,CAAAA,GAAAA,aAAAA,QAAAQ,aAAuBrC,MAAMoC,OAAO;KAAA,OAAAC;IAAA,GAAA,IAAW;GAAI,GAAA,CAAA;GAAA,OAAAL;EAAA,GAAA,IAGtD;CAAI,GAAA,GAAA,IAAA;CAlCZ,OAAAd;AAqCF;iCAAC,CAAA,OAAA,CAAA"}
{"version":3,"file":"CatchBoundary.cjs","names":["<Solid.Errored\n fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>","Solid.Errored","fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}","<Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />","error={resolvedError}","<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>","<div style={{ height: '.25rem' }} />","<div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\nimport type { JSX } from '@solidjs/web'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAKA,SAAgB,cACd,OAMA;CACA,QAAA,GAAA,aAAA,iBACEA,SAACC,SAAD;EACEC,WAAW,OAAO,UAAU;GAC1B,MAAM,gBAAgB,SAAM,cAAc,MAAA,CAAW;GAErD,MAAM,UAAU,aAAA;GAEhB,SAAM,aAAa,MAAM,mBAAmB;IAG1C,MAAA;;GAGF,QAAA,GAAA,aAAA,iBACEC,aAAAA,SAAAA;IACE,IAAA,YAAA;YAAW,MAAM,kBAAkB;;IACnCC,OAAO;IACA;IACP;;EAjBR,IAAA,WAAA;UAqBG,MAAM;;EACO;;AAIpB,SAAgB,eAAe,EAAE,SAAyB;CACxD,MAAM,CAAC,MAAM,WAAW,SAAM,aAAA,QAAA,IAAA,aACH,YAAA;CAIzB,IAAA,OAAA,OAAA;CACE,IAAA,QAAA,KAAA;CAEE,IAAA,QAAA,MAAA,WADCC,YACD;CAcFC,MAAAA;CALI,MAAA,gBAAe,SAAS,MAAM,CAAC,CAAA;CATjC,CAAA,GAAA,aAAA,QAAA,aAWE;SAAC,KAAA,IAAS,eAAe;;CAd/B,CAAA,GAAA,aAAA,QAAA,aAkBE;;YAAC,KAAA;;EAAD,aAAA;yBACE;;IACE,IAAA,QAAA,MAAA;2CAUE;;eAAC,MAAM;;KAAP,aAAA;6BAAiB;;OAAA,CAAA,GAAA,aAAA,QAAA,aAAM;eAAC,MAAM;;OAAb,OAAA;aAA+B;;QAAK;IAXzD,OAAA;UAcE;;OAjCN,IAAA;CADF,OACEC"}

@@ -33,3 +33,3 @@ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");

get children() {
return (0, _solidjs_web.memo)(() => props.children);
return props.children;
}

@@ -36,0 +36,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"ClientOnly.cjs","names":["Solid","JSX","ClientOnlyProps","children","Element","fallback","ClientOnly","props","hydrated","useHydrated","_$createComponent","Show","when","_$memo","globalHydrated","Accessor","setHydrated","createSignal","createEffect"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { JSX } from '@solidjs/web'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n <>{props.children}</>\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nlet globalHydrated = false\n\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(globalHydrated)\n\n Solid.createEffect(\n () => true,\n () => {\n globalHydrated = true\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgBM,WAAWC,OAAwB;CACjD,MAAMC,WAAWC,YAAY;CAC7B,QAAA,GAAA,aAAA,iBACGT,SAAMW,MAAI;EAAA,IAACC,OAAI;GAAA,OAAEJ,SAAS;EAAC;EAAA,IAAEH,WAAQ;GAAA,OAAEE,MAAMF,YAAY;EAAI;EAAA,IAAAF,WAAA;GAAA,QAAA,GAAA,aAAA,YACzDI,MAAMJ,QAAQ;EAAA;CAAA,CAAA;AAGvB;;;;;;;;;;;;;;;;;;;;AAqBA,IAAIW,iBAAiB;AAErB,SAAgBL,cAAuC;CACrD,MAAM,CAACD,UAAUQ,eAAehB,SAAMiB,aAAaH,cAAc;CAEjEd,SAAMkB,mBACE,YACA;EACJJ,iBAAiB;EACjBE,YAAY,IAAI;CAClB,CACF;CAEA,OAAOR;AACT"}
{"version":3,"file":"ClientOnly.cjs","names":["<Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n {props.children}\n </Solid.Show>","Solid.Show"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { JSX } from '@solidjs/web'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n {props.children}\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nlet globalHydrated = false\n\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(globalHydrated)\n\n Solid.createEffect(\n () => true,\n () => {\n globalHydrated = true\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,WAAW,OAAwB;CACjD,MAAM,WAAW,YAAA;CACjB,QAAA,GAAA,aAAA,iBACEA,SAACC,MAAD;EAAY,IAAA,OAAA;UAAM,SAAA;;EAAY,IAAA,WAAA;UAAU,MAAM,YAAY;;EAA1D,IAAA,WAAA;UACG,MAAM;;EACI;;;;;;;;;;;;;;;;;;;;;AAuBjB,IAAI,iBAAiB;AAErB,SAAgB,cAAuC;CACrD,MAAM,CAAC,UAAU,eAAe,SAAM,aAAa,cAAA;CAEnD,SAAM,mBACE,YACA;EACJ,iBAAiB;EACjB,YAAY,IAAA;;CAIhB,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"HeadContent.cjs","names":["For","HydrationScript","Asset","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","_$createComponent","each","children","tag","t","attrs"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * Place this component inside the `<head>` of your document so the rendered tags end up in the right place.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n\n return (\n <>\n <HydrationScript />\n <For each={tags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgBO,YAAYC,OAAyB;CACnD,MAAMC,OAAON,yBAAAA,QAAQK,MAAMF,gBAAgB;CAE3C,OAAA,EAAA,GAAA,aAAA,iBAEKL,aAAAA,iBAAe,CAAA,CAAA,IAAA,GAAA,aAAA,iBACfD,SAAAA,KAAG;EAAA,IAACW,OAAI;GAAA,OAAEF,KAAK;EAAC;EAAAG,WACbC,QAAQ;GACR,MAAMC,IAAID;GACV,QAAA,GAAA,aAAA,iBAAQX,cAAAA,OAAK;IAAA,IAACW,MAAG;KAAA,OAAEC,EAAED;IAAG;IAAA,IAAEE,QAAK;KAAA,OAAED,EAAEC;IAAK;IAAA,IAAEH,WAAQ;KAAA,OAAEE,EAAEF;IAAQ;GAAA,CAAA;EAChE;CAAC,CAAA,CAAA;AAIT"}
{"version":3,"file":"HeadContent.cjs","names":["<HydrationScript />","<For each={tags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>","<Asset tag={t.tag} attrs={t.attrs} children={t.children} />"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * Place this component inside the `<head>` of your document so the rendered tags end up in the right place.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n\n return (\n <>\n <HydrationScript />\n <For each={tags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,YAAY,OAAyB;CACnD,MAAM,OAAO,yBAAA,QAAQ,MAAM,gBAAA;CAE3B,OACI,EAAA,GAAA,aAAA,iBACAA,aAAAA,iBAAAA,CAAAA,CAAmB,IAAA,GAAA,aAAA,iBACnBC,SAAAA,KAAAA;EAAK,IAAA,OAAA;UAAM,KAAA;;EAAXA,WACI,QAAQ;GACR,MAAM,IAAI;GACV,QAAA,GAAA,aAAA,iBAAOC,cAAAA,OAAAA;IAAO,IAAA,MAAA;YAAK,EAAE;;IAAK,IAAA,QAAA;YAAO,EAAE;;IAAO,IAAA,WAAA;YAAU,EAAE;;IAAY;;EAEhE,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"HeadContent.dev.cjs","names":["For","createEffect","createMemo","HydrationScript","DEV_STYLES_ATTR","Asset","useHydrated","useTags","HeadContentProps","HeadContent","props","tags","assetCrossOrigin","hydrated","const","document","querySelectorAll","forEach","el","remove","filteredTags","filter","tag","attrs","_$createComponent","each","children","t"],"sources":["../../src/HeadContent.dev.tsx"],"sourcesContent":["import { For, createEffect, createMemo } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { DEV_STYLES_ATTR } from '@tanstack/router-core'\nimport { Asset } from './Asset'\nimport { useHydrated } from './ClientOnly'\nimport { useTags } from './headContentUtils'\nimport type { HeadContentProps } from './HeadContent'\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n *\n * Development version: filters out dev styles link after hydration and\n * includes a fallback cleanup effect for hydration mismatch cases.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const hydrated = useHydrated()\n\n // Fallback cleanup for hydration mismatch cases\n // Runs when hydration completes to remove any orphaned dev styles links from DOM\n createEffect(\n () => [hydrated()] as const,\n ([hydrated]) => {\n if (hydrated) {\n document\n .querySelectorAll(`link[${DEV_STYLES_ATTR}]`)\n .forEach((el) => el.remove())\n }\n },\n )\n\n // Filter out dev styles after hydration\n const filteredTags = createMemo(() => {\n if (hydrated()) {\n return tags().filter(\n (tag) => tag.tag !== 'link' || tag.attrs?.[DEV_STYLES_ATTR] !== true,\n )\n }\n return tags()\n })\n\n return (\n <>\n <HydrationScript />\n <For each={filteredTags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgBS,YAAYC,OAAyB;CACnD,MAAMC,OAAOJ,yBAAAA,QAAQG,MAAME,gBAAgB;CAC3C,MAAMC,WAAWP,mBAAAA,YAAY;CAI7BL,CAAAA,GAAAA,SAAAA,oBACQ,CAACY,SAAS,CAAC,IAChB,CAACA,cAAc;EACd,IAAIA,UACFE,SACGC,iBAAiB,QAAQZ,sBAAAA,gBAAe,EAAG,EAC3Ca,SAASC,OAAOA,GAAGC,OAAO,CAAC;CAElC,CACF;CAGA,MAAMC,gBAAAA,GAAAA,SAAAA,kBAAgC;EACpC,IAAIP,SAAS,GACX,OAAOF,KAAK,EAAEU,QACXC,QAAQA,IAAIA,QAAQ,UAAUA,IAAIC,QAAQnB,sBAAAA,qBAAqB,IAClE;EAEF,OAAOO,KAAK;CACd,CAAC;CAED,OAAA,EAAA,GAAA,aAAA,iBAEKR,aAAAA,iBAAe,CAAA,CAAA,IAAA,GAAA,aAAA,iBACfH,SAAAA,KAAG;EAAA,IAACyB,OAAI;GAAA,OAAEL,aAAa;EAAC;EAAAM,WACrBJ,QAAQ;GACR,MAAMK,IAAIL;GACV,QAAA,GAAA,aAAA,iBAAQjB,cAAAA,OAAK;IAAA,IAACiB,MAAG;KAAA,OAAEK,EAAEL;IAAG;IAAA,IAAEC,QAAK;KAAA,OAAEI,EAAEJ;IAAK;IAAA,IAAEG,WAAQ;KAAA,OAAEC,EAAED;IAAQ;GAAA,CAAA;EAChE;CAAC,CAAA,CAAA;AAIT"}
{"version":3,"file":"HeadContent.dev.cjs","names":["<HydrationScript />","<For each={filteredTags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>","<Asset tag={t.tag} attrs={t.attrs} children={t.children} />"],"sources":["../../src/HeadContent.dev.tsx"],"sourcesContent":["import { For, createEffect, createMemo } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { DEV_STYLES_ATTR } from '@tanstack/router-core'\nimport { Asset } from './Asset'\nimport { useHydrated } from './ClientOnly'\nimport { useTags } from './headContentUtils'\nimport type { HeadContentProps } from './HeadContent'\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n *\n * Development version: filters out dev styles link after hydration and\n * includes a fallback cleanup effect for hydration mismatch cases.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const hydrated = useHydrated()\n\n // Fallback cleanup for hydration mismatch cases\n // Runs when hydration completes to remove any orphaned dev styles links from DOM\n createEffect(\n () => [hydrated()] as const,\n ([hydrated]) => {\n if (hydrated) {\n document\n .querySelectorAll(`link[${DEV_STYLES_ATTR}]`)\n .forEach((el) => el.remove())\n }\n },\n )\n\n // Filter out dev styles after hydration\n const filteredTags = createMemo(() => {\n if (hydrated()) {\n return tags().filter(\n (tag) => tag.tag !== 'link' || tag.attrs?.[DEV_STYLES_ATTR] !== true,\n )\n }\n return tags()\n })\n\n return (\n <>\n <HydrationScript />\n <For each={filteredTags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,YAAY,OAAyB;CACnD,MAAM,OAAO,yBAAA,QAAQ,MAAM,gBAAA;CAC3B,MAAM,WAAW,mBAAA,YAAA;CAIjB,CAAA,GAAA,SAAA,oBACQ,CAAC,SAAA,CAAU,IAChB,CAAC,cAAc;EACd,IAAI,UACF,SACG,iBAAiB,QAAQ,sBAAA,gBAAgB,EAAA,EACzC,SAAS,OAAO,GAAG,OAAA,CAAQ;;CAMpC,MAAM,gBAAA,GAAA,SAAA,kBAAgC;EACpC,IAAI,SAAA,GACF,OAAO,KAAA,EAAO,QACX,QAAQ,IAAI,QAAQ,UAAU,IAAI,QAAQ,sBAAA,qBAAqB,IAAA;EAGpE,OAAO,KAAA;;CAGT,OACI,EAAA,GAAA,aAAA,iBACAA,aAAAA,iBAAAA,CAAAA,CAAmB,IAAA,GAAA,aAAA,iBACnBC,SAAAA,KAAAA;EAAK,IAAA,OAAA;UAAM,aAAA;;EAAXA,WACI,QAAQ;GACR,MAAM,IAAI;GACV,QAAA,GAAA,aAAA,iBAAOC,cAAAA,OAAAA;IAAO,IAAA,MAAA;YAAK,EAAE;;IAAK,IAAA,QAAA;YAAO,EAAE;;IAAO,IAAA,WAAA;YAAU,EAAE;;IAAY;;EAEhE,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"headContentUtils.cjs","names":["Solid","appendUniqueUserTags","escapeHtml","getAssetCrossOrigin","getScriptPreloadAttrs","resolveManifestCssLink","useRouter","AssetCrossOriginConfig","RouterManagedTag","useTags","assetCrossOrigin","router","nonce","options","ssr","activeMatches","createMemo","stores","matches","get","routeMeta","map","match","meta","filter","undefined","Accessor","Array","resultMeta","metaByAttribute","Record","title","routeMetasArray","i","length","metas","j","m","tag","children","json","JSON","stringify","push","attrs","type","attribute","name","property","content","reverse","links","constructed","flatMap","link","retainedManifestCssTags","Map","manifestCssTags","manifest","tags","routes","routeId","css","forEach","resolvedLink","rel","crossOrigin","key","has","set","values","inlineStyle","inlineCss","preloadLinks","preloads","Boolean","preload","styles","style","headScripts","script","prev","next","replaceEqualTags","prevByKey","isEqual","result","index","existing"],"sources":["../../src/headContentUtils.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n appendUniqueUserTags,\n escapeHtml,\n getAssetCrossOrigin,\n getScriptPreloadAttrs,\n resolveManifestCssLink,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AssetCrossOriginConfig,\n RouterManagedTag,\n} from '@tanstack/router-core'\n\n/**\n * Build the list of head/link/meta/script tags to render for active matches.\n * Used internally by `HeadContent`.\n */\nexport const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const routeMeta = Solid.createMemo(() =>\n activeMatches()\n .map((match) => match.meta)\n .filter((meta) => meta !== undefined),\n )\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else if ('script:ld+json' in m) {\n // Handle JSON-LD structured data\n // Content is HTML-escaped to prevent XSS when injected via innerHTML\n try {\n const json = JSON.stringify(m['script:ld+json'])\n resultMeta.push({\n tag: 'script',\n attrs: {\n type: 'application/ld+json',\n },\n children: escapeHtml(json),\n })\n } catch {\n // Skip invalid JSON-LD objects\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n nonce,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n if (router.options.ssr?.nonce) {\n resultMeta.push({\n tag: 'meta',\n attrs: {\n property: 'csp-nonce',\n content: router.options.ssr.nonce,\n },\n })\n }\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = Solid.createMemo(() => {\n const matches = activeMatches()\n const constructed = matches\n .flatMap((match) => match.links ?? [])\n .filter((link) => link !== undefined)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n nonce,\n },\n })) satisfies Array<RouterManagedTag>\n\n return constructed\n })\n\n const retainedManifestCssTags = new Map<string, RouterManagedTag>()\n const manifestCssTags = Solid.createMemo(() => {\n const manifest = router.ssr?.manifest\n const tags: Array<RouterManagedTag> = []\n\n if (!manifest) {\n return tags\n }\n\n for (const match of activeMatches()) {\n manifest.routes[match.routeId]?.css?.forEach((link) => {\n const resolvedLink = resolveManifestCssLink(link)\n const tag: RouterManagedTag = {\n tag: 'link',\n attrs: {\n rel: 'stylesheet',\n ...resolvedLink,\n crossOrigin:\n getAssetCrossOrigin(assetCrossOrigin, 'stylesheet') ??\n resolvedLink.crossOrigin,\n nonce,\n },\n }\n const key = JSON.stringify(tag)\n if (!retainedManifestCssTags.has(key)) {\n retainedManifestCssTags.set(key, tag)\n }\n })\n }\n\n // Lazy modules are cached and do not reinsert their CSS when revisited.\n tags.push(...retainedManifestCssTags.values())\n\n if (manifest.inlineStyle) {\n tags.push({\n tag: 'style',\n attrs: {\n ...manifest.inlineStyle.attrs,\n nonce,\n },\n children: manifest.inlineStyle.children,\n inlineCss: true,\n })\n }\n\n return tags\n })\n\n const preloadLinks = Solid.createMemo(() => {\n const matches = activeMatches()\n const preloadLinks: Array<RouterManagedTag> = []\n\n matches.forEach((match) =>\n router.ssr?.manifest?.routes[match.routeId]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadLinks.push({\n tag: 'link',\n attrs: {\n ...getScriptPreloadAttrs(\n router.ssr?.manifest,\n preload,\n assetCrossOrigin,\n ),\n nonce,\n },\n })\n }),\n )\n\n return preloadLinks\n })\n\n const styles = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.styles ?? [])\n .filter((style) => style !== undefined)\n .map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n const headScripts = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.headScripts ?? [])\n .filter((script) => script !== undefined)\n .map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n // Cache tag objects by key across renders so that unchanged tags keep a\n // stable object identity. `<For>` keys by reference, so reusing the previous\n // object for an unchanged tag lets it reconcile the existing DOM node in\n // place instead of remounting it. Remounting head nodes on navigation\n // detaches/re-fetches stylesheets (e.g. the app stylesheet), causing a FOUC.\n return Solid.createMemo((prev: Array<RouterManagedTag> | undefined) => {\n const next: Array<RouterManagedTag> = []\n appendUniqueUserTags(next, meta())\n appendUniqueUserTags(next, links())\n next.push(...manifestCssTags())\n next.push(...preloadLinks())\n appendUniqueUserTags(next, styles())\n appendUniqueUserTags(next, headScripts())\n\n if (prev === undefined) {\n return next\n }\n return replaceEqualTags(prev, next)\n })\n}\n\nfunction replaceEqualTags(\n prev: Array<RouterManagedTag>,\n next: Array<RouterManagedTag>,\n) {\n const prevByKey = new Map<string, RouterManagedTag>()\n for (const tag of prev) {\n prevByKey.set(JSON.stringify(tag), tag)\n }\n\n let isEqual = prev.length === next.length\n const result = next.map((tag, index) => {\n const existing = prevByKey.get(JSON.stringify(tag))\n if (existing) {\n if (existing !== prev[index]) {\n isEqual = false\n }\n return existing\n }\n\n isEqual = false\n return tag\n })\n\n return isEqual ? prev : result\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAaS,WAAWC,qBAA8C;CACpE,MAAMC,SAASL,kBAAAA,UAAU;CACzB,MAAMM,QAAQD,OAAOE,QAAQC,KAAKF;CAClC,MAAMG,gBAAgBf,SAAMgB,iBAAiBL,OAAOM,OAAOC,QAAQC,IAAI,CAAC;CACxE,MAAMC,YAAYpB,SAAMgB,iBACtBD,cAAc,EACXM,KAAKC,UAAUA,MAAMC,IAAI,EACzBC,QAAQD,SAASA,SAASE,KAAAA,CAAS,CACxC;CAEA,MAAMF,OAAgDvB,SAAMgB,iBAAiB;EAC3E,MAAMY,aAAsC,CAAA;EAC5C,MAAMC,kBAAwC,CAAC;EAC/C,IAAIE;EACJ,MAAMC,kBAAkBZ,UAAU;EAClC,KAAK,IAAIa,IAAID,gBAAgBE,SAAS,GAAGD,KAAK,GAAGA,KAAK;GACpD,MAAME,QAAQH,gBAAgBC;GAC9B,KAAK,IAAIG,IAAID,MAAMD,SAAS,GAAGE,KAAK,GAAGA,KAAK;IAC1C,MAAMC,IAAIF,MAAMC;IAChB,IAAI,CAACC,GAAG;IAER,IAAIA,EAAEN;SACA,CAACA,OACHA,QAAQ;MACNO,KAAK;MACLC,UAAUF,EAAEN;KACd;IAAA,OAEG,IAAI,oBAAoBM,GAG7B,IAAI;KACF,MAAMG,OAAOC,KAAKC,UAAUL,EAAE,iBAA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,CAAE,EAC1CvD,QAAQwD,WAAWA,WAAWvD,KAAAA,CAAS,EACvCJ,KAAK,EAAEkB,UAAU,GAAGyC,cAAc;GACjC1C,KAAK;GACLM,OAAO;IACL,GAAGoC;IACHpE;GACF;GACU2B;EACZ,EAAE;CACN,CAAC;CAOD,OAAOvC,SAAMgB,YAAYiE,SAA8C;EACrE,MAAMC,OAAgC,CAAA;EACtCjF,CAAAA,GAAAA,sBAAAA,sBAAqBiF,MAAM3D,KAAK,CAAC;EACjCtB,CAAAA,GAAAA,sBAAAA,sBAAqBiF,MAAM/B,MAAM,CAAC;EAClC+B,KAAKvC,KAAK,GAAGc,gBAAgB,CAAC;EAC9ByB,KAAKvC,KAAK,GAAG8B,aAAa,CAAC;EAC3BxE,CAAAA,GAAAA,sBAAAA,sBAAqBiF,MAAML,OAAO,CAAC;EACnC5E,CAAAA,GAAAA,sBAAAA,sBAAqBiF,MAAMH,YAAY,CAAC;EAExC,IAAIE,SAASxD,KAAAA,GACX,OAAOyD;EAET,OAAOC,iBAAiBF,MAAMC,IAAI;CACpC,CAAC;AACH;AAEA,SAASC,iBACPF,MACAC,MACA;CACA,MAAME,4BAAY,IAAI5B,IAA8B;CACpD,KAAK,MAAMlB,OAAO2C,MAChBG,UAAUf,IAAI5B,KAAKC,UAAUJ,GAAG,GAAGA,GAAG;CAGxC,IAAI+C,UAAUJ,KAAK/C,WAAWgD,KAAKhD;CACnC,MAAMoD,SAASJ,KAAK7D,KAAKiB,KAAKiD,UAAU;EACtC,MAAMC,WAAWJ,UAAUjE,IAAIsB,KAAKC,UAAUJ,GAAG,CAAC;EAClD,IAAIkD,UAAU;GACZ,IAAIA,aAAaP,KAAKM,QACpBF,UAAU;GAEZ,OAAOG;EACT;EAEAH,UAAU;EACV,OAAO/C;CACT,CAAC;CAED,OAAO+C,UAAUJ,OAAOK;AAC1B"}
{"version":3,"file":"headContentUtils.cjs","names":[],"sources":["../../src/headContentUtils.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n appendUniqueUserTags,\n escapeHtml,\n getAssetCrossOrigin,\n getScriptPreloadAttrs,\n resolveManifestCssLink,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AssetCrossOriginConfig,\n RouterManagedTag,\n} from '@tanstack/router-core'\n\n/**\n * Build the list of head/link/meta/script tags to render for active matches.\n * Used internally by `HeadContent`.\n */\nexport const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const routeMeta = Solid.createMemo(() =>\n activeMatches()\n .map((match) => match.meta)\n .filter((meta) => meta !== undefined),\n )\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else if ('script:ld+json' in m) {\n // Handle JSON-LD structured data\n // Content is HTML-escaped to prevent XSS when injected via innerHTML\n try {\n const json = JSON.stringify(m['script:ld+json'])\n resultMeta.push({\n tag: 'script',\n attrs: {\n type: 'application/ld+json',\n },\n children: escapeHtml(json),\n })\n } catch {\n // Skip invalid JSON-LD objects\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n nonce,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n if (router.options.ssr?.nonce) {\n resultMeta.push({\n tag: 'meta',\n attrs: {\n property: 'csp-nonce',\n content: router.options.ssr.nonce,\n },\n })\n }\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = Solid.createMemo(() => {\n const matches = activeMatches()\n const constructed = matches\n .flatMap((match) => match.links ?? [])\n .filter((link) => link !== undefined)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n nonce,\n },\n })) satisfies Array<RouterManagedTag>\n\n return constructed\n })\n\n const retainedManifestCssTags = new Map<string, RouterManagedTag>()\n const manifestCssTags = Solid.createMemo(() => {\n const manifest = router.ssr?.manifest\n const tags: Array<RouterManagedTag> = []\n\n if (!manifest) {\n return tags\n }\n\n for (const match of activeMatches()) {\n manifest.routes[match.routeId]?.css?.forEach((link) => {\n const resolvedLink = resolveManifestCssLink(link)\n const tag: RouterManagedTag = {\n tag: 'link',\n attrs: {\n rel: 'stylesheet',\n ...resolvedLink,\n crossOrigin:\n getAssetCrossOrigin(assetCrossOrigin, 'stylesheet') ??\n resolvedLink.crossOrigin,\n nonce,\n },\n }\n const key = JSON.stringify(tag)\n if (!retainedManifestCssTags.has(key)) {\n retainedManifestCssTags.set(key, tag)\n }\n })\n }\n\n // Lazy modules are cached and do not reinsert their CSS when revisited.\n tags.push(...retainedManifestCssTags.values())\n\n if (manifest.inlineStyle) {\n tags.push({\n tag: 'style',\n attrs: {\n ...manifest.inlineStyle.attrs,\n nonce,\n },\n children: manifest.inlineStyle.children,\n inlineCss: true,\n })\n }\n\n return tags\n })\n\n const preloadLinks = Solid.createMemo(() => {\n const matches = activeMatches()\n const preloadLinks: Array<RouterManagedTag> = []\n\n matches.forEach((match) =>\n router.ssr?.manifest?.routes[match.routeId]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadLinks.push({\n tag: 'link',\n attrs: {\n ...getScriptPreloadAttrs(\n router.ssr?.manifest,\n preload,\n assetCrossOrigin,\n ),\n nonce,\n },\n })\n }),\n )\n\n return preloadLinks\n })\n\n const styles = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.styles ?? [])\n .filter((style) => style !== undefined)\n .map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n const headScripts = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.headScripts ?? [])\n .filter((script) => script !== undefined)\n .map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n // Cache tag objects by key across renders so that unchanged tags keep a\n // stable object identity. `<For>` keys by reference, so reusing the previous\n // object for an unchanged tag lets it reconcile the existing DOM node in\n // place instead of remounting it. Remounting head nodes on navigation\n // detaches/re-fetches stylesheets (e.g. the app stylesheet), causing a FOUC.\n return Solid.createMemo((prev: Array<RouterManagedTag> | undefined) => {\n const next: Array<RouterManagedTag> = []\n appendUniqueUserTags(next, meta())\n appendUniqueUserTags(next, links())\n next.push(...manifestCssTags())\n next.push(...preloadLinks())\n appendUniqueUserTags(next, styles())\n appendUniqueUserTags(next, headScripts())\n\n if (prev === undefined) {\n return next\n }\n return replaceEqualTags(prev, next)\n })\n}\n\nfunction replaceEqualTags(\n prev: Array<RouterManagedTag>,\n next: Array<RouterManagedTag>,\n) {\n const prevByKey = new Map<string, RouterManagedTag>()\n for (const tag of prev) {\n prevByKey.set(JSON.stringify(tag), tag)\n }\n\n let isEqual = prev.length === next.length\n const result = next.map((tag, index) => {\n const existing = prevByKey.get(JSON.stringify(tag))\n if (existing) {\n if (existing !== prev[index]) {\n isEqual = false\n }\n return existing\n }\n\n isEqual = false\n return tag\n })\n\n return isEqual ? prev : result\n}\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,WAAW,qBAA8C;CACpE,MAAM,SAAS,kBAAA,UAAA;CACf,MAAM,QAAQ,OAAO,QAAQ,KAAK;CAClC,MAAM,gBAAgB,SAAM,iBAAiB,OAAO,OAAO,QAAQ,IAAA,CAAK;CACxE,MAAM,YAAY,SAAM,iBACtB,cAAA,EACG,KAAK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M,iBAAiB;EACzC,OAAO,cAAA,EACJ,SAAS,UAAU,MAAM,eAAe,CAAA,CAAE,EAC1C,QAAQ,WAAW,WAAW,KAAA,CAAA,EAC9B,KAAK,EAAE,UAAU,GAAG,cAAc;GACjC,KAAK;GACL,OAAO;IACL,GAAG;IACH;;GAEQ;IACX;;CAQL,OAAO,SAAM,YAAY,SAA8C;EACrE,MAAM,OAAgC,CAAA;EACtC,CAAA,GAAA,sBAAA,sBAAqB,MAAM,KAAA,CAAM;EACjC,CAAA,GAAA,sBAAA,sBAAqB,MAAM,MAAA,CAAO;EAClC,KAAK,KAAK,GAAG,gBAAA,CAAiB;EAC9B,KAAK,KAAK,GAAG,aAAA,CAAc;EAC3B,CAAA,GAAA,sBAAA,sBAAqB,MAAM,OAAA,CAAQ;EACnC,CAAA,GAAA,sBAAA,sBAAqB,MAAM,YAAA,CAAa;EAExC,IAAI,SAAS,KAAA,GACX,OAAO;EAET,OAAO,iBAAiB,MAAM,IAAA;;;AAIlC,SAAS,iBACP,MACA,MACA;CACA,MAAM,4BAAY,IAAI,IAAY;CAClC,KAAK,MAAM,OAAO,MAChB,UAAU,IAAI,KAAK,UAAU,GAAA,GAAM,GAAA;CAGrC,IAAI,UAAU,KAAK,WAAW,KAAK;CACnC,MAAM,SAAS,KAAK,KAAK,KAAK,UAAU;EACtC,MAAM,WAAW,UAAU,IAAI,KAAK,UAAU,GAAA,CAAI;EAClD,IAAI,UAAU;GACZ,IAAI,aAAa,KAAK,QACpB,UAAU;GAEZ,OAAO;;EAGT,UAAU;EACV,OAAO;;CAGT,OAAO,UAAU,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"lazyRouteComponent.cjs","names":["isModuleNotFoundError","Dynamic","createMemo","AsyncRouteComponent","lazyRouteComponent","Record","T","importer","Promise","exportName","TKey","props","TProps","loadPromise","comp","error","load","then","res","undefined","catch","err","lazyComp","Lazy","Error","window","sessionStorage","storageKey","message","getItem","setItem","location","reload","default","compResource","_$createComponent","_$mergeProps","component","preload"],"sources":["../../src/lazyRouteComponent.tsx"],"sourcesContent":["import { isModuleNotFoundError } from '@tanstack/router-core'\nimport { Dynamic } from '@solidjs/web'\nimport { createMemo } from 'solid-js'\nimport type { AsyncRouteComponent } from './route'\n\nexport function lazyRouteComponent<\n T extends Record<string, any>,\n TKey extends keyof T = 'default',\n>(\n importer: () => Promise<T>,\n exportName?: TKey,\n): T[TKey] extends (props: infer TProps) => any\n ? AsyncRouteComponent<TProps>\n : never {\n let loadPromise: Promise<any> | undefined\n let comp: T[TKey] | T['default']\n let error: any\n\n const load = () => {\n if (!loadPromise) {\n loadPromise = importer()\n .then((res) => {\n loadPromise = undefined\n comp = res[exportName ?? 'default']\n return comp\n })\n .catch((err) => {\n error = err\n })\n }\n\n return loadPromise\n }\n\n const lazyComp = function Lazy(props: any) {\n // Now that we're out of preload and into actual render path,\n // throw the error if it was a module not found error during preload\n if (error) {\n // If the load fails due to module not found, it may mean a new version of\n // the build was deployed and the user's browser is still using an old version.\n // If this happens, the old version in the user's browser would have an outdated\n // URL to the lazy module.\n // In that case, we want to attempt one window refresh to get the latest.\n if (isModuleNotFoundError(error)) {\n // We don't want an error thrown from preload in this case, because\n // there's nothing we want to do about module not found during preload.\n // Record the error, recover the promise with a null return,\n // and we will attempt module not found resolution during the render path.\n\n if (\n error instanceof Error &&\n typeof window !== 'undefined' &&\n typeof sessionStorage !== 'undefined'\n ) {\n // Again, we want to reload one time on module not found error and not enter\n // a reload loop if there is some other issue besides an old deploy.\n // That's why we store our reload attempt in sessionStorage.\n // Use error.message as key because it contains the module path that failed.\n const storageKey = `tanstack_router_reload:${error.message}`\n if (!sessionStorage.getItem(storageKey)) {\n sessionStorage.setItem(storageKey, '1')\n window.location.reload()\n\n // Return empty component while we wait for window to reload\n return {\n default: () => null,\n }\n }\n }\n }\n\n // Otherwise, just throw the error\n throw error\n }\n\n if (!comp) {\n const compResource = createMemo(load)\n return <Dynamic component={compResource()} {...props} />\n }\n\n return <Dynamic component={comp} {...props} />\n }\n\n ;(lazyComp as any).preload = load\n\n return lazyComp as any\n}\n"],"mappings":";;;;AAKA,SAAgBI,mBAIdG,UACAE,YAGQ;CACR,IAAII;CACJ,IAAIC;CACJ,IAAIC;CAEJ,MAAMC,aAAa;EACjB,IAAI,CAACH,aACHA,cAAcN,SAAS,EACpBU,MAAMC,QAAQ;GACbL,cAAcM,KAAAA;GACdL,OAAOI,IAAIT,cAAc;GACzB,OAAOK;EACT,CAAC,EACAM,OAAOC,QAAQ;GACdN,QAAQM;EACV,CAAC;EAGL,OAAOR;CACT;CAEA,MAAMS,WAAW,SAASC,KAAKZ,OAAY;EAGzC,IAAII,OAAO;GAMT,KAAA,GAAA,sBAAA,uBAA0BA,KAAK;QAO3BA,iBAAiBS,SACjB,OAAOC,WAAW,eAClB,OAAOC,mBAAmB,aAC1B;KAKA,MAAMC,aAAa,0BAA0BZ,MAAMa;KACnD,IAAI,CAACF,eAAeG,QAAQF,UAAU,GAAG;MACvCD,eAAeI,QAAQH,YAAY,GAAG;MACtCF,OAAOM,SAASC,OAAO;MAGvB,OAAO,EACLC,eAAe,KACjB;KACF;IACF;;GAIF,MAAMlB;EACR;EAEA,IAAI,CAACD,MAAM;GACT,MAAMoB,gBAAAA,GAAAA,SAAAA,YAA0BlB,IAAI;GACpC,QAAA,GAAA,aAAA,iBAAQf,aAAAA,UAAAA,GAAAA,aAAAA,YAAO,EAAA,IAACoC,YAAS;IAAA,OAAEH,aAAa;GAAC,EAAA,GAAMvB,KAAK,CAAA;EACtD;EAEA,QAAA,GAAA,aAAA,iBAAQV,aAAAA,UAAAA,GAAAA,aAAAA,YAAO,EAACoC,WAAWvB,KAAI,GAAMH,KAAK,CAAA;CAC5C;CAEC,SAAkB2B,UAAUtB;CAE7B,OAAOM;AACT"}
{"version":3,"file":"lazyRouteComponent.cjs","names":["<Dynamic component={compResource()} {...props} />","<Dynamic component={comp} {...props} />","component={comp}"],"sources":["../../src/lazyRouteComponent.tsx"],"sourcesContent":["import { isModuleNotFoundError } from '@tanstack/router-core'\nimport { Dynamic } from '@solidjs/web'\nimport { createMemo } from 'solid-js'\nimport type { AsyncRouteComponent } from './route'\n\nexport function lazyRouteComponent<\n T extends Record<string, any>,\n TKey extends keyof T = 'default',\n>(\n importer: () => Promise<T>,\n exportName?: TKey,\n): T[TKey] extends (props: infer TProps) => any\n ? AsyncRouteComponent<TProps>\n : never {\n let loadPromise: Promise<any> | undefined\n let comp: T[TKey] | T['default']\n let error: any\n\n const load = () => {\n if (!loadPromise) {\n loadPromise = importer()\n .then((res) => {\n loadPromise = undefined\n comp = res[exportName ?? 'default']\n return comp\n })\n .catch((err) => {\n error = err\n })\n }\n\n return loadPromise\n }\n\n const lazyComp = function Lazy(props: any) {\n // Now that we're out of preload and into actual render path,\n // throw the error if it was a module not found error during preload\n if (error) {\n // If the load fails due to module not found, it may mean a new version of\n // the build was deployed and the user's browser is still using an old version.\n // If this happens, the old version in the user's browser would have an outdated\n // URL to the lazy module.\n // In that case, we want to attempt one window refresh to get the latest.\n if (isModuleNotFoundError(error)) {\n // We don't want an error thrown from preload in this case, because\n // there's nothing we want to do about module not found during preload.\n // Record the error, recover the promise with a null return,\n // and we will attempt module not found resolution during the render path.\n\n if (\n error instanceof Error &&\n typeof window !== 'undefined' &&\n typeof sessionStorage !== 'undefined'\n ) {\n // Again, we want to reload one time on module not found error and not enter\n // a reload loop if there is some other issue besides an old deploy.\n // That's why we store our reload attempt in sessionStorage.\n // Use error.message as key because it contains the module path that failed.\n const storageKey = `tanstack_router_reload:${error.message}`\n if (!sessionStorage.getItem(storageKey)) {\n sessionStorage.setItem(storageKey, '1')\n window.location.reload()\n\n // Return empty component while we wait for window to reload\n return {\n default: () => null,\n }\n }\n }\n }\n\n // Otherwise, just throw the error\n throw error\n }\n\n if (!comp) {\n const compResource = createMemo(load)\n return <Dynamic component={compResource()} {...props} />\n }\n\n return <Dynamic component={comp} {...props} />\n }\n\n ;(lazyComp as any).preload = load\n\n return lazyComp as any\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAId,UACA,YAGQ;CACR,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,aAAa;EACjB,IAAI,CAAC,aACH,cAAc,SAAA,EACX,MAAM,QAAQ;GACb,cAAc,KAAA;GACd,OAAO,IAAI,cAAc;GACzB,OAAO;KAER,OAAO,QAAQ;GACd,QAAQ;;EAId,OAAO;;CAGT,MAAM,WAAW,SAAS,KAAK,OAAY;EAGzC,IAAI,OAAO;GAMT,KAAA,GAAA,sBAAA,uBAA0B,KAAA;QAOtB,iBAAiB,SACjB,OAAO,WAAW,eAClB,OAAO,mBAAmB,aAC1B;KAKA,MAAM,aAAa,0BAA0B,MAAM;KACnD,IAAI,CAAC,eAAe,QAAQ,UAAA,GAAa;MACvC,eAAe,QAAQ,YAAY,GAAA;MACnC,OAAO,SAAS,OAAA;MAGhB,OAAO,EACL,eAAe,KAAA;;;;GAOvB,MAAM;;EAGR,IAAI,CAAC,MAAM;GACT,MAAM,gBAAA,GAAA,SAAA,YAA0B,IAAA;GAChC,QAAA,GAAA,aAAA,iBAAOA,aAAAA,UAAAA,GAAAA,aAAAA,YAAAA,EAAS,IAAA,YAAA;WAAW,aAAA;QAAoB,KAAA,CAAS;;EAG1D,QAAA,GAAA,aAAA,iBAAOC,aAAAA,UAAAA,GAAAA,aAAAA,YAAAA,EAASC,WAAW,KAAA,GAAU,KAAA,CAAS;;CAG/C,SAAkB,UAAU;CAE7B,OAAO"}

@@ -11,3 +11,4 @@ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");

//#region src/link.tsx
var _tmpl$ = /* @__PURE__ */ (0, _solidjs_web.template)(`<svg><a>`), _tmpl$2 = /* @__PURE__ */ (0, _solidjs_web.template)(`<a>`);
var _tmpl$ = /* @__PURE__ */ (0, _solidjs_web.template)(`<svg><a>`);
var _tmpl$2 = /* @__PURE__ */ (0, _solidjs_web.template)(`<a>`);
function mergeRefs(...refs) {

@@ -302,3 +303,4 @@ return (el) => {

const [_, svgLinkProps] = splitProps(linkProps, ["class"]);
var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
var _el$ = _tmpl$();
var _el$2 = _el$.firstChild;
(0, _solidjs_web.spread)(_el$2, svgLinkProps, true);

@@ -305,0 +307,0 @@ (0, _solidjs_web.insert)(_el$2, children);

@@ -1,1 +0,1 @@

{"version":3,"file":"link.cjs","names":["Solid","deepEqual","exactPathTest","functionalUpdate","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","Dynamic","useRouter","useIntersectionObserver","useHydrated","AnyRouter","Constrain","LinkOptions","RegisteredRouter","RoutePaths","ValidateLinkOptions","ValidateLinkOptionsArray","ComponentProps","JSX","ValidComponent","mergeRefs","refs","Array","el","T","ref","splitProps","Record","props","keys","ReadonlyArray","TKey","Pick","Omit","_local","_rest","omit","timeoutMap","WeakMap","EventTarget","ReturnType","setTimeout","useLinkProps","TRouter","TFrom","options","UseLinkPropsOptions","TTo","TMaskFrom","TMaskTo","router","isTransitioning","setIsTransitioning","createSignal","shouldHydrateHash","ssr","hasHydrated","hasRenderFetched","local","activeProps","STATIC_ACTIVE_PROPS_GET","inactiveProps","STATIC_INACTIVE_PROPS_GET","propsSafeToSpread","currentLocation","createMemo","stores","location","get","equals","prev","next","href","_options","_fromLocation","untrack","buildLocation","lazy","external","maskedLocation","hrefOption","disabled","undefined","publicHref","history","createHref","externalLink","_href","protocolAllowlist","process","env","NODE_ENV","console","warn","to","safeInternal","isSafeInternal","indexOf","URL","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","isActive","activeOptions","current","nextLocation","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","length","includeSearch","searchTest","search","partial","ignoreUndefined","explicitUndefined","includeHash","currentHash","hash","doPreload","preloadRoute","_builtLocation","catch","err","preloadViewportIoCallback","entry","IntersectionObserverEntry","isIntersecting","setRefSignal","Element","setRef","runWithOwner","rootMargin","createEffect","preloadValue","externalHref","merge","handleClick","e","MouseEvent","elementTarget","currentTarget","HTMLAnchorElement","SVGAElement","getAttribute","effectiveTarget","target","isCtrlEvent","defaultPrevented","button","preventDefault","unsub","subscribe","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","enqueueIntentPreload","FocusEvent","eventTarget","has","set","delete","handleTouchStart","_","TouchEvent","handleLeave","id","clearTimeout","simpleStyling","class","style","onClick","createComposedHandler","onBlur","onFocus","onMouseEnter","onMouseOver","onMouseLeave","onMouseOut","onTouchStart","ResolvedLinkStateProps","CSSProperties","resolvedStateProps","EMPTY_OBJECT","resolvedClass","filter","Boolean","join","resolvedStyle","extraStateKeys","Set","stateProps","key","Object","add","composedRef","r","linkProps","defineProperty","getOwnPropertyDescriptor","enumerable","configurable","defineGetters","getters","role","aria-disabled","data-status","aria-current","data-transitioning","STATIC_ACTIVE_PROPS","callHandler","Event","event","TEvent","handler","EventHandlerUnion","getHandler","fallback","ActiveLinkOptions","ActiveLinkOptionProps","TComp","ActiveLinkProps","Partial","LinkComponentSolidProps","LinkProps","LinkPropsChildren","children","state","CreateLinkProps","LinkComponentProps","LinkComponent","TDefaultFrom","LinkComponentRoute","defaultFrom","createLink","Comp","_$createComponent","Link","_$mergeProps","_asChild","rest","resolvedChildren","ch","Function","svgLinkProps","_el$","_tmpl$","_el$2","firstChild","_$spread","_$insert","_el$3","_tmpl$2","component","metaKey","altKey","ctrlKey","shiftKey","zero","charCodeAt","LinkOptionsFnOptions","TOptions","LinkOptionsFn","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from '@solidjs/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\n\nfunction mergeRefs<T>(\n ...refs: Array<((el: T) => void) | undefined>\n): (el: T) => void {\n return (el: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(el)\n }\n }\n }\n}\n\nfunction splitProps<T extends Record<string, any>, TKey extends keyof T>(\n props: T,\n keys: ReadonlyArray<TKey>,\n): [Pick<T, TKey>, Omit<T, TKey>] {\n const _local = {} as Pick<T, TKey>\n const _rest = {} as Omit<T, TKey>\n\n // A safe way to polyfill splitProps if native getter copy is too complex\n // is just to return [props, Solid.omit(props, keys)] but it modifies typing.\n // Actually, Solid.omit exists!\n // Note: Solid.omit uses rest params (...keys), so we must spread the array.\n return [props as any, Solid.omit(props, ...(keys as any)) as any]\n}\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\n\nexport function useLinkProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '',\n>(\n options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n): ComponentProps<'a'> {\n const router = useRouter()\n const [isTransitioning, setIsTransitioning] = Solid.createSignal(false)\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n // Defaults are resolved through accessors at the use sites instead of\n // merging them into the props. Every merge/omit proxy layered here gets\n // re-enumerated by spread() on each navigation, and V8 dispatches proxy\n // traps in native runtime code — keeping this path proxy-free is what\n // keeps Link updates cheap.\n const local = options\n const activeProps = () => local.activeProps ?? STATIC_ACTIVE_PROPS_GET\n const inactiveProps = () => local.inactiveProps ?? STATIC_INACTIVE_PROPS_GET\n\n const propsSafeToSpread = Solid.omit(\n options as Record<string, any>,\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n )\n\n const currentLocation = Solid.createMemo(() => router.stores.location.get(), {\n equals: (prev, next) => prev.href === next.href,\n })\n\n const _options = () => options\n\n const next = Solid.createMemo(\n () => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const options = { _fromLocation, ..._options() } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(options))\n },\n {\n lazy: true,\n // Navigations usually leave most links' built locations unchanged;\n // comparing hrefs lets downstream memos (href, isActive) skip work.\n equals: (prev, next) =>\n prev.href === next.href &&\n prev.external === next.external &&\n prev.maskedLocation?.href === next.maskedLocation?.href,\n },\n )\n\n const hrefOption = Solid.createMemo(\n () => {\n if (_options().disabled) return undefined\n // Use publicHref - it contains the correct href for display\n // When a rewrite changes the origin, publicHref is the full URL\n // Otherwise it's the origin-stripped path\n // This avoids constructing URL objects in the hot path\n const location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n },\n { lazy: true },\n )\n\n const externalLink = Solid.createMemo(\n () => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = _options().to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n },\n { lazy: true },\n )\n\n const preload = Solid.createMemo(\n () => {\n if (_options().reloadDocument || externalLink()) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n },\n { lazy: true },\n )\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(\n () => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(\n current.pathname,\n router.basepath,\n )\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\n\n const pathIsFuzzyEqual =\n currentPath.startsWith(nextPath) &&\n (currentPath.length === nextPath.length ||\n currentPath[nextPath.length] === '/')\n if (!pathIsFuzzyEqual) {\n return false\n }\n }\n\n if (activeOptions?.includeSearch ?? true) {\n const searchTest = deepEqual(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n },\n { lazy: true },\n )\n\n const doPreload = () =>\n router\n .preloadRoute({ ..._options(), _builtLocation: next() } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const preloadViewportIoCallback = (\n entry: IntersectionObserverEntry | undefined,\n ) => {\n if (entry?.isIntersecting) {\n doPreload()\n }\n }\n\n const [ref, setRefSignal] = Solid.createSignal<Element | null>(null)\n\n const setRef = (el: Element | null) => {\n Solid.runWithOwner(null, () => {\n setRefSignal(el)\n })\n }\n\n useIntersectionObserver(\n ref,\n preloadViewportIoCallback,\n { rootMargin: '100px' },\n { disabled: !!local.disabled || !(Solid.untrack(preload) === 'viewport') },\n )\n\n Solid.createEffect(preload, (preloadValue) => {\n if (hasRenderFetched) {\n return\n }\n if (!local.disabled && preloadValue === 'render') {\n Solid.untrack(() => doPreload())\n hasRenderFetched = true\n }\n })\n\n if (Solid.untrack(externalLink)) {\n const externalHref = Solid.untrack(externalLink)\n return Solid.merge(\n propsSafeToSpread,\n {\n // ref: mergeRefs(setRef, _options().ref),\n href: externalHref,\n },\n splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\n // Check actual element's target attribute as fallback\n const elementTarget = (\n e.currentTarget as HTMLAnchorElement | SVGAElement\n ).getAttribute('target')\n const effectiveTarget =\n local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n Solid.runWithOwner(null, () => {\n setIsTransitioning(true)\n })\n\n const unsub = router.subscribe('onResolved', () => {\n unsub()\n Solid.runWithOwner(null, () => {\n setIsTransitioning(false)\n })\n })\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ..._options(),\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {\n if (local.disabled || preload() !== 'intent') return\n\n if (!preloadDelay()) {\n doPreload()\n return\n }\n\n const eventTarget = e.currentTarget || e.target\n\n if (!eventTarget || timeoutMap.has(eventTarget)) return\n\n timeoutMap.set(\n eventTarget,\n setTimeout(() => {\n timeoutMap.delete(eventTarget)\n doPreload()\n }, preloadDelay()),\n )\n }\n\n const handleTouchStart = (_: TouchEvent) => {\n if (local.disabled || preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = (e: MouseEvent | FocusEvent) => {\n if (local.disabled) return\n const eventTarget = e.currentTarget || e.target\n\n if (eventTarget) {\n const id = timeoutMap.get(eventTarget)\n clearTimeout(id)\n timeoutMap.delete(eventTarget)\n }\n }\n\n const simpleStyling = Solid.createMemo(\n () =>\n activeProps() === STATIC_ACTIVE_PROPS_GET &&\n inactiveProps() === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n { lazy: true },\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(\n () => local.onFocus,\n enqueueIntentPreload,\n )\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueueIntentPreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueueIntentPreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<ComponentProps<'a'>, 'style'> & {\n style?: JSX.CSSProperties\n }\n\n const resolvedStateProps = Solid.createMemo(\n (): ResolvedLinkStateProps =>\n (isActive()\n ? functionalUpdate(activeProps() as any, {})\n : functionalUpdate(inactiveProps(), {})) ?? EMPTY_OBJECT,\n { lazy: true },\n )\n\n const resolvedClass = Solid.createMemo(\n () => {\n if (simpleStyling()) return isActive() ? 'active' : undefined\n return (\n [local.class, resolvedStateProps().class].filter(Boolean).join(' ') ||\n undefined\n )\n },\n { lazy: true },\n )\n\n const resolvedStyle = Solid.createMemo(\n () => {\n if (simpleStyling()) return local.style\n const style = { ...local.style, ...resolvedStateProps().style }\n return hasKeys(style) ? style : undefined\n },\n { lazy: true },\n )\n\n // The returned object must be a plain object with a stable key set so the\n // consuming spread() never enumerates through proxy traps. Reactivity lives\n // in the property getters; values that no longer apply resolve to undefined,\n // which spread()/assign() treats as attribute removal. Keys returned by\n // activeProps/inactiveProps are discovered once at setup.\n const extraStateKeys = new Set<string>()\n Solid.untrack(() => {\n for (const stateProps of [\n functionalUpdate(activeProps() as any, {}),\n functionalUpdate(inactiveProps(), {}),\n ]) {\n if (stateProps) {\n for (const key of Object.keys(stateProps)) {\n if (key !== 'class' && key !== 'style') extraStateKeys.add(key)\n }\n }\n }\n })\n\n const composedRef = mergeRefs(setRef, (el: Element) => {\n const r = _options().ref as any\n if (typeof r === 'function') r(el)\n })\n\n const linkProps: Record<string, any> = {}\n for (const key of Object.keys(propsSafeToSpread)) {\n Object.defineProperty(\n linkProps,\n key,\n Object.getOwnPropertyDescriptor(propsSafeToSpread, key)!,\n )\n }\n for (const key of extraStateKeys) {\n Object.defineProperty(linkProps, key, {\n get: () => (resolvedStateProps() as Record<string, any>)[key],\n enumerable: true,\n configurable: true,\n })\n }\n\n const defineGetters = (getters: Record<string, () => any>) => {\n for (const key of Object.keys(getters)) {\n Object.defineProperty(linkProps, key, {\n get: getters[key],\n enumerable: true,\n configurable: true,\n })\n }\n }\n\n linkProps.ref = composedRef\n linkProps.onClick = onClick\n linkProps.onBlur = onBlur\n linkProps.onFocus = onFocus\n linkProps.onMouseEnter = onMouseEnter\n linkProps.onMouseOver = onMouseOver\n linkProps.onMouseLeave = onMouseLeave\n linkProps.onMouseOut = onMouseOut\n linkProps.onTouchStart = onTouchStart\n\n defineGetters({\n href: () => hrefOption()?.href,\n disabled: () => !!local.disabled,\n target: () => local.target,\n role: () => (local.disabled ? 'link' : undefined),\n 'aria-disabled': () => (local.disabled ? 'true' : undefined),\n 'data-status': () => (isActive() ? 'active' : undefined),\n 'aria-current': () => (isActive() ? 'page' : undefined),\n 'data-transitioning': () =>\n isTransitioning() ? 'transitioning' : undefined,\n class: resolvedClass,\n style: resolvedStyle,\n })\n\n return linkProps as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\nexport type UseLinkPropsOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n Omit<ComponentProps<'a'>, 'style'> & { style?: JSX.CSSProperties }\n\nexport type ActiveLinkOptions<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n LinkComponentSolidProps<TComp> & {\n [key: `data-${string}`]: unknown\n }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n /**\n * A function that returns additional props for the `active` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n /**\n * A function that returns additional props for the `inactive` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkPropsChildren\n\nexport interface LinkPropsChildren {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | JSX.Element\n | ((state: { isActive: boolean; isTransitioning: boolean }) => JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends ValidComponent\n ? Omit<ComponentProps<TComp>, keyof CreateLinkProps>\n : never\n\nexport type LinkComponentProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkComponentSolidProps<TComp> &\n LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n any,\n any,\n string,\n string,\n string,\n string\n>\n\nexport type LinkComponent<\n in out TComp,\n in out TDefaultFrom extends string = string,\n> = <\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = TDefaultFrom,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(\n props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => JSX.Element\n\nexport interface LinkComponentRoute<\n in out TDefaultFrom extends string = string,\n> {\n defaultFrom: TDefaultFrom;\n <\n TRouter extends AnyRouter = RegisteredRouter,\n const TTo extends string | undefined = undefined,\n const TMaskTo extends string = '',\n >(\n props: LinkComponentProps<\n 'a',\n TRouter,\n this['defaultFrom'],\n TTo,\n this['defaultFrom'],\n TMaskTo\n >,\n ): JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = splitProps(props as typeof props & { _asChild: any }, [\n '_asChild',\n 'children',\n ])\n const [_, linkProps] = splitProps(useLinkProps(rest as unknown as any), [\n 'type',\n ])\n\n // Resolve children once using Solid.children to avoid\n // re-accessing the children getter (which in Solid 2.0 would\n // re-invoke createComponent each time for JSX children).\n const resolvedChildren = Solid.children(() => local.children as JSX.Element)\n const children = () => {\n const ch = resolvedChildren()\n if (typeof ch === 'function') {\n return (ch as Function)({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n get isTransitioning() {\n return (linkProps as any)['data-transitioning'] === 'transitioning'\n },\n })\n }\n\n return ch\n }\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = splitProps(linkProps as any, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\n}\n\nexport type LinkOptionsFnOptions<\n TOptions,\n TComp,\n TRouter extends AnyRouter = RegisteredRouter,\n> =\n TOptions extends ReadonlyArray<any>\n ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n const TOptions,\n TRouter extends AnyRouter = RegisteredRouter,\n>(\n options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n return options as any\n}\n"],"mappings":";;;;;;;;;;;AAgCA,SAASuB,UACP,GAAGC,MACc;CACjB,QAAQE,OAAU;EAChB,KAAK,MAAME,OAAOJ,MAChB,IAAI,OAAOI,QAAQ,YACjBA,IAAIF,EAAE;CAGZ;AACF;AAEA,SAASG,WACPE,OACAC,MACgC;CAQhC,OAAO,CAACD,OAAc/B,SAAMuC,KAAKR,OAAO,GAAIC,IAAY,CAAQ;AAClE;AACA,IAAMQ,6BAAa,IAAIC,QAAoD;AAE3E,SAAgBI,aAOdG,SACqB;CACrB,MAAMK,SAAS3C,kBAAAA,UAAU;CACzB,MAAM,CAAC4C,iBAAiBC,sBAAsBvD,SAAMwD,aAAa,KAAK;CACtE,MAAMC,oBAAoB,CAACjD,+BAAAA,YAAY,CAAC,CAAC6C,OAAOL,QAAQU;CACxD,MAAMC,cAAc/C,mBAAAA,YAAY;CAEhC,IAAIgD,mBAAmB;CAOvB,MAAMC,QAAQb;CACd,MAAMc,oBAAoBD,MAAMC,eAAeC;CAC/C,MAAMC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AA6B,WAAA;EAAA,OAChEA,SAAS;CAAC,EAAA,CAAA,CAAA;AAGjB;AAEA,SAASnF,YAAYT,GAAe;CAClC,OAAO,CAAC,EAAEA,EAAEwH,WAAWxH,EAAEyH,UAAUzH,EAAE0H,WAAW1H,EAAE2H;AACpD;AAEA,SAAS5K,eAAeF,IAAa;CACnC,IAAI,OAAOA,OAAO,UAAU,OAAO;CACnC,MAAM+K,OAAO/K,GAAGgL,WAAW,CAAC;CAC5B,IAAID,SAAS,IAAI,OAAO/K,GAAGgL,WAAW,CAAC,MAAM;CAC7C,OAAOD,SAAS;AAClB;AAkBA,IAAaK,eAAmCrO,YAAY;CAC1D,OAAOA;AACT"}
{"version":3,"file":"link.cjs","names":["<Link {...props} _asChild={Comp} />","_asChild={Comp}","<svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>","<a {...linkProps}>{children()}</a>","<Dynamic component={local._asChild as ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from '@solidjs/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\n\nfunction mergeRefs<T>(\n ...refs: Array<((el: T) => void) | undefined>\n): (el: T) => void {\n return (el: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(el)\n }\n }\n }\n}\n\nfunction splitProps<T extends Record<string, any>, TKey extends keyof T>(\n props: T,\n keys: ReadonlyArray<TKey>,\n): [Pick<T, TKey>, Omit<T, TKey>] {\n const _local = {} as Pick<T, TKey>\n const _rest = {} as Omit<T, TKey>\n\n // A safe way to polyfill splitProps if native getter copy is too complex\n // is just to return [props, Solid.omit(props, keys)] but it modifies typing.\n // Actually, Solid.omit exists!\n // Note: Solid.omit uses rest params (...keys), so we must spread the array.\n return [props as any, Solid.omit(props, ...(keys as any)) as any]\n}\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\n\nexport function useLinkProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '',\n>(\n options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n): ComponentProps<'a'> {\n const router = useRouter()\n const [isTransitioning, setIsTransitioning] = Solid.createSignal(false)\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n // Defaults are resolved through accessors at the use sites instead of\n // merging them into the props. Every merge/omit proxy layered here gets\n // re-enumerated by spread() on each navigation, and V8 dispatches proxy\n // traps in native runtime code — keeping this path proxy-free is what\n // keeps Link updates cheap.\n const local = options\n const activeProps = () => local.activeProps ?? STATIC_ACTIVE_PROPS_GET\n const inactiveProps = () => local.inactiveProps ?? STATIC_INACTIVE_PROPS_GET\n\n const propsSafeToSpread = Solid.omit(\n options as Record<string, any>,\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n )\n\n const currentLocation = Solid.createMemo(() => router.stores.location.get(), {\n equals: (prev, next) => prev.href === next.href,\n })\n\n const _options = () => options\n\n const next = Solid.createMemo(\n () => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const options = { _fromLocation, ..._options() } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(options))\n },\n {\n lazy: true,\n // Navigations usually leave most links' built locations unchanged;\n // comparing hrefs lets downstream memos (href, isActive) skip work.\n equals: (prev, next) =>\n prev.href === next.href &&\n prev.external === next.external &&\n prev.maskedLocation?.href === next.maskedLocation?.href,\n },\n )\n\n const hrefOption = Solid.createMemo(\n () => {\n if (_options().disabled) return undefined\n // Use publicHref - it contains the correct href for display\n // When a rewrite changes the origin, publicHref is the full URL\n // Otherwise it's the origin-stripped path\n // This avoids constructing URL objects in the hot path\n const location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n },\n { lazy: true },\n )\n\n const externalLink = Solid.createMemo(\n () => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = _options().to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n },\n { lazy: true },\n )\n\n const preload = Solid.createMemo(\n () => {\n if (_options().reloadDocument || externalLink()) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n },\n { lazy: true },\n )\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(\n () => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(\n current.pathname,\n router.basepath,\n )\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\n\n const pathIsFuzzyEqual =\n currentPath.startsWith(nextPath) &&\n (currentPath.length === nextPath.length ||\n currentPath[nextPath.length] === '/')\n if (!pathIsFuzzyEqual) {\n return false\n }\n }\n\n if (activeOptions?.includeSearch ?? true) {\n const searchTest = deepEqual(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n },\n { lazy: true },\n )\n\n const doPreload = () =>\n router\n .preloadRoute({ ..._options(), _builtLocation: next() } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const preloadViewportIoCallback = (\n entry: IntersectionObserverEntry | undefined,\n ) => {\n if (entry?.isIntersecting) {\n doPreload()\n }\n }\n\n const [ref, setRefSignal] = Solid.createSignal<Element | null>(null)\n\n const setRef = (el: Element | null) => {\n Solid.runWithOwner(null, () => {\n setRefSignal(el)\n })\n }\n\n useIntersectionObserver(\n ref,\n preloadViewportIoCallback,\n { rootMargin: '100px' },\n { disabled: !!local.disabled || !(Solid.untrack(preload) === 'viewport') },\n )\n\n Solid.createEffect(preload, (preloadValue) => {\n if (hasRenderFetched) {\n return\n }\n if (!local.disabled && preloadValue === 'render') {\n Solid.untrack(() => doPreload())\n hasRenderFetched = true\n }\n })\n\n if (Solid.untrack(externalLink)) {\n const externalHref = Solid.untrack(externalLink)\n return Solid.merge(\n propsSafeToSpread,\n {\n // ref: mergeRefs(setRef, _options().ref),\n href: externalHref,\n },\n splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\n // Check actual element's target attribute as fallback\n const elementTarget = (\n e.currentTarget as HTMLAnchorElement | SVGAElement\n ).getAttribute('target')\n const effectiveTarget =\n local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n Solid.runWithOwner(null, () => {\n setIsTransitioning(true)\n })\n\n const unsub = router.subscribe('onResolved', () => {\n unsub()\n Solid.runWithOwner(null, () => {\n setIsTransitioning(false)\n })\n })\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ..._options(),\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {\n if (local.disabled || preload() !== 'intent') return\n\n if (!preloadDelay()) {\n doPreload()\n return\n }\n\n const eventTarget = e.currentTarget || e.target\n\n if (!eventTarget || timeoutMap.has(eventTarget)) return\n\n timeoutMap.set(\n eventTarget,\n setTimeout(() => {\n timeoutMap.delete(eventTarget)\n doPreload()\n }, preloadDelay()),\n )\n }\n\n const handleTouchStart = (_: TouchEvent) => {\n if (local.disabled || preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = (e: MouseEvent | FocusEvent) => {\n if (local.disabled) return\n const eventTarget = e.currentTarget || e.target\n\n if (eventTarget) {\n const id = timeoutMap.get(eventTarget)\n clearTimeout(id)\n timeoutMap.delete(eventTarget)\n }\n }\n\n const simpleStyling = Solid.createMemo(\n () =>\n activeProps() === STATIC_ACTIVE_PROPS_GET &&\n inactiveProps() === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n { lazy: true },\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(\n () => local.onFocus,\n enqueueIntentPreload,\n )\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueueIntentPreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueueIntentPreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<ComponentProps<'a'>, 'style'> & {\n style?: JSX.CSSProperties\n }\n\n const resolvedStateProps = Solid.createMemo(\n (): ResolvedLinkStateProps =>\n (isActive()\n ? functionalUpdate(activeProps() as any, {})\n : functionalUpdate(inactiveProps(), {})) ?? EMPTY_OBJECT,\n { lazy: true },\n )\n\n const resolvedClass = Solid.createMemo(\n () => {\n if (simpleStyling()) return isActive() ? 'active' : undefined\n return (\n [local.class, resolvedStateProps().class].filter(Boolean).join(' ') ||\n undefined\n )\n },\n { lazy: true },\n )\n\n const resolvedStyle = Solid.createMemo(\n () => {\n if (simpleStyling()) return local.style\n const style = { ...local.style, ...resolvedStateProps().style }\n return hasKeys(style) ? style : undefined\n },\n { lazy: true },\n )\n\n // The returned object must be a plain object with a stable key set so the\n // consuming spread() never enumerates through proxy traps. Reactivity lives\n // in the property getters; values that no longer apply resolve to undefined,\n // which spread()/assign() treats as attribute removal. Keys returned by\n // activeProps/inactiveProps are discovered once at setup.\n const extraStateKeys = new Set<string>()\n Solid.untrack(() => {\n for (const stateProps of [\n functionalUpdate(activeProps() as any, {}),\n functionalUpdate(inactiveProps(), {}),\n ]) {\n if (stateProps) {\n for (const key of Object.keys(stateProps)) {\n if (key !== 'class' && key !== 'style') extraStateKeys.add(key)\n }\n }\n }\n })\n\n const composedRef = mergeRefs(setRef, (el: Element) => {\n const r = _options().ref as any\n if (typeof r === 'function') r(el)\n })\n\n const linkProps: Record<string, any> = {}\n for (const key of Object.keys(propsSafeToSpread)) {\n Object.defineProperty(\n linkProps,\n key,\n Object.getOwnPropertyDescriptor(propsSafeToSpread, key)!,\n )\n }\n for (const key of extraStateKeys) {\n Object.defineProperty(linkProps, key, {\n get: () => (resolvedStateProps() as Record<string, any>)[key],\n enumerable: true,\n configurable: true,\n })\n }\n\n const defineGetters = (getters: Record<string, () => any>) => {\n for (const key of Object.keys(getters)) {\n Object.defineProperty(linkProps, key, {\n get: getters[key],\n enumerable: true,\n configurable: true,\n })\n }\n }\n\n linkProps.ref = composedRef\n linkProps.onClick = onClick\n linkProps.onBlur = onBlur\n linkProps.onFocus = onFocus\n linkProps.onMouseEnter = onMouseEnter\n linkProps.onMouseOver = onMouseOver\n linkProps.onMouseLeave = onMouseLeave\n linkProps.onMouseOut = onMouseOut\n linkProps.onTouchStart = onTouchStart\n\n defineGetters({\n href: () => hrefOption()?.href,\n disabled: () => !!local.disabled,\n target: () => local.target,\n role: () => (local.disabled ? 'link' : undefined),\n 'aria-disabled': () => (local.disabled ? 'true' : undefined),\n 'data-status': () => (isActive() ? 'active' : undefined),\n 'aria-current': () => (isActive() ? 'page' : undefined),\n 'data-transitioning': () =>\n isTransitioning() ? 'transitioning' : undefined,\n class: resolvedClass,\n style: resolvedStyle,\n })\n\n return linkProps as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\nexport type UseLinkPropsOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n Omit<ComponentProps<'a'>, 'style'> & { style?: JSX.CSSProperties }\n\nexport type ActiveLinkOptions<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n LinkComponentSolidProps<TComp> & {\n [key: `data-${string}`]: unknown\n }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n /**\n * A function that returns additional props for the `active` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n /**\n * A function that returns additional props for the `inactive` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkPropsChildren\n\nexport interface LinkPropsChildren {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | JSX.Element\n | ((state: { isActive: boolean; isTransitioning: boolean }) => JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends ValidComponent\n ? Omit<ComponentProps<TComp>, keyof CreateLinkProps>\n : never\n\nexport type LinkComponentProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkComponentSolidProps<TComp> &\n LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n any,\n any,\n string,\n string,\n string,\n string\n>\n\nexport type LinkComponent<\n in out TComp,\n in out TDefaultFrom extends string = string,\n> = <\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = TDefaultFrom,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(\n props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => JSX.Element\n\nexport interface LinkComponentRoute<\n in out TDefaultFrom extends string = string,\n> {\n defaultFrom: TDefaultFrom;\n <\n TRouter extends AnyRouter = RegisteredRouter,\n const TTo extends string | undefined = undefined,\n const TMaskTo extends string = '',\n >(\n props: LinkComponentProps<\n 'a',\n TRouter,\n this['defaultFrom'],\n TTo,\n this['defaultFrom'],\n TMaskTo\n >,\n ): JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = splitProps(props as typeof props & { _asChild: any }, [\n '_asChild',\n 'children',\n ])\n const [_, linkProps] = splitProps(useLinkProps(rest as unknown as any), [\n 'type',\n ])\n\n // Resolve children once using Solid.children to avoid\n // re-accessing the children getter (which in Solid 2.0 would\n // re-invoke createComponent each time for JSX children).\n const resolvedChildren = Solid.children(() => local.children as JSX.Element)\n const children = () => {\n const ch = resolvedChildren()\n if (typeof ch === 'function') {\n return (ch as Function)({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n get isTransitioning() {\n return (linkProps as any)['data-transitioning'] === 'transitioning'\n },\n })\n }\n\n return ch\n }\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = splitProps(linkProps as any, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\n}\n\nexport type LinkOptionsFnOptions<\n TOptions,\n TComp,\n TRouter extends AnyRouter = RegisteredRouter,\n> =\n TOptions extends ReadonlyArray<any>\n ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n const TOptions,\n TRouter extends AnyRouter = RegisteredRouter,\n>(\n options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n return options as any\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,SAAS,UACP,GAAG,MACc;CACjB,QAAQ,OAAU;EAChB,KAAK,MAAM,OAAO,MAChB,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAA;;;AAMZ,SAAS,WACP,OACA,MACgC;CAQhC,OAAO,CAAC,OAAc,SAAM,KAAK,OAAO,GAAI,IAAA,CAAa;;AAE3D,IAAM,6BAAa,IAAI,QAAuC;AAE9D,SAAgB,aAOd,SACqB;CACrB,MAAM,SAAS,kBAAA,UAAA;CACf,MAAM,CAAC,iBAAiB,sBAAsB,SAAM,aAAa,KAAA;CACjE,MAAM,oBAAoB,CAAC,+BAAA,YAAY,CAAC,CAAC,OAAO,QAAQ;CACxD,MAAM,cAAc,mBAAA,YAAA;CAEpB,IAAI,mBAAmB;CAOvB,MAAM,QAAQ;CACd,MAAM,oBAAoB,MAAM,eAAe;CAC/C,MAAM,sBAAsB,MAAM,iBAAiB;CAEnD,MAAM,oBAAoB,SAAM,KAC9B,SACA,eACA,iBACA,iBACA,MACA,WACA,gBACA,0BACA,sBACA,WACA,mBACA,eACA,kBACA,UACA,YACA,SACA,SACA,WACA,UACA,WACA,gBACA,gBACA,eACA,cACA,gBACA,iBACA,UACA,UACA,QACA,SACA,QACA,kBACA,kBACA,MAAA;CAGF,MAAM,kBAAkB,SAAM,iBAAiB,OAAO,OAAO,SAAS,IAAA,GAAO,EAC3E,SAAS,MAAM,SAAS,KAAK,SAAS,KAAK,KAAA,CAC5C;CAED,MAAM,iBAAiB;CAEvB,MAAM,OAAO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,OAAQ,UAAkB,0BAA0B;;GAEvD;EAGH,OAAO;;CAGT,IAAI,MAAM,aAAa,OAAO;EAC5B,MAAM,CAAC,GAAG,gBAAgB,WAAW,WAAkB,CAAC,OAAA,CAAQ;EAE9D,IAAA,OAAA,OAAA;EACE,IAAA,QAAA,KAAA;kCAAO,cAAA,IAAA;EAAP,CAAA,GAAA,aAAA,QAAA,OAAsB,QAAA;EAF1B,OACEC;;CAMJ,IAAI,CAAC,MAAM,UAAU;EACZ,IAAA,QAAA,QAAA;kCAAO,WAAA,IAAA;EAAP,CAAA,GAAA,aAAA,QAAA,OAAmB,QAAA;EAA1B,OAAOC;;CAGT,QAAA,GAAA,aAAA,iBACEC,aAAAA,UAAAA,GAAAA,aAAAA,YAAAA,EAAS,IAAA,YAAA;SAAW,MAAM;MAAgC,WAA1D,EAAA,IAAA,WAAA;SACG,SAAA;IACO,CAAA;;AAId,SAAS,YAAY,GAAe;CAClC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE;;AAGpD,SAAS,eAAe,IAAa;CACnC,IAAI,OAAO,OAAO,UAAU,OAAO;CACnC,MAAM,OAAO,GAAG,WAAW,CAAA;CAC3B,IAAI,SAAS,IAAI,OAAO,GAAG,WAAW,CAAA,MAAO;CAC7C,OAAO,SAAS;;AAmBlB,IAAa,eAAmC,YAAY;CAC1D,OAAO"}

@@ -74,3 +74,5 @@ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");

get fallback() {
return (0, _solidjs_web.memo)(() => !!shouldSkipSuspenseFallback())() ? void 0 : (0, _solidjs_web.createComponent)(_solidjs_web.Dynamic, { get component() {
return (0, _solidjs_web.memo)(() => {
return !!shouldSkipSuspenseFallback();
})() ? void 0 : (0, _solidjs_web.createComponent)(_solidjs_web.Dynamic, { get component() {
return resolvePendingComponent();

@@ -147,3 +149,11 @@ } });

}
}), (0, _solidjs_web.memo)(() => (0, _solidjs_web.memo)(() => currentMatchState().parentRouteId === _tanstack_router_core.rootRouteId)() ? [(0, _solidjs_web.createComponent)(OnRendered, {}), (0, _solidjs_web.memo)(() => (0, _solidjs_web.memo)(() => !!(router.options.scrollRestoration && (_tanstack_router_core_isServer.isServer ?? router.isServer)))() ? (0, _solidjs_web.createComponent)(require_scroll_restoration.ScrollRestoration, {}) : null)] : null)];
}), (0, _solidjs_web.memo)(() => {
return (0, _solidjs_web.memo)(() => {
return currentMatchState().parentRouteId === _tanstack_router_core.rootRouteId;
})() ? [(0, _solidjs_web.createComponent)(OnRendered, {}), (0, _solidjs_web.memo)(() => {
return (0, _solidjs_web.memo)(() => {
return !!(router.options.scrollRestoration && (_tanstack_router_core_isServer.isServer ?? router.isServer));
})() ? (0, _solidjs_web.createComponent)(require_scroll_restoration.ScrollRestoration, {}) : null;
})] : null;
})];
}

@@ -363,3 +373,5 @@ });

get when() {
return (0, _solidjs_web.memo)(() => !!shouldShowNotFound())() ? route() : shouldShowNotFound();
return (0, _solidjs_web.memo)(() => {
return !!shouldShowNotFound();
})() ? route() : shouldShowNotFound();
},

@@ -388,3 +400,5 @@ children: (resolvedRoute) => solid_js.untrack(() => require_renderRouteNotFound.renderRouteNotFound(router, resolvedRoute(), void 0))

get fallback() {
return (0, _solidjs_web.memo)(() => !!childPendingComponent())() ? (0, _solidjs_web.createComponent)(_solidjs_web.Dynamic, { get component() {
return (0, _solidjs_web.memo)(() => {
return !!childPendingComponent();
})() ? (0, _solidjs_web.createComponent)(_solidjs_web.Dynamic, { get component() {
return childPendingComponent();

@@ -391,0 +405,0 @@ } }) : null;

@@ -1,1 +0,1 @@

{"version":3,"file":"matchContext.cjs","names":["Solid","AnyRouteMatch","NearestMatchContextValue","matchId","Accessor","routeId","match","hasPending","defaultNearestMatchContext","undefined","nearestMatchContext","createContext"],"sources":["../../src/matchContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouteMatch } from '@tanstack/router-core'\n\nexport type NearestMatchContextValue = {\n matchId: Solid.Accessor<string | undefined>\n routeId: Solid.Accessor<string | undefined>\n match: Solid.Accessor<AnyRouteMatch | undefined>\n hasPending: Solid.Accessor<boolean>\n}\n\nconst defaultNearestMatchContext: NearestMatchContextValue = {\n matchId: () => undefined,\n routeId: () => undefined,\n match: () => undefined,\n hasPending: () => false,\n}\n\nexport const nearestMatchContext =\n Solid.createContext<NearestMatchContextValue>(defaultNearestMatchContext)\n"],"mappings":";;;AAiBA,IAAaU,sBACXV,SAAMW,cAAwCH;CAP9CL,eAAeM,KAAAA;CACfJ,eAAeI,KAAAA;CACfH,aAAaG,KAAAA;CACbF,kBAAkB;AAI4BC,CAA0B"}
{"version":3,"file":"matchContext.cjs","names":[],"sources":["../../src/matchContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouteMatch } from '@tanstack/router-core'\n\nexport type NearestMatchContextValue = {\n matchId: Solid.Accessor<string | undefined>\n routeId: Solid.Accessor<string | undefined>\n match: Solid.Accessor<AnyRouteMatch | undefined>\n hasPending: Solid.Accessor<boolean>\n}\n\nconst defaultNearestMatchContext: NearestMatchContextValue = {\n matchId: () => undefined,\n routeId: () => undefined,\n match: () => undefined,\n hasPending: () => false,\n}\n\nexport const nearestMatchContext =\n Solid.createContext<NearestMatchContextValue>(defaultNearestMatchContext)\n"],"mappings":";;;AAiBA,IAAa,sBACX,SAAM,cAAwC;CAP9C,eAAe,KAAA;CACf,eAAe,KAAA;CACf,aAAa,KAAA;CACb,kBAAkB;AAI4B,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"Matches.cjs","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","JSX","NearestMatchContext","Component","value","children","RouteMatchExtensions","meta","Array","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","options","disableGlobalCatchBoundary","document","ssr","Loading","rootRoute","routesById","PendingComponent","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","fallback","MatchesInner","matchId","stores","firstId","get","routeId","undefined","match","getRouteMatchStore","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchContent","Show","when","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteDeps","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","_$memo","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst NearestMatchContext = nearestMatchContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n // When disableGlobalCatchBoundary is true, we must NOT wrap with Solid.Loading\n // because Solid.Loading transforms STATUS_ERROR into STATUS_PENDING, which\n // prevents errors from propagating to an external Errored boundary.\n const ResolvedSuspense =\n router.options.disableGlobalCatchBoundary ||\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Loading\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstId.get()\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId() ? router.stores.getRouteMatchStore(rootRouteId).get() : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.get()[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.get()\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchContent = () => (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n\n if (router.options.disableGlobalCatchBoundary) {\n // When disableGlobalCatchBoundary is true, render without any internal\n // error boundary so errors bubble up freely to an external Errored boundary.\n return (\n <NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>\n )\n }\n\n return (\n <NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>\n )\n}\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteDeps.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => JSX.Element)\n | JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;;;AAyBA,IAAMwB,sBAAsBhB,qBAAAA;AAe5B,SAAgB4B,UAAU;CACxB,MAAMC,SAAS/B,kBAAAA,UAAU;CAKzB,MAAMgC,mBACJD,OAAOE,QAAQC,+BACdrC,+BAAAA,YAAYkC,OAAOlC,aACnB,OAAOsC,aAAa,eAAeJ,OAAOK,MACvCjC,qBAAAA,eACAT,SAAM2C;CAEZ,MAAMC,kBAAkCP,OAAOQ,WAAW3C,sBAAAA;CAC1D,MAAM4C,mBACJF,UAAU,EAAEL,QAAQQ,oBACpBV,OAAOE,QAAQS;CAIjB,QAAA,GAAA,aAAA,iBAFwBX,OAAOE,QAAQW,aAAazC,qBAAAA,cAGlC,EAAA,IAAAkB,WAAA;EAAA,QAAA,GAAA,aAAA,iBACbW,kBAAgB;GAAA,IACfc,WAAQ;IAAA,OAAEN,oBAAAA,GAAAA,aAAAA,iBAAoBA,kBAAgB,CAAA,CAAA,IAAM;GAAI;GAAA,IAAAnB,WAAA;IAAA,OAAA,EAAA,GAAA,aAAA,iBAEvDpB,qBAAAA,cAAY,CAAA,CAAA,IAAA,GAAA,aAAA,iBACZ8C,cAAY,CAAA,CAAA,CAAA;GAAA;EAAA,CAAA;CAAA,EAAA,CAAA;AAIrB;AAEA,SAASA,eAAe;CACtB,MAAMhB,SAAS/B,kBAAAA,UAAU;CACzB,MAAMgD,gBAAgBjB,OAAOkB,OAAOC,QAAQC,IAAI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,SAAgBa,gBAIdlC,MACsD;CACtD,MAAM4B,iBAAiBtH,SAAMuH,WAAW/G,qBAAAA,mBAAmB,EAAE8C;CAE7D,OAAO4D,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChBT,QAAQU,WAAWC,MAAMA,EAAEC,OAAOL,eAAe,CAAC,IAAI,CACxD;EACA,OAAO5B,MAAMoB,SAASpB,KAAKoB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"}
{"version":3,"file":"Matches.cjs","names":["<OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>","<ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>","<PendingComponent />","<Transitioner />","<MatchesInner />","<Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>","Solid.Show","<Match matchId={matchId()!} />","<NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>","value={nearestMatch}","<NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>","<CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>","getResetKey={() => resetKey()}","errorComponent={ErrorComponent}","{renderedChild()}"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst NearestMatchContext = nearestMatchContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n // When disableGlobalCatchBoundary is true, we must NOT wrap with Solid.Loading\n // because Solid.Loading transforms STATUS_ERROR into STATUS_PENDING, which\n // prevents errors from propagating to an external Errored boundary.\n const ResolvedSuspense =\n router.options.disableGlobalCatchBoundary ||\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Loading\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstId.get()\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId() ? router.stores.getRouteMatchStore(rootRouteId).get() : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.get()[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.get()\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchContent = () => (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n\n if (router.options.disableGlobalCatchBoundary) {\n // When disableGlobalCatchBoundary is true, render without any internal\n // error boundary so errors bubble up freely to an external Errored boundary.\n return (\n <NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>\n )\n }\n\n return (\n <NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>\n )\n}\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteDeps.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => JSX.Element)\n | JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;;;AAyBA,IAAM,sBAAsB,qBAAA;AAe5B,SAAgB,UAAU;CACxB,MAAM,SAAS,kBAAA,UAAA;CAKf,MAAM,mBACJ,OAAO,QAAQ,+BACd,+BAAA,YAAY,OAAO,aACnB,OAAO,aAAa,eAAe,OAAO,MACvC,qBAA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KAAK,OAAO,OAAA,IAAW;IAEhD;;AAGH,SAAgB,gBAId,MACsD;CACtD,MAAM,iBAAiB,SAAM,WAAW,qBAAA,mBAAA,EAAqB;CAE7D,OAAO,WAAW,EAChB,SAAS,YAAiD;EACxD,UAAU,QAAQ,MAChB,QAAQ,WAAW,MAAM,EAAE,OAAO,eAAA,CAAgB,IAAI,CAAA;EAExD,OAAO,MAAM,SAAS,KAAK,OAAO,OAAA,IAAW;IAEhD"}

@@ -1,1 +0,1 @@

{"version":3,"file":"not-found.cjs","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","JSX","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","Element","onCatch","children","router","pathname","createMemo","stores","location","get","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.get().pathname)\n const status = Solid.createMemo(() => router.stores.status.get())\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AASA,SAAgBM,YACdC,OACoD;CACpD,KAAA,GAAA,sBAAA,YAAeA,KAAK,GAClB,OAAOA;CAGT,KAAA,GAAA,sBAAA,YAAgBA,OAAeC,KAAK,GAClC,OAAQD,MAAcC;AAI1B;AAEA,SAAgBE,cAAcC,OAI3B;CACD,MAAMK,SAASb,kBAAAA,UAAU;CAEzB,MAAMc,WAAWhB,SAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,IAAI,EAAEJ,QAAQ;CAC7E,MAAMK,SAASrB,SAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,IAAI,CAAC;CAEhE,QAAA,GAAA,aAAA,iBACGnB,sBAAAA,eAAa;EACZsB,mBAAmB,aAAaP,SAAS,EAAC,GAAIK,OAAO;EACrDR,UAAUP,UAAU;GAClB,MAAMkB,gBAAgBnB,YAAYC,KAAK;GAEvC,IAAIkB,eACFd,MAAMG,UAAUW,aAAa;QAE7B,MAAMlB;EAEV;EACAmB,iBAAiB,EAAEnB,YAAY;GAC7B,MAAMkB,gBAAgBnB,YAAYC,KAAK;GAEvC,IAAIkB,eACF,OAAOd,MAAMC,WAAWa,aAAa;QAErC,MAAMlB;EAEV;EAAC,IAAAQ,WAAA;GAAA,OAEAJ,MAAMI;EAAQ;CAAA,CAAA;AAGrB;AAEA,SAAgBY,wBAAwB;CACtC,OAAAC,OAAA;AACF"}
{"version":3,"file":"not-found.cjs","names":["<CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>","getResetKey={() => `not-found-${pathname()}-${status()}`}","onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}","errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}","<p>Not Found</p>"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.get().pathname)\n const status = Solid.createMemo(() => router.stores.status.get())\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,YACd,OACoD;CACpD,KAAA,GAAA,sBAAA,YAAe,KAAA,GACb,OAAO;CAGT,KAAA,GAAA,sBAAA,YAAgB,OAAe,KAAA,GAC7B,OAAQ,MAAc;;AAM1B,SAAgB,cAAc,OAI3B;CACD,MAAM,SAAS,kBAAA,UAAA;CAEf,MAAM,WAAW,SAAM,iBAAiB,OAAO,OAAO,SAAS,IAAA,EAAM,QAAA;CACrE,MAAM,SAAS,SAAM,iBAAiB,OAAO,OAAO,OAAO,IAAA,CAAK;CAEhE,QAAA,GAAA,aAAA,iBACEA,sBAAAA,eAAAA;EACEC,mBAAmB,aAAa,SAAA,EAAW,GAAG,OAAA;EAC9CC,UAAU,UAAU;GAClB,MAAM,gBAAgB,YAAY,KAAA;GAElC,IAAI,eACF,MAAM,UAAU,aAAA;QAEhB,MAAM;;EAGVC,iBAAiB,EAAE,YAAY;GAC7B,MAAM,gBAAgB,YAAY,KAAA;GAElC,IAAI,eACF,OAAO,MAAM,WAAW,aAAA;QAExB,MAAM;;EAjBZ,IAAA,WAAA;UAqBG,MAAM;;EACO;;AAIpB,SAAgB,wBAAwB;CACtC,OAAOC,OAAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouteNotFound.cjs","names":["DefaultGlobalNotFound","AnyRoute","AnyRouter","renderRouteNotFound","router","route","data","options","notFoundComponent","defaultNotFoundComponent","_$createComponent","process","env","NODE_ENV","console","warn","id"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { DefaultGlobalNotFound } from './not-found'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\n/**\n * Renders a not found component for a route when no matching route is found.\n *\n * @param router - The router instance containing the route configuration\n * @param route - The route that triggered the not found state\n * @param data - Additional data to pass to the not found component\n * @returns The rendered not found component or a default fallback component\n */\nexport function renderRouteNotFound(\n router: AnyRouter,\n route: AnyRoute,\n data: any,\n) {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <router.options.defaultNotFoundComponent {...data} />\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n console.warn(\n `Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,\n )\n }\n }\n\n return <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgBG,oBACdC,QACAC,OACAC,MACA;CACA,IAAI,CAACD,MAAME,QAAQC,mBAAmB;EACpC,IAAIJ,OAAOG,QAAQE,0BACjB,QAAA,GAAA,aAAA,iBAAQL,OAAOG,QAAQE,0BAA6BH,IAAI;EAG1D,IAAA,QAAA,IAAA,aAA6B;OACvB,CAACD,MAAME,QAAQC,mBACjBM,QAAQC,KACN,kEAAkEV,MAAMW,GAAE,mPAC5E;EAAA;EAIJ,QAAA,GAAA,aAAA,iBAAQhB,kBAAAA,uBAAqB,CAAA,CAAA;CAC/B;CAEA,QAAA,GAAA,aAAA,iBAAQK,MAAME,QAAQC,mBAAsBF,IAAI;AAClD"}
{"version":3,"file":"renderRouteNotFound.cjs","names":["<router.options.defaultNotFoundComponent {...data} />","router.options","<DefaultGlobalNotFound />","<route.options.notFoundComponent {...data} />","route.options"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { DefaultGlobalNotFound } from './not-found'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\n/**\n * Renders a not found component for a route when no matching route is found.\n *\n * @param router - The router instance containing the route configuration\n * @param route - The route that triggered the not found state\n * @param data - Additional data to pass to the not found component\n * @returns The rendered not found component or a default fallback component\n */\nexport function renderRouteNotFound(\n router: AnyRouter,\n route: AnyRoute,\n data: any,\n) {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <router.options.defaultNotFoundComponent {...data} />\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n console.warn(\n `Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,\n )\n }\n }\n\n return <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,oBACd,QACA,OACA,MACA;CACA,IAAI,CAAC,MAAM,QAAQ,mBAAmB;EACpC,IAAI,OAAO,QAAQ,0BACjB,QAAA,GAAA,aAAA,iBAAOA,OAACC,QAAAA,0BAA4C,IAAA;EAGtD,IAAA,QAAA,IAAA,aAA6B;OACvB,CAAC,MAAM,QAAQ,mBACjB,QAAQ,KACN,kEAAkE,MAAM,GAAG,mPAAA;EAAA;EAKjF,QAAA,GAAA,aAAA,iBAAOC,kBAAAA,uBAAAA,CAAAA,CAAyB;;CAGlC,QAAA,GAAA,aAAA,iBAAOC,MAACC,QAAAA,mBAAoC,IAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"route.cjs","names":["BaseRootRoute","BaseRoute","BaseRouteApi","notFound","Link","useLoaderData","useLoaderDeps","useParams","useSearch","useNavigate","useMatch","useRouteContext","useRouter","AnyContext","AnyRoute","AnyRouter","ConstrainLiteral","ErrorComponentProps","NotFoundError","NotFoundRouteProps","Register","RegisteredRouter","ResolveFullPath","ResolveId","ResolveParams","RootRoute","RootRouteCore","RootRouteId","RootRouteOptions","RouteConstraints","Route","RouteCore","RouteIds","RouteMask","RouteOptions","RouteTypesById","RouterCore","ToMaskOptions","UseNavigateResult","UseLoaderDataRoute","UseMatchRoute","UseLoaderDepsRoute","UseParamsRoute","UseSearchRoute","UseRouteContextRoute","LinkComponentRoute","JSX","UpdatableRouteOptionsExtensions","component","RouteComponent","errorComponent","ErrorRouteComponent","notFoundComponent","NotFoundRouteComponent","pendingComponent","RootRouteOptionsExtensions","shellComponent","children","Element","RouteExtensions","TId","TFullPath","getRouteApi","id","TRouter","RouteApi","constructor","opts","select","from","strict","router","routesById","fullPath","routeId","props","_$createComponent","_$mergeProps","TParentRoute","TPath","TCustomId","Record","TRegister","TSearchValidator","TParams","TRouterContext","TRouteContextFn","TBeforeLoadFn","TLoaderDeps","TLoaderFn","TChildren","TFileRouteTypes","TSSR","TMiddlewares","THandlers","options","_self$","createRoute","AnyRootRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","_self$2","createRouteMask","routeTree","TRouteTree","TFrom","TTo","SolidNode","DefaultRouteTypes","TProps","RouteTypes","AsyncRouteComponent","preload","Promise","NotFoundRoute","Omit"],"sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\nimport type { JSX } from '@solidjs/web'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | undefined | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({ children }: { children: JSX.Element }) => JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TRegister = unknown,\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n TMiddlewares,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TRegister = unknown,\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TRegister,\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;AA6EA,SAAgB8D,YAGdC,IAA2D;CAC3D,OAAO,IAAIE,SAAuB,EAAEF,GAAG,CAAC;AAC1C;AAEA,IAAaE,WAAb,cAGU/D,sBAAAA,aAA2B;;;;CAInCgE,YAAY,EAAEH,MAAmB;EAC/B,MAAM,EAAEA,GAAG,CAAC;mBAGkBI,SAAS;GACvC,OAAOzD,iBAAAA,SAAS;IACd0D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;GACb,CAAQ;EACV;0BAE8CI,SAAS;GACrD,OAAOxD,wBAAAA,gBAAgB;IAAE,GAAIwD;IAAcE,MAAM,KAAKN;GAAG,CAAC;EAC5D;oBAEkCI,SAAS;GACzC,OAAO3D,kBAAAA,UAAU;IACf4D,QAAQD,MAAMC;IACdC,MAAM,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IAAE,GAAG6D;IAAME,MAAM,KAAKN;GAAG,CAAQ;EACxD;wBAEkDI,SAAS;GACzD,OAAO9D,sBAAAA,cAAc;IAAE,GAAG8D;IAAME,MAAM,KAAKN;GAAG,CAAQ;EACxD;2BAE4C;GAC1C,OAAOtD,oBAAAA,YAAY,EAAE4D,MAAM,KAAKI,SAAS,CAAC;EAC5C;gBAEkCE,UAAU;GAAA,MAAA2B,UAAA;GAC1C,QAAA,GAAA,aAAA,iBAAQlG,aAAAA,OAAAA,GAAAA,aAAAA,YAAI,EAAA,IAACiE,OAAI;IAAA,OAAEiC,QAAK7B;GAAQ,EAAA,GAAOE,KAAY,CAAA;EACrD;CAzCA;AA0CF;AAEA,SAAgB4B,gBAKdpC,MAGuB;CACvB,OAAOA;AACT;AAmBA,IAAagD,gBAAb,cAYUrF,MAiBR;CACAoC,YACE6B,SAyBA;EACA,MAAM;GACJ,GAAIA;GACJhC,IAAI;EACN,CAAC;CACH;AACF;AAEA,SAAgBqC,gBAWdL,SAuBA;CACA,OAAO,IAAItE,UAYTsE,OAAO;AACX"}
{"version":3,"file":"route.cjs","names":["<Link from={fullPath as never} {...props} />","from={fullPath as never}","<Link from={this.fullPath} {...props} />","this","<Link from={this.fullPath} {...(props as any)} />"],"sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\nimport type { JSX } from '@solidjs/web'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | undefined | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({ children }: { children: JSX.Element }) => JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TRegister = unknown,\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n TMiddlewares,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TRegister = unknown,\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TRegister,\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;AA6EA,SAAgB,YAGd,IAA2D;CAC3D,OAAO,IAAI,SAAuB,EAAE,GAAA,CAAI;;AAG1C,IAAa,WAAb,cAGU,sBAAA,aAA2B;;;;CAInC,YAAY,EAAE,MAAmB;EAC/B,MAAM,EAAE,GAAA,CAAI;mBAGkB,SAAS;GACvC,OAAO,iBAAA,SAAS;IACd,QAAQ,MAAM;IACd,MA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AAMD,QAAK;QAAe,KAAA,CAAiB;;;;AAI5D,SAAgB,gBAKd,MAGuB;CACvB,OAAO;;AAoBT,IAAa,gBAAb,cAYU,MAiBR;CACA,YACE,SAyBA;EACA,MAAM;GACJ,GAAI;GACJ,IAAI;GACL;;;AAIL,SAAgB,gBAWd,SAuBA;CACA,OAAO,IAAI,UAYT,OAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"routerContext.cjs","names":["Solid","AnyRouter","routerContext","createContext"],"sources":["../../src/routerContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const routerContext = Solid.createContext<AnyRouter>(\n null as unknown as AnyRouter,\n)\n"],"mappings":";;;;AAGA,IAAaE,gBAAgBF,SAAMG,cACjC,IACF"}
{"version":3,"file":"routerContext.cjs","names":[],"sources":["../../src/routerContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const routerContext = Solid.createContext<AnyRouter>(\n null as unknown as AnyRouter,\n)\n"],"mappings":";;;;AAGA,IAAa,gBAAgB,SAAM,cACjC,IAAmB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"RouterProvider.cjs","names":["Solid","routerContext","SafeFragment","Matches","AnyRouter","RegisteredRouter","RouterOptions","JSX","RouterContext","Component","value","children","RouterContextProvider","Record","router","rest","RouterProps","TRouter","TDehydrated","Element","Object","keys","length","runWithOwner","update","options","context","OptionalWrapper","Wrap","_$createComponent","RouterProvider","_$mergeProps","Omit","NonNullable","Partial"],"sources":["../../src/RouterProvider.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Matches } from './Matches'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterOptions,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst RouterContext = routerContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\nexport function RouterContextProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({\n router,\n children,\n ...rest\n}: RouterProps<TRouter, TDehydrated> & {\n children: () => JSX.Element\n}) {\n if (Object.keys(rest).length > 0) {\n Solid.runWithOwner(null, () => {\n router.update({\n ...router.options,\n ...rest,\n context: {\n ...router.options.context,\n ...rest.context,\n },\n } as any)\n })\n }\n\n const OptionalWrapper = router.options.Wrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <RouterContext value={router as AnyRouter}>{children()}</RouterContext>\n </OptionalWrapper>\n )\n}\n\nexport function RouterProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({ router, ...rest }: RouterProps<TRouter, TDehydrated>) {\n return (\n <RouterContextProvider router={router} {...rest}>\n {() => <Matches />}\n </RouterContextProvider>\n )\n}\n\nexport type RouterProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n> = Omit<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >,\n 'context'\n> & {\n router: TRouter\n context?: Partial<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >['context']\n >\n}\n"],"mappings":";;;;;;;;AAWA,IAAMQ,gBAAgBP,sBAAAA;AAKtB,SAAgBW,sBAGd,EACAE,QACAH,UACA,GAAGI,QAGF;CACD,IAAIK,OAAOC,KAAKN,IAAI,EAAEO,SAAS,GAC7BtB,SAAMuB,aAAa,YAAY;EAC7BT,OAAOU,OAAO;GACZ,GAAGV,OAAOW;GACV,GAAGV;GACHW,SAAS;IACP,GAAGZ,OAAOW,QAAQC;IAClB,GAAGX,KAAKW;GACV;EACF,CAAQ;CACV,CAAC;CAKH,QAAA,GAAA,aAAA,iBAFwBZ,OAAOW,QAAQG,QAAQ1B,qBAAAA,cAG7B,EAAA,IAAAS,WAAA;EAAA,QAAA,GAAA,aAAA,iBACbH,eAAa;GAACE,OAAOI;GAAmB,IAAAH,WAAA;IAAA,OAAGA,SAAS;GAAC;EAAA,CAAA;CAAA,EAAA,CAAA;AAG5D;AAEA,SAAgBmB,eAGd,EAAEhB,QAAQ,GAAGC,QAA2C;CACxD,QAAA,GAAA,aAAA,iBACGH,wBAAAA,GAAAA,aAAAA,YAAqB,EAASE,OAAM,GAAMC,MAAI,EAAAJ,iBAAAA,GAAAA,aAAAA,iBACrCR,gBAAAA,SAAO,CAAA,CAAA,EAAG,CAAA,CAAA;AAGxB"}
{"version":3,"file":"RouterProvider.cjs","names":["<OptionalWrapper>\n <RouterContext value={router as AnyRouter}>{children()}</RouterContext>\n </OptionalWrapper>","<RouterContext value={router as AnyRouter}>{children()}</RouterContext>","value={router as AnyRouter}","<RouterContextProvider router={router} {...rest}>\n {() => <Matches />}\n </RouterContextProvider>","<Matches />"],"sources":["../../src/RouterProvider.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Matches } from './Matches'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterOptions,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst RouterContext = routerContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\nexport function RouterContextProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({\n router,\n children,\n ...rest\n}: RouterProps<TRouter, TDehydrated> & {\n children: () => JSX.Element\n}) {\n if (Object.keys(rest).length > 0) {\n Solid.runWithOwner(null, () => {\n router.update({\n ...router.options,\n ...rest,\n context: {\n ...router.options.context,\n ...rest.context,\n },\n } as any)\n })\n }\n\n const OptionalWrapper = router.options.Wrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <RouterContext value={router as AnyRouter}>{children()}</RouterContext>\n </OptionalWrapper>\n )\n}\n\nexport function RouterProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({ router, ...rest }: RouterProps<TRouter, TDehydrated>) {\n return (\n <RouterContextProvider router={router} {...rest}>\n {() => <Matches />}\n </RouterContextProvider>\n )\n}\n\nexport type RouterProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n> = Omit<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >,\n 'context'\n> & {\n router: TRouter\n context?: Partial<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >['context']\n >\n}\n"],"mappings":";;;;;;;;AAWA,IAAM,gBAAgB,sBAAA;AAKtB,SAAgB,sBAGd,EACA,QACA,UACA,GAAG,QAGF;CACD,IAAI,OAAO,KAAK,IAAA,EAAM,SAAS,GAC7B,SAAM,aAAa,YAAY;EAC7B,OAAO,OAAO;GACZ,GAAG,OAAO;GACV,GAAG;GACH,SAAS;IACP,GAAG,OAAO,QAAQ;IAClB,GAAG,KAAK;;GAEX;;CAML,QAAA,GAAA,aAAA,iBAFwB,OAAO,QAAQ,QAAQ,qBAAA,cAG7CA,EAAAA,IAAAA,WAAAA;2CACEC,eAAAA;GAAeC,OAAO;GAAtB,IAAA,WAAA;WAA4C,SAAA;;GAA2B;IACvD;;AAItB,SAAgB,eAGd,EAAE,QAAQ,GAAG,QAA2C;CACxD,QAAA,GAAA,aAAA,iBACEC,wBAAAA,GAAAA,aAAAA,YAAAA,EAA+B,OAAA,GAAY,MAA3C,EAAA,iBAAA,GAAA,aAAA,iBACSC,gBAAAA,SAAAA,CAAAA,CAAW,EAAA,CACI,CAAA"}
let _solidjs_web = require("@solidjs/web");
//#region src/SafeFragment.tsx
function SafeFragment(props) {
return (0, _solidjs_web.memo)(() => props.children);
return (0, _solidjs_web.memo)(() => {
return props.children;
});
}

@@ -6,0 +8,0 @@ //#endregion

@@ -1,1 +0,1 @@

{"version":3,"file":"SafeFragment.cjs","names":["SafeFragment","props","_$memo","children"],"sources":["../../src/SafeFragment.tsx"],"sourcesContent":["export function SafeFragment(props: any) {\n return <>{props.children}</>\n}\n"],"mappings":";;AAAA,SAAgBA,aAAaC,OAAY;CACvC,QAAA,GAAA,aAAA,YAAUA,MAAME,QAAQ;AAC1B"}
{"version":3,"file":"SafeFragment.cjs","names":["{props.children}"],"sources":["../../src/SafeFragment.tsx"],"sourcesContent":["export function SafeFragment(props: any) {\n return <>{props.children}</>\n}\n"],"mappings":";;AAAA,SAAgB,aAAa,OAAY;CACvC,QAAA,GAAA,aAAA,YAASA;SAAC,MAAM"}

@@ -1,1 +0,1 @@

{"version":3,"file":"ScriptOnce.cjs","names":["isServer","useRouter","ScriptOnce","children","log","sync","router","_el$","_tmpl$","innerHTML","_$effect","options","ssr","nonce","_v$","_$setAttribute"],"sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nexport function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n const router = useRouter()\n if (!(isServer ?? router.isServer)) {\n return null\n }\n return (\n <script\n nonce={router.options.ssr?.nonce}\n class=\"$tsr\"\n innerHTML={children + ';document.currentScript.remove()'}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAgBE,WAAW,EACzBC,YAKC;CACD,MAAMG,SAASL,kBAAAA,UAAU;CACzB,IAAI,EAAED,+BAAAA,YAAYM,OAAON,WACvB,OAAO;CACR,IAAAO,OAAAC,OAAA;CAAAD,KAAAE,YAKcN,WAAW;CAAkCO,CAAAA,GAAAA,aAAAA,cAFjDJ,OAAOK,QAAQC,KAAKC,QAAKC,QAAA;EAAAC,CAAAA,GAAAA,aAAAA,cAAAR,MAAA,SAAAO,GAAA;CAAA,CAAA;CAFpC,OAAAP;AAOF"}
{"version":3,"file":"ScriptOnce.cjs","names":["<script\n nonce={router.options.ssr?.nonce}\n class=\"$tsr\"\n innerHTML={children + ';document.currentScript.remove()'}\n />"],"sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nexport function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n const router = useRouter()\n if (!(isServer ?? router.isServer)) {\n return null\n }\n return (\n <script\n nonce={router.options.ssr?.nonce}\n class=\"$tsr\"\n innerHTML={children + ';document.currentScript.remove()'}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAgB,WAAW,EACzB,YAKC;CACD,MAAM,SAAS,kBAAA,UAAA;CACf,IAAI,EAAE,+BAAA,YAAY,OAAO,WACvB,OAAO;CAGP,IAAA,OAAA,OAAA;CAGE,KAAA,YAAW,WAAW;CAFtB,CAAA,GAAA,aAAA,cAAO,OAAO,QAAQ,KAAK,QAA3B,QAAA;;;CAFJ,OACEA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"Scripts.cjs","names":["Solid","NoHydration","isServer","Asset","useRouter","AnyRouteMatch","RouterManagedTag","Scripts","router","nonce","options","ssr","getAssetScripts","matches","Array","assetScripts","manifest","match","scripts","routes","routeId","asset","push","tag","attrs","children","getScripts","map","flat","filter","Boolean","script","activeMatches","createMemo","stores","get","renderScripts","ReturnType","allScripts","serverSsr","serverBufferedScript","takeBufferedScripts","unshift","_$createComponent"],"sources":["../../src/Scripts.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { NoHydration } from '@solidjs/web'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport type { AnyRouteMatch, RouterManagedTag } from '@tanstack/router-core'\n\nexport const Scripts = () => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n\n const getAssetScripts = (matches: Array<AnyRouteMatch>) => {\n const assetScripts: Array<RouterManagedTag> = []\n const manifest = router.ssr?.manifest\n\n if (!manifest) {\n return []\n }\n\n for (const match of matches) {\n const scripts = manifest.routes[match.routeId]?.scripts\n\n if (!scripts) {\n continue\n }\n\n for (const asset of scripts) {\n assetScripts.push({\n tag: 'script',\n attrs: { ...asset.attrs, nonce },\n children: asset.children,\n })\n }\n }\n\n return assetScripts\n }\n\n const getScripts = (matches: Array<AnyRouteMatch>): Array<RouterManagedTag> =>\n (\n matches\n .map((match) => match.scripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(\n ({ children, ...script }) =>\n ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children,\n }) satisfies RouterManagedTag,\n )\n\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const assetScripts = Solid.createMemo(() => getAssetScripts(activeMatches()))\n const scripts = Solid.createMemo(() => getScripts(activeMatches()))\n\n return renderScripts(router, scripts(), assetScripts())\n}\n\nfunction renderScripts(\n router: ReturnType<typeof useRouter>,\n scripts: Array<RouterManagedTag>,\n assetScripts: Array<RouterManagedTag>,\n) {\n const allScripts = [...scripts, ...assetScripts] as Array<RouterManagedTag>\n\n if ((isServer ?? router.isServer) && router.serverSsr) {\n const serverBufferedScript = router.serverSsr.takeBufferedScripts()\n if (serverBufferedScript) {\n allScripts.unshift(serverBufferedScript)\n }\n }\n\n return (\n <NoHydration>\n {allScripts.map((asset) => (\n <Asset {...asset} />\n ))}\n </NoHydration>\n )\n}\n"],"mappings":";;;;;;;;AAOA,IAAaO,gBAAgB;CAC3B,MAAMC,SAASJ,kBAAAA,UAAU;CACzB,MAAMK,QAAQD,OAAOE,QAAQC,KAAKF;CAElC,MAAMG,mBAAmBC,YAAkC;EACzD,MAAME,eAAwC,CAAA;EAC9C,MAAMC,WAAWR,OAAOG,KAAKK;EAE7B,IAAI,CAACA,UACH,OAAO,CAAA;EAGT,KAAK,MAAMC,SAASJ,SAAS;GAC3B,MAAMK,UAAUF,SAASG,OAAOF,MAAMG,UAAUF;GAEhD,IAAI,CAACA,SACH;GAGF,KAAK,MAAMG,SAASH,SAClBH,aAAaO,KAAK;IAChBC,KAAK;IACLC,OAAO;KAAE,GAAGH,MAAMG;KAAOf;IAAM;IAC/BgB,UAAUJ,MAAMI;GAClB,CAAC;EAEL;EAEA,OAAOV;CACT;CAEA,MAAMW,cAAcb,YAEhBA,QACGc,KAAKV,UAAUA,MAAMC,OAAQ,EAC7BU,KAAK,CAAC,EACNC,OAAOC,OAAO,EACjBH,KACC,EAAEF,UAAU,GAAGM,cACb;EACCR,KAAK;EACLC,OAAO;GACL,GAAGO;GACHtB;EACF;EACAgB;CACF,EACJ;CAEF,MAAMO,gBAAgBhC,SAAMiC,iBAAiBzB,OAAO0B,OAAOrB,QAAQsB,IAAI,CAAC;CACxE,MAAMpB,eAAef,SAAMiC,iBAAiBrB,gBAAgBoB,cAAc,CAAC,CAAC;CAG5E,OAAOI,cAAc5B,QAFLR,SAAMiC,iBAAiBP,WAAWM,cAAc,CAAC,CAEpCd,EAAQ,GAAGH,aAAa,CAAC;AACxD;AAEA,SAASqB,cACP5B,QACAU,SACAH,cACA;CACA,MAAMuB,aAAa,CAAC,GAAGpB,SAAS,GAAGH,YAAY;CAE/C,KAAKb,+BAAAA,YAAYM,OAAON,aAAaM,OAAO+B,WAAW;EACrD,MAAMC,uBAAuBhC,OAAO+B,UAAUE,oBAAoB;EAClE,IAAID,sBACFF,WAAWI,QAAQF,oBAAoB;CAE3C;CAEA,QAAA,GAAA,aAAA,iBACGvC,aAAAA,aAAW,EAAA,IAAAwB,WAAA;EAAA,OACTa,WAAWX,KAAKN,WAAAA,GAAAA,aAAAA,iBACdlB,cAAAA,OAAUkB,KAAK,CACjB;CAAC,EAAA,CAAA;AAGR"}
{"version":3,"file":"Scripts.cjs","names":["<NoHydration>\n {allScripts.map((asset) => (\n <Asset {...asset} />\n ))}\n </NoHydration>","<Asset {...asset} />"],"sources":["../../src/Scripts.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { NoHydration } from '@solidjs/web'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport type { AnyRouteMatch, RouterManagedTag } from '@tanstack/router-core'\n\nexport const Scripts = () => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n\n const getAssetScripts = (matches: Array<AnyRouteMatch>) => {\n const assetScripts: Array<RouterManagedTag> = []\n const manifest = router.ssr?.manifest\n\n if (!manifest) {\n return []\n }\n\n for (const match of matches) {\n const scripts = manifest.routes[match.routeId]?.scripts\n\n if (!scripts) {\n continue\n }\n\n for (const asset of scripts) {\n assetScripts.push({\n tag: 'script',\n attrs: { ...asset.attrs, nonce },\n children: asset.children,\n })\n }\n }\n\n return assetScripts\n }\n\n const getScripts = (matches: Array<AnyRouteMatch>): Array<RouterManagedTag> =>\n (\n matches\n .map((match) => match.scripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(\n ({ children, ...script }) =>\n ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children,\n }) satisfies RouterManagedTag,\n )\n\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const assetScripts = Solid.createMemo(() => getAssetScripts(activeMatches()))\n const scripts = Solid.createMemo(() => getScripts(activeMatches()))\n\n return renderScripts(router, scripts(), assetScripts())\n}\n\nfunction renderScripts(\n router: ReturnType<typeof useRouter>,\n scripts: Array<RouterManagedTag>,\n assetScripts: Array<RouterManagedTag>,\n) {\n const allScripts = [...scripts, ...assetScripts] as Array<RouterManagedTag>\n\n if ((isServer ?? router.isServer) && router.serverSsr) {\n const serverBufferedScript = router.serverSsr.takeBufferedScripts()\n if (serverBufferedScript) {\n allScripts.unshift(serverBufferedScript)\n }\n }\n\n return (\n <NoHydration>\n {allScripts.map((asset) => (\n <Asset {...asset} />\n ))}\n </NoHydration>\n )\n}\n"],"mappings":";;;;;;;;AAOA,IAAa,gBAAgB;CAC3B,M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ce","ScrollRestoration","router","script","_$createComponent","children"],"sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import { getScrollRestorationScriptForRouter } from '@tanstack/router-core/scroll-restoration-script'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n const script = getScrollRestorationScriptForRouter(router)\n\n if (!script) {\n return null\n }\n\n return <ScriptOnce children={script} />\n}\n"],"mappings":";;;;;AAIA,SAAgBG,oBAAoB;CAElC,MAAME,UAAAA,GAAAA,gDAAAA,qCADSJ,kBAAAA,UACoCG,CAAM;CAEzD,IAAI,CAACC,QACH,OAAO;CAGT,QAAA,GAAA,aAAA,iBAAQH,mBAAAA,YAAU,EAACK,UAAUF,OAAM,CAAA;AACrC"}
{"version":3,"file":"scroll-restoration.cjs","names":["<ScriptOnce children={script} />","children={script}"],"sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import { getScrollRestorationScriptForRouter } from '@tanstack/router-core/scroll-restoration-script'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n const script = getScrollRestorationScriptForRouter(router)\n\n if (!script) {\n return null\n }\n\n return <ScriptOnce children={script} />\n}\n"],"mappings":";;;;;AAIA,SAAgB,oBAAoB;CAElC,MAAM,UAAA,GAAA,gDAAA,qCADS,kBAAA,UACoC,CAAA;CAEnD,IAAI,CAAC,QACH,OAAO;CAGT,QAAA,GAAA,aAAA,iBAAOA,mBAAAA,YAAAA,EAAYC,UAAU,OAAA,CAAU"}

@@ -1,1 +0,1 @@

{"version":3,"file":"ScrollRestoration.cjs","names":["getElementScrollRestorationEntry","setupScrollRestoration","useRouter","ParsedLocation","ScrollRestorationEntry","ScrollRestorationOptions","useScrollRestoration","router","ScrollRestoration","_props","process","env","NODE_ENV","console","warn","useElementScrollRestoration","options","id","getElement","Window","Element","getKey","location"],"sources":["../../src/ScrollRestoration.tsx"],"sourcesContent":["import {\n getElementScrollRestorationEntry,\n setupScrollRestoration,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n ParsedLocation,\n ScrollRestorationEntry,\n ScrollRestorationOptions,\n} from '@tanstack/router-core'\n\nfunction useScrollRestoration() {\n const router = useRouter()\n setupScrollRestoration(router, true)\n}\n\n/**\n * @deprecated use createRouter's `scrollRestoration` option instead\n */\nexport function ScrollRestoration(_props: ScrollRestorationOptions) {\n useScrollRestoration()\n\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n \"The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead.\",\n )\n }\n\n return null\n}\n\nexport function useElementScrollRestoration(\n options: (\n | {\n id: string\n getElement?: () => Window | Element | undefined | null\n }\n | {\n id?: string\n getElement: () => Window | Element | undefined | null\n }\n ) & {\n getKey?: (location: ParsedLocation) => string\n },\n): ScrollRestorationEntry | undefined {\n useScrollRestoration()\n\n return getElementScrollRestorationEntry(useRouter(), options)\n}\n"],"mappings":";;;AAWA,SAASM,uBAAuB;CAE9BL,CAAAA,GAAAA,sBAAAA,wBADeC,kBAAAA,UACQK,GAAQ,IAAI;AACrC;;;;AAKA,SAAgBC,kBAAkBC,QAAkC;CAClEH,qBAAqB;CAErB,IAAA,QAAA,IAAA,aAA6B,eAC3BO,QAAQC,KACN,uGACF;CAGF,OAAO;AACT;AAEA,SAAgBC,4BACdC,SAYoC;CACpCV,qBAAqB;CAErB,QAAA,GAAA,sBAAA,kCAAwCJ,kBAAAA,UAAU,GAAGc,OAAO;AAC9D"}
{"version":3,"file":"ScrollRestoration.cjs","names":[],"sources":["../../src/ScrollRestoration.tsx"],"sourcesContent":["import {\n getElementScrollRestorationEntry,\n setupScrollRestoration,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n ParsedLocation,\n ScrollRestorationEntry,\n ScrollRestorationOptions,\n} from '@tanstack/router-core'\n\nfunction useScrollRestoration() {\n const router = useRouter()\n setupScrollRestoration(router, true)\n}\n\n/**\n * @deprecated use createRouter's `scrollRestoration` option instead\n */\nexport function ScrollRestoration(_props: ScrollRestorationOptions) {\n useScrollRestoration()\n\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n \"The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead.\",\n )\n }\n\n return null\n}\n\nexport function useElementScrollRestoration(\n options: (\n | {\n id: string\n getElement?: () => Window | Element | undefined | null\n }\n | {\n id?: string\n getElement: () => Window | Element | undefined | null\n }\n ) & {\n getKey?: (location: ParsedLocation) => string\n },\n): ScrollRestorationEntry | undefined {\n useScrollRestoration()\n\n return getElementScrollRestorationEntry(useRouter(), options)\n}\n"],"mappings":";;;AAWA,SAAS,uBAAuB;CAE9B,CAAA,GAAA,sBAAA,wBADe,kBAAA,UACQ,GAAQ,IAAA;;;;;AAMjC,SAAgB,kBAAkB,QAAkC;CAClE,qBAAA;CAEA,IAAA,QAAA,IAAA,aAA6B,eAC3B,QAAQ,KACN,uGAAA;CAIJ,OAAO;;AAGT,SAAgB,4BACd,SAYoC;CACpC,qBAAA;CAEA,QAAA,GAAA,sBAAA,kCAAwC,kBAAA,UAAA,GAAa,OAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"defaultRenderHandler.cjs","names":["defineHandlerCallback","RouterServer","renderRouterToString","defaultRenderHandler","router","responseHeaders","children","_$createComponent"],"sources":["../../../src/ssr/defaultRenderHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToString } from './renderRouterToString'\n\nexport const defaultRenderHandler = defineHandlerCallback(\n ({ router, responseHeaders }) =>\n renderRouterToString({\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;AAIA,IAAaG,wBAAAA,6CAAAA,EAAAA,wBACV,EAAEC,QAAQC,sBACTH,6BAAAA,qBAAqB;CACnBE;CACAC;CACAC,iBAAAA,GAAAA,aAAAA,iBAAiBL,qBAAAA,cAAY,EAASG,OAAM,CAAA;AAC9C,CAAC,CACL"}
{"version":3,"file":"defaultRenderHandler.cjs","names":["<RouterServer router={router} />"],"sources":["../../../src/ssr/defaultRenderHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToString } from './renderRouterToString'\n\nexport const defaultRenderHandler = defineHandlerCallback(\n ({ router, responseHeaders }) =>\n renderRouterToString({\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;AAIA,IAAa,wBAAA,6CAAA,EAAA,wBACV,EAAE,QAAQ,sBACT,6BAAA,qBAAqB;CACnB;CACA;CACA,iBAAA,GAAA,aAAA,iBAAgBA,qBAAAA,cAAAA,EAAsB,OAAA,CAAU;CACjD,CAAC"}

@@ -1,1 +0,1 @@

{"version":3,"file":"defaultStreamHandler.cjs","names":["defineHandlerCallback","RouterServer","renderRouterToStream","defaultStreamHandler","request","router","responseHeaders","children","_$createComponent"],"sources":["../../../src/ssr/defaultStreamHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToStream } from './renderRouterToStream'\n\nexport const defaultStreamHandler = defineHandlerCallback(\n ({ request, router, responseHeaders }) =>\n renderRouterToStream({\n request,\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;AAIA,IAAaG,wBAAAA,6CAAAA,EAAAA,wBACV,EAAEC,SAASC,QAAQC,sBAClBJ,6BAAAA,qBAAqB;CACnBE;CACAC;CACAC;CACAC,iBAAAA,GAAAA,aAAAA,iBAAiBN,qBAAAA,cAAY,EAASI,OAAM,CAAA;AAC9C,CAAC,CACL"}
{"version":3,"file":"defaultStreamHandler.cjs","names":["<RouterServer router={router} />"],"sources":["../../../src/ssr/defaultStreamHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToStream } from './renderRouterToStream'\n\nexport const defaultStreamHandler = defineHandlerCallback(\n ({ request, router, responseHeaders }) =>\n renderRouterToStream({\n request,\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;AAIA,IAAa,wBAAA,6CAAA,EAAA,wBACV,EAAE,SAAS,QAAQ,sBAClB,6BAAA,qBAAqB;CACnB;CACA;CACA;CACA,iBAAA,GAAA,aAAA,iBAAgBA,qBAAAA,cAAAA,EAAsB,OAAA,CAAU;CACjD,CAAC"}

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouterToStream.cjs","names":["Solid","isbot","createSsrStreamResponse","transformReadableStreamWithRouter","makeSsrSerovalPlugin","ReadableStream","AnyRouter","JSX","noop","waitForReadyOrAbort","ready","Promise","signal","AbortSignal","cleanup","race","resolve","onAbort","removeEventListener","addEventListener","once","aborted","renderRouterToStream","request","router","responseHeaders","children","manifest","Request","Headers","Element","writable","readable","TransformStream","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","stream","renderToStream","nonce","plugins","innerWriter","getWriter","writerDone","releaseWriter","releaseLock","abortSolidPipe","reason","abort","catch","finally","onRequestAbort","serverSsr","onCleanup","headers","get","doctype","TextEncoder","encode","doctypeWritten","solidWritable","WritableStream","write","chunk","ArrayBuffer","isView","bytes","Uint8Array","out","length","set","close","pipeTo","err","name","code","console","error","responseStream","Response","status","stores","statusCode"],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport {\n createSsrStreamResponse,\n transformReadableStreamWithRouter,\n} from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst noop = () => {}\n\n// Bot responses wait for the server renderer before streaming. If the request\n// disconnects during that wait, unblock so the pipe can abort and clean up.\nasync function waitForReadyOrAbort(\n ready: Promise<unknown>,\n signal: AbortSignal,\n) {\n let cleanup = noop\n try {\n await Promise.race([\n ready,\n new Promise<void>((resolve) => {\n const onAbort = () => resolve()\n cleanup = () => signal.removeEventListener('abort', onAbort)\n signal.addEventListener('abort', onAbort, { once: true })\n if (signal.aborted) resolve()\n }),\n ])\n } finally {\n cleanup()\n }\n}\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n\n // Solid's `pipeTo(w)` takes a single arg (no signal overload) and locks\n // `w` via `w.getWriter()`. To still own the lifecycle we hand Solid a\n // proxy WritableStream that forwards into an inner writer we control on\n // the real TransformStream writable. Aborting the inner writer errors\n // the underlying readable (which our router transform reads from),\n // surfacing the cancel through the response pipeline.\n //\n // RESIDUAL RISK: solid-js@1.x does NOT expose a disposal hook on\n // `renderToStream`, and its internal write loop swallows writer\n // rejections (`writer.write(...).catch(() => {})` in\n // solid-js/web/dist/server.js). So aborting the inner writer stops\n // outbound bytes but does not terminate Solid's render continuation\n // if a Suspense/resource never resolves — those pending promise\n // continuations remain scheduled and can retain children/context/\n // request references via captured closures until natural completion\n // or process exit. The request-scoped router graph itself is released\n // by ServerSsr.cleanup() through the router stream lifecycle, so the leak\n // is bounded to whatever the user's Suspense/resource closures capture.\n // A hard upstream-abort guarantee would require a disposal API in solid-js.\n const innerWriter = writable.getWriter()\n let writerDone = false\n const releaseWriter = () => {\n try {\n innerWriter.releaseLock()\n } catch {\n // already released / errored\n }\n }\n const abortSolidPipe = (reason?: unknown) => {\n if (writerDone) return\n writerDone = true\n void innerWriter\n .abort(reason)\n .catch(() => {})\n .finally(releaseWriter)\n }\n\n const onRequestAbort = () => {\n abortSolidPipe(request.signal.reason)\n }\n\n // Wire request abort before the bot all-ready wait. Otherwise a disconnect\n // during `await stream` can leave this callback pending forever.\n if (request.signal.aborted) {\n onRequestAbort()\n } else {\n request.signal.addEventListener('abort', onRequestAbort, { once: true })\n router.serverSsr?.onCleanup(() => {\n request.signal.removeEventListener('abort', onRequestAbort)\n })\n }\n\n if (isbot(request.headers.get('User-Agent'))) {\n await waitForReadyOrAbort(\n Promise.resolve(stream as unknown),\n request.signal,\n )\n }\n\n const doctype = new TextEncoder().encode('<!DOCTYPE html>')\n let doctypeWritten = false\n\n const solidWritable = new WritableStream({\n write(chunk) {\n if (!doctypeWritten) {\n doctypeWritten = true\n if (ArrayBuffer.isView(chunk)) {\n const bytes = chunk as Uint8Array\n const out = new Uint8Array(doctype.length + bytes.length)\n out.set(doctype, 0)\n out.set(bytes, doctype.length)\n return innerWriter.write(out)\n }\n }\n return innerWriter.write(chunk)\n },\n close() {\n writerDone = true\n return innerWriter.close().finally(releaseWriter)\n },\n abort(reason) {\n writerDone = true\n return innerWriter.abort(reason).finally(releaseWriter)\n },\n })\n\n if (!request.signal.aborted) {\n try {\n void Promise.resolve(stream.pipeTo(solidWritable) as unknown).catch(\n (err: any) => {\n if (\n writerDone ||\n err?.name === 'AbortError' ||\n err?.code === 'ABORT_ERR'\n )\n return\n console.error('Error in Solid render stream:', err)\n abortSolidPipe(err)\n },\n )\n } catch (err: any) {\n if (err?.name !== 'AbortError' && err?.code !== 'ABORT_ERR') {\n console.error('Error in Solid render stream:', err)\n }\n abortSolidPipe(err)\n }\n }\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n { onAbort: abortSolidPipe },\n )\n return createSsrStreamResponse(\n router,\n new Response(responseStream as any, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n }),\n )\n}\n"],"mappings":";;;;;;;AAWA,IAAMQ,aAAa,CAAC;AAIpB,eAAeC,oBACbC,OACAE,QACA;CACA,IAAIE,UAAUN;CACd,IAAI;EACF,MAAMG,QAAQI,KAAK,CACjBL,OACA,IAAIC,SAAeK,YAAY;GAC7B,MAAMC,gBAAgBD,QAAQ;GAC9BF,gBAAgBF,OAAOM,oBAAoB,SAASD,OAAO;GAC3DL,OAAOO,iBAAiB,SAASF,SAAS,EAAEG,MAAM,KAAK,CAAC;GACxD,IAAIR,OAAOS,SAASL,QAAQ;EAC9B,CAAC,CAAC,CACH;CACH,UAAU;EACRF,QAAQ;CACV;AACF;AAEA,IAAaQ,uBAAuB,OAAO,EACzCC,SACAC,QACAC,iBACAC,UACAC,eAOI;CACJ,MAAM,EAAEI,UAAUC,aAAa,IAAIC,gBAAgB;CAKnD,MAAMI,kBAFHb,OAAOW,SAAiBD,yBACxBV,OAAOW,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;EAElE,QAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,MAAM,CACtDD;CACT,CAAC;CAED,MAAME,SAAS1C,aAAM2C,qBAAqBjB,UAAU;EAClDkB,OAAOpB,OAAOW,QAAQC,KAAKQ;EAC3BC,SAASR;EACTV,UAAUA,YAAYH,OAAOY,KAAKT;CACpC,CAAQ;CAqBR,MAAMmB,cAAcf,SAASgB,UAAU;CACvC,IAAIC,aAAa;CACjB,MAAMC,sBAAsB;EAC1B,IAAI;GACFH,YAAYI,YAAY;EAC1B,QAAQ,CACN;CAEJ;CACA,MAAMC,kBAAkBC,WAAqB;EAC3C,IAAIJ,YAAY;EAChBA,aAAa;EACb,YACGK,MAAMD,MAAM,EACZE,YAAY,CAAC,CAAC,EACdC,QAAQN,aAAa;CAC1B;CAEA,MAAMO,uBAAu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AAM,iCAAiCJ,GAAG;GAClD3B,eAAe2B,GAAG;EACpB,CACF;CACF,SAASA,KAAU;EACjB,IAAIA,KAAKC,SAAS,gBAAgBD,KAAKE,SAAS,aAC9CC,QAAQC,MAAM,iCAAiCJ,GAAG;EAEpD3B,eAAe2B,GAAG;CACpB;CAGF,MAAMK,kBAAAA,GAAAA,iCAAAA,mCACJ3D,QACAQ,UACA,EAAEf,SAASkC,eAAe,CAC5B;CACA,QAAA,GAAA,iCAAA,yBACE3B,QACA,IAAI4D,SAASD,gBAAuB;EAClCE,QAAQ7D,OAAO8D,OAAOC,WAAW3B,IAAI;EACrCD,SAASlC;CACX,CAAC,CACH;AACF"}
{"version":3,"file":"renderRouterToStream.cjs","names":[],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport {\n createSsrStreamResponse,\n transformReadableStreamWithRouter,\n} from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst noop = () => {}\n\n// Bot responses wait for the server renderer before streaming. If the request\n// disconnects during that wait, unblock so the pipe can abort and clean up.\nasync function waitForReadyOrAbort(\n ready: Promise<unknown>,\n signal: AbortSignal,\n) {\n let cleanup = noop\n try {\n await Promise.race([\n ready,\n new Promise<void>((resolve) => {\n const onAbort = () => resolve()\n cleanup = () => signal.removeEventListener('abort', onAbort)\n signal.addEventListener('abort', onAbort, { once: true })\n if (signal.aborted) resolve()\n }),\n ])\n } finally {\n cleanup()\n }\n}\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n\n // Solid's `pipeTo(w)` takes a single arg (no signal overload) and locks\n // `w` via `w.getWriter()`. To still own the lifecycle we hand Solid a\n // proxy WritableStream that forwards into an inner writer we control on\n // the real TransformStream writable. Aborting the inner writer errors\n // the underlying readable (which our router transform reads from),\n // surfacing the cancel through the response pipeline.\n //\n // RESIDUAL RISK: solid-js@1.x does NOT expose a disposal hook on\n // `renderToStream`, and its internal write loop swallows writer\n // rejections (`writer.write(...).catch(() => {})` in\n // solid-js/web/dist/server.js). So aborting the inner writer stops\n // outbound bytes but does not terminate Solid's render continuation\n // if a Suspense/resource never resolves — those pending promise\n // continuations remain scheduled and can retain children/context/\n // request references via captured closures until natural completion\n // or process exit. The request-scoped router graph itself is released\n // by ServerSsr.cleanup() through the router stream lifecycle, so the leak\n // is bounded to whatever the user's Suspense/resource closures capture.\n // A hard upstream-abort guarantee would require a disposal API in solid-js.\n const innerWriter = writable.getWriter()\n let writerDone = false\n const releaseWriter = () => {\n try {\n innerWriter.releaseLock()\n } catch {\n // already released / errored\n }\n }\n const abortSolidPipe = (reason?: unknown) => {\n if (writerDone) return\n writerDone = true\n void innerWriter\n .abort(reason)\n .catch(() => {})\n .finally(releaseWriter)\n }\n\n const onRequestAbort = () => {\n abortSolidPipe(request.signal.reason)\n }\n\n // Wire request abort before the bot all-ready wait. Otherwise a disconnect\n // during `await stream` can leave this callback pending forever.\n if (request.signal.aborted) {\n onRequestAbort()\n } else {\n request.signal.addEventListener('abort', onRequestAbort, { once: true })\n router.serverSsr?.onCleanup(() => {\n request.signal.removeEventListener('abort', onRequestAbort)\n })\n }\n\n if (isbot(request.headers.get('User-Agent'))) {\n await waitForReadyOrAbort(\n Promise.resolve(stream as unknown),\n request.signal,\n )\n }\n\n const doctype = new TextEncoder().encode('<!DOCTYPE html>')\n let doctypeWritten = false\n\n const solidWritable = new WritableStream({\n write(chunk) {\n if (!doctypeWritten) {\n doctypeWritten = true\n if (ArrayBuffer.isView(chunk)) {\n const bytes = chunk as Uint8Array\n const out = new Uint8Array(doctype.length + bytes.length)\n out.set(doctype, 0)\n out.set(bytes, doctype.length)\n return innerWriter.write(out)\n }\n }\n return innerWriter.write(chunk)\n },\n close() {\n writerDone = true\n return innerWriter.close().finally(releaseWriter)\n },\n abort(reason) {\n writerDone = true\n return innerWriter.abort(reason).finally(releaseWriter)\n },\n })\n\n if (!request.signal.aborted) {\n try {\n void Promise.resolve(stream.pipeTo(solidWritable) as unknown).catch(\n (err: any) => {\n if (\n writerDone ||\n err?.name === 'AbortError' ||\n err?.code === 'ABORT_ERR'\n )\n return\n console.error('Error in Solid render stream:', err)\n abortSolidPipe(err)\n },\n )\n } catch (err: any) {\n if (err?.name !== 'AbortError' && err?.code !== 'ABORT_ERR') {\n console.error('Error in Solid render stream:', err)\n }\n abortSolidPipe(err)\n }\n }\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n { onAbort: abortSolidPipe },\n )\n return createSsrStreamResponse(\n router,\n new Response(responseStream as any, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n }),\n )\n}\n"],"mappings":";;;;;;;AAWA,IAAM,aAAa,CAAA;AAInB,eAAe,oBACb,OACA,QACA;CACA,IAAI,UAAU;CACd,IAAI;EACF,MAAM,QAAQ,KAAK,CACjB,OACA,IAAI,SAAe,YAAY;GAC7B,MAAM,gBAAgB,QAAA;GACtB,gBAAgB,OAAO,oBAAoB,SAAS,OAAA;GACpD,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAA,CAAM;GACxD,IAAI,OAAO,SAAS,QAAA;IACpB,CACH;WACO;EACR,QAAA;;;AAIJ,IAAa,uBAAuB,O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AAA;KACjB,IAAI,IAAI,OAAO,QAAQ,MAAA;KACvB,OAAO,YAAY,MAAM,GAAA;;;GAG7B,OAAO,YAAY,MAAM,KAAA;;EAE3B,QAAQ;GACN,aAAa;GACb,OAAO,YAAY,MAAA,EAAQ,QAAQ,aAAA;;EAErC,MAAM,QAAQ;GACZ,aAAa;GACb,OAAO,YAAY,MAAM,MAAA,EAAQ,QAAQ,aAAA;;EAE5C;CAED,IAAI,CAAC,QAAQ,OAAO,SAClB,IAAI;EACF,QAAa,QAAQ,OAAO,OAAO,aAAA,CAAc,EAAa,OAC3D,QAAa;GACZ,IACE,cACA,KAAK,SAAS,gBACd,KAAK,SAAS,aAEd;GACF,QAAQ,MAAM,iCAAiC,GAAA;GAC/C,eAAe,GAAA;;UAGZ,KAAU;EACjB,IAAI,KAAK,SAAS,gBAAgB,KAAK,SAAS,aAC9C,QAAQ,MAAM,iCAAiC,GAAA;EAEjD,eAAe,GAAA;;CAInB,MAAM,kBAAA,GAAA,iCAAA,mCACJ,QACA,UACA,EAAE,SAAS,eAAA,CAAgB;CAE7B,QAAA,GAAA,iCAAA,yBACE,QACA,IAAI,SAAS,gBAAuB;EAClC,QAAQ,OAAO,OAAO,WAAW,IAAA;EACjC,SAAS;EACV,CAAC"}

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouterToString.cjs","names":["Solid","makeSsrSerovalPlugin","AnyRouter","JSX","renderRouterToString","router","responseHeaders","children","manifest","Headers","Element","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","html","renderToString","nonce","plugins","serverSsr","setRenderFinished","injectedHtml","takeBufferedHtml","replace","Response","status","stores","statusCode","get","headers","error","console","cleanup"],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;;;AAKA,IAAaI,wBAAwB,EACnCC,QACAC,iBACAC,UACAC,eAMI;CACJ,IAAI;EAIF,MAAMM,kBAFHT,OAAOO,SAAiBD,yBACxBN,OAAOO,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;GAElE,QAAA,GAAA,sBAAA,sBADoCA,SAAS,EAAEE,QAAQ,MAAM,CACtDD;EACT,CAAC;EAED,IAAIE,OAAOnB,aAAMoB,eAAeb,UAAU;GACxCc,OAAOhB,OAAOO,QAAQC,KAAKQ;GAC3BC,SAASR;GACTN,UAAUA,YAAYH,OAAOQ,KAAKL;EACpC,CAAQ;EACRH,OAAOkB,UAAWC,kBAAkB;EAEpC,MAAMC,eAAepB,OAAOkB,UAAWG,iBAAiB;EACxD,IAAID,cACFN,OAAOA,KAAKQ,QAAQ,iBAAiB,GAAGF,aAAY,QAAS;EAE/D,OAAO,IAAIG,SAAS,kBAAkBT,QAAQ;GAC5CU,QAAQxB,OAAOyB,OAAOC,WAAWC,IAAI;GACrCC,SAAS3B;EACX,CAAC;CACH,SAAS4B,OAAO;EACdC,QAAQD,MAAM,2BAA2BA,KAAK;EAC9C,OAAO,IAAIN,SAAS,yBAAyB;GAC3CC,QAAQ;GACRI,SAAS3B;EACX,CAAC;CACH,UAAU;EACRD,OAAOkB,WAAWa,QAAQ;CAC5B;AACF"}
{"version":3,"file":"renderRouterToString.cjs","names":[],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,wBAAwB,EACnC,QACA,iBACA,UACA,eAMI;CACJ,IAAI;EAIF,MAAM,kBAFH,OAAO,SAAiB,yBACxB,OAAO,QAAQ,KAAa,wBACe,KAAK,YAAiB;GAElE,QAAA,GAAA,sBAAA,sBADoC,SAAS,EAAE,QAAQ,MAAA,CAChD;;EAGT,IAAI,OAAO,aAAM,eAAe,UAAU;GACxC,OAAO,OAAO,QAAQ,KAAK;GAC3B,SAAS;GACT,UAAU,YAAY,OAAO,KAAK;GACnC;EACD,OAAO,UAAW,kBAAA;EAElB,MAAM,eAAe,OAAO,UAAW,iBAAA;EACvC,IAAI,cACF,OAAO,KAAK,QAAQ,iBAAiB,GAAG,aAAa,QAAA;EAEvD,OAAO,IAAI,SAAS,kBAAkB,QAAQ;GAC5C,QAAQ,OAAO,OAAO,WAAW,IAAA;GACjC,SAAS;GACV;UACM,OAAO;EACd,QAAQ,MAAM,2BAA2B,KAAA;EACzC,OAAO,IAAI,SAAS,yBAAyB;GAC3C,QAAQ;GACR,SAAS;GACV;WACO;EACR,OAAO,WAAW,QAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"RouterClient.cjs","names":["hydrate","Await","RouterProvider","AnyRouter","hydrationPromise","Promise","Array","RouterClient","props","router","stores","matchesId","get","length","resolve","_$createComponent","promise","children"],"sources":["../../../src/ssr/RouterClient.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/router-core/ssr/client'\nimport { Await } from '../awaited'\nimport { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nlet hydrationPromise: Promise<void | Array<Array<void>>> | undefined\n\nexport function RouterClient(props: { router: AnyRouter }) {\n if (!hydrationPromise) {\n if (!props.router.stores.matchesId.get().length) {\n hydrationPromise = hydrate(props.router)\n } else {\n hydrationPromise = Promise.resolve()\n }\n }\n return (\n <Await\n promise={hydrationPromise}\n children={() => <RouterProvider router={props.router} />}\n />\n )\n}\n"],"mappings":";;;;;AAKA,IAAII;AAEJ,SAAgBG,aAAaC,OAA8B;CACzD,IAAI,CAACJ,kBACH,IAAI,CAACI,MAAMC,OAAOC,OAAOC,UAAUC,IAAI,EAAEC,QACvCT,oBAAAA,GAAAA,iCAAAA,SAA2BI,MAAMC,MAAM;MAEvCL,mBAAmBC,QAAQS,QAAQ;CAGvC,QAAA,GAAA,aAAA,iBACGb,gBAAAA,OAAK;EACJe,SAASZ;EACTa,iBAAAA,GAAAA,aAAAA,iBAAiBf,uBAAAA,gBAAc,EAAA,IAACO,SAAM;GAAA,OAAED,MAAMC;EAAM,EAAA,CAAA;CAAI,CAAA;AAG9D"}
{"version":3,"file":"RouterClient.cjs","names":["<Await\n promise={hydrationPromise}\n children={() => <RouterProvider router={props.router} />}\n />","promise={hydrationPromise}","children={() => <RouterProvider router={props.router} />}","<RouterProvider router={props.router} />"],"sources":["../../../src/ssr/RouterClient.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/router-core/ssr/client'\nimport { Await } from '../awaited'\nimport { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nlet hydrationPromise: Promise<void | Array<Array<void>>> | undefined\n\nexport function RouterClient(props: { router: AnyRouter }) {\n if (!hydrationPromise) {\n if (!props.router.stores.matchesId.get().length) {\n hydrationPromise = hydrate(props.router)\n } else {\n hydrationPromise = Promise.resolve()\n }\n }\n return (\n <Await\n promise={hydrationPromise}\n children={() => <RouterProvider router={props.router} />}\n />\n )\n}\n"],"mappings":";;;;;AAKA,IAAI;AAEJ,SAAgB,aAAa,OAA8B;CACzD,IAAI,CAAC,kBACH,IAAI,CAAC,MAAM,OAAO,OAAO,UAAU,IAAA,EAAM,QACvC,oBAAA,GAAA,iCAAA,SAA2B,MAAM,MAAA;MAEjC,mBAAmB,QAAQ,QAAA;CAG/B,QAAA,GAAA,aAAA,iBACEA,gBAAAA,OAAAA;EACEC,SAAS;EACTC,iBAAAA,GAAAA,aAAAA,iBAAgBC,uBAAAA,gBAAAA,EAAgB,IAAA,SAAA;UAAQ,MAAM;KAAU;EACxD"}

@@ -1,1 +0,1 @@

{"version":3,"file":"RouterServer.cjs","names":["RouterProvider","AnyRouter","RouterServer","props","router","TRouter","_$createComponent"],"sources":["../../../src/ssr/RouterServer.tsx"],"sourcesContent":["import { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport function RouterServer<TRouter extends AnyRouter>(props: {\n router: TRouter\n}) {\n return <RouterProvider router={props.router} />\n}\n"],"mappings":";;;AAGA,SAAgBE,aAAwCC,OAErD;CACD,QAAA,GAAA,aAAA,iBAAQH,uBAAAA,gBAAc,EAAA,IAACI,SAAM;EAAA,OAAED,MAAMC;CAAM,EAAA,CAAA;AAC7C"}
{"version":3,"file":"RouterServer.cjs","names":["<RouterProvider router={props.router} />"],"sources":["../../../src/ssr/RouterServer.tsx"],"sourcesContent":["import { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport function RouterServer<TRouter extends AnyRouter>(props: {\n router: TRouter\n}) {\n return <RouterProvider router={props.router} />\n}\n"],"mappings":";;;AAGA,SAAgB,aAAwC,OAErD;CACD,QAAA,GAAA,aAAA,iBAAOA,uBAAAA,gBAAAA,EAAgB,IAAA,SAAA;SAAQ,MAAM;IAAU"}

@@ -1,1 +0,1 @@

{"version":3,"file":"Transitioner.cjs","names":["Solid","getLocationChangeInfo","trimPathRight","useRouter","ParsedLocation","handleHashScrollWithLocation","_router","location","document","querySelector","hashScrollIntoViewOptions","state","__hashScrollIntoViewOptions","hash","el","getElementById","scrollIntoView","Transitioner","router","mountLoadForRouter","mounted","isLoading","createMemo","stores","get","isSolidTransitioning","hasPending","isAnyPending","isPagePending","startTransition","fn","Promise","runWithOwner","flush","onSettled","unsub","history","subscribe","queueMicrotask","load","updateLatestLocation","nextLocation","buildLocation","to","latestLocation","pathname","search","params","_includeValidateSearch","publicHref","commitLocation","replace","window","ssr","tryLoad","err","console","error","createRenderEffect","resolvedLocation","const","currentIsLoading","currentIsPagePending","currentIsAnyPending","loc","resolvedLoc","prev","previousIsLoading","previousIsPagePending","previousIsAnyPending","emit","type","changeInfo","batch","status","set","hrefChanged"],"sources":["../../src/Transitioner.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { getLocationChangeInfo, trimPathRight } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type { ParsedLocation } from '@tanstack/router-core'\n\n/**\n * Inline version of handleHashScroll that accepts a pre-captured location\n * to avoid reading router.stores.location.state inside an effect callback\n * (which would trigger a Solid v2 reactive warning).\n */\nfunction handleHashScrollWithLocation(_router: any, location: ParsedLocation) {\n if (typeof document !== 'undefined' && (document as any).querySelector) {\n const hashScrollIntoViewOptions =\n location.state.__hashScrollIntoViewOptions ?? true\n\n if (hashScrollIntoViewOptions && location.hash !== '') {\n const el = document.getElementById(location.hash)\n if (el) {\n el.scrollIntoView(hashScrollIntoViewOptions)\n }\n }\n }\n}\n\nexport function Transitioner() {\n const router = useRouter()\n let mountLoadForRouter = { router, mounted: false }\n const isLoading = Solid.createMemo(() => router.stores.isLoading.get())\n\n const [isSolidTransitioning] = [() => false]\n\n // Track pending state changes\n const hasPending = Solid.createMemo(() => router.stores.hasPending.get())\n\n const isAnyPending = Solid.createMemo(\n () => isLoading() || isSolidTransitioning() || hasPending(),\n )\n\n const isPagePending = Solid.createMemo(() => isLoading() || hasPending())\n\n router.startTransition = (fn: () => void | Promise<void>) => {\n Solid.runWithOwner(null, fn)\n try {\n Solid.flush()\n } catch {\n // flush() throws inside reactive contexts — Solid auto-flushes there\n }\n }\n\n // Subscribe to location changes\n // and try to load the new location\n Solid.onSettled(() => {\n const unsub = router.history.subscribe(() => {\n queueMicrotask(() => router.load())\n })\n\n // Refresh latestLocation from the current browser URL before comparing.\n // The URL may have been changed synchronously (e.g. via replaceState) after\n // render() but before this effect ran, so we must not use the stale\n // render-time location here.\n router.updateLatestLocation()\n\n const nextLocation = router.buildLocation({\n to: router.latestLocation.pathname,\n search: true,\n params: true,\n hash: true,\n state: true,\n _includeValidateSearch: true,\n })\n\n // Check if the current URL matches the canonical form.\n // Compare publicHref (browser-facing URL) for consistency with\n // the server-side redirect check in router.beforeLoad.\n if (\n trimPathRight(router.latestLocation.publicHref) !==\n trimPathRight(nextLocation.publicHref)\n ) {\n router.commitLocation({ ...nextLocation, replace: true })\n }\n\n return () => {\n unsub()\n }\n })\n\n // Try to load the initial location\n // In Solid v2, signal updates inside onSettled cannot be flushed\n // synchronously (flush() throws). router.load() sets signals via batch(),\n // and the code that runs immediately after needs those values committed.\n // By deferring to queueMicrotask, the load runs outside the reactive\n // scheduling frame so flush() works correctly.\n Solid.onSettled(() => {\n if (\n // if we are hydrating from SSR, loading is triggered in ssr-client\n (typeof window !== 'undefined' && router.ssr) ||\n (mountLoadForRouter.router === router && mountLoadForRouter.mounted)\n ) {\n return\n }\n mountLoadForRouter = { router, mounted: true }\n queueMicrotask(() => {\n const tryLoad = async () => {\n try {\n await router.load()\n } catch (err) {\n console.error(err)\n }\n }\n tryLoad()\n })\n })\n\n Solid.createRenderEffect(\n () =>\n [\n isLoading(),\n isPagePending(),\n isAnyPending(),\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\n ] as const,\n (\n [\n currentIsLoading,\n currentIsPagePending,\n currentIsAnyPending,\n loc,\n resolvedLoc,\n ],\n prev,\n ) => {\n // Guard: if location state isn't available yet, skip all event emissions\n if (!loc) return\n\n const previousIsLoading = prev?.[0]\n const previousIsPagePending = prev?.[1]\n const previousIsAnyPending = prev?.[2]\n\n // onLoad: when the router finishes loading\n if (previousIsLoading && !currentIsLoading) {\n router.emit({\n type: 'onLoad',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onBeforeRouteMount: must fire before onResolved\n if (previousIsPagePending && !currentIsPagePending) {\n router.emit({\n type: 'onBeforeRouteMount',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onResolved: fires after onBeforeRouteMount\n if (previousIsAnyPending && !currentIsAnyPending) {\n const changeInfo = getLocationChangeInfo(loc, resolvedLoc)\n router.emit({\n type: 'onResolved',\n ...changeInfo,\n })\n\n Solid.runWithOwner(null, () => {\n router.batch(() => {\n router.stores.status.set('idle')\n // Use `loc` from the source tuple to avoid reading\n // router.stores.location.get() inside the effect callback\n router.stores.resolvedLocation.set(loc)\n })\n })\n\n if (changeInfo.hrefChanged) {\n // Pass the already-captured location to avoid a reactive read\n // inside the effect callback (handleHashScroll would otherwise\n // read router.stores.location.get() which triggers a warning)\n handleHashScrollWithLocation(router, loc)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAASK,6BAA6BC,SAAcC,UAA0B;CAC5E,IAAI,OAAOC,aAAa,eAAgBA,SAAiBC,eAAe;EACtE,MAAMC,4BACJH,SAASI,MAAMC,+BAA+B;EAEhD,IAAIF,6BAA6BH,SAASM,SAAS,IAAI;GACrD,MAAMC,KAAKN,SAASO,eAAeR,SAASM,IAAI;GAChD,IAAIC,IACFA,GAAGE,eAAeN,yBAAyB;EAE/C;CACF;AACF;AAEA,SAAgBO,eAAe;CAC7B,MAAMC,SAASf,kBAAAA,UAAU;CACzB,IAAIgB,qBAAqB;EAAED;EAAQE,SAAS;CAAM;CAClD,MAAMC,YAAYrB,SAAMsB,iBAAiBJ,OAAOK,OAAOF,UAAUG,IAAI,CAAC;CAEtE,MAAM,CAACC,wBAAwB,OAAO,KAAK;CAG3C,MAAMC,aAAa1B,SAAMsB,iBAAiBJ,OAAOK,OAAOG,WAAWF,IAAI,CAAC;CAExE,MAAMG,eAAe3B,SAAMsB,iBACnBD,UAAU,KAAKI,qBAAqB,KAAKC,WAAW,CAC5D;CAEA,MAAME,gBAAgB5B,SAAMsB,iBAAiBD,UAAU,KAAKK,WAAW,CAAC;CAExER,OAAOW,mBAAmBC,OAAmC;EAC3D9B,SAAMgC,aAAa,MAAMF,EAAE;EAC3B,IAAI;GACF9B,SAAMiC,MAAM;EACd,QAAQ,CACN;CAEJ;CAIAjC,SAAMkC,gBAAgB;EACpB,MAAMC,QAAQjB,OAAOkB,QAAQC,gBAAgB;GAC3CC,qBAAqBpB,OAAOqB,KAAK,CAAC;EACpC,CAAC;EAMDrB,OAAOsB,qBAAqB;EAE5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C;EAIH,IAAII,wBAAwB,CAACN,qBAAqB;GAChD,MAAMS,cAAAA,GAAAA,sBAAAA,uBAAmCR,KAAKC,WAAW;GACzD/C,OAAOoD,KAAK;IACVC,MAAM;IACN,GAAGC;GACL,CAAC;GAEDxE,SAAMgC,aAAa,YAAY;IAC7Bd,OAAOuD,YAAY;KACjBvD,OAAOK,OAAOmD,OAAOC,IAAI,MAAM;KAG/BzD,OAAOK,OAAOoC,iBAAiBgB,IAAIX,GAAG;IACxC,CAAC;GACH,CAAC;GAED,IAAIQ,WAAWI,aAIbvE,6BAA6Ba,QAAQ8C,GAAG;EAE5C;CACF,CACF;CAEA,OAAO;AACT"}
{"version":3,"file":"Transitioner.cjs","names":[],"sources":["../../src/Transitioner.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { getLocationChangeInfo, trimPathRight } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type { ParsedLocation } from '@tanstack/router-core'\n\n/**\n * Inline version of handleHashScroll that accepts a pre-captured location\n * to avoid reading router.stores.location.state inside an effect callback\n * (which would trigger a Solid v2 reactive warning).\n */\nfunction handleHashScrollWithLocation(_router: any, location: ParsedLocation) {\n if (typeof document !== 'undefined' && (document as any).querySelector) {\n const hashScrollIntoViewOptions =\n location.state.__hashScrollIntoViewOptions ?? true\n\n if (hashScrollIntoViewOptions && location.hash !== '') {\n const el = document.getElementById(location.hash)\n if (el) {\n el.scrollIntoView(hashScrollIntoViewOptions)\n }\n }\n }\n}\n\nexport function Transitioner() {\n const router = useRouter()\n let mountLoadForRouter = { router, mounted: false }\n const isLoading = Solid.createMemo(() => router.stores.isLoading.get())\n\n const [isSolidTransitioning] = [() => false]\n\n // Track pending state changes\n const hasPending = Solid.createMemo(() => router.stores.hasPending.get())\n\n const isAnyPending = Solid.createMemo(\n () => isLoading() || isSolidTransitioning() || hasPending(),\n )\n\n const isPagePending = Solid.createMemo(() => isLoading() || hasPending())\n\n router.startTransition = (fn: () => void | Promise<void>) => {\n Solid.runWithOwner(null, fn)\n try {\n Solid.flush()\n } catch {\n // flush() throws inside reactive contexts — Solid auto-flushes there\n }\n }\n\n // Subscribe to location changes\n // and try to load the new location\n Solid.onSettled(() => {\n const unsub = router.history.subscribe(() => {\n queueMicrotask(() => router.load())\n })\n\n // Refresh latestLocation from the current browser URL before comparing.\n // The URL may have been changed synchronously (e.g. via replaceState) after\n // render() but before this effect ran, so we must not use the stale\n // render-time location here.\n router.updateLatestLocation()\n\n const nextLocation = router.buildLocation({\n to: router.latestLocation.pathname,\n search: true,\n params: true,\n hash: true,\n state: true,\n _includeValidateSearch: true,\n })\n\n // Check if the current URL matches the canonical form.\n // Compare publicHref (browser-facing URL) for consistency with\n // the server-side redirect check in router.beforeLoad.\n if (\n trimPathRight(router.latestLocation.publicHref) !==\n trimPathRight(nextLocation.publicHref)\n ) {\n router.commitLocation({ ...nextLocation, replace: true })\n }\n\n return () => {\n unsub()\n }\n })\n\n // Try to load the initial location\n // In Solid v2, signal updates inside onSettled cannot be flushed\n // synchronously (flush() throws). router.load() sets signals via batch(),\n // and the code that runs immediately after needs those values committed.\n // By deferring to queueMicrotask, the load runs outside the reactive\n // scheduling frame so flush() works correctly.\n Solid.onSettled(() => {\n if (\n // if we are hydrating from SSR, loading is triggered in ssr-client\n (typeof window !== 'undefined' && router.ssr) ||\n (mountLoadForRouter.router === router && mountLoadForRouter.mounted)\n ) {\n return\n }\n mountLoadForRouter = { router, mounted: true }\n queueMicrotask(() => {\n const tryLoad = async () => {\n try {\n await router.load()\n } catch (err) {\n console.error(err)\n }\n }\n tryLoad()\n })\n })\n\n Solid.createRenderEffect(\n () =>\n [\n isLoading(),\n isPagePending(),\n isAnyPending(),\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\n ] as const,\n (\n [\n currentIsLoading,\n currentIsPagePending,\n currentIsAnyPending,\n loc,\n resolvedLoc,\n ],\n prev,\n ) => {\n // Guard: if location state isn't available yet, skip all event emissions\n if (!loc) return\n\n const previousIsLoading = prev?.[0]\n const previousIsPagePending = prev?.[1]\n const previousIsAnyPending = prev?.[2]\n\n // onLoad: when the router finishes loading\n if (previousIsLoading && !currentIsLoading) {\n router.emit({\n type: 'onLoad',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onBeforeRouteMount: must fire before onResolved\n if (previousIsPagePending && !currentIsPagePending) {\n router.emit({\n type: 'onBeforeRouteMount',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onResolved: fires after onBeforeRouteMount\n if (previousIsAnyPending && !currentIsAnyPending) {\n const changeInfo = getLocationChangeInfo(loc, resolvedLoc)\n router.emit({\n type: 'onResolved',\n ...changeInfo,\n })\n\n Solid.runWithOwner(null, () => {\n router.batch(() => {\n router.stores.status.set('idle')\n // Use `loc` from the source tuple to avoid reading\n // router.stores.location.get() inside the effect callback\n router.stores.resolvedLocation.set(loc)\n })\n })\n\n if (changeInfo.hrefChanged) {\n // Pass the already-captured location to avoid a reactive read\n // inside the effect callback (handleHashScroll would otherwise\n // read router.stores.location.get() which triggers a warning)\n handleHashScrollWithLocation(router, loc)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAS,6BAA6B,SAAc,UAA0B;CAC5E,IAAI,OAAO,aAAa,eAAgB,SAAiB,eAAe;EACtE,MAAM,4BACJ,SAAS,MAAM,+BAA+B;EAEhD,IAAI,6BAA6B,SAAS,SAAS,IAAI;GACrD,MAAM,KAAK,SAAS,eAAe,SAAS,IAAA;GAC5C,IAAI,IACF,GAAG,eAAe,yBAAA;;;;AAM1B,SAAgB,eAAe;CAC7B,MAAM,SAAS,kBAAA,UAAA;CACf,IAAI,qBAAqB;EAAE;EAAQ,SAAS;;CAC5C,MAAM,YAAY,SAAM,iBAAiB,OAAO,OAAO,UAAU,IAAA,CAAK;CAEtE,MAAM,CAAC,wBAAwB,OAAO,KAAA;CAGtC,MAAM,aAAa,SAAM,iBAAiB,OAAO,OAAO,WAAW,IAAA,CAAK;CAExE,M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uBAAyB,KAAK,WAAA;GAC/B;EAIH,IAAI,yBAAyB,CAAC,sBAC5B,OAAO,KAAK;GACV,MAAM;GACN,IAAA,GAAA,sBAAA,uBAAyB,KAAK,WAAA;GAC/B;EAIH,IAAI,wBAAwB,CAAC,qBAAqB;GAChD,MAAM,cAAA,GAAA,sBAAA,uBAAmC,KAAK,WAAA;GAC9C,OAAO,KAAK;IACV,MAAM;IACN,GAAG;IACJ;GAED,SAAM,aAAa,YAAY;IAC7B,OAAO,YAAY;KACjB,OAAO,OAAO,OAAO,IAAI,MAAA;KAGzB,OAAO,OAAO,iBAAiB,IAAI,GAAA;;;GAIvC,IAAI,WAAW,aAIb,6BAA6B,QAAQ,GAAA;;;CAM7C,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useBlocker.cjs","names":["Solid","useRouter","BlockerFnArgs","HistoryAction","HistoryLocation","SolidNode","AnyRoute","AnyRouter","ParseRoute","RegisteredRouter","ShouldBlockFnLocation","routeId","TRouteId","fullPath","TFullPath","pathname","params","TAllParams","search","TFullSearchSchema","AnyShouldBlockFnLocation","MakeShouldBlockFnLocationUnion","TRouter","TRoute","BlockerResolver","status","current","next","action","proceed","reset","ShouldBlockFnArgs","ShouldBlockFn","args","Promise","UseBlockerOpts","shouldBlockFn","enableBeforeUnload","disabled","withResolver","TWithResolver","LegacyBlockerFn","LegacyBlockerOpts","blockerFn","condition","_resolveBlockerOpts","opts","undefined","shouldBlock","Boolean","_customBlockerFn","createMemo","useBlocker","Accessor","blockerFnOrOpts","props","merge","router","resolver","setResolver","createSignal","disposeBlock","createEffect","blockerFnComposed","blockerFnArgs","getLocation","location","parsedLocation","parseLocation","matchedRoutes","getMatchedRoutes","foundRoute","routeParams","id","currentLocation","nextLocation","promise","resolve","canNavigateAsync","history","block","onSettled","_resolvePromptBlockerArgs","PromptProps","LegacyPromptProps","BlockComponent","Block","propsWithChildren","children","child","_$memo","TParams"],"sources":["../../src/useBlocker.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n BlockerFnArgs,\n HistoryAction,\n HistoryLocation,\n} from '@tanstack/history'\nimport type { SolidNode } from './route'\nimport type {\n AnyRoute,\n AnyRouter,\n ParseRoute,\n RegisteredRouter,\n} from '@tanstack/router-core'\n\ntype ShouldBlockFnLocation<\n out TRouteId,\n out TFullPath,\n out TAllParams,\n out TFullSearchSchema,\n> = {\n routeId: TRouteId\n fullPath: TFullPath\n pathname: string\n params: TAllParams\n search: TFullSearchSchema\n}\n\ntype AnyShouldBlockFnLocation = ShouldBlockFnLocation<any, any, any, any>\ntype MakeShouldBlockFnLocationUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? ShouldBlockFnLocation<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema']\n >\n : never\n\ntype BlockerResolver<TRouter extends AnyRouter = RegisteredRouter> =\n | {\n status: 'blocked'\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n proceed: () => void\n reset: () => void\n }\n | {\n status: 'idle'\n current: undefined\n next: undefined\n action: undefined\n proceed: undefined\n reset: undefined\n }\n\ntype ShouldBlockFnArgs<TRouter extends AnyRouter = RegisteredRouter> = {\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n}\n\nexport type ShouldBlockFn<TRouter extends AnyRouter = RegisteredRouter> = (\n args: ShouldBlockFnArgs<TRouter>,\n) => boolean | Promise<boolean>\nexport type UseBlockerOpts<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n> = {\n shouldBlockFn: ShouldBlockFn<TRouter>\n enableBeforeUnload?: boolean | (() => boolean)\n disabled?: boolean\n withResolver?: TWithResolver\n}\n\ntype LegacyBlockerFn = () => Promise<any> | any\ntype LegacyBlockerOpts = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n}\n\nfunction _resolveBlockerOpts(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): UseBlockerOpts {\n if (opts === undefined) {\n return {\n shouldBlockFn: () => true,\n withResolver: false,\n }\n }\n\n if ('shouldBlockFn' in opts) {\n return opts\n }\n\n if (typeof opts === 'function') {\n const shouldBlock = Boolean(condition ?? true)\n\n const _customBlockerFn = async () => {\n if (shouldBlock) return await opts()\n return false\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n enableBeforeUnload: shouldBlock,\n withResolver: false,\n }\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(opts.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && opts.blockerFn !== undefined) {\n return await opts.blockerFn()\n }\n return shouldBlock()\n }\n\n return {\n get shouldBlockFn() {\n return _customBlockerFn\n },\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return opts.blockerFn === undefined\n },\n }\n}\n\nexport function useBlocker<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = false,\n>(\n opts: UseBlockerOpts<TRouter, TWithResolver>,\n): TWithResolver extends true ? Solid.Accessor<BlockerResolver<TRouter>> : void\n\n/**\n * @deprecated Use the shouldBlockFn property instead\n */\nexport function useBlocker(\n blockerFnOrOpts?: LegacyBlockerOpts,\n): Solid.Accessor<BlockerResolver>\n\n/**\n * @deprecated Use the UseBlockerOpts object syntax instead\n */\nexport function useBlocker(\n blockerFn?: LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver>\n\nexport function useBlocker(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver> | void {\n const props = Solid.merge(\n {\n enableBeforeUnload: true,\n disabled: false,\n withResolver: false,\n },\n _resolveBlockerOpts(opts, condition),\n )\n\n const router = useRouter()\n\n const [resolver, setResolver] = Solid.createSignal<BlockerResolver>({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n let disposeBlock: (() => void) | undefined\n\n Solid.createEffect(\n () => props.disabled,\n (disabled) => {\n // Dispose previous blocker registration when re-running\n disposeBlock?.()\n disposeBlock = undefined\n\n if (disabled) {\n return\n }\n\n const blockerFnComposed = async (blockerFnArgs: BlockerFnArgs) => {\n function getLocation(\n location: HistoryLocation,\n ): AnyShouldBlockFnLocation {\n const parsedLocation = router.parseLocation(location)\n const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname)\n if (matchedRoutes.foundRoute === undefined) {\n return {\n routeId: '__notFound__',\n fullPath: parsedLocation.pathname,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n return {\n routeId: matchedRoutes.foundRoute.id,\n fullPath: matchedRoutes.foundRoute.fullPath,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n\n const current = getLocation(blockerFnArgs.currentLocation)\n const next = getLocation(blockerFnArgs.nextLocation)\n\n if (\n current.routeId === '__notFound__' &&\n next.routeId !== '__notFound__'\n ) {\n return false\n }\n\n const shouldBlock = await props.shouldBlockFn({\n action: blockerFnArgs.action,\n current,\n next,\n })\n if (!props.withResolver) {\n return shouldBlock\n }\n\n if (!shouldBlock) {\n return false\n }\n\n const promise = new Promise<boolean>((resolve) => {\n setResolver({\n status: 'blocked',\n current,\n next,\n action: blockerFnArgs.action,\n proceed: () => resolve(false),\n reset: () => resolve(true),\n })\n })\n\n const canNavigateAsync = await promise\n setResolver({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n return canNavigateAsync\n }\n\n disposeBlock = router.history.block({\n blockerFn: blockerFnComposed,\n enableBeforeUnload: props.enableBeforeUnload,\n })\n },\n )\n\n // Clean up on unmount\n Solid.onSettled(() => {\n return () => {\n disposeBlock?.()\n disposeBlock = undefined\n }\n })\n\n return resolver\n}\n\nconst _resolvePromptBlockerArgs = (\n props: PromptProps | LegacyPromptProps,\n): UseBlockerOpts => {\n if ('shouldBlockFn' in props) {\n return props\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(props.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && props.blockerFn !== undefined) {\n return await props.blockerFn()\n }\n return shouldBlock\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return props.blockerFn === undefined\n },\n }\n}\n\ninterface BlockComponent {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n >(\n opts: PromptProps<TRouter, TWithResolver>,\n ): SolidNode\n /**\n * @deprecated Use the UseBlockerOpts property instead\n */\n (opts: LegacyPromptProps): SolidNode\n}\n\nexport const Block: BlockComponent = function Block(\n opts: PromptProps | LegacyPromptProps,\n): SolidNode {\n const propsWithChildren = {\n get children() {\n return opts.children\n },\n }\n const args = _resolvePromptBlockerArgs(opts)\n\n const resolver = useBlocker(args)\n const children = Solid.createMemo(() => {\n const child = propsWithChildren.children\n if (resolver && typeof child === 'function') return child(resolver())\n return child\n })\n\n return <>{children()}</>\n}\n\ntype LegacyPromptProps = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n children?: SolidNode | ((params: BlockerResolver) => SolidNode)\n}\n\ntype PromptProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n TParams = TWithResolver extends true ? BlockerResolver<TRouter> : void,\n> = UseBlockerOpts<TRouter, TWithResolver> & {\n children?: SolidNode | ((params: TParams) => SolidNode)\n}\n"],"mappings":";;;;;;AAoFA,SAAS6C,oBACPC,MACAF,WACgB;CAChB,IAAIE,SAASC,KAAAA,GACX,OAAO;EACLX,qBAAqB;EACrBG,cAAc;CAChB;CAGF,IA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OAAOW;AACT;AAEA,IAAMwB,6BACJ3B,UACmB;CACnB,IAAI,mBAAmBA,OACrB,OAAOA;CAGT,MAAMP,cAAchD,SAAMmD,iBAAiBF,QAAQM,MAAMX,aAAa,IAAI,CAAC;CAE3E,MAAMM,mBAAmB,YAAY;EACnC,IAAIF,YAAY,KAAKO,MAAMZ,cAAcI,KAAAA,GACvC,OAAO,MAAMQ,MAAMZ,UAAU;EAE/B,OAAOK;CACT;CAEA,OAAO;EACLZ,eAAec;EACf,IAAIb,qBAAqB;GACvB,OAAOW,YAAY;EACrB;EACA,IAAIT,eAAe;GACjB,OAAOgB,MAAMZ,cAAcI,KAAAA;EAC7B;CACF;AACF;AAeA,IAAauC,QAAwB,SAASA,MAC5CxC,MACW;CACX,MAAMyC,oBAAoB,EACxB,IAAIC,WAAW;EACb,OAAO1C,KAAK0C;CACd,EACF;CAGA,MAAM9B,WAAWN,WAFJ8B,0BAA0BpC,IAEXb,CAAI;CAOhC,QAAA,GAAA,aAAA,MANiBjC,SAAMmD,iBAAiB;EACtC,MAAMsC,QAAQF,kBAAkBC;EAChC,IAAI9B,YAAY,OAAO+B,UAAU,YAAY,OAAOA,MAAM/B,SAAS,CAAC;EACpE,OAAO+B;CACT,CAEUD,CAAQ;AACpB"}
{"version":3,"file":"useBlocker.cjs","names":["{children()}"],"sources":["../../src/useBlocker.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n BlockerFnArgs,\n HistoryAction,\n HistoryLocation,\n} from '@tanstack/history'\nimport type { SolidNode } from './route'\nimport type {\n AnyRoute,\n AnyRouter,\n ParseRoute,\n RegisteredRouter,\n} from '@tanstack/router-core'\n\ntype ShouldBlockFnLocation<\n out TRouteId,\n out TFullPath,\n out TAllParams,\n out TFullSearchSchema,\n> = {\n routeId: TRouteId\n fullPath: TFullPath\n pathname: string\n params: TAllParams\n search: TFullSearchSchema\n}\n\ntype AnyShouldBlockFnLocation = ShouldBlockFnLocation<any, any, any, any>\ntype MakeShouldBlockFnLocationUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? ShouldBlockFnLocation<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema']\n >\n : never\n\ntype BlockerResolver<TRouter extends AnyRouter = RegisteredRouter> =\n | {\n status: 'blocked'\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n proceed: () => void\n reset: () => void\n }\n | {\n status: 'idle'\n current: undefined\n next: undefined\n action: undefined\n proceed: undefined\n reset: undefined\n }\n\ntype ShouldBlockFnArgs<TRouter extends AnyRouter = RegisteredRouter> = {\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n}\n\nexport type ShouldBlockFn<TRouter extends AnyRouter = RegisteredRouter> = (\n args: ShouldBlockFnArgs<TRouter>,\n) => boolean | Promise<boolean>\nexport type UseBlockerOpts<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n> = {\n shouldBlockFn: ShouldBlockFn<TRouter>\n enableBeforeUnload?: boolean | (() => boolean)\n disabled?: boolean\n withResolver?: TWithResolver\n}\n\ntype LegacyBlockerFn = () => Promise<any> | any\ntype LegacyBlockerOpts = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n}\n\nfunction _resolveBlockerOpts(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): UseBlockerOpts {\n if (opts === undefined) {\n return {\n shouldBlockFn: () => true,\n withResolver: false,\n }\n }\n\n if ('shouldBlockFn' in opts) {\n return opts\n }\n\n if (typeof opts === 'function') {\n const shouldBlock = Boolean(condition ?? true)\n\n const _customBlockerFn = async () => {\n if (shouldBlock) return await opts()\n return false\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n enableBeforeUnload: shouldBlock,\n withResolver: false,\n }\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(opts.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && opts.blockerFn !== undefined) {\n return await opts.blockerFn()\n }\n return shouldBlock()\n }\n\n return {\n get shouldBlockFn() {\n return _customBlockerFn\n },\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return opts.blockerFn === undefined\n },\n }\n}\n\nexport function useBlocker<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = false,\n>(\n opts: UseBlockerOpts<TRouter, TWithResolver>,\n): TWithResolver extends true ? Solid.Accessor<BlockerResolver<TRouter>> : void\n\n/**\n * @deprecated Use the shouldBlockFn property instead\n */\nexport function useBlocker(\n blockerFnOrOpts?: LegacyBlockerOpts,\n): Solid.Accessor<BlockerResolver>\n\n/**\n * @deprecated Use the UseBlockerOpts object syntax instead\n */\nexport function useBlocker(\n blockerFn?: LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver>\n\nexport function useBlocker(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver> | void {\n const props = Solid.merge(\n {\n enableBeforeUnload: true,\n disabled: false,\n withResolver: false,\n },\n _resolveBlockerOpts(opts, condition),\n )\n\n const router = useRouter()\n\n const [resolver, setResolver] = Solid.createSignal<BlockerResolver>({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n let disposeBlock: (() => void) | undefined\n\n Solid.createEffect(\n () => props.disabled,\n (disabled) => {\n // Dispose previous blocker registration when re-running\n disposeBlock?.()\n disposeBlock = undefined\n\n if (disabled) {\n return\n }\n\n const blockerFnComposed = async (blockerFnArgs: BlockerFnArgs) => {\n function getLocation(\n location: HistoryLocation,\n ): AnyShouldBlockFnLocation {\n const parsedLocation = router.parseLocation(location)\n const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname)\n if (matchedRoutes.foundRoute === undefined) {\n return {\n routeId: '__notFound__',\n fullPath: parsedLocation.pathname,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n return {\n routeId: matchedRoutes.foundRoute.id,\n fullPath: matchedRoutes.foundRoute.fullPath,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n\n const current = getLocation(blockerFnArgs.currentLocation)\n const next = getLocation(blockerFnArgs.nextLocation)\n\n if (\n current.routeId === '__notFound__' &&\n next.routeId !== '__notFound__'\n ) {\n return false\n }\n\n const shouldBlock = await props.shouldBlockFn({\n action: blockerFnArgs.action,\n current,\n next,\n })\n if (!props.withResolver) {\n return shouldBlock\n }\n\n if (!shouldBlock) {\n return false\n }\n\n const promise = new Promise<boolean>((resolve) => {\n setResolver({\n status: 'blocked',\n current,\n next,\n action: blockerFnArgs.action,\n proceed: () => resolve(false),\n reset: () => resolve(true),\n })\n })\n\n const canNavigateAsync = await promise\n setResolver({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n return canNavigateAsync\n }\n\n disposeBlock = router.history.block({\n blockerFn: blockerFnComposed,\n enableBeforeUnload: props.enableBeforeUnload,\n })\n },\n )\n\n // Clean up on unmount\n Solid.onSettled(() => {\n return () => {\n disposeBlock?.()\n disposeBlock = undefined\n }\n })\n\n return resolver\n}\n\nconst _resolvePromptBlockerArgs = (\n props: PromptProps | LegacyPromptProps,\n): UseBlockerOpts => {\n if ('shouldBlockFn' in props) {\n return props\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(props.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && props.blockerFn !== undefined) {\n return await props.blockerFn()\n }\n return shouldBlock\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return props.blockerFn === undefined\n },\n }\n}\n\ninterface BlockComponent {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n >(\n opts: PromptProps<TRouter, TWithResolver>,\n ): SolidNode\n /**\n * @deprecated Use the UseBlockerOpts property instead\n */\n (opts: LegacyPromptProps): SolidNode\n}\n\nexport const Block: BlockComponent = function Block(\n opts: PromptProps | LegacyPromptProps,\n): SolidNode {\n const propsWithChildren = {\n get children() {\n return opts.children\n },\n }\n const args = _resolvePromptBlockerArgs(opts)\n\n const resolver = useBlocker(args)\n const children = Solid.createMemo(() => {\n const child = propsWithChildren.children\n if (resolver && typeof child === 'function') return child(resolver())\n return child\n })\n\n return <>{children()}</>\n}\n\ntype LegacyPromptProps = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n children?: SolidNode | ((params: BlockerResolver) => SolidNode)\n}\n\ntype PromptProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n TParams = TWithResolver extends true ? BlockerResolver<TRouter> : void,\n> = UseBlockerOpts<TRouter, TWithResolver> & {\n children?: SolidNode | ((params: TParams) => SolidNode)\n}\n"],"mappings":";;;;;;AAoFA,SAAS,oBACP,MACA,WACgB;CAChB,IAAI,SAAS,KAAA,GACX,OAAO;EACL,qBAAqB;EACrB,cAAc;;CAIlB,IAAI,mBAAmB,MACrB,OAAO;CAGT,IAAI,OAAO,SAAS,YAAY;EAC9B,MAAM,cAAc,QAAQ,aAAa,IAAA;EAEzC,MAAM,mBAAmB,YAAY;GACnC,IAAI,aAAa,OAAO,MAAM,KAAA;GAC9B,OAAO;;EAGT,OAAO;GACL,eAAe;GACf,oBAAoB;GACpB,cAAc;;;CAIlB,MAAM,cAAc,SAAM,iBAAiB,QAAQ,KAAK,aAAa,IAAA,CAAK;CAE1E,MAAM,mBAAmB,YAAY;EACnC,IAAI,YAAA,KAAiB,KAAK,cAAc,KAAA,GACtC,OAAO,MAAM,KAAK,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cT,MAAM,mBAAmB,MAAM,IAXX,SAAkB,YAAY;IAChD,YAAY;KACV,QAAQ;KACR;KACA;KACA,QAAQ,cAAc;KACtB,eAAe,QAAQ,KAAA;KACvB,aAAa,QAAQ,IAAA;KACtB;IAG4B;GAC/B,YAAY;IACV,QAAQ;IACR,SAAS,KAAA;IACT,MAAM,KAAA;IACN,QAAQ,KAAA;IACR,SAAS,KAAA;IACT,OAAO,KAAA;IACR;GAED,OAAO;;EAGT,eAAe,OAAO,QAAQ,MAAM;GAClC,WAAW;GACX,oBAAoB,MAAM;GAC3B;;CAKL,SAAM,gBAAgB;EACpB,aAAa;GACX,eAAA;GACA,eAAe,KAAA;;;CAInB,OAAO;;AAGT,IAAM,6BACJ,UACmB;CACnB,IAAI,mBAAmB,OACrB,OAAO;CAGT,MAAM,cAAc,SAAM,iBAAiB,QAAQ,MAAM,aAAa,IAAA,CAAK;CAE3E,MAAM,mBAAmB,YAAY;EACnC,IAAI,YAAA,KAAiB,MAAM,cAAc,KAAA,GACvC,OAAO,MAAM,MAAM,UAAA;EAErB,OAAO;;CAGT,OAAO;EACL,eAAe;EACf,IAAI,qBAAqB;GACvB,OAAO,YAAA;;EAET,IAAI,eAAe;GACjB,OAAO,MAAM,cAAc,KAAA;;;;AAkBjC,IAAa,QAAwB,SAAS,MAC5C,MACW;CACX,MAAM,oBAAoB,EACxB,IAAI,WAAW;EACb,OAAO,KAAK;;CAKhB,MAAM,WAAW,WAFJ,0BAA0B,IAEX,CAAA;CAO5B,QAAA,GAAA,aAAA,MANiB,SAAM,iBAAiB;EACtC,MAAM,QAAQ,kBAAkB;EAChC,IAAI,YAAY,OAAO,UAAU,YAAY,OAAO,MAAM,SAAA,CAAU;EACpE,OAAO;EAGC,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useLoaderData.cjs","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseLoaderData","StrictOrFrom","UseLoaderDataResult","UseLoaderDataBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","UseLoaderDataOptions","UseLoaderDataRoute","opts","TId","useLoaderData","from","strict","loaderData"],"sources":["../../src/useLoaderData.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderData,\n StrictOrFrom,\n UseLoaderDataResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDataBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> {\n select?: (match: ResolveUseLoaderData<TRouter, TFrom, TStrict>) => TSelected\n}\n\nexport type UseLoaderDataOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseLoaderDataBaseOptions<TRouter, TFrom, TStrict, TSelected>\n\nexport type UseLoaderDataRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDataBaseOptions<TRouter, TId, true, TSelected>,\n) => Accessor<UseLoaderDataResult<TRouter, TId, true, TSelected>>\n\nexport function useLoaderData<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseLoaderDataOptions<TRouter, TFrom, TStrict, TSelected>,\n): Accessor<UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected>> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n select: (match) => {\n return opts.select ? opts.select(match.loaderData) : match.loaderData\n },\n }) as any\n}\n"],"mappings":";;AAkCA,SAAgBkB,cAMdF,MACmE;CACnE,OAAOhB,iBAAAA,SAAS;EACdmB,MAAMH,KAAKG;EACXC,QAAQJ,KAAKI;EACbZ,SAASC,UAAU;GACjB,OAAOO,KAAKR,SAASQ,KAAKR,OAAOC,MAAMY,UAAU,IAAIZ,MAAMY;EAC7D;CACF,CAAC;AACH"}
{"version":3,"file":"useLoaderData.cjs","names":[],"sources":["../../src/useLoaderData.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderData,\n StrictOrFrom,\n UseLoaderDataResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDataBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> {\n select?: (match: ResolveUseLoaderData<TRouter, TFrom, TStrict>) => TSelected\n}\n\nexport type UseLoaderDataOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseLoaderDataBaseOptions<TRouter, TFrom, TStrict, TSelected>\n\nexport type UseLoaderDataRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDataBaseOptions<TRouter, TId, true, TSelected>,\n) => Accessor<UseLoaderDataResult<TRouter, TId, true, TSelected>>\n\nexport function useLoaderData<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseLoaderDataOptions<TRouter, TFrom, TStrict, TSelected>,\n): Accessor<UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected>> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n select: (match) => {\n return opts.select ? opts.select(match.loaderData) : match.loaderData\n },\n }) as any\n}\n"],"mappings":";;AAkCA,SAAgB,cAMd,MACmE;CACnE,OAAO,iBAAA,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,SAAS,UAAU;GACjB,OAAO,KAAK,SAAS,KAAK,OAAO,MAAM,UAAA,IAAc,MAAM;;EAE9D"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useLoaderDeps.cjs","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseLoaderDeps","StrictOrFrom","UseLoaderDepsResult","UseLoaderDepsBaseOptions","select","deps","TRouter","TFrom","TSelected","UseLoaderDepsOptions","UseLoaderDepsRoute","opts","TId","useLoaderDeps","match","loaderDeps"],"sources":["../../src/useLoaderDeps.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderDeps,\n StrictOrFrom,\n UseLoaderDepsResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDepsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TSelected,\n> {\n select?: (deps: ResolveUseLoaderDeps<TRouter, TFrom>) => TSelected\n}\n\nexport type UseLoaderDepsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom> &\n UseLoaderDepsBaseOptions<TRouter, TFrom, TSelected>\n\nexport type UseLoaderDepsRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDepsBaseOptions<TRouter, TId, TSelected>,\n) => Accessor<UseLoaderDepsResult<TRouter, TId, TSelected>>\n\nexport function useLoaderDeps<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TSelected = unknown,\n>(\n opts: UseLoaderDepsOptions<TRouter, TFrom, TSelected>,\n): Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>> {\n return useMatch({\n ...opts,\n select: (match) => {\n return opts.select ? opts.select(match.loaderDeps) : match.loaderDeps\n },\n }) as Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>>\n}\n"],"mappings":";;AAgCA,SAAgBiB,cAKdF,MAC0D;CAC1D,OAAOf,iBAAAA,SAAS;EACd,GAAGe;EACHP,SAASU,UAAU;GACjB,OAAOH,KAAKP,SAASO,KAAKP,OAAOU,MAAMC,UAAU,IAAID,MAAMC;EAC7D;CACF,CAAC;AACH"}
{"version":3,"file":"useLoaderDeps.cjs","names":[],"sources":["../../src/useLoaderDeps.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderDeps,\n StrictOrFrom,\n UseLoaderDepsResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDepsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TSelected,\n> {\n select?: (deps: ResolveUseLoaderDeps<TRouter, TFrom>) => TSelected\n}\n\nexport type UseLoaderDepsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom> &\n UseLoaderDepsBaseOptions<TRouter, TFrom, TSelected>\n\nexport type UseLoaderDepsRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDepsBaseOptions<TRouter, TId, TSelected>,\n) => Accessor<UseLoaderDepsResult<TRouter, TId, TSelected>>\n\nexport function useLoaderDeps<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TSelected = unknown,\n>(\n opts: UseLoaderDepsOptions<TRouter, TFrom, TSelected>,\n): Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>> {\n return useMatch({\n ...opts,\n select: (match) => {\n return opts.select ? opts.select(match.loaderDeps) : match.loaderDeps\n },\n }) as Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>>\n}\n"],"mappings":";;AAgCA,SAAgB,cAKd,MAC0D;CAC1D,OAAO,iBAAA,SAAS;EACd,GAAG;EACH,SAAS,UAAU;GACjB,OAAO,KAAK,SAAS,KAAK,OAAO,MAAM,UAAA,IAAc,MAAM;;EAE9D"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useLocation.cjs","names":["Solid","replaceEqualDeep","useRouter","AnyRouter","RegisteredRouter","RouterState","Accessor","UseLocationBaseOptions","select","state","TRouter","TSelected","UseLocationResult","useLocation","opts","router","stores","location","get","createMemo","prev","res","undefined"],"sources":["../../src/useLocation.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport interface UseLocationBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (state: RouterState<TRouter['routeTree']>['location']) => TSelected\n}\n\nexport type UseLocationResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected\n ? RouterState<TRouter['routeTree']>['location']\n : TSelected\n\nexport function useLocation<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLocationBaseOptions<TRouter, TSelected>,\n): Accessor<UseLocationResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n\n if (!opts?.select) {\n return (() => router.stores.location.get()) as Accessor<\n UseLocationResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const res = select(router.stores.location.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n }) as Accessor<UseLocationResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;;;AAqBA,SAAgBa,YAIdC,MACiD;CACjD,MAAMC,SAASb,kBAAAA,UAAmB;CAElC,IAAI,CAACY,MAAMN,QACT,cAAcO,OAAOC,OAAOC,SAASC,IAAI;CAK3C,MAAMV,SAASM,KAAKN;CAEpB,OAAOR,SAAMmB,YAAYC,SAAgC;EACvD,MAAMC,MAAMb,OAAOO,OAAOC,OAAOC,SAASC,IAAI,CAAC;EAC/C,IAAIE,SAASE,KAAAA,GAAW,OAAOD;EAC/B,QAAA,GAAA,sBAAA,kBAAwBD,MAAMC,GAAG;CACnC,CAAC;AACH"}
{"version":3,"file":"useLocation.cjs","names":[],"sources":["../../src/useLocation.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport interface UseLocationBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (state: RouterState<TRouter['routeTree']>['location']) => TSelected\n}\n\nexport type UseLocationResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected\n ? RouterState<TRouter['routeTree']>['location']\n : TSelected\n\nexport function useLocation<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLocationBaseOptions<TRouter, TSelected>,\n): Accessor<UseLocationResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n\n if (!opts?.select) {\n return (() => router.stores.location.get()) as Accessor<\n UseLocationResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const res = select(router.stores.location.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n }) as Accessor<UseLocationResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;;;AAqBA,SAAgB,YAId,MACiD;CACjD,MAAM,SAAS,kBAAA,UAAU;CAEzB,IAAI,CAAC,MAAM,QACT,cAAc,OAAO,OAAO,SAAS,IAAA;CAKvC,MAAM,SAAS,KAAK;CAEpB,OAAO,SAAM,YAAY,SAAgC;EACvD,MAAM,MAAM,OAAO,OAAO,OAAO,SAAS,IAAA,CAAK;EAC/C,IAAI,SAAS,KAAA,GAAW,OAAO;EAC/B,QAAA,GAAA,sBAAA,kBAAwB,MAAM,GAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useMatch.cjs","names":["Solid","invariant","replaceEqualDeep","nearestMatchContext","useRouter","AnyRouter","MakeRouteMatch","MakeRouteMatchUnion","RegisteredRouter","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseMatchBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseMatchRoute","opts","Accessor","UseMatchResult","UseMatchOptions","useMatch","router","nearestMatch","from","undefined","useContext","stores","matches","get","find","routeId","createMemo","prev","selectedMatch","hasPendingMatch","Boolean","pendingRouteIds","hasPending","isTransitioning","process","env","NODE_ENV","Error","res"],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.matches\n .get()\n .find((match) => match.routeId === opts.from)\n }\n\n return nearestMatch?.match()\n }\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) {\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n prev !== undefined &&\n (hasPendingMatch || router.stores.isTransitioning.get())\n ) {\n return prev\n }\n\n if (!hasPendingMatch && (opts.shouldThrow ?? true)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n\n return undefined\n }\n\n const res = opts.select ? opts.select(selectedMatch) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;;;AAsDA,SAAgB0B,SAOdJ,MASA;CACA,MAAMK,SAASvB,kBAAAA,UAAmB;CAClC,MAAMwB,eAAeN,KAAKO,OACtBC,KAAAA,IACA9B,SAAM+B,WAAW5B,qBAAAA,mBAAmB;CAExC,MAAMW,cAAc;EAClB,IAAIQ,KAAKO,MACP,OAAOF,OAAOK,OAAOC,QAClBC,IAAI,EACJC,MAAMrB,UAAUA,MAAMsB,YAAYd,KAAKO,IAAI;EAGhD,OAAOD,cAAcd,MAAM;CAC7B;CAEA,OAAOd,SAAMqC,YAAYC,SAAgC;EACvD,MAAMC,gBAAgBzB,MAAM;EAE5B,IAAIyB,kBAAkBT,KAAAA,GAAW;GAC/B,MAAMU,kBAAkBlB,KAAKO,OACzBY,QAAQd,OAAOK,OAAOU,gBAAgBR,IAAI,EAAEZ,KAAKO,KAAM,IACtDD,cAAce,WAAW,KAAK;GAEnC,IACEL,SAASR,KAAAA,MACRU,mBAAmBb,OAAOK,OAAOY,gBAAgBV,IAAI,IAEtD,OAAOI;GAGT,IAAI,CAACE,oBAAoBlB,KAAKH,eAAe,OAAO;IAClD,IAAA,QAAA,IAAA,aAA6B,cAC3B,MAAM,IAAI6B,MACR,oCAAoC1B,KAAKO,OAAO,yBAAyBP,KAAKO,KAAI,KAAM,oBAC1F;IAGF5B,CAAAA,GAAAA,sBAAAA,WAAU;GACZ;GAEA;EACF;EAEA,MAAMgD,MAAM3B,KAAKT,SAASS,KAAKT,OAAO0B,aAAa,IAAIA;EACvD,IAAID,SAASR,KAAAA,GAAW,OAAOmB;EAC/B,QAAA,GAAA,sBAAA,kBAAwBX,MAAMW,GAAG;CACnC,CAAC;AACH"}
{"version":3,"file":"useMatch.cjs","names":[],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.matches\n .get()\n .find((match) => match.routeId === opts.from)\n }\n\n return nearestMatch?.match()\n }\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) {\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n prev !== undefined &&\n (hasPendingMatch || router.stores.isTransitioning.get())\n ) {\n return prev\n }\n\n if (!hasPendingMatch && (opts.shouldThrow ?? true)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n\n return undefined\n }\n\n const res = opts.select ? opts.select(selectedMatch) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;;;AAsDA,SAAgB,SAOd,MASA;CACA,MAAM,SAAS,kBAAA,UAAU;CACzB,MAAM,eAAe,KAAK,OACtB,KAAA,IACA,SAAM,WAAW,qBAAA,mBAAA;CAErB,MAAM,cAAc;EAClB,IAAI,KAAK,MACP,OAAO,OAAO,OAAO,QAClB,IAAA,EACA,MAAM,UAAU,MAAM,YAAY,KAAK,IAAA;EAG5C,OAAO,cAAc,MAAA;;CAGvB,OAAO,SAAM,YAAY,SAAgC;EACvD,MAAM,gBAAgB,MAAA;EAEtB,IAAI,kBAAkB,KAAA,GAAW;GAC/B,MAAM,kBAAkB,KAAK,OACzB,QAAQ,OAAO,OAAO,gBAAgB,IAAA,EAAM,KAAK,KAAA,IAChD,cAAc,WAAA,KAAgB;GAEnC,IACE,SAAS,KAAA,MACR,mBAAmB,OAAO,OAAO,gBAAgB,IAAA,IAElD,OAAO;GAGT,IAAI,CAAC,oBAAoB,KAAK,eAAe,OAAO;IAClD,IAAA,QAAA,IAAA,aAA6B,cAC3B,MAAM,IAAI,MACR,oCAAoC,KAAK,OAAO,yBAAyB,KAAK,KAAK,KAAK,oBAAA;IAI5F,CAAA,GAAA,sBAAA,WAAA;;GAGF;;EAGF,MAAM,MAAM,KAAK,SAAS,KAAK,OAAO,aAAA,IAAiB;EACvD,IAAI,SAAS,KAAA,GAAW,OAAO;EAC/B,QAAA,GAAA,sBAAA,kBAAwB,MAAM,GAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useNavigate.cjs","names":["Solid","useRouter","AnyRouter","FromPathOption","NavigateOptions","RegisteredRouter","UseNavigateResult","useNavigate","_defaultOpts","from","TRouter","TDefaultFrom","router","options","navigate","Navigate","TFrom","props","TTo","TMaskFrom","TMaskTo","onSettled"],"sources":["../../src/useNavigate.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n FromPathOption,\n NavigateOptions,\n RegisteredRouter,\n UseNavigateResult,\n} from '@tanstack/router-core'\n\nexport function useNavigate<\n TRouter extends AnyRouter = RegisteredRouter,\n TDefaultFrom extends string = string,\n>(_defaultOpts?: {\n from?: FromPathOption<TRouter, TDefaultFrom>\n}): UseNavigateResult<TDefaultFrom> {\n const router = useRouter()\n\n return ((options: NavigateOptions) => {\n return router.navigate({\n ...options,\n from: options.from ?? _defaultOpts?.from,\n })\n }) as UseNavigateResult<TDefaultFrom>\n}\n\nexport function Navigate<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): null {\n const { navigate } = useRouter()\n\n Solid.onSettled(() => {\n navigate({\n ...props,\n })\n })\n\n return null\n}\n"],"mappings":";;;;;AAUA,SAAgBO,YAGdC,cAEkC;CAClC,MAAMI,SAASX,kBAAAA,UAAU;CAEzB,SAASY,YAA6B;EACpC,OAAOD,OAAOE,SAAS;GACrB,GAAGD;GACHJ,MAAMI,QAAQJ,QAAQD,cAAcC;EACtC,CAAC;CACH;AACF;AAEA,SAAgBM,SAMdE,OAAuE;CACvE,MAAM,EAAEH,aAAab,kBAAAA,UAAU;CAE/BD,SAAMqB,gBAAgB;EACpBP,SAAS,EACP,GAAGG,MACL,CAAC;CACH,CAAC;CAED,OAAO;AACT"}
{"version":3,"file":"useNavigate.cjs","names":[],"sources":["../../src/useNavigate.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n FromPathOption,\n NavigateOptions,\n RegisteredRouter,\n UseNavigateResult,\n} from '@tanstack/router-core'\n\nexport function useNavigate<\n TRouter extends AnyRouter = RegisteredRouter,\n TDefaultFrom extends string = string,\n>(_defaultOpts?: {\n from?: FromPathOption<TRouter, TDefaultFrom>\n}): UseNavigateResult<TDefaultFrom> {\n const router = useRouter()\n\n return ((options: NavigateOptions) => {\n return router.navigate({\n ...options,\n from: options.from ?? _defaultOpts?.from,\n })\n }) as UseNavigateResult<TDefaultFrom>\n}\n\nexport function Navigate<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): null {\n const { navigate } = useRouter()\n\n Solid.onSettled(() => {\n navigate({\n ...props,\n })\n })\n\n return null\n}\n"],"mappings":";;;;;AAUA,SAAgB,YAGd,cAEkC;CAClC,MAAM,SAAS,kBAAA,UAAA;CAEf,SAAS,YAA6B;EACpC,OAAO,OAAO,SAAS;GACrB,GAAG;GACH,MAAM,QAAQ,QAAQ,cAAc;GACrC;;;AAIL,SAAgB,SAMd,OAAuE;CACvE,MAAM,EAAE,aAAa,kBAAA,UAAA;CAErB,SAAM,gBAAgB;EACpB,SAAS,EACP,GAAG,MAAA,CACJ;;CAGH,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useParams.cjs","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseParams","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseParamsResult","UseParamsBaseOptions","select","params","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseParamsOptions","UseParamsRoute","opts","useParams","from","strict","match","_strictParams"],"sources":["../../src/useParams.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseParams,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (params: ResolveUseParams<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseParamsBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseParamsRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseParamsBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseParamsResult<TRouter, TFrom, true, TSelected>>\n\nexport function useParams<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseParamsOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseParamsResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const params = opts.strict === false ? match.params : match._strictParams\n return opts.select ? opts.select(params) : params\n },\n }) as Accessor<any>\n}\n"],"mappings":";;AA6CA,SAAgBqB,UAOdD,MASA;CACA,OAAOpB,iBAAAA,SAAS;EACdsB,MAAMF,KAAKE;EACXC,QAAQH,KAAKG;EACbP,aAAaI,KAAKJ;EAClBN,SAASc,UAAU;GACjB,MAAMb,SAASS,KAAKG,WAAW,QAAQC,MAAMb,SAASa,MAAMC;GAC5D,OAAOL,KAAKV,SAASU,KAAKV,OAAOC,MAAM,IAAIA;EAC7C;CACF,CAAC;AACH"}
{"version":3,"file":"useParams.cjs","names":[],"sources":["../../src/useParams.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseParams,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (params: ResolveUseParams<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseParamsBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseParamsRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseParamsBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseParamsResult<TRouter, TFrom, true, TSelected>>\n\nexport function useParams<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseParamsOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseParamsResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const params = opts.strict === false ? match.params : match._strictParams\n return opts.select ? opts.select(params) : params\n },\n }) as Accessor<any>\n}\n"],"mappings":";;AA6CA,SAAgB,UAOd,MASA;CACA,OAAO,iBAAA,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,aAAa,KAAK;EAClB,SAAS,UAAU;GACjB,MAAM,SAAS,KAAK,WAAW,QAAQ,MAAM,SAAS,MAAM;GAC5D,OAAO,KAAK,SAAS,KAAK,OAAO,MAAA,IAAU;;EAE9C"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useRouter.cjs","names":["Solid","routerContext","AnyRouter","RegisteredRouter","useRouter","opts","warn","TRouter","value","useContext","process","env","NODE_ENV","console"],"sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = Solid.useContext(routerContext)\n if (process.env.NODE_ENV !== 'production') {\n if ((opts?.warn ?? true) && !value) {\n console.warn(\n 'Warning: useRouter must be used inside a <RouterProvider> component!',\n )\n }\n }\n return value as TRouter\n}\n"],"mappings":";;;;;AAIA,SAAgBI,UAAwDC,MAE5D;CACV,MAAMG,QAAQR,SAAMS,WAAWR,sBAAAA,aAAa;CAC5C,IAAA,QAAA,IAAA,aAA6B;OACtBI,MAAMC,QAAQ,SAAS,CAACE,OAC3BK,QAAQP,KACN,sEACF;CAAA;CAGJ,OAAOE;AACT"}
{"version":3,"file":"useRouter.cjs","names":[],"sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = Solid.useContext(routerContext)\n if (process.env.NODE_ENV !== 'production') {\n if ((opts?.warn ?? true) && !value) {\n console.warn(\n 'Warning: useRouter must be used inside a <RouterProvider> component!',\n )\n }\n }\n return value as TRouter\n}\n"],"mappings":";;;;;AAIA,SAAgB,UAAwD,MAE5D;CACV,MAAM,QAAQ,SAAM,WAAW,sBAAA,aAAA;CAC/B,IAAA,QAAA,IAAA,aAA6B;OACtB,MAAM,QAAQ,SAAS,CAAC,OAC3B,QAAQ,KACN,sEAAA;CAAA;CAIN,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useRouterState.cjs","names":["Solid","replaceEqualDeep","useRouter","AnyRouter","RegisteredRouter","RouterState","Accessor","UseRouterStateOptions","router","TRouter","select","state","TSelected","UseRouterStateResult","useRouterState","opts","contextRouter","warn","undefined","stores","__store","get","createMemo","prev","res","transparent","MemoOptions","ssrSource"],"sources":["../../src/useRouterState.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport type UseRouterStateOptions<TRouter extends AnyRouter, TSelected> = {\n router?: TRouter\n select?: (state: RouterState<TRouter['routeTree']>) => TSelected\n}\n\nexport type UseRouterStateResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\nexport function useRouterState<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseRouterStateOptions<TRouter, TSelected>,\n): Accessor<UseRouterStateResult<TRouter, TSelected>> {\n const contextRouter = useRouter<TRouter>({\n warn: opts?.router === undefined,\n })\n const router = opts?.router || contextRouter\n\n if (!opts?.select) {\n return (() => router.stores.__store.get()) as Accessor<\n UseRouterStateResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo(\n (prev: TSelected | undefined) => {\n const res = select(router.stores.__store.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n },\n { transparent: true } as Solid.MemoOptions<TSelected> & {\n ssrSource?: 'server' | 'hybrid'\n },\n ) as Accessor<UseRouterStateResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;;;AAoBA,SAAgBc,eAIdC,MACoD;CACpD,MAAMC,gBAAgBd,kBAAAA,UAAmB,EACvCe,MAAMF,MAAMP,WAAWU,KAAAA,EACzB,CAAC;CACD,MAAMV,SAASO,MAAMP,UAAUQ;CAE/B,IAAI,CAACD,MAAML,QACT,cAAcF,OAAOW,OAAOC,QAAQC,IAAI;CAK1C,MAAMX,SAASK,KAAKL;CAEpB,OAAOV,SAAMsB,YACVC,SAAgC;EAC/B,MAAMC,MAAMd,OAAOF,OAAOW,OAAOC,QAAQC,IAAI,CAAC;EAC9C,IAAIE,SAASL,KAAAA,GAAW,OAAOM;EAC/B,QAAA,GAAA,sBAAA,kBAAwBD,MAAMC,GAAG;CACnC,GACA,EAAEC,aAAa,KAAK,CAGtB;AACF"}
{"version":3,"file":"useRouterState.cjs","names":[],"sources":["../../src/useRouterState.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport type UseRouterStateOptions<TRouter extends AnyRouter, TSelected> = {\n router?: TRouter\n select?: (state: RouterState<TRouter['routeTree']>) => TSelected\n}\n\nexport type UseRouterStateResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\nexport function useRouterState<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseRouterStateOptions<TRouter, TSelected>,\n): Accessor<UseRouterStateResult<TRouter, TSelected>> {\n const contextRouter = useRouter<TRouter>({\n warn: opts?.router === undefined,\n })\n const router = opts?.router || contextRouter\n\n if (!opts?.select) {\n return (() => router.stores.__store.get()) as Accessor<\n UseRouterStateResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo(\n (prev: TSelected | undefined) => {\n const res = select(router.stores.__store.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n },\n { transparent: true } as Solid.MemoOptions<TSelected> & {\n ssrSource?: 'server' | 'hybrid'\n },\n ) as Accessor<UseRouterStateResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;;;AAoBA,SAAgB,eAId,MACoD;CACpD,MAAM,gBAAgB,kBAAA,UAAmB,EACvC,MAAM,MAAM,WAAW,KAAA,EAAA,CACxB;CACD,MAAM,SAAS,MAAM,UAAU;CAE/B,IAAI,CAAC,MAAM,QACT,cAAc,OAAO,OAAO,QAAQ,IAAA;CAKtC,MAAM,SAAS,KAAK;CAEpB,OAAO,SAAM,YACV,SAAgC;EAC/B,MAAM,MAAM,OAAO,OAAO,OAAO,QAAQ,IAAA,CAAK;EAC9C,IAAI,SAAS,KAAA,GAAW,OAAO;EAC/B,QAAA,GAAA,sBAAA,kBAAwB,MAAM,GAAA;IAEhC,EAAE,aAAa,KAAA,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useSearch.cjs","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseSearch","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseSearchResult","UseSearchBaseOptions","select","state","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseSearchOptions","UseSearchRoute","opts","useSearch","from","strict","match","search"],"sources":["../../src/useSearch.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseSearch,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (state: ResolveUseSearch<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseSearchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseSearchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseSearchBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseSearchResult<TRouter, TFrom, true, TSelected>>\n\nexport function useSearch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseSearchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseSearchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const search = match.search\n return opts.select ? opts.select(search) : search\n },\n }) as any\n}\n"],"mappings":";;AA6CA,SAAgBqB,UAOdD,MASA;CACA,OAAOpB,iBAAAA,SAAS;EACdsB,MAAMF,KAAKE;EACXC,QAAQH,KAAKG;EACbP,aAAaI,KAAKJ;EAClBN,SAASc,UAAU;GACjB,MAAMC,SAASD,MAAMC;GACrB,OAAOL,KAAKV,SAASU,KAAKV,OAAOe,MAAM,IAAIA;EAC7C;CACF,CAAC;AACH"}
{"version":3,"file":"useSearch.cjs","names":[],"sources":["../../src/useSearch.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseSearch,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (state: ResolveUseSearch<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseSearchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseSearchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseSearchBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseSearchResult<TRouter, TFrom, true, TSelected>>\n\nexport function useSearch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseSearchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseSearchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const search = match.search\n return opts.select ? opts.select(search) : search\n },\n }) as any\n}\n"],"mappings":";;AA6CA,SAAgB,UAOd,MASA;CACA,OAAO,iBAAA,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,aAAa,KAAK;EAClB,SAAS,UAAU;GACjB,MAAM,SAAS,MAAM;GACrB,OAAO,KAAK,SAAS,KAAK,OAAO,MAAA,IAAU;;EAE9C"}

@@ -6,3 +6,7 @@ import { useRouter } from "./useRouter.js";

//#region src/Asset.tsx
var _tmpl$ = /* @__PURE__ */ template(`<style>`), _tmpl$2 = /* @__PURE__ */ template(`<meta>`), _tmpl$3 = /* @__PURE__ */ template(`<link>`), _tmpl$4 = /* @__PURE__ */ template(`<title>`), _tmpl$5 = /* @__PURE__ */ template(`<script>`);
var _tmpl$ = /* @__PURE__ */ template(`<style>`);
var _tmpl$2 = /* @__PURE__ */ template(`<meta>`);
var _tmpl$3 = /* @__PURE__ */ template(`<link>`);
var _tmpl$4 = /* @__PURE__ */ template(`<title>`);
var _tmpl$5 = /* @__PURE__ */ template(`<script>`);
var INLINE_CSS_HYDRATION_ATTR = "data-tsr-inline-css";

@@ -81,3 +85,5 @@ function Asset(asset) {

var _el$2 = _tmpl$2();
spread(_el$2, mergeProps(() => props.attrs), false);
spread(_el$2, mergeProps(() => {
return props.attrs;
}), false);
return _el$2;

@@ -88,3 +94,5 @@ })();

var _el$3 = _tmpl$3();
spread(_el$3, mergeProps(() => props.attrs), false);
spread(_el$3, mergeProps(() => {
return props.attrs;
}), false);
return _el$3;

@@ -103,5 +111,11 @@ })();

var _el$4 = _tmpl$4();
ref(() => (e) => el = e, _el$4);
spread(_el$4, mergeProps(() => props.attrs), true);
insert(_el$4, () => props.children);
ref(() => {
return (e) => el = e;
}, _el$4);
spread(_el$4, mergeProps(() => {
return props.attrs;
}), true);
insert(_el$4, () => {
return props.children;
});
return _el$4;

@@ -122,3 +136,3 @@ }

var _el$6 = _tmpl$5();
spread(_el$6, mergeProps(attrs, { "innerHTML": children }), false);
spread(_el$6, mergeProps(attrs, { innerHTML: children }), false);
return _el$6;

@@ -130,3 +144,3 @@ }

var _el$7 = _tmpl$5();
spread(_el$7, mergeProps(attrs, { "innerHTML": children }), false);
spread(_el$7, mergeProps(attrs, { innerHTML: children }), false);
return _el$7;

@@ -133,0 +147,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"Asset.js","names":["isServer","createEffect","onCleanup","onSettled","useRouter","RouterManagedTag","JSX","INLINE_CSS_HYDRATION_ATTR","Asset","asset","Element","tag","attrs","children","_$createComponent","Title","HeadElement","inlineCss","process","env","TSS_INLINE_CSS_ENABLED","undefined","InlineCssStyle","Script","useRelocateToHead","getEl","Node","el","parentNode","document","head","appendChild","removeChild","Record","isInlineCssPlaceholder","html","querySelector","HTMLStyleElement","textContent","ScriptAttrs","key","src","props","element","innerHTML","_el$","_tmpl$","_$spread","_el$2","_tmpl$2","_$mergeProps","_el$3","_tmpl$3","HTMLTitleElement","titleText","title","_el$4","_tmpl$4","_$ref","e","_$insert","router","dataScript","type","_el$5","_tmpl$5","_el$6","_el$7","const","script","HTMLScriptElement","normSrc","base","baseURI","window","location","href","URL","existingScript","Array","from","querySelectorAll","find","createElement","value","Object","entries","setAttribute","String","typeAttr","nonceAttr","nonce","sType","getAttribute","sNonce"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect, onCleanup, onSettled } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst INLINE_CSS_HYDRATION_ATTR = 'data-tsr-inline-css'\n\nexport function Asset(asset: RouterManagedTag): JSX.Element | null {\n const { tag, attrs, children } = asset\n\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <HeadElement tag=\"meta\" attrs={attrs} />\n case 'link':\n return <HeadElement tag=\"link\" attrs={attrs} />\n case 'style':\n if (\n asset.inlineCss &&\n (process.env.TSS_INLINE_CSS_ENABLED === 'true' ||\n (process.env.TSS_INLINE_CSS_ENABLED === undefined && isServer))\n ) {\n return <InlineCssStyle attrs={attrs}>{children}</InlineCssStyle>\n }\n\n return <HeadElement tag=\"style\" attrs={attrs} children={children} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\n// On the client, relocate a rendered head element into document.head so head\n// tags end up in the right place even when <HeadContent /> is rendered in\n// <body>. The *same* node that Solid rendered/hydrated is moved — never\n// recreated — so the server-rendered node stays claimed (its hydration id is\n// preserved) and stylesheets/scripts are not refetched or re-executed.\n//\n// When <HeadContent /> is placed in <head> (the SSR/hydration case), the node\n// is already in document.head, so this is a no-op and the element is left\n// exactly where Solid hydrated it.\nfunction useRelocateToHead(getEl: () => Node | undefined) {\n onSettled(() => {\n const el = getEl()\n if (el && el.parentNode !== document.head) {\n document.head.appendChild(el)\n }\n })\n\n onCleanup(() => {\n const el = getEl()\n if (el?.parentNode) {\n el.parentNode.removeChild(el)\n }\n })\n}\n\nfunction InlineCssStyle({\n attrs,\n children,\n}: {\n attrs?: Record<string, any>\n children?: RouterManagedTag['children']\n}) {\n const isInlineCssPlaceholder = children === undefined\n const html = isInlineCssPlaceholder\n ? typeof document === 'undefined'\n ? ''\n : (document.querySelector<HTMLStyleElement>(\n `style[${INLINE_CSS_HYDRATION_ATTR}]`,\n )?.textContent ?? '')\n : (children ?? '')\n\n return (\n <HeadElement\n tag=\"style\"\n attrs={{ ...attrs, [INLINE_CSS_HYDRATION_ATTR]: '' }}\n children={html}\n />\n )\n}\n\ninterface ScriptAttrs {\n [key: string]: string | boolean | undefined\n src?: string\n}\n\nfunction HeadElement(props: {\n tag: 'meta' | 'link' | 'style'\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n // Each branch must live in its own `case` block so the Solid compiler emits\n // exactly ONE getNextElement() per invocation. Sequential `if ... return`\n // statements compile to multiple getNextElement() calls that all execute,\n // desyncing the hydration key counter (causing \"expected <style>\" mismatches\n // and unclaimed nodes).\n //\n // We capture the element via the JSX return value (a real DOM node in Solid)\n // rather than a `ref` attribute: a `ref` compiles to a _$ref() call that\n // interferes with attribute spreading on hydration-claimed nodes (wiping the\n // SSR attributes).\n let element: Element\n switch (props.tag) {\n case 'style': {\n const attrs = {\n ...props.attrs,\n innerHTML:\n typeof props.children === 'string' ? props.children : undefined,\n }\n element = (<style {...attrs} />) as unknown as Element\n break\n }\n case 'meta':\n element = (<meta {...props.attrs} />) as unknown as Element\n break\n default:\n element = (<link {...props.attrs} />) as unknown as Element\n }\n\n // Move the rendered/hydrated element into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>. Called unconditionally so\n // server and client register the same primitives (see Title).\n useRelocateToHead(() => element)\n\n return element as unknown as JSX.Element\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n let el: HTMLTitleElement | undefined\n\n // IMPORTANT: call these hooks UNCONDITIONALLY (do not guard with isServer).\n // Solid's hydration relies on the component body registering the same\n // reactive primitives in the same order on the server and the client. An\n // `if (!isServer)` guard would skip them on the server but run them on the\n // client, desyncing the hydration owner tree and causing the server <title>\n // to be left unclaimed (and a duplicate appended). These hooks are no-ops\n // during SSR anyway.\n\n // Move the rendered/hydrated <title> into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>.\n useRelocateToHead(() => el)\n\n // Keep document.title in sync during client-side navigation.\n createEffect(\n () => props.children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n return (\n <title ref={(e) => (el = e)} {...props.attrs}>\n {props.children as string}\n </title>\n )\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation. The injection is\n // idempotent (it checks for an already-present matching script), so the\n // server-rendered script node is reused rather than duplicated.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;AAMA,IAAMO,4BAA4B;AAElC,SAAgBC,MAAMC,OAA6C;CACjE,MAAM,EAAEE,KAAKC,OAAOC,aAAaJ;CAEjC,QAAQE,KAAR;EACE,KAAK,SACH,OAAAG,gBAAQC,OAAK;GAAQH;GAAiBC;EAAQ,CAAA;EAChD,KAAK,QACH,OAAAC,gBAAQE,aAAW;GAACL,KAAG;GAAeC;EAAK,CAAA;EAC7C,KAAK,QACH,OAAAE,gBAAQE,aAAW;GAACL,KAAG;GAAeC;EAAK,CAAA;EAC7C,KAAK;GACH,IACEH,MAAMQ,cACLC,QAAQC,IAAIC,2BAA2B,UACrCF,QAAQC,IAAIC,2BAA2BC,KAAAA,KAAarB,WAEvD,OAAAc,gBAAQQ,gBAAc;IAAQV;IAA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QAAQ;GACxCd,OAAO/B,cAAczB;GAErB,IAAID;SACG,MAAM,CAAC4B,KAAK4C,UAAUC,OAAOC,QAAQ1E,KAAK,GAC7C,IAAIwE,UAAU/D,KAAAA,KAAa+D,UAAU,OACnCf,OAAOkB,aACL/C,KACA,OAAO4C,UAAU,YAAY,KAAKI,OAAOJ,KAAK,CAChD;GAAA;GAKNvD,SAASC,KAAKC,YAAYsC,MAAM;EAClC;EAEA,aAAa;GACX,IAAIA,QAAQzC,YACVyC,OAAOzC,WAAWI,YAAYqC,MAAM;EAExC;CACF,CACF;CAEA,OAAO;AACT"}
{"version":3,"file":"Asset.js","names":["<Title attrs={attrs} children={children} />","<HeadElement tag=\"meta\" attrs={attrs} />","tag=\"meta\"","<HeadElement tag=\"link\" attrs={attrs} />","tag=\"link\"","<InlineCssStyle attrs={attrs}>{children}</InlineCssStyle>","<HeadElement tag=\"style\" attrs={attrs} children={children} />","tag=\"style\"","<Script attrs={attrs} children={children} />","<HeadElement\n tag=\"style\"\n attrs={{ ...attrs, [INLINE_CSS_HYDRATION_ATTR]: '' }}\n children={html}\n />","children={html}","ref={(e) => (el = e)}","<title ref={(e) => (el = e)} {...props.attrs}>\n {props.children as string}\n </title>","<script {...attrs} />","innerHTML={children}","<script {...attrs} innerHTML={children} />"],"sources":["../../src/Asset.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { createEffect, onCleanup, onSettled } from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type { RouterManagedTag } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst INLINE_CSS_HYDRATION_ATTR = 'data-tsr-inline-css'\n\nexport function Asset(asset: RouterManagedTag): JSX.Element | null {\n const { tag, attrs, children } = asset\n\n switch (tag) {\n case 'title':\n return <Title attrs={attrs} children={children} />\n case 'meta':\n return <HeadElement tag=\"meta\" attrs={attrs} />\n case 'link':\n return <HeadElement tag=\"link\" attrs={attrs} />\n case 'style':\n if (\n asset.inlineCss &&\n (process.env.TSS_INLINE_CSS_ENABLED === 'true' ||\n (process.env.TSS_INLINE_CSS_ENABLED === undefined && isServer))\n ) {\n return <InlineCssStyle attrs={attrs}>{children}</InlineCssStyle>\n }\n\n return <HeadElement tag=\"style\" attrs={attrs} children={children} />\n case 'script':\n return <Script attrs={attrs} children={children} />\n default:\n return null\n }\n}\n\n// On the client, relocate a rendered head element into document.head so head\n// tags end up in the right place even when <HeadContent /> is rendered in\n// <body>. The *same* node that Solid rendered/hydrated is moved — never\n// recreated — so the server-rendered node stays claimed (its hydration id is\n// preserved) and stylesheets/scripts are not refetched or re-executed.\n//\n// When <HeadContent /> is placed in <head> (the SSR/hydration case), the node\n// is already in document.head, so this is a no-op and the element is left\n// exactly where Solid hydrated it.\nfunction useRelocateToHead(getEl: () => Node | undefined) {\n onSettled(() => {\n const el = getEl()\n if (el && el.parentNode !== document.head) {\n document.head.appendChild(el)\n }\n })\n\n onCleanup(() => {\n const el = getEl()\n if (el?.parentNode) {\n el.parentNode.removeChild(el)\n }\n })\n}\n\nfunction InlineCssStyle({\n attrs,\n children,\n}: {\n attrs?: Record<string, any>\n children?: RouterManagedTag['children']\n}) {\n const isInlineCssPlaceholder = children === undefined\n const html = isInlineCssPlaceholder\n ? typeof document === 'undefined'\n ? ''\n : (document.querySelector<HTMLStyleElement>(\n `style[${INLINE_CSS_HYDRATION_ATTR}]`,\n )?.textContent ?? '')\n : (children ?? '')\n\n return (\n <HeadElement\n tag=\"style\"\n attrs={{ ...attrs, [INLINE_CSS_HYDRATION_ATTR]: '' }}\n children={html}\n />\n )\n}\n\ninterface ScriptAttrs {\n [key: string]: string | boolean | undefined\n src?: string\n}\n\nfunction HeadElement(props: {\n tag: 'meta' | 'link' | 'style'\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n // Each branch must live in its own `case` block so the Solid compiler emits\n // exactly ONE getNextElement() per invocation. Sequential `if ... return`\n // statements compile to multiple getNextElement() calls that all execute,\n // desyncing the hydration key counter (causing \"expected <style>\" mismatches\n // and unclaimed nodes).\n //\n // We capture the element via the JSX return value (a real DOM node in Solid)\n // rather than a `ref` attribute: a `ref` compiles to a _$ref() call that\n // interferes with attribute spreading on hydration-claimed nodes (wiping the\n // SSR attributes).\n let element: Element\n switch (props.tag) {\n case 'style': {\n const attrs = {\n ...props.attrs,\n innerHTML:\n typeof props.children === 'string' ? props.children : undefined,\n }\n element = (<style {...attrs} />) as unknown as Element\n break\n }\n case 'meta':\n element = (<meta {...props.attrs} />) as unknown as Element\n break\n default:\n element = (<link {...props.attrs} />) as unknown as Element\n }\n\n // Move the rendered/hydrated element into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>. Called unconditionally so\n // server and client register the same primitives (see Title).\n useRelocateToHead(() => element)\n\n return element as unknown as JSX.Element\n}\n\nfunction Title(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n let el: HTMLTitleElement | undefined\n\n // IMPORTANT: call these hooks UNCONDITIONALLY (do not guard with isServer).\n // Solid's hydration relies on the component body registering the same\n // reactive primitives in the same order on the server and the client. An\n // `if (!isServer)` guard would skip them on the server but run them on the\n // client, desyncing the hydration owner tree and causing the server <title>\n // to be left unclaimed (and a duplicate appended). These hooks are no-ops\n // during SSR anyway.\n\n // Move the rendered/hydrated <title> into <head> when <HeadContent /> is\n // placed in <body>. No-op when already in <head>.\n useRelocateToHead(() => el)\n\n // Keep document.title in sync during client-side navigation.\n createEffect(\n () => props.children,\n (titleText) => {\n document.title = typeof titleText === 'string' ? titleText : ''\n },\n )\n\n return (\n <title ref={(e) => (el = e)} {...props.attrs}>\n {props.children as string}\n </title>\n )\n}\n\nfunction Script(props: {\n attrs?: Record<string, any>\n children?: unknown\n}): JSX.Element | null {\n const router = useRouter()\n const attrs = props.attrs\n const children = props.children\n\n const dataScript =\n typeof attrs?.type === 'string' &&\n attrs.type !== '' &&\n attrs.type !== 'text/javascript' &&\n attrs.type !== 'module'\n\n // --- Server rendering ---\n if (isServer ?? router.isServer) {\n if (attrs?.src) {\n return <script {...attrs} />\n }\n\n if (typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n return null\n }\n\n // --- Client rendering ---\n\n // Data scripts (e.g. application/ld+json) are rendered in the tree;\n // they don't need to execute.\n if (dataScript && typeof children === 'string') {\n return <script {...attrs} innerHTML={children} />\n }\n\n // For executable scripts, use imperative DOM injection so the browser\n // actually executes them during client-side navigation. The injection is\n // idempotent (it checks for an already-present matching script), so the\n // server-rendered script node is reused rather than duplicated.\n createEffect(\n () => ({ attrs, children, dataScript }) as const,\n ({ attrs, children, dataScript }) => {\n if (dataScript) return\n\n let script: HTMLScriptElement | undefined\n\n if (attrs?.src) {\n const normSrc = (() => {\n try {\n const base = document.baseURI || window.location.href\n return new URL(attrs.src, base).href\n } catch {\n return attrs.src\n }\n })()\n const existingScript = Array.from(\n document.querySelectorAll('script[src]'),\n ).find((el) => (el as HTMLScriptElement).src === normSrc)\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n\n document.head.appendChild(script)\n } else if (typeof children === 'string') {\n const typeAttr =\n typeof attrs?.type === 'string' ? attrs.type : 'text/javascript'\n const nonceAttr =\n typeof attrs?.nonce === 'string' ? attrs.nonce : undefined\n const existingScript = Array.from(\n document.querySelectorAll('script:not([src])'),\n ).find((el) => {\n if (!(el instanceof HTMLScriptElement)) return false\n const sType = el.getAttribute('type') ?? 'text/javascript'\n const sNonce = el.getAttribute('nonce') ?? undefined\n return (\n el.textContent === children &&\n sType === typeAttr &&\n sNonce === nonceAttr\n )\n })\n\n if (existingScript) {\n return\n }\n\n script = document.createElement('script')\n script.textContent = children\n\n if (attrs) {\n for (const [key, value] of Object.entries(attrs)) {\n if (value !== undefined && value !== false) {\n script.setAttribute(\n key,\n typeof value === 'boolean' ? '' : String(value),\n )\n }\n }\n }\n\n document.head.appendChild(script)\n }\n\n return () => {\n if (script?.parentNode) {\n script.parentNode.removeChild(script)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;;;;;AAMA,IAAM,4BAA4B;AAElC,SAAgB,MAAM,OAA6C;CACjE,MAAM,EAAE,KAAK,OAAO,aAAa;CAEjC,QAAQ,KAAR;EACE,KAAK,SACH,OAAOA,gBAAAA,OAAAA;GAAc;GAAiB;GAAY;EACpD,KAAK,QACH,OAAOC,gBAAAA,aAAAA;GAAaC,KAAI;GAAc;GAAS;EACjD,KAAK,QACH,OAAOC,gBAAAA,aAAAA;GAAaC,KAAI;GAAc;GAAS;EACjD,KAAK;GACH,IACE,MAAM,cACL,QAAQ,IAAI,2BAA2B,UACrC,QAAQ,IAAI,2BAA2B,KAAA,KAAa,WAEvD,OAAOC,gBAAAA,gBAAAA;IAAuB;IAAQ;IAA0B;GAGlE,OAAOC,gBAAAA,aAAAA;IAAaC,KAAI;IAAe;IAAiB;IAAY;EACtE,KAAK,UACH,OAAOC,gBAAAA,QAAAA;GAAe;GAAiB;GAAY;EACrD,SACE,OAAO;;;AAab,SAAS,kBAAkB,OAA+B;CACxD,gBAAgB;EACd,MAAM,KAAK,MAAA;EACX,IAAI,MAAM,GAAG,eAAe,SAAS,MACnC,SAAS,KAAK,YAAY,EAAA;;CAI9B,gBAAgB;EACd,MAAM,KAAK,MAAA;EACX,IAAI,IAAI,YACN,GAAG,WAAW,YAAY,EAAA;;;AAKhC,SAAS,eAAe,EACtB,OACA,YAIC;CAUD,OACEC,gBAAAA,aAAAA;EACEF,KAAI;EACJ,IAAA,QAAA;UAAO;IAAE,GAAG;KAAQ,4BAA4B;;;EAChDG,UAb2B,aAAa,KAAA,IAExC,OAAO,aAAa,cAClB,KACC,SAAS,cACR,SAAS,0BAA0B,EAAA,GAClC,eAAe,KACnB,YAAY;EAOb;;AASN,SAAS,YAAY,OAIE;CAWrB,IAAI;CACJ,QAAQ,MAAM,KAAd;EACE,KAAK,SAAS;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":3,"file":"awaited.js","names":["Solid","TSR_DEFERRED_PROMISE","defer","DeferredPromise","SolidNode","AwaitOptions","promise","Promise","T","useAwaited","_promise","data","createMemo","InnerAwait","props","deferred","ready","Accessor","children","res","state","status","error","Await","fallback","result","_$createComponent","Loading"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n const data = Solid.createMemo(async () => await promise)\n\n return [data(), promise]\n}\n\nfunction InnerAwait<T>(props: {\n deferred: DeferredPromise<T>\n ready: Solid.Accessor<unknown>\n children: (res: T) => SolidNode\n}) {\n props.ready()\n const state = props.deferred[TSR_DEFERRED_PROMISE]\n if (state.status === 'error') {\n throw state.error\n }\n return props.children(state.data as T) as any\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const deferred = defer(props.promise)\n const ready = Solid.createMemo(async () => {\n await deferred\n return true\n })\n\n return (\n <Solid.Loading fallback={props.fallback as any}>\n <InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>\n </Solid.Loading>\n )\n}\n"],"mappings":";;;;AAUA,SAAgBS,WAAc,EAC5BH,SAASI,YACkC;CAC3C,MAAMJ,UAAUJ,MAAMQ,QAAQ;CAG9B,OAAO,CAFMV,MAAMY,WAAW,YAAY,MAAMN,OAExCK,EAAK,GAAGL,OAAO;AACzB;AAEA,SAASO,WAAcC,OAIpB;CACDA,MAAME,MAAM;CACZ,MAAMI,QAAQN,MAAMC,SAASd;CAC7B,IAAImB,MAAMC,WAAW,SACnB,MAAMD,MAAME;CAEd,OAAOR,MAAMI,SAASE,MAAMT,IAAS;AACvC;AAEA,SAAgBY,MACdT,OAIA;CACA,MAAMC,WAAWb,MAAMY,MAAMR,OAAO;CACpC,MAAMU,QAAQhB,MAAMY,WAAW,YAAY;EACzC,MAAMG;EACN,OAAO;CACT,CAAC;CAED,OAAAW,gBACG1B,MAAM2B,SAAO;EAAA,IAACH,WAAQ;GAAA,OAAEV,MAAMU;EAAe;EAAA,IAAAN,WAAA;GAAA,OAAAQ,gBAC3Cb,YAAU;IAAWE;IAAiBC;IAAK,IAAAE,WAAA;KAAA,OACzCJ,MAAMI;IAAQ;GAAA,CAAA;EAAA;CAAA,CAAA;AAIvB"}
{"version":3,"file":"awaited.js","names":["<Solid.Loading fallback={props.fallback as any}>\n <InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>\n </Solid.Loading>","Solid.Loading","<InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>"],"sources":["../../src/awaited.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport { TSR_DEFERRED_PROMISE, defer } from '@tanstack/router-core'\nimport type { DeferredPromise } from '@tanstack/router-core'\nimport type { SolidNode } from './route'\n\nexport type AwaitOptions<T> = {\n promise: Promise<T>\n}\n\nexport function useAwaited<T>({\n promise: _promise,\n}: AwaitOptions<T>): [T, DeferredPromise<T>] {\n const promise = defer(_promise)\n const data = Solid.createMemo(async () => await promise)\n\n return [data(), promise]\n}\n\nfunction InnerAwait<T>(props: {\n deferred: DeferredPromise<T>\n ready: Solid.Accessor<unknown>\n children: (res: T) => SolidNode\n}) {\n props.ready()\n const state = props.deferred[TSR_DEFERRED_PROMISE]\n if (state.status === 'error') {\n throw state.error\n }\n return props.children(state.data as T) as any\n}\n\nexport function Await<T>(\n props: AwaitOptions<T> & {\n fallback?: SolidNode\n children: (result: T) => SolidNode\n },\n) {\n const deferred = defer(props.promise)\n const ready = Solid.createMemo(async () => {\n await deferred\n return true\n })\n\n return (\n <Solid.Loading fallback={props.fallback as any}>\n <InnerAwait deferred={deferred} ready={ready}>\n {props.children}\n </InnerAwait>\n </Solid.Loading>\n )\n}\n"],"mappings":";;;;AAUA,SAAgB,WAAc,EAC5B,SAAS,YACkC;CAC3C,MAAM,UAAU,MAAM,QAAA;CAGtB,OAAO,CAFM,MAAM,WAAW,YAAY,MAAM,OAExC,EAAA,GAAQ,OAAA;;AAGlB,SAAS,WAAc,OAIpB;CACD,MAAM,MAAA;CACN,MAAM,QAAQ,MAAM,SAAS;CAC7B,IAAI,MAAM,WAAW,SACnB,MAAM,MAAM;CAEd,OAAO,MAAM,SAAS,MAAM,IAAQ;;AAGtC,SAAgB,MACd,OAIA;CACA,MAAM,WAAW,MAAM,MAAM,OAAA;CAC7B,MAAM,QAAQ,MAAM,WAAW,YAAY;EACzC,MAAM;EACN,OAAO;;CAGT,OACEA,gBAAAA,MAACC,SAAD;EAAe,IAAA,WAAA;UAAU,MAAM;;EAA/B,IAAA,WAAA;UACEC,gBAAAA,YAAAA;IAAsB;IAAiB;IAAvC,IAAA,WAAA;YACG,MAAM;;IACI;;EACC"}
import { Dynamic, createComponent, delegateEvents, insert, memo, template } from "@solidjs/web";
import * as Solid from "solid-js";
//#region src/CatchBoundary.tsx
var _tmpl$ = /* @__PURE__ */ template(`<div style=padding:.5rem;max-width:100%><div style=display:flex;align-items:center;gap:.5rem>∂<strong style=font-size:1rem>Something went wrong!</strong><button style="appearance:none;font-size:.6em;border:1px solid currentColor;padding:.1rem .2rem;font-weight:bold;border-radius:.25rem"></button></div><div style=height:.25rem>`), _tmpl$2 = /* @__PURE__ */ template(`<div><pre style="font-size:.7em;border:1px solid red;border-radius:.25rem;padding:.3rem;color:red;overflow:auto">`), _tmpl$3 = /* @__PURE__ */ template(`<code>`);
var _tmpl$ = /* @__PURE__ */ template(`<div style=padding:.5rem;max-width:100%><div style=display:flex;align-items:center;gap:.5rem>∂<strong style=font-size:1rem>Something went wrong!</strong><button style="appearance:none;font-size:.6em;border:1px solid currentColor;padding:.1rem .2rem;font-weight:bold;border-radius:.25rem"></button></div><div style=height:.25rem>`);
var _tmpl$2 = /* @__PURE__ */ template(`<div><pre style="font-size:.7em;border:1px solid red;border-radius:.25rem;padding:.3rem;color:red;overflow:auto">`);
var _tmpl$3 = /* @__PURE__ */ template(`<code>`);
function CatchBoundary(props) {

@@ -28,20 +30,35 @@ return createComponent(Solid.Errored, {

const [show, setShow] = Solid.createSignal(process.env.NODE_ENV !== "production");
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$5 = _el$2.firstChild.nextSibling.nextSibling;
var _el$ = _tmpl$();
var _el$2 = _el$.firstChild;
var _el$5 = _el$2.firstChild.nextSibling.nextSibling;
_el$2.nextSibling;
_el$5.$$click = () => setShow((d) => !d);
insert(_el$5, () => show() ? "Hide Error" : "Show Error");
insert(_el$5, () => {
return show() ? "Hide Error" : "Show Error";
});
insert(_el$, (() => {
var _c$ = memo(() => !!show());
return () => _c$() ? (() => {
var _el$7 = _tmpl$2(), _el$8 = _el$7.firstChild;
insert(_el$8, (() => {
var _c$2 = memo(() => !!error.message);
return () => _c$2() ? (() => {
var _el$9 = _tmpl$3();
insert(_el$9, () => error.message);
return _el$9;
})() : null;
})());
return _el$7;
})() : null;
var _c$ = memo(() => {
return !!show();
});
return () => {
return _c$() ? (() => {
var _el$7 = _tmpl$2();
var _el$8 = _el$7.firstChild;
insert(_el$8, (() => {
var _c$2 = memo(() => {
return !!error.message;
});
return () => {
return _c$2() ? (() => {
var _el$9 = _tmpl$3();
insert(_el$9, () => {
return error.message;
});
return _el$9;
})() : null;
};
})());
return _el$7;
})() : null;
};
})(), null);

@@ -48,0 +65,0 @@ return _el$;

@@ -1,1 +0,1 @@

{"version":3,"file":"CatchBoundary.js","names":["Solid","Dynamic","ErrorRouteComponent","JSX","CatchBoundary","props","getResetKey","children","Element","errorComponent","onCatch","error","Error","ParentProps","_$createComponent","Errored","fallback","reset","resolvedError","untrack","createEffect","component","ErrorComponent","show","setShow","createSignal","process","env","NODE_ENV","_el$","_tmpl$","_el$2","firstChild","_el$3","_el$4","nextSibling","_el$5","_el$6","$$click","d","_$insert","_c$","_$memo","_el$7","_tmpl$2","_el$8","_c$2","message","_el$9","_tmpl$3","_$delegateEvents"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\nimport type { JSX } from '@solidjs/web'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>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AA,CAAA"}
{"version":3,"file":"CatchBoundary.js","names":["<Solid.Errored\n fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>","Solid.Errored","fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}","<Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />","error={resolvedError}","<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>","<div style={{ height: '.25rem' }} />","<div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>"],"sources":["../../src/CatchBoundary.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { Dynamic } from '@solidjs/web'\nimport type { ErrorRouteComponent } from './route'\nimport type { JSX } from '@solidjs/web'\n\nexport function CatchBoundary(\n props: {\n getResetKey: () => number | string\n children: JSX.Element\n errorComponent?: ErrorRouteComponent\n onCatch?: (error: Error) => void\n } & Solid.ParentProps,\n) {\n return (\n <Solid.Errored\n fallback={(error, reset) => {\n const resolvedError = Solid.untrack(() => error() as Error)\n\n props.onCatch?.(resolvedError)\n\n Solid.createEffect(props.getResetKey, () => {\n // We trigger reset here. For a fully deferred effect we might need usePrevious,\n // but calling reset on key change is the main goal.\n reset()\n })\n\n return (\n <Dynamic\n component={props.errorComponent ?? ErrorComponent}\n error={resolvedError}\n reset={reset}\n />\n )\n }}\n >\n {props.children}\n </Solid.Errored>\n )\n}\n\nexport function ErrorComponent({ error }: { error: any }) {\n const [show, setShow] = Solid.createSignal(\n process.env.NODE_ENV !== 'production',\n )\n\n return (\n <div style={{ padding: '.5rem', 'max-width': '100%' }}>\n <div style={{ display: 'flex', 'align-items': 'center', gap: '.5rem' }}>\n ∂<strong style={{ 'font-size': '1rem' }}>Something went wrong!</strong>\n <button\n style={{\n appearance: 'none',\n 'font-size': '.6em',\n border: '1px solid currentColor',\n padding: '.1rem .2rem',\n 'font-weight': 'bold',\n 'border-radius': '.25rem',\n }}\n onClick={() => setShow((d) => !d)}\n >\n {show() ? 'Hide Error' : 'Show Error'}\n </button>\n </div>\n <div style={{ height: '.25rem' }} />\n {show() ? (\n <div>\n <pre\n style={{\n 'font-size': '.7em',\n border: '1px solid red',\n 'border-radius': '.25rem',\n padding: '.3rem',\n color: 'red',\n overflow: 'auto',\n }}\n >\n {error.message ? <code>{error.message}</code> : null}\n </pre>\n </div>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;AAKA,SAAgB,cACd,OAMA;CACA,OACEA,gBAAAA,MAACC,SAAD;EACEC,WAAW,OAAO,UAAU;GAC1B,MAAM,gBAAgB,MAAM,cAAc,MAAA,CAAW;GAErD,MAAM,UAAU,aAAA;GAEhB,MAAM,aAAa,MAAM,mBAAmB;IAG1C,MAAA;;GAGF,OACEC,gBAAAA,SAAAA;IACE,IAAA,YAAA;YAAW,MAAM,kBAAkB;;IACnCC,OAAO;IACA;IACP;;EAjBR,IAAA,WAAA;UAqBG,MAAM;;EACO;;AAIpB,SAAgB,eAAe,EAAE,SAAyB;CACxD,MAAM,CAAC,MAAM,WAAW,MAAM,aAAA,QAAA,IAAA,aACH,YAAA;CAIzB,IAAA,OAAA,OAAA;CACE,IAAA,QAAA,KAAA;CAEE,IAAA,QAAA,MAAA,WADCC,YACD;CAcFC,MAAAA;CALI,MAAA,gBAAe,SAAS,MAAM,CAAC,CAAA;CATjC,OAAA,aAWE;SAAC,KAAA,IAAS,eAAe;;CAd/B,OAAA,aAkBE;;YAAC,KAAA;;EAAD,aAAA;yBACE;;IACE,IAAA,QAAA,MAAA;yBAUE;;eAAC,MAAM;;KAAP,aAAA;6BAAiB;;OAAA,OAAA,aAAM;eAAC,MAAM;;OAAb,OAAA;aAA+B;;QAAK;IAXzD,OAAA;UAcE;;OAjCN,IAAA;CADF,OACEC"}

@@ -1,2 +0,2 @@

import { createComponent, memo } from "@solidjs/web";
import { createComponent } from "@solidjs/web";
import * as Solid from "solid-js";

@@ -31,3 +31,3 @@ //#region src/ClientOnly.tsx

get children() {
return memo(() => props.children);
return props.children;
}

@@ -34,0 +34,0 @@ });

@@ -1,1 +0,1 @@

{"version":3,"file":"ClientOnly.js","names":["Solid","JSX","ClientOnlyProps","children","Element","fallback","ClientOnly","props","hydrated","useHydrated","_$createComponent","Show","when","_$memo","globalHydrated","Accessor","setHydrated","createSignal","createEffect"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { JSX } from '@solidjs/web'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n <>{props.children}</>\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nlet globalHydrated = false\n\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(globalHydrated)\n\n Solid.createEffect(\n () => true,\n () => {\n globalHydrated = true\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,SAAgBM,WAAWC,OAAwB;CACjD,MAAMC,WAAWC,YAAY;CAC7B,OAAAC,gBACGV,MAAMW,MAAI;EAAA,IAACC,OAAI;GAAA,OAAEJ,SAAS;EAAC;EAAA,IAAEH,WAAQ;GAAA,OAAEE,MAAMF,YAAY;EAAI;EAAA,IAAAF,WAAA;GAAA,OAAAU,WACzDN,MAAMJ,QAAQ;EAAA;CAAA,CAAA;AAGvB;;;;;;;;;;;;;;;;;;;;AAqBA,IAAIW,iBAAiB;AAErB,SAAgBL,cAAuC;CACrD,MAAM,CAACD,UAAUQ,eAAehB,MAAMiB,aAAaH,cAAc;CAEjEd,MAAMkB,mBACE,YACA;EACJJ,iBAAiB;EACjBE,YAAY,IAAI;CAClB,CACF;CAEA,OAAOR;AACT"}
{"version":3,"file":"ClientOnly.js","names":["<Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n {props.children}\n </Solid.Show>","Solid.Show"],"sources":["../../src/ClientOnly.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { JSX } from '@solidjs/web'\n\nexport interface ClientOnlyProps {\n /**\n * The children to render when the JS is loaded.\n */\n children: JSX.Element\n /**\n * The fallback component to render if the JS is not yet loaded.\n */\n fallback?: JSX.Element\n}\n\n/**\n * Render the children only after the JS has loaded client-side. Use an optional\n * fallback component if the JS is not yet loaded.\n *\n * @example\n * Render a Chart component if JS loads, renders a simple FakeChart\n * component server-side or if there is no JS. The FakeChart can have only the\n * UI without the behavior or be a loading spinner or skeleton.\n *\n * ```tsx\n * return (\n * <ClientOnly fallback={<FakeChart />}>\n * <Chart />\n * </ClientOnly>\n * )\n * ```\n */\nexport function ClientOnly(props: ClientOnlyProps) {\n const hydrated = useHydrated()\n return (\n <Solid.Show when={hydrated()} fallback={props.fallback ?? null}>\n {props.children}\n </Solid.Show>\n )\n}\n\n/**\n * Return a boolean indicating if the JS has been hydrated already.\n * When doing Server-Side Rendering, the result will always be false.\n * When doing Client-Side Rendering, the result will always be false on the\n * first render and true from then on. Even if a new component renders it will\n * always start with true.\n *\n * @example\n * ```tsx\n * // Disable a button that needs JS to work.\n * const hydrated = useHydrated()\n * return (\n * <button type=\"button\" disabled={!hydrated()} onClick={doSomethingCustom}>\n * Click me\n * </button>\n * )\n * ```\n * @returns True if the JS has been hydrated already, false otherwise.\n */\nlet globalHydrated = false\n\nexport function useHydrated(): Solid.Accessor<boolean> {\n const [hydrated, setHydrated] = Solid.createSignal(globalHydrated)\n\n Solid.createEffect(\n () => true,\n () => {\n globalHydrated = true\n setHydrated(true)\n },\n )\n\n return hydrated\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,WAAW,OAAwB;CACjD,MAAM,WAAW,YAAA;CACjB,OACEA,gBAAAA,MAACC,MAAD;EAAY,IAAA,OAAA;UAAM,SAAA;;EAAY,IAAA,WAAA;UAAU,MAAM,YAAY;;EAA1D,IAAA,WAAA;UACG,MAAM;;EACI;;;;;;;;;;;;;;;;;;;;;AAuBjB,IAAI,iBAAiB;AAErB,SAAgB,cAAuC;CACrD,MAAM,CAAC,UAAU,eAAe,MAAM,aAAa,cAAA;CAEnD,MAAM,mBACE,YACA;EACJ,iBAAiB;EACjB,YAAY,IAAA;;CAIhB,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"HeadContent.dev.js","names":["For","createEffect","createMemo","HydrationScript","DEV_STYLES_ATTR","Asset","useHydrated","useTags","HeadContentProps","HeadContent","props","tags","assetCrossOrigin","hydrated","const","document","querySelectorAll","forEach","el","remove","filteredTags","filter","tag","attrs","_$createComponent","each","children","t"],"sources":["../../src/HeadContent.dev.tsx"],"sourcesContent":["import { For, createEffect, createMemo } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { DEV_STYLES_ATTR } from '@tanstack/router-core'\nimport { Asset } from './Asset'\nimport { useHydrated } from './ClientOnly'\nimport { useTags } from './headContentUtils'\nimport type { HeadContentProps } from './HeadContent'\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n *\n * Development version: filters out dev styles link after hydration and\n * includes a fallback cleanup effect for hydration mismatch cases.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const hydrated = useHydrated()\n\n // Fallback cleanup for hydration mismatch cases\n // Runs when hydration completes to remove any orphaned dev styles links from DOM\n createEffect(\n () => [hydrated()] as const,\n ([hydrated]) => {\n if (hydrated) {\n document\n .querySelectorAll(`link[${DEV_STYLES_ATTR}]`)\n .forEach((el) => el.remove())\n }\n },\n )\n\n // Filter out dev styles after hydration\n const filteredTags = createMemo(() => {\n if (hydrated()) {\n return tags().filter(\n (tag) => tag.tag !== 'link' || tag.attrs?.[DEV_STYLES_ATTR] !== true,\n )\n }\n return tags()\n })\n\n return (\n <>\n <HydrationScript />\n <For each={filteredTags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgBS,YAAYC,OAAyB;CACnD,MAAMC,OAAOJ,QAAQG,MAAME,gBAAgB;CAC3C,MAAMC,WAAWP,YAAY;CAI7BL,mBACQ,CAACY,SAAS,CAAC,IAChB,CAACA,cAAc;EACd,IAAIA,UACFE,SACGC,iBAAiB,QAAQZ,gBAAe,EAAG,EAC3Ca,SAASC,OAAOA,GAAGC,OAAO,CAAC;CAElC,CACF;CAGA,MAAMC,eAAelB,iBAAiB;EACpC,IAAIW,SAAS,GACX,OAAOF,KAAK,EAAEU,QACXC,QAAQA,IAAIA,QAAQ,UAAUA,IAAIC,QAAQnB,qBAAqB,IAClE;EAEF,OAAOO,KAAK;CACd,CAAC;CAED,OAAA,CAAAa,gBAEKrB,iBAAe,CAAA,CAAA,GAAAqB,gBACfxB,KAAG;EAAA,IAACyB,OAAI;GAAA,OAAEL,aAAa;EAAC;EAAAM,WACrBJ,QAAQ;GACR,MAAMK,IAAIL;GACV,OAAAE,gBAAQnB,OAAK;IAAA,IAACiB,MAAG;KAAA,OAAEK,EAAEL;IAAG;IAAA,IAAEC,QAAK;KAAA,OAAEI,EAAEJ;IAAK;IAAA,IAAEG,WAAQ;KAAA,OAAEC,EAAED;IAAQ;GAAA,CAAA;EAChE;CAAC,CAAA,CAAA;AAIT"}
{"version":3,"file":"HeadContent.dev.js","names":["<HydrationScript />","<For each={filteredTags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>","<Asset tag={t.tag} attrs={t.attrs} children={t.children} />"],"sources":["../../src/HeadContent.dev.tsx"],"sourcesContent":["import { For, createEffect, createMemo } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { DEV_STYLES_ATTR } from '@tanstack/router-core'\nimport { Asset } from './Asset'\nimport { useHydrated } from './ClientOnly'\nimport { useTags } from './headContentUtils'\nimport type { HeadContentProps } from './HeadContent'\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n *\n * Development version: filters out dev styles link after hydration and\n * includes a fallback cleanup effect for hydration mismatch cases.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const hydrated = useHydrated()\n\n // Fallback cleanup for hydration mismatch cases\n // Runs when hydration completes to remove any orphaned dev styles links from DOM\n createEffect(\n () => [hydrated()] as const,\n ([hydrated]) => {\n if (hydrated) {\n document\n .querySelectorAll(`link[${DEV_STYLES_ATTR}]`)\n .forEach((el) => el.remove())\n }\n },\n )\n\n // Filter out dev styles after hydration\n const filteredTags = createMemo(() => {\n if (hydrated()) {\n return tags().filter(\n (tag) => tag.tag !== 'link' || tag.attrs?.[DEV_STYLES_ATTR] !== true,\n )\n }\n return tags()\n })\n\n return (\n <>\n <HydrationScript />\n <For each={filteredTags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,YAAY,OAAyB;CACnD,MAAM,OAAO,QAAQ,MAAM,gBAAA;CAC3B,MAAM,WAAW,YAAA;CAIjB,mBACQ,CAAC,SAAA,CAAU,IAChB,CAAC,cAAc;EACd,IAAI,UACF,SACG,iBAAiB,QAAQ,gBAAgB,EAAA,EACzC,SAAS,OAAO,GAAG,OAAA,CAAQ;;CAMpC,MAAM,eAAe,iBAAiB;EACpC,IAAI,SAAA,GACF,OAAO,KAAA,EAAO,QACX,QAAQ,IAAI,QAAQ,UAAU,IAAI,QAAQ,qBAAqB,IAAA;EAGpE,OAAO,KAAA;;CAGT,OACI,CACAA,gBAAAA,iBAAAA,CAAAA,CAAmB,GACnBC,gBAAAA,KAAAA;EAAK,IAAA,OAAA;UAAM,aAAA;;EAAXA,WACI,QAAQ;GACR,MAAM,IAAI;GACV,OAAOC,gBAAAA,OAAAA;IAAO,IAAA,MAAA;YAAK,EAAE;;IAAK,IAAA,QAAA;YAAO,EAAE;;IAAO,IAAA,WAAA;YAAU,EAAE;;IAAY;;EAEhE,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"HeadContent.js","names":["For","HydrationScript","Asset","useTags","AssetCrossOriginConfig","HeadContentProps","assetCrossOrigin","HeadContent","props","tags","_$createComponent","each","children","tag","t","attrs"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * Place this component inside the `<head>` of your document so the rendered tags end up in the right place.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n\n return (\n <>\n <HydrationScript />\n <For each={tags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgBO,YAAYC,OAAyB;CACnD,MAAMC,OAAON,QAAQK,MAAMF,gBAAgB;CAE3C,OAAA,CAAAI,gBAEKT,iBAAe,CAAA,CAAA,GAAAS,gBACfV,KAAG;EAAA,IAACW,OAAI;GAAA,OAAEF,KAAK;EAAC;EAAAG,WACbC,QAAQ;GACR,MAAMC,IAAID;GACV,OAAAH,gBAAQR,OAAK;IAAA,IAACW,MAAG;KAAA,OAAEC,EAAED;IAAG;IAAA,IAAEE,QAAK;KAAA,OAAED,EAAEC;IAAK;IAAA,IAAEH,WAAQ;KAAA,OAAEE,EAAEF;IAAQ;GAAA,CAAA;EAChE;CAAC,CAAA,CAAA;AAIT"}
{"version":3,"file":"HeadContent.js","names":["<HydrationScript />","<For each={tags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>","<Asset tag={t.tag} attrs={t.attrs} children={t.children} />"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["import { For } from 'solid-js'\nimport { HydrationScript } from '@solidjs/web'\nimport { Asset } from './Asset'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.\n * Place this component inside the `<head>` of your document so the rendered tags end up in the right place.\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n\n return (\n <>\n <HydrationScript />\n <For each={tags()}>\n {(tag) => {\n const t = tag as any\n return <Asset tag={t.tag} attrs={t.attrs} children={t.children} />\n }}\n </For>\n </>\n )\n}\n"],"mappings":";;;;;;;;;AAcA,SAAgB,YAAY,OAAyB;CACnD,MAAM,OAAO,QAAQ,MAAM,gBAAA;CAE3B,OACI,CACAA,gBAAAA,iBAAAA,CAAAA,CAAmB,GACnBC,gBAAAA,KAAAA;EAAK,IAAA,OAAA;UAAM,KAAA;;EAAXA,WACI,QAAQ;GACR,MAAM,IAAI;GACV,OAAOC,gBAAAA,OAAAA;IAAO,IAAA,MAAA;YAAK,EAAE;;IAAK,IAAA,QAAA;YAAO,EAAE;;IAAO,IAAA,WAAA;YAAU,EAAE;;IAAY;;EAEhE,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"headContentUtils.js","names":["Solid","appendUniqueUserTags","escapeHtml","getAssetCrossOrigin","getScriptPreloadAttrs","resolveManifestCssLink","useRouter","AssetCrossOriginConfig","RouterManagedTag","useTags","assetCrossOrigin","router","nonce","options","ssr","activeMatches","createMemo","stores","matches","get","routeMeta","map","match","meta","filter","undefined","Accessor","Array","resultMeta","metaByAttribute","Record","title","routeMetasArray","i","length","metas","j","m","tag","children","json","JSON","stringify","push","attrs","type","attribute","name","property","content","reverse","links","constructed","flatMap","link","retainedManifestCssTags","Map","manifestCssTags","manifest","tags","routes","routeId","css","forEach","resolvedLink","rel","crossOrigin","key","has","set","values","inlineStyle","inlineCss","preloadLinks","preloads","Boolean","preload","styles","style","headScripts","script","prev","next","replaceEqualTags","prevByKey","isEqual","result","index","existing"],"sources":["../../src/headContentUtils.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n appendUniqueUserTags,\n escapeHtml,\n getAssetCrossOrigin,\n getScriptPreloadAttrs,\n resolveManifestCssLink,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AssetCrossOriginConfig,\n RouterManagedTag,\n} from '@tanstack/router-core'\n\n/**\n * Build the list of head/link/meta/script tags to render for active matches.\n * Used internally by `HeadContent`.\n */\nexport const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const routeMeta = Solid.createMemo(() =>\n activeMatches()\n .map((match) => match.meta)\n .filter((meta) => meta !== undefined),\n )\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else if ('script:ld+json' in m) {\n // Handle JSON-LD structured data\n // Content is HTML-escaped to prevent XSS when injected via innerHTML\n try {\n const json = JSON.stringify(m['script:ld+json'])\n resultMeta.push({\n tag: 'script',\n attrs: {\n type: 'application/ld+json',\n },\n children: escapeHtml(json),\n })\n } catch {\n // Skip invalid JSON-LD objects\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n nonce,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n if (router.options.ssr?.nonce) {\n resultMeta.push({\n tag: 'meta',\n attrs: {\n property: 'csp-nonce',\n content: router.options.ssr.nonce,\n },\n })\n }\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = Solid.createMemo(() => {\n const matches = activeMatches()\n const constructed = matches\n .flatMap((match) => match.links ?? [])\n .filter((link) => link !== undefined)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n nonce,\n },\n })) satisfies Array<RouterManagedTag>\n\n return constructed\n })\n\n const retainedManifestCssTags = new Map<string, RouterManagedTag>()\n const manifestCssTags = Solid.createMemo(() => {\n const manifest = router.ssr?.manifest\n const tags: Array<RouterManagedTag> = []\n\n if (!manifest) {\n return tags\n }\n\n for (const match of activeMatches()) {\n manifest.routes[match.routeId]?.css?.forEach((link) => {\n const resolvedLink = resolveManifestCssLink(link)\n const tag: RouterManagedTag = {\n tag: 'link',\n attrs: {\n rel: 'stylesheet',\n ...resolvedLink,\n crossOrigin:\n getAssetCrossOrigin(assetCrossOrigin, 'stylesheet') ??\n resolvedLink.crossOrigin,\n nonce,\n },\n }\n const key = JSON.stringify(tag)\n if (!retainedManifestCssTags.has(key)) {\n retainedManifestCssTags.set(key, tag)\n }\n })\n }\n\n // Lazy modules are cached and do not reinsert their CSS when revisited.\n tags.push(...retainedManifestCssTags.values())\n\n if (manifest.inlineStyle) {\n tags.push({\n tag: 'style',\n attrs: {\n ...manifest.inlineStyle.attrs,\n nonce,\n },\n children: manifest.inlineStyle.children,\n inlineCss: true,\n })\n }\n\n return tags\n })\n\n const preloadLinks = Solid.createMemo(() => {\n const matches = activeMatches()\n const preloadLinks: Array<RouterManagedTag> = []\n\n matches.forEach((match) =>\n router.ssr?.manifest?.routes[match.routeId]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadLinks.push({\n tag: 'link',\n attrs: {\n ...getScriptPreloadAttrs(\n router.ssr?.manifest,\n preload,\n assetCrossOrigin,\n ),\n nonce,\n },\n })\n }),\n )\n\n return preloadLinks\n })\n\n const styles = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.styles ?? [])\n .filter((style) => style !== undefined)\n .map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n const headScripts = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.headScripts ?? [])\n .filter((script) => script !== undefined)\n .map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n // Cache tag objects by key across renders so that unchanged tags keep a\n // stable object identity. `<For>` keys by reference, so reusing the previous\n // object for an unchanged tag lets it reconcile the existing DOM node in\n // place instead of remounting it. Remounting head nodes on navigation\n // detaches/re-fetches stylesheets (e.g. the app stylesheet), causing a FOUC.\n return Solid.createMemo((prev: Array<RouterManagedTag> | undefined) => {\n const next: Array<RouterManagedTag> = []\n appendUniqueUserTags(next, meta())\n appendUniqueUserTags(next, links())\n next.push(...manifestCssTags())\n next.push(...preloadLinks())\n appendUniqueUserTags(next, styles())\n appendUniqueUserTags(next, headScripts())\n\n if (prev === undefined) {\n return next\n }\n return replaceEqualTags(prev, next)\n })\n}\n\nfunction replaceEqualTags(\n prev: Array<RouterManagedTag>,\n next: Array<RouterManagedTag>,\n) {\n const prevByKey = new Map<string, RouterManagedTag>()\n for (const tag of prev) {\n prevByKey.set(JSON.stringify(tag), tag)\n }\n\n let isEqual = prev.length === next.length\n const result = next.map((tag, index) => {\n const existing = prevByKey.get(JSON.stringify(tag))\n if (existing) {\n if (existing !== prev[index]) {\n isEqual = false\n }\n return existing\n }\n\n isEqual = false\n return tag\n })\n\n return isEqual ? prev : result\n}\n"],"mappings":";;;;;;;;AAkBA,IAAaS,WAAWC,qBAA8C;CACpE,MAAMC,SAASL,UAAU;CACzB,MAAMM,QAAQD,OAAOE,QAAQC,KAAKF;CAClC,MAAMG,gBAAgBf,MAAMgB,iBAAiBL,OAAOM,OAAOC,QAAQC,IAAI,CAAC;CACxE,MAAMC,YAAYpB,MAAMgB,iBACtBD,cAAc,EACXM,KAAKC,UAAUA,MAAMC,IAAI,EACzBC,QAAQD,SAASA,SAASE,KAAAA,CAAS,CACxC;CAEA,MAAMF,OAAgDvB,MAAMgB,iBAAiB;EAC3E,MAAMY,aAAsC,CAAA;EAC5C,MAAMC,kBAAwC,CAAC;EAC/C,IAAIE;EACJ,MAAMC,kBAAkBZ,UAAU;EAClC,KAAK,IAAIa,IAAID,gBAAgBE,SAAS,GAAGD,KAAK,GAAGA,KAAK;GACpD,MAAME,QAAQH,gBAAgBC;GAC9B,KAAK,IAAIG,IAAID,MAAMD,SAAS,GAAGE,KAAK,GAAGA,KAAK;IAC1C,MAAMC,IAAIF,MAAMC;IAChB,IAAI,CAACC,GAAG;IAER,IAAIA,EAAEN;SACA,CAACA,OACHA,QAAQ;MACNO,KAAK;MACLC,UAAUF,EAAEN;KACd;IAAA,OAEG,IAAI,oBAAoBM,GAG7B,IAAI;KACF,MAAMG,OAAOC,KAAKC,UAAUL,EAAE,iBAAiB;KAC/CT,WAAWe,KAAK;MACdL,KAAK;MACLM,OAAO,EACLC,MAAM,sBACR;MACAN,UAAUrC,WAAWsC,IAAI;KAC3B,CAAC;IACH,QAAQ,CACN;SAEG;KACL,MAAMM,YAAYT,EAAEU,QAAQV,EAAEW;KAC9B,I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CAAA;EACtCjF,qBAAqBiF,MAAM3D,KAAK,CAAC;EACjCtB,qBAAqBiF,MAAM/B,MAAM,CAAC;EAClC+B,KAAKvC,KAAK,GAAGc,gBAAgB,CAAC;EAC9ByB,KAAKvC,KAAK,GAAG8B,aAAa,CAAC;EAC3BxE,qBAAqBiF,MAAML,OAAO,CAAC;EACnC5E,qBAAqBiF,MAAMH,YAAY,CAAC;EAExC,IAAIE,SAASxD,KAAAA,GACX,OAAOyD;EAET,OAAOC,iBAAiBF,MAAMC,IAAI;CACpC,CAAC;AACH;AAEA,SAASC,iBACPF,MACAC,MACA;CACA,MAAME,4BAAY,IAAI5B,IAA8B;CACpD,KAAK,MAAMlB,OAAO2C,MAChBG,UAAUf,IAAI5B,KAAKC,UAAUJ,GAAG,GAAGA,GAAG;CAGxC,IAAI+C,UAAUJ,KAAK/C,WAAWgD,KAAKhD;CACnC,MAAMoD,SAASJ,KAAK7D,KAAKiB,KAAKiD,UAAU;EACtC,MAAMC,WAAWJ,UAAUjE,IAAIsB,KAAKC,UAAUJ,GAAG,CAAC;EAClD,IAAIkD,UAAU;GACZ,IAAIA,aAAaP,KAAKM,QACpBF,UAAU;GAEZ,OAAOG;EACT;EAEAH,UAAU;EACV,OAAO/C;CACT,CAAC;CAED,OAAO+C,UAAUJ,OAAOK;AAC1B"}
{"version":3,"file":"headContentUtils.js","names":[],"sources":["../../src/headContentUtils.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n appendUniqueUserTags,\n escapeHtml,\n getAssetCrossOrigin,\n getScriptPreloadAttrs,\n resolveManifestCssLink,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AssetCrossOriginConfig,\n RouterManagedTag,\n} from '@tanstack/router-core'\n\n/**\n * Build the list of head/link/meta/script tags to render for active matches.\n * Used internally by `HeadContent`.\n */\nexport const useTags = (assetCrossOrigin?: AssetCrossOriginConfig) => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const routeMeta = Solid.createMemo(() =>\n activeMatches()\n .map((match) => match.meta)\n .filter((meta) => meta !== undefined),\n )\n\n const meta: Solid.Accessor<Array<RouterManagedTag>> = Solid.createMemo(() => {\n const resultMeta: Array<RouterManagedTag> = []\n const metaByAttribute: Record<string, true> = {}\n let title: RouterManagedTag | undefined\n const routeMetasArray = routeMeta()\n for (let i = routeMetasArray.length - 1; i >= 0; i--) {\n const metas = routeMetasArray[i]!\n for (let j = metas.length - 1; j >= 0; j--) {\n const m = metas[j]\n if (!m) continue\n\n if (m.title) {\n if (!title) {\n title = {\n tag: 'title',\n children: m.title,\n }\n }\n } else if ('script:ld+json' in m) {\n // Handle JSON-LD structured data\n // Content is HTML-escaped to prevent XSS when injected via innerHTML\n try {\n const json = JSON.stringify(m['script:ld+json'])\n resultMeta.push({\n tag: 'script',\n attrs: {\n type: 'application/ld+json',\n },\n children: escapeHtml(json),\n })\n } catch {\n // Skip invalid JSON-LD objects\n }\n } else {\n const attribute = m.name ?? m.property\n if (attribute) {\n if (metaByAttribute[attribute]) {\n continue\n } else {\n metaByAttribute[attribute] = true\n }\n }\n\n resultMeta.push({\n tag: 'meta',\n attrs: {\n ...m,\n nonce,\n },\n })\n }\n }\n }\n\n if (title) {\n resultMeta.push(title)\n }\n\n if (router.options.ssr?.nonce) {\n resultMeta.push({\n tag: 'meta',\n attrs: {\n property: 'csp-nonce',\n content: router.options.ssr.nonce,\n },\n })\n }\n resultMeta.reverse()\n\n return resultMeta\n })\n\n const links = Solid.createMemo(() => {\n const matches = activeMatches()\n const constructed = matches\n .flatMap((match) => match.links ?? [])\n .filter((link) => link !== undefined)\n .map((link) => ({\n tag: 'link',\n attrs: {\n ...link,\n nonce,\n },\n })) satisfies Array<RouterManagedTag>\n\n return constructed\n })\n\n const retainedManifestCssTags = new Map<string, RouterManagedTag>()\n const manifestCssTags = Solid.createMemo(() => {\n const manifest = router.ssr?.manifest\n const tags: Array<RouterManagedTag> = []\n\n if (!manifest) {\n return tags\n }\n\n for (const match of activeMatches()) {\n manifest.routes[match.routeId]?.css?.forEach((link) => {\n const resolvedLink = resolveManifestCssLink(link)\n const tag: RouterManagedTag = {\n tag: 'link',\n attrs: {\n rel: 'stylesheet',\n ...resolvedLink,\n crossOrigin:\n getAssetCrossOrigin(assetCrossOrigin, 'stylesheet') ??\n resolvedLink.crossOrigin,\n nonce,\n },\n }\n const key = JSON.stringify(tag)\n if (!retainedManifestCssTags.has(key)) {\n retainedManifestCssTags.set(key, tag)\n }\n })\n }\n\n // Lazy modules are cached and do not reinsert their CSS when revisited.\n tags.push(...retainedManifestCssTags.values())\n\n if (manifest.inlineStyle) {\n tags.push({\n tag: 'style',\n attrs: {\n ...manifest.inlineStyle.attrs,\n nonce,\n },\n children: manifest.inlineStyle.children,\n inlineCss: true,\n })\n }\n\n return tags\n })\n\n const preloadLinks = Solid.createMemo(() => {\n const matches = activeMatches()\n const preloadLinks: Array<RouterManagedTag> = []\n\n matches.forEach((match) =>\n router.ssr?.manifest?.routes[match.routeId]?.preloads\n ?.filter(Boolean)\n .forEach((preload) => {\n preloadLinks.push({\n tag: 'link',\n attrs: {\n ...getScriptPreloadAttrs(\n router.ssr?.manifest,\n preload,\n assetCrossOrigin,\n ),\n nonce,\n },\n })\n }),\n )\n\n return preloadLinks\n })\n\n const styles = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.styles ?? [])\n .filter((style) => style !== undefined)\n .map(({ children, ...style }) => ({\n tag: 'style',\n attrs: {\n ...style,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n const headScripts = Solid.createMemo(() => {\n return activeMatches()\n .flatMap((match) => match.headScripts ?? [])\n .filter((script) => script !== undefined)\n .map(({ children, ...script }) => ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children: children as string | undefined,\n })) satisfies Array<RouterManagedTag>\n })\n\n // Cache tag objects by key across renders so that unchanged tags keep a\n // stable object identity. `<For>` keys by reference, so reusing the previous\n // object for an unchanged tag lets it reconcile the existing DOM node in\n // place instead of remounting it. Remounting head nodes on navigation\n // detaches/re-fetches stylesheets (e.g. the app stylesheet), causing a FOUC.\n return Solid.createMemo((prev: Array<RouterManagedTag> | undefined) => {\n const next: Array<RouterManagedTag> = []\n appendUniqueUserTags(next, meta())\n appendUniqueUserTags(next, links())\n next.push(...manifestCssTags())\n next.push(...preloadLinks())\n appendUniqueUserTags(next, styles())\n appendUniqueUserTags(next, headScripts())\n\n if (prev === undefined) {\n return next\n }\n return replaceEqualTags(prev, next)\n })\n}\n\nfunction replaceEqualTags(\n prev: Array<RouterManagedTag>,\n next: Array<RouterManagedTag>,\n) {\n const prevByKey = new Map<string, RouterManagedTag>()\n for (const tag of prev) {\n prevByKey.set(JSON.stringify(tag), tag)\n }\n\n let isEqual = prev.length === next.length\n const result = next.map((tag, index) => {\n const existing = prevByKey.get(JSON.stringify(tag))\n if (existing) {\n if (existing !== prev[index]) {\n isEqual = false\n }\n return existing\n }\n\n isEqual = false\n return tag\n })\n\n return isEqual ? prev : result\n}\n"],"mappings":";;;;;;;;AAkBA,IAAa,WAAW,qBAA8C;CACpE,MAAM,SAAS,UAAA;CACf,MAAM,QAAQ,OAAO,QAAQ,KAAK;CAClC,MAAM,gBAAgB,MAAM,iBAAiB,OAAO,OAAO,QAAQ,IAAA,CAAK;CACxE,MAAM,YAAY,MAAM,iBACtB,cAAA,EACG,KAAK,UAAU,MAAM,IAAA,EACrB,QAAQ,SAAS,SAAS,KAAA,CAAA,CAAU;CAGzC,MAAM,OAAgD,MAAM,iBAAiB;EAC3E,MAAM,aAAsC,CAAA;EAC5C,MAAM,kBAAwC,CAAA;EAC9C,IAAI;EACJ,MAAM,kBAAkB,UAAA;EACxB,KAAK,IAAI,IAAI,gBAAgB,SAAS,GAAG,KAAK,GAAG,KAAK;GACpD,MAAM,QAAQ,gBAAgB;GAC9B,KAAK,IAAI,IAAI,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK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EAC3B,qBAAqB,MAAM,OAAA,CAAQ;EACnC,qBAAqB,MAAM,YAAA,CAAa;EAExC,IAAI,SAAS,KAAA,GACX,OAAO;EAET,OAAO,iBAAiB,MAAM,IAAA;;;AAIlC,SAAS,iBACP,MACA,MACA;CACA,MAAM,4BAAY,IAAI,IAAY;CAClC,KAAK,MAAM,OAAO,MAChB,UAAU,IAAI,KAAK,UAAU,GAAA,GAAM,GAAA;CAGrC,IAAI,UAAU,KAAK,WAAW,KAAK;CACnC,MAAM,SAAS,KAAK,KAAK,KAAK,UAAU;EACtC,MAAM,WAAW,UAAU,IAAI,KAAK,UAAU,GAAA,CAAI;EAClD,IAAI,UAAU;GACZ,IAAI,aAAa,KAAK,QACpB,UAAU;GAEZ,OAAO;;EAGT,UAAU;EACV,OAAO;;CAGT,OAAO,UAAU,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"lazyRouteComponent.js","names":["isModuleNotFoundError","Dynamic","createMemo","AsyncRouteComponent","lazyRouteComponent","Record","T","importer","Promise","exportName","TKey","props","TProps","loadPromise","comp","error","load","then","res","undefined","catch","err","lazyComp","Lazy","Error","window","sessionStorage","storageKey","message","getItem","setItem","location","reload","default","compResource","_$createComponent","_$mergeProps","component","preload"],"sources":["../../src/lazyRouteComponent.tsx"],"sourcesContent":["import { isModuleNotFoundError } from '@tanstack/router-core'\nimport { Dynamic } from '@solidjs/web'\nimport { createMemo } from 'solid-js'\nimport type { AsyncRouteComponent } from './route'\n\nexport function lazyRouteComponent<\n T extends Record<string, any>,\n TKey extends keyof T = 'default',\n>(\n importer: () => Promise<T>,\n exportName?: TKey,\n): T[TKey] extends (props: infer TProps) => any\n ? AsyncRouteComponent<TProps>\n : never {\n let loadPromise: Promise<any> | undefined\n let comp: T[TKey] | T['default']\n let error: any\n\n const load = () => {\n if (!loadPromise) {\n loadPromise = importer()\n .then((res) => {\n loadPromise = undefined\n comp = res[exportName ?? 'default']\n return comp\n })\n .catch((err) => {\n error = err\n })\n }\n\n return loadPromise\n }\n\n const lazyComp = function Lazy(props: any) {\n // Now that we're out of preload and into actual render path,\n // throw the error if it was a module not found error during preload\n if (error) {\n // If the load fails due to module not found, it may mean a new version of\n // the build was deployed and the user's browser is still using an old version.\n // If this happens, the old version in the user's browser would have an outdated\n // URL to the lazy module.\n // In that case, we want to attempt one window refresh to get the latest.\n if (isModuleNotFoundError(error)) {\n // We don't want an error thrown from preload in this case, because\n // there's nothing we want to do about module not found during preload.\n // Record the error, recover the promise with a null return,\n // and we will attempt module not found resolution during the render path.\n\n if (\n error instanceof Error &&\n typeof window !== 'undefined' &&\n typeof sessionStorage !== 'undefined'\n ) {\n // Again, we want to reload one time on module not found error and not enter\n // a reload loop if there is some other issue besides an old deploy.\n // That's why we store our reload attempt in sessionStorage.\n // Use error.message as key because it contains the module path that failed.\n const storageKey = `tanstack_router_reload:${error.message}`\n if (!sessionStorage.getItem(storageKey)) {\n sessionStorage.setItem(storageKey, '1')\n window.location.reload()\n\n // Return empty component while we wait for window to reload\n return {\n default: () => null,\n }\n }\n }\n }\n\n // Otherwise, just throw the error\n throw error\n }\n\n if (!comp) {\n const compResource = createMemo(load)\n return <Dynamic component={compResource()} {...props} />\n }\n\n return <Dynamic component={comp} {...props} />\n }\n\n ;(lazyComp as any).preload = load\n\n return lazyComp as any\n}\n"],"mappings":";;;;AAKA,SAAgBI,mBAIdG,UACAE,YAGQ;CACR,IAAII;CACJ,IAAIC;CACJ,IAAIC;CAEJ,MAAMC,aAAa;EACjB,IAAI,CAACH,aACHA,cAAcN,SAAS,EACpBU,MAAMC,QAAQ;GACbL,cAAcM,KAAAA;GACdL,OAAOI,IAAIT,cAAc;GACzB,OAAOK;EACT,CAAC,EACAM,OAAOC,QAAQ;GACdN,QAAQM;EACV,CAAC;EAGL,OAAOR;CACT;CAEA,MAAMS,WAAW,SAASC,KAAKZ,OAAY;EAGzC,IAAII,OAAO;GAMT,IAAIf,sBAAsBe,KAAK;QAO3BA,iBAAiBS,SACjB,OAAOC,WAAW,eAClB,OAAOC,mBAAmB,aAC1B;KAKA,MAAMC,aAAa,0BAA0BZ,MAAMa;KACnD,IAAI,CAACF,eAAeG,QAAQF,UAAU,GAAG;MACvCD,eAAeI,QAAQH,YAAY,GAAG;MACtCF,OAAOM,SAASC,OAAO;MAGvB,OAAO,EACLC,eAAe,KACjB;KACF;IACF;;GAIF,MAAMlB;EACR;EAEA,IAAI,CAACD,MAAM;GACT,MAAMoB,eAAehC,WAAWc,IAAI;GACpC,OAAAmB,gBAAQlC,SAAOmC,WAAA,EAAA,IAACC,YAAS;IAAA,OAAEH,aAAa;GAAC,EAAA,GAAMvB,KAAK,CAAA;EACtD;EAEA,OAAAwB,gBAAQlC,SAAOmC,WAAA,EAACC,WAAWvB,KAAI,GAAMH,KAAK,CAAA;CAC5C;CAEC,SAAkB2B,UAAUtB;CAE7B,OAAOM;AACT"}
{"version":3,"file":"lazyRouteComponent.js","names":["<Dynamic component={compResource()} {...props} />","<Dynamic component={comp} {...props} />","component={comp}"],"sources":["../../src/lazyRouteComponent.tsx"],"sourcesContent":["import { isModuleNotFoundError } from '@tanstack/router-core'\nimport { Dynamic } from '@solidjs/web'\nimport { createMemo } from 'solid-js'\nimport type { AsyncRouteComponent } from './route'\n\nexport function lazyRouteComponent<\n T extends Record<string, any>,\n TKey extends keyof T = 'default',\n>(\n importer: () => Promise<T>,\n exportName?: TKey,\n): T[TKey] extends (props: infer TProps) => any\n ? AsyncRouteComponent<TProps>\n : never {\n let loadPromise: Promise<any> | undefined\n let comp: T[TKey] | T['default']\n let error: any\n\n const load = () => {\n if (!loadPromise) {\n loadPromise = importer()\n .then((res) => {\n loadPromise = undefined\n comp = res[exportName ?? 'default']\n return comp\n })\n .catch((err) => {\n error = err\n })\n }\n\n return loadPromise\n }\n\n const lazyComp = function Lazy(props: any) {\n // Now that we're out of preload and into actual render path,\n // throw the error if it was a module not found error during preload\n if (error) {\n // If the load fails due to module not found, it may mean a new version of\n // the build was deployed and the user's browser is still using an old version.\n // If this happens, the old version in the user's browser would have an outdated\n // URL to the lazy module.\n // In that case, we want to attempt one window refresh to get the latest.\n if (isModuleNotFoundError(error)) {\n // We don't want an error thrown from preload in this case, because\n // there's nothing we want to do about module not found during preload.\n // Record the error, recover the promise with a null return,\n // and we will attempt module not found resolution during the render path.\n\n if (\n error instanceof Error &&\n typeof window !== 'undefined' &&\n typeof sessionStorage !== 'undefined'\n ) {\n // Again, we want to reload one time on module not found error and not enter\n // a reload loop if there is some other issue besides an old deploy.\n // That's why we store our reload attempt in sessionStorage.\n // Use error.message as key because it contains the module path that failed.\n const storageKey = `tanstack_router_reload:${error.message}`\n if (!sessionStorage.getItem(storageKey)) {\n sessionStorage.setItem(storageKey, '1')\n window.location.reload()\n\n // Return empty component while we wait for window to reload\n return {\n default: () => null,\n }\n }\n }\n }\n\n // Otherwise, just throw the error\n throw error\n }\n\n if (!comp) {\n const compResource = createMemo(load)\n return <Dynamic component={compResource()} {...props} />\n }\n\n return <Dynamic component={comp} {...props} />\n }\n\n ;(lazyComp as any).preload = load\n\n return lazyComp as any\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAId,UACA,YAGQ;CACR,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,aAAa;EACjB,IAAI,CAAC,aACH,cAAc,SAAA,EACX,MAAM,QAAQ;GACb,cAAc,KAAA;GACd,OAAO,IAAI,cAAc;GACzB,OAAO;KAER,OAAO,QAAQ;GACd,QAAQ;;EAId,OAAO;;CAGT,MAAM,WAAW,SAAS,KAAK,OAAY;EAGzC,IAAI,OAAO;GAMT,IAAI,sBAAsB,KAAA;QAOtB,iBAAiB,SACjB,OAAO,WAAW,eAClB,OAAO,mBAAmB,aAC1B;KAKA,MAAM,aAAa,0BAA0B,MAAM;KACnD,IAAI,CAAC,eAAe,QAAQ,UAAA,GAAa;MACvC,eAAe,QAAQ,YAAY,GAAA;MACnC,OAAO,SAAS,OAAA;MAGhB,OAAO,EACL,eAAe,KAAA;;;;GAOvB,MAAM;;EAGR,IAAI,CAAC,MAAM;GACT,MAAM,eAAe,WAAW,IAAA;GAChC,OAAOA,gBAAAA,SAAAA,WAAAA,EAAS,IAAA,YAAA;WAAW,aAAA;QAAoB,KAAA,CAAS;;EAG1D,OAAOC,gBAAAA,SAAAA,WAAAA,EAASC,WAAW,KAAA,GAAU,KAAA,CAAS;;CAG/C,SAAkB,UAAU;CAE7B,OAAO"}

@@ -9,3 +9,4 @@ import { useHydrated } from "./ClientOnly.js";

//#region src/link.tsx
var _tmpl$ = /* @__PURE__ */ template(`<svg><a>`), _tmpl$2 = /* @__PURE__ */ template(`<a>`);
var _tmpl$ = /* @__PURE__ */ template(`<svg><a>`);
var _tmpl$2 = /* @__PURE__ */ template(`<a>`);
function mergeRefs(...refs) {

@@ -300,3 +301,4 @@ return (el) => {

const [_, svgLinkProps] = splitProps(linkProps, ["class"]);
var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
var _el$ = _tmpl$();
var _el$2 = _el$.firstChild;
spread(_el$2, svgLinkProps, true);

@@ -303,0 +305,0 @@ insert(_el$2, children);

@@ -1,1 +0,1 @@

{"version":3,"file":"link.js","names":["Solid","deepEqual","exactPathTest","functionalUpdate","hasKeys","isDangerousProtocol","preloadWarning","removeTrailingSlash","isServer","Dynamic","useRouter","useIntersectionObserver","useHydrated","AnyRouter","Constrain","LinkOptions","RegisteredRouter","RoutePaths","ValidateLinkOptions","ValidateLinkOptionsArray","ComponentProps","JSX","ValidComponent","mergeRefs","refs","Array","el","T","ref","splitProps","Record","props","keys","ReadonlyArray","TKey","Pick","Omit","_local","_rest","omit","timeoutMap","WeakMap","EventTarget","ReturnType","setTimeout","useLinkProps","TRouter","TFrom","options","UseLinkPropsOptions","TTo","TMaskFrom","TMaskTo","router","isTransitioning","setIsTransitioning","createSignal","shouldHydrateHash","ssr","hasHydrated","hasRenderFetched","local","activeProps","STATIC_ACTIVE_PROPS_GET","inactiveProps","STATIC_INACTIVE_PROPS_GET","propsSafeToSpread","currentLocation","createMemo","stores","location","get","equals","prev","next","href","_options","_fromLocation","untrack","buildLocation","lazy","external","maskedLocation","hrefOption","disabled","undefined","publicHref","history","createHref","externalLink","_href","protocolAllowlist","process","env","NODE_ENV","console","warn","to","safeInternal","isSafeInternal","indexOf","URL","preload","reloadDocument","defaultPreload","preloadDelay","defaultPreloadDelay","isActive","activeOptions","current","nextLocation","exact","testExact","pathname","basepath","currentPath","nextPath","pathIsFuzzyEqual","startsWith","length","includeSearch","searchTest","search","partial","ignoreUndefined","explicitUndefined","includeHash","currentHash","hash","doPreload","preloadRoute","_builtLocation","catch","err","preloadViewportIoCallback","entry","IntersectionObserverEntry","isIntersecting","setRefSignal","Element","setRef","runWithOwner","rootMargin","createEffect","preloadValue","externalHref","merge","handleClick","e","MouseEvent","elementTarget","currentTarget","HTMLAnchorElement","SVGAElement","getAttribute","effectiveTarget","target","isCtrlEvent","defaultPrevented","button","preventDefault","unsub","subscribe","navigate","replace","resetScroll","hashScrollIntoView","startTransition","viewTransition","ignoreBlocker","enqueueIntentPreload","FocusEvent","eventTarget","has","set","delete","handleTouchStart","_","TouchEvent","handleLeave","id","clearTimeout","simpleStyling","class","style","onClick","createComposedHandler","onBlur","onFocus","onMouseEnter","onMouseOver","onMouseLeave","onMouseOut","onTouchStart","ResolvedLinkStateProps","CSSProperties","resolvedStateProps","EMPTY_OBJECT","resolvedClass","filter","Boolean","join","resolvedStyle","extraStateKeys","Set","stateProps","key","Object","add","composedRef","r","linkProps","defineProperty","getOwnPropertyDescriptor","enumerable","configurable","defineGetters","getters","role","aria-disabled","data-status","aria-current","data-transitioning","STATIC_ACTIVE_PROPS","callHandler","Event","event","TEvent","handler","EventHandlerUnion","getHandler","fallback","ActiveLinkOptions","ActiveLinkOptionProps","TComp","ActiveLinkProps","Partial","LinkComponentSolidProps","LinkProps","LinkPropsChildren","children","state","CreateLinkProps","LinkComponentProps","LinkComponent","TDefaultFrom","LinkComponentRoute","defaultFrom","createLink","Comp","_$createComponent","Link","_$mergeProps","_asChild","rest","resolvedChildren","ch","Function","svgLinkProps","_el$","_tmpl$","_el$2","firstChild","_$spread","_$insert","_el$3","_tmpl$2","component","metaKey","altKey","ctrlKey","shiftKey","zero","charCodeAt","LinkOptionsFnOptions","TOptions","LinkOptionsFn","linkOptions"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from '@solidjs/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\n\nfunction mergeRefs<T>(\n ...refs: Array<((el: T) => void) | undefined>\n): (el: T) => void {\n return (el: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(el)\n }\n }\n }\n}\n\nfunction splitProps<T extends Record<string, any>, TKey extends keyof T>(\n props: T,\n keys: ReadonlyArray<TKey>,\n): [Pick<T, TKey>, Omit<T, TKey>] {\n const _local = {} as Pick<T, TKey>\n const _rest = {} as Omit<T, TKey>\n\n // A safe way to polyfill splitProps if native getter copy is too complex\n // is just to return [props, Solid.omit(props, keys)] but it modifies typing.\n // Actually, Solid.omit exists!\n // Note: Solid.omit uses rest params (...keys), so we must spread the array.\n return [props as any, Solid.omit(props, ...(keys as any)) as any]\n}\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\n\nexport function useLinkProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '',\n>(\n options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n): ComponentProps<'a'> {\n const router = useRouter()\n const [isTransitioning, setIsTransitioning] = Solid.createSignal(false)\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n // Defaults are resolved through accessors at the use sites instead of\n // merging them into the props. Every merge/omit proxy layered here gets\n // re-enumerated by spread() on each navigation, and V8 dispatches proxy\n // traps in native runtime code — keeping this path proxy-free is what\n // keeps Link updates cheap.\n const local = options\n const activeProps = () => local.activeProps ?? STATIC_ACTIVE_PROPS_GET\n const inactiveProps = () => local.inactiveProps ?? STATIC_INACTIVE_PROPS_GET\n\n const propsSafeToSpread = Solid.omit(\n options as Record<string, any>,\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n )\n\n const currentLocation = Solid.createMemo(() => router.stores.location.get(), {\n equals: (prev, next) => prev.href === next.href,\n })\n\n const _options = () => options\n\n const next = Solid.createMemo(\n () => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const options = { _fromLocation, ..._options() } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(options))\n },\n {\n lazy: true,\n // Navigations usually leave most links' built locations unchanged;\n // comparing hrefs lets downstream memos (href, isActive) skip work.\n equals: (prev, next) =>\n prev.href === next.href &&\n prev.external === next.external &&\n prev.maskedLocation?.href === next.maskedLocation?.href,\n },\n )\n\n const hrefOption = Solid.createMemo(\n () => {\n if (_options().disabled) return undefined\n // Use publicHref - it contains the correct href for display\n // When a rewrite changes the origin, publicHref is the full URL\n // Otherwise it's the origin-stripped path\n // This avoids constructing URL objects in the hot path\n const location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n },\n { lazy: true },\n )\n\n const externalLink = Solid.createMemo(\n () => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = _options().to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n },\n { lazy: true },\n )\n\n const preload = Solid.createMemo(\n () => {\n if (_options().reloadDocument || externalLink()) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n },\n { lazy: true },\n )\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(\n () => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(\n current.pathname,\n router.basepath,\n )\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\n\n const pathIsFuzzyEqual =\n currentPath.startsWith(nextPath) &&\n (currentPath.length === nextPath.length ||\n currentPath[nextPath.length] === '/')\n if (!pathIsFuzzyEqual) {\n return false\n }\n }\n\n if (activeOptions?.includeSearch ?? true) {\n const searchTest = deepEqual(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n },\n { lazy: true },\n )\n\n const doPreload = () =>\n router\n .preloadRoute({ ..._options(), _builtLocation: next() } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const preloadViewportIoCallback = (\n entry: IntersectionObserverEntry | undefined,\n ) => {\n if (entry?.isIntersecting) {\n doPreload()\n }\n }\n\n const [ref, setRefSignal] = Solid.createSignal<Element | null>(null)\n\n const setRef = (el: Element | null) => {\n Solid.runWithOwner(null, () => {\n setRefSignal(el)\n })\n }\n\n useIntersectionObserver(\n ref,\n preloadViewportIoCallback,\n { rootMargin: '100px' },\n { disabled: !!local.disabled || !(Solid.untrack(preload) === 'viewport') },\n )\n\n Solid.createEffect(preload, (preloadValue) => {\n if (hasRenderFetched) {\n return\n }\n if (!local.disabled && preloadValue === 'render') {\n Solid.untrack(() => doPreload())\n hasRenderFetched = true\n }\n })\n\n if (Solid.untrack(externalLink)) {\n const externalHref = Solid.untrack(externalLink)\n return Solid.merge(\n propsSafeToSpread,\n {\n // ref: mergeRefs(setRef, _options().ref),\n href: externalHref,\n },\n splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\n // Check actual element's target attribute as fallback\n const elementTarget = (\n e.currentTarget as HTMLAnchorElement | SVGAElement\n ).getAttribute('target')\n const effectiveTarget =\n local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n Solid.runWithOwner(null, () => {\n setIsTransitioning(true)\n })\n\n const unsub = router.subscribe('onResolved', () => {\n unsub()\n Solid.runWithOwner(null, () => {\n setIsTransitioning(false)\n })\n })\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ..._options(),\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {\n if (local.disabled || preload() !== 'intent') return\n\n if (!preloadDelay()) {\n doPreload()\n return\n }\n\n const eventTarget = e.currentTarget || e.target\n\n if (!eventTarget || timeoutMap.has(eventTarget)) return\n\n timeoutMap.set(\n eventTarget,\n setTimeout(() => {\n timeoutMap.delete(eventTarget)\n doPreload()\n }, preloadDelay()),\n )\n }\n\n const handleTouchStart = (_: TouchEvent) => {\n if (local.disabled || preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = (e: MouseEvent | FocusEvent) => {\n if (local.disabled) return\n const eventTarget = e.currentTarget || e.target\n\n if (eventTarget) {\n const id = timeoutMap.get(eventTarget)\n clearTimeout(id)\n timeoutMap.delete(eventTarget)\n }\n }\n\n const simpleStyling = Solid.createMemo(\n () =>\n activeProps() === STATIC_ACTIVE_PROPS_GET &&\n inactiveProps() === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n { lazy: true },\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(\n () => local.onFocus,\n enqueueIntentPreload,\n )\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueueIntentPreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueueIntentPreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<ComponentProps<'a'>, 'style'> & {\n style?: JSX.CSSProperties\n }\n\n const resolvedStateProps = Solid.createMemo(\n (): ResolvedLinkStateProps =>\n (isActive()\n ? functionalUpdate(activeProps() as any, {})\n : functionalUpdate(inactiveProps(), {})) ?? EMPTY_OBJECT,\n { lazy: true },\n )\n\n const resolvedClass = Solid.createMemo(\n () => {\n if (simpleStyling()) return isActive() ? 'active' : undefined\n return (\n [local.class, resolvedStateProps().class].filter(Boolean).join(' ') ||\n undefined\n )\n },\n { lazy: true },\n )\n\n const resolvedStyle = Solid.createMemo(\n () => {\n if (simpleStyling()) return local.style\n const style = { ...local.style, ...resolvedStateProps().style }\n return hasKeys(style) ? style : undefined\n },\n { lazy: true },\n )\n\n // The returned object must be a plain object with a stable key set so the\n // consuming spread() never enumerates through proxy traps. Reactivity lives\n // in the property getters; values that no longer apply resolve to undefined,\n // which spread()/assign() treats as attribute removal. Keys returned by\n // activeProps/inactiveProps are discovered once at setup.\n const extraStateKeys = new Set<string>()\n Solid.untrack(() => {\n for (const stateProps of [\n functionalUpdate(activeProps() as any, {}),\n functionalUpdate(inactiveProps(), {}),\n ]) {\n if (stateProps) {\n for (const key of Object.keys(stateProps)) {\n if (key !== 'class' && key !== 'style') extraStateKeys.add(key)\n }\n }\n }\n })\n\n const composedRef = mergeRefs(setRef, (el: Element) => {\n const r = _options().ref as any\n if (typeof r === 'function') r(el)\n })\n\n const linkProps: Record<string, any> = {}\n for (const key of Object.keys(propsSafeToSpread)) {\n Object.defineProperty(\n linkProps,\n key,\n Object.getOwnPropertyDescriptor(propsSafeToSpread, key)!,\n )\n }\n for (const key of extraStateKeys) {\n Object.defineProperty(linkProps, key, {\n get: () => (resolvedStateProps() as Record<string, any>)[key],\n enumerable: true,\n configurable: true,\n })\n }\n\n const defineGetters = (getters: Record<string, () => any>) => {\n for (const key of Object.keys(getters)) {\n Object.defineProperty(linkProps, key, {\n get: getters[key],\n enumerable: true,\n configurable: true,\n })\n }\n }\n\n linkProps.ref = composedRef\n linkProps.onClick = onClick\n linkProps.onBlur = onBlur\n linkProps.onFocus = onFocus\n linkProps.onMouseEnter = onMouseEnter\n linkProps.onMouseOver = onMouseOver\n linkProps.onMouseLeave = onMouseLeave\n linkProps.onMouseOut = onMouseOut\n linkProps.onTouchStart = onTouchStart\n\n defineGetters({\n href: () => hrefOption()?.href,\n disabled: () => !!local.disabled,\n target: () => local.target,\n role: () => (local.disabled ? 'link' : undefined),\n 'aria-disabled': () => (local.disabled ? 'true' : undefined),\n 'data-status': () => (isActive() ? 'active' : undefined),\n 'aria-current': () => (isActive() ? 'page' : undefined),\n 'data-transitioning': () =>\n isTransitioning() ? 'transitioning' : undefined,\n class: resolvedClass,\n style: resolvedStyle,\n })\n\n return linkProps as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\nexport type UseLinkPropsOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n Omit<ComponentProps<'a'>, 'style'> & { style?: JSX.CSSProperties }\n\nexport type ActiveLinkOptions<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n LinkComponentSolidProps<TComp> & {\n [key: `data-${string}`]: unknown\n }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n /**\n * A function that returns additional props for the `active` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n /**\n * A function that returns additional props for the `inactive` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkPropsChildren\n\nexport interface LinkPropsChildren {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | JSX.Element\n | ((state: { isActive: boolean; isTransitioning: boolean }) => JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends ValidComponent\n ? Omit<ComponentProps<TComp>, keyof CreateLinkProps>\n : never\n\nexport type LinkComponentProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkComponentSolidProps<TComp> &\n LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n any,\n any,\n string,\n string,\n string,\n string\n>\n\nexport type LinkComponent<\n in out TComp,\n in out TDefaultFrom extends string = string,\n> = <\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = TDefaultFrom,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(\n props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => JSX.Element\n\nexport interface LinkComponentRoute<\n in out TDefaultFrom extends string = string,\n> {\n defaultFrom: TDefaultFrom;\n <\n TRouter extends AnyRouter = RegisteredRouter,\n const TTo extends string | undefined = undefined,\n const TMaskTo extends string = '',\n >(\n props: LinkComponentProps<\n 'a',\n TRouter,\n this['defaultFrom'],\n TTo,\n this['defaultFrom'],\n TMaskTo\n >,\n ): JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = splitProps(props as typeof props & { _asChild: any }, [\n '_asChild',\n 'children',\n ])\n const [_, linkProps] = splitProps(useLinkProps(rest as unknown as any), [\n 'type',\n ])\n\n // Resolve children once using Solid.children to avoid\n // re-accessing the children getter (which in Solid 2.0 would\n // re-invoke createComponent each time for JSX children).\n const resolvedChildren = Solid.children(() => local.children as JSX.Element)\n const children = () => {\n const ch = resolvedChildren()\n if (typeof ch === 'function') {\n return (ch as Function)({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n get isTransitioning() {\n return (linkProps as any)['data-transitioning'] === 'transitioning'\n },\n })\n }\n\n return ch\n }\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = splitProps(linkProps as any, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\n}\n\nexport type LinkOptionsFnOptions<\n TOptions,\n TComp,\n TRouter extends AnyRouter = RegisteredRouter,\n> =\n TOptions extends ReadonlyArray<any>\n ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n const TOptions,\n TRouter extends AnyRouter = RegisteredRouter,\n>(\n options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n return options as any\n}\n"],"mappings":";;;;;;;;;AAgCA,SAASuB,UACP,GAAGC,MACc;CACjB,QAAQE,OAAU;EAChB,KAAK,MAAME,OAAOJ,MAChB,IAAI,OAAOI,QAAQ,YACjBA,IAAIF,EAAE;CAGZ;AACF;AA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EAAAqD,OAAAC,OAAGzB,QAAQ;EAAlC,OAAAyB;CACF;CAEA,OAAAf,gBACGjP,SAAOmP,WAAA,EAAA,IAACe,YAAS;EAAA,OAAE9M,MAAMgM;CAA0B,EAAA,GAAM1C,WAAS,EAAA,IAAA6B,WAAA;EAAA,OAChEA,SAAS;CAAC,EAAA,CAAA,CAAA;AAGjB;AAEA,SAASnF,YAAYT,GAAe;CAClC,OAAO,CAAC,EAAEA,EAAEwH,WAAWxH,EAAEyH,UAAUzH,EAAE0H,WAAW1H,EAAE2H;AACpD;AAEA,SAAS5K,eAAeF,IAAa;CACnC,IAAI,OAAOA,OAAO,UAAU,OAAO;CACnC,MAAM+K,OAAO/K,GAAGgL,WAAW,CAAC;CAC5B,IAAID,SAAS,IAAI,OAAO/K,GAAGgL,WAAW,CAAC,MAAM;CAC7C,OAAOD,SAAS;AAClB;AAkBA,IAAaK,eAAmCrO,YAAY;CAC1D,OAAOA;AACT"}
{"version":3,"file":"link.js","names":["<Link {...props} _asChild={Comp} />","_asChild={Comp}","<svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>","<a {...linkProps}>{children()}</a>","<Dynamic component={local._asChild as ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>"],"sources":["../../src/link.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\n\nimport {\n deepEqual,\n exactPathTest,\n functionalUpdate,\n hasKeys,\n isDangerousProtocol,\n preloadWarning,\n removeTrailingSlash,\n} from '@tanstack/router-core'\n\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from '@solidjs/web'\nimport { useRouter } from './useRouter'\n\nimport { useIntersectionObserver } from './utils'\n\nimport { useHydrated } from './ClientOnly'\nimport type {\n AnyRouter,\n Constrain,\n LinkOptions,\n RegisteredRouter,\n RoutePaths,\n} from '@tanstack/router-core'\nimport type {\n ValidateLinkOptions,\n ValidateLinkOptionsArray,\n} from './typePrimitives'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\n\nfunction mergeRefs<T>(\n ...refs: Array<((el: T) => void) | undefined>\n): (el: T) => void {\n return (el: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(el)\n }\n }\n }\n}\n\nfunction splitProps<T extends Record<string, any>, TKey extends keyof T>(\n props: T,\n keys: ReadonlyArray<TKey>,\n): [Pick<T, TKey>, Omit<T, TKey>] {\n const _local = {} as Pick<T, TKey>\n const _rest = {} as Omit<T, TKey>\n\n // A safe way to polyfill splitProps if native getter copy is too complex\n // is just to return [props, Solid.omit(props, keys)] but it modifies typing.\n // Actually, Solid.omit exists!\n // Note: Solid.omit uses rest params (...keys), so we must spread the array.\n return [props as any, Solid.omit(props, ...(keys as any)) as any]\n}\nconst timeoutMap = new WeakMap<EventTarget, ReturnType<typeof setTimeout>>()\n\nexport function useLinkProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '',\n>(\n options: UseLinkPropsOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n): ComponentProps<'a'> {\n const router = useRouter()\n const [isTransitioning, setIsTransitioning] = Solid.createSignal(false)\n const shouldHydrateHash = !isServer && !!router.options.ssr\n const hasHydrated = useHydrated()\n\n let hasRenderFetched = false\n\n // Defaults are resolved through accessors at the use sites instead of\n // merging them into the props. Every merge/omit proxy layered here gets\n // re-enumerated by spread() on each navigation, and V8 dispatches proxy\n // traps in native runtime code — keeping this path proxy-free is what\n // keeps Link updates cheap.\n const local = options\n const activeProps = () => local.activeProps ?? STATIC_ACTIVE_PROPS_GET\n const inactiveProps = () => local.inactiveProps ?? STATIC_INACTIVE_PROPS_GET\n\n const propsSafeToSpread = Solid.omit(\n options as Record<string, any>,\n 'activeProps',\n 'inactiveProps',\n 'activeOptions',\n 'to',\n 'preload',\n 'preloadDelay',\n 'preloadIntentProximity',\n 'hashScrollIntoView',\n 'replace',\n 'startTransition',\n 'resetScroll',\n 'viewTransition',\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onTouchStart',\n 'ignoreBlocker',\n 'params',\n 'search',\n 'hash',\n 'state',\n 'mask',\n 'reloadDocument',\n 'unsafeRelative',\n 'from',\n )\n\n const currentLocation = Solid.createMemo(() => router.stores.location.get(), {\n equals: (prev, next) => prev.href === next.href,\n })\n\n const _options = () => options\n\n const next = Solid.createMemo(\n () => {\n // Rebuild when inherited search/hash or the current route context changes.\n const _fromLocation = currentLocation()\n const options = { _fromLocation, ..._options() } as any\n // untrack because router-core will also access stores, which are signals in solid\n return Solid.untrack(() => router.buildLocation(options))\n },\n {\n lazy: true,\n // Navigations usually leave most links' built locations unchanged;\n // comparing hrefs lets downstream memos (href, isActive) skip work.\n equals: (prev, next) =>\n prev.href === next.href &&\n prev.external === next.external &&\n prev.maskedLocation?.href === next.maskedLocation?.href,\n },\n )\n\n const hrefOption = Solid.createMemo(\n () => {\n if (_options().disabled) return undefined\n // Use publicHref - it contains the correct href for display\n // When a rewrite changes the origin, publicHref is the full URL\n // Otherwise it's the origin-stripped path\n // This avoids constructing URL objects in the hot path\n const location = next().maskedLocation ?? next()\n const publicHref = location.publicHref\n const external = location.external\n\n if (external) {\n return { href: publicHref, external: true }\n }\n\n return {\n href: router.history.createHref(publicHref) || '/',\n external: false,\n }\n },\n { lazy: true },\n )\n\n const externalLink = Solid.createMemo(\n () => {\n const _href = hrefOption()\n if (_href?.external) {\n // Block dangerous protocols for external links\n if (isDangerousProtocol(_href.href, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${_href.href}`)\n }\n return undefined\n }\n return _href.href\n }\n const to = _options().to\n const safeInternal = isSafeInternal(to)\n if (safeInternal) return undefined\n if (typeof to !== 'string' || to.indexOf(':') === -1) return undefined\n try {\n new URL(to as any)\n // Block dangerous protocols like javascript:, blob:, data:\n if (isDangerousProtocol(to, router.protocolAllowlist)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Blocked Link with dangerous protocol: ${to}`)\n }\n return undefined\n }\n return to\n } catch {}\n return undefined\n },\n { lazy: true },\n )\n\n const preload = Solid.createMemo(\n () => {\n if (_options().reloadDocument || externalLink()) {\n return false\n }\n return local.preload ?? router.options.defaultPreload\n },\n { lazy: true },\n )\n const preloadDelay = () =>\n local.preloadDelay ?? router.options.defaultPreloadDelay ?? 0\n\n const isActive = Solid.createMemo(\n () => {\n if (externalLink()) return false\n const activeOptions = local.activeOptions\n const current = currentLocation()\n const nextLocation = next()\n\n if (activeOptions?.exact) {\n const testExact = exactPathTest(\n current.pathname,\n nextLocation.pathname,\n router.basepath,\n )\n if (!testExact) {\n return false\n }\n } else {\n const currentPath = removeTrailingSlash(\n current.pathname,\n router.basepath,\n )\n const nextPath = removeTrailingSlash(\n nextLocation.pathname,\n router.basepath,\n )\n\n const pathIsFuzzyEqual =\n currentPath.startsWith(nextPath) &&\n (currentPath.length === nextPath.length ||\n currentPath[nextPath.length] === '/')\n if (!pathIsFuzzyEqual) {\n return false\n }\n }\n\n if (activeOptions?.includeSearch ?? true) {\n const searchTest = deepEqual(current.search, nextLocation.search, {\n partial: !activeOptions?.exact,\n ignoreUndefined: !activeOptions?.explicitUndefined,\n })\n if (!searchTest) {\n return false\n }\n }\n\n if (activeOptions?.includeHash) {\n const currentHash =\n shouldHydrateHash && !hasHydrated() ? '' : current.hash\n return currentHash === nextLocation.hash\n }\n return true\n },\n { lazy: true },\n )\n\n const doPreload = () =>\n router\n .preloadRoute({ ..._options(), _builtLocation: next() } as any)\n .catch((err: any) => {\n console.warn(err)\n console.warn(preloadWarning)\n })\n\n const preloadViewportIoCallback = (\n entry: IntersectionObserverEntry | undefined,\n ) => {\n if (entry?.isIntersecting) {\n doPreload()\n }\n }\n\n const [ref, setRefSignal] = Solid.createSignal<Element | null>(null)\n\n const setRef = (el: Element | null) => {\n Solid.runWithOwner(null, () => {\n setRefSignal(el)\n })\n }\n\n useIntersectionObserver(\n ref,\n preloadViewportIoCallback,\n { rootMargin: '100px' },\n { disabled: !!local.disabled || !(Solid.untrack(preload) === 'viewport') },\n )\n\n Solid.createEffect(preload, (preloadValue) => {\n if (hasRenderFetched) {\n return\n }\n if (!local.disabled && preloadValue === 'render') {\n Solid.untrack(() => doPreload())\n hasRenderFetched = true\n }\n })\n\n if (Solid.untrack(externalLink)) {\n const externalHref = Solid.untrack(externalLink)\n return Solid.merge(\n propsSafeToSpread,\n {\n // ref: mergeRefs(setRef, _options().ref),\n href: externalHref,\n },\n splitProps(local, [\n 'target',\n 'disabled',\n 'style',\n 'class',\n 'onClick',\n 'onBlur',\n 'onFocus',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOut',\n 'onMouseOver',\n 'onTouchStart',\n ])[0],\n ) as any\n }\n\n // The click handler\n const handleClick = (e: MouseEvent) => {\n // Check actual element's target attribute as fallback\n const elementTarget = (\n e.currentTarget as HTMLAnchorElement | SVGAElement\n ).getAttribute('target')\n const effectiveTarget =\n local.target !== undefined ? local.target : elementTarget\n\n if (\n !local.disabled &&\n !isCtrlEvent(e) &&\n !e.defaultPrevented &&\n (!effectiveTarget || effectiveTarget === '_self') &&\n e.button === 0\n ) {\n e.preventDefault()\n\n Solid.runWithOwner(null, () => {\n setIsTransitioning(true)\n })\n\n const unsub = router.subscribe('onResolved', () => {\n unsub()\n Solid.runWithOwner(null, () => {\n setIsTransitioning(false)\n })\n })\n\n // All is well? Navigate!\n // N.B. we don't call `router.commitLocation(next) here because we want to run `validateSearch` before committing\n router.navigate({\n ..._options(),\n replace: local.replace,\n resetScroll: local.resetScroll,\n hashScrollIntoView: local.hashScrollIntoView,\n startTransition: local.startTransition,\n viewTransition: local.viewTransition,\n ignoreBlocker: local.ignoreBlocker,\n })\n }\n }\n\n const enqueueIntentPreload = (e: MouseEvent | FocusEvent) => {\n if (local.disabled || preload() !== 'intent') return\n\n if (!preloadDelay()) {\n doPreload()\n return\n }\n\n const eventTarget = e.currentTarget || e.target\n\n if (!eventTarget || timeoutMap.has(eventTarget)) return\n\n timeoutMap.set(\n eventTarget,\n setTimeout(() => {\n timeoutMap.delete(eventTarget)\n doPreload()\n }, preloadDelay()),\n )\n }\n\n const handleTouchStart = (_: TouchEvent) => {\n if (local.disabled || preload() !== 'intent') return\n doPreload()\n }\n\n const handleLeave = (e: MouseEvent | FocusEvent) => {\n if (local.disabled) return\n const eventTarget = e.currentTarget || e.target\n\n if (eventTarget) {\n const id = timeoutMap.get(eventTarget)\n clearTimeout(id)\n timeoutMap.delete(eventTarget)\n }\n }\n\n const simpleStyling = Solid.createMemo(\n () =>\n activeProps() === STATIC_ACTIVE_PROPS_GET &&\n inactiveProps() === STATIC_INACTIVE_PROPS_GET &&\n local.class === undefined &&\n local.style === undefined,\n { lazy: true },\n )\n\n const onClick = createComposedHandler(() => local.onClick, handleClick)\n const onBlur = createComposedHandler(() => local.onBlur, handleLeave)\n const onFocus = createComposedHandler(\n () => local.onFocus,\n enqueueIntentPreload,\n )\n const onMouseEnter = createComposedHandler(\n () => local.onMouseEnter,\n enqueueIntentPreload,\n )\n const onMouseOver = createComposedHandler(\n () => local.onMouseOver,\n enqueueIntentPreload,\n )\n const onMouseLeave = createComposedHandler(\n () => local.onMouseLeave,\n handleLeave,\n )\n const onMouseOut = createComposedHandler(() => local.onMouseOut, handleLeave)\n const onTouchStart = createComposedHandler(\n () => local.onTouchStart,\n handleTouchStart,\n )\n\n type ResolvedLinkStateProps = Omit<ComponentProps<'a'>, 'style'> & {\n style?: JSX.CSSProperties\n }\n\n const resolvedStateProps = Solid.createMemo(\n (): ResolvedLinkStateProps =>\n (isActive()\n ? functionalUpdate(activeProps() as any, {})\n : functionalUpdate(inactiveProps(), {})) ?? EMPTY_OBJECT,\n { lazy: true },\n )\n\n const resolvedClass = Solid.createMemo(\n () => {\n if (simpleStyling()) return isActive() ? 'active' : undefined\n return (\n [local.class, resolvedStateProps().class].filter(Boolean).join(' ') ||\n undefined\n )\n },\n { lazy: true },\n )\n\n const resolvedStyle = Solid.createMemo(\n () => {\n if (simpleStyling()) return local.style\n const style = { ...local.style, ...resolvedStateProps().style }\n return hasKeys(style) ? style : undefined\n },\n { lazy: true },\n )\n\n // The returned object must be a plain object with a stable key set so the\n // consuming spread() never enumerates through proxy traps. Reactivity lives\n // in the property getters; values that no longer apply resolve to undefined,\n // which spread()/assign() treats as attribute removal. Keys returned by\n // activeProps/inactiveProps are discovered once at setup.\n const extraStateKeys = new Set<string>()\n Solid.untrack(() => {\n for (const stateProps of [\n functionalUpdate(activeProps() as any, {}),\n functionalUpdate(inactiveProps(), {}),\n ]) {\n if (stateProps) {\n for (const key of Object.keys(stateProps)) {\n if (key !== 'class' && key !== 'style') extraStateKeys.add(key)\n }\n }\n }\n })\n\n const composedRef = mergeRefs(setRef, (el: Element) => {\n const r = _options().ref as any\n if (typeof r === 'function') r(el)\n })\n\n const linkProps: Record<string, any> = {}\n for (const key of Object.keys(propsSafeToSpread)) {\n Object.defineProperty(\n linkProps,\n key,\n Object.getOwnPropertyDescriptor(propsSafeToSpread, key)!,\n )\n }\n for (const key of extraStateKeys) {\n Object.defineProperty(linkProps, key, {\n get: () => (resolvedStateProps() as Record<string, any>)[key],\n enumerable: true,\n configurable: true,\n })\n }\n\n const defineGetters = (getters: Record<string, () => any>) => {\n for (const key of Object.keys(getters)) {\n Object.defineProperty(linkProps, key, {\n get: getters[key],\n enumerable: true,\n configurable: true,\n })\n }\n }\n\n linkProps.ref = composedRef\n linkProps.onClick = onClick\n linkProps.onBlur = onBlur\n linkProps.onFocus = onFocus\n linkProps.onMouseEnter = onMouseEnter\n linkProps.onMouseOver = onMouseOver\n linkProps.onMouseLeave = onMouseLeave\n linkProps.onMouseOut = onMouseOut\n linkProps.onTouchStart = onTouchStart\n\n defineGetters({\n href: () => hrefOption()?.href,\n disabled: () => !!local.disabled,\n target: () => local.target,\n role: () => (local.disabled ? 'link' : undefined),\n 'aria-disabled': () => (local.disabled ? 'true' : undefined),\n 'data-status': () => (isActive() ? 'active' : undefined),\n 'aria-current': () => (isActive() ? 'page' : undefined),\n 'data-transitioning': () =>\n isTransitioning() ? 'transitioning' : undefined,\n class: resolvedClass,\n style: resolvedStyle,\n })\n\n return linkProps as any\n}\n\nconst STATIC_ACTIVE_PROPS = { class: 'active' }\nconst STATIC_ACTIVE_PROPS_GET = () => STATIC_ACTIVE_PROPS\nconst EMPTY_OBJECT = {}\nconst STATIC_INACTIVE_PROPS_GET = () => EMPTY_OBJECT\n\n/** Call a JSX.EventHandlerUnion with the event. */\nfunction callHandler<T, TEvent extends Event>(\n event: TEvent & { currentTarget: T; target: Element },\n handler: JSX.EventHandlerUnion<T, TEvent>,\n) {\n if (typeof handler === 'function') {\n handler(event)\n } else {\n handler[0](handler[1], event)\n }\n return event.defaultPrevented\n}\n\nfunction createComposedHandler<T, TEvent extends Event>(\n getHandler: () => JSX.EventHandlerUnion<T, TEvent> | undefined,\n fallback: (event: TEvent) => void,\n) {\n return (event: TEvent & { currentTarget: T; target: Element }) => {\n const handler = getHandler()\n if (!handler || !callHandler(event, handler)) fallback(event)\n }\n}\n\nexport type UseLinkPropsOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends RoutePaths<TRouter['routeTree']> | string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<'a', TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n Omit<ComponentProps<'a'>, 'style'> & { style?: JSX.CSSProperties }\n\nexport type ActiveLinkOptions<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n ActiveLinkOptionProps<TComp>\n\ntype ActiveLinkProps<TComp> = Partial<\n LinkComponentSolidProps<TComp> & {\n [key: `data-${string}`]: unknown\n }\n>\n\nexport interface ActiveLinkOptionProps<TComp = 'a'> {\n /**\n * A function that returns additional props for the `active` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n activeProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n /**\n * A function that returns additional props for the `inactive` state of this link.\n * These props override other props passed to the link (`style`'s are merged, `class`'s are concatenated)\n */\n inactiveProps?: ActiveLinkProps<TComp> | (() => ActiveLinkProps<TComp>)\n}\n\nexport type LinkProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = ActiveLinkOptions<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo> &\n LinkPropsChildren\n\nexport interface LinkPropsChildren {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | JSX.Element\n | ((state: { isActive: boolean; isTransitioning: boolean }) => JSX.Element)\n}\n\ntype LinkComponentSolidProps<TComp> = TComp extends ValidComponent\n ? Omit<ComponentProps<TComp>, keyof CreateLinkProps>\n : never\n\nexport type LinkComponentProps<\n TComp = 'a',\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = '.',\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '.',\n> = LinkComponentSolidProps<TComp> &\n LinkProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport type CreateLinkProps = LinkProps<\n any,\n any,\n string,\n string,\n string,\n string\n>\n\nexport type LinkComponent<\n in out TComp,\n in out TDefaultFrom extends string = string,\n> = <\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = TDefaultFrom,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(\n props: LinkComponentProps<TComp, TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n) => JSX.Element\n\nexport interface LinkComponentRoute<\n in out TDefaultFrom extends string = string,\n> {\n defaultFrom: TDefaultFrom;\n <\n TRouter extends AnyRouter = RegisteredRouter,\n const TTo extends string | undefined = undefined,\n const TMaskTo extends string = '',\n >(\n props: LinkComponentProps<\n 'a',\n TRouter,\n this['defaultFrom'],\n TTo,\n this['defaultFrom'],\n TMaskTo\n >,\n ): JSX.Element\n}\n\nexport function createLink<const TComp>(\n Comp: Constrain<TComp, any, (props: CreateLinkProps) => JSX.Element>,\n): LinkComponent<TComp> {\n return (props) => <Link {...props} _asChild={Comp} />\n}\n\nexport const Link: LinkComponent<'a'> = (props) => {\n const [local, rest] = splitProps(props as typeof props & { _asChild: any }, [\n '_asChild',\n 'children',\n ])\n const [_, linkProps] = splitProps(useLinkProps(rest as unknown as any), [\n 'type',\n ])\n\n // Resolve children once using Solid.children to avoid\n // re-accessing the children getter (which in Solid 2.0 would\n // re-invoke createComponent each time for JSX children).\n const resolvedChildren = Solid.children(() => local.children as JSX.Element)\n const children = () => {\n const ch = resolvedChildren()\n if (typeof ch === 'function') {\n return (ch as Function)({\n get isActive() {\n return (linkProps as any)['data-status'] === 'active'\n },\n get isTransitioning() {\n return (linkProps as any)['data-transitioning'] === 'transitioning'\n },\n })\n }\n\n return ch\n }\n\n if (local._asChild === 'svg') {\n const [_, svgLinkProps] = splitProps(linkProps as any, ['class'])\n return (\n <svg>\n <a {...svgLinkProps}>{children()}</a>\n </svg>\n )\n }\n\n if (!local._asChild) {\n return <a {...linkProps}>{children()}</a>\n }\n\n return (\n <Dynamic component={local._asChild as ValidComponent} {...linkProps}>\n {children()}\n </Dynamic>\n )\n}\n\nfunction isCtrlEvent(e: MouseEvent) {\n return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\n}\n\nfunction isSafeInternal(to: unknown) {\n if (typeof to !== 'string') return false\n const zero = to.charCodeAt(0)\n if (zero === 47) return to.charCodeAt(1) !== 47 // '/' but not '//'\n return zero === 46 // '.', '..', './', '../'\n}\n\nexport type LinkOptionsFnOptions<\n TOptions,\n TComp,\n TRouter extends AnyRouter = RegisteredRouter,\n> =\n TOptions extends ReadonlyArray<any>\n ? ValidateLinkOptionsArray<TRouter, TOptions, string, TComp>\n : ValidateLinkOptions<TRouter, TOptions, string, TComp>\n\nexport type LinkOptionsFn<TComp> = <\n const TOptions,\n TRouter extends AnyRouter = RegisteredRouter,\n>(\n options: LinkOptionsFnOptions<TOptions, TComp, TRouter>,\n) => TOptions\n\nexport const linkOptions: LinkOptionsFn<'a'> = (options) => {\n return options as any\n}\n"],"mappings":";;;;;;;;;;AAgCA,SAAS,UACP,GAAG,MACc;CACjB,QAAQ,OAAU;EAChB,KAAK,MAAM,OAAO,MAChB,IAAI,OAAO,QAAQ,YACjB,IAAI,EAAA;;;AAMZ,SAAS,WACP,OACA,MACgC;CAQhC,OAAO,CAAC,OAAc,MAAM,KAAK,OAAO,GAAI,IAAA,CAAa;;AAE3D,IAAM,6BAAa,IAAI,QAAuC;AAE9D,SAAgB,aAOd,SACqB;CACrB,MAAM,SAAS,UAAA;CACf,MAAM,CAAC,iBAAiB,sBAAsB,MAAM,aAAa,KAAA;CACjE,MAAM,oBAAoB,CAAC,YAAY,CAAC,CAAC,OAAO,QAAQ;CACxD,MAAM,cAAc,YAAA;CAEpB,IAAI,mBAAmB;CAOvB,MAAM,QAAQ;CACd,MAAM,oBAAoB,MAAM,eAAe;CAC/C,MAAM,sBAAsB,MAAM,iBAAiB;CAEnD,MAAM,oBAAoB,MAAM,KAC9B,SACA,eACA,iBACA,iBACA,MACA,WACA,gBACA,0BACA,sBACA,WACA,mBACA,eACA,kBACA,UACA,YACA,SACA,SACA,WACA,UACA,WACA,gBACA,gBACA,eACA,cACA,gBACA,iBACA,UACA,UACA,QACA,SACA,QACA,kBACA,kBACA,MAAA;CAGF,MAAM,kBAAkB,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;;CAGT,IAAI,MAAM,aAAa,OAAO;EAC5B,MAAM,CAAC,GAAG,gBAAgB,WAAW,WAAkB,CAAC,OAAA,CAAQ;EAE9D,IAAA,OAAA,OAAA;EACE,IAAA,QAAA,KAAA;gBAAO,cAAA,IAAA;EAAP,OAAA,OAAsB,QAAA;EAF1B,OACEC;;CAMJ,IAAI,CAAC,MAAM,UAAU;EACZ,IAAA,QAAA,QAAA;gBAAO,WAAA,IAAA;EAAP,OAAA,OAAmB,QAAA;EAA1B,OAAOC;;CAGT,OACEC,gBAAAA,SAAAA,WAAAA,EAAS,IAAA,YAAA;SAAW,MAAM;MAAgC,WAA1D,EAAA,IAAA,WAAA;SACG,SAAA;IACO,CAAA;;AAId,SAAS,YAAY,GAAe;CAClC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE;;AAGpD,SAAS,eAAe,IAAa;CACnC,IAAI,OAAO,OAAO,UAAU,OAAO;CACnC,MAAM,OAAO,GAAG,WAAW,CAAA;CAC3B,IAAI,SAAS,IAAI,OAAO,GAAG,WAAW,CAAA,MAAO;CAC7C,OAAO,SAAS;;AAmBlB,IAAa,eAAmC,YAAY;CAC1D,OAAO"}

@@ -72,3 +72,5 @@ import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";

get fallback() {
return memo(() => !!shouldSkipSuspenseFallback())() ? void 0 : createComponent(Dynamic, { get component() {
return memo(() => {
return !!shouldSkipSuspenseFallback();
})() ? void 0 : createComponent(Dynamic, { get component() {
return resolvePendingComponent();

@@ -145,3 +147,11 @@ } });

}
}), memo(() => memo(() => currentMatchState().parentRouteId === rootRouteId)() ? [createComponent(OnRendered, {}), memo(() => memo(() => !!(router.options.scrollRestoration && (isServer ?? router.isServer)))() ? createComponent(ScrollRestoration, {}) : null)] : null)];
}), memo(() => {
return memo(() => {
return currentMatchState().parentRouteId === rootRouteId;
})() ? [createComponent(OnRendered, {}), memo(() => {
return memo(() => {
return !!(router.options.scrollRestoration && (isServer ?? router.isServer));
})() ? createComponent(ScrollRestoration, {}) : null;
})] : null;
})];
}

@@ -361,3 +371,5 @@ });

get when() {
return memo(() => !!shouldShowNotFound())() ? route() : shouldShowNotFound();
return memo(() => {
return !!shouldShowNotFound();
})() ? route() : shouldShowNotFound();
},

@@ -386,3 +398,5 @@ children: (resolvedRoute) => Solid.untrack(() => renderRouteNotFound(router, resolvedRoute(), void 0))

get fallback() {
return memo(() => !!childPendingComponent())() ? createComponent(Dynamic, { get component() {
return memo(() => {
return !!childPendingComponent();
})() ? createComponent(Dynamic, { get component() {
return childPendingComponent();

@@ -389,0 +403,0 @@ } }) : null;

@@ -1,1 +0,1 @@

{"version":3,"file":"matchContext.js","names":["Solid","AnyRouteMatch","NearestMatchContextValue","matchId","Accessor","routeId","match","hasPending","defaultNearestMatchContext","undefined","nearestMatchContext","createContext"],"sources":["../../src/matchContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouteMatch } from '@tanstack/router-core'\n\nexport type NearestMatchContextValue = {\n matchId: Solid.Accessor<string | undefined>\n routeId: Solid.Accessor<string | undefined>\n match: Solid.Accessor<AnyRouteMatch | undefined>\n hasPending: Solid.Accessor<boolean>\n}\n\nconst defaultNearestMatchContext: NearestMatchContextValue = {\n matchId: () => undefined,\n routeId: () => undefined,\n match: () => undefined,\n hasPending: () => false,\n}\n\nexport const nearestMatchContext =\n Solid.createContext<NearestMatchContextValue>(defaultNearestMatchContext)\n"],"mappings":";AAiBA,IAAaU,sBACXV,MAAMW,cAAwCH;CAP9CL,eAAeM,KAAAA;CACfJ,eAAeI,KAAAA;CACfH,aAAaG,KAAAA;CACbF,kBAAkB;AAI4BC,CAA0B"}
{"version":3,"file":"matchContext.js","names":[],"sources":["../../src/matchContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouteMatch } from '@tanstack/router-core'\n\nexport type NearestMatchContextValue = {\n matchId: Solid.Accessor<string | undefined>\n routeId: Solid.Accessor<string | undefined>\n match: Solid.Accessor<AnyRouteMatch | undefined>\n hasPending: Solid.Accessor<boolean>\n}\n\nconst defaultNearestMatchContext: NearestMatchContextValue = {\n matchId: () => undefined,\n routeId: () => undefined,\n match: () => undefined,\n hasPending: () => false,\n}\n\nexport const nearestMatchContext =\n Solid.createContext<NearestMatchContextValue>(defaultNearestMatchContext)\n"],"mappings":";AAiBA,IAAa,sBACX,MAAM,cAAwC;CAP9C,eAAe,KAAA;CACf,eAAe,KAAA;CACf,aAAa,KAAA;CACb,kBAAkB;AAI4B,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"Matches.js","names":["Solid","replaceEqualDeep","rootRouteId","isServer","CatchBoundary","ErrorComponent","useRouter","Transitioner","nearestMatchContext","SafeFragment","Match","AnyRoute","AnyRouter","DeepPartial","Expand","MakeOptionalPathParams","MakeOptionalSearchParams","MakeRouteMatchUnion","MaskOptions","MatchRouteOptions","RegisteredRouter","ResolveRoute","ToSubOptionsProps","JSX","NearestMatchContext","Component","value","children","RouteMatchExtensions","meta","Array","IntrinsicElements","links","scripts","styles","headScripts","Matches","router","ResolvedSuspense","options","disableGlobalCatchBoundary","document","ssr","Loading","rootRoute","routesById","PendingComponent","pendingComponent","defaultPendingComponent","OptionalWrapper","InnerWrap","_$createComponent","fallback","MatchesInner","matchId","stores","firstId","get","routeId","undefined","match","getRouteMatchStore","hasPendingMatch","Boolean","pendingRouteIds","resetKey","loadedAt","nearestMatch","hasPending","matchContent","Show","when","getResetKey","errorComponent","onCatch","process","env","NODE_ENV","error","console","warn","message","toString","UseMatchRouteOptions","TFrom","TRouter","TTo","TMaskFrom","TMaskTo","useMatchRoute","opts","Accessor","createMemo","pending","caseSensitive","fuzzy","includeSearch","rest","matchRouteDeps","matchRoute","MakeMatchRouteOptions","params","Element","MatchRoute","props","renderedChild","matchedParams","child","_$memo","UseMatchesBaseOptions","select","matches","TSelected","UseMatchesResult","useMatches","prev","res","useParentMatches","contextMatchId","useContext","slice","findIndex","d","id","useChildMatches"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst NearestMatchContext = nearestMatchContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n // When disableGlobalCatchBoundary is true, we must NOT wrap with Solid.Loading\n // because Solid.Loading transforms STATUS_ERROR into STATUS_PENDING, which\n // prevents errors from propagating to an external Errored boundary.\n const ResolvedSuspense =\n router.options.disableGlobalCatchBoundary ||\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Loading\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstId.get()\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId() ? router.stores.getRouteMatchStore(rootRouteId).get() : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.get()[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.get()\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchContent = () => (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n\n if (router.options.disableGlobalCatchBoundary) {\n // When disableGlobalCatchBoundary is true, render without any internal\n // error boundary so errors bubble up freely to an external Errored boundary.\n return (\n <NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>\n )\n }\n\n return (\n <NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>\n )\n}\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteDeps.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => JSX.Element)\n | JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;AAyBA,IAAMwB,sBAAsBhB;AAe5B,SAAgB4B,UAAU;CACxB,MAAMC,SAAS/B,UAAU;CAKzB,MAAMgC,mBACJD,OAAOE,QAAQC,+BACdrC,YAAYkC,OAAOlC,aACnB,OAAOsC,aAAa,eAAeJ,OAAOK,MACvCjC,eACAT,MAAM2C;CAEZ,MAAMC,kB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AAAA,GAAW,OAAOyD;EAC/B,OAAOnH,iBAAiBkH,MAAMC,GAAG;CACnC,CAAC;AACH;AAEA,SAAgBC,iBAId3B,MACsD;CACtD,MAAM4B,iBAAiBtH,MAAMuH,WAAW/G,mBAAmB,EAAE8C;CAE7D,OAAO4D,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChB,GACAT,QAAQU,WAAWC,MAAMA,EAAEC,OAAOL,eAAe,CAAC,CACpD;EACA,OAAO5B,MAAMoB,SAASpB,KAAKoB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV;AAEA,SAAgBa,gBAIdlC,MACsD;CACtD,MAAM4B,iBAAiBtH,MAAMuH,WAAW/G,mBAAmB,EAAE8C;CAE7D,OAAO4D,WAAW,EAChBJ,SAASC,YAAiD;EACxDA,UAAUA,QAAQS,MAChBT,QAAQU,WAAWC,MAAMA,EAAEC,OAAOL,eAAe,CAAC,IAAI,CACxD;EACA,OAAO5B,MAAMoB,SAASpB,KAAKoB,OAAOC,OAAO,IAAIA;CAC/C,EACF,CAAQ;AACV"}
{"version":3,"file":"Matches.js","names":["<OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>","<ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>","<PendingComponent />","<Transitioner />","<MatchesInner />","<Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>","Solid.Show","<Match matchId={matchId()!} />","<NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>","value={nearestMatch}","<NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>","<CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>","getResetKey={() => resetKey()}","errorComponent={ErrorComponent}","{renderedChild()}"],"sources":["../../src/Matches.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep, rootRouteId } from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { Transitioner } from './Transitioner'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Match } from './Match'\nimport type {\n AnyRoute,\n AnyRouter,\n DeepPartial,\n Expand,\n MakeOptionalPathParams,\n MakeOptionalSearchParams,\n MakeRouteMatchUnion,\n MaskOptions,\n MatchRouteOptions,\n RegisteredRouter,\n ResolveRoute,\n ToSubOptionsProps,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst NearestMatchContext = nearestMatchContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\ndeclare module '@tanstack/router-core' {\n export interface RouteMatchExtensions {\n meta?: Array<JSX.IntrinsicElements['meta'] | undefined>\n links?: Array<JSX.IntrinsicElements['link'] | undefined>\n scripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n styles?: Array<JSX.IntrinsicElements['style'] | undefined>\n headScripts?: Array<JSX.IntrinsicElements['script'] | undefined>\n }\n}\n\nexport function Matches() {\n const router = useRouter()\n\n // When disableGlobalCatchBoundary is true, we must NOT wrap with Solid.Loading\n // because Solid.Loading transforms STATUS_ERROR into STATUS_PENDING, which\n // prevents errors from propagating to an external Errored boundary.\n const ResolvedSuspense =\n router.options.disableGlobalCatchBoundary ||\n (isServer ?? router.isServer) ||\n (typeof document !== 'undefined' && router.ssr)\n ? SafeFragment\n : Solid.Loading\n\n const rootRoute: () => AnyRoute = () => router.routesById[rootRouteId]\n const PendingComponent =\n rootRoute().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const OptionalWrapper = router.options.InnerWrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <ResolvedSuspense\n fallback={PendingComponent ? <PendingComponent /> : null}\n >\n <Transitioner />\n <MatchesInner />\n </ResolvedSuspense>\n </OptionalWrapper>\n )\n}\n\nfunction MatchesInner() {\n const router = useRouter()\n const matchId = () => router.stores.firstId.get()\n const routeId = () => (matchId() ? rootRouteId : undefined)\n const match = () =>\n routeId() ? router.stores.getRouteMatchStore(rootRouteId).get() : undefined\n const hasPendingMatch = () =>\n routeId()\n ? Boolean(router.stores.pendingRouteIds.get()[rootRouteId])\n : false\n const resetKey = () => router.stores.loadedAt.get()\n const nearestMatch = {\n matchId,\n routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n const matchContent = () => (\n <Solid.Show when={matchId()}>\n <Match matchId={matchId()!} />\n </Solid.Show>\n )\n\n if (router.options.disableGlobalCatchBoundary) {\n // When disableGlobalCatchBoundary is true, render without any internal\n // error boundary so errors bubble up freely to an external Errored boundary.\n return (\n <NearestMatchContext value={nearestMatch}>\n {matchContent()}\n </NearestMatchContext>\n )\n }\n\n return (\n <NearestMatchContext value={nearestMatch}>\n <CatchBoundary\n getResetKey={() => resetKey()}\n errorComponent={ErrorComponent}\n onCatch={\n process.env.NODE_ENV !== 'production'\n ? (error) => {\n console.warn(\n `Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`,\n )\n console.warn(`Warning: ${error.message || error.toString()}`)\n }\n : undefined\n }\n >\n {matchContent()}\n </CatchBoundary>\n </NearestMatchContext>\n )\n}\n\nexport type UseMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = ToSubOptionsProps<TRouter, TFrom, TTo> &\n DeepPartial<MakeOptionalSearchParams<TRouter, TFrom, TTo>> &\n DeepPartial<MakeOptionalPathParams<TRouter, TFrom, TTo>> &\n MaskOptions<TRouter, TMaskFrom, TMaskTo> &\n MatchRouteOptions\n\nexport function useMatchRoute<TRouter extends AnyRouter = RegisteredRouter>() {\n const router = useRouter()\n\n return <\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n >(\n opts: UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>,\n ): Solid.Accessor<\n false | Expand<ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']>\n > => {\n return Solid.createMemo(() => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts\n\n router.stores.matchRouteDeps.get()\n return router.matchRoute(rest as any, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch,\n })\n })\n }\n}\n\nexport type MakeMatchRouteOptions<\n TRouter extends AnyRouter = RegisteredRouter,\n TFrom extends string = string,\n TTo extends string | undefined = undefined,\n TMaskFrom extends string = TFrom,\n TMaskTo extends string = '',\n> = UseMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | ((\n params?: Expand<\n ResolveRoute<TRouter, TFrom, TTo>['types']['allParams']\n >,\n ) => JSX.Element)\n | JSX.Element\n}\n\nexport function MatchRoute<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: MakeMatchRouteOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): any {\n const matchRoute = useMatchRoute()\n const params = matchRoute(props as any)\n\n const renderedChild = Solid.createMemo(() => {\n const matchedParams = params()\n const child = props.children\n\n if (typeof child === 'function') {\n return (child as any)(matchedParams)\n }\n\n return matchedParams ? child : null\n })\n\n return <>{renderedChild()}</>\n}\n\nexport interface UseMatchesBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (matches: Array<MakeRouteMatchUnion<TRouter>>) => TSelected\n}\n\nexport type UseMatchesResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? Array<MakeRouteMatchUnion<TRouter>> : TSelected\n\nexport function useMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n return Solid.createMemo((prev: TSelected | undefined) => {\n const matches = router.stores.matches.get() as Array<\n MakeRouteMatchUnion<TRouter>\n >\n const res = opts?.select ? opts.select(matches) : matches\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res) as any\n }) as Solid.Accessor<UseMatchesResult<TRouter, TSelected>>\n}\n\nexport function useParentMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId()),\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n\nexport function useChildMatches<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchesBaseOptions<TRouter, TSelected>,\n): Solid.Accessor<UseMatchesResult<TRouter, TSelected>> {\n const contextMatchId = Solid.useContext(nearestMatchContext).matchId\n\n return useMatches({\n select: (matches: Array<MakeRouteMatchUnion<TRouter>>) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId()) + 1,\n )\n return opts?.select ? opts.select(matches) : matches\n },\n } as any)\n}\n"],"mappings":";;;;;;;;;;;AAyBA,IAAM,sBAAsB;AAe5B,SAAgB,UAAU;CACxB,MAAM,SAAS,UAAA;CAKf,MAAM,mBACJ,OAAO,QAAQ,+BACd,YAAY,OAAO,aACnB,OAAO,aAAa,eAAe,OAAO,MACvC,eACA,MAAM;CAEZ,MAAM,kBAAkC,OAAO,WAAW;CAC1D,MAAM,mBACJ,UAAA,EAAY,QAAQ,oBACpB,OAAO,QAAQ;CAIjB,OACEA,gBAHsB,OAAO,QAAQ,aAAa,cAGlDA,EAAAA,IAAAA,WAAAA;SACEC,gBAAAA,kBAAAA;GACE,IAAA,WAAA;WAAU,mBAAmBC,gBAAAA,kBAAAA,CAAAA,CAAoB,IAAG;;GADtD,IAAA,WAAA;WAEC,CACCC,gBAAAA,cAAAA,CAAAA,CAAgB,GAChBC,gBAAAA,cAAAA,CAAAA,CAAgB,CAAA;;GACC;IACH;;AAItB,SAAS,eAAe;CACtB,MAAM,SAAS,UAAA;CACf,MAAM,gBAAgB,OAAO,OAAO,QAAQ,IAAA;CAC5C,MAAM,gBAAiB,QAAA,IAAY,cAAc,KAAA;CACjD,MAAM,cACJ,QAAA,IAAY,OAAO,OAAO,mBAAmB,WAAA,EAAa,IAAA,IAAQ,KAAA;CACpE,MAAM,wBACJ,QAAA,IACI,QAAQ,OAAO,OAAO,gBAAgB,IAAA,EAAM,YAAA,IAC5C;CACN,MAAM,iBAAiB,OAAO,OAAO,SAAS,IAAA;CAC9C,MAAM,eAAe;EACnB;EACA;EACA;EACA,YAAY;;CAGd,MAAM,qBACJC,gBAAAA,MAACC,MAAD;EAAY,IAAA,OAAA;UAAM,QAAA;;EAAlB,IAAA,WAAA;UACEC,gBAAAA,OAAAA,EAAO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AAW,mBAAA,EAAqB;CAE7D,OAAO,WAAW,EAChB,SAAS,YAAiD;EACxD,UAAU,QAAQ,MAChB,GACA,QAAQ,WAAW,MAAM,EAAE,OAAO,eAAA,CAAgB,CAAC;EAErD,OAAO,MAAM,SAAS,KAAK,OAAO,OAAA,IAAW;IAEhD;;AAGH,SAAgB,gBAId,MACsD;CACtD,MAAM,iBAAiB,MAAM,WAAW,mBAAA,EAAqB;CAE7D,OAAO,WAAW,EAChB,SAAS,YAAiD;EACxD,UAAU,QAAQ,MAChB,QAAQ,WAAW,MAAM,EAAE,OAAO,eAAA,CAAgB,IAAI,CAAA;EAExD,OAAO,MAAM,SAAS,KAAK,OAAO,OAAA,IAAW;IAEhD"}

@@ -1,1 +0,1 @@

{"version":3,"file":"not-found.js","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","JSX","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","Element","onCatch","children","router","pathname","createMemo","stores","location","get","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.get().pathname)\n const status = Solid.createMemo(() => router.stores.status.get())\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;AASA,SAAgBM,YACdC,OACoD;CACpD,IAAIP,WAAWO,KAAK,GAClB,OAAOA;CAGT,IAAIP,WAAYO,OAAeC,KAAK,GAClC,OAAQD,MAAcC;AAI1B;AAEA,SAAgBE,cAAcC,OAI3B;CACD,MAAMK,SAASb,UAAU;CAEzB,MAAMc,WAAWhB,MAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,IAAI,EAAEJ,QAAQ;CAC7E,MAAMK,SAASrB,MAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,IAAI,CAAC;CAEhE,OAAAE,gBACGrB,eAAa;EACZsB,mBAAmB,aAAaP,SAAS,EAAC,GAAIK,OAAO;EACrDR,UAAUP,UAAU;GAClB,MAAMkB,gBAAgBnB,YAAYC,KAAK;GAEvC,IAAIkB,eACFd,MAAMG,UAAUW,aAAa;QAE7B,MAAMlB;EAEV;EACAmB,iBAAiB,EAAEnB,YAAY;GAC7B,MAAMkB,gBAAgBnB,YAAYC,KAAK;GAEvC,IAAIkB,eACF,OAAOd,MAAMC,WAAWa,aAAa;QAErC,MAAMlB;EAEV;EAAC,IAAAQ,WAAA;GAAA,OAEAJ,MAAMI;EAAQ;CAAA,CAAA;AAGrB;AAEA,SAAgBY,wBAAwB;CACtC,OAAAC,OAAA;AACF"}
{"version":3,"file":"not-found.js","names":["<CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>","getResetKey={() => `not-found-${pathname()}-${status()}`}","onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}","errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}","<p>Not Found</p>"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.get().pathname)\n const status = Solid.createMemo(() => router.stores.status.get())\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;AASA,SAAgB,YACd,OACoD;CACpD,IAAI,WAAW,KAAA,GACb,OAAO;CAGT,IAAI,WAAY,OAAe,KAAA,GAC7B,OAAQ,MAAc;;AAM1B,SAAgB,cAAc,OAI3B;CACD,MAAM,SAAS,UAAA;CAEf,MAAM,WAAW,MAAM,iBAAiB,OAAO,OAAO,SAAS,IAAA,EAAM,QAAA;CACrE,MAAM,SAAS,MAAM,iBAAiB,OAAO,OAAO,OAAO,IAAA,CAAK;CAEhE,OACEA,gBAAAA,eAAAA;EACEC,mBAAmB,aAAa,SAAA,EAAW,GAAG,OAAA;EAC9CC,UAAU,UAAU;GAClB,MAAM,gBAAgB,YAAY,KAAA;GAElC,IAAI,eACF,MAAM,UAAU,aAAA;QAEhB,MAAM;;EAGVC,iBAAiB,EAAE,YAAY;GAC7B,MAAM,gBAAgB,YAAY,KAAA;GAElC,IAAI,eACF,OAAO,MAAM,WAAW,aAAA;QAExB,MAAM;;EAjBZ,IAAA,WAAA;UAqBG,MAAM;;EACO;;AAIpB,SAAgB,wBAAwB;CACtC,OAAOC,OAAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouteNotFound.js","names":["DefaultGlobalNotFound","AnyRoute","AnyRouter","renderRouteNotFound","router","route","data","options","notFoundComponent","defaultNotFoundComponent","_$createComponent","process","env","NODE_ENV","console","warn","id"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { DefaultGlobalNotFound } from './not-found'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\n/**\n * Renders a not found component for a route when no matching route is found.\n *\n * @param router - The router instance containing the route configuration\n * @param route - The route that triggered the not found state\n * @param data - Additional data to pass to the not found component\n * @returns The rendered not found component or a default fallback component\n */\nexport function renderRouteNotFound(\n router: AnyRouter,\n route: AnyRoute,\n data: any,\n) {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <router.options.defaultNotFoundComponent {...data} />\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n console.warn(\n `Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,\n )\n }\n }\n\n return <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgBG,oBACdC,QACAC,OACAC,MACA;CACA,IAAI,CAACD,MAAME,QAAQC,mBAAmB;EACpC,IAAIJ,OAAOG,QAAQE,0BACjB,OAAAC,gBAAQN,OAAOG,QAAQE,0BAA6BH,IAAI;EAG1D,IAAA,QAAA,IAAA,aAA6B;OACvB,CAACD,MAAME,QAAQC,mBACjBM,QAAQC,KACN,kEAAkEV,MAAMW,GAAE,mPAC5E;EAAA;EAIJ,OAAAN,gBAAQV,uBAAqB,CAAA,CAAA;CAC/B;CAEA,OAAAU,gBAAQL,MAAME,QAAQC,mBAAsBF,IAAI;AAClD"}
{"version":3,"file":"renderRouteNotFound.js","names":["<router.options.defaultNotFoundComponent {...data} />","router.options","<DefaultGlobalNotFound />","<route.options.notFoundComponent {...data} />","route.options"],"sources":["../../src/renderRouteNotFound.tsx"],"sourcesContent":["import { DefaultGlobalNotFound } from './not-found'\nimport type { AnyRoute, AnyRouter } from '@tanstack/router-core'\n\n/**\n * Renders a not found component for a route when no matching route is found.\n *\n * @param router - The router instance containing the route configuration\n * @param route - The route that triggered the not found state\n * @param data - Additional data to pass to the not found component\n * @returns The rendered not found component or a default fallback component\n */\nexport function renderRouteNotFound(\n router: AnyRouter,\n route: AnyRoute,\n data: any,\n) {\n if (!route.options.notFoundComponent) {\n if (router.options.defaultNotFoundComponent) {\n return <router.options.defaultNotFoundComponent {...data} />\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!route.options.notFoundComponent) {\n console.warn(\n `Warning: A notFoundError was encountered on the route with ID \"${route.id}\", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`,\n )\n }\n }\n\n return <DefaultGlobalNotFound />\n }\n\n return <route.options.notFoundComponent {...data} />\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,oBACd,QACA,OACA,MACA;CACA,IAAI,CAAC,MAAM,QAAQ,mBAAmB;EACpC,IAAI,OAAO,QAAQ,0BACjB,OAAOA,gBAAAA,OAACC,QAAAA,0BAA4C,IAAA;EAGtD,IAAA,QAAA,IAAA,aAA6B;OACvB,CAAC,MAAM,QAAQ,mBACjB,QAAQ,KACN,kEAAkE,MAAM,GAAG,mPAAA;EAAA;EAKjF,OAAOC,gBAAAA,uBAAAA,CAAAA,CAAyB;;CAGlC,OAAOC,gBAAAA,MAACC,QAAAA,mBAAoC,IAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"route.js","names":["BaseRootRoute","BaseRoute","BaseRouteApi","notFound","Link","useLoaderData","useLoaderDeps","useParams","useSearch","useNavigate","useMatch","useRouteContext","useRouter","AnyContext","AnyRoute","AnyRouter","ConstrainLiteral","ErrorComponentProps","NotFoundError","NotFoundRouteProps","Register","RegisteredRouter","ResolveFullPath","ResolveId","ResolveParams","RootRoute","RootRouteCore","RootRouteId","RootRouteOptions","RouteConstraints","Route","RouteCore","RouteIds","RouteMask","RouteOptions","RouteTypesById","RouterCore","ToMaskOptions","UseNavigateResult","UseLoaderDataRoute","UseMatchRoute","UseLoaderDepsRoute","UseParamsRoute","UseSearchRoute","UseRouteContextRoute","LinkComponentRoute","JSX","UpdatableRouteOptionsExtensions","component","RouteComponent","errorComponent","ErrorRouteComponent","notFoundComponent","NotFoundRouteComponent","pendingComponent","RootRouteOptionsExtensions","shellComponent","children","Element","RouteExtensions","TId","TFullPath","getRouteApi","id","TRouter","RouteApi","constructor","opts","select","from","strict","router","routesById","fullPath","routeId","props","_$createComponent","_$mergeProps","TParentRoute","TPath","TCustomId","Record","TRegister","TSearchValidator","TParams","TRouterContext","TRouteContextFn","TBeforeLoadFn","TLoaderDeps","TLoaderFn","TChildren","TFileRouteTypes","TSSR","TMiddlewares","THandlers","options","_self$","createRoute","AnyRootRoute","createRootRouteWithContext","createRootRoute","rootRouteWithContext","_self$2","createRouteMask","routeTree","TRouteTree","TFrom","TTo","SolidNode","DefaultRouteTypes","TProps","RouteTypes","AsyncRouteComponent","preload","Promise","NotFoundRoute","Omit"],"sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\nimport type { JSX } from '@solidjs/web'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | undefined | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({ children }: { children: JSX.Element }) => JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TRegister = unknown,\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n TMiddlewares,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TRegister = unknown,\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TRegister,\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;AA6EA,SAAgB8D,YAGdC,IAA2D;CAC3D,OAAO,IAAIE,SAAuB,EAAEF,GAAG,CAAC;AAC1C;AAEA,IAAaE,WAAb,cAGU/D,aAA2B;;;;CAInCgE,YAAY,EAAEH,MAAmB;EAC/B,MAAM,EAAEA,GAAG,CAAC;mBAGkBI,SAAS;GACvC,OAAOzD,SAAS;IACd0D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;GACb,CAAQ;EACV;0BAE8CI,SAAS;GACrD,OAAOxD,gBAAgB;IAAE,GAAIwD;IAAcE,MAAM,KAAKN;GAAG,CAAC;EAC5D;oBAEkCI,SAAS;GACzC,OAAO3D,UAAU;IACf4D,QAAQD,MAAMC;IACdC,MAAM,KAAKN;GACb,CAAQ;EACV;oBAEkCI,SAAS;GACzC,OAAO5D,UAAU;IACf6D,QAAQD,MAAMC;IACd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AAQ,EAAA,GAAOE,KAAY,CAAA;EACrD;CAzCA;AA0CF;AAEA,SAAgB4B,gBAKdpC,MAGuB;CACvB,OAAOA;AACT;AAmBA,IAAagD,gBAAb,cAYUrF,MAiBR;CACAoC,YACE6B,SAyBA;EACA,MAAM;GACJ,GAAIA;GACJhC,IAAI;EACN,CAAC;CACH;AACF;AAEA,SAAgBqC,gBAWdL,SAuBA;CACA,OAAO,IAAItE,UAYTsE,OAAO;AACX"}
{"version":3,"file":"route.js","names":["<Link from={fullPath as never} {...props} />","from={fullPath as never}","<Link from={this.fullPath} {...props} />","this","<Link from={this.fullPath} {...(props as any)} />"],"sources":["../../src/route.tsx"],"sourcesContent":["import {\n BaseRootRoute,\n BaseRoute,\n BaseRouteApi,\n notFound,\n} from '@tanstack/router-core'\nimport { Link } from './link'\nimport { useLoaderData } from './useLoaderData'\nimport { useLoaderDeps } from './useLoaderDeps'\nimport { useParams } from './useParams'\nimport { useSearch } from './useSearch'\nimport { useNavigate } from './useNavigate'\nimport { useMatch } from './useMatch'\nimport { useRouteContext } from './useRouteContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyContext,\n AnyRoute,\n AnyRouter,\n ConstrainLiteral,\n ErrorComponentProps,\n NotFoundError,\n NotFoundRouteProps,\n Register,\n RegisteredRouter,\n ResolveFullPath,\n ResolveId,\n ResolveParams,\n RootRoute as RootRouteCore,\n RootRouteId,\n RootRouteOptions,\n RouteConstraints,\n Route as RouteCore,\n RouteIds,\n RouteMask,\n RouteOptions,\n RouteTypesById,\n RouterCore,\n ToMaskOptions,\n UseNavigateResult,\n} from '@tanstack/router-core'\nimport type { UseLoaderDataRoute } from './useLoaderData'\nimport type { UseMatchRoute } from './useMatch'\nimport type { UseLoaderDepsRoute } from './useLoaderDeps'\nimport type { UseParamsRoute } from './useParams'\nimport type { UseSearchRoute } from './useSearch'\nimport type { UseRouteContextRoute } from './useRouteContext'\nimport type { LinkComponentRoute } from './link'\nimport type { JSX } from '@solidjs/web'\n\ndeclare module '@tanstack/router-core' {\n export interface UpdatableRouteOptionsExtensions {\n component?: RouteComponent\n errorComponent?: false | null | undefined | ErrorRouteComponent\n notFoundComponent?: NotFoundRouteComponent\n pendingComponent?: RouteComponent\n }\n\n export interface RootRouteOptionsExtensions {\n shellComponent?: ({ children }: { children: JSX.Element }) => JSX.Element\n }\n\n export interface RouteExtensions<\n in out TId extends string,\n in out TFullPath extends string,\n > {\n useMatch: UseMatchRoute<TId>\n useRouteContext: UseRouteContextRoute<TId>\n useSearch: UseSearchRoute<TId>\n useParams: UseParamsRoute<TId>\n useLoaderDeps: UseLoaderDepsRoute<TId>\n useLoaderData: UseLoaderDataRoute<TId>\n useNavigate: () => UseNavigateResult<TFullPath>\n Link: LinkComponentRoute<TFullPath>\n }\n}\n\nexport function getRouteApi<\n const TId,\n TRouter extends AnyRouter = RegisteredRouter,\n>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {\n return new RouteApi<TId, TRouter>({ id })\n}\n\nexport class RouteApi<\n TId,\n TRouter extends AnyRouter = RegisteredRouter,\n> extends BaseRouteApi<TId, TRouter> {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }: { id: TId }) {\n super({ id })\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id, strict: false } as any)\n }\n\n useNavigate = (): UseNavigateResult<\n RouteTypesById<TRouter, TId>['fullPath']\n > => {\n const router = useRouter()\n return useNavigate({ from: router.routesById[this.id as string].fullPath })\n }\n\n notFound = (opts?: NotFoundError) => {\n return notFound({ routeId: this.id as string, ...opts })\n }\n\n Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> = ((\n props,\n ) => {\n const router = useRouter()\n const fullPath = router.routesById[this.id as string].fullPath\n return <Link from={fullPath as never} {...props} />\n }) as LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']>\n}\n\nexport class Route<\n in out TRegister = unknown,\n in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n in out TPath extends RouteConstraints['TPath'] = '/',\n in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n in out TCustomId extends RouteConstraints['TCustomId'] = string,\n in out TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n in out TSearchValidator = undefined,\n in out TParams = ResolveParams<TPath>,\n in out TRouterContext = AnyContext,\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out TMiddlewares = unknown,\n in out THandlers = undefined,\n>\n extends BaseRoute<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n implements\n RouteCore<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n TMiddlewares,\n THandlers\n >\n{\n /**\n * @deprecated Use the `createRoute` function instead.\n */\n constructor(\n options?: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n TMiddlewares,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<TId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<TId> = (opts?) => {\n return useRouteContext({ ...(opts as any), from: this.id }) as any\n }\n\n useSearch: UseSearchRoute<TId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<TId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<TId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<TFullPath> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<TFullPath> = ((props) => {\n return <Link from={this.fullPath} {...props} />\n }) as LinkComponentRoute<TFullPath>\n}\n\nexport function createRoute<\n TRegister = unknown,\n TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,\n TPath extends RouteConstraints['TPath'] = '/',\n TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<\n TParentRoute,\n TPath\n >,\n TCustomId extends RouteConstraints['TCustomId'] = string,\n TId extends RouteConstraints['TId'] = ResolveId<\n TParentRoute,\n TCustomId,\n TPath\n >,\n TSearchValidator = undefined,\n TParams = ResolveParams<TPath>,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options: RouteOptions<\n TRegister,\n TParentRoute,\n TId,\n TCustomId,\n TFullPath,\n TPath,\n TSearchValidator,\n TParams,\n TLoaderDeps,\n TLoaderFn,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n): Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n> {\n return new Route<\n TRegister,\n TParentRoute,\n TPath,\n TFullPath,\n TCustomId,\n TId,\n TSearchValidator,\n TParams,\n AnyContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n\nexport type AnyRootRoute = RootRoute<\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any,\n any\n>\n\nexport function createRootRouteWithContext<TRouterContext extends {}>() {\n return <\n TRegister = Register,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n >(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) => {\n return createRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >(options)\n }\n}\n\n/**\n * @deprecated Use the `createRootRouteWithContext` function instead.\n */\nexport const rootRouteWithContext = createRootRouteWithContext\n\nexport class RootRoute<\n in out TRegister = Register,\n in out TSearchValidator = undefined,\n in out TRouterContext = {},\n in out TRouteContextFn = AnyContext,\n in out TBeforeLoadFn = AnyContext,\n in out TLoaderDeps extends Record<string, any> = {},\n in out TLoaderFn = undefined,\n in out TChildren = unknown,\n in out TFileRouteTypes = unknown,\n in out TSSR = unknown,\n in out THandlers = undefined,\n>\n extends BaseRootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n implements\n RootRouteCore<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TFileRouteTypes,\n TSSR,\n THandlers\n >\n{\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n ) {\n super(options)\n }\n\n useMatch: UseMatchRoute<RootRouteId> = (opts) => {\n return useMatch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {\n return useRouteContext({ ...(opts as any), from: this.id })\n }\n\n useSearch: UseSearchRoute<RootRouteId> = (opts) => {\n return useSearch({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useParams: UseParamsRoute<RootRouteId> = (opts) => {\n return useParams({\n select: opts?.select,\n from: this.id,\n } as any) as any\n }\n\n useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id } as any)\n }\n\n useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {\n return useLoaderData({ ...opts, from: this.id } as any)\n }\n\n useNavigate = (): UseNavigateResult<'/'> => {\n return useNavigate({ from: this.fullPath })\n }\n\n Link: LinkComponentRoute<'/'> = ((props) => {\n return <Link from={this.fullPath} {...(props as any)} />\n }) as LinkComponentRoute<'/'>\n}\n\nexport function createRouteMask<\n TRouteTree extends AnyRoute,\n TFrom extends string,\n TTo extends string,\n>(\n opts: {\n routeTree: TRouteTree\n } & ToMaskOptions<RouterCore<TRouteTree, 'never', false>, TFrom, TTo>,\n): RouteMask<TRouteTree> {\n return opts as any\n}\n\nexport type SolidNode = JSX.Element\n\nexport interface DefaultRouteTypes<TProps> {\n component: (props: TProps) => any\n}\nexport interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}\n\nexport type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {\n preload?: () => Promise<void>\n}\n\nexport type RouteComponent = AsyncRouteComponent<{}>\n\nexport type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>\n\nexport type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']\n\nexport class NotFoundRoute<\n TRegister,\n TParentRoute extends AnyRootRoute,\n TRouterContext = AnyContext,\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TSearchValidator = undefined,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TChildren = unknown,\n TSSR = unknown,\n THandlers = undefined,\n> extends Route<\n TRegister,\n TParentRoute,\n '/404',\n '/404',\n '404',\n '404',\n TSearchValidator,\n {},\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TChildren,\n TSSR,\n THandlers\n> {\n constructor(\n options: Omit<\n RouteOptions<\n TRegister,\n TParentRoute,\n string,\n string,\n string,\n string,\n TSearchValidator,\n {},\n TLoaderDeps,\n TLoaderFn,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TSSR,\n THandlers\n >,\n | 'caseSensitive'\n | 'parseParams'\n | 'stringifyParams'\n | 'path'\n | 'id'\n | 'params'\n >,\n ) {\n super({\n ...(options as any),\n id: '404',\n })\n }\n}\n\nexport function createRootRoute<\n TRegister = Register,\n TSearchValidator = undefined,\n TRouterContext = {},\n TRouteContextFn = AnyContext,\n TBeforeLoadFn = AnyContext,\n TLoaderDeps extends Record<string, any> = {},\n TLoaderFn = undefined,\n TSSR = unknown,\n THandlers = undefined,\n>(\n options?: RootRouteOptions<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n TSSR,\n THandlers\n >,\n): RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n> {\n return new RootRoute<\n TRegister,\n TSearchValidator,\n TRouterContext,\n TRouteContextFn,\n TBeforeLoadFn,\n TLoaderDeps,\n TLoaderFn,\n unknown,\n unknown,\n TSSR,\n THandlers\n >(options)\n}\n"],"mappings":";;;;;;;;;;;;AA6EA,SAAgB,YAGd,IAA2D;CAC3D,OAAO,IAAI,SAAuB,EAAE,GAAA,CAAI;;AAG1C,IAAa,WAAb,cAGU,aAA2B;;;;CAInC,YAAY,EAAE,MAAmB;EAC/B,MAAM,EAAE,GAAA,CAAI;mBAGkB,SAAS;GACvC,OAAO,SAAS;IACd,QAAQ,MAAM;IACd,MAAM,KAAK;IACZ;;0BAG2C,SAAS;GACrD,OAAO,gBAAgB;IAAE,GAAI;IAAc,MAAM,KAAK;IAAI;;oBAG1B,SAAS;GACzC,OAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK;IACZ;;oBAG+B,SAAS;GACzC,OAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK;IACZ;;wBAGuC,SAAS;GACjD,OAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK;IAAI,QAAQ;IAAO;;wBAGtB,SAAS;GACjD,OAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK;IAAI,QAAQ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S;IACd,QAAQ,MAAM;IACd,MAAM,KAAK;IACZ;;0BAGmD,SAAS;GAC7D,OAAO,gBAAgB;IAAE,GAAI;IAAc,MAAM,KAAK;IAAI;;oBAGlB,SAAS;GACjD,OAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK;IACZ;;oBAGuC,SAAS;GACjD,OAAO,UAAU;IACf,QAAQ,MAAM;IACd,MAAM,KAAK;IACZ;;wBAG+C,SAAS;GACzD,OAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK;IAAI;;wBAGC,SAAS;GACzD,OAAO,cAAc;IAAE,GAAG;IAAM,MAAM,KAAK;IAAI;;2BAGL;GAC1C,OAAO,YAAY,EAAE,MAAM,KAAK,SAAA,CAAU;;gBAGV,UAAU;GAAX,MAAA,UAAA;GAC/B,OAAOC,gBAAAA,MAAAA,WAAAA,EAAM,IAAA,OAAA;WAAMD,QAAK;QAAe,KAAA,CAAiB;;;;AAI5D,SAAgB,gBAKd,MAGuB;CACvB,OAAO;;AAoBT,IAAa,gBAAb,cAYU,MAiBR;CACA,YACE,SAyBA;EACA,MAAM;GACJ,GAAI;GACJ,IAAI;GACL;;;AAIL,SAAgB,gBAWd,SAuBA;CACA,OAAO,IAAI,UAYT,OAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"routerContext.js","names":["Solid","AnyRouter","routerContext","createContext"],"sources":["../../src/routerContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const routerContext = Solid.createContext<AnyRouter>(\n null as unknown as AnyRouter,\n)\n"],"mappings":";;AAGA,IAAaE,gBAAgBF,MAAMG,cACjC,IACF"}
{"version":3,"file":"routerContext.js","names":[],"sources":["../../src/routerContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport const routerContext = Solid.createContext<AnyRouter>(\n null as unknown as AnyRouter,\n)\n"],"mappings":";;AAGA,IAAa,gBAAgB,MAAM,cACjC,IAAmB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"RouterProvider.js","names":["Solid","routerContext","SafeFragment","Matches","AnyRouter","RegisteredRouter","RouterOptions","JSX","RouterContext","Component","value","children","RouterContextProvider","Record","router","rest","RouterProps","TRouter","TDehydrated","Element","Object","keys","length","runWithOwner","update","options","context","OptionalWrapper","Wrap","_$createComponent","RouterProvider","_$mergeProps","Omit","NonNullable","Partial"],"sources":["../../src/RouterProvider.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Matches } from './Matches'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterOptions,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst RouterContext = routerContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\nexport function RouterContextProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({\n router,\n children,\n ...rest\n}: RouterProps<TRouter, TDehydrated> & {\n children: () => JSX.Element\n}) {\n if (Object.keys(rest).length > 0) {\n Solid.runWithOwner(null, () => {\n router.update({\n ...router.options,\n ...rest,\n context: {\n ...router.options.context,\n ...rest.context,\n },\n } as any)\n })\n }\n\n const OptionalWrapper = router.options.Wrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <RouterContext value={router as AnyRouter}>{children()}</RouterContext>\n </OptionalWrapper>\n )\n}\n\nexport function RouterProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({ router, ...rest }: RouterProps<TRouter, TDehydrated>) {\n return (\n <RouterContextProvider router={router} {...rest}>\n {() => <Matches />}\n </RouterContextProvider>\n )\n}\n\nexport type RouterProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n> = Omit<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >,\n 'context'\n> & {\n router: TRouter\n context?: Partial<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >['context']\n >\n}\n"],"mappings":";;;;;;AAWA,IAAMQ,gBAAgBP;AAKtB,SAAgBW,sBAGd,EACAE,QACAH,UACA,GAAGI,QAGF;CACD,IAAIK,OAAOC,KAAKN,IAAI,EAAEO,SAAS,GAC7BtB,MAAMuB,aAAa,YAAY;EAC7BT,OAAOU,OAAO;GACZ,GAAGV,OAAOW;GACV,GAAGV;GACHW,SAAS;IACP,GAAGZ,OAAOW,QAAQC;IAClB,GAAGX,KAAKW;GACV;EACF,CAAQ;CACV,CAAC;CAKH,OAAAG,gBAFwBf,OAAOW,QAAQG,QAAQ1B,cAG7B,EAAA,IAAAS,WAAA;EAAA,OAAAkB,gBACbrB,eAAa;GAACE,OAAOI;GAAmB,IAAAH,WAAA;IAAA,OAAGA,SAAS;GAAC;EAAA,CAAA;CAAA,EAAA,CAAA;AAG5D;AAEA,SAAgBmB,eAGd,EAAEhB,QAAQ,GAAGC,QAA2C;CACxD,OAAAc,gBACGjB,uBAAqBmB,WAAA,EAASjB,OAAM,GAAMC,MAAI,EAAAJ,gBAC5CkB,gBAAO1B,SAAO,CAAA,CAAA,EAAG,CAAA,CAAA;AAGxB"}
{"version":3,"file":"RouterProvider.js","names":["<OptionalWrapper>\n <RouterContext value={router as AnyRouter}>{children()}</RouterContext>\n </OptionalWrapper>","<RouterContext value={router as AnyRouter}>{children()}</RouterContext>","value={router as AnyRouter}","<RouterContextProvider router={router} {...rest}>\n {() => <Matches />}\n </RouterContextProvider>","<Matches />"],"sources":["../../src/RouterProvider.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport { SafeFragment } from './SafeFragment'\nimport { Matches } from './Matches'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterOptions,\n} from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst RouterContext = routerContext as unknown as Solid.Component<{\n value: any\n children: any\n}>\n\nexport function RouterContextProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({\n router,\n children,\n ...rest\n}: RouterProps<TRouter, TDehydrated> & {\n children: () => JSX.Element\n}) {\n if (Object.keys(rest).length > 0) {\n Solid.runWithOwner(null, () => {\n router.update({\n ...router.options,\n ...rest,\n context: {\n ...router.options.context,\n ...rest.context,\n },\n } as any)\n })\n }\n\n const OptionalWrapper = router.options.Wrap || SafeFragment\n\n return (\n <OptionalWrapper>\n <RouterContext value={router as AnyRouter}>{children()}</RouterContext>\n </OptionalWrapper>\n )\n}\n\nexport function RouterProvider<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n>({ router, ...rest }: RouterProps<TRouter, TDehydrated>) {\n return (\n <RouterContextProvider router={router} {...rest}>\n {() => <Matches />}\n </RouterContextProvider>\n )\n}\n\nexport type RouterProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TDehydrated extends Record<string, any> = Record<string, any>,\n> = Omit<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >,\n 'context'\n> & {\n router: TRouter\n context?: Partial<\n RouterOptions<\n TRouter['routeTree'],\n NonNullable<TRouter['options']['trailingSlash']>,\n false,\n TRouter['history'],\n TDehydrated\n >['context']\n >\n}\n"],"mappings":";;;;;;AAWA,IAAM,gBAAgB;AAKtB,SAAgB,sBAGd,EACA,QACA,UACA,GAAG,QAGF;CACD,IAAI,OAAO,KAAK,IAAA,EAAM,SAAS,GAC7B,MAAM,aAAa,YAAY;EAC7B,OAAO,OAAO;GACZ,GAAG,OAAO;GACV,GAAG;GACH,SAAS;IACP,GAAG,OAAO,QAAQ;IAClB,GAAG,KAAK;;GAEX;;CAML,OACEA,gBAHsB,OAAO,QAAQ,QAAQ,cAG7CA,EAAAA,IAAAA,WAAAA;SACEC,gBAAAA,eAAAA;GAAeC,OAAO;GAAtB,IAAA,WAAA;WAA4C,SAAA;;GAA2B;IACvD;;AAItB,SAAgB,eAGd,EAAE,QAAQ,GAAG,QAA2C;CACxD,OACEC,gBAAAA,uBAAAA,WAAAA,EAA+B,OAAA,GAAY,MAA3C,EAAA,gBACSC,gBAAAA,SAAAA,CAAAA,CAAW,EAAA,CACI,CAAA"}
import { memo } from "@solidjs/web";
//#region src/SafeFragment.tsx
function SafeFragment(props) {
return memo(() => props.children);
return memo(() => {
return props.children;
});
}

@@ -6,0 +8,0 @@ //#endregion

@@ -1,1 +0,1 @@

{"version":3,"file":"SafeFragment.js","names":["SafeFragment","props","_$memo","children"],"sources":["../../src/SafeFragment.tsx"],"sourcesContent":["export function SafeFragment(props: any) {\n return <>{props.children}</>\n}\n"],"mappings":";;AAAA,SAAgBA,aAAaC,OAAY;CACvC,OAAAC,WAAUD,MAAME,QAAQ;AAC1B"}
{"version":3,"file":"SafeFragment.js","names":["{props.children}"],"sources":["../../src/SafeFragment.tsx"],"sourcesContent":["export function SafeFragment(props: any) {\n return <>{props.children}</>\n}\n"],"mappings":";;AAAA,SAAgB,aAAa,OAAY;CACvC,OAASA,WAAAA;SAAC,MAAM"}

@@ -1,1 +0,1 @@

{"version":3,"file":"ScriptOnce.js","names":["isServer","useRouter","ScriptOnce","children","log","sync","router","_el$","_tmpl$","innerHTML","_$effect","options","ssr","nonce","_v$","_$setAttribute"],"sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nexport function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n const router = useRouter()\n if (!(isServer ?? router.isServer)) {\n return null\n }\n return (\n <script\n nonce={router.options.ssr?.nonce}\n class=\"$tsr\"\n innerHTML={children + ';document.currentScript.remove()'}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAgBE,WAAW,EACzBC,YAKC;CACD,MAAMG,SAASL,UAAU;CACzB,IAAI,EAAED,YAAYM,OAAON,WACvB,OAAO;CACR,IAAAO,OAAAC,OAAA;CAAAD,KAAAE,YAKcN,WAAW;CAAkCO,aAFjDJ,OAAOK,QAAQC,KAAKC,QAAKC,QAAA;EAAAC,aAAAR,MAAA,SAAAO,GAAA;CAAA,CAAA;CAFpC,OAAAP;AAOF"}
{"version":3,"file":"ScriptOnce.js","names":["<script\n nonce={router.options.ssr?.nonce}\n class=\"$tsr\"\n innerHTML={children + ';document.currentScript.remove()'}\n />"],"sources":["../../src/ScriptOnce.tsx"],"sourcesContent":["import { isServer } from '@tanstack/router-core/isServer'\nimport { useRouter } from './useRouter'\n\nexport function ScriptOnce({\n children,\n}: {\n children: string\n log?: boolean\n sync?: boolean\n}) {\n const router = useRouter()\n if (!(isServer ?? router.isServer)) {\n return null\n }\n return (\n <script\n nonce={router.options.ssr?.nonce}\n class=\"$tsr\"\n innerHTML={children + ';document.currentScript.remove()'}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAgB,WAAW,EACzB,YAKC;CACD,MAAM,SAAS,UAAA;CACf,IAAI,EAAE,YAAY,OAAO,WACvB,OAAO;CAGP,IAAA,OAAA,OAAA;CAGE,KAAA,YAAW,WAAW;CAFtB,aAAO,OAAO,QAAQ,KAAK,QAA3B,QAAA;;;CAFJ,OACEA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"Scripts.js","names":["Solid","NoHydration","isServer","Asset","useRouter","AnyRouteMatch","RouterManagedTag","Scripts","router","nonce","options","ssr","getAssetScripts","matches","Array","assetScripts","manifest","match","scripts","routes","routeId","asset","push","tag","attrs","children","getScripts","map","flat","filter","Boolean","script","activeMatches","createMemo","stores","get","renderScripts","ReturnType","allScripts","serverSsr","serverBufferedScript","takeBufferedScripts","unshift","_$createComponent"],"sources":["../../src/Scripts.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { NoHydration } from '@solidjs/web'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport type { AnyRouteMatch, RouterManagedTag } from '@tanstack/router-core'\n\nexport const Scripts = () => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n\n const getAssetScripts = (matches: Array<AnyRouteMatch>) => {\n const assetScripts: Array<RouterManagedTag> = []\n const manifest = router.ssr?.manifest\n\n if (!manifest) {\n return []\n }\n\n for (const match of matches) {\n const scripts = manifest.routes[match.routeId]?.scripts\n\n if (!scripts) {\n continue\n }\n\n for (const asset of scripts) {\n assetScripts.push({\n tag: 'script',\n attrs: { ...asset.attrs, nonce },\n children: asset.children,\n })\n }\n }\n\n return assetScripts\n }\n\n const getScripts = (matches: Array<AnyRouteMatch>): Array<RouterManagedTag> =>\n (\n matches\n .map((match) => match.scripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(\n ({ children, ...script }) =>\n ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children,\n }) satisfies RouterManagedTag,\n )\n\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const assetScripts = Solid.createMemo(() => getAssetScripts(activeMatches()))\n const scripts = Solid.createMemo(() => getScripts(activeMatches()))\n\n return renderScripts(router, scripts(), assetScripts())\n}\n\nfunction renderScripts(\n router: ReturnType<typeof useRouter>,\n scripts: Array<RouterManagedTag>,\n assetScripts: Array<RouterManagedTag>,\n) {\n const allScripts = [...scripts, ...assetScripts] as Array<RouterManagedTag>\n\n if ((isServer ?? router.isServer) && router.serverSsr) {\n const serverBufferedScript = router.serverSsr.takeBufferedScripts()\n if (serverBufferedScript) {\n allScripts.unshift(serverBufferedScript)\n }\n }\n\n return (\n <NoHydration>\n {allScripts.map((asset) => (\n <Asset {...asset} />\n ))}\n </NoHydration>\n )\n}\n"],"mappings":";;;;;;AAOA,IAAaO,gBAAgB;CAC3B,MAAMC,SAASJ,UAAU;CACzB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AAUkB,KAAK,CACjB;CAAC,EAAA,CAAA;AAGR"}
{"version":3,"file":"Scripts.js","names":["<NoHydration>\n {allScripts.map((asset) => (\n <Asset {...asset} />\n ))}\n </NoHydration>","<Asset {...asset} />"],"sources":["../../src/Scripts.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { NoHydration } from '@solidjs/web'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport type { AnyRouteMatch, RouterManagedTag } from '@tanstack/router-core'\n\nexport const Scripts = () => {\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n\n const getAssetScripts = (matches: Array<AnyRouteMatch>) => {\n const assetScripts: Array<RouterManagedTag> = []\n const manifest = router.ssr?.manifest\n\n if (!manifest) {\n return []\n }\n\n for (const match of matches) {\n const scripts = manifest.routes[match.routeId]?.scripts\n\n if (!scripts) {\n continue\n }\n\n for (const asset of scripts) {\n assetScripts.push({\n tag: 'script',\n attrs: { ...asset.attrs, nonce },\n children: asset.children,\n })\n }\n }\n\n return assetScripts\n }\n\n const getScripts = (matches: Array<AnyRouteMatch>): Array<RouterManagedTag> =>\n (\n matches\n .map((match) => match.scripts!)\n .flat(1)\n .filter(Boolean) as Array<RouterManagedTag>\n ).map(\n ({ children, ...script }) =>\n ({\n tag: 'script',\n attrs: {\n ...script,\n nonce,\n },\n children,\n }) satisfies RouterManagedTag,\n )\n\n const activeMatches = Solid.createMemo(() => router.stores.matches.get())\n const assetScripts = Solid.createMemo(() => getAssetScripts(activeMatches()))\n const scripts = Solid.createMemo(() => getScripts(activeMatches()))\n\n return renderScripts(router, scripts(), assetScripts())\n}\n\nfunction renderScripts(\n router: ReturnType<typeof useRouter>,\n scripts: Array<RouterManagedTag>,\n assetScripts: Array<RouterManagedTag>,\n) {\n const allScripts = [...scripts, ...assetScripts] as Array<RouterManagedTag>\n\n if ((isServer ?? router.isServer) && router.serverSsr) {\n const serverBufferedScript = router.serverSsr.takeBufferedScripts()\n if (serverBufferedScript) {\n allScripts.unshift(serverBufferedScript)\n }\n }\n\n return (\n <NoHydration>\n {allScripts.map((asset) => (\n <Asset {...asset} />\n ))}\n </NoHydration>\n )\n}\n"],"mappings":";;;;;;AAOA,IAAa,gBAAgB;CAC3B,MAAM,SAAS,UAAA;CACf,MAAM,QAAQ,OAAO,QAAQ,KAAK;CAElC,MAAM,mBAAmB,YAAkC;EACzD,MAAM,eAAwC,CAAA;EAC9C,MAAM,WAAW,OAAO,KAAK;EAE7B,IAAI,CAAC,UACH,OAAO,CAAA;EAGT,KAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,UAAU,SAAS,OAAO,MAAM,UAAU;GAEhD,IAAI,CAAC,SACH;GAGF,KAAK,MAAM,SAAS,SAClB,aAAa,KAAK;IAChB,KAAK;IACL,OAAO;KAAE,GAAG,MAAM;KAAO;;IACzB,UAAU,MAAM;IACjB;;EAIL,OAAO;;CAGT,MAAM,cAAc,YAEhB,QACG,KAAK,UAAU,MAAM,OAAA,EACrB,KAAK,CAAA,EACL,OAAO,OAAA,EACV,KACC,EAAE,UAAU,GAAG,cACb;EACC,KAAK;EACL,OAAO;GACL,GAAG;GACH;;EAEF;GACW;CAGnB,MAAM,gBAAgB,MAAM,iBAAiB,OAAO,OAAO,QAAQ,IAAA,CAAK;CACxE,MAAM,eAAe,MAAM,iBAAiB,gBAAgB,cAAA,CAAe,CAAC;CAG5E,OAAO,cAAc,QAFL,MAAM,iBAAiB,WAAW,cAAA,CAAe,CAEpC,EAAA,GAAW,aAAA,CAAc;;AAGxD,SAAS,cACP,QACA,SACA,cACA;CACA,MAAM,aAAa,CAAC,GAAG,SAAS,GAAG,YAAA;CAEnC,KAAK,YAAY,OAAO,aAAa,OAAO,WAAW;EACrD,MAAM,uBAAuB,OAAO,UAAU,oBAAA;EAC9C,IAAI,sBACF,WAAW,QAAQ,oBAAA;;CAIvB,OACEA,gBAAAA,aAAAA,EAAAA,IAAAA,WAAAA;SACG,WAAW,KAAK,UACfC,gBAAAA,OAAW,KAAA,CAAS;IAEV"}

@@ -1,1 +0,1 @@

{"version":3,"file":"scroll-restoration.js","names":["getScrollRestorationScriptForRouter","useRouter","ScriptOnce","ScrollRestoration","router","script","_$createComponent","children"],"sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import { getScrollRestorationScriptForRouter } from '@tanstack/router-core/scroll-restoration-script'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n const script = getScrollRestorationScriptForRouter(router)\n\n if (!script) {\n return null\n }\n\n return <ScriptOnce children={script} />\n}\n"],"mappings":";;;;;AAIA,SAAgBG,oBAAoB;CAElC,MAAME,SAASL,oCADAC,UACoCG,CAAM;CAEzD,IAAI,CAACC,QACH,OAAO;CAGT,OAAAC,gBAAQJ,YAAU,EAACK,UAAUF,OAAM,CAAA;AACrC"}
{"version":3,"file":"scroll-restoration.js","names":["<ScriptOnce children={script} />","children={script}"],"sources":["../../src/scroll-restoration.tsx"],"sourcesContent":["import { getScrollRestorationScriptForRouter } from '@tanstack/router-core/scroll-restoration-script'\nimport { useRouter } from './useRouter'\nimport { ScriptOnce } from './ScriptOnce'\n\nexport function ScrollRestoration() {\n const router = useRouter()\n const script = getScrollRestorationScriptForRouter(router)\n\n if (!script) {\n return null\n }\n\n return <ScriptOnce children={script} />\n}\n"],"mappings":";;;;;AAIA,SAAgB,oBAAoB;CAElC,MAAM,SAAS,oCADA,UACoC,CAAA;CAEnD,IAAI,CAAC,QACH,OAAO;CAGT,OAAOA,gBAAAA,YAAAA,EAAYC,UAAU,OAAA,CAAU"}

@@ -1,1 +0,1 @@

{"version":3,"file":"ScrollRestoration.js","names":["getElementScrollRestorationEntry","setupScrollRestoration","useRouter","ParsedLocation","ScrollRestorationEntry","ScrollRestorationOptions","useScrollRestoration","router","ScrollRestoration","_props","process","env","NODE_ENV","console","warn","useElementScrollRestoration","options","id","getElement","Window","Element","getKey","location"],"sources":["../../src/ScrollRestoration.tsx"],"sourcesContent":["import {\n getElementScrollRestorationEntry,\n setupScrollRestoration,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n ParsedLocation,\n ScrollRestorationEntry,\n ScrollRestorationOptions,\n} from '@tanstack/router-core'\n\nfunction useScrollRestoration() {\n const router = useRouter()\n setupScrollRestoration(router, true)\n}\n\n/**\n * @deprecated use createRouter's `scrollRestoration` option instead\n */\nexport function ScrollRestoration(_props: ScrollRestorationOptions) {\n useScrollRestoration()\n\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n \"The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead.\",\n )\n }\n\n return null\n}\n\nexport function useElementScrollRestoration(\n options: (\n | {\n id: string\n getElement?: () => Window | Element | undefined | null\n }\n | {\n id?: string\n getElement: () => Window | Element | undefined | null\n }\n ) & {\n getKey?: (location: ParsedLocation) => string\n },\n): ScrollRestorationEntry | undefined {\n useScrollRestoration()\n\n return getElementScrollRestorationEntry(useRouter(), options)\n}\n"],"mappings":";;;AAWA,SAASM,uBAAuB;CAE9BL,uBADeC,UACQK,GAAQ,IAAI;AACrC;;;;AAKA,SAAgBC,kBAAkBC,QAAkC;CAClEH,qBAAqB;CAErB,IAAA,QAAA,IAAA,aAA6B,eAC3BO,QAAQC,KACN,uGACF;CAGF,OAAO;AACT;AAEA,SAAgBC,4BACdC,SAYoC;CACpCV,qBAAqB;CAErB,OAAON,iCAAiCE,UAAU,GAAGc,OAAO;AAC9D"}
{"version":3,"file":"ScrollRestoration.js","names":[],"sources":["../../src/ScrollRestoration.tsx"],"sourcesContent":["import {\n getElementScrollRestorationEntry,\n setupScrollRestoration,\n} from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n ParsedLocation,\n ScrollRestorationEntry,\n ScrollRestorationOptions,\n} from '@tanstack/router-core'\n\nfunction useScrollRestoration() {\n const router = useRouter()\n setupScrollRestoration(router, true)\n}\n\n/**\n * @deprecated use createRouter's `scrollRestoration` option instead\n */\nexport function ScrollRestoration(_props: ScrollRestorationOptions) {\n useScrollRestoration()\n\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n \"The ScrollRestoration component is deprecated. Use createRouter's `scrollRestoration` option instead.\",\n )\n }\n\n return null\n}\n\nexport function useElementScrollRestoration(\n options: (\n | {\n id: string\n getElement?: () => Window | Element | undefined | null\n }\n | {\n id?: string\n getElement: () => Window | Element | undefined | null\n }\n ) & {\n getKey?: (location: ParsedLocation) => string\n },\n): ScrollRestorationEntry | undefined {\n useScrollRestoration()\n\n return getElementScrollRestorationEntry(useRouter(), options)\n}\n"],"mappings":";;;AAWA,SAAS,uBAAuB;CAE9B,uBADe,UACQ,GAAQ,IAAA;;;;;AAMjC,SAAgB,kBAAkB,QAAkC;CAClE,qBAAA;CAEA,IAAA,QAAA,IAAA,aAA6B,eAC3B,QAAQ,KACN,uGAAA;CAIJ,OAAO;;AAGT,SAAgB,4BACd,SAYoC;CACpC,qBAAA;CAEA,OAAO,iCAAiC,UAAA,GAAa,OAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"defaultRenderHandler.js","names":["defineHandlerCallback","RouterServer","renderRouterToString","defaultRenderHandler","router","responseHeaders","children","_$createComponent"],"sources":["../../../src/ssr/defaultRenderHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToString } from './renderRouterToString'\n\nexport const defaultRenderHandler = defineHandlerCallback(\n ({ router, responseHeaders }) =>\n renderRouterToString({\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;;AAIA,IAAaG,uBAAuBH,uBACjC,EAAEI,QAAQC,sBACTH,qBAAqB;CACnBE;CACAC;CACAC,gBAAUC,gBAAON,cAAY,EAASG,OAAM,CAAA;AAC9C,CAAC,CACL"}
{"version":3,"file":"defaultRenderHandler.js","names":["<RouterServer router={router} />"],"sources":["../../../src/ssr/defaultRenderHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToString } from './renderRouterToString'\n\nexport const defaultRenderHandler = defineHandlerCallback(\n ({ router, responseHeaders }) =>\n renderRouterToString({\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;;AAIA,IAAa,uBAAuB,uBACjC,EAAE,QAAQ,sBACT,qBAAqB;CACnB;CACA;CACA,gBAAgBA,gBAAAA,cAAAA,EAAsB,OAAA,CAAU;CACjD,CAAC"}

@@ -1,1 +0,1 @@

{"version":3,"file":"defaultStreamHandler.js","names":["defineHandlerCallback","RouterServer","renderRouterToStream","defaultStreamHandler","request","router","responseHeaders","children","_$createComponent"],"sources":["../../../src/ssr/defaultStreamHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToStream } from './renderRouterToStream'\n\nexport const defaultStreamHandler = defineHandlerCallback(\n ({ request, router, responseHeaders }) =>\n renderRouterToStream({\n request,\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;;AAIA,IAAaG,uBAAuBH,uBACjC,EAAEI,SAASC,QAAQC,sBAClBJ,qBAAqB;CACnBE;CACAC;CACAC;CACAC,gBAAUC,gBAAOP,cAAY,EAASI,OAAM,CAAA;AAC9C,CAAC,CACL"}
{"version":3,"file":"defaultStreamHandler.js","names":["<RouterServer router={router} />"],"sources":["../../../src/ssr/defaultStreamHandler.tsx"],"sourcesContent":["import { defineHandlerCallback } from '@tanstack/router-core/ssr/server'\nimport { RouterServer } from './RouterServer'\nimport { renderRouterToStream } from './renderRouterToStream'\n\nexport const defaultStreamHandler = defineHandlerCallback(\n ({ request, router, responseHeaders }) =>\n renderRouterToStream({\n request,\n router,\n responseHeaders,\n children: () => <RouterServer router={router} />,\n }),\n)\n"],"mappings":";;;;;AAIA,IAAa,uBAAuB,uBACjC,EAAE,SAAS,QAAQ,sBAClB,qBAAqB;CACnB;CACA;CACA;CACA,gBAAgBA,gBAAAA,cAAAA,EAAsB,OAAA,CAAU;CACjD,CAAC"}

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouterToStream.js","names":["Solid","isbot","createSsrStreamResponse","transformReadableStreamWithRouter","makeSsrSerovalPlugin","ReadableStream","AnyRouter","JSX","noop","waitForReadyOrAbort","ready","Promise","signal","AbortSignal","cleanup","race","resolve","onAbort","removeEventListener","addEventListener","once","aborted","renderRouterToStream","request","router","responseHeaders","children","manifest","Request","Headers","Element","writable","readable","TransformStream","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","stream","renderToStream","nonce","plugins","innerWriter","getWriter","writerDone","releaseWriter","releaseLock","abortSolidPipe","reason","abort","catch","finally","onRequestAbort","serverSsr","onCleanup","headers","get","doctype","TextEncoder","encode","doctypeWritten","solidWritable","WritableStream","write","chunk","ArrayBuffer","isView","bytes","Uint8Array","out","length","set","close","pipeTo","err","name","code","console","error","responseStream","Response","status","stores","statusCode"],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport {\n createSsrStreamResponse,\n transformReadableStreamWithRouter,\n} from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst noop = () => {}\n\n// Bot responses wait for the server renderer before streaming. If the request\n// disconnects during that wait, unblock so the pipe can abort and clean up.\nasync function waitForReadyOrAbort(\n ready: Promise<unknown>,\n signal: AbortSignal,\n) {\n let cleanup = noop\n try {\n await Promise.race([\n ready,\n new Promise<void>((resolve) => {\n const onAbort = () => resolve()\n cleanup = () => signal.removeEventListener('abort', onAbort)\n signal.addEventListener('abort', onAbort, { once: true })\n if (signal.aborted) resolve()\n }),\n ])\n } finally {\n cleanup()\n }\n}\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n\n // Solid's `pipeTo(w)` takes a single arg (no signal overload) and locks\n // `w` via `w.getWriter()`. To still own the lifecycle we hand Solid a\n // proxy WritableStream that forwards into an inner writer we control on\n // the real TransformStream writable. Aborting the inner writer errors\n // the underlying readable (which our router transform reads from),\n // surfacing the cancel through the response pipeline.\n //\n // RESIDUAL RISK: solid-js@1.x does NOT expose a disposal hook on\n // `renderToStream`, and its internal write loop swallows writer\n // rejections (`writer.write(...).catch(() => {})` in\n // solid-js/web/dist/server.js). So aborting the inner writer stops\n // outbound bytes but does not terminate Solid's render continuation\n // if a Suspense/resource never resolves — those pending promise\n // continuations remain scheduled and can retain children/context/\n // request references via captured closures until natural completion\n // or process exit. The request-scoped router graph itself is released\n // by ServerSsr.cleanup() through the router stream lifecycle, so the leak\n // is bounded to whatever the user's Suspense/resource closures capture.\n // A hard upstream-abort guarantee would require a disposal API in solid-js.\n const innerWriter = writable.getWriter()\n let writerDone = false\n const releaseWriter = () => {\n try {\n innerWriter.releaseLock()\n } catch {\n // already released / errored\n }\n }\n const abortSolidPipe = (reason?: unknown) => {\n if (writerDone) return\n writerDone = true\n void innerWriter\n .abort(reason)\n .catch(() => {})\n .finally(releaseWriter)\n }\n\n const onRequestAbort = () => {\n abortSolidPipe(request.signal.reason)\n }\n\n // Wire request abort before the bot all-ready wait. Otherwise a disconnect\n // during `await stream` can leave this callback pending forever.\n if (request.signal.aborted) {\n onRequestAbort()\n } else {\n request.signal.addEventListener('abort', onRequestAbort, { once: true })\n router.serverSsr?.onCleanup(() => {\n request.signal.removeEventListener('abort', onRequestAbort)\n })\n }\n\n if (isbot(request.headers.get('User-Agent'))) {\n await waitForReadyOrAbort(\n Promise.resolve(stream as unknown),\n request.signal,\n )\n }\n\n const doctype = new TextEncoder().encode('<!DOCTYPE html>')\n let doctypeWritten = false\n\n const solidWritable = new WritableStream({\n write(chunk) {\n if (!doctypeWritten) {\n doctypeWritten = true\n if (ArrayBuffer.isView(chunk)) {\n const bytes = chunk as Uint8Array\n const out = new Uint8Array(doctype.length + bytes.length)\n out.set(doctype, 0)\n out.set(bytes, doctype.length)\n return innerWriter.write(out)\n }\n }\n return innerWriter.write(chunk)\n },\n close() {\n writerDone = true\n return innerWriter.close().finally(releaseWriter)\n },\n abort(reason) {\n writerDone = true\n return innerWriter.abort(reason).finally(releaseWriter)\n },\n })\n\n if (!request.signal.aborted) {\n try {\n void Promise.resolve(stream.pipeTo(solidWritable) as unknown).catch(\n (err: any) => {\n if (\n writerDone ||\n err?.name === 'AbortError' ||\n err?.code === 'ABORT_ERR'\n )\n return\n console.error('Error in Solid render stream:', err)\n abortSolidPipe(err)\n },\n )\n } catch (err: any) {\n if (err?.name !== 'AbortError' && err?.code !== 'ABORT_ERR') {\n console.error('Error in Solid render stream:', err)\n }\n abortSolidPipe(err)\n }\n }\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n { onAbort: abortSolidPipe },\n )\n return createSsrStreamResponse(\n router,\n new Response(responseStream as any, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n }),\n )\n}\n"],"mappings":";;;;;AAWA,IAAMQ,aAAa,CAAC;AAIpB,eAAeC,oBACbC,OACAE,QACA;CACA,IAAIE,UAAUN;CACd,IAAI;EACF,MAAMG,QAAQI,KAAK,CACjBL,O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D,wBACLsB,QACA,IAAI4D,SAASD,gBAAuB;EAClCE,QAAQ7D,OAAO8D,OAAOC,WAAW3B,IAAI;EACrCD,SAASlC;CACX,CAAC,CACH;AACF"}
{"version":3,"file":"renderRouterToStream.js","names":[],"sources":["../../../src/ssr/renderRouterToStream.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { isbot } from 'isbot'\nimport {\n createSsrStreamResponse,\n transformReadableStreamWithRouter,\n} from '@tanstack/router-core/ssr/server'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { ReadableStream } from 'node:stream/web'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nconst noop = () => {}\n\n// Bot responses wait for the server renderer before streaming. If the request\n// disconnects during that wait, unblock so the pipe can abort and clean up.\nasync function waitForReadyOrAbort(\n ready: Promise<unknown>,\n signal: AbortSignal,\n) {\n let cleanup = noop\n try {\n await Promise.race([\n ready,\n new Promise<void>((resolve) => {\n const onAbort = () => resolve()\n cleanup = () => signal.removeEventListener('abort', onAbort)\n signal.addEventListener('abort', onAbort, { once: true })\n if (signal.aborted) resolve()\n }),\n ])\n } finally {\n cleanup()\n }\n}\n\nexport const renderRouterToStream = async ({\n request,\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n request: Request\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n const { writable, readable } = new TransformStream()\n\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n const stream = Solid.renderToStream(() => children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n\n // Solid's `pipeTo(w)` takes a single arg (no signal overload) and locks\n // `w` via `w.getWriter()`. To still own the lifecycle we hand Solid a\n // proxy WritableStream that forwards into an inner writer we control on\n // the real TransformStream writable. Aborting the inner writer errors\n // the underlying readable (which our router transform reads from),\n // surfacing the cancel through the response pipeline.\n //\n // RESIDUAL RISK: solid-js@1.x does NOT expose a disposal hook on\n // `renderToStream`, and its internal write loop swallows writer\n // rejections (`writer.write(...).catch(() => {})` in\n // solid-js/web/dist/server.js). So aborting the inner writer stops\n // outbound bytes but does not terminate Solid's render continuation\n // if a Suspense/resource never resolves — those pending promise\n // continuations remain scheduled and can retain children/context/\n // request references via captured closures until natural completion\n // or process exit. The request-scoped router graph itself is released\n // by ServerSsr.cleanup() through the router stream lifecycle, so the leak\n // is bounded to whatever the user's Suspense/resource closures capture.\n // A hard upstream-abort guarantee would require a disposal API in solid-js.\n const innerWriter = writable.getWriter()\n let writerDone = false\n const releaseWriter = () => {\n try {\n innerWriter.releaseLock()\n } catch {\n // already released / errored\n }\n }\n const abortSolidPipe = (reason?: unknown) => {\n if (writerDone) return\n writerDone = true\n void innerWriter\n .abort(reason)\n .catch(() => {})\n .finally(releaseWriter)\n }\n\n const onRequestAbort = () => {\n abortSolidPipe(request.signal.reason)\n }\n\n // Wire request abort before the bot all-ready wait. Otherwise a disconnect\n // during `await stream` can leave this callback pending forever.\n if (request.signal.aborted) {\n onRequestAbort()\n } else {\n request.signal.addEventListener('abort', onRequestAbort, { once: true })\n router.serverSsr?.onCleanup(() => {\n request.signal.removeEventListener('abort', onRequestAbort)\n })\n }\n\n if (isbot(request.headers.get('User-Agent'))) {\n await waitForReadyOrAbort(\n Promise.resolve(stream as unknown),\n request.signal,\n )\n }\n\n const doctype = new TextEncoder().encode('<!DOCTYPE html>')\n let doctypeWritten = false\n\n const solidWritable = new WritableStream({\n write(chunk) {\n if (!doctypeWritten) {\n doctypeWritten = true\n if (ArrayBuffer.isView(chunk)) {\n const bytes = chunk as Uint8Array\n const out = new Uint8Array(doctype.length + bytes.length)\n out.set(doctype, 0)\n out.set(bytes, doctype.length)\n return innerWriter.write(out)\n }\n }\n return innerWriter.write(chunk)\n },\n close() {\n writerDone = true\n return innerWriter.close().finally(releaseWriter)\n },\n abort(reason) {\n writerDone = true\n return innerWriter.abort(reason).finally(releaseWriter)\n },\n })\n\n if (!request.signal.aborted) {\n try {\n void Promise.resolve(stream.pipeTo(solidWritable) as unknown).catch(\n (err: any) => {\n if (\n writerDone ||\n err?.name === 'AbortError' ||\n err?.code === 'ABORT_ERR'\n )\n return\n console.error('Error in Solid render stream:', err)\n abortSolidPipe(err)\n },\n )\n } catch (err: any) {\n if (err?.name !== 'AbortError' && err?.code !== 'ABORT_ERR') {\n console.error('Error in Solid render stream:', err)\n }\n abortSolidPipe(err)\n }\n }\n\n const responseStream = transformReadableStreamWithRouter(\n router,\n readable as unknown as ReadableStream,\n { onAbort: abortSolidPipe },\n )\n return createSsrStreamResponse(\n router,\n new Response(responseStream as any, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n }),\n )\n}\n"],"mappings":";;;;;AAWA,IAAM,aAAa,CAAA;AAInB,eAAe,oBACb,OACA,QACA;CACA,IAAI,UAAU;CACd,IAAI;EACF,MAAM,QAAQ,KAAK,CACjB,OACA,IAAI,SAAe,YAAY;GAC7B,MAAM,gBAAgB,QAAA;GACtB,gBAAgB,OAAO,oBAAoB,SAAS,OAAA;GACpD,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAA,CAAM;GACxD,IAAI,OAAO,SAAS,QAAA;IACpB,CACH;WACO;EACR,QAAA;;;AAIJ,IAAa,uBAAuB,OAAO,EACzC,SACA,QACA,iBACA,UACA,eAOI;CACJ,MAAM,EAAE,UAAU,aAAa,IAAI,gBAAA;CAKnC,MAAM,kBAFH,OAAO,SAAiB,yBACxB,OAAO,QAAQ,KAAa,wBACe,KAAK,YAAiB;EAElE,OADe,qBAAqB,SAAS,EAAE,QAAQ,MAAA,CAChD;;CAGT,MAAM,SAAS,MAAM,qBAAqB,UAAU;EAClD,OAAO,OAAO,QAAQ,KAAK;EAC3B,SAAS;EACT,UAA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AO,OAAO,aAAA,CAAc,EAAa,OAC3D,QAAa;GACZ,IACE,cACA,KAAK,SAAS,gBACd,KAAK,SAAS,aAEd;GACF,QAAQ,MAAM,iCAAiC,GAAA;GAC/C,eAAe,GAAA;;UAGZ,KAAU;EACjB,IAAI,KAAK,SAAS,gBAAgB,KAAK,SAAS,aAC9C,QAAQ,MAAM,iCAAiC,GAAA;EAEjD,eAAe,GAAA;;CAInB,MAAM,iBAAiB,kCACrB,QACA,UACA,EAAE,SAAS,eAAA,CAAgB;CAE7B,OAAO,wBACL,QACA,IAAI,SAAS,gBAAuB;EAClC,QAAQ,OAAO,OAAO,WAAW,IAAA;EACjC,SAAS;EACV,CAAC"}

@@ -1,1 +0,1 @@

{"version":3,"file":"renderRouterToString.js","names":["Solid","makeSsrSerovalPlugin","AnyRouter","JSX","renderRouterToString","router","responseHeaders","children","manifest","Headers","Element","serializationAdapters","options","ssr","serovalPlugins","map","adapter","plugin","didRun","html","renderToString","nonce","plugins","serverSsr","setRenderFinished","injectedHtml","takeBufferedHtml","replace","Response","status","stores","statusCode","get","headers","error","console","cleanup"],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;AAKA,IAAaI,wBAAwB,EACnCC,QACAC,iBACAC,UACAC,eAMI;CACJ,IAAI;EAIF,MAAMM,kBAFHT,OAAOO,SAAiBD,yBACxBN,OAAOO,QAAQC,KAAaF,wBACeI,KAAKC,YAAiB;GAElE,OADef,qBAAqBe,SAAS,EAAEE,QAAQ,MAAM,CACtDD;EACT,CAAC;EAED,IAAIE,OAAOnB,MAAMoB,eAAeb,UAAU;GACxCc,OAAOhB,OAAOO,QAAQC,KAAKQ;GAC3BC,SAASR;GACTN,UAAUA,YAAYH,OAAOQ,KAAKL;EACpC,CAAQ;EACRH,OAAOkB,UAAWC,kBAAkB;EAEpC,MAAMC,eAAepB,OAAOkB,UAAWG,iBAAiB;EACxD,IAAID,cACFN,OAAOA,KAAKQ,QAAQ,iBAAiB,GAAGF,aAAY,QAAS;EAE/D,OAAO,IAAIG,SAAS,kBAAkBT,QAAQ;GAC5CU,QAAQxB,OAAOyB,OAAOC,WAAWC,IAAI;GACrCC,SAAS3B;EACX,CAAC;CACH,SAAS4B,OAAO;EACdC,QAAQD,MAAM,2BAA2BA,KAAK;EAC9C,OAAO,IAAIN,SAAS,yBAAyB;GAC3CC,QAAQ;GACRI,SAAS3B;EACX,CAAC;CACH,UAAU;EACRD,OAAOkB,WAAWa,QAAQ;CAC5B;AACF"}
{"version":3,"file":"renderRouterToString.js","names":[],"sources":["../../../src/ssr/renderRouterToString.tsx"],"sourcesContent":["import * as Solid from '@solidjs/web'\nimport { makeSsrSerovalPlugin } from '@tanstack/router-core'\nimport type { AnyRouter } from '@tanstack/router-core'\nimport type { JSX } from '@solidjs/web'\n\nexport const renderRouterToString = ({\n router,\n responseHeaders,\n children,\n manifest,\n}: {\n router: AnyRouter\n responseHeaders: Headers\n children: () => JSX.Element\n manifest?: unknown\n}) => {\n try {\n const serializationAdapters =\n (router.options as any)?.serializationAdapters ||\n (router.options.ssr as any)?.serializationAdapters\n const serovalPlugins = serializationAdapters?.map((adapter: any) => {\n const plugin = makeSsrSerovalPlugin(adapter, { didRun: false })\n return plugin\n })\n\n let html = Solid.renderToString(children, {\n nonce: router.options.ssr?.nonce,\n plugins: serovalPlugins,\n manifest: manifest ?? router.ssr?.manifest,\n } as any)\n router.serverSsr!.setRenderFinished()\n\n const injectedHtml = router.serverSsr!.takeBufferedHtml()\n if (injectedHtml) {\n html = html.replace(`</body>`, () => `${injectedHtml}</body>`)\n }\n return new Response(`<!DOCTYPE html>${html}`, {\n status: router.stores.statusCode.get(),\n headers: responseHeaders,\n })\n } catch (error) {\n console.error('Render to string error:', error)\n return new Response('Internal Server Error', {\n status: 500,\n headers: responseHeaders,\n })\n } finally {\n router.serverSsr?.cleanup()\n }\n}\n"],"mappings":";;;AAKA,IAAa,wBAAwB,EACnC,QACA,iBACA,UACA,eAMI;CACJ,IAAI;EAIF,MAAM,kBAFH,OAAO,SAAiB,yBACxB,OAAO,QAAQ,KAAa,wBACe,KAAK,YAAiB;GAElE,OADe,qBAAqB,SAAS,EAAE,QAAQ,MAAA,CAChD;;EAGT,IAAI,OAAO,MAAM,eAAe,UAAU;GACxC,OAAO,OAAO,QAAQ,KAAK;GAC3B,SAAS;GACT,UAAU,YAAY,OAAO,KAAK;GACnC;EACD,OAAO,UAAW,kBAAA;EAElB,MAAM,eAAe,OAAO,UAAW,iBAAA;EACvC,IAAI,cACF,OAAO,KAAK,QAAQ,iBAAiB,GAAG,aAAa,QAAA;EAEvD,OAAO,IAAI,SAAS,kBAAkB,QAAQ;GAC5C,QAAQ,OAAO,OAAO,WAAW,IAAA;GACjC,SAAS;GACV;UACM,OAAO;EACd,QAAQ,MAAM,2BAA2B,KAAA;EACzC,OAAO,IAAI,SAAS,yBAAyB;GAC3C,QAAQ;GACR,SAAS;GACV;WACO;EACR,OAAO,WAAW,QAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"RouterClient.js","names":["hydrate","Await","RouterProvider","AnyRouter","hydrationPromise","Promise","Array","RouterClient","props","router","stores","matchesId","get","length","resolve","_$createComponent","promise","children"],"sources":["../../../src/ssr/RouterClient.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/router-core/ssr/client'\nimport { Await } from '../awaited'\nimport { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nlet hydrationPromise: Promise<void | Array<Array<void>>> | undefined\n\nexport function RouterClient(props: { router: AnyRouter }) {\n if (!hydrationPromise) {\n if (!props.router.stores.matchesId.get().length) {\n hydrationPromise = hydrate(props.router)\n } else {\n hydrationPromise = Promise.resolve()\n }\n }\n return (\n <Await\n promise={hydrationPromise}\n children={() => <RouterProvider router={props.router} />}\n />\n )\n}\n"],"mappings":";;;;;AAKA,IAAII;AAEJ,SAAgBG,aAAaC,OAA8B;CACzD,IAAI,CAACJ,kBACH,IAAI,CAACI,MAAMC,OAAOC,OAAOC,UAAUC,IAAI,EAAEC,QACvCT,mBAAmBJ,QAAQQ,MAAMC,MAAM;MAEvCL,mBAAmBC,QAAQS,QAAQ;CAGvC,OAAAC,gBACGd,OAAK;EACJe,SAASZ;EACTa,gBAAUF,gBAAOb,gBAAc,EAAA,IAACO,SAAM;GAAA,OAAED,MAAMC;EAAM,EAAA,CAAA;CAAI,CAAA;AAG9D"}
{"version":3,"file":"RouterClient.js","names":["<Await\n promise={hydrationPromise}\n children={() => <RouterProvider router={props.router} />}\n />","promise={hydrationPromise}","children={() => <RouterProvider router={props.router} />}","<RouterProvider router={props.router} />"],"sources":["../../../src/ssr/RouterClient.tsx"],"sourcesContent":["import { hydrate } from '@tanstack/router-core/ssr/client'\nimport { Await } from '../awaited'\nimport { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nlet hydrationPromise: Promise<void | Array<Array<void>>> | undefined\n\nexport function RouterClient(props: { router: AnyRouter }) {\n if (!hydrationPromise) {\n if (!props.router.stores.matchesId.get().length) {\n hydrationPromise = hydrate(props.router)\n } else {\n hydrationPromise = Promise.resolve()\n }\n }\n return (\n <Await\n promise={hydrationPromise}\n children={() => <RouterProvider router={props.router} />}\n />\n )\n}\n"],"mappings":";;;;;AAKA,IAAI;AAEJ,SAAgB,aAAa,OAA8B;CACzD,IAAI,CAAC,kBACH,IAAI,CAAC,MAAM,OAAO,OAAO,UAAU,IAAA,EAAM,QACvC,mBAAmB,QAAQ,MAAM,MAAA;MAEjC,mBAAmB,QAAQ,QAAA;CAG/B,OACEA,gBAAAA,OAAAA;EACEC,SAAS;EACTC,gBAAgBC,gBAAAA,gBAAAA,EAAgB,IAAA,SAAA;UAAQ,MAAM;KAAU;EACxD"}

@@ -1,1 +0,1 @@

{"version":3,"file":"RouterServer.js","names":["RouterProvider","AnyRouter","RouterServer","props","router","TRouter","_$createComponent"],"sources":["../../../src/ssr/RouterServer.tsx"],"sourcesContent":["import { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport function RouterServer<TRouter extends AnyRouter>(props: {\n router: TRouter\n}) {\n return <RouterProvider router={props.router} />\n}\n"],"mappings":";;;AAGA,SAAgBE,aAAwCC,OAErD;CACD,OAAAG,gBAAQN,gBAAc,EAAA,IAACI,SAAM;EAAA,OAAED,MAAMC;CAAM,EAAA,CAAA;AAC7C"}
{"version":3,"file":"RouterServer.js","names":["<RouterProvider router={props.router} />"],"sources":["../../../src/ssr/RouterServer.tsx"],"sourcesContent":["import { RouterProvider } from '../RouterProvider'\nimport type { AnyRouter } from '@tanstack/router-core'\n\nexport function RouterServer<TRouter extends AnyRouter>(props: {\n router: TRouter\n}) {\n return <RouterProvider router={props.router} />\n}\n"],"mappings":";;;AAGA,SAAgB,aAAwC,OAErD;CACD,OAAOA,gBAAAA,gBAAAA,EAAgB,IAAA,SAAA;SAAQ,MAAM;IAAU"}

@@ -1,1 +0,1 @@

{"version":3,"file":"Transitioner.js","names":["Solid","getLocationChangeInfo","trimPathRight","useRouter","ParsedLocation","handleHashScrollWithLocation","_router","location","document","querySelector","hashScrollIntoViewOptions","state","__hashScrollIntoViewOptions","hash","el","getElementById","scrollIntoView","Transitioner","router","mountLoadForRouter","mounted","isLoading","createMemo","stores","get","isSolidTransitioning","hasPending","isAnyPending","isPagePending","startTransition","fn","Promise","runWithOwner","flush","onSettled","unsub","history","subscribe","queueMicrotask","load","updateLatestLocation","nextLocation","buildLocation","to","latestLocation","pathname","search","params","_includeValidateSearch","publicHref","commitLocation","replace","window","ssr","tryLoad","err","console","error","createRenderEffect","resolvedLocation","const","currentIsLoading","currentIsPagePending","currentIsAnyPending","loc","resolvedLoc","prev","previousIsLoading","previousIsPagePending","previousIsAnyPending","emit","type","changeInfo","batch","status","set","hrefChanged"],"sources":["../../src/Transitioner.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { getLocationChangeInfo, trimPathRight } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type { ParsedLocation } from '@tanstack/router-core'\n\n/**\n * Inline version of handleHashScroll that accepts a pre-captured location\n * to avoid reading router.stores.location.state inside an effect callback\n * (which would trigger a Solid v2 reactive warning).\n */\nfunction handleHashScrollWithLocation(_router: any, location: ParsedLocation) {\n if (typeof document !== 'undefined' && (document as any).querySelector) {\n const hashScrollIntoViewOptions =\n location.state.__hashScrollIntoViewOptions ?? true\n\n if (hashScrollIntoViewOptions && location.hash !== '') {\n const el = document.getElementById(location.hash)\n if (el) {\n el.scrollIntoView(hashScrollIntoViewOptions)\n }\n }\n }\n}\n\nexport function Transitioner() {\n const router = useRouter()\n let mountLoadForRouter = { router, mounted: false }\n const isLoading = Solid.createMemo(() => router.stores.isLoading.get())\n\n const [isSolidTransitioning] = [() => false]\n\n // Track pending state changes\n const hasPending = Solid.createMemo(() => router.stores.hasPending.get())\n\n const isAnyPending = Solid.createMemo(\n () => isLoading() || isSolidTransitioning() || hasPending(),\n )\n\n const isPagePending = Solid.createMemo(() => isLoading() || hasPending())\n\n router.startTransition = (fn: () => void | Promise<void>) => {\n Solid.runWithOwner(null, fn)\n try {\n Solid.flush()\n } catch {\n // flush() throws inside reactive contexts — Solid auto-flushes there\n }\n }\n\n // Subscribe to location changes\n // and try to load the new location\n Solid.onSettled(() => {\n const unsub = router.history.subscribe(() => {\n queueMicrotask(() => router.load())\n })\n\n // Refresh latestLocation from the current browser URL before comparing.\n // The URL may have been changed synchronously (e.g. via replaceState) after\n // render() but before this effect ran, so we must not use the stale\n // render-time location here.\n router.updateLatestLocation()\n\n const nextLocation = router.buildLocation({\n to: router.latestLocation.pathname,\n search: true,\n params: true,\n hash: true,\n state: true,\n _includeValidateSearch: true,\n })\n\n // Check if the current URL matches the canonical form.\n // Compare publicHref (browser-facing URL) for consistency with\n // the server-side redirect check in router.beforeLoad.\n if (\n trimPathRight(router.latestLocation.publicHref) !==\n trimPathRight(nextLocation.publicHref)\n ) {\n router.commitLocation({ ...nextLocation, replace: true })\n }\n\n return () => {\n unsub()\n }\n })\n\n // Try to load the initial location\n // In Solid v2, signal updates inside onSettled cannot be flushed\n // synchronously (flush() throws). router.load() sets signals via batch(),\n // and the code that runs immediately after needs those values committed.\n // By deferring to queueMicrotask, the load runs outside the reactive\n // scheduling frame so flush() works correctly.\n Solid.onSettled(() => {\n if (\n // if we are hydrating from SSR, loading is triggered in ssr-client\n (typeof window !== 'undefined' && router.ssr) ||\n (mountLoadForRouter.router === router && mountLoadForRouter.mounted)\n ) {\n return\n }\n mountLoadForRouter = { router, mounted: true }\n queueMicrotask(() => {\n const tryLoad = async () => {\n try {\n await router.load()\n } catch (err) {\n console.error(err)\n }\n }\n tryLoad()\n })\n })\n\n Solid.createRenderEffect(\n () =>\n [\n isLoading(),\n isPagePending(),\n isAnyPending(),\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\n ] as const,\n (\n [\n currentIsLoading,\n currentIsPagePending,\n currentIsAnyPending,\n loc,\n resolvedLoc,\n ],\n prev,\n ) => {\n // Guard: if location state isn't available yet, skip all event emissions\n if (!loc) return\n\n const previousIsLoading = prev?.[0]\n const previousIsPagePending = prev?.[1]\n const previousIsAnyPending = prev?.[2]\n\n // onLoad: when the router finishes loading\n if (previousIsLoading && !currentIsLoading) {\n router.emit({\n type: 'onLoad',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onBeforeRouteMount: must fire before onResolved\n if (previousIsPagePending && !currentIsPagePending) {\n router.emit({\n type: 'onBeforeRouteMount',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onResolved: fires after onBeforeRouteMount\n if (previousIsAnyPending && !currentIsAnyPending) {\n const changeInfo = getLocationChangeInfo(loc, resolvedLoc)\n router.emit({\n type: 'onResolved',\n ...changeInfo,\n })\n\n Solid.runWithOwner(null, () => {\n router.batch(() => {\n router.stores.status.set('idle')\n // Use `loc` from the source tuple to avoid reading\n // router.stores.location.get() inside the effect callback\n router.stores.resolvedLocation.set(loc)\n })\n })\n\n if (changeInfo.hrefChanged) {\n // Pass the already-captured location to avoid a reactive read\n // inside the effect callback (handleHashScroll would otherwise\n // read router.stores.location.get() which triggers a warning)\n handleHashScrollWithLocation(router, loc)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;;;;AAUA,SAASK,6BAA6BC,SAAcC,UAA0B;CAC5E,IAAI,OAAOC,aAAa,eAAgBA,SAAiBC,eAAe;EACtE,MAAMC,4BACJH,SAASI,MAAMC,+BAA+B;EAEhD,IAAIF,6BAA6BH,SAASM,SAAS,IAAI;GACrD,MAAMC,KAAKN,SAASO,eAAeR,SAASM,IAAI;GAChD,IAAIC,IACFA,GAAGE,eAAeN,yBAAyB;EAE/C;CACF;AACF;AAEA,SAAgBO,eAAe;CAC7B,MAAMC,SAASf,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AAK;IACpB,SAASgB,KAAK;KACZC,QAAQC,MAAMF,GAAG;IACnB;GACF;GACAD,QAAQ;EACV,CAAC;CACH,CAAC;CAEDtD,MAAM0D,yBAEF;EACErC,UAAU;EACVO,cAAc;EACdD,aAAa;EACbT,OAAOK,OAAOhB,SAASiB,IAAI;EAC3BN,OAAOK,OAAOoC,iBAAiBnC,IAAI;CAAC,IAGtC,CACEqC,kBACAC,sBACAC,qBACAC,KACAC,cAEFC,SACG;EAEH,IAAI,CAACF,KAAK;EAEV,MAAMG,oBAAoBD,OAAO;EACjC,MAAME,wBAAwBF,OAAO;EACrC,MAAMG,uBAAuBH,OAAO;EAGpC,IAAIC,qBAAqB,CAACN,kBACxB3C,OAAOoD,KAAK;GACVC,MAAM;GACN,GAAGtE,sBAAsB+D,KAAKC,WAAW;EAC3C,CAAC;EAIH,IAAIG,yBAAyB,CAACN,sBAC5B5C,OAAOoD,KAAK;GACVC,MAAM;GACN,GAAGtE,sBAAsB+D,KAAKC,WAAW;EAC3C,CAAC;EAIH,IAAII,wBAAwB,CAACN,qBAAqB;GAChD,MAAMS,aAAavE,sBAAsB+D,KAAKC,WAAW;GACzD/C,OAAOoD,KAAK;IACVC,MAAM;IACN,GAAGC;GACL,CAAC;GAEDxE,MAAMgC,aAAa,YAAY;IAC7Bd,OAAOuD,YAAY;KACjBvD,OAAOK,OAAOmD,OAAOC,IAAI,MAAM;KAG/BzD,OAAOK,OAAOoC,iBAAiBgB,IAAIX,GAAG;IACxC,CAAC;GACH,CAAC;GAED,IAAIQ,WAAWI,aAIbvE,6BAA6Ba,QAAQ8C,GAAG;EAE5C;CACF,CACF;CAEA,OAAO;AACT"}
{"version":3,"file":"Transitioner.js","names":[],"sources":["../../src/Transitioner.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { getLocationChangeInfo, trimPathRight } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type { ParsedLocation } from '@tanstack/router-core'\n\n/**\n * Inline version of handleHashScroll that accepts a pre-captured location\n * to avoid reading router.stores.location.state inside an effect callback\n * (which would trigger a Solid v2 reactive warning).\n */\nfunction handleHashScrollWithLocation(_router: any, location: ParsedLocation) {\n if (typeof document !== 'undefined' && (document as any).querySelector) {\n const hashScrollIntoViewOptions =\n location.state.__hashScrollIntoViewOptions ?? true\n\n if (hashScrollIntoViewOptions && location.hash !== '') {\n const el = document.getElementById(location.hash)\n if (el) {\n el.scrollIntoView(hashScrollIntoViewOptions)\n }\n }\n }\n}\n\nexport function Transitioner() {\n const router = useRouter()\n let mountLoadForRouter = { router, mounted: false }\n const isLoading = Solid.createMemo(() => router.stores.isLoading.get())\n\n const [isSolidTransitioning] = [() => false]\n\n // Track pending state changes\n const hasPending = Solid.createMemo(() => router.stores.hasPending.get())\n\n const isAnyPending = Solid.createMemo(\n () => isLoading() || isSolidTransitioning() || hasPending(),\n )\n\n const isPagePending = Solid.createMemo(() => isLoading() || hasPending())\n\n router.startTransition = (fn: () => void | Promise<void>) => {\n Solid.runWithOwner(null, fn)\n try {\n Solid.flush()\n } catch {\n // flush() throws inside reactive contexts — Solid auto-flushes there\n }\n }\n\n // Subscribe to location changes\n // and try to load the new location\n Solid.onSettled(() => {\n const unsub = router.history.subscribe(() => {\n queueMicrotask(() => router.load())\n })\n\n // Refresh latestLocation from the current browser URL before comparing.\n // The URL may have been changed synchronously (e.g. via replaceState) after\n // render() but before this effect ran, so we must not use the stale\n // render-time location here.\n router.updateLatestLocation()\n\n const nextLocation = router.buildLocation({\n to: router.latestLocation.pathname,\n search: true,\n params: true,\n hash: true,\n state: true,\n _includeValidateSearch: true,\n })\n\n // Check if the current URL matches the canonical form.\n // Compare publicHref (browser-facing URL) for consistency with\n // the server-side redirect check in router.beforeLoad.\n if (\n trimPathRight(router.latestLocation.publicHref) !==\n trimPathRight(nextLocation.publicHref)\n ) {\n router.commitLocation({ ...nextLocation, replace: true })\n }\n\n return () => {\n unsub()\n }\n })\n\n // Try to load the initial location\n // In Solid v2, signal updates inside onSettled cannot be flushed\n // synchronously (flush() throws). router.load() sets signals via batch(),\n // and the code that runs immediately after needs those values committed.\n // By deferring to queueMicrotask, the load runs outside the reactive\n // scheduling frame so flush() works correctly.\n Solid.onSettled(() => {\n if (\n // if we are hydrating from SSR, loading is triggered in ssr-client\n (typeof window !== 'undefined' && router.ssr) ||\n (mountLoadForRouter.router === router && mountLoadForRouter.mounted)\n ) {\n return\n }\n mountLoadForRouter = { router, mounted: true }\n queueMicrotask(() => {\n const tryLoad = async () => {\n try {\n await router.load()\n } catch (err) {\n console.error(err)\n }\n }\n tryLoad()\n })\n })\n\n Solid.createRenderEffect(\n () =>\n [\n isLoading(),\n isPagePending(),\n isAnyPending(),\n router.stores.location.get(),\n router.stores.resolvedLocation.get(),\n ] as const,\n (\n [\n currentIsLoading,\n currentIsPagePending,\n currentIsAnyPending,\n loc,\n resolvedLoc,\n ],\n prev,\n ) => {\n // Guard: if location state isn't available yet, skip all event emissions\n if (!loc) return\n\n const previousIsLoading = prev?.[0]\n const previousIsPagePending = prev?.[1]\n const previousIsAnyPending = prev?.[2]\n\n // onLoad: when the router finishes loading\n if (previousIsLoading && !currentIsLoading) {\n router.emit({\n type: 'onLoad',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onBeforeRouteMount: must fire before onResolved\n if (previousIsPagePending && !currentIsPagePending) {\n router.emit({\n type: 'onBeforeRouteMount',\n ...getLocationChangeInfo(loc, resolvedLoc),\n })\n }\n\n // onResolved: fires after onBeforeRouteMount\n if (previousIsAnyPending && !currentIsAnyPending) {\n const changeInfo = getLocationChangeInfo(loc, resolvedLoc)\n router.emit({\n type: 'onResolved',\n ...changeInfo,\n })\n\n Solid.runWithOwner(null, () => {\n router.batch(() => {\n router.stores.status.set('idle')\n // Use `loc` from the source tuple to avoid reading\n // router.stores.location.get() inside the effect callback\n router.stores.resolvedLocation.set(loc)\n })\n })\n\n if (changeInfo.hrefChanged) {\n // Pass the already-captured location to avoid a reactive read\n // inside the effect callback (handleHashScroll would otherwise\n // read router.stores.location.get() which triggers a warning)\n handleHashScrollWithLocation(router, loc)\n }\n }\n },\n )\n\n return null\n}\n"],"mappings":";;;;;;;;;AAUA,SAAS,6BAA6B,SAAc,UAA0B;CAC5E,IAAI,OAAO,aAAa,eAAgB,SAAiB,eAAe;EACtE,MAAM,4BACJ,SAAS,MAAM,+BAA+B;EAEhD,IAAI,6BAA6B,SAAS,SAAS,IAAI;GACrD,MAAM,KAAK,SAAS,eAAe,SAAS,IAAA;GAC5C,IAAI,IACF,GAAG,eAAe,yBAAA;;;;AAM1B,SAAgB,eAAe;CAC7B,MAAM,SAAS,UAAA;CACf,IAAI,qBAAqB;EAAE;EAAQ,SAAS;;CAC5C,MAAM,YAAY,MAAM,iBAAiB,OAAO,OAAO,UAAU,IAAA,CAAK;CAEtE,MAAM,CAAC,wBAAwB,OAAO,KAAA;CAGtC,MAAM,aAAa,MAAM,iBAAiB,OAAO,OAAO,WAAW,IAAA,CAAK;CAExE,MAAM,eAAe,MAAM,iBACnB,UAAA,KAAe,qBAAA,KAA0B,WAAA,CAAY;CAG7D,MAAM,gBAAgB,MAAM,iBAAiB,UAAA,KAAe,WAAA,CAAY;CAExE,OAAO,mBAAmB,OAAmC;EAC3D,MAAM,aAAa,MAAM,EAAA;EACzB,IAAI;GACF,MAAM,MAAA;UACA,CAAA;;CAOV,MAAM,gBAAgB;EACpB,MAAM,QAAQ,OAAO,QAAQ,gBAAgB;GAC3C,qBAAqB,OAAO,KAAA,CAAM;;EAOpC,OAAO,qBAAA;EAEP,MAAM,eAAe,OAAO,cAAc;GACxC,IAAI,OAAO,eAAe;GAC1B,QAAQ;GACR,QAAQ;GACR,MAAM;GACN,OAAO;GACP,wBAAwB;GACzB;EAKD,IACE,cAAc,OAAO,eAAe,UAAA,MACpC,cAAc,aAAa,UAAA,GAE3B,OAAO,eAAe;GAAE,GAAG;GAAc,SAAS;GAAM;EAG1D,aAAa;GACX,MAAA;;;CAUJ,MAAM,gBAAgB;EACpB,IAEG,OAAO,WAAW,eAAe,OAAO,OACxC,mBAAmB,WAAW,UAAU,mBAAmB,SAE5D;EAEF,qBAAqB;GAAE;GAAQ,SAAS;;EACxC,qBAAqB;GACnB,MAAM,UAAU,YAAY;IAC1B,IAAI;KACF,MAAM,OAAO,KAAA;aACN,KAAK;KACZ,QAAQ,MAAM,GAAA;;;GAGlB,QAAA;;;CAIJ,MAAM,yBAEF;EACE,UAAA;EACA,cAAA;EACA,aAAA;EACA,OAAO,OAAO,SAAS,IAAA;EACvB,OAAO,OAAO,iBAAiB,IAAA;KAGjC,CACE,kBACA,sBACA,qBACA,KACA,cAEF,SACG;EAEH,IAAI,CAAC,KAAK;EAEV,MAAM,oBAAoB,OAAO;EACjC,MAAM,wBAAwB,OAAO;EACrC,MAAM,uBAAuB,OAAO;EAGpC,IAAI,qBAAqB,CAAC,kBACxB,OAAO,KAAK;GACV,MAAM;GACN,GAAG,sBAAsB,KAAK,WAAA;GAC/B;EAIH,IAAI,yBAAyB,CAAC,sBAC5B,OAAO,KAAK;GACV,MAAM;GACN,GAAG,sBAAsB,KAAK,WAAA;GAC/B;EAIH,IAAI,wBAAwB,CAAC,qBAAqB;GAChD,MAAM,aAAa,sBAAsB,KAAK,WAAA;GAC9C,OAAO,KAAK;IACV,MAAM;IACN,GAAG;IACJ;GAED,MAAM,aAAa,YAAY;IAC7B,OAAO,YAAY;KACjB,OAAO,OAAO,OAAO,IAAI,MAAA;KAGzB,OAAO,OAAO,iBAAiB,IAAI,GAAA;;;GAIvC,IAAI,WAAW,aAIb,6BAA6B,QAAQ,GAAA;;;CAM7C,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useBlocker.js","names":["Solid","useRouter","BlockerFnArgs","HistoryAction","HistoryLocation","SolidNode","AnyRoute","AnyRouter","ParseRoute","RegisteredRouter","ShouldBlockFnLocation","routeId","TRouteId","fullPath","TFullPath","pathname","params","TAllParams","search","TFullSearchSchema","AnyShouldBlockFnLocation","MakeShouldBlockFnLocationUnion","TRouter","TRoute","BlockerResolver","status","current","next","action","proceed","reset","ShouldBlockFnArgs","ShouldBlockFn","args","Promise","UseBlockerOpts","shouldBlockFn","enableBeforeUnload","disabled","withResolver","TWithResolver","LegacyBlockerFn","LegacyBlockerOpts","blockerFn","condition","_resolveBlockerOpts","opts","undefined","shouldBlock","Boolean","_customBlockerFn","createMemo","useBlocker","Accessor","blockerFnOrOpts","props","merge","router","resolver","setResolver","createSignal","disposeBlock","createEffect","blockerFnComposed","blockerFnArgs","getLocation","location","parsedLocation","parseLocation","matchedRoutes","getMatchedRoutes","foundRoute","routeParams","id","currentLocation","nextLocation","promise","resolve","canNavigateAsync","history","block","onSettled","_resolvePromptBlockerArgs","PromptProps","LegacyPromptProps","BlockComponent","Block","propsWithChildren","children","child","_$memo","TParams"],"sources":["../../src/useBlocker.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n BlockerFnArgs,\n HistoryAction,\n HistoryLocation,\n} from '@tanstack/history'\nimport type { SolidNode } from './route'\nimport type {\n AnyRoute,\n AnyRouter,\n ParseRoute,\n RegisteredRouter,\n} from '@tanstack/router-core'\n\ntype ShouldBlockFnLocation<\n out TRouteId,\n out TFullPath,\n out TAllParams,\n out TFullSearchSchema,\n> = {\n routeId: TRouteId\n fullPath: TFullPath\n pathname: string\n params: TAllParams\n search: TFullSearchSchema\n}\n\ntype AnyShouldBlockFnLocation = ShouldBlockFnLocation<any, any, any, any>\ntype MakeShouldBlockFnLocationUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? ShouldBlockFnLocation<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema']\n >\n : never\n\ntype BlockerResolver<TRouter extends AnyRouter = RegisteredRouter> =\n | {\n status: 'blocked'\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n proceed: () => void\n reset: () => void\n }\n | {\n status: 'idle'\n current: undefined\n next: undefined\n action: undefined\n proceed: undefined\n reset: undefined\n }\n\ntype ShouldBlockFnArgs<TRouter extends AnyRouter = RegisteredRouter> = {\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n}\n\nexport type ShouldBlockFn<TRouter extends AnyRouter = RegisteredRouter> = (\n args: ShouldBlockFnArgs<TRouter>,\n) => boolean | Promise<boolean>\nexport type UseBlockerOpts<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n> = {\n shouldBlockFn: ShouldBlockFn<TRouter>\n enableBeforeUnload?: boolean | (() => boolean)\n disabled?: boolean\n withResolver?: TWithResolver\n}\n\ntype LegacyBlockerFn = () => Promise<any> | any\ntype LegacyBlockerOpts = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n}\n\nfunction _resolveBlockerOpts(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): UseBlockerOpts {\n if (opts === undefined) {\n return {\n shouldBlockFn: () => true,\n withResolver: false,\n }\n }\n\n if ('shouldBlockFn' in opts) {\n return opts\n }\n\n if (typeof opts === 'function') {\n const shouldBlock = Boolean(condition ?? true)\n\n const _customBlockerFn = async () => {\n if (shouldBlock) return await opts()\n return false\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n enableBeforeUnload: shouldBlock,\n withResolver: false,\n }\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(opts.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && opts.blockerFn !== undefined) {\n return await opts.blockerFn()\n }\n return shouldBlock()\n }\n\n return {\n get shouldBlockFn() {\n return _customBlockerFn\n },\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return opts.blockerFn === undefined\n },\n }\n}\n\nexport function useBlocker<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = false,\n>(\n opts: UseBlockerOpts<TRouter, TWithResolver>,\n): TWithResolver extends true ? Solid.Accessor<BlockerResolver<TRouter>> : void\n\n/**\n * @deprecated Use the shouldBlockFn property instead\n */\nexport function useBlocker(\n blockerFnOrOpts?: LegacyBlockerOpts,\n): Solid.Accessor<BlockerResolver>\n\n/**\n * @deprecated Use the UseBlockerOpts object syntax instead\n */\nexport function useBlocker(\n blockerFn?: LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver>\n\nexport function useBlocker(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver> | void {\n const props = Solid.merge(\n {\n enableBeforeUnload: true,\n disabled: false,\n withResolver: false,\n },\n _resolveBlockerOpts(opts, condition),\n )\n\n const router = useRouter()\n\n const [resolver, setResolver] = Solid.createSignal<BlockerResolver>({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n let disposeBlock: (() => void) | undefined\n\n Solid.createEffect(\n () => props.disabled,\n (disabled) => {\n // Dispose previous blocker registration when re-running\n disposeBlock?.()\n disposeBlock = undefined\n\n if (disabled) {\n return\n }\n\n const blockerFnComposed = async (blockerFnArgs: BlockerFnArgs) => {\n function getLocation(\n location: HistoryLocation,\n ): AnyShouldBlockFnLocation {\n const parsedLocation = router.parseLocation(location)\n const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname)\n if (matchedRoutes.foundRoute === undefined) {\n return {\n routeId: '__notFound__',\n fullPath: parsedLocation.pathname,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n return {\n routeId: matchedRoutes.foundRoute.id,\n fullPath: matchedRoutes.foundRoute.fullPath,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n\n const current = getLocation(blockerFnArgs.currentLocation)\n const next = getLocation(blockerFnArgs.nextLocation)\n\n if (\n current.routeId === '__notFound__' &&\n next.routeId !== '__notFound__'\n ) {\n return false\n }\n\n const shouldBlock = await props.shouldBlockFn({\n action: blockerFnArgs.action,\n current,\n next,\n })\n if (!props.withResolver) {\n return shouldBlock\n }\n\n if (!shouldBlock) {\n return false\n }\n\n const promise = new Promise<boolean>((resolve) => {\n setResolver({\n status: 'blocked',\n current,\n next,\n action: blockerFnArgs.action,\n proceed: () => resolve(false),\n reset: () => resolve(true),\n })\n })\n\n const canNavigateAsync = await promise\n setResolver({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n return canNavigateAsync\n }\n\n disposeBlock = router.history.block({\n blockerFn: blockerFnComposed,\n enableBeforeUnload: props.enableBeforeUnload,\n })\n },\n )\n\n // Clean up on unmount\n Solid.onSettled(() => {\n return () => {\n disposeBlock?.()\n disposeBlock = undefined\n }\n })\n\n return resolver\n}\n\nconst _resolvePromptBlockerArgs = (\n props: PromptProps | LegacyPromptProps,\n): UseBlockerOpts => {\n if ('shouldBlockFn' in props) {\n return props\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(props.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && props.blockerFn !== undefined) {\n return await props.blockerFn()\n }\n return shouldBlock\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return props.blockerFn === undefined\n },\n }\n}\n\ninterface BlockComponent {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n >(\n opts: PromptProps<TRouter, TWithResolver>,\n ): SolidNode\n /**\n * @deprecated Use the UseBlockerOpts property instead\n */\n (opts: LegacyPromptProps): SolidNode\n}\n\nexport const Block: BlockComponent = function Block(\n opts: PromptProps | LegacyPromptProps,\n): SolidNode {\n const propsWithChildren = {\n get children() {\n return opts.children\n },\n }\n const args = _resolvePromptBlockerArgs(opts)\n\n const resolver = useBlocker(args)\n const children = Solid.createMemo(() => {\n const child = propsWithChildren.children\n if (resolver && typeof child === 'function') return child(resolver())\n return child\n })\n\n return <>{children()}</>\n}\n\ntype LegacyPromptProps = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n children?: SolidNode | ((params: BlockerResolver) => SolidNode)\n}\n\ntype PromptProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n TParams = TWithResolver extends true ? BlockerResolver<TRouter> : void,\n> = UseBlockerOpts<TRouter, TWithResolver> & {\n children?: SolidNode | ((params: TParams) => SolidNode)\n}\n"],"mappings":";;;;AAoFA,SAAS6C,oBACPC,MACAF,WACgB;CAChB,IAAIE,SAASC,KAAAA,GACX,OAAO;EACLX,qBAAqB;EACrBG,cAAc;CAChB;CAGF,IAAI,mBAAmBO,MACrB,OAAOA;CAGT,IAAI,OAAOA,SAAS,YAAY;EAC9B,MAAME,cAAcC,QAAQL,aAAa,IAAI;EAE7C,MAAMM,mBAAmB,YAAY;GACnC,IAAIF,aAAa,OAAO,MAAMF,KAAK;GACnC,OAAO;EACT;EAEA,OAAO;GACLV,eAAec;GACfb,oBAAoBW;GACpBT,cAAc;EAChB;CACF;CAEA,MAAMS,cAAchD,MAAMmD,iBAAiBF,QAAQH,KAAKF,aAAa,IAAI,CAAC;CAE1E,MAAMM,mBAAmB,YAAY;EACnC,IAAIF,YAAY,KAAKF,KAAKH,cAAcI,KAAAA,GACtC,OAAO,MAAMD,KAAKH,UAAU;EAE9B,OAAOK,YAAY;CACrB;CAEA,OAAO;EACL,IAAIZ,gBAAgB;GAClB,OAAOc;EACT;EACA,IAAIb,qBAAqB;GACvB,OAAOW,YAAY;EACrB;EACA,IAAIT,eAAe;GACjB,OAAOO,KAAKH,cAAcI,KAAAA;EAC5B;CACF;AACF;AAwBA,SAAgBK,WACdN,MACAF,WACwC;CACxC,MAAMW,QAAQvD,MAAMwD,MAClB;EACEnB,oBA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OA,MAAM/B,SAAS,CAAC;EACpE,OAAO+B;CACT,CAEUD,CAAQ;AACpB"}
{"version":3,"file":"useBlocker.js","names":["{children()}"],"sources":["../../src/useBlocker.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n BlockerFnArgs,\n HistoryAction,\n HistoryLocation,\n} from '@tanstack/history'\nimport type { SolidNode } from './route'\nimport type {\n AnyRoute,\n AnyRouter,\n ParseRoute,\n RegisteredRouter,\n} from '@tanstack/router-core'\n\ntype ShouldBlockFnLocation<\n out TRouteId,\n out TFullPath,\n out TAllParams,\n out TFullSearchSchema,\n> = {\n routeId: TRouteId\n fullPath: TFullPath\n pathname: string\n params: TAllParams\n search: TFullSearchSchema\n}\n\ntype AnyShouldBlockFnLocation = ShouldBlockFnLocation<any, any, any, any>\ntype MakeShouldBlockFnLocationUnion<\n TRouter extends AnyRouter = RegisteredRouter,\n TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>,\n> = TRoute extends any\n ? ShouldBlockFnLocation<\n TRoute['id'],\n TRoute['fullPath'],\n TRoute['types']['allParams'],\n TRoute['types']['fullSearchSchema']\n >\n : never\n\ntype BlockerResolver<TRouter extends AnyRouter = RegisteredRouter> =\n | {\n status: 'blocked'\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n proceed: () => void\n reset: () => void\n }\n | {\n status: 'idle'\n current: undefined\n next: undefined\n action: undefined\n proceed: undefined\n reset: undefined\n }\n\ntype ShouldBlockFnArgs<TRouter extends AnyRouter = RegisteredRouter> = {\n current: MakeShouldBlockFnLocationUnion<TRouter>\n next: MakeShouldBlockFnLocationUnion<TRouter>\n action: HistoryAction\n}\n\nexport type ShouldBlockFn<TRouter extends AnyRouter = RegisteredRouter> = (\n args: ShouldBlockFnArgs<TRouter>,\n) => boolean | Promise<boolean>\nexport type UseBlockerOpts<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n> = {\n shouldBlockFn: ShouldBlockFn<TRouter>\n enableBeforeUnload?: boolean | (() => boolean)\n disabled?: boolean\n withResolver?: TWithResolver\n}\n\ntype LegacyBlockerFn = () => Promise<any> | any\ntype LegacyBlockerOpts = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n}\n\nfunction _resolveBlockerOpts(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): UseBlockerOpts {\n if (opts === undefined) {\n return {\n shouldBlockFn: () => true,\n withResolver: false,\n }\n }\n\n if ('shouldBlockFn' in opts) {\n return opts\n }\n\n if (typeof opts === 'function') {\n const shouldBlock = Boolean(condition ?? true)\n\n const _customBlockerFn = async () => {\n if (shouldBlock) return await opts()\n return false\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n enableBeforeUnload: shouldBlock,\n withResolver: false,\n }\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(opts.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && opts.blockerFn !== undefined) {\n return await opts.blockerFn()\n }\n return shouldBlock()\n }\n\n return {\n get shouldBlockFn() {\n return _customBlockerFn\n },\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return opts.blockerFn === undefined\n },\n }\n}\n\nexport function useBlocker<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = false,\n>(\n opts: UseBlockerOpts<TRouter, TWithResolver>,\n): TWithResolver extends true ? Solid.Accessor<BlockerResolver<TRouter>> : void\n\n/**\n * @deprecated Use the shouldBlockFn property instead\n */\nexport function useBlocker(\n blockerFnOrOpts?: LegacyBlockerOpts,\n): Solid.Accessor<BlockerResolver>\n\n/**\n * @deprecated Use the UseBlockerOpts object syntax instead\n */\nexport function useBlocker(\n blockerFn?: LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver>\n\nexport function useBlocker(\n opts?: UseBlockerOpts | LegacyBlockerOpts | LegacyBlockerFn,\n condition?: boolean | any,\n): Solid.Accessor<BlockerResolver> | void {\n const props = Solid.merge(\n {\n enableBeforeUnload: true,\n disabled: false,\n withResolver: false,\n },\n _resolveBlockerOpts(opts, condition),\n )\n\n const router = useRouter()\n\n const [resolver, setResolver] = Solid.createSignal<BlockerResolver>({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n let disposeBlock: (() => void) | undefined\n\n Solid.createEffect(\n () => props.disabled,\n (disabled) => {\n // Dispose previous blocker registration when re-running\n disposeBlock?.()\n disposeBlock = undefined\n\n if (disabled) {\n return\n }\n\n const blockerFnComposed = async (blockerFnArgs: BlockerFnArgs) => {\n function getLocation(\n location: HistoryLocation,\n ): AnyShouldBlockFnLocation {\n const parsedLocation = router.parseLocation(location)\n const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname)\n if (matchedRoutes.foundRoute === undefined) {\n return {\n routeId: '__notFound__',\n fullPath: parsedLocation.pathname,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n return {\n routeId: matchedRoutes.foundRoute.id,\n fullPath: matchedRoutes.foundRoute.fullPath,\n pathname: parsedLocation.pathname,\n params: matchedRoutes.routeParams,\n search: parsedLocation.search,\n }\n }\n\n const current = getLocation(blockerFnArgs.currentLocation)\n const next = getLocation(blockerFnArgs.nextLocation)\n\n if (\n current.routeId === '__notFound__' &&\n next.routeId !== '__notFound__'\n ) {\n return false\n }\n\n const shouldBlock = await props.shouldBlockFn({\n action: blockerFnArgs.action,\n current,\n next,\n })\n if (!props.withResolver) {\n return shouldBlock\n }\n\n if (!shouldBlock) {\n return false\n }\n\n const promise = new Promise<boolean>((resolve) => {\n setResolver({\n status: 'blocked',\n current,\n next,\n action: blockerFnArgs.action,\n proceed: () => resolve(false),\n reset: () => resolve(true),\n })\n })\n\n const canNavigateAsync = await promise\n setResolver({\n status: 'idle',\n current: undefined,\n next: undefined,\n action: undefined,\n proceed: undefined,\n reset: undefined,\n })\n\n return canNavigateAsync\n }\n\n disposeBlock = router.history.block({\n blockerFn: blockerFnComposed,\n enableBeforeUnload: props.enableBeforeUnload,\n })\n },\n )\n\n // Clean up on unmount\n Solid.onSettled(() => {\n return () => {\n disposeBlock?.()\n disposeBlock = undefined\n }\n })\n\n return resolver\n}\n\nconst _resolvePromptBlockerArgs = (\n props: PromptProps | LegacyPromptProps,\n): UseBlockerOpts => {\n if ('shouldBlockFn' in props) {\n return props\n }\n\n const shouldBlock = Solid.createMemo(() => Boolean(props.condition ?? true))\n\n const _customBlockerFn = async () => {\n if (shouldBlock() && props.blockerFn !== undefined) {\n return await props.blockerFn()\n }\n return shouldBlock\n }\n\n return {\n shouldBlockFn: _customBlockerFn,\n get enableBeforeUnload() {\n return shouldBlock()\n },\n get withResolver() {\n return props.blockerFn === undefined\n },\n }\n}\n\ninterface BlockComponent {\n <\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n >(\n opts: PromptProps<TRouter, TWithResolver>,\n ): SolidNode\n /**\n * @deprecated Use the UseBlockerOpts property instead\n */\n (opts: LegacyPromptProps): SolidNode\n}\n\nexport const Block: BlockComponent = function Block(\n opts: PromptProps | LegacyPromptProps,\n): SolidNode {\n const propsWithChildren = {\n get children() {\n return opts.children\n },\n }\n const args = _resolvePromptBlockerArgs(opts)\n\n const resolver = useBlocker(args)\n const children = Solid.createMemo(() => {\n const child = propsWithChildren.children\n if (resolver && typeof child === 'function') return child(resolver())\n return child\n })\n\n return <>{children()}</>\n}\n\ntype LegacyPromptProps = {\n blockerFn?: LegacyBlockerFn\n condition?: boolean | any\n children?: SolidNode | ((params: BlockerResolver) => SolidNode)\n}\n\ntype PromptProps<\n TRouter extends AnyRouter = RegisteredRouter,\n TWithResolver extends boolean = boolean,\n TParams = TWithResolver extends true ? BlockerResolver<TRouter> : void,\n> = UseBlockerOpts<TRouter, TWithResolver> & {\n children?: SolidNode | ((params: TParams) =>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EAET,IAAI,eAAe;GACjB,OAAO,MAAM,cAAc,KAAA;;;;AAkBjC,IAAa,QAAwB,SAAS,MAC5C,MACW;CACX,MAAM,oBAAoB,EACxB,IAAI,WAAW;EACb,OAAO,KAAK;;CAKhB,MAAM,WAAW,WAFJ,0BAA0B,IAEX,CAAA;CAO5B,OAASA,KANQ,MAAM,iBAAiB;EACtC,MAAM,QAAQ,kBAAkB;EAChC,IAAI,YAAY,OAAO,UAAU,YAAY,OAAO,MAAM,SAAA,CAAU;EACpE,OAAO;EAGC,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useLoaderData.js","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseLoaderData","StrictOrFrom","UseLoaderDataResult","UseLoaderDataBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","UseLoaderDataOptions","UseLoaderDataRoute","opts","TId","useLoaderData","from","strict","loaderData"],"sources":["../../src/useLoaderData.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderData,\n StrictOrFrom,\n UseLoaderDataResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDataBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> {\n select?: (match: ResolveUseLoaderData<TRouter, TFrom, TStrict>) => TSelected\n}\n\nexport type UseLoaderDataOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseLoaderDataBaseOptions<TRouter, TFrom, TStrict, TSelected>\n\nexport type UseLoaderDataRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDataBaseOptions<TRouter, TId, true, TSelected>,\n) => Accessor<UseLoaderDataResult<TRouter, TId, true, TSelected>>\n\nexport function useLoaderData<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseLoaderDataOptions<TRouter, TFrom, TStrict, TSelected>,\n): Accessor<UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected>> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n select: (match) => {\n return opts.select ? opts.select(match.loaderData) : match.loaderData\n },\n }) as any\n}\n"],"mappings":";;AAkCA,SAAgBkB,cAMdF,MACmE;CACnE,OAAOhB,SAAS;EACdmB,MAAMH,KAAKG;EACXC,QAAQJ,KAAKI;EACbZ,SAASC,UAAU;GACjB,OAAOO,KAAKR,SAASQ,KAAKR,OAAOC,MAAMY,UAAU,IAAIZ,MAAMY;EAC7D;CACF,CAAC;AACH"}
{"version":3,"file":"useLoaderData.js","names":[],"sources":["../../src/useLoaderData.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderData,\n StrictOrFrom,\n UseLoaderDataResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDataBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> {\n select?: (match: ResolveUseLoaderData<TRouter, TFrom, TStrict>) => TSelected\n}\n\nexport type UseLoaderDataOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseLoaderDataBaseOptions<TRouter, TFrom, TStrict, TSelected>\n\nexport type UseLoaderDataRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDataBaseOptions<TRouter, TId, true, TSelected>,\n) => Accessor<UseLoaderDataResult<TRouter, TId, true, TSelected>>\n\nexport function useLoaderData<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseLoaderDataOptions<TRouter, TFrom, TStrict, TSelected>,\n): Accessor<UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected>> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n select: (match) => {\n return opts.select ? opts.select(match.loaderData) : match.loaderData\n },\n }) as any\n}\n"],"mappings":";;AAkCA,SAAgB,cAMd,MACmE;CACnE,OAAO,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,SAAS,UAAU;GACjB,OAAO,KAAK,SAAS,KAAK,OAAO,MAAM,UAAA,IAAc,MAAM;;EAE9D"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useLoaderDeps.js","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseLoaderDeps","StrictOrFrom","UseLoaderDepsResult","UseLoaderDepsBaseOptions","select","deps","TRouter","TFrom","TSelected","UseLoaderDepsOptions","UseLoaderDepsRoute","opts","TId","useLoaderDeps","match","loaderDeps"],"sources":["../../src/useLoaderDeps.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderDeps,\n StrictOrFrom,\n UseLoaderDepsResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDepsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TSelected,\n> {\n select?: (deps: ResolveUseLoaderDeps<TRouter, TFrom>) => TSelected\n}\n\nexport type UseLoaderDepsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom> &\n UseLoaderDepsBaseOptions<TRouter, TFrom, TSelected>\n\nexport type UseLoaderDepsRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDepsBaseOptions<TRouter, TId, TSelected>,\n) => Accessor<UseLoaderDepsResult<TRouter, TId, TSelected>>\n\nexport function useLoaderDeps<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TSelected = unknown,\n>(\n opts: UseLoaderDepsOptions<TRouter, TFrom, TSelected>,\n): Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>> {\n return useMatch({\n ...opts,\n select: (match) => {\n return opts.select ? opts.select(match.loaderDeps) : match.loaderDeps\n },\n }) as Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>>\n}\n"],"mappings":";;AAgCA,SAAgBiB,cAKdF,MAC0D;CAC1D,OAAOf,SAAS;EACd,GAAGe;EACHP,SAASU,UAAU;GACjB,OAAOH,KAAKP,SAASO,KAAKP,OAAOU,MAAMC,UAAU,IAAID,MAAMC;EAC7D;CACF,CAAC;AACH"}
{"version":3,"file":"useLoaderDeps.js","names":[],"sources":["../../src/useLoaderDeps.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseLoaderDeps,\n StrictOrFrom,\n UseLoaderDepsResult,\n} from '@tanstack/router-core'\n\nexport interface UseLoaderDepsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TSelected,\n> {\n select?: (deps: ResolveUseLoaderDeps<TRouter, TFrom>) => TSelected\n}\n\nexport type UseLoaderDepsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom> &\n UseLoaderDepsBaseOptions<TRouter, TFrom, TSelected>\n\nexport type UseLoaderDepsRoute<out TId> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLoaderDepsBaseOptions<TRouter, TId, TSelected>,\n) => Accessor<UseLoaderDepsResult<TRouter, TId, TSelected>>\n\nexport function useLoaderDeps<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TSelected = unknown,\n>(\n opts: UseLoaderDepsOptions<TRouter, TFrom, TSelected>,\n): Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>> {\n return useMatch({\n ...opts,\n select: (match) => {\n return opts.select ? opts.select(match.loaderDeps) : match.loaderDeps\n },\n }) as Accessor<UseLoaderDepsResult<TRouter, TFrom, TSelected>>\n}\n"],"mappings":";;AAgCA,SAAgB,cAKd,MAC0D;CAC1D,OAAO,SAAS;EACd,GAAG;EACH,SAAS,UAAU;GACjB,OAAO,KAAK,SAAS,KAAK,OAAO,MAAM,UAAA,IAAc,MAAM;;EAE9D"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useLocation.js","names":["Solid","replaceEqualDeep","useRouter","AnyRouter","RegisteredRouter","RouterState","Accessor","UseLocationBaseOptions","select","state","TRouter","TSelected","UseLocationResult","useLocation","opts","router","stores","location","get","createMemo","prev","res","undefined"],"sources":["../../src/useLocation.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport interface UseLocationBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (state: RouterState<TRouter['routeTree']>['location']) => TSelected\n}\n\nexport type UseLocationResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected\n ? RouterState<TRouter['routeTree']>['location']\n : TSelected\n\nexport function useLocation<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLocationBaseOptions<TRouter, TSelected>,\n): Accessor<UseLocationResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n\n if (!opts?.select) {\n return (() => router.stores.location.get()) as Accessor<\n UseLocationResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const res = select(router.stores.location.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n }) as Accessor<UseLocationResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;AAqBA,SAAgBa,YAIdC,MACiD;CACjD,MAAMC,SAASb,UAAmB;CAElC,IAAI,CAACY,MAAMN,QACT,cAAcO,OAAOC,OAAOC,SAASC,IAAI;CAK3C,MAAMV,SAASM,KAAKN;CAEpB,OAAOR,MAAMmB,YAAYC,SAAgC;EACvD,MAAMC,MAAMb,OAAOO,OAAOC,OAAOC,SAASC,IAAI,CAAC;EAC/C,IAAIE,SAASE,KAAAA,GAAW,OAAOD;EAC/B,OAAOpB,iBAAiBmB,MAAMC,GAAG;CACnC,CAAC;AACH"}
{"version":3,"file":"useLocation.js","names":[],"sources":["../../src/useLocation.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport interface UseLocationBaseOptions<TRouter extends AnyRouter, TSelected> {\n select?: (state: RouterState<TRouter['routeTree']>['location']) => TSelected\n}\n\nexport type UseLocationResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected\n ? RouterState<TRouter['routeTree']>['location']\n : TSelected\n\nexport function useLocation<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseLocationBaseOptions<TRouter, TSelected>,\n): Accessor<UseLocationResult<TRouter, TSelected>> {\n const router = useRouter<TRouter>()\n\n if (!opts?.select) {\n return (() => router.stores.location.get()) as Accessor<\n UseLocationResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const res = select(router.stores.location.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n }) as Accessor<UseLocationResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;AAqBA,SAAgB,YAId,MACiD;CACjD,MAAM,SAAS,UAAU;CAEzB,IAAI,CAAC,MAAM,QACT,cAAc,OAAO,OAAO,SAAS,IAAA;CAKvC,MAAM,SAAS,KAAK;CAEpB,OAAO,MAAM,YAAY,SAAgC;EACvD,MAAM,MAAM,OAAO,OAAO,OAAO,SAAS,IAAA,CAAK;EAC/C,IAAI,SAAS,KAAA,GAAW,OAAO;EAC/B,OAAO,iBAAiB,MAAM,GAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useMatch.js","names":["Solid","invariant","replaceEqualDeep","nearestMatchContext","useRouter","AnyRouter","MakeRouteMatch","MakeRouteMatchUnion","RegisteredRouter","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseMatchBaseOptions","select","match","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseMatchRoute","opts","Accessor","UseMatchResult","UseMatchOptions","useMatch","router","nearestMatch","from","undefined","useContext","stores","matches","get","find","routeId","createMemo","prev","selectedMatch","hasPendingMatch","Boolean","pendingRouteIds","hasPending","isTransitioning","process","env","NODE_ENV","Error","res"],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.matches\n .get()\n .find((match) => match.routeId === opts.from)\n }\n\n return nearestMatch?.match()\n }\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) {\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n prev !== undefined &&\n (hasPendingMatch || router.stores.isTransitioning.get())\n ) {\n return prev\n }\n\n if (!hasPendingMatch && (opts.shouldThrow ?? true)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n\n return undefined\n }\n\n const res = opts.select ? opts.select(selectedMatch) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;AAsDA,SAAgB0B,SAOdJ,MASA;CACA,MAAMK,SAASvB,UAAmB;CAClC,MAAMwB,eAAeN,KAAKO,OACtBC,KAAAA,IACA9B,MAAM+B,WAAW5B,mBAAmB;CAExC,MAAMW,cAAc;EAClB,IAAIQ,KAAKO,MACP,OAAOF,OAAOK,OAAOC,QAClBC,IAAI,EACJC,MAAMrB,UAAUA,MAAMsB,YAAYd,KAAKO,IAAI;EAGhD,OAAOD,cAAcd,MAAM;CAC7B;CAEA,OAAOd,MAAMqC,YAAYC,SAAgC;EACvD,MAAMC,gBAAgBzB,MAAM;EAE5B,IAAIyB,kBAAkBT,KAAAA,GAAW;GAC/B,MAAMU,kBAAkBlB,KAAKO,OACzBY,QAAQd,OAAOK,OAAOU,gBAAgBR,IAAI,EAAEZ,KAAKO,KAAM,IACtDD,cAAce,WAAW,KAAK;GAEnC,IACEL,SAASR,KAAAA,MACRU,mBAAmBb,OAAOK,OAAOY,gBAAgBV,IAAI,IAEtD,OAAOI;GAGT,IAAI,CAACE,oBAAoBlB,KAAKH,eAAe,OAAO;IAClD,IAAA,QAAA,IAAA,aAA6B,cAC3B,MAAM,IAAI6B,MACR,oCAAoC1B,KAAKO,OAAO,yBAAyBP,KAAKO,KAAI,KAAM,oBAC1F;IAGF5B,UAAU;GACZ;GAEA;EACF;EAEA,MAAMgD,MAAM3B,KAAKT,SAASS,KAAKT,OAAO0B,aAAa,IAAIA;EACvD,IAAID,SAASR,KAAAA,GAAW,OAAOmB;EAC/B,OAAO/C,iBAAiBoC,MAAMW,GAAG;CACnC,CAAC;AACH"}
{"version":3,"file":"useMatch.js","names":[],"sources":["../../src/useMatch.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { invariant, replaceEqualDeep } from '@tanstack/router-core'\nimport { nearestMatchContext } from './matchContext'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n MakeRouteMatch,\n MakeRouteMatchUnion,\n RegisteredRouter,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n} from '@tanstack/router-core'\n\nexport interface UseMatchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (\n match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>,\n ) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseMatchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseMatchBaseOptions<TRouter, TFrom, true, true, TSelected>,\n) => Solid.Accessor<UseMatchResult<TRouter, TFrom, true, TSelected>>\n\nexport type UseMatchOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseMatchResult<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TSelected,\n> = unknown extends TSelected\n ? TStrict extends true\n ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>\n : MakeRouteMatchUnion<TRouter>\n : TSelected\n\nexport function useMatch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseMatchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Solid.Accessor<\n ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n const router = useRouter<TRouter>()\n const nearestMatch = opts.from\n ? undefined\n : Solid.useContext(nearestMatchContext)\n\n const match = () => {\n if (opts.from) {\n return router.stores.matches\n .get()\n .find((match) => match.routeId === opts.from)\n }\n\n return nearestMatch?.match()\n }\n\n return Solid.createMemo((prev: TSelected | undefined) => {\n const selectedMatch = match()\n\n if (selectedMatch === undefined) {\n const hasPendingMatch = opts.from\n ? Boolean(router.stores.pendingRouteIds.get()[opts.from!])\n : (nearestMatch?.hasPending() ?? false)\n\n if (\n prev !== undefined &&\n (hasPendingMatch || router.stores.isTransitioning.get())\n ) {\n return prev\n }\n\n if (!hasPendingMatch && (opts.shouldThrow ?? true)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `Invariant failed: Could not find ${opts.from ? `an active match from \"${opts.from}\"` : 'a nearest match!'}`,\n )\n }\n\n invariant()\n }\n\n return undefined\n }\n\n const res = opts.select ? opts.select(selectedMatch) : selectedMatch\n if (prev === undefined) return res as TSelected\n return replaceEqualDeep(prev, res) as TSelected\n }) as any\n}\n"],"mappings":";;;;;AAsDA,SAAgB,SAOd,MASA;CACA,MAAM,SAAS,UAAU;CACzB,MAAM,eAAe,KAAK,OACtB,KAAA,IACA,MAAM,WAAW,mBAAA;CAErB,MAAM,cAAc;EAClB,IAAI,KAAK,MACP,OAAO,OAAO,OAAO,QAClB,IAAA,EACA,MAAM,UAAU,MAAM,YAAY,KAAK,IAAA;EAG5C,OAAO,cAAc,MAAA;;CAGvB,OAAO,MAAM,YAAY,SAAgC;EACvD,MAAM,gBAAgB,MAAA;EAEtB,IAAI,kBAAkB,KAAA,GAAW;GAC/B,MAAM,kBAAkB,KAAK,OACzB,QAAQ,OAAO,OAAO,gBAAgB,IAAA,EAAM,KAAK,KAAA,IAChD,cAAc,WAAA,KAAgB;GAEnC,IACE,SAAS,KAAA,MACR,mBAAmB,OAAO,OAAO,gBAAgB,IAAA,IAElD,OAAO;GAGT,IAAI,CAAC,oBAAoB,KAAK,eAAe,OAAO;IAClD,IAAA,QAAA,IAAA,aAA6B,cAC3B,MAAM,IAAI,MACR,oCAAoC,KAAK,OAAO,yBAAyB,KAAK,KAAK,KAAK,oBAAA;IAI5F,UAAA;;GAGF;;EAGF,MAAM,MAAM,KAAK,SAAS,KAAK,OAAO,aAAA,IAAiB;EACvD,IAAI,SAAS,KAAA,GAAW,OAAO;EAC/B,OAAO,iBAAiB,MAAM,GAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useNavigate.js","names":["Solid","useRouter","AnyRouter","FromPathOption","NavigateOptions","RegisteredRouter","UseNavigateResult","useNavigate","_defaultOpts","from","TRouter","TDefaultFrom","router","options","navigate","Navigate","TFrom","props","TTo","TMaskFrom","TMaskTo","onSettled"],"sources":["../../src/useNavigate.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n FromPathOption,\n NavigateOptions,\n RegisteredRouter,\n UseNavigateResult,\n} from '@tanstack/router-core'\n\nexport function useNavigate<\n TRouter extends AnyRouter = RegisteredRouter,\n TDefaultFrom extends string = string,\n>(_defaultOpts?: {\n from?: FromPathOption<TRouter, TDefaultFrom>\n}): UseNavigateResult<TDefaultFrom> {\n const router = useRouter()\n\n return ((options: NavigateOptions) => {\n return router.navigate({\n ...options,\n from: options.from ?? _defaultOpts?.from,\n })\n }) as UseNavigateResult<TDefaultFrom>\n}\n\nexport function Navigate<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): null {\n const { navigate } = useRouter()\n\n Solid.onSettled(() => {\n navigate({\n ...props,\n })\n })\n\n return null\n}\n"],"mappings":";;;AAUA,SAAgBO,YAGdC,cAEkC;CAClC,MAAMI,SAASX,UAAU;CAEzB,SAASY,YAA6B;EACpC,OAAOD,OAAOE,SAAS;GACrB,GAAGD;GACHJ,MAAMI,QAAQJ,QAAQD,cAAcC;EACtC,CAAC;CACH;AACF;AAEA,SAAgBM,SAMdE,OAAuE;CACvE,MAAM,EAAEH,aAAab,UAAU;CAE/BD,MAAMqB,gBAAgB;EACpBP,SAAS,EACP,GAAGG,MACL,CAAC;CACH,CAAC;CAED,OAAO;AACT"}
{"version":3,"file":"useNavigate.js","names":[],"sources":["../../src/useNavigate.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n FromPathOption,\n NavigateOptions,\n RegisteredRouter,\n UseNavigateResult,\n} from '@tanstack/router-core'\n\nexport function useNavigate<\n TRouter extends AnyRouter = RegisteredRouter,\n TDefaultFrom extends string = string,\n>(_defaultOpts?: {\n from?: FromPathOption<TRouter, TDefaultFrom>\n}): UseNavigateResult<TDefaultFrom> {\n const router = useRouter()\n\n return ((options: NavigateOptions) => {\n return router.navigate({\n ...options,\n from: options.from ?? _defaultOpts?.from,\n })\n }) as UseNavigateResult<TDefaultFrom>\n}\n\nexport function Navigate<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string = string,\n const TTo extends string | undefined = undefined,\n const TMaskFrom extends string = TFrom,\n const TMaskTo extends string = '',\n>(props: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>): null {\n const { navigate } = useRouter()\n\n Solid.onSettled(() => {\n navigate({\n ...props,\n })\n })\n\n return null\n}\n"],"mappings":";;;AAUA,SAAgB,YAGd,cAEkC;CAClC,MAAM,SAAS,UAAA;CAEf,SAAS,YAA6B;EACpC,OAAO,OAAO,SAAS;GACrB,GAAG;GACH,MAAM,QAAQ,QAAQ,cAAc;GACrC;;;AAIL,SAAgB,SAMd,OAAuE;CACvE,MAAM,EAAE,aAAa,UAAA;CAErB,MAAM,gBAAgB;EACpB,SAAS,EACP,GAAG,MAAA,CACJ;;CAGH,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useParams.js","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseParams","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseParamsResult","UseParamsBaseOptions","select","params","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseParamsOptions","UseParamsRoute","opts","useParams","from","strict","match","_strictParams"],"sources":["../../src/useParams.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseParams,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (params: ResolveUseParams<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseParamsBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseParamsRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseParamsBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseParamsResult<TRouter, TFrom, true, TSelected>>\n\nexport function useParams<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseParamsOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseParamsResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const params = opts.strict === false ? match.params : match._strictParams\n return opts.select ? opts.select(params) : params\n },\n }) as Accessor<any>\n}\n"],"mappings":";;AA6CA,SAAgBqB,UAOdD,MASA;CACA,OAAOpB,SAAS;EACdsB,MAAMF,KAAKE;EACXC,QAAQH,KAAKG;EACbP,aAAaI,KAAKJ;EAClBN,SAASc,UAAU;GACjB,MAAMb,SAASS,KAAKG,WAAW,QAAQC,MAAMb,SAASa,MAAMC;GAC5D,OAAOL,KAAKV,SAASU,KAAKV,OAAOC,MAAM,IAAIA;EAC7C;CACF,CAAC;AACH"}
{"version":3,"file":"useParams.js","names":[],"sources":["../../src/useParams.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseParams,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseParamsResult,\n} from '@tanstack/router-core'\n\nexport interface UseParamsBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (params: ResolveUseParams<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseParamsOptions<\n TRouter extends AnyRouter,\n TFrom extends string | undefined,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseParamsBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseParamsRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseParamsBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseParamsResult<TRouter, TFrom, true, TSelected>>\n\nexport function useParams<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseParamsOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseParamsResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const params = opts.strict === false ? match.params : match._strictParams\n return opts.select ? opts.select(params) : params\n },\n }) as Accessor<any>\n}\n"],"mappings":";;AA6CA,SAAgB,UAOd,MASA;CACA,OAAO,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,aAAa,KAAK;EAClB,SAAS,UAAU;GACjB,MAAM,SAAS,KAAK,WAAW,QAAQ,MAAM,SAAS,MAAM;GAC5D,OAAO,KAAK,SAAS,KAAK,OAAO,MAAA,IAAU;;EAE9C"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useRouter.js","names":["Solid","routerContext","AnyRouter","RegisteredRouter","useRouter","opts","warn","TRouter","value","useContext","process","env","NODE_ENV","console"],"sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = Solid.useContext(routerContext)\n if (process.env.NODE_ENV !== 'production') {\n if ((opts?.warn ?? true) && !value) {\n console.warn(\n 'Warning: useRouter must be used inside a <RouterProvider> component!',\n )\n }\n }\n return value as TRouter\n}\n"],"mappings":";;;AAIA,SAAgBI,UAAwDC,MAE5D;CACV,MAAMG,QAAQR,MAAMS,WAAWR,aAAa;CAC5C,IAAA,QAAA,IAAA,aAA6B;OACtBI,MAAMC,QAAQ,SAAS,CAACE,OAC3BK,QAAQP,KACN,sEACF;CAAA;CAGJ,OAAOE;AACT"}
{"version":3,"file":"useRouter.js","names":[],"sources":["../../src/useRouter.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { routerContext } from './routerContext'\nimport type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'\n\nexport function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {\n warn?: boolean\n}): TRouter {\n const value = Solid.useContext(routerContext)\n if (process.env.NODE_ENV !== 'production') {\n if ((opts?.warn ?? true) && !value) {\n console.warn(\n 'Warning: useRouter must be used inside a <RouterProvider> component!',\n )\n }\n }\n return value as TRouter\n}\n"],"mappings":";;;AAIA,SAAgB,UAAwD,MAE5D;CACV,MAAM,QAAQ,MAAM,WAAW,aAAA;CAC/B,IAAA,QAAA,IAAA,aAA6B;OACtB,MAAM,QAAQ,SAAS,CAAC,OAC3B,QAAQ,KACN,sEAAA;CAAA;CAIN,OAAO"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useRouterState.js","names":["Solid","replaceEqualDeep","useRouter","AnyRouter","RegisteredRouter","RouterState","Accessor","UseRouterStateOptions","router","TRouter","select","state","TSelected","UseRouterStateResult","useRouterState","opts","contextRouter","warn","undefined","stores","__store","get","createMemo","prev","res","transparent","MemoOptions","ssrSource"],"sources":["../../src/useRouterState.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport type UseRouterStateOptions<TRouter extends AnyRouter, TSelected> = {\n router?: TRouter\n select?: (state: RouterState<TRouter['routeTree']>) => TSelected\n}\n\nexport type UseRouterStateResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\nexport function useRouterState<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseRouterStateOptions<TRouter, TSelected>,\n): Accessor<UseRouterStateResult<TRouter, TSelected>> {\n const contextRouter = useRouter<TRouter>({\n warn: opts?.router === undefined,\n })\n const router = opts?.router || contextRouter\n\n if (!opts?.select) {\n return (() => router.stores.__store.get()) as Accessor<\n UseRouterStateResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo(\n (prev: TSelected | undefined) => {\n const res = select(router.stores.__store.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n },\n { transparent: true } as Solid.MemoOptions<TSelected> & {\n ssrSource?: 'server' | 'hybrid'\n },\n ) as Accessor<UseRouterStateResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;AAoBA,SAAgBc,eAIdC,MACoD;CACpD,MAAMC,gBAAgBd,UAAmB,EACvCe,MAAMF,MAAMP,WAAWU,KAAAA,EACzB,CAAC;CACD,MAAMV,SAASO,MAAMP,UAAUQ;CAE/B,IAAI,CAACD,MAAML,QACT,cAAcF,OAAOW,OAAOC,QAAQC,IAAI;CAK1C,MAAMX,SAASK,KAAKL;CAEpB,OAAOV,MAAMsB,YACVC,SAAgC;EAC/B,MAAMC,MAAMd,OAAOF,OAAOW,OAAOC,QAAQC,IAAI,CAAC;EAC9C,IAAIE,SAASL,KAAAA,GAAW,OAAOM;EAC/B,OAAOvB,iBAAiBsB,MAAMC,GAAG;CACnC,GACA,EAAEC,aAAa,KAAK,CAGtB;AACF"}
{"version":3,"file":"useRouterState.js","names":[],"sources":["../../src/useRouterState.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport { replaceEqualDeep } from '@tanstack/router-core'\nimport { useRouter } from './useRouter'\nimport type {\n AnyRouter,\n RegisteredRouter,\n RouterState,\n} from '@tanstack/router-core'\nimport type { Accessor } from 'solid-js'\n\nexport type UseRouterStateOptions<TRouter extends AnyRouter, TSelected> = {\n router?: TRouter\n select?: (state: RouterState<TRouter['routeTree']>) => TSelected\n}\n\nexport type UseRouterStateResult<\n TRouter extends AnyRouter,\n TSelected,\n> = unknown extends TSelected ? RouterState<TRouter['routeTree']> : TSelected\n\nexport function useRouterState<\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseRouterStateOptions<TRouter, TSelected>,\n): Accessor<UseRouterStateResult<TRouter, TSelected>> {\n const contextRouter = useRouter<TRouter>({\n warn: opts?.router === undefined,\n })\n const router = opts?.router || contextRouter\n\n if (!opts?.select) {\n return (() => router.stores.__store.get()) as Accessor<\n UseRouterStateResult<TRouter, TSelected>\n >\n }\n\n const select = opts.select\n\n return Solid.createMemo(\n (prev: TSelected | undefined) => {\n const res = select(router.stores.__store.get())\n if (prev === undefined) return res\n return replaceEqualDeep(prev, res)\n },\n { transparent: true } as Solid.MemoOptions<TSelected> & {\n ssrSource?: 'server' | 'hybrid'\n },\n ) as Accessor<UseRouterStateResult<TRouter, TSelected>>\n}\n"],"mappings":";;;;AAoBA,SAAgB,eAId,MACoD;CACpD,MAAM,gBAAgB,UAAmB,EACvC,MAAM,MAAM,WAAW,KAAA,EAAA,CACxB;CACD,MAAM,SAAS,MAAM,UAAU;CAE/B,IAAI,CAAC,MAAM,QACT,cAAc,OAAO,OAAO,QAAQ,IAAA;CAKtC,MAAM,SAAS,KAAK;CAEpB,OAAO,MAAM,YACV,SAAgC;EAC/B,MAAM,MAAM,OAAO,OAAO,OAAO,QAAQ,IAAA,CAAK;EAC9C,IAAI,SAAS,KAAA,GAAW,OAAO;EAC/B,OAAO,iBAAiB,MAAM,GAAA;IAEhC,EAAE,aAAa,KAAA,CAAA"}

@@ -1,1 +0,1 @@

{"version":3,"file":"useSearch.js","names":["useMatch","Accessor","AnyRouter","RegisteredRouter","ResolveUseSearch","StrictOrFrom","ThrowConstraint","ThrowOrOptional","UseSearchResult","UseSearchBaseOptions","select","state","TRouter","TFrom","TStrict","TSelected","shouldThrow","TThrow","UseSearchOptions","UseSearchRoute","opts","useSearch","from","strict","match","search"],"sources":["../../src/useSearch.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseSearch,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (state: ResolveUseSearch<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseSearchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseSearchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseSearchBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseSearchResult<TRouter, TFrom, true, TSelected>>\n\nexport function useSearch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseSearchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseSearchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const search = match.search\n return opts.select ? opts.select(search) : search\n },\n }) as any\n}\n"],"mappings":";;AA6CA,SAAgBqB,UAOdD,MASA;CACA,OAAOpB,SAAS;EACdsB,MAAMF,KAAKE;EACXC,QAAQH,KAAKG;EACbP,aAAaI,KAAKJ;EAClBN,SAASc,UAAU;GACjB,MAAMC,SAASD,MAAMC;GACrB,OAAOL,KAAKV,SAASU,KAAKV,OAAOe,MAAM,IAAIA;EAC7C;CACF,CAAC;AACH"}
{"version":3,"file":"useSearch.js","names":[],"sources":["../../src/useSearch.tsx"],"sourcesContent":["import { useMatch } from './useMatch'\nimport type { Accessor } from 'solid-js'\nimport type {\n AnyRouter,\n RegisteredRouter,\n ResolveUseSearch,\n StrictOrFrom,\n ThrowConstraint,\n ThrowOrOptional,\n UseSearchResult,\n} from '@tanstack/router-core'\n\nexport interface UseSearchBaseOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> {\n select?: (state: ResolveUseSearch<TRouter, TFrom, TStrict>) => TSelected\n shouldThrow?: TThrow\n}\n\nexport type UseSearchOptions<\n TRouter extends AnyRouter,\n TFrom,\n TStrict extends boolean,\n TThrow extends boolean,\n TSelected,\n> = StrictOrFrom<TRouter, TFrom, TStrict> &\n UseSearchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected>\n\nexport type UseSearchRoute<out TFrom> = <\n TRouter extends AnyRouter = RegisteredRouter,\n TSelected = unknown,\n>(\n opts?: UseSearchBaseOptions<\n TRouter,\n TFrom,\n /* TStrict */ true,\n /* TThrow */ true,\n TSelected\n >,\n) => Accessor<UseSearchResult<TRouter, TFrom, true, TSelected>>\n\nexport function useSearch<\n TRouter extends AnyRouter = RegisteredRouter,\n const TFrom extends string | undefined = undefined,\n TStrict extends boolean = true,\n TThrow extends boolean = true,\n TSelected = unknown,\n>(\n opts: UseSearchOptions<\n TRouter,\n TFrom,\n TStrict,\n ThrowConstraint<TStrict, TThrow>,\n TSelected\n >,\n): Accessor<\n ThrowOrOptional<UseSearchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>\n> {\n return useMatch({\n from: opts.from!,\n strict: opts.strict,\n shouldThrow: opts.shouldThrow,\n select: (match) => {\n const search = match.search\n return opts.select ? opts.select(search) : search\n },\n }) as any\n}\n"],"mappings":";;AA6CA,SAAgB,UAOd,MASA;CACA,OAAO,SAAS;EACd,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,aAAa,KAAK;EAClB,SAAS,UAAU;GACjB,MAAM,SAAS,MAAM;GACrB,OAAO,KAAK,SAAS,KAAK,OAAO,MAAA,IAAU;;EAE9C"}

@@ -22,3 +22,3 @@ import * as Solid from 'solid-js';

return (<Solid.Show when={hydrated()} fallback={props.fallback ?? null}>
<>{props.children}</>
{props.children}
</Solid.Show>);

@@ -25,0 +25,0 @@ }

@@ -1,1 +0,1 @@

{"version":3,"file":"ClientOnly.jsx","sourceRoot":"","s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AAK,CAAC,QAAQ,CACjB;IAAA,EAAE,KAAK,CAAC,IAAI,CAAC,CACd,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,IAAI,cAAc,GAAG,KAAK,CAAA;AAE1B,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IAElE,KAAK,CAAC,YAAY,CAChB,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,EAAE;QACH,cAAc,GAAG,IAAI,CAAA;QACrB,WAAW,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC,CACF,CAAA;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
{
"name": "@tanstack/solid-router",
"version": "2.0.0-beta.24",
"version": "2.0.0-beta.25",
"description": "Modern and scalable routing for Solid applications",

@@ -92,11 +92,11 @@ "author": "Tanner Linsley",

"@solidjs/meta": "^0.29.4",
"@solidjs/web": "2.0.0-beta.19",
"@solidjs/web": "2.0.0-beta.20",
"isbot": "^5.1.22",
"@solid-primitives/refs": "^1.0.8",
"@tanstack/router-core": "1.171.14",
"@tanstack/history": "1.162.0"
"@tanstack/history": "1.162.0",
"@tanstack/router-core": "1.171.14"
},
"devDependencies": {
"@solidjs/testing-library": "^0.8.10",
"@solidjs/web": "2.0.0-beta.19",
"@solidjs/web": "2.0.0-beta.20",
"@testing-library/jest-dom": "^6.6.3",

@@ -106,5 +106,5 @@ "@types/node": ">=20",

"eslint-plugin-solid": "^0.14.5",
"solid-js": "2.0.0-beta.19",
"solid-js": "2.0.0-beta.20",
"vite": "*",
"vite-plugin-solid": "^3.0.0-next.11",
"vite-plugin-solid": "^3.0.0-next.13",
"zod": "^4.4.3"

@@ -111,0 +111,0 @@ },

@@ -36,3 +36,3 @@ import * as Solid from 'solid-js'

<Solid.Show when={hydrated()} fallback={props.fallback ?? null}>
<>{props.children}</>
{props.children}
</Solid.Show>

@@ -39,0 +39,0 @@ )

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display