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