var e,t,r=(e,t,r)=>new Promise((n,a)=>{var o=e=>{try{l(r.next(e))}catch(t){a(t)}},i=e=>{try{l(r.throw(e))}catch(t){a(t)}},l=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,i);l((r=r.apply(e,t)).next())});import{r as n,R as a,a as o}from"./react-vendor-BmlOtb7g.js"; /** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function i(){return i=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},i.apply(this,arguments)}(t=e||(e={})).Pop="POP",t.Push="PUSH",t.Replace="REPLACE";const l="popstate";function s(t){return void 0===t&&(t={}),function(t,r,n,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:s=!1}=a,c=o.history,p=e.Pop,m=null,v=y();null==v&&(v=0,c.replaceState(i({},c.state,{idx:v}),""));function y(){return(c.state||{idx:null}).idx}function g(){p=e.Pop;let t=y(),r=null==t?null:t-v;v=t,m&&m({action:p,location:E.location,delta:r})}function b(t,r){p=e.Push;let n=h(E.location,t,r);v=y()+1;let a=d(n,v),i=E.createHref(n);try{c.pushState(a,"",i)}catch(l){if(l instanceof DOMException&&"DataCloneError"===l.name)throw l;o.location.assign(i)}s&&m&&m({action:p,location:E.location,delta:1})}function w(t,r){p=e.Replace;let n=h(E.location,t,r);v=y();let a=d(n,v),o=E.createHref(n);c.replaceState(a,"",o),s&&m&&m({action:p,location:E.location,delta:0})}function S(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:f(e);return r=r.replace(/ $/,"%20"),u(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}let E={get action(){return p},get location(){return t(o,c)},listen(e){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(l,g),m=e,()=>{o.removeEventListener(l,g),m=null}},createHref:e=>r(o,e),createURL:S,encodeLocation(e){let t=S(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:b,replace:w,go:e=>c.go(e)};return E}(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return h("",{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:f(t)},0,t)}function u(e,t){if(!1===e||null==e)throw new Error(t)}function c(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}function d(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,r,n){return void 0===r&&(r=null),i({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?p(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function f(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 p(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}var m,v;(v=m||(m={})).data="data",v.deferred="deferred",v.redirect="redirect",v.error="error";const y=new Set(["lazy","caseSensitive","path","id","index","children"]);function g(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((e,a)=>{let o=[...r,String(a)],l="string"==typeof e.id?e.id:o.join("-");if(u(!0!==e.index||!e.children,"Cannot specify children on an index route"),u(!n[l],'Found a route id collision on id "'+l+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=i({},e,t(e),{id:l});return n[l]=r,r}{let r=i({},e,t(e),{id:l,children:void 0});return n[l]=r,e.children&&(r.children=g(e.children,t,o,n)),r}})}function b(e,t,r){return void 0===r&&(r="/"),w(e,t,r,!1)}function w(e,t,r,n){let a=j(("string"==typeof t?p(t):t).pathname||"/",r);if(null==a)return null;let o=S(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r]);return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(o);let i=null;for(let l=0;null==i&&l<o.length;++l){let e=U(a);i=T(o[l],e,n)}return i}function S(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(u(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let l=z([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(u(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),S(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:M(l,e.index),routesMeta:s})};return e.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let n of E(e.path))a(e,t,n);else a(e,t)}),t}function E(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=E(n.join("/")),l=[];return l.push(...i.map(e=>""===e?o:[o,e].join("/"))),a&&l.push(...i),l.map(t=>e.startsWith("/")&&""===t?"/":t)}const R=/^:[\w-]+$/,x=3,D=2,k=1,L=10,P=-2,C=e=>"*"===e;function M(e,t){let r=e.split("/"),n=r.length;return r.some(C)&&(n+=P),t&&(n+=D),r.filter(e=>!C(e)).reduce((e,t)=>e+(R.test(t)?x:""===t?k:L),n)}function T(e,t,r){void 0===r&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let l=0;l<n.length;++l){let e=n[l],s=l===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c=A({path:e.relativePath,caseSensitive:e.caseSensitive,end:s},u),d=e.route;if(!c&&s&&r&&!n[n.length-1].route.index&&(c=A({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),i.push({params:a,pathname:z([o,c.pathname]),pathnameBase:N(z([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=z([o,c.pathnameBase]))}return i}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!0);c("*"===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,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let o=new RegExp(a,t?void 0:"i");return[o,n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:(s||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function U(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return c(!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}}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 _(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 O(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function F(e,t){let r=O(e);return t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase)}function B(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=p(e):(a=i({},e),u(!a.pathname||!a.pathname.includes("?"),_("?","pathname","search",a)),u(!a.pathname||!a.pathname.includes("#"),_("#","pathname","hash",a)),u(!a.search||!a.search.includes("#"),_("#","search","hash",a)));let o,l=""===e||""===a.pathname,s=l?"/":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=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?p(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:H(n),hash:I(a)}}(a,o),d=s&&"/"!==s&&s.endsWith("/"),h=(l||"."===s)&&r.endsWith("/");return c.pathname.endsWith("/")||!d&&!h||(c.pathname+="/"),c}const z=e=>e.join("/").replace(/\/\/+/g,"/"),N=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",I=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class W{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 $(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const J=["post","put","patch","delete"],V=new Set(J),q=["get",...J],Y=new Set(q),K=new Set([301,302,303,307,308]),X=new Set([307,308]),G={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},ee=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,te=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),re="remix-router-transitions";function ne(t){const n=t.window?t.window:"undefined"!=typeof window?window:void 0,a=void 0!==n&&void 0!==n.document&&void 0!==n.document.createElement,o=!a;let l;if(u(t.routes.length>0,"You must provide a non-empty routes array to createRouter"),t.mapRouteProperties)l=t.mapRouteProperties;else if(t.detectErrorBoundary){let e=t.detectErrorBoundary;l=t=>({hasErrorBoundary:e(t)})}else l=te;let s,d,f,p={},v=g(t.routes,l,void 0,p),S=t.basename||"/",E=t.dataStrategy||fe,R=t.patchRoutesOnNavigation,x=i({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),D=null,k=new Set,L=null,P=null,C=null,M=null!=t.hydrationData,T=b(v,t.history.location,S),A=!1,U=null;if(null==T&&!R){let e=De(404,{pathname:t.history.location.pathname}),{matches:r,route:n}=xe(v);T=r,U={[n.id]:e}}if(T&&!t.hydrationData){ct(T,v,t.history.location.pathname).active&&(T=null)}if(T)if(T.some(e=>e.route.lazy))d=!1;else if(T.some(e=>e.route.loader))if(x.v7_partialHydration){let e=t.hydrationData?t.hydrationData.loaderData:null,r=t.hydrationData?t.hydrationData.errors:null;if(r){let t=T.findIndex(e=>void 0!==r[e.route.id]);d=T.slice(0,t+1).every(t=>!se(t.route,e,r))}else d=T.every(t=>!se(t.route,e,r))}else d=null!=t.hydrationData;else d=!0;else if(d=!1,T=[],x.v7_partialHydration){let e=ct(null,v,t.history.location.pathname);e.active&&e.matches&&(A=!0,T=e.matches)}let _,O,F={historyAction:t.history.action,location:t.history.location,matches:T,initialized:d,navigation:G,restoreScrollPosition:null==t.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||U,fetchers:new Map,blockers:new Map},B=e.Pop,z=!1,N=!1,H=new Map,I=null,W=!1,J=!1,V=[],q=new Set,Y=new Map,K=0,ne=-1,ie=new Map,ue=new Set,ce=new Map,he=new Map,ge=new Set,be=new Map,Le=new Map;function Ae(e,t){void 0===t&&(t={}),F=i({},F,e);let r=[],n=[];x.v7_fetcherPersist&&F.fetchers.forEach((e,t)=>{"idle"===e.state&&(ge.has(t)?n.push(t):r.push(t))}),ge.forEach(e=>{F.fetchers.has(e)||Y.has(e)||n.push(e)}),[...k].forEach(e=>e(F,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),x.v7_fetcherPersist?(r.forEach(e=>F.fetchers.delete(e)),n.forEach(e=>Qe(e))):n.forEach(e=>ge.delete(e))}function Ue(r,n,a){var o,l;let u,{flushSync:c}=void 0===a?{}:a,d=null!=F.actionData&&null!=F.navigation.formMethod&&je(F.navigation.formMethod)&&"loading"===F.navigation.state&&!0!==(null==(o=r.state)?void 0:o._isRedirect);u=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:d?F.actionData:null;let h=n.loaderData?Se(F.loaderData,n.loaderData,n.matches||[],n.errors):F.loaderData,f=F.blockers;f.size>0&&(f=new Map(f),f.forEach((e,t)=>f.set(t,Z)));let p,m=!0===z||null!=F.navigation.formMethod&&je(F.navigation.formMethod)&&!0!==(null==(l=r.state)?void 0:l._isRedirect);if(s&&(v=s,s=void 0),W||B===e.Pop||(B===e.Push?t.history.push(r,r.state):B===e.Replace&&t.history.replace(r,r.state)),B===e.Pop){let e=H.get(F.location.pathname);e&&e.has(r.pathname)?p={currentLocation:F.location,nextLocation:r}:H.has(r.pathname)&&(p={currentLocation:r,nextLocation:F.location})}else if(N){let e=H.get(F.location.pathname);e?e.add(r.pathname):(e=new Set([r.pathname]),H.set(F.location.pathname,e)),p={currentLocation:F.location,nextLocation:r}}Ae(i({},n,{actionData:u,loaderData:h,historyAction:B,location:r,initialized:!0,navigation:G,revalidation:"idle",restoreScrollPosition:ut(r,n.matches||F.matches),preventScrollReset:m,blockers:f}),{viewTransitionOpts:p,flushSync:!0===c}),B=e.Pop,z=!1,N=!1,W=!1,J=!1,V=[]}function Be(n,a,o){return r(this,null,function*(){_&&_.abort(),_=null,B=n,W=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(L&&C){let r=st(e,t);L[r]=C()}}(F.location,F.matches),z=!0===(o&&o.preventScrollReset),N=!0===(o&&o.enableViewTransition);let l=s||v,u=o&&o.overrideNavigation,c=null!=o&&o.initialHydration&&F.matches&&F.matches.length>0&&!A?F.matches:b(l,a,S),d=!0===(o&&o.flushSync);if(c&&F.initialized&&!J&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(F.location,a)&&!(o&&o.submission&&je(o.submission.formMethod)))return void Ue(a,{matches:c},{flushSync:d});let h=ct(c,l,a.pathname);if(h.active&&h.matches&&(c=h.matches),!c){let{error:e,notFoundMatches:t,route:r}=it(a.pathname);return void Ue(a,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:d})}_=new AbortController;let f,p=ye(t.history,a,_.signal,o&&o.submission);if(o&&o.pendingError)f=[Re(c).route.id,{type:m.error,error:o.pendingError}];else if(o&&o.submission&&je(o.submission.formMethod)){let n=yield function(t,n,a,o,i,l){return r(this,null,function*(){void 0===l&&(l={}),Ye();let r,s=function(e,t){let r={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return r}(n,a);if(Ae({navigation:s},{flushSync:!0===l.flushSync}),i){let e=yield dt(o,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=Re(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:m.error,error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:r}=it(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:m.error,error:t}]}}o=e.matches}let u=ze(o,n);if(u.route.action||u.route.lazy){if(r=(yield Ve("action",F,t,[u],o,null))[u.route.id],t.signal.aborted)return{shortCircuited:!0}}else r={type:m.error,error:De(405,{method:t.method,pathname:n.pathname,routeId:u.route.id})};if(Te(r)){let e;if(l&&null!=l.replace)e=l.replace;else{e=ve(r.response.headers.get("Location"),new URL(t.url),S)===F.location.pathname+F.location.search}return yield Je(t,r,!0,{submission:a,replace:e}),{shortCircuited:!0}}if(Ce(r))throw De(400,{type:"defer-action"});if(Me(r)){let t=Re(o,u.route.id);return!0!==(l&&l.replace)&&(B=e.Push),{matches:o,pendingActionResult:[t.route.id,r]}}return{matches:o,pendingActionResult:[u.route.id,r]}})}(p,a,o.submission,c,h.active,{replace:o.replace,flushSync:d});if(n.shortCircuited)return;if(n.pendingActionResult){let[e,t]=n.pendingActionResult;if(Me(t)&&$(t.error)&&404===t.error.status)return _=null,void Ue(a,{matches:n.matches,loaderData:{},errors:{[e]:t.error}})}c=n.matches||c,f=n.pendingActionResult,u=He(a,o.submission),d=!1,h.active=!1,p=ye(t.history,p.url,p.signal)}let{shortCircuited:y,matches:g,loaderData:w,errors:E}=yield function(e,n,a,o,l,u,c,d,h,f,p){return r(this,null,function*(){let r=l||He(n,u),m=u||c||Ne(r),y=!(W||x.v7_partialHydration&&h);if(o){if(y){let e=$e(p);Ae(i({navigation:r},void 0!==e?{actionData:e}:{}),{flushSync:f})}let t=yield dt(a,n.pathname,e.signal);if("aborted"===t.type)return{shortCircuited:!0};if("error"===t.type){let e=Re(t.partialMatches).route.id;return{matches:t.partialMatches,loaderData:{},errors:{[e]:t.error}}}if(!t.matches){let{error:e,notFoundMatches:t,route:r}=it(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}a=t.matches}let g=s||v,[b,w]=le(t.history,F,a,m,n,x.v7_partialHydration&&!0===h,x.v7_skipActionErrorRevalidation,J,V,q,ge,ce,ue,g,S,p);if(lt(e=>!(a&&a.some(t=>t.route.id===e))||b&&b.some(t=>t.route.id===e)),ne=++K,0===b.length&&0===w.length){let e=tt();return Ue(n,i({matches:a,loaderData:{},errors:p&&Me(p[1])?{[p[0]]:p[1].error}:null},Ee(p),e?{fetchers:new Map(F.fetchers)}:{}),{flushSync:f}),{shortCircuited:!0}}if(y){let e={};if(!o){e.navigation=r;let t=$e(p);void 0!==t&&(e.actionData=t)}w.length>0&&(e.fetchers=function(e){return e.forEach(e=>{let t=F.fetchers.get(e.key),r=Ie(void 0,t?t.data:void 0);F.fetchers.set(e.key,r)}),new Map(F.fetchers)}(w)),Ae(e,{flushSync:f})}w.forEach(e=>{Ze(e.key),e.controller&&Y.set(e.key,e.controller)});let E=()=>w.forEach(e=>Ze(e.key));_&&_.signal.addEventListener("abort",E);let{loaderResults:R,fetcherResults:D}=yield qe(F,a,b,w,e);if(e.signal.aborted)return{shortCircuited:!0};_&&_.signal.removeEventListener("abort",E),w.forEach(e=>Y.delete(e.key));let k=ke(R);if(k)return yield Je(e,k.result,!0,{replace:d}),{shortCircuited:!0};if(k=ke(D),k)return ue.add(k.key),yield Je(e,k.result,!0,{replace:d}),{shortCircuited:!0};let{loaderData:L,errors:P}=we(F,a,R,p,w,D,be);be.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&be.delete(t)})}),x.v7_partialHydration&&h&&F.errors&&(P=i({},F.errors,P));let C=tt(),M=rt(ne),T=C||M||w.length>0;return i({matches:a,loaderData:L,errors:P},T?{fetchers:new Map(F.fetchers)}:{})})}(p,a,c,h.active,u,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,d,f);y||(_=null,Ue(a,i({matches:g||c},Ee(f),{loaderData:w,errors:E})))})}function $e(e){return e&&!Me(e[1])?{[e[0]]:e[1].data}:F.actionData?0===Object.keys(F.actionData).length?null:F.actionData:void 0}function Je(o,l,s,c){return r(this,null,function*(){let{submission:r,fetcherSubmission:d,preventScrollReset:f,replace:p}=void 0===c?{}:c;l.response.headers.has("X-Remix-Revalidate")&&(J=!0);let m=l.response.headers.get("Location");u(m,"Expected a Location header on the redirect Response"),m=ve(m,new URL(o.url),S);let v=h(F.location,m,{_isRedirect:!0});if(a){let e=!1;if(l.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(ee.test(m)){const r=t.history.createURL(m);e=r.origin!==n.location.origin||null==j(r.pathname,S)}if(e)return void(p?n.location.replace(m):n.location.assign(m))}_=null;let y=!0===p||l.response.headers.has("X-Remix-Replace")?e.Replace:e.Push,{formMethod:g,formAction:b,formEncType:w}=F.navigation;!r&&!d&&g&&b&&w&&(r=Ne(F.navigation));let E=r||d;if(X.has(l.response.status)&&E&&je(E.formMethod))yield Be(y,v,{submission:i({},E,{formAction:m}),preventScrollReset:f||z,enableViewTransition:s?N:void 0});else{let e=He(v,r);yield Be(y,v,{overrideNavigation:e,fetcherSubmission:d,preventScrollReset:f||z,enableViewTransition:s?N:void 0})}})}function Ve(e,t,n,a,o,s){return r(this,null,function*(){let t,d={};try{t=yield function(e,t,n,a,o,l,s,d,h,f){return r(this,null,function*(){let n=l.map(e=>e.route.lazy?function(e,t,n){return r(this,null,function*(){if(!e.lazy)return;let r=yield e.lazy();if(!e.lazy)return;let a=n[e.id];u(a,"No route found in manifest");let o={};for(let e in r){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;c(!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||y.has(e)||(o[e]=r[e])}Object.assign(a,o),Object.assign(a,i({},t(a),{lazy:void 0}))})}(e.route,h,d):void 0),p=l.map((e,l)=>{let s=n[l],c=o.some(t=>t.route.id===e.route.id),d=n=>r(this,null,function*(){return n&&"GET"===a.method&&(e.route.lazy||e.route.loader)&&(c=!0),c?function(e,t,n,a,o,i){return r(this,null,function*(){let l,s,c=a=>{let l,u=new Promise((e,t)=>l=t);s=()=>l(),t.signal.addEventListener("abort",s);let c=r=>"function"!=typeof a?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+n.route.id+"]")):a({request:t,params:n.params,context:i},...void 0!==r?[r]:[]),d=(()=>r(this,null,function*(){try{return{type:"data",result:yield o?o(e=>c(e)):c()}}catch(e){return{type:"error",result:e}}}))();return Promise.race([d,u])};try{let r=n.route[e];if(a)if(r){let e,[t]=yield Promise.all([c(r).catch(t=>{e=t}),a]);if(void 0!==e)throw e;l=t}else{if(yield a,r=n.route[e],!r){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw De(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:m.data,result:void 0}}l=yield c(r)}else{if(!r){let e=new URL(t.url);throw De(404,{pathname:e.pathname+e.search})}l=yield c(r)}u(void 0!==l.result,"You defined "+("action"===e?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(d){return{type:m.error,result:d}}finally{s&&t.signal.removeEventListener("abort",s)}return l})}(t,a,e,s,n,f):Promise.resolve({type:m.data,result:void 0})});return i({},e,{shouldLoad:c,resolve:d})}),v=yield e({matches:p,request:a,params:l[0].params,fetcherKey:s,context:f});try{yield Promise.all(n)}catch(g){}return v})}(E,e,0,n,a,o,s,p,l)}catch(h){return a.forEach(e=>{d[e.route.id]={type:m.error,error:h}}),d}for(let[e,r]of Object.entries(t))if(Pe(r)){let t=r.result;d[e]={type:m.redirect,response:me(t,n,e,o,S,x.v7_relativeSplatPath)}}else d[e]=yield pe(r);return d})}function qe(e,n,a,o,i){return r(this,null,function*(){let l=e.matches,s=Ve("loader",0,i,a,n,null),u=Promise.all(o.map(e=>r(this,null,function*(){if(e.matches&&e.match&&e.controller){let r=(yield Ve("loader",0,ye(t.history,e.path,e.controller.signal),[e.match],e.matches,e.key))[e.match.route.id];return{[e.key]:r}}return Promise.resolve({[e.key]:{type:m.error,error:De(404,{pathname:e.path})}})}))),c=yield s,d=(yield u).reduce((e,t)=>Object.assign(e,t),{});return yield Promise.all([_e(n,c,i.signal,l,e.loaderData),Oe(n,d,o)]),{loaderResults:c,fetcherResults:d}})}function Ye(){J=!0,V.push(...lt()),ce.forEach((e,t)=>{Y.has(t)&&q.add(t),Ze(t)})}function Ke(e,t,r){void 0===r&&(r={}),F.fetchers.set(e,t),Ae({fetchers:new Map(F.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Xe(e,t,r,n){void 0===n&&(n={});let a=Re(F.matches,t);Qe(e),Ae({errors:{[a.route.id]:r},fetchers:new Map(F.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Ge(e){return he.set(e,(he.get(e)||0)+1),ge.has(e)&&ge.delete(e),F.fetchers.get(e)||Q}function Qe(e){let t=F.fetchers.get(e);!Y.has(e)||t&&"loading"===t.state&&ie.has(e)||Ze(e),ce.delete(e),ie.delete(e),ue.delete(e),x.v7_fetcherPersist&&ge.delete(e),q.delete(e),F.fetchers.delete(e)}function Ze(e){let t=Y.get(e);t&&(t.abort(),Y.delete(e))}function et(e){for(let t of e){let e=We(Ge(t).data);F.fetchers.set(t,e)}}function tt(){let e=[],t=!1;for(let r of ue){let n=F.fetchers.get(r);u(n,"Expected fetcher: "+r),"loading"===n.state&&(ue.delete(r),e.push(r),t=!0)}return et(e),t}function rt(e){let t=[];for(let[r,n]of ie)if(n<e){let e=F.fetchers.get(r);u(e,"Expected fetcher: "+r),"loading"===e.state&&(Ze(r),ie.delete(r),t.push(r))}return et(t),t.length>0}function nt(e){F.blockers.delete(e),Le.delete(e)}function at(e,t){let r=F.blockers.get(e)||Z;u("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(F.blockers);n.set(e,t),Ae({blockers:n})}function ot(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Le.size)return;Le.size>1&&c(!1,"A router only supports one blocker at a time");let a=Array.from(Le.entries()),[o,i]=a[a.length-1],l=F.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function it(e){let t=De(404,{pathname:e}),r=s||v,{matches:n,route:a}=xe(r);return lt(),{notFoundMatches:n,route:a,error:t}}function lt(e){let t=[];return be.forEach((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),be.delete(n))}),t}function st(e,t){if(P){return P(e,t.map(e=>function(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}}(e,F.loaderData)))||e.key}return e.key}function ut(e,t){if(L){let r=st(e,t),n=L[r];if("number"==typeof n)return n}return null}function ct(e,t,r){if(R){if(!e){return{active:!0,matches:w(t,r,S,!0)||[]}}if(Object.keys(e[0].params).length>0){return{active:!0,matches:w(t,r,S,!0)}}}return{active:!1,matches:null}}function dt(e,t,n,a){return r(this,null,function*(){if(!R)return{type:"success",matches:e};let r=e;for(;;){let e=null==s,i=s||v,u=p;try{yield R({signal:n,path:t,matches:r,fetcherKey:a,patch:(e,t)=>{n.aborted||de(e,t,i,u,l)}})}catch(o){return{type:"error",error:o,partialMatches:r}}finally{e&&!n.aborted&&(v=[...v])}if(n.aborted)return{type:"aborted"};let c=b(i,t,S);if(c)return{type:"success",matches:c};let d=w(i,t,S,!0);if(!d||r.length===d.length&&r.every((e,t)=>e.route.id===d[t].route.id))return{type:"success",matches:null};r=d}})}return f={get basename(){return S},get future(){return x},get state(){return F},get routes(){return v},get window(){return n},initialize:function(){if(D=t.history.listen(e=>{let{action:r,location:n,delta:a}=e;if(O)return O(),void(O=void 0);c(0===Le.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=ot({currentLocation:F.location,nextLocation:n,historyAction:r});if(o&&null!=a){let e=new Promise(e=>{O=e});return t.history.go(-1*a),void at(o,{state:"blocked",location:n,proceed(){at(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.then(()=>t.history.go(a))},reset(){let e=new Map(F.blockers);e.set(o,Z),Ae({blockers:e})}})}return Be(r,n)}),a){!function(e,t){try{let r=e.sessionStorage.getItem(re);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(r){}}(n,H);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(re,JSON.stringify(n))}catch(r){c(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}} /** * React Router v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */(n,H);n.addEventListener("pagehide",e),I=()=>n.removeEventListener("pagehide",e)}return F.initialized||Be(e.Pop,F.location,{initialHydration:!0}),f},subscribe:function(e){return k.add(e),()=>k.delete(e)},enableScrollRestoration:function(e,t,r){if(L=e,C=t,P=r||null,!M&&F.navigation===G){M=!0;let e=ut(F.location,F.matches);null!=e&&Ae({restoreScrollPosition:e})}return()=>{L=null,C=null,P=null}},navigate:function n(a,o){return r(this,null,function*(){if("number"==typeof a)return void t.history.go(a);let r=ae(F.location,F.matches,S,x.v7_prependBasename,a,x.v7_relativeSplatPath,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),{path:l,submission:s,error:u}=oe(x.v7_normalizeFormMethod,!1,r,o),c=F.location,d=h(F.location,l,o&&o.state);d=i({},d,t.history.encodeLocation(d));let f=o&&null!=o.replace?o.replace:void 0,p=e.Push;!0===f?p=e.Replace:!1===f||null!=s&&je(s.formMethod)&&s.formAction===F.location.pathname+F.location.search&&(p=e.Replace);let m=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,v=!0===(o&&o.flushSync),y=ot({currentLocation:c,nextLocation:d,historyAction:p});if(!y)return yield Be(p,d,{submission:s,pendingError:u,preventScrollReset:m,replace:o&&o.replace,enableViewTransition:o&&o.viewTransition,flushSync:v});at(y,{state:"blocked",location:d,proceed(){at(y,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),n(a,o)},reset(){let e=new Map(F.blockers);e.set(y,Z),Ae({blockers:e})}})})},fetch:function(e,n,a,i){if(o)throw new 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.");Ze(e);let l=!0===(i&&i.flushSync),c=s||v,d=ae(F.location,F.matches,S,x.v7_prependBasename,a,x.v7_relativeSplatPath,n,null==i?void 0:i.relative),h=b(c,d,S),f=ct(h,c,d);if(f.active&&f.matches&&(h=f.matches),!h)return void Xe(e,n,De(404,{pathname:d}),{flushSync:l});let{path:p,submission:m,error:y}=oe(x.v7_normalizeFormMethod,!0,d,i);if(y)return void Xe(e,n,y,{flushSync:l});let g=ze(h,p),w=!0===(i&&i.preventScrollReset);m&&je(m.formMethod)?function(e,n,a,o,i,l,c,d,h){r(this,null,function*(){function r(t){if(!t.route.action&&!t.route.lazy){let t=De(405,{method:h.formMethod,pathname:a,routeId:n});return Xe(e,n,t,{flushSync:c}),!0}return!1}if(Ye(),ce.delete(e),!l&&r(o))return;let f=F.fetchers.get(e);Ke(e,function(e,t){let r={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};return r}(h,f),{flushSync:c});let p=new AbortController,m=ye(t.history,a,p.signal,h);if(l){let t=yield dt(i,new URL(m.url).pathname,m.signal,e);if("aborted"===t.type)return;if("error"===t.type)return void Xe(e,n,t.error,{flushSync:c});if(!t.matches)return void Xe(e,n,De(404,{pathname:a}),{flushSync:c});if(i=t.matches,r(o=ze(i,a)))return}Y.set(e,p);let y=K,g=(yield Ve("action",F,m,[o],i,e))[o.route.id];if(m.signal.aborted)return void(Y.get(e)===p&&Y.delete(e));if(x.v7_fetcherPersist&&ge.has(e)){if(Te(g)||Me(g))return void Ke(e,We(void 0))}else{if(Te(g))return Y.delete(e),ne>y?void Ke(e,We(void 0)):(ue.add(e),Ke(e,Ie(h)),Je(m,g,!1,{fetcherSubmission:h,preventScrollReset:d}));if(Me(g))return void Xe(e,n,g.error)}if(Ce(g))throw De(400,{type:"defer-action"});let w=F.navigation.location||F.location,E=ye(t.history,w,p.signal),R=s||v,D="idle"!==F.navigation.state?b(R,F.navigation.location,S):F.matches;u(D,"Didn't find any matches after fetcher action");let k=++K;ie.set(e,k);let L=Ie(h,g.data);F.fetchers.set(e,L);let[P,C]=le(t.history,F,D,h,w,!1,x.v7_skipActionErrorRevalidation,J,V,q,ge,ce,ue,R,S,[o.route.id,g]);C.filter(t=>t.key!==e).forEach(e=>{let t=e.key,r=F.fetchers.get(t),n=Ie(void 0,r?r.data:void 0);F.fetchers.set(t,n),Ze(t),e.controller&&Y.set(t,e.controller)}),Ae({fetchers:new Map(F.fetchers)});let M=()=>C.forEach(e=>Ze(e.key));p.signal.addEventListener("abort",M);let{loaderResults:T,fetcherResults:A}=yield qe(F,D,P,C,E);if(p.signal.aborted)return;p.signal.removeEventListener("abort",M),ie.delete(e),Y.delete(e),C.forEach(e=>Y.delete(e.key));let U=ke(T);if(U)return Je(E,U.result,!1,{preventScrollReset:d});if(U=ke(A),U)return ue.add(U.key),Je(E,U.result,!1,{preventScrollReset:d});let{loaderData:j,errors:O}=we(F,D,T,void 0,C,A,be);if(F.fetchers.has(e)){let t=We(g.data);F.fetchers.set(e,t)}rt(k),"loading"===F.navigation.state&&k>ne?(u(B,"Expected pending action"),_&&_.abort(),Ue(F.navigation.location,{matches:D,loaderData:j,errors:O,fetchers:new Map(F.fetchers)})):(Ae({errors:O,loaderData:Se(F.loaderData,j,D,O),fetchers:new Map(F.fetchers)}),J=!1)})}(e,n,p,g,h,f.active,l,w,m):(ce.set(e,{routeId:n,path:p}),function(e,n,a,o,i,l,s,c,d){r(this,null,function*(){let r=F.fetchers.get(e);Ke(e,Ie(d,r?r.data:void 0),{flushSync:s});let h=new AbortController,f=ye(t.history,a,h.signal);if(l){let t=yield dt(i,new URL(f.url).pathname,f.signal,e);if("aborted"===t.type)return;if("error"===t.type)return void Xe(e,n,t.error,{flushSync:s});if(!t.matches)return void Xe(e,n,De(404,{pathname:a}),{flushSync:s});i=t.matches,o=ze(i,a)}Y.set(e,h);let p=K,m=(yield Ve("loader",F,f,[o],i,e))[o.route.id];if(Ce(m)&&(m=(yield Fe(m,f.signal,!0))||m),Y.get(e)===h&&Y.delete(e),!f.signal.aborted){if(!ge.has(e))return Te(m)?ne>p?void Ke(e,We(void 0)):(ue.add(e),void(yield Je(f,m,!1,{preventScrollReset:c}))):void(Me(m)?Xe(e,n,m.error):(u(!Ce(m),"Unhandled fetcher deferred data"),Ke(e,We(m.data))));Ke(e,We(void 0))}})}(e,n,p,g,h,f.active,l,w,m))},revalidate:function(){Ye(),Ae({revalidation:"loading"}),"submitting"!==F.navigation.state&&("idle"!==F.navigation.state?Be(B||F.historyAction,F.navigation.location,{overrideNavigation:F.navigation,enableViewTransition:!0===N}):Be(F.historyAction,F.location,{startUninterruptedRevalidation:!0}))},createHref:e=>t.history.createHref(e),encodeLocation:e=>t.history.encodeLocation(e),getFetcher:Ge,deleteFetcher:function(e){let t=(he.get(e)||0)-1;t<=0?(he.delete(e),ge.add(e),x.v7_fetcherPersist||Qe(e)):he.set(e,t),Ae({fetchers:new Map(F.fetchers)})},dispose:function(){D&&D(),I&&I(),k.clear(),_&&_.abort(),F.fetchers.forEach((e,t)=>Qe(t)),F.blockers.forEach((e,t)=>nt(t))},getBlocker:function(e,t){let r=F.blockers.get(e)||Z;return Le.get(e)!==t&&Le.set(e,t),r},deleteBlocker:nt,patchRoutes:function(e,t){let r=null==s;de(e,t,s||v,p,l),r&&(v=[...v],Ae({}))},_internalFetchControllers:Y,_internalActiveDeferreds:be,_internalSetRoutes:function(e){p={},s=g(e,l,void 0,p)}},f}function ae(e,t,r,n,a,o,i,l){let s,u;if(i){s=[];for(let e of t)if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=B(a||".",F(s,o),j(e.pathname,r)||e.pathname,"path"===l);if(null==a&&(c.search=e.search,c.hash=e.hash),(null==a||""===a||"."===a)&&u){let e=Be(c.search);if(u.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();c.search=r?"?"+r:""}}return n&&"/"!==r&&(c.pathname="/"===c.pathname?r:z([r,c.pathname])),f(c)}function oe(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!Y.has(a.toLowerCase())))return{path:r,error:De(405,{method:n.formMethod})};var a;let o,i,l=()=>({path:r,error:De(400,{type:"invalid-body"})}),s=n.formMethod||"get",c=e?s.toUpperCase():s.toLowerCase(),d=Le(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!je(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(!je(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(v){return l()}}}if(u("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=ge(n.formData),i=n.formData;else if(n.body instanceof FormData)o=ge(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=be(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=be(o)}catch(v){return l()}let h={formMethod:c,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(je(h.formMethod))return{path:r,submission:h};let m=p(r);return t&&m.search&&Be(m.search)&&o.append("index",""),m.search="?"+o,{path:f(m),submission:h}}function ie(e,t,r){void 0===r&&(r=!1);let n=e.findIndex(e=>e.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function le(e,t,r,n,a,o,l,s,u,c,d,h,f,p,m,v){let y=v?Me(v[1])?v[1].error:v[1].data:void 0,g=e.createURL(t.location),w=e.createURL(a),S=r;o&&t.errors?S=ie(r,Object.keys(t.errors)[0],!0):v&&Me(v[1])&&(S=ie(r,v[0]));let E=v?v[1].statusCode:void 0,R=l&&E&&E>=400,x=S.filter((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return se(a,t.loaderData,t.errors);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||u.some(t=>t===e.route.id))return!0;let l=t.matches[r],c=e;return ce(e,i({currentUrl:g,currentParams:l.params,nextUrl:w,nextParams:c.params},n,{actionResult:y,actionStatus:E,defaultShouldRevalidate:!R&&(s||g.pathname+g.search===w.pathname+w.search||g.search!==w.search||ue(l,c))}))}),D=[];return h.forEach((e,a)=>{if(o||!r.some(t=>t.route.id===e.routeId)||d.has(a))return;let l=b(p,e.path,m);if(!l)return void D.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let u=t.fetchers.get(a),h=ze(l,e.path),v=!1;f.has(a)?v=!1:c.has(a)?(c.delete(a),v=!0):v=u&&"idle"!==u.state&&void 0===u.data?s:ce(h,i({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:r[r.length-1].params},n,{actionResult:y,actionStatus:E,defaultShouldRevalidate:!R&&s})),v&&D.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:h,controller:new AbortController})}),[x,D]}function se(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=null!=t&&void 0!==t[e.id],a=null!=r&&void 0!==r[e.id];return!(!n&&a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function ue(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ce(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function de(e,t,r,n,a){var o;let i;if(e){let t=n[e];u(t,"No route found to patch children into: routeId = "+e),t.children||(t.children=[]),i=t.children}else i=r;let l=g(t.filter(e=>!i.some(t=>he(e,t))),a,[e||"_","patch",String((null==(o=i)?void 0:o.length)||"0")],n);i.push(...l)}function he(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every((e,r)=>{var n;return null==(n=t.children)?void 0:n.some(t=>he(e,t))}))}function fe(e){return r(this,null,function*(){let{matches:t}=e,r=t.filter(e=>e.shouldLoad);return(yield Promise.all(r.map(e=>e.resolve()))).reduce((e,t,n)=>Object.assign(e,{[r[n].route.id]:t}),{})})}function pe(e){return r(this,null,function*(){let{result:t,type:r}=e;if(Ue(t)){let e;try{let r=t.headers.get("Content-Type");e=r&&/\bapplication\/json\b/.test(r)?null==t.body?null:yield t.json():yield t.text()}catch(d){return{type:m.error,error:d}}return r===m.error?{type:m.error,error:new W(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:m.data,data:e,statusCode:t.status,headers:t.headers}}var n,a,o,i,l,s,u,c;return r===m.error?Ae(t)?t.data instanceof Error?{type:m.error,error:t.data,statusCode:null==(o=t.init)?void 0:o.status,headers:null!=(i=t.init)&&i.headers?new Headers(t.init.headers):void 0}:{type:m.error,error:new W((null==(n=t.init)?void 0:n.status)||500,void 0,t.data),statusCode:$(t)?t.status:void 0,headers:null!=(a=t.init)&&a.headers?new Headers(t.init.headers):void 0}:{type:m.error,error:t,statusCode:$(t)?t.status:void 0}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:m.deferred,deferredData:t,statusCode:null==(l=t.init)?void 0:l.status,headers:(null==(s=t.init)?void 0:s.headers)&&new Headers(t.init.headers)}:Ae(t)?{type:m.data,data:t.data,statusCode:null==(u=t.init)?void 0:u.status,headers:null!=(c=t.init)&&c.headers?new Headers(t.init.headers):void 0}:{type:m.data,data:t}})}function me(e,t,r,n,a,o){let i=e.headers.get("Location");if(u(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ee.test(i)){let l=n.slice(0,n.findIndex(e=>e.route.id===r)+1);i=ae(new URL(t.url),l,a,!0,i,o),e.headers.set("Location",i)}return e}function ve(e,t,r){if(ee.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=null!=j(a.pathname,r);if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function ye(e,t,r,n){let a=e.createURL(Le(t)).toString(),o={signal:r};if(n&&je(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=ge(n.formData):o.body=n.formData}return new Request(a,o)}function ge(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function be(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function we(e,t,r,n,a,o,l){let{loaderData:s,errors:c}=function(e,t,r,n){let a,o={},i=null,l=!1,s={},c=r&&Me(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let d=r.route.id,h=t[d];if(u(!Te(h),"Cannot handle redirect results in processLoaderData"),Me(h)){let t=h.error;void 0!==c&&(t=c,c=void 0),i=i||{};{let r=Re(e,d);null==i[r.route.id]&&(i[r.route.id]=t)}o[d]=void 0,l||(l=!0,a=$(h.error)?h.error.status:500),h.headers&&(s[d]=h.headers)}else Ce(h)?(n.set(d,h.deferredData),o[d]=h.deferredData.data,null==h.statusCode||200===h.statusCode||l||(a=h.statusCode),h.headers&&(s[d]=h.headers)):(o[d]=h.data,h.statusCode&&200!==h.statusCode&&!l&&(a=h.statusCode),h.headers&&(s[d]=h.headers))}),void 0!==c&&r&&(i={[r[0]]:c},o[r[0]]=void 0),{loaderData:o,errors:i,statusCode:a||200,loaderHeaders:s}}(t,r,n,l);return a.forEach(t=>{let{key:r,match:n,controller:a}=t,l=o[r];if(u(l,"Did not find corresponding fetcher result"),!a||!a.signal.aborted)if(Me(l)){let t=Re(e.matches,null==n?void 0:n.route.id);c&&c[t.route.id]||(c=i({},c,{[t.route.id]:l.error})),e.fetchers.delete(r)}else if(Te(l))u(!1,"Unhandled fetcher revalidation redirect");else if(Ce(l))u(!1,"Unhandled fetcher deferred data");else{let t=We(l.data);e.fetchers.set(r,t)}}),{loaderData:s,errors:c}}function Se(e,t,r,n){let a=i({},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 Ee(e){return e?Me(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Re(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 xe(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 De(e,t){let{pathname:r,routeId:n,method:a,type:o,message:i}=void 0===t?{}:t,l="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(l="Bad Request",a&&r&&n?s="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?s="defer() is not supported in actions":"invalid-body"===o&&(s="Unable to encode submission body")):403===e?(l="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):404===e?(l="Not Found",s='No route matches URL "'+r+'"'):405===e&&(l="Method Not Allowed",a&&r&&n?s="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&&(s='Invalid request method "'+a.toUpperCase()+'"')),new W(e||500,l,new Error(s),!0)}function ke(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[e,n]=t[r];if(Te(n))return{key:e,result:n}}}function Le(e){return f(i({},"string"==typeof e?p(e):e,{hash:""}))}function Pe(e){return Ue(e.result)&&K.has(e.result.status)}function Ce(e){return e.type===m.deferred}function Me(e){return e.type===m.error}function Te(e){return(e&&e.type)===m.redirect}function Ae(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Ue(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function je(e){return V.has(e.toLowerCase())}function _e(e,t,n,a,o){return r(this,null,function*(){let r=Object.entries(t);for(let i=0;i<r.length;i++){let[l,s]=r[i],u=e.find(e=>(null==e?void 0:e.route.id)===l);if(!u)continue;let c=a.find(e=>e.route.id===u.route.id),d=null!=c&&!ue(c,u)&&void 0!==(o&&o[u.route.id]);Ce(s)&&d&&(yield Fe(s,n,!1).then(e=>{e&&(t[l]=e)}))}})}function Oe(e,t,n){return r(this,null,function*(){for(let r=0;r<n.length;r++){let{key:a,routeId:o,controller:i}=n[r],l=t[a];e.find(e=>(null==e?void 0:e.route.id)===o)&&(Ce(l)&&(u(i,"Expected an AbortController for revalidating fetcher deferred result"),yield Fe(l,i.signal,!0).then(e=>{e&&(t[a]=e)})))}})}function Fe(e,t,n){return r(this,null,function*(){if(void 0===n&&(n=!1),!(yield e.deferredData.resolveData(t))){if(n)try{return{type:m.data,data:e.deferredData.unwrappedData}}catch(r){return{type:m.error,error:r}}return{type:m.data,data:e.deferredData.data}}})}function Be(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function ze(e,t){let r="string"==typeof t?p(t).search:t.search;if(e[e.length-1].route.index&&Be(r||""))return e[e.length-1];let n=O(e);return n[n.length-1]}function Ne(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function He(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ie(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function We(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 $e(){return $e=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},$e.apply(this,arguments)}const Je=n.createContext(null),Ve=n.createContext(null),qe=n.createContext(null),Ye=n.createContext(null),Ke=n.createContext({outlet:null,matches:[],isDataRoute:!1}),Xe=n.createContext(null);function Ge(){return null!=n.useContext(Ye)}function Qe(){return Ge()||u(!1),n.useContext(Ye).location}function Ze(e){n.useContext(qe).static||n.useLayoutEffect(e)}function et(){let{isDataRoute:e}=n.useContext(Ke);return e?function(){let{router:e}=function(){let e=n.useContext(Je);return e||u(!1),e}(ut.UseNavigateStable),t=dt(ct.UseNavigateStable),r=n.useRef(!1);return Ze(()=>{r.current=!0}),n.useCallback(function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,$e({fromRouteId:t},a)))},[e,t])}():function(){Ge()||u(!1);let e=n.useContext(Je),{basename:t,future:r,navigator:a}=n.useContext(qe),{matches:o}=n.useContext(Ke),{pathname:i}=Qe(),l=JSON.stringify(F(o,r.v7_relativeSplatPath)),s=n.useRef(!1);return Ze(()=>{s.current=!0}),n.useCallback(function(r,n){if(void 0===n&&(n={}),!s.current)return;if("number"==typeof r)return void a.go(r);let o=B(r,JSON.parse(l),i,"path"===n.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:z([t,o.pathname])),(n.replace?a.replace:a.push)(o,n.state,n)},[t,a,l,i,e])}()}const tt=n.createContext(null);function rt(){let{matches:e}=n.useContext(Ke),t=e[e.length-1];return t?t.params:{}}function nt(e,t){let{relative:r}=void 0===t?{}:t,{future:a}=n.useContext(qe),{matches:o}=n.useContext(Ke),{pathname:i}=Qe(),l=JSON.stringify(F(o,a.v7_relativeSplatPath));return n.useMemo(()=>B(e,JSON.parse(l),i,"path"===r),[e,l,i,r])}function at(e,t,r,a){Ge()||u(!1);let{navigator:o,static:i}=n.useContext(qe),{matches:l}=n.useContext(Ke),s=l[l.length-1],c=s?s.params:{};!s||s.pathname;let d,h=s?s.pathnameBase:"/";s&&s.route,d=Qe();let f=d.pathname||"/",p=f;if("/"!==h){let e=h.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=!i&&r&&r.matches&&r.matches.length>0?r.matches:b(e,{pathname:p}),v=function(e,t,r,a){var o;void 0===t&&(t=[]);void 0===r&&(r=null);void 0===a&&(a=null);if(null==e){var i;if(!r)return null;if(r.errors)e=r.matches;else{if(!(null!=(i=a)&&i.v7_partialHydration&&0===t.length&&!r.initialized&&r.matches.length>0))return null;e=r.matches}}let l=e,s=null==(o=r)?void 0:o.errors;if(null!=s){let e=l.findIndex(e=>e.route.id&&void 0!==(null==s?void 0:s[e.route.id]));e>=0||u(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,d=-1;if(r&&a&&a.v7_partialHydration)for(let n=0;n<l.length;n++){let e=l[n];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(d=n),e.route.id){let{loaderData:t,errors:n}=r,a=e.route.loader&&void 0===t[e.route.id]&&(!n||void 0===n[e.route.id]);if(e.route.lazy||a){c=!0,l=d>=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight((e,a,o)=>{let i,u=!1,h=null,f=null;var p;r&&(i=s&&a.route.id?s[a.route.id]:void 0,h=a.route.errorElement||it,c&&(d<0&&0===o?(ht[p="route-fallback"]||(ht[p]=!0),u=!0,f=null):d===o&&(u=!0,f=a.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=i?h:u?f:a.route.Component?n.createElement(a.route.Component,null):a.route.element?a.route.element:e,n.createElement(st,{match:a,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(a.route.ErrorBoundary||a.route.errorElement||0===o)?n.createElement(lt,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:z([h,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:z([h,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),l,r,a);return v}function ot(){let e=function(){var e;let t=n.useContext(Xe),r=function(){let e=n.useContext(Ve);return e||u(!1),e}(),a=dt();if(void 0!==t)return t;return null==(e=r.errors)?void 0:e[a]}(),t=$(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return n.createElement(n.Fragment,null,n.createElement("h2",null,"Unexpected Application Error!"),n.createElement("h3",{style:{fontStyle:"italic"}},t),r?n.createElement("pre",{style:a},r):null,null)}const it=n.createElement(ot,null);class lt extends n.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?n.createElement(Ke.Provider,{value:this.props.routeContext},n.createElement(Xe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function st(e){let{routeContext:t,match:r,children:a}=e,o=n.useContext(Je);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),n.createElement(Ke.Provider,{value:t},a)}var ut=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ut||{}),ct=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ct||{});function dt(e){let t=function(){let e=n.useContext(Ke);return e||u(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||u(!1),r.route.id}const ht={};function ft(e){let{to:t,replace:r,state:a,relative:o}=e;Ge()||u(!1);let{future:i,static:l}=n.useContext(qe),{matches:s}=n.useContext(Ke),{pathname:c}=Qe(),d=et(),h=B(t,F(s,i.v7_relativeSplatPath),c,"path"===o),f=JSON.stringify(h);return n.useEffect(()=>d(JSON.parse(f),{replace:r,state:a,relative:o}),[d,f,o,r,a]),null}function pt(e){return function(e){let t=n.useContext(Ke).outlet;return t?n.createElement(tt.Provider,{value:e},t):t}(e.context)}function mt(t){let{basename:r="/",children:a=null,location:o,navigationType:i=e.Pop,navigator:l,static:s=!1,future:c}=t;Ge()&&u(!1);let d=r.replace(/^\/*/,"/"),h=n.useMemo(()=>({basename:d,navigator:l,static:s,future:$e({v7_relativeSplatPath:!1},c)}),[d,c,l,s]);"string"==typeof o&&(o=p(o));let{pathname:f="/",search:m="",hash:v="",state:y=null,key:g="default"}=o,b=n.useMemo(()=>{let e=j(f,d);return null==e?null:{location:{pathname:e,search:m,hash:v,state:y,key:g},navigationType:i}},[d,f,m,v,y,g,i]);return null==b?null:n.createElement(qe.Provider,{value:h},n.createElement(Ye.Provider,{children:a,value:b}))}function vt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:n.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:n.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:n.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t} /** * React Router DOM v6.30.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function yt(){return yt=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},yt.apply(this,arguments)}function gt(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}new Promise(()=>{});const bt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(Nt){}function wt(e,t){return ne({basename:void 0,future:yt({},void 0,{v7_prependBasename:!0}),history:s({window:void 0}),hydrationData:St(),routes:e,mapRouteProperties:vt,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function St(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=yt({},t,{errors:Et(t.errors)})),t}function Et(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&"RouteErrorResponse"===a.__type)r[n]=new W(a.status,a.statusText,a.data,!0===a.internal);else if(a&&"Error"===a.__type){if(a.__subType){let e=window[a.__subType];if("function"==typeof e)try{let t=new e(a.message);t.stack="",r[n]=t}catch(Nt){}}if(null==r[n]){let e=new Error(a.message);e.stack="",r[n]=e}}else r[n]=a;return r}const Rt=n.createContext({isTransitioning:!1}),xt=n.createContext(new Map),Dt=a.startTransition,kt=o.flushSync;function Lt(e){kt?kt(e):e()}class Pt{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}}function Ct(e){let{fallbackElement:t,router:a,future:o}=e,[i,l]=n.useState(a.state),[s,u]=n.useState(),[c,d]=n.useState({isTransitioning:!1}),[h,f]=n.useState(),[p,m]=n.useState(),[v,y]=n.useState(),g=n.useRef(new Map),{v7_startTransition:b}=o||{},w=n.useCallback(e=>{b?function(e){Dt?Dt(e):e()}(e):e()},[b]),S=n.useCallback((e,t)=>{let{deletedFetchers:r,flushSync:n,viewTransitionOpts:o}=t;e.fetchers.forEach((e,t)=>{void 0!==e.data&&g.current.set(t,e.data)}),r.forEach(e=>g.current.delete(e));let i=null==a.window||null==a.window.document||"function"!=typeof a.window.document.startViewTransition;if(o&&!i){if(n){Lt(()=>{p&&(h&&h.resolve(),p.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})});let t=a.window.document.startViewTransition(()=>{Lt(()=>l(e))});return t.finished.finally(()=>{Lt(()=>{f(void 0),m(void 0),u(void 0),d({isTransitioning:!1})})}),void Lt(()=>m(t))}p?(h&&h.resolve(),p.skipTransition(),y({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(u(e),d({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else n?Lt(()=>l(e)):w(()=>l(e))},[a.window,p,h,g,w]);n.useLayoutEffect(()=>a.subscribe(S),[a,S]),n.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new Pt)},[c]),n.useEffect(()=>{if(h&&s&&a.window){let e=s,t=h.promise,n=a.window.document.startViewTransition(()=>r(this,null,function*(){w(()=>l(e)),yield t}));n.finished.finally(()=>{f(void 0),m(void 0),u(void 0),d({isTransitioning:!1})}),m(n)}},[w,s,h,a.window]),n.useEffect(()=>{h&&s&&i.location.key===s.location.key&&h.resolve()},[h,p,i.location,s]),n.useEffect(()=>{!c.isTransitioning&&v&&(u(v.state),d({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),y(void 0))},[c.isTransitioning,v]),n.useEffect(()=>{},[]);let E=n.useMemo(()=>({createHref:a.createHref,encodeLocation:a.encodeLocation,go:e=>a.navigate(e),push:(e,t,r)=>a.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>a.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})}),[a]),R=a.basename||"/",x=n.useMemo(()=>({router:a,navigator:E,static:!1,basename:R}),[a,E,R]),D=n.useMemo(()=>({v7_relativeSplatPath:a.future.v7_relativeSplatPath}),[a.future.v7_relativeSplatPath]);return n.useEffect(()=>function(e,t){null==e||e.v7_startTransition,void 0!==(null==e?void 0:e.v7_relativeSplatPath)||t&&t.v7_relativeSplatPath,t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}(o,a.future),[o,a.future]),n.createElement(n.Fragment,null,n.createElement(Je.Provider,{value:x},n.createElement(Ve.Provider,{value:i},n.createElement(xt.Provider,{value:g.current},n.createElement(Rt.Provider,{value:c},n.createElement(mt,{basename:R,location:i.location,navigationType:i.historyAction,navigator:E,future:D},i.initialized||a.future.v7_partialHydration?n.createElement(Mt,{routes:a.routes,future:a.future,state:i}):t))))),null)}const Mt=n.memo(Tt);function Tt(e){let{routes:t,future:r,state:n}=e;return at(t,0,n,r)}const At="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ut=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jt=n.forwardRef(function(e,t){let r,{onClick:a,relative:o,reloadDocument:i,replace:l,state:s,target:c,to:d,preventScrollReset:h,viewTransition:p}=e,m=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,bt),{basename:v}=n.useContext(qe),y=!1;if("string"==typeof d&&Ut.test(d)&&(r=d,At))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),r=j(t.pathname,v);t.origin===e.origin&&null!=r?d=r+t.search+t.hash:y=!0}catch(Nt){}let g=function(e,t){let{relative:r}=void 0===t?{}:t;Ge()||u(!1);let{basename:a,navigator:o}=n.useContext(qe),{hash:i,pathname:l,search:s}=nt(e,{relative:r}),c=l;return"/"!==a&&(c="/"===l?a:z([a,l])),o.createHref({pathname:c,search:s,hash:i})}(d,{relative:o}),b=function(e,t){let{target:r,replace:a,state:o,preventScrollReset:i,relative:l,viewTransition:s}=void 0===t?{}:t,u=et(),c=Qe(),d=nt(e,{relative:l});return n.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==a?a:f(c)===f(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:l,viewTransition:s})}},[c,u,d,a,o,r,e,i,l,s])}(d,{replace:l,state:s,target:c,preventScrollReset:h,relative:o,viewTransition:p});return n.createElement("a",yt({},m,{href:r||g,onClick:y||i?a:function(e){a&&a(e),e.defaultPrevented||b(e)},ref:t,target:c}))});var _t,Ot,Ft,Bt;function zt(e){let t=n.useRef(gt(e)),r=n.useRef(!1),a=Qe(),o=n.useMemo(()=>function(e,t){let r=gt(e);return t&&t.forEach((e,n)=>{r.has(n)||t.getAll(n).forEach(e=>{r.append(n,e)})}),r}(a.search,r.current?null:t.current),[a.search]),i=et(),l=n.useCallback((e,t)=>{const n=gt("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)},[i,o]);return[o,l]}(Ot=_t||(_t={})).UseScrollRestoration="useScrollRestoration",Ot.UseSubmit="useSubmit",Ot.UseSubmitFetcher="useSubmitFetcher",Ot.UseFetcher="useFetcher",Ot.useViewTransitionState="useViewTransitionState",(Bt=Ft||(Ft={})).UseFetcher="useFetcher",Bt.UseFetchers="useFetchers",Bt.UseScrollRestoration="useScrollRestoration";export{jt as L,ft as N,pt as O,Ct as R,et as a,rt as b,wt as c,zt as d,Qe as u};