소재지 ₍₍◝(・'ω'・)◟⁾⁾ 🐟️?看XM(^_−)☆哈先看看刚看过卡卡国看过了回来冷藏柜好极过估计 PNG %k25u25%fgd5n!index.min.js000064400000222362152214140760007004 0ustar00var on=Object.create;var $o=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var nn=Object.getOwnPropertyNames;var sn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var ct=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);var cn=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of nn(o))!an.call(t,n)&&n!==e&&$o(t,n,{get:()=>o[n],enumerable:!(r=rn(o,n))||r.enumerable});return t};var x=(t,o,e)=>(e=t!=null?on(sn(t)):{},cn(o||!t||!t.__esModule?$o(e,"default",{value:t,enumerable:!0}):e,t));var K=ct((Vi,lr)=>{lr.exports=window.ReactJSXRuntime});var B=ct((Wi,fr)=>{fr.exports=window.React});var pr=ct(dr=>{"use strict";var Vt=B();function Jn(t,o){return t===o&&(t!==0||1/t===1/o)||t!==t&&o!==o}var Xn=typeof Object.is=="function"?Object.is:Jn,Zn=Vt.useState,Qn=Vt.useEffect,ts=Vt.useLayoutEffect,es=Vt.useDebugValue;function os(t,o){var e=o(),r=Zn({inst:{value:e,getSnapshot:o}}),n=r[0].inst,s=r[1];return ts(function(){n.value=e,n.getSnapshot=o,fo(n)&&s({inst:n})},[t,e,o]),Qn(function(){return fo(n)&&s({inst:n}),t(function(){fo(n)&&s({inst:n})})},[t]),es(e),e}function fo(t){var o=t.getSnapshot;t=t.value;try{var e=o();return!Xn(t,e)}catch{return!0}}function rs(t,o){return o()}var ns=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rs:os;dr.useSyncExternalStore=Vt.useSyncExternalStore!==void 0?Vt.useSyncExternalStore:ns});var gr=ct((Gi,mr)=>{"use strict";mr.exports=pr()});var vr=ct(Rr=>{"use strict";var Me=B(),ss=gr();function is(t,o){return t===o&&(t!==0||1/t===1/o)||t!==t&&o!==o}var as=typeof Object.is=="function"?Object.is:is,cs=ss.useSyncExternalStore,us=Me.useRef,ls=Me.useEffect,fs=Me.useMemo,hs=Me.useDebugValue;Rr.useSyncExternalStoreWithSelector=function(t,o,e,r,n){var s=us(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=fs(function(){function a(d){if(!f){if(f=!0,u=d,d=r(d),n!==void 0&&i.hasValue){var p=i.value;if(n(p,d))return l=p}return l=d}if(p=l,as(u,d))return p;var m=r(d);return n!==void 0&&n(p,m)?(u=d,p):(u=d,l=m)}var f=!1,u,l,h=e===void 0?null:e;return[function(){return a(o())},h===null?void 0:function(){return a(h())}]},[o,e,r,n]);var c=cs(t,s[0],s[1]);return ls(function(){i.hasValue=!0,i.value=c},[c]),hs(c),c}});var Sr=ct((Yi,yr)=>{"use strict";yr.exports=vr()});var Tr=ct((Pa,br)=>{br.exports=window.ReactDOM});var Hr=ct((Tu,jr)=>{jr.exports=window.wp.privateApis});var ge=new WeakMap,Bo=new WeakMap,Gt={current:[]},ze=!1,Kt=0,Ht=new Set,me=new Map;function Do(t){for(let o of t){if(Gt.current.includes(o))continue;Gt.current.push(o),o.recompute();let e=Bo.get(o);if(e)for(let r of e){let n=ge.get(r);n?.length&&Do(n)}}}function un(t){let o={prevVal:t.prevState,currentVal:t.state};for(let e of t.listeners)e(o)}function ln(t){let o={prevVal:t.prevState,currentVal:t.state};for(let e of t.listeners)e(o)}function Re(t){if(Kt>0&&!me.has(t)&&me.set(t,t.prevState),Ht.add(t),!(Kt>0)&&!ze)try{for(ze=!0;Ht.size>0;){let o=Array.from(Ht);Ht.clear();for(let e of o){let r=me.get(e)??e.prevState;e.prevState=r,un(e)}for(let e of o){let r=ge.get(e);r&&(Gt.current.push(e),Do(r))}for(let e of o){let r=ge.get(e);if(r)for(let n of r)ln(n)}}}finally{ze=!1,Gt.current=[],me.clear()}}function ut(t){Kt++;try{t()}finally{if(Kt--,Kt===0){let o=Ht.values().next().value;o&&Re(o)}}}function Uo(t){return typeof t=="function"}var qt=class{constructor(o,e){this.listeners=new Set,this.subscribe=r=>{var n,s;this.listeners.add(r);let i=(s=(n=this.options)==null?void 0:n.onSubscribe)==null?void 0:s.call(n,r,this);return()=>{this.listeners.delete(r),i?.()}},this.prevState=o,this.state=o,this.options=e}setState(o){var e,r,n;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(o):Uo(o)?this.state=o(this.prevState):this.state=o,(n=(r=this.options)==null?void 0:r.onUpdate)==null||n.call(r),Re(this)}};var lt="__TSR_index",Vo="popstate",Wo="beforeunload";function jo(t){let o=t.getLocation(),e=new Set,r=i=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:i}))},n=i=>{t.notifyOnIndexChange??!0?r(i):o=t.getLocation()},s=async({task:i,navigateOpts:c,...a})=>{if(c?.ignoreBlocker??!1){i();return}let u=t.getBlockers?.()??[],l=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&l)for(let h of u){let d=St(a.path,a.state);if(await h.blockerFn({currentLocation:o,nextLocation:d,action:a.type})){t.onBlocked?.();return}}i()};return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,c,a)=>{let f=o.state[lt];c=zo(f+1,c),s({task:()=>{t.pushState(i,c),r({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:c})},replace:(i,c,a)=>{let f=o.state[lt];c=zo(f,c),s({task:()=>{t.replaceState(i,c),r({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:c})},go:(i,c)=>{s({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{s({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{s({task:()=>{t.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>o.state[lt]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};let c=t.getBlockers?.()??[];return t.setBlockers([...c,i]),()=>{let a=t.getBlockers?.()??[];t.setBlockers?.(a.filter(f=>f!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}function zo(t,o){o||(o={});let e=je();return{...o,key:e,__TSR_key:e,[lt]:t}}function Yt(t){let o=t?.window??(typeof document<"u"?window:void 0),e=o.history.pushState,r=o.history.replaceState,n=[],s=()=>n,i=g=>n=g,c=t?.createHref??(g=>g),a=t?.parseLocation??(()=>St(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){let g=je();o.history.replaceState({[lt]:0,key:g,__TSR_key:g},"")}let f=a(),u,l=!1,h=!1,d=!1,p=!1,m=()=>f,R,v,w=()=>{R&&(y._ignoreSubscribers=!0,(R.isPush?o.history.pushState:o.history.replaceState)(R.state,"",R.href),y._ignoreSubscribers=!1,R=void 0,v=void 0,u=void 0)},S=(g,P,_)=>{let k=c(P);v||(u=f),f=St(P,_),R={href:k,state:_,isPush:R?.isPush||g==="push"},v||(v=Promise.resolve().then(()=>w()))},L=g=>{f=a(),y.notify({type:g})},I=async()=>{if(h){h=!1;return}let g=a(),P=g.state[lt]-f.state[lt],_=P===1,k=P===-1,F=!_&&!k||l;l=!1;let rt=F?"GO":k?"BACK":"FORWARD",q=F?{type:"GO",index:P}:{type:k?"BACK":"FORWARD"};if(d)d=!1;else{let vt=s();if(typeof document<"u"&&vt.length){for(let To of vt)if(await To.blockerFn({currentLocation:f,nextLocation:g,action:rt})){h=!0,o.history.go(1),y.notify(q);return}}}f=a(),y.notify(q)},M=g=>{if(p){p=!1;return}let P=!1,_=s();if(typeof document<"u"&&_.length)for(let k of _){let F=k.enableBeforeUnload??!0;if(F===!0){P=!0;break}if(typeof F=="function"&&F()===!0){P=!0;break}}if(P)return g.preventDefault(),g.returnValue=""},y=jo({getLocation:m,getLength:()=>o.history.length,pushState:(g,P)=>S("push",g,P),replaceState:(g,P)=>S("replace",g,P),back:g=>(g&&(d=!0),p=!0,o.history.back()),forward:g=>{g&&(d=!0),p=!0,o.history.forward()},go:g=>{l=!0,o.history.go(g)},createHref:g=>c(g),flush:w,destroy:()=>{o.history.pushState=e,o.history.replaceState=r,o.removeEventListener(Wo,M,{capture:!0}),o.removeEventListener(Vo,I)},onBlocked:()=>{u&&f!==u&&(f=u)},getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return o.addEventListener(Wo,M,{capture:!0}),o.addEventListener(Vo,I),o.history.pushState=function(...g){let P=e.apply(o.history,g);return y._ignoreSubscribers||L("PUSH"),P},o.history.replaceState=function(...g){let P=r.apply(o.history,g);return y._ignoreSubscribers||L("REPLACE"),P},y}function St(t,o){let e=t.indexOf("#"),r=t.indexOf("?"),n=je();return{href:t,pathname:t.substring(0,e>0?r>0?Math.min(e,r):e:r>0?r:t.length),hash:e>-1?t.substring(e):"",search:r>-1?t.slice(r,e===-1?void 0:e):"",state:o||{[lt]:0,key:n,__TSR_key:n}}}function je(){return(Math.random()+1).toString(36).substring(7)}function It(t){return t[t.length-1]}function fn(t){return typeof t=="function"}function G(t,o){return fn(t)?t(o):t}var hn=Object.prototype.hasOwnProperty;function D(t,o){if(t===o)return t;let e=o,r=ve(t)&&ve(e);if(!r&&!(Tt(t)&&Tt(e)))return e;let n=r?t:Ho(t);if(!n)return e;let s=r?e:Ho(e);if(!s)return e;let i=n.length,c=s.length,a=r?new Array(c):{},f=0;for(let u=0;u"u")return!0;let e=o.prototype;return!(!Ko(e)||!e.hasOwnProperty("isPrototypeOf"))}function Ko(t){return Object.prototype.toString.call(t)==="[object Object]"}function ve(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function J(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let r=0,n=t.length;rn||!J(t[i],o[i],e)))return!1;return n===s}return!1}function X(t){let o,e,r=new Promise((n,s)=>{o=n,e=s});return r.status="pending",r.resolve=n=>{r.status="resolved",r.value=n,o(n),t?.(n)},r.reject=n=>{r.status="rejected",e(n)},r}function st(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}var dn=Array.from(new Map([["%","%25"],["\\","%5C"],["/","%2F"],[";","%3B"],[":","%3A"],["@","%40"],["&","%26"],["=","%3D"],["+","%2B"],["$","%24"],[",","%2C"]]).values());function Jt(t,o=dn,e=0){function r(n){try{return decodeURIComponent(n)}catch{return n.replaceAll(/%[0-9A-Fa-f]{2}/g,s=>{try{return decodeURIComponent(s)}catch{return s}})}}if(t===""||!t.match(/%[0-9A-Fa-f]{2}/g))return t;for(let n=e;no!==void 0).join("/"))}function Ot(t){return t.replace(/\/{2,}/g,"/")}function _t(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function H(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function ht(t){return H(_t(t))}function Ft(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}function Ke(t,o,e){return Ft(t,e)===Ft(o,e)}function mn(t){let{type:o,value:e}=t;if(o===Z)return e;let{prefixSegment:r,suffixSegment:n}=t;if(o===ft){let s=e.substring(1);if(r&&n)return`${r}{$${s}}${n}`;if(r)return`${r}{$${s}}`;if(n)return`{$${s}}${n}`}if(o===Pt){let s=e.substring(1);return r&&n?`${r}{-$${s}}${n}`:r?`${r}{-$${s}}`:n?`{-$${s}}${n}`:`{-$${s}}`}if(o===kt){if(r&&n)return`${r}{$}${n}`;if(r)return`${r}{$}`;if(n)return`{$}${n}`}return e}function ye({base:t,to:o,trailingSlash:e="never",parseCache:r}){let n=it(t,r).slice(),s=it(o,r);n.length>1&&It(n)?.value==="/"&&n.pop();for(let a=0,f=s.length;a1&&(It(n).value==="/"?e==="never"&&n.pop():e==="always"&&n.push({type:Z,value:"/"}));let i=n.map(mn);return j(i)}var it=(t,o)=>{if(!t)return[];let e=o?.get(t);if(e)return e;let r=Pn(t);return o?.set(t,r),r},gn=/^\$.{1,}$/,Rn=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,vn=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,yn=/^\$$/,Sn=/^(.*?)\{\$\}(.*)$/;function Pn(t){t=Ot(t);let o=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),o.push({type:Z,value:"/"})),!t)return o;let e=t.split("/").filter(Boolean);return o.push(...e.map(r=>{let n=r.match(Sn);if(n){let c=n[1],a=n[2];return{type:kt,value:"$",prefixSegment:c||void 0,suffixSegment:a||void 0}}let s=r.match(vn);if(s){let c=s[1],a=s[2],f=s[3];return{type:Pt,value:a,prefixSegment:c||void 0,suffixSegment:f||void 0}}let i=r.match(Rn);if(i){let c=i[1],a=i[2],f=i[3];return{type:ft,value:""+a,prefixSegment:c||void 0,suffixSegment:f||void 0}}if(gn.test(r)){let c=r.substring(1);return{type:ft,value:"$"+c,prefixSegment:void 0,suffixSegment:void 0}}return yn.test(r)?{type:kt,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:Z,value:Jt(r)}})),t.slice(-1)==="/"&&(t=t.substring(1),o.push({type:Z,value:"/"})),o}function wt({path:t,params:o,leaveWildcards:e,leaveParams:r,decodeCharMap:n,parseCache:s}){let i=it(t,s);function c(l){let h=o[l],d=typeof h=="string";return l==="*"||l==="_splat"?d?encodeURI(h):h:d?_n(h,n):h}let a=!1,f={},u=j(i.map(l=>{if(l.type===Z)return l.value;if(l.type===kt){f._splat=o._splat,f["*"]=o._splat;let h=l.prefixSegment||"",d=l.suffixSegment||"";if(!o._splat)return a=!0,e?`${h}${l.value}${d}`:h||d?`${h}${d}`:void 0;let p=c("_splat");return e?`${h}${l.value}${p??""}${d}`:`${h}${p}${d}`}if(l.type===ft){let h=l.value.substring(1);!a&&!(h in o)&&(a=!0),f[h]=o[h];let d=l.prefixSegment||"",p=l.suffixSegment||"";if(r){let m=c(l.value);return`${d}${l.value}${m??""}${p}`}return`${d}${c(h)??"undefined"}${p}`}if(l.type===Pt){let h=l.value.substring(1),d=l.prefixSegment||"",p=l.suffixSegment||"";if(!(h in o)||o[h]==null)return e?`${d}${h}${p}`:d||p?`${d}${p}`:void 0;if(f[h]=o[h],r){let m=c(l.value);return`${d}${l.value}${m??""}${p}`}return e?`${d}${h}${c(h)??""}${p}`:`${d}${c(h)??""}${p}`}return l.value}));return{usedParams:f,interpolatedPath:u,isMissingParams:a}}function _n(t,o){let e=encodeURIComponent(t);if(o)for(let[r,n]of o)e=e.replaceAll(r,n);return e}function At(t,o,e){let r=Ge(t,o,e);if(!(o.to&&!r))return r??{}}function Ge(t,{to:o,fuzzy:e,caseSensitive:r},n){let s=o,i=it(t.startsWith("/")?t:`/${t}`,n),c=it(s.startsWith("/")?s:`/${s}`,n),a={};return wn(i,c,a,e,r)?a:void 0}function wn(t,o,e,r,n){let s=0,i=0;for(;sm.value)));l&&p.startsWith(l)&&(p=p.slice(l.length)),h&&p.endsWith(h)&&(p=p.slice(0,p.length-h.length)),u=p}else u=decodeURI(j(f.map(l=>l.value)));return e["*"]=u,e._splat=u,!0}if(a.type===Z){if(a.value==="/"&&!c?.value){i++;continue}if(c){if(n){if(a.value!==c.value)return!1}else if(a.value.toLowerCase()!==c.value.toLowerCase())return!1;s++,i++;continue}else return!1}if(a.type===ft){if(!c||c.value==="/")return!1;let f="",u=!1;if(a.prefixSegment||a.suffixSegment){let l=a.prefixSegment||"",h=a.suffixSegment||"",d=c.value;if(l&&!d.startsWith(l)||h&&!d.endsWith(h))return!1;let p=d;l&&p.startsWith(l)&&(p=p.slice(l.length)),h&&p.endsWith(h)&&(p=p.slice(0,p.length-h.length)),f=decodeURIComponent(p),u=!0}else f=decodeURIComponent(c.value),u=!0;u&&(e[a.value.substring(1)]=f,s++),i++;continue}if(a.type===Pt){if(!c){i++;continue}if(c.value==="/"){i++;continue}let f="",u=!1;if(a.prefixSegment||a.suffixSegment){let l=a.prefixSegment||"",h=a.suffixSegment||"",d=c.value;if((!l||d.startsWith(l))&&(!h||d.endsWith(h))){let p=d;l&&p.startsWith(l)&&(p=p.slice(l.length)),h&&p.endsWith(h)&&(p=p.slice(0,p.length-h.length)),f=decodeURIComponent(p),u=!0}}else{let l=!0;for(let h=i+1;h=o.length)return e["**"]=j(t.slice(s).map(f=>f.value)),!!r&&o[o.length-1]?.value!=="/";if(i=t.length){for(let f=i;f{if(r.isRoot||!r.path)return;let s=_t(r.fullPath),i=it(s),c=0;for(;i.length>c+1&&i[c]?.value==="/";)c++;c>0&&(i=i.slice(c));let a=0,f=!1,u=i.map((l,h)=>{if(l.value==="/")return xn;if(l.type===Z)return Cn;let d;l.type===ft?d=Ln:l.type===Pt?(d=Mn,a++):d=En;for(let p=h+1;p{let s=Math.min(r.scores.length,n.scores.length);for(let i=0;in.parsed[i].value?1:-1;return r.index-n.index}).map((r,n)=>(r.child.rank=n,r.child))}function Jo({routeTree:t,initRoute:o}){let e={},r={},n=i=>{i.forEach((c,a)=>{o?.(c,a);let f=e[c.id];if(z(!f,`Duplicate routes found with id: ${String(c.id)}`),e[c.id]=c,!c.isRoot&&c.path){let l=H(c.fullPath);(!r[l]||c.fullPath.endsWith("/"))&&(r[l]=c)}let u=c.children;u?.length&&n(u)})};n([t]);let s=Fn(Object.values(e));return{routesById:e,routesByPath:r,flatRoutes:s}}function Se(t={}){if(t.isNotFound=!0,t.throw)throw t;return t}function $(t){return!!t?.isNotFound}function On(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var Nt="tsr-scroll-restoration-v1_3",An=(t,o)=>{let e;return(...r)=>{e||(e=setTimeout(()=>{t(...r),e=null},o))}};function Nn(){let t=On();if(!t)return null;let o=t.getItem(Nt),e=o?JSON.parse(o):{};return{state:e,set:r=>(e=G(r,e)||e,t.setItem(Nt,JSON.stringify(e)))}}var Xt=Nn(),Zt=t=>t.state.__TSR_key||t.href;function Xo(t){let o=[],e;for(;e=t.parentNode;)o.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${o.reverse().join(" > ")}`.toLowerCase()}var Pe=!1;function _e({storageKey:t,key:o,behavior:e,shouldScrollRestoration:r,scrollToTopSelectors:n,location:s}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(f){console.error(f);return}let c=o||window.history.state?.__TSR_key,a=i[c];Pe=!0;t:{if(r&&a&&Object.keys(a).length>0){for(let l in a){let h=a[l];if(l==="window")window.scrollTo({top:h.scrollY,left:h.scrollX,behavior:e});else if(l){let d=document.querySelector(l);d&&(d.scrollLeft=h.scrollX,d.scrollTop=h.scrollY)}}break t}let f=(s??window.location).hash.split("#",2)[1];if(f){let l=window.history.state?.__hashScrollIntoViewOptions??!0;if(l){let h=document.getElementById(f);h&&h.scrollIntoView(l)}break t}let u={top:0,left:0,behavior:e};if(window.scrollTo(u),n)for(let l of n){if(l==="window")continue;let h=typeof l=="function"?l():document.querySelector(l);h&&h.scrollTo(u)}}Pe=!1}function qe(t,o){if(!Xt&&!t.isServer||((o??t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!Xt))return;t.isScrollRestorationSetup=!0,Pe=!1;let r=t.options.getScrollRestorationKey||Zt;window.history.scrollRestoration="manual";let n=s=>{if(Pe||!t.isScrollRestoring)return;let i="";if(s.target===document||s.target===window)i="window";else{let a=s.target.getAttribute("data-scroll-restoration-id");a?i=`[data-scroll-restoration-id="${a}"]`:i=Xo(s.target)}let c=r(t.state.location);Xt.set(a=>{let f=a[c]||={},u=f[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){let l=document.querySelector(i);l&&(u.scrollX=l.scrollLeft||0,u.scrollY=l.scrollTop||0)}return a})};typeof document<"u"&&document.addEventListener("scroll",An(n,100),!0),t.subscribe("onRendered",s=>{let i=r(s.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(_e({storageKey:Nt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&Xt.set(c=>(c[i]||={},c)))})}function Ye(t){if(typeof document<"u"&&document.querySelector){let o=t.state.location.state.__hashScrollIntoViewOptions??!0;if(o&&t.state.location.hash!==""){let e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(o)}}}function Zo(t,o=String){let e=new URLSearchParams;for(let r in t){let n=t[r];n!==void 0&&e.set(r,o(n))}return e.toString()}function Je(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function Qo(t){let o=new URLSearchParams(t),e={};for(let[r,n]of o.entries()){let s=e[r];s==null?e[r]=Je(n):Array.isArray(s)?s.push(Je(n)):e[r]=[s,Je(n)]}return e}var Xe=tr(JSON.parse),Ze=er(JSON.stringify,JSON.parse);function tr(t){return o=>{o[0]==="?"&&(o=o.substring(1));let e=Qo(o);for(let r in e){let n=e[r];if(typeof n=="string")try{e[r]=t(n)}catch{}}return e}}function er(t,o){let e=typeof o=="function";function r(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(e&&typeof n=="string")try{return o(n),t(n)}catch{}return n}return n=>{let s=Zo(n,r);return s?`?${s}`:""}}var O="__root__";function xt(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);let e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}function V(t){return t instanceof Response&&!!t.options}function or(t){let o=new Map,e,r,n=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,e=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){let i=o.get(s);if(i)return n(i),i.value},set(s,i){if(o.size>=t&&e){let a=e;o.delete(a.key),a.next&&(e=a.next,a.next.prev=void 0),a===r&&(r=void 0)}let c=o.get(s);if(c)c.value=i,n(c);else{let a={key:s,value:i,prev:r};r&&(r.next=a),r=a,e||(e=a),o.set(s,a)}}}}var xe=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},Ce=(t,o)=>!!(t.preload&&!t.router.state.matches.some(e=>e.id===o)),nr=(t,o)=>{let e=t.router.routesById[o.routeId??""]??t.router.routeTree;!e.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(e.options.notFoundComponent=t.router.options.defaultNotFoundComponent),z(e.options.notFoundComponent,"No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.");let r=t.matches.find(n=>n.routeId===e.id);z(r,"Could not find match for route: "+e.id),t.updateMatch(r.id,n=>({...n,status:"notFound",error:o,isFetching:!1})),o.routerCode==="BEFORE_LOAD"&&e.parentRoute&&(o.routeId=e.parentRoute.id,nr(t,o))},dt=(t,o,e)=>{if(!(!V(e)&&!$(e))){if(V(e)&&e.redirectHandled&&!e.options.reloadDocument)throw e;if(o){o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0;let r=V(e)?"redirected":"notFound";t.updateMatch(o.id,n=>({...n,status:r,isFetching:!1,error:e})),$(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()}throw V(e)?(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e),e):(nr(t,e),e)}},sr=(t,o)=>{let e=t.router.getMatch(o);return!!(!t.router.isServer&&e._nonReactive.dehydrated||t.router.isServer&&e.ssr===!1)},Qt=(t,o,e,r)=>{let{id:n,routeId:s}=t.matches[o],i=t.router.looseRoutesById[s];if(e instanceof Promise)throw e;e.routerCode=r,t.firstBadMatchIndex??=o,dt(t,t.router.getMatch(n),e);try{i.options.onError?.(e)}catch(c){e=c,dt(t,t.router.getMatch(n),e)}t.updateMatch(n,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},$n=(t,o,e,r)=>{let n=t.router.getMatch(o),s=t.matches[e-1]?.id,i=s?t.router.getMatch(s):void 0;if(t.router.isShell()){n.ssr=o===O;return}if(i?.ssr===!1){n.ssr=!1;return}let c=d=>d===!0&&i?.ssr==="data-only"?"data-only":d,a=t.router.options.defaultSsr??!0;if(r.options.ssr===void 0){n.ssr=c(a);return}if(typeof r.options.ssr!="function"){n.ssr=c(r.options.ssr);return}let{search:f,params:u}=n,l={search:we(f,n.searchError),params:we(u,n.paramsError),location:t.location,matches:t.matches.map(d=>({index:d.index,pathname:d.pathname,fullPath:d.fullPath,staticData:d.staticData,id:d.id,routeId:d.routeId,search:we(d.search,d.searchError),params:we(d.params,d.paramsError),ssr:d.ssr}))},h=r.options.ssr(l);if(st(h))return h.then(d=>{n.ssr=c(d??a)});n.ssr=c(h??a)},ir=(t,o,e,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let n=e.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!Ce(t,o)&&(e.options.loader||e.options.beforeLoad||eo(e))&&typeof n=="number"&&n!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent))){let i=setTimeout(()=>{xe(t)},n);r._nonReactive.pendingTimeout=i}},Bn=(t,o,e)=>{let r=t.router.getMatch(o);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ir(t,o,e,r);let n=()=>{let s=t.router.getMatch(o);s.preload&&(s.status==="redirected"||s.status==="notFound")&&dt(t,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(n):n()},Dn=(t,o,e,r)=>{let n=t.router.getMatch(o),s=n._nonReactive.loadPromise;n._nonReactive.loadPromise=X(()=>{s?.resolve()});let{paramsError:i,searchError:c}=n;i&&Qt(t,e,i,"PARSE_PARAMS"),c&&Qt(t,e,c,"VALIDATE_SEARCH"),ir(t,o,r,n);let a=new AbortController,f=t.matches[e-1]?.id,h={...(f?t.router.getMatch(f):void 0)?.context??t.router.options.context??void 0,...n.__routeContext},d=!1,p=()=>{d||(d=!0,t.updateMatch(o,y=>({...y,isFetching:"beforeLoad",fetchCount:y.fetchCount+1,abortController:a,context:h})))},m=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,y=>({...y,isFetching:!1}))};if(!r.options.beforeLoad){ut(()=>{p(),m()});return}n._nonReactive.beforeLoadPromise=X();let{search:R,params:v,cause:w}=n,S=Ce(t,o),L={search:R,abortController:a,params:v,preload:S,context:h,location:t.location,navigate:y=>t.router.navigate({...y,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:S?"preload":w,matches:t.matches,...t.router.options.additionalContext},I=y=>{if(y===void 0){ut(()=>{p(),m()});return}(V(y)||$(y))&&(p(),Qt(t,e,y,"BEFORE_LOAD")),ut(()=>{p(),t.updateMatch(o,g=>({...g,__beforeLoadContext:y,context:{...g.context,...y}})),m()})},M;try{if(M=r.options.beforeLoad(L),st(M))return p(),M.catch(y=>{Qt(t,e,y,"BEFORE_LOAD")}).then(I)}catch(y){p(),Qt(t,e,y,"BEFORE_LOAD")}I(M)},Un=(t,o)=>{let{id:e,routeId:r}=t.matches[o],n=t.router.looseRoutesById[r],s=()=>{if(t.router.isServer){let a=$n(t,e,o,n);if(st(a))return a.then(c)}return c()},i=()=>Dn(t,e,o,n),c=()=>{if(sr(t,e))return;let a=Bn(t,e,n);return st(a)?a.then(i):i()};return s()},te=(t,o,e)=>{let r=t.router.getMatch(o);if(!r||!e.options.head&&!e.options.scripts&&!e.options.headers)return;let n={matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([e.options.head?.(n),e.options.scripts?.(n),e.options.headers?.(n)]).then(([s,i,c])=>{let a=s?.meta,f=s?.links,u=s?.scripts,l=s?.styles;return{meta:a,links:f,headScripts:u,headers:c,scripts:i,styles:l}})},ar=(t,o,e,r)=>{let n=t.matchPromises[e-1],{params:s,loaderDeps:i,abortController:c,context:a,cause:f}=t.router.getMatch(o),u=Ce(t,o);return{params:s,deps:i,preload:!!u,parentMatchPromise:n,abortController:c,context:a,location:t.location,navigate:l=>t.router.navigate({...l,_fromLocation:t.location}),cause:u?"preload":f,route:r,...t.router.options.additionalContext}},rr=async(t,o,e,r)=>{try{let n=t.router.getMatch(o);try{(!t.router.isServer||n.ssr===!0)&&to(r);let s=r.options.loader?.(ar(t,o,e,r)),i=r.options.loader&&st(s);if((i||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(o,l=>({...l,isFetching:"loader"})),r.options.loader){let l=i?await s:s;dt(t,t.router.getMatch(o),l),l!==void 0&&t.updateMatch(o,h=>({...h,loaderData:l}))}r._lazyPromise&&await r._lazyPromise;let a=te(t,o,r),f=a?await a:void 0,u=n._nonReactive.minPendingPromise;u&&await u,r._componentsPromise&&await r._componentsPromise,t.updateMatch(o,l=>({...l,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...f}))}catch(s){let i=s,c=n._nonReactive.minPendingPromise;c&&await c,$(s)&&await r.options.notFoundComponent?.preload?.(),dt(t,t.router.getMatch(o),s);try{r.options.onError?.(s)}catch(u){i=u,dt(t,t.router.getMatch(o),u)}let a=te(t,o,r),f=a?await a:void 0;t.updateMatch(o,u=>({...u,error:i,status:"error",isFetching:!1,...f}))}}catch(n){let s=t.router.getMatch(o);if(s){let i=te(t,o,r);if(i){let c=await i;t.updateMatch(o,a=>({...a,...c}))}s._nonReactive.loaderPromise=void 0}dt(t,s,n)}},Vn=async(t,o)=>{let{id:e,routeId:r}=t.matches[o],n=!1,s=!1,i=t.router.looseRoutesById[r];if(sr(t,e)){if(t.router.isServer){let f=te(t,e,i);if(f){let u=await f;t.updateMatch(e,l=>({...l,...u}))}return t.router.getMatch(e)}}else{let f=t.router.getMatch(e);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!t.sync&&!f.preload)return f;await f._nonReactive.loaderPromise;let u=t.router.getMatch(e);u.error&&dt(t,u,u.error)}else{let u=Date.now()-f.updatedAt,l=Ce(t,e),h=l?i.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??t.router.options.defaultStaleTime??0,d=i.options.shouldReload,p=typeof d=="function"?d(ar(t,e,o,i)):d,m=!!l&&!t.router.state.matches.some(S=>S.id===e),R=t.router.getMatch(e);R._nonReactive.loaderPromise=X(),m!==R.preload&&t.updateMatch(e,S=>({...S,preload:m}));let{status:v,invalid:w}=R;if(n=v==="success"&&(w||(p??u>h)),!(l&&i.options.preload===!1))if(n&&!t.sync)s=!0,(async()=>{try{await rr(t,e,o,i);let S=t.router.getMatch(e);S._nonReactive.loaderPromise?.resolve(),S._nonReactive.loadPromise?.resolve(),S._nonReactive.loaderPromise=void 0}catch(S){V(S)&&await t.router.navigate(S.options)}})();else if(v!=="success"||n&&t.sync)await rr(t,e,o,i);else{let S=te(t,e,i);if(S){let L=await S;t.updateMatch(e,I=>({...I,...L}))}}}}let c=t.router.getMatch(e);s||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,s||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;let a=s?c.isFetching:!1;return a!==c.isFetching||c.invalid!==!1?(t.updateMatch(e,f=>({...f,isFetching:a,invalid:!1})),t.router.getMatch(e)):c};async function Qe(t){let o=Object.assign(t,{matchPromises:[]});!o.router.isServer&&o.router.state.matches.some(e=>e._forcePending)&&xe(o);try{for(let n=0;n{let{id:e,...r}=o.options;Object.assign(t.options,r),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){let o=()=>{let e=[];for(let r of oo){let n=t.options[r]?.preload;n&&e.push(n())}if(e.length)return Promise.all(e).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(o):o()}return t._componentsPromise}function we(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}function eo(t){for(let o of oo)if(t.options[o]?.preload)return!0;return!1}var oo=["component","errorComponent","pendingComponent","notFoundComponent"];function ro(t){return{input:({url:o})=>{for(let e of t)o=no(e,o);return o},output:({url:o})=>{for(let e=t.length-1;e>=0;e--)o=so(t[e],o);return o}}}function cr(t){let o=ht(t.basepath),e=`/${o}`,r=`${e}/`,n=t.caseSensitive?e:e.toLowerCase(),s=t.caseSensitive?r:r.toLowerCase();return{input:({url:i})=>{let c=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return c===n?i.pathname="/":c.startsWith(s)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=j(["/",o,i.pathname]),i)}}function no(t,o){let e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function so(t,o){let e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function tt(t){let o=t.resolvedLocation,e=t.location,r=o?.pathname!==e.pathname,n=o?.href!==e.href,s=o?.hash!==e.hash;return{fromLocation:o,toLocation:e,pathChanged:r,hrefChanged:n,hashChanged:s}}var ee=class{constructor(o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");let r=this.options,n=this.basepath??r?.basepath??"/",s=this.basepath===void 0,i=r?.rewrite;this.options={...r,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(h=>[encodeURIComponent(h),h])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Yt())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new qt(ao(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(h=>!["redirected"].includes(h.status))}}}),qe(this));let c=!1,a=this.options.basepath??"/",f=this.options.rewrite;if(s||n!==a||i!==f){this.basepath=a;let h=[];ht(a)!==""&&h.push(cr({basepath:a})),f&&h.push(f),this.rewrite=h.length===0?void 0:h.length===1?h[0]:ro(h),this.history&&this.updateLatestLocation(),c=!0}c&&this.__store&&(this.__store.state={...this.state,location: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{routesById:e,routesByPath:r,flatRoutes:n}=Jo({routeTree:this.routeTree,initRoute:(i,c)=>{i.init({originalIndex:c})}});this.routesById=e,this.routesByPath=r,this.flatRoutes=n;let s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)},this.subscribe=(e,r)=>{let n={eventType:e,fn:r};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(r=>{r.eventType===e.type&&r.fn(e)})},this.parseLocation=(e,r)=>{let n=({href:a,state:f})=>{let u=new URL(a,this.origin),l=no(this.rewrite,u),h=this.options.parseSearch(l.search),d=this.options.stringifySearch(h);l.search=d;let p=l.href.replace(l.origin,""),{pathname:m,hash:R}=l;return{href:p,publicHref:a,url:l.href,pathname:m,searchStr:d,search:D(r?.search,h),hash:R.split("#").reverse()[0]??"",state:D(r?.state,f)}},s=n(e),{__tempLocation:i,__tempKey:c}=s.state;if(i&&(!c||c===this.tempLocationKey)){let a=n(i);return a.state.key=s.state.key,a.state.__TSR_key=s.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:s}}return s},this.resolvePathWithBase=(e,r)=>ye({base:e,to:Ot(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(e,r,n)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:r},n):this.matchRoutesInternal(e,r),this.parsePathnameCache=or(1e3),this.getMatchedRoutes=(e,r)=>ur({pathname:e,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=e=>{let r=this.getMatch(e);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.state.pendingMatches?.forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let r=(s={})=>{let i=s._fromLocation||this.latestLocation,c=this.matchRoutes(i,{_buildLocation:!0}),a=It(c);s.from;let f=s.unsafeRelative==="path"?i.pathname:s.from??a.fullPath,u=this.resolvePathWithBase(f,"."),l=a.search,h={...a.params},d=s.to?this.resolvePathWithBase(u,`${s.to}`):this.resolvePathWithBase(u,"."),p=s.params===!1||s.params===null?{}:(s.params??!0)===!0?h:Object.assign(h,G(s.params,h)),m=wt({path:d,params:p,parseCache:this.parsePathnameCache}).interpolatedPath,R=this.matchRoutes(m,void 0,{_buildLocation:!0}).map(_=>this.looseRoutesById[_.routeId]);if(Object.keys(p).length>0)for(let _ of R){let k=_.options.params?.stringify??_.options.stringifyParams;k&&Object.assign(p,k(p))}let v=Jt(wt({path:d,params:p,leaveWildcards:!1,leaveParams:e.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath),w=l;if(e._includeValidateSearch&&this.options.search?.strict){let _={};R.forEach(k=>{if(k.options.validateSearch)try{Object.assign(_,io(k.options.validateSearch,{..._,...w}))}catch{}}),w=_}w=Wn({search:w,dest:s,destRoutes:R,_includeValidateSearch:e._includeValidateSearch}),w=D(l,w);let S=this.options.stringifySearch(w),L=s.hash===!0?i.hash:s.hash?G(s.hash,i.hash):void 0,I=L?`#${L}`:"",M=s.state===!0?i.state:s.state?G(s.state,i.state):{};M=D(i.state,M);let y=`${v}${S}${I}`,g=new URL(y,this.origin),P=so(this.rewrite,g);return{publicHref:P.pathname+P.search+P.hash,href:y,url:P.href,pathname:v,search:w,searchStr:S,state:M,hash:L??"",unmaskOnReload:s.unmaskOnReload}},n=(s={},i)=>{let c=r(s),a=i?r(i):void 0;if(!a){let f={},u=this.options.routeMasks?.find(l=>{let h=At(c.pathname,{to:l.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return h?(f=h,!0):!1});if(u){let{from:l,...h}=u;i={from:e.from,...h,params:f},a=r(i)}}return a&&(c.maskedLocation=a),c};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:r,...n})=>{let s=()=>{let a=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];a.forEach(u=>{n.state[u]=this.latestLocation.state[u]});let f=J(n.state,this.latestLocation.state);return a.forEach(u=>{delete n.state[u]}),f},i=H(this.latestLocation.href)===H(n.href),c=this.commitLocationPromise;if(this.commitLocationPromise=X(()=>{c?.resolve()}),i&&s())this.load();else{let{maskedLocation:a,hashScrollIntoView:f,...u}=n;a&&(u={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:r})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:r,hashScrollIntoView:n,viewTransition:s,ignoreBlocker:i,href:c,...a}={})=>{if(c){let u=this.history.location.state.__TSR_index,l=St(c,{__TSR_index:e?u:u+1});a.to=l.pathname,a.search=this.options.parseSearch(l.search),a.hash=l.hash.slice(1)}let f=this.buildLocation({...a,_includeValidateSearch:!0});return this.commitLocation({...f,viewTransition:s,replace:e,resetScroll:r,hashScrollIntoView:n,ignoreBlocker:i})},this.navigate=({to:e,reloadDocument:r,href:n,...s})=>{if(!r&&n)try{new URL(`${n}`),r=!0}catch{}return r?(n||(n=this.buildLocation({to:e,...s}).url),s.replace?window.location.replace(n):window.location.href=n,Promise.resolve()):this.buildAndCommitLocation({...s,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){let r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),n=s=>{try{return encodeURI(decodeURI(s))}catch{return s}};if(ht(n(this.latestLocation.href))!==ht(n(r.href))){let s=r.url;throw this.origin&&s.startsWith(this.origin)&&(s=s.replace(this.origin,"")||"/"),xt({href:s})}}let e=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:r.cachedMatches.filter(n=>!e.some(s=>s.id===n.id))}))},this.load=async e=>{let r,n,s;for(s=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();let a=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...tt({resolvedLocation:f,location:a})}),this.emit({type:"onBeforeLoad",...tt({resolvedLocation:f,location:a})}),await Qe({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:a,updateMatch:this.updateMatch,onReady:async()=>{this.startViewTransition(async()=>{let u,l,h;ut(()=>{this.__store.setState(d=>{let p=d.matches,m=d.pendingMatches||d.matches;return u=p.filter(R=>!m.some(v=>v.id===R.id)),l=m.filter(R=>!p.some(v=>v.id===R.id)),h=p.filter(R=>m.some(v=>v.id===R.id)),{...d,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...d.cachedMatches,...u.filter(R=>R.status!=="error")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[l,"onEnter"],[h,"onStay"]].forEach(([d,p])=>{d.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})}})}catch(a){V(a)?(r=a,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):$(a)&&(n=a),this.__store.setState(f=>({...f,statusCode:r?r.status:n?404:f.matches.some(u=>u.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(c=>c.status==="error")&&(i=500),i!==void 0&&this.__store.setState(c=>({...c,statusCode:i}))},this.startViewTransition=e=>{let r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof r=="object"&&this.isViewTransitionTypesSupported){let s=this.latestLocation,i=this.state.resolvedLocation,c=typeof r.types=="function"?r.types(tt({resolvedLocation:i,location:s})):r.types;if(c===!1){e();return}n={update:e,types:c}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,r)=>{let n=this.state.pendingMatches?.some(s=>s.id===e)?"pendingMatches":this.state.matches.some(s=>s.id===e)?"matches":this.state.cachedMatches.some(s=>s.id===e)?"cachedMatches":"";n&&this.__store.setState(s=>({...s,[n]:s[n]?.map(i=>i.id===e?r(i):i)}))},this.getMatch=e=>{let r=n=>n.id===e;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=e=>{let r=n=>e?.filter?.(n)??!0?{...n,invalid:!0,...e?.forcePending||n.status==="error"?{status:"pending",error:void 0}:void 0}:n;return this.__store.setState(n=>({...n,matches:n.matches.map(r),cachedMatches:n.cachedMatches.map(r),pendingMatches:n.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){let r=this.buildLocation(e.options),n=r.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,"")||"/"),e.options.href=r.href,e.headers.set("Location",n)}return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{let r=e?.filter;r!==void 0?this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(s=>!r(s))})):this.__store.setState(n=>({...n,cachedMatches:[]}))},this.clearExpiredCache=()=>{let e=r=>{let n=this.looseRoutesById[r.routeId];if(!n.options.loader)return!0;let s=(r.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:e})},this.loadRouteChunk=to,this.preloadRoute=async e=>{let r=this.buildLocation(e),n=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:e}),s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),i=new Set([...s,...this.state.cachedMatches.map(c=>c.id)]);ut(()=>{n.forEach(c=>{i.has(c.id)||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,c]}))})});try{return n=await Qe({router:this,matches:n,location:r,preload:!0,updateMatch:(c,a)=>{s.has(c)?n=n.map(f=>f.id===c?a(f):f):this.updateMatch(c,a)}}),n}catch(c){if(V(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});$(c)||console.error(c);return}},this.matchRoute=(e,r)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},s=this.buildLocation(n);if(r?.pending&&this.state.status!=="pending")return!1;let c=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=At(c.pathname,{...r,to:s.pathname},this.parsePathnameCache);return!a||e.params&&!J(a,e.params,{partial:!0})?!1:a&&(r?.includeSearch??!0)?J(c.search,s.search,{partial:!0})?a:!1:a},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...o,caseSensitive:o.caseSensitive??!1,notFoundMode:o.notFoundMode??"fuzzy",stringifySearch:o.stringifySearch??Ze,parseSearch:o.parseSearch??Xe}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(o,e){let{foundRoute:r,matchedRoutes:n,routeParams:s}=this.getMatchedRoutes(o.pathname,e?.dest?.to),i=!1;(r?r.path!=="/"&&s["**"]:H(o.pathname))&&(this.options.notFoundRoute?n.push(this.options.notFoundRoute):i=!0);let c=(()=>{if(i){if(this.options.notFoundMode!=="root")for(let u=n.length-1;u>=0;u--){let l=n[u];if(l.children)return l.id}return O}})(),a=[],f=u=>u?.id?u.context??this.options.context??void 0:this.options.context??void 0;return n.forEach((u,l)=>{let h=a[l-1],[d,p,m]=(()=>{let F=h?.search??o.search,rt=h?._strictSearch??void 0;try{let q=io(u.options.validateSearch,{...F})??void 0;return[{...F,...q},{...rt,...q},void 0]}catch(q){let vt=q;if(q instanceof pt||(vt=new pt(q.message,{cause:q})),e?.throwOnError)throw vt;return[F,{},vt]}})(),R=u.options.loaderDeps?.({search:d})??"",v=R?JSON.stringify(R):"",{interpolatedPath:w,usedParams:S}=wt({path:u.fullPath,params:s,decodeCharMap:this.pathParamsDecodeCharMap}),L=wt({path:u.id,params:s,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+v,I=this.getMatch(L),M=this.state.matches.find(F=>F.routeId===u.id),y=I?._strictParams??S,g;if(!I){let F=u.options.params?.parse??u.options.parseParams;if(F)try{Object.assign(y,F(y))}catch(rt){if(g=new oe(rt.message,{cause:rt}),e?.throwOnError)throw g}}Object.assign(s,y);let P=M?"stay":"enter",_;if(I)_={...I,cause:P,params:M?D(M.params,s):s,_strictParams:y,search:M?D(M.search,d):D(I.search,d),_strictSearch:p};else{let F=u.options.loader||u.options.beforeLoad||u.lazyFn||eo(u)?"pending":"success";_={id:L,index:l,routeId:u.id,params:M?D(M.params,s):s,_strictParams:y,pathname:w,updatedAt:Date.now(),search:M?D(M.search,d):d,_strictSearch:p,searchError:void 0,status:F,isFetching:!1,error:void 0,paramsError:g,__routeContext:void 0,_nonReactive:{loadPromise:X()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:P,loaderDeps:M?D(M.loaderDeps,R):R,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},fullPath:u.fullPath}}e?.preload||(_.globalNotFound=c===u.id),_.searchError=m;let k=f(h);_.context={...k,..._.__routeContext,..._.__beforeLoadContext},a.push(_)}),a.forEach((u,l)=>{let h=this.looseRoutesById[u.routeId];if(!this.getMatch(u.id)&&e?._buildLocation!==!0){let p=a[l-1],m=f(p);if(h.options.context){let R={deps:u.loaderDeps,params:u.params,context:m??{},location:o,navigate:v=>this.navigate({...v,_fromLocation:o}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:a};u.__routeContext=h.options.context(R)??void 0}u.context={...m,...u.__routeContext,...u.__beforeLoadContext}}}),a}},pt=class extends Error{},oe=class extends Error{};function ao(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function io(t,o){if(t==null)return{};if("~standard"in t){let e=t["~standard"].validate(o);if(e instanceof Promise)throw new pt("Async validation not supported");if(e.issues)throw new pt(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}function ur({pathname:t,routePathname:o,caseSensitive:e,routesByPath:r,routesById:n,flatRoutes:s,parseCache:i}){let c={},a=H(t),f=d=>At(a,{to:d.fullPath,caseSensitive:d.options?.caseSensitive??e,fuzzy:!0},i),u=o!==void 0?r[o]:void 0;if(u)c=f(u);else{let d;for(let p of s){let m=f(p);if(m)if(p.path!=="/"&&m["**"])d||(d={foundRoute:p,routeParams:m});else{u=p,c=m;break}}!u&&d&&(u=d.foundRoute,c=d.routeParams)}let l=u||n[O],h=[l];for(;l.parentRoute;)l=l.parentRoute,h.push(l);return h.reverse(),{matchedRoutes:h,routeParams:c,foundRoute:u}}function Wn({search:t,dest:o,destRoutes:e,_includeValidateSearch:r}){let n=e.reduce((c,a)=>{let f=[];if("search"in a.options)a.options.search?.middlewares&&f.push(...a.options.search.middlewares);else if(a.options.preSearchFilters||a.options.postSearchFilters){let u=({search:l,next:h})=>{let d=l;"preSearchFilters"in a.options&&a.options.preSearchFilters&&(d=a.options.preSearchFilters.reduce((m,R)=>R(m),l));let p=h(d);return"postSearchFilters"in a.options&&a.options.postSearchFilters?a.options.postSearchFilters.reduce((m,R)=>R(m),p):p};f.push(u)}if(r&&a.options.validateSearch){let u=({search:l,next:h})=>{let d=h(l);try{return{...d,...io(a.options.validateSearch,d)??void 0}}catch{return d}};f.push(u)}return c.concat(f)},[])??[],s=({search:c})=>o.search?o.search===!0?c:G(o.search,c):{};n.push(s);let i=(c,a)=>{if(c>=n.length)return a;let f=n[c];return f({search:a,next:l=>i(c+1,l)})};return i(0,t)}var co="Error preloading route! \u261D\uFE0F";var $t=class{constructor(o){if(this.init=e=>{this.originalIndex=e.originalIndex;let r=this.options,n=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=O:this.parentRoute||z(!1,"Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let s=n?O:r?.path;s&&s!=="/"&&(s=_t(s));let i=r?.id||s,c=n?O:j([this.parentRoute.id===O?"":this.parentRoute.id,i]);s===O&&(s="/"),c!==O&&(c=j(["/",c]));let a=c===O?"/":j([this.parentRoute.fullPath,s]);this._path=s,this._id=c,this._fullPath=a,this._to=a},this.clone=e=>{this._path=e._path,this._id=e._id,this._fullPath=e._fullPath,this._to=e._to,this.options.getParentRoute=e.options.getParentRoute,this.children=e.children},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(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.options=o||{},this.isRoot=!o?.getParentRoute,o?.id&&o?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}};var re=class extends $t{constructor(o){super(o)}};var Q=x(K(),1),Bt=x(B(),1);function Dt(t){let o=t.errorComponent??Ut;return(0,Q.jsx)(uo,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:r})=>e?Bt.createElement(o,{error:e,reset:r}):t.children})}var uo=class extends Bt.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(o){return{resetKey:o.getResetKey()}}static getDerivedStateFromError(o){return{error:o}}reset(){this.setState({error:null})}componentDidUpdate(o,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(o,e){this.props.onCatch&&this.props.onCatch(o,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function Ut({error:t}){let[o,e]=Bt.useState(!1);return(0,Q.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,Q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,Q.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,Q.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(r=>!r),children:o?"Hide Error":"Show Error"})]}),(0,Q.jsx)("div",{style:{height:".25rem"}}),o?(0,Q.jsx)("div",{children:(0,Q.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,Q.jsx)("code",{children:t.message}):null})}):null]})}var lo=x(K(),1),Le=x(B(),1);function hr({children:t,fallback:o=null}){return Kn()?(0,lo.jsx)(Le.default.Fragment,{children:t}):(0,lo.jsx)(Le.default.Fragment,{children:o})}function Kn(){return Le.default.useSyncExternalStore(Gn,()=>!0,()=>!1)}function Gn(){return()=>{}}var qn=!0;function Yn(t,o){if(!qn){if(t)return;var e="Warning: "+o;typeof console<"u"&&console.warn(e);try{throw Error(e)}catch{}}}var at=Yn;var vo=x(K(),1);var yo=x(B(),1);var Er=x(B(),1);var _r=x(Sr(),1);function wr(t,o=r=>r,e={}){let r=e.equal??ds;return(0,_r.useSyncExternalStoreWithSelector)(t.subscribe,()=>t.state,()=>t.state,o,r)}function ds(t,o){if(Object.is(t,o))return!0;if(typeof t!="object"||t===null||typeof o!="object"||o===null)return!1;if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(let[r,n]of t)if(!o.has(r)||!Object.is(n,o.get(r)))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(let r of t)if(!o.has(r))return!1;return!0}if(t instanceof Date&&o instanceof Date)return t.getTime()===o.getTime();let e=Pr(t);if(e.length!==Pr(o).length)return!1;for(let r=0;r"u"?ho:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ho,ho)}function E(t){let o=Cr.useContext(Ee());return at(!((t?.warn??!0)&&!o),"useRouter must be used inside a component!"),o}function C(t){let o=E({warn:t?.router===void 0}),e=t?.router||o,r=(0,Lr.useRef)(void 0);return wr(e.__store,n=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){let s=D(r.current,t.select(n));return r.current=s,s}return t.select(n)}return n})}var po=x(B(),1),Ct=po.createContext(void 0),Mr=po.createContext(void 0);function U(t){let o=Er.useContext(t.from?Mr:Ct);return C({select:r=>{let n=r.matches.find(s=>t.from?t.from===s.routeId:s.id===o);if(z(!((t.shouldThrow??!0)&&!n),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),n!==void 0)return t.select?t.select(n):n},structuralSharing:t.structuralSharing})}function mt(t){return U({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.loaderData):o.loaderData})}function ne(t){let{select:o,...e}=t;return U({...e,select:r=>o?o(r.loaderDeps):r.loaderDeps})}function Lt(t){return U({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:o=>{let e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e}})}function Mt(t){return U({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.search):o.search})}var be=x(B(),1);function Et(t){let o=E();return be.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}var Fr=x(K(),1),A=x(B(),1),Or=x(Tr(),1);var et=x(B(),1);var se=typeof window<"u"?et.useLayoutEffect:et.useEffect;function Te(t){let o=et.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}function Ir(t,o,e={},r={}){et.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;let n=new IntersectionObserver(([s])=>{o(s)},e);return n.observe(t.current),()=>{n.disconnect()}},[o,e,r.disabled,t])}function kr(t){let o=et.useRef(null);return et.useImperativeHandle(t,()=>o.current,[]),o}function go(t,o){let e=E(),[r,n]=A.useState(!1),s=A.useRef(!1),i=kr(o),{activeProps:c,inactiveProps:a,activeOptions:f,to:u,preload:l,preloadDelay:h,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:R,viewTransition:v,children:w,target:S,disabled:L,style:I,className:M,onClick:y,onFocus:g,onMouseEnter:P,onMouseLeave:_,onTouchStart:k,ignoreBlocker:F,params:rt,search:q,hash:vt,state:To,mask:Yr,reloadDocument:_s,unsafeRelative:ws,from:xs,_fromLocation:Cs,...Io}=t,Jr=C({select:b=>b.location.search,structuralSharing:!0}),ko=t.from,jt=A.useMemo(()=>({...t,from:ko}),[e,Jr,ko,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),nt=A.useMemo(()=>e.buildLocation({...jt}),[e,jt]),fe=A.useMemo(()=>{if(L)return;let b=nt.maskedLocation?nt.maskedLocation.url:nt.url,N=!1;return e.origin&&(b.startsWith(e.origin)?b=e.history.createHref(b.replace(e.origin,""))||"/":N=!0),{href:b,external:N}},[L,nt.maskedLocation,nt.url,e.origin,e.history]),he=A.useMemo(()=>{if(fe?.external)return fe.href;try{return new URL(u),u}catch{}},[u,fe]),bt=t.reloadDocument||he?!1:l??e.options.defaultPreload,Ve=h??e.options.defaultPreloadDelay??0,We=C({select:b=>{if(he)return!1;if(f?.exact){if(!Ke(b.location.pathname,nt.pathname,e.basepath))return!1}else{let N=Ft(b.location.pathname,e.basepath),Y=Ft(nt.pathname,e.basepath);if(!(N.startsWith(Y)&&(N.length===Y.length||N[Y.length]==="/")))return!1}return(f?.includeSearch??!0)&&!J(b.location.search,nt.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?b.location.hash===nt.hash:!0}}),yt=A.useCallback(()=>{e.preloadRoute({...jt}).catch(b=>{console.warn(b),console.warn(co)})},[e,jt]),Xr=A.useCallback(b=>{b?.isIntersecting&&yt()},[yt]);Ir(i,Xr,vs,{disabled:!!L||bt!=="viewport"}),A.useEffect(()=>{s.current||!L&&bt==="render"&&(yt(),s.current=!0)},[L,yt,bt]);let Zr=b=>{let N=b.currentTarget.getAttribute("target"),Y=S!==void 0?S:N;if(!L&&!ys(b)&&!b.defaultPrevented&&(!Y||Y==="_self")&&b.button===0){b.preventDefault(),(0,Or.flushSync)(()=>{n(!0)});let No=e.subscribe("onResolved",()=>{No(),n(!1)});e.navigate({...jt,replace:p,resetScroll:R,hashScrollIntoView:d,startTransition:m,viewTransition:v,ignoreBlocker:F})}};if(he)return{...Io,ref:i,href:he,...w&&{children:w},...S&&{target:S},...L&&{disabled:L},...I&&{style:I},...M&&{className:M},...y&&{onClick:y},...g&&{onFocus:g},...P&&{onMouseEnter:P},..._&&{onMouseLeave:_},...k&&{onTouchStart:k}};let Fo=b=>{L||bt&&yt()},Qr=Fo,tn=b=>{if(!(L||!bt))if(!Ve)yt();else{let N=b.target;if(ie.has(N))return;let Y=setTimeout(()=>{ie.delete(N),yt()},Ve);ie.set(N,Y)}},en=b=>{if(L||!bt||!Ve)return;let N=b.target,Y=ie.get(N);Y&&(clearTimeout(Y),ie.delete(N))},de=We?G(c,{})??ps:mo,pe=We?mo:G(a,{})??mo,Oo=[M,de.className,pe.className].filter(Boolean).join(" "),Ao=(I||de.style||pe.style)&&{...I,...de.style,...pe.style};return{...Io,...de,...pe,href:fe?.href,ref:i,onClick:ae([y,Zr]),onFocus:ae([g,Fo]),onMouseEnter:ae([P,tn]),onMouseLeave:ae([_,en]),onTouchStart:ae([k,Qr]),disabled:!!L,target:S,...Ao&&{style:Ao},...Oo&&{className:Oo},...L&&ms,...We&&gs,...r&&Rs}}var mo={},ps={className:"active"},ms={role:"link","aria-disabled":!0},gs={"data-status":"active","aria-current":"page"},Rs={"data-transitioning":"transitioning"},ie=new WeakMap,vs={rootMargin:"100px"},ae=t=>o=>{for(let e of t)if(e){if(o.defaultPrevented)return;e(o)}};function Ro(t){return A.forwardRef(function(e,r){return(0,Fr.jsx)(Wt,{...e,_asChild:t,ref:r})})}var Wt=A.forwardRef((t,o)=>{let{_asChild:e,...r}=t,{type:n,ref:s,...i}=go(r,o),c=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;return e===void 0&&delete i.disabled,A.createElement(e||"a",{...i,ref:s},c)});function ys(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}var Ie=class extends $t{constructor(o){super(o),this.useMatch=e=>U({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>U({...e,from:this.id,select:r=>e?.select?e.select(r.context):r.context}),this.useSearch=e=>Mt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Lt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ne({...e,from:this.id}),this.useLoaderData=e=>mt({...e,from:this.id}),this.useNavigate=()=>Et({from:this.fullPath}),this.Link=yo.default.forwardRef((e,r)=>(0,vo.jsx)(Wt,{ref:r,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}};function ce(t){return new Ie(t)}var ke=class extends re{constructor(o){super(o),this.useMatch=e=>U({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>U({...e,from:this.id,select:r=>e?.select?e.select(r.context):r.context}),this.useSearch=e=>Mt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Lt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ne({...e,from:this.id}),this.useLoaderData=e=>mt({...e,from:this.id}),this.useNavigate=()=>Et({from:this.fullPath}),this.Link=yo.default.forwardRef((e,r)=>(0,vo.jsx)(Wt,{ref:r,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}};function So(t){return new ke(t)}function Fe(t){return typeof t=="object"?new ue(t,{silent:!0}).createRoute(t):new ue(t,{silent:!0}).createRoute}var ue=class{constructor(o,e){this.path=o,this.createRoute=r=>{at(this.silent,"FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.");let n=ce(r);return n.isRoot=!1,n},this.silent=e?.silent}};var zt=class{constructor(o){this.useMatch=e=>U({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>U({from:this.options.id,select:r=>e?.select?e.select(r.context):r.context}),this.useSearch=e=>Mt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>Lt({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>ne({...e,from:this.options.id}),this.useLoaderData=e=>mt({...e,from:this.options.id}),this.useNavigate=()=>{let e=E();return Et({from:e.routesById[this.options.id].fullPath})},this.options=o,this.$$typeof=Symbol.for("react.memo")}};function Po(t){return o=>new zt({id:t,...o})}function Oe(t){return typeof t=="object"?new zt(t):o=>new zt({id:t,...o})}var ot=x(K(),1),De=x(B(),1);var gt=x(B(),1);function Ar(){let t=E(),o=gt.useRef({router:t,mounted:!1}),[e,r]=gt.useState(!1),{hasPendingMatches:n,isLoading:s}=C({select:l=>({isLoading:l.isLoading,hasPendingMatches:l.matches.some(h=>h.status==="pending")}),structuralSharing:!0}),i=Te(s),c=s||e||n,a=Te(c),f=s||n,u=Te(f);return t.startTransition=l=>{r(!0),gt.startTransition(()=>{l(),r(!1)})},gt.useEffect(()=>{let l=t.history.subscribe(t.load),h=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return H(t.latestLocation.href)!==H(h.href)&&t.commitLocation({...h,replace:!0}),()=>{l()}},[t,t.history]),se(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(h){console.error(h)}})()},[t]),se(()=>{i&&!s&&t.emit({type:"onLoad",...tt(t.state)})},[i,t,s]),se(()=>{u&&!f&&t.emit({type:"onBeforeRouteMount",...tt(t.state)})},[f,u,t]),se(()=>{a&&!c&&(t.emit({type:"onResolved",...tt(t.state)}),t.__store.setState(l=>({...l,status:"idle",resolvedLocation:l.location})),Ye(t))},[c,a,t]),null}var T=x(K(),1),W=x(B(),1);var _o=x(K(),1);function Nr(t){let o=C({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,_o.jsx)(Dt,{getResetKey:()=>o,onCatch:(e,r)=>{if($(e))t.onCatch?.(e,r);else throw e},errorComponent:({error:e})=>{if($(e))return t.fallback?.(e);throw e},children:t.children})}function $r(){return(0,_o.jsx)("p",{children:"Not Found"})}var Ae=x(K(),1);function Rt(t){return(0,Ae.jsx)(Ae.Fragment,{children:t.children})}var Ne=x(K(),1);function wo(t,o,e){return o.options.notFoundComponent?(0,Ne.jsx)(o.options.notFoundComponent,{data:e}):t.options.defaultNotFoundComponent?(0,Ne.jsx)(t.options.defaultNotFoundComponent,{data:e}):(0,Ne.jsx)($r,{})}var Ur=x(K(),1);var Br=x(K(),1);function Dr({children:t}){let o=E();return o.isServer?(0,Br.jsx)("script",{nonce:o.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[t].filter(Boolean).join(` `)+";$_TSR.c()"}}):null}function Vr(){let t=E();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;let e=(t.options.getScrollRestorationKey||Zt)(t.latestLocation),r=e!==Zt(t.latestLocation)?e:void 0,n={storageKey:Nt,shouldScrollRestoration:!0};return r&&(n.key=r),(0,Ur.jsx)(Dr,{children:`(${_e.toString()})(${JSON.stringify(n)})`})}var $e=W.memo(function({matchId:o}){let e=E(),r=C({select:v=>{let w=v.matches.find(S=>S.id===o);return z(w,`Could not find match for matchId "${o}". Please file an issue!`),{routeId:w.routeId,ssr:w.ssr,_displayPending:w._displayPending}},structuralSharing:!0}),n=e.routesById[r.routeId],s=n.options.pendingComponent??e.options.defaultPendingComponent,i=s?(0,T.jsx)(s,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,f=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=r.ssr===!1||r.ssr==="data-only",l=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??s??(n.options.errorComponent?.preload||u))?W.Suspense:Rt,h=c?Dt:Rt,d=f?Nr:Rt,p=C({select:v=>v.loadedAt}),m=C({select:v=>{let w=v.matches.findIndex(S=>S.id===o);return v.matches[w-1]?.routeId}}),R=n.isRoot?n.options.shellComponent??Rt:Rt;return(0,T.jsxs)(R,{children:[(0,T.jsx)(Ct.Provider,{value:o,children:(0,T.jsx)(l,{fallback:i,children:(0,T.jsx)(h,{getResetKey:()=>p,errorComponent:c||Ut,onCatch:(v,w)=>{if($(v))throw v;at(!1,`Error in route match: ${o}`),a?.(v,w)},children:(0,T.jsx)(d,{fallback:v=>{if(!f||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!n.isRoot)throw v;return W.createElement(f,v)},children:u||r._displayPending?(0,T.jsx)(hr,{fallback:i,children:(0,T.jsx)(Wr,{matchId:o})}):(0,T.jsx)(Wr,{matchId:o})})})})}),m===O&&e.options.scrollRestoration?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ss,{}),(0,T.jsx)(Vr,{})]}):null]})});function Ss(){let t=E(),o=W.useRef(void 0);return(0,T.jsx)("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...tt(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}var Wr=W.memo(function({matchId:o}){let e=E(),{match:r,key:n,routeId:s}=C({select:a=>{let f=a.matches.find(p=>p.id===o),u=f.routeId,h=(e.routesById[u].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:u,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:h?JSON.stringify(h):void 0,routeId:u,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),i=e.routesById[s],c=W.useMemo(()=>{let a=i.options.component??e.options.defaultComponent;return a?(0,T.jsx)(a,{},n):(0,T.jsx)(Be,{})},[n,i.options.component,e.options.defaultComponent]);if(r._displayPending)throw e.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw e.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){let a=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(a){let f=e.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise&&!e.isServer){let u=X();f._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),f._nonReactive.minPendingPromise=void 0},a)}}throw e.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return z($(r.error),"Expected a notFound error"),wo(e,i,r.error);if(r.status==="redirected")throw z(V(r.error),"Expected a redirect error"),e.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(e.isServer){let a=(i.options.errorComponent??e.options.defaultErrorComponent)||Ut;return(0,T.jsx)(a,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return c}),Be=W.memo(function(){let o=E(),e=W.useContext(Ct),r=C({select:f=>f.matches.find(u=>u.id===e)?.routeId}),n=o.routesById[r],s=C({select:f=>{let l=f.matches.find(h=>h.id===e);return z(l,`Could not find parent match for matchId "${e}"`),l.globalNotFound}}),i=C({select:f=>{let u=f.matches,l=u.findIndex(h=>h.id===e);return u[l+1]?.id}}),c=o.options.defaultPendingComponent?(0,T.jsx)(o.options.defaultPendingComponent,{}):null;if(s)return wo(o,n,void 0);if(!i)return null;let a=(0,T.jsx)($e,{matchId:i});return e===O?(0,T.jsx)(W.Suspense,{fallback:c,children:a}):a});function xo(){let t=E(),e=t.routesById[O].options.pendingComponent??t.options.defaultPendingComponent,r=e?(0,ot.jsx)(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?Rt:De.Suspense,s=(0,ot.jsxs)(n,{fallback:r,children:[!t.isServer&&(0,ot.jsx)(Ar,{}),(0,ot.jsx)(Ps,{})]});return t.options.InnerWrap?(0,ot.jsx)(t.options.InnerWrap,{children:s}):s}function Ps(){let t=E(),o=C({select:n=>n.matches[0]?.id}),e=C({select:n=>n.loadedAt}),r=o?(0,ot.jsx)($e,{matchId:o}):null;return(0,ot.jsx)(Ct.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?r:(0,ot.jsx)(Dt,{getResetKey:()=>e,errorComponent:Ut,onCatch:n=>{at(!1,"The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),at(!1,n.message||n.toString())},children:r})})}function Co(t){return C({select:o=>{let e=o.matches;return t?.select?t.select(e):e},structuralSharing:t?.structuralSharing})}var Lo=t=>new Ue(t),Ue=class extends ee{constructor(o){super(o)}};typeof globalThis<"u"?(globalThis.createFileRoute=Fe,globalThis.createLazyFileRoute=Oe):typeof window<"u"&&(window.createFileRoute=Fe,window.createLazyFileRoute=Oe);var le=x(K(),1);function zr({router:t,children:o,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});let r=Ee(),n=(0,le.jsx)(r.Provider,{value:t,children:o});return t.options.Wrap?(0,le.jsx)(t.options.Wrap,{children:n}):n}function Mo({router:t,...o}){return(0,le.jsx)(zr,{router:t,...o,children:(0,le.jsx)(xo,{})})}function Eo(t){return C({select:o=>t?.select?t.select(o.location):o.location})}function bo(){return C({select:t=>t.location.state.__TSR_index!==0})}var Kr=x(Hr(),1),{lock:Gr,unlock:Iu}=(0,Kr.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/route");var qr={};Gr(qr,{createBrowserHistory:Yt,createLazyRoute:Po,createRouter:Lo,createRootRoute:So,createRoute:ce,Outlet:Be,RouterProvider:Mo,redirect:xt,createLink:Ro,useCanGoBack:bo,useLoaderData:mt,useLocation:Eo,useMatches:Co,useRouter:E,useRouterState:C,parseHref:St});function Uu(){let t=E();return()=>t.invalidate()}export{Wt as Link,Se as notFound,qr as privateApis,xt as redirect,Uu as useInvalidate,go as useLinkProps,Et as useNavigate,Lt as useParams,Mt as useSearch}; /*! Bundled license information: use-sync-external-store/cjs/use-sync-external-store-shim.production.js: (** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js: (** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) */ index.js000064400000542626152214140760006232 0ustar00var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js var require_use_sync_external_store_shim_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { "use strict"; (function() { function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } function useSyncExternalStore$2(subscribe2, getSnapshot) { didWarnOld18Alpha || void 0 === React12.startTransition || (didWarnOld18Alpha = true, console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." )); var value = getSnapshot(); if (!didWarnUncachedGetSnapshot) { var cachedValue = getSnapshot(); objectIs(value, cachedValue) || (console.error( "The result of getSnapshot should be cached to avoid an infinite loop" ), didWarnUncachedGetSnapshot = true); } cachedValue = useState4({ inst: { value, getSnapshot } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect3( function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [subscribe2, value, getSnapshot] ); useEffect5( function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe2(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe2] ); useDebugValue(value); return value; } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; inst = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); } catch (error) { return true; } } function useSyncExternalStore$1(subscribe2, getSnapshot) { return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React12 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState4 = React12.useState, useEffect5 = React12.useEffect, useLayoutEffect3 = React12.useLayoutEffect, useDebugValue = React12.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; exports.useSyncExternalStore = void 0 !== React12.useSyncExternalStore ? React12.useSyncExternalStore : shim; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/index.js var require_shim = __commonJS({ "node_modules/use-sync-external-store/shim/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_use_sync_external_store_shim_development(); } } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js var require_with_selector_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { "use strict"; (function() { function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React12 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim.useSyncExternalStore, useRef7 = React12.useRef, useEffect5 = React12.useEffect, useMemo3 = React12.useMemo, useDebugValue = React12.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot, getServerSnapshot, selector, isEqual) { var instRef = useRef7(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo3( function() { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = true; memoizedSnapshot = nextSnapshot; nextSnapshot = selector(nextSnapshot); if (void 0 !== isEqual && inst.hasValue) { var currentSelection = inst.value; if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection; } return memoizedSelection = nextSnapshot; } currentSelection = memoizedSelection; if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; var nextSelection = selector(nextSnapshot); if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection; memoizedSnapshot = nextSnapshot; return memoizedSelection = nextSelection; } var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; return [ function() { return memoizedSelector(getSnapshot()); }, null === maybeGetServerSnapshot ? void 0 : function() { return memoizedSelector(maybeGetServerSnapshot()); } ]; }, [getSnapshot, getServerSnapshot, selector, isEqual] ); var value = useSyncExternalStore(subscribe2, instRef[0], instRef[1]); useEffect5( function() { inst.hasValue = true; inst.value = value; }, [value] ); useDebugValue(value); return value; }; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/with-selector.js var require_with_selector = __commonJS({ "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_with_selector_development(); } } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // node_modules/@tanstack/store/dist/esm/scheduler.js var __storeToDerived = /* @__PURE__ */ new WeakMap(); var __derivedToStore = /* @__PURE__ */ new WeakMap(); var __depsThatHaveWrittenThisTick = { current: [] }; var __isFlushing = false; var __batchDepth = 0; var __pendingUpdates = /* @__PURE__ */ new Set(); var __initialBatchValues = /* @__PURE__ */ new Map(); function __flush_internals(relatedVals) { for (const derived of relatedVals) { if (__depsThatHaveWrittenThisTick.current.includes(derived)) { continue; } __depsThatHaveWrittenThisTick.current.push(derived); derived.recompute(); const stores = __derivedToStore.get(derived); if (stores) { for (const store of stores) { const relatedLinkedDerivedVals = __storeToDerived.get(store); if (!(relatedLinkedDerivedVals == null ? void 0 : relatedLinkedDerivedVals.length)) continue; __flush_internals(relatedLinkedDerivedVals); } } } } function __notifyListeners(store) { const value = { prevVal: store.prevState, currentVal: store.state }; for (const listener of store.listeners) { listener(value); } } function __notifyDerivedListeners(derived) { const value = { prevVal: derived.prevState, currentVal: derived.state }; for (const listener of derived.listeners) { listener(value); } } function __flush(store) { if (__batchDepth > 0 && !__initialBatchValues.has(store)) { __initialBatchValues.set(store, store.prevState); } __pendingUpdates.add(store); if (__batchDepth > 0) return; if (__isFlushing) return; try { __isFlushing = true; while (__pendingUpdates.size > 0) { const stores = Array.from(__pendingUpdates); __pendingUpdates.clear(); for (const store2 of stores) { const prevState = __initialBatchValues.get(store2) ?? store2.prevState; store2.prevState = prevState; __notifyListeners(store2); } for (const store2 of stores) { const derivedVals = __storeToDerived.get(store2); if (!derivedVals) continue; __depsThatHaveWrittenThisTick.current.push(store2); __flush_internals(derivedVals); } for (const store2 of stores) { const derivedVals = __storeToDerived.get(store2); if (!derivedVals) continue; for (const derived of derivedVals) { __notifyDerivedListeners(derived); } } } } finally { __isFlushing = false; __depsThatHaveWrittenThisTick.current = []; __initialBatchValues.clear(); } } function batch(fn) { __batchDepth++; try { fn(); } finally { __batchDepth--; if (__batchDepth === 0) { const pendingUpdateToFlush = __pendingUpdates.values().next().value; if (pendingUpdateToFlush) { __flush(pendingUpdateToFlush); } } } } // node_modules/@tanstack/store/dist/esm/types.js function isUpdaterFunction(updater) { return typeof updater === "function"; } // node_modules/@tanstack/store/dist/esm/store.js var Store = class { constructor(initialState, options) { this.listeners = /* @__PURE__ */ new Set(); this.subscribe = (listener) => { var _a, _b; this.listeners.add(listener); const unsub = (_b = (_a = this.options) == null ? void 0 : _a.onSubscribe) == null ? void 0 : _b.call(_a, listener, this); return () => { this.listeners.delete(listener); unsub == null ? void 0 : unsub(); }; }; this.prevState = initialState; this.state = initialState; this.options = options; } setState(updater) { var _a, _b, _c; this.prevState = this.state; if ((_a = this.options) == null ? void 0 : _a.updateFn) { this.state = this.options.updateFn(this.prevState)(updater); } else { if (isUpdaterFunction(updater)) { this.state = updater(this.prevState); } else { this.state = updater; } } (_c = (_b = this.options) == null ? void 0 : _b.onUpdate) == null ? void 0 : _c.call(_b); __flush(this); } }; // node_modules/@tanstack/history/dist/esm/index.js var stateIndexKey = "__TSR_index"; var popStateEvent = "popstate"; var beforeUnloadEvent = "beforeunload"; function createHistory(opts) { let location = opts.getLocation(); const subscribers = /* @__PURE__ */ new Set(); const notify = (action) => { location = opts.getLocation(); subscribers.forEach((subscriber) => subscriber({ location, action })); }; const handleIndexChange = (action) => { if (opts.notifyOnIndexChange ?? true) notify(action); else location = opts.getLocation(); }; const tryNavigation = async ({ task, navigateOpts, ...actionInfo }) => { const ignoreBlocker = navigateOpts?.ignoreBlocker ?? false; if (ignoreBlocker) { task(); return; } const blockers = opts.getBlockers?.() ?? []; const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE"; if (typeof document !== "undefined" && blockers.length && isPushOrReplace) { for (const blocker of blockers) { const nextLocation = parseHref(actionInfo.path, actionInfo.state); const isBlocked = await blocker.blockerFn({ currentLocation: location, nextLocation, action: actionInfo.type }); if (isBlocked) { opts.onBlocked?.(); return; } } } task(); }; return { get location() { return location; }, get length() { return opts.getLength(); }, subscribers, subscribe: (cb) => { subscribers.add(cb); return () => { subscribers.delete(cb); }; }, push: (path, state, navigateOpts) => { const currentIndex = location.state[stateIndexKey]; state = assignKeyAndIndex(currentIndex + 1, state); tryNavigation({ task: () => { opts.pushState(path, state); notify({ type: "PUSH" }); }, navigateOpts, type: "PUSH", path, state }); }, replace: (path, state, navigateOpts) => { const currentIndex = location.state[stateIndexKey]; state = assignKeyAndIndex(currentIndex, state); tryNavigation({ task: () => { opts.replaceState(path, state); notify({ type: "REPLACE" }); }, navigateOpts, type: "REPLACE", path, state }); }, go: (index, navigateOpts) => { tryNavigation({ task: () => { opts.go(index); handleIndexChange({ type: "GO", index }); }, navigateOpts, type: "GO" }); }, back: (navigateOpts) => { tryNavigation({ task: () => { opts.back(navigateOpts?.ignoreBlocker ?? false); handleIndexChange({ type: "BACK" }); }, navigateOpts, type: "BACK" }); }, forward: (navigateOpts) => { tryNavigation({ task: () => { opts.forward(navigateOpts?.ignoreBlocker ?? false); handleIndexChange({ type: "FORWARD" }); }, navigateOpts, type: "FORWARD" }); }, canGoBack: () => location.state[stateIndexKey] !== 0, createHref: (str) => opts.createHref(str), block: (blocker) => { if (!opts.setBlockers) return () => { }; const blockers = opts.getBlockers?.() ?? []; opts.setBlockers([...blockers, blocker]); return () => { const blockers2 = opts.getBlockers?.() ?? []; opts.setBlockers?.(blockers2.filter((b) => b !== blocker)); }; }, flush: () => opts.flush?.(), destroy: () => opts.destroy?.(), notify }; } function assignKeyAndIndex(index, state) { if (!state) { state = {}; } const key = createRandomKey(); return { ...state, key, // TODO: Remove in v2 - use __TSR_key instead __TSR_key: key, [stateIndexKey]: index }; } function createBrowserHistory(opts) { const win = opts?.window ?? (typeof document !== "undefined" ? window : void 0); const originalPushState = win.history.pushState; const originalReplaceState = win.history.replaceState; let blockers = []; const _getBlockers = () => blockers; const _setBlockers = (newBlockers) => blockers = newBlockers; const createHref = opts?.createHref ?? ((path) => path); const parseLocation = opts?.parseLocation ?? (() => parseHref( `${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state )); if (!win.history.state?.__TSR_key && !win.history.state?.key) { const addedKey = createRandomKey(); win.history.replaceState( { [stateIndexKey]: 0, key: addedKey, // TODO: Remove in v2 - use __TSR_key instead __TSR_key: addedKey }, "" ); } let currentLocation = parseLocation(); let rollbackLocation; let nextPopIsGo = false; let ignoreNextPop = false; let skipBlockerNextPop = false; let ignoreNextBeforeUnload = false; const getLocation = () => currentLocation; let next; let scheduled; const flush = () => { if (!next) { return; } history._ignoreSubscribers = true; (next.isPush ? win.history.pushState : win.history.replaceState)( next.state, "", next.href ); history._ignoreSubscribers = false; next = void 0; scheduled = void 0; rollbackLocation = void 0; }; const queueHistoryAction = (type, destHref, state) => { const href = createHref(destHref); if (!scheduled) { rollbackLocation = currentLocation; } currentLocation = parseHref(destHref, state); next = { href, state, isPush: next?.isPush || type === "push" }; if (!scheduled) { scheduled = Promise.resolve().then(() => flush()); } }; const onPushPop = (type) => { currentLocation = parseLocation(); history.notify({ type }); }; const onPushPopEvent = async () => { if (ignoreNextPop) { ignoreNextPop = false; return; } const nextLocation = parseLocation(); const delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey]; const isForward = delta === 1; const isBack = delta === -1; const isGo = !isForward && !isBack || nextPopIsGo; nextPopIsGo = false; const action = isGo ? "GO" : isBack ? "BACK" : "FORWARD"; const notify = isGo ? { type: "GO", index: delta } : { type: isBack ? "BACK" : "FORWARD" }; if (skipBlockerNextPop) { skipBlockerNextPop = false; } else { const blockers2 = _getBlockers(); if (typeof document !== "undefined" && blockers2.length) { for (const blocker of blockers2) { const isBlocked = await blocker.blockerFn({ currentLocation, nextLocation, action }); if (isBlocked) { ignoreNextPop = true; win.history.go(1); history.notify(notify); return; } } } } currentLocation = parseLocation(); history.notify(notify); }; const onBeforeUnload = (e) => { if (ignoreNextBeforeUnload) { ignoreNextBeforeUnload = false; return; } let shouldBlock = false; const blockers2 = _getBlockers(); if (typeof document !== "undefined" && blockers2.length) { for (const blocker of blockers2) { const shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true; if (shouldHaveBeforeUnload === true) { shouldBlock = true; break; } if (typeof shouldHaveBeforeUnload === "function" && shouldHaveBeforeUnload() === true) { shouldBlock = true; break; } } } if (shouldBlock) { e.preventDefault(); return e.returnValue = ""; } return; }; const history = createHistory({ getLocation, getLength: () => win.history.length, pushState: (href, state) => queueHistoryAction("push", href, state), replaceState: (href, state) => queueHistoryAction("replace", href, state), back: (ignoreBlocker) => { if (ignoreBlocker) skipBlockerNextPop = true; ignoreNextBeforeUnload = true; return win.history.back(); }, forward: (ignoreBlocker) => { if (ignoreBlocker) skipBlockerNextPop = true; ignoreNextBeforeUnload = true; win.history.forward(); }, go: (n) => { nextPopIsGo = true; win.history.go(n); }, createHref: (href) => createHref(href), flush, destroy: () => { win.history.pushState = originalPushState; win.history.replaceState = originalReplaceState; win.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true }); win.removeEventListener(popStateEvent, onPushPopEvent); }, onBlocked: () => { if (rollbackLocation && currentLocation !== rollbackLocation) { currentLocation = rollbackLocation; } }, getBlockers: _getBlockers, setBlockers: _setBlockers, notifyOnIndexChange: false }); win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true }); win.addEventListener(popStateEvent, onPushPopEvent); win.history.pushState = function(...args) { const res = originalPushState.apply(win.history, args); if (!history._ignoreSubscribers) onPushPop("PUSH"); return res; }; win.history.replaceState = function(...args) { const res = originalReplaceState.apply(win.history, args); if (!history._ignoreSubscribers) onPushPop("REPLACE"); return res; }; return history; } function parseHref(href, state) { const hashIndex = href.indexOf("#"); const searchIndex = href.indexOf("?"); const addedKey = createRandomKey(); return { href, pathname: href.substring( 0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length ), hash: hashIndex > -1 ? href.substring(hashIndex) : "", search: searchIndex > -1 ? href.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "", state: state || { [stateIndexKey]: 0, key: addedKey, __TSR_key: addedKey } }; } function createRandomKey() { return (Math.random() + 1).toString(36).substring(7); } // node_modules/@tanstack/router-core/dist/esm/utils.js function last(arr) { return arr[arr.length - 1]; } function isFunction(d) { return typeof d === "function"; } function functionalUpdate(updater, previous) { if (isFunction(updater)) { return updater(previous); } return updater; } var hasOwn = Object.prototype.hasOwnProperty; function replaceEqualDeep(prev, _next) { if (prev === _next) { return prev; } const next = _next; const array = isPlainArray(prev) && isPlainArray(next); if (!array && !(isPlainObject(prev) && isPlainObject(next))) return next; const prevItems = array ? prev : getEnumerableOwnKeys(prev); if (!prevItems) return next; const nextItems = array ? next : getEnumerableOwnKeys(next); if (!nextItems) return next; const prevSize = prevItems.length; const nextSize = nextItems.length; const copy = array ? new Array(nextSize) : {}; let equalItems = 0; for (let i = 0; i < nextSize; i++) { const key = array ? i : nextItems[i]; const p = prev[key]; const n = next[key]; if (p === n) { copy[key] = p; if (array ? i < prevSize : hasOwn.call(prev, key)) equalItems++; continue; } if (p === null || n === null || typeof p !== "object" || typeof n !== "object") { copy[key] = n; continue; } const v = replaceEqualDeep(p, n); copy[key] = v; if (v === p) equalItems++; } return prevSize === nextSize && equalItems === prevSize ? prev : copy; } function getEnumerableOwnKeys(o) { const keys = []; const names = Object.getOwnPropertyNames(o); for (const name of names) { if (!Object.prototype.propertyIsEnumerable.call(o, name)) return false; keys.push(name); } const symbols = Object.getOwnPropertySymbols(o); for (const symbol of symbols) { if (!Object.prototype.propertyIsEnumerable.call(o, symbol)) return false; keys.push(symbol); } return keys; } function isPlainObject(o) { if (!hasObjectPrototype(o)) { return false; } const ctor = o.constructor; if (typeof ctor === "undefined") { return true; } const prot = ctor.prototype; if (!hasObjectPrototype(prot)) { return false; } if (!prot.hasOwnProperty("isPrototypeOf")) { return false; } return true; } function hasObjectPrototype(o) { return Object.prototype.toString.call(o) === "[object Object]"; } function isPlainArray(value) { return Array.isArray(value) && value.length === Object.keys(value).length; } function deepEqual(a, b, opts) { if (a === b) { return true; } if (typeof a !== typeof b) { return false; } if (Array.isArray(a) && Array.isArray(b)) { if (a.length !== b.length) return false; for (let i = 0, l = a.length; i < l; i++) { if (!deepEqual(a[i], b[i], opts)) return false; } return true; } if (isPlainObject(a) && isPlainObject(b)) { const ignoreUndefined = opts?.ignoreUndefined ?? true; if (opts?.partial) { for (const k in b) { if (!ignoreUndefined || b[k] !== void 0) { if (!deepEqual(a[k], b[k], opts)) return false; } } return true; } let aCount = 0; if (!ignoreUndefined) { aCount = Object.keys(a).length; } else { for (const k in a) { if (a[k] !== void 0) aCount++; } } let bCount = 0; for (const k in b) { if (!ignoreUndefined || b[k] !== void 0) { bCount++; if (bCount > aCount || !deepEqual(a[k], b[k], opts)) return false; } } return aCount === bCount; } return false; } function createControlledPromise(onResolve) { let resolveLoadPromise; let rejectLoadPromise; const controlledPromise = new Promise((resolve, reject) => { resolveLoadPromise = resolve; rejectLoadPromise = reject; }); controlledPromise.status = "pending"; controlledPromise.resolve = (value) => { controlledPromise.status = "resolved"; controlledPromise.value = value; resolveLoadPromise(value); onResolve?.(value); }; controlledPromise.reject = (e) => { controlledPromise.status = "rejected"; rejectLoadPromise(e); }; return controlledPromise; } function isPromise(value) { return Boolean( value && typeof value === "object" && typeof value.then === "function" ); } function findLast(array, predicate) { for (let i = array.length - 1; i >= 0; i--) { const item = array[i]; if (predicate(item)) return item; } return void 0; } var DECODE_IGNORE_LIST = Array.from( (/* @__PURE__ */ new Map([ ["%", "%25"], ["\\", "%5C"], ["/", "%2F"], [";", "%3B"], [":", "%3A"], ["@", "%40"], ["&", "%26"], ["=", "%3D"], ["+", "%2B"], ["$", "%24"], [",", "%2C"] ])).values() ); function decodePathSegment(part, decodeIgnore = DECODE_IGNORE_LIST, startIndex = 0) { function decode2(part2) { try { return decodeURIComponent(part2); } catch { return part2.replaceAll(/%[0-9A-Fa-f]{2}/g, (match) => { try { return decodeURIComponent(match); } catch { return match; } }); } } if (part === "" || !part.match(/%[0-9A-Fa-f]{2}/g)) return part; for (let i = startIndex; i < decodeIgnore.length; i++) { const char = decodeIgnore[i]; if (char && part.includes(char)) { const partsToDecode = part.split(char); const partsToJoin = []; for (const partToDecode of partsToDecode) { partsToJoin.push(decodePathSegment(partToDecode, decodeIgnore, i + 1)); } return partsToJoin.join(char); } } return decode2(part); } // node_modules/tiny-invariant/dist/esm/tiny-invariant.js var isProduction = false; var prefix = "Invariant failed"; function invariant(condition, message) { if (condition) { return; } if (isProduction) { throw new Error(prefix); } var provided = typeof message === "function" ? message() : message; var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix; throw new Error(value); } // node_modules/@tanstack/router-core/dist/esm/path.js var SEGMENT_TYPE_PATHNAME = 0; var SEGMENT_TYPE_PARAM = 1; var SEGMENT_TYPE_WILDCARD = 2; var SEGMENT_TYPE_OPTIONAL_PARAM = 3; function joinPaths(paths) { return cleanPath( paths.filter((val) => { return val !== void 0; }).join("/") ); } function cleanPath(path) { return path.replace(/\/{2,}/g, "/"); } function trimPathLeft(path) { return path === "/" ? path : path.replace(/^\/{1,}/, ""); } function trimPathRight(path) { return path === "/" ? path : path.replace(/\/{1,}$/, ""); } function trimPath(path) { return trimPathRight(trimPathLeft(path)); } function removeTrailingSlash(value, basepath) { if (value?.endsWith("/") && value !== "/" && value !== `${basepath}/`) { return value.slice(0, -1); } return value; } function exactPathTest(pathName1, pathName2, basepath) { return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath); } function segmentToString(segment) { const { type, value } = segment; if (type === SEGMENT_TYPE_PATHNAME) { return value; } const { prefixSegment, suffixSegment } = segment; if (type === SEGMENT_TYPE_PARAM) { const param = value.substring(1); if (prefixSegment && suffixSegment) { return `${prefixSegment}{$${param}}${suffixSegment}`; } else if (prefixSegment) { return `${prefixSegment}{$${param}}`; } else if (suffixSegment) { return `{$${param}}${suffixSegment}`; } } if (type === SEGMENT_TYPE_OPTIONAL_PARAM) { const param = value.substring(1); if (prefixSegment && suffixSegment) { return `${prefixSegment}{-$${param}}${suffixSegment}`; } else if (prefixSegment) { return `${prefixSegment}{-$${param}}`; } else if (suffixSegment) { return `{-$${param}}${suffixSegment}`; } return `{-$${param}}`; } if (type === SEGMENT_TYPE_WILDCARD) { if (prefixSegment && suffixSegment) { return `${prefixSegment}{$}${suffixSegment}`; } else if (prefixSegment) { return `${prefixSegment}{$}`; } else if (suffixSegment) { return `{$}${suffixSegment}`; } } return value; } function resolvePath({ base, to, trailingSlash = "never", parseCache }) { let baseSegments = parsePathname(base, parseCache).slice(); const toSegments = parsePathname(to, parseCache); if (baseSegments.length > 1 && last(baseSegments)?.value === "/") { baseSegments.pop(); } for (let index = 0, length = toSegments.length; index < length; index++) { const toSegment = toSegments[index]; const value = toSegment.value; if (value === "/") { if (!index) { baseSegments = [toSegment]; } else if (index === length - 1) { baseSegments.push(toSegment); } else ; } else if (value === "..") { baseSegments.pop(); } else if (value === ".") ; else { baseSegments.push(toSegment); } } if (baseSegments.length > 1) { if (last(baseSegments).value === "/") { if (trailingSlash === "never") { baseSegments.pop(); } } else if (trailingSlash === "always") { baseSegments.push({ type: SEGMENT_TYPE_PATHNAME, value: "/" }); } } const segmentValues = baseSegments.map(segmentToString); const joined = joinPaths(segmentValues); return joined; } var parsePathname = (pathname, cache) => { if (!pathname) return []; const cached = cache?.get(pathname); if (cached) return cached; const parsed = baseParsePathname(pathname); cache?.set(pathname, parsed); return parsed; }; var PARAM_RE = /^\$.{1,}$/; var PARAM_W_CURLY_BRACES_RE = /^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/; var OPTIONAL_PARAM_W_CURLY_BRACES_RE = /^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/; var WILDCARD_RE = /^\$$/; var WILDCARD_W_CURLY_BRACES_RE = /^(.*?)\{\$\}(.*)$/; function baseParsePathname(pathname) { pathname = cleanPath(pathname); const segments = []; if (pathname.slice(0, 1) === "/") { pathname = pathname.substring(1); segments.push({ type: SEGMENT_TYPE_PATHNAME, value: "/" }); } if (!pathname) { return segments; } const split = pathname.split("/").filter(Boolean); segments.push( ...split.map((part) => { const wildcardBracesMatch = part.match(WILDCARD_W_CURLY_BRACES_RE); if (wildcardBracesMatch) { const prefix2 = wildcardBracesMatch[1]; const suffix = wildcardBracesMatch[2]; return { type: SEGMENT_TYPE_WILDCARD, value: "$", prefixSegment: prefix2 || void 0, suffixSegment: suffix || void 0 }; } const optionalParamBracesMatch = part.match( OPTIONAL_PARAM_W_CURLY_BRACES_RE ); if (optionalParamBracesMatch) { const prefix2 = optionalParamBracesMatch[1]; const paramName = optionalParamBracesMatch[2]; const suffix = optionalParamBracesMatch[3]; return { type: SEGMENT_TYPE_OPTIONAL_PARAM, value: paramName, // Now just $paramName (no prefix) prefixSegment: prefix2 || void 0, suffixSegment: suffix || void 0 }; } const paramBracesMatch = part.match(PARAM_W_CURLY_BRACES_RE); if (paramBracesMatch) { const prefix2 = paramBracesMatch[1]; const paramName = paramBracesMatch[2]; const suffix = paramBracesMatch[3]; return { type: SEGMENT_TYPE_PARAM, value: "" + paramName, prefixSegment: prefix2 || void 0, suffixSegment: suffix || void 0 }; } if (PARAM_RE.test(part)) { const paramName = part.substring(1); return { type: SEGMENT_TYPE_PARAM, value: "$" + paramName, prefixSegment: void 0, suffixSegment: void 0 }; } if (WILDCARD_RE.test(part)) { return { type: SEGMENT_TYPE_WILDCARD, value: "$", prefixSegment: void 0, suffixSegment: void 0 }; } return { type: SEGMENT_TYPE_PATHNAME, value: decodePathSegment(part) }; }) ); if (pathname.slice(-1) === "/") { pathname = pathname.substring(1); segments.push({ type: SEGMENT_TYPE_PATHNAME, value: "/" }); } return segments; } function interpolatePath({ path, params, leaveWildcards, leaveParams, decodeCharMap, parseCache }) { const interpolatedPathSegments = parsePathname(path, parseCache); function encodeParam(key) { const value = params[key]; const isValueString = typeof value === "string"; if (key === "*" || key === "_splat") { return isValueString ? encodeURI(value) : value; } else { return isValueString ? encodePathParam(value, decodeCharMap) : value; } } let isMissingParams = false; const usedParams = {}; const interpolatedPath = joinPaths( interpolatedPathSegments.map((segment) => { if (segment.type === SEGMENT_TYPE_PATHNAME) { return segment.value; } if (segment.type === SEGMENT_TYPE_WILDCARD) { usedParams._splat = params._splat; usedParams["*"] = params._splat; const segmentPrefix = segment.prefixSegment || ""; const segmentSuffix = segment.suffixSegment || ""; if (!params._splat) { isMissingParams = true; if (leaveWildcards) { return `${segmentPrefix}${segment.value}${segmentSuffix}`; } if (segmentPrefix || segmentSuffix) { return `${segmentPrefix}${segmentSuffix}`; } return void 0; } const value = encodeParam("_splat"); if (leaveWildcards) { return `${segmentPrefix}${segment.value}${value ?? ""}${segmentSuffix}`; } return `${segmentPrefix}${value}${segmentSuffix}`; } if (segment.type === SEGMENT_TYPE_PARAM) { const key = segment.value.substring(1); if (!isMissingParams && !(key in params)) { isMissingParams = true; } usedParams[key] = params[key]; const segmentPrefix = segment.prefixSegment || ""; const segmentSuffix = segment.suffixSegment || ""; if (leaveParams) { const value = encodeParam(segment.value); return `${segmentPrefix}${segment.value}${value ?? ""}${segmentSuffix}`; } return `${segmentPrefix}${encodeParam(key) ?? "undefined"}${segmentSuffix}`; } if (segment.type === SEGMENT_TYPE_OPTIONAL_PARAM) { const key = segment.value.substring(1); const segmentPrefix = segment.prefixSegment || ""; const segmentSuffix = segment.suffixSegment || ""; if (!(key in params) || params[key] == null) { if (leaveWildcards) { return `${segmentPrefix}${key}${segmentSuffix}`; } if (segmentPrefix || segmentSuffix) { return `${segmentPrefix}${segmentSuffix}`; } return void 0; } usedParams[key] = params[key]; if (leaveParams) { const value = encodeParam(segment.value); return `${segmentPrefix}${segment.value}${value ?? ""}${segmentSuffix}`; } if (leaveWildcards) { return `${segmentPrefix}${key}${encodeParam(key) ?? ""}${segmentSuffix}`; } return `${segmentPrefix}${encodeParam(key) ?? ""}${segmentSuffix}`; } return segment.value; }) ); return { usedParams, interpolatedPath, isMissingParams }; } function encodePathParam(value, decodeCharMap) { let encoded = encodeURIComponent(value); if (decodeCharMap) { for (const [encodedChar, char] of decodeCharMap) { encoded = encoded.replaceAll(encodedChar, char); } } return encoded; } function matchPathname(currentPathname, matchLocation, parseCache) { const pathParams = matchByPath(currentPathname, matchLocation, parseCache); if (matchLocation.to && !pathParams) { return; } return pathParams ?? {}; } function matchByPath(from, { to, fuzzy, caseSensitive }, parseCache) { const stringTo = to; const baseSegments = parsePathname( from.startsWith("/") ? from : `/${from}`, parseCache ); const routeSegments = parsePathname( stringTo.startsWith("/") ? stringTo : `/${stringTo}`, parseCache ); const params = {}; const result = isMatch( baseSegments, routeSegments, params, fuzzy, caseSensitive ); return result ? params : void 0; } function isMatch(baseSegments, routeSegments, params, fuzzy, caseSensitive) { let baseIndex = 0; let routeIndex = 0; while (baseIndex < baseSegments.length || routeIndex < routeSegments.length) { const baseSegment = baseSegments[baseIndex]; const routeSegment = routeSegments[routeIndex]; if (routeSegment) { if (routeSegment.type === SEGMENT_TYPE_WILDCARD) { const remainingBaseSegments = baseSegments.slice(baseIndex); let _splat; if (routeSegment.prefixSegment || routeSegment.suffixSegment) { if (!baseSegment) return false; const prefix2 = routeSegment.prefixSegment || ""; const suffix = routeSegment.suffixSegment || ""; const baseValue = baseSegment.value; if ("prefixSegment" in routeSegment) { if (!baseValue.startsWith(prefix2)) { return false; } } if ("suffixSegment" in routeSegment) { if (!baseSegments[baseSegments.length - 1]?.value.endsWith(suffix)) { return false; } } let rejoinedSplat = decodeURI( joinPaths(remainingBaseSegments.map((d) => d.value)) ); if (prefix2 && rejoinedSplat.startsWith(prefix2)) { rejoinedSplat = rejoinedSplat.slice(prefix2.length); } if (suffix && rejoinedSplat.endsWith(suffix)) { rejoinedSplat = rejoinedSplat.slice( 0, rejoinedSplat.length - suffix.length ); } _splat = rejoinedSplat; } else { _splat = decodeURI( joinPaths(remainingBaseSegments.map((d) => d.value)) ); } params["*"] = _splat; params["_splat"] = _splat; return true; } if (routeSegment.type === SEGMENT_TYPE_PATHNAME) { if (routeSegment.value === "/" && !baseSegment?.value) { routeIndex++; continue; } if (baseSegment) { if (caseSensitive) { if (routeSegment.value !== baseSegment.value) { return false; } } else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase()) { return false; } baseIndex++; routeIndex++; continue; } else { return false; } } if (routeSegment.type === SEGMENT_TYPE_PARAM) { if (!baseSegment) { return false; } if (baseSegment.value === "/") { return false; } let _paramValue = ""; let matched = false; if (routeSegment.prefixSegment || routeSegment.suffixSegment) { const prefix2 = routeSegment.prefixSegment || ""; const suffix = routeSegment.suffixSegment || ""; const baseValue = baseSegment.value; if (prefix2 && !baseValue.startsWith(prefix2)) { return false; } if (suffix && !baseValue.endsWith(suffix)) { return false; } let paramValue = baseValue; if (prefix2 && paramValue.startsWith(prefix2)) { paramValue = paramValue.slice(prefix2.length); } if (suffix && paramValue.endsWith(suffix)) { paramValue = paramValue.slice(0, paramValue.length - suffix.length); } _paramValue = decodeURIComponent(paramValue); matched = true; } else { _paramValue = decodeURIComponent(baseSegment.value); matched = true; } if (matched) { params[routeSegment.value.substring(1)] = _paramValue; baseIndex++; } routeIndex++; continue; } if (routeSegment.type === SEGMENT_TYPE_OPTIONAL_PARAM) { if (!baseSegment) { routeIndex++; continue; } if (baseSegment.value === "/") { routeIndex++; continue; } let _paramValue = ""; let matched = false; if (routeSegment.prefixSegment || routeSegment.suffixSegment) { const prefix2 = routeSegment.prefixSegment || ""; const suffix = routeSegment.suffixSegment || ""; const baseValue = baseSegment.value; if ((!prefix2 || baseValue.startsWith(prefix2)) && (!suffix || baseValue.endsWith(suffix))) { let paramValue = baseValue; if (prefix2 && paramValue.startsWith(prefix2)) { paramValue = paramValue.slice(prefix2.length); } if (suffix && paramValue.endsWith(suffix)) { paramValue = paramValue.slice( 0, paramValue.length - suffix.length ); } _paramValue = decodeURIComponent(paramValue); matched = true; } } else { let shouldMatchOptional = true; for (let lookAhead = routeIndex + 1; lookAhead < routeSegments.length; lookAhead++) { const futureRouteSegment = routeSegments[lookAhead]; if (futureRouteSegment?.type === SEGMENT_TYPE_PATHNAME && futureRouteSegment.value === baseSegment.value) { shouldMatchOptional = false; break; } if (futureRouteSegment?.type === SEGMENT_TYPE_PARAM || futureRouteSegment?.type === SEGMENT_TYPE_WILDCARD) { if (baseSegments.length < routeSegments.length) { shouldMatchOptional = false; } break; } } if (shouldMatchOptional) { _paramValue = decodeURIComponent(baseSegment.value); matched = true; } } if (matched) { params[routeSegment.value.substring(1)] = _paramValue; baseIndex++; } routeIndex++; continue; } } if (baseIndex < baseSegments.length && routeIndex >= routeSegments.length) { params["**"] = joinPaths( baseSegments.slice(baseIndex).map((d) => d.value) ); return !!fuzzy && routeSegments[routeSegments.length - 1]?.value !== "/"; } if (routeIndex < routeSegments.length && baseIndex >= baseSegments.length) { for (let i = routeIndex; i < routeSegments.length; i++) { if (routeSegments[i]?.type !== SEGMENT_TYPE_OPTIONAL_PARAM) { return false; } } break; } break; } return true; } // node_modules/@tanstack/router-core/dist/esm/process-route-tree.js var SLASH_SCORE = 0.75; var STATIC_SEGMENT_SCORE = 1; var REQUIRED_PARAM_BASE_SCORE = 0.5; var OPTIONAL_PARAM_BASE_SCORE = 0.4; var WILDCARD_PARAM_BASE_SCORE = 0.25; var STATIC_AFTER_DYNAMIC_BONUS_SCORE = 0.2; var BOTH_PRESENCE_BASE_SCORE = 0.05; var PREFIX_PRESENCE_BASE_SCORE = 0.02; var SUFFIX_PRESENCE_BASE_SCORE = 0.01; var PREFIX_LENGTH_SCORE_MULTIPLIER = 2e-4; var SUFFIX_LENGTH_SCORE_MULTIPLIER = 1e-4; function handleParam(segment, baseScore) { if (segment.prefixSegment && segment.suffixSegment) { return baseScore + BOTH_PRESENCE_BASE_SCORE + PREFIX_LENGTH_SCORE_MULTIPLIER * segment.prefixSegment.length + SUFFIX_LENGTH_SCORE_MULTIPLIER * segment.suffixSegment.length; } if (segment.prefixSegment) { return baseScore + PREFIX_PRESENCE_BASE_SCORE + PREFIX_LENGTH_SCORE_MULTIPLIER * segment.prefixSegment.length; } if (segment.suffixSegment) { return baseScore + SUFFIX_PRESENCE_BASE_SCORE + SUFFIX_LENGTH_SCORE_MULTIPLIER * segment.suffixSegment.length; } return baseScore; } function sortRoutes(routes) { const scoredRoutes = []; routes.forEach((d, i) => { if (d.isRoot || !d.path) { return; } const trimmed = trimPathLeft(d.fullPath); let parsed = parsePathname(trimmed); let skip = 0; while (parsed.length > skip + 1 && parsed[skip]?.value === "/") { skip++; } if (skip > 0) parsed = parsed.slice(skip); let optionalParamCount = 0; let hasStaticAfter = false; const scores = parsed.map((segment, index) => { if (segment.value === "/") { return SLASH_SCORE; } if (segment.type === SEGMENT_TYPE_PATHNAME) { return STATIC_SEGMENT_SCORE; } let baseScore = void 0; if (segment.type === SEGMENT_TYPE_PARAM) { baseScore = REQUIRED_PARAM_BASE_SCORE; } else if (segment.type === SEGMENT_TYPE_OPTIONAL_PARAM) { baseScore = OPTIONAL_PARAM_BASE_SCORE; optionalParamCount++; } else { baseScore = WILDCARD_PARAM_BASE_SCORE; } for (let i2 = index + 1; i2 < parsed.length; i2++) { const nextSegment = parsed[i2]; if (nextSegment.type === SEGMENT_TYPE_PATHNAME && nextSegment.value !== "/") { hasStaticAfter = true; return handleParam( segment, baseScore + STATIC_AFTER_DYNAMIC_BONUS_SCORE ); } } return handleParam(segment, baseScore); }); scoredRoutes.push({ child: d, trimmed, parsed, index: i, scores, optionalParamCount, hasStaticAfter }); }); const flatRoutes = scoredRoutes.sort((a, b) => { const minLength = Math.min(a.scores.length, b.scores.length); for (let i = 0; i < minLength; i++) { if (a.scores[i] !== b.scores[i]) { return b.scores[i] - a.scores[i]; } } if (a.scores.length !== b.scores.length) { if (a.optionalParamCount !== b.optionalParamCount) { if (a.hasStaticAfter === b.hasStaticAfter) { return a.optionalParamCount - b.optionalParamCount; } else if (a.hasStaticAfter && !b.hasStaticAfter) { return -1; } else if (!a.hasStaticAfter && b.hasStaticAfter) { return 1; } } return b.scores.length - a.scores.length; } for (let i = 0; i < minLength; i++) { if (a.parsed[i].value !== b.parsed[i].value) { return a.parsed[i].value > b.parsed[i].value ? 1 : -1; } } return a.index - b.index; }).map((d, i) => { d.child.rank = i; return d.child; }); return flatRoutes; } function processRouteTree({ routeTree, initRoute }) { const routesById = {}; const routesByPath = {}; const recurseRoutes = (childRoutes) => { childRoutes.forEach((childRoute, i) => { initRoute?.(childRoute, i); const existingRoute = routesById[childRoute.id]; invariant( !existingRoute, `Duplicate routes found with id: ${String(childRoute.id)}` ); routesById[childRoute.id] = childRoute; if (!childRoute.isRoot && childRoute.path) { const trimmedFullPath = trimPathRight(childRoute.fullPath); if (!routesByPath[trimmedFullPath] || childRoute.fullPath.endsWith("/")) { routesByPath[trimmedFullPath] = childRoute; } } const children = childRoute.children; if (children?.length) { recurseRoutes(children); } }); }; recurseRoutes([routeTree]); const flatRoutes = sortRoutes(Object.values(routesById)); return { routesById, routesByPath, flatRoutes }; } // node_modules/@tanstack/router-core/dist/esm/not-found.js function notFound(options = {}) { options.isNotFound = true; if (options.throw) throw options; return options; } function isNotFound(obj) { return !!obj?.isNotFound; } // node_modules/@tanstack/router-core/dist/esm/scroll-restoration.js function getSafeSessionStorage() { try { if (typeof window !== "undefined" && typeof window.sessionStorage === "object") { return window.sessionStorage; } } catch { } return void 0; } var storageKey = "tsr-scroll-restoration-v1_3"; var throttle = (fn, wait) => { let timeout; return (...args) => { if (!timeout) { timeout = setTimeout(() => { fn(...args); timeout = null; }, wait); } }; }; function createScrollRestorationCache() { const safeSessionStorage = getSafeSessionStorage(); if (!safeSessionStorage) { return null; } const persistedState = safeSessionStorage.getItem(storageKey); let state = persistedState ? JSON.parse(persistedState) : {}; return { state, // This setter is simply to make sure that we set the sessionStorage right // after the state is updated. It doesn't necessarily need to be a functional // update. set: (updater) => (state = functionalUpdate(updater, state) || state, safeSessionStorage.setItem(storageKey, JSON.stringify(state))) }; } var scrollRestorationCache = createScrollRestorationCache(); var defaultGetScrollRestorationKey = (location) => { return location.state.__TSR_key || location.href; }; function getCssSelector(el) { const path = []; let parent; while (parent = el.parentNode) { path.push( `${el.tagName}:nth-child(${Array.prototype.indexOf.call(parent.children, el) + 1})` ); el = parent; } return `${path.reverse().join(" > ")}`.toLowerCase(); } var ignoreScroll = false; function restoreScroll({ storageKey: storageKey2, key, behavior, shouldScrollRestoration, scrollToTopSelectors, location }) { let byKey; try { byKey = JSON.parse(sessionStorage.getItem(storageKey2) || "{}"); } catch (error) { console.error(error); return; } const resolvedKey = key || window.history.state?.__TSR_key; const elementEntries = byKey[resolvedKey]; ignoreScroll = true; scroll: { if (shouldScrollRestoration && elementEntries && Object.keys(elementEntries).length > 0) { for (const elementSelector in elementEntries) { const entry = elementEntries[elementSelector]; if (elementSelector === "window") { window.scrollTo({ top: entry.scrollY, left: entry.scrollX, behavior }); } else if (elementSelector) { const element = document.querySelector(elementSelector); if (element) { element.scrollLeft = entry.scrollX; element.scrollTop = entry.scrollY; } } } break scroll; } const hash = (location ?? window.location).hash.split("#", 2)[1]; if (hash) { const hashScrollIntoViewOptions = window.history.state?.__hashScrollIntoViewOptions ?? true; if (hashScrollIntoViewOptions) { const el = document.getElementById(hash); if (el) { el.scrollIntoView(hashScrollIntoViewOptions); } } break scroll; } const scrollOptions = { top: 0, left: 0, behavior }; window.scrollTo(scrollOptions); if (scrollToTopSelectors) { for (const selector of scrollToTopSelectors) { if (selector === "window") continue; const element = typeof selector === "function" ? selector() : document.querySelector(selector); if (element) element.scrollTo(scrollOptions); } } } ignoreScroll = false; } function setupScrollRestoration(router, force) { if (!scrollRestorationCache && !router.isServer) { return; } const shouldScrollRestoration = force ?? router.options.scrollRestoration ?? false; if (shouldScrollRestoration) { router.isScrollRestoring = true; } if (router.isServer || router.isScrollRestorationSetup || !scrollRestorationCache) { return; } router.isScrollRestorationSetup = true; ignoreScroll = false; const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey; window.history.scrollRestoration = "manual"; const onScroll = (event) => { if (ignoreScroll || !router.isScrollRestoring) { return; } let elementSelector = ""; if (event.target === document || event.target === window) { elementSelector = "window"; } else { const attrId = event.target.getAttribute( "data-scroll-restoration-id" ); if (attrId) { elementSelector = `[data-scroll-restoration-id="${attrId}"]`; } else { elementSelector = getCssSelector(event.target); } } const restoreKey = getKey(router.state.location); scrollRestorationCache.set((state) => { const keyEntry = state[restoreKey] ||= {}; const elementEntry = keyEntry[elementSelector] ||= {}; if (elementSelector === "window") { elementEntry.scrollX = window.scrollX || 0; elementEntry.scrollY = window.scrollY || 0; } else if (elementSelector) { const element = document.querySelector(elementSelector); if (element) { elementEntry.scrollX = element.scrollLeft || 0; elementEntry.scrollY = element.scrollTop || 0; } } return state; }); }; if (typeof document !== "undefined") { document.addEventListener("scroll", throttle(onScroll, 100), true); } router.subscribe("onRendered", (event) => { const cacheKey = getKey(event.toLocation); if (!router.resetNextScroll) { router.resetNextScroll = true; return; } if (typeof router.options.scrollRestoration === "function") { const shouldRestore = router.options.scrollRestoration({ location: router.latestLocation }); if (!shouldRestore) { return; } } restoreScroll({ storageKey, key: cacheKey, behavior: router.options.scrollRestorationBehavior, shouldScrollRestoration: router.isScrollRestoring, scrollToTopSelectors: router.options.scrollToTopSelectors, location: router.history.location }); if (router.isScrollRestoring) { scrollRestorationCache.set((state) => { state[cacheKey] ||= {}; return state; }); } }); } function handleHashScroll(router) { if (typeof document !== "undefined" && document.querySelector) { const hashScrollIntoViewOptions = router.state.location.state.__hashScrollIntoViewOptions ?? true; if (hashScrollIntoViewOptions && router.state.location.hash !== "") { const el = document.getElementById(router.state.location.hash); if (el) { el.scrollIntoView(hashScrollIntoViewOptions); } } } } // node_modules/@tanstack/router-core/dist/esm/qss.js function encode(obj, stringify = String) { const result = new URLSearchParams(); for (const key in obj) { const val = obj[key]; if (val !== void 0) { result.set(key, stringify(val)); } } return result.toString(); } function toValue(str) { if (!str) return ""; if (str === "false") return false; if (str === "true") return true; return +str * 0 === 0 && +str + "" === str ? +str : str; } function decode(str) { const searchParams = new URLSearchParams(str); const result = {}; for (const [key, value] of searchParams.entries()) { const previousValue = result[key]; if (previousValue == null) { result[key] = toValue(value); } else if (Array.isArray(previousValue)) { previousValue.push(toValue(value)); } else { result[key] = [previousValue, toValue(value)]; } } return result; } // node_modules/@tanstack/router-core/dist/esm/searchParams.js var defaultParseSearch = parseSearchWith(JSON.parse); var defaultStringifySearch = stringifySearchWith( JSON.stringify, JSON.parse ); function parseSearchWith(parser) { return (searchStr) => { if (searchStr[0] === "?") { searchStr = searchStr.substring(1); } const query = decode(searchStr); for (const key in query) { const value = query[key]; if (typeof value === "string") { try { query[key] = parser(value); } catch (_err) { } } } return query; }; } function stringifySearchWith(stringify, parser) { const hasParser = typeof parser === "function"; function stringifyValue(val) { if (typeof val === "object" && val !== null) { try { return stringify(val); } catch (_err) { } } else if (hasParser && typeof val === "string") { try { parser(val); return stringify(val); } catch (_err) { } } return val; } return (search) => { const searchStr = encode(search, stringifyValue); return searchStr ? `?${searchStr}` : ""; }; } // node_modules/@tanstack/router-core/dist/esm/root.js var rootRouteId = "__root__"; // node_modules/@tanstack/router-core/dist/esm/redirect.js function redirect(opts) { opts.statusCode = opts.statusCode || opts.code || 307; if (!opts.reloadDocument && typeof opts.href === "string") { try { new URL(opts.href); opts.reloadDocument = true; } catch { } } const headers = new Headers(opts.headers); if (opts.href && headers.get("Location") === null) { headers.set("Location", opts.href); } const response = new Response(null, { status: opts.statusCode, headers }); response.options = opts; if (opts.throw) { throw response; } return response; } function isRedirect(obj) { return obj instanceof Response && !!obj.options; } // node_modules/@tanstack/router-core/dist/esm/lru-cache.js function createLRUCache(max) { const cache = /* @__PURE__ */ new Map(); let oldest; let newest; const touch = (entry) => { if (!entry.next) return; if (!entry.prev) { entry.next.prev = void 0; oldest = entry.next; entry.next = void 0; if (newest) { entry.prev = newest; newest.next = entry; } } else { entry.prev.next = entry.next; entry.next.prev = entry.prev; entry.next = void 0; if (newest) { newest.next = entry; entry.prev = newest; } } newest = entry; }; return { get(key) { const entry = cache.get(key); if (!entry) return void 0; touch(entry); return entry.value; }, set(key, value) { if (cache.size >= max && oldest) { const toDelete = oldest; cache.delete(toDelete.key); if (toDelete.next) { oldest = toDelete.next; toDelete.next.prev = void 0; } if (toDelete === newest) { newest = void 0; } } const existing = cache.get(key); if (existing) { existing.value = value; touch(existing); } else { const entry = { key, value, prev: newest }; if (newest) newest.next = entry; newest = entry; if (!oldest) oldest = entry; cache.set(key, entry); } } }; } // node_modules/@tanstack/router-core/dist/esm/load-matches.js var triggerOnReady = (inner) => { if (!inner.rendered) { inner.rendered = true; return inner.onReady?.(); } }; var resolvePreload = (inner, matchId) => { return !!(inner.preload && !inner.router.state.matches.some((d) => d.id === matchId)); }; var _handleNotFound = (inner, err) => { const routeCursor = inner.router.routesById[err.routeId ?? ""] ?? inner.router.routeTree; if (!routeCursor.options.notFoundComponent && inner.router.options?.defaultNotFoundComponent) { routeCursor.options.notFoundComponent = inner.router.options.defaultNotFoundComponent; } invariant( routeCursor.options.notFoundComponent, "No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router." ); const matchForRoute = inner.matches.find((m) => m.routeId === routeCursor.id); invariant(matchForRoute, "Could not find match for route: " + routeCursor.id); inner.updateMatch(matchForRoute.id, (prev) => ({ ...prev, status: "notFound", error: err, isFetching: false })); if (err.routerCode === "BEFORE_LOAD" && routeCursor.parentRoute) { err.routeId = routeCursor.parentRoute.id; _handleNotFound(inner, err); } }; var handleRedirectAndNotFound = (inner, match, err) => { if (!isRedirect(err) && !isNotFound(err)) return; if (isRedirect(err) && err.redirectHandled && !err.options.reloadDocument) { throw err; } if (match) { match._nonReactive.beforeLoadPromise?.resolve(); match._nonReactive.loaderPromise?.resolve(); match._nonReactive.beforeLoadPromise = void 0; match._nonReactive.loaderPromise = void 0; const status = isRedirect(err) ? "redirected" : "notFound"; inner.updateMatch(match.id, (prev) => ({ ...prev, status, isFetching: false, error: err })); if (isNotFound(err) && !err.routeId) { err.routeId = match.routeId; } match._nonReactive.loadPromise?.resolve(); } if (isRedirect(err)) { inner.rendered = true; err.options._fromLocation = inner.location; err.redirectHandled = true; err = inner.router.resolveRedirect(err); throw err; } else { _handleNotFound(inner, err); throw err; } }; var shouldSkipLoader = (inner, matchId) => { const match = inner.router.getMatch(matchId); if (!inner.router.isServer && match._nonReactive.dehydrated) { return true; } if (inner.router.isServer && match.ssr === false) { return true; } return false; }; var handleSerialError = (inner, index, err, routerCode) => { const { id: matchId, routeId } = inner.matches[index]; const route = inner.router.looseRoutesById[routeId]; if (err instanceof Promise) { throw err; } err.routerCode = routerCode; inner.firstBadMatchIndex ??= index; handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err); try { route.options.onError?.(err); } catch (errorHandlerErr) { err = errorHandlerErr; handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err); } inner.updateMatch(matchId, (prev) => { prev._nonReactive.beforeLoadPromise?.resolve(); prev._nonReactive.beforeLoadPromise = void 0; prev._nonReactive.loadPromise?.resolve(); return { ...prev, error: err, status: "error", isFetching: false, updatedAt: Date.now(), abortController: new AbortController() }; }); }; var isBeforeLoadSsr = (inner, matchId, index, route) => { const existingMatch = inner.router.getMatch(matchId); const parentMatchId = inner.matches[index - 1]?.id; const parentMatch = parentMatchId ? inner.router.getMatch(parentMatchId) : void 0; if (inner.router.isShell()) { existingMatch.ssr = matchId === rootRouteId; return; } if (parentMatch?.ssr === false) { existingMatch.ssr = false; return; } const parentOverride = (tempSsr2) => { if (tempSsr2 === true && parentMatch?.ssr === "data-only") { return "data-only"; } return tempSsr2; }; const defaultSsr = inner.router.options.defaultSsr ?? true; if (route.options.ssr === void 0) { existingMatch.ssr = parentOverride(defaultSsr); return; } if (typeof route.options.ssr !== "function") { existingMatch.ssr = parentOverride(route.options.ssr); return; } const { search, params } = existingMatch; const ssrFnContext = { search: makeMaybe(search, existingMatch.searchError), params: makeMaybe(params, existingMatch.paramsError), location: inner.location, matches: inner.matches.map((match) => ({ index: match.index, pathname: match.pathname, fullPath: match.fullPath, staticData: match.staticData, id: match.id, routeId: match.routeId, search: makeMaybe(match.search, match.searchError), params: makeMaybe(match.params, match.paramsError), ssr: match.ssr })) }; const tempSsr = route.options.ssr(ssrFnContext); if (isPromise(tempSsr)) { return tempSsr.then((ssr) => { existingMatch.ssr = parentOverride(ssr ?? defaultSsr); }); } existingMatch.ssr = parentOverride(tempSsr ?? defaultSsr); return; }; var setupPendingTimeout = (inner, matchId, route, match) => { if (match._nonReactive.pendingTimeout !== void 0) return; const pendingMs = route.options.pendingMs ?? inner.router.options.defaultPendingMs; const shouldPending = !!(inner.onReady && !inner.router.isServer && !resolvePreload(inner, matchId) && (route.options.loader || route.options.beforeLoad || routeNeedsPreload(route)) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? inner.router.options?.defaultPendingComponent)); if (shouldPending) { const pendingTimeout = setTimeout(() => { triggerOnReady(inner); }, pendingMs); match._nonReactive.pendingTimeout = pendingTimeout; } }; var preBeforeLoadSetup = (inner, matchId, route) => { const existingMatch = inner.router.getMatch(matchId); if (!existingMatch._nonReactive.beforeLoadPromise && !existingMatch._nonReactive.loaderPromise) return; setupPendingTimeout(inner, matchId, route, existingMatch); const then = () => { const match = inner.router.getMatch(matchId); if (match.preload && (match.status === "redirected" || match.status === "notFound")) { handleRedirectAndNotFound(inner, match, match.error); } }; return existingMatch._nonReactive.beforeLoadPromise ? existingMatch._nonReactive.beforeLoadPromise.then(then) : then(); }; var executeBeforeLoad = (inner, matchId, index, route) => { const match = inner.router.getMatch(matchId); const prevLoadPromise = match._nonReactive.loadPromise; match._nonReactive.loadPromise = createControlledPromise(() => { prevLoadPromise?.resolve(); }); const { paramsError, searchError } = match; if (paramsError) { handleSerialError(inner, index, paramsError, "PARSE_PARAMS"); } if (searchError) { handleSerialError(inner, index, searchError, "VALIDATE_SEARCH"); } setupPendingTimeout(inner, matchId, route, match); const abortController = new AbortController(); const parentMatchId = inner.matches[index - 1]?.id; const parentMatch = parentMatchId ? inner.router.getMatch(parentMatchId) : void 0; const parentMatchContext = parentMatch?.context ?? inner.router.options.context ?? void 0; const context = { ...parentMatchContext, ...match.__routeContext }; let isPending = false; const pending = () => { if (isPending) return; isPending = true; inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: "beforeLoad", fetchCount: prev.fetchCount + 1, abortController, context })); }; const resolve = () => { match._nonReactive.beforeLoadPromise?.resolve(); match._nonReactive.beforeLoadPromise = void 0; inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: false })); }; if (!route.options.beforeLoad) { batch(() => { pending(); resolve(); }); return; } match._nonReactive.beforeLoadPromise = createControlledPromise(); const { search, params, cause } = match; const preload = resolvePreload(inner, matchId); const beforeLoadFnContext = { search, abortController, params, preload, context, location: inner.location, navigate: (opts) => inner.router.navigate({ ...opts, _fromLocation: inner.location }), buildLocation: inner.router.buildLocation, cause: preload ? "preload" : cause, matches: inner.matches, ...inner.router.options.additionalContext }; const updateContext = (beforeLoadContext2) => { if (beforeLoadContext2 === void 0) { batch(() => { pending(); resolve(); }); return; } if (isRedirect(beforeLoadContext2) || isNotFound(beforeLoadContext2)) { pending(); handleSerialError(inner, index, beforeLoadContext2, "BEFORE_LOAD"); } batch(() => { pending(); inner.updateMatch(matchId, (prev) => ({ ...prev, __beforeLoadContext: beforeLoadContext2, context: { ...prev.context, ...beforeLoadContext2 } })); resolve(); }); }; let beforeLoadContext; try { beforeLoadContext = route.options.beforeLoad(beforeLoadFnContext); if (isPromise(beforeLoadContext)) { pending(); return beforeLoadContext.catch((err) => { handleSerialError(inner, index, err, "BEFORE_LOAD"); }).then(updateContext); } } catch (err) { pending(); handleSerialError(inner, index, err, "BEFORE_LOAD"); } updateContext(beforeLoadContext); return; }; var handleBeforeLoad = (inner, index) => { const { id: matchId, routeId } = inner.matches[index]; const route = inner.router.looseRoutesById[routeId]; const serverSsr = () => { if (inner.router.isServer) { const maybePromise = isBeforeLoadSsr(inner, matchId, index, route); if (isPromise(maybePromise)) return maybePromise.then(queueExecution); } return queueExecution(); }; const execute = () => executeBeforeLoad(inner, matchId, index, route); const queueExecution = () => { if (shouldSkipLoader(inner, matchId)) return; const result = preBeforeLoadSetup(inner, matchId, route); return isPromise(result) ? result.then(execute) : execute(); }; return serverSsr(); }; var executeHead = (inner, matchId, route) => { const match = inner.router.getMatch(matchId); if (!match) { return; } if (!route.options.head && !route.options.scripts && !route.options.headers) { return; } const assetContext = { matches: inner.matches, match, params: match.params, loaderData: match.loaderData }; return Promise.all([ route.options.head?.(assetContext), route.options.scripts?.(assetContext), route.options.headers?.(assetContext) ]).then(([headFnContent, scripts, headers]) => { const meta = headFnContent?.meta; const links = headFnContent?.links; const headScripts = headFnContent?.scripts; const styles = headFnContent?.styles; return { meta, links, headScripts, headers, scripts, styles }; }); }; var getLoaderContext = (inner, matchId, index, route) => { const parentMatchPromise = inner.matchPromises[index - 1]; const { params, loaderDeps, abortController, context, cause } = inner.router.getMatch(matchId); const preload = resolvePreload(inner, matchId); return { params, deps: loaderDeps, preload: !!preload, parentMatchPromise, abortController, context, location: inner.location, navigate: (opts) => inner.router.navigate({ ...opts, _fromLocation: inner.location }), cause: preload ? "preload" : cause, route, ...inner.router.options.additionalContext }; }; var runLoader = async (inner, matchId, index, route) => { try { const match = inner.router.getMatch(matchId); try { if (!inner.router.isServer || match.ssr === true) { loadRouteChunk(route); } const loaderResult = route.options.loader?.( getLoaderContext(inner, matchId, index, route) ); const loaderResultIsPromise = route.options.loader && isPromise(loaderResult); const willLoadSomething = !!(loaderResultIsPromise || route._lazyPromise || route._componentsPromise || route.options.head || route.options.scripts || route.options.headers || match._nonReactive.minPendingPromise); if (willLoadSomething) { inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: "loader" })); } if (route.options.loader) { const loaderData = loaderResultIsPromise ? await loaderResult : loaderResult; handleRedirectAndNotFound( inner, inner.router.getMatch(matchId), loaderData ); if (loaderData !== void 0) { inner.updateMatch(matchId, (prev) => ({ ...prev, loaderData })); } } if (route._lazyPromise) await route._lazyPromise; const headResult = executeHead(inner, matchId, route); const head = headResult ? await headResult : void 0; const pendingPromise = match._nonReactive.minPendingPromise; if (pendingPromise) await pendingPromise; if (route._componentsPromise) await route._componentsPromise; inner.updateMatch(matchId, (prev) => ({ ...prev, error: void 0, status: "success", isFetching: false, updatedAt: Date.now(), ...head })); } catch (e) { let error = e; const pendingPromise = match._nonReactive.minPendingPromise; if (pendingPromise) await pendingPromise; if (isNotFound(e)) { await route.options.notFoundComponent?.preload?.(); } handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), e); try { route.options.onError?.(e); } catch (onErrorError) { error = onErrorError; handleRedirectAndNotFound( inner, inner.router.getMatch(matchId), onErrorError ); } const headResult = executeHead(inner, matchId, route); const head = headResult ? await headResult : void 0; inner.updateMatch(matchId, (prev) => ({ ...prev, error, status: "error", isFetching: false, ...head })); } } catch (err) { const match = inner.router.getMatch(matchId); if (match) { const headResult = executeHead(inner, matchId, route); if (headResult) { const head = await headResult; inner.updateMatch(matchId, (prev) => ({ ...prev, ...head })); } match._nonReactive.loaderPromise = void 0; } handleRedirectAndNotFound(inner, match, err); } }; var loadRouteMatch = async (inner, index) => { const { id: matchId, routeId } = inner.matches[index]; let loaderShouldRunAsync = false; let loaderIsRunningAsync = false; const route = inner.router.looseRoutesById[routeId]; if (shouldSkipLoader(inner, matchId)) { if (inner.router.isServer) { const headResult = executeHead(inner, matchId, route); if (headResult) { const head = await headResult; inner.updateMatch(matchId, (prev) => ({ ...prev, ...head })); } return inner.router.getMatch(matchId); } } else { const prevMatch = inner.router.getMatch(matchId); if (prevMatch._nonReactive.loaderPromise) { if (prevMatch.status === "success" && !inner.sync && !prevMatch.preload) { return prevMatch; } await prevMatch._nonReactive.loaderPromise; const match2 = inner.router.getMatch(matchId); if (match2.error) { handleRedirectAndNotFound(inner, match2, match2.error); } } else { const age = Date.now() - prevMatch.updatedAt; const preload = resolvePreload(inner, matchId); const staleAge = preload ? route.options.preloadStaleTime ?? inner.router.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? inner.router.options.defaultStaleTime ?? 0; const shouldReloadOption = route.options.shouldReload; const shouldReload = typeof shouldReloadOption === "function" ? shouldReloadOption(getLoaderContext(inner, matchId, index, route)) : shouldReloadOption; const nextPreload = !!preload && !inner.router.state.matches.some((d) => d.id === matchId); const match2 = inner.router.getMatch(matchId); match2._nonReactive.loaderPromise = createControlledPromise(); if (nextPreload !== match2.preload) { inner.updateMatch(matchId, (prev) => ({ ...prev, preload: nextPreload })); } const { status, invalid } = match2; loaderShouldRunAsync = status === "success" && (invalid || (shouldReload ?? age > staleAge)); if (preload && route.options.preload === false) ; else if (loaderShouldRunAsync && !inner.sync) { loaderIsRunningAsync = true; (async () => { try { await runLoader(inner, matchId, index, route); const match3 = inner.router.getMatch(matchId); match3._nonReactive.loaderPromise?.resolve(); match3._nonReactive.loadPromise?.resolve(); match3._nonReactive.loaderPromise = void 0; } catch (err) { if (isRedirect(err)) { await inner.router.navigate(err.options); } } })(); } else if (status !== "success" || loaderShouldRunAsync && inner.sync) { await runLoader(inner, matchId, index, route); } else { const headResult = executeHead(inner, matchId, route); if (headResult) { const head = await headResult; inner.updateMatch(matchId, (prev) => ({ ...prev, ...head })); } } } } const match = inner.router.getMatch(matchId); if (!loaderIsRunningAsync) { match._nonReactive.loaderPromise?.resolve(); match._nonReactive.loadPromise?.resolve(); } clearTimeout(match._nonReactive.pendingTimeout); match._nonReactive.pendingTimeout = void 0; if (!loaderIsRunningAsync) match._nonReactive.loaderPromise = void 0; match._nonReactive.dehydrated = void 0; const nextIsFetching = loaderIsRunningAsync ? match.isFetching : false; if (nextIsFetching !== match.isFetching || match.invalid !== false) { inner.updateMatch(matchId, (prev) => ({ ...prev, isFetching: nextIsFetching, invalid: false })); return inner.router.getMatch(matchId); } else { return match; } }; async function loadMatches(arg) { const inner = Object.assign(arg, { matchPromises: [] }); if (!inner.router.isServer && inner.router.state.matches.some((d) => d._forcePending)) { triggerOnReady(inner); } try { for (let i = 0; i < inner.matches.length; i++) { const beforeLoad = handleBeforeLoad(inner, i); if (isPromise(beforeLoad)) await beforeLoad; } const max = inner.firstBadMatchIndex ?? inner.matches.length; for (let i = 0; i < max; i++) { inner.matchPromises.push(loadRouteMatch(inner, i)); } await Promise.all(inner.matchPromises); const readyPromise = triggerOnReady(inner); if (isPromise(readyPromise)) await readyPromise; } catch (err) { if (isNotFound(err) && !inner.preload) { const readyPromise = triggerOnReady(inner); if (isPromise(readyPromise)) await readyPromise; throw err; } if (isRedirect(err)) { throw err; } } return inner.matches; } async function loadRouteChunk(route) { if (!route._lazyLoaded && route._lazyPromise === void 0) { if (route.lazyFn) { route._lazyPromise = route.lazyFn().then((lazyRoute) => { const { id: _id, ...options } = lazyRoute.options; Object.assign(route.options, options); route._lazyLoaded = true; route._lazyPromise = void 0; }); } else { route._lazyLoaded = true; } } if (!route._componentsLoaded && route._componentsPromise === void 0) { const loadComponents = () => { const preloads = []; for (const type of componentTypes) { const preload = route.options[type]?.preload; if (preload) preloads.push(preload()); } if (preloads.length) return Promise.all(preloads).then(() => { route._componentsLoaded = true; route._componentsPromise = void 0; }); route._componentsLoaded = true; route._componentsPromise = void 0; return; }; route._componentsPromise = route._lazyPromise ? route._lazyPromise.then(loadComponents) : loadComponents(); } return route._componentsPromise; } function makeMaybe(value, error) { if (error) { return { status: "error", error }; } return { status: "success", value }; } function routeNeedsPreload(route) { for (const componentType of componentTypes) { if (route.options[componentType]?.preload) { return true; } } return false; } var componentTypes = [ "component", "errorComponent", "pendingComponent", "notFoundComponent" ]; // node_modules/@tanstack/router-core/dist/esm/rewrite.js function composeRewrites(rewrites) { return { input: ({ url }) => { for (const rewrite of rewrites) { url = executeRewriteInput(rewrite, url); } return url; }, output: ({ url }) => { for (let i = rewrites.length - 1; i >= 0; i--) { url = executeRewriteOutput(rewrites[i], url); } return url; } }; } function rewriteBasepath(opts) { const trimmedBasepath = trimPath(opts.basepath); const normalizedBasepath = `/${trimmedBasepath}`; const normalizedBasepathWithSlash = `${normalizedBasepath}/`; const checkBasepath = opts.caseSensitive ? normalizedBasepath : normalizedBasepath.toLowerCase(); const checkBasepathWithSlash = opts.caseSensitive ? normalizedBasepathWithSlash : normalizedBasepathWithSlash.toLowerCase(); return { input: ({ url }) => { const pathname = opts.caseSensitive ? url.pathname : url.pathname.toLowerCase(); if (pathname === checkBasepath) { url.pathname = "/"; } else if (pathname.startsWith(checkBasepathWithSlash)) { url.pathname = url.pathname.slice(normalizedBasepath.length); } return url; }, output: ({ url }) => { url.pathname = joinPaths(["/", trimmedBasepath, url.pathname]); return url; } }; } function executeRewriteInput(rewrite, url) { const res = rewrite?.input?.({ url }); if (res) { if (typeof res === "string") { return new URL(res); } else if (res instanceof URL) { return res; } } return url; } function executeRewriteOutput(rewrite, url) { const res = rewrite?.output?.({ url }); if (res) { if (typeof res === "string") { return new URL(res); } else if (res instanceof URL) { return res; } } return url; } // node_modules/@tanstack/router-core/dist/esm/router.js function getLocationChangeInfo(routerState) { const fromLocation = routerState.resolvedLocation; const toLocation = routerState.location; const pathChanged = fromLocation?.pathname !== toLocation.pathname; const hrefChanged = fromLocation?.href !== toLocation.href; const hashChanged = fromLocation?.hash !== toLocation.hash; return { fromLocation, toLocation, pathChanged, hrefChanged, hashChanged }; } var RouterCore = class { /** * @deprecated Use the `createRouter` function instead */ constructor(options) { this.tempLocationKey = `${Math.round( Math.random() * 1e7 )}`; this.resetNextScroll = true; this.shouldViewTransition = void 0; this.isViewTransitionTypesSupported = void 0; this.subscribers = /* @__PURE__ */ new Set(); this.isScrollRestoring = false; this.isScrollRestorationSetup = false; this.startTransition = (fn) => fn(); this.update = (newOptions) => { if (newOptions.notFoundRoute) { console.warn( "The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info." ); } const prevOptions = this.options; const prevBasepath = this.basepath ?? prevOptions?.basepath ?? "/"; const basepathWasUnset = this.basepath === void 0; const prevRewriteOption = prevOptions?.rewrite; this.options = { ...prevOptions, ...newOptions }; this.isServer = this.options.isServer ?? typeof document === "undefined"; this.pathParamsDecodeCharMap = this.options.pathParamsAllowedCharacters ? new Map( this.options.pathParamsAllowedCharacters.map((char) => [ encodeURIComponent(char), char ]) ) : void 0; if (!this.history || this.options.history && this.options.history !== this.history) { if (!this.options.history) { if (!this.isServer) { this.history = createBrowserHistory(); } } else { this.history = this.options.history; } } this.origin = this.options.origin; if (!this.origin) { if (!this.isServer && window?.origin && window.origin !== "null") { this.origin = window.origin; } else { this.origin = "http://localhost"; } } if (this.history) { this.updateLatestLocation(); } if (this.options.routeTree !== this.routeTree) { this.routeTree = this.options.routeTree; this.buildRouteTree(); } if (!this.__store && this.latestLocation) { this.__store = new Store(getInitialRouterState(this.latestLocation), { onUpdate: () => { this.__store.state = { ...this.state, cachedMatches: this.state.cachedMatches.filter( (d) => !["redirected"].includes(d.status) ) }; } }); setupScrollRestoration(this); } let needsLocationUpdate = false; const nextBasepath = this.options.basepath ?? "/"; const nextRewriteOption = this.options.rewrite; const basepathChanged = basepathWasUnset || prevBasepath !== nextBasepath; const rewriteChanged = prevRewriteOption !== nextRewriteOption; if (basepathChanged || rewriteChanged) { this.basepath = nextBasepath; const rewrites = []; if (trimPath(nextBasepath) !== "") { rewrites.push( rewriteBasepath({ basepath: nextBasepath }) ); } if (nextRewriteOption) { rewrites.push(nextRewriteOption); } this.rewrite = rewrites.length === 0 ? void 0 : rewrites.length === 1 ? rewrites[0] : composeRewrites(rewrites); if (this.history) { this.updateLatestLocation(); } needsLocationUpdate = true; } if (needsLocationUpdate && this.__store) { this.__store.state = { ...this.state, location: this.latestLocation }; } if (typeof window !== "undefined" && "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 = () => { const { routesById, routesByPath, flatRoutes } = processRouteTree({ routeTree: this.routeTree, initRoute: (route, i) => { route.init({ originalIndex: i }); } }); this.routesById = routesById; this.routesByPath = routesByPath; this.flatRoutes = flatRoutes; const notFoundRoute = this.options.notFoundRoute; if (notFoundRoute) { notFoundRoute.init({ originalIndex: 99999999999 }); this.routesById[notFoundRoute.id] = notFoundRoute; } }; this.subscribe = (eventType, fn) => { const listener = { eventType, fn }; this.subscribers.add(listener); return () => { this.subscribers.delete(listener); }; }; this.emit = (routerEvent) => { this.subscribers.forEach((listener) => { if (listener.eventType === routerEvent.type) { listener.fn(routerEvent); } }); }; this.parseLocation = (locationToParse, previousLocation) => { const parse = ({ href, state }) => { const fullUrl = new URL(href, this.origin); const url = executeRewriteInput(this.rewrite, fullUrl); const parsedSearch = this.options.parseSearch(url.search); const searchStr = this.options.stringifySearch(parsedSearch); url.search = searchStr; const fullPath = url.href.replace(url.origin, ""); const { pathname, hash } = url; return { href: fullPath, publicHref: href, url: url.href, pathname, searchStr, search: replaceEqualDeep(previousLocation?.search, parsedSearch), hash: hash.split("#").reverse()[0] ?? "", state: replaceEqualDeep(previousLocation?.state, state) }; }; const location = parse(locationToParse); const { __tempLocation, __tempKey } = location.state; if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) { const parsedTempLocation = parse(__tempLocation); parsedTempLocation.state.key = location.state.key; parsedTempLocation.state.__TSR_key = location.state.__TSR_key; delete parsedTempLocation.state.__tempLocation; return { ...parsedTempLocation, maskedLocation: location }; } return location; }; this.resolvePathWithBase = (from, path) => { const resolvedPath = resolvePath({ base: from, to: cleanPath(path), trailingSlash: this.options.trailingSlash, parseCache: this.parsePathnameCache }); return resolvedPath; }; this.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => { if (typeof pathnameOrNext === "string") { return this.matchRoutesInternal( { pathname: pathnameOrNext, search: locationSearchOrOpts }, opts ); } return this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts); }; this.parsePathnameCache = createLRUCache(1e3); this.getMatchedRoutes = (pathname, routePathname) => { return getMatchedRoutes({ pathname, routePathname, caseSensitive: this.options.caseSensitive, routesByPath: this.routesByPath, routesById: this.routesById, flatRoutes: this.flatRoutes, parseCache: this.parsePathnameCache }); }; this.cancelMatch = (id) => { const match = this.getMatch(id); if (!match) return; match.abortController.abort(); clearTimeout(match._nonReactive.pendingTimeout); match._nonReactive.pendingTimeout = void 0; }; this.cancelMatches = () => { this.state.pendingMatches?.forEach((match) => { this.cancelMatch(match.id); }); }; this.buildLocation = (opts) => { const build = (dest = {}) => { const currentLocation = dest._fromLocation || this.latestLocation; const allCurrentLocationMatches = this.matchRoutes(currentLocation, { _buildLocation: true }); const lastMatch = last(allCurrentLocationMatches); if (dest.from && true && dest._isNavigate) { const allFromMatches = this.getMatchedRoutes( dest.from, void 0 ).matchedRoutes; const matchedFrom = findLast(allCurrentLocationMatches, (d) => { return comparePaths(d.fullPath, dest.from); }); const matchedCurrent = findLast(allFromMatches, (d) => { return comparePaths(d.fullPath, lastMatch.fullPath); }); if (!matchedFrom && !matchedCurrent) { console.warn(`Could not find match for from: ${dest.from}`); } } const defaultedFromPath = dest.unsafeRelative === "path" ? currentLocation.pathname : dest.from ?? lastMatch.fullPath; const fromPath = this.resolvePathWithBase(defaultedFromPath, "."); const fromSearch = lastMatch.search; const fromParams = { ...lastMatch.params }; const nextTo = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(fromPath, "."); const nextParams = dest.params === false || dest.params === null ? {} : (dest.params ?? true) === true ? fromParams : Object.assign( fromParams, functionalUpdate(dest.params, fromParams) ); const interpolatedNextTo = interpolatePath({ path: nextTo, params: nextParams, parseCache: this.parsePathnameCache }).interpolatedPath; const destRoutes = this.matchRoutes(interpolatedNextTo, void 0, { _buildLocation: true }).map((d) => this.looseRoutesById[d.routeId]); if (Object.keys(nextParams).length > 0) { for (const route of destRoutes) { const fn = route.options.params?.stringify ?? route.options.stringifyParams; if (fn) { Object.assign(nextParams, fn(nextParams)); } } } const nextPathname = decodePathSegment( interpolatePath({ // Use the original template path for interpolation // This preserves the original parameter syntax including optional parameters path: nextTo, params: nextParams, leaveWildcards: false, leaveParams: opts.leaveParams, decodeCharMap: this.pathParamsDecodeCharMap, parseCache: this.parsePathnameCache }).interpolatedPath ); let nextSearch = fromSearch; if (opts._includeValidateSearch && this.options.search?.strict) { const validatedSearch = {}; destRoutes.forEach((route) => { if (route.options.validateSearch) { try { Object.assign( validatedSearch, validateSearch(route.options.validateSearch, { ...validatedSearch, ...nextSearch }) ); } catch { } } }); nextSearch = validatedSearch; } nextSearch = applySearchMiddleware({ search: nextSearch, dest, destRoutes, _includeValidateSearch: opts._includeValidateSearch }); nextSearch = replaceEqualDeep(fromSearch, nextSearch); const searchStr = this.options.stringifySearch(nextSearch); const hash = dest.hash === true ? currentLocation.hash : dest.hash ? functionalUpdate(dest.hash, currentLocation.hash) : void 0; const hashStr = hash ? `#${hash}` : ""; let nextState = dest.state === true ? currentLocation.state : dest.state ? functionalUpdate(dest.state, currentLocation.state) : {}; nextState = replaceEqualDeep(currentLocation.state, nextState); const fullPath = `${nextPathname}${searchStr}${hashStr}`; const url = new URL(fullPath, this.origin); const rewrittenUrl = executeRewriteOutput(this.rewrite, url); return { publicHref: rewrittenUrl.pathname + rewrittenUrl.search + rewrittenUrl.hash, href: fullPath, url: rewrittenUrl.href, pathname: nextPathname, search: nextSearch, searchStr, state: nextState, hash: hash ?? "", unmaskOnReload: dest.unmaskOnReload }; }; const buildWithMatches = (dest = {}, maskedDest) => { const next = build(dest); let maskedNext = maskedDest ? build(maskedDest) : void 0; if (!maskedNext) { let params = {}; const foundMask = this.options.routeMasks?.find((d) => { const match = matchPathname( next.pathname, { to: d.from, caseSensitive: false, fuzzy: false }, this.parsePathnameCache ); if (match) { params = match; return true; } return false; }); if (foundMask) { const { from: _from, ...maskProps } = foundMask; maskedDest = { from: opts.from, ...maskProps, params }; maskedNext = build(maskedDest); } } if (maskedNext) { next.maskedLocation = maskedNext; } return next; }; if (opts.mask) { return buildWithMatches(opts, { from: opts.from, ...opts.mask }); } return buildWithMatches(opts); }; this.commitLocation = ({ viewTransition, ignoreBlocker, ...next }) => { const isSameState = () => { const ignoredProps = [ "key", // TODO: Remove in v2 - use __TSR_key instead "__TSR_key", "__TSR_index", "__hashScrollIntoViewOptions" ]; ignoredProps.forEach((prop) => { next.state[prop] = this.latestLocation.state[prop]; }); const isEqual = deepEqual(next.state, this.latestLocation.state); ignoredProps.forEach((prop) => { delete next.state[prop]; }); return isEqual; }; const isSameUrl = trimPathRight(this.latestLocation.href) === trimPathRight(next.href); const previousCommitPromise = this.commitLocationPromise; this.commitLocationPromise = createControlledPromise(() => { previousCommitPromise?.resolve(); }); if (isSameUrl && isSameState()) { this.load(); } else { let { maskedLocation, hashScrollIntoView, ...nextHistory } = next; if (maskedLocation) { nextHistory = { ...maskedLocation, state: { ...maskedLocation.state, __tempKey: void 0, __tempLocation: { ...nextHistory, search: nextHistory.searchStr, state: { ...nextHistory.state, __tempKey: void 0, __tempLocation: void 0, __TSR_key: void 0, key: void 0 // TODO: Remove in v2 - use __TSR_key instead } } } }; if (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) { nextHistory.state.__tempKey = this.tempLocationKey; } } nextHistory.state.__hashScrollIntoViewOptions = hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true; this.shouldViewTransition = viewTransition; this.history[next.replace ? "replace" : "push"]( nextHistory.publicHref, nextHistory.state, { ignoreBlocker } ); } this.resetNextScroll = next.resetScroll ?? true; if (!this.history.subscribers.size) { this.load(); } return this.commitLocationPromise; }; this.buildAndCommitLocation = ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, href, ...rest } = {}) => { if (href) { const currentIndex = this.history.location.state.__TSR_index; const parsed = parseHref(href, { __TSR_index: replace ? currentIndex : currentIndex + 1 }); rest.to = parsed.pathname; rest.search = this.options.parseSearch(parsed.search); rest.hash = parsed.hash.slice(1); } const location = this.buildLocation({ ...rest, _includeValidateSearch: true }); return this.commitLocation({ ...location, viewTransition, replace, resetScroll, hashScrollIntoView, ignoreBlocker }); }; this.navigate = ({ to, reloadDocument, href, ...rest }) => { if (!reloadDocument && href) { try { new URL(`${href}`); reloadDocument = true; } catch { } } if (reloadDocument) { if (!href) { const location = this.buildLocation({ to, ...rest }); href = location.url; } if (rest.replace) { window.location.replace(href); } else { window.location.href = href; } return Promise.resolve(); } return this.buildAndCommitLocation({ ...rest, href, to, _isNavigate: true }); }; this.beforeLoad = () => { this.cancelMatches(); this.updateLatestLocation(); if (this.isServer) { const nextLocation = this.buildLocation({ to: this.latestLocation.pathname, search: true, params: true, hash: true, state: true, _includeValidateSearch: true }); const normalizeUrl = (url) => { try { return encodeURI(decodeURI(url)); } catch { return url; } }; if (trimPath(normalizeUrl(this.latestLocation.href)) !== trimPath(normalizeUrl(nextLocation.href))) { let href = nextLocation.url; if (this.origin && href.startsWith(this.origin)) { href = href.replace(this.origin, "") || "/"; } throw redirect({ href }); } } const pendingMatches = this.matchRoutes(this.latestLocation); this.__store.setState((s) => ({ ...s, status: "pending", statusCode: 200, isLoading: true, location: this.latestLocation, pendingMatches, // If a cached moved to pendingMatches, remove it from cachedMatches cachedMatches: s.cachedMatches.filter( (d) => !pendingMatches.some((e) => e.id === d.id) ) })); }; this.load = async (opts) => { let redirect2; let notFound2; let loadPromise; loadPromise = new Promise((resolve) => { this.startTransition(async () => { try { this.beforeLoad(); const next = this.latestLocation; const prevLocation = this.state.resolvedLocation; if (!this.state.redirect) { this.emit({ type: "onBeforeNavigate", ...getLocationChangeInfo({ resolvedLocation: prevLocation, location: next }) }); } this.emit({ type: "onBeforeLoad", ...getLocationChangeInfo({ resolvedLocation: prevLocation, location: next }) }); await loadMatches({ router: this, sync: opts?.sync, matches: this.state.pendingMatches, location: next, updateMatch: this.updateMatch, // eslint-disable-next-line @typescript-eslint/require-await onReady: async () => { this.startViewTransition(async () => { let exitingMatches; let enteringMatches; let stayingMatches; batch(() => { this.__store.setState((s) => { const previousMatches = s.matches; const newMatches = s.pendingMatches || s.matches; exitingMatches = previousMatches.filter( (match) => !newMatches.some((d) => d.id === match.id) ); enteringMatches = newMatches.filter( (match) => !previousMatches.some((d) => d.id === match.id) ); stayingMatches = previousMatches.filter( (match) => newMatches.some((d) => d.id === match.id) ); return { ...s, isLoading: false, loadedAt: Date.now(), matches: newMatches, pendingMatches: void 0, cachedMatches: [ ...s.cachedMatches, ...exitingMatches.filter((d) => d.status !== "error") ] }; }); this.clearExpiredCache(); }); [ [exitingMatches, "onLeave"], [enteringMatches, "onEnter"], [stayingMatches, "onStay"] ].forEach(([matches, hook]) => { matches.forEach((match) => { this.looseRoutesById[match.routeId].options[hook]?.(match); }); }); }); } }); } catch (err) { if (isRedirect(err)) { redirect2 = err; if (!this.isServer) { this.navigate({ ...redirect2.options, replace: true, ignoreBlocker: true }); } } else if (isNotFound(err)) { notFound2 = err; } this.__store.setState((s) => ({ ...s, statusCode: redirect2 ? redirect2.status : notFound2 ? 404 : s.matches.some((d) => d.status === "error") ? 500 : 200, redirect: redirect2 })); } if (this.latestLoadPromise === loadPromise) { this.commitLocationPromise?.resolve(); this.latestLoadPromise = void 0; this.commitLocationPromise = void 0; } resolve(); }); }); this.latestLoadPromise = loadPromise; await loadPromise; while (this.latestLoadPromise && loadPromise !== this.latestLoadPromise) { await this.latestLoadPromise; } let newStatusCode = void 0; if (this.hasNotFoundMatch()) { newStatusCode = 404; } else if (this.__store.state.matches.some((d) => d.status === "error")) { newStatusCode = 500; } if (newStatusCode !== void 0) { this.__store.setState((s) => ({ ...s, statusCode: newStatusCode })); } }; this.startViewTransition = (fn) => { const shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition; delete this.shouldViewTransition; if (shouldViewTransition && typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function") { let startViewTransitionParams; if (typeof shouldViewTransition === "object" && this.isViewTransitionTypesSupported) { const next = this.latestLocation; const prevLocation = this.state.resolvedLocation; const resolvedViewTransitionTypes = typeof shouldViewTransition.types === "function" ? shouldViewTransition.types( getLocationChangeInfo({ resolvedLocation: prevLocation, location: next }) ) : shouldViewTransition.types; if (resolvedViewTransitionTypes === false) { fn(); return; } startViewTransitionParams = { update: fn, types: resolvedViewTransitionTypes }; } else { startViewTransitionParams = fn; } document.startViewTransition(startViewTransitionParams); } else { fn(); } }; this.updateMatch = (id, updater) => { const matchesKey = this.state.pendingMatches?.some((d) => d.id === id) ? "pendingMatches" : this.state.matches.some((d) => d.id === id) ? "matches" : this.state.cachedMatches.some((d) => d.id === id) ? "cachedMatches" : ""; if (matchesKey) { this.__store.setState((s) => ({ ...s, [matchesKey]: s[matchesKey]?.map((d) => d.id === id ? updater(d) : d) })); } }; this.getMatch = (matchId) => { const findFn = (d) => d.id === matchId; return this.state.cachedMatches.find(findFn) ?? this.state.pendingMatches?.find(findFn) ?? this.state.matches.find(findFn); }; this.invalidate = (opts) => { const invalidate = (d) => { if (opts?.filter?.(d) ?? true) { return { ...d, invalid: true, ...opts?.forcePending || d.status === "error" ? { status: "pending", error: void 0 } : void 0 }; } return d; }; this.__store.setState((s) => ({ ...s, matches: s.matches.map(invalidate), cachedMatches: s.cachedMatches.map(invalidate), pendingMatches: s.pendingMatches?.map(invalidate) })); this.shouldViewTransition = false; return this.load({ sync: opts?.sync }); }; this.resolveRedirect = (redirect2) => { if (!redirect2.options.href) { const location = this.buildLocation(redirect2.options); let href = location.url; if (this.origin && href.startsWith(this.origin)) { href = href.replace(this.origin, "") || "/"; } redirect2.options.href = location.href; redirect2.headers.set("Location", href); } if (!redirect2.headers.get("Location")) { redirect2.headers.set("Location", redirect2.options.href); } return redirect2; }; this.clearCache = (opts) => { const filter = opts?.filter; if (filter !== void 0) { this.__store.setState((s) => { return { ...s, cachedMatches: s.cachedMatches.filter( (m) => !filter(m) ) }; }); } else { this.__store.setState((s) => { return { ...s, cachedMatches: [] }; }); } }; this.clearExpiredCache = () => { const filter = (d) => { const route = this.looseRoutesById[d.routeId]; if (!route.options.loader) { return true; } const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3; const isError = d.status === "error"; if (isError) return true; const gcEligible = Date.now() - d.updatedAt >= gcTime; return gcEligible; }; this.clearCache({ filter }); }; this.loadRouteChunk = loadRouteChunk; this.preloadRoute = async (opts) => { const next = this.buildLocation(opts); let matches = this.matchRoutes(next, { throwOnError: true, preload: true, dest: opts }); const activeMatchIds = new Set( [...this.state.matches, ...this.state.pendingMatches ?? []].map( (d) => d.id ) ); const loadedMatchIds = /* @__PURE__ */ new Set([ ...activeMatchIds, ...this.state.cachedMatches.map((d) => d.id) ]); batch(() => { matches.forEach((match) => { if (!loadedMatchIds.has(match.id)) { this.__store.setState((s) => ({ ...s, cachedMatches: [...s.cachedMatches, match] })); } }); }); try { matches = await loadMatches({ router: this, matches, location: next, preload: true, updateMatch: (id, updater) => { if (activeMatchIds.has(id)) { matches = matches.map((d) => d.id === id ? updater(d) : d); } else { this.updateMatch(id, updater); } } }); return matches; } catch (err) { if (isRedirect(err)) { if (err.options.reloadDocument) { return void 0; } return await this.preloadRoute({ ...err.options, _fromLocation: next }); } if (!isNotFound(err)) { console.error(err); } return void 0; } }; this.matchRoute = (location, opts) => { const matchLocation = { ...location, to: location.to ? this.resolvePathWithBase( location.from || "", location.to ) : void 0, params: location.params || {}, leaveParams: true }; const next = this.buildLocation(matchLocation); if (opts?.pending && this.state.status !== "pending") { return false; } const pending = opts?.pending === void 0 ? !this.state.isLoading : opts.pending; const baseLocation = pending ? this.latestLocation : this.state.resolvedLocation || this.state.location; const match = matchPathname( baseLocation.pathname, { ...opts, to: next.pathname }, this.parsePathnameCache ); if (!match) { return false; } if (location.params) { if (!deepEqual(match, location.params, { partial: true })) { return false; } } if (match && (opts?.includeSearch ?? true)) { return deepEqual(baseLocation.search, next.search, { partial: true }) ? match : false; } return match; }; this.hasNotFoundMatch = () => { return this.__store.state.matches.some( (d) => d.status === "notFound" || d.globalNotFound ); }; this.update({ defaultPreloadDelay: 50, defaultPendingMs: 1e3, defaultPendingMinMs: 500, context: void 0, ...options, caseSensitive: options.caseSensitive ?? false, notFoundMode: options.notFoundMode ?? "fuzzy", stringifySearch: options.stringifySearch ?? defaultStringifySearch, parseSearch: options.parseSearch ?? defaultParseSearch }); if (typeof document !== "undefined") { self.__TSR_ROUTER__ = this; } } isShell() { return !!this.options.isShell; } isPrerendering() { return !!this.options.isPrerendering; } get state() { return this.__store.state; } get looseRoutesById() { return this.routesById; } matchRoutesInternal(next, opts) { const { foundRoute, matchedRoutes, routeParams } = this.getMatchedRoutes( next.pathname, opts?.dest?.to ); let isGlobalNotFound = false; if ( // If we found a route, and it's not an index route and we have left over path foundRoute ? foundRoute.path !== "/" && routeParams["**"] : ( // Or if we didn't find a route and we have left over path trimPathRight(next.pathname) ) ) { if (this.options.notFoundRoute) { matchedRoutes.push(this.options.notFoundRoute); } else { isGlobalNotFound = true; } } const globalNotFoundRouteId = (() => { if (!isGlobalNotFound) { return void 0; } if (this.options.notFoundMode !== "root") { for (let i = matchedRoutes.length - 1; i >= 0; i--) { const route = matchedRoutes[i]; if (route.children) { return route.id; } } } return rootRouteId; })(); const matches = []; const getParentContext = (parentMatch) => { const parentMatchId = parentMatch?.id; const parentContext = !parentMatchId ? this.options.context ?? void 0 : parentMatch.context ?? this.options.context ?? void 0; return parentContext; }; matchedRoutes.forEach((route, index) => { const parentMatch = matches[index - 1]; const [preMatchSearch, strictMatchSearch, searchError] = (() => { const parentSearch = parentMatch?.search ?? next.search; const parentStrictSearch = parentMatch?._strictSearch ?? void 0; try { const strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? void 0; return [ { ...parentSearch, ...strictSearch }, { ...parentStrictSearch, ...strictSearch }, void 0 ]; } catch (err) { let searchParamError = err; if (!(err instanceof SearchParamError)) { searchParamError = new SearchParamError(err.message, { cause: err }); } if (opts?.throwOnError) { throw searchParamError; } return [parentSearch, {}, searchParamError]; } })(); const loaderDeps = route.options.loaderDeps?.({ search: preMatchSearch }) ?? ""; const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : ""; const { interpolatedPath, usedParams } = interpolatePath({ path: route.fullPath, params: routeParams, decodeCharMap: this.pathParamsDecodeCharMap }); const matchId = interpolatePath({ path: route.id, params: routeParams, leaveWildcards: true, decodeCharMap: this.pathParamsDecodeCharMap, parseCache: this.parsePathnameCache }).interpolatedPath + loaderDepsHash; const existingMatch = this.getMatch(matchId); const previousMatch = this.state.matches.find( (d) => d.routeId === route.id ); const strictParams = existingMatch?._strictParams ?? usedParams; let paramsError = void 0; if (!existingMatch) { const strictParseParams = route.options.params?.parse ?? route.options.parseParams; if (strictParseParams) { try { Object.assign( strictParams, strictParseParams(strictParams) ); } catch (err) { paramsError = new PathParamError(err.message, { cause: err }); if (opts?.throwOnError) { throw paramsError; } } } } Object.assign(routeParams, strictParams); const cause = previousMatch ? "stay" : "enter"; let match; if (existingMatch) { match = { ...existingMatch, cause, params: previousMatch ? replaceEqualDeep(previousMatch.params, routeParams) : routeParams, _strictParams: strictParams, search: previousMatch ? replaceEqualDeep(previousMatch.search, preMatchSearch) : replaceEqualDeep(existingMatch.search, preMatchSearch), _strictSearch: strictMatchSearch }; } else { const status = route.options.loader || route.options.beforeLoad || route.lazyFn || routeNeedsPreload(route) ? "pending" : "success"; match = { id: matchId, index, routeId: route.id, params: previousMatch ? replaceEqualDeep(previousMatch.params, routeParams) : routeParams, _strictParams: strictParams, pathname: interpolatedPath, updatedAt: Date.now(), search: previousMatch ? replaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch, _strictSearch: strictMatchSearch, searchError: void 0, status, isFetching: false, error: void 0, paramsError, __routeContext: void 0, _nonReactive: { loadPromise: createControlledPromise() }, __beforeLoadContext: void 0, context: {}, abortController: new AbortController(), fetchCount: 0, cause, loaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps, invalid: false, preload: false, links: void 0, scripts: void 0, headScripts: void 0, meta: void 0, staticData: route.options.staticData || {}, fullPath: route.fullPath }; } if (!opts?.preload) { match.globalNotFound = globalNotFoundRouteId === route.id; } match.searchError = searchError; const parentContext = getParentContext(parentMatch); match.context = { ...parentContext, ...match.__routeContext, ...match.__beforeLoadContext }; matches.push(match); }); matches.forEach((match, index) => { const route = this.looseRoutesById[match.routeId]; const existingMatch = this.getMatch(match.id); if (!existingMatch && opts?._buildLocation !== true) { const parentMatch = matches[index - 1]; const parentContext = getParentContext(parentMatch); if (route.options.context) { const contextFnContext = { deps: match.loaderDeps, params: match.params, context: parentContext ?? {}, location: next, navigate: (opts2) => this.navigate({ ...opts2, _fromLocation: next }), buildLocation: this.buildLocation, cause: match.cause, abortController: match.abortController, preload: !!match.preload, matches }; match.__routeContext = route.options.context(contextFnContext) ?? void 0; } match.context = { ...parentContext, ...match.__routeContext, ...match.__beforeLoadContext }; } }); return matches; } }; var SearchParamError = class extends Error { }; var PathParamError = class extends Error { }; var normalize = (str) => str.endsWith("/") && str.length > 1 ? str.slice(0, -1) : str; function comparePaths(a, b) { return normalize(a) === normalize(b); } function getInitialRouterState(location) { return { loadedAt: 0, isLoading: false, isTransitioning: false, status: "idle", resolvedLocation: void 0, location, matches: [], pendingMatches: [], cachedMatches: [], statusCode: 200 }; } function validateSearch(validateSearch2, input) { if (validateSearch2 == null) return {}; if ("~standard" in validateSearch2) { const result = validateSearch2["~standard"].validate(input); if (result instanceof Promise) throw new SearchParamError("Async validation not supported"); if (result.issues) throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { cause: result }); return result.value; } if ("parse" in validateSearch2) { return validateSearch2.parse(input); } if (typeof validateSearch2 === "function") { return validateSearch2(input); } return {}; } function getMatchedRoutes({ pathname, routePathname, caseSensitive, routesByPath, routesById, flatRoutes, parseCache }) { let routeParams = {}; const trimmedPath = trimPathRight(pathname); const getMatchedParams = (route) => { const result = matchPathname( trimmedPath, { to: route.fullPath, caseSensitive: route.options?.caseSensitive ?? caseSensitive, // we need fuzzy matching for `notFoundMode: 'fuzzy'` fuzzy: true }, parseCache ); return result; }; let foundRoute = routePathname !== void 0 ? routesByPath[routePathname] : void 0; if (foundRoute) { routeParams = getMatchedParams(foundRoute); } else { let fuzzyMatch = void 0; for (const route of flatRoutes) { const matchedParams = getMatchedParams(route); if (matchedParams) { if (route.path !== "/" && matchedParams["**"]) { if (!fuzzyMatch) { fuzzyMatch = { foundRoute: route, routeParams: matchedParams }; } } else { foundRoute = route; routeParams = matchedParams; break; } } } if (!foundRoute && fuzzyMatch) { foundRoute = fuzzyMatch.foundRoute; routeParams = fuzzyMatch.routeParams; } } let routeCursor = foundRoute || routesById[rootRouteId]; const matchedRoutes = [routeCursor]; while (routeCursor.parentRoute) { routeCursor = routeCursor.parentRoute; matchedRoutes.push(routeCursor); } matchedRoutes.reverse(); return { matchedRoutes, routeParams, foundRoute }; } function applySearchMiddleware({ search, dest, destRoutes, _includeValidateSearch }) { const allMiddlewares = destRoutes.reduce( (acc, route) => { const middlewares = []; if ("search" in route.options) { if (route.options.search?.middlewares) { middlewares.push(...route.options.search.middlewares); } } else if (route.options.preSearchFilters || route.options.postSearchFilters) { const legacyMiddleware = ({ search: search2, next }) => { let nextSearch = search2; if ("preSearchFilters" in route.options && route.options.preSearchFilters) { nextSearch = route.options.preSearchFilters.reduce( (prev, next2) => next2(prev), search2 ); } const result = next(nextSearch); if ("postSearchFilters" in route.options && route.options.postSearchFilters) { return route.options.postSearchFilters.reduce( (prev, next2) => next2(prev), result ); } return result; }; middlewares.push(legacyMiddleware); } if (_includeValidateSearch && route.options.validateSearch) { const validate = ({ search: search2, next }) => { const result = next(search2); try { const validatedSearch = { ...result, ...validateSearch(route.options.validateSearch, result) ?? void 0 }; return validatedSearch; } catch { return result; } }; middlewares.push(validate); } return acc.concat(middlewares); }, [] ) ?? []; const final = ({ search: search2 }) => { if (!dest.search) { return {}; } if (dest.search === true) { return search2; } return functionalUpdate(dest.search, search2); }; allMiddlewares.push(final); const applyNext = (index, currentSearch) => { if (index >= allMiddlewares.length) { return currentSearch; } const middleware = allMiddlewares[index]; const next = (newSearch) => { return applyNext(index + 1, newSearch); }; return middleware({ search: currentSearch, next }); }; return applyNext(0, search); } // node_modules/@tanstack/router-core/dist/esm/link.js var preloadWarning = "Error preloading route! \u261D\uFE0F"; // node_modules/@tanstack/router-core/dist/esm/route.js var BaseRoute = class { constructor(options) { this.init = (opts) => { this.originalIndex = opts.originalIndex; const options2 = this.options; const isRoot = !options2?.path && !options2?.id; this.parentRoute = this.options.getParentRoute?.(); if (isRoot) { this._path = rootRouteId; } else if (!this.parentRoute) { invariant( false, `Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.` ); } let path = isRoot ? rootRouteId : options2?.path; if (path && path !== "/") { path = trimPathLeft(path); } const customId = options2?.id || path; let id = isRoot ? rootRouteId : joinPaths([ this.parentRoute.id === rootRouteId ? "" : this.parentRoute.id, customId ]); if (path === rootRouteId) { path = "/"; } if (id !== rootRouteId) { id = joinPaths(["/", id]); } const fullPath = id === rootRouteId ? "/" : joinPaths([this.parentRoute.fullPath, path]); this._path = path; this._id = id; this._fullPath = fullPath; this._to = fullPath; }; this.clone = (other) => { this._path = other._path; this._id = other._id; this._fullPath = other._fullPath; this._to = other._to; this.options.getParentRoute = other.options.getParentRoute; this.children = other.children; }; this.addChildren = (children) => { return this._addFileChildren(children); }; this._addFileChildren = (children) => { if (Array.isArray(children)) { this.children = children; } if (typeof children === "object" && children !== null) { this.children = Object.values(children); } return this; }; this._addFileTypes = () => { return this; }; this.updateLoader = (options2) => { Object.assign(this.options, options2); return this; }; this.update = (options2) => { Object.assign(this.options, options2); return this; }; this.lazy = (lazyFn2) => { this.lazyFn = lazyFn2; return this; }; this.options = options || {}; this.isRoot = !options?.getParentRoute; if (options?.id && options?.path) { throw new Error(`Route cannot have both an 'id' and a 'path' option.`); } } get to() { return this._to; } get id() { return this._id; } get path() { return this._path; } get fullPath() { return this._fullPath; } }; var BaseRootRoute = class extends BaseRoute { constructor(options) { super(options); } }; // node_modules/@tanstack/react-router/dist/esm/CatchBoundary.js var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var React = __toESM(require_react(), 1); function CatchBoundary(props) { const errorComponent = props.errorComponent ?? ErrorComponent; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( CatchBoundaryImpl, { getResetKey: props.getResetKey, onCatch: props.onCatch, children: ({ error, reset }) => { if (error) { return React.createElement(errorComponent, { error, reset }); } return props.children; } } ); } var CatchBoundaryImpl = class extends React.Component { constructor() { super(...arguments); this.state = { error: null }; } static getDerivedStateFromProps(props) { return { resetKey: props.getResetKey() }; } static getDerivedStateFromError(error) { return { error }; } reset() { this.setState({ error: null }); } componentDidUpdate(prevProps, prevState) { if (prevState.error && prevState.resetKey !== this.state.resetKey) { this.reset(); } } componentDidCatch(error, errorInfo) { if (this.props.onCatch) { this.props.onCatch(error, errorInfo); } } render() { return this.props.children({ error: this.state.resetKey !== this.props.getResetKey() ? null : this.state.error, reset: () => { this.reset(); } }); } }; function ErrorComponent({ error }) { const [show, setShow] = React.useState(true); return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "button", { style: { appearance: "none", fontSize: ".6em", border: "1px solid currentColor", padding: ".1rem .2rem", fontWeight: "bold", borderRadius: ".25rem" }, onClick: () => setShow((d) => !d), children: show ? "Hide Error" : "Show Error" } ) ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { height: ".25rem" } }), show ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "pre", { style: { fontSize: ".7em", border: "1px solid red", borderRadius: ".25rem", padding: ".3rem", color: "red", overflow: "auto" }, children: error.message ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: error.message }) : null } ) }) : null ] }); } // node_modules/@tanstack/react-router/dist/esm/ClientOnly.js var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var import_react = __toESM(require_react(), 1); function ClientOnly({ children, fallback = null }) { return useHydrated() ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react.default.Fragment, { children }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react.default.Fragment, { children: fallback }); } function useHydrated() { return import_react.default.useSyncExternalStore( subscribe, () => true, () => false ); } function subscribe() { return () => { }; } // node_modules/tiny-warning/dist/tiny-warning.esm.js var isProduction2 = false; function warning(condition, message) { if (!isProduction2) { if (condition) { return; } var text = "Warning: " + message; if (typeof console !== "undefined") { console.warn(text); } try { throw Error(text); } catch (x) { } } } var tiny_warning_esm_default = warning; // node_modules/@tanstack/react-router/dist/esm/route.js var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var import_react3 = __toESM(require_react(), 1); // node_modules/@tanstack/react-router/dist/esm/useMatch.js var React5 = __toESM(require_react(), 1); // node_modules/@tanstack/react-store/dist/esm/index.js var import_with_selector = __toESM(require_with_selector(), 1); function useStore(store, selector = (d) => d, options = {}) { const equal = options.equal ?? shallow; const slice = (0, import_with_selector.useSyncExternalStoreWithSelector)( store.subscribe, () => store.state, () => store.state, selector, equal ); return slice; } function shallow(objA, objB) { if (Object.is(objA, objB)) { return true; } if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { return false; } if (objA instanceof Map && objB instanceof Map) { if (objA.size !== objB.size) return false; for (const [k, v] of objA) { if (!objB.has(k) || !Object.is(v, objB.get(k))) return false; } return true; } if (objA instanceof Set && objB instanceof Set) { if (objA.size !== objB.size) return false; for (const v of objA) { if (!objB.has(v)) return false; } return true; } if (objA instanceof Date && objB instanceof Date) { if (objA.getTime() !== objB.getTime()) return false; return true; } const keysA = getOwnKeys(objA); if (keysA.length !== getOwnKeys(objB).length) { return false; } for (let i = 0; i < keysA.length; i++) { if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { return false; } } return true; } function getOwnKeys(obj) { return Object.keys(obj).concat( Object.getOwnPropertySymbols(obj) ); } // node_modules/@tanstack/react-router/dist/esm/useRouterState.js var import_react2 = __toESM(require_react(), 1); // node_modules/@tanstack/react-router/dist/esm/useRouter.js var React3 = __toESM(require_react(), 1); // node_modules/@tanstack/react-router/dist/esm/routerContext.js var React2 = __toESM(require_react(), 1); var routerContext = React2.createContext(null); function getRouterContext() { if (typeof document === "undefined") { return routerContext; } if (window.__TSR_ROUTER_CONTEXT__) { return window.__TSR_ROUTER_CONTEXT__; } window.__TSR_ROUTER_CONTEXT__ = routerContext; return routerContext; } // node_modules/@tanstack/react-router/dist/esm/useRouter.js function useRouter(opts) { const value = React3.useContext(getRouterContext()); tiny_warning_esm_default( !((opts?.warn ?? true) && !value), "useRouter must be used inside a component!" ); return value; } // node_modules/@tanstack/react-router/dist/esm/useRouterState.js function useRouterState(opts) { const contextRouter = useRouter({ warn: opts?.router === void 0 }); const router = opts?.router || contextRouter; const previousResult = (0, import_react2.useRef)(void 0); return useStore(router.__store, (state) => { if (opts?.select) { if (opts.structuralSharing ?? router.options.defaultStructuralSharing) { const newSlice = replaceEqualDeep( previousResult.current, opts.select(state) ); previousResult.current = newSlice; return newSlice; } return opts.select(state); } return state; }); } // node_modules/@tanstack/react-router/dist/esm/matchContext.js var React4 = __toESM(require_react(), 1); var matchContext = React4.createContext(void 0); var dummyMatchContext = React4.createContext( void 0 ); // node_modules/@tanstack/react-router/dist/esm/useMatch.js function useMatch(opts) { const nearestMatchId = React5.useContext( opts.from ? dummyMatchContext : matchContext ); const matchSelection = useRouterState({ select: (state) => { const match = state.matches.find( (d) => opts.from ? opts.from === d.routeId : d.id === nearestMatchId ); invariant( !((opts.shouldThrow ?? true) && !match), `Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}` ); if (match === void 0) { return void 0; } return opts.select ? opts.select(match) : match; }, structuralSharing: opts.structuralSharing }); return matchSelection; } // node_modules/@tanstack/react-router/dist/esm/useLoaderData.js function useLoaderData(opts) { return useMatch({ from: opts.from, strict: opts.strict, structuralSharing: opts.structuralSharing, select: (s) => { return opts.select ? opts.select(s.loaderData) : s.loaderData; } }); } // node_modules/@tanstack/react-router/dist/esm/useLoaderDeps.js function useLoaderDeps(opts) { const { select, ...rest } = opts; return useMatch({ ...rest, select: (s) => { return select ? select(s.loaderDeps) : s.loaderDeps; } }); } // node_modules/@tanstack/react-router/dist/esm/useParams.js function useParams(opts) { return useMatch({ from: opts.from, shouldThrow: opts.shouldThrow, structuralSharing: opts.structuralSharing, strict: opts.strict, select: (match) => { const params = opts.strict === false ? match.params : match._strictParams; return opts.select ? opts.select(params) : params; } }); } // node_modules/@tanstack/react-router/dist/esm/useSearch.js function useSearch(opts) { return useMatch({ from: opts.from, strict: opts.strict, shouldThrow: opts.shouldThrow, structuralSharing: opts.structuralSharing, select: (match) => { return opts.select ? opts.select(match.search) : match.search; } }); } // node_modules/@tanstack/react-router/dist/esm/useNavigate.js var React6 = __toESM(require_react(), 1); function useNavigate(_defaultOpts) { const router = useRouter(); return React6.useCallback( (options) => { return router.navigate({ ...options, from: options.from ?? _defaultOpts?.from }); }, [_defaultOpts?.from, router] ); } // node_modules/@tanstack/react-router/dist/esm/link.js var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var React8 = __toESM(require_react(), 1); var import_react_dom = __toESM(require_react_dom(), 1); // node_modules/@tanstack/react-router/dist/esm/utils.js var React7 = __toESM(require_react(), 1); var useLayoutEffect2 = typeof window !== "undefined" ? React7.useLayoutEffect : React7.useEffect; function usePrevious(value) { const ref = React7.useRef({ value, prev: null }); const current = ref.current.value; if (value !== current) { ref.current = { value, prev: current }; } return ref.current.prev; } function useIntersectionObserver(ref, callback, intersectionObserverOptions2 = {}, options = {}) { React7.useEffect(() => { if (!ref.current || options.disabled || typeof IntersectionObserver !== "function") { return; } const observer = new IntersectionObserver(([entry]) => { callback(entry); }, intersectionObserverOptions2); observer.observe(ref.current); return () => { observer.disconnect(); }; }, [callback, intersectionObserverOptions2, options.disabled, ref]); } function useForwardedRef(ref) { const innerRef = React7.useRef(null); React7.useImperativeHandle(ref, () => innerRef.current, []); return innerRef; } // node_modules/@tanstack/react-router/dist/esm/link.js function useLinkProps(options, forwardedRef) { const router = useRouter(); const [isTransitioning, setIsTransitioning] = React8.useState(false); const hasRenderFetched = React8.useRef(false); const innerRef = useForwardedRef(forwardedRef); const { // custom props activeProps, inactiveProps, activeOptions, to, preload: userPreload, preloadDelay: userPreloadDelay, hashScrollIntoView, replace, startTransition: startTransition2, resetScroll, viewTransition, // element props children, target, disabled, style, className, onClick, onFocus, onMouseEnter, onMouseLeave, onTouchStart, ignoreBlocker, // prevent these from being returned params: _params, search: _search, hash: _hash, state: _state, mask: _mask, reloadDocument: _reloadDocument, unsafeRelative: _unsafeRelative, from: _from, _fromLocation, ...propsSafeToSpread } = options; const currentSearch = useRouterState({ select: (s) => s.location.search, structuralSharing: true }); const from = options.from; const _options = React8.useMemo( () => { return { ...options, from }; }, // eslint-disable-next-line react-hooks/exhaustive-deps [ router, currentSearch, from, options._fromLocation, options.hash, options.to, options.search, options.params, options.state, options.mask, options.unsafeRelative ] ); const next = React8.useMemo( () => router.buildLocation({ ..._options }), [router, _options] ); const hrefOption = React8.useMemo(() => { if (disabled) { return void 0; } let href = next.maskedLocation ? next.maskedLocation.url : next.url; let external = false; if (router.origin) { if (href.startsWith(router.origin)) { href = router.history.createHref(href.replace(router.origin, "")) || "/"; } else { external = true; } } return { href, external }; }, [disabled, next.maskedLocation, next.url, router.origin, router.history]); const externalLink = React8.useMemo(() => { if (hrefOption?.external) { return hrefOption.href; } try { new URL(to); return to; } catch { } return void 0; }, [to, hrefOption]); const preload = options.reloadDocument || externalLink ? false : userPreload ?? router.options.defaultPreload; const preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0; const isActive = useRouterState({ select: (s) => { if (externalLink) return false; if (activeOptions?.exact) { const testExact = exactPathTest( s.location.pathname, next.pathname, router.basepath ); if (!testExact) { return false; } } else { const currentPathSplit = removeTrailingSlash( s.location.pathname, router.basepath ); const nextPathSplit = removeTrailingSlash( next.pathname, router.basepath ); const pathIsFuzzyEqual = currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/"); if (!pathIsFuzzyEqual) { return false; } } if (activeOptions?.includeSearch ?? true) { const searchTest = deepEqual(s.location.search, next.search, { partial: !activeOptions?.exact, ignoreUndefined: !activeOptions?.explicitUndefined }); if (!searchTest) { return false; } } if (activeOptions?.includeHash) { return s.location.hash === next.hash; } return true; } }); const doPreload = React8.useCallback(() => { router.preloadRoute({ ..._options }).catch((err) => { console.warn(err); console.warn(preloadWarning); }); }, [router, _options]); const preloadViewportIoCallback = React8.useCallback( (entry) => { if (entry?.isIntersecting) { doPreload(); } }, [doPreload] ); useIntersectionObserver( innerRef, preloadViewportIoCallback, intersectionObserverOptions, { disabled: !!disabled || !(preload === "viewport") } ); React8.useEffect(() => { if (hasRenderFetched.current) { return; } if (!disabled && preload === "render") { doPreload(); hasRenderFetched.current = true; } }, [disabled, doPreload, preload]); const handleClick = (e) => { const elementTarget = e.currentTarget.getAttribute("target"); const effectiveTarget = target !== void 0 ? target : elementTarget; if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!effectiveTarget || effectiveTarget === "_self") && e.button === 0) { e.preventDefault(); (0, import_react_dom.flushSync)(() => { setIsTransitioning(true); }); const unsub = router.subscribe("onResolved", () => { unsub(); setIsTransitioning(false); }); router.navigate({ ..._options, replace, resetScroll, hashScrollIntoView, startTransition: startTransition2, viewTransition, ignoreBlocker }); } }; if (externalLink) { return { ...propsSafeToSpread, ref: innerRef, href: externalLink, ...children && { children }, ...target && { target }, ...disabled && { disabled }, ...style && { style }, ...className && { className }, ...onClick && { onClick }, ...onFocus && { onFocus }, ...onMouseEnter && { onMouseEnter }, ...onMouseLeave && { onMouseLeave }, ...onTouchStart && { onTouchStart } }; } const handleFocus = (_) => { if (disabled) return; if (preload) { doPreload(); } }; const handleTouchStart = handleFocus; const handleEnter = (e) => { if (disabled || !preload) return; if (!preloadDelay) { doPreload(); } else { const eventTarget = e.target; if (timeoutMap.has(eventTarget)) { return; } const id = setTimeout(() => { timeoutMap.delete(eventTarget); doPreload(); }, preloadDelay); timeoutMap.set(eventTarget, id); } }; const handleLeave = (e) => { if (disabled || !preload || !preloadDelay) return; const eventTarget = e.target; const id = timeoutMap.get(eventTarget); if (id) { clearTimeout(id); timeoutMap.delete(eventTarget); } }; const resolvedActiveProps = isActive ? functionalUpdate(activeProps, {}) ?? STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT; const resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : functionalUpdate(inactiveProps, {}) ?? STATIC_EMPTY_OBJECT; const resolvedClassName = [ className, resolvedActiveProps.className, resolvedInactiveProps.className ].filter(Boolean).join(" "); const resolvedStyle = (style || resolvedActiveProps.style || resolvedInactiveProps.style) && { ...style, ...resolvedActiveProps.style, ...resolvedInactiveProps.style }; return { ...propsSafeToSpread, ...resolvedActiveProps, ...resolvedInactiveProps, href: hrefOption?.href, ref: innerRef, onClick: composeHandlers([onClick, handleClick]), onFocus: composeHandlers([onFocus, handleFocus]), onMouseEnter: composeHandlers([onMouseEnter, handleEnter]), onMouseLeave: composeHandlers([onMouseLeave, handleLeave]), onTouchStart: composeHandlers([onTouchStart, handleTouchStart]), disabled: !!disabled, target, ...resolvedStyle && { style: resolvedStyle }, ...resolvedClassName && { className: resolvedClassName }, ...disabled && STATIC_DISABLED_PROPS, ...isActive && STATIC_ACTIVE_PROPS, ...isTransitioning && STATIC_TRANSITIONING_PROPS }; } var STATIC_EMPTY_OBJECT = {}; var STATIC_ACTIVE_OBJECT = { className: "active" }; var STATIC_DISABLED_PROPS = { role: "link", "aria-disabled": true }; var STATIC_ACTIVE_PROPS = { "data-status": "active", "aria-current": "page" }; var STATIC_TRANSITIONING_PROPS = { "data-transitioning": "transitioning" }; var timeoutMap = /* @__PURE__ */ new WeakMap(); var intersectionObserverOptions = { rootMargin: "100px" }; var composeHandlers = (handlers) => (e) => { for (const handler of handlers) { if (!handler) continue; if (e.defaultPrevented) return; handler(e); } }; function createLink(Comp) { return React8.forwardRef(function CreatedLink(props, ref) { return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Link, { ...props, _asChild: Comp, ref }); }); } var Link = React8.forwardRef( (props, ref) => { const { _asChild, ...rest } = props; const { type: _type, ref: innerRef, ...linkProps } = useLinkProps(rest, ref); const children = typeof rest.children === "function" ? rest.children({ isActive: linkProps["data-status"] === "active" }) : rest.children; if (_asChild === void 0) { delete linkProps.disabled; } return React8.createElement( _asChild ? _asChild : "a", { ...linkProps, ref: innerRef }, children ); } ); function isCtrlEvent(e) { return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey); } // node_modules/@tanstack/react-router/dist/esm/route.js var Route = class extends BaseRoute { /** * @deprecated Use the `createRoute` function instead. */ constructor(options) { super(options); this.useMatch = (opts) => { return useMatch({ select: opts?.select, from: this.id, structuralSharing: opts?.structuralSharing }); }; this.useRouteContext = (opts) => { return useMatch({ ...opts, from: this.id, select: (d) => opts?.select ? opts.select(d.context) : d.context }); }; this.useSearch = (opts) => { return useSearch({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useParams = (opts) => { return useParams({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useLoaderDeps = (opts) => { return useLoaderDeps({ ...opts, from: this.id }); }; this.useLoaderData = (opts) => { return useLoaderData({ ...opts, from: this.id }); }; this.useNavigate = () => { return useNavigate({ from: this.fullPath }); }; this.Link = import_react3.default.forwardRef( (props, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { ref, from: this.fullPath, ...props }); } ); this.$$typeof = /* @__PURE__ */ Symbol.for("react.memo"); } }; function createRoute(options) { return new Route( // TODO: Help us TypeChris, you're our only hope! options ); } var RootRoute = class extends BaseRootRoute { /** * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead. */ constructor(options) { super(options); this.useMatch = (opts) => { return useMatch({ select: opts?.select, from: this.id, structuralSharing: opts?.structuralSharing }); }; this.useRouteContext = (opts) => { return useMatch({ ...opts, from: this.id, select: (d) => opts?.select ? opts.select(d.context) : d.context }); }; this.useSearch = (opts) => { return useSearch({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useParams = (opts) => { return useParams({ select: opts?.select, structuralSharing: opts?.structuralSharing, from: this.id }); }; this.useLoaderDeps = (opts) => { return useLoaderDeps({ ...opts, from: this.id }); }; this.useLoaderData = (opts) => { return useLoaderData({ ...opts, from: this.id }); }; this.useNavigate = () => { return useNavigate({ from: this.fullPath }); }; this.Link = import_react3.default.forwardRef( (props, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { ref, from: this.fullPath, ...props }); } ); this.$$typeof = /* @__PURE__ */ Symbol.for("react.memo"); } }; function createRootRoute(options) { return new RootRoute(options); } // node_modules/@tanstack/react-router/dist/esm/fileRoute.js function createFileRoute(path) { if (typeof path === "object") { return new FileRoute(path, { silent: true }).createRoute(path); } return new FileRoute(path, { silent: true }).createRoute; } var FileRoute = class { constructor(path, _opts) { this.path = path; this.createRoute = (options) => { tiny_warning_esm_default( this.silent, "FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead." ); const route = createRoute(options); route.isRoot = false; return route; }; this.silent = _opts?.silent; } }; var LazyRoute = class { constructor(opts) { this.useMatch = (opts2) => { return useMatch({ select: opts2?.select, from: this.options.id, structuralSharing: opts2?.structuralSharing }); }; this.useRouteContext = (opts2) => { return useMatch({ from: this.options.id, select: (d) => opts2?.select ? opts2.select(d.context) : d.context }); }; this.useSearch = (opts2) => { return useSearch({ select: opts2?.select, structuralSharing: opts2?.structuralSharing, from: this.options.id }); }; this.useParams = (opts2) => { return useParams({ select: opts2?.select, structuralSharing: opts2?.structuralSharing, from: this.options.id }); }; this.useLoaderDeps = (opts2) => { return useLoaderDeps({ ...opts2, from: this.options.id }); }; this.useLoaderData = (opts2) => { return useLoaderData({ ...opts2, from: this.options.id }); }; this.useNavigate = () => { const router = useRouter(); return useNavigate({ from: router.routesById[this.options.id].fullPath }); }; this.options = opts; this.$$typeof = /* @__PURE__ */ Symbol.for("react.memo"); } }; function createLazyRoute(id) { return (opts) => { return new LazyRoute({ id, ...opts }); }; } function createLazyFileRoute(id) { if (typeof id === "object") { return new LazyRoute(id); } return (opts) => new LazyRoute({ id, ...opts }); } // node_modules/@tanstack/react-router/dist/esm/Matches.js var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); var React11 = __toESM(require_react(), 1); // node_modules/@tanstack/react-router/dist/esm/Transitioner.js var React9 = __toESM(require_react(), 1); function Transitioner() { const router = useRouter(); const mountLoadForRouter = React9.useRef({ router, mounted: false }); const [isTransitioning, setIsTransitioning] = React9.useState(false); const { hasPendingMatches, isLoading } = useRouterState({ select: (s) => ({ isLoading: s.isLoading, hasPendingMatches: s.matches.some((d) => d.status === "pending") }), structuralSharing: true }); const previousIsLoading = usePrevious(isLoading); const isAnyPending = isLoading || isTransitioning || hasPendingMatches; const previousIsAnyPending = usePrevious(isAnyPending); const isPagePending = isLoading || hasPendingMatches; const previousIsPagePending = usePrevious(isPagePending); router.startTransition = (fn) => { setIsTransitioning(true); React9.startTransition(() => { fn(); setIsTransitioning(false); }); }; React9.useEffect(() => { const unsub = router.history.subscribe(router.load); const nextLocation = router.buildLocation({ to: router.latestLocation.pathname, search: true, params: true, hash: true, state: true, _includeValidateSearch: true }); if (trimPathRight(router.latestLocation.href) !== trimPathRight(nextLocation.href)) { router.commitLocation({ ...nextLocation, replace: true }); } return () => { unsub(); }; }, [router, router.history]); useLayoutEffect2(() => { if ( // if we are hydrating from SSR, loading is triggered in ssr-client typeof window !== "undefined" && router.ssr || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted ) { return; } mountLoadForRouter.current = { router, mounted: true }; const tryLoad = async () => { try { await router.load(); } catch (err) { console.error(err); } }; tryLoad(); }, [router]); useLayoutEffect2(() => { if (previousIsLoading && !isLoading) { router.emit({ type: "onLoad", // When the new URL has committed, when the new matches have been loaded into state.matches ...getLocationChangeInfo(router.state) }); } }, [previousIsLoading, router, isLoading]); useLayoutEffect2(() => { if (previousIsPagePending && !isPagePending) { router.emit({ type: "onBeforeRouteMount", ...getLocationChangeInfo(router.state) }); } }, [isPagePending, previousIsPagePending, router]); useLayoutEffect2(() => { if (previousIsAnyPending && !isAnyPending) { router.emit({ type: "onResolved", ...getLocationChangeInfo(router.state) }); router.__store.setState((s) => ({ ...s, status: "idle", resolvedLocation: s.location })); handleHashScroll(router); } }, [isAnyPending, previousIsAnyPending, router]); return null; } // node_modules/@tanstack/react-router/dist/esm/Match.js var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); var React10 = __toESM(require_react(), 1); // node_modules/@tanstack/react-router/dist/esm/not-found.js var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); function CatchNotFound(props) { const resetKey = useRouterState({ select: (s) => `not-found-${s.location.pathname}-${s.status}` }); return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( CatchBoundary, { getResetKey: () => resetKey, onCatch: (error, errorInfo) => { if (isNotFound(error)) { props.onCatch?.(error, errorInfo); } else { throw error; } }, errorComponent: ({ error }) => { if (isNotFound(error)) { return props.fallback?.(error); } else { throw error; } }, children: props.children } ); } function DefaultGlobalNotFound() { return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "Not Found" }); } // node_modules/@tanstack/react-router/dist/esm/SafeFragment.js var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); function SafeFragment(props) { return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: props.children }); } // node_modules/@tanstack/react-router/dist/esm/renderRouteNotFound.js var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); function renderRouteNotFound(router, route, data) { if (!route.options.notFoundComponent) { if (router.options.defaultNotFoundComponent) { return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(router.options.defaultNotFoundComponent, { data }); } if (true) { tiny_warning_esm_default( route.options.notFoundComponent, `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
Not Found
)` ); } return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DefaultGlobalNotFound, {}); } return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(route.options.notFoundComponent, { data }); } // node_modules/@tanstack/react-router/dist/esm/scroll-restoration.js var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); // node_modules/@tanstack/react-router/dist/esm/ScriptOnce.js var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); function ScriptOnce({ children }) { const router = useRouter(); if (!router.isServer) { return null; } return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( "script", { nonce: router.options.ssr?.nonce, className: "$tsr", dangerouslySetInnerHTML: { __html: [children].filter(Boolean).join("\n") + ";$_TSR.c()" } } ); } // node_modules/@tanstack/react-router/dist/esm/scroll-restoration.js function ScrollRestoration() { const router = useRouter(); if (!router.isScrollRestoring || !router.isServer) { return null; } if (typeof router.options.scrollRestoration === "function") { const shouldRestore = router.options.scrollRestoration({ location: router.latestLocation }); if (!shouldRestore) { return null; } } const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey; const userKey = getKey(router.latestLocation); const resolvedKey = userKey !== defaultGetScrollRestorationKey(router.latestLocation) ? userKey : void 0; const restoreScrollOptions = { storageKey, shouldScrollRestoration: true }; if (resolvedKey) { restoreScrollOptions.key = resolvedKey; } return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)( ScriptOnce, { children: `(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})` } ); } // node_modules/@tanstack/react-router/dist/esm/Match.js var Match = React10.memo(function MatchImpl({ matchId }) { const router = useRouter(); const matchState = useRouterState({ select: (s) => { const match = s.matches.find((d) => d.id === matchId); invariant( match, `Could not find match for matchId "${matchId}". Please file an issue!` ); return { routeId: match.routeId, ssr: match.ssr, _displayPending: match._displayPending }; }, structuralSharing: true }); const route = router.routesById[matchState.routeId]; const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent; const pendingElement = PendingComponent ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PendingComponent, {}) : null; const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent; const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch; const routeNotFoundComponent = route.isRoot ? ( // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component route.options.notFoundComponent ?? router.options.notFoundRoute?.options.component ) : route.options.notFoundComponent; const resolvedNoSsr = matchState.ssr === false || matchState.ssr === "data-only"; const ResolvedSuspenseBoundary = ( // If we're on the root route, allow forcefully wrapping in suspense (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) && (route.options.wrapInSuspense ?? PendingComponent ?? (route.options.errorComponent?.preload || resolvedNoSsr)) ? React10.Suspense : SafeFragment ); const ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment; const ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment; const resetKey = useRouterState({ select: (s) => s.loadedAt }); const parentRouteId = useRouterState({ select: (s) => { const index = s.matches.findIndex((d) => d.id === matchId); return s.matches[index - 1]?.routeId; } }); const ShellComponent = route.isRoot ? route.options.shellComponent ?? SafeFragment : SafeFragment; return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ShellComponent, { children: [ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResolvedSuspenseBoundary, { fallback: pendingElement, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( ResolvedCatchBoundary, { getResetKey: () => resetKey, errorComponent: routeErrorComponent || ErrorComponent, onCatch: (error, errorInfo) => { if (isNotFound(error)) throw error; tiny_warning_esm_default(false, `Error in route match: ${matchId}`); routeOnCatch?.(error, errorInfo); }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( ResolvedNotFoundBoundary, { fallback: (error) => { if (!routeNotFoundComponent || error.routeId && error.routeId !== matchState.routeId || !error.routeId && !route.isRoot) throw error; return React10.createElement(routeNotFoundComponent, error); }, children: resolvedNoSsr || matchState._displayPending ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ClientOnly, { fallback: pendingElement, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MatchInner, { matchId }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MatchInner, { matchId }) } ) } ) }) }), parentRouteId === rootRouteId && router.options.scrollRestoration ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(OnRendered, {}), /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScrollRestoration, {}) ] }) : null ] }); }); function OnRendered() { const router = useRouter(); const prevLocationRef = React10.useRef( void 0 ); return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( "script", { suppressHydrationWarning: true, ref: (el) => { if (el && (prevLocationRef.current === void 0 || prevLocationRef.current.href !== router.latestLocation.href)) { router.emit({ type: "onRendered", ...getLocationChangeInfo(router.state) }); prevLocationRef.current = router.latestLocation; } } }, router.latestLocation.state.__TSR_key ); } var MatchInner = React10.memo(function MatchInnerImpl({ matchId }) { const router = useRouter(); const { match, key, routeId } = useRouterState({ select: (s) => { const match2 = s.matches.find((d) => d.id === matchId); const routeId2 = match2.routeId; const remountFn = router.routesById[routeId2].options.remountDeps ?? router.options.defaultRemountDeps; const remountDeps = remountFn?.({ routeId: routeId2, loaderDeps: match2.loaderDeps, params: match2._strictParams, search: match2._strictSearch }); const key2 = remountDeps ? JSON.stringify(remountDeps) : void 0; return { key: key2, routeId: routeId2, match: { id: match2.id, status: match2.status, error: match2.error, _forcePending: match2._forcePending, _displayPending: match2._displayPending } }; }, structuralSharing: true }); const route = router.routesById[routeId]; const out = React10.useMemo(() => { const Comp = route.options.component ?? router.options.defaultComponent; if (Comp) { return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Comp, {}, key); } return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Outlet, {}); }, [key, route.options.component, router.options.defaultComponent]); if (match._displayPending) { throw router.getMatch(match.id)?._nonReactive.displayPendingPromise; } if (match._forcePending) { throw router.getMatch(match.id)?._nonReactive.minPendingPromise; } if (match.status === "pending") { const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs; if (pendingMinMs) { const routerMatch = router.getMatch(match.id); if (routerMatch && !routerMatch._nonReactive.minPendingPromise) { if (!router.isServer) { const minPendingPromise = createControlledPromise(); routerMatch._nonReactive.minPendingPromise = minPendingPromise; setTimeout(() => { minPendingPromise.resolve(); routerMatch._nonReactive.minPendingPromise = void 0; }, pendingMinMs); } } } throw router.getMatch(match.id)?._nonReactive.loadPromise; } if (match.status === "notFound") { invariant(isNotFound(match.error), "Expected a notFound error"); return renderRouteNotFound(router, route, match.error); } if (match.status === "redirected") { invariant(isRedirect(match.error), "Expected a redirect error"); throw router.getMatch(match.id)?._nonReactive.loadPromise; } if (match.status === "error") { if (router.isServer) { const RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent; return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( RouteErrorComponent, { error: match.error, reset: void 0, info: { componentStack: "" } } ); } throw match.error; } return out; }); var Outlet = React10.memo(function OutletImpl() { const router = useRouter(); const matchId = React10.useContext(matchContext); const routeId = useRouterState({ select: (s) => s.matches.find((d) => d.id === matchId)?.routeId }); const route = router.routesById[routeId]; const parentGlobalNotFound = useRouterState({ select: (s) => { const matches = s.matches; const parentMatch = matches.find((d) => d.id === matchId); invariant( parentMatch, `Could not find parent match for matchId "${matchId}"` ); return parentMatch.globalNotFound; } }); const childMatchId = useRouterState({ select: (s) => { const matches = s.matches; const index = matches.findIndex((d) => d.id === matchId); return matches[index + 1]?.id; } }); const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(router.options.defaultPendingComponent, {}) : null; if (parentGlobalNotFound) { return renderRouteNotFound(router, route, void 0); } if (!childMatchId) { return null; } const nextMatch = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Match, { matchId: childMatchId }); if (matchId === rootRouteId) { return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(React10.Suspense, { fallback: pendingElement, children: nextMatch }); } return nextMatch; }); // node_modules/@tanstack/react-router/dist/esm/Matches.js function Matches() { const router = useRouter(); const rootRoute = router.routesById[rootRouteId]; const PendingComponent = rootRoute.options.pendingComponent ?? router.options.defaultPendingComponent; const pendingElement = PendingComponent ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PendingComponent, {}) : null; const ResolvedSuspense = router.isServer || typeof document !== "undefined" && router.ssr ? SafeFragment : React11.Suspense; const inner = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ResolvedSuspense, { fallback: pendingElement, children: [ !router.isServer && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Transitioner, {}), /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MatchesInner, {}) ] }); return router.options.InnerWrap ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(router.options.InnerWrap, { children: inner }) : inner; } function MatchesInner() { const router = useRouter(); const matchId = useRouterState({ select: (s) => { return s.matches[0]?.id; } }); const resetKey = useRouterState({ select: (s) => s.loadedAt }); const matchComponent = matchId ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Match, { matchId }) : null; return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(matchContext.Provider, { value: matchId, children: router.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)( CatchBoundary, { getResetKey: () => resetKey, errorComponent: ErrorComponent, onCatch: (error) => { tiny_warning_esm_default( false, `The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!` ); tiny_warning_esm_default(false, error.message || error.toString()); }, children: matchComponent } ) }); } function useMatches(opts) { return useRouterState({ select: (state) => { const matches = state.matches; return opts?.select ? opts.select(matches) : matches; }, structuralSharing: opts?.structuralSharing }); } // node_modules/@tanstack/react-router/dist/esm/router.js var createRouter = (options) => { return new Router(options); }; var Router = class extends RouterCore { constructor(options) { super(options); } }; if (typeof globalThis !== "undefined") { globalThis.createFileRoute = createFileRoute; globalThis.createLazyFileRoute = createLazyFileRoute; } else if (typeof window !== "undefined") { window.createFileRoute = createFileRoute; window.createLazyFileRoute = createLazyFileRoute; } // node_modules/@tanstack/react-router/dist/esm/RouterProvider.js var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); function RouterContextProvider({ router, children, ...rest }) { if (Object.keys(rest).length > 0) { router.update({ ...router.options, ...rest, context: { ...router.options.context, ...rest.context } }); } const routerContext2 = getRouterContext(); const provider = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(routerContext2.Provider, { value: router, children }); if (router.options.Wrap) { return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(router.options.Wrap, { children: provider }); } return provider; } function RouterProvider({ router, ...rest }) { return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RouterContextProvider, { router, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Matches, {}) }); } // node_modules/@tanstack/react-router/dist/esm/useLocation.js function useLocation(opts) { return useRouterState({ select: (state) => opts?.select ? opts.select(state.location) : state.location }); } // node_modules/@tanstack/react-router/dist/esm/useCanGoBack.js function useCanGoBack() { return useRouterState({ select: (s) => s.location.state.__TSR_index !== 0 }); } // packages/route/build-module/lock-unlock.mjs var import_private_apis = __toESM(require_private_apis(), 1); var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", "@wordpress/route" ); // packages/route/build-module/private-apis.mjs var privateApis = {}; lock(privateApis, { // Router creation and setup createBrowserHistory, createLazyRoute, createRouter, createRootRoute, createRoute, Outlet, RouterProvider, // Internal routing utilities redirect, createLink, useCanGoBack, useLoaderData, useLocation, useMatches, useRouter, useRouterState, // History utilities parseHref }); // packages/route/build-module/index.mjs function useInvalidate() { const router = useRouter(); return () => router.invalidate(); } export { Link, notFound, privateApis, redirect, useInvalidate, useLinkProps, useNavigate, useParams, useSearch }; /*! Bundled license information: use-sync-external-store/cjs/use-sync-external-store-shim.development.js: (** * @license React * use-sync-external-store-shim.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js: (** * @license React * use-sync-external-store-shim/with-selector.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) */ index.min.asset.php000064400000000217152214140760010266 0ustar00 array('react', 'react-dom', 'react-jsx-runtime', 'wp-private-apis'), 'version' => 'c5843b6c5e84b352f43b');