PageSourceSearch

https://contentmarketinginstitute.com/assets/vendor-react-router-C-6Wf3r1.js

js contentmarketinginstitute.com collected 2026-09-24 06:56:33 UTC 121,466 bytes, 15 lines download raw bytes

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

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.