"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[252],{50798:function(e,t,r){var n,a,o,i;function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,{AV:function(){return z},Ep:function(){return v},Gn:function(){return x},J0:function(){return h},LX:function(){return R},OF:function(){return H},PP:function(){return c},PQ:function(){return I},RQ:function(){return O},WK:function(){return N},WS:function(){return D},X3:function(){return W},Zn:function(){return j},aU:function(){return n},cP:function(){return y},cm:function(){return A},fZ:function(){return B},fp:function(){return S},i3:function(){return k},lX:function(){return d},ov:function(){return Q},p7:function(){return er},pC:function(){return _},q_:function(){return u},qp:function(){return Z},uX:function(){return F}}),(o=n||(n={})).Pop="POP",o.Push="PUSH",o.Replace="REPLACE";let s="popstate";function c(e){let t;void 0===e&&(e={});let{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map((e,t)=>d(e,"string"==typeof e?null:e.state,0===t?"default":void 0));let i=c(null==a?t.length-1:a),l=n.Pop,s=null;function c(e){return Math.min(Math.max(e,0),t.length-1)}function d(e,r,n){void 0===r&&(r=null);let a=m(t?t[i].pathname:"/",e,r,n);return f("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function u(e){return"string"==typeof e?e:v(e)}return{get index(){return i},get action(){return l},get location(){return t[i]},createHref:u,createURL:e=>new URL(u(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?y(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&s&&s({action:l,location:a,delta:1})},replace(e,r){l=n.Replace;let a=d(e,r);t[i]=a,o&&s&&s({action:l,location:a,delta:0})},go(e){l=n.Pop;let r=c(i+e),a=t[r];i=r,s&&s({action:l,location:a,delta:e})},listen:e=>(s=e,()=>{s=null})}}function d(e){return void 0===e&&(e={}),g(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:v(t)},null,e)}function u(e){return void 0===e&&(e={}),g(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=y(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:v(t))},function(e,t){f("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function h(e,t){if(!1===e||null==e)throw Error(t)}function f(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function p(e,t){return{usr:e.state,key:e.key,idx:t}}function m(e,t,r,n){return void 0===r&&(r=null),l({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?y(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function v(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function g(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:i=!1}=a,c=o.history,d=n.Pop,u=null,f=y();function y(){return(c.state||{idx:null}).idx}function g(){d=n.Pop;let e=y(),t=null==e?null:e-f;f=e,u&&u({action:d,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:v(e);return h(t,"No window.location.(origin|href) available to create URL for href: "+(r=r.replace(/ $/,"%20"))),new URL(r,t)}null==f&&(f=0,c.replaceState(l({},c.state,{idx:f}),""));let w={get action(){return d},get location(){return e(o,c)},listen(e){if(u)throw Error("A history only accepts one active listener");return o.addEventListener(s,g),u=e,()=>{o.removeEventListener(s,g),u=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d=n.Push;let a=m(w.location,e,t);r&&r(a,e);let l=p(a,f=y()+1),s=w.createHref(a);try{c.pushState(l,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(s)}i&&u&&u({action:d,location:w.location,delta:1})},replace:function(e,t){d=n.Replace;let a=m(w.location,e,t);r&&r(a,e);let o=p(a,f=y()),l=w.createHref(a);c.replaceState(o,"",l),i&&u&&u({action:d,location:w.location,delta:0})},go:e=>c.go(e)};return w}(i=a||(a={})).data="data",i.deferred="deferred",i.redirect="redirect",i.error="error";let b=new Set(["lazy","caseSensitive","path","id","index","children"]);function w(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(h(!0!==e.index||!e.children,"Cannot specify children on an index route"),h(!n[i],'Found a route id collision on id "'+i+"\".  Route id's must be globally unique within Data Router usages"),!0===e.index){let r=l({},e,t(e),{id:i});return n[i]=r,r}{let r=l({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=w(e.children,t,o,n)),r}})}function S(e,t,r){void 0===r&&(r="/");let n=j(("string"==typeof t?y(t):t).pathname||"/",r);if(null==n)return null;let a=function e(t,r,n,a){void 0===r&&(r=[]),void 0===n&&(n=[]),void 0===a&&(a="");let o=(t,o,i)=>{let l={relativePath:void 0===i?t.path||"":i,caseSensitive:!0===t.caseSensitive,childrenIndex:o,route:t};l.relativePath.startsWith("/")&&(h(l.relativePath.startsWith(a),'Absolute route path "'+l.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),l.relativePath=l.relativePath.slice(a.length));let s=O([a,l.relativePath]),c=n.concat(l);if(t.children&&t.children.length>0&&(h(!0!==t.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),e(t.children,r,c,s)),null!=t.path||t.index){var d;let e,n;r.push({path:s,score:(d=t.index,n=(e=s.split("/")).length,e.some(P)&&(n+=-2),d&&(n+=2),e.filter(e=>!P(e)).reduce((e,t)=>e+(E.test(t)?3:""===t?1:10),n)),routesMeta:c})}};return t.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))o(e,t,r);else o(e,t)}),r}(e);!function(e){e.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.length-1]:0)})}(a);let o=null;for(let e=0;null==o&&e<a.length;++e){let t=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return f(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}(n);o=function(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",c=R({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!c)return null;Object.assign(n,c.params);let d=i.route;o.push({params:n,pathname:O([a,c.pathname]),pathnameBase:T(O([a,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(a=O([a,c.pathnameBase]))}return o}(a[e],t)}return o}function D(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}let E=/^:[\w-]+$/,P=e=>"*"===e;function x(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(f(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));let n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);let o=e.match(/^:([\w-]+)(\??)$/);if(o){let[,e,r]=o,n=t[e];return h("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")}).filter(e=>!!e).join("/")}function R(e,t){var r,n,a;let o,i;"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[l,s]=(r=e.path,n=e.caseSensitive,a=e.end,void 0===n&&(n=!1),void 0===a&&(a=!0),f("*"===r||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),o=[],i="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(o.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")),r.endsWith("*")?(o.push({paramName:"*"}),i+="*"===r||"/*"===r?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?i+="\\/*$":""!==r&&"/"!==r&&(i+="(?:(?=\\/|$))"),[new RegExp(i,n?void 0:"i"),o]),c=t.match(l);if(!c)return null;let d=c[0],u=d.replace(/(.)\/+$/,"$1"),h=c.slice(1);return{params:s.reduce((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=h[r]||"";u=d.slice(0,d.length-e.length).replace(/(.)\/+$/,"$1")}let o=h[r];return a&&!o?e[n]=void 0:e[n]=(o||"").replace(/%2F/g,"/"),e},{}),pathname:d,pathnameBase:u,pattern:e}}function j(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 k(e,t){let r;void 0===t&&(t="/");let{pathname:n,search:a="",hash:o=""}="string"==typeof e?y(e):e;return{pathname:n?n.startsWith("/")?n:(r=t.replace(/\/+$/,"").split("/"),n.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"):t,search:C(a),hash:U(o)}}function L(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 <Link to="..."> and the router will parse it for you.'}function M(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function A(e,t){let r=M(e);return t?r.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase):r.map(e=>e.pathnameBase)}function _(e,t,r,n){let a,o;void 0===n&&(n=!1),"string"==typeof e?a=y(e):(h(!(a=l({},e)).pathname||!a.pathname.includes("?"),L("?","pathname","search",a)),h(!a.pathname||!a.pathname.includes("#"),L("#","pathname","hash",a)),h(!a.search||!a.search.includes("#"),L("#","search","hash",a)));let i=""===e||""===a.pathname,s=i?"/":a.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let c=k(a,o),d=s&&"/"!==s&&s.endsWith("/"),u=(i||"."===s)&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}let O=e=>e.join("/").replace(/\/\/+/g,"/"),T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),C=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",z=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),l({},r,{headers:n}))};class W extends Error{}class ${constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],h(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise((e,t)=>r=t),this.controller=new AbortController;let n=()=>r(new W("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})},{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then(t=>this.onSettle(r,e,void 0,t),t=>this.onSettle(r,e,t));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof W)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach(r=>r(e,t))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((e,t)=>this.pendingKeysSet.delete(t)),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise(t=>{this.subscribe(n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)})})}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return h(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:function(e){if(!(e instanceof Promise&&!0===e._tracked))return e;if(e._error)throw e._error;return e._data}(n)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}let I=function(e,t){return void 0===t&&(t={}),new $(e,"number"==typeof t?{status:t}:t)},F=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,l({},r,{headers:n}))},B=(e,t)=>{let r=F(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class H{constructor(e,t,r,n){void 0===n&&(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 N(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}let q=["post","put","patch","delete"],K=new Set(q),J=new Set(["get",...q]),X=new Set([301,302,303,307,308]),Y=new Set([307,308]),V={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Q={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Z={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},G=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ee=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),et="remix-router-transitions";function er(e){let t,r,o,i,s;let c=e.window?e.window:"undefined"!=typeof window?window:void 0,d=void 0!==c&&void 0!==c.document&&void 0!==c.document.createElement,u=!d;if(h(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){let r=e.detectErrorBoundary;t=e=>({hasErrorBoundary:r(e)})}else t=ee;let p={},v=w(e.routes,t,void 0,p),y=e.basename||"/",g=l({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),b=null,E=new Set,P=null,x=null,R=null,k=null!=e.hydrationData,L=S(v,e.history.location,y),M=null;if(null==L){let t=ey(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=ev(v);L=r,M={[n.id]:t}}let A=L.some(e=>e.route.lazy),_=L.some(e=>e.route.loader);if(A)o=!1;else if(_){if(g.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=e=>!e.route.loader||!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=L.findIndex(e=>void 0!==r[e.route.id]);o=L.slice(0,e+1).every(n)}else o=L.every(n)}else o=null!=e.hydrationData}else o=!0;let O={historyAction:e.history.action,location:e.history.location,matches:L,initialized:o,navigation:V,restoreScrollPosition:null==e.hydrationData&&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},T=n.Pop,C=!1,U=!1,z=new Map,W=null,$=!1,I=!1,F=[],B=[],H=new Map,N=0,q=-1,K=new Map,J=new Set,X=new Map,er=new Map,ei=new Set,el=new Map,es=new Map,eu=!1;function eh(e,t){void 0===t&&(t={}),O=l({},O,e);let r=[],n=[];g.v7_fetcherPersist&&O.fetchers.forEach((e,t)=>{"idle"===e.state&&(ei.has(t)?n.push(t):r.push(t))}),[...E].forEach(e=>e(O,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync})),g.v7_fetcherPersist&&(r.forEach(e=>O.fetchers.delete(e)),n.forEach(e=>eH(e)))}function eb(t,a,o){var i,s;let c,d;let{flushSync:u}=void 0===o?{}:o,h=null!=O.actionData&&null!=O.navigation.formMethod&&eE(O.navigation.formMethod)&&"loading"===O.navigation.state&&(null==(i=t.state)?void 0:i._isRedirect)!==!0;c=a.actionData?Object.keys(a.actionData).length>0?a.actionData:null:h?O.actionData:null;let f=a.loaderData?ep(O.loaderData,a.loaderData,a.matches||[],a.errors):O.loaderData,p=O.blockers;p.size>0&&(p=new Map(p)).forEach((e,t)=>p.set(t,Z));let m=!0===C||null!=O.navigation.formMethod&&eE(O.navigation.formMethod)&&(null==(s=t.state)?void 0:s._isRedirect)!==!0;if(r&&(v=r,r=void 0),$||T===n.Pop||(T===n.Push?e.history.push(t,t.state):T===n.Replace&&e.history.replace(t,t.state)),T===n.Pop){let e=z.get(O.location.pathname);e&&e.has(t.pathname)?d={currentLocation:O.location,nextLocation:t}:z.has(t.pathname)&&(d={currentLocation:t,nextLocation:O.location})}else if(U){let e=z.get(O.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),z.set(O.location.pathname,e)),d={currentLocation:O.location,nextLocation:t}}eh(l({},a,{actionData:c,loaderData:f,historyAction:T,location:t,initialized:!0,navigation:V,revalidation:"idle",restoreScrollPosition:eG(t,a.matches||O.matches),preventScrollReset:m,blockers:p}),{viewTransitionOpts:d,flushSync:!0===u}),T=n.Pop,C=!1,U=!1,$=!1,I=!1,F=[],B=[]}async function eR(t,r){if("number"==typeof t){e.history.go(t);return}let a=en(O.location,O.matches,y,g.v7_prependBasename,t,g.v7_relativeSplatPath,null==r?void 0:r.fromRouteId,null==r?void 0:r.relative),{path:o,submission:i,error:s}=ea(g.v7_normalizeFormMethod,!1,a,r),c=O.location,d=m(O.location,o,r&&r.state);d=l({},d,e.history.encodeLocation(d));let u=r&&null!=r.replace?r.replace:void 0,h=n.Push;!0===u?h=n.Replace:!1===u||null!=i&&eE(i.formMethod)&&i.formAction===O.location.pathname+O.location.search&&(h=n.Replace);let f=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,p=!0===(r&&r.unstable_flushSync),v=eV({currentLocation:c,nextLocation:d,historyAction:h});if(v){eY(v,{state:"blocked",location:d,proceed(){eY(v,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),eR(t,r)},reset(){let e=new Map(O.blockers);e.set(v,Z),eh({blockers:e})}});return}return await e_(h,d,{submission:i,pendingError:s,preventScrollReset:f,replace:r&&r.replace,enableViewTransition:r&&r.unstable_viewTransition,flushSync:p})}async function e_(t,n,a){var o,i,c;let d,u;s&&s.abort(),s=null,T=t,$=!0===(a&&a.startUninterruptedRevalidation),o=O.location,i=O.matches,P&&R&&(P[eZ(o,i)]=R()),C=!0===(a&&a.preventScrollReset),U=!0===(a&&a.enableViewTransition);let h=r||v,f=a&&a.overrideNavigation,p=S(h,n,y),m=!0===(a&&a.flushSync);if(!p){let e=ey(404,{pathname:n.pathname}),{matches:t,route:r}=ev(h);eQ(),eb(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:m});return}if(O.initialized&&!I&&(c=O.location).pathname===n.pathname&&c.search===n.search&&(""===c.hash?""!==n.hash:c.hash===n.hash||""!==n.hash)&&!(a&&a.submission&&eE(a.submission.formMethod))){eb(n,{matches:p},{flushSync:m});return}s=new AbortController;let g=ed(e.history,n,s.signal,a&&a.submission);if(a&&a.pendingError)u={[em(p).route.id]:a.pendingError};else if(a&&a.submission&&eE(a.submission.formMethod)){let e=await eO(g,n,a.submission,p,{replace:a.replace,flushSync:m});if(e.shortCircuited)return;d=e.pendingActionData,u=e.pendingActionError,f=eL(n,a.submission),m=!1,g=new Request(g.url,{signal:g.signal})}let{shortCircuited:b,loaderData:w,errors:D}=await eT(g,n,p,f,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,m,d,u);b||(s=null,eb(n,l({matches:p},d?{actionData:d}:{},{loaderData:w,errors:D})))}async function eO(e,r,o,i,l){let s;void 0===l&&(l={}),e$(),eh({navigation:{state:"submitting",location:r,formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text}},{flushSync:!0===l.flushSync});let c=ej(i,r);if(c.route.action||c.route.lazy){if(s=await ec("action",e,c,i,p,t,y,g.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else s={type:a.error,error:ey(405,{method:e.method,pathname:r.pathname,routeId:c.route.id})};if(eD(s)){let e;return e=l&&null!=l.replace?l.replace:s.location===O.location.pathname+O.location.search,await ez(O,s,{submission:o,replace:e}),{shortCircuited:!0}}if(eS(s)){let e=em(i,c.route.id);return!0!==(l&&l.replace)&&(T=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:s.error}}}if(ew(s))throw ey(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:s.data}}}async function eT(t,n,a,o,i,c,d,u,h,f,p){let m=o||eL(n,i),b=i||c||ek(m),w=r||v,[S,D]=eo(e.history,O,a,b,n,g.v7_partialHydration&&!0===u,I,F,B,ei,X,J,w,y,f,p);if(eQ(e=>!(a&&a.some(t=>t.route.id===e))||S&&S.some(t=>t.route.id===e)),q=++N,0===S.length&&0===D.length){let e=eK();return eb(n,l({matches:a,loaderData:{},errors:p||null},f?{actionData:f}:{},e?{fetchers:new Map(O.fetchers)}:{}),{flushSync:h}),{shortCircuited:!0}}if(!$&&(!g.v7_partialHydration||!u)){D.forEach(e=>{let t=O.fetchers.get(e.key),r=eM(void 0,t?t.data:void 0);O.fetchers.set(e.key,r)});let e=f||O.actionData;eh(l({navigation:m},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},D.length>0?{fetchers:new Map(O.fetchers)}:{}),{flushSync:h})}D.forEach(e=>{H.has(e.key)&&eN(e.key),e.controller&&H.set(e.key,e.controller)});let E=()=>D.forEach(e=>eN(e.key));s&&s.signal.addEventListener("abort",E);let{results:P,loaderResults:x,fetcherResults:R}=await eW(O.matches,a,S,D,t);if(t.signal.aborted)return{shortCircuited:!0};s&&s.signal.removeEventListener("abort",E),D.forEach(e=>H.delete(e.key));let j=eg(P);if(j){if(j.idx>=S.length){let e=D[j.idx-S.length].key;J.add(e)}return await ez(O,j.result,{replace:d}),{shortCircuited:!0}}let{loaderData:k,errors:L}=ef(O,a,S,x,p,D,R,el);el.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&el.delete(t)})}),g.v7_partialHydration&&u&&O.errors&&Object.entries(O.errors).filter(e=>{let[t]=e;return!S.some(e=>e.route.id===t)}).forEach(e=>{let[t,r]=e;L=Object.assign(L||{},{[t]:r})});let M=eK(),A=eJ(q),_=M||A||D.length>0;return l({loaderData:k,errors:L},_?{fetchers:new Map(O.fetchers)}:{})}async function eC(n,a,o,i,l,c,d){if(e$(),X.delete(n),!i.route.action&&!i.route.lazy){let e=ey(405,{method:d.formMethod,pathname:o,routeId:a});eF(n,a,e,{flushSync:c});return}let u=O.fetchers.get(n);eI(n,{state:"submitting",formMethod:d.formMethod,formAction:d.formAction,formEncType:d.formEncType,formData:d.formData,json:d.json,text:d.text,data:u?u.data:void 0},{flushSync:c});let f=new AbortController,m=ed(e.history,o,f.signal,d);H.set(n,f);let b=N,w=await ec("action",m,i,l,p,t,y,g.v7_relativeSplatPath);if(m.signal.aborted){H.get(n)===f&&H.delete(n);return}if(g.v7_fetcherPersist&&ei.has(n)){if(eD(w)||eS(w)){eI(n,eA(void 0));return}}else{if(eD(w))return(H.delete(n),q>b)?void eI(n,eA(void 0)):(J.add(n),eI(n,eM(d)),ez(O,w,{fetcherSubmission:d}));if(eS(w)){eF(n,a,w.error);return}}if(ew(w))throw ey(400,{type:"defer-action"});let D=O.navigation.location||O.location,E=ed(e.history,D,f.signal),P=r||v,x="idle"!==O.navigation.state?S(P,O.navigation.location,y):O.matches;h(x,"Didn't find any matches after fetcher action");let R=++N;K.set(n,R);let j=eM(d,w.data);O.fetchers.set(n,j);let[k,L]=eo(e.history,O,x,d,D,!1,I,F,B,ei,X,J,P,y,{[i.route.id]:w.data},void 0);L.filter(e=>e.key!==n).forEach(e=>{let t=e.key,r=O.fetchers.get(t),n=eM(void 0,r?r.data:void 0);O.fetchers.set(t,n),H.has(t)&&eN(t),e.controller&&H.set(t,e.controller)}),eh({fetchers:new Map(O.fetchers)});let M=()=>L.forEach(e=>eN(e.key));f.signal.addEventListener("abort",M);let{results:A,loaderResults:_,fetcherResults:C}=await eW(O.matches,x,k,L,E);if(f.signal.aborted)return;f.signal.removeEventListener("abort",M),K.delete(n),H.delete(n),L.forEach(e=>H.delete(e.key));let U=eg(A);if(U){if(U.idx>=k.length){let e=L[U.idx-k.length].key;J.add(e)}return ez(O,U.result)}let{loaderData:z,errors:W}=ef(O,O.matches,k,_,void 0,L,C,el);if(O.fetchers.has(n)){let e=eA(w.data);O.fetchers.set(n,e)}eJ(R),"loading"===O.navigation.state&&R>q?(h(T,"Expected pending action"),s&&s.abort(),eb(O.navigation.location,{matches:x,loaderData:z,errors:W,fetchers:new Map(O.fetchers)})):(eh({errors:W,loaderData:ep(O.loaderData,z,x,W),fetchers:new Map(O.fetchers)}),I=!1)}async function eU(r,n,a,o,i,l,s){let c=O.fetchers.get(r);eI(r,eM(s,c?c.data:void 0),{flushSync:l});let d=new AbortController,u=ed(e.history,a,d.signal);H.set(r,d);let f=N,m=await ec("loader",u,o,i,p,t,y,g.v7_relativeSplatPath);if(ew(m)&&(m=await ex(m,u.signal,!0)||m),H.get(r)===d&&H.delete(r),!u.signal.aborted){if(ei.has(r)){eI(r,eA(void 0));return}if(eD(m)){if(q>f){eI(r,eA(void 0));return}J.add(r),await ez(O,m);return}if(eS(m)){eF(r,n,m.error);return}h(!ew(m),"Unhandled fetcher deferred data"),eI(r,eA(m.data))}}async function ez(t,r,a){let{submission:o,fetcherSubmission:i,replace:u}=void 0===a?{}:a;r.revalidate&&(I=!0);let f=m(t.location,r.location,{_isRedirect:!0});if(h(f,"Expected a location on the redirect navigation"),d){let t=!1;if(r.reloadDocument)t=!0;else if(G.test(r.location)){let n=e.history.createURL(r.location);t=n.origin!==c.location.origin||null==j(n.pathname,y)}if(t){u?c.location.replace(r.location):c.location.assign(r.location);return}}s=null;let p=!0===u?n.Replace:n.Push,{formMethod:v,formAction:g,formEncType:b}=t.navigation;!o&&!i&&v&&g&&b&&(o=ek(t.navigation));let w=o||i;if(Y.has(r.status)&&w&&eE(w.formMethod))await e_(p,f,{submission:l({},w,{formAction:r.location}),preventScrollReset:C});else{let e=eL(f,o);await e_(p,f,{overrideNavigation:e,fetcherSubmission:i,preventScrollReset:C})}}async function eW(r,n,o,i,l){let s=await Promise.all([...o.map(e=>ec("loader",l,e,n,p,t,y,g.v7_relativeSplatPath)),...i.map(r=>r.matches&&r.match&&r.controller?ec("loader",ed(e.history,r.path,r.controller.signal),r.match,r.matches,p,t,y,g.v7_relativeSplatPath):{type:a.error,error:ey(404,{pathname:r.path})})]),c=s.slice(0,o.length),d=s.slice(o.length);return await Promise.all([eP(r,o,c,c.map(()=>l.signal),!1,O.loaderData),eP(r,i.map(e=>e.match),d,i.map(e=>e.controller?e.controller.signal:null),!0)]),{results:s,loaderResults:c,fetcherResults:d}}function e$(){I=!0,F.push(...eQ()),X.forEach((e,t)=>{H.has(t)&&(B.push(t),eN(t))})}function eI(e,t,r){void 0===r&&(r={}),O.fetchers.set(e,t),eh({fetchers:new Map(O.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function eF(e,t,r,n){void 0===n&&(n={});let a=em(O.matches,t);eH(e),eh({errors:{[a.route.id]:r},fetchers:new Map(O.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function eB(e){return g.v7_fetcherPersist&&(er.set(e,(er.get(e)||0)+1),ei.has(e)&&ei.delete(e)),O.fetchers.get(e)||Q}function eH(e){let t=O.fetchers.get(e);H.has(e)&&!(t&&"loading"===t.state&&K.has(e))&&eN(e),X.delete(e),K.delete(e),J.delete(e),ei.delete(e),O.fetchers.delete(e)}function eN(e){let t=H.get(e);h(t,"Expected fetch controller: "+e),t.abort(),H.delete(e)}function eq(e){for(let t of e){let e=eA(eB(t).data);O.fetchers.set(t,e)}}function eK(){let e=[],t=!1;for(let r of J){let n=O.fetchers.get(r);h(n,"Expected fetcher: "+r),"loading"===n.state&&(J.delete(r),e.push(r),t=!0)}return eq(e),t}function eJ(e){let t=[];for(let[r,n]of K)if(n<e){let e=O.fetchers.get(r);h(e,"Expected fetcher: "+r),"loading"===e.state&&(eN(r),K.delete(r),t.push(r))}return eq(t),t.length>0}function eX(e){O.blockers.delete(e),es.delete(e)}function eY(e,t){let r=O.blockers.get(e)||Z;h("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(O.blockers);n.set(e,t),eh({blockers:n})}function eV(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===es.size)return;es.size>1&&f(!1,"A router only supports one blocker at a time");let a=Array.from(es.entries()),[o,i]=a[a.length-1],l=O.blockers.get(o);if((!l||"proceeding"!==l.state)&&i({currentLocation:t,nextLocation:r,historyAction:n}))return o}function eQ(e){let t=[];return el.forEach((r,n)=>{(!e||e(n))&&(r.cancel(),t.push(n),el.delete(n))}),t}function eZ(e,t){return x&&x(e,t.map(e=>D(e,O.loaderData)))||e.key}function eG(e,t){if(P){let r=P[eZ(e,t)];if("number"==typeof r)return r}return null}return i={get basename(){return y},get future(){return g},get state(){return O},get routes(){return v},get window(){return c},initialize:function(){if(b=e.history.listen(t=>{let{action:r,location:n,delta:a}=t;if(eu){eu=!1;return}f(0===es.size||null!=a,"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 o=eV({currentLocation:O.location,nextLocation:n,historyAction:r});if(o&&null!=a){eu=!0,e.history.go(-1*a),eY(o,{state:"blocked",location:n,proceed(){eY(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(O.blockers);e.set(o,Z),eh({blockers:e})}});return}return e_(r,n)}),d){!function(e,t){try{let r=e.sessionStorage.getItem(et);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(c,z);let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(et,JSON.stringify(r))}catch(e){f(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}})(c,z);c.addEventListener("pagehide",e),W=()=>c.removeEventListener("pagehide",e)}return O.initialized||e_(n.Pop,O.location,{initialHydration:!0}),i},subscribe:function(e){return E.add(e),()=>E.delete(e)},enableScrollRestoration:function(e,t,r){if(P=e,R=t,x=r||null,!k&&O.navigation===V){k=!0;let e=eG(O.location,O.matches);null!=e&&eh({restoreScrollPosition:e})}return()=>{P=null,R=null,x=null}},navigate:eR,fetch:function(e,t,n,a){if(u)throw Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");H.has(e)&&eN(e);let o=!0===(a&&a.unstable_flushSync),i=r||v,l=en(O.location,O.matches,y,g.v7_prependBasename,n,g.v7_relativeSplatPath,t,null==a?void 0:a.relative),s=S(i,l,y);if(!s){eF(e,t,ey(404,{pathname:l}),{flushSync:o});return}let{path:c,submission:d,error:h}=ea(g.v7_normalizeFormMethod,!0,l,a);if(h){eF(e,t,h,{flushSync:o});return}let f=ej(s,c);if(C=!0===(a&&a.preventScrollReset),d&&eE(d.formMethod)){eC(e,t,c,f,s,o,d);return}X.set(e,{routeId:t,path:c}),eU(e,t,c,f,s,o,d)},revalidate:function(){if(e$(),eh({revalidation:"loading"}),"submitting"!==O.navigation.state){if("idle"===O.navigation.state){e_(O.historyAction,O.location,{startUninterruptedRevalidation:!0});return}e_(T||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation})}},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:eB,deleteFetcher:function(e){if(g.v7_fetcherPersist){let t=(er.get(e)||0)-1;t<=0?(er.delete(e),ei.add(e)):er.set(e,t)}else eH(e);eh({fetchers:new Map(O.fetchers)})},dispose:function(){b&&b(),W&&W(),E.clear(),s&&s.abort(),O.fetchers.forEach((e,t)=>eH(t)),O.blockers.forEach((e,t)=>eX(t))},getBlocker:function(e,t){let r=O.blockers.get(e)||Z;return es.get(e)!==t&&es.set(e,t),r},deleteBlocker:eX,_internalFetchControllers:H,_internalActiveDeferreds:el,_internalSetRoutes:function(e){r=w(e,t,void 0,p={})}}}function en(e,t,r,n,a,o,i,l){let s,c;if(i){for(let e of(s=[],t))if(s.push(e),e.route.id===i){c=e;break}}else s=t,c=t[t.length-1];let d=_(a||".",A(s,o),j(e.pathname,r)||e.pathname,"path"===l);return null==a&&(d.search=e.search,d.hash=e.hash),(null==a||""===a||"."===a)&&c&&c.route.index&&!eR(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(d.pathname="/"===d.pathname?r:O([r,d.pathname])),v(d)}function ea(e,t,r,n){var a;let o,i;if(!n||!(null!=n&&("formData"in n&&null!=n.formData||"body"in n&&void 0!==n.body)))return{path:r};if(n.formMethod&&(a=n.formMethod,!J.has(a.toLowerCase())))return{path:r,error:ey(405,{method:n.formMethod})};let l=()=>({path:r,error:ey(400,{type:"invalid-body"})}),s=n.formMethod||"get",c=e?s.toUpperCase():s.toLowerCase(),d=eb(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!eE(c))return l();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"},""):String(n.body);return{path:r,submission:{formMethod:c,formAction:d,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!eE(c))return l();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:c,formAction:d,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return l()}}}if(h("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=eu(n.formData),i=n.formData;else if(n.body instanceof FormData)o=eu(n.body),i=n.body;else if(n.body instanceof URLSearchParams)i=eh(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=eh(o)}catch(e){return l()}let u={formMethod:c,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(eE(u.formMethod))return{path:r,submission:u};let f=y(r);return t&&f.search&&eR(f.search)&&o.append("index",""),f.search="?"+o,{path:v(f),submission:u}}function eo(e,t,r,n,a,o,i,s,c,d,u,h,f,p,m,v){let y=v?Object.values(v)[0]:m?Object.values(m)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),w=(function(e,t){let r=e;if(t){let n=e.findIndex(e=>e.route.id===t);n>=0&&(r=e.slice(0,n))}return r})(r,v?Object.keys(v)[0]:void 0).filter((e,r)=>{var a,c;let d,u,{route:h}=e;if(h.lazy)return!0;if(null==h.loader)return!1;if(o)return!!h.loader.hydrate||void 0===t.loaderData[h.id]&&(!t.errors||void 0===t.errors[h.id]);if(a=t.loaderData,d=!(c=t.matches[r])||e.route.id!==c.route.id,u=void 0===a[e.route.id],d||u||s.some(t=>t===e.route.id))return!0;let f=t.matches[r];return el(e,l({currentUrl:g,currentParams:f.params,nextUrl:b,nextParams:e.params},n,{actionResult:y,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||ei(f,e)}))}),D=[];return u.forEach((e,a)=>{if(o||!r.some(t=>t.route.id===e.routeId)||d.has(a))return;let s=S(f,e.path,p);if(!s){D.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});return}let u=t.fetchers.get(a),m=ej(s,e.path);!h.has(a)&&(c.includes(a)||(u&&"idle"!==u.state&&void 0===u.data?i:el(m,l({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:i}))))&&D.push({key:a,routeId:e.routeId,path:e.path,matches:s,match:m,controller:new AbortController})}),[w,D]}function ei(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function el(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function es(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];h(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;f(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||b.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,l({},t(a),{lazy:void 0}))}async function ec(e,t,r,n,o,i,l,s,c){var d,u,f,p;let m,v,y;void 0===c&&(c={});let g=e=>{let n;let a=new Promise((e,t)=>n=t);return y=()=>n(),t.signal.addEventListener("abort",y),Promise.race([e({request:t,params:r.params,context:c.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy){if(n){let e;let t=await Promise.all([g(n).catch(t=>{e=t}),es(r.route,i,o)]);if(e)throw e;v=t[0]}else if(await es(r.route,i,o),n=r.route[e])v=await g(n);else{if("action"!==e)return{type:a.data,data:void 0};let n=new URL(t.url),o=n.pathname+n.search;throw ey(405,{method:t.method,pathname:o,routeId:r.route.id})}}else if(n)v=await g(n);else{let e=new URL(t.url),r=e.pathname+e.search;throw ey(404,{pathname:r})}h(void 0!==v,"You defined "+("action"===e?"an action":"a loader")+" for route "+('"'+r.route.id)+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){m=a.error,v=e}finally{y&&t.signal.removeEventListener("abort",y)}if(null!=(d=v)&&"number"==typeof d.status&&"string"==typeof d.statusText&&"object"==typeof d.headers&&void 0!==d.body){let e,o=v.status;if(X.has(o)){let e=v.headers.get("Location");if(h(e,"Redirects returned/thrown from loaders/actions must have a Location header"),G.test(e)){if(!c.isStaticRequest){let r=new URL(t.url),n=new URL(e.startsWith("//")?r.protocol+e:e),a=null!=j(n.pathname,l);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=en(new URL(t.url),n.slice(0,n.indexOf(r)+1),l,!0,e,s);if(c.isStaticRequest)throw v.headers.set("Location",e),v;return{type:a.redirect,status:o,location:e,revalidate:null!==v.headers.get("X-Remix-Revalidate"),reloadDocument:null!==v.headers.get("X-Remix-Reload-Document")}}if(c.isRouteRequest)throw{type:m===a.error?a.error:a.data,response:v};try{let t=v.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?null==v.body?null:await v.json():await v.text()}catch(e){return{type:a.error,error:e}}return m===a.error?{type:m,error:new H(o,v.statusText,e),headers:v.headers}:{type:a.data,data:e,statusCode:v.status,headers:v.headers}}return m===a.error?{type:m,error:v}:(u=v)&&"object"==typeof u&&"object"==typeof u.data&&"function"==typeof u.subscribe&&"function"==typeof u.cancel&&"function"==typeof u.resolveData?{type:a.deferred,deferredData:v,statusCode:null==(f=v.init)?void 0:f.status,headers:(null==(p=v.init)?void 0:p.headers)&&new Headers(v.init.headers)}:{type:a.data,data:v}}function ed(e,t,r,n){let a=e.createURL(eb(t)).toString(),o={signal:r};if(n&&eE(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=eu(n.formData):o.body=n.formData}return new Request(a,o)}function eu(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eh(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ef(e,t,r,n,a,o,i,s){var c;let d,u,f,p,m;let{loaderData:v,errors:y}=(c=a,u={},f=null,p=!1,m={},n.forEach((e,n)=>{let a=r[n].route.id;if(h(!eD(e),"Cannot handle redirect results in processLoaderData"),eS(e)){let r=em(t,a),n=e.error;c&&(n=Object.values(c)[0],c=void 0),null==(f=f||{})[r.route.id]&&(f[r.route.id]=n),u[a]=void 0,p||(p=!0,d=N(e.error)?e.error.status:500),e.headers&&(m[a]=e.headers)}else ew(e)?(s.set(a,e.deferredData),u[a]=e.deferredData.data):u[a]=e.data,null==e.statusCode||200===e.statusCode||p||(d=e.statusCode),e.headers&&(m[a]=e.headers)}),c&&(f=c,u[Object.keys(c)[0]]=void 0),{loaderData:u,errors:f,statusCode:d||200,loaderHeaders:m});for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];h(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let s=i[t];if(!a||!a.signal.aborted){if(eS(s)){let t=em(e.matches,null==n?void 0:n.route.id);y&&y[t.route.id]||(y=l({},y,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(eD(s))h(!1,"Unhandled fetcher revalidation redirect");else if(ew(s))h(!1,"Unhandled fetcher deferred data");else{let t=eA(s.data);e.fetchers.set(r,t)}}}return{loaderData:v,errors:y}}function ep(e,t,r,n){let a=l({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function em(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function ev(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ey(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new H(e||500,i,Error(l),!0)}function eg(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(eD(r))return{result:r,idx:t}}}function eb(e){let t="string"==typeof e?y(e):e;return v(l({},t,{hash:""}))}function ew(e){return e.type===a.deferred}function eS(e){return e.type===a.error}function eD(e){return(e&&e.type)===a.redirect}function eE(e){return K.has(e.toLowerCase())}async function eP(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let c=e.find(e=>e.route.id===s.route.id),d=null!=c&&!ei(c,s)&&(o&&o[s.route.id])!==void 0;if(ew(l)&&(a||d)){let e=n[i];h(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await ex(l,e,a).then(e=>{e&&(r[i]=e||r[i])})}}}async function ex(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:a.data,data:e.deferredData.unwrappedData}}catch(e){return{type:a.error,error:e}}return{type:a.data,data:e.deferredData.data}}}function eR(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function ej(e,t){let r="string"==typeof t?y(t).search:t.search;if(e[e.length-1].route.index&&eR(r||""))return e[e.length-1];let n=M(e);return n[n.length-1]}function ek(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function eL(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 eM(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 eA(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}Symbol("deferred")}}]);