PageSourceSearch

https://kvarterskliniken.se/assets/router-Cd1GfZ4p.js

js kvarterskliniken.se collected 2026-10-07 20:45:12 UTC 84,399 bytes, 4 lines download raw bytes

1import{r as Fa,g as Ur}from"./react-CUBIzhyw.js";import{r as Oa}from"./reactDom-DF4oupHq.js";function za(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(a,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var h=Fa();const $a=Ur(h),ri=za({__proto__:null,default:$a},[h]);var jr=e=>{throw TypeError(e)},ka=(e,t,r)=>t.has(e)||jr("Cannot "+r),Tt=(e,t,r)=>(ka(e,t,"read from private field"),r?r.call(e):t.get(e)),Na=(e,t,r)=>t.has(e)?jr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),fr="popstate";function Ua(e={}){function t(a,n){let{pathname:o,search:i,hash:s}=a.location;return et("",{pathname:o,search:i,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:ge(n)}return Ia(t,r,null,e)}function k(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function K(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ja(){return Math.random().toString(36).substring(2,10)}function hr(e,t){return{usr:e.state,key:e.key,idx:t}}function et(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?De(t):t,state:r,key:t&&t.key||a||ja()}}function ge({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 De(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 Ia(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,s="POP",c=null,l=p();l==null&&(l=0,i.replaceState({...i.state,idx:l},""));function p(){return(i.state||{idx:null}).idx}function f(){s="POP";let x=p(),C=x==null?null:x-l;l=x,c&&c({action:s,location:S.location,delta:C})}function g(x,C){s="PUSH";let E=et(S.location,x,C);l=p()+1;let z=hr(E,l),q=S.createHref(E);try{i.pushState(z,"",q)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;n.location.assign(q)}o&&c&&c({action:s,location:S.location,delta:1})}function v(x,C){s="REPLACE";let E=et(S.location,x,C);l=p();let z=hr(E,l),q=S.createHref(E);i.replaceState(z,"",q),o&&c&&c({action:s,location:S.location,delta:0})}function b(x){return Ir(x)}let S={get action(){return s},get location(){return e(n,i)}
1,listen(x){if(c)throw new Error("A history only accepts one active listener");return n.addEventListener(fr,f),c=x,()=>{n.removeEventListener(fr,f),c=null}},createHref(x){return t(n,x)},createURL:b,encodeLocation(x){let C=b(x);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:g,replace:v,go(x){return i.go(x)}};return S}function Ir(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),k(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ge(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var Qe,mr=class{constructor(e){if(Na(this,Qe,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Tt(this,Qe).has(e))return Tt(this,Qe).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Tt(this,Qe).set(e,t)}};Qe=new WeakMap;var Aa=new Set(["lazy","caseSensitive","path","id","index","children"]);function _a(e){return Aa.has(e)}var Ha=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Ba(e){return Ha.has(e)}function Wa(e){return e.index===!0}function tt(e,t,r=[],a={},n=!1){return e.map((o,i)=>{let s=[...r,String(i)],c=typeof o.id=="string"?o.id:s.join("-");if(k(o.index!==!0||!o.children,"Cannot specify children on an index route"),k(n||!a[c],`Found a route id collision on i
1d "${c}".  Route id's must be globally unique within Data Router usages`),Wa(o)){let l={...o,id:c};return a[c]=pr(l,t(l)),l}else{let l={...o,id:c,children:void 0};return a[c]=pr(l,t(l)),o.children&&(l.children=tt(o.children,t,s,a,n)),l}})}function pr(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ce(e,t,r="/"){return Ze(e,t,r,!1)}function Ze(e,t,r,a){let n=typeof t=="string"?De(t):t,o=ie(n.pathname||"/",r);if(o==null)return null;let i=_r(e);Va(i);let s=null;for(let c=0;s==null&&c<i.length;++c){let l=rn(o);s=en(i[c],l,a)}return s}function Ar(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 _r(e,t=[],r=[],a="",n=!1){let o=(i,s,c=n,l)=>{let p={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(a)&&c)return;k(p.relativePath.startsWith(a),`Absolute route path "${p.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(a.length)}let f=ve([a,p.relativePath]),g=r.concat(p);i.children&&i.children.length>0&&(k(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),_r(i.children,t,g,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:Qa(f,i.index),routesMeta:g})};return e.forEach((i,s)=>{if(i.path===""||!i.path?.includes("?"))o(i,s);else for(let c of Hr(i.path))o(i,s,!0,c)}),t}function Hr(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=Hr(a.join("/")),s=[];return s.push(...i.map(c=>c===""?o:[o,c].join("/"))),n&&s.push(...i),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function Va(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Za(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Ya=/^:[\w-]+$/,Ja=3,Ka=2,Ga=1,Xa=10,qa=-2,yr=e=>e==="*";function Qa(e,t){let r=e.split("/"),a=r.length;return r.some(yr)&&(a+=qa),t&&(a+=Ka),r.filter(n=>!yr(n)).reduce((n,o)=>n+(Ya.test(o)?Ja:o===""?Ga:Xa),a)}function Za(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 en(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let s=0;s<a.length;++s){let c=a[s],l=s===a.length-1,p=o==="/"?t:t.slice(o.length)||"/",f=wt({path:c.relativePath,caseSensitive:c.caseSensitive,end:l},p),g=c.route;if(!f&&l&&r&&!a[a.length-1].route.index&&(f=wt({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},p)),!f)return null;
1Object.assign(n,f.params),i.push({params:n,pathname:ve([o,f.pathname]),pathnameBase:ln(ve([o,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(o=ve([o,f.pathnameBase]))}return i}function wt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=tn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:a.reduce((l,{paramName:p,isOptional:f},g)=>{if(p==="*"){let b=s[g]||"";i=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const v=s[g];return f&&!v?l[p]=void 0:l[p]=(v||"").replace(/%2F/g,"/"),l},{}),pathname:o,pathnameBase:i,pattern:e}}function tn(e,t=!1,r=!0){K(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,s,c)=>(a.push({paramName:s,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).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 rn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return K(!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 ie(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 an({basename:e,pathname:t}){return t==="/"?e:ve([e,t])}var nn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Et=e=>nn.test(e);function on(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?De(e):e,o;if(r)if(Et(r))o=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),K(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${r}`)}r.startsWith("/")?o=vr(r.substring(1),"/"):o=vr(r,t)}else o=t;return{pathname:o,search:sn(a),hash:un(n)}}function vr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function Ft(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 Br(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _t(e){let t=Br(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Ht(e,t,r,a=!1){let n;typeof e=="string"?n=De(e):(n={...e},k(!n.pathname||!n.pathname.includes("?"),Ft("?","pathname","search",n)),k(!n.pathname||!n.pathname.includes("#"),Ft("#","pathname","hash",n)),k(!n.search||!n.search.includes("#"),Ft("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,s;if(i==null)s=r;else{let f=t.length-1;if(!a&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),f-=1;n.pathname=g.join("/")}s=f>=0?t[f]:"/"}let c=on(n,s),l=i&&i!=="/"&&i.endsWith("/"),p=(o||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(l||p)&&(c.pathname+="/"),c}var ve=e=>e.join("/").replace(/\/\/+/g,"/"),ln=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,un=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ai=(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})},bt=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 rt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Bt(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Me=Symbol("Uninstrumented");function cn(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 s of i)o[s]&&r[s].push(o[s])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=He(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],s=r[`lazy.${o}`];if(typeof i=="function"&&s.length>0){let c=He(s,i,()=>{});c&&(a.lazy=Object.assign(a.lazy||{},{[o]:c}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let i=o[Me]??o,s=He(r[n],i,(...c)=>gr(c[0]));s&&(s[Me]=i,a[n]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[Me]??n,i=He(r.middleware,o,(...s)=>gr(s[0]));return i?(i[Me]=o,i):n})),a}function dn(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[Me]??e.navigate,n=He(r.navigate,a,(...o)=>{let[i,s]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?ge(i):".",...wr(e,s??{})}});n&&(n[Me]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[Me]??e.fetch,n=He(r.fetch,a,(...o)=>{let[i,,s,c]=o;return{href:s??".",fetcherKey:i,...wr(e,c??{})}});n&&(n[Me]=a,e.fetch=n)}return e}function He(e,t,r){return e.length===0?null:async(...a)=>{let n=await Wr(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function Wr(e,t,r,a){let n=e[a],o;if(n){let i,s=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Wr(e,t,r,a-1),o=await i,k(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(s,t)}catch(c){console.error("An instrumentation function threw an error:",c)}i||await s(),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 gr(e){let{request:t,context:r,params:a,unstable_pattern:n}=e;return{request:fn(t),params:{...a},unstable_pattern:n,context:hn(r)}}function wr(e,t){return{currentUrl:ge(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 fn(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function hn(e){if(pn(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var mn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function pn(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")===mn}var Vr=["POST","PUT","PATCH","DELETE"],yn=new Set(Vr),vn=["GET",...Vr],gn=new Set(vn),wn=new Set([301,302,303,307,308]),bn=new Set([307,308]),Ot={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ge={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},En=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Yr="remix-router-transitions",Jr=Symbol("ResetLoaderData");function xn(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";k(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||En,o=n;if(e.unstable_instrumentations){let u=e.unstable_instrumentations;o=d=>({...n(d),...cn(u.map(m=>
1m.route).filter(Boolean),d)})}let i={},s=tt(e.routes,o,void 0,i),c,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let p=e.dataStrategy||Mn,f={...e.future},g=null,v=new Set,b=null,S=null,x=null,C=e.hydrationData!=null,E=Ce(s,e.history.location,l),z=!1,q=null,$;if(E==null&&!e.patchRoutesOnNavigation){let u=ce(404,{pathname:e.history.location.pathname}),{matches:d,route:m}=ft(s);$=!0,E=d,q={[m.id]:u}}else if(E&&!e.hydrationData&&lt(E,s,e.history.location.pathname).active&&(E=null),E)if(E.some(u=>u.route.lazy))$=!1;else if(!E.some(u=>Wt(u.route)))$=!0;else{let u=e.hydrationData?e.hydrationData.loaderData:null,d=e.hydrationData?e.hydrationData.errors:null;if(d){let m=E.findIndex(w=>d[w.route.id]!==void 0);$=E.slice(0,m+1).every(w=>!Nt(w.route,u,d))}else $=E.every(m=>!Nt(m.route,u,d))}else{$=!1,E=[];let u=lt(null,s,e.history.location.pathname);u.active&&u.matches&&(z=!0,E=u.matches)}let H,y={historyAction:e.history.action,location:e.history.location,matches:E,initialized:$,navigation:Ot,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||q,fetchers:new Map,blockers:new Map},I="POP",Y=!1,N,re=!1,Se=new Map,Te=null,_=!1,J=!1,le=new Set,A=new Map,se=0,ae=-1,fe=new Map,ne=new Set,ue=new Map,me=new Map,pe=new Set,Fe=new Map,ot,Ve=null;function ha(){if(g=e.history.listen(({action:u,location:d,delta:m})=>{if(ot){ot(),ot=void 0;return}K(Fe.size===0||m!=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 w=lr({currentLocation:y.location,nextLocation:d,historyAction:u});if(w&&m!=null){let R=new Promise(L=>{ot=L});e.history.go(m*-1),it(w,{state:"blocked",location:d,proceed(){it(w,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),R.then(()=>e.history.go(m))},reset(){let L=new Map(y.blockers);L.set(w,Ge),Z({blockers:L})}});return}return Oe(u,d)}),r){Bn(t,Se);let u=()=>Wn(t,Se);t.addEventListener("pagehide",u),Te=()=>t.removeEventListener("pagehide",u)}return y.initialized||Oe("POP",y.location,{initialHydration:!0}),H}function ma(){g&&g(),Te&&Te(),v.clear(),N&&N.abort(),y.fetchers.forEach((u,d)=>Lt(d)),y.blockers.forEach((u,d)=>ir(d))}function pa(u){return v.add(u),()=>v.delete(u)}function Z(u,d={}){u.matches&&(u.matches=u.matches.map(R=>{let L=i[R.route.id],M=R.route;return M.element!==L.element||M.errorElement!==L.errorElement||M.hydrateFallbackElement!==L.hydrateFallbackElement?{...R,route:L}:R})),y={...y,...u};let m=[],w=[];y.fetchers.forEach((R,L)=>{R.state==="idle"&&(pe.has(L)?m.push(L):w.push(L))}),pe.forEach(R=>{!y.fetchers.has(R)&&!A.has(R)&&m.push(R)}),[...v].forEach(R=>R(y,{deletedFetchers:m,viewTransitionOpts:d.viewTransitionOpts,flushSync:d.flushSync===!0})),m.forEach(R=>Lt(R)),w.forEach(R=>y.fetchers.delete(R))}function Ie(u,d,{flushSync:m}={}){let w=y.actionData!=null&&y.navigation.formMethod!=null&&te(y.navigation.formMethod)&&y.navigation.state==="loading"&&u.state?._isRedirect!==!0,R;d.actionData?Object.keys(d.actionData).length>0?R=d.actionData:R=null:w?R=y.actionData:R=null;let L=d.loaderData?Dr(y.loaderData,d.loaderData,d.matches||[],d.errors):y.loaderData,M=y.blockers;M.size>0&&(M=new Map(M),M.forEach((T,F)=>M.set(F,Ge)));let P=_?!1:ur(u,d.matches||y.matches),D=Y===!0||y.navigation.formMethod!=null&&te(y.navigation.formMethod)&&u.state?._isRedirect!==!0;c&&(s=c,c=void 0),_||I==="POP"||(I==="PUSH"?e.history.push(u,u.state):I==="REPLACE"&&e.history.replace(u,u.state));let O;if(I==="POP"){let T=Se.get(y.location.pathname);T&&T.has(u.pathname)?O={currentLocation:y.location,nextLocation:u}:Se.has(u.pathname)&&(O={currentLocation:u,nextLocation:y.location})}else if(re){let T=Se.get(y.location.pathname);T?T.add(u.pathname):(T=new Set([u.pathname]),Se.set(y.location.pathname,T)),O={currentLocation:y.location,nextLocation:u}}Z({...d,actionData:R,loaderData:L,historyAction:I,location:u,initialized:!0,navigation:Ot,revalidation:"idle",restoreScrollPosition:P,preventScrollReset:D,blockers:M},{viewTransitionOpts:O,flushSync:m===!0}),I="POP",Y=!1,re=!1,_=!1,J=!1,Ve?.resolve(),Ve=null}async function Zt(u,d){if(typeof u=="number"){e.history.go(u);return}let m=kt(y.location,y.matches,l,u,d?.fromRouteId,d?.relative),{path:w,submission:R,error:L}=br(!1,m,d),M=y.location,P=et(y.location,w,d&&d.state);P={...P,...e.history.encodeLocation(P)};let D=d&&d.replace!=null?d.replace:void 0,O="PUSH";D===!0?O="REPLACE":D===!1||R!=null&&te(R.formMethod)&&R.formAction===y.location.pathname+y.location.search&&(O="REPLACE");let T=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,F=(d&&d.flushSync)===!0,U=lr({currentLocation:M,nextLocation:P,historyAction:O});if(U){it(U,{state:"blocked",location:P,proceed(){it(U,{state:"proceeding",proceed:void 0,reset:void 0,location:P}),Zt(u,d)},reset(){let V=new Map(y.blockers);V.set(U,Ge),Z({blockers:V})}});return}await Oe(O,P,{submission:R,pendingError:L,preventScrollReset:T,replace:d&&d.replace,enableViewTransition:d&&d.viewTransition,flushSync:F})}function ya(){Ve||(Ve=Vn()),Ct(),Z({revalidation:"loading"});let u=Ve.promise;return y.navigation.state==="submitting"?u:y.navigation.state==="idle"?(Oe(y.historyAction,y.location,{startUninterruptedRevalidation:!0}
1),u):(Oe(I||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:re===!0}),u)}async function Oe(u,d,m){N&&N.abort(),N=null,I=u,_=(m&&m.startUninterruptedRevalidation)===!0,La(y.location,y.matches),Y=(m&&m.preventScrollReset)===!0,re=(m&&m.enableViewTransition)===!0;let w=c||s,R=m&&m.overrideNavigation,L=m?.initialHydration&&y.matches&&y.matches.length>0&&!z?y.matches:Ce(w,d,l),M=(m&&m.flushSync)===!0;if(L&&y.initialized&&!J&&Nn(y.location,d)&&!(m&&m.submission&&te(m.submission.formMethod))){Ie(d,{matches:L},{flushSync:M});return}let P=lt(L,w,d.pathname);if(P.active&&P.matches&&(L=P.matches),!L){let{error:Q,notFoundMatches:B,route:W}=Mt(d.pathname);Ie(d,{matches:B,loaderData:{},errors:{[W.id]:Q}},{flushSync:M});return}N=new AbortController;let D=_e(e.history,d,N.signal,m&&m.submission),O=e.getContext?await e.getContext():new mr,T;if(m&&m.pendingError)T=[Le(L).route.id,{type:"error",error:m.pendingError}];else if(m&&m.submission&&te(m.submission.formMethod)){let Q=await va(D,d,m.submission,L,O,P.active,m&&m.initialHydration===!0,{replace:m.replace,flushSync:M});if(Q.shortCircuited)return;if(Q.pendingActionResult){let[B,W]=Q.pendingActionResult;if(oe(W)&&rt(W.error)&&W.error.status===404){N=null,Ie(d,{matches:Q.matches,loaderData:{},errors:{[B]:W.error}});return}}L=Q.matches||L,T=Q.pendingActionResult,R=zt(d,m.submission),M=!1,P.active=!1,D=_e(e.history,D.url,D.signal)}let{shortCircuited:F,matches:U,loaderData:V,errors:X}=await ga(D,d,L,O,P.active,R,m&&m.submission,m&&m.fetcherSubmission,m&&m.replace,m&&m.initialHydration===!0,M,T);F||(N=null,Ie(d,{matches:U||L,...Tr(T),loaderData:V,errors:X}))}async function va(u,d,m,w,R,L,M,P={}){Ct();let D=_n(d,m);if(Z({navigation:D},{flushSync:P.flushSync===!0}),L){let F=await st(w,d.pathname,u.signal);if(F.type==="aborted")return{shortCircuited:!0};if(F.type==="error"){if(F.partialMatches.length===0){let{matches:V,route:X}=ft(s);return{matches:V,pendingActionResult:[X.id,{type:"error",error:F.error}]}}let U=Le(F.partialMatches).route.id;return{matches:F.partialMatches,pendingActionResult:[U,{type:"error",error:F.error}]}}else if(F.matches)w=F.matches;else{let{notFoundMatches:U,error:V,route:X}=Mt(d.pathname);return{matches:U,pendingActionResult:[X.id,{type:"error",error:V}]}}}let O,T=yt(w,d);if(!T.route.action&&!T.route.lazy)O={type:"error",error:ce(405,{method:u.method,pathname:d.pathname,routeId:T.route.id})};else{let F=Be(o,i,u,w,T,M?[]:a,R),U=await Ye(u,F,R,null);if(O=U[T.route.id],!O){for(let V of w)if(U[V.route.id]){O=U[V.route.id];break}}if(u.signal.aborted)return{shortCircuited:!0}}if(Ue(O)){let F;return P&&P.replace!=null?F=P.replace:F=Cr(O.response.headers.get("Location"),new URL(u.url),l)===y.location.pathname+y.location.search,await ze(u,O,!0,{submission:m,replace:F}),{shortCircuited:!0}}if(oe(O)){let F=Le(w,T.route.id);
1return(P&&P.replace)!==!0&&(I="PUSH"),{matches:w,pendingActionResult:[F.route.id,O,T.route.id]}}return{matches:w,pendingActionResult:[T.route.id,O]}}async function ga(u,d,m,w,R,L,M,P,D,O,T,F){let U=L||zt(d,M),V=M||P||Or(U),X=!_&&!O;if(R){if(X){let ee=er(F);Z({navigation:U,...ee!==void 0?{actionData:ee}:{}},{flushSync:T})}let j=await st(m,d.pathname,u.signal);if(j.type==="aborted")return{shortCircuited:!0};if(j.type==="error"){if(j.partialMatches.length===0){let{matches:Ae,route:Ne}=ft(s);return{matches:Ae,loaderData:{},errors:{[Ne.id]:j.error}}}let ee=Le(j.partialMatches).route.id;return{matches:j.partialMatches,loaderData:{},errors:{[ee]:j.error}}}else if(j.matches)m=j.matches;else{let{error:ee,notFoundMatches:Ae,route:Ne}=Mt(d.pathname);return{matches:Ae,loaderData:{},errors:{[Ne.id]:ee}}}}let Q=c||s,{dsMatches:B,revalidatingFetchers:W}=Rr(u,w,o,i,e.history,y,m,V,d,O?[]:a,O===!0,J,le,pe,ue,ne,Q,l,e.patchRoutesOnNavigation!=null,F);if(ae=++se,!e.dataStrategy&&!B.some(j=>j.shouldLoad)&&!B.some(j=>j.route.middleware&&j.route.middleware.length>0)&&W.length===0){let j=nr();return Ie(d,{matches:m,loaderData:{},errors:F&&oe(F[1])?{[F[0]]:F[1].error}:null,...Tr(F),...j?{fetchers:new Map(y.fetchers)}:{}},{flushSync:T}),{shortCircuited:!0}}if(X){let j={};if(!R){j.navigation=U;let ee=er(F);ee!==void 0&&(j.actionData=ee)}W.length>0&&(j.fetchers=wa(W)),Z(j,{flushSync:T})}W.forEach(j=>{Re(j.key),j.controller&&A.set(j.key,j.controller)});let $e=()=>W.forEach(j=>Re(j.key));N&&N.signal.addEventListener("abort",$e);let{loaderResults:Je,fetcherResults:Pe}=await tr(B,W,u,w);if(u.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",$e),W.forEach(j=>A.delete(j.key));let ye=ht(Je);if(ye)return await ze(u,ye.result,!0,{replace:D}),{shortCircuited:!0};if(ye=ht(Pe),ye)return ne.add(ye.key),await ze(u,ye.result,!0,{replace:D}),{shortCircuited:!0};let{loaderData:Dt,errors:Ke}=Mr(y,m,Je,F,W,Pe);O&&y.errors&&(Ke={...y.errors,...Ke});let ke=nr(),ut=or(ae),ct=ke||ut||W.length>0;return{matches:m,loaderData:Dt,errors:Ke,...ct?{fetchers:new Map(y.fetchers)}:{}}}function er(u){if(u&&!oe(u[1]))return{[u[0]]:u[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function wa(u){return u.forEach(d=>{let m=y.fetchers.get(d.key),w=Xe(void 0,m?m.data:void 0);y.fetchers.set(d.key,w)}),new Map(y.fetchers)}async function ba(u,d,m,w){Re(u);let R=(w&&w.flushSync)===!0,L=c||s,M=kt(y.location,y.matches,l,m,d,w?.relative),P=Ce(L,M,l),D=lt(P,L,M);if(D.active&&D.matches&&(P=D.matches),!P){be(u,d,ce(404,{pathname:M}),{flushSync:R});return}let{path:O,submission:T,error:F}=br(!0,M,w);if(F){be(u,d,F,{flushSync:R});return}let U=e.getContext?await e.getContext():new mr,V=(w&&w.preventScrollReset)===!0;if(T&&te(T.formMethod)){await Ra(u,d,O,P,U,D.active,R,V,T);return}ue.set(u,{routeId:d,path:O}),await Ea(u,d,O,P,U,D.active,R,V,T)}async function Ra(u,d,m,w,R,L,M,P,D){Ct(),ue.delete(u);let O=y.fetchers.get(u);we(u,Hn(D,O),{flushSync:M});let T=new AbortController,F=_e(e.history,m,T.signal,D);if(L){let G=await st(w,new URL(F.url).pathname,F.signal,u);if(G.type==="aborted")return;if(G.type==="error"){be(u,d,G.error,{flushSync:M});return}else if(G.matches)w=G.matches;else{be(u,d,ce(404,{pathname:m}),{flushSync:M});return}}let U=yt(w,m);if(!U.route.action&&!U.route.lazy){let G=ce(405,{method:D.formMethod,pathname:m,routeId:d});be(u,d,G,{flushSync:M});return}A.set(u,T);let V=se,X=Be(o,i,F,w,U,a,R),Q=await Ye(F,X,R,u),B=Q[U.route.id];if(!B){for(let G of X)if(Q[G.route.id]){B=Q[G.route.id];break}}if(F.signal.aborted){A.get(u)===T&&A.delete(u);return}if(pe.has(u)){if(Ue(B)||oe(B)){we(u,Ee(void 0));return}}else{if(Ue(B))if(A.delete(u),ae>V){we(u,Ee(void 0));return}else return ne.add(u),we(u,Xe(D)),ze(F,B,!1,{fetcherSubmission:D,preventScrollReset:P});if(oe(B)){be(u,d,B.error);return}}let W=y.navigation.location||y.location,$e=_e(e.history,W,T.signal),Je=c||s,Pe=y.navigation.state!=="idle"?Ce(Je,y.navigation.location,l):y.matches;k(Pe,"Didn't find any matches after fetcher action");let ye=++se;fe.set(u,ye);let Dt=Xe(D,B.data);y.fetchers.set(u,Dt);let{dsMatches:Ke,revalidatingFetchers:ke}=Rr($e,R,o,i,e.history,y,Pe,D,W,a,!1,J,le,pe,ue,ne,Je,l,e.patchRoutesOnNavigation!=null,[U.route.id,B]);ke.filter(G=>G.key!==u).forEach(G=>{let dt=G.key,dr=y.fetchers.get(dt),Ta=Xe(void 0,dr?dr.data:void 0);y.fetchers.set(dt,Ta),Re(dt),G.controller&&A.set(dt,G.controller)}),Z({fetchers:new Map(y.fetchers)});let ut=()=>ke.forEach(G=>Re(G.key));T.signal.addEventListener("abort",ut);let{loaderResults:ct,fetcherResults:j}=await tr(Ke,ke,$e,R);if(T.signal.aborted)return;if(T.signal.removeEventListener("abort",ut),fe.delete(u),A.delete(u),ke.forEach(G=>A.delete(G.key)),y.fetchers.has(u)){let G=Ee(B.data);y.fetchers.set(u,G)}let ee=ht(ct);if(ee)return ze($e,ee.result,!1,{preventScrollReset:P});if(ee=ht(j),ee)return ne.add(ee.key),ze($e,ee.result,!1,{preventScrollReset:P});let{loaderData:Ae,errors:Ne}=Mr(y,Pe,ct,void 0,ke,j);or(ye),y.navigation.state==="loading"&&ye>ae?(k(I,"Expected pending action"),N&&N.abort(),Ie(y.navigation.location,{matches:Pe,loaderData:Ae,errors:Ne,fetchers:new Map(y.fetchers)})):(Z({errors:Ne,loaderData:Dr(y.loaderData,Ae,Pe,Ne),fetchers:new Map(y.fetchers)}),J=!1)}async function Ea(u,d,m,w,R,L,M,P,D){let O=y.fetchers.get(u);we(u,Xe(D,O?O.data:void 0),{flushSync:M});let T=new AbortController,F=_e(e.history,m,T.signal);if(L){let W=await st(w,new URL(F.url).pathname,F.signal,u);if(W.type==="aborted")return;if(W.type==="error"){be(u,d,W.error,{flushSync:M});return}else if(W.matches)w=W.matches;else{be(u,d,ce(404,{pathname:m}),{flushSync:M});return}}let U=yt(w,m);A.set(u,T);let V=se,X=Be(o,i,F,w,U,a,R),B=(await Ye(F,X,R,u))[U.route.id];if(A.get(u)===T&&A.delete(u),!F.signal.aborted){if(pe.has(u)){we(u,Ee(void 0));return}if(Ue(B))if(ae>V){we(u,Ee(void 0));return}else{ne.add(u),await ze(F,B,!1,{preventScrollReset:P});return}if(oe(B)){be(u,d,B.error);return}we(u,Ee(B.data))}}async function ze(u,d,m,{submission:w,fetcherSubmission:R,preventScrollReset:L,replace:M}={}){d.response.headers.has("X-Remix-Revalidate")&&(J=!0);let P=d.response.headers.get("Location");k(P,"Expected a Location header on the redirect Response"),P=Cr(P,new URL(u.url),l);let D=et(y.location,P,{_isRedirect:!0});if(r){let X=!1;if(d.response.headers.has("X-Remix-Reload-Document"))X=!0;else if(Et(P)){const Q=Ir(P,!0);X=Q.origin!==t.location.origin||ie(Q.pathname,l)==null}if(X){M?t.location.replace(P):t.location.assign(P);return}}N=null;let O=M===!0||d.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:T,formAction:F,formEncType:U}=y.navigation;!w&&!R&&T&&F&&U&&(w=Or(y.navigation));let V=w||R;if(bn.has(d.response.status)&&V&&te(V.formMethod))await Oe(O,D,{submission:{...V,formAction:P},preventScrollReset:L||Y,enableViewTransition:m?re:void 0});else{let X=zt(D,w);await Oe(O,D,{overrideNavigation:X,fetcherSubmission:R,preventScrollReset:L||Y,enableViewTransition:m?re:void 0})}}async function Ye(u,d,m,w){let R,L={};try{R=await Tn(p,u,d,w,m,!1)}catch(M){return d.filter(P=>
1P.shouldLoad).forEach(P=>{L[P.route.id]={type:"error",error:M}}),L}if(u.signal.aborted)return L;for(let[M,P]of Object.entries(R))if(In(P)){let D=P.result;L[M]={type:"redirect",response:$n(D,u,M,d,l)}}else L[M]=await zn(P);return L}async function tr(u,d,m,w){let R=Ye(m,u,w,null),L=Promise.all(d.map(async D=>{if(D.matches&&D.match&&D.request&&D.controller){let T=(await Ye(D.request,D.matches,w,D.key))[D.match.route.id];return{[D.key]:T}}else return Promise.resolve({[D.key]:{type:"error",error:ce(404,{pathname:D.path})}})})),M=await R,P=(await L).reduce((D,O)=>Object.assign(D,O),{});return{loaderResults:M,fetcherResults:P}}function Ct(){J=!0,ue.forEach((u,d)=>{A.has(d)&&le.add(d),Re(d)})}function we(u,d,m={}){y.fetchers.set(u,d),Z({fetchers:new Map(y.fetchers)},{flushSync:(m&&m.flushSync)===!0})}function be(u,d,m,w={}){let R=Le(y.matches,d);Lt(u),Z({errors:{[R.route.id]:m},fetchers:new Map(y.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function rr(u){return me.set(u,(me.get(u)||0)+1),pe.has(u)&&pe.delete(u),y.fetchers.get(u)||Rn}function xa(u,d){Re(u,d?.reason),we(u,Ee(null))}function Lt(u){let d=y.fetchers.get(u);A.has(u)&&!(d&&d.state==="loading"&&fe.has(u))&&Re(u),ue.delete(u),fe.delete(u),ne.delete(u),pe.delete(u),le.delete(u),y.fetchers.delete(u)}function Sa(u){let d=(me.get(u)||0)-1;d<=0?(me.delete(u),pe.add(u)):me.set(u,d),Z({fetchers:new Map(y.fetchers)})}function Re(u,d){let m=A.get(u);m&&(m.abort(d),A.delete(u))}function ar(u){for(let d of u){let m=rr(d),w=Ee(m.data);y.fetchers.set(d,w)}}function nr(){let u=[],d=!1;for(let m of ne){let w=y.fetchers.get(m);k(w,`Expected fetcher: ${m}`),w.state==="loading"&&(ne.delete(m),u.push(m),d=!0)}return ar(u),d}function or(u){let d=[];for(let[m,w]of fe)if(w<u){let R=y.fetchers.get(m);k(R,`Expected fetcher: ${m}`),R.state==="loading"&&(Re(m),fe.delete(m),d.push(m))}return ar(d),d.length>0}function Pa(u,d){let m=y.blockers.get(u)||Ge;return Fe.get(u)!==d&&Fe.set(u,d),m}function ir(u){y.blockers.delete(u),Fe.delete(u)}function it(u,d){let m=y.blockers.get(u)||Ge;k(m.state==="unblocked"&&d.state==="blocked"||m.state==="blocked"&&d.state==="blocked"||m.state==="blocked"&&d.state==="proceeding"||m.state==="blocked"&&d.state==="unblocked"||m.state==="proceeding"&&d.state==="unblocked",`Invalid blocker state transition: ${m.state} -> ${d.state}`);let w=new Map(y.blockers);w.set(u,d),Z({blockers:w})}function lr({currentLocation:u,nextLocation:d,historyAction:m}){if(Fe.size===0)return;Fe.size>1&&K(!1,"A router only supports one blocker at a time");let w=Array.from(Fe.entries()),[R,L]=w[w.length-1],M=y.blockers.get(R);if(!(M&&M.state==="proceeding")&&L({currentLocation:u,nextLocation:d,historyAction:m}))return R}function Mt(u){let d=ce(404,{pathname:u}),m=c||s,{matches:w,route:R}=ft(m);return{notFoundMatches:w,route:R,error:d}}function Ca(u,d,m){if(b=u,x=d,S=m||null,!C&&y.navigation===Ot){C=!0;let w=ur(y.location,y.matches);w!=null&&Z({restoreScrollPosition:w})}return()=>{b=null,x=null,S=null}}function sr(u,d){return S&&S(u,d.map(w=>Ar(w,y.loaderData)))||u.key}function La(u,d){if(b&&x){let m=sr(u,d);b[m]=x()}}function ur(u,d){if(b){let m=sr(u,d),w=b[m];if(typeof w=="number")return w}return null}function lt(u,d,m){if(e.patchRoutesOnNavigation)if(u){if(Object.keys(u[0].params).length>0)return{active:!0,matches:Ze(d,m,l,!0)}}else return{active:!0,matches:Ze(d,m,l,!0)||[]};return{active:!1,matches:null}}async function st(u,d,m,w){if(!e.patchRoutesOnNavigation)return{type:"success",matches:u};let R=u;for(;;){let L=c==null,M=c||s,P=i;try{await e.patchRoutesOnNavigation({signal:m,path:d,matches:R,fetcherKey:w,patch:(T,F)=>{m.aborted||Er(T,F,M,P,o,!1)}})}catch(T){return{type:"error",error:T,partialMatches:R}}finally{L&&!m.aborted&&(s=[...s])}if(m.aborted)return{type:"aborted"};let D=Ce(M,d,l),O=null;if(D){if(Object.keys(D[0].params).length===0)return{type:"success",matches:D};if(O=Ze(M,d,l,!0),!(O&&R.length<O.length&&cr(R,O.slice(0,R.length))))return{type:"success",matches:D}}if(O||(O=Ze(M,d,l,!0)),!O||cr(R,O))return{type:"success",matches:null};R=O}}function cr(u,d){return u.length===d.length&&u.every((m,w)=>m.route.id===d[w].route.id)}function Ma(u){i={},c=tt(u,o,void 0,i)}function Da(u,d,m=!1){let w=c==null;Er(u,d,c||s,i,o,m),w&&(s=[...s],Z({}))}return H={get basename(){return l},get future(){return f},get state(){return y},get routes(){return s},get window(){return t},initialize:ha,subscribe:pa,enableScrollRestoration:Ca,navigate:Zt,fetch:ba,revalidate:ya,createHref:u=>e.history.createHref(u),encodeLocation:u=>e.history.encodeLocation(u),getFetcher:rr,resetFetcher:xa,deleteFetcher:Sa,dispose:ma,getBlocker:Pa,deleteBlocker:ir,patchRoutes:Da,_internalFetchControllers:A,_internalSetRoutes:Ma,_internalSetStateDoNotUseOrYouWillBreakYourApp(u){Z(u)}},e.unstable_instrumentations&&(H=dn(H,e.unstable_instrumentations.map(u=>
1u.router).filter(Boolean))),H}function Sn(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function kt(e,t,r,a,n,o){let i,s;if(n){i=[];for(let l of t)if(i.push(l),l.route.id===n){s=l;break}}else i=t,s=t[t.length-1];let c=Ht(a||".",_t(i),ie(e.pathname,r)||e.pathname,o==="path");if(a==null&&(c.search=e.search,c.hash=e.hash),(a==null||a===""||a===".")&&s){let l=Vt(c.search);if(s.route.index&&!l)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&l){let p=new URLSearchParams(c.search),f=p.getAll("index");p.delete("index"),f.filter(v=>v).forEach(v=>p.append("index",v));let g=p.toString();c.search=g?`?${g}`:""}}return r!=="/"&&(c.pathname=an({basename:r,pathname:c.pathname})),ge(c)}function br(e,t,r){if(!r||!Sn(r))return{path:t};if(r.formMethod&&!An(r.formMethod))return{path:t,error:ce(405,{method:r.formMethod})};let a=()=>({path:t,error:ce(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Zr(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!te(o))return a();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,[v,b])=>`${g}${v}=${b}
2`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!te(o))return a();try{let f=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:f,text:void 0}}}catch{return a()}}}k(typeof FormData=="function","FormData is not available in this environment");let s,c;if(r.formData)s=jt(r.formData),c=r.formData;else if(r.body instanceof FormData)s=jt(r.body),c=r.body;else if(r.body instanceof URLSearchParams)s=r.body,c=Lr(s);else if(r.body==null)s=new URLSearchParams,c=new FormData;else try{s=new URLSearchParams(r.body),c=Lr(s)}catch{return a()}let l={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(te(l.formMethod))return{path:t,submission:l};let p=De(t);return e&&p.search&&Vt(p.search)&&s.append("index",""),p.search=`?${s}`,{path:ge(p),submission:l}}function Rr(e,t,r,a,n,o,i,s,c,l,p,f,g,v,b,S,x,C,E,z){let q=z?oe(z[1])?z[1].error:z[1].data:void 0,$=n.createURL(o.location),H=n.createURL(c),y;if(p&&o.errors){let _=Object.keys(o.errors)[0];y=i.findIndex(J=>J.route.id===_)}else if(z&&oe(z[1])){let _=z[0];y=i.findIndex(J=>J.route.id===_)-1}let I=z?z[1].statusCode:void 0,Y=I&&I>=400,N={currentUrl:$,currentParams:o.matches[0]?.params||{},nextUrl:H,nextParams:i[0].params,...s,actionResult:q,actionStatus:I},re=Bt(i.map(_=>_.route.path)),Se=i.map((_,J)=>{let{route:le}=_,A=null;if(y!=null&&J>y?A=!1:le.lazy?A=!0:Wt(le)?p?A=Nt(le,o.loaderData,o.errors):Pn(o.loaderData,o.matches[J],_)&&(A=!0):A=!1,A!==null)return Ut(r,a,e,re,_,l,t,A);let se=Y?!1:f||$.pathname+$.search===H.pathname+H.search||$.search!==H.search||Cn(o.matches[J],_),ae={...N,defaultShouldRevalidate:se},fe=Rt(_,ae);return Ut(r,a,e,re,_,l,t,fe,ae)}),Te=[];return b.forEach((_,J)=>{if(p||!i.some(me=>me.route.id===_.routeId)||v.has(J))return;let le=o.fetchers.get(J),A=le&&le.state!=="idle"&&le.data===void 0,se=Ce(x,_.path,C);if(!se){if(E&&A)return;Te.push({key:J,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(S.has(J))return;let ae=yt(se,_.path),fe=new AbortController,ne=_e(n,_.path,fe.signal),ue=null;if(g.has(J))g.delete(J),ue=Be(r,a,ne,se,ae,l,t);else if(A)f&&(ue=Be(r,a,ne,se,ae,l,t));else{let me={...N,defaultShouldRevalidate:Y?!1:f};Rt(ae,me)&&(ue=Be(r,a,ne,se,ae,l,t,me))}ue&&Te.push({key:J,routeId:_.routeId,path:_.path,matches:ue,match:ae,request:ne,controller:fe})}),{dsMatches:Se,revalidatingFetchers:Te}}function Wt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Nt(e,t,r){if(e.lazy)return!0;if(!Wt(e))return!1;let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function Pn(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function Cn(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Rt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Er(e,t,r,a,n,o){let i;if(e){let l=a[e];k(l,`No route found to patch children into: routeId = ${e}`),l.children||(l.children=[]),i=l.children}else i=r;let s=[],c=[];if(t.forEach(l=>{let p=i.find(f=>Kr(l,f));p?c.push({existingRoute:p,newRoute:l}):s.push(l)}),s.length>0){let l=tt(s,n,[e||"_","patch",String(i?.length||"0")],a);i.push(...l)}if(o&&c.length>0)for(let l=0;l<c.length;l++){let{existingRoute:p,newRoute:f}=c[l],g=p,[v]=tt([f],n,[],{},!0);Object.assign(g,{element:v.element?v.element:g.element,errorElement:v.errorElement?v.errorElement:g.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:g.hydrateFallbackElement})}}function Kr(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=>Kr(r,n))):!1}var xr=new WeakMap,Gr=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(k(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let i=xr.get(n);i||(i={},xr.set(n,i));let s=i[e];if(s)return s;let c=(async()=>{let l=_a(e),f=n[e]!==void 0&&e!=="hasErrorBoundary";if(l)K(!l,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(f)K(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);
2else{let g=await o();g!=null&&(Object.assign(n,{[e]:g}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(g=>g===void 0)&&(n.lazy=void 0))})();return i[e]=c,c},Sr=new WeakMap;function Ln(e,t,r,a,n){let o=r[e.id];if(k(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=Sr.get(o);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let f=(async()=>{k(typeof e.lazy=="function","No lazy route function found");let g=await e.lazy(),v={};for(let b in g){let S=g[b];if(S===void 0)continue;let x=Ba(b),E=o[b]!==void 0&&b!=="hasErrorBoundary";x?K(!x,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?K(!E,`Route "${o.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):v[b]=S}Object.assign(o,v),Object.assign(o,{...a(o),lazy:void 0})})();return Sr.set(o,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let i=Object.keys(e.lazy),s=[],c;for(let p of i){if(n&&n.includes(p))continue;let f=Gr({key:p,route:e,manifest:r,mapRouteProperties:a});f&&(s.push(f),p===t&&(c=f))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Pr(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 Mn(e){return e.matches.some(t=>t.route.middleware)?Xr(e,()=>Pr(e)):Pr(e)}function Xr(e,t){return Dn(e,t,a=>a,Un,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:i}=e,s=Math.min(Math.max(i.findIndex(l=>l.route.id===n),0),Math.max(i.findIndex(l=>l.unstable_shouldCallHandler()),0)),c=Le(i,i[s].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:a}})}}}async function Dn(e,t,r,a,n){let{matches:o,request:i,params:s,context:c,unstable_pattern:l}=e,p=o.flatMap(g=>g.route.middleware?g.route.middleware.map(v=>[g.route.id,v]):[]);return await qr({request:i,params:s,context:c,unstable_pattern:l},p,t,r,a,n)}async function qr(e,t,r,a,n,o,i=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let c=t[i];if(!c)return await r();let[l,p]=c,f,g=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await qr(e,t,r,a,n,o,i+1)},f.value}catch(v){return f={value:await o(v,l,f)},f.value}};try{let v=await p(e,g),b=v!=null?a(v):void 0;return n(b)?b:f?b??f.value:(f={value:await g()},f.value)}catch(v){return await o(v,l,f)}}function Qr(e,t,r,a,n){let o=Gr({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=Ln(a.route,te(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Ut(e,t,r,a,n,o,i,s,c=null){let l=!1,p=Qr(e,t,r,n,o);return{...n,_lazyPromises:p,shouldLoad:s,unstable_shouldRevalidateArgs:c,unstable_shouldCallHandler(f){return l=!0,c?typeof f=="boolean"?Rt(n,{...c,defaultShouldRevalidate:f}):Rt(n,c):s},resolve(f){let{lazy:g,loader:v,middleware:b}=n.route,S=l||s||f&&!te(r.method)&&(g||v),x=b&&b.length>0&&!v&&!g;return S&&(te(r.method)||!x)?Fn({request:r,unstable_pattern:a,match:n,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:f,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Be(e,t,r,a,n,o,i,s=null){return a.map(c=>c.route.id!==n.route.id?{...c,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:Qr(e,t,r,c,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ut(e,t,r,Bt(a.map(l=>l.route.path)),c,o,i,!0,s))}async function Tn(e,t,r,a,n,o){r.some(l=>l._lazyPromises?.middleware)&&await Promise.all(r.map(l=>l._lazyPromises?.middleware));let i={request:t,unstable_pattern:Bt(r.map(l=>l.route.path)),params:r[0].params,context:n,matches:r},c=await e({...i,fetcherKey:a,runClientMiddleware:l=>{let p=i;return Xr(p,()=>l({...p,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(l=>[l._lazyPromises?.handler,l._lazyPromises?.route]))}catch{}return c}async function Fn({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:n,handlerOverride:o,scopedContext:i}){let s,c,l=te(e.method),p=l?"action":"loader",f=g=>{let v,b=new Promise((C,E)=>v=E);c=()=>v(),e.signal.addEventListener("abort",c);let S=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${p}" [routeId: ${r.route.id}]`)):g({request:e,unstable_pattern:t,params:r.params,context:i},...C!==void 0?[C]:[]),x=(async()=>{try{return{type:"data",result:await(o?o(E=>S(E)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([x,b])};try{let g=l?r.route.action:r.route.loader;if(a||n)if(g){let v,[b]=await Promise.all([f(g).catch(S=>{v=S}),a,n]);if(v!==void 0)throw v;s=b}else{await a;let v=l?r.route.action:r.route.loader;if(v)[s]=await Promise.all([f(v),n]);else if(p==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw ce(405,{method:e.method,pathname:S,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(g)s=await f(g);else{let v=new URL(e.url),b=v.pathname+v.search;throw ce(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{c&&e.signal.removeEventListener("abort",c)}return s}async function On(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 zn(e){let{result:t,type:r}=e;if(ea(t)){let a;try{a=await On(t)}catch(n){return{type:"error",error:n}}return r==="error"?{type:"error",error:new bt(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?Fr(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:new bt(t.init?.status||500,void 0,t.data),statusCode:rt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:rt(t)?t.status:void 0}:Fr(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 $n(e,t,r,a,n){let o=e.headers.get("Location");if(k(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Et(o)){let i=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=kt(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}function Cr(e,t,r){if(Et(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=ie(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function _e(e,t,r,a){let n=e.createURL(Zr(t)).toString(),o={signal:r};if(a&&te(a.formMethod)){let{formMethod:i,formEncType:s}=a;o.method=i.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=jt(a.formData):o.body=a.formData}
2return new Request(n,o)}function jt(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function Lr(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function kn(e,t,r,a=!1,n=!1){let o={},i=null,s,c=!1,l={},p=r&&oe(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let g=f.route.id,v=t[g];if(k(!Ue(v),"Cannot handle redirect results in processLoaderData"),oe(v)){let b=v.error;if(p!==void 0&&(b=p,p=void 0),i=i||{},n)i[g]=b;else{let S=Le(e,g);i[S.route.id]==null&&(i[S.route.id]=b)}a||(o[g]=Jr),c||(c=!0,s=rt(v.error)?v.error.status:500),v.headers&&(l[g]=v.headers)}else o[g]=v.data,v.statusCode&&v.statusCode!==200&&!c&&(s=v.statusCode),v.headers&&(l[g]=v.headers)}),p!==void 0&&r&&(i={[r[0]]:p},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:s||200,loaderHeaders:l}}function Mr(e,t,r,a,n,o){let{loaderData:i,errors:s}=kn(t,r,a);return n.filter(c=>!c.matches||c.matches.some(l=>l.shouldLoad)).forEach(c=>{let{key:l,match:p,controller:f}=c;if(f&&f.signal.aborted)return;let g=o[l];if(k(g,"Did not find corresponding fetcher result"),oe(g)){let v=Le(e.matches,p?.route.id);s&&s[v.route.id]||(s={...s,[v.route.id]:g.error}),e.fetchers.delete(l)}else if(Ue(g))k(!1,"Unhandled fetcher revalidation redirect");else{let v=Ee(g.data);e.fetchers.set(l,v)}}),{loaderData:i,errors:s}}function Dr(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Jr).reduce((o,[i,s])=>(o[i]=s,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 Tr(e){return e?oe(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Le(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 ft(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 ce(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&t&&r?s=`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"&&(s="Unable to encode submission body")):e===403?(i="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(i="Not Found",s=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",a&&t&&r?s=`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&&(s=`Invalid request method "${a.toUpperCase()}"`)),new bt(e||500,i,new Error(s),!0)}function ht(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Ue(n))return{key:a,result:n}}}function Zr(e){let t=typeof e=="string"?De(e):e;return ge({...t,hash:""})}function Nn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Un(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&jn(r))}function jn(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function In(e){return ea(e.result)&&wn.has(e.result.status)}function oe(e){return e.type==="error"}function Ue(e){return(e&&e.type)==="redirect"}function Fr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function ea(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function An(e){return gn.has(e.toUpperCase())}function te(e){return yn.has(e.toUpperCase())}function Vt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function yt(e,t){let r=typeof t=="string"?De(t).search:t.search;if(e[e.length-1].route.index&&Vt(r||""))return e[e.length-1];let a=Br(e);return a[a.length-1]}function Or(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 zt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function _n(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Xe(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 Hn(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 Ee(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 Bn(e,t){try{let r=e.sessionStorage.getItem(Yr);
2if(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 Wn(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Yr,JSON.stringify(r))}catch(a){K(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Vn(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var je=h.createContext(null);je.displayName="DataRouter";var We=h.createContext(null);We.displayName="DataRouterState";h.createContext(!1);var Yt=h.createContext({isTransitioning:!1});Yt.displayName="ViewTransition";var ta=h.createContext(new Map);ta.displayName="Fetchers";var Yn=h.createContext(null);Yn.displayName="Await";var de=h.createContext(null);de.displayName="Navigation";var xt=h.createContext(null);xt.displayName="Location";var he=h.createContext({outlet:null,matches:[],isDataRoute:!1});he.displayName="Route";var Jt=h.createContext(null);Jt.displayName="RouteError";function Jn(e,{relative:t}={}){k(at(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=h.useContext(de),{hash:n,pathname:o,search:i}=nt(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:ve([r,o])),a.createHref({pathname:s,search:i,hash:n})}function at(){return h.useContext(xt)!=null}function xe(){return k(at(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(xt).location}var ra="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function aa(e){h.useContext(de).static||h.useLayoutEffect(e)}function Kn(){let{isDataRoute:e}=h.useContext(he);return e?uo():Gn()}function Gn(){k(at(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(je),{basename:t,navigator:r}=h.useContext(de),{matches:a}=h.useContext(he),{pathname:n}=xe(),o=JSON.stringify(_t(a)),i=h.useRef(!1);return aa(()=>{i.current=!0}),h.useCallback((c,l={})=>{if(K(i.current,ra),!i.current)return;if(typeof c=="number"){r.go(c);return}let p=Ht(c,JSON.parse(o),n,l.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:ve([t,p.pathname])),(l.replace?r.replace:r.push)(p,l.state,l)},[t,r,o,n,e])}var Xn=h.createContext(null);function qn(e){let t=h.useContext(he).outlet;return h.useMemo(()=>t&&h.createElement(Xn.Provider,{value:e},t),[t,e])}function ni(){let{matches:e}=h.useContext(he),t=e[e.length-1];return t?t.params:{}}function nt(e,{relative:t}={}){let{matches:r}=h.useContext(he),{pathname:a}=xe(),n=JSON.stringify(_t(r));return h.useMemo(()=>Ht(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Qn(e,t,r,a,n){k(at(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=h.useContext(de),{matches:i}=h.useContext(he),s=i[i.length-1],c=s?s.params:{},l=s?s.pathname:"/",p=s?s.pathnameBase:"/",f=s&&s.route;{let E=f&&f.path||"";oa(l,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3
4Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let g=xe(),v;v=g;let b=v.pathname||"/",S=b;if(p!=="/"){let E=p.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let x=Ce(e,{pathname:S});return K(f||x!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),K(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`),ao(x&&x.map(E=>Object.assign({},E,{params:Object.assign({},c,E.params),pathname:ve([p,o.encodeLocation?o.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:ve([p,o.encodeLocation?o.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),i,r,a,n)}function Zn(){let e=so(),t=rt(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=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application 
4Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:n},r):null,i)}var eo=h.createElement(Zn,null),to=class extends h.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(){return this.state.error!==void 0?h.createElement(he.Provider,{value:this.props.routeContext},h.createElement(Jt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ro({routeContext:e,match:t,children:r}){let a=h.useContext(je);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(he.Provider,{value:e},r)}function ao(e,t=[],r=null,a=null,n=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,i=r?.errors;if(i!=null){let p=o.findIndex(f=>f.route.id&&i?.[f.route.id]!==void 0);k(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,p+1))}let s=!1,c=-1;if(r)for(let p=0;p<o.length;p++){let f=o[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=p),f.route.id){let{loaderData:g,errors:v}=r,b=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.route.lazy||b){s=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}let l=r&&a?(p,f)=>{a(p,{location:r.location,params:r.matches?.[0]?.params??{},errorInfo:f})}:void 0;return o.reduceRight((p,f,g)=>{let v,b=!1,S=null,x=null;r&&(v=i&&f.route.id?i[f.route.id]:void 0,S=f.route.errorElement||eo,s&&(c<0&&g===0?(oa("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,x=null):c===g&&(b=!0,x=f.route.hydrateFallbackElement||null)));let C=t.concat(o.slice(0,g+1)),E=()=>{let z;return v?z=S:b?z=x:f.route.Component?z=h.createElement(f.route.Component,null):f.route.element?z=f.route.element:z=p,h.createElement(ro,{match:f,routeContext:{outlet:p,matches:C,isDataRoute:r!=null},children:z})};return r&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?h.createElement(to,{location:r.location,revalidation:r.revalidation,component:S,error:v,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:l}):E()},null)}function Kt(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function no(e){let t=h.useContext(je);return k(t,Kt(e)),t}function Gt(e){let t=h.useContext(We);return k(t,Kt(e)),t}function oo(e){let t=h.useContext(he);return k(t,Kt(e)),t}function Xt(e){let t=oo(e),r=t.matches[t.matches.length-1];return k(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function io(){return Xt("useRouteId")}function lo(){return Gt("useNavigation").navigation}function na(){let{matches:e,loaderData:t}=Gt("useMatches");return h.useMemo(()=>e.map(r=>Ar(r,t)),[e,t])}function so(){let e=h.useContext(Jt),t=Gt("useRouteError"),r=Xt("useRouteError");return e!==void 0?e:t.errors?.[r]}function uo(){let{router:e}=no("useNavigate"),t=Xt("useNavigate"),r=h.useRef(!1);return aa(()=>{r.current=!0}),h.useCallback(async(n,o={})=>{K(r.current,ra),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var zr={};function oa(e,t,r){!t&&!zr[e]&&(zr[e]=!0,K(!1,r))}var $r={};function kr(e,t){!e&&!$r[t]&&($r[t]=!0,console.warn(t))}function co(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&K(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&K(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&K(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var fo=["HydrateFallback","hydrateFallbackElement"],ho=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 mo({router:e,flushSync:t,unstable_onError:r}){let[a,n]=h.useState(e.state),[o,i]=h.useState(),[s,c]=h.useState({isTransitioning:!1}),[l,p]=h.useState(),[f,g]=h.useState(),[v,b]=h.useState(),S=h.useRef(new Map),x=h.useCallback($=>{n(H=>($.errors&&r&&Object.entries($.errors).forEach(([y,I])=>{H.errors?.[y]!==I&&r(I,{location:$.location,params:$.matches[0]?.params??{}})}),$))},[r]),C=h.useCallback(($,{deletedFetchers:H,flushSync:y,viewTransitionOpts:I})=>{$.fetchers.forEach((N,re)=>{N.data!==void 0&&S.current.set(re,N.data)}),H.forEach(N=>S.current.delete(N)),kr(y===!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 Y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(kr(I==null||Y,"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."),!I||!Y){t&&y?t(()=>x($)):h.startTransition(()=>x($));return}if(t&&y){t(()=>{f&&(l&&l.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let N=e.window.document.startViewTransition(()=>{t(()=>x($))});N.finished.finally(()=>{t(()=>{p(void 0),g(void 0),i(void 0),c({isTransitioning:!1})})}),t(()=>g(N));return}f?(l&&l.resolve(),f.skipTransition(),b({state:$,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(i($),c({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[e.window,t,f,l,x]);h.useLayoutEffect(()=>e.subscribe(C),[e,C]),h.useEffect(()=>{s.isTransitioning&&!s.flushSync&&p(new ho)},[s]),h.useEffect(()=>{if(l&&o&&e.window){let $=o,H=l.promise,y=e.window.document.startViewTransition(async()=>{h.startTransition(()=>x($)),await H});y.finished.finally(()=>{p(void 0),g(void 0),i(void 0),c({isTransitioning:!1})}),g(y)}},[o,l,e.window,x]),h.useEffect(()=>{l&&o&&a.location.key===o.location.key&&l.resolve()},[l,f,a.location,o]),h.useEffect(()=>{!s.isTransitioning&&v&&(i(v.state),c({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[s.isTransitioning,v]);let E=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:$=>e.navigate($),push:($,H,y)=>e.navigate($,{state:H,preventScrollReset:y?.preventScrollReset}),replace:($,H,y)=>e.navigate($,{replace:!0,state:H,preventScrollReset:y?.preventScrollReset})}),[e]),z=e.basename||"/",q=h.useMemo(()=>({router:e,navigator:E,static:!1,basename:z,unstable_onError:r}),[e,E,z,r]);return h.createElement(h.Fragment,null,h.createElement(je.Provider,{value:q},h.createElement(We.Provider,{value:a},h.createElement(ta.Provider,{value:S.current},h.createElement(Yt.Provider,{value:s},h.createElement(vo,{basename:z,location:a.location,navigationType:a.historyAction,navigator:E},h.createElement(po,{routes:e.routes,future:e.future,state:a,unstable_onError:r})))))),null)}var po=h.memo(yo);function yo({routes:e,future:t,state:r,unstable_onError:a}){return Qn(e,void 0,r,a,t)}function oi(e){return qn(e.context)}function vo({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){k(!at(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),s=h.useMemo(()=>({basename:i,navigator:n,static:o,future:{}}),[i,n,o]);typeof r=="string"&&(r=De(r));let{pathname:c="/",search:l="",hash:p="",state:f=null,key:g="default"}=r,v=h.useMemo(()=>{let b=ie(c,i);return b==null?null:{location:{pathname:b,search:l,hash:p,state:f,key:g},navigationType:a}},[i,c,l,p,f,g,a]);
4return K(v!=null,`<Router basename="${i}"> is not able to match the URL "${c}${l}${p}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:h.createElement(de.Provider,{value:s},h.createElement(xt.Provider,{children:t,value:v}))}var vt="get",gt="application/x-www-form-urlencoded";function St(e){return e!=null&&typeof e.tagName=="string"}function go(e){return St(e)&&e.tagName.toLowerCase()==="button"}function wo(e){return St(e)&&e.tagName.toLowerCase()==="form"}function bo(e){return St(e)&&e.tagName.toLowerCase()==="input"}function Ro(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Eo(e,t){return e.button===0&&(!t||t==="_self")&&!Ro(e)}var mt=null;function xo(){if(mt===null)try{new FormData(document.createElement("form"),0),mt=!1}catch{mt=!0}return mt}var So=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $t(e){return e!=null&&!So.has(e)?(K(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gt}"`),null):e}function Po(e,t){let r,a,n,o,i;if(wo(e)){let s=e.getAttribute("action");a=s?ie(s,t):null,r=e.getAttribute("method")||vt,n=$t(e.getAttribute("enctype"))||gt,o=new FormData(e)}else if(go(e)||bo(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||s.getAttribute("action");if(a=c?ie(c,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||vt,n=$t(e.getAttribute("formenctype"))||$t(s.getAttribute("enctype"))||gt,o=new FormData(s,e),!xo()){let{name:l,type:p,value:f}=e;if(p==="image"){let g=l?`${l}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else l&&o.append(l,f)}}else{if(St(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=vt,a=null,n=gt,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function qt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Co(e,t,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a.pathname==="/"?a.pathname=`_root.${r}`:t&&ie(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function Lo(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 Mo(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 Do(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Lo(o,r);return i.links?i.links():[]}return[]}));return zo(a.flat(1).filter(Mo).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Nr(e,t,r,a,n,o){let i=(c,l)=>r[l]?c.route.id!==r[l].route.id:!0,s=(c,l)=>r[l].pathname!==c.pathname||r[l].route.path?.endsWith("*")&&r[l].params["*"]!==c.params["*"];return o==="assets"?t.filter((c,l)=>i(c,l)||s(c,l)):o==="data"?t.filter((c,l)=>{let p=a.routes[c.route.id];if(!p||!p.hasLoader)return!1;if(i(c,l)||s(c,l))return!0;if(c.route.shouldRevalidate){let f=c.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function To(e,t,{includeHydrateFallback:r}={}){return Fo(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.c
4oncat(n.imports)),o}).flat(1))}function Fo(e){return[...new Set(e)]}function Oo(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function zo(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(Oo(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}function ia(){let e=h.useContext(je);return qt(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $o(){let e=h.useContext(We);return qt(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Pt=h.createContext(void 0);Pt.displayName="FrameworkContext";function la(){let e=h.useContext(Pt);return qt(e,"You must render this element inside a <HydratedRouter> element"),e}function ko(e,t){let r=h.useContext(Pt),[a,n]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:p,onTouchStart:f}=t,g=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let S=C=>{C.forEach(E=>{i(E.isIntersecting)})},x=new IntersectionObserver(S,{threshold:.5});return g.current&&x.observe(g.current),()=>{x.disconnect()}}},[e]),h.useEffect(()=>{if(a){let S=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(S)}}},[a]);let v=()=>{n(!0)},b=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,g,{}]:[o,g,{onFocus:qe(s,v),onBlur:qe(c,b),onMouseEnter:qe(l,v),onMouseLeave:qe(p,b),onTouchStart:qe(f,v)}]:[!1,g,{}]}function qe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function No({page:e,...t}){let{router:r}=ia(),a=h.useMemo(()=>Ce(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?h.createElement(jo,{page:e,matches:a,...t}):null}function Uo(e){let{manifest:t,routeModules:r}=la(),[a,n]=h.useState([]);return h.useEffect(()=>{let o=!1;return Do(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function jo({page:e,matches:t,...r}){let a=xe(),{manifest:n,routeModules:o}=la(),{basename:i}=ia(),{loaderData:s,matches:c}=$o(),l=h.useMemo(()=>Nr(e,t,c,n,a,"data"),[e,t,c,n,a]),p=h.useMemo(()=>Nr(e,t,c,n,a,"assets"),[e,t,c,n,a]),f=h.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let b=new Set,S=!1;if(t.forEach(C=>{let E=n.routes[C.route.id];!E||!E.hasLoader||(!l.some(z=>z.route.id===C.route.id)&&C.route.id in s&&o[C.route.id]?.shouldRevalidate||E.hasClientLoader?S=!0:b.add(C.route.id))}),b.size===0)return[];let x=Co(e,i,"data");return S&&b.size>0&&x.searchParams.set("_routes",t.filter(C=>b.has(C.route.id)).map(C=>C.route.id).join(",")),[x.pathname+x.search]},[i,s,a,n,l,t,e,o]),g=h.useMemo(()=>To(p,n),[p,n]),v=Uo(p);return h.createElement(h.Fragment,null,f.map(b=>h.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>h.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),v.map(({key:b,link:S})=>h.createElement("link",{key:b,nonce:r.nonce,...S})))}function Io(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var sa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sa&&(window.__reactRouterVersion="7.9.6")}catch{}function ii(e,t){return xn({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:Ua({window:t?.window}),hydrationData:t?.hydrationData||Ao(),routes:e,mapRouteProperties:co,hydrationRouteProperties:fo,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Ao(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:_o(e.errors)}),e}function _o(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")r[a]=new bt(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let o=window[n.__subType];if(typeof o=="function")try{let i=new o(n.message);i.stack="",r[a]=i}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack="",r[a]=o}}else r[a]=n;return r}var ua=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ca=h.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,state:s,target:c,to:l,preventScrollReset:p,viewTransition:f,...g},v){let{basename:b}=h.useContext(de),S=typeof l=="string"&&ua.test(l),x,C=!1;if(typeof l=="string"&&S&&(x=l,sa))try{let Y=new URL(window.location.href),N=l.startsWith("//")?new URL(Y.protocol+l):new URL(l),re=ie(N.pathname,b);N.origin===Y.origin&&re!=null?l=re+N.search+N.hash:C=!0}catch{K(!1,`<Link to="${l}">
4 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=Jn(l,{relative:n}),[z,q,$]=ko(a,g),H=Yo(l,{replace:i,state:s,target:c,preventScrollReset:p,relative:n,viewTransition:f});function y(Y){t&&t(Y),Y.defaultPrevented||H(Y)}let I=h.createElement("a",{...g,...$,href:x||E,onClick:C||o?t:y,ref:Io(v,q),target:c,"data-discover":!S&&r==="render"?"true":void 0});return z&&!S?h.createElement(h.Fragment,null,I,h.createElement(No,{page:E})):I});ca.displayName="Link";var Ho=h.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:s,children:c,...l},p){let f=nt(i,{relative:l.relative}),g=xe(),v=h.useContext(We),{navigator:b,basename:S}=h.useContext(de),x=v!=null&&Zo(f)&&s===!0,C=b.encodeLocation?b.encodeLocation(f).pathname:f.pathname,E=g.pathname,z=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(E=E.toLowerCase(),z=z?z.toLowerCase():null,C=C.toLowerCase()),z&&S&&(z=ie(z,S)||z);const q=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let $=E===C||!n&&E.startsWith(C)&&E.charAt(q)==="/",H=z!=null&&(z===C||!n&&z.startsWith(C)&&z.charAt(C.length)==="/"),y={isActive:$,isPending:H,isTransitioning:x},I=$?t:void 0,Y;typeof a=="function"?Y=a(y):Y=[a,$?"active":null,H?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let N=typeof o=="function"?o(y):o;return h.createElement(ca,{...l,"aria-current":I,className:Y,ref:p,style:N,to:i,viewTransition:s},typeof c=="function"?c(y):c)});Ho.displayName="NavLink";var Bo=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=vt,action:s,onSubmit:c,relative:l,preventScrollReset:p,viewTransition:f,...g},v)=>{let b=Go(),S=Xo(s,{relative:l}),x=i.toLowerCase()==="get"?"get":"post",C=typeof s=="string"&&ua.test(s),E=z=>{if(c&&c(z),z.defaultPrevented)return;z.preventDefault();let q=z.nativeEvent.submitter,$=q?.getAttribute("formmethod")||i;b(q||z.currentTarget,{fetcherKey:t,method:$,navigate:r,replace:n,state:o,relative:l,preventScrollReset:p,viewTransition:f})};return h.createElement("form",{ref:v,method:x,action:S,onSubmit:a?c:E,...g,"data-discover":!C&&e==="render"?"true":void 0})});Bo.displayName="Form";function Wo({getKey:e,storageKey:t,...r}){let a=h.useContext(Pt),{basename:n}=h.useContext(de),o=xe(),i=na();qo({getKey:e,storageKey:t});let s=h.useMemo(()=>{if(!a||!e)return null;let l=At(o,i,n,e);return l!==o.key?l:null},[]);if(!a||a.isSpaMode)return null;let c=((l,p)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let g=JSON.parse(sessionStorage.getItem(l)||"{}")[p||window.history.state.key];typeof g=="number"&&window.scrollTo(0,g)}catch(f){console.error(f),sessionStorage.removeItem(l)}}).toString();return h.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${JSON.stringify(t||It)}, ${JSON.stringify(s)})`}})}Wo.displayName="ScrollRestoration";function da(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qt(e){let t=h.useContext(je);return k(t,da(e)),t}function Vo(e){let t=h.useContext(We);return k(t,da(e)),t}function Yo(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:i}={}){let s=Kn(),c=xe(),l=nt(e,{relative:o});return h.useCallback(p=>{if(Eo(p,t)){p.preventDefault();let f=r!==void 0?r:ge(c)===ge(l);s(e,{replace:f,state:a,preventScrollReset:n,relative:o,viewTransition:i})}},[c,s,l,r,a,t,e,n,o,i])}var Jo=0,Ko=()=>`__${String(++Jo)}__`;function Go(){let{router:e}=Qt("useSubmit"),{basename:t}=h.useContext(de),r=io();return h.useCallback(async(a,n={})=>{let{action:o,method:i,encType:s,formData:c,body:l}=Po(a,t);if(n.navigate===!1){let p=n.fetcherKey||Ko();await e.fetch(p,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:c,body:l,formMethod:n.method||i,formEncType:n.encType||s,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:c,body:l,formMethod:n.method||i,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function Xo(e,{relative:t}={}){let{basename:r}=h.useContext(de),a=h.useContext(he);k(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...nt(e||".",{relative:t})},i=xe();if(e==null){o.search=i.search;let s=new URLSearchParams(o.search),c=s.getAll("index");if(c.some(p=>p==="")){s.delete("index"),c.filter(f=>f).forEach(f=>s.append("index",f));let p=s.toString();o.search=p?`?${p}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:ve([r,o.pathname])),ge(o)}var It="react-router-scroll-positions",pt={};function At(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:ie(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function qo({getKey:e,storageKey:t}={}){let{router:r}=Qt("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}
4=Vo("useScrollRestoration"),{basename:o}=h.useContext(de),i=xe(),s=na(),c=lo();h.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Qo(h.useCallback(()=>{if(c.state==="idle"){let l=At(i,s,o,e);pt[l]=window.scrollY}try{sessionStorage.setItem(t||It,JSON.stringify(pt))}catch(l){K(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${l}).`)}window.history.scrollRestoration="auto"},[c.state,e,o,i,s,t])),typeof document<"u"&&(h.useLayoutEffect(()=>{try{let l=sessionStorage.getItem(t||It);l&&(pt=JSON.parse(l))}catch{}},[t]),h.useLayoutEffect(()=>{let l=r?.enableScrollRestoration(pt,()=>window.scrollY,e?(p,f)=>At(p,f,o,e):void 0);return()=>l&&l()},[r,o,e]),h.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let l=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(l){l.scrollIntoView();return}}}catch{K(!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 Qo(e,t){let{capture:r}={};h.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function Zo(e,{relative:t}={}){let r=h.useContext(Yt);k(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Qt("useViewTransitionState"),n=nt(e,{relative:t});if(!r.isTransitioning)return!1;let o=ie(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=ie(r.nextLocation.pathname,a)||r.nextLocation.pathname;return wt(n.pathname,i)!=null||wt(n.pathname,o)!=null}var fa=Oa();const li=Ur(fa);function si(e){return h.createElement(mo,{flushSync:fa.flushSync,...e})}export{ca as L,oi as O,ri as R,Wo as S,$a as a,li as b,fa as c,xe as d,ai as e,ii as f,si as g,ni as h,h as r,Kn as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.