1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./preload-helper-DLnQEEFQ.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=(e,t,n,r)=>(a(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),l=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,u=/^[\\/]{2}/;function d(e,t){return t+e.replace(/\\/g,`/`)}var f=`popstate`;function p(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function m(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return y(``,{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:b(t)}return S(t,n,null,e)}function h(e,t){if(e===!1||e==null)throw Error(t)}function g(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _(){return Math.random().toString(36).substring(2,10)}function v(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function y(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?x(t):t,state:n,key:t&&t.key||r||_(),mask:i}}function b({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 x(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 S(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:_.location,delta:t})}function m(e,t){s=`PUSH`;let r=p(e)?e:y(_.location,e,t);n&&n(r,e),l=u()+1;let d=v(r,l),f=_.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:_.location,delta:1})}function h(e,t){s=`REPLACE`;let r=p(e)?e:y(_.location,e,t);n&&n(r,e),l=u();let i=v(r,l),d=_.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:_.location,delta:0})}function g(e){return C(i,e)}let _={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(f,d),c=e,()=>{i.removeEventListener(f,d),c=null}},createHref(e){return t(i,e)},createURL:g,encodeLocation(e){let t=g(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:m,replace:h,go(e){return o.go(e)}};return _}function C(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),h(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:b(t);return i=i.replace(/ $/,`%20`),!n&&u.test(i)&&(i=r+i),new URL(i,r)}function w(e){return{defaultValue:e}}var T,ee=class{constructor(e){if(s(this,T,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(o(this,T).has(e))return o(this,T).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){o(this,T).set(e,t)}};T=new WeakMap;var E=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function D(e){return E.has(e)}var O=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function k(e){return O.has(e)}function A(e){return e.index===!0}function j(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(h(e.index!==!0||!e.children,`Cannot specify children on an index route`),h(i||!r[s],`Found a route id collision on i
1d "${s}". Route id's must be globally unique within Data Router usages`),A(e)){let n={...e,id:s};return r[s]=M(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=M(n,t(n)),e.children&&(n.children=j(e.children,t,o,r,i)),n}})}function M(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function N(e,t,n=`/`){return P(e,t,n,!1)}function P(e,t,n,r,i){let a=B((typeof t==`string`?x(t):t).pathname||`/`,n);if(a==null)return null;let o=i??F(e),s=null,c=me(a);for(let e=0;s==null&&e<o.length;++e)s=de(o[e],c,r);return s}function te(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 F(e){let t=ne(e);return re(t),t}function ne(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;h(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=H([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(h(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ne(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:le(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=z(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of I(e.path))a(e,t,!0,n)}),t}function I(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=I(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 re(e){e.sort((e,t)=>e.score===t.score?ue(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ie=/^:[\w-]+$/,ae=3,L=2,oe=1,se=10,R=-2,ce=e=>e===`*`;function le(e,t){let n=e.split(`/`),r=n.length;return n.some(ce)&&(r+=R),t&&(r+=L),n.filter(e=>!ce(e)).reduce((e,t)=>e+(ie.test(t)?ae:t===``?oe:se),r)}function ue(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 de(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={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?pe(u,l,s.matcher,s.compiledParams):fe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=fe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;
1Object.assign(i,d.params),o.push({params:i,pathname:H([a,d.pathname]),pathnameBase:Ce(H([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=H([a,d.pathnameBase]))}return o}function fe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=z(e.path,e.caseSensitive,e.end);return pe(e,t,n,r)}function pe(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=U(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=U(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function z(e,t=!1,n=!0){g(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 me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return g(!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 he({basename:e,pathname:t}){return t===`/`?e:H([e,t])}var ge=e=>l.test(e);function _e(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?x(e):e,a;return n?(n=Se(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?ve(n.substring(1),`/`):ve(n,t)):a=t,{pathname:a,search:we(r),hash:Te(i)}}function ve(e,t){let n=U(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ye(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 be(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function V(e){let t=be(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function xe(e,t,n,r=!1){let i;typeof e==`string`?i=x(e):(i={...e},h(!i.pathname||!i.pathname.includes(`?`),ye(`?`,`pathname`,`search`,i)),h(!i.pathname||!i.pathname.includes(`#`),ye(`#`,`pathname`,`hash`,i)),h(!i.search||!i.search.includes(`#`),ye(`#`,`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=_e(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Se=e=>e.replace(/[\\/]{2,}/g,`/`),H=e=>Se(e.join(`/`));function U(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ce=e=>U(e).replace(/^\/*/,`/`),we=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Te=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ee=class{constructor(e,t){this.type=`DataWithResponseInit`,this.data=e,this.init=t||null}};function De(e,t){return new Ee(e,typeof t==`number`?{status:t}:t)}var Oe=(e,t=302)=>{let n=t;typeof n==`number`?n={status:n}:n.status===void 0&&(n.status=302);let r=new Headers(n.headers);return r.set(`Location`,e),new Response(null,{...n,headers:r})},ke=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],W=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 Ae(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function je(e){return H(e.map(e=>
1e.route.path).filter(Boolean))||`/`}var Me=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ne(e,t){let n=e;if(typeof n!=`string`||!l.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Me)try{let e=new URL(window.location.href),r=u.test(n)?new URL(d(n,e.protocol)):new URL(n),a=B(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{g(!1,`<Link to="${n}"> 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 G=Symbol(`Uninstrumented`);function Pe(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=K(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=K(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[G]??i,a=K(n[e],t,(...e)=>Le(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[G]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[G]??e,r=K(n.middleware,t,(...e)=>Le(e[0]));return r?(r[G]=t,r):e})),r}function Fe(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[G]??e.navigate,r=K(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?b(n):`.`,...Re(e,r??{})}});r&&(r[G]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[G]??e.fetch,r=K(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...Re(e,i??{})}});r&&(r[G]=t,e.fetch=r)}return e}function K(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ie(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ie(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=Ie(e,t,n,r-1),a=await o,h(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 Le(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:ze(t),params:{...r},pattern:i,context:Be(n)}}function Re(e,t){return{currentUrl:b(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 ze(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Be(e){if(He(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Ve=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function He(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`)===Ve}var Ue=new URL(`http://localhost`);function We(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ue)}catch{return Ue}}function Ge(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Ke(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function qe(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ge(i,n),s=!Ge(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Ke(e,i)||!Ge(i,a)))throw Error(`External navigation is not allowed`)}var Je=[`POST`,`PUT`,`PATCH`,`DELETE`],Ye=new Set(Je),Xe=[`GET`,...Je],Ze=new Set(Xe),Qe
1=new Set([301,302,303,307,308]),$e=new Set([307,308]),et={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},rt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),it=`remix-router-transitions`,at=Symbol(`ResetLoaderData`),ot,st,ct,lt,ut=class{constructor(e){s(this,ot),s(this,st),s(this,ct),s(this,lt),c(this,ot,e),c(this,st,F(e))}get stableRoutes(){return o(this,ot)}get activeRoutes(){return o(this,ct)??o(this,ot)}get branches(){return o(this,lt)??o(this,st)}get hasHMRRoutes(){return o(this,ct)!=null}setRoutes(e){c(this,ot,e),c(this,st,F(e))}setHmrRoutes(e){c(this,ct,e),c(this,lt,F(e))}commitHmrRoutes(){o(this,ct)&&(c(this,ot,o(this,ct)),c(this,st,o(this,lt)),c(this,ct,void 0),c(this,lt,void 0))}};ot=new WeakMap,st=new WeakMap,ct=new WeakMap,lt=new WeakMap;function dt(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;h(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||rt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Pe(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new ut(j(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Ot,d={...e.future},f=null,p=new Set,m=null,_=null,v=null,S=null,w=e.hydrationData!=null,T=P(s.activeRoutes,e.history.location,c,!1,s.branches),E=!1,D=null,O,k;if(T==null&&!e.patchRoutesOnNavigation){let t=q(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Qt(s.activeRoutes);O=!0,k=!O,T=n,D={[r.id]:t}}else if(T&&!e.hydrationData&&at(T,s.activeRoutes,e.history.location.pathname).active&&(T=null),!T){O=!1,k=!O,T=[];let t=at(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(E=!0,T=t.matches)}else if(T.some(e=>e.route.lazy))O=!1,k=!O;else if(!T.some(e=>gt(e.route)))O=!0,k=!O;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=T;if(n){let e=T.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}k=!1,O=!0,r.forEach(e=>{let r=_t(e.route,t,n);k||=r.renderFallback,O&&=!r.shouldLoad})}let A,M={historyAction:e.history.action,location:e.history.location,matches:T,initialized:O,renderFallback:k,navigation:et,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||D,fetchers:new Map,blockers:new Map},N=`POP`,F=null,ne=!1,I,re=!1,ie=new Map,ae=null,L=!1,oe=!1,se=new Set,R=new Map,ce=0,le=-1,ue=new Map,de=new Set,fe=new Map,pe=new Map,z=new Set,me=new Map,he,_e=null;function ve(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(he){he(),he=void 0;return}g(me.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=Je({currentLocation:M.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{he=e});e.history.go(r*-1),Ke(i,{state:`blocked`,location:n,proceed(){Ke(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(M.blockers);e.set(i,nt),V({blockers:e})}}),F?.resolve(),F=null;return}return U(t,n)}),n){xn(t,ie);let e=()=>Sn(t,ie);t.addEventListener(`pagehide`,e),ae=()=>t.removeEventListener(`pagehide`,e)}return M.initialized||U(`POP`,M.location,{initialHydration:!0}),A}function ye(){f&&f(),ae&&ae(),p.clear(),I&&I.abort(),M.fetchers.forEac
1h((e,t)=>Re(M.fetchers,t)),M.blockers.forEach((e,t)=>Ge(t))}function be(e){if(p.add(e),m){let{newErrors:t}=m;m=null,e(M,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)}function V(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}),M={...M,...e};let n=[],r=[];M.fetchers.forEach((e,t)=>{e.state===`idle`&&(z.has(t)?n.push(t):r.push(t))}),z.forEach(e=>{!M.fetchers.has(e)&&!R.has(e)&&n.push(e)}),p.size===0&&(m={newErrors:e.errors??null}),[...p].forEach(r=>r(M,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Re(M.fetchers,e)),r.forEach(e=>M.fetchers.delete(e))}function xe(t,n,{flushSync:r}={}){let i=M.actionData!=null&&M.navigation.formMethod!=null&&Y(M.navigation.formMethod)&&M.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?M.actionData:null;let o=n.loaderData?Yt(M.loaderData,n.loaderData,n.matches||[],n.errors):M.loaderData,c=M.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,nt)));let l=!L&&it(t,n.matches||M.matches),u=ne===!0||M.navigation.formMethod!=null&&Y(M.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),L||N===`POP`||(N===`PUSH`?e.history.push(t,t.state):N===`REPLACE`&&e.history.replace(t,t.state));let d;if(N===`POP`&&!L&&t!==M.location){let e=ie.get(M.location.pathname);e&&e.has(t.pathname)?d={currentLocation:M.location,nextLocation:t}:ie.has(t.pathname)&&(d={currentLocation:t,nextLocation:M.location})}else if(re){let e=ie.get(M.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ie.set(M.location.pathname,e)),d={currentLocation:M.location,nextLocation:t}}V({...n,actionData:a,loaderData:o,historyAction:N,location:t,initialized:!0,renderFallback:!1,navigation:et,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),N=`POP`,ne=!1,re=!1,L=!1,oe=!1,F?.resolve(),F=null,_e?.resolve(),_e=null}async function Se(t,n){if(F?.resolve(),F=null,typeof t==`number`){F||=Cn();let n=F.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=mt(!1,pt(M.location,M.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?x(n.mask):{...M.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},u.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),qe(typeof n.mask==`string`?n.mask:b(n.mask),b(o),e.history.createURL(`/`),`reject`)}let s=M.location,l=y(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},qe(t==null?e.history.createHref(M.location):typeof t==`string`?t:b(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||i!=null&&Y(i.formMethod)&&i.formAction===M.location.pathname+M.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Je({currentLocation:s,nextLocation:l,historyAction:f});if(h){Ke(h,{state:`blocked`,location:l,proceed(){Ke(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),Se(t,n)},reset(){let e=new Map(M.blockers);e.set(h,nt),V({blockers:e})}});return}await U(f,l,{submission:i,pendingError:a,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function H(){_e||=Cn(),Ne(),V({revalidation:`loading`});let e=_e.promise;return M.navigation.state===`submitting`?e:M.navigation.state===`idle`?(U(M.historyAction,M.location,{startUninterruptedRevalidation:!0}),e):(U(N||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:re===!0}),e)}async function U(t,n,r){I&&I.abort(),I=null,N=t,L=(r&&r.startUninterruptedRevalidation)===!0,Qe(M.location,M.matches),ne=(r&&r.preventScrollReset)===!0,re=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&M.matches&&M.matches.length>0&&!E?M.matches:P(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&M.initialized&&!oe&&tn(M.location,n)&&!(r&&r.submission&&Y(r.submission.formMethod))){xe(n,{matches:a},{flushSync:o});return}let l=at(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);xe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;I=new AbortController;let d=Ut(e.history,n,I.signal,r&&r.submission),f=e.getContext?await e.getContext():new ee,p;if(r&&r.pendingError)p=[Zt(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Y(r.submission.formMethod)){let i=await Ce(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(J(t)&&Ae(t.error)&&t.error.status===404){I=null,xe(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=gn(n,a,t,r.submission),o=!1,l.active=!1,d=Ut(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await we(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(I=null,xe(n,{matches:h||a,...Xt(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Ce(t,n,i,l,u,d,f,p,m={}){if(Ne(),V({navigation:_n(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ot(l,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}=Qt(s.activeRoutes);
1return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Zt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Ye(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=mn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:q(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await je(t,n,Pt(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(sn(h)){let n;return n=m&&m.replace!=null?m.replace:Ht(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===M.location.pathname+M.location.search,await W(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(J(h)){let e=Zt(l,g.route.id);return(m&&m.replace)!==!0&&(N=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function we(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||gn(n,i,l,p),x=p||m||hn(b),S=!L&&!g;if(d){if(S){let e=Te(v);V({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ot(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}=Qt(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Zt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Ye(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:T}=ht(t,u,a,o,e.history,M,i,x,n,g?[]:r,g===!0,oe,se,z,fe,de,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(le=++ce,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&T.length===0){let e=new Map(M.fetchers),t=He(e);return xe(n,{matches:i,loaderData:{},errors:v&&J(v[1])?{[v[0]]:v[1].error}:null,...Xt(v),...t?{fetchers:e}:{}},{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)),V(e,{flushSync:_})}T.forEach(e=>{Be(e.key),e.controller&&R.set(e.key,e.controller)});let ee=()=>T.forEach(e=>Be(e.key));I&&I.signal.addEventListener(`abort`,ee);let{loaderResults:E,fetcherResults:D}=await Me(w,T,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener(`abort`,ee),T.forEach(e=>R.delete(e.key));let O=$t(E);if(O)return await W(t,O.result,!0,{replace:h}),{shortCircuited:!0};if(O=$t(D),O)return de.add(O.key),await W(t,O.result,!0,{replace:h}),{shortCircuited:!0};let k=new Map(M.fetchers),{loaderData:A,errors:j}=Jt(M,i,E,v,T,D,k);g&&M.errors&&(j={...M.errors,...j});let N=He(k),P=Ue(le,k),te=N||P||T.length>0;return{matches:i,loaderData:A,errors:j,...te?{workingFetchers:k}:{}}}function Te(e){if(e&&!J(e[1]))return{[e[0]]:e[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function Ee(e){let t=new Map(M.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=vn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function De(t,n,r,i){Be(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=pt(M.location,M.matches,c,r,n,i?.relative),u=P(o,l,c,!1,s.branches),d=at(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){K(t,n,q(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=mt(!0,l,i);if(m){K(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new ee,g=(i&&i.preventScrollReset)===!0;if(p&&Y(p.formMethod)){await Oe(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}fe.set(t,{routeId:n,path:f}),await ke(t,n,f,u,h,d.active,a,g,p)}async function Oe(t,n,i,l,u,d,f,p,m,g){Ne(),fe.delete(t),G(t,yn(m,M.fetchers.get(t)),{flushSync:f});let _=new AbortController,v=Ut(e.history,i,_.signal,m);if(d){let e=await ot(l,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{K(t,n,q(404,{pathname:i}),{flushSync:f});return}}let y=mn(l,i);if(!y.route.action&&!y.route.lazy){K(t,n,q(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}R.set(t,_);let b=ce,x=Pt(a,o,v,i,l,y,r,u),S=await je(v,i,x,u,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){R.get(t)===_&&R.delete(t);return}if(z.has(t)){if(sn(C)||J(C)){G(t,bn(void 0));return}}else{if(sn(C)){if(R.delete(t),le>b){G(t,bn(void 0));return}return de.add(t),G(t,vn(m)),W(v,C,!1,{fetcherSubmission:m,preventScrollReset:p})}if(J(C)){K(t,n,C.error);return}}let w=M.navigation.location||M.location,T=Ut(e.history,w,_.signal),ee=s.activeRoutes,E=M.navigation.state===`idle`?M.matches:P(ee,M.navigation.location,c,!1,s.branches);h(E,`Didn't find any matches after fetcher action`);let D=++ce;ue.set(t,D);let{dsMatches:O,revalidatingFetchers:k}=ht(T,u,a,o,e.history,M,E,m,w,r,!1,oe,se,z,fe,de,ee,c,e.patchRoutesOnNavigation!=null,s.branches,[y.route.id,C],g),A=vn(m,C.data),j=new Map(M.fetchers);j.set(t,A),k.filter(e=>
1e.key!==t).forEach(e=>{let t=e.key,n=j.get(t),r=vn(void 0,n?n.data:void 0);j.set(t,r),Be(t),e.controller&&R.set(t,e.controller)}),V({fetchers:j});let te=()=>k.forEach(e=>Be(e.key));_.signal.addEventListener(`abort`,te);let{loaderResults:F,fetcherResults:ne}=await Me(O,k,T,w,u);if(_.signal.aborted)return;_.signal.removeEventListener(`abort`,te),ue.delete(t),R.delete(t),k.forEach(e=>R.delete(e.key));let re=M.fetchers.has(t),ie=e=>{if(!re)return e;let n=new Map(e.fetchers);return n.set(t,bn(C.data)),{...e,fetchers:n}},ae=$t(F);if(ae)return M=ie(M),W(T,ae.result,!1,{preventScrollReset:p});if(ae=$t(ne),ae)return de.add(ae.key),M=ie(M),W(T,ae.result,!1,{preventScrollReset:p});let L=new Map(M.fetchers);re&&L.set(t,bn(C.data));let{loaderData:pe,errors:me}=Jt(M,E,F,void 0,k,ne,L);Ue(D,L),M.navigation.state===`loading`&&D>le?(h(N,`Expected pending action`),I&&I.abort(),xe(M.navigation.location,{matches:E,loaderData:pe,errors:me,fetchers:L})):(V({errors:me,loaderData:Yt(M.loaderData,pe,E,me),fetchers:L}),oe=!1)}async function ke(t,n,i,s,c,l,u,d,f){let p=M.fetchers.get(t);G(t,vn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Ut(e.history,i,m.signal);if(l){let e=await ot(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){K(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{K(t,n,q(404,{pathname:i}),{flushSync:u});return}}let g=mn(s,i);R.set(t,m);let _=ce,v=await je(h,i,Pt(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(R.get(t)===m&&R.delete(t),!h.signal.aborted){if(z.has(t)){G(t,bn(void 0));return}if(sn(y)){if(le>_){G(t,bn(void 0));return}de.add(t),await W(h,y,!1,{preventScrollReset:d});return}if(J(y)){K(t,n,y.error);return}G(t,bn(y.data))}}async function W(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(F?.resolve(),F=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let d=i.response.headers.get(`Location`);h(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Ht(d,p,c,e.history),qe(f,d,p,`allow-explicit`);let m=y(M.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(ge(d)){let n=C(t,d,!0);e=n.origin!==t.location.origin||B(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}I=null;let g=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:_,formAction:v,formEncType:b}=M.navigation;!o&&!s&&_&&v&&b&&(o=hn(M.navigation));let x=o||s;$e.has(i.response.status)&&x&&Y(x.formMethod)?await U(g,m,{submission:{...x,formAction:d},preventScrollReset:l||ne,enableViewTransition:a?re:void 0}):await U(g,m,{overrideNavigation:gn(m,[],g,o),fetcherSubmission:s,preventScrollReset:l||ne,enableViewTransition:a?re:void 0})}async function je(e,t,n,r,i){let a,o={};try{a=await Ft(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Y(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!M.loaderData.hasOwnProperty(e.route.id)&&(!M.errors||!M.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(on(r)){let i=r.result;o[t]={type:`redirect`,response:zt(i,e,t,n,c)}}else o[t]=await Rt(r);return o}async function Me(e,t,n,r,i){let a=je(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await je(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:q(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Ne(){oe=!0,fe.forEach((e,t)=>{R.has(t)&&se.add(t),Be(t)})}function G(e,t,n={}){let r=new Map(M.fetchers);r.set(e,t),V({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function K(e,t,n,r={}){let i=Zt(M.matches,t),a=new Map(M.fetchers);Re(a,e),V({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ie(e){return pe.set(e,(pe.get(e)||0)+1),z.has(e)&&z.delete(e),M.fetchers.get(e)||tt}function Le(e,t){Be(e,t?.reason),G(e,bn(null))}function Re(e,t){let n=M.fetchers.get(t);R.has(t)&&!(n&&n.state===`loading`&&ue.has(t))&&Be(t),fe.delete(t),ue.delete(t),de.delete(t),z.delete(t),se.delete(t),e.delete(t)}function ze(e){let t=(pe.get(e)||0)-1;t<=0?(pe.delete(e),z.add(e)):pe.set(e,t),V({fetchers:new Map(M.fetchers)})}function Be(e,t){let n=R.get(e);n&&(n.abort(t),R.delete(e))}function Ve(e,t){for(let n of e){let e=t.get(n);h(e,`Expected fetcher: ${n}`);let r=bn(e.data);t.set(n,r)}}function He(e){let t=[],n=!1;for(let r of de){let i=e.get(r);h(i,`Expected fetcher: ${r}`),i.state===`loading`&&(de.delete(r),t.push(r),n=!0)}return Ve(t,e),n}function Ue(e,t){let n=[];for(let[r,i]of ue)if(i<e){let e=t.get(r);h(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Be(r),ue.delete(r),n.push(r))}return Ve(n,t),n.length>0}function We(e,t){let n=M.blockers.get(e)||nt;return me.get(e)!==t&&me.set(e,t),n}function Ge(e){M.blockers.delete(e),me.delete(e)}function Ke(e,t){let n=M.blockers.get(e)||nt;h(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(M.blockers);r.set(e,t),V({blockers:r})}function Je({currentLocation:e,nextLocation:t,historyAction:n}){if(me.size===0)return;me.size>1&&g(!1,`A router only supports one blocker at a time`);let r=Array.from(me.entries()),[i,a]=r[r.length-1],o=M.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Ye(e){let t=q(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Qt(n);return{notFoundMatches:r,route:i,error:t}}function Xe(e,t,n){if(_=e,S=t,v=n||null,!w&&M.navigation===et){w=!0;let e=it(M.location,M.matches);e!=null&&V({restoreScrollPosition:e})}return()=>{_=null,S=null,v=null}}function Ze(e,t){return v&&v(e,t.map(e=>te(e,M.loaderData)))||e.key}function Qe(e,t){if(_&&S){let n=Ze(e,t);_[n]=S()}}function it(e,t){if(_){let n=Ze(e,t),r=_[n];if(typeof r==`number`)return r}return null}function at(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:P(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:P(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ot(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||xt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=P(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=P(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&st(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=P(s.activeRoutes,n,c,!0,u),!f||st(l,f))return{type:`success`,matches:null};l=f}}function st(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ct(e){o={},s.setHmrRoutes(j(e,a,void 0,o))}function lt(e,t,n=!1){xt(e,t,s,o,a,n),s.hasHMRRoutes||V({})}return A={get basename(){return c},get future(){return d},get state(){return M},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ve,subscribe:be,enableScrollRestoration:Xe,navigate:Se,fetch:De,revalidate:H,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ie,resetFetcher:Le,deleteFetcher:ze,dispose:ye,getBlocker:We,deleteBlocker:Ge,patchRoutes:lt,_internalFetchControllers:R,_internalSetRoutes:ct,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){V(e)}},e.instrumentations&&(A=Fe(A,e.instrumentations.map(e=>
1e.router).filter(Boolean))),A}function ft(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function pt(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=xe(r||`.`,V(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=pn(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=he({basename:n,pathname:c.pathname})),b(c)}function mt(e,t,n){if(!n||!ft(n))return{path:t};if(n.formMethod&&!fn(n.formMethod))return{path:t,error:q(405,{method:n.formMethod})};let r=()=>({path:t,error:q(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=en(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Y(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}}}if(n.formEncType===`application/json`){if(!Y(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()}}}h(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Gt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Gt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Kt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Kt(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(Y(c.formMethod))return{path:t,submission:c};let l=x(t);return e&&l.search&&pn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:b(l),submission:c}}function ht(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?J(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}
2else if(b&&J(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let ee=b?b[1].statusCode:void 0,E=ee&&ee>=400,D={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:ee},O=je(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!gt(s))f=!1;else if(u){let{shouldLoad:e}=_t(s,a.loaderData,a.errors);f=e}else vt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Nt(n,r,e,c,O,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:E?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?yt(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p},h=bt(i,m);return Nt(n,r,e,c,O,i,l,t,h,m,x)}),A=[];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,b=P(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=mn(b,e.path),C=new AbortController,w=Ut(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=Pt(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=Pt(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!E&&d;let a={...D,defaultShouldRevalidate:i};bt(S,a)&&(T=Pt(n,r,w,e.path,b,S,l,t,a))}T&&A.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:k,revalidatingFetchers:A}}function gt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function _t(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!gt(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 vt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function yt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function bt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function xt(e,t,n,r,i,a){let o;if(e){let t=r[e];h(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>St(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=j(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]=j([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})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function St(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?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>St(e,t)))??!1}var Ct=new WeakMap,wt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(h(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Ct.get(i);o||(o={},Ct.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=D(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)g(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)g(!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},Tt=new WeakMap;function Et(e,t,n,r,i){let a=n[e.id];if(h(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Tt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{h(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=k(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?g(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?g(!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 Tt.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=wt({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 Dt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>
2e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Ot(e){return e.matches.some(e=>e.route.middleware)?kt(e,()=>Dt(e)):Dt(e)}function kt(e,t){return At(e,t,e=>{if(dn(e))throw e;return e},rn,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=Zt(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 At(e,t,n,r,i){let{matches:a,...o}=e;return await jt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function jt(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 jt(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 Mt(e,t,n,r,i){let a=wt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Et(r.route,Y(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Nt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Mt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?bt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?bt(a,{...l,defaultShouldRevalidate:e}):bt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Y(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Y(n.method)||!p)?It({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Pt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Nt(e,t,n,r,je(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Mt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ft(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Wt(t,n),pattern:je(r),params:r[0].params,context:a,matches:r},c=o?()=>{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=s;return kt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function It({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Y(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Wt(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw q(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw q(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Lt(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 Rt(e){let{result:t,type:n}=e;if(ln(t)){let e;try{e=await Lt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new W(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?cn(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:nn(t),statusCode:Ae(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ae(t)?t.status:void 0}:cn(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 zt(e,t,n,r,i){let a=e.headers.get(`Location`);if(h(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!ge(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=pt(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Bt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Vt(e){try{return Bt.includes(new URL(e).protocol)}catch{return!1}}function Ht(e,t,n,r){if(ge(e)){let r=e,i=u.test(r)?new URL(d(r,t.protocol)):new URL(r);if(Vt(i.toString()))throw Error(`Invalid redirect location`);let a=B(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Se(i.pathname)+i.search+i.hash}try{if(Vt(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Ut(e,t,n,r){let i=e.createURL(en(t)).toString(),a={signal:n};if(r&&Y(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)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Gt(r.formData):r.formData}
2return new Request(i,a)}function Wt(e,t){let n=new URL(e.url),r=typeof t==`string`?x(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Gt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Kt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function qt(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&J(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(h(!sn(f),`Cannot handle redirect results in processLoaderData`),J(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Zt(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=at),c||(c=!0,s=Ae(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.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 Jt(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=qt(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 s=a[n];if(h(s,`Did not find corresponding fetcher result`),J(s)){let t=Zt(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(sn(s))h(!1,`Unhandled fetcher revalidation redirect`);else{let e=bn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Yt(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==at).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 Xt(e){return e?J(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Zt(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 Qt(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 q(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 W(e||500,o,Error(s),!0)}function $t(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(sn(r))return{key:n,result:r}}}function en(e){return b({...typeof e==`string`?x(e):e,hash:``})}function tn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function nn(e){return new W(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function rn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&an(t))}function an(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function on(e){return ln(e.result)&&Qe.has(e.result.status)}function J(e){return e.type===`error`}function sn(e){return(e&&e.type)===`redirect`}function cn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function ln(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function un(e){return Qe.has(e)}function dn(e){return ln(e)&&un(e.status)&&e.headers.has(`Location`)}function fn(e){return Ze.has(e.toUpperCase())}function Y(e){return Ye.has(e.toUpperCase())}function pn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function mn(e,t){let n=typeof t==`string`?x(t).search:t.search;if(e[e.length-1].route.index&&pn(n||``))return e[e.length-1];let r=be(e);return r[r.length-1]}function hn(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 gn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function _n(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function vn(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 yn(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 bn(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 xn(e,t){try{let n=e.sessionStorage.getItem(it);
2if(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 Sn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(it,JSON.stringify(n))}catch(e){g(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Cn(){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 wn=r.createContext(null);wn.displayName=`DataRouter`;var Tn=r.createContext(null);Tn.displayName=`DataRouterState`;var En=r.createContext(!1);function Dn(){return r.useContext(En)}var On=r.createContext({isTransitioning:!1});On.displayName=`ViewTransition`;var kn=r.createContext(new Map);kn.displayName=`Fetchers`;var An=r.createContext(null);An.displayName=`Await`;var X=r.createContext(null);X.displayName=`Navigation`;var jn=r.createContext(null);jn.displayName=`Location`;var Z=r.createContext({outlet:null,matches:[],isDataRoute:!1});Z.displayName=`Route`;var Mn=r.createContext(null);Mn.displayName=`RouteError`;var Nn=`REACT_ROUTER_ERROR`,Pn=`REDIRECT`,Fn=`ROUTE_ERROR_RESPONSE`;function In(e){if(e.startsWith(`${Nn}:${Pn}:{`))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 Ln(e){if(e.startsWith(`${Nn}:${Fn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new W(t.status,t.statusText,t.data)}catch{}}function Rn(e,{relative:t}={}){h(zn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:i}=r.useContext(X),{hash:a,pathname:o,search:s}=qn(e,{relative:t}),c=o;return n!==`/`&&(c=o===`/`?n:H([n,o])),i.createHref({pathname:c,search:s,hash:a})}function zn(){return r.useContext(jn)!=null}function Q(){return h(zn(),`useLocation() may be used only in the context of a <Router> component.`),r.useContext(jn).location}var Bn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Vn(e){r.useContext(X).static||r.useLayoutEffect(e)}function Hn(){let{isDataRoute:e}=r.useContext(Z);return e?_r():Un()}function Un(){h(zn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=r.useContext(wn),{basename:t,navigator:n}=r.useContext(X),{matches:i}=r.useContext(Z),{pathname:a}=Q(),o=JSON.stringify(V(i)),s=r.useRef(!1);return Vn(()=>{s.current=!0}),r.useCallback((r,i={})=>{if(g(s.current,Bn),!s.current)return;if(typeof r==`number`){n.go(r);return}let c=xe(r,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:H([t,c.pathname])),qe(typeof r==`string`?r:b(r),n.createHref(c),We(n),`reject`),(i.replace?n.replace:n.push)(c,i.state,i)},[t,n,o,a,e])}var Wn=r.createContext(null);function Gn(e){let t=r.useContext(Z).outlet;return r.useMemo(()=>t&&r.createElement(Wn.Provider,{value:e},t),[t,e])}function Kn(){let{matches:e}=r.useContext(Z);return e[e.length-1]?.params??{}}function qn(e,{relative:t}={}){let{matches:n}=r.useContext(Z),{pathname:i}=Q(),a=JSON.stringify(V(n));return r.useMemo(()=>xe(e,JSON.parse(a),i,t===`path`),[e,a,i,t])}function Jn(e,t,n){h(zn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:i}=r.useContext(X),{matches:a}=r.useContext(Z),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||``;yr(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 d=Q(),f;if(t){let e=typeof t==`string`?x(t):t;h(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.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(l!==`/`){let e=l.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let _=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):N(e,{pathname:m});g(u||_!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),g(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 v=tr(_&&_.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:H([l,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?l:H([l,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),a,n);return t&&v?r.createElement(jn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},v):v}function Yn(){let e=mr(),t=Ae(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 Xn=r.createElement(Yn,null),Zn=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=Ln(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:r.createElement(Z.Provider,{value:this.props.routeContext},r.createElement(Mn.Provider,{value:e,children:this.props.component}));return this.context?r.createElement($n,{error:e},t):t}};Zn.contextType=En;var Qn=new WeakMap;function $n({children:e,error:t}){let{basename:n,navigator:i}=r.useContext(X);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=In(t.digest);if(e){let a=Qn.get(t);if(a)throw a;let o=Ne(e.location,n),s=o.absoluteURL||o.to;if(qe(e.location,s,We(i),`allow-explicit`),Vt(s))throw Error(`Invalid redirect location`);if(Me&&!Qn.get(t)){if(o.isExternal||e.reloadDocument)window.location.href=s;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:e.replace}));throw Qn.set(t,n),n}}return r.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${s}`})}}return e}function er({routeContext:e,match:t,children:n}){let i=r.useContext(wn);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),r.createElement(Z.Provider,{value:e},n)}function tr(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);h(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??{},pattern:je(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||Xn,s&&(c<0&&l===0?(yr(`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(er,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:i!=null},children:t})};return i&&(n.route.ErrorBoundary||n.route.errorElement||l===0)?r.createElement(Zn,{location:i.location,revalidation:i.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:u}):g()},null)}function nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rr(e){let t=r.useContext(wn);return h(t,nr(e)),t}function ir(e){let t=r.useContext(Tn);return h(t,nr(e)),t}function ar(e){let t=r.useContext(Z);return h(t,nr(e)),t}function or(e){let t=ar(e),n=t.matches[t.matches.length-1];return h(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sr(){return or(`useRouteId`)}function cr(){let e=ir(`useNavigation`);return r.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function lr(){let e=rr(`useRevalidator`),t=ir(`useRevalidator`),n=r.useCallback(async()=>{await e.router.revalidate()},[e.router]);return r.useMemo(()=>({revalidate:n,state:t.revalidation}),[n,t.revalidation])}function ur(){let{matches:e,loaderData:t}=ir(`useMatches`);return r.useMemo(()=>e.map(e=>te(e,t)),[e,t])}function dr(){let e=ir(`useLoaderData`),t=or(`useLoaderData`);return e.loaderData[t]}function fr(e){return ir(`useRouteLoaderData`).loaderData[e]}function pr(){let e=ir(`useActionData`),t=or(`useLoaderData`);return e.actionData?e.actionData[t]:void 0}function mr(){let e=r.useContext(Mn),t=ir(`useRouteError`),n=or(`useRouteError`);return e===void 0?t.errors?.[n]:e}var hr=0;function gr(e){let{router:t,basename:n}=rr(`useBlocker`),i=ir(`useBlocker`),[a,o]=r.useState(``),s=r.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:B(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:B(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return r.useEffect(()=>{let e=String(++hr);return o(e),()=>t.deleteBlocker(e)},[t]),r.useEffect(()=>{a!==``&&t.getBlocker(a,s)},[t,a,s]),a&&i.blockers.has(a)?i.blockers.get(a):nt}function _r(){let{router:e}=rr(`useNavigate`),t=or(`useNavigate`),n=r.useRef(!1);return Vn(()=>{n.current=!0}),r.useCallback(async(r,i={})=>{g(n.current,Bn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var vr={};function yr(e,t,n){!t&&!vr[e]&&(vr[e]=!0,g(!1,n))}var br={};function xr(e,t){!e&&!br[t]&&(br[t]=!0,console.warn(t))}var Sr=r.useOptimistic,Cr=()=>void 0;function wr(e){return Sr?Sr(e):[e,Cr]}function Tr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&g(!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&&g(!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&&g(!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 Er=[`HydrateFallback`,`hydrateFallbackElement`],Dr=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 Or({router:e,flushSync:t,onError:n,useTransitions:i}){i=Dn()||i;let[a,o]=r.useState(e.state),[s,c]=wr(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??{},pattern:je(a.matches)})),a.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),s.forEach(e=>y.current.delete(e)),xr(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(xr(_==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=>kr(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 Dr)},[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=>kr(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,createURL:e.createURL,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(wn.Provider,{value:C},r.createElement(Tn.Provider,{value:s},r.createElement(kn.Provider,{value:y.current},r.createElement(On.Provider,{value:d},r.createElement(Nr,{basename:S,location:s.location,navigationType:s.historyAction,navigator:x,useTransitions:i},r.createElement(Ar,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:n})))))),null)}function kr(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 Ar=r.memo(jr);function jr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Jn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Mr(e){return Gn(e.context)}function Nr({basename:e=`/`,children:t=null,location:n,navigationType:i=`POP`,navigator:a,static:o=!1,useTransitions:s}){h(!zn(),`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,useTransitions:s,future:{}}),[c,a,o,s]);typeof n==`string`&&(n=x(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:_}=n,v=r.useMemo(()=>{let e=B(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:_},navigationType:i}},[c,u,d,f,p,m,i,_]);
4return g(v!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:r.createElement(X.Provider,{value:l},r.createElement(jn.Provider,{children:t,value:v}))}r.Component;function Pr(){return{params:Kn(),loaderData:dr(),actionData:pr(),matches:ur()}}function Fr(e){return function(){let t=Pr();return r.createElement(e,t)}}var Ir=`get`,Lr=`application/x-www-form-urlencoded`;function Rr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function zr(e){return Rr(e)&&e.tagName.toLowerCase()===`button`}function Br(e){return Rr(e)&&e.tagName.toLowerCase()===`form`}function Vr(e){return Rr(e)&&e.tagName.toLowerCase()===`input`}function Hr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ur(e,t){return e.button===0&&(!t||t===`_self`)&&!Hr(e)}function Wr(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 Gr(e,t){let n=Wr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Kr=null;function qr(){if(Kr===null)try{new FormData(document.createElement(`form`),0),Kr=!1}catch{Kr=!0}return Kr}var Jr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Yr(e){return e!=null&&!Jr.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lr}"`),null):e}function Xr(e,t){let n,r,i,a,o;if(Br(e)){let o=e.getAttribute(`action`);r=o?B(o,t):null,n=e.getAttribute(`method`)||Ir,i=Yr(e.getAttribute(`enctype`))||Lr,a=new FormData(e)}else if(zr(e)||Vr(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`)||Ir,i=Yr(e.getAttribute(`formenctype`))||Yr(o.getAttribute(`enctype`))||Lr,a=new FormData(o,e),!qr()){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(Rr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Ir,r=null,i=Lr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var Zr=-1,Qr=-2,$r=-3,ei=-4,ti=-5,ni=-6,ri=-7,ii=`B`,ai=`D`,oi=`E`,si=`M`,ci=`N`,li=`P`,ui=`R`,di=`S`,fi=`Y`,pi=`U`,mi=`Z`,hi=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function gi(){let e=new TextDecoder,t=``;return new TransformStream({transform(n,r){let i=e.decode(n,{stream:!0}),a=(t+i).split(` 5`);t=a.pop()||``;for(let e of a)r.enqueue(e)},flush(e){t&&e.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var _i=typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0;function vi(e){let{hydrated:t,values:n}=this;if(typeof e==`number`)return yi.call(this,e);if(!Array.isArray(e)||!e.length)throw SyntaxError();let r=n.length;for(let t of e)n.push(t);return t.length=n.length,yi.call(this,r)}function yi(e){let{hydrated:t,values:n,deferred:r,plugins:i}=this,a,o=[[e,e=>{a=e}]],s=[];for(;o.length>0;){let[e,a]=o.pop();switch(e){case ri:a(void 0);continue;case ti:a(null);continue;case Qr:a(NaN);continue;case ni:a(1/0);continue;case $r:a(-1/0);continue;case ei:a(-0);continue}if(t[e]){a(t[e]);continue}let c=n[e];if(!c||typeof c!=`object`){t[e]=c,a(c);continue}if(Array.isArray(c)){if(typeof c[0]==`string`){let[n,l,u]=c;switch(n){case ai:a(t[e]=new Date(l));continue;case pi:a(t[e]=new URL(l));continue;case ii:a(t[e]=BigInt(l));continue;case ui:a(t[e]=new RegExp(l,u));continue;case fi:a(t[e]=Symbol.for(l));continue;case di:let n=new Set;t[e]=n;for(let e=c.length-1;e>0;e--)o.push([c[e],e=>{n.add(e)}]);a(n);continue;case si:let d=new Map;t[e]=d;for(let e=c.length-2;e>0;e-=2){let t=[];o.push([c[e+1],e=>{t[1]=e}]),o.push([c[e],e=>{t[0]=e}]),s.push(()=>{d.set(t[0],t[1])})}a(d);continue;case ci:let f=Object.create(null);t[e]=f;for(let e of Object.keys(l).reverse()){let t=[];o.push([l[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{f[t[0]]=t[1]})}a(f);continue;case li:if(t[l])a(t[e]=t[l]);else{let n=new hi;r[l]=n,a(t[e]=n.promise)}continue;case oi:let[,p,m]=c,h=m&&_i&&ke.includes(m)&&m in _i&&typeof _i[m]==`function`?new _i[m](p):Error(p);t[e]=h,a(h);continue;case mi:a(t[e]=t[l]);continue;default:if(Array.isArray(i)){let n=[],r=c.slice(1);for(let e=0;e<r.length;e++){let t=r[e];o.push([t,t=>{n[e]=t}])}s.push(()=>{for(let r of i){let i=r(c[0],...n);if(i){a(t[e]=i.value);return}}throw SyntaxError()});continue}throw SyntaxError()}}else{let n=[];t[e]=n;for(let e=0;e<c.length;e++){let t=c[e];t!==Zr&&o.push([t,t=>{n[e]=t}])}a(n);continue}}else{let n={};t[e]=n;for(let e of Object.keys(c).reverse()){let t=[];o.push([c[e],e=>{t[1]=e}]),o.push([Number(e.slice(1)),e=>{t[0]=e}]),s.push(()=>{n[t[0]]=t[1]})}a(n);continue}}for(;s.length>0;)s.pop()();return a}
5async function bi(e,t){let{plugins:n}=t??{},r=new hi,i=e.pipeThrough(gi()).getReader(),a={values:[],hydrated:[],deferred:{},plugins:n},o=await xi.call(a,i),s=r.promise;return o.done?r.resolve():s=Si.call(a,i).then(r.resolve).catch(e=>{for(let t of Object.values(a.deferred))t.reject(e);r.reject(e)}),{done:s.then(()=>i.closed),value:o.value}}async function xi(e){let t=await e.read();if(!t.value)throw SyntaxError();let n;try{n=JSON.parse(t.value)}catch{throw SyntaxError()}return{done:t.done,value:vi.call(this,n)}}async function Si(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;let n=t.value;switch(n[0]){case li:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=vi.call(this,a);r.resolve(o);break}case oi:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=vi.call(this,a);r.reject(o);break}default:throw SyntaxError()}t=await e.read()}}async function Ci(e){let t={signal:e.signal};if(e.method!==`GET`){t.method=e.method;let n=e.headers.get(`Content-Type`);n&&/\bapplication\/json\b/.test(n)?(t.headers={"Content-Type":n},t.body=JSON.stringify(await e.json())):n&&/\btext\/plain\b/.test(n)?(t.headers={"Content-Type":n},t.body=await e.text()):t.body=n&&/\bapplication\/x-www-form-urlencoded\b/.test(n)?new URLSearchParams(await e.text()):await e.formData()}return t}var wi={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ti=/[&><\u2028\u2029]/g;function Ei(e){return e.replace(Ti,e=>wi[e])}function $(e,t){if(e===!1||e==null)throw Error(t)}var Di=Symbol(`SingleFetchRedirect`),Oi=class extends Error{},ki=new Set([100,101,204,205]);function Ai(e,t,n,r,i,a){let o=ji(e,e=>{let n=t.routes[e.route.id];return $(n,`Route not found in manifest`),{hasLoader:n.hasLoader,hasClientLoader:n.hasClientLoader}},zi,r,i,a);return async e=>e.runClientMiddleware(o)}function ji(e,t,n,r,i,a,o=()=>!0){return async s=>{let{request:c,matches:l,fetcherKey:u}=s,d=e();if(c.method!==`GET`)return Mi(s,n,i,a);let f=l.some(e=>{let{hasLoader:n,hasClientLoader:r}=t(e);return e.shouldCallHandler()&&n&&!r});return!r&&!f?Ni(s,t,n,i,a):u?Ii(s,n,i,a):Pi(s,d,t,n,r,i,a,o)}}async function Mi(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No action match found`);let a,o=await i.resolve(async o=>await o(async()=>{let{data:o,status:s}=await t(e,n,r,[i.route.id]);return a=s,Vi(o,i.route.id)}));return ln(o.result)||Ae(o.result)||cn(o.result)?{[i.route.id]:o}:{[i.route.id]:{type:o.type,result:De(o.result,a)}}}async function Ni(e,t,n,r,i){let a=e.matches.filter(e=>e.shouldCallHandler()),o={};return await Promise.all(a.map(a=>a.resolve(async s=>{try{let{hasClientLoader:c}=t(a),l=a.route.id,u=c?await s(async()=>{let{data:t}=await n(e,r,i,[l]);return Vi(t,l)}):await s();o[a.route.id]={type:`data`,result:u}}catch(e){o[a.route.id]={type:`error`,result:e}}}))),o}async function Pi(e,t,n,r,i,a,o,s=()=>!0){let c=new Set,l=!1,u=e.matches.map(()=>Hi()),d=Hi(),f={},p=Promise.all(e.matches.map(async(t,i)=>t.resolve(async p=>{u[i].resolve();let m=t.route.id,{hasLoader:h,hasClientLoader:g}=n(t),_=!t.shouldRevalidateArgs||t.shouldRevalidateArgs.actionStatus==null||t.shouldRevalidateArgs.actionStatus<400;if(!t.shouldCallHandler(_)){l||=t.shouldRevalidateArgs!=null&&h;return}if(s(t)&&g){h&&(l=!0);try{let t=await p(async()=>{let{data:t}=await r(e,a,o,[m]);return Vi(t,m)});f[m]={type:`data`,result:t}}catch(e){f[m]={type:`error`,result:e}}return}h&&c.add(m);try{let e=await p(async()=>Vi(await d.promise,m));f[m]={type:`data`,result:e}}catch(e){f[m]={type:`error`,result:e}}})));if(await Promise.all(u.map(e=>e.promise)),(!t.state.initialized&&t.state.navigation.state===`idle`||c.size===0)&&!window.__reactRouterHdrActive)d.resolve({routes:{}});else{let t=i&&l&&c.size>0?[...c.keys()]:void 0;try{let n=await r(e,a,o,t);d.resolve(n.data)}catch(e){d.reject(e)}}return await p,await Fi(d.promise,e.matches,c,f),f}async function Fi(e,t,n,r){try{let i,a=await e;if(`routes`in a){for(let e of t)if(e.route.id in a.routes){let t=a.routes[e.route.id];if(`error`in t){i=t.error,r[e.route.id]?.result??(r[e.route.id]={type:`error`,result:i});break}}}
5i!==void 0&&Array.from(n.values()).forEach(e=>{r[e].result instanceof Oi&&(r[e].result=i)})}catch{}}async function Ii(e,t,n,r){let i=e.matches.find(e=>e.shouldCallHandler());$(i,`No fetcher match found`);let a=i.route.id,o=await i.resolve(async i=>i(async()=>{let{data:i}=await t(e,n,r,[a]);return Vi(i,a)}));return{[i.route.id]:o}}function Li(e){let t=e.searchParams.getAll(`index`);e.searchParams.delete(`index`);let n=[];for(let e of t)e&&n.push(e);for(let t of n)e.searchParams.append(`index`,t);return e}function Ri(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&B(i.pathname,t)===`/`?`${U(t)}/_root.${r}`:`${U(i.pathname)}.${r}`,i}async function zi(e,t,n,r){let{request:i}=e,a=Ri(i.url,t,n,`data`);i.method===`GET`&&(a=Li(a),r&&a.searchParams.set(`_routes`,r.join(`,`)));let o=await fetch(a,await Ci(i));if(o.status>=400&&!o.headers.has(`X-Remix-Response`))throw new W(o.status,o.statusText,await o.text());if(o.status===204&&o.headers.has(`X-Remix-Redirect`))return{status:202,data:{redirect:{redirect:o.headers.get(`X-Remix-Redirect`),status:Number(o.headers.get(`X-Remix-Status`)||`302`),revalidate:o.headers.get(`X-Remix-Revalidate`)===`true`,reload:o.headers.get(`X-Remix-Reload-Document`)===`true`,replace:o.headers.get(`X-Remix-Replace`)===`true`}}};if(ki.has(o.status)){let e={};return r&&i.method!==`GET`&&(e[r[0]]={data:void 0}),{status:o.status,data:{routes:e}}}$(o.body,`No response body to decode`);try{let e=await Bi(o.body,window),t;if(i.method===`GET`){let n=e.value;t=Di in n?{redirect:n[Di]}:{routes:n}}else{let n=e.value,i=r?.[0];$(i,`No routeId found for single fetch call decoding`),t=`redirect`in n?{redirect:n}:{routes:{[i]:n}}}return{status:o.status,data:t}}catch{throw Error(`Unable to decode turbo-stream response`)}}function Bi(e,t){return bi(e,{plugins:[(e,...n)=>{if(e===`SanitizedError`){let[e,r,i]=n,a=Error;e&&ke.includes(e)&&e in t&&typeof t[e]==`function`&&(a=t[e]);let o=new a(r);return o.stack=i,{value:o}}if(e===`ErrorResponse`){let[e,t,r]=n;return{value:new W(t,r,e)}}if(e===`SingleFetchRedirect`)return{value:{[Di]:n[0]}};if(e===`SingleFetchClassInstance`)return{value:n[0]};if(e===`SingleFetchFallback`)return{value:void 0}}]})}function Vi(e,t){if(`redirect`in e){let{redirect:t,revalidate:n,reload:r,replace:i,status:a}=e.redirect;throw Oe(t,{status:a,headers:{...n?{"X-Remix-Revalidate":`yes`}:null,...r?{"X-Remix-Reload-Document":`yes`}:null,...i?{"X-Remix-Replace":`yes`}:null}})}let n=e.routes[t];if(n==null)throw new Oi(`No result found for routeId "${t}"`);if(`error`in n)throw n.error;if(`data`in n)return n.data;throw Error(`Invalid response found for routeId "${t}"`)}function Hi(){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}}async function Ui(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 Wi(e,t,n){return na(e.map(e=>{let r=t[e.route.id],i=n.routes[e.route.id];return[i&&i.css?i.css.map(e=>({rel:`stylesheet`,href:e})):[],r?.links?.()||[]]}).flat(2),$i(e,n))}function Gi(e){return e.css?e.css.map(e=>({rel:`stylesheet`,href:e})):[]}async function Ki(e){if(!e.css)return;let t=Gi(e);await Promise.all(t.map(Ji))}async function qi(e,t){if(!e.css&&!t.links||!ia())return;let n=[];if(e.css&&n.push(...Gi(e)),t.links&&n.push(...t.links()),n.length===0)return;let r=[];for(let e of n)!Yi(e)&&e.rel===`stylesheet`&&r.push({...e,rel:`preload`,as:`style`});await Promise.all(r.map(Ji))}async function Ji(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let n=document.createElement(`link`);Object.assign(n,e);function r(){document.head.contains(n)&&document.head.removeChild(n)}n.onload=()=>{r(),t()},n.onerror=()=>{r(),t()},document.head.appendChild(n)})}function Yi(e){return e!=null&&typeof e.page==`string`}function Xi(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 Zi(e,t,n){return na((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ui(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Xi).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Qi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,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)=>
5o(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 $i(e,t,{includeHydrateFallback:n}={}){return ea(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 ea(e){return[...new Set(e)]}function ta(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function na(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Yi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ta(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var ra;function ia(){if(ra!==void 0)return ra;let e=document.createElement(`link`);return ra=e.relList.supports(`preload`),e=null,ra}function aa(){let{nonce:e}=Na();return r.createElement(Za,{title:`Loading...`,renderScripts:!0},r.createElement(`script`,{nonce:e,dangerouslySetInnerHTML:{__html:` 6 console.log( 7 "ð¿ Hey developer ð. You can provide a way better UX than this " + 8 "when your app is loading JS modules and/or running \`clientLoader\` " + 9 "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " + 10 "for more information." 11 ); 12 `}}))}function oa(e){let t={};return Object.values(e).forEach(e=>{if(e){let n=e.parentId||``;t[n]||(t[n]=[]),t[n].push(e)}}),t}function sa(e,t,n){let i=ha(t),a=t.HydrateFallback&&(!n||e.id===`root`)?t.HydrateFallback:e.id===`root`?aa:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id===`root`?()=>r.createElement(Xa,{error:mr()}):void 0;return e.id===`root`&&t.Layout?{...i?{element:r.createElement(t.Layout,null,r.createElement(i,null))}:{Component:i},...o?{errorElement:r.createElement(t.Layout,null,r.createElement(o,null))}:{ErrorBoundary:o},...a?{hydrateFallbackElement:r.createElement(t.Layout,null,r.createElement(a,null))}:{HydrateFallback:a}}:{Component:i,ErrorBoundary:o,HydrateFallback:a}}function ca(e,t,n,r,i,a){return da(t,n,r,i,a,``,oa(t),e)}function la(e,t){if(e===`loader`&&!t.hasLoader||e===`action`&&!t.hasAction){let n=`You are trying to call ${e===`action`?`serverAction()`:`serverLoader()`} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new W(400,`Bad Request`,Error(n),!0)}}function ua(e,t){let n=e===`clientAction`?`a`:`an`,r=`Route "${t}" does not have ${n} ${e}, but you are trying to submit to it. To fix this, please add ${n} \`${e}\` function to the route`;throw console.error(r),new W(405,`Method Not Allowed`,Error(r),!0)}function da(e,t,r,i,a,o=``,s=oa(e),c){return(s[o]||[]).map(o=>{let l=t[o.id];function u(e){return $(typeof e==`function`,`No single fetch function available for route handler`),e()}function d(e){return o.hasLoader?u(e):Promise.resolve(null)}function f(e){if(!o.hasAction)throw ua(`action`,o.id);return u(e)}function p(e){n(()=>import(e),[])}function m(e){e.clientActionModule&&p(e.clientActionModule),e.clientLoaderModule&&p(e.clientLoaderModule)}async function h(e){let n=t[o.id],r=n?qi(o,n):Promise.resolve();try{return e()}finally{await r}}let g={id:o.id,index:o.index,path:o.path};if(l){Object.assign(g,{...g,...sa(o,l,a),middleware:l.clientMiddleware,handle:l.handle,shouldRevalidate:fa(g.path,l,o,i,c)});let e=r&&r.loaderData&&o.id in r.loaderData,t=e?r?.loaderData?.[o.id]:void 0,n=r&&r.errors&&o.id in r.errors,s=n?r?.errors?.[o.id]:void 0,u=c==null&&(l.clientLoader?.hydrate===!0||!o.hasLoader);g.loader=async({request:r,params:i,context:a,pattern:c,url:f},p)=>{let m=u;return u=!1,await h(async()=>($(l,"No `routeModule` available for critical-route loader"),l.clientLoader?l.clientLoader({request:r,params:i,context:a,pattern:c,url:f,async serverLoader(){if
12(la(`loader`,o),m){if(e)return t;if(n)throw s}return d(p)}}):d(p)))},g.loader.hydrate=ga(o.id,l.clientLoader,o.hasLoader,a),g.action=({request:e,params:t,context:n,pattern:r,url:i},s)=>h(async()=>{if($(l,"No `routeModule` available for critical-route action"),!l.clientAction){if(a)throw ua(`clientAction`,o.id);return f(s)}return l.clientAction({request:e,params:t,context:n,pattern:r,url:i,async serverAction(){return la(`action`,o),f(s)}})})}else{o.hasClientLoader||(g.loader=(e,t)=>h(()=>d(t))),o.hasClientAction||(g.action=(e,t)=>h(()=>{if(a)throw ua(`clientAction`,o.id);return f(t)}));let e;async function r(){return e||=(async()=>{(o.clientLoaderModule||o.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=ma(o,t);return m(o),await e})(),await e}g.lazy={loader:o.hasClientLoader?async()=>{let{clientLoader:e}=o.clientLoaderModule?await n(()=>import(o.clientLoaderModule),[]):await r();return $(e,"No `clientLoader` export found"),(t,n)=>e({...t,async serverLoader(){return la(`loader`,o),d(n)}})}:void 0,action:o.hasClientAction?async()=>{let e=o.clientActionModule?n(()=>import(o.clientActionModule),[]):r();m(o);let{clientAction:t}=await e;return $(t,"No `clientAction` export found"),(e,n)=>t({...e,async serverAction(){return la(`action`,o),f(n)}})}:void 0,middleware:o.hasClientMiddleware?async()=>{let{clientMiddleware:e}=o.clientMiddlewareModule?await n(()=>import(o.clientMiddlewareModule),[]):await r();return $(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await r();return fa(g.path,e,o,i,c)},handle:async()=>(await r()).handle,Component:async()=>(await r()).Component,ErrorBoundary:o.hasErrorBoundary?async()=>(await r()).ErrorBoundary:void 0}}let _=da(e,t,r,i,a,o.id,s,c);return _.length>0&&(g.children=_),g})}function fa(e,t,n,r,i){if(i)return pa(n.id,t.shouldRevalidate,i);if(!r&&n.hasLoader&&!n.hasClientLoader){let n=e?z(e)[1].map(e=>e.paramName):[],r=e=>n.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:r(t)})}return e=>r(e)}return t.shouldRevalidate}function pa(e,t,n){let r=!1;return i=>r?t?t(i):i.defaultShouldRevalidate:(r=!0,n.has(e))}async function ma(e,t){let n=Ui(e,t),r=Ki(e),i=await n;return await Promise.all([r,qi(e,i)]),{Component:ha(i),ErrorBoundary:i.ErrorBoundary,clientMiddleware:i.clientMiddleware,clientAction:i.clientAction,clientLoader:i.clientLoader,handle:i.handle,links:i.links,meta:i.meta,shouldRevalidate:i.shouldRevalidate}}function ha(e){if(e.default!=null&&(typeof e.default!=`object`||Object.keys(e.default).length!==0))return e.default}function ga(e,t,n,r){return r&&e!==`root`||t!=null&&(t.hydrate===!0||n!==!0)}var _a=new Set,va=1e3,ya=new Set;function ba(e){let t=new Set;return e.forEach(e=>{e.startsWith(`/`)||(e=`/${e}`);for(let n=1;n<e.length;n++)e[n]===`/`&&t.add(e.slice(0,n));t.add(e)}),Array.from(t)}function xa(e,t){return e.mode===`lazy`&&t===!0}function Sa({sri:e,...t},n){let r=new Set(n.state.matches.map(e=>e.route.id)),i=n.state.location.pathname.split(`/`).filter(Boolean),a=[`/`];for(i.pop();i.length>0;)a.push(`/${i.join(`/`)}`),i.pop();a.forEach(e=>{let t=P(n.routes,e,n.basename||`/`,!1,n.branches);t&&t.forEach(e=>r.add(e.route.id))});let o=[...r].reduce((e,n)=>Object.assign(e,{[n]:t.routes[n]}),{});return{...t,routes:o,sri:e?!0:void 0}}function Ca(e,t,n,r,i,a,o){if(xa(i,r))return async({path:s,patch:c,signal:l,fetcherKey:u})=>{if(ya.has(s))return;let{state:d}=e();await Da([s],u?window.location.href:b(d.navigation.location||d.location),t,n,r,a,o,i.manifestPath,c,l)}}function wa(e,t,n,i,a,o){r.useEffect(()=>{if(!xa(a,i)||window.navigator?.connection?.saveData===!0)return;function r(e){let t=e.tagName===`FORM`?e.getAttribute(`action`):e.getAttribute(`href`);if(!t)return;let n=e.tagName===`A`?e.pathname:new URL(t,window.location.origin).pathname;ya.has(n)||_a.add(n)}async function s(){document.querySelectorAll(`a[data-discover], form[data-discover]`).forEach(r);let s=Array.from(_a.keys()).filter(e=>!ya.has(e)||(_a.delete(e),!1));if(s.length!==0)try{await Da(s,null,t,n,i,o,e.basename,a.manifestPath,e.patchRoutes)}catch(e){console.error(`Failed to fetch manifest patches`,e)}}let c=ka(s,100);s();let l=new MutationObserver(()=>c());return l.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-discover`,`href`,`action`]}),()=>l.disconnect()},[i,o,t,n,e,a])}function Ta(e,t){let n=e||`/__manifest`;return t==null?n:H([t,n])}var Ea=`react-router-manifest-version`;async function Da(e,t,n,r,i,a,o,s,c,l){e=ba(e);let u=new URLSearchParams;u.set(`paths`,e.sort().join(`,`)),u.set(`version`,n.version);let d=new URL(Ta(s,o),window.location.origin);if(d.search=u.toString(),d.toString().length>7680){_a.clear();return}let f;try{let e=await fetch(d,{signal:l});if(!e.ok)throw Error(`${e.status} ${e.statusText}`);if(e.status===204&&e.headers.has(`X-Remix-Reload-Document`)){if(!t){console.warn(`Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a
12new document navigation to sync up with the latest manifest.`);return}try{if(sessionStorage.getItem(Ea)===n.version){console.error(`Unable to discover routes due to manifest version mismatch.`);return}sessionStorage.setItem(Ea,n.version)}catch{}window.location.href=t,console.warn(`Detected manifest version mismatch, reloading...`),await new Promise(()=>{})}else if(e.status>=400)throw Error(await e.text());try{sessionStorage.removeItem(Ea)}catch{}f=await e.json()}catch(e){if(l?.aborted)return;throw e}let p=new Set(Object.keys(n.routes)),m=Object.values(f).reduce((e,t)=>(t&&!p.has(t.id)&&(e[t.id]=t),e),{});Object.assign(n.routes,m),e.forEach(e=>Oa(e,ya));let h=new Set;Object.values(m).forEach(e=>{e&&(!e.parentId||!m[e.parentId])&&h.add(e.parentId)}),h.forEach(e=>c(e||null,da(m,r,null,i,a,e)))}function Oa(e,t){if(t.size>=va){let e=t.values().next().value;t.delete(e)}t.add(e)}function ka(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function Aa(){let e=r.useContext(wn);return $(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ja(){let e=r.useContext(Tn);return $(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ma=r.createContext(void 0);Ma.displayName=`FrameworkContext`;function Na(){let e=r.useContext(Ma);return $(e,`You must render this element inside a <HydratedRouter> element`),e}function Pa(e,t){let n=r.useContext(Ma),[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:Fa(c,m),onBlur:Fa(l,h),onMouseEnter:Fa(u,m),onMouseLeave:Fa(d,h),onTouchStart:Fa(f,m)}]:[o,p,{}]:[!1,p,{}]}function Fa(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ia(e,t,n){if(n&&!Ga)return[e[0]];if(t){let n=e.findIndex(e=>t[e.route.id]!==void 0);return e.slice(0,n+1)}return e}var La=`data-react-router-critical-css`;function Ra({nonce:e,crossOrigin:t}){let{isSpaMode:n,manifest:i,routeModules:a,criticalCss:o,nonce:s}=Na(),{errors:c,matches:l}=ja(),u=Ia(l,c,n),d=r.useMemo(()=>Wi(u,a,i),[u,a,i]);return e==null&&s&&(e=s),r.createElement(r.Fragment,null,typeof o==`string`?r.createElement(`style`,{[La]:``,nonce:e,dangerouslySetInnerHTML:{__html:o}}):null,typeof o==`object`?r.createElement(`link`,{[La]:``,rel:`stylesheet`,href:o.href,nonce:e,crossOrigin:t}):null,d.map(({key:n,link:i})=>Yi(i)?r.createElement(za,{key:n,nonce:e,...i,crossOrigin:i.crossOrigin??t}):r.createElement(`link`,{key:n,nonce:e,...i,crossOrigin:i.crossOrigin??t})))}function za({page:e,...t}){let n=Dn(),{nonce:i}=Na(),{router:a}=Aa(),o=r.useMemo(()=>N(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?(t.nonce==null&&i&&(t={...t,nonce:i}),n?r.createElement(Va,{page:e,matches:o,...t}):r.createElement(Ha,{page:e,matches:o,...t})):null}function Ba(e){let{manifest:t,routeModules:n}=Na(),[i,a]=r.useState([]);return r.useEffect(()=>{let r=!1;return Zi(e,t,n).then(e=>{r||a(e)}),()=>{r=!0}},[e,t,n]),i}function Va({page:e,matches:t,...n}){let i=Q(),{future:a}=Na(),{basename:o}=Aa(),s=r.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let n=Ri(e,o,a.v8_trailingSlashAwareDataRequests,`rsc`),r=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?r=!0:s.push(e.route.id);return r&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[o,a.v8_trailingSlashAwareDataRequests,e,i,t]);return r.createElement(r.Fragment,null,s.map(e=>r.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ha({page:e,matches:t,...n}){let i=Q(),{future:a,manifest:o,routeModules:s}=Na(),{basename:c}=Aa(),{loaderData:l,matches:u}=ja(),d=r.useMemo(()=>Qi(e,t,u,o,i,`data`),[e,t,u,o,i]),f=r.useMemo(()=>Qi(e,t,u,o,i,`assets`),[e,t,u,o,i]),p=r.useMemo(()=>
12{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=Ri(e,c,a.v8_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.v8_trailingSlashAwareDataRequests,l,i,o,d,t,e,s]),m=r.useMemo(()=>$i(f,o),[f,o]),h=Ba(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 Ua(){let{isSpaMode:e,routeModules:t}=Na(),{errors:n,matches:i,loaderData:a}=ja(),o=Q(),s=Ia(i,n,e),c=null;n&&(c=n[s[s.length-1].route.id]);let l=[],u=null,d=[];for(let e=0;e<s.length;e++){let n=s[e],r=n.route.id,i=a[r],f=n.params,p=t[r],m=[],h={id:r,data:i,loaderData:i,meta:[],params:n.params,pathname:n.pathname,handle:n.route.handle,error:c};if(d[e]=h,p?.meta?m=typeof p.meta==`function`?p.meta({data:i,loaderData:i,params:f,location:o,matches:d,error:c}):Array.isArray(p.meta)?[...p.meta]:p.meta:u&&(m=[...u]),m||=[],!Array.isArray(m))throw Error(`The route at `+n.route.path+` returns an invalid value. All route meta functions must return an array of meta objects. 13 14To reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta`);h.meta=m,d[e]=h,l=[...m],u=l}return r.createElement(r.Fragment,null,l.flat().map(e=>{if(!e)return null;if(`tagName`in e){let{tagName:t,...n}=e;if(!Wa(t))return console.warn(`A meta object uses an invalid tagName: ${t}. Expected either 'link' or 'meta'`),null;let i=t;return r.createElement(i,{key:JSON.stringify(n),...n})}if(`title`in e)return r.createElement(`title`,{key:`title`},String(e.title));if(`charset`in e&&(e.charSet??=e.charset,delete e.charset),`charSet`in e&&e.charSet!=null)return typeof e.charSet==`string`?r.createElement(`meta`,{key:`charSet`,charSet:e.charSet}):null;if(`script:ld+json`in e)try{let t=JSON.stringify(e[`script:ld+json`]);return r.createElement(`script`,{key:`script:ld+json:${t}`,type:`application/ld+json`,dangerouslySetInnerHTML:{__html:Ei(t)}})}catch{return null}return r.createElement(`meta`,{key:JSON.stringify(e),...e})}))}function Wa(e){return typeof e==`string`&&/^(meta|link)$/.test(e)}var Ga=!1;function Ka(){Ga=!0}function qa(e){let{manifest:t,serverHandoffString:n,isSpaMode:i,renderMeta:a,routeDiscovery:o,ssr:s,nonce:c}=Na(),{router:l,static:u,staticContext:d}=Aa(),{matches:f}=ja(),p=Dn(),m=xa(o,s);e.nonce==null&&c&&(e={...e,nonce:c}),a&&(a.didRenderScripts=!0);let h=Ia(f,null,i);r.useEffect(()=>{Ka()},[]);let g=r.useMemo(()=>{if(p)return null;let i=d?`window.__reactRouterContext = ${n};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:` `,a=u?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:``}${m?``:`import ${JSON.stringify(t.url)}`}; 15${h.map((e,n)=>{let r=`route${n}`,i=t.routes[e.route.id];$(i,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:o,clientMiddlewareModule:s,hydrateFallbackModule:c,module:l}=i,u=[...a?[{module:a,varName:`${r}_clientAction`}]:[],...o?[{module:o,varName:`${r}_clientLoader`}]:[],...s?[{module:s,varName:`${r}_clientMiddleware`}]:[],...c?[{module:c,varName:`${r}_HydrateFallback`}]:[],{module:l,varName:`${r}_main`}];return u.length===1?`import * as ${r} from ${JSON.stringify(l)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join(` 16`),`const ${r} = {${u.map(e=>`...${e.varName}`).join(`,`)}};`].join(` 17`)}).join(` 18`)} 19 ${m?`window.__reactRouterManifest = ${JSON.stringify(Sa(t,l),null,2)};`:``} 20 window.__reactRouterRouteModules = {${h.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(`,`)}}; 21 22import(${JSON.stringify(t.entry.module)});`:` `;return r.createElement(r.Fragment,null,r.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:i},type:void 0}),r.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:`module`,async:!0}))},[]),_=Ga||p?[]:[...new Set(t.entry.imports.concat($i(h,t,{includeHydrateFallback:!0})))],v=typeof t.sri==`object`?t.sri:{};return xr(!p,`The <Scripts /> element is a no-op when using RSC and can be safely removed.`),Ga||p?null:r.createElement(r.Fragment,null,typeof t.sri==`object`?r.createElement(`script`,{...e,"rr-importmap":``,type:`importmap`,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:v})}}):null,m?null:r.createElement(`link`,{rel:`modulepreload`,href:t.url,crossOrigin:e.crossOrigin,integrity:v[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),r.createElement(`link`,{rel:`modulepreload`,href:t.entry.module,crossOrigin:e.crossOrigin,integrity:v[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),_.map(t=>r.createElement(`link`,{key:t,rel:`modulepreload`,href:t,crossOrigin:e.crossOrigin,integrity:v[t],nonce:e.nonce,suppressHydrationWarning:!0})),g)}function Ja(...e){return t=>
22{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Ya=class extends r.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location===e.location?{error:e.error||t.error,location:t.location}:{error:e.error||null,location:e.location}}render(){return this.state.error?r.createElement(Xa,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Xa({error:e,isOutsideRemixApp:t}){let{nonce:n}=Na();console.error(e);let i=r.createElement(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:` 23 console.log( 24 "ð¿ Hey developer ð. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information." 25 ); 26 `}});if(Ae(e))return r.createElement(Za,{title:`Unhandled Thrown Response!`},r.createElement(`h1`,{style:{fontSize:`24px`}},e.status,` `,e.statusText),i);let a;if(e instanceof Error)a=e;else{let t=e==null?`Unknown Error`:typeof e==`object`&&`toString`in e?e.toString():JSON.stringify(e);a=Error(t)}return r.createElement(Za,{title:`Application Error!`,isOutsideRemixApp:t},r.createElement(`h1`,{style:{fontSize:`24px`}},`Application Error`),r.createElement(`pre`,{style:{padding:`2rem`,background:`hsla(10, 50%, 50%, 0.1)`,color:`red`,overflow:`auto`}},a.stack),i)}function Za({title:e,renderScripts:t,isOutsideRemixApp:n,children:i}){let{routeModules:a}=Na();return a.root?.Layout&&!n?i:r.createElement(`html`,{lang:`en`},r.createElement(`head`,null,r.createElement(`meta`,{charSet:`utf-8`}),r.createElement(`meta`,{name:`viewport`,content:`width=device-width,initial-scale=1,viewport-fit=cover`}),r.createElement(`title`,null,e)),r.createElement(`body`,null,r.createElement(`main`,{style:{fontFamily:`system-ui, sans-serif`,padding:`2rem`}},i,t?r.createElement(qa,null):null)))}var Qa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Qa&&(window.__reactRouterVersion=`7.18.4`)}catch{}var $a=r.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:i,reloadDocument:a,replace:o,mask:s,state:c,target:u,to:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g){let{basename:_,navigator:v,useTransitions:y}=r.useContext(X),b=typeof d==`string`&&l.test(d),x=Ne(d,_);d=x.to;let S=Rn(d,{relative:i}),C=Q(),w=null;if(s){let e=xe(s,[],C.mask?C.mask.pathname:`/`,!0);_!==`/`&&(e.pathname=e.pathname===`/`?_:H([_,e.pathname])),w=v.createHref(e)}let[T,ee,E]=Pa(n,h),D=oo(d,{replace:o,mask:s,state:c,target:u,preventScrollReset:f,relative:i,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(x.isExternal||a),A=r.createElement(`a`,{...h,...E,href:(k?w:void 0)||x.absoluteURL||S,onClick:k?O:e,ref:Ja(g,ee),target:u,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?r.createElement(r.Fragment,null,A,r.createElement(za,{page:S})):A});$a.displayName=`Link`;var eo=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=qn(o,{relative:l.relative}),f=Q(),p=r.useContext(Tn),{navigator:m,basename:h}=r.useContext(X),g=p!=null&&yo(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(Boolean).join(` `);let ee=typeof a==`function`?a(C):a;return r.createElement($a,{...l,"aria-current":w,className:T,ref:u,style:ee,to:o,viewTransition:s},typeof c==`function`?c(C):c)});eo.displayName=`NavLink`;var to=r.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:i,replace:a,state:o,method:s=Ir,action:c,onSubmit:u,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m,...h},g)=>{let{useTransitions:_}=r.useContext(X),v=uo(),y=fo(c,{relative:d}),b=s.toLowerCase()===`get`?`get`:`post`,x=typeof c==`string`&&l.test(c);return r.createElement(`form`,{ref:g,method:b,action:y,onSubmit:i?u:e=>{if(u&&u(e),e.defaultPrevented)return;e.preventDefault();let i=e.nativeEvent.submitter,c=i?.getAttribute(`formmethod`)||s,l=()=>v(i||e.currentTarget,{fetcherKey:t,method:c,navigate:n,replace:a,state:o,relative:d,preventScrollReset:f,viewTransition:p,defaultShouldRevalidate:m});_&&n!==!1?r.startTransition(()=>l()):l()},...h,"data-discover":!x&&e===`render`?`true`:void 0})});to.displayName=`Form`;function no({getKey:e,storageKey:t,...n}){let i=r.useContext(Ma),{basename:a}=r.useContext(X),o=Q(),s=ur();_o({getKey:e,storageKey:t});let c=r.useMemo(()=>
26{if(!i||!e)return null;let t=go(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];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&i?.nonce&&(n.nonce=i.nonce),r.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${Ei(JSON.stringify(t||mo))}, ${Ei(JSON.stringify(c))})`}})}no.displayName=`ScrollRestoration`;function ro(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function io(e){let t=r.useContext(wn);return h(t,ro(e)),t}function ao(e){let t=r.useContext(Tn);return h(t,ro(e)),t}function oo(e,{target:t,replace:n,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l,useTransitions:u}={}){let d=Hn(),f=Q(),p=qn(e,{relative:s});return r.useCallback(m=>{if(Ur(m,t)){m.preventDefault();let t=n===void 0?b(f)===b(p):n,h=()=>d(e,{replace:t,mask:i,state:a,preventScrollReset:o,relative:s,viewTransition:c,defaultShouldRevalidate:l});u?r.startTransition(()=>h()):h()}},[f,d,p,n,i,a,t,e,o,s,c,l,u])}function so(e){g(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(Wr(e)),n=r.useRef(!1),i=Q(),a=r.useMemo(()=>Gr(i.search,n.current?null:t.current),[i.search]),o=Hn();return[a,r.useCallback((e,t)=>{let r=Wr(typeof e==`function`?e(new URLSearchParams(a)):e);n.current=!0,o(`?`+r,t)},[o,a])]}var co=0,lo=()=>`__${String(++co)}__`;function uo(){let{router:e}=io(`useSubmit`),{basename:t}=r.useContext(X),n=sr(),i=e.fetch,a=e.navigate;return r.useCallback(async(e,r={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Xr(e,t);if(r.navigate===!1){let e=r.fetcherKey||lo();await i(e,n,r.action||o,{defaultShouldRevalidate:r.defaultShouldRevalidate,preventScrollReset:r.preventScrollReset,formData:l,body:u,formMethod:r.method||s,formEncType:r.encType||c,flushSync:r.flushSync})}else await a(r.action||o,{defaultShouldRevalidate:r.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 fo(e,{relative:t}={}){let{basename:n}=r.useContext(X),i=r.useContext(Z);h(i,`useFormAction must be used inside a RouteContext`);let[a]=i.matches.slice(-1),o={...qn(e||`.`,{relative:t})},s=Q();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:H([n,o.pathname])),b(o)}function po({key:e}={}){let{router:t}=io(`useFetcher`),n=ao(`useFetcher`),i=r.useContext(kn),a=r.useContext(Z),o=a.matches[a.matches.length-1]?.route.id;h(i,`useFetcher must be used inside a FetchersContext`),h(a,`useFetcher must be used inside a RouteContext`),h(o!=null,`useFetcher can only be used on routes that contain a unique "id"`);let s=r.useId(),[c,l]=r.useState(e||s);e&&e!==c&&l(e);let{deleteFetcher:u,getFetcher:d,resetFetcher:f,fetch:p}=t;r.useEffect(()=>(d(c),()=>u(c)),[u,d,c]);let m=r.useCallback(async(e,t)=>{h(o,`No routeId available for fetcher.load()`),await p(c,o,e,t)},[c,o,p]),g=uo(),_=r.useCallback(async(e,t)=>{await g(e,{...t,navigate:!1,fetcherKey:c})},[c,g]),v=r.useCallback(e=>f(c,e),[f,c]),y=r.useMemo(()=>{let e=r.forwardRef((e,t)=>r.createElement(to,{...e,navigate:!1,fetcherKey:c,ref:t}));return e.displayName=`fetcher.Form`,e},[c]),b=n.fetchers.get(c)||tt,x=i.get(c);return r.useMemo(()=>({Form:y,submit:_,load:m,reset:v,...b,data:x}),[y,_,m,v,b,x])}var mo=`react-router-scroll-positions`,ho={};function go(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 _o({getKey:e,storageKey:t}={}){let{router:n}=io(`useScrollRestoration`),{restoreScrollPosition:i,preventScrollReset:a}=ao(`useScrollRestoration`),{basename:o}=r.useContext(X),s=Q(),c=ur(),l=cr();r.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),vo(r.useCallback(()=>
26{if(l.state===`idle`){let t=go(s,c,o,e);ho[t]=window.scrollY}try{sessionStorage.setItem(t||mo,JSON.stringify(ho))}catch(e){g(!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||mo);e&&(ho=JSON.parse(e))}catch{}},[t]),r.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(ho,()=>window.scrollY,e?(t,n)=>go(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{g(!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 vo(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 yo(e,{relative:t}={}){let n=r.useContext(On);h(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=io(`useViewTransitionState`),a=qn(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 fe(a.pathname,s)!=null||fe(a.pathname,o)!=null}export{Q as A,Tr as C,po as D,gr as E,mr as F,fr as I,so as L,cr as M,Kn as N,wa as O,lr as P,Fr as R,Ae as S,ga as T,Bi as _,U
26a as a,Er as b,Ya as c,no as d,m as f,dt as g,w as h,Ra as i,Hn as j,dr as k,Or as l,ca as m,Ma as n,ki as o,da as p,$a as r,Mr as s,to as t,qa as u,Ca as v,N as w,h as x,Ai as y};
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.