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