1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./not-found-i5RsCZif.js";import{t as r}from"./jsx-runtime-BdxMnOeJ.js";import{a as i,c as a,o,t as s}from"./useSelector-CZh_0VLF.js";var c=`__root__`,l=e(t(),1),u=r(),d=class extends l.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?l.createElement(this.props.errorComponent??f,{error:e[0],reset:this.reset}):this.props.children}};function f({error:e}){let[t,n]=l.useState(!1);return(0,u.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,u.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,u.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,u.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,u.jsx)(`div`,{children:(0,u.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,u.jsx)(`code`,{children:e.message}):null})}):null]})}function p(e){let t=o(),r=`not-found-${s(t.stores.location,e=>e.pathname)}-${s(t.stores.status)}`;return(0,u.jsx)(d,{getResetKey:()=>r,onCatch:(t,r)=>{if(n(t))e.onCatch?.(t,r);else throw t},errorComponent:({error:t})=>{if(n(t))return e.fallback?.(t);throw t},children:e.children})}function m(){return(0,u.jsx)(`p`,{children:`Not Found`})}function h(e,t,n){return t.options.notFoundComponent?(0,u.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,u.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,u.jsx)(m,{})}function g(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,u.jsx)(n,{}):null}var _=(e,t)=>
1e[0]===t[0]&&e[1]===t[1],v=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,y=l.memo(function({routeId:e}){let t=o();return(0,u.jsx)(b,{router:t,match:s(t.stores.getMatchStore(e))})});function b({router:e,match:t}){let r=e.routesById[t.routeId],o=g(e,r),s=r.options.errorComponent??e.options.defaultErrorComponent,c=r.options.onCatch??e.options.defaultOnCatch,f=r.isRoot?r.options.notFoundComponent??e.options.notFoundRoute?.options.component:r.options.notFoundComponent,m=t.ssr===!1||t.ssr===`data-only`,h=v(e,r,t.ssr)&&(r.options.wrapInSuspense??o??(r.options.errorComponent?.preload||m)),_=(0,u.jsx)(x,{match:t});m&&(_=(0,u.jsx)(a,{fallback:o,children:_})),f&&(_=(0,u.jsx)(p,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return l.createElement(f,e)},children:_})),s&&(_=(0,u.jsx)(d,{getResetKey:()=>t,errorComponent:s,onCatch:(e,r)=>{if(n(e))throw e.routeId??=t.routeId,e;c?.(e,r)},children:_})),h&&(_=(0,u.jsx)(l.Suspense,{fallback:o,children:_}));let y=r.isRoot?r.options.shellComponent:void 0;return(0,u.jsx)(i.Provider,{value:t.routeId,children:y?(0,u.jsxs)(y,{children:[_,null]}):(0,u.jsxs)(u.Fragment,{children:[_,null]})})}var x=l.memo(function({match:e}){let t=o(),n=e.routeId,r=t.routesById[n],i=l.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=l.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,u.jsx)(e,{},i):(0,u.jsx)(S,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!v(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return g(t,r)}if(e.status===`notFound`)return h(t,r,e.error);if(e.status===`error`)throw e.error;return a}),S=l.memo(function(){let e=o(),t=l.useContext(i),n,r,a;{let i=e.stores.getMatchStore(t);[n,r]=s(i,e=>[!!e._notFound,e.error],{compare:_}),a=s(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return h(e,e.routesById[t],r);if(!a)return null;let c=(0,u.jsx)(y,{routeId:a});return t===`__root__`?(0,u.jsx)(l.Suspense,{fallback:g(e),children:c}):c});export{c as a,d as i,S as n,g as r,y as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.