1import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{v as t}from"./forms-BA2oQwJY.js";import{t as n}from"./preload-helper-B_l5jfgx.js";var r=e(t(),1),i=e=>{throw TypeError(e)},a=(e,t,n)=>t.has(e)||i(`Cannot `+n),o=(e,t,n)=>(a(e,t,`read from private field`),n?n.call(e):t.get(e)),s=(e,t,n)=>t.has(e)?i(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),c=`popstate`;function l(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function u(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return h(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:g(t)}return v(t,n,null,e)}function d(e,t){if(e===!1||e==null)throw Error(t)}function f(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function p(){return Math.random().toString(36).substring(2,10)}function m(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function h(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?_(t):t,state:n,key:t&&t.key||r||p(),unstable_mask:i}}function g({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function _(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function v(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,u=null,d=f();d??(d=0,o.replaceState({...o.state,idx:d},``));function f(){return(o.state||{idx:null}).idx}function p(){s=`POP`;let e=f(),t=e==null?null:e-d;d=e,u&&u({action:s,location:b.location,delta:t})}function g(e,t){s=`PUSH`;let r=l(e)?e:h(b.location,e,t);n&&n(r,e),d=f()+1;let c=m(r,d),p=b.createHref(r.unstable_mask||r);try{o.pushState(c,``,p)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(p)}a&&u&&u({action:s,location:b.location,delta:1})}function _(e,t){s=`REPLACE`;let r=l(e)?e:h(b.location,e,t);n&&n(r,e),d=f();let i=m(r,d),c=b.createHref(r.unstable_mask||r);o.replaceState(i,``,c),a&&u&&u({action:s,location:b.location,delta:0})}function v(e){return y(e)}let b={get action(){return s},get location(){return e(i,o)},listen(e){if(u)throw Error(`A history only accepts one active listener`);return i.addEventListener(c,p),u=e,()=>{i.removeEventListener(c,p),u=null}},createHref(e){return t(i,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:g,replace:_,go(e){return o.go(e)}};return b}function y(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),d(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:g(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function b(e){return{defaultValue:e}}var x,S=class{constructor(e){if(s(this,x,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(o(this,x).has(e))return o(this,x).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){o(this,x).set(e,t)}};x=new WeakMap;var C=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function w(e){return C.has(e)}var T=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function E(e){return T.has(e)}function D(e){return e.index===!0}function O(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(d(e.index!==!0||!e.children,`Cannot specify children on an index route`),d(i||!r[s],`Found a route id collision on i
1d "${s}". Route id's must be globally unique within Data Router usages`),D(e)){let n={...e,id:s};return r[s]=k(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=k(n,t(n)),e.children&&(n.children=O(e.children,t,o,r,i)),n}})}function k(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function A(e,t,n=`/`){return j(e,t,n,!1)}function j(e,t,n,r){let i=B((typeof t==`string`?_(t):t).pathname||`/`,n);if(i==null)return null;let a=M(e);P(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=ce(i);o=z(a[e],t,r)}return o}function ee(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function M(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;d(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=W([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(d(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),M(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ie(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of N(e.path))a(e,t,!0,n)}),t}function N(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=N(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function P(e){e.sort((e,t)=>e.score===t.score?ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var F=/^:[\w-]+$/,te=3,I=2,ne=1,L=10,re=-2,R=e=>e===`*`;function ie(e,t){let n=e.split(`/`),r=n.length;return n.some(R)&&(r+=re),t&&(r+=I),n.filter(e=>!R(e)).reduce((e,t)=>e+(F.test(t)?te:t===``?ne:L),r)}function ae(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function z(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=oe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;
1Object.assign(i,u.params),o.push({params:i,pathname:W([a,u.pathname]),pathnameBase:he(W([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=W([a,u.pathnameBase]))}return o}function oe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=se(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function se(e,t=!1,n=!0){f(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ce(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return f(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function B(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function V({basename:e,pathname:t}){return t===`/`?e:W([e,t])}var le=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ue=e=>le.test(e);function de(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?_(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?H(n.substring(1),`/`):H(n,t)):a=t,{pathname:a,search:G(r),hash:ge(i)}}function H(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function U(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function fe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function pe(e){let t=fe(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function me(e,t,n,r=!1){let i;typeof e==`string`?i=_(e):(i={...e},d(!i.pathname||!i.pathname.includes(`?`),U(`?`,`pathname`,`search`,i)),d(!i.pathname||!i.pathname.includes(`#`),U(`#`,`pathname`,`hash`,i)),d(!i.search||!i.search.includes(`#`),U(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=de(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var W=e=>e.join(`/`).replace(/\/\/+/g,`/`),he=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),G=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ge=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,_e=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ve(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ye(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var be=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function xe(e,t){let n=e;if(typeof n!=`string`||!le.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(be)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=B(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{f(!1,`<Link to="${n}">
1 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var Se=Symbol(`Uninstrumented`);function Ce(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Te(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Te(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[Se]??i,a=Te(n[e],t,(...e)=>De(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[Se]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[Se]??e,r=Te(n.middleware,t,(...e)=>De(e[0]));return r?(r[Se]=t,r):e})),r}function we(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[Se]??e.navigate,r=Te(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?g(n):`.`,...Oe(e,r??{})}});r&&(r[Se]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[Se]??e.fetch,r=Te(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...Oe(e,i??{})}});r&&(r[Se]=t,e.fetch=r)}return e}function Te(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ee(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ee(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Ee(e,t,n,r-1),a=await o,d(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function De(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:ke(t),params:{...r},unstable_pattern:i,context:Ae(n)}}function Oe(e,t){return{currentUrl:g(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function ke(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Ae(e){if(Me(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var je=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Me(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===je}var Ne=[`POST`,`PUT`,`PATCH`,`DELETE`],K=new Set(Ne),q=[`GET`,...Ne],Pe=new Set(q),Fe=new Set([301,302,303,307,308]),Ie=new Set([307,308]),Le={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Re={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ze={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Be=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ve=`remix-router-transitions`,He=Symbol(`ResetLoaderData`);function Ue(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;d(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Be,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...Ce(t.map(e=>
1e.route).filter(Boolean),e)})}let o={},s=O(e.routes,a,void 0,o),c,l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let u=e.dataStrategy||ot,p={...e.future},m=null,g=new Set,v=null,b=null,x=null,C=e.hydrationData!=null,w=A(s,e.history.location,l),T=!1,E=null,D,k;if(w==null&&!e.patchRoutesOnNavigation){let t=J(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Dt(s);D=!0,k=!D,w=n,E={[r.id]:t}}else if(w&&!e.hydrationData&<(w,s,e.history.location.pathname).active&&(w=null),!w){D=!1,k=!D,w=[];let t=lt(null,s,e.history.location.pathname);t.active&&t.matches&&(T=!0,w=t.matches)}else if(w.some(e=>e.route.lazy))D=!1,k=!D;else if(!w.some(e=>Je(e.route)))D=!0,k=!D;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=w;if(n){let e=w.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}k=!1,D=r.every(e=>{let r=Ye(e.route,t,n);return k||=r.renderFallback,!r.shouldLoad})}let M,N={historyAction:e.history.action,location:e.history.location,matches:w,initialized:D,renderFallback:k,navigation:Le,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},P=`POP`,F=null,te=!1,I,ne=!1,L=new Map,re=null,R=!1,ie=!1,ae=new Set,z=new Map,oe=0,se=-1,ce=new Map,V=new Set,le=new Map,de=new Map,H=new Set,U=new Map,fe,pe=null;function me(){if(m=e.history.listen(({action:t,location:n,delta:r})=>{if(fe){fe(),fe=void 0;return}f(U.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=nt({currentLocation:N.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{fe=e});e.history.go(r*-1),tt(i,{state:`blocked`,location:n,proceed(){tt(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(N.blockers);e.set(i,ze),G({blockers:e})}}),F?.resolve(),F=null;return}return be(t,n)}),n){Yt(t,L);let e=()=>Xt(t,L);t.addEventListener(`pagehide`,e),re=()=>t.removeEventListener(`pagehide`,e)}return N.initialized||be(`POP`,N.location,{initialHydration:!0}),M}function W(){m&&m(),re&&re(),g.clear(),I&&I.abort(),N.fetchers.forEach((e,t)=>Ve(t)),N.blockers.forEach((e,t)=>et(t))}function he(e){return g.add(e),()=>g.delete(e)}function G(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),N={...N,...e};let n=[],r=[];N.fetchers.forEach((e,t)=>{e.state===`idle`&&(H.has(t)?n.push(t):r.push(t))}),H.forEach(e=>{!N.fetchers.has(e)&&!z.has(e)&&n.push(e)}),[...g].forEach(r=>r(N,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ve(e)),r.forEach(e=>N.fetchers.delete(e))}function ge(t,n,{flushSync:r}={}){let i=N.actionData!=null&&N.navigation.formMethod!=null&&X(N.navigation.formMethod)&&N.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?N.actionData:null;let o=n.loaderData?wt(N.loaderData,n.loaderData,n.matches||[],n.errors):N.loaderData,l=N.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,ze)));let u=R?!1:ct(t,n.matches||N.matches),d=te===!0||N.navigation.formMethod!=null&&X(N.navigation.formMethod)&&t.state?._isRedirect!==!0;c&&=(s=c,void 0),R||P===`POP`||(P===`PUSH`?e.history.push(t,t.state):P===`REPLACE`&&e.history.replace(t,t.state));let f;if(P===`POP`){let e=L.get(N.location.pathname);e&&e.has(t.pathname)?f={currentLocation:N.location,nextLocation:t}:L.has(t.pathname)&&(f={currentLocation:t,nextLocation:N.location})}else if(ne){let e=L.get(N.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),L.set(N.location.pathname,e)),f={currentLocation:N.location,nextLocation:t}}G({...n,actionData:a,loaderData:o,historyAction:P,location:t,initialized:!0,renderFallback:!1,navigation:Le,revalidation:`idle`,restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:f,flushSync:r===!0}),P=`POP`,te=!1,ne=!1,R=!1,ie=!1,F?.resolve(),F=null,pe?.resolve(),pe=null}async function _e(t,n){if(F?.resolve(),F=null,typeof t==`number`){F||=Zt();let n=F.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=Ke(!1,Ge(N.location,N.matches,l,t,n?.fromRouteId,n?.relative),n),o;n?.unstable_mask&&(o={pathname:``,search:``,hash:``,...typeof n.unstable_mask==`string`?_(n.unstable_mask):{...N.location.unstable_mask,...n.unstable_mask}});let s=N.location,c=h(s,r,n&&n.state,void 0,o);c={...c,...e.history.encodeLocation(c)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&X(i.formMethod)&&i.formAction===N.location.pathname+N.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=nt({currentLocation:s,nextLocation:c,historyAction:d});if(m){tt(m,{state:`blocked`,location:c,proceed(){tt(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:c}),_e(t,n)},reset(){let e=new Map(N.blockers);e.set(m,ze),G({blockers:e})}});return}await be(d,c,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.unstable_defaultShouldRevalidate})}function ye(){pe||=Zt(),Ne(),G({revalidation:`loading`});let e=pe.promise;return N.navigation.state===`submitting`?e:N.navigation.state===`idle`?(be(N.historyAction,N.location,{startUninterruptedRevalidation:!0}
1),e):(be(P||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:ne===!0}),e)}async function be(t,n,r){I&&I.abort(),I=null,P=t,R=(r&&r.startUninterruptedRevalidation)===!0,st(N.location,N.matches),te=(r&&r.preventScrollReset)===!0,ne=(r&&r.enableViewTransition)===!0;let i=c||s,a=r&&r.overrideNavigation,o=r?.initialHydration&&N.matches&&N.matches.length>0&&!T?N.matches:A(i,n,l),u=(r&&r.flushSync)===!0;if(o&&N.initialized&&!ie&&At(N.location,n)&&!(r&&r.submission&&X(r.submission.formMethod))){ge(n,{matches:o},{flushSync:u});return}let d=lt(o,i,n.pathname);if(d.active&&d.matches&&(o=d.matches),!o){let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);ge(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}I=new AbortController;let f=yt(e.history,n,I.signal,r&&r.submission),p=e.getContext?await e.getContext():new S,m;if(r&&r.pendingError)m=[Et(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&X(r.submission.formMethod)){let t=await xe(f,n,r.submission,o,p,d.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Y(r)&&ve(r.error)&&r.error.status===404){I=null,ge(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,m=t.pendingActionResult,a=Wt(n,r.submission),u=!1,d.active=!1,f=yt(e.history,f.url,f.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await Se(f,n,o,p,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,m,r&&r.callSiteDefaultShouldRevalidate);h||(I=null,ge(n,{matches:g||o,...Tt(m),loaderData:_,errors:v}))}async function xe(t,n,i,c,u,d,f,p={}){if(Ne(),G({navigation:Gt(n,i)},{flushSync:p.flushSync===!0}),d){let e=await ut(c,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Dt(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Et(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:r}=rt(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let m,h=Ht(c,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:J(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await je(t,ft(a,o,t,c,h,f?[]:r,u),u,null);if(m=e[h.route.id],!m){for(let t of c)if(e[t.route.id]){m=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Ft(m)){let n;return n=p&&p.replace!=null?p.replace:vt(m.response.headers.get(`Location`),new URL(t.url),l,e.history)===N.location.pathname+N.location.search,await Ae(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Y(m)){let e=Et(c,h.route.id);return(p&&p.replace)!==!0&&(P=`PUSH`),{matches:c,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:c,pendingActionResult:[h.route.id,m]}}async function Se(t,n,i,u,d,f,p,m,h,g,_,v,y){let b=f||Wt(n,p),x=p||m||Ut(b),S=!R&&!g;if(d){if(S){let e=Te(v);G({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ut(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Dt(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Et(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=rt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c||s,{dsMatches:w,revalidatingFetchers:T}=qe(t,u,a,o,e.history,N,i,x,n,g?[]:r,g===!0,ie,ae,H,le,V,C,l,e.patchRoutesOnNavigation!=null,v,y);if(se=++oe,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=Xe();return ge(n,{matches:i,loaderData:{},errors:v&&Y(v[1])?{[v[0]]:v[1].error}:null,...Tt(v),...e?{fetchers:new Map(N.fetchers)}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Te(v);t!==void 0&&(e.actionData=t)}T.length>0&&(e.fetchers=Ee(T)),G(e,{flushSync:_})}
1T.forEach(e=>{Ue(e.key),e.controller&&z.set(e.key,e.controller)});let E=()=>T.forEach(e=>Ue(e.key));I&&I.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Me(w,T,t,u);if(t.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener(`abort`,E),T.forEach(e=>z.delete(e.key));let k=Ot(D);if(k)return await Ae(t,k.result,!0,{replace:h}),{shortCircuited:!0};if(k=Ot(O),k)return V.add(k.key),await Ae(t,k.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:A,errors:j}=Ct(N,i,D,v,T,O);g&&N.errors&&(j={...N.errors,...j});let ee=Xe(),M=Ze(se),P=ee||M||T.length>0;return{matches:i,loaderData:A,errors:j,...P?{fetchers:new Map(N.fetchers)}:{}}}function Te(e){if(e&&!Y(e[1]))return{[e[0]]:e[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Ee(e){return e.forEach(e=>{let t=N.fetchers.get(e.key),n=Kt(void 0,t?t.data:void 0);N.fetchers.set(e.key,n)}),new Map(N.fetchers)}async function De(t,n,r,i){Ue(t);let a=(i&&i.flushSync)===!0,o=c||s,u=Ge(N.location,N.matches,l,r,n,i?.relative),d=A(o,u,l),f=lt(d,o,u);if(f.active&&f.matches&&(d=f.matches),!d){q(t,n,J(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=Ke(!0,u,i);if(h){q(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new S,_=(i&&i.preventScrollReset)===!0;if(m&&X(m.formMethod)){await Oe(t,n,p,d,g,f.active,a,_,m,i&&i.unstable_defaultShouldRevalidate);return}le.set(t,{routeId:n,path:p}),await ke(t,n,p,d,g,f.active,a,_,m)}async function Oe(t,n,i,u,f,p,m,h,g,_){Ne(),le.delete(t),K(t,qt(g,N.fetchers.get(t)),{flushSync:m});let v=new AbortController,y=yt(e.history,i,v.signal,g);if(p){let e=await ut(u,new URL(y.url).pathname,y.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){q(t,n,e.error,{flushSync:m});return}else if(e.matches)u=e.matches;else{q(t,n,J(404,{pathname:i}),{flushSync:m});return}}let b=Ht(u,i);if(!b.route.action&&!b.route.lazy){q(t,n,J(405,{method:g.formMethod,pathname:i,routeId:n}),{flushSync:m});return}z.set(t,v);let x=oe,S=ft(a,o,y,u,b,r,f),C=await je(y,S,f,t),w=C[b.route.id];if(!w){for(let e of S)if(C[e.route.id]){w=C[e.route.id];break}}if(y.signal.aborted){z.get(t)===v&&z.delete(t);return}if(H.has(t)){if(Ft(w)||Y(w)){K(t,Jt(void 0));return}}else{if(Ft(w))if(z.delete(t),se>x){K(t,Jt(void 0));return}else return V.add(t),K(t,Kt(g)),Ae(y,w,!1,{fetcherSubmission:g,preventScrollReset:h});if(Y(w)){q(t,n,w.error);return}}let T=N.navigation.location||N.location,E=yt(e.history,T,v.signal),D=c||s,O=N.navigation.state===`idle`?N.matches:A(D,N.navigation.location,l);d(O,`Didn't find any matches after fetcher action`);let k=++oe;ce.set(t,k);let j=Kt(g,w.data);N.fetchers.set(t,j);let{dsMatches:ee,revalidatingFetchers:M}=qe(E,f,a,o,e.history,N,O,g,T,r,!1,ie,ae,H,le,V,D,l,e.patchRoutesOnNavigation!=null,[b.route.id,w],_);M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=N.fetchers.get(t),r=Kt(void 0,n?n.data:void 0);N.fetchers.set(t,r),Ue(t),e.controller&&z.set(t,e.controller)}),G({fetchers:new Map(N.fetchers)});let F=()=>M.forEach(e=>Ue(e.key));v.signal.addEventListener(`abort`,F);let{loaderResults:te,fetcherResults:ne}=await Me(ee,M,E,f);if(v.signal.aborted)return;if(v.signal.removeEventListener(`abort`,F),ce.delete(t),z.delete(t),M.forEach(e=>z.delete(e.key)),N.fetchers.has(t)){let e=Jt(w.data);N.fetchers.set(t,e)}let L=Ot(te);if(L)return Ae(E,L.result,!1,{preventScrollReset:h});if(L=Ot(ne),L)return V.add(L.key),Ae(E,L.result,!1,{preventScrollReset:h});let{loaderData:re,errors:R}=Ct(N,O,te,void 0,M,ne);Ze(k),N.navigation.state===`loading`&&k>se?(d(P,`Expected pending action`),I&&I.abort(),ge(N.navigation.location,{matches:O,loaderData:re,errors:R,fetchers:new Map(N.fetchers)})):(G({errors:R,loaderData:wt(N.loaderData,re,O,R),fetchers:new Map(N.fetchers)}),ie=!1)}async function ke(t,n,i,s,c,l,u,d,f){let p=N.fetchers.get(t);K(t,Kt(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=yt(e.history,i,m.signal);if(l){let e=await ut(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){q(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{q(t,n,J(404,{pathname:i}),{flushSync:u});return}}let g=Ht(s,i);z.set(t,m);let _=oe,v=(await je(h,ft(a,o,h,s,g,r,c),c,t))[g.route.id];if(z.get(t)===m&&z.delete(t),!h.signal.aborted){if(H.has(t)){K(t,Jt(void 0));return}if(Ft(v))if(se>_){K(t,Jt(void 0));return}else{V.add(t),await Ae(h,v,!1,{preventScrollReset:d});return}if(Y(v)){q(t,n,v.error);return}K(t,Jt(v.data))}}async function Ae(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:u}={}){a||(F?.resolve(),F=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ie=!0);let f=i.response.headers.get(`Location`);d(f,`Expected a Location header on the redirect Response`),f=vt(f,new URL(r.url),l,e.history);let p=h(N.location,f,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(ue(f)){let n=y(f,!0);e=n.origin!==t.location.origin||B(n.pathname,l)==null}if(e){u?t.location.replace(f):t.location.assign(f);return}}I=null;let m=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=N.navigation;!o&&!s&&g&&_&&v&&(o=Ut(N.navigation));let b=o||s;Ie.has(i.response.status)&&b&&X(b.formMethod)?await be(m,p,{submission:{...b,formAction:f},preventScrollReset:c||te,enableViewTransition:a?ne:void 0}):await be(m,p,{overrideNavigation:Wt(p,o),fetcherSubmission:s,preventScrollReset:c||te,enableViewTransition:a?ne:void 0})}async function je(e,t,n,r){let i,a={};try{i=await pt(u,e,t,r,n,!1)}catch(e){return t.filter(e=>
1e.shouldLoad).forEach(t=>{a[t.route.id]={type:`error`,error:e}}),a}if(e.signal.aborted)return a;if(!X(e.method))for(let e of t){if(i[e.route.id]?.type===`error`)break;!i.hasOwnProperty(e.route.id)&&!N.loaderData.hasOwnProperty(e.route.id)&&(!N.errors||!N.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(i[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[n,r]of Object.entries(i))if(Pt(r)){let i=r.result;a[n]={type:`redirect`,response:_t(i,e,n,t,l)}}else a[n]=await gt(r);return a}async function Me(e,t,n,r){let i=je(n,e,r,null),a=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await je(e.request,e.matches,r,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:J(404,{pathname:e.path})}})}));return{loaderResults:await i,fetcherResults:(await a).reduce((e,t)=>Object.assign(e,t),{})}}function Ne(){ie=!0,le.forEach((e,t)=>{z.has(t)&&ae.add(t),Ue(t)})}function K(e,t,n={}){N.fetchers.set(e,t),G({fetchers:new Map(N.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function q(e,t,n,r={}){let i=Et(N.matches,t);Ve(e),G({errors:{[i.route.id]:n},fetchers:new Map(N.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Pe(e){return de.set(e,(de.get(e)||0)+1),H.has(e)&&H.delete(e),N.fetchers.get(e)||Re}function Fe(e,t){Ue(e,t?.reason),K(e,Jt(null))}function Ve(e){let t=N.fetchers.get(e);z.has(e)&&!(t&&t.state===`loading`&&ce.has(e))&&Ue(e),le.delete(e),ce.delete(e),V.delete(e),H.delete(e),ae.delete(e),N.fetchers.delete(e)}function He(e){let t=(de.get(e)||0)-1;t<=0?(de.delete(e),H.add(e)):de.set(e,t),G({fetchers:new Map(N.fetchers)})}function Ue(e,t){let n=z.get(e);n&&(n.abort(t),z.delete(e))}function We(e){for(let t of e){let e=Jt(Pe(t).data);N.fetchers.set(t,e)}}function Xe(){let e=[],t=!1;for(let n of V){let r=N.fetchers.get(n);d(r,`Expected fetcher: ${n}`),r.state===`loading`&&(V.delete(n),e.push(n),t=!0)}return We(e),t}function Ze(e){let t=[];for(let[n,r]of ce)if(r<e){let e=N.fetchers.get(n);d(e,`Expected fetcher: ${n}`),e.state===`loading`&&(Ue(n),ce.delete(n),t.push(n))}return We(t),t.length>0}function Qe(e,t){let n=N.blockers.get(e)||ze;return U.get(e)!==t&&U.set(e,t),n}function et(e){N.blockers.delete(e),U.delete(e)}function tt(e,t){let n=N.blockers.get(e)||ze;d(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(N.blockers);r.set(e,t),G({blockers:r})}function nt({currentLocation:e,nextLocation:t,historyAction:n}){if(U.size===0)return;U.size>1&&f(!1,`A router only supports one blocker at a time`);let r=Array.from(U.entries()),[i,a]=r[r.length-1],o=N.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function rt(e){let t=J(404,{pathname:e}),{matches:n,route:r}=Dt(c||s);return{notFoundMatches:n,route:r,error:t}}function it(e,t,n){if(v=e,x=t,b=n||null,!C&&N.navigation===Le){C=!0;let e=ct(N.location,N.matches);e!=null&&G({restoreScrollPosition:e})}return()=>{v=null,x=null,b=null}}function at(e,t){return b&&b(e,t.map(e=>ee(e,N.loaderData)))||e.key}function st(e,t){if(v&&x){let n=at(e,t);v[n]=x()}}function ct(e,t){if(v){let n=at(e,t),r=v[n];if(typeof r==`number`)return r}return null}function lt(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:j(n,r,l,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:j(n,r,l,!0)}}return{active:!1,matches:null}}async function ut(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let u=t;for(;;){let t=c==null,d=c||s,f=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:u,fetcherKey:i,patch:(e,t)=>{r.aborted||$e(e,t,d,f,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:u}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:`aborted`};let p=A(d,n,l),m=null;if(p&&(Object.keys(p[0].params).length===0||(m=j(d,n,l,!0),!(m&&u.length<m.length&&dt(u,m.slice(0,u.length))))))return{type:`success`,matches:p};if(m||=j(d,n,l,!0),!m||dt(u,m))return{type:`success`,matches:null};u=m}}function dt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function mt(e){o={},c=O(e,a,void 0,o)}function ht(e,t,n=!1){let r=c==null;$e(e,t,c||s,o,a,n),r&&(s=[...s],G({}))}return M={get basename(){return l},get future(){return p},get state(){return N},get routes(){return s},get window(){return t},initialize:me,subscribe:he,enableScrollRestoration:it,navigate:_e,fetch:De,revalidate:ye,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Pe,resetFetcher:Fe,deleteFetcher:He,dispose:W,getBlocker:Qe,deleteBlocker:et,patchRoutes:ht,_internalFetchControllers:z,_internalSetRoutes:mt,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){G(e)}},e.unstable_instrumentations&&(M=we(M,e.unstable_instrumentations.map(e=>
1e.router).filter(Boolean))),M}function We(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Ge(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=me(r||`.`,pe(o),B(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Vt(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=V({basename:n,pathname:c.pathname})),g(c)}function Ke(e,t,n){if(!n||!We(n))return{path:t};if(n.formMethod&&!Bt(n.formMethod))return{path:t,error:J(405,{method:n.formMethod})};let r=()=>({path:t,error:J(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=kt(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!X(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n} 2`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!X(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}d(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=bt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=bt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=xt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=xt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(X(c.formMethod))return{path:t,submission:c};let l=_(t);return e&&l.search&&Vt(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:g(l),submission:c}}function qe(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?Y(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&Y(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=ye(o),k=o.map((i,o)=>{let{route:s}=i,c=null;if(w!=null&&o>w)c=!1;else if(s.lazy)c=!0;else if(!Je(s))c=!1;else if(u){let{shouldLoad:e}=Ye(s,a.loaderData,a.errors);c=e}else Xe(a.loaderData,a.matches[o],i)&&(c=!0);if(c!==null)return dt(n,r,e,O,i,l,t,c);let f=!1;typeof b==`boolean`?f=b:E?f=!1:d||S.pathname+S.search===C.pathname+C.search?f=!0:S.search===C.search?Ze(a.matches[o],i)&&(f=!0):f=!0;let p={...D,defaultShouldRevalidate:f};return dt(n,r,e,O,i,l,t,Qe(i,p),p,b)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=A(g,e.path,_);if(!y){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Ht(y,e.path),S=new AbortController,C=yt(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=ft(n,r,C,y,x,l,t);else if(m)d&&(w=ft(n,r,C,y,x,l,t));else{let e;e=typeof b==`boolean`?b:E?!1:d;let i={...D,defaultShouldRevalidate:e};Qe(x,i)&&(w=ft(n,r,C,y,x,l,t,i))}w&&j.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:j}}function Je(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Ye(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Je(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Xe(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Ze(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Qe(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function $e(e,t,n,r,i,a){let o;if(e){let t=r[e];d(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];
2if(t.forEach(e=>{let t=o.find(t=>et(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=O(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=O([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function et(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>et(e,t)))??!1:!1}var tt=new WeakMap,nt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(d(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=tt.get(i);o||(o={},tt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=w(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)f(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)f(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},rt=new WeakMap;function it(e,t,n,r,i){let a=n[e.id];if(d(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=rt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{d(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=E(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?f(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?f(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return rt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=nt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function at(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function ot(e){return e.matches.some(e=>e.route.middleware)?st(e,()=>at(e)):at(e)}function st(e,t){return ct(e,t,e=>{if(zt(e))throw e;return e},Mt,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Et(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function ct(e,t,n,r,i){let{matches:a,request:o,params:s,context:c,unstable_pattern:l}=e,u=a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]);return await lt({request:o,params:s,context:c,unstable_pattern:l},u,t,n,r,i)}async function lt(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await lt(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function ut(e,t,n,r,i){let a=nt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=it(r.route,X(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function dt(e,t,n,r,i,a,o,s,c=null,l){let u=!1,d=ut(e,t,n,i,a);return{...i,_lazyPromises:d,shouldLoad:s,shouldRevalidateArgs:c,shouldCallHandler(e){return u=!0,
2c?typeof l==`boolean`?Qe(i,{...c,defaultShouldRevalidate:l}):typeof e==`boolean`?Qe(i,{...c,defaultShouldRevalidate:e}):Qe(i,c):s},resolve(e){let{lazy:t,loader:a,middleware:c}=i.route,l=u||s||e&&!X(n.method)&&(t||a),f=c&&c.length>0&&!a&&!t;return l&&(X(n.method)||!f)?mt({request:n,unstable_pattern:r,match:i,lazyHandlerPromise:d?.handler,lazyRoutePromise:d?.route,handlerOverride:e,scopedContext:o}):Promise.resolve({type:`data`,result:void 0})}}}function ft(e,t,n,r,i,a,o,s=null){return r.map(c=>c.route.id===i.route.id?dt(e,t,n,ye(r),c,a,o,!0,s):{...c,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:ut(e,t,n,c,a),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function pt(e,t,n,r,i,a){n.some(e=>e._lazyPromises?.middleware)&&await Promise.all(n.map(e=>e._lazyPromises?.middleware));let o={request:t,unstable_pattern:ye(n),params:n[0].params,context:i,matches:n},s=a?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=o;return st(t,()=>e({...t,fetcherKey:r,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},c=await e({...o,fetcherKey:r,runClientMiddleware:s});try{await Promise.all(n.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return c}async function mt({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:a,scopedContext:o}){let s,c,l=X(e.method),u=l?`action`:`loader`,d=r=>{let i,s=new Promise((e,t)=>i=t);c=()=>i(),e.signal.addEventListener(`abort`,c);let l=i=>typeof r==`function`?r({request:e,unstable_pattern:t,params:n.params,context:o},...i===void 0?[]:[i]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${n.route.id}]`)),d=(async()=>{try{return{type:`data`,result:await(a?a(e=>l(e)):l())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([d,s])};try{let t=l?n.route.action:n.route.loader;if(r||i)if(t){let e,[n]=await Promise.all([d(t).catch(t=>{e=t}),r,i]);if(e!==void 0)throw e;s=n}else{await r;let t=l?n.route.action:n.route.loader;if(t)[s]=await Promise.all([d(t),i]);else if(u===`action`){let t=new URL(e.url),r=t.pathname+t.search;throw J(405,{method:e.method,pathname:r,routeId:n.route.id})}else return{type:`data`,result:void 0}}else if(t)s=await d(t);else{let t=new URL(e.url);throw J(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{c&&e.signal.removeEventListener(`abort`,c)}return s}async function ht(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function gt(e){let{result:t,type:n}=e;if(Lt(t)){let e;try{e=await ht(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new _e(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?It(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:jt(t),statusCode:ve(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:ve(t)?t.status:void 0}:It(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function _t(e,t,n,r,i){let a=e.headers.get(`Location`);if(d(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!ue(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Ge(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}function vt(e,t,n,r){let i=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];if(ue(e)){let r=e,a=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(i.includes(a.protocol))throw Error(`Invalid redirect location`);let o=B(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}try{let t=r.createURL(e);if(i.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function yt(e,t,n,r){let i=e.createURL(kt(t)).toString(),a={signal:n};if(r&&X(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=bt(r.formData):a.body=r.formData}
2return new Request(i,a)}function bt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function xt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function St(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Y(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let f=n.route.id,p=t[f];if(d(!Ft(p),`Cannot handle redirect results in processLoaderData`),Y(p)){let t=p.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[f]=t;else{let n=Et(e,f);o[n.route.id]??(o[n.route.id]=t)}r||(a[f]=He),c||(c=!0,s=ve(p.error)?p.error.status:500),p.headers&&(l[f]=p.headers)}else a[f]=p.data,p.statusCode&&p.statusCode!==200&&!c&&(s=p.statusCode),p.headers&&(l[f]=p.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Ct(e,t,n,r,i,a){let{loaderData:o,errors:s}=St(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(d(o,`Did not find corresponding fetcher result`),Y(o)){let t=Et(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(Ft(o))d(!1,`Unhandled fetcher revalidation redirect`);else{let t=Jt(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function wt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==He).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Tt(e){return e?Y(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Et(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Dt(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function J(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new _e(e||500,o,Error(s),!0)}function Ot(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Ft(r))return{key:n,result:r}}}function kt(e){return g({...typeof e==`string`?_(e):e,hash:``})}function At(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function jt(e){return new _e(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Mt(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Nt(t))}function Nt(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Pt(e){return Lt(e.result)&&Fe.has(e.result.status)}function Y(e){return e.type===`error`}function Ft(e){return(e&&e.type)===`redirect`}function It(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Lt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Rt(e){return Fe.has(e)}function zt(e){return Lt(e)&&Rt(e.status)&&e.headers.has(`Location`)}function Bt(e){return Pe.has(e.toUpperCase())}function X(e){return K.has(e.toUpperCase())}function Vt(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Ht(e,t){let n=typeof t==`string`?_(t).search:t.search;if(e[e.length-1].route.index&&Vt(n||``))return e[e.length-1];let r=fe(e);return r[r.length-1]}function Ut(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Wt(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Gt(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Kt(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function qt(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Jt(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Yt(e,t){try{let n=e.sessionStorage.getItem(Ve);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Xt(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Ve,JSON.stringify(n))}catch(e){f(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Zt(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Qt=r.createContext(null);Qt.displayName=`DataRouter`;var $t=r.createContext(null);$t.displayName=`DataRouterState`;var en=r.createContext(!1);function tn(){return r.useContext(en)}var nn=r.createContext({isTransitioning:!1});nn.displayName=`ViewTransition`;var rn=r.createContext(new Map);rn.displayName=`Fetchers`;var an=r.createContext(null);an.displayName=`Await`;var Z=r.createContext(null);Z.displayName=`Navigation`;var on=r.createContext(null);on.displayName=`Location`;var Q=r.createContext({outlet:null,matches:[],isDataRoute:!1});Q.displayName=`Route`;var sn=r.createContext(null);sn.displayName=`RouteError`;var cn=`REACT_ROUTER_ERROR`,ln=`REDIRECT`,un=`ROUTE_ERROR_RESPONSE`;function dn(e){if(e.startsWith(`${cn}:${ln}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function fn(e){if(e.startsWith(`${cn}:${un}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new _e(t.status,t.statusText,t.data)}catch{}}function pn(e,{relative:t}={}){d(mn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:i}=r.useContext(Z),{hash:a,pathname:o,search:s}=Cn(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:W([n,o])),i.createHref({pathname:c,search:s,hash:a})}function mn(){return r.useContext(on)!=null}
2function $(){return d(mn(),`useLocation() may be used only in the context of a <Router> component.`),r.useContext(on).location}var hn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function gn(e){r.useContext(Z).static||r.useLayoutEffect(e)}function _n(){let{isDataRoute:e}=r.useContext(Q);return e?Vn():vn()}function vn(){d(mn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=r.useContext(Qt),{basename:t,navigator:n}=r.useContext(Z),{matches:i}=r.useContext(Q),{pathname:a}=$(),o=JSON.stringify(pe(i)),s=r.useRef(!1);return gn(()=>{s.current=!0}),r.useCallback((r,i={})=>{if(f(s.current,hn),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=me(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}var yn=r.createContext(null);function bn(){return r.useContext(yn)}function xn(e){let t=r.useContext(Q).outlet;return r.useMemo(()=>t&&r.createElement(yn.Provider,{value:e},t),[t,e])}function Sn(){let{matches:e}=r.useContext(Q),t=e[e.length-1];return t?t.params:{}}function Cn(e,{relative:t}={}){let{matches:n}=r.useContext(Q),{pathname:i}=$(),a=JSON.stringify(pe(n));return r.useMemo(()=>me(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function wn(e,t,n){d(mn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=r.useContext(Z),{matches:a}=r.useContext(Q),o=a[a.length-1],s=o?o.params:{},c=o?o.pathname:`/`,l=o?o.pathnameBase:`/`,u=o&&o.route;{let e=u&&u.path||``;Un(c,!u||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 3 4Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let p=$(),m;if(t){let e=typeof t==`string`?_(t):t;d(l===`/`||e.pathname?.startsWith(l),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${e.pathname}" was given in the \`location\` prop.`),m=e}else m=p;let h=m.pathname||`/`,g=h;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);g=`/`+h.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let v=A(e,{pathname:g});f(u||v!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),f(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=jn(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:W([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:W([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&y?r.createElement(on.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...m},navigationType:`POP`}},y):y}function Tn(){let e=Bn(),t=ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i=`rgba(200,200,200, 0.5)`,a={padding:`0.5rem`,backgroundColor:i},o={padding:`2px 4px`,backgroundColor:i},s=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),s=r.createElement(r.Fragment,null,r.createElement(`p`,null,`ð¿ Hey developer ð`),r.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,r.createElement(`code`,{style:o},`ErrorBoundary`),` or`,` `,r.createElement(`code`,{style:o},`errorElement`),` prop on your route.`)),r.createElement(r.Fragment,null,r.createElement(`h2`,null,`Unexpected Application
4Error!`),r.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?r.createElement(`pre`,{style:a},n):null,s)}var En=r.createElement(Tn,null),Dn=class extends r.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=fn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(Q.Provider,{value:this.props.routeContext},r.createElement(sn.Provider,{value:e,children:this.props.component}));return this.context?r.createElement(kn,{error:e},t):t}};Dn.contextType=en;var On=new WeakMap;function kn({children:e,error:t}){let{basename:n}=r.useContext(Z);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=dn(t.digest);if(e){let i=On.get(t);if(i)throw i;let a=xe(e.location,n);if(be&&!On.get(t))if(a.isExternal||e.reloadDocument)window.location.href=a.absoluteURL||a.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw On.set(t,n),n}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a.absoluteURL||a.to}`})}}return e}function An({routeContext:e,match:t,children:n}){let i=r.useContext(Qt);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(Q.Provider,{value:e},n)}function jn(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let a=e,o=i?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);d(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&i){s=i.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=i,o=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||o){n.isStatic&&(s=!0),a=c>=0?a.slice(0,c+1):[a[0]];break}}}}let l=n?.onError,u=i&&l?(e,t)=>{l(e,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:ye(i.matches),errorInfo:t})}:void 0;return a.reduceRight((e,n,l)=>{let d,f=!1,p=null,m=null;i&&(d=o&&n.route.id?o[n.route.id]:void 0,p=n.route.errorElement||En,s&&(c<0&&l===0?(Un(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):c===l&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,l+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?r.createElement(n.route.Component,null):n.route.element?n.route.element:e,r.createElement(An,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(Dn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function Mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nn(e){let t=r.useContext(Qt);return d(t,Mn(e)),t}function Pn(e){let t=r.useContext($t);return d(t,Mn(e)),t}function Fn(e){let t=r.useContext(Q);return d(t,Mn(e)),t}function In(e){let t=Fn(e),n=t.matches[t.matches.length-1];return d(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ln(){return In(`useRouteId`)}function Rn(){return Pn(`useNavigation`).navigation}function zn(){let{matches:e,loaderData:t}=Pn(`useMatches`);return r.useMemo(()=>e.map(e=>ee(e,t)),[e,t])}function Bn(){let e=r.useContext(sn),t=Pn(`useRouteError`),n=In(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Vn(){let{router:e}=Nn(`useNavigate`),t=In(`useNavigate`),n=r.useRef(!1);return gn(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{f(n.current,hn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Hn={};function Un(e,t,n){!t&&!Hn[e]&&(Hn[e]=!0,f(!1,n))}var Wn={};function Gn(e,t){!e&&!Wn[t]&&(Wn[t]=!0,console.warn(t))}var Kn=r.useOptimistic,qn=()=>void 0;function Jn(e){return Kn?Kn(e):[e,qn]}function Yn(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&f(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:r.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&f(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:r.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&f(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:r.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Xn=[`HydrateFallback`,`hydrateFallbackElement`],Zn=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>
4{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Qn({router:e,flushSync:t,onError:n,unstable_useTransitions:i}){i=tn()||i;let[a,o]=r.useState(e.state),[s,c]=Jn(a),[l,u]=r.useState(),[d,f]=r.useState({isTransitioning:!1}),[p,m]=r.useState(),[h,g]=r.useState(),[_,v]=r.useState(),y=r.useRef(new Map),b=r.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:d,viewTransitionOpts:_})=>{l&&n&&Object.values(l).forEach(e=>n(e,{location:a.location,params:a.matches[0]?.params??{},unstable_pattern:ye(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),Gn(d===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Gn(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&d?t(()=>o(a)):i===!1?o(a):r.startTransition(()=>{i===!0&&c(e=>$n(e,a)),o(a)});return}if(t&&d){t(()=>{h&&(p?.resolve(),h.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>o(a))});n.finished.finally(()=>{t(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})})}),t(()=>g(n));return}h?(p?.resolve(),h.skipTransition(),v({state:a,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(u(a),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,p,i,c,n]);r.useLayoutEffect(()=>e.subscribe(b),[e,b]),r.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new Zn)},[d]),r.useEffect(()=>{if(p&&l&&e.window){let t=l,n=p.promise,a=e.window.document.startViewTransition(async()=>{i===!1?o(t):r.startTransition(()=>{i===!0&&c(e=>$n(e,t)),o(t)}),await n});a.finished.finally(()=>{m(void 0),g(void 0),u(void 0),f({isTransitioning:!1})}),g(a)}},[l,p,e.window,i,c]),r.useEffect(()=>{p&&l&&s.location.key===l.location.key&&p.resolve()},[p,h,s.location,l]),r.useEffect(()=>{!d.isTransitioning&&_&&(u(_.state),f({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[d.isTransitioning,_]);let x=r.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=r.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return r.createElement(r.Fragment,null,r.createElement(Qt.Provider,{value:C},r.createElement($t.Provider,{value:s},r.createElement(rn.Provider,{value:y.current},r.createElement(nn.Provider,{value:d},r.createElement(ir,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,unstable_useTransitions:i},r.createElement(er,{routes:e.routes,future:e.future,state:s,isStatic:!1,onError:n})))))),null)}function $n(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var er=r.memo(tr);function tr({routes:e,future:t,state:n,isStatic:r,onError:i}){return wn(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function nr({to:e,replace:t,state:n,relative:i}){d(mn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:a}=r.useContext(Z);f(!a,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=r.useContext(Q),{pathname:s}=$(),c=_n(),l=me(e,pe(o),s,i===`path`),u=JSON.stringify(l);return r.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:i})},[c,u,i,t,n]),null}function rr(e){return xn(e.context)}function ir({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,unstable_useTransitions:s}){d(!mn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=r.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=_(n));let{pathname:u=`/`,search:p=``,hash:m=``,state:h=null,key:g=`default`,unstable_mask:v}=n,y=r.useMemo(()=>{let e=B(u,c);return e==null?null:{location:{pathname:e,search:p,hash:m,state:h,key:g,unstable_mask:v},navigationType:i}},[c,u,p,m,h,g,i,v]);
4return f(y!=null,`<Router basename="${c}"> is not able to match the URL "${u}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:r.createElement(Z.Provider,{value:l},r.createElement(on.Provider,{children:t,value:y}))}var ar=`get`,or=`application/x-www-form-urlencoded`;function sr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function cr(e){return sr(e)&&e.tagName.toLowerCase()===`button`}function lr(e){return sr(e)&&e.tagName.toLowerCase()===`form`}function ur(e){return sr(e)&&e.tagName.toLowerCase()===`input`}function dr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fr(e,t){return e.button===0&&(!t||t===`_self`)&&!dr(e)}function pr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function mr(e,t){let n=pr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var hr=null;function gr(){if(hr===null)try{new FormData(document.createElement(`form`),0),hr=!1}catch{hr=!0}return hr}var _r=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function vr(e){return e!=null&&!_r.has(e)?(f(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${or}"`),null):e}function yr(e,t){let n,r,i,a,o;if(lr(e)){let o=e.getAttribute(`action`);r=o?B(o,t):null,n=e.getAttribute(`method`)||ar,i=vr(e.getAttribute(`enctype`))||or,a=new FormData(e)}else if(cr(e)||ur(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?B(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||ar,i=vr(e.getAttribute(`formenctype`))||vr(o.getAttribute(`enctype`))||or,a=new FormData(o,e),!gr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(sr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=ar,r=null,i=or,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var br={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},xr=/[&><\u2028\u2029]/g;function Sr(e){return e.replace(xr,e=>br[e])}function Cr(e,t){if(e===!1||e==null)throw Error(t)}function wr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&B(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function Tr(e,t){if(e.id in t)return t[e.id];try{let r=await n(()=>import(e.module),[]);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Er(e){return e!=null&&typeof e.page==`string`}function Dr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Or(e,t,n){return Nr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Tr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Dr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function kr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>
4o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ar(e,t,{includeHydrateFallback:n}={}){return jr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function jr(e){return[...new Set(e)]}function Mr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Nr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Er(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Mr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Pr(){let e=r.useContext(Qt);return Cr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Fr(){let e=r.useContext($t);return Cr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ir=r.createContext(void 0);Ir.displayName=`FrameworkContext`;function Lr(){let e=r.useContext(Ir);return Cr(e,`You must render this element inside a <HydratedRouter> element`),e}function Rr(e,t){let n=r.useContext(Ir),[i,a]=r.useState(!1),[o,s]=r.useState(!1),{onFocus:c,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:f}=t,p=r.useRef(null);r.useEffect(()=>{if(e===`render`&&s(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{s(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),r.useEffect(()=>{if(i){let e=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(e)}}},[i]);let m=()=>{a(!0)},h=()=>{a(!1),s(!1)};return n?e===`intent`?[o,p,{onFocus:zr(c,m),onBlur:zr(l,h),onMouseEnter:zr(u,m),onMouseLeave:zr(d,h),onTouchStart:zr(f,m)}]:[o,p,{}]:[!1,p,{}]}function zr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Br({page:e,...t}){let{router:n}=Pr(),i=r.useMemo(()=>A(n.routes,e,n.basename),[n.routes,e,n.basename]);return i?r.createElement(Hr,{page:e,matches:i,...t}):null}function Vr(e){let{manifest:t,routeModules:n}=Lr(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Or(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function Hr({page:e,matches:t,...n}){let i=$(),{future:a,manifest:o,routeModules:s}=Lr(),{basename:c}=Pr(),{loaderData:l,matches:u}=Fr(),d=r.useMemo(()=>kr(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>kr(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=new Set,r=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in l&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?r=!0:n.add(e.route.id))}),n.size===0)return[];let u=wr(e,c,a.unstable_trailingSlashAwareDataRequests,`data`);return r&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[c,a.unstable_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>Ar(f,o),[f,o]),h=Vr(f);return r.createElement(r.Fragment,null,p.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>r.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>r.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ur(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Wr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Wr&&(window.__reactRouterVersion=`7.13.1`)}catch{}function Gr(e,t){return Ue({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:u({window:t?.window}),hydrationData:t?.hydrationData||Kr(),routes:e,mapRouteProperties:Yn,hydrationRouteProperties:Xn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Kr(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:qr(e.errors)}),e}function qr(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new _e(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function Jr({basename:e,children:t,history:n,unstable_useTransitions:i}){let[a,o]=r.useState({action:n.action,location:n.location}),s=r.useCallback(e=>{i===!1?o(e):r.startTransition(()=>o(e))},[i]);return r.useLayoutEffect(()=>n.listen(s),[n,s]),r.createElement(ir,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:n,unstable_useTransitions:i})}Jr.displayName=`unstable_HistoryRouter`;var Yr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xr=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:i,reloadDocument:a,replace:o,unstable_mask:s,state:c,target:l,to:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,unstable_useTransitions:v}=r.useContext(Z),y=typeof u==`string`&&Yr.test(u),b=xe(u,g);u=b.to;let x=pn(u,{relative:i}),S=$(),C=null;if(s){let e=me(s,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:W([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Rr(n,m),D=ri(u,{replace:o,unstable_mask:s,state:c,target:l,preventScrollReset:d,relative:i,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||a),A=r.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Ur(h,T),target:l,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?r.createElement(r.Fragment,null,A,r.createElement(Br,{page:x})):A});Xr.displayName=`Link`;var Zr=r.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=Cn(o,{relative:l.relative}),f=$(),p=r.useContext($t),{navigator:m,basename:h}=r.useContext(Z),g=p!=null&&mi(d)&&s===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=B(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!i&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!i&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(
4Boolean).join(` `);let E=typeof a==`function`?a(C):a;return r.createElement(Xr,{...l,"aria-current":w,className:T,ref:u,style:E,to:o,viewTransition:s},typeof c==`function`?c(C):c)});Zr.displayName=`NavLink`;var Qr=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=ar,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=r.useContext(Z),_=si(),v=ci(c,{relative:u}),y=s.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&Yr.test(c);return r.createElement(`form`,{ref:h,method:y,action:v,onSubmit:i?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,m=()=>_(i||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:a,state:o,relative:u,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&n!==!1?r.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Qr.displayName=`Form`;function $r({getKey:e,storageKey:t,...n}){let i=r.useContext(Ir),{basename:a}=r.useContext(Z),o=$(),s=zn();fi({getKey:e,storageKey:t});let c=r.useMemo(()=>{if(!i||!e)return null;let t=di(o,s,a,e);return t===o.key?null:t},[]);if(!i||i.isSpaMode)return null;let l=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];
4typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Sr(JSON.stringify(t||li))}, ${Sr(JSON.stringify(c))})`}})}$r.displayName=`ScrollRestoration`;function ei(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ti(e){let t=r.useContext(Qt);return d(t,ei(e)),t}function ni(e){let t=r.useContext($t);return d(t,ei(e)),t}function ri(e,{target:t,replace:n,unstable_mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l,unstable_useTransitions:u}={}){let d=_n(),f=$(),p=Cn(e,{relative:s});return r.useCallback(m=>{if(fr(m,t)){m.preventDefault();let t=n===void 0?g(f)===g(p):n,h=()=>d(e,{replace:t,unstable_mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:l});u?r.startTransition(()=>h()):h()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function ii(e){f(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=r.useRef(pr(e)),n=r.useRef(!1),i=$(),a=r.useMemo(()=>mr(i.search,n.current?null:t.current),[i.search]),o=_n();return[a,r.useCallback((e,t)=>{let r=pr(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var ai=0,oi=()=>`__${String(++ai)}__`;function si(){let{router:e}=ti(`useSubmit`),{basename:t}=r.useContext(Z),n=Ln(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=yr(e,t);r.navigate===!1?await i(r.fetcherKey||oi(),n,r.action||o,{unstable_defaultShouldRevalidate:r.unstable_defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync}):await a(r.action||o,{unstable_defaultShouldRevalidate:r.unstable_defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,replace:r.replace,state:r.state,fromRouteId:n,flushSync:r.flushSync,viewTransition:r.viewTransition})},[i,a,t,n])}function ci(e,{relative:t}={}){let{basename:n}=r.useContext(Z),i=r.useContext(Q);d(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...Cn(e||`.`,{relative:t})},s=$();if(e==null){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();o.search=n?`?${n}`:``}}return(!e||e===`.`)&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(o.pathname=o.pathname===`/`?n:W([n,o.pathname])),g(o)}var li=`react-router-scroll-positions`,ui={};function di(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:B(e.pathname,n)||e.pathname},t)),i??=e.key,i}function fi({getKey:e,storageKey:t}={}){let{router:n}=ti(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=ni(`useScrollRestoration`),{basename:o}=r.useContext(Z),s=$(),c=zn(),l=Rn();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),pi(r.useCallback(()=>{if(l.state===`idle`){let t=di(s,c,o,e);ui[t]=window.scrollY}try{sessionStorage.setItem(t||li,JSON.stringify(ui))}catch(e){f(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,o,s,c,t])),typeof document<`u`&&(r.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||li);e&&(ui=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ui,()=>window.scrollY,e?(t,n)=>di(t,n,o,e):void 0);return()=>t&&t()},[n,o,e]),r.useLayoutEffect(()=>{if(i!==!1){if(typeof i==`number`){window.scrollTo(0,i);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{f(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}a!==!0&&window.scrollTo(0,0)}},[s,i,a]))}function pi(e,t){let{capture:n}=t||{};r.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function mi(e,{relative:t}={}){let n=r.useContext(nn);d(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=ti(`useViewTransitionState`),a=Cn(e,{relative:t});if(!n.isTransitioning)return!1;let o=B(n.currentLocation.pathname,i)||n.currentLocation.pathname,s=B(n.nextLocation.pathname,i)||n.nextLocation.pathname;return oe(a.pathname,s)!=null||oe(a.pathname,o)!=null}var hi={landing:`/`,home:`/`,profile:`/profile`,designSystem:`/design-system`,contentTiles:`/content-tiles`,contact:`/contact`,auth:{login:`/login`,register:`/register`,forgotPassword:`/forgot-password`,resetPassword:`/reset-password`,googleRedirect:`/connect/google/redirect`},feed:{path:`/`,public:`/feed`,my:`/my`}
4,timeline:{path:`/timeline/:slug`,detail:(e,t)=>t?`/timeline/${e}?record=${t}`:`/timeline/${e}`},search:`/search`,timelines:{my:`/timelines`},topics:{path:`/topics`,public:`/topics`,my:`/topics/my`},topic:{path:`/topic/:slug`,detail:e=>`/topic/${e}`},notifications:`/notifications`,teams:{path:`/teams`,my:`/teams/my`,detail:{path:`:id`,createTimeline:{path:`timelines/create`,link:e=>`/teams/${e}/timelines/create`},timelines:{path:`timelines`,link:e=>`/teams/${e}/timelines`},roles:{path:`roles`,link:e=>`/teams/${e}/roles`},members:{path:`members`,link:e=>`/teams/${e}/members`},requests:{path:`requests`,link:e=>`/teams/${e}/requests`},requestDetail:{path:`requests/:slug`,link:(e,t)=>`/teams/${e}/requests/${t}`}}}};export{rr as a,b as c,_n as d,bn as f,ii as h,nr as i,ve as l,Bn as m,Xr as n,Qn as o,Sn as p,Zr as r,Gr as s,hi as t,$ as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.