function Ua(e,t){for(var r=0;rn[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Ha(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xt={exports:{}},at={};var Jr;function za(){if(Jr)return at;Jr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,o){var i=null;if(o!==void 0&&(i=""+o),a.key!==void 0&&(i=""+a.key),"key"in a){o={};for(var l in a)l!=="key"&&(o[l]=a[l])}else o=a;return a=o.ref,{$$typeof:e,type:n,key:i,ref:a!==void 0?a:null,props:o}}return at.Fragment=t,at.jsx=r,at.jsxs=r,at}var Gr;function Ba(){return Gr||(Gr=1,Xt.exports=za()),Xt.exports}var ss=Ba(),Kt={exports:{}},W={};var Xr;function Wa(){if(Xr)return W;Xr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),p=Symbol.iterator;function g(m){return m===null||typeof m!="object"?null:(m=p&&m[p]||m["@@iterator"],typeof m=="function"?m:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function L(m,x,j){this.props=m,this.context=x,this.refs=E,this.updater=j||b}L.prototype.isReactComponent={},L.prototype.setState=function(m,x){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,x,"setState")},L.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function R(){}R.prototype=L.prototype;function T(m,x,j){this.props=m,this.context=x,this.refs=E,this.updater=j||b}var M=T.prototype=new R;M.constructor=T,S(M,L.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function I(){}var v={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function z(m,x,j){var A=j.ref;return{$$typeof:e,type:m,key:x,ref:A!==void 0?A:null,props:j}}function X(m,x){return z(m.type,x,m.props)}function V(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function ae(m){var x={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(j){return x[j]})}var se=/\/+/g;function ne(m,x){return typeof m=="object"&&m!==null&&m.key!=null?ae(""+m.key):x.toString(36)}function Z(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(I,I):(m.status="pending",m.then(function(x){m.status==="pending"&&(m.status="fulfilled",m.value=x)},function(x){m.status==="pending"&&(m.status="rejected",m.reason=x)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function G(m,x,j,A,B){var J=typeof m;(J==="undefined"||J==="boolean")&&(m=null);var te=!1;if(m===null)te=!0;else switch(J){case"bigint":case"string":case"number":te=!0;break;case"object":switch(m.$$typeof){case e:case t:te=!0;break;case h:return te=m._init,G(te(m._payload),x,j,A,B)}}if(te)return B=B(m),te=A===""?"."+ne(m,0):A,D(B)?(j="",te!=null&&(j=te.replace(se,"$&/")+"/"),G(B,x,j,"",function(Wt){return Wt})):B!=null&&(V(B)&&(B=X(B,j+(B.key==null||m&&m.key===B.key?"":(""+B.key).replace(se,"$&/")+"/")+te)),x.push(B)),1;te=0;var he=A===""?".":A+":";if(D(m))for(var me=0;me{throw TypeError(e)},Ga=(e,t,r)=>t.has(e)||Tn("Cannot "+r),qt=(e,t,r)=>(Ga(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>t.has(e)?Tn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),qr="popstate";function us(e={}){function t(n,a){let{pathname:o,search:i,hash:l}=n.location;return dt("",{pathname:o,search:i,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Te(a)}return qa(t,r,null,e)}function Y(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oe(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ka(){return Math.random().toString(36).substring(2,10)}function Qr(e,t){return{usr:e.state,key:e.key,idx:t}}function dt(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?je(t):t,state:r,key:t&&t.key||n||Ka()}}function Te({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 je(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function qa(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",s=null,u=h();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function h(){return(i.state||{idx:null}).idx}function c(){l="POP";let E=h(),L=E==null?null:E-u;u=E,s&&s({action:l,location:S.location,delta:L})}function p(E,L){l="PUSH";let R=dt(S.location,E,L);u=h()+1;let T=Qr(R,u),M=S.createHref(R);try{i.pushState(T,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(M)}o&&s&&s({action:l,location:S.location,delta:1})}function g(E,L){l="REPLACE";let R=dt(S.location,E,L);u=h();let T=Qr(R,u),M=S.createHref(R);i.replaceState(T,"",M),o&&s&&s({action:l,location:S.location,delta:0})}function b(E){return Mn(E)}let S={get action(){return l},get location(){return e(a,i)},listen(E){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(qr,c),s=E,()=>{a.removeEventListener(qr,c),s=null}},createHref(E){return t(a,E)},createURL:b,encodeLocation(E){let L=b(E);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:p,replace:g,go(E){return i.go(E)}};return S}function Mn(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Y(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Te(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var st,Zr=class{constructor(e){if(Xa(this,st,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(qt(this,st).has(e))return qt(this,st).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){qt(this,st).set(e,t)}};st=new WeakMap;var Qa=new Set(["lazy","caseSensitive","path","id","index","children"]);function Za(e){return Qa.has(e)}var eo=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function to(e){return eo.has(e)}function ro(e){return e.index===!0}function ft(e,t,r=[],n={},a=!1){return e.map((o,i)=>{let l=[...r,String(i)],s=typeof o.id=="string"?o.id:l.join("-");if(Y(o.index!==!0||!o.children,"Cannot specify children on an index route"),Y(a||!n[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),ro(o)){let u={...o,id:s};return n[s]=en(u,t(u)),u}else{let u={...o,id:s,children:void 0};return n[s]=en(u,t(u)),o.children&&(u.children=ft(o.children,t,l,n,a)),u}})}function en(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ie(e,t,r="/"){return ut(e,t,r,!1)}function ut(e,t,r,n){let a=typeof t=="string"?je(t):t,o=be(a.pathname||"/",r);if(o==null)return null;let i=_n(e);no(i);let l=null;for(let s=0;l==null&&s{let h={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&s)return;Y(h.relativePath.startsWith(n),`Absolute route path "${h.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(n.length)}let c=Pe([n,h.relativePath]),p=r.concat(h);i.children&&i.children.length>0&&(Y(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),_n(i.children,t,p,c,s)),!(i.path==null&&!i.index)&&t.push({path:c,score:co(c,i.index),routesMeta:p})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of On(i.path))o(i,l,!0,s)}),t}function On(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=On(n.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function no(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:fo(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var ao=/^:[\w-]+$/,oo=3,io=2,lo=1,so=10,uo=-2,tn=e=>e==="*";function co(e,t){let r=e.split("/"),n=r.length;return r.some(tn)&&(n+=uo),t&&(n+=io),r.filter(a=>!tn(a)).reduce((a,o)=>a+(ao.test(o)?oo:o===""?lo:so),n)}function fo(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function ho(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l{if(h==="*"){let b=l[p]||"";i=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const g=l[p];return c&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Nn(e,t=!1,r=!0){oe(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s)=>(n.push({paramName:l,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function mo(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oe(!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 be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function po({basename:e,pathname:t}){return t==="/"?e:Pe([e,t])}var In=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jt=e=>In.test(e);function yo(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?je(e):e,o;if(r)if(jt(r))o=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),oe(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${r}`)}r.startsWith("/")?o=rn(r.substring(1),"/"):o=rn(r,t)}else o=t;return{pathname:o,search:go(n),hash:wo(a)}}function rn(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Qt(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function An(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function gr(e){let t=An(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function wr(e,t,r,n=!1){let a;typeof e=="string"?a=je(e):(a={...e},Y(!a.pathname||!a.pathname.includes("?"),Qt("?","pathname","search",a)),Y(!a.pathname||!a.pathname.includes("#"),Qt("#","pathname","hash",a)),Y(!a.search||!a.search.includes("#"),Qt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,l;if(i==null)l=r;else{let c=t.length-1;if(!n&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),c-=1;a.pathname=p.join("/")}l=c>=0?t[c]:"/"}let s=yo(a,l),u=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||h)&&(s.pathname+="/"),s}var Pe=e=>e.join("/").replace(/\/\/+/g,"/"),vo=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),go=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wo=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Eo=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function Ro(e,t){return new Eo(e,typeof t=="number"?{status:t}:t)}var bo=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},Fe=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ve(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function mt(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $n(e,t){let r=e;if(typeof r!="string"||!In.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(kn)try{let o=new URL(window.location.href),i=r.startsWith("//")?new URL(o.protocol+r):new URL(r),l=be(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:a=!0}catch{oe(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var $e=Symbol("Uninstrumented");function So(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({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 n={};if(typeof t.lazy=="function"&&r.lazy.length>0){let a=qe(r.lazy,t.lazy,()=>{});a&&(n.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let i=a[o],l=r[`lazy.${o}`];if(typeof i=="function"&&l.length>0){let s=qe(l,i,()=>{});s&&(n.lazy=Object.assign(n.lazy||{},{[o]:s}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&r[a].length>0){let i=o[$e]??o,l=qe(r[a],i,(...s)=>nn(s[0]));l&&(a==="loader"&&i.hydrate===!0&&(l.hydrate=!0),l[$e]=i,n[a]=l)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(a=>{let o=a[$e]??a,i=qe(r.middleware,o,(...l)=>nn(l[0]));return i?(i[$e]=o,i):a})),n}function xo(e,t){let r={navigate:[],fetch:[]};if(t.forEach(n=>n({instrument(a){let o=Object.keys(a);for(let i of o)a[i]&&r[i].push(a[i])}})),r.navigate.length>0){let n=e.navigate[$e]??e.navigate,a=qe(r.navigate,n,(...o)=>{let[i,l]=o;return{to:typeof i=="number"||typeof i=="string"?i:i?Te(i):".",...an(e,l??{})}});a&&(a[$e]=n,e.navigate=a)}if(r.fetch.length>0){let n=e.fetch[$e]??e.fetch,a=qe(r.fetch,n,(...o)=>{let[i,,l,s]=o;return{href:l??".",fetcherKey:i,...an(e,s??{})}});a&&(a[$e]=n,e.fetch=a)}return e}function qe(e,t,r){return e.length===0?null:async(...n)=>{let a=await jn(e,r(...n),()=>t(...n),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function jn(e,t,r,n){let a=e[n],o;if(a){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=jn(e,t,r,n-1),o=await i,Y(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(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 nn(e){let{request:t,context:r,params:n,unstable_pattern:a}=e;return{request:Co(t),params:{...n},unstable_pattern:a,context:Lo(r)}}function an(e,t){return{currentUrl:Te(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 Co(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Lo(e){if(To(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Po=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function To(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")===Po}var Fn=["POST","PUT","PATCH","DELETE"],Mo=new Set(Fn),Do=["GET",...Fn],_o=new Set(Do),Un=new Set([301,302,303,307,308]),Oo=new Set([307,308]),Zt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},No={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Io=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Hn="remix-router-transitions",zn=Symbol("ResetLoaderData");function cs(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";Y(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],a=e.mapRouteProperties||Io,o=a;if(e.unstable_instrumentations){let d=e.unstable_instrumentations;o=y=>({...a(y),...So(d.map(w=>w.route).filter(Boolean),y)})}let i={},l=ft(e.routes,o,void 0,i),s,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let h=e.dataStrategy||Fo,c={...e.future},p=null,g=new Set,b=null,S=null,E=null,L=e.hydrationData!=null,R=Ie(l,e.history.location,u),T=!1,M=null,D;if(R==null&&!e.patchRoutesOnNavigation){let d=xe(404,{pathname:e.history.location.pathname}),{matches:y,route:w}=Ct(l);D=!0,R=y,M={[w.id]:d}}else if(R&&!e.hydrationData&&Et(R,l,e.history.location.pathname).active&&(R=null),R)if(R.some(d=>d.route.lazy))D=!1;else if(!R.some(d=>Er(d.route)))D=!0;else{let d=e.hydrationData?e.hydrationData.loaderData:null,y=e.hydrationData?e.hydrationData.errors:null;if(y){let w=R.findIndex(C=>y[C.route.id]!==void 0);D=R.slice(0,w+1).every(C=>!lr(C.route,d,y))}else D=R.every(w=>!lr(w.route,d,y))}else{D=!1,R=[];let d=Et(null,l,e.history.location.pathname);d.active&&d.matches&&(T=!0,R=d.matches)}let I,v={historyAction:e.history.action,location:e.history.location,matches:R,initialized:D,navigation:Zt,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||M,fetchers:new Map,blockers:new Map},_="POP",z=null,X=!1,V,ae=!1,se=new Map,ne=null,Z=!1,G=!1,ce=new Set,ee=new Map,le=0,fe=-1,m=new Map,x=new Set,j=new Map,A=new Map,B=new Set,J=new Map,te,he=null;function me(){if(p=e.history.listen(({action:d,location:y,delta:w})=>{if(te){te(),te=void 0;return}oe(J.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 C=zr({currentLocation:v.location,nextLocation:y,historyAction:d});if(C&&w!=null){let P=new Promise(k=>{te=k});e.history.go(w*-1),wt(C,{state:"blocked",location:y,proceed(){wt(C,{state:"proceeding",proceed:void 0,reset:void 0,location:y}),P.then(()=>e.history.go(w))},reset(){let k=new Map(v.blockers);k.set(C,ot),pe({blockers:k})}}),z?.resolve(),z=null;return}return Ue(d,y)}),r){ni(t,se);let d=()=>ai(t,se);t.addEventListener("pagehide",d),ne=()=>t.removeEventListener("pagehide",d)}return v.initialized||Ue("POP",v.location,{initialHydration:!0}),I}function Wt(){p&&p(),ne&&ne(),g.clear(),V&&V.abort(),v.fetchers.forEach((d,y)=>Vt(y)),v.blockers.forEach((d,y)=>Hr(y))}function xa(d){return g.add(d),()=>g.delete(d)}function pe(d,y={}){d.matches&&(d.matches=d.matches.map(P=>{let k=i[P.route.id],O=P.route;return O.element!==k.element||O.errorElement!==k.errorElement||O.hydrateFallbackElement!==k.hydrateFallbackElement?{...P,route:k}:P})),v={...v,...d};let w=[],C=[];v.fetchers.forEach((P,k)=>{P.state==="idle"&&(B.has(k)?w.push(k):C.push(k))}),B.forEach(P=>{!v.fetchers.has(P)&&!ee.has(P)&&w.push(P)}),[...g].forEach(P=>P(v,{deletedFetchers:w,newErrors:d.errors??null,viewTransitionOpts:y.viewTransitionOpts,flushSync:y.flushSync===!0})),w.forEach(P=>Vt(P)),C.forEach(P=>v.fetchers.delete(P))}function Ge(d,y,{flushSync:w}={}){let C=v.actionData!=null&&v.navigation.formMethod!=null&&ve(v.navigation.formMethod)&&v.navigation.state==="loading"&&d.state?._isRedirect!==!0,P;y.actionData?Object.keys(y.actionData).length>0?P=y.actionData:P=null:C?P=v.actionData:P=null;let k=y.loaderData?pn(v.loaderData,y.loaderData,y.matches||[],y.errors):v.loaderData,O=v.blockers;O.size>0&&(O=new Map(O),O.forEach((H,F)=>O.set(F,ot)));let N=Z?!1:Wr(d,y.matches||v.matches),$=X===!0||v.navigation.formMethod!=null&&ve(v.navigation.formMethod)&&d.state?._isRedirect!==!0;s&&(l=s,s=void 0),Z||_==="POP"||(_==="PUSH"?e.history.push(d,d.state):_==="REPLACE"&&e.history.replace(d,d.state));let U;if(_==="POP"){let H=se.get(v.location.pathname);H&&H.has(d.pathname)?U={currentLocation:v.location,nextLocation:d}:se.has(d.pathname)&&(U={currentLocation:d,nextLocation:v.location})}else if(ae){let H=se.get(v.location.pathname);H?H.add(d.pathname):(H=new Set([d.pathname]),se.set(v.location.pathname,H)),U={currentLocation:v.location,nextLocation:d}}pe({...y,actionData:P,loaderData:k,historyAction:_,location:d,initialized:!0,navigation:Zt,revalidation:"idle",restoreScrollPosition:N,preventScrollReset:$,blockers:O},{viewTransitionOpts:U,flushSync:w===!0}),_="POP",X=!1,ae=!1,Z=!1,G=!1,z?.resolve(),z=null,he?.resolve(),he=null}async function Ir(d,y){if(z?.resolve(),z=null,typeof d=="number"){z||(z=gn());let Q=z.promise;return e.history.go(d),Q}let w=ir(v.location,v.matches,u,d,y?.fromRouteId,y?.relative),{path:C,submission:P,error:k}=on(!1,w,y),O=v.location,N=dt(v.location,C,y&&y.state);N={...N,...e.history.encodeLocation(N)};let $=y&&y.replace!=null?y.replace:void 0,U="PUSH";$===!0?U="REPLACE":$===!1||P!=null&&ve(P.formMethod)&&P.formAction===v.location.pathname+v.location.search&&(U="REPLACE");let H=y&&"preventScrollReset"in y?y.preventScrollReset===!0:void 0,F=(y&&y.flushSync)===!0,q=zr({currentLocation:O,nextLocation:N,historyAction:U});if(q){wt(q,{state:"blocked",location:N,proceed(){wt(q,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),Ir(d,y)},reset(){let Q=new Map(v.blockers);Q.set(q,ot),pe({blockers:Q})}});return}await Ue(U,N,{submission:P,pendingError:k,preventScrollReset:H,replace:y&&y.replace,enableViewTransition:y&&y.viewTransition,flushSync:F,callSiteDefaultShouldRevalidate:y&&y.unstable_defaultShouldRevalidate})}function Ca(){he||(he=gn()),Yt(),pe({revalidation:"loading"});let d=he.promise;return v.navigation.state==="submitting"?d:v.navigation.state==="idle"?(Ue(v.historyAction,v.location,{startUninterruptedRevalidation:!0}),d):(Ue(_||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation,enableViewTransition:ae===!0}),d)}async function Ue(d,y,w){V&&V.abort(),V=null,_=d,Z=(w&&w.startUninterruptedRevalidation)===!0,ka(v.location,v.matches),X=(w&&w.preventScrollReset)===!0,ae=(w&&w.enableViewTransition)===!0;let C=s||l,P=w&&w.overrideNavigation,k=w?.initialHydration&&v.matches&&v.matches.length>0&&!T?v.matches:Ie(C,y,u),O=(w&&w.flushSync)===!0;if(k&&v.initialized&&!G&&Jo(v.location,y)&&!(w&&w.submission&&ve(w.submission.formMethod))){Ge(y,{matches:k},{flushSync:O});return}let N=Et(k,C,y.pathname);if(N.active&&N.matches&&(k=N.matches),!k){let{error:ue,notFoundMatches:ge,route:re}=Jt(y.pathname);Ge(y,{matches:ge,loaderData:{},errors:{[re.id]:ue}},{flushSync:O});return}V=new AbortController;let $=Ke(e.history,y,V.signal,w&&w.submission),U=e.getContext?await e.getContext():new Zr,H;if(w&&w.pendingError)H=[ke(k).route.id,{type:"error",error:w.pendingError}];else if(w&&w.submission&&ve(w.submission.formMethod)){let ue=await La($,y,w.submission,k,U,N.active,w&&w.initialHydration===!0,{replace:w.replace,flushSync:O});if(ue.shortCircuited)return;if(ue.pendingActionResult){let[ge,re]=ue.pendingActionResult;if(Re(re)&&Ve(re.error)&&re.error.status===404){V=null,Ge(y,{matches:ue.matches,loaderData:{},errors:{[ge]:re.error}});return}}k=ue.matches||k,H=ue.pendingActionResult,P=er(y,w.submission),O=!1,N.active=!1,$=Ke(e.history,$.url,$.signal)}let{shortCircuited:F,matches:q,loaderData:Q,errors:de}=await Pa($,y,k,U,N.active,P,w&&w.submission,w&&w.fetcherSubmission,w&&w.replace,w&&w.initialHydration===!0,O,H,w&&w.callSiteDefaultShouldRevalidate);F||(V=null,Ge(y,{matches:q||k,...yn(H),loaderData:Q,errors:de}))}async function La(d,y,w,C,P,k,O,N={}){Yt();let $=ti(y,w);if(pe({navigation:$},{flushSync:N.flushSync===!0}),k){let F=await Rt(C,y.pathname,d.signal);if(F.type==="aborted")return{shortCircuited:!0};if(F.type==="error"){if(F.partialMatches.length===0){let{matches:Q,route:de}=Ct(l);return{matches:Q,pendingActionResult:[de.id,{type:"error",error:F.error}]}}let q=ke(F.partialMatches).route.id;return{matches:F.partialMatches,pendingActionResult:[q,{type:"error",error:F.error}]}}else if(F.matches)C=F.matches;else{let{notFoundMatches:q,error:Q,route:de}=Jt(y.pathname);return{matches:q,pendingActionResult:[de.id,{type:"error",error:Q}]}}}let U,H=_t(C,y);if(!H.route.action&&!H.route.lazy)U={type:"error",error:xe(405,{method:d.method,pathname:y.pathname,routeId:H.route.id})};else{let F=Qe(o,i,d,C,H,O?[]:n,P),q=await tt(d,F,P,null);if(U=q[H.route.id],!U){for(let Q of C)if(q[Q.route.id]){U=q[Q.route.id];break}}if(d.signal.aborted)return{shortCircuited:!0}}if(Ye(U)){let F;return N&&N.replace!=null?F=N.replace:F=fn(U.response.headers.get("Location"),new URL(d.url),u,e.history)===v.location.pathname+v.location.search,await He(d,U,!0,{submission:w,replace:F}),{shortCircuited:!0}}if(Re(U)){let F=ke(C,H.route.id);return(N&&N.replace)!==!0&&(_="PUSH"),{matches:C,pendingActionResult:[F.route.id,U,H.route.id]}}return{matches:C,pendingActionResult:[H.route.id,U]}}async function Pa(d,y,w,C,P,k,O,N,$,U,H,F,q){let Q=k||er(y,O),de=O||N||vn(Q),ue=!Z&&!U;if(P){if(ue){let ye=Ar(F);pe({navigation:Q,...ye!==void 0?{actionData:ye}:{}},{flushSync:H})}let K=await Rt(w,y.pathname,d.signal);if(K.type==="aborted")return{shortCircuited:!0};if(K.type==="error"){if(K.partialMatches.length===0){let{matches:Xe,route:We}=Ct(l);return{matches:Xe,loaderData:{},errors:{[We.id]:K.error}}}let ye=ke(K.partialMatches).route.id;return{matches:K.partialMatches,loaderData:{},errors:{[ye]:K.error}}}else if(K.matches)w=K.matches;else{let{error:ye,notFoundMatches:Xe,route:We}=Jt(y.pathname);return{matches:Xe,loaderData:{},errors:{[We.id]:ye}}}}let ge=s||l,{dsMatches:re,revalidatingFetchers:Se}=ln(d,C,o,i,e.history,v,w,de,y,U?[]:n,U===!0,G,ce,B,j,x,ge,u,e.patchRoutesOnNavigation!=null,F,q);if(fe=++le,!e.dataStrategy&&!re.some(K=>K.shouldLoad)&&!re.some(K=>K.route.middleware&&K.route.middleware.length>0)&&Se.length===0){let K=Fr();return Ge(y,{matches:w,loaderData:{},errors:F&&Re(F[1])?{[F[0]]:F[1].error}:null,...yn(F),...K?{fetchers:new Map(v.fetchers)}:{}},{flushSync:H}),{shortCircuited:!0}}if(ue){let K={};if(!P){K.navigation=Q;let ye=Ar(F);ye!==void 0&&(K.actionData=ye)}Se.length>0&&(K.fetchers=Ta(Se)),pe(K,{flushSync:H})}Se.forEach(K=>{Oe(K.key),K.controller&&ee.set(K.key,K.controller)});let ze=()=>Se.forEach(K=>Oe(K.key));V&&V.signal.addEventListener("abort",ze);let{loaderResults:rt,fetcherResults:Ae}=await kr(re,Se,d,C);if(d.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",ze),Se.forEach(K=>ee.delete(K.key));let Le=Lt(rt);if(Le)return await He(d,Le.result,!0,{replace:$}),{shortCircuited:!0};if(Le=Lt(Ae),Le)return x.add(Le.key),await He(d,Le.result,!0,{replace:$}),{shortCircuited:!0};let{loaderData:Gt,errors:nt}=mn(v,w,rt,F,Se,Ae);U&&v.errors&&(nt={...v.errors,...nt});let Be=Fr(),bt=Ur(fe),St=Be||bt||Se.length>0;return{matches:w,loaderData:Gt,errors:nt,...St?{fetchers:new Map(v.fetchers)}:{}}}function Ar(d){if(d&&!Re(d[1]))return{[d[0]]:d[1].data};if(v.actionData)return Object.keys(v.actionData).length===0?null:v.actionData}function Ta(d){return d.forEach(y=>{let w=v.fetchers.get(y.key),C=it(void 0,w?w.data:void 0);v.fetchers.set(y.key,C)}),new Map(v.fetchers)}async function Ma(d,y,w,C){Oe(d);let P=(C&&C.flushSync)===!0,k=s||l,O=ir(v.location,v.matches,u,w,y,C?.relative),N=Ie(k,O,u),$=Et(N,k,O);if($.active&&$.matches&&(N=$.matches),!N){_e(d,y,xe(404,{pathname:O}),{flushSync:P});return}let{path:U,submission:H,error:F}=on(!0,O,C);if(F){_e(d,y,F,{flushSync:P});return}let q=e.getContext?await e.getContext():new Zr,Q=(C&&C.preventScrollReset)===!0;if(H&&ve(H.formMethod)){await Da(d,y,U,N,q,$.active,P,Q,H,C&&C.unstable_defaultShouldRevalidate);return}j.set(d,{routeId:y,path:U}),await _a(d,y,U,N,q,$.active,P,Q,H)}async function Da(d,y,w,C,P,k,O,N,$,U){Yt(),j.delete(d);let H=v.fetchers.get(d);De(d,ri($,H),{flushSync:O});let F=new AbortController,q=Ke(e.history,w,F.signal,$);if(k){let ie=await Rt(C,new URL(q.url).pathname,q.signal,d);if(ie.type==="aborted")return;if(ie.type==="error"){_e(d,y,ie.error,{flushSync:O});return}else if(ie.matches)C=ie.matches;else{_e(d,y,xe(404,{pathname:w}),{flushSync:O});return}}let Q=_t(C,w);if(!Q.route.action&&!Q.route.lazy){let ie=xe(405,{method:$.formMethod,pathname:w,routeId:y});_e(d,y,ie,{flushSync:O});return}ee.set(d,F);let de=le,ue=Qe(o,i,q,C,Q,n,P),ge=await tt(q,ue,P,d),re=ge[Q.route.id];if(!re){for(let ie of ue)if(ge[ie.route.id]){re=ge[ie.route.id];break}}if(q.signal.aborted){ee.get(d)===F&&ee.delete(d);return}if(B.has(d)){if(Ye(re)||Re(re)){De(d,Ne(void 0));return}}else{if(Ye(re))if(ee.delete(d),fe>de){De(d,Ne(void 0));return}else return x.add(d),De(d,it($)),He(q,re,!1,{fetcherSubmission:$,preventScrollReset:N});if(Re(re)){_e(d,y,re.error);return}}let Se=v.navigation.location||v.location,ze=Ke(e.history,Se,F.signal),rt=s||l,Ae=v.navigation.state!=="idle"?Ie(rt,v.navigation.location,u):v.matches;Y(Ae,"Didn't find any matches after fetcher action");let Le=++le;m.set(d,Le);let Gt=it($,re.data);v.fetchers.set(d,Gt);let{dsMatches:nt,revalidatingFetchers:Be}=ln(ze,P,o,i,e.history,v,Ae,$,Se,n,!1,G,ce,B,j,x,rt,u,e.patchRoutesOnNavigation!=null,[Q.route.id,re],U);Be.filter(ie=>ie.key!==d).forEach(ie=>{let xt=ie.key,Vr=v.fetchers.get(xt),Fa=it(void 0,Vr?Vr.data:void 0);v.fetchers.set(xt,Fa),Oe(xt),ie.controller&&ee.set(xt,ie.controller)}),pe({fetchers:new Map(v.fetchers)});let bt=()=>Be.forEach(ie=>Oe(ie.key));F.signal.addEventListener("abort",bt);let{loaderResults:St,fetcherResults:K}=await kr(nt,Be,ze,P);if(F.signal.aborted)return;if(F.signal.removeEventListener("abort",bt),m.delete(d),ee.delete(d),Be.forEach(ie=>ee.delete(ie.key)),v.fetchers.has(d)){let ie=Ne(re.data);v.fetchers.set(d,ie)}let ye=Lt(St);if(ye)return He(ze,ye.result,!1,{preventScrollReset:N});if(ye=Lt(K),ye)return x.add(ye.key),He(ze,ye.result,!1,{preventScrollReset:N});let{loaderData:Xe,errors:We}=mn(v,Ae,St,void 0,Be,K);Ur(Le),v.navigation.state==="loading"&&Le>fe?(Y(_,"Expected pending action"),V&&V.abort(),Ge(v.navigation.location,{matches:Ae,loaderData:Xe,errors:We,fetchers:new Map(v.fetchers)})):(pe({errors:We,loaderData:pn(v.loaderData,Xe,Ae,We),fetchers:new Map(v.fetchers)}),G=!1)}async function _a(d,y,w,C,P,k,O,N,$){let U=v.fetchers.get(d);De(d,it($,U?U.data:void 0),{flushSync:O});let H=new AbortController,F=Ke(e.history,w,H.signal);if(k){let re=await Rt(C,new URL(F.url).pathname,F.signal,d);if(re.type==="aborted")return;if(re.type==="error"){_e(d,y,re.error,{flushSync:O});return}else if(re.matches)C=re.matches;else{_e(d,y,xe(404,{pathname:w}),{flushSync:O});return}}let q=_t(C,w);ee.set(d,H);let Q=le,de=Qe(o,i,F,C,q,n,P),ge=(await tt(F,de,P,d))[q.route.id];if(ee.get(d)===H&&ee.delete(d),!F.signal.aborted){if(B.has(d)){De(d,Ne(void 0));return}if(Ye(ge))if(fe>Q){De(d,Ne(void 0));return}else{x.add(d),await He(F,ge,!1,{preventScrollReset:N});return}if(Re(ge)){_e(d,y,ge.error);return}De(d,Ne(ge.data))}}async function He(d,y,w,{submission:C,fetcherSubmission:P,preventScrollReset:k,replace:O}={}){w||(z?.resolve(),z=null),y.response.headers.has("X-Remix-Revalidate")&&(G=!0);let N=y.response.headers.get("Location");Y(N,"Expected a Location header on the redirect Response"),N=fn(N,new URL(d.url),u,e.history);let $=dt(v.location,N,{_isRedirect:!0});if(r){let de=!1;if(y.response.headers.has("X-Remix-Reload-Document"))de=!0;else if(jt(N)){const ue=Mn(N,!0);de=ue.origin!==t.location.origin||be(ue.pathname,u)==null}if(de){O?t.location.replace(N):t.location.assign(N);return}}V=null;let U=O===!0||y.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:H,formAction:F,formEncType:q}=v.navigation;!C&&!P&&H&&F&&q&&(C=vn(v.navigation));let Q=C||P;if(Oo.has(y.response.status)&&Q&&ve(Q.formMethod))await Ue(U,$,{submission:{...Q,formAction:N},preventScrollReset:k||X,enableViewTransition:w?ae:void 0});else{let de=er($,C);await Ue(U,$,{overrideNavigation:de,fetcherSubmission:P,preventScrollReset:k||X,enableViewTransition:w?ae:void 0})}}async function tt(d,y,w,C){let P,k={};try{P=await Ho(h,d,y,C,w,!1)}catch(O){return y.filter(N=>N.shouldLoad).forEach(N=>{k[N.route.id]={type:"error",error:O}}),k}if(d.signal.aborted)return k;if(!ve(d.method))for(let O of y){if(P[O.route.id]?.type==="error")break;!P.hasOwnProperty(O.route.id)&&!v.loaderData.hasOwnProperty(O.route.id)&&(!v.errors||!v.errors.hasOwnProperty(O.route.id))&&O.shouldCallHandler()&&(P[O.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${O.route.id}`)})}for(let[O,N]of Object.entries(P))if(qo(N)){let $=N.result;k[O]={type:"redirect",response:Yo($,d,O,y,u)}}else k[O]=await Wo(N);return k}async function kr(d,y,w,C){let P=tt(w,d,C,null),k=Promise.all(y.map(async $=>{if($.matches&&$.match&&$.request&&$.controller){let H=(await tt($.request,$.matches,C,$.key))[$.match.route.id];return{[$.key]:H}}else return Promise.resolve({[$.key]:{type:"error",error:xe(404,{pathname:$.path})}})})),O=await P,N=(await k).reduce(($,U)=>Object.assign($,U),{});return{loaderResults:O,fetcherResults:N}}function Yt(){G=!0,j.forEach((d,y)=>{ee.has(y)&&ce.add(y),Oe(y)})}function De(d,y,w={}){v.fetchers.set(d,y),pe({fetchers:new Map(v.fetchers)},{flushSync:(w&&w.flushSync)===!0})}function _e(d,y,w,C={}){let P=ke(v.matches,y);Vt(d),pe({errors:{[P.route.id]:w},fetchers:new Map(v.fetchers)},{flushSync:(C&&C.flushSync)===!0})}function $r(d){return A.set(d,(A.get(d)||0)+1),B.has(d)&&B.delete(d),v.fetchers.get(d)||No}function Oa(d,y){Oe(d,y?.reason),De(d,Ne(null))}function Vt(d){let y=v.fetchers.get(d);ee.has(d)&&!(y&&y.state==="loading"&&m.has(d))&&Oe(d),j.delete(d),m.delete(d),x.delete(d),B.delete(d),ce.delete(d),v.fetchers.delete(d)}function Na(d){let y=(A.get(d)||0)-1;y<=0?(A.delete(d),B.add(d)):A.set(d,y),pe({fetchers:new Map(v.fetchers)})}function Oe(d,y){let w=ee.get(d);w&&(w.abort(y),ee.delete(d))}function jr(d){for(let y of d){let w=$r(y),C=Ne(w.data);v.fetchers.set(y,C)}}function Fr(){let d=[],y=!1;for(let w of x){let C=v.fetchers.get(w);Y(C,`Expected fetcher: ${w}`),C.state==="loading"&&(x.delete(w),d.push(w),y=!0)}return jr(d),y}function Ur(d){let y=[];for(let[w,C]of m)if(C0}function Ia(d,y){let w=v.blockers.get(d)||ot;return J.get(d)!==y&&J.set(d,y),w}function Hr(d){v.blockers.delete(d),J.delete(d)}function wt(d,y){let w=v.blockers.get(d)||ot;Y(w.state==="unblocked"&&y.state==="blocked"||w.state==="blocked"&&y.state==="blocked"||w.state==="blocked"&&y.state==="proceeding"||w.state==="blocked"&&y.state==="unblocked"||w.state==="proceeding"&&y.state==="unblocked",`Invalid blocker state transition: ${w.state} -> ${y.state}`);let C=new Map(v.blockers);C.set(d,y),pe({blockers:C})}function zr({currentLocation:d,nextLocation:y,historyAction:w}){if(J.size===0)return;J.size>1&&oe(!1,"A router only supports one blocker at a time");let C=Array.from(J.entries()),[P,k]=C[C.length-1],O=v.blockers.get(P);if(!(O&&O.state==="proceeding")&&k({currentLocation:d,nextLocation:y,historyAction:w}))return P}function Jt(d){let y=xe(404,{pathname:d}),w=s||l,{matches:C,route:P}=Ct(w);return{notFoundMatches:C,route:P,error:y}}function Aa(d,y,w){if(b=d,E=y,S=w||null,!L&&v.navigation===Zt){L=!0;let C=Wr(v.location,v.matches);C!=null&&pe({restoreScrollPosition:C})}return()=>{b=null,E=null,S=null}}function Br(d,y){return S&&S(d,y.map(C=>Dn(C,v.loaderData)))||d.key}function ka(d,y){if(b&&E){let w=Br(d,y);b[w]=E()}}function Wr(d,y){if(b){let w=Br(d,y),C=b[w];if(typeof C=="number")return C}return null}function Et(d,y,w){if(e.patchRoutesOnNavigation)if(d){if(Object.keys(d[0].params).length>0)return{active:!0,matches:ut(y,w,u,!0)}}else return{active:!0,matches:ut(y,w,u,!0)||[]};return{active:!1,matches:null}}async function Rt(d,y,w,C){if(!e.patchRoutesOnNavigation)return{type:"success",matches:d};let P=d;for(;;){let k=s==null,O=s||l,N=i;try{await e.patchRoutesOnNavigation({signal:w,path:y,matches:P,fetcherKey:C,patch:(H,F)=>{w.aborted||sn(H,F,O,N,o,!1)}})}catch(H){return{type:"error",error:H,partialMatches:P}}finally{k&&!w.aborted&&(l=[...l])}if(w.aborted)return{type:"aborted"};let $=Ie(O,y,u),U=null;if($){if(Object.keys($[0].params).length===0)return{type:"success",matches:$};if(U=ut(O,y,u,!0),!(U&&P.lengthw.route.id===y[C].route.id)}function $a(d){i={},s=ft(d,o,void 0,i)}function ja(d,y,w=!1){let C=s==null;sn(d,y,s||l,i,o,w),C&&(l=[...l],pe({}))}return I={get basename(){return u},get future(){return c},get state(){return v},get routes(){return l},get window(){return t},initialize:me,subscribe:xa,enableScrollRestoration:Aa,navigate:Ir,fetch:Ma,revalidate:Ca,createHref:d=>e.history.createHref(d),encodeLocation:d=>e.history.encodeLocation(d),getFetcher:$r,resetFetcher:Oa,deleteFetcher:Na,dispose:Wt,getBlocker:Ia,deleteBlocker:Hr,patchRoutes:ja,_internalFetchControllers:ee,_internalSetRoutes:$a,_internalSetStateDoNotUseOrYouWillBreakYourApp(d){pe(d)}},e.unstable_instrumentations&&(I=xo(I,e.unstable_instrumentations.map(d=>d.router).filter(Boolean))),I}function Ao(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ir(e,t,r,n,a,o){let i,l;if(a){i=[];for(let u of t)if(i.push(u),u.route.id===a){l=u;break}}else i=t,l=t[t.length-1];let s=wr(n||".",gr(i),be(e.pathname,r)||e.pathname,o==="path");if(n==null&&(s.search=e.search,s.hash=e.hash),(n==null||n===""||n===".")&&l){let u=Rr(s.search);if(l.route.index&&!u)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&u){let h=new URLSearchParams(s.search),c=h.getAll("index");h.delete("index"),c.filter(g=>g).forEach(g=>h.append("index",g));let p=h.toString();s.search=p?`?${p}`:""}}return r!=="/"&&(s.pathname=po({basename:r,pathname:s.pathname})),Te(s)}function on(e,t,r){if(!r||!Ao(r))return{path:t};if(r.formMethod&&!ei(r.formMethod))return{path:t,error:xe(405,{method:r.formMethod})};let n=()=>({path:t,error:xe(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),i=Gn(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ve(o))return n();let c=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[g,b])=>`${p}${g}=${b} `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:r.formEncType,formData:void 0,json:void 0,text:c}}}else if(r.formEncType==="application/json"){if(!ve(o))return n();try{let c=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:c,text:void 0}}}catch{return n()}}}Y(typeof FormData=="function","FormData is not available in this environment");let l,s;if(r.formData)l=ur(r.formData),s=r.formData;else if(r.body instanceof FormData)l=ur(r.body),s=r.body;else if(r.body instanceof URLSearchParams)l=r.body,s=hn(l);else if(r.body==null)l=new URLSearchParams,s=new FormData;else try{l=new URLSearchParams(r.body),s=hn(l)}catch{return n()}let u={formMethod:o,formAction:i,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(ve(u.formMethod))return{path:t,submission:u};let h=je(t);return e&&h.search&&Rr(h.search)&&l.append("index",""),h.search=`?${l}`,{path:Te(h),submission:u}}function ln(e,t,r,n,a,o,i,l,s,u,h,c,p,g,b,S,E,L,R,T,M){let D=T?Re(T[1])?T[1].error:T[1].data:void 0,I=a.createURL(o.location),v=a.createURL(s),_;if(h&&o.errors){let Z=Object.keys(o.errors)[0];_=i.findIndex(G=>G.route.id===Z)}else if(T&&Re(T[1])){let Z=T[0];_=i.findIndex(G=>G.route.id===Z)-1}let z=T?T[1].statusCode:void 0,X=z&&z>=400,V={currentUrl:I,currentParams:o.matches[0]?.params||{},nextUrl:v,nextParams:i[0].params,...l,actionResult:D,actionStatus:z},ae=mt(i),se=i.map((Z,G)=>{let{route:ce}=Z,ee=null;if(_!=null&&G>_?ee=!1:ce.lazy?ee=!0:Er(ce)?h?ee=lr(ce,o.loaderData,o.errors):ko(o.loaderData,o.matches[G],Z)&&(ee=!0):ee=!1,ee!==null)return sr(r,n,e,ae,Z,u,t,ee);let le=!1;typeof M=="boolean"?le=M:X?le=!1:(c||I.pathname+I.search===v.pathname+v.search||I.search!==v.search||$o(o.matches[G],Z))&&(le=!0);let fe={...V,defaultShouldRevalidate:le},m=ct(Z,fe);return sr(r,n,e,ae,Z,u,t,m,fe,M)}),ne=[];return b.forEach((Z,G)=>{if(h||!i.some(A=>A.route.id===Z.routeId)||g.has(G))return;let ce=o.fetchers.get(G),ee=ce&&ce.state!=="idle"&&ce.data===void 0,le=Ie(E,Z.path,L);if(!le){if(R&&ee)return;ne.push({key:G,routeId:Z.routeId,path:Z.path,matches:null,match:null,request:null,controller:null});return}if(S.has(G))return;let fe=_t(le,Z.path),m=new AbortController,x=Ke(a,Z.path,m.signal),j=null;if(p.has(G))p.delete(G),j=Qe(r,n,x,le,fe,u,t);else if(ee)c&&(j=Qe(r,n,x,le,fe,u,t));else{let A;typeof M=="boolean"?A=M:X?A=!1:A=c;let B={...V,defaultShouldRevalidate:A};ct(fe,B)&&(j=Qe(r,n,x,le,fe,u,t,B))}j&&ne.push({key:G,routeId:Z.routeId,path:Z.path,matches:j,match:fe,request:x,controller:m})}),{dsMatches:se,revalidatingFetchers:ne}}function Er(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function lr(e,t,r){if(e.lazy)return!0;if(!Er(e))return!1;let n=t!=null&&e.id in t,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function ko(e,t,r){let n=!t||r.route.id!==t.route.id,a=!e.hasOwnProperty(r.route.id);return n||a}function $o(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ct(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function sn(e,t,r,n,a,o){let i;if(e){let u=n[e];Y(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),i=u.children}else i=r;let l=[],s=[];if(t.forEach(u=>{let h=i.find(c=>Bn(u,c));h?s.push({existingRoute:h,newRoute:u}):l.push(u)}),l.length>0){let u=ft(l,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...u)}if(o&&s.length>0)for(let u=0;ut.children?.some(a=>Bn(r,a))):!1}var un=new WeakMap,Wn=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let a=r[t.id];if(Y(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let i=un.get(a);i||(i={},un.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let u=Za(e),c=a[e]!==void 0&&e!=="hasErrorBoundary";if(u)oe(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(c)oe(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await o();p!=null&&(Object.assign(a,{[e]:p}),Object.assign(a,n(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(p=>p===void 0)&&(a.lazy=void 0))})();return i[e]=s,s},cn=new WeakMap;function jo(e,t,r,n,a){let o=r[e.id];if(Y(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=cn.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let c=(async()=>{Y(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),g={};for(let b in p){let S=p[b];if(S===void 0)continue;let E=to(b),R=o[b]!==void 0&&b!=="hasErrorBoundary";E?oe(!E,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?oe(!R,`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.`):g[b]=S}Object.assign(o,g),Object.assign(o,{...n(o),lazy:void 0})})();return cn.set(o,c),c.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:c}}let i=Object.keys(e.lazy),l=[],s;for(let h of i){if(a&&a.includes(h))continue;let c=Wn({key:h,route:e,manifest:r,mapRouteProperties:n});c&&(l.push(c),h===t&&(s=c))}let u=l.length>0?Promise.all(l).then(()=>{}):void 0;return u?.catch(()=>{}),s?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:s}}async function dn(e){let t=e.matches.filter(a=>a.shouldLoad),r={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{r[t[o].route.id]=a}),r}async function Fo(e){return e.matches.some(t=>t.route.middleware)?Yn(e,()=>dn(e)):dn(e)}function Yn(e,t){return Uo(e,t,n=>{if(Zo(n))throw n;return n},Xo,r);function r(n,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:n}}));{let{matches:i}=e,l=Math.min(Math.max(i.findIndex(u=>u.route.id===a),0),Math.max(i.findIndex(u=>u.shouldCallHandler()),0)),s=ke(i,i[l].route.id).route.id;return Promise.resolve({[s]:{type:"error",result:n}})}}}async function Uo(e,t,r,n,a){let{matches:o,request:i,params:l,context:s,unstable_pattern:u}=e,h=o.flatMap(p=>p.route.middleware?p.route.middleware.map(g=>[p.route.id,g]):[]);return await Vn({request:i,params:l,context:s,unstable_pattern:u},h,t,r,n,a)}async function Vn(e,t,r,n,a,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,h]=s,c,p=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{return c={value:await Vn(e,t,r,n,a,o,i+1)},c.value}catch(g){return c={value:await o(g,u,c)},c.value}};try{let g=await h(e,p),b=g!=null?n(g):void 0;return a(b)?b:c?b??c.value:(c={value:await p()},c.value)}catch(g){return await o(g,u,c)}}function Jn(e,t,r,n,a){let o=Wn({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=jo(n.route,ve(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function sr(e,t,r,n,a,o,i,l,s=null,u){let h=!1,c=Jn(e,t,r,a,o);return{...a,_lazyPromises:c,shouldLoad:l,shouldRevalidateArgs:s,shouldCallHandler(p){return h=!0,s?typeof u=="boolean"?ct(a,{...s,defaultShouldRevalidate:u}):typeof p=="boolean"?ct(a,{...s,defaultShouldRevalidate:p}):ct(a,s):l},resolve(p){let{lazy:g,loader:b,middleware:S}=a.route,E=h||l||p&&!ve(r.method)&&(g||b),L=S&&S.length>0&&!b&&!g;return E&&(ve(r.method)||!L)?zo({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:c?.handler,lazyRoutePromise:c?.route,handlerOverride:p,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function Qe(e,t,r,n,a,o,i,l=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:Jn(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:sr(e,t,r,mt(n),s,o,i,!0,l))}async function Ho(e,t,r,n,a,o){r.some(u=>u._lazyPromises?.middleware)&&await Promise.all(r.map(u=>u._lazyPromises?.middleware));let i={request:t,unstable_pattern:mt(r),params:r[0].params,context:a,matches:r},s=await e({...i,fetcherKey:n,runClientMiddleware:u=>{let h=i;return Yn(h,()=>u({...h,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return s}async function zo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let l,s,u=ve(e.method),h=u?"action":"loader",c=p=>{let g,b=new Promise((L,R)=>g=R);s=()=>g(),e.signal.addEventListener("abort",s);let S=L=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${r.route.id}]`)):p({request:e,unstable_pattern:t,params:r.params,context:i},...L!==void 0?[L]:[]),E=(async()=>{try{return{type:"data",result:await(o?o(R=>S(R)):S())}}catch(L){return{type:"error",result:L}}})();return Promise.race([E,b])};try{let p=u?r.route.action:r.route.loader;if(n||a)if(p){let g,[b]=await Promise.all([c(p).catch(S=>{g=S}),n,a]);if(g!==void 0)throw g;l=b}else{await n;let g=u?r.route.action:r.route.loader;if(g)[l]=await Promise.all([c(g),a]);else if(h==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw xe(405,{method:e.method,pathname:S,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(p)l=await c(p);else{let g=new URL(e.url),b=g.pathname+g.search;throw xe(404,{pathname:b})}}catch(p){return{type:"error",result:p}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function Bo(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 Wo(e){let{result:t,type:r}=e;if(Ft(t)){let n;try{n=await Bo(t)}catch(a){return{type:"error",error:a}}return r==="error"?{type:"error",error:new Fe(t.status,t.statusText,n),statusCode:t.status,headers:t.headers}:{type:"data",data:n,statusCode:t.status,headers:t.headers}}return r==="error"?cr(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:Go(t),statusCode:Ve(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ve(t)?t.status:void 0}:cr(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 Yo(e,t,r,n,a){let o=e.headers.get("Location");if(Y(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!jt(o)){let i=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=ir(new URL(t.url),i,a,o),e.headers.set("Location",o)}return e}function fn(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(jt(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(i.protocol))throw new Error("Invalid redirect location");let l=be(i.pathname,r)!=null;if(i.origin===t.origin&&l)return i.pathname+i.search+i.hash}try{let o=n.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ke(e,t,r,n){let a=e.createURL(Gn(t)).toString(),o={signal:r};if(n&&ve(n.formMethod)){let{formMethod:i,formEncType:l}=n;o.method=i.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(n.json)):l==="text/plain"?o.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?o.body=ur(n.formData):o.body=n.formData}return new Request(a,o)}function ur(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function hn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Vo(e,t,r,n=!1,a=!1){let o={},i=null,l,s=!1,u={},h=r&&Re(r[1])?r[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let p=c.route.id,g=t[p];if(Y(!Ye(g),"Cannot handle redirect results in processLoaderData"),Re(g)){let b=g.error;if(h!==void 0&&(b=h,h=void 0),i=i||{},a)i[p]=b;else{let S=ke(e,p);i[S.route.id]==null&&(i[S.route.id]=b)}n||(o[p]=zn),s||(s=!0,l=Ve(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)}),h!==void 0&&r&&(i={[r[0]]:h},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:i,statusCode:l||200,loaderHeaders:u}}function mn(e,t,r,n,a,o){let{loaderData:i,errors:l}=Vo(t,r,n);return a.filter(s=>!s.matches||s.matches.some(u=>u.shouldLoad)).forEach(s=>{let{key:u,match:h,controller:c}=s;if(c&&c.signal.aborted)return;let p=o[u];if(Y(p,"Did not find corresponding fetcher result"),Re(p)){let g=ke(e.matches,h?.route.id);l&&l[g.route.id]||(l={...l,[g.route.id]:p.error}),e.fetchers.delete(u)}else if(Ye(p))Y(!1,"Unhandled fetcher revalidation redirect");else{let g=Ne(p.data);e.fetchers.set(u,g)}}),{loaderData:i,errors:l}}function pn(e,t,r,n){let a=Object.entries(t).filter(([,o])=>o!==zn).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&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function yn(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ke(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Ct(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:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:a==="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",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new Fe(e||500,i,new Error(l),!0)}function Lt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Ye(a))return{key:n,result:a}}}function Gn(e){let t=typeof e=="string"?je(e):e;return Te({...t,hash:""})}function Jo(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Go(e){return new Fe(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function Xo(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Ko(r))}function Ko(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function qo(e){return Ft(e.result)&&Un.has(e.result.status)}function Re(e){return e.type==="error"}function Ye(e){return(e&&e.type)==="redirect"}function cr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ft(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Qo(e){return Un.has(e)}function Zo(e){return Ft(e)&&Qo(e.status)&&e.headers.has("Location")}function ei(e){return _o.has(e.toUpperCase())}function ve(e){return Mo.has(e.toUpperCase())}function Rr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function _t(e,t){let r=typeof t=="string"?je(t).search:t.search;if(e[e.length-1].route.index&&Rr(r||""))return e[e.length-1];let n=An(e);return n[n.length-1]}function vn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function er(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 ti(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 it(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 ri(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 Ne(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 ni(e,t){try{let r=e.sessionStorage.getItem(Hn);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function ai(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Hn,JSON.stringify(r))}catch(n){oe(!1,`Failed to save applied view transitions in sessionStorage (${n}).`)}}}function gn(){let e,t,r=new Promise((n,a)=>{e=async o=>{n(o);try{await r}catch{}},t=async o=>{a(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Je=f.createContext(null);Je.displayName="DataRouter";var Ze=f.createContext(null);Ze.displayName="DataRouterState";var Xn=f.createContext(!1);function Kn(){return f.useContext(Xn)}var br=f.createContext({isTransitioning:!1});br.displayName="ViewTransition";var qn=f.createContext(new Map);qn.displayName="Fetchers";var oi=f.createContext(null);oi.displayName="Await";var Ee=f.createContext(null);Ee.displayName="Navigation";var Ut=f.createContext(null);Ut.displayName="Location";var Ce=f.createContext({outlet:null,matches:[],isDataRoute:!1});Ce.displayName="Route";var Sr=f.createContext(null);Sr.displayName="RouteError";var Qn="REACT_ROUTER_ERROR",ii="REDIRECT",li="ROUTE_ERROR_RESPONSE";function si(e){if(e.startsWith(`${Qn}:${ii}:{`))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 ui(e){if(e.startsWith(`${Qn}:${li}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Fe(t.status,t.statusText,t.data)}catch{}}function ci(e,{relative:t}={}){Y(pt(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:n}=f.useContext(Ee),{hash:a,pathname:o,search:i}=yt(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:Pe([r,o])),n.createHref({pathname:l,search:i,hash:a})}function pt(){return f.useContext(Ut)!=null}function Me(){return Y(pt(),"useLocation() may be used only in the context of a component."),f.useContext(Ut).location}var Zn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ea(e){f.useContext(Ee).static||f.useLayoutEffect(e)}function di(){let{isDataRoute:e}=f.useContext(Ce);return e?Ci():fi()}function fi(){Y(pt(),"useNavigate() may be used only in the context of a component.");let e=f.useContext(Je),{basename:t,navigator:r}=f.useContext(Ee),{matches:n}=f.useContext(Ce),{pathname:a}=Me(),o=JSON.stringify(gr(n)),i=f.useRef(!1);return ea(()=>{i.current=!0}),f.useCallback((s,u={})=>{if(oe(i.current,Zn),!i.current)return;if(typeof s=="number"){r.go(s);return}let h=wr(s,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Pe([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,a,e])}var hi=f.createContext(null);function mi(e){let t=f.useContext(Ce).outlet;return f.useMemo(()=>t&&f.createElement(hi.Provider,{value:e},t),[t,e])}function ta(){let{matches:e}=f.useContext(Ce),t=e[e.length-1];return t?t.params:{}}function yt(e,{relative:t}={}){let{matches:r}=f.useContext(Ce),{pathname:n}=Me(),a=JSON.stringify(gr(r));return f.useMemo(()=>wr(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function pi(e,t,r,n,a){Y(pt(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=f.useContext(Ee),{matches:i}=f.useContext(Ce),l=i[i.length-1],s=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",c=l&&l.route;{let R=c&&c.path||"";oa(u,!c||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${u}" (under ) 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. Please change the parent to .`)}let p=Me(),g;g=p;let b=g.pathname||"/",S=b;if(h!=="/"){let R=h.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let E=Ie(e,{pathname:S});return oe(c||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),oe(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),Ei(E&&E.map(R=>Object.assign({},R,{params:Object.assign({},s,R.params),pathname:Pe([h,o.encodeLocation?o.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?h:Pe([h,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),i,r,n,a)}function yi(){let e=Lr(),t=Ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},o={padding:"2px 4px",backgroundColor:n},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:o},"ErrorBoundary")," or"," ",f.createElement("code",{style:o},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:a},r):null,i)}var vi=f.createElement(yi,null),ra=class extends f.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=ui(e.digest);r&&(e=r)}let t=e!==void 0?f.createElement(Ce.Provider,{value:this.props.routeContext},f.createElement(Sr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(gi,{error:e},t):t}};ra.contextType=Xn;var tr=new WeakMap;function gi({children:e,error:t}){let{basename:r}=f.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=si(t.digest);if(n){let a=tr.get(t);if(a)throw a;let o=$n(n.location,r);if(kn&&!tr.get(t))if(o.isExternal||n.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:n.replace}));throw tr.set(t,i),i}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function wi({routeContext:e,match:t,children:r}){let n=f.useContext(Je);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Ce.Provider,{value:e},r)}function Ei(e,t=[],r=null,n=null,a=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 h=o.findIndex(c=>c.route.id&&i?.[c.route.id]!==void 0);Y(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let l=!1,s=-1;if(r)for(let h=0;h=0?o=o.slice(0,s+1):o=[o[0]];break}}}let u=r&&n?(h,c)=>{n(h,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:mt(r.matches),errorInfo:c})}:void 0;return o.reduceRight((h,c,p)=>{let g,b=!1,S=null,E=null;r&&(g=i&&c.route.id?i[c.route.id]:void 0,S=c.route.errorElement||vi,l&&(s<0&&p===0?(oa("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,E=null):s===p&&(b=!0,E=c.route.hydrateFallbackElement||null)));let L=t.concat(o.slice(0,p+1)),R=()=>{let T;return g?T=S:b?T=E:c.route.Component?T=f.createElement(c.route.Component,null):c.route.element?T=c.route.element:T=h,f.createElement(wi,{match:c,routeContext:{outlet:h,matches:L,isDataRoute:r!=null},children:T})};return r&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?f.createElement(ra,{location:r.location,revalidation:r.revalidation,component:S,error:g,children:R(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:u}):R()},null)}function xr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ri(e){let t=f.useContext(Je);return Y(t,xr(e)),t}function vt(e){let t=f.useContext(Ze);return Y(t,xr(e)),t}function bi(e){let t=f.useContext(Ce);return Y(t,xr(e)),t}function gt(e){let t=bi(e),r=t.matches[t.matches.length-1];return Y(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Si(){return gt("useRouteId")}function xi(){return vt("useNavigation").navigation}function Cr(){let{matches:e,loaderData:t}=vt("useMatches");return f.useMemo(()=>e.map(r=>Dn(r,t)),[e,t])}function na(){let e=vt("useLoaderData"),t=gt("useLoaderData");return e.loaderData[t]}function aa(){let e=vt("useActionData"),t=gt("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Lr(){let e=f.useContext(Sr),t=vt("useRouteError"),r=gt("useRouteError");return e!==void 0?e:t.errors?.[r]}function Ci(){let{router:e}=Ri("useNavigate"),t=gt("useNavigate"),r=f.useRef(!1);return ea(()=>{r.current=!0}),f.useCallback(async(a,o={})=>{oe(r.current,Zn),r.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var wn={};function oa(e,t,r){!t&&!wn[e]&&(wn[e]=!0,oe(!1,r))}var En={};function dr(e,t){!e&&!En[t]&&(En[t]=!0,console.warn(t))}var Li="useOptimistic",Rn=Ja[Li],Pi=()=>{};function Ti(e){return Rn?Rn(e):[e,Pi]}function ds(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&oe(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:f.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&oe(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:f.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&oe(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var fs=["HydrateFallback","hydrateFallbackElement"],Mi=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function hs({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=Kn()||n;let[o,i]=f.useState(e.state),[l,s]=Ti(o),[u,h]=f.useState(),[c,p]=f.useState({isTransitioning:!1}),[g,b]=f.useState(),[S,E]=f.useState(),[L,R]=f.useState(),T=f.useRef(new Map),M=f.useCallback((_,{deletedFetchers:z,newErrors:X,flushSync:V,viewTransitionOpts:ae})=>{X&&r&&Object.values(X).forEach(ne=>r(ne,{location:_.location,params:_.matches[0]?.params??{},unstable_pattern:mt(_.matches)})),_.fetchers.forEach((ne,Z)=>{ne.data!==void 0&&T.current.set(Z,ne.data)}),z.forEach(ne=>T.current.delete(ne)),dr(V===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `` 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 se=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(dr(ae==null||se,"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."),!ae||!se){t&&V?t(()=>i(_)):n===!1?i(_):f.startTransition(()=>{n===!0&&s(ne=>bn(ne,_)),i(_)});return}if(t&&V){t(()=>{S&&(g?.resolve(),S.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})});let ne=e.window.document.startViewTransition(()=>{t(()=>i(_))});ne.finished.finally(()=>{t(()=>{b(void 0),E(void 0),h(void 0),p({isTransitioning:!1})})}),t(()=>E(ne));return}S?(g?.resolve(),S.skipTransition(),R({state:_,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})):(h(_),p({isTransitioning:!0,flushSync:!1,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation}))},[e.window,t,S,g,n,s,r]);f.useLayoutEffect(()=>e.subscribe(M),[e,M]),f.useEffect(()=>{c.isTransitioning&&!c.flushSync&&b(new Mi)},[c]),f.useEffect(()=>{if(g&&u&&e.window){let _=u,z=g.promise,X=e.window.document.startViewTransition(async()=>{n===!1?i(_):f.startTransition(()=>{n===!0&&s(V=>bn(V,_)),i(_)}),await z});X.finished.finally(()=>{b(void 0),E(void 0),h(void 0),p({isTransitioning:!1})}),E(X)}},[u,g,e.window,n,s]),f.useEffect(()=>{g&&u&&l.location.key===u.location.key&&g.resolve()},[g,S,l.location,u]),f.useEffect(()=>{!c.isTransitioning&&L&&(h(L.state),p({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),R(void 0))},[c.isTransitioning,L]);let D=f.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:_=>e.navigate(_),push:(_,z,X)=>e.navigate(_,{state:z,preventScrollReset:X?.preventScrollReset}),replace:(_,z,X)=>e.navigate(_,{replace:!0,state:z,preventScrollReset:X?.preventScrollReset})}),[e]),I=e.basename||"/",v=f.useMemo(()=>({router:e,navigator:D,static:!1,basename:I,onError:r}),[e,D,I,r]);return f.createElement(f.Fragment,null,f.createElement(Je.Provider,{value:v},f.createElement(Ze.Provider,{value:l},f.createElement(qn.Provider,{value:T.current},f.createElement(br.Provider,{value:c},f.createElement(Oi,{basename:I,location:l.location,navigationType:l.historyAction,navigator:D,unstable_useTransitions:n},f.createElement(Di,{routes:e.routes,future:e.future,state:l,onError:r})))))),null)}function bn(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 Di=f.memo(_i);function _i({routes:e,future:t,state:r,onError:n}){return pi(e,void 0,r,n,t)}function ms(e){return mi(e.context)}function Oi({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:o=!1,unstable_useTransitions:i}){Y(!pt(),"You cannot render a inside another . You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=f.useMemo(()=>({basename:l,navigator:a,static:o,unstable_useTransitions:i,future:{}}),[l,a,o,i]);typeof r=="string"&&(r=je(r));let{pathname:u="/",search:h="",hash:c="",state:p=null,key:g="default"}=r,b=f.useMemo(()=>{let S=be(u,l);return S==null?null:{location:{pathname:S,search:h,hash:c,state:p,key:g},navigationType:n}},[l,u,h,c,p,g,n]);return oe(b!=null,` is not able to match the URL "${u}${h}${c}" because it does not start with the basename, so the won't render anything.`),b==null?null:f.createElement(Ee.Provider,{value:s},f.createElement(Ut.Provider,{children:t,value:b}))}function Ni(){return{params:ta(),loaderData:na(),actionData:aa(),matches:Cr()}}function ps(e){return function(){const r=Ni();return f.createElement(e,r)}}function Ii(){return{params:ta(),loaderData:na(),actionData:aa(),error:Lr()}}function ys(e){return function(){const r=Ii();return f.createElement(e,r)}}var Ot="get",Nt="application/x-www-form-urlencoded";function Ht(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ai(e){return Ht(e)&&e.tagName.toLowerCase()==="button"}function ki(e){return Ht(e)&&e.tagName.toLowerCase()==="form"}function $i(e){return Ht(e)&&e.tagName.toLowerCase()==="input"}function ji(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Fi(e,t){return e.button===0&&(!t||t==="_self")&&!ji(e)}var Pt=null;function Ui(){if(Pt===null)try{new FormData(document.createElement("form"),0),Pt=!1}catch{Pt=!0}return Pt}var Hi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rr(e){return e!=null&&!Hi.has(e)?(oe(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Nt}"`),null):e}function zi(e,t){let r,n,a,o,i;if(ki(e)){let l=e.getAttribute("action");n=l?be(l,t):null,r=e.getAttribute("method")||Ot,a=rr(e.getAttribute("enctype"))||Nt,o=new FormData(e)}else if(Ai(e)||$i(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a