diffbook-app 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{_-CzvvmzrL.js → _-BxvhSqUx.js} +1 -1
- package/dist/client/assets/{_-DtlOTuaQ.js → _-DlbH9o0D.js} +1 -1
- package/dist/client/assets/{_bookSlug-CDIukwwd.js → _bookSlug-C22DaBn6.js} +1 -1
- package/dist/client/assets/{book-view-B1VhlTqp.js → book-view-9jg75Op3.js} +1 -1
- package/dist/client/assets/{index-fwL8CzeX.js → index-D-H0_zTz.js} +2 -2
- package/dist/client/assets/{routes-DFt923uJ.js → routes-D9MJ7Eom.js} +1 -1
- package/dist/client/assets/{search-CiDFupIW.js → search-B4jRzfu8.js} +1 -1
- package/dist/client/assets/{search-RZsiFwn_.js → search-CC0UJ_Yq.js} +1 -1
- package/dist/server/assets/{_-B80GDgiD.js → _-1L9ZXE-q.js} +1 -1
- package/dist/server/assets/{_-CP8_agta.js → _-B5_LccIu.js} +2 -2
- package/dist/server/assets/{_-B_NWL_qD.js → _-C6ub-P1E.js} +1 -1
- package/dist/server/assets/{_-BtAixLy_.js → _-mt_Yy6-c.js} +2 -2
- package/dist/server/assets/{_bookSlug-DrcXOgap.js → _bookSlug-D0xcN6QO.js} +2 -2
- package/dist/server/assets/{_bookSlug-CKPYyfgT.js → _bookSlug-DchAAhuW.js} +1 -1
- package/dist/server/assets/{_tanstack-start-manifest_v-DzW688Vp.js → _tanstack-start-manifest_v-Cu2WkYA2.js} +12 -12
- package/dist/server/assets/{book-DwyvrUaa.js → book-mMc--P1C.js} +4 -2
- package/dist/server/assets/{book-view-BNB-pHS9.js → book-view-CtxTyFBH.js} +2 -14
- package/dist/server/assets/{router-DpEmZ9-Y.js → router-BnmwNZcP.js} +5 -5
- package/dist/server/assets/{routes-DcjNYCIo.js → routes-DONi2ZXD.js} +1 -1
- package/dist/server/assets/{routes-FcpIT7AD.js → routes-DlesMb9O.js} +2 -2
- package/dist/server/assets/{search-BHOf95No.js → search-BsCSJT7J.js} +1 -1
- package/dist/server/assets/{source-mode-D-C0lnPO.js → source-mode-4uG8Ej3e.js} +10 -2
- package/dist/server/server.js +9 -9
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DREnUpxT.js";import{n as t}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-DREnUpxT.js";import{n as t}from"./index-D-H0_zTz.js";import{t as n}from"./book-links-POwyHx-T.js";import{n as r,t as i}from"./book-view-9jg75Op3.js";var a=e();function o(){let{book:e,tree:o,rendered:s}=t.useLoaderData();if(!e.config)return null;let c=n(e.mode,e.book.slug),l=e.mode===`registry`?`/`:void 0;return(0,a.jsx)(r,{config:e.config,tree:o,pages:i(o),links:c,page:s.page,html:s.html,toc:s.toc,catalogHome:l})}export{o as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DREnUpxT.js";import{a as t}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-DREnUpxT.js";import{a as t}from"./index-D-H0_zTz.js";import{t as n}from"./book-links-POwyHx-T.js";import{n as r,t as i}from"./book-view-9jg75Op3.js";var a=e();function o(){let{book:e,tree:o,rendered:s}=t.useLoaderData();if(!e.config)return null;let c=n(e.mode,e.book.slug);return(0,a.jsx)(r,{config:e.config,tree:o,pages:i(o),links:c,page:s.page,html:s.html,toc:s.toc})}export{o as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DREnUpxT.js";import{r as t}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-DREnUpxT.js";import{r as t}from"./index-D-H0_zTz.js";import{n,t as r}from"./book-links-POwyHx-T.js";import{n as i,t as a}from"./book-view-9jg75Op3.js";import{n as o,t as s}from"./unavailable-zzVFaXGP.js";var c=e();function l(){let e=t.useLoaderData();if(e.kind===`document`){let{book:t,tree:n,rendered:o}=e;if(!t.config)return null;let s=r(t.mode,t.book.slug),l=t.mode===`registry`?`/`:void 0;return(0,c.jsx)(i,{config:t.config,tree:n,pages:a(n),links:s,page:o.page,html:o.html,toc:o.toc,catalogHome:l})}let{book:l,tree:u}=e;if(l.unavailable)return(0,c.jsx)(s,{message:l.unavailable});if(!l.config)return null;let d=r(l.mode,l.book.slug),f=l.mode===`registry`?`/`:void 0;return l.config.mode===`book`?(0,c.jsx)(o,{config:l.config,tree:u,links:d,catalogHome:f}):(0,c.jsx)(n,{config:l.config,tree:u,links:d,currentPath:d.home,catalogHome:f})}export{l as component};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-BNAOSzn1.js","assets/preload-helper-Czpn1I53.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-au7WJVa2.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/isArrayLikeObject-BsMDyiF-.js","assets/chunk-WYO6CB5R-DFaHwYzM.js","assets/chunk-ICXQ74PX-Dx4jcrDD.js","assets/dist-BRuBKNNy.js","assets/chunk-HOUHSVGY-DsG7XhC0.js","assets/chunk-Q4XR5HBZ-Df-8rUD0.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-OGEWGWER-DHuvEvvQ.js","assets/chunk-C7G6YPKG-otZzVycX.js","assets/chunk-ZGVPDNZ5-BS9TKsjR.js","assets/rough.esm-By172zw-.js","assets/chunk-52WLFC77-BNxXVU2g.js","assets/islands-B6tNK80x.js","assets/book-links-POwyHx-T.js","assets/react-FVqWAEVH.js","assets/react-dom-CTKIkrPf.js","assets/book-CAuFl1ig.js","assets/jsx-runtime-DREnUpxT.js","assets/with-selector-C9wwYFib.js","assets/clsx-CjueKrWZ.js","assets/useRenderElement-BQ1V91fw.js","assets/createLucideIcon-CSrh2MqE.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEVH.js";import{m as n}from"./book-CAuFl1ig.js";import{t as r}from"./jsx-runtime-DREnUpxT.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{R as a,n as o}from"./book-links-POwyHx-T.js";var s=e(t(),1),c=r();function l({html:e}){let t=(0,s.useRef)(null),r=n();return(0,s.useEffect)(()=>{let e=t.current;if(!e)return;u(e);let n=e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target?.closest(`a`);if(!t||t.target||t.hasAttribute(`download`)||t.getAttribute(`rel`)===`external`)return;let n=t.getAttribute(`href`);if(!n||!n.startsWith(`/`)||n.startsWith(`//`))return;let[i,a]=n.split(`#`),o=`/`.replace(/\/$/,``),s=window.location.pathname,c=o&&s.startsWith(o)?s.slice(o.length)||`/`:s;if(a!==void 0&&i.split(`?`)[0]===c){e.preventDefault();let t=a?document.getElementById(decodeURIComponent(a)):null;t?t.scrollIntoView():window.scrollTo({top:0}),history.replaceState(null,``,`${o}${n}`);return}e.preventDefault();let l=o&&(n===o||n.startsWith(`${o}/`))?n.slice(o.length)||`/`:n;r.navigate({to:l})};e.addEventListener(`click`,n,!0);let i=!1,a=()=>i,o=()=>{i||h(e,document.documentElement.classList.contains(`dark`),a)};o();let s=new MutationObserver(()=>o());return s.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{i=!0,e.removeEventListener(`click`,n,!0),s.disconnect()}},[e,r]),(0,c.jsx)(`article`,{ref:t,className:`prose dark:prose-invert max-w-none`,dangerouslySetInnerHTML:{__html:e}})}function u(e){e.querySelectorAll(`pre.shiki`).forEach(e=>{if(e.parentElement?.classList.contains(`code-wrap`))return;let t=document.createElement(`div`);t.className=`code-wrap not-prose`,e.replaceWith(t),t.appendChild(e);let n=document.createElement(`button`);n.type=`button`,n.className=`code-copy`,n.textContent=`Copy`,n.setAttribute(`aria-label`,`Copy code`),n.addEventListener(`click`,async()=>{try{await navigator.clipboard.writeText(e.textContent??``),n.textContent=`Copied`,setTimeout(()=>n.textContent=`Copy`,1500)}catch{}}),t.appendChild(n)})}var d={primaryColor:`#2d2d2d`,primaryTextColor:`#f5f5f5`,primaryBorderColor:`#555555`,lineColor:`#aaaaaa`,secondaryColor:`#1a1a1a`,tertiaryColor:`#3a3a3a`,background:`#1e1e1e`,mainBkg:`#2d2d2d`,nodeBorder:`#555555`},f={primaryColor:`#f4f4f4`,primaryTextColor:`#111111`,primaryBorderColor:`#cccccc`,lineColor:`#777777`,secondaryColor:`#eeeeee`,tertiaryColor:`#ffffff`,background:`#ffffff`,mainBkg:`#f4f4f4`,nodeBorder:`#cccccc`},p=0;function m(e){let t=e.getAttribute(`data-mermaid-code`)??``;try{let e=JSON.parse(t);if(typeof e==`string`)return e}catch{}return t.replace(/\\n/g,`
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEVH.js";import{m as n}from"./book-CAuFl1ig.js";import{t as r}from"./jsx-runtime-DREnUpxT.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{R as a,n as o}from"./book-links-POwyHx-T.js";var s=e(t(),1),c=r();function l({html:e}){let t=(0,s.useRef)(null),r=n();return(0,s.useEffect)(()=>{let e=t.current;if(!e)return;u(e);let n=e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.target?.closest(`a`);if(!t||t.target||t.hasAttribute(`download`)||t.getAttribute(`rel`)===`external`)return;let n=t.getAttribute(`href`);if(!n||!n.startsWith(`/`)||n.startsWith(`//`))return;let[i,a]=n.split(`#`),o=`/`.replace(/\/$/,``),s=window.location.pathname,c=o&&s.startsWith(o)?s.slice(o.length)||`/`:s;if(a!==void 0&&i.split(`?`)[0]===c){e.preventDefault();let t=a?document.getElementById(decodeURIComponent(a)):null;t?t.scrollIntoView():window.scrollTo({top:0}),history.replaceState(null,``,`${o}${n}`);return}e.preventDefault();let l=o&&(n===o||n.startsWith(`${o}/`))?n.slice(o.length)||`/`:n;r.navigate({to:l})};n&&e.addEventListener(`click`,n,!0);let i=!1,a=()=>i,o=()=>{i||h(e,document.documentElement.classList.contains(`dark`),a)};o();let s=new MutationObserver(()=>o());return s.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{i=!0,n&&e.removeEventListener(`click`,n,!0),s.disconnect()}},[e,r]),(0,c.jsx)(`article`,{ref:t,className:`prose dark:prose-invert max-w-none`,dangerouslySetInnerHTML:{__html:e}})}function u(e){e.querySelectorAll(`pre.shiki`).forEach(e=>{if(e.parentElement?.classList.contains(`code-wrap`))return;let t=document.createElement(`div`);t.className=`code-wrap not-prose`,e.replaceWith(t),t.appendChild(e);let n=document.createElement(`button`);n.type=`button`,n.className=`code-copy`,n.textContent=`Copy`,n.setAttribute(`aria-label`,`Copy code`),n.addEventListener(`click`,async()=>{try{await navigator.clipboard.writeText(e.textContent??``),n.textContent=`Copied`,setTimeout(()=>n.textContent=`Copy`,1500)}catch{}}),t.appendChild(n)})}var d={primaryColor:`#2d2d2d`,primaryTextColor:`#f5f5f5`,primaryBorderColor:`#555555`,lineColor:`#aaaaaa`,secondaryColor:`#1a1a1a`,tertiaryColor:`#3a3a3a`,background:`#1e1e1e`,mainBkg:`#2d2d2d`,nodeBorder:`#555555`},f={primaryColor:`#f4f4f4`,primaryTextColor:`#111111`,primaryBorderColor:`#cccccc`,lineColor:`#777777`,secondaryColor:`#eeeeee`,tertiaryColor:`#ffffff`,background:`#ffffff`,mainBkg:`#f4f4f4`,nodeBorder:`#cccccc`},p=0;function m(e){let t=e.getAttribute(`data-mermaid-code`)??``;try{let e=JSON.parse(t);if(typeof e==`string`)return e}catch{}return t.replace(/\\n/g,`
|
|
3
3
|
`)}async function h(e,t,n){let r=[...e.querySelectorAll(`pre.mermaid`)].map(e=>({el:e,src:e.textContent??``,rendered:!1})),a=[...e.querySelectorAll(`[data-mermaid-code]`)].map(e=>({el:e,src:m(e),rendered:!1})),o=[...e.querySelectorAll(`[data-mermaid-src]`)].map(e=>({el:e,src:e.getAttribute(`data-mermaid-src`)??``,rendered:!0})),s=[...r,...a,...o];if(s.length===0)return;let c=(await i(async()=>{let{default:e}=await import(`./mermaid.core-BNAOSzn1.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))).default;if(!n()){c.initialize({startOnLoad:!1,securityLevel:`loose`,theme:t?`dark`:`default`,themeVariables:t?d:f});for(let e of s)try{let{svg:t}=await c.render(`wiki-mmd-${Date.now()}-${p++}`,e.src);if(n())return;if(e.rendered)e.el.innerHTML=t;else{let n=document.createElement(`div`);n.className=`not-prose my-4 flex justify-center overflow-x-auto [&>svg]:max-w-full`,n.setAttribute(`data-mermaid-src`,e.src),n.innerHTML=t,e.el.replaceWith(n)}}catch{}}}var g={};function _(){return(0,s.useEffect)(()=>{window.__DIFFBOOK_MANIM_SCENES__=g,i(()=>import(`./islands-B6tNK80x.js`).then(()=>{document.dispatchEvent(new Event(`diffbook:page-load`))}),__vite__mapDeps([17,1,18,4,19,20,21,22,23,24,25,26]))},[]),null}function v({config:e,tree:t,pages:n,links:r,page:i,html:s,toc:u,catalogHome:d}){let f=n.findIndex(e=>e.slug===i.slug),p=f>0?n[f-1]:void 0,m=f>=0?n[f+1]:void 0;return(0,c.jsxs)(o,{config:e,tree:t,links:r,currentPath:r.document(i.slug),headings:u,catalogHome:d,children:[(0,c.jsx)(`h1`,{children:i.title}),(0,c.jsx)(l,{html:s}),(0,c.jsx)(a,{prev:p?{title:p.title,href:r.document(p.slug)}:void 0,next:m?{title:m.title,href:r.document(m.slug)}:void 0}),(0,c.jsx)(_,{},i.slug)]})}function y(e){return e.flatMap(e=>[...e.slug?[{slug:e.slug,title:e.title}]:[],...e.children?y(e.children):[]])}export{v as n,y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-D9MJ7Eom.js","assets/book-CAuFl1ig.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/react-FVqWAEVH.js","assets/react-dom-CTKIkrPf.js","assets/jsx-runtime-DREnUpxT.js","assets/with-selector-C9wwYFib.js","assets/book-links-POwyHx-T.js","assets/preload-helper-Czpn1I53.js","assets/clsx-CjueKrWZ.js","assets/useRenderElement-BQ1V91fw.js","assets/createLucideIcon-CSrh2MqE.js","assets/book-view-9jg75Op3.js","assets/unavailable-zzVFaXGP.js","assets/_-DlbH9o0D.js","assets/search-B4jRzfu8.js","assets/search-static-BBk4OCV1.js","assets/_bookSlug-C22DaBn6.js","assets/_-BxvhSqUx.js","assets/search-CC0UJ_Yq.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEVH.js";import{t as n}from"./client-DFmNPiUt.js";import{$ as r,A as i,B as a,C as o,D as s,E as c,F as l,G as u,H as d,I as f,J as p,K as m,L as h,M as g,N as _,O as v,P as y,Q as b,R as x,S,T as C,U as w,V as T,W as E,X as ee,Y as D,Z as te,_ as ne,a as O,at as re,b as ie,c as k,d as ae,et as oe,f as A,g as se,h as ce,i as le,it as ue,j as de,k as fe,l as pe,m as j,n as M,nt as me,p as he,q as N,r as ge,rt as P,s as F,t as I,tt as L,v as _e,x as ve,y as R,z as ye}from"./book-CAuFl1ig.js";import{t as be}from"./jsx-runtime-DREnUpxT.js";import{t as z}from"./preload-helper-Czpn1I53.js";import{t as xe}from"./search-BxPCmETY.js";function Se(){try{return sessionStorage}catch{return}}var Ce=`tsr-scroll-restoration-v1_3`,we=Se();function Te(){try{return JSON.parse(we?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ee(){try{we?.setItem(Ce,JSON.stringify(B))}catch{}}var B=Te(),De=`data-scroll-restoration-id`,Oe=e=>e.state.__TSR_key||e.href;function ke(e){let t=e.getAttribute(De);if(t)return`[${De}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Ae=!1,je=`window`;function Me(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ne(e){let t=new Set;for(let n of e){if(n===je)continue;let e=Me(n);e&&t.add(e)}return t}function Pe(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Oe,a=new Set,o=e=>{let t=B[e]||={};for(let e of a)e===document?t[je]={scrollX,scrollY}:e.isConnected&&(t[ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Ae=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Ae||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Ee()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=B[d];if(e){let t=B[u];for(let n in e){if(n===je){if(s)continue}else{let e=Me(n);if(!e||s&&o&&(l??=Ne(o),l.has(e)))continue}t||=B[u]={},t[n]??=e[n]}}}Ae=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ne(o));let t=e&&i&&c,s=r.restoring?B[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Me(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Ae=!1}}))}var Fe=Le(JSON.parse),Ie=Re(JSON.stringify,JSON.parse);function Le(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=c(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Re(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=s(e,r);return t?`?${t}`:``}}function ze(e){return{input:({url:t})=>{for(let n of e)t=Ve(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=He(e[n],t);return t}}}function Be(e){let t=l(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=_([`/`,t,e.pathname]),e)}}function Ve(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function He(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ue(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>We(o,_.get())),x=r(()=>We(s,v.get())),S=r(()=>We(c,y.get())),C=r(()=>_.get()[0]),T=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),E=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),ee=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=w(64);function te(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let ne={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:T,matchRouteDeps:E,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:ee,getRouteMatchStore:te,setMatches:O,setPending:re,setCached:ie};O(e.matches),a?.(ne);function O(e){Ge(e,o,_,n,i)}function re(e){Ge(e,s,v,n,i)}function ie(e){Ge(e,c,y,n,i)}return ne}function We(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Ge(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}m(n.get(),a)||n.set(a)})}var Ke=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},qe=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Je=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),V=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Ye=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},H=(e,t,n)=>{if(!(!o(n)&&!v(n)))throw o(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:o(n)?`redirected`:v(n)?`notFound`:r.status===`pending`?`success`:r.status,context:V(e,t.index),isFetching:!1,error:n})),v(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),o(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Xe=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Ze=(e,t,n)=>{let r=V(e,n);e.updateMatch(t,e=>({...e,context:r}))},U=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,H(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,H(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!o(n)&&!v(n)&&(e.serialError??=n)},Qe=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Je(e,t)&&(n.options.loader||n.options.beforeLoad||ct(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Ke(e)},i);r._nonReactive.pendingTimeout=t}},$e=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Qe(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&H(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},et=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=N(()=>{a?.resolve(),a=void 0});let{paramsError:s,searchError:c}=i;s&&U(e,n,s),c&&U(e,n,c),Qe(e,t,r,i);let l=new AbortController,u=!1,d=()=>{u||(u=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:l})))},f=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{d(),f()});return}i._nonReactive.beforeLoadPromise=N();let p={...V(e,n,!1),...i.__routeContext},{search:m,params:h,cause:g}=i,_=Je(e,t),y={search:m,abortController:l,params:h,preload:_,context:p,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:_?`preload`:g,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){e.router.batch(()=>{d(),f()});return}(o(r)||v(r))&&(d(),U(e,n,r)),e.router.batch(()=>{d(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),f()})},x;try{if(x=r.options.beforeLoad(y),L(x))return d(),x.catch(t=>{U(e,n,t)}).then(b)}catch(t){d(),U(e,n,t)}b(x)},tt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>et(e,n,t,i),s=()=>{if(Xe(e,n))return;let t=$e(e,n,i);return L(t)?t.then(o):o()};return a()},nt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},rt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=V(e,r),d=Je(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},it=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{W(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(rt(e,t,n,r,i)),l=!!s&&L(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;H(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:V(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let s=t;if(s?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:V(e,r)}));return}let c=a._nonReactive.minPendingPromise;c&&await c,v(t)&&await i.options.notFoundComponent?.preload?.(),H(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){s=t,H(e,e.router.getMatch(n),t)}!o(s)&&!v(s)&&await W(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:s,context:V(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),H(e,r,t)}},at=async(e,t,n)=>{async function r(r,a,l,u,f){let p=Date.now()-a.updatedAt,m=r?f.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:f.options.staleTime??e.router.options.defaultStaleTime??0,h=f.options.shouldReload,g=typeof h==`function`?h(rt(e,t,i,n,f)):h,{status:_,invalid:v}=u,y=p>=m&&(!!e.forceStaleReload||u.cause===`enter`||l!==void 0&&l!==u.id);s=_===`success`&&(v||(g??y)),r&&f.options.preload===!1||(s&&!e.sync&&d?(c=!0,(async()=>{try{await it(e,t,i,n,f);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){o(t)&&await e.router.navigate(t.options)}})()):_!==`success`||s?await it(e,t,i,n,f):Ze(e,i,n))}let{id:i,routeId:a}=e.matches[n],s=!1,c=!1,l=e.router.looseRoutesById[a],u=l.options.loader,d=((typeof u==`function`?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Xe(e,i)){if(!e.router.getMatch(i))return e.matches[n];Ze(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,c=Je(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&d)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&H(e,n,a),n.status===`pending`&&await r(c,t,s,n,l)}else{let n=c&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=N(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(c,t,s,a,l)}}let f=e.router.getMatch(i);c||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,c||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;let p=c?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:p,invalid:!1})),e.router.getMatch(i)):f};async function ot(e){let t=e,n=[];qe(t.router)&&Ke(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=tt(t,e);L(n)&&await n}catch(e){if(o(e))throw e;if(v(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Ye(t,r):void 0,s=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),c,l;for(let e=0;e<s;e++)n.push(at(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(o(e))throw e;v(e)?c??=e:l??=e}if(l!==void 0)throw l}let u=c??(r&&!t.preload?r:void 0),d=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!u&&r&&t.preload)return t.matches;if(u){let e=Ye(t,u);e===void 0&&E();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),u.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:u},isFetching:!1})),d=e,await W(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await W(e,[`errorComponent`])}for(let e=0;e<=d;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=nt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let f=Ke(t);if(L(f)&&await f,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function st(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function W(e,t=lt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===lt?(()=>{if(e._componentsPromise===void 0){let t=st(e,lt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():st(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function ct(e){for(let t of lt)if(e.options[t]?.preload)return!0;return!1}var lt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],G=`__TSR_index`,ut=`popstate`,dt=`beforeunload`;function ft(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=gt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[G];i=pt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[G];i=pt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[G]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function pt(e,t){t||={};let n=_t();return{...t,key:n,__TSR_key:n,[G]:e}}function mt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>gt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=_t();t.history.replaceState({[G]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=gt(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[G]-l.state[G],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=ft({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(dt,S,{capture:!0}),t.removeEventListener(ut,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(dt,S,{capture:!0}),t.addEventListener(ut,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function ht(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function gt(e,t){let n=ht(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=_t();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[G]:0,key:a,__TSR_key:a}}}function _t(){return(Math.random()+1).toString(36).substring(7)}function vt(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function K(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var yt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=de(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:mt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=w(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Ue(St(this.latestLocation),e),Pe(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=l(o);t&&t!==`/`&&e.push(Be({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ze(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=d(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&T(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:p(e).path,external:!1,searchStr:o,search:P(t?.search,i),hash:p(r.slice(1)).path,state:ue(t?.state,a)}}let o=new URL(i,this.origin),s=Ve(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:p(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:P(t?.search,c),hash:p(s.hash.slice(1)).path,state:ue(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>y({base:e,to:t.includes(`//`)?i(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>wt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,i=this.matchRoutesLightweight(n);t.from;let a=t.unsafeRelative===`path`?n.pathname:t.from??i.fullPath,o=t.to?`${t.to}`:void 0,s=i.search,c=Object.assign(Object.create(null),i.params),l=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),u=o?this.resolvePathWithBase(l,o):l,d=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?c:Object.assign(c,b(t.params,c)),m=this.routesByPath[f(u)],h;if(m)h=this.getRouteBranch(m);else if(u.includes(`$`))h=[];else{let e=this.getMatchedRoutes(u);h=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(h=[...h,this.options.notFoundRoute])}if(h.length&&r(d))for(let e of h){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(d,t(d))}catch{}}let _=e.leaveParams?u:p(g({path:u,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,v=s;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ct(t.options.validateSearch,{...e,...v}))}catch{}}),v=e}v=Tt({search:v,dest:t,destRoutes:h,_includeValidateSearch:e._includeValidateSearch}),v=P(s,v);let y=this.options.stringifySearch(v),x=t.hash===!0?n.hash:t.hash?b(t.hash,n.hash):void 0,S=x?`#${x}`:``,C=t.state===!0?n.state:t.state?b(t.state,n.state):{};C=ue(n.state,C);let w=`${_}${y}${S}`,T,E,D=!1;if(this.rewrite){let e=new URL(w,this.origin),t=He(this.rewrite,e);T=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,D=!0)}else T=ee(w),E=T;return{publicHref:E,href:T,pathname:_,search:v,searchStr:y,state:C,hash:x??``,external:D,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=x(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,b(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=D(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=f(this.latestLocation.href)===f(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=N(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=gt(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ve(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(oe(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(s=>{this.startTransition(async()=>{try{this.beforeLoad(),t&&(this._scroll.hash=t===`PUSH`||t===`REPLACE`);let n=this.latestLocation,r=K(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await ot({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){o(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):v(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),s()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let s;this.hasNotFoundMatch()?s=404:this.stores.matches.get().some(e=>e.status===`error`)&&(s=500),s!==void 0&&this.stores.statusCode.set(s)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(K(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&oe(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??3e5;return t.status===`error`||e-t.updatedAt>=r}})},this.loadRouteChunk=W,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await ot({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(o(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});v(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=a(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!o||e.params&&!D(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?D(i.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Ie,parseSearch:e.parseSearch??Fe,protocolAllowlist:e.protocolAllowlist??u}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=h(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,s=!1;(r?r.path!==`/`&&i[`**`]:f(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:s=!0);let c=s?Dt(this.options.notFoundMode,a):void 0,l=Array(a.length),u=new Map;for(let e of this.stores.matchStores.values())e.routeId&&u.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Ct(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof bt||(r=new bt(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:_,usedParams:y}=g({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),b=r.id+_+h,x=this.getMatch(b),S=u.get(r.id),C=x?._strictParams??y,w;if(!x)try{Ot(r,C)}catch(e){if(w=v(e)||o(e)?e:new xt(e.message,{cause:e}),t?.throwOnError)throw w}Object.assign(i,C);let T=S?`stay`:`enter`,E;if(x)E={...x,cause:T,params:S?.params??i,_strictParams:C,search:P(S?S.search:x.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||ct(r)?`pending`:`success`;E={id:b,ssr:r.options.ssr,index:n,routeId:r.id,params:S?.params??i,_strictParams:C,pathname:_,updatedAt:Date.now(),search:S?P(S.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:N()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:T,loaderDeps:S?ue(S.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(E.globalNotFound=c===r.id),E.searchError=p;let ee=this.getParentContext(s);E.context={...ee,...E.__routeContext,...E.__beforeLoadContext},l[n]=E}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?P(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let t=me(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];let{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=me(r),o={...e.search};for(let e of r)try{Object.assign(o,Ct(e.options.validateSearch,o))}catch{}let s=t&&this.stores.matchStores.get(t)?.get(),c=s&&s.routeId===a.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),i);for(let t of r)try{Ot(t,e)}catch{}l=e}let u={matchedRoutes:r,fullPath:a.fullPath,search:o,params:l};return this.lightweightCache.set(e,[t,u]),u}},bt=class extends Error{},xt=class extends Error{};function St(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Ct(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new bt(`Async validation not supported`);if(n.issues)throw new bt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function wt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=f(e),a,o=ye(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Tt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Et(n)(e,t,r??!1)}function Et(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Ct(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=b(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function Dt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return C}function Ot(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var q=Symbol.for(`TSR_DEFERRED_PROMISE`);function kt(e,t){let n=e;return n[q]?n:(n[q]={status:`pending`},n.then(e=>{n[q].status=`success`,n[q].data=e}).catch(e=>{n[q].status=`error`,n[q].error={data:(t?.serializeError??vt)(e),__isServerError:!0}}),n)}function At(e,t){if(e)return typeof e==`string`?e:e[t]}function jt(e){return e?.scriptFormat??`module`}function Mt(e,t,n){let r=Nt(t),i=At(n,`script`)??r.crossOrigin;return{...jt(e)===`iife`?{rel:`preload`,as:`script`}:{rel:`modulepreload`},href:r.href,...i?{crossOrigin:i}:{}}}function Nt(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}function Pt(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}let n=new Set;for(let r of t){let t=JSON.stringify(r);n.has(t)||(n.add(t),e.push(r))}}function Ft(e){return typeof e==`string`?{href:e,crossOrigin:void 0}:e}var It=S({key:`$TSS/serverfn`,test:e=>typeof e!=`function`||!(re in e)?!1:!!e[re],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>ve(e)});function Lt(e){return e.replaceAll(`\0`,`/`).replaceAll(`�`,`/`)}function Rt(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e,t.g!==void 0&&(e.globalNotFound=t.g)}async function zt(e){window.$_TSR||E();let t=e.options.serializationAdapters;if(t?.length){let e=new Map;t.forEach(t=>{e.set(t.key,t.fromSerializable)}),window.$_TSR.t=e,window.$_TSR.buffer.forEach(e=>e())}window.$_TSR.initialized=!0,window.$_TSR.router||E();let n=window.$_TSR.router;n.matches.forEach(e=>{e.i=Lt(e.i)}),n.lastMatchId&&=Lt(n.lastMatchId);let{manifest:r,dehydratedData:i,lastMatchId:a}=n;e.ssr={manifest:r};let o=document.querySelector(`meta[property="csp-nonce"]`)?.content;e.options.ssr={nonce:o},await e.options.hydrate?.(i);let s=e.matchRoutes(e.stores.location.get()),c=Promise.all(s.map(t=>e.loadRouteChunk(e.looseRoutesById[t.routeId])));function l(t){let n=e.looseRoutesById[t.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(n){let r=N();t._nonReactive.minPendingPromise=r,t._forcePending=!0,setTimeout(()=>{r.resolve(),e.updateMatch(t.id,e=>(e._nonReactive.minPendingPromise=void 0,{...e,_forcePending:void 0}))},n)}}function u(t){let n=e.looseRoutesById[t.routeId];n&&(n.options.ssr=t.ssr)}let d;s.forEach(e=>{let t=n.matches.find(t=>t.i===e.id);if(!t){e._nonReactive.dehydrated=!1,e.ssr=!1,u(e);return}Rt(e,t),u(e),e._nonReactive.dehydrated=e.ssr!==!1,(e.ssr===`data-only`||e.ssr===!1)&&d===void 0&&(d=e.index,l(e))}),e.stores.setMatches(s);let f=e.stores.matches.get(),p=e.stores.location.get();await Promise.all(f.map(async t=>{try{let n=e.looseRoutesById[t.routeId],r=f[t.index-1]?.context??e.options.context;if(n.options.context){let i={deps:t.loaderDeps,params:t.params,context:r??{},location:p,navigate:t=>e.navigate({...t,_fromLocation:p}),buildLocation:e.buildLocation,cause:t.cause,abortController:t.abortController,preload:!1,matches:s,routeId:n.id};t.__routeContext=n.options.context(i)??void 0}t.context={...r,...t.__routeContext,...t.__beforeLoadContext};let i={ssr:e.options.ssr,matches:f,match:t,params:t.params,loaderData:t.loaderData},a=await n.options.head?.(i),o=await n.options.scripts?.(i);t.meta=a?.meta,t.links=a?.links,t.headScripts=a?.scripts,t.styles=a?.styles,t.scripts=o}catch(e){if(v(e))t.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${t.routeId}`,e);else throw t.error=e,console.error(`Error during hydration for route ${t.routeId}:`,e),e}}));let m=s[s.length-1].id!==a;if(!s.some(e=>e.ssr===!1)&&!m)return s.forEach(e=>{e._nonReactive.dehydrated=void 0}),e.stores.resolvedLocation.set(e.stores.location.get()),c;let h=Promise.resolve().then(()=>e.load()).catch(e=>{console.error(`Error during router hydration:`,e)});if(m){let t=s[1];t||E(),l(t),t._displayPending=!0,t._nonReactive.displayPendingPromise=h,h.then(()=>{e.batch(()=>{e.stores.status.get()===`pending`&&(e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())),e.updateMatch(t.id,e=>({...e,_displayPending:void 0,displayPendingPromise:void 0}))})})}return c}var J=e(t(),1),Y=be();function Bt({promise:e}){if(_e)return _e(e);let t=kt(e);if(t[q].status===`pending`)throw t;if(t[q].status===`error`)throw t[q].error;return t[q].data}function Vt(e){let t=(0,Y.jsx)(Ht,{...e});return e.fallback?(0,Y.jsx)(J.Suspense,{fallback:e.fallback,children:t}):t}function Ht(e){let t=Bt(e);return e.children(t)}function Ut(e){let t=e.errorComponent??Gt;return(0,Y.jsx)(Wt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?J.createElement(t,{error:n,reset:r}):e.children})}var Wt=class extends J.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Gt({error:e}){let[t,n]=J.useState(!1);return(0,Y.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Y.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Y.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Y.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Y.jsx)(`code`,{children:e.message}):null})}):null]})}var X=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(X||{});function Kt({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function qt(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Jt=[],Yt=0,{link:Xt,unlink:Zt,propagate:Qt,checkDirty:$t,shallowPropagate:en}=Kt({update(e){return e._update()},notify(e){Jt[nn++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,on(e))}}),tn=0,nn=0,Z,rn=0;function an(e){try{++rn,e()}finally{--rn||sn()}}function on(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Zt(n,e)}function sn(){if(!(rn>0)){for(;tn<nn;){let e=Jt[tn];Jt[tn++]=void 0,e.notify()}tn=0,nn=0}}function cn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?X.None:X.Mutable,get(){return Z!==void 0&&Xt(i,Z,Yt),i._snapshot},subscribe(e){let t=qt(e),n={current:!1},r=ln(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++Yt,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Z=a,n&&(i.flags&=~X.RecursedCheck),on(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&$t(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&en(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&Xt(i,Z,Yt),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Qt(e),en(e),sn())}},i}function ln(e){let t=()=>{let t=Z;Z=n,++Yt,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,on(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&$t(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,on(this)}};return t(),n}function un(e){let t=j(),n=`not-found-${A(t.stores.location,e=>e.pathname)}-${A(t.stores.status,e=>e)}`;return(0,Y.jsx)(Ut,{getResetKey:()=>n,onCatch:(t,n)=>{if(v(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(v(t))return e.fallback?.(t);throw t},children:e.children})}function dn(){return(0,Y.jsx)(`p`,{children:`Not Found`})}function Q(e){return(0,Y.jsx)(Y.Fragment,{children:e.children})}function fn(e,t,n){return t.options.notFoundComponent?(0,Y.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Y.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Y.jsx)(dn,{})}var pn=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,mn=(e,t)=>e[0]===t[0]&&e[1]===t[1],hn=J.memo(function({matchId:e}){let t=j(),n=t.stores.matchStores.get(e);n||E();let r=A(t.stores.loadedAt,e=>e),i=A(n,e=>e,pn);return(0,Y.jsx)(gn,{router:t,matchId:e,resetKey:r,matchState:J.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function gn({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,Y.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?J.Suspense:Q,f=s?Ut:Q,p=l?un:Q;return(0,Y.jsxs)(i.isRoot?i.options.shellComponent??Q:Q,{children:[(0,Y.jsx)(he.Provider,{value:t,children:(0,Y.jsx)(d,{fallback:o,children:(0,Y.jsx)(f,{getResetKey:()=>n,errorComponent:s||Gt,onCatch:(e,t)=>{if(v(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,Y.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return J.createElement(l,e)},children:u||r._displayPending?(0,Y.jsx)(se,{fallback:o,children:(0,Y.jsx)(vn,{matchId:t})}):(0,Y.jsx)(vn,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(_n,{}),(e.options.scrollRestoration,null)]}):null]})}function _n(){let e=j(),t=J.useRef();return R(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...K(e.stores.location.get(),r??n)}),t.current=n},[A(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var vn=J.memo(function({matchId:e}){let t=j(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||E();let i=A(r,e=>e),a=i.routeId,s=t.routesById[a],c=J.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),l=J.useMemo(()=>{let e=s.options.component??t.options.defaultComponent;return e?(0,Y.jsx)(e,{},c):(0,Y.jsx)(yn,{})},[c,s.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=s.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=N();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return v(i.error)||E(),fn(t,s,i.error);if(i.status===`redirected`)throw o(i.error)||E(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return l}),yn=J.memo(function(){let e=j(),t=J.useContext(he),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=A(a,e=>[e?.routeId,e?.globalNotFound??!1],mn),i=A(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,Y.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||E(),fn(e,a,void 0);if(!i)return null;let s=(0,Y.jsx)(hn,{matchId:i});return n===`__root__`?(0,Y.jsx)(J.Suspense,{fallback:o,children:s}):s});function bn(){let e=j(),t=J.useRef({router:e,mounted:!1}),[n,r]=J.useState(!1),i=A(e.stores.isLoading,e=>e),a=A(e.stores.hasPending,e=>e),o=ie(i),s=i||n||a,c=ie(s),l=i||a,u=ie(l);return e.startTransition=e=>{r(!0),J.startTransition(()=>{e(),r(!1)})},J.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return f(e.latestLocation.publicHref)!==f(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),R(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),R(()=>{o&&!i&&e.emit({type:`onLoad`,...K(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),R(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...K(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),R(()=>{if(c&&!s){let t=K(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),an(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function xn(){let e=j(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,Y.jsx)(t,{}):null,r=(0,Y.jsxs)(typeof document<`u`&&e.ssr?Q:J.Suspense,{fallback:n,children:[(0,Y.jsx)(bn,{}),(0,Y.jsx)(Sn,{})]});return e.options.InnerWrap?(0,Y.jsx)(e.options.InnerWrap,{children:r}):r}function Sn(){let e=j(),t=A(e.stores.firstId,e=>e),n=A(e.stores.loadedAt,e=>e),r=t?(0,Y.jsx)(hn,{matchId:t}):null;return(0,Y.jsx)(he.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,Y.jsx)(Ut,{getResetKey:()=>n,errorComponent:Gt,onCatch:void 0,children:r})})}var Cn=e=>({createMutableStore:cn,createReadonlyStore:cn,batch:an}),wn=e=>new Tn(e),Tn=class extends yt{constructor(e){super(e,Cn)}};function En({router:e,children:t,...n}){r(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let i=(0,Y.jsx)(ce.Provider,{value:e,children:t});return e.options.Wrap?(0,Y.jsx)(e.options.Wrap,{children:i}):i}function Dn({router:e,...t}){return(0,Y.jsx)(En,{router:e,...t,children:(0,Y.jsx)(xn,{})})}function On(e){let t=j({warn:e?.router===void 0}),n=e?.router||t;return A(n.stores.__store,ae(e,n))}function kn(e,t){if(t)for(let[n,r]of Object.entries(t))n!==`suppressHydrationWarning`&&r!==void 0&&r!==!1&&e.setAttribute(n,typeof r==`boolean`?``:String(r))}function An(e){let{attrs:t,children:n,nonce:r,preventScriptHoist:i}=e;switch(e.tag){case`title`:return(0,Y.jsx)(`title`,{...t,suppressHydrationWarning:!0,children:n});case`meta`:return(0,Y.jsx)(`meta`,{...t,suppressHydrationWarning:!0});case`link`:return(0,Y.jsx)(`link`,{...t,precedence:t?.precedence??(t?.rel===`stylesheet`?`default`:void 0),nonce:r,suppressHydrationWarning:!0});case`style`:return e.inlineCss,(0,Y.jsx)(`style`,{...t,dangerouslySetInnerHTML:{__html:n},nonce:r});case`script`:return(0,Y.jsx)(jn,{attrs:t,preventScriptHoist:i,children:n});default:return null}}function jn({attrs:e,children:t,preventScriptHoist:n}){j();let r=ne(),i=typeof e?.type==`string`&&e.type!==``&&e.type!==`text/javascript`&&e.type!==`module`;if(J.useEffect(()=>{if(!i){if(e?.src){let t=(()=>{try{let t=document.baseURI||window.location.href;return new URL(e.src,t).href}catch{return e.src}})();for(let e of document.querySelectorAll(`script[src]`))if(e.src===t)return;let n=document.createElement(`script`);return kn(n,e),document.head.appendChild(n),()=>n.remove()}if(typeof t==`string`){let n=typeof e?.type==`string`?e.type:`text/javascript`,r=typeof e?.nonce==`string`?e.nonce:void 0;for(let e of document.querySelectorAll(`script:not([src])`)){if(!(e instanceof HTMLScriptElement))continue;let i=e.getAttribute(`type`)??`text/javascript`,a=e.getAttribute(`nonce`)??void 0;if(e.textContent===t&&i===n&&a===r)return}let i=document.createElement(`script`);return i.textContent=t,kn(i,e),document.head.appendChild(i),()=>i.remove()}}},[e,t,i]),i&&typeof t==`string`)return(0,Y.jsx)(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!r){if(e?.src)return(0,Y.jsx)(`script`,{...e,suppressHydrationWarning:!0});if(typeof t==`string`)return(0,Y.jsx)(`script`,{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var Mn=e=>{let t=j(),n=t.options.ssr?.nonce,r=A(t.stores.matches,e=>e.map(e=>e.meta).filter(e=>e!==void 0),D),i=J.useMemo(()=>{let e=[],t={},i;for(let a=r.length-1;a>=0;a--){let o=r[a];for(let r=o.length-1;r>=0;r--){let a=o[r];if(a)if(a.title)i||={tag:`title`,children:a.title};else if(`script:ld+json`in a)try{let t=JSON.stringify(a[`script:ld+json`]);e.push({tag:`script`,attrs:{type:`application/ld+json`},children:te(t)})}catch{}else{let r=a.name??a.property;if(r){if(t[r])continue;t[r]=!0}e.push({tag:`meta`,attrs:{...a,nonce:n}})}}}return i&&e.push(i),n&&e.push({tag:`meta`,attrs:{property:`csp-nonce`,content:n}}),e.reverse(),e},[r,n]),a=A(t.stores.matches,e=>e.flatMap(e=>e.links??[]).filter(e=>e!==void 0).map(e=>({tag:`link`,attrs:{...e,nonce:n}})),D),o=A(t.stores.matches,r=>{let i=t.ssr?.manifest,a=[];return i?(r.forEach(t=>{i.routes[t.routeId]?.css?.forEach(t=>{let r=Ft(t);a.push({tag:`link`,attrs:{rel:`stylesheet`,...r,crossOrigin:At(e,`stylesheet`)??r.crossOrigin,suppressHydrationWarning:!0,nonce:n}})})}),i.inlineStyle&&a.push({tag:`style`,attrs:{...i.inlineStyle.attrs,nonce:n},children:i.inlineStyle.children,inlineCss:!0}),a):a},D),s=A(t.stores.matches,r=>{let i=[],a=t.ssr?.manifest;return a&&r.forEach(t=>{a.routes[t.routeId]?.preloads?.forEach(t=>{i.push({tag:`link`,attrs:{...Mt(a,t,e),nonce:n}})})}),i},D),c=A(t.stores.matches,e=>e.flatMap(e=>e.styles??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`style`,attrs:{...t,nonce:n},children:e})),D),l=A(t.stores.matches,e=>e.flatMap(e=>e.headScripts??[]).filter(e=>e!==void 0).map(({children:e,...t})=>({tag:`script`,attrs:{...t,nonce:n},children:e})),D),u=[];return Pt(u,i),u.push(...s),Pt(u,a),u.push(...o),Pt(u,c),Pt(u,l),u};function Nn(e){let t=Mn(e.assetCrossOrigin),n=j().options.ssr?.nonce;return(0,Y.jsx)(Y.Fragment,{children:t.map(e=>(0,J.createElement)(An,{...e,key:`tsr-meta-${JSON.stringify(e)}`,nonce:n}))})}var Pn=()=>{let e=j(),t=e.options.ssr?.nonce,n=n=>{let r=[],i=e.ssr?.manifest;if(!i)return[];for(let e of n){let n=i.routes[e.routeId]?.scripts;if(n)for(let e of n)r.push({tag:`script`,attrs:{...e.attrs,nonce:t},children:e.children,...typeof e.attrs?.src==`string`?{preventScriptHoist:!0}:{}})}return r},r=e=>e.map(e=>e.scripts).flat(1).filter(Boolean).map(({children:e,...n})=>({tag:`script`,attrs:{...n,suppressHydrationWarning:!0,nonce:t},children:e})),i=A(e.stores.matches,n,D);return Fn(e,A(e.stores.matches,r,D),i)};function Fn(e,t,n){let r=[...t,...n];return(0,Y.jsx)(Y.Fragment,{children:r.map((e,t)=>(0,J.createElement)(An,{...e,key:`tsr-scripts-${e.tag}-${t}`}))})}function In(){let e=On({select:e=>e.isLoading||e.status===`pending`}),[t,n]=(0,J.useState)(0),[r,i]=(0,J.useState)(!1);if((0,J.useEffect)(()=>{let t=0,a;return e?(i(!0),n(0),t=requestAnimationFrame(()=>n(90))):r&&(n(100),a=setTimeout(()=>{i(!1),n(0)},300)),()=>{cancelAnimationFrame(t),a&&clearTimeout(a)}},[e,r]),!r)return null;let a=t===100;return(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none fixed inset-x-0 top-0 z-[60] h-0.5`,children:(0,Y.jsx)(`div`,{className:`h-full bg-primary shadow-[0_0_8px_0] shadow-primary/50`,style:{width:`${t}%`,opacity:+!a,transition:a?`width 150ms ease-out, opacity 300ms ease 150ms`:`width 8s cubic-bezier(0.05, 0.7, 0.1, 1)`}})})}var Ln=`try {
|
|
3
3
|
var root = document.documentElement;
|
|
4
4
|
var mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
@@ -22,4 +22,4 @@ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEV
|
|
|
22
22
|
for (var i = 0; i < toRemove.length; i++) root.classList.remove(toRemove[i]);
|
|
23
23
|
root.classList.add("theme-" + theme);
|
|
24
24
|
}
|
|
25
|
-
} catch (e) { /* localStorage unavailable — non-fatal */ }`;function Rn(){let e=j();return(0,J.useEffect)(()=>{let t=()=>{document.visibilityState===`visible`&&e.invalidate()};document.addEventListener(`visibilitychange`,t);let n=new EventSource(`/api/watch`);return n.onmessage=()=>{e.invalidate().then(()=>document.dispatchEvent(new Event(`diffbook:page-load`)))},n.onerror=()=>{},()=>{document.removeEventListener(`visibilitychange`,t),n.close()}},[e]),null}var zn=`/assets/styles-BJwcDxBm.css`,$=pe({loader:async()=>({mode:await I()}),head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`diffbook`},{name:`description`,content:`A registry-backed documentation reader.`}],links:[{rel:`stylesheet`,href:zn},{rel:`icon`,href:`/favicon.svg`,type:`image/svg+xml`},{rel:`preconnect`,href:`https://fonts.googleapis.com`},{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:`anonymous`},{rel:`stylesheet`,href:`https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Open+Sans:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Montserrat:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Lora:wght@400;500;600;700&family=Oxanium:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Fira+Code:wght@400;500&family=Geist+Mono:wght@400;500&family=Source+Code+Pro:wght@400;500&display=swap`}]}),component:Bn});function Bn(){let{mode:e}=$.useLoaderData();return(0,Y.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,Y.jsxs)(`head`,{children:[(0,Y.jsx)(Nn,{}),(0,Y.jsx)(`script`,{dangerouslySetInnerHTML:{__html:Ln}})]}),(0,Y.jsxs)(`body`,{children:[(0,Y.jsx)(In,{}),(0,Y.jsx)(`div`,{className:`flex min-h-screen flex-col`,children:(0,Y.jsx)(yn,{})}),e===`project`&&(0,Y.jsx)(Rn,{}),(0,Y.jsx)(Pn,{})]})]})}var Vn=k(`/`)({loader:async()=>{let e=await ge();if(e!==null)return{catalog:e};let[t,n,r]=await Promise.all([M({data:{}}),O({data:{}}),le({data:{slug:``}})]);return{book:t,tree:n,rendered:r}},component:F(()=>z(()=>import(`./routes-
|
|
25
|
+
} catch (e) { /* localStorage unavailable — non-fatal */ }`;function Rn(){let e=j();return(0,J.useEffect)(()=>{let t=()=>{document.visibilityState===`visible`&&e.invalidate()};document.addEventListener(`visibilitychange`,t);let n=new EventSource(`/api/watch`);return n.onmessage=()=>{e.invalidate().then(()=>document.dispatchEvent(new Event(`diffbook:page-load`)))},n.onerror=()=>{},()=>{document.removeEventListener(`visibilitychange`,t),n.close()}},[e]),null}var zn=`/assets/styles-BJwcDxBm.css`,$=pe({loader:async()=>({mode:await I()}),head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`diffbook`},{name:`description`,content:`A registry-backed documentation reader.`}],links:[{rel:`stylesheet`,href:zn},{rel:`icon`,href:`/favicon.svg`,type:`image/svg+xml`},{rel:`preconnect`,href:`https://fonts.googleapis.com`},{rel:`preconnect`,href:`https://fonts.gstatic.com`,crossOrigin:`anonymous`},{rel:`stylesheet`,href:`https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Open+Sans:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Montserrat:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Lora:wght@400;500;600;700&family=Oxanium:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Fira+Code:wght@400;500&family=Geist+Mono:wght@400;500&family=Source+Code+Pro:wght@400;500&display=swap`}]}),component:Bn});function Bn(){let{mode:e}=$.useLoaderData();return(0,Y.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,Y.jsxs)(`head`,{children:[(0,Y.jsx)(Nn,{}),(0,Y.jsx)(`script`,{dangerouslySetInnerHTML:{__html:Ln}})]}),(0,Y.jsxs)(`body`,{children:[(0,Y.jsx)(In,{}),(0,Y.jsx)(`div`,{className:`flex min-h-screen flex-col`,children:(0,Y.jsx)(yn,{})}),e===`project`&&(0,Y.jsx)(Rn,{}),(0,Y.jsx)(Pn,{})]})]})}var Vn=k(`/`)({loader:async()=>{let e=await ge();if(e!==null)return{catalog:e};let[t,n,r]=await Promise.all([M({data:{}}),O({data:{}}),le({data:{slug:``}})]);return{book:t,tree:n,rendered:r}},component:F(()=>z(()=>import(`./routes-D9MJ7Eom.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),`component`)}),Hn=k(`/$`)({loader:async({params:e})=>{let t=e._splat??``,[n,r,i]=await Promise.all([M({data:{}}),O({data:{}}),le({data:{slug:t}})]);if(!i)throw fe();return{book:n,tree:r,rendered:i}},component:F(()=>z(()=>import(`./_-DlbH9o0D.js`),__vite__mapDeps([14,5,2,7,3,4,1,6,8,9,10,11,12])),`component`)}),Un=k(`/search`)({validateSearch:e=>({q:typeof e.q==`string`?e.q:``}),shouldReload:!1,loader:async({location:e})=>{if(await I()===`registry`)throw fe();let t=e.search.q,n=typeof t==`string`?t:``,[r,i,a]=await Promise.all([M({data:{}}),O({data:{}}),xe({data:{query:n}})]);return{book:r,tree:i,searchData:a}},component:F(()=>z(()=>import(`./search-B4jRzfu8.js`),__vite__mapDeps([15,2,3,5,7,4,1,6,8,9,10,11,16])),`component`)}),Wn=k(`/$bookSlug/`)({loader:async({params:e})=>{if(await I()!==`registry`){let[t,n,r]=await Promise.all([M({data:{}}),O({data:{}}),le({data:{slug:e.bookSlug}})]);if(!r)throw fe();return{kind:`document`,book:t,tree:n,rendered:r}}let t=await M({data:{bookSlug:e.bookSlug}});return t.unavailable?{kind:`home`,book:t,tree:[]}:{kind:`home`,book:t,tree:await O({data:{bookSlug:e.bookSlug}})}},component:F(()=>z(()=>import(`./_bookSlug-C22DaBn6.js`),__vite__mapDeps([17,5,2,7,3,4,1,6,8,9,10,11,12,13])),`component`)}),Gn=k(`/$bookSlug/$`)({loader:async({params:e})=>{let t=await I(),n=t===`registry`?{bookSlug:e.bookSlug,slug:e._splat??``}:{slug:[e.bookSlug,e._splat].filter(Boolean).join(`/`)},[r,i,a]=await Promise.all([M({data:t===`registry`?{bookSlug:e.bookSlug}:{}}),O({data:t===`registry`?{bookSlug:e.bookSlug}:{}}),le({data:n})]);if(!a)throw fe();return{book:r,tree:i,rendered:a}},component:F(()=>z(()=>import(`./_-BxvhSqUx.js`),__vite__mapDeps([18,5,2,7,3,4,1,6,8,9,10,11,12])),`component`)}),Kn=k(`/$bookSlug/search`)({validateSearch:e=>({q:typeof e.q==`string`?e.q:``}),shouldReload:!1,loader:async({params:e,location:t})=>{if(await I()!==`registry`)throw fe();let n=t.search.q,r=typeof n==`string`?n:``,[i,a,o]=await Promise.all([M({data:{bookSlug:e.bookSlug}}),O({data:{bookSlug:e.bookSlug}}),xe({data:{bookSlug:e.bookSlug,query:r}})]);return{book:i,tree:a,searchData:o}},component:F(()=>z(()=>import(`./search-CC0UJ_Yq.js`),__vite__mapDeps([19,2,3,5,7,4,1,6,8,9,10,11,16])),`component`)}),qn=Vn.update({id:`/`,path:`/`,getParentRoute:()=>$}),Jn=Hn.update({id:`/$`,path:`/$`,getParentRoute:()=>$}),Yn=Un.update({id:`/search`,path:`/search`,getParentRoute:()=>$}),Xn=Wn.update({id:`/$bookSlug/`,path:`/$bookSlug/`,getParentRoute:()=>$}),Zn={IndexRoute:qn,SplatRoute:Jn,SearchRoute:Yn,BookSlugSplatRoute:Gn.update({id:`/$bookSlug/$`,path:`/$bookSlug/$`,getParentRoute:()=>$}),BookSlugSearchRoute:Kn.update({id:`/$bookSlug/search`,path:`/$bookSlug/search`,getParentRoute:()=>$}),BookSlugIndexRoute:Xn},Qn=$._addFileChildren(Zn);function $n(){return(0,Y.jsxs)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,Y.jsx)(`p`,{className:`text-lg font-semibold text-foreground`,children:`Page not found`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That book or document doesn’t exist.`})]})}function er({error:e}){return(0,Y.jsxs)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,Y.jsx)(`p`,{className:`text-lg font-semibold text-foreground`,children:`Couldn’t load this page`}),(0,Y.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:e?.message||`Something went wrong while loading the content.`})]})}function tr(){return wn({routeTree:Qn,basepath:`/`,scrollRestoration:!0,defaultPreload:`intent`,defaultPreloadDelay:80,defaultNotFoundComponent:$n,defaultErrorComponent:er})}async function nr(){let e=await tr(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(It),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await zt(e),e}var rr=nr;async function ir(){let e=await rr();return window.$_TSR?.h(),e}var ar;function or(){return ar||=ir(),(0,Y.jsx)(Vt,{promise:ar,children:e=>(0,Y.jsx)(Dn,{router:e})})}var sr=n();(0,J.startTransition)(()=>{(0,sr.hydrateRoot)(document,(0,Y.jsx)(J.StrictMode,{children:(0,Y.jsx)(or,{})}))});export{Hn as a,Un as i,Gn as n,Vn as o,Wn as r,Kn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./book-CAuFl1ig.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{o as n}from"./index-
|
|
1
|
+
import{u as e}from"./book-CAuFl1ig.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{o as n}from"./index-D-H0_zTz.js";import{I as r,i,n as a,r as o,t as s}from"./book-links-POwyHx-T.js";import{n as c,t as l}from"./book-view-9jg75Op3.js";import{n as u,t as d}from"./unavailable-zzVFaXGP.js";var f=t();function p({books:t}){let n=o();return(0,f.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,f.jsx)(`header`,{className:`db-topnav sticky top-0 z-40 border-b bg-background transition-colors${n?``:` border-transparent`}`,children:(0,f.jsx)(r,{title:`diffbook`,nav:[],showMenu:!1,homeLink:`/`,appearanceControl:(0,f.jsx)(i,{})})}),(0,f.jsxs)(`main`,{className:`mx-auto w-full max-w-5xl flex-1 px-6 py-12`,children:[(0,f.jsx)(`h1`,{className:`mb-8 text-2xl font-bold tracking-tight`,children:`Your library`}),t.length?(0,f.jsx)(`div`,{className:`grid grid-cols-2 gap-6 sm:grid-cols-3 lg:grid-cols-4`,children:t.map(t=>(0,f.jsxs)(e,{to:`/$bookSlug`,params:{bookSlug:t.slug},className:`group flex flex-col gap-2`,children:[(0,f.jsx)(`div`,{className:`flex aspect-[2/3] w-full flex-col items-center justify-center bg-gradient-to-b from-secondary to-accent p-4 text-center shadow-lg transition-shadow group-hover:shadow-xl`,children:(0,f.jsx)(`span`,{className:`text-sm font-bold leading-snug tracking-tight text-secondary-foreground`,children:t.title})}),(0,f.jsx)(`p`,{className:`truncate text-center text-sm font-medium`,children:t.title})]},t.slug))}):(0,f.jsxs)(`p`,{className:`rounded-lg border border-dashed p-6 text-sm text-muted-foreground`,children:[`No books registered. Run `,(0,f.jsx)(`code`,{children:`diffbook add <directory>`}),` to add one.`]})]}),(0,f.jsx)(`footer`,{className:`mt-auto px-4 pb-6 pt-12 text-center text-xs text-muted-foreground`,children:(0,f.jsx)(`p`,{children:`Copyright © 2025 Cloudvoyant`})})]})}function m(){let e=n.useLoaderData();if(`catalog`in e)return(0,f.jsx)(p,{books:e.catalog??[]});if(e.book.unavailable)return(0,f.jsx)(d,{message:e.book.unavailable});let t=e.book.config;if(!t)return null;let r=s(e.book.mode,e.book.book.slug),i=l(e.tree);return t.mode===`book`?(0,f.jsx)(u,{config:t,tree:e.tree,links:r}):e.rendered?(0,f.jsx)(c,{config:t,tree:e.tree,pages:i,links:r,page:e.rendered.page,html:e.rendered.html,toc:e.rendered.toc}):(0,f.jsx)(a,{config:t,tree:e.tree,links:r,currentPath:r.home})}export{m as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEVH.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEVH.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{i as r}from"./index-D-H0_zTz.js";import{n as i,t as a}from"./book-links-POwyHx-T.js";import{n as o,t as s}from"./search-static-BBk4OCV1.js";var c=e(t()),l=n();function u(){let{book:e,tree:t,searchData:n}=r.useLoaderData(),{q:u}=r.useSearch(),d=(0,c.useMemo)(()=>e.config?a(e.mode,e.book.slug):void 0,[e.config,e.mode,e.book.slug]),f=s(u,d,n);return!e.config||!d?null:(0,l.jsx)(i,{config:e.config,tree:t,links:d,currentPath:d.search,children:(0,l.jsx)(o,{action:d.search,query:u,...f})})}export{u as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEVH.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-FVqWAEVH.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{t as r}from"./index-D-H0_zTz.js";import{n as i,t as a}from"./book-links-POwyHx-T.js";import{n as o,t as s}from"./search-static-BBk4OCV1.js";var c=e(t()),l=n();function u(){let{book:e,tree:t,searchData:n}=r.useLoaderData(),{q:u}=r.useSearch(),d=(0,c.useMemo)(()=>e.config?a(e.mode,e.book.slug):void 0,[e.config,e.mode,e.book.slug]),f=s(u,d,n);return!e.config||!d?null:(0,l.jsx)(i,{config:e.config,tree:t,links:d,currentPath:d.search,children:(0,l.jsx)(o,{action:d.search,query:u,...f})})}export{u as component};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as getTree, i as getRenderedPage, n as getBook, t as getAppMode } from "./book-CXMnntxk.js";
|
|
2
2
|
import { createFileRoute, lazyRouteComponent, notFound } from "@tanstack/react-router";
|
|
3
3
|
//#region src/routes/$bookSlug/$.tsx
|
|
4
|
-
var $$splitComponentImporter = () => import("./_-
|
|
4
|
+
var $$splitComponentImporter = () => import("./_-mt_Yy6-c.js");
|
|
5
5
|
var Route = createFileRoute("/$bookSlug/$")({
|
|
6
6
|
loader: async ({ params }) => {
|
|
7
7
|
const mode = await getAppMode();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Route } from "./_-
|
|
2
|
-
import { n as BookDocument, t as pagesFromTree } from "./book-view-
|
|
1
|
+
import { t as Route } from "./_-C6ub-P1E.js";
|
|
2
|
+
import { n as BookDocument, t as pagesFromTree } from "./book-view-CtxTyFBH.js";
|
|
3
3
|
import { t as createBookLinks } from "./book-links-Bf2mPPK2.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/routes/$.tsx?tsr-split=component
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as getTree, i as getRenderedPage, n as getBook } from "./book-CXMnntxk.js";
|
|
2
2
|
import { createFileRoute, lazyRouteComponent, notFound } from "@tanstack/react-router";
|
|
3
3
|
//#region src/routes/$.tsx
|
|
4
|
-
var $$splitComponentImporter = () => import("./_-
|
|
4
|
+
var $$splitComponentImporter = () => import("./_-B5_LccIu.js");
|
|
5
5
|
var Route = createFileRoute("/$")({
|
|
6
6
|
loader: async ({ params }) => {
|
|
7
7
|
const slug = params._splat ?? "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Route } from "./_-
|
|
2
|
-
import { n as BookDocument, t as pagesFromTree } from "./book-view-
|
|
1
|
+
import { t as Route } from "./_-1L9ZXE-q.js";
|
|
2
|
+
import { n as BookDocument, t as pagesFromTree } from "./book-view-CtxTyFBH.js";
|
|
3
3
|
import { t as createBookLinks } from "./book-links-Bf2mPPK2.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/routes/$bookSlug/$.tsx?tsr-split=component
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Route } from "./_bookSlug-
|
|
2
|
-
import { n as BookDocument, t as pagesFromTree } from "./book-view-
|
|
1
|
+
import { t as Route } from "./_bookSlug-DchAAhuW.js";
|
|
2
|
+
import { n as BookDocument, t as pagesFromTree } from "./book-view-CtxTyFBH.js";
|
|
3
3
|
import { n as DocsHome, t as createBookLinks } from "./book-links-Bf2mPPK2.js";
|
|
4
4
|
import { n as BookHome, t as Unavailable } from "./unavailable-0XWFBxtd.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as getTree, i as getRenderedPage, n as getBook, t as getAppMode } from "./book-CXMnntxk.js";
|
|
2
2
|
import { createFileRoute, lazyRouteComponent, notFound } from "@tanstack/react-router";
|
|
3
3
|
//#region src/routes/$bookSlug/index.tsx
|
|
4
|
-
var $$splitComponentImporter = () => import("./_bookSlug-
|
|
4
|
+
var $$splitComponentImporter = () => import("./_bookSlug-D0xcN6QO.js");
|
|
5
5
|
var Route = createFileRoute("/$bookSlug/")({
|
|
6
6
|
loader: async ({ params }) => {
|
|
7
7
|
if (await getAppMode() !== "registry") {
|
|
@@ -12,7 +12,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
12
12
|
"/$bookSlug/"
|
|
13
13
|
],
|
|
14
14
|
preloads: [
|
|
15
|
-
"/assets/index-
|
|
15
|
+
"/assets/index-D-H0_zTz.js",
|
|
16
16
|
"/assets/rolldown-runtime-Dd_uD5pT.js",
|
|
17
17
|
"/assets/react-FVqWAEVH.js",
|
|
18
18
|
"/assets/client-DFmNPiUt.js",
|
|
@@ -24,16 +24,16 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
24
24
|
scripts: [{ attrs: {
|
|
25
25
|
type: "module",
|
|
26
26
|
async: !0,
|
|
27
|
-
src: "/assets/index-
|
|
27
|
+
src: "/assets/index-D-H0_zTz.js"
|
|
28
28
|
} }]
|
|
29
29
|
},
|
|
30
30
|
"/": {
|
|
31
31
|
filePath: "/home/runner/work/diffbook/diffbook/apps/book/src/routes/index.tsx",
|
|
32
32
|
children: void 0,
|
|
33
33
|
preloads: [
|
|
34
|
-
"/assets/routes-
|
|
34
|
+
"/assets/routes-D9MJ7Eom.js",
|
|
35
35
|
"/assets/book-links-POwyHx-T.js",
|
|
36
|
-
"/assets/book-view-
|
|
36
|
+
"/assets/book-view-9jg75Op3.js",
|
|
37
37
|
"/assets/unavailable-zzVFaXGP.js"
|
|
38
38
|
]
|
|
39
39
|
},
|
|
@@ -41,16 +41,16 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
41
41
|
filePath: "/home/runner/work/diffbook/diffbook/apps/book/src/routes/$.tsx",
|
|
42
42
|
children: void 0,
|
|
43
43
|
preloads: [
|
|
44
|
-
"/assets/_-
|
|
44
|
+
"/assets/_-DlbH9o0D.js",
|
|
45
45
|
"/assets/book-links-POwyHx-T.js",
|
|
46
|
-
"/assets/book-view-
|
|
46
|
+
"/assets/book-view-9jg75Op3.js"
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"/search": {
|
|
50
50
|
filePath: "/home/runner/work/diffbook/diffbook/apps/book/src/routes/search.tsx",
|
|
51
51
|
children: void 0,
|
|
52
52
|
preloads: [
|
|
53
|
-
"/assets/search-
|
|
53
|
+
"/assets/search-B4jRzfu8.js",
|
|
54
54
|
"/assets/book-links-POwyHx-T.js",
|
|
55
55
|
"/assets/search-static-BBk4OCV1.js"
|
|
56
56
|
]
|
|
@@ -59,16 +59,16 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
59
59
|
filePath: "/home/runner/work/diffbook/diffbook/apps/book/src/routes/$bookSlug/$.tsx",
|
|
60
60
|
children: void 0,
|
|
61
61
|
preloads: [
|
|
62
|
-
"/assets/_-
|
|
62
|
+
"/assets/_-BxvhSqUx.js",
|
|
63
63
|
"/assets/book-links-POwyHx-T.js",
|
|
64
|
-
"/assets/book-view-
|
|
64
|
+
"/assets/book-view-9jg75Op3.js"
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"/$bookSlug/search": {
|
|
68
68
|
filePath: "/home/runner/work/diffbook/diffbook/apps/book/src/routes/$bookSlug/search.tsx",
|
|
69
69
|
children: void 0,
|
|
70
70
|
preloads: [
|
|
71
|
-
"/assets/search-
|
|
71
|
+
"/assets/search-CC0UJ_Yq.js",
|
|
72
72
|
"/assets/book-links-POwyHx-T.js",
|
|
73
73
|
"/assets/search-static-BBk4OCV1.js"
|
|
74
74
|
]
|
|
@@ -77,9 +77,9 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
77
77
|
filePath: "/home/runner/work/diffbook/diffbook/apps/book/src/routes/$bookSlug/index.tsx",
|
|
78
78
|
children: void 0,
|
|
79
79
|
preloads: [
|
|
80
|
-
"/assets/_bookSlug-
|
|
80
|
+
"/assets/_bookSlug-C22DaBn6.js",
|
|
81
81
|
"/assets/book-links-POwyHx-T.js",
|
|
82
|
-
"/assets/book-view-
|
|
82
|
+
"/assets/book-view-9jg75Op3.js",
|
|
83
83
|
"/assets/unavailable-zzVFaXGP.js"
|
|
84
84
|
]
|
|
85
85
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createServerFn } from "../server.js";
|
|
2
|
-
import { a as readRegistry, c as renderArticle, n as resolveSourceContext, o as rehypeCollectToc, r as GitBookUnavailableError, s as rehypeMarkMermaid, t as currentSourceMode, u as rehypeSlug } from "./source-mode-
|
|
2
|
+
import { a as readRegistry, c as renderArticle, n as resolveSourceContext, o as rehypeCollectToc, r as GitBookUnavailableError, s as rehypeMarkMermaid, t as currentSourceMode, u as rehypeSlug } from "./source-mode-4uG8Ej3e.js";
|
|
3
3
|
import { I as mdxComponents } from "./dist-Dum_xO7d.js";
|
|
4
4
|
import { t as createServerRpc } from "./createServerRpc-DwsoH1hp.js";
|
|
5
5
|
import * as jsxRuntime from "react/jsx-runtime";
|
|
@@ -355,11 +355,13 @@ var getRenderedPage = createServerFn({ method: "GET" }).validator((data) => data
|
|
|
355
355
|
toc
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
+
const base = (process.env.DIFFBOOK_BASE ?? "/").replace(/\/$/, "");
|
|
358
359
|
return {
|
|
359
360
|
page,
|
|
360
361
|
...await renderArticle(page.body, {
|
|
361
362
|
slug: page.slug,
|
|
362
|
-
document: context.links.document
|
|
363
|
+
document: context.links.document,
|
|
364
|
+
base
|
|
363
365
|
})
|
|
364
366
|
};
|
|
365
367
|
});
|
|
@@ -4,18 +4,6 @@ import { useEffect, useRef } from "react";
|
|
|
4
4
|
import { useRouter } from "@tanstack/react-router";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/article-body.tsx
|
|
7
|
-
/**
|
|
8
|
-
* Renders an article whose body was turned into Shiki-highlighted HTML on the
|
|
9
|
-
* server (Diffbook's `renderArticle` or MDX bridge). The HTML is mounted directly — no
|
|
10
|
-
* `run()`/`eval`, so it works under a strict CSP. A client effect progressively
|
|
11
|
-
* enhances it: a copy button per code block, and mermaid rendering for
|
|
12
|
-
* `pre.mermaid` blocks (mermaid itself still uses eval, so diagrams are the one
|
|
13
|
-
* piece that a strict CSP can block — code and prose are unaffected).
|
|
14
|
-
*
|
|
15
|
-
* The effect also intercepts internal in-content links and routes them through
|
|
16
|
-
* the router for client-side, basepath-aware navigation;
|
|
17
|
-
* same-page `#fragment` links scroll in place instead of navigating.
|
|
18
|
-
*/
|
|
19
7
|
function ArticleBody({ html }) {
|
|
20
8
|
const ref = useRef(null);
|
|
21
9
|
const router = useRouter();
|
|
@@ -47,7 +35,7 @@ function ArticleBody({ html }) {
|
|
|
47
35
|
const to = base && (href === base || href.startsWith(`${base}/`)) ? href.slice(base.length) || "/" : href;
|
|
48
36
|
router.navigate({ to });
|
|
49
37
|
};
|
|
50
|
-
root.addEventListener("click", onClick, true);
|
|
38
|
+
if (onClick) root.addEventListener("click", onClick, true);
|
|
51
39
|
let cancelled = false;
|
|
52
40
|
const isCancelled = () => cancelled;
|
|
53
41
|
const paint = () => {
|
|
@@ -61,7 +49,7 @@ function ArticleBody({ html }) {
|
|
|
61
49
|
});
|
|
62
50
|
return () => {
|
|
63
51
|
cancelled = true;
|
|
64
|
-
root.removeEventListener("click", onClick, true);
|
|
52
|
+
if (onClick) root.removeEventListener("click", onClick, true);
|
|
65
53
|
observer.disconnect();
|
|
66
54
|
};
|
|
67
55
|
}, [html, router]);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as getAppMode } from "./book-CXMnntxk.js";
|
|
2
|
-
import { t as Route$2 } from "./routes-
|
|
3
|
-
import { t as Route$3 } from "./_-
|
|
2
|
+
import { t as Route$2 } from "./routes-DONi2ZXD.js";
|
|
3
|
+
import { t as Route$3 } from "./_-C6ub-P1E.js";
|
|
4
4
|
import { t as Route$4 } from "./search-WKn1ukuf.js";
|
|
5
|
-
import { t as Route$5 } from "./_bookSlug-
|
|
6
|
-
import { t as Route$6 } from "./_-
|
|
5
|
+
import { t as Route$5 } from "./_bookSlug-DchAAhuW.js";
|
|
6
|
+
import { t as Route$6 } from "./_-1L9ZXE-q.js";
|
|
7
7
|
import { t as Route$7 } from "./search-B9QT-xba.js";
|
|
8
|
-
import { i as LocalBookSource, n as resolveSourceContext, t as currentSourceMode } from "./source-mode-
|
|
8
|
+
import { i as LocalBookSource, n as resolveSourceContext, t as currentSourceMode } from "./source-mode-4uG8Ej3e.js";
|
|
9
9
|
import { useEffect, useState } from "react";
|
|
10
10
|
import { HeadContent, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, useRouter, useRouterState } from "@tanstack/react-router";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as getTree, i as getRenderedPage, n as getBook, r as getCatalog } from "./book-CXMnntxk.js";
|
|
2
2
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
3
3
|
//#region src/routes/index.tsx
|
|
4
|
-
var $$splitComponentImporter = () => import("./routes-
|
|
4
|
+
var $$splitComponentImporter = () => import("./routes-DlesMb9O.js");
|
|
5
5
|
var Route = createFileRoute("/")({
|
|
6
6
|
loader: async () => {
|
|
7
7
|
const catalog = await getCatalog();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Route } from "./routes-
|
|
1
|
+
import { t as Route } from "./routes-DONi2ZXD.js";
|
|
2
2
|
import { P as Navbar } from "./dist-Dum_xO7d.js";
|
|
3
|
-
import { n as BookDocument, t as pagesFromTree } from "./book-view-
|
|
3
|
+
import { n as BookDocument, t as pagesFromTree } from "./book-view-CtxTyFBH.js";
|
|
4
4
|
import { i as SettingsDialog, n as DocsHome, r as useScrolled, t as createBookLinks } from "./book-links-Bf2mPPK2.js";
|
|
5
5
|
import { n as BookHome, t as Unavailable } from "./unavailable-0XWFBxtd.js";
|
|
6
6
|
import { Link } from "@tanstack/react-router";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createServerFn } from "../server.js";
|
|
2
|
-
import { l as searchBookPages, n as resolveSourceContext, t as currentSourceMode } from "./source-mode-
|
|
2
|
+
import { l as searchBookPages, n as resolveSourceContext, t as currentSourceMode } from "./source-mode-4uG8Ej3e.js";
|
|
3
3
|
import { t as createServerRpc } from "./createServerRpc-DwsoH1hp.js";
|
|
4
4
|
//#region src/server/search.ts?tss-serverfn-split
|
|
5
5
|
var searchBook_createServerFn_handler = createServerRpc({
|
|
@@ -31018,7 +31018,15 @@ function rehypeRewriteLinks(ctx) {
|
|
|
31018
31018
|
visit(tree, "element", (node) => {
|
|
31019
31019
|
if (node.tagName !== "a") return;
|
|
31020
31020
|
const raw = node.properties?.href;
|
|
31021
|
-
if (typeof raw !== "string"
|
|
31021
|
+
if (typeof raw !== "string") return;
|
|
31022
|
+
if (ctx.base && raw.startsWith("/") && !raw.startsWith("//") && raw !== ctx.base && !raw.startsWith(`${ctx.base}/`)) {
|
|
31023
|
+
node.properties = {
|
|
31024
|
+
...node.properties,
|
|
31025
|
+
href: `${ctx.base}${raw}`
|
|
31026
|
+
};
|
|
31027
|
+
return;
|
|
31028
|
+
}
|
|
31029
|
+
if (isNonRelativeHref(raw)) return;
|
|
31022
31030
|
const suffixMatch = /[#?].*$/.exec(raw);
|
|
31023
31031
|
const suffix = suffixMatch ? suffixMatch[0] : "";
|
|
31024
31032
|
const pathPart = suffix ? raw.slice(0, raw.length - suffix.length) : raw;
|
|
@@ -31204,7 +31212,7 @@ function currentSourceMode() {
|
|
|
31204
31212
|
return mode === "project" || mode === "static" ? mode : "registry";
|
|
31205
31213
|
}
|
|
31206
31214
|
function links(mode, bookSlug) {
|
|
31207
|
-
const prefix = mode === "registry" && bookSlug ? `/${bookSlug}` : ""
|
|
31215
|
+
const prefix = `${(process.env.DIFFBOOK_BASE ?? "/").replace(/\/$/, "")}${mode === "registry" && bookSlug ? `/${bookSlug}` : ""}`;
|
|
31208
31216
|
const document = (slug) => {
|
|
31209
31217
|
const normalized = slug.replace(/^\/+|\/+$/g, "");
|
|
31210
31218
|
return normalized ? `${prefix}/${normalized}` : prefix || "/";
|
package/dist/server/server.js
CHANGED
|
@@ -3594,7 +3594,7 @@ var defaultSerovalPlugins = [
|
|
|
3594
3594
|
* the dev styles URL for route-scoped CSS collection.
|
|
3595
3595
|
*/
|
|
3596
3596
|
async function getStartManifest(matchedRoutes) {
|
|
3597
|
-
const { tsrStartManifest } = await import("./assets/_tanstack-start-manifest_v-
|
|
3597
|
+
const { tsrStartManifest } = await import("./assets/_tanstack-start-manifest_v-Cu2WkYA2.js");
|
|
3598
3598
|
const startManifest = tsrStartManifest();
|
|
3599
3599
|
let routes = startManifest.routes;
|
|
3600
3600
|
routes[rootRouteId];
|
|
@@ -3618,31 +3618,31 @@ async function getStartManifest(matchedRoutes) {
|
|
|
3618
3618
|
var manifest = {
|
|
3619
3619
|
"3f29b402143f5f71892967ea7bf5954237905ecb40c9be07215916a222d6fd8e": {
|
|
3620
3620
|
functionName: "getCatalog_createServerFn_handler",
|
|
3621
|
-
importer: () => import("./assets/book-
|
|
3621
|
+
importer: () => import("./assets/book-mMc--P1C.js")
|
|
3622
3622
|
},
|
|
3623
3623
|
"4716699d9a9992d8bfbc79aca5d0e092a3715ea2be0688784405c139fb6bedd0": {
|
|
3624
3624
|
functionName: "getTree_createServerFn_handler",
|
|
3625
|
-
importer: () => import("./assets/book-
|
|
3625
|
+
importer: () => import("./assets/book-mMc--P1C.js")
|
|
3626
3626
|
},
|
|
3627
3627
|
"76c6cbe6bafe3d837829b67f9530def4cd807fb9666d2a796582881558b0329a": {
|
|
3628
3628
|
functionName: "searchBook_createServerFn_handler",
|
|
3629
|
-
importer: () => import("./assets/search-
|
|
3629
|
+
importer: () => import("./assets/search-BsCSJT7J.js")
|
|
3630
3630
|
},
|
|
3631
3631
|
"b3d861154ecb7779bebdfc1368eda9f5ebe0b7ab9cfdbbd824b0de67b11de6fe": {
|
|
3632
3632
|
functionName: "getBook_createServerFn_handler",
|
|
3633
|
-
importer: () => import("./assets/book-
|
|
3633
|
+
importer: () => import("./assets/book-mMc--P1C.js")
|
|
3634
3634
|
},
|
|
3635
3635
|
"c12cd95602f5ab3286987207732f6ae40e4df5559ae1cd1ddfd461ac9474264c": {
|
|
3636
3636
|
functionName: "getRenderedPage_createServerFn_handler",
|
|
3637
|
-
importer: () => import("./assets/book-
|
|
3637
|
+
importer: () => import("./assets/book-mMc--P1C.js")
|
|
3638
3638
|
},
|
|
3639
3639
|
"d8862ad8bb0ba5cd129ec684eec14170424bd5a85fc84bd84e24d32b2db54c2d": {
|
|
3640
3640
|
functionName: "getPage_createServerFn_handler",
|
|
3641
|
-
importer: () => import("./assets/book-
|
|
3641
|
+
importer: () => import("./assets/book-mMc--P1C.js")
|
|
3642
3642
|
},
|
|
3643
3643
|
"e857d6f9a3cc81796d517d2ba0206bbba7f56140652baea392b24b56fbc0ce62": {
|
|
3644
3644
|
functionName: "getAppMode_createServerFn_handler",
|
|
3645
|
-
importer: () => import("./assets/book-
|
|
3645
|
+
importer: () => import("./assets/book-mMc--P1C.js")
|
|
3646
3646
|
}
|
|
3647
3647
|
};
|
|
3648
3648
|
async function getServerFnById(id, access) {
|
|
@@ -5520,7 +5520,7 @@ var getBaseManifest = getProdBaseManifest;
|
|
|
5520
5520
|
var createEarlyHintsForRequest = createEarlyHintsCollector;
|
|
5521
5521
|
async function loadEntries() {
|
|
5522
5522
|
const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
|
|
5523
|
-
import("./assets/router-
|
|
5523
|
+
import("./assets/router-BnmwNZcP.js"),
|
|
5524
5524
|
import("./assets/start-n8qSJ9CO.js"),
|
|
5525
5525
|
import("./assets/empty-plugin-adapters-BWkUiWlQ.js")
|
|
5526
5526
|
]);
|
package/package.json
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"tailwind-merge": "^3.0.2",
|
|
38
38
|
"tailwindcss": "^4.1.18",
|
|
39
39
|
"tw-animate-css": "^1.3.6",
|
|
40
|
-
"diffbook-core": "0.10.
|
|
41
|
-
"diffbook-ui": "0.10.
|
|
40
|
+
"diffbook-core": "0.10.2",
|
|
41
|
+
"diffbook-ui": "0.10.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@playwright/test": "^1.57.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
|
-
"version": "0.10.
|
|
63
|
+
"version": "0.10.2",
|
|
64
64
|
"scripts": {
|
|
65
65
|
"dev": "vite dev --port 3000",
|
|
66
66
|
"build": "vite build",
|