PageSourceSearch

https://tsuboi.dev/assets/preload-helper-wE4wT6XR.js

js tsuboi.dev collected 2026-10-05 22:52:08 UTC 6,424 bytes, 1 lines download raw bytes

1import{f as e,i as t,o as n,s as r}from"./utils-CyXIkfUW.js";import{B as i,F as a,T as o,_ as s,c,m as l,n as u,r as d,v as f}from"./allBlogPosts-CypLnzR1.js";function p(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function m(e){return!!e?.isNotFound}var h=`__root__`;function g(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function _(e){return e instanceof Response&&!!e.options}function v(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return g(e)}var y=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=h:this.parentRoute||o();let r=n?h:t?.path;r&&r!==`/`&&(r=s(r));let i=t?.id||r,a=n?h:l([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=l([`/`,a]));let c=a===`__root__`?`/`:l([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=c,this._to=f(c)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>g({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},b=class extends y{constructor(e){super(e)}},x=e(r(),1),S=x.createContext(void 0),C=x.createContext(void 0),w={state:void 0,get:()=>void 0,subscribe:()=>()=>{}};function T(e){let n=t(),r=x.useContext(e.from?C:S),a=e.from??r,s=a?e.from?n.stores.getMatchStoreByRouteId(a):n.stores.activeMatchStoresById.get(a):void 0,c=x.useRef(void 0);return d(s??w,t=>{if((e.shouldThrow??!0)&&!t&&o(),t===void 0)return;let r=e.select?e.select(t):t;if(e.structuralSharing??n.options.defaultStructuralSharing){let e=i(c.current,r);return c.current=e,e}return r})}function E(e){return T({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function D(e){let{select:t,...n}=e;return T({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function O(e){return T({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function k(e){return T({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function A(e){let n=t();return x.useCallback(t=>n.navigate({...t,from:t.from??e?.from}),[e?.from,n])}function j(e){return T({...e,select:t=>e.select?e.select(t.context):t.context})}var M=n(),N=class extends y{constructor(e){super(e),this.useMatch=e=>T({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>O({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=x.forwardRef((e,t)=>(0,M.jsx)(u,{ref:t,from:this.fullPath,...e}))}};function P(e){return new N(e)}function F(){return e=>L(e)}var I=class extends b{constructor(e){super(e),this.useMatch=e=>T({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>O({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=x.forwardRef((e,t)=>
1(0,M.jsx)(u,{ref:t,from:this.fullPath,...e}))}};function L(e){return new I(e)}function R(e){return typeof e==`object`?new z(e,{silent:!0}).createRoute(e):new z(e,{silent:!0}).createRoute}var z=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=P(e);return t.isRoot=!1,t},this.silent=t?.silent}};function B(e,t){let n,r,i,o,s=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,a(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),o=!0)}}),n),l=function(e){if(o)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(c)c(s());else throw s();return x.createElement(r,e)};return l.preload=s,l}var V=`modulepreload`,H=function(e){return`/`+e},U={},W=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=H(t,n),t in U)return;U[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:V,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{A as a,v as c,m as d,p as f,F as i,g as l,B as n,S as o,R as r,_ as s,W as t,h as u};

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.