@dhzh/foundry 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- /*! LICENSE: lib-router.1aa7ec2bfc.js.LICENSE.txt */
2
- "use strict";(self.rspackChunk_dhzh_foundry_app=self.rspackChunk_dhzh_foundry_app||[]).push([[535],{8071(e,t,r){r.d(t,{C5:()=>y,sv:()=>v,Ix:()=>g,pg:()=>f,jC:()=>d});var n=r(7629),a=r(9932),o=r(7527),i=r(4508),l=r(8189);let s={};function u(e,t){e||s[t]||(s[t]=!0,console.warn(t))}var c=r(6255);let d=["HydrateFallback","hydrateFallbackElement"];var h=class{status="pending";promise;resolve;reject;constructor(){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 f({router:e,flushSync:t,onError:r,useTransitions:n}){n=(0,i.OA)()||n;let[o,l]=c.useState(e.state),[s,d]=(0,c.useOptimistic)(o),[y,v]=c.useState(),[w,b]=c.useState({isTransitioning:!1}),[R,E]=c.useState(),[x,S]=c.useState(),[L,P]=c.useState(),k=c.useRef(new Map),C=c.useCallback((o,{deletedFetchers:i,newErrors:s,flushSync:h,viewTransitionOpts:f})=>{s&&r&&Object.values(s).forEach(e=>r(e,{location:o.location,params:o.matches[0]?.params??{},pattern:(0,a.gU)(o.matches)})),o.fetchers.forEach((e,t)=>{void 0!==e.data&&k.current.set(t,e.data)}),i.forEach(e=>k.current.delete(e)),u(!1===h||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let m=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(u(null==f||m,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!f||!m)return void(t&&h?t(()=>l(o)):!1===n?l(o):c.startTransition(()=>{!0===n&&d(e=>p(e,o)),l(o)}));if(t&&h){t(()=>{x&&(R?.resolve(),x.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:f.currentLocation,nextLocation:f.nextLocation})});let r=e.window.document.startViewTransition(()=>{t(()=>l(o))});r.finished.finally(()=>{t(()=>{E(void 0),S(void 0),v(void 0),b({isTransitioning:!1})})}),t(()=>S(r));return}x?(R?.resolve(),x.skipTransition(),P({state:o,currentLocation:f.currentLocation,nextLocation:f.nextLocation})):(v(o),b({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}))},[e.window,t,x,R,n,d,r]);c.useLayoutEffect(()=>e.subscribe(C),[e,C]),c.useEffect(()=>{w.isTransitioning&&!w.flushSync&&E(new h)},[w]),c.useEffect(()=>{if(R&&y&&e.window){let t=R.promise,r=e.window.document.startViewTransition(async()=>{!1===n?l(y):c.startTransition(()=>{!0===n&&d(e=>p(e,y)),l(y)}),await t});r.finished.finally(()=>{E(void 0),S(void 0),v(void 0),b({isTransitioning:!1})}),S(r)}},[y,R,e.window,n,d]),c.useEffect(()=>{R&&y&&s.location.key===y.location.key&&R.resolve()},[R,x,s.location,y]),c.useEffect(()=>{!w.isTransitioning&&L&&(v(L.state),b({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),P(void 0))},[w.isTransitioning,L]);let D=c.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),M=e.basename||"/",O=c.useMemo(()=>({router:e,navigator:D,static:!1,basename:M,onError:r}),[e,D,M,r]);return c.createElement(c.Fragment,null,c.createElement(i.hf.Provider,{value:O},c.createElement(i.ay.Provider,{value:s},c.createElement(i.QH.Provider,{value:k.current},c.createElement(i.KZ.Provider,{value:w},c.createElement(g,{basename:M,location:s.location,navigationType:s.historyAction,navigator:D,useTransitions:n},c.createElement(m,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function p(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}let m=c.memo(function({routes:e,manifest:t,future:r,state:n,isStatic:a,onError:o}){return(0,l.uG)(e,void 0,{manifest:t,state:n,isStatic:a,onError:o,future:r})});function y({to:e,replace:t,state:r,relative:s}){(0,n.V1)((0,l.Ri)(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u,navigator:d}=c.useContext(i._3);(0,n.$e)(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:h}=c.useContext(i.Pl),{pathname:f}=(0,l.zy)(),p=(0,l.Zp)(),m=(0,a.Gh)(e,(0,a.PD)(h),f,"path"===s);(0,o.c)("string"==typeof e?e:(0,n.AO)(e),d.createHref(m),(0,o.Y)(d),"reject");let v=JSON.stringify(m);return c.useEffect(()=>{p(JSON.parse(v),{replace:t,state:r,relative:s})},[p,v,s,t,r]),null}function v(e){return(0,l.P1)(e.context)}function g({basename:e="/",children:t=null,location:r,navigationType:o="POP",navigator:s,static:u=!1,useTransitions:d}){(0,n.V1)(!(0,l.Ri)(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),f=c.useMemo(()=>({basename:h,navigator:s,static:u,useTransitions:d,future:{}}),[h,s,u,d]);"string"==typeof r&&(r=(0,n.Rr)(r));let{pathname:p="/",search:m="",hash:y="",state:v=null,key:w="default",mask:b}=r,R=c.useMemo(()=>{let e=(0,a.pb)(p,h);return null==e?null:{location:{pathname:e,search:m,hash:y,state:v,key:w,mask:b},navigationType:o}},[h,p,m,y,v,w,o,b]);return((0,n.$e)(null!=R,`<Router basename="${h}"> is not able to match the URL "${p}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),null==R)?null:c.createElement(i._3.Provider,{value:f},c.createElement(i.di.Provider,{children:t,value:R}))}c.Component},4508(e,t,r){var n=r(6255);let a=n.createContext(null);a.displayName="DataRouter";let o=n.createContext(null);o.displayName="DataRouterState";let i=n.createContext(!1);function l(){return n.useContext(i)}let s=n.createContext({isTransitioning:!1});s.displayName="ViewTransition";let u=n.createContext(new Map);u.displayName="Fetchers";let c=n.createContext(null);c.displayName="Await";let d=n.createContext(null);d.displayName="Navigation";let h=n.createContext(null);h.displayName="Location";let f=n.createContext({outlet:null,matches:[],isDataRoute:!1});f.displayName="Route";let p=n.createContext(null);p.displayName="RouteError",r.d(t,{OA:()=>l},{Bu:i,KZ:s,Pl:f,QH:u,_3:d,ay:o,di:h,hf:a,m4:c,xN:p})},6653(e,t,r){var n=r(6255),a=r(7965),o=r(8071);function i(e){return n.createElement(o.pg,{flushSync:a.flushSync,...e})}r.d(t,{p:()=>i})},6551(e,t,r){r.d(t,{N_:()=>O,k2:()=>T,Ge:()=>M,ok:()=>A});var n=r(2872),a=r(7629),o=r(9932),i=r(9667),l=r(4508),s=r(8189),u=r(8071);let c="application/x-www-form-urlencoded";function d(e){return"u">typeof HTMLElement&&e instanceof HTMLElement}function h(e=""){return 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]])},[]))}let f=null,p=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function m(e){return null==e||p.has(e)?e:((0,a.$e)(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${c}"`),null)}function y(e,t){if(!1===e||null==e)throw Error(t)}async function v(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function g(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function w(e,t,r){var n;let a,o;return n=(await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await v(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(g).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),a=new Set,o=new Set(void 0),n.reduce((e,t)=>{!1;let r=JSON.stringify(function(e){let t={};for(let r of Object.keys(e).sort())t[r]=e[r];return t}(t));return a.has(r)||(a.add(r),e.push({key:r,link:t})),e},[])}function b(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}var R=r(6255);function E(e,t){let r="string"==typeof e?new URL(e,"u"<typeof window?"server://singlefetch/":window.location.origin):e;return r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}Symbol("SingleFetchRedirect");let x=R.createContext(void 0);function S(){let e=R.useContext(x);return y(e,"You must render this element inside a <HydratedRouter> element"),e}function L(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function P({page:e,...t}){let r,n=(0,l.OA)(),{nonce:a}=S(),{router:i}=(y(r=R.useContext(l.hf),"You must render this element inside a <DataRouterContext.Provider> element"),r),s=R.useMemo(()=>(0,o.ue)(i.routes,e,i.basename),[i.routes,e,i.basename]);return s?(null==t.nonce&&a&&(t={...t,nonce:a}),n)?R.createElement(k,{page:e,matches:s,...t}):R.createElement(C,{page:e,matches:s,...t}):null}function k({page:e,matches:t,...r}){let n=(0,s.zy)(),a=R.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=E(e,"rsc"),a=!1,o=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?a=!0:o.push(e.route.id);return a&&o.length>0&&r.searchParams.set("_routes",o.join(",")),[r.pathname+r.search]},[e,n,t]);return R.createElement(R.Fragment,null,a.map(e=>R.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})))}function C({page:e,matches:t,...r}){let n,a=(0,s.zy)(),{manifest:o,routeModules:i}=S(),{loaderData:u,matches:c}=(y(n=R.useContext(l.ay),"You must render this element inside a <DataRouterStateContext.Provider> element"),n),d=R.useMemo(()=>b(e,t,c,o,a,"data"),[e,t,c,o,a]),h=R.useMemo(()=>b(e,t,c,o,a,"assets"),[e,t,c,o,a]),f=R.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let r=new Set,n=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in u&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?n=!0:r.add(e.route.id))}),0===r.size)return[];let l=E(e,"data");return n&&r.size>0&&l.searchParams.set("_routes",t.filter(e=>r.has(e.route.id)).map(e=>e.route.id).join(",")),[l.pathname+l.search]},[u,a,o,d,t,e,i]),p=R.useMemo(()=>(function(e,t,{includeHydrateFallback:r}={}){return[...new Set(e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))]})(h,o),[h,o]),m=function(e){let{manifest:t,routeModules:r}=S(),[n,a]=R.useState([]);return R.useEffect(()=>{let n=!1;return w(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}(h);return R.createElement(R.Fragment,null,f.map(e=>R.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),p.map(e=>R.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),m.map(({key:e,link:t})=>R.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}x.displayName="FrameworkContext";let D="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{D&&(window.__reactRouterVersion="8")}catch{}function M(e,t){let r;return(0,i.aE)({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:(0,a.TM)({window:t?.window}),hydrationData:t?.hydrationData||((r=window?.__staticRouterHydrationData)&&r.errors&&(r={...r,errors:function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new o.cj(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if("string"==typeof n.__subType&&o.WF.includes(n.__subType)){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch{}}if(null==r[e]){let t=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(r.errors)}),r),routes:e,mapRouteProperties:o.MT,hydrationRouteProperties:u.jC,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}let O=R.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:i,reloadDocument:u,replace:c,mask:d,state:h,target:f,to:p,preventScrollReset:m,viewTransition:y,defaultShouldRevalidate:v,...g},w){let{basename:b,navigator:E,useTransitions:S}=R.useContext(l._3),k="string"==typeof p&&n.E6.test(p),C=(0,o.X9)(p,b);p=C.to;let D=(0,s.$P)(p,{relative:i}),M=(0,s.zy)(),O=null;if(d){let e=(0,o.Gh)(d,[],M.mask?M.mask.pathname:"/",!0);"/"!==b&&(e.pathname="/"===e.pathname?b:(0,o.HS)([b,e.pathname])),O=E.createHref(e)}let[T,$,A]=function(e,t){let r=R.useContext(x),[n,a]=R.useState(!1),[o,i]=R.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,h=R.useRef(null);R.useEffect(()=>{if("render"===e&&i(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{i(e.isIntersecting)})},{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}},[e]),R.useEffect(()=>{if(n){let e=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(e)}}},[n]);let f=()=>{a(!0)},p=()=>{a(!1),i(!1)};return r?"intent"!==e?[o,h,{}]:[o,h,{onFocus:L(l,f),onBlur:L(s,p),onMouseEnter:L(u,f),onMouseLeave:L(c,p),onTouchStart:L(d,f)}]:[!1,h,{}]}(r,g),j=function(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:c,useTransitions:d}={}){let h=(0,s.Zp)(),f=(0,s.zy)(),p=(0,s.x$)(e,{relative:l});return R.useCallback(s=>{if(0===s.button&&(!t||"_self"===t)&&!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)){s.preventDefault();let t=void 0!==r?r:(0,a.AO)(f)===(0,a.AO)(p),m=()=>h(e,{replace:t,mask:n,state:o,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:c});d?R.startTransition(()=>m()):m()}},[f,h,p,r,n,o,t,e,i,l,u,c,d])}(p,{replace:c,mask:d,state:h,target:f,preventScrollReset:m,relative:i,viewTransition:y,defaultShouldRevalidate:v,useTransitions:S}),U=!(C.isExternal||u),z=R.createElement("a",{...g,...A,href:(U?O:void 0)||C.absoluteURL||D,onClick:U?function(t){e&&e(t),t.defaultPrevented||j(t)}:e,ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(w,$),target:f,"data-discover":k||"render"!==t?void 0:"true"});return T&&!k?R.createElement(R.Fragment,null,z,R.createElement(P,{page:D})):z});O.displayName="Link";let T=R.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:i,to:u,viewTransition:c,children:d,...h},f){let p,m=(0,s.x$)(u,{relative:h.relative}),y=(0,s.zy)(),v=R.useContext(l.ay),{navigator:g,basename:w}=R.useContext(l._3),b=null!=v&&function(e,{relative:t}={}){let r=R.useContext(l.KZ);(0,a.V1)(null!=r,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=$("useViewTransitionState"),i=(0,s.x$)(e,{relative:t});if(!r.isTransitioning)return!1;let u=(0,o.pb)(r.currentLocation.pathname,n)||r.currentLocation.pathname,c=(0,o.pb)(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=(0,o.B6)(i.pathname,c)||null!=(0,o.B6)(i.pathname,u)}(m)&&!0===c,E=g.encodeLocation?g.encodeLocation(m).pathname:m.pathname,x=y.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;t||(x=x.toLowerCase(),S=S?S.toLowerCase():null,E=E.toLowerCase()),S&&w&&(S=(0,o.pb)(S,w)||S);let L="/"!==E&&E.endsWith("/")?E.length-1:E.length,P=x===E||!n&&x.startsWith(E)&&"/"===x.charAt(L),k=null!=S&&(S===E||!n&&S.startsWith(E)&&"/"===S.charAt(L)),C={isActive:P,isPending:k,isTransitioning:b},D=P?e:void 0;p="function"==typeof r?r(C):[r,P?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let M="function"==typeof i?i(C):i;return R.createElement(O,{...h,"aria-current":D,className:p,ref:f,style:M,to:u,viewTransition:c},"function"==typeof d?d(C):d)});T.displayName="NavLink",R.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:i,replace:u,state:h,method:p="get",action:y,onSubmit:v,relative:g,preventScrollReset:w,viewTransition:b,defaultShouldRevalidate:E,...x},S)=>{let{useTransitions:L}=R.useContext(l._3),P=function(){let{router:e}=$("useSubmit"),{basename:t}=R.useContext(l._3),r=(0,s.Gw)(),n=e.fetch,a=e.navigate;return R.useCallback(async(e,i={})=>{let{action:l,method:s,encType:u,formData:h,body:p}=function(e,t){let r,n,a,i,l;if(d(e)&&"form"===e.tagName.toLowerCase()){let l=e.getAttribute("action");n=l?(0,o.pb)(l,t):null,r=e.getAttribute("method")||"get",a=m(e.getAttribute("enctype"))||c,i=new FormData(e)}else if(d(e)&&"button"===e.tagName.toLowerCase()||d(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let l=e.form;if(null==l)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(n=s?(0,o.pb)(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||"get",a=m(e.getAttribute("formenctype"))||m(l.getAttribute("enctype"))||c,i=new FormData(l,e),!function(){if(null===f)try{new FormData(document.createElement("form"),0),f=!1}catch{f=!0}return f}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,n)}}else if(d(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r="get",n=null,a=c,l=e;return i&&"text/plain"===a&&(l=i,i=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:i,body:l}}(e,t);!1===i.navigate?await n(i.fetcherKey||`__${String(++j)}__`,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,relative:i.relative,formData:h,body:p,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync}):await a(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,relative:i.relative,formData:h,body:p,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}(),k=function(e,{relative:t}={}){let{basename:r}=R.useContext(l._3),n=R.useContext(l.Pl);(0,a.V1)(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),u={...(0,s.x$)(e||".",{relative:t})},c=(0,s.zy)();if(null==e){u.search=c.search;let e=new URLSearchParams(u.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();u.search=r?`?${r}`:""}}return(!e||"."===e)&&i.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(u.pathname="/"===u.pathname?r:(0,o.HS)([r,u.pathname])),(0,a.AO)(u)}(y,{relative:g}),C="get"===p.toLowerCase()?"get":"post",D="string"==typeof y&&n.E6.test(y);return R.createElement("form",{ref:S,method:C,action:k,onSubmit:i?v:e=>{if(v&&v(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,a=n?.getAttribute("formmethod")||p,o=()=>P(n||e.currentTarget,{fetcherKey:t,method:a,navigate:r,replace:u,state:h,relative:g,preventScrollReset:w,viewTransition:b,defaultShouldRevalidate:E});L&&!1!==r?R.startTransition(()=>o()):o()},...x,"data-discover":D||"render"!==e?void 0:"true"})}).displayName="Form";function $(e){var t;let r=R.useContext(l.hf);return(0,a.V1)(r,(t=e,`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`)),r}function A(e){(0,a.$e)("u">typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=R.useRef(h(e)),r=R.useRef(!1),n=(0,s.zy)(),o=R.useMemo(()=>{var e,a;let o;return e=n.search,a=r.current?null:t.current,o=h(e),a&&a.forEach((e,t)=>{o.has(t)||a.getAll(t).forEach(e=>{o.append(t,e)})}),o},[n.search]),i=(0,s.Zp)();return[o,R.useCallback((e,t)=>{let n=h("function"==typeof e?e(new URLSearchParams(o)):e);r.current=!0,i("?"+n,t)},[i,o])]}let j=0},8189(e,t,r){r.d(t,{$P:()=>c,Ri:()=>d,zy:()=>h,FE:()=>D,Zp:()=>p,cq:()=>C,P1:()=>y,x$:()=>v,Gw:()=>k,uG:()=>g});var n=r(7629),a=r(9932),o=r(7527),i=r(9667),l=r(4508);let s="REACT_ROUTER_ERROR";var u=r(6255);function c(e,{relative:t}={}){(0,n.V1)(d(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=u.useContext(l._3),{hash:i,pathname:s,search:h}=v(e,{relative:t}),f=s;return"/"!==r&&(f="/"===s?r:(0,a.HS)([r,s])),o.createHref({pathname:f,search:h,hash:i})}function d(){return null!=u.useContext(l.di)}function h(){return(0,n.V1)(d(),"useLocation() may be used only in the context of a <Router> component."),u.useContext(l.di).location}let f="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function p(){let{isDataRoute:e}=u.useContext(l.Pl);return e?function(){let e,{router:t}=(e=u.useContext(l.hf),(0,n.V1)(e,S("useNavigate")),e),r=P("useNavigate"),a=u.useRef(!1);return u.useLayoutEffect(()=>{a.current=!0}),u.useCallback(async(e,o={})=>{(0,n.$e)(a.current,f),a.current&&("number"==typeof e?await t.navigate(e):await t.navigate(e,{fromRouteId:r,...o}))},[t,r])}():function(){(0,n.V1)(d(),"useNavigate() may be used only in the context of a <Router> component.");let e=u.useContext(l.hf),{basename:t,navigator:r}=u.useContext(l._3),{matches:i}=u.useContext(l.Pl),{pathname:s}=h(),c=JSON.stringify((0,a.PD)(i)),p=u.useRef(!1);return u.useLayoutEffect(()=>{p.current=!0}),u.useCallback((i,l={})=>{if((0,n.$e)(p.current,f),!p.current)return;if("number"==typeof i)return void r.go(i);let u=(0,a.Gh)(i,JSON.parse(c),s,"path"===l.relative);null==e&&"/"!==t&&(u.pathname="/"===u.pathname?t:(0,a.HS)([t,u.pathname])),(0,o.c)("string"==typeof i?i:(0,n.AO)(i),r.createHref(u),(0,o.Y)(r),"reject"),(l.replace?r.replace:r.push)(u,l.state,l)},[t,r,c,s,e])}()}let m=u.createContext(null);function y(e){let t=u.useContext(l.Pl).outlet;return u.useMemo(()=>t&&u.createElement(m.Provider,{value:e},t),[t,e])}function v(e,{relative:t}={}){let{matches:r}=u.useContext(l.Pl),{pathname:n}=h(),o=JSON.stringify((0,a.PD)(r));return u.useMemo(()=>(0,a.Gh)(e,JSON.parse(o),n,"path"===t),[e,o,n,t])}function g(e,t,r){let o;(0,n.V1)(d(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=u.useContext(l._3),{matches:s}=u.useContext(l.Pl),c=s[s.length-1],f=c?c.params:{};c&&c.pathname;let p=c?c.pathnameBase:"/";c&&c.route;let m=h();if(t){let e="string"==typeof t?(0,n.Rr)(t):t;(0,n.V1)("/"===p||e.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${e.pathname}" was given in the \`location\` prop.`),o=e}else o=m;let y=o.pathname||"/",v=y;if("/"!==p){let e=p.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):(0,a.ue)(e,{pathname:v}),R=function(e,t=[],r){let o=r?.state;if(null==e){if(!o)return null;if(o.errors)e=o.matches;else{if(0!==t.length||o.initialized||!(o.matches.length>0))return null;e=o.matches}}let i=e,l=o?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&l?.[e.route.id]!==void 0);(0,n.V1)(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(r&&o){s=o.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=o,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){r.isStatic&&(s=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let d=r?.onError,h=o&&d?(e,t)=>{d(e,{location:o.location,params:o.matches?.[0]?.params??{},pattern:(0,a.gU)(o.matches),errorInfo:t})}:void 0;return i.reduceRight((e,r,a)=>{var d,f;let p,m=!1,y=null,v=null;o&&(p=l&&r.route.id?l[r.route.id]:void 0,y=r.route.errorElement||w,s&&(c<0&&0===a?(d="route-fallback",f="No `HydrateFallback` element provided to render during initial hydration",M[d]||(M[d]=!0,(0,n.$e)(!1,f)),m=!0,v=null):c===a&&(m=!0,v=r.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,a+1)),R=()=>{let t;return t=p?y:m?v:r.route.Component?u.createElement(r.route.Component,null):r.route.element?r.route.element:e,u.createElement(x,{match:r,routeContext:{outlet:e,matches:g,isDataRoute:null!=o},children:t})};return o&&(r.route.ErrorBoundary||r.route.errorElement||0===a)?u.createElement(b,{location:o.location,revalidation:o.revalidation,component:y,error:p,children:R(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:h}):R()},null)}(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},f,e.params),pathname:(0,a.HS)([p,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:(0,a.HS)([p,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,r);return t&&R?u.createElement(l.di.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...o},navigationType:"POP"}},R):R}let w=u.createElement(function(){let e,t,r,n=(e=u.useContext(l.xN),t=L("useRouteError"),r=P("useRouteError"),void 0!==e?e:t.errors?.[r]),o=(0,a.pX)(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null;return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},o),i?u.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},i):null,null)},null);var b=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=l.Bu;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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){let t=function(e){if(e.startsWith(`${s}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new a.cj(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?u.createElement(l.Pl.Provider,{value:this.props.routeContext},u.createElement(l.xN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?u.createElement(E,{error:e},t):t}};let R=new WeakMap;function E({children:e,error:t}){let{basename:r,navigator:n}=u.useContext(l._3);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${s}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let l=R.get(t);if(l)throw l;let s=(0,a.X9)(e.location,r),c=s.absoluteURL||s.to;if((0,o.c)(e.location,c,(0,o.Y)(n),"allow-explicit"),(0,i.yf)(c))throw Error("Invalid redirect location");if(a.Bd&&!R.get(t))if(s.isExternal||e.reloadDocument)window.location.href=c;else{let r=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:e.replace}));throw R.set(t,r),r}return u.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return e}function x({routeContext:e,match:t,children:r}){let n=u.useContext(l.hf);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(l.Pl.Provider,{value:e},r)}function S(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L(e){let t=u.useContext(l.ay);return(0,n.V1)(t,S(e)),t}function P(e){let t,r=(t=u.useContext(l.Pl),(0,n.V1)(t,S(e)),t),a=r.matches[r.matches.length-1];return(0,n.V1)(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function k(){return P("useRouteId")}function C(){let e=L("useNavigation");return u.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}function D(){let{matches:e,loaderData:t}=L("useMatches");return u.useMemo(()=>e.map(e=>(0,a.wy)(e,t)),[e,t])}let M={}},7629(e,t,r){var n=r(2872);let a="popstate";function o(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function i(e={}){return function(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:l=!1}=n,s=i.history,d="POP",h=null,p=m();function m(){return(s.state||{idx:null}).idx}function y(){d="POP";let e=m(),t=null==e?null:e-p;p=e,h&&h({action:d,location:g.location,delta:t})}function v(e){return f(i,e)}null==p&&(p=0,s.replaceState({...s.state,idx:p},""));let g={get action(){return d},get location(){return e(i,s)},listen(e){if(h)throw Error("A history only accepts one active listener");return i.addEventListener(a,y),h=e,()=>{i.removeEventListener(a,y),h=null}},createHref:e=>t(i,e),createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d="PUSH";let n=o(e)?e:c(g.location,e,t);r&&r(n,e);let a=u(n,p=m()+1),f=g.createHref(n.mask||n);try{s.pushState(a,"",f)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(f)}l&&h&&h({action:d,location:g.location,delta:1})},replace:function(e,t){d="REPLACE";let n=o(e)?e:c(g.location,e,t);r&&r(n,e);let a=u(n,p=m()),i=g.createHref(n.mask||n);s.replaceState(a,"",i),l&&h&&h({action:d,location:g.location,delta:0})},go:e=>s.go(e)};return g}(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=h(e.location.hash.substring(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),c("",{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:d(t))},function(e,t){s("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}function l(e,t){if(!1===e||null==e)throw Error(t)}function s(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch{}}}function u(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function c(e,t,r=null,n,a){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?h(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10),mask:a}}function d({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function h(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function f(e,t,r=!1){let a="http://localhost";e&&(a="null"!==e.location.origin?e.location.origin:e.location.href),l(a,"No window.location.(origin|href) available to create URL");let o="string"==typeof t?t:d(t);return o=o.replace(/ $/,"%20"),!r&&n.iA.test(o)&&(o=a+o),new URL(o,a)}r.d(t,{$e:()=>s,A4:()=>f,AO:()=>d,Rr:()=>h,TM:()=>i,V1:()=>l,yJ:()=>c})},7527(e,t,r){let n=new URL("http://localhost");function a(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),n)}catch{return n}}function o(e,t){return e.origin===t.origin&&("null"!==e.origin||e.protocol===t.protocol&&e.host===t.host)}function i(e,t,r,n){let a=null;try{a=null==e?null:new URL(e,r)}catch{}let i=new URL(t,r),l=null!=a&&!o(a,r),s=!o(i,r);if("reject"===n){if(l||s)throw Error("External navigation is not allowed")}else if(s&&(null==a||!function(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return!!e.toLowerCase().startsWith(r)&&(""===t.host||e.slice(r.length).startsWith("//"))}(e,a)||!o(a,i)))throw Error("External navigation is not allowed")}r.d(t,{Y:()=>a,c:()=>i})},9667(e,t,r){r.d(t,{aE:()=>C,yf:()=>Z});var n=r(2872),a=r(7629),o=r(9932);let i=Symbol("Uninstrumented"),l=new WeakMap;function s(e){return e[i]??e}function u(e,t){return l.set(e,t),()=>{l.get(e)===t&&l.delete(e)}}function c(e){let t=l.get(e);return l.delete(e),t}function d(e){if("error"===e.type)throw e.value;return e.value}async function h(e,t,r,n,o={result:null,innerResult:null},i=e.length-1){let l=e[i];if(l){let s,u=async()=>(s?console.error("You cannot call instrumented handlers more than once"):s=h(e,t,r,n,o,i-1),await s,(0,a.V1)(o.innerResult,"Expected an inner result"),o.innerResult);try{await l(u,t)}catch(e){console.error("An instrumentation function threw an error:",e)}s||await u(),await s}else{try{o.result={type:"success",value:await r()}}catch(e){o.result={type:"error",value:e}}o.innerResult=n(o.result,t)}return o.result||(o.result={type:"error",value:Error("No result assigned in instrumentation chain.")},o.innerResult=n(o.result,t)),o.result}function f(e){return"error"===e.type&&e.value instanceof Error?{status:"error",error:e.value}:{status:"success",error:void 0}}function p(e){var t,r;let{request:n,context:a,params:o}=e;return{...e,request:{method:(t=n).method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}},params:{...o},context:(r=a,{get:e=>r.get(e)})}}function m(e,t){return{currentUrl:(0,a.AO)(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}var y=r(7527);let v=["POST","PUT","PATCH","DELETE"],g=new Set(v),w=new Set(["GET",...v]),b=new Set([301,302,303,307,308]),R=new Set([307,308]),E={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},x={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},S={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L="remix-router-transitions",P=Symbol("ResetLoaderData");var k=class{#e;#t;#r;#n;constructor(e){this.#e=e,this.#t=(0,o.oI)(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#r??this.#e}get branches(){return this.#n??this.#t}get hasHMRRoutes(){return null!=this.#r}setRoutes(e){this.#e=e,this.#t=(0,o.oI)(e)}setHmrRoutes(e){this.#r=e,this.#n=(0,o.oI)(e)}commitHmrRoutes(){this.#r&&(this.#e=this.#r,this.#t=this.#n,this.#r=void 0,this.#n=void 0)}};function C(e){let t,r,l,v,g,w=e.window?e.window:"u">typeof window?window:void 0,P=void 0!==w&&void 0!==w.document&&void 0!==w.document.createElement;(0,a.V1)(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let C=e.hydrationRouteProperties||[],A=e.mapRouteProperties,U=A||(()=>({}));if(e.instrumentations){let t=e.instrumentations;U=e=>({...A?.(e),...function(e,t){var r,n,a,o;let l=[],u=[],c=[],m=[],y=[],v=[],g=[];e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){null!=e.lazy&&l.push(e.lazy),null!=e["lazy.loader"]&&u.push(e["lazy.loader"]),null!=e["lazy.action"]&&c.push(e["lazy.action"]),null!=e["lazy.middleware"]&&m.push(e["lazy.middleware"]),null!=e.middleware&&y.push(e.middleware),null!=e.loader&&v.push(e.loader),null!=e.action&&g.push(e.action)}}));let w={};if("function"==typeof t.lazy&&l.length>0){let e=t.lazy;w.lazy=async(...t)=>d(await h(l,void 0,()=>e(...t),f))}if("object"==typeof t.lazy){let e=t.lazy;if("function"==typeof e.middleware&&m.length>0){let t=e.middleware;w.lazy=Object.assign(w.lazy||{},{middleware:async(...e)=>d(await h(m,void 0,()=>t(...e),f))})}if("function"==typeof e.loader&&u.length>0){let t=e.loader;w.lazy=Object.assign(w.lazy||{},{loader:async(...e)=>d(await h(u,void 0,()=>t(...e),f))})}if("function"==typeof e.action&&c.length>0){let t=e.action;w.lazy=Object.assign(w.lazy||{},{action:async(...e)=>d(await h(c,void 0,()=>t(...e),f))})}}if("function"==typeof t.loader&&v.length>0){let e=s(t.loader),a=async(...t)=>d(await h(v,p(t[0]),()=>e(...t),f));!0===e.hydrate&&(a.hydrate=!0),r=a,n=e,r[i]=n,w.loader=a}if("function"==typeof t.action&&g.length>0){let e=s(t.action),r=async(...t)=>d(await h(g,p(t[0]),()=>e(...t),f));a=r,o=e,a[i]=o,w.action=r}return t.middleware&&t.middleware.length>0&&y.length>0&&(w.middleware=t.middleware.map(e=>{var t,r;let n=s(e),a=async(...e)=>d(await h(y,p(e[0]),()=>n(...e),f));return t=a,r=n,t[i]=r,a})),w}(t.map(e=>e.route).filter(Boolean),e)})}let z={},N=new k((0,o.R_)(e.routes,U,void 0,z)),_=e.basename||"/";_.startsWith("/")||(_=`/${_}`);let H=e.dataStrategy||F,V={...e.future},I=null,W=new Set,B=null,J=null,G=null,K=null,Z=null!=e.hydrationData,et=(0,o.et)(N.activeRoutes,e.history.location,_,!1,N.branches),er=!1,ec=null;if(null!=et||e.patchRoutesOnNavigation)if(et&&!e.hydrationData&&ta(et,N.activeRoutes,e.history.location.pathname).active&&(et=null),et)if(et.some(e=>e.route.lazy))t=!1,r=!0;else if(et.some(e=>T(e.route))){let n=e.hydrationData?e.hydrationData.loaderData:null,a=e.hydrationData?e.hydrationData.errors:null,o=et;if(a){let e=et.findIndex(e=>void 0!==a[e.route.id]);o=o.slice(0,e+1)}r=!1,t=!0,o.forEach(e=>{let o=$(e.route,n,a);r=r||o.renderFallback,t=t&&!o.shouldLoad})}else t=!0,r=!1;else{t=!1,r=!0,et=[];let n=ta(null,N.activeRoutes,e.history.location.pathname);n.active&&n.matches&&(er=!0,et=n.matches)}else{let n=es(404,{pathname:e.history.location.pathname}),{matches:a,route:o}=el(N.activeRoutes);t=!0,r=!1,et=a,ec={[o.id]:n}}let ed={historyAction:e.history.action,location:e.history.location,matches:et,initialized:t,renderFallback:r,navigation:E,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||ec,fetchers:new Map,blockers:new Map},ep="POP",ev=null,eL=!1,eP=!1,ek=new Map,eC=null,eD=!1,eM=!1,eO=new Set,eT=new Map,e$=0,eA=-1,ej=new Map,eU=new Set,ez=new Map,eN=new Map,e_=new Set,eF=new Map,eH=null;function eV(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=z[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}));let r=[],n=[];(ed={...ed,...e}).fetchers.forEach((e,t)=>{"idle"===e.state&&(e_.has(t)?r.push(t):n.push(t))}),e_.forEach(e=>{ed.fetchers.has(e)||eT.has(e)||r.push(e)}),0===W.size&&(B={newErrors:e.errors??null}),[...W].forEach(n=>n(ed,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>e5(ed.fetchers,e)),n.forEach(e=>ed.fetchers.delete(e))}function eI(t,r,{flushSync:n}={}){let a,o,i=null!=ed.actionData&&null!=ed.navigation.formMethod&&ey(ed.navigation.formMethod)&&"loading"===ed.navigation.state&&t.state?._isRedirect!==!0;a=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:i?ed.actionData:null;let l=r.loaderData?ea(ed.loaderData,r.loaderData,r.matches||[],r.errors):ed.loaderData,s=ed.blockers;s.size>0&&!eD&&(s=new Map(s)).forEach((e,t)=>s.set(t,S));let u=!eD&&tn(t,r.matches||ed.matches),c=!0===eL||null!=ed.navigation.formMethod&&ey(ed.navigation.formMethod)&&t.state?._isRedirect!==!0;if(N.commitHmrRoutes(),eD||"POP"===ep||("PUSH"===ep?e.history.push(t,t.state):"REPLACE"===ep&&e.history.replace(t,t.state)),"POP"===ep){let e=ek.get(ed.location.pathname);e&&e.has(t.pathname)?o={currentLocation:ed.location,nextLocation:t}:ek.has(t.pathname)&&(o={currentLocation:t,nextLocation:ed.location})}else if(eP){let e=ek.get(ed.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ek.set(ed.location.pathname,e)),o={currentLocation:ed.location,nextLocation:t}}eV({...r,actionData:a,loaderData:l,historyAction:ep,location:t,initialized:!0,renderFallback:!1,navigation:E,revalidation:"idle",restoreScrollPosition:u,preventScrollReset:c,blockers:s},{viewTransitionOpts:o,flushSync:!0===n}),ep="POP",eL=!1,eP=!1,eD=!1,eM=!1,ev?.resolve(),ev=null,eH?.resolve(),eH=null}async function eW(t,r){let o;if(ev?.resolve(),ev=null,"number"==typeof t){ev||(ev=eS());let r=ev.promise;return e.history.go(t),r}let i=c(l),{path:s,submission:u,error:d}=M(!1,D(ed.location,ed.matches,_,t,r?.fromRouteId,r?.relative),r);if(r?.mask){let t="string"==typeof r.mask?(0,a.Rr)(r.mask):{...ed.location.mask,...r.mask};if(o={pathname:t.pathname??"",search:t.search??"",hash:t.hash??""},n.iA.test(o.pathname))throw Error("External navigation is not allowed");o.pathname.startsWith("\\")&&(o.pathname=o.pathname.replace(/^\\+/,"/")),(0,y.c)("string"==typeof r.mask?r.mask:(0,a.AO)(r.mask),(0,a.AO)(o),e.history.createURL("/"),"reject")}let h=ed.location,f=(0,a.yJ)(h,s,r&&r.state,void 0,o);f={...f,...e.history.encodeLocation(f)},(0,y.c)(null==t?e.history.createHref(ed.location):"string"==typeof t?t:(0,a.AO)(t),e.history.createHref(f.mask||f),e.history.createURL("/"),"reject");let p=r&&null!=r.replace?r.replace:void 0,m="PUSH";!0===p?m="REPLACE":!1===p||null!=u&&ey(u.formMethod)&&u.formAction===ed.location.pathname+ed.location.search&&(m="REPLACE");let v=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,g=!0===(r&&r.flushSync),w=te({currentLocation:h,nextLocation:f,historyAction:m});w?e8(w,{state:"blocked",location:f,proceed(){e8(w,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),eW(t,r)},reset(){let e=new Map(ed.blockers);e.set(w,S),eV({blockers:e})}}):await eB(m,f,{submission:u,pendingError:d,preventScrollReset:v,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:g,callSiteDefaultShouldRevalidate:r&&r.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:i})}async function eB(t,r,n){var a,i,l,s;let u;v&&v.abort(),v=null,ep=t,eD=!0===(n&&n.startUninterruptedRevalidation),a=ed.location,i=ed.matches,J&&K&&(J[tr(a,i)]=K()),eL=!0===(n&&n.preventScrollReset),eP=!0===(n&&n.enableViewTransition);let c=N.activeRoutes,d=n?.initialHydration&&ed.matches&&ed.matches.length>0&&!er?ed.matches:(0,o.et)(c,r,_,!1,N.branches),h=!0===(n&&n.flushSync);if(d&&ed.initialized&&!eM&&(l=ed.location,s=r,l.pathname===s.pathname&&l.search===s.search&&(""===l.hash?""!==s.hash:l.hash===s.hash||""!==s.hash||!1))&&!(n&&n.submission&&ey(n.submission.formMethod)))return void eI(r,{matches:d},{flushSync:h});let f=ta(d,c,r.pathname);if(f.active&&f.matches&&(d=f.matches),n?.instrumentationNavigateMetaReceiver){let t=ew(e.history,r,d);n.instrumentationNavigateMetaReceiver(t)}if(!d){let{error:e,notFoundMatches:t,route:n}=tt(r.pathname);eI(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:h});return}let p=n&&n.overrideNavigation?{...n.overrideNavigation,matches:d,historyAction:t}:void 0;v=new AbortController;let m=ee(e.history,r,v.signal,n&&n.submission),y=e.getContext?await e.getContext():new o.aB;if(n&&n.pendingError)u=[ei(d).route.id,{type:"error",error:n.pendingError}];else if(n&&n.submission&&ey(n.submission.formMethod)){let a=await eY(m,r,n.submission,d,t,y,f.active,n&&!0===n.initialHydration,{replace:n.replace,flushSync:h});if(a.shortCircuited)return;if(a.pendingActionResult){let[e,t]=a.pendingActionResult;if(eh(t)&&(0,o.pX)(t.error)&&404===t.error.status){v=null,eI(r,{matches:a.matches,loaderData:{},errors:{[e]:t.error}});return}}d=a.matches||d,u=a.pendingActionResult,p=eR(r,d,t,n.submission),h=!1,f.active=!1,m=ee(e.history,m.url,m.signal)}let{shortCircuited:g,matches:w,loaderData:b,errors:R,workingFetchers:E}=await eq(m,r,d,t,y,f.active,p,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,h,u,n&&n.callSiteDefaultShouldRevalidate);g||(v=null,eI(r,{matches:w||d,...eo(u),loaderData:b,errors:R,...E?{fetchers:E}:{}}))}async function eY(t,r,n,a,o,i,l,s,u={}){var c,d,h;let f;if(e0(),eV({navigation:(c=r,d=a,{state:"submitting",location:c,matches:d,historyAction:o,formMethod:(h=n).formMethod,formAction:h.formAction,formEncType:h.formEncType,formData:h.formData,json:h.json,text:h.text})},{flushSync:!0===u.flushSync}),l){let e=await to(a,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=el(N.activeRoutes);return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=ei(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(e.matches)a=e.matches;else{let{notFoundMatches:e,error:t,route:n}=tt(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:t}]}}}let p=eg(a,r);if(p.route.action||p.route.lazy){let e=await eZ(t,r,Y(U,z,t,r,a,p,s?[]:C,i),i,null);if(!(f=e[p.route.id])){for(let t of a)if(e[t.route.id]){f=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}else f={type:"error",error:es(405,{method:t.method,pathname:r.pathname,routeId:p.route.id})};if(ef(f)){let r;return r=u&&null!=u.replace?u.replace:Q(f.response.headers.get("Location"),new URL(t.url),_,e.history)===ed.location.pathname+ed.location.search,await eK(t,f,!0,{submission:n,replace:r}),{shortCircuited:!0}}if(eh(f)){let e=ei(a,p.route.id);return!0!==(u&&u.replace)&&(ep="PUSH"),{matches:a,pendingActionResult:[e.route.id,f,p.route.id]}}return{matches:a,pendingActionResult:[p.route.id,f]}}async function eq(t,r,n,a,o,i,l,s,u,c,d,h,f,p){let m=l||eR(r,n,a,s),y=s||u||eb(m),g=!eD&&!d;if(i){if(g){let e=eJ(f);eV({navigation:m,...void 0!==e?{actionData:e}:{}},{flushSync:h})}let e=await to(n,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=el(N.activeRoutes);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=ei(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)n=e.matches;else{let{error:e,notFoundMatches:t,route:n}=tt(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let w=N.activeRoutes,{dsMatches:b,revalidatingFetchers:R}=O(t,o,U,z,e.history,ed,n,y,r,d?[]:C,!0===d,eM,eO,e_,ez,eU,w,_,null!=e.patchRoutesOnNavigation,N.branches,f,p);if(eA=++e$,!e.dataStrategy&&!b.some(e=>e.shouldLoad)&&!b.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===R.length){let e=new Map(ed.fetchers),t=e6(e);return eI(r,{matches:n,loaderData:{},errors:f&&eh(f[1])?{[f[0]]:f[1].error}:null,...eo(f),...t?{fetchers:e}:{}},{flushSync:h}),{shortCircuited:!0}}if(g){var E;let e,t={};if(!i){t.navigation=m;let e=eJ(f);void 0!==e&&(t.actionData=e)}R.length>0&&(E=R,e=new Map(ed.fetchers),E.forEach(t=>{let r=e.get(t.key),n=eE(void 0,r?r.data:void 0);e.set(t.key,n)}),t.fetchers=e),eV(t,{flushSync:h})}R.forEach(e=>{e3(e.key),e.controller&&eT.set(e.key,e.controller)});let x=()=>R.forEach(e=>e3(e.key));v&&v.signal.addEventListener("abort",x);let{loaderResults:S,fetcherResults:L}=await eQ(b,R,t,r,o);if(t.signal.aborted)return{shortCircuited:!0};v&&v.signal.removeEventListener("abort",x),R.forEach(e=>eT.delete(e.key));let P=eu(S);if(P)return await eK(t,P.result,!0,{replace:c}),{shortCircuited:!0};if(P=eu(L))return eU.add(P.key),await eK(t,P.result,!0,{replace:c}),{shortCircuited:!0};let k=new Map(ed.fetchers),{loaderData:D,errors:M}=en(ed,n,S,f,R,L,k);d&&ed.errors&&(M={...ed.errors,...M});let T=e6(k),$=e7(eA,k);return{matches:n,loaderData:D,errors:M,...T||$||R.length>0?{workingFetchers:k}:{}}}function eJ(e){if(e&&!eh(e[1]))return{[e[0]]:e[1].data};if(ed.actionData)if(0===Object.keys(ed.actionData).length)return null;else return ed.actionData}async function eG(t,r,n,i,l,s,u,c,d,h){var f,p;e0(),ez.delete(t),e1(t,(f=d,p=ed.fetchers.get(t),{state:"submitting",formMethod:f.formMethod,formAction:f.formAction,formEncType:f.formEncType,formData:f.formData,json:f.json,text:f.text,data:p?p.data:void 0}),{flushSync:u});let m=new AbortController,y=ee(e.history,n,m.signal,d);if(s){let e=await to(i,new URL(y.url).pathname,y.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void e2(t,r,e.error,{flushSync:u});if(!e.matches)return void e2(t,r,es(404,{pathname:n}),{flushSync:u});i=e.matches}let g=eg(i,n);if(!g.route.action&&!g.route.lazy)return void e2(t,r,es(405,{method:d.formMethod,pathname:n,routeId:r}),{flushSync:u});eT.set(t,m);let w=e$,b=Y(U,z,y,n,i,g,C,l),R=await eZ(y,n,b,l,t),E=R[g.route.id];if(!E){for(let e of b)if(R[e.route.id]){E=R[e.route.id];break}}if(y.signal.aborted){eT.get(t)===m&&eT.delete(t);return}if(e_.has(t)){if(ef(E)||eh(E))return void e1(t,ex(void 0))}else{if(ef(E))return(eT.delete(t),eA>w)?void e1(t,ex(void 0)):(eU.add(t),e1(t,eE(d)),eK(y,E,!1,{fetcherSubmission:d,preventScrollReset:c}));if(eh(E))return void e2(t,r,E.error)}let x=ed.navigation.location||ed.location,S=ee(e.history,x,m.signal),L=N.activeRoutes,P="idle"!==ed.navigation.state?(0,o.et)(L,ed.navigation.location,_,!1,N.branches):ed.matches;(0,a.V1)(P,"Didn't find any matches after fetcher action");let k=++e$;ej.set(t,k);let{dsMatches:D,revalidatingFetchers:M}=O(S,l,U,z,e.history,ed,P,d,x,C,!1,eM,eO,e_,ez,eU,L,_,null!=e.patchRoutesOnNavigation,N.branches,[g.route.id,E],h),T=eE(d,E.data),$=new Map(ed.fetchers);$.set(t,T),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=$.get(t),n=eE(void 0,r?r.data:void 0);$.set(t,n),e3(t),e.controller&&eT.set(t,e.controller)}),eV({fetchers:$});let A=()=>M.forEach(e=>e3(e.key));m.signal.addEventListener("abort",A);let{loaderResults:j,fetcherResults:F}=await eQ(D,M,S,x,l);if(m.signal.aborted){ej.get(t)===k&&ej.delete(t);return}m.signal.removeEventListener("abort",A),ej.delete(t),eT.delete(t),M.forEach(e=>eT.delete(e.key));let H=ed.fetchers.has(t),V=e=>{if(!H)return e;let r=new Map(e.fetchers);return r.set(t,ex(E.data)),{...e,fetchers:r}},I=eu(j);if(I)return ed=V(ed),eK(S,I.result,!1,{preventScrollReset:c});if(I=eu(F))return eU.add(I.key),ed=V(ed),eK(S,I.result,!1,{preventScrollReset:c});let W=new Map(ed.fetchers);H&&W.set(t,ex(E.data));let{loaderData:B,errors:q}=en(ed,P,j,void 0,M,F,W);e7(k,W),"loading"===ed.navigation.state&&k>eA?((0,a.V1)(ep,"Expected pending action"),v&&v.abort(),eI(ed.navigation.location,{matches:P,loaderData:B,errors:q,fetchers:W})):(eV({errors:q,loaderData:ea(ed.loaderData,B,P,q),fetchers:W}),eM=!1)}async function eX(t,r,n,a,o,i,l,s,u){let c=ed.fetchers.get(t);e1(t,eE(u,c?c.data:void 0),{flushSync:l});let d=new AbortController,h=ee(e.history,n,d.signal);if(i){let e=await to(a,new URL(h.url).pathname,h.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void e2(t,r,e.error,{flushSync:l});if(!e.matches)return void e2(t,r,es(404,{pathname:n}),{flushSync:l});a=e.matches}let f=eg(a,n);eT.set(t,d);let p=e$,m=await eZ(h,n,Y(U,z,h,n,a,f,C,o),o,t),y=m[f.route.id];if(!y){for(let e of a)if(m[e.route.id]){y=m[e.route.id];break}}if(eT.get(t)===d&&eT.delete(t),!h.signal.aborted){if(e_.has(t))return void e1(t,ex(void 0));if(ef(y))if(eA>p)return void e1(t,ex(void 0));else{eU.add(t),await eK(h,y,!1,{preventScrollReset:s});return}if(eh(y))return void e2(t,r,y.error);e1(t,ex(y.data))}}async function eK(t,r,n,{submission:i,fetcherSubmission:l,preventScrollReset:s,replace:u}={}){n||(ev?.resolve(),ev=null),r.response.headers.has("X-Remix-Revalidate")&&(eM=!0);let c=r.response.headers.get("Location");(0,a.V1)(c,"Expected a Location header on the redirect Response");let d=c,h=new URL(t.url);c=Q(c,h,_,e.history),(0,y.c)(d,c,h,"allow-explicit");let f=(0,a.yJ)(ed.location,c,{_isRedirect:!0});if(P){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else if((0,o.vh)(c)){let t=(0,a.A4)(w,c,!0);e=t.origin!==w.location.origin||null==(0,o.pb)(t.pathname,_)}if(e)return void(u?w.location.replace(c):w.location.assign(c))}v=null;let p=!0===u||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:m,formAction:g,formEncType:b}=ed.navigation;!i&&!l&&m&&g&&b&&(i=eb(ed.navigation));let E=i||l;R.has(r.response.status)&&E&&ey(E.formMethod)?await eB(p,f,{submission:{...E,formAction:c},preventScrollReset:s||eL,enableViewTransition:n?eP:void 0}):await eB(p,f,{overrideNavigation:eR(f,[],p,i),fetcherSubmission:l,preventScrollReset:s||eL,enableViewTransition:n?eP:void 0})}async function eZ(e,t,r,n,i){let l,s={};try{l=await q(H,e,t,r,i,n,!1)}catch(e){return r.filter(e=>e.shouldLoad).forEach(t=>{s[t.route.id]={type:"error",error:e}}),s}if(e.signal.aborted)return s;if(!ey(e.method))for(let e of r){if(l[e.route.id]?.type==="error")break;!l.hasOwnProperty(e.route.id)&&!ed.loaderData.hasOwnProperty(e.route.id)&&(!ed.errors||!ed.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(l[e.route.id]={type:"error",result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,n]of Object.entries(l)){var u;if(em((u=n).result)&&b.has(u.result.status)){let i=n.result;s[t]={type:"redirect",response:function(e,t,r,n,i){let l=e.headers.get("Location");if((0,a.V1)(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!(0,o.vh)(l)){let a=n.slice(0,n.findIndex(e=>e.route.id===r)+1);l=D(new URL(t.url),a,i,l),e.headers.set("Location",l)}return e}(i,e,t,r,_)}}else s[t]=await X(n)}return s}async function eQ(e,t,r,n,a){let o=eZ(r,n,e,a,null),i=Promise.all(t.map(async e=>{if(!e.matches||!e.match||!e.request||!e.controller)return Promise.resolve({[e.key]:{type:"error",error:es(404,{pathname:e.path})}});{let t=(await eZ(e.request,e.path,e.matches,a,e.key))[e.match.route.id];return{[e.key]:t}}}));return{loaderResults:await o,fetcherResults:(await i).reduce((e,t)=>Object.assign(e,t),{})}}function e0(){eM=!0,ez.forEach((e,t)=>{eT.has(t)&&eO.add(t),e3(t)})}function e1(e,t,r={}){let n=new Map(ed.fetchers);n.set(e,t),eV({fetchers:n},{flushSync:!0===(r&&r.flushSync)})}function e2(e,t,r,n={}){let a=ei(ed.matches,t),o=new Map(ed.fetchers);e5(o,e),eV({errors:{[a.route.id]:r},fetchers:o},{flushSync:!0===(n&&n.flushSync)})}function e5(e,t){let r=ed.fetchers.get(t);eT.has(t)&&!(r&&"loading"===r.state&&ej.has(t))&&e3(t),ez.delete(t),ej.delete(t),eU.delete(t),e_.delete(t),eO.delete(t),e.delete(t)}function e3(e,t){let r=eT.get(e);r&&(r.abort(t),eT.delete(e))}function e4(e,t){for(let r of e){let e=t.get(r);(0,a.V1)(e,`Expected fetcher: ${r}`);let n=ex(e.data);t.set(r,n)}}function e6(e){let t=[],r=!1;for(let n of eU){let o=e.get(n);(0,a.V1)(o,`Expected fetcher: ${n}`),"loading"===o.state&&(eU.delete(n),t.push(n),r=!0)}return e4(t,e),r}function e7(e,t){let r=[];for(let[n,o]of ej)if(o<e){let e=t.get(n);(0,a.V1)(e,`Expected fetcher: ${n}`),"loading"===e.state&&(e3(n),ej.delete(n),r.push(n))}return e4(r,t),r.length>0}function e9(e){ed.blockers.delete(e),eF.delete(e)}function e8(e,t){let r=ed.blockers.get(e)||S;(0,a.V1)("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(ed.blockers);n.set(e,t),eV({blockers:n})}function te({currentLocation:e,nextLocation:t,historyAction:r}){if(0===eF.size)return;eF.size>1&&(0,a.$e)(!1,"A router only supports one blocker at a time");let n=Array.from(eF.entries()),[o,i]=n[n.length-1],l=ed.blockers.get(o);if((!l||"proceeding"!==l.state)&&i({currentLocation:e,nextLocation:t,historyAction:r}))return o}function tt(e){let t=es(404,{pathname:e}),{matches:r,route:n}=el(N.activeRoutes);return{notFoundMatches:r,route:n,error:t}}function tr(e,t){return G&&G(e,t.map(e=>(0,o.wy)(e,ed.loaderData)))||e.key}function tn(e,t){if(J){let r=J[tr(e,t)];if("number"==typeof r)return r}return null}function ta(t,r,n){if(e.patchRoutesOnNavigation){let e=N.branches;if(!t)return{active:!0,matches:(0,o.et)(r,n,_,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:(0,o.et)(r,n,_,!0,e)}}return{active:!1,matches:null}}async function to(t,r,n,a){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let i=t;for(;;){let t=z;try{await e.patchRoutesOnNavigation({signal:n,path:r,matches:i,fetcherKey:a,patch:(e,r)=>{n.aborted||j(e,r,N,t,U,!1)}})}catch(e){return{type:"error",error:e,partialMatches:i}}if(n.aborted)return{type:"aborted"};let l=N.branches,s=(0,o.et)(N.activeRoutes,r,_,!1,l),u=null;if(s){if(0===Object.keys(s[0].params).length)return{type:"success",matches:s};else if(!((u=(0,o.et)(N.activeRoutes,r,_,!0,l))&&i.length<u.length&&ti(i,u.slice(0,i.length))))return{type:"success",matches:s}}if(u||(u=(0,o.et)(N.activeRoutes,r,_,!0,l)),!u||ti(i,u))return{type:"success",matches:null};i=u}}function ti(e,t){return e.length===t.length&&e.every((e,r)=>e.route.id===t[r].route.id)}return l={get basename(){return _},get future(){return V},get state(){return ed},get routes(){return N.stableRoutes},get branches(){return N.branches},get manifest(){return z},get window(){return w},initialize:function(){if(I=e.history.listen(({action:t,location:r,delta:n})=>{if(g){g(),g=void 0;return}(0,a.$e)(0===eF.size||null!=n,"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=te({currentLocation:ed.location,nextLocation:r,historyAction:t});if(o&&null!=n){let t=new Promise(e=>{g=e});e.history.go(-1*n),e8(o,{state:"blocked",location:r,proceed(){e8(o,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(ed.blockers);e.set(o,S),eV({blockers:e})}}),ev?.resolve(),ev=null;return}return eB(t,r)}),P){var t=w,r=ek;try{let e=t.sessionStorage.getItem(L);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t||{}))n&&Array.isArray(n)&&r.set(e,new Set(n||[]))}}catch{}let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(L,JSON.stringify(r))}catch(e){(0,a.$e)(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}})(w,ek);w.addEventListener("pagehide",e),eC=()=>w.removeEventListener("pagehide",e)}return ed.initialized||eB("POP",ed.location,{initialHydration:!0}),l},subscribe:function(e){if(W.add(e),B){let{newErrors:t}=B;B=null,e(ed,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>W.delete(e)},enableScrollRestoration:function(e,t,r){if(J=e,K=t,G=r||null,!Z&&ed.navigation===E){Z=!0;let e=tn(ed.location,ed.matches);null!=e&&eV({restoreScrollPosition:e})}return()=>{J=null,K=null,G=null}},navigate:eW,fetch:async function t(t,r,n,a){e3(t);let i=!0===(a&&a.flushSync),s=c(l),u=N.activeRoutes,d=D(ed.location,ed.matches,_,n,r,a?.relative),h=(0,o.et)(u,d,_,!1,N.branches),f=ta(h,u,d);if(f.active&&f.matches&&(h=f.matches),s&&s(ew(e.history,d,h)),!h)return void e2(t,r,es(404,{pathname:d}),{flushSync:i});let{path:p,submission:m,error:y}=M(!0,d,a);if(y)return void e2(t,r,y,{flushSync:i});let v=e.getContext?await e.getContext():new o.aB,g=!0===(a&&a.preventScrollReset);m&&ey(m.formMethod)?await eG(t,r,p,h,v,f.active,i,g,m,a&&a.defaultShouldRevalidate):(ez.set(t,{routeId:r,path:p}),await eX(t,r,p,h,v,f.active,i,g,m))},revalidate:function(){eH||(eH=eS()),e0(),eV({revalidation:"loading"});let e=eH.promise;return"submitting"===ed.navigation.state||("idle"===ed.navigation.state?eB(ed.historyAction,ed.location,{startUninterruptedRevalidation:!0}):eB(ep||ed.historyAction,ed.navigation.location,{overrideNavigation:ed.navigation,enableViewTransition:!0===eP})),e},createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:function(e){return eN.set(e,(eN.get(e)||0)+1),e_.has(e)&&e_.delete(e),ed.fetchers.get(e)||x},resetFetcher:function(e,t){e3(e,t?.reason),e1(e,ex(null))},deleteFetcher:function(e){let t=(eN.get(e)||0)-1;t<=0?(eN.delete(e),e_.add(e)):eN.set(e,t),eV({fetchers:new Map(ed.fetchers)})},dispose:function(){I&&I(),eC&&eC(),W.clear(),v&&v.abort(),ed.fetchers.forEach((e,t)=>e5(ed.fetchers,t)),ed.blockers.forEach((e,t)=>e9(t))},getBlocker:function(e,t){let r=ed.blockers.get(e)||S;return eF.get(e)!==t&&eF.set(e,t),r},deleteBlocker:e9,patchRoutes:function(e,t,r=!1){j(e,t,N,z,U,r),N.hasHMRRoutes||eV({})},_internalFetchControllers:eT,_internalSetRoutes:function(e){z={},N.setHmrRoutes((0,o.R_)(e,U,void 0,z))},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){eV(e)}},e.instrumentations&&(l=function(e,t){var r,n,o,l;let c=[],p=[];if(t.forEach(e=>e({instrument(e){null!=e.navigate&&c.push(e.navigate),null!=e.fetch&&p.push(e.fetch)}})),c.length>0){let t=s(e.navigate),o=async(...r)=>{let n,[o,i]=r,l={to:"number"==typeof o||"string"==typeof o?o:o?(0,a.AO)(o):".",...m(e,i??{})};return d(await h(c,l,async()=>{if("number"==typeof o)return await t(...r);let a=u(e,e=>{n=e});try{return await t(...r)}finally{a()}},e=>({...f(e),meta:n})))};r=o,n=t,r[i]=n,e.navigate=o}if(p.length>0){let t=s(e.fetch),r=async(...r)=>{let n,[a,o,i,l]=r;return d(await h(p,{href:i??".",fetcherKey:a,...m(e,l??{})},async()=>{let a=u(e,e=>{n=e});try{return await t(...r)}finally{a()}},e=>({...f(e),meta:n})))};o=r,l=t,o[i]=l,e.fetch=r}return e}(l,e.instrumentations.map(e=>e.router).filter(Boolean))),l}function D(e,t,r,n,i,l){let s,u;if(i){for(let e of(s=[],t))if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=(0,o.Gh)(n||".",(0,o.PD)(s),(0,o.pb)(e.pathname,r)||e.pathname,"path"===l);if(null==n&&(c.search=e.search,c.hash=e.hash),(null==n||""===n||"."===n)&&u){let e=ev(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"/"!==r&&(c.pathname=(0,o.RW)({basename:r,pathname:c.pathname})),(0,a.AO)(c)}function M(e,t,r){var n;let o,i;if(!r||!(null!=r&&("formData"in r&&null!=r.formData||"body"in r&&void 0!==r.body)))return{path:t};if(r.formMethod&&(n=r.formMethod,!w.has(n.toUpperCase())))return{path:t,error:es(405,{method:r.formMethod})};let l=()=>({path:t,error:es(400,{type:"invalid-body"})}),s=(r.formMethod||"get").toUpperCase(),u=ec(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!ey(s))return l();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}
3
- `,""):String(r.body);return{path:t,submission:{formMethod:s,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if("application/json"===r.formEncType){if(!ey(s))return l();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:s,formAction:u,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch{return l()}}}if((0,a.V1)("function"==typeof FormData,"FormData is not available in this environment"),r.formData)o=et(r.formData),i=r.formData;else if(r.body instanceof FormData)o=et(r.body),i=r.body;else if(r.body instanceof URLSearchParams)i=er(o=r.body);else if(null==r.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(r.body),i=er(o)}catch{return l()}let c={formMethod:s,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ey(c.formMethod))return{path:t,submission:c};let d=(0,a.Rr)(t);return e&&d.search&&ev(d.search)&&o.append("index",""),d.search=`?${o}`,{path:(0,a.AO)(d),submission:c}}function O(e,t,r,n,a,i,l,s,u,c,d,h,f,p,m,y,v,g,w,b,R,E){let x,S=R?eh(R[1])?R[1].error:R[1].data:void 0,L=a.createURL(i.location),P=a.createURL(u);if(d&&i.errors){let e=Object.keys(i.errors)[0];x=l.findIndex(t=>t.route.id===e)}else if(R&&eh(R[1])){let e=R[0];x=l.findIndex(t=>t.route.id===e)-1}let k=R?R[1].statusCode:void 0,C=k&&k>=400,D={currentUrl:L,currentParams:i.matches[0]?.params||{},nextUrl:P,nextParams:l[0].params,...s,actionResult:S,actionStatus:k},M=(0,o.gU)(l),O=l.map((a,o)=>{var l,s,f,p,m;let y,{route:v}=a,g=null;if(null!=x&&o>x)g=!1;else if(v.lazy)g=!0;else if(T(v))if(d){let{shouldLoad:e}=$(v,i.loaderData,i.errors);g=e}else{let e,t;l=i.loaderData,s=i.matches[o],f=a,e=!s||f.route.id!==s.route.id,t=!l.hasOwnProperty(f.route.id),(e||t)&&(g=!0)}else g=!1;if(null!==g)return B(r,n,e,u,M,a,c,t,g);let w=!1;"boolean"==typeof E?w=E:C?w=!1:h||L.pathname+L.search===P.pathname+P.search||L.search!==P.search?w=!0:(p=i.matches[o],m=a,y=p.route.path,(p.pathname!==m.pathname||null!=y&&y.endsWith("*")&&p.params["*"]!==m.params["*"])&&(w=!0));let b={...D,defaultShouldRevalidate:w};return B(r,n,e,u,M,a,c,t,A(a,b),b,E)}),j=[];return m.forEach((e,s)=>{if(d||!l.some(t=>t.route.id===e.routeId)||p.has(s))return;let u=i.fetchers.get(s),m=u&&"idle"!==u.state&&void 0===u.data,R=(0,o.et)(v,e.path,g??"/",!1,b);if(!R){if(w&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(y.has(s))return;let x=eg(R,e.path),S=new AbortController,L=ee(a,e.path,S.signal),P=null;if(f.has(s))f.delete(s),P=Y(r,n,L,e.path,R,x,c,t);else if(m)h&&(P=Y(r,n,L,e.path,R,x,c,t));else{let a={...D,defaultShouldRevalidate:"boolean"==typeof E?E:!C&&h};A(x,a)&&(P=Y(r,n,L,e.path,R,x,c,t,a))}P&&j.push({key:s,routeId:e.routeId,path:e.path,matches:P,match:x,request:L,controller:S})}),{dsMatches:O,revalidatingFetchers:j}}function T(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function $(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!T(e))return{shouldLoad:!1,renderFallback:!1};let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];if(!n&&a)return{shouldLoad:!1,renderFallback:!1};if("function"==typeof e.loader&&!0===e.loader.hydrate)return{shouldLoad:!0,renderFallback:!n};let o=!n&&!a;return{shouldLoad:o,renderFallback:o}}function A(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function j(e,t,r,n,i,l){let s;if(e){let t=n[e];(0,a.V1)(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),s=t.children}else s=r.activeRoutes;let u=[],c=[];if(t.forEach(e=>{let t=s.find(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||(t.children?.every((t,n)=>r.children?.some(r=>e(t,r)))??!1))})(e,t));t?c.push({existingRoute:t,newRoute:e}):u.push(e)}),u.length>0){let t=(0,o.R_)(u,i,[e||"_","patch",String(s?.length||"0")],n);s.push(...t)}if(l&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:r}=c[e],[n]=(0,o.R_)([r],i,[],{},!0);Object.assign(t,{element:n.element?n.element:t.element,errorElement:n.errorElement?n.errorElement:t.errorElement,hydrateFallbackElement:n.hydrateFallbackElement?n.hydrateFallbackElement:t.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}let U=new WeakMap,z=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let i=r[t.id];if((0,a.V1)(i,"No route found in manifest"),!i.lazy||"object"!=typeof i.lazy)return;let l=i.lazy[e];if(!l)return;let s=U.get(i);s||(s={},U.set(i,s));let u=s[e];if(u)return u;let c=(async()=>{let t=(0,o.pr)(e),r=void 0!==i[e];if(t)(0,a.$e)(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),s[e]=Promise.resolve();else if(r)(0,a.$e)(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await l();null!=t&&(Object.assign(i,{[e]:t}),Object.assign(i,n(i)))}"object"==typeof i.lazy&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>void 0===e)&&(i.lazy=void 0))})();return s[e]=c,c},N=new WeakMap;async function _(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function F(e){return e.matches.some(e=>e.route.middleware)?H(e,()=>_(e)):_(e)}function H(e,t){return V(e,t,e=>{var t,r;if(em(t=e)&&(r=t.status,b.has(r))&&t.headers.has("Location"))throw e;return e},ed,r);async function r(t,r,n){if(n)return Object.assign(n.value,{[r]:{type:"error",result:t}});{let{matches:n}=e,a=Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.shouldCallHandler()),0)),o=n[a].route.id;for(let e of n.slice(0,a+1))try{await e._lazyPromises?.route}catch{o=e.route.id;break}return{[ei(n,o).route.id]:{type:"error",result:t}}}}}async function V(e,t,r,n,a){let{matches:o,...i}=e;return await I(i,o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,r,n,a)}async function I(e,t,r,n,a,o,i=0){let l,{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let u=t[i];if(!u)return await r();let[c,d]=u,h=async()=>{if(l)throw Error("You may only call `next()` once per middleware");try{return(l={value:await I(e,t,r,n,a,o,i+1)}).value}catch(e){return(l={value:await o(e,c,l)}).value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;if(a(r))return r;if(l)return r??l.value;return(l={value:await h()}).value}catch(e){return await o(e,c,l)}}function W(e,t,r,n,i){let l=z({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),s=function(e,t,r,n,i){let l,s=r[e.id];if((0,a.V1)(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=N.get(s);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{(0,a.V1)("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let i=(0,o.ep)(e),l=void 0!==s[e];i?(0,a.$e)(!i,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):l?(0,a.$e)(!l,`Route "${s.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.`):r[e]=n}Object.assign(s,r),Object.assign(s,{...n(s),lazy:void 0})})();return N.set(s,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let u=Object.keys(e.lazy),c=[];for(let a of u){if(i&&i.includes(a))continue;let o=z({key:a,route:e,manifest:r,mapRouteProperties:n});o&&(c.push(o),a===t&&(l=o))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:l}}(n.route,ey(r.method)?"action":"loader",t,e,i);return{middleware:l,route:s.lazyRoutePromise,handler:s.lazyHandlerPromise}}function B(e,t,r,n,a,o,i,l,s,u=null,c){let d=!1,h=W(e,t,r,o,i);return{...o,_lazyPromises:h,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler:e=>(d=!0,u)?"boolean"==typeof c?A(o,{...u,defaultShouldRevalidate:c}):"boolean"==typeof e?A(o,{...u,defaultShouldRevalidate:e}):A(o,u):s,resolve(e){let{lazy:t,loader:i,middleware:u}=o.route,c=d||s||e&&!ey(r.method)&&(t||i),f=u&&u.length>0&&!i&&!t;return c&&(ey(r.method)||!f)?J({request:r,path:n,pattern:a,match:o,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:e,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Y(e,t,r,n,a,i,l,s,u=null){return a.map(c=>c.route.id!==i.route.id?{...c,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:W(e,t,r,c,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:B(e,t,r,n,(0,o.gU)(a),c,l,s,!0,u))}async function q(e,t,r,n,a,i,l){n.some(e=>e._lazyPromises?.middleware)&&await Promise.all(n.map(e=>e._lazyPromises?.middleware));let s={request:t,url:(0,o.cg)(t,r),pattern:(0,o.gU)(n),params:n[0].params,context:i,matches:n},u=l?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>H(s,()=>e({...s,fetcherKey:a,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})),c=await e({...s,fetcherKey:a,runClientMiddleware:u});try{await Promise.all(n.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return c}async function J({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:l,scopedContext:s}){let u,c,d=ey(e.method),h=d?"action":"loader",f=a=>{let i,u=new Promise((e,t)=>i=t);c=()=>i(),e.signal.addEventListener("abort",c);let d=i=>"function"!=typeof a?Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${n.route.id}]`)):a({request:e,url:(0,o.cg)(e,t),pattern:r,params:n.params,context:s},...void 0!==i?[i]:[]);return Promise.race([(async()=>{try{return{type:"data",result:await (l?l(e=>d(e)):d())}}catch(e){return{type:"error",result:e}}})(),u])};try{let t=d?n.route.action:n.route.loader;if(a||i)if(t){let e,[r]=await Promise.all([f(t).catch(t=>{e=t}),a,i]);if(void 0!==e)throw e;u=r}else{await a;let t=d?n.route.action:n.route.loader;if(t)[u]=await Promise.all([f(t),i]);else{if("action"!==h)return{type:"data",result:void 0};let t=new URL(e.url),r=t.pathname+t.search;throw es(405,{method:e.method,pathname:r,routeId:n.route.id})}}else if(t)u=await f(t);else{let t=new URL(e.url);throw es(404,{pathname:t.pathname+t.search})}}catch(e){return{type:"error",result:e}}finally{c&&e.signal.removeEventListener("abort",c)}return u}async function G(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function X(e){let{result:t,type:r}=e;if(em(t)){let e;try{e=await G(t)}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new o.cj(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}if("error"===r){if(ep(t)){var n;return t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:(n=t,new o.cj(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)),statusCode:(0,o.pX)(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}}return{type:"error",error:t,statusCode:(0,o.pX)(t)?t.status:void 0}}return ep(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}let K=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Z(e){try{return K.includes(new URL(e).protocol)}catch{return!1}}function Q(e,t,r,a){if((0,o.vh)(e)){let a=new URL(n.iA.test(e)?(0,n.lS)(e,t.protocol):e);if(Z(a.toString()))throw Error("Invalid redirect location");let i=null!=(0,o.pb)(a.pathname,r);if(a.origin===t.origin&&i)return(0,o.Hv)(a.pathname)+a.search+a.hash}try{if(Z(a.createURL(e).toString()))throw Error("Invalid redirect location")}catch{}return e}function ee(e,t,r,n){let a=e.createURL(ec(t)).toString(),o={signal:r};if(n&&ey(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=et(n.formData):o.body=n.formData}return new Request(a,o)}function et(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function er(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function en(e,t,r,n,i,l,s){let{loaderData:u,errors:c}=function(e,t,r,n=!1,i=!1){let l,s={},u=null,c=!1,d={},h=r&&eh(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let f=r.route.id,p=t[f];if((0,a.V1)(!ef(p),"Cannot handle redirect results in processLoaderData"),eh(p)){let t=p.error;if(void 0!==h&&(t=h,h=void 0),u=u||{},i)u[f]=t;else{let r=ei(e,f);null==u[r.route.id]&&(u[r.route.id]=t)}n||(s[f]=P),c||(c=!0,l=(0,o.pX)(p.error)?p.error.status:500),p.headers&&(d[f]=p.headers)}else s[f]=p.data,p.statusCode&&200!==p.statusCode&&!c&&(l=p.statusCode),p.headers&&(d[f]=p.headers)}),void 0!==h&&r&&(u={[r[0]]:h},r[2]&&(s[r[2]]=void 0)),{loaderData:s,errors:u,statusCode:l||200,loaderHeaders:d}}(t,r,n);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:o}=t;if(o&&o.signal.aborted)return;let i=l[r];if((0,a.V1)(i,"Did not find corresponding fetcher result"),eh(i)){let t=ei(e.matches,n?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:i.error}),s.delete(r)}else if(ef(i))(0,a.V1)(!1,"Unhandled fetcher revalidation redirect");else{let e=ex(i.data);s.set(r,e)}}),{loaderData:u,errors:c}}function ea(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==P).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eo(e){return e?eh(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ei(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>null!=e.route.ErrorBoundary||null!=e.route.errorElement)||e[0]}function el(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 es(e,{pathname:t,routeId:r,method:n,type:a,message:i}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(l="Bad Request",n&&t&&r?s=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(s="Unable to encode submission body")):403===e?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):404===e?(l="Not Found",s=`No route matches URL "${t}"`):405===e&&(l="Method Not Allowed",n&&t&&r?s=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(s=`Invalid request method "${n.toUpperCase()}"`)),new o.cj(e||500,l,Error(s),!0)}function eu(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(ef(n))return{key:r,result:n}}}function ec(e){return(0,a.AO)({..."string"==typeof e?(0,a.Rr)(e):e,hash:""})}function ed(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>{var r;return"string"==typeof e&&null!=(r=t)&&"object"==typeof r&&"type"in r&&"result"in r&&("data"===r.type||"error"===r.type)})}function eh(e){return"error"===e.type}function ef(e){return"redirect"===(e&&e.type)}function ep(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function em(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function ey(e){return g.has(e.toUpperCase())}function ev(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eg(e,t){let r="string"==typeof t?(0,a.Rr)(t).search:t.search;if(e[e.length-1].route.index&&ev(r||""))return e[e.length-1];let n=(0,o.nr)(e);return n[n.length-1]}function ew(e,t,r){return{url:(0,o.cg)(e.createURL(t),t),pattern:r?(0,o.gU)(r):"",params:r?.[0]?.params?{...r[0].params}:{}}}function eb(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};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function eR(e,t,r,n){return n?{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function eE(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 ex(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 eS(){let e,t,r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch{}},t=async e=>{a(e);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}},2872(e,t,r){function n(e,t){return t+e.replace(/\\/g,"/")}r.d(t,{lS:()=>n},{E6:/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,iA:/^[\\/]{2}/})},9932(e,t,r){var n=r(2872),a=r(7629),o=r(6255),i=class{#a=new Map;constructor(e){if(e)for(let[t,r]of e)this.set(t,r)}get(e){if(this.#a.has(e))return this.#a.get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw Error("No value found for context")}set(e,t){this.#a.set(e,t)}};let l=new Set(["lazy","caseSensitive","path","id","index","children"]);function s(e){return l.has(e)}let u=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function c(e){return u.has(e)}function d(e){let t={};return e.Component&&Object.assign(t,{element:o.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:o.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:o.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function h(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function f(e,t,r="/"){return p(e,t,r,!1)}function p(e,t,r,n,o){let i=x(("string"==typeof t?(0,a.Rr)(t):t).pathname||"/",r);if(null==i)return null;let l=o??y(e),s=null,u=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return(0,a.$e)(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(i);for(let e=0;null==s&&e<l.length;++e)s=function(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c={path:l.relativePath,caseSensitive:l.caseSensitive,end:s},d=l.matcher&&l.compiledParams?R(c,u,l.matcher,l.compiledParams):b(c,u),h=l.route;if(!d&&s&&r&&!n[n.length-1].route.index&&(d=b({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(a,d.params),i.push({params:a,pathname:O([o,d.pathname]),pathnameBase:$(O([o,d.pathnameBase])),route:h}),"/"!==d.pathnameBase&&(o=O([o,d.pathnameBase]))}return i}(l[e],u,n);return s}function m(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,loaderData:t[r.id],handle:r.handle}}function y(e){let t=function e(t,r=[],n=[],o="",i=!1){let l=(t,l,s=i,u)=>{var c,d;let h,f,p={relativePath:void 0===u?t.path||"":u,caseSensitive:!0===t.caseSensitive,childrenIndex:l,route:t};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(o)&&s)return;(0,a.V1)(p.relativePath.startsWith(o),`Absolute route path "${p.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(o.length)}let m=O([o,p.relativePath]),y=n.concat(p);t.children&&t.children.length>0&&((0,a.V1)(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),e(t.children,r,y,m,s)),(null!=t.path||t.index)&&r.push({path:m,score:(c=m,d=t.index,f=(h=c.split("/")).length,h.some(w)&&(f+=-2),d&&(f+=2),h.filter(e=>!w(e)).reduce((e,t)=>e+(v.test(t)?3:g.test(t)?3.5:""===t?1:10),f)),routesMeta:y.map((e,t)=>{let[r,n]=E(e.relativePath,e.caseSensitive,t===y.length-1);return{...e,matcher:r,compiledParams:n}})})};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.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))l(e,t,!0,r);else l(e,t)}),r}(e);return t.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)}),t}let v=/^:[\w-]+$/,g=/^:[\w-]+/,w=e=>"*"===e;function b(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=E(e.path,e.caseSensitive,e.end);return R(e,t,r,n)}function R(e,t,r,n){let a=t.match(r);if(!a)return null;let o=a[0],i=T(o,1),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=T(o.slice(0,o.length-e.length),1)}let a=l[n];return r&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function E(e,t=!1,r=!0){(0,a.$e)("*"===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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r,a,o)=>{if(n.push({paramName:t,isOptional:null!=r}),r){let t=o.charAt(a+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,"(?:/$1)?");return e.endsWith("*")?(n.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function x(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 S({basename:e,pathname:t}){return"/"===t?e:O([e,t])}function L(e,t){let r=T(t).split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function P(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 k(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function C(e){let t=k(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function D(e,t,r,n=!1){let o,i;"string"==typeof e?o=(0,a.Rr)(e):(o={...e},(0,a.V1)(!o.pathname||!o.pathname.includes("?"),P("?","pathname","search",o)),(0,a.V1)(!o.pathname||!o.pathname.includes("#"),P("#","pathname","hash",o)),(0,a.V1)(!o.search||!o.search.includes("#"),P("#","search","hash",o)));let l=""===e||""===o.pathname,s=l?"/":o.pathname;if(null==s)i=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=function(e,t="/"){let{pathname:r,search:n="",hash:o=""}="string"==typeof e?(0,a.Rr)(e):e;return{pathname:r?(r=M(r)).startsWith("/")||r.startsWith("\\")?L(r.substring(1),"/"):L(r,t):t,search:A(n),hash:j(o)}}(o,i),c=s&&"/"!==s&&s.endsWith("/"),d=(l||"."===s)&&r.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}let M=e=>e.replace(/[\\/]{2,}/g,"/"),O=e=>M(e.join("/"));function T(e,t=0){let r=e.length;for(;r>t&&47===e.charCodeAt(r-1);)r--;return r===e.length?e:e.slice(0,r)}let $=e=>T(e).replace(/^\/*/,"/"),A=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",j=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var U=class{status;statusText;data;error;internal;constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function z(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function N(e){return O(e.map(e=>e.route.path).filter(Boolean))||"/"}function _(e,t){let r=new URL("string"==typeof e||e instanceof URL?e:e.url),n="string"==typeof t?(0,a.Rr)(t):t;if(r.pathname=n.pathname||"/",n.search){let e=new URLSearchParams(n.search),t=e.getAll("index");for(let r of(e.delete("index"),t.filter(Boolean)))e.append("index",r);let a=e.toString();r.search=a?`?${a}`:""}else r.search="";return r.hash=n.hash||"",r}let F="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function H(e,t){let r=e;if("string"!=typeof r||!n.E6.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let o=r,i=!1;if(F)try{let e=new URL(window.location.href),a=new URL(n.iA.test(r)?(0,n.lS)(r,e.protocol):r),o=x(a.pathname,t);a.origin===e.origin&&null!=o?r=o+a.search+a.hash:i=!0}catch{(0,a.$e)(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:i,to:r}}r.d(t,{B6:()=>b,Gh:()=>D,MT:()=>d,PD:()=>C,RW:()=>S,R_:()=>function e(t,r=d,n=[],o={},i=!1){return t.map((t,l)=>{let s=[...n,String(l)],u="string"==typeof t.id?t.id:s.join("-");if((0,a.V1)(!0!==t.index||!t.children,"Cannot specify children on an index route"),(0,a.V1)(i||!o[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),!0===t.index){let e={...t,id:u};return o[u]=h(e,r(e)),e}{let n={...t,id:u,children:void 0};return o[u]=h(n,r(n)),t.children&&(n.children=e(t.children,r,s,o,i)),n}})},X9:()=>H,aB:()=>i,cg:()=>_,cj:()=>U,ep:()=>c,et:()=>p,gU:()=>N,nr:()=>k,oI:()=>y,pX:()=>z,pb:()=>x,pr:()=>s,ue:()=>f,wy:()=>m},{Bd:F,HS:O,Hv:M,WF:["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vh:e=>n.E6.test(e)})}}]);
1
+ /*! LICENSE: lib-router.c327fb621e.js.LICENSE.txt */
2
+ "use strict";(self.rspackChunk_dhzh_foundry_app=self.rspackChunk_dhzh_foundry_app||[]).push([[535],{8071(e,t,r){r.d(t,{C5:()=>y,sv:()=>v,Ix:()=>g,pg:()=>f,jC:()=>d});var n=r(7629),a=r(9932),o=r(7527),i=r(4508),l=r(8189);let s={};function u(e,t){e||s[t]||(s[t]=!0,console.warn(t))}var c=r(6255);let d=["HydrateFallback","hydrateFallbackElement"];var h=class{status="pending";promise;resolve;reject;constructor(){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 f({router:e,flushSync:t,onError:r,useTransitions:n}){n=(0,i.OA)()||n;let[o,l]=c.useState(e.state),[s,d]=(0,c.useOptimistic)(o),[y,v]=c.useState(),[w,b]=c.useState({isTransitioning:!1}),[R,E]=c.useState(),[x,S]=c.useState(),[P,L]=c.useState(),k=c.useRef(new Map),C=c.useCallback((o,{deletedFetchers:i,newErrors:s,flushSync:h,viewTransitionOpts:f})=>{s&&r&&Object.values(s).forEach(e=>r(e,{location:o.location,params:o.matches[0]?.params??{},pattern:(0,a.gU)(o.matches)})),o.fetchers.forEach((e,t)=>{void 0!==e.data&&k.current.set(t,e.data)}),i.forEach(e=>k.current.delete(e)),u(!1===h||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let m=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(u(null==f||m,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!f||!m)return void(t&&h?t(()=>l(o)):!1===n?l(o):c.startTransition(()=>{!0===n&&d(e=>p(e,o)),l(o)}));if(t&&h){t(()=>{x&&(R?.resolve(),x.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:f.currentLocation,nextLocation:f.nextLocation})});let r=e.window.document.startViewTransition(()=>{t(()=>l(o))});r.finished.finally(()=>{t(()=>{E(void 0),S(void 0),v(void 0),b({isTransitioning:!1})})}),t(()=>S(r));return}x?(R?.resolve(),x.skipTransition(),L({state:o,currentLocation:f.currentLocation,nextLocation:f.nextLocation})):(v(o),b({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}))},[e.window,t,x,R,n,d,r]);c.useLayoutEffect(()=>e.subscribe(C),[e,C]),c.useEffect(()=>{w.isTransitioning&&!w.flushSync&&E(new h)},[w]),c.useEffect(()=>{if(R&&y&&e.window){let t=R.promise,r=e.window.document.startViewTransition(async()=>{!1===n?l(y):c.startTransition(()=>{!0===n&&d(e=>p(e,y)),l(y)}),await t});r.finished.finally(()=>{E(void 0),S(void 0),v(void 0),b({isTransitioning:!1})}),S(r)}},[y,R,e.window,n,d]),c.useEffect(()=>{R&&y&&s.location.key===y.location.key&&R.resolve()},[R,x,s.location,y]),c.useEffect(()=>{!w.isTransitioning&&P&&(v(P.state),b({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}),L(void 0))},[w.isTransitioning,P]);let D=c.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),M=e.basename||"/",O=c.useMemo(()=>({router:e,navigator:D,static:!1,basename:M,onError:r}),[e,D,M,r]);return c.createElement(c.Fragment,null,c.createElement(i.hf.Provider,{value:O},c.createElement(i.ay.Provider,{value:s},c.createElement(i.QH.Provider,{value:k.current},c.createElement(i.KZ.Provider,{value:w},c.createElement(g,{basename:M,location:s.location,navigationType:s.historyAction,navigator:D,useTransitions:n},c.createElement(m,{routes:e.routes,manifest:e.manifest,future:e.future,state:s,isStatic:!1,onError:r})))))),null)}function p(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}let m=c.memo(function({routes:e,manifest:t,future:r,state:n,isStatic:a,onError:o}){return(0,l.uG)(e,void 0,{manifest:t,state:n,isStatic:a,onError:o,future:r})});function y({to:e,replace:t,state:r,relative:s}){(0,n.V1)((0,l.Ri)(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u,navigator:d}=c.useContext(i._3);(0,n.$e)(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:h}=c.useContext(i.Pl),{pathname:f}=(0,l.zy)(),p=(0,l.Zp)(),m=(0,a.Gh)(e,(0,a.PD)(h),f,"path"===s);(0,o.c)("string"==typeof e?e:(0,n.AO)(e),d.createHref(m),(0,o.Y)(d),"reject");let v=JSON.stringify(m);return c.useEffect(()=>{p(JSON.parse(v),{replace:t,state:r,relative:s})},[p,v,s,t,r]),null}function v(e){return(0,l.P1)(e.context)}function g({basename:e="/",children:t=null,location:r,navigationType:o="POP",navigator:s,static:u=!1,useTransitions:d}){(0,n.V1)(!(0,l.Ri)(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),f=c.useMemo(()=>({basename:h,navigator:s,static:u,useTransitions:d,future:{}}),[h,s,u,d]);"string"==typeof r&&(r=(0,n.Rr)(r));let{pathname:p="/",search:m="",hash:y="",state:v=null,key:w="default",mask:b}=r,R=c.useMemo(()=>{let e=(0,a.pb)(p,h);return null==e?null:{location:{pathname:e,search:m,hash:y,state:v,key:w,mask:b},navigationType:o}},[h,p,m,y,v,w,o,b]);return((0,n.$e)(null!=R,`<Router basename="${h}"> is not able to match the URL "${p}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),null==R)?null:c.createElement(i._3.Provider,{value:f},c.createElement(i.di.Provider,{children:t,value:R}))}c.Component},4508(e,t,r){var n=r(6255);let a=n.createContext(null);a.displayName="DataRouter";let o=n.createContext(null);o.displayName="DataRouterState";let i=n.createContext(!1);function l(){return n.useContext(i)}let s=n.createContext({isTransitioning:!1});s.displayName="ViewTransition";let u=n.createContext(new Map);u.displayName="Fetchers";let c=n.createContext(null);c.displayName="Await";let d=n.createContext(null);d.displayName="Navigation";let h=n.createContext(null);h.displayName="Location";let f=n.createContext({outlet:null,matches:[],isDataRoute:!1});f.displayName="Route";let p=n.createContext(null);p.displayName="RouteError",r.d(t,{OA:()=>l},{Bu:i,KZ:s,Pl:f,QH:u,_3:d,ay:o,di:h,hf:a,m4:c,xN:p})},6653(e,t,r){var n=r(6255),a=r(7965),o=r(8071);function i(e){return n.createElement(o.pg,{flushSync:a.flushSync,...e})}r.d(t,{p:()=>i})},6551(e,t,r){r.d(t,{N_:()=>O,k2:()=>T,Ge:()=>M,ok:()=>A});var n=r(2872),a=r(7629),o=r(9932),i=r(9667),l=r(4508),s=r(8189),u=r(8071);let c="application/x-www-form-urlencoded";function d(e){return"u">typeof HTMLElement&&e instanceof HTMLElement}function h(e=""){return 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]])},[]))}let f=null,p=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function m(e){return null==e||p.has(e)?e:((0,a.$e)(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${c}"`),null)}function y(e,t){if(!1===e||null==e)throw Error(t)}async function v(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function g(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function w(e,t,r){var n;let a,o;return n=(await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await v(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(g).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),a=new Set,o=new Set(void 0),n.reduce((e,t)=>{!1;let r=JSON.stringify(function(e){let t={};for(let r of Object.keys(e).sort())t[r]=e[r];return t}(t));return a.has(r)||(a.add(r),e.push({key:r,link:t})),e},[])}function b(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}var R=r(6255);function E(e,t){let r="string"==typeof e?new URL(e,"u"<typeof window?"server://singlefetch/":window.location.origin):e;return r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${t}`:r.pathname=`${r.pathname}.${t}`,r}Symbol("SingleFetchRedirect");let x=R.createContext(void 0);function S(){let e=R.useContext(x);return y(e,"You must render this element inside a <HydratedRouter> element"),e}function P(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function L({page:e,...t}){let r,n=(0,l.OA)(),{nonce:a}=S(),{router:i}=(y(r=R.useContext(l.hf),"You must render this element inside a <DataRouterContext.Provider> element"),r),s=R.useMemo(()=>(0,o.ue)(i.routes,e,i.basename),[i.routes,e,i.basename]);return s?(null==t.nonce&&a&&(t={...t,nonce:a}),n)?R.createElement(k,{page:e,matches:s,...t}):R.createElement(C,{page:e,matches:s,...t}):null}function k({page:e,matches:t,...r}){let n=(0,s.zy)(),a=R.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=E(e,"rsc"),a=!1,o=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?a=!0:o.push(e.route.id);return a&&o.length>0&&r.searchParams.set("_routes",o.join(",")),[r.pathname+r.search]},[e,n,t]);return R.createElement(R.Fragment,null,a.map(e=>R.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})))}function C({page:e,matches:t,...r}){let n,a=(0,s.zy)(),{manifest:o,routeModules:i}=S(),{loaderData:u,matches:c}=(y(n=R.useContext(l.ay),"You must render this element inside a <DataRouterStateContext.Provider> element"),n),d=R.useMemo(()=>b(e,t,c,o,a,"data"),[e,t,c,o,a]),h=R.useMemo(()=>b(e,t,c,o,a,"assets"),[e,t,c,o,a]),f=R.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let r=new Set,n=!1;if(t.forEach(e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in u&&i[e.route.id]?.shouldRevalidate||t.hasClientLoader?n=!0:r.add(e.route.id))}),0===r.size)return[];let l=E(e,"data");return n&&r.size>0&&l.searchParams.set("_routes",t.filter(e=>r.has(e.route.id)).map(e=>e.route.id).join(",")),[l.pathname+l.search]},[u,a,o,d,t,e,i]),p=R.useMemo(()=>(function(e,t,{includeHydrateFallback:r}={}){return[...new Set(e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))]})(h,o),[h,o]),m=function(e){let{manifest:t,routeModules:r}=S(),[n,a]=R.useState([]);return R.useEffect(()=>{let n=!1;return w(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}(h);return R.createElement(R.Fragment,null,f.map(e=>R.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),p.map(e=>R.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),m.map(({key:e,link:t})=>R.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}x.displayName="FrameworkContext";let D="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{D&&(window.__reactRouterVersion="8")}catch{}function M(e,t){let r;return(0,i.aE)({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:(0,a.TM)({window:t?.window}),hydrationData:t?.hydrationData||((r=window?.__staticRouterHydrationData)&&r.errors&&(r={...r,errors:function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new o.cj(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if("string"==typeof n.__subType&&o.WF.includes(n.__subType)){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch{}}if(null==r[e]){let t=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(r.errors)}),r),routes:e,mapRouteProperties:o.MT,hydrationRouteProperties:u.jC,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}let O=R.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:i,reloadDocument:u,replace:c,mask:d,state:h,target:f,to:p,preventScrollReset:m,viewTransition:y,defaultShouldRevalidate:v,...g},w){let{basename:b,navigator:E,useTransitions:S}=R.useContext(l._3),k="string"==typeof p&&n.E6.test(p),C=(0,o.X9)(p,b);p=C.to;let D=(0,s.$P)(p,{relative:i}),M=(0,s.zy)(),O=null;if(d){let e=(0,o.Gh)(d,[],M.mask?M.mask.pathname:"/",!0);"/"!==b&&(e.pathname="/"===e.pathname?b:(0,o.HS)([b,e.pathname])),O=E.createHref(e)}let[T,$,A]=function(e,t){let r=R.useContext(x),[n,a]=R.useState(!1),[o,i]=R.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,h=R.useRef(null);R.useEffect(()=>{if("render"===e&&i(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{i(e.isIntersecting)})},{threshold:.5});return h.current&&e.observe(h.current),()=>{e.disconnect()}}},[e]),R.useEffect(()=>{if(n){let e=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(e)}}},[n]);let f=()=>{a(!0)},p=()=>{a(!1),i(!1)};return r?"intent"!==e?[o,h,{}]:[o,h,{onFocus:P(l,f),onBlur:P(s,p),onMouseEnter:P(u,f),onMouseLeave:P(c,p),onTouchStart:P(d,f)}]:[!1,h,{}]}(r,g),j=function(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:c,useTransitions:d}={}){let h=(0,s.Zp)(),f=(0,s.zy)(),p=(0,s.x$)(e,{relative:l});return R.useCallback(s=>{if(0===s.button&&(!t||"_self"===t)&&!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)){s.preventDefault();let t=void 0!==r?r:(0,a.AO)(f)===(0,a.AO)(p),m=()=>h(e,{replace:t,mask:n,state:o,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:c});d?R.startTransition(()=>m()):m()}},[f,h,p,r,n,o,t,e,i,l,u,c,d])}(p,{replace:c,mask:d,state:h,target:f,preventScrollReset:m,relative:i,viewTransition:y,defaultShouldRevalidate:v,useTransitions:S}),U=!(C.isExternal||u),z=R.createElement("a",{...g,...A,href:(U?O:void 0)||C.absoluteURL||D,onClick:U?function(t){e&&e(t),t.defaultPrevented||j(t)}:e,ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(w,$),target:f,"data-discover":k||"render"!==t?void 0:"true"});return T&&!k?R.createElement(R.Fragment,null,z,R.createElement(L,{page:D})):z});O.displayName="Link";let T=R.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:i,to:u,viewTransition:c,children:d,...h},f){let p,m=(0,s.x$)(u,{relative:h.relative}),y=(0,s.zy)(),v=R.useContext(l.ay),{navigator:g,basename:w}=R.useContext(l._3),b=null!=v&&function(e,{relative:t}={}){let r=R.useContext(l.KZ);(0,a.V1)(null!=r,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=$("useViewTransitionState"),i=(0,s.x$)(e,{relative:t});if(!r.isTransitioning)return!1;let u=(0,o.pb)(r.currentLocation.pathname,n)||r.currentLocation.pathname,c=(0,o.pb)(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=(0,o.B6)(i.pathname,c)||null!=(0,o.B6)(i.pathname,u)}(m)&&!0===c,E=g.encodeLocation?g.encodeLocation(m).pathname:m.pathname,x=y.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;t||(x=x.toLowerCase(),S=S?S.toLowerCase():null,E=E.toLowerCase()),S&&w&&(S=(0,o.pb)(S,w)||S);let P="/"!==E&&E.endsWith("/")?E.length-1:E.length,L=x===E||!n&&x.startsWith(E)&&"/"===x.charAt(P),k=null!=S&&(S===E||!n&&S.startsWith(E)&&"/"===S.charAt(P)),C={isActive:L,isPending:k,isTransitioning:b},D=L?e:void 0;p="function"==typeof r?r(C):[r,L?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let M="function"==typeof i?i(C):i;return R.createElement(O,{...h,"aria-current":D,className:p,ref:f,style:M,to:u,viewTransition:c},"function"==typeof d?d(C):d)});T.displayName="NavLink",R.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:i,replace:u,state:h,method:p="get",action:y,onSubmit:v,relative:g,preventScrollReset:w,viewTransition:b,defaultShouldRevalidate:E,...x},S)=>{let{useTransitions:P}=R.useContext(l._3),L=function(){let{router:e}=$("useSubmit"),{basename:t}=R.useContext(l._3),r=(0,s.Gw)(),n=e.fetch,a=e.navigate;return R.useCallback(async(e,i={})=>{let{action:l,method:s,encType:u,formData:h,body:p}=function(e,t){let r,n,a,i,l;if(d(e)&&"form"===e.tagName.toLowerCase()){let l=e.getAttribute("action");n=l?(0,o.pb)(l,t):null,r=e.getAttribute("method")||"get",a=m(e.getAttribute("enctype"))||c,i=new FormData(e)}else if(d(e)&&"button"===e.tagName.toLowerCase()||d(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let l=e.form;if(null==l)throw Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(n=s?(0,o.pb)(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||"get",a=m(e.getAttribute("formenctype"))||m(l.getAttribute("enctype"))||c,i=new FormData(l,e),!function(){if(null===f)try{new FormData(document.createElement("form"),0),f=!1}catch{f=!0}return f}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,n)}}else if(d(e))throw Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');else r="get",n=null,a=c,l=e;return i&&"text/plain"===a&&(l=i,i=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:i,body:l}}(e,t);!1===i.navigate?await n(i.fetcherKey||`__${String(++j)}__`,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,relative:i.relative,formData:h,body:p,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync}):await a(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,relative:i.relative,formData:h,body:p,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}(),k=function(e,{relative:t}={}){let{basename:r}=R.useContext(l._3),n=R.useContext(l.Pl);(0,a.V1)(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),u={...(0,s.x$)(e||".",{relative:t})},c=(0,s.zy)();if(null==e){u.search=c.search;let e=new URLSearchParams(u.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();u.search=r?`?${r}`:""}}return(!e||"."===e)&&i.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(u.pathname="/"===u.pathname?r:(0,o.HS)([r,u.pathname])),(0,a.AO)(u)}(y,{relative:g}),C="get"===p.toLowerCase()?"get":"post",D="string"==typeof y&&n.E6.test(y);return R.createElement("form",{ref:S,method:C,action:k,onSubmit:i?v:e=>{if(v&&v(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,a=n?.getAttribute("formmethod")||p,o=()=>L(n||e.currentTarget,{fetcherKey:t,method:a,navigate:r,replace:u,state:h,relative:g,preventScrollReset:w,viewTransition:b,defaultShouldRevalidate:E});P&&!1!==r?R.startTransition(()=>o()):o()},...x,"data-discover":D||"render"!==e?void 0:"true"})}).displayName="Form";function $(e){var t;let r=R.useContext(l.hf);return(0,a.V1)(r,(t=e,`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`)),r}function A(e){(0,a.$e)("u">typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=R.useRef(h(e)),r=R.useRef(!1),n=(0,s.zy)(),o=R.useMemo(()=>{var e,a;let o;return e=n.search,a=r.current?null:t.current,o=h(e),a&&a.forEach((e,t)=>{o.has(t)||a.getAll(t).forEach(e=>{o.append(t,e)})}),o},[n.search]),i=(0,s.Zp)();return[o,R.useCallback((e,t)=>{let n=h("function"==typeof e?e(new URLSearchParams(o)):e);r.current=!0,i("?"+n,t)},[i,o])]}let j=0},8189(e,t,r){r.d(t,{$P:()=>c,Ri:()=>d,zy:()=>h,FE:()=>M,Zp:()=>p,cq:()=>D,P1:()=>y,g:()=>v,x$:()=>g,Gw:()=>C,uG:()=>w});var n=r(7629),a=r(9932),o=r(7527),i=r(9667),l=r(4508);let s="REACT_ROUTER_ERROR";var u=r(6255);function c(e,{relative:t}={}){(0,n.V1)(d(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=u.useContext(l._3),{hash:i,pathname:s,search:h}=g(e,{relative:t}),f=s;return"/"!==r&&(f="/"===s?r:(0,a.HS)([r,s])),o.createHref({pathname:f,search:h,hash:i})}function d(){return null!=u.useContext(l.di)}function h(){return(0,n.V1)(d(),"useLocation() may be used only in the context of a <Router> component."),u.useContext(l.di).location}let f="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function p(){let{isDataRoute:e}=u.useContext(l.Pl);return e?function(){let e,{router:t}=(e=u.useContext(l.hf),(0,n.V1)(e,P("useNavigate")),e),r=k("useNavigate"),a=u.useRef(!1);return u.useLayoutEffect(()=>{a.current=!0}),u.useCallback(async(e,o={})=>{(0,n.$e)(a.current,f),a.current&&("number"==typeof e?await t.navigate(e):await t.navigate(e,{fromRouteId:r,...o}))},[t,r])}():function(){(0,n.V1)(d(),"useNavigate() may be used only in the context of a <Router> component.");let e=u.useContext(l.hf),{basename:t,navigator:r}=u.useContext(l._3),{matches:i}=u.useContext(l.Pl),{pathname:s}=h(),c=JSON.stringify((0,a.PD)(i)),p=u.useRef(!1);return u.useLayoutEffect(()=>{p.current=!0}),u.useCallback((i,l={})=>{if((0,n.$e)(p.current,f),!p.current)return;if("number"==typeof i)return void r.go(i);let u=(0,a.Gh)(i,JSON.parse(c),s,"path"===l.relative);null==e&&"/"!==t&&(u.pathname="/"===u.pathname?t:(0,a.HS)([t,u.pathname])),(0,o.c)("string"==typeof i?i:(0,n.AO)(i),r.createHref(u),(0,o.Y)(r),"reject"),(l.replace?r.replace:r.push)(u,l.state,l)},[t,r,c,s,e])}()}let m=u.createContext(null);function y(e){let t=u.useContext(l.Pl).outlet;return u.useMemo(()=>t&&u.createElement(m.Provider,{value:e},t),[t,e])}function v(){let{matches:e}=u.useContext(l.Pl);return e[e.length-1]?.params??{}}function g(e,{relative:t}={}){let{matches:r}=u.useContext(l.Pl),{pathname:n}=h(),o=JSON.stringify((0,a.PD)(r));return u.useMemo(()=>(0,a.Gh)(e,JSON.parse(o),n,"path"===t),[e,o,n,t])}function w(e,t,r){let o;(0,n.V1)(d(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=u.useContext(l._3),{matches:s}=u.useContext(l.Pl),c=s[s.length-1],f=c?c.params:{};c&&c.pathname;let p=c?c.pathnameBase:"/";c&&c.route;let m=h();if(t){let e="string"==typeof t?(0,n.Rr)(t):t;(0,n.V1)("/"===p||e.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${e.pathname}" was given in the \`location\` prop.`),o=e}else o=m;let y=o.pathname||"/",v=y;if("/"!==p){let e=p.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):(0,a.ue)(e,{pathname:v}),w=function(e,t=[],r){let o=r?.state;if(null==e){if(!o)return null;if(o.errors)e=o.matches;else{if(0!==t.length||o.initialized||!(o.matches.length>0))return null;e=o.matches}}let i=e,l=o?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&l?.[e.route.id]!==void 0);(0,n.V1)(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(r&&o){s=o.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=o,a=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){r.isStatic&&(s=!0),i=c>=0?i.slice(0,c+1):[i[0]];break}}}}let d=r?.onError,h=o&&d?(e,t)=>{d(e,{location:o.location,params:o.matches?.[0]?.params??{},pattern:(0,a.gU)(o.matches),errorInfo:t})}:void 0;return i.reduceRight((e,r,a)=>{var d,f;let p,m=!1,y=null,v=null;o&&(p=l&&r.route.id?l[r.route.id]:void 0,y=r.route.errorElement||b,s&&(c<0&&0===a?(d="route-fallback",f="No `HydrateFallback` element provided to render during initial hydration",O[d]||(O[d]=!0,(0,n.$e)(!1,f)),m=!0,v=null):c===a&&(m=!0,v=r.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,a+1)),w=()=>{let t;return t=p?y:m?v:r.route.Component?u.createElement(r.route.Component,null):r.route.element?r.route.element:e,u.createElement(S,{match:r,routeContext:{outlet:e,matches:g,isDataRoute:null!=o},children:t})};return o&&(r.route.ErrorBoundary||r.route.errorElement||0===a)?u.createElement(R,{location:o.location,revalidation:o.revalidation,component:y,error:p,children:w(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:h}):w()},null)}(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},f,e.params),pathname:(0,a.HS)([p,i.encodeLocation?i.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:(0,a.HS)([p,i.encodeLocation?i.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,r);return t&&w?u.createElement(l.di.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...o},navigationType:"POP"}},w):w}let b=u.createElement(function(){let e,t,r,n=(e=u.useContext(l.xN),t=L("useRouteError"),r=k("useRouteError"),void 0!==e?e:t.errors?.[r]),o=(0,a.pX)(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null;return u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},o),i?u.createElement("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"}},i):null,null)},null);var R=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=l.Bu;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){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){let t=function(e){if(e.startsWith(`${s}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new a.cj(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?u.createElement(l.Pl.Provider,{value:this.props.routeContext},u.createElement(l.xN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?u.createElement(x,{error:e},t):t}};let E=new WeakMap;function x({children:e,error:t}){let{basename:r,navigator:n}=u.useContext(l._3);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${s}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let l=E.get(t);if(l)throw l;let s=(0,a.X9)(e.location,r),c=s.absoluteURL||s.to;if((0,o.c)(e.location,c,(0,o.Y)(n),"allow-explicit"),(0,i.yf)(c))throw Error("Invalid redirect location");if(a.Bd&&!E.get(t))if(s.isExternal||e.reloadDocument)window.location.href=c;else{let r=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:e.replace}));throw E.set(t,r),r}return u.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return e}function S({routeContext:e,match:t,children:r}){let n=u.useContext(l.hf);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(l.Pl.Provider,{value:e},r)}function P(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L(e){let t=u.useContext(l.ay);return(0,n.V1)(t,P(e)),t}function k(e){let t,r=(t=u.useContext(l.Pl),(0,n.V1)(t,P(e)),t),a=r.matches[r.matches.length-1];return(0,n.V1)(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function C(){return k("useRouteId")}function D(){let e=L("useNavigation");return u.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}function M(){let{matches:e,loaderData:t}=L("useMatches");return u.useMemo(()=>e.map(e=>(0,a.wy)(e,t)),[e,t])}let O={}},7629(e,t,r){var n=r(2872);let a="popstate";function o(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function i(e={}){return function(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:l=!1}=n,s=i.history,d="POP",h=null,p=m();function m(){return(s.state||{idx:null}).idx}function y(){d="POP";let e=m(),t=null==e?null:e-p;p=e,h&&h({action:d,location:g.location,delta:t})}function v(e){return f(i,e)}null==p&&(p=0,s.replaceState({...s.state,idx:p},""));let g={get action(){return d},get location(){return e(i,s)},listen(e){if(h)throw Error("A history only accepts one active listener");return i.addEventListener(a,y),h=e,()=>{i.removeEventListener(a,y),h=null}},createHref:e=>t(i,e),createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d="PUSH";let n=o(e)?e:c(g.location,e,t);r&&r(n,e);let a=u(n,p=m()+1),f=g.createHref(n.mask||n);try{s.pushState(a,"",f)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(f)}l&&h&&h({action:d,location:g.location,delta:1})},replace:function(e,t){d="REPLACE";let n=o(e)?e:c(g.location,e,t);r&&r(n,e);let a=u(n,p=m()),i=g.createHref(n.mask||n);s.replaceState(a,"",i),l&&h&&h({action:d,location:g.location,delta:0})},go:e=>s.go(e)};return g}(function(e,t){let{pathname:r="/",search:n="",hash:a=""}=h(e.location.hash.substring(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),c("",{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:d(t))},function(e,t){s("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}function l(e,t){if(!1===e||null==e)throw Error(t)}function s(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch{}}}function u(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function c(e,t,r=null,n,a){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?h(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10),mask:a}}function d({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function h(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function f(e,t,r=!1){let a="http://localhost";e&&(a="null"!==e.location.origin?e.location.origin:e.location.href),l(a,"No window.location.(origin|href) available to create URL");let o="string"==typeof t?t:d(t);return o=o.replace(/ $/,"%20"),!r&&n.iA.test(o)&&(o=a+o),new URL(o,a)}r.d(t,{$e:()=>s,A4:()=>f,AO:()=>d,Rr:()=>h,TM:()=>i,V1:()=>l,yJ:()=>c})},7527(e,t,r){let n=new URL("http://localhost");function a(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),n)}catch{return n}}function o(e,t){return e.origin===t.origin&&("null"!==e.origin||e.protocol===t.protocol&&e.host===t.host)}function i(e,t,r,n){let a=null;try{a=null==e?null:new URL(e,r)}catch{}let i=new URL(t,r),l=null!=a&&!o(a,r),s=!o(i,r);if("reject"===n){if(l||s)throw Error("External navigation is not allowed")}else if(s&&(null==a||!function(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return!!e.toLowerCase().startsWith(r)&&(""===t.host||e.slice(r.length).startsWith("//"))}(e,a)||!o(a,i)))throw Error("External navigation is not allowed")}r.d(t,{Y:()=>a,c:()=>i})},9667(e,t,r){r.d(t,{aE:()=>C,yf:()=>Z});var n=r(2872),a=r(7629),o=r(9932);let i=Symbol("Uninstrumented"),l=new WeakMap;function s(e){return e[i]??e}function u(e,t){return l.set(e,t),()=>{l.get(e)===t&&l.delete(e)}}function c(e){let t=l.get(e);return l.delete(e),t}function d(e){if("error"===e.type)throw e.value;return e.value}async function h(e,t,r,n,o={result:null,innerResult:null},i=e.length-1){let l=e[i];if(l){let s,u=async()=>(s?console.error("You cannot call instrumented handlers more than once"):s=h(e,t,r,n,o,i-1),await s,(0,a.V1)(o.innerResult,"Expected an inner result"),o.innerResult);try{await l(u,t)}catch(e){console.error("An instrumentation function threw an error:",e)}s||await u(),await s}else{try{o.result={type:"success",value:await r()}}catch(e){o.result={type:"error",value:e}}o.innerResult=n(o.result,t)}return o.result||(o.result={type:"error",value:Error("No result assigned in instrumentation chain.")},o.innerResult=n(o.result,t)),o.result}function f(e){return"error"===e.type&&e.value instanceof Error?{status:"error",error:e.value}:{status:"success",error:void 0}}function p(e){var t,r;let{request:n,context:a,params:o}=e;return{...e,request:{method:(t=n).method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}},params:{...o},context:(r=a,{get:e=>r.get(e)})}}function m(e,t){return{currentUrl:(0,a.AO)(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}var y=r(7527);let v=["POST","PUT","PATCH","DELETE"],g=new Set(v),w=new Set(["GET",...v]),b=new Set([301,302,303,307,308]),R=new Set([307,308]),E={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},x={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},S={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},P="remix-router-transitions",L=Symbol("ResetLoaderData");var k=class{#e;#t;#r;#n;constructor(e){this.#e=e,this.#t=(0,o.oI)(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#r??this.#e}get branches(){return this.#n??this.#t}get hasHMRRoutes(){return null!=this.#r}setRoutes(e){this.#e=e,this.#t=(0,o.oI)(e)}setHmrRoutes(e){this.#r=e,this.#n=(0,o.oI)(e)}commitHmrRoutes(){this.#r&&(this.#e=this.#r,this.#t=this.#n,this.#r=void 0,this.#n=void 0)}};function C(e){let t,r,l,v,g,w=e.window?e.window:"u">typeof window?window:void 0,L=void 0!==w&&void 0!==w.document&&void 0!==w.document.createElement;(0,a.V1)(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let C=e.hydrationRouteProperties||[],A=e.mapRouteProperties,U=A||(()=>({}));if(e.instrumentations){let t=e.instrumentations;U=e=>({...A?.(e),...function(e,t){var r,n,a,o;let l=[],u=[],c=[],m=[],y=[],v=[],g=[];e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){null!=e.lazy&&l.push(e.lazy),null!=e["lazy.loader"]&&u.push(e["lazy.loader"]),null!=e["lazy.action"]&&c.push(e["lazy.action"]),null!=e["lazy.middleware"]&&m.push(e["lazy.middleware"]),null!=e.middleware&&y.push(e.middleware),null!=e.loader&&v.push(e.loader),null!=e.action&&g.push(e.action)}}));let w={};if("function"==typeof t.lazy&&l.length>0){let e=t.lazy;w.lazy=async(...t)=>d(await h(l,void 0,()=>e(...t),f))}if("object"==typeof t.lazy){let e=t.lazy;if("function"==typeof e.middleware&&m.length>0){let t=e.middleware;w.lazy=Object.assign(w.lazy||{},{middleware:async(...e)=>d(await h(m,void 0,()=>t(...e),f))})}if("function"==typeof e.loader&&u.length>0){let t=e.loader;w.lazy=Object.assign(w.lazy||{},{loader:async(...e)=>d(await h(u,void 0,()=>t(...e),f))})}if("function"==typeof e.action&&c.length>0){let t=e.action;w.lazy=Object.assign(w.lazy||{},{action:async(...e)=>d(await h(c,void 0,()=>t(...e),f))})}}if("function"==typeof t.loader&&v.length>0){let e=s(t.loader),a=async(...t)=>d(await h(v,p(t[0]),()=>e(...t),f));!0===e.hydrate&&(a.hydrate=!0),r=a,n=e,r[i]=n,w.loader=a}if("function"==typeof t.action&&g.length>0){let e=s(t.action),r=async(...t)=>d(await h(g,p(t[0]),()=>e(...t),f));a=r,o=e,a[i]=o,w.action=r}return t.middleware&&t.middleware.length>0&&y.length>0&&(w.middleware=t.middleware.map(e=>{var t,r;let n=s(e),a=async(...e)=>d(await h(y,p(e[0]),()=>n(...e),f));return t=a,r=n,t[i]=r,a})),w}(t.map(e=>e.route).filter(Boolean),e)})}let z={},N=new k((0,o.R_)(e.routes,U,void 0,z)),_=e.basename||"/";_.startsWith("/")||(_=`/${_}`);let H=e.dataStrategy||F,V={...e.future},I=null,W=new Set,B=null,J=null,G=null,K=null,Z=null!=e.hydrationData,et=(0,o.et)(N.activeRoutes,e.history.location,_,!1,N.branches),er=!1,ec=null;if(null!=et||e.patchRoutesOnNavigation)if(et&&!e.hydrationData&&ta(et,N.activeRoutes,e.history.location.pathname).active&&(et=null),et)if(et.some(e=>e.route.lazy))t=!1,r=!0;else if(et.some(e=>T(e.route))){let n=e.hydrationData?e.hydrationData.loaderData:null,a=e.hydrationData?e.hydrationData.errors:null,o=et;if(a){let e=et.findIndex(e=>void 0!==a[e.route.id]);o=o.slice(0,e+1)}r=!1,t=!0,o.forEach(e=>{let o=$(e.route,n,a);r=r||o.renderFallback,t=t&&!o.shouldLoad})}else t=!0,r=!1;else{t=!1,r=!0,et=[];let n=ta(null,N.activeRoutes,e.history.location.pathname);n.active&&n.matches&&(er=!0,et=n.matches)}else{let n=es(404,{pathname:e.history.location.pathname}),{matches:a,route:o}=el(N.activeRoutes);t=!0,r=!1,et=a,ec={[o.id]:n}}let ed={historyAction:e.history.action,location:e.history.location,matches:et,initialized:t,renderFallback:r,navigation:E,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||ec,fetchers:new Map,blockers:new Map},ep="POP",ev=null,eP=!1,eL=!1,ek=new Map,eC=null,eD=!1,eM=!1,eO=new Set,eT=new Map,e$=0,eA=-1,ej=new Map,eU=new Set,ez=new Map,eN=new Map,e_=new Set,eF=new Map,eH=null;function eV(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=z[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}));let r=[],n=[];(ed={...ed,...e}).fetchers.forEach((e,t)=>{"idle"===e.state&&(e_.has(t)?r.push(t):n.push(t))}),e_.forEach(e=>{ed.fetchers.has(e)||eT.has(e)||r.push(e)}),0===W.size&&(B={newErrors:e.errors??null}),[...W].forEach(n=>n(ed,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>e5(ed.fetchers,e)),n.forEach(e=>ed.fetchers.delete(e))}function eI(t,r,{flushSync:n}={}){let a,o,i=null!=ed.actionData&&null!=ed.navigation.formMethod&&ey(ed.navigation.formMethod)&&"loading"===ed.navigation.state&&t.state?._isRedirect!==!0;a=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:i?ed.actionData:null;let l=r.loaderData?ea(ed.loaderData,r.loaderData,r.matches||[],r.errors):ed.loaderData,s=ed.blockers;s.size>0&&!eD&&(s=new Map(s)).forEach((e,t)=>s.set(t,S));let u=!eD&&tn(t,r.matches||ed.matches),c=!0===eP||null!=ed.navigation.formMethod&&ey(ed.navigation.formMethod)&&t.state?._isRedirect!==!0;if(N.commitHmrRoutes(),eD||"POP"===ep||("PUSH"===ep?e.history.push(t,t.state):"REPLACE"===ep&&e.history.replace(t,t.state)),"POP"===ep){let e=ek.get(ed.location.pathname);e&&e.has(t.pathname)?o={currentLocation:ed.location,nextLocation:t}:ek.has(t.pathname)&&(o={currentLocation:t,nextLocation:ed.location})}else if(eL){let e=ek.get(ed.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ek.set(ed.location.pathname,e)),o={currentLocation:ed.location,nextLocation:t}}eV({...r,actionData:a,loaderData:l,historyAction:ep,location:t,initialized:!0,renderFallback:!1,navigation:E,revalidation:"idle",restoreScrollPosition:u,preventScrollReset:c,blockers:s},{viewTransitionOpts:o,flushSync:!0===n}),ep="POP",eP=!1,eL=!1,eD=!1,eM=!1,ev?.resolve(),ev=null,eH?.resolve(),eH=null}async function eW(t,r){let o;if(ev?.resolve(),ev=null,"number"==typeof t){ev||(ev=eS());let r=ev.promise;return e.history.go(t),r}let i=c(l),{path:s,submission:u,error:d}=M(!1,D(ed.location,ed.matches,_,t,r?.fromRouteId,r?.relative),r);if(r?.mask){let t="string"==typeof r.mask?(0,a.Rr)(r.mask):{...ed.location.mask,...r.mask};if(o={pathname:t.pathname??"",search:t.search??"",hash:t.hash??""},n.iA.test(o.pathname))throw Error("External navigation is not allowed");o.pathname.startsWith("\\")&&(o.pathname=o.pathname.replace(/^\\+/,"/")),(0,y.c)("string"==typeof r.mask?r.mask:(0,a.AO)(r.mask),(0,a.AO)(o),e.history.createURL("/"),"reject")}let h=ed.location,f=(0,a.yJ)(h,s,r&&r.state,void 0,o);f={...f,...e.history.encodeLocation(f)},(0,y.c)(null==t?e.history.createHref(ed.location):"string"==typeof t?t:(0,a.AO)(t),e.history.createHref(f.mask||f),e.history.createURL("/"),"reject");let p=r&&null!=r.replace?r.replace:void 0,m="PUSH";!0===p?m="REPLACE":!1===p||null!=u&&ey(u.formMethod)&&u.formAction===ed.location.pathname+ed.location.search&&(m="REPLACE");let v=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,g=!0===(r&&r.flushSync),w=te({currentLocation:h,nextLocation:f,historyAction:m});w?e8(w,{state:"blocked",location:f,proceed(){e8(w,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),eW(t,r)},reset(){let e=new Map(ed.blockers);e.set(w,S),eV({blockers:e})}}):await eB(m,f,{submission:u,pendingError:d,preventScrollReset:v,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:g,callSiteDefaultShouldRevalidate:r&&r.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:i})}async function eB(t,r,n){var a,i,l,s;let u;v&&v.abort(),v=null,ep=t,eD=!0===(n&&n.startUninterruptedRevalidation),a=ed.location,i=ed.matches,J&&K&&(J[tr(a,i)]=K()),eP=!0===(n&&n.preventScrollReset),eL=!0===(n&&n.enableViewTransition);let c=N.activeRoutes,d=n?.initialHydration&&ed.matches&&ed.matches.length>0&&!er?ed.matches:(0,o.et)(c,r,_,!1,N.branches),h=!0===(n&&n.flushSync);if(d&&ed.initialized&&!eM&&(l=ed.location,s=r,l.pathname===s.pathname&&l.search===s.search&&(""===l.hash?""!==s.hash:l.hash===s.hash||""!==s.hash||!1))&&!(n&&n.submission&&ey(n.submission.formMethod)))return void eI(r,{matches:d},{flushSync:h});let f=ta(d,c,r.pathname);if(f.active&&f.matches&&(d=f.matches),n?.instrumentationNavigateMetaReceiver){let t=ew(e.history,r,d);n.instrumentationNavigateMetaReceiver(t)}if(!d){let{error:e,notFoundMatches:t,route:n}=tt(r.pathname);eI(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:h});return}let p=n&&n.overrideNavigation?{...n.overrideNavigation,matches:d,historyAction:t}:void 0;v=new AbortController;let m=ee(e.history,r,v.signal,n&&n.submission),y=e.getContext?await e.getContext():new o.aB;if(n&&n.pendingError)u=[ei(d).route.id,{type:"error",error:n.pendingError}];else if(n&&n.submission&&ey(n.submission.formMethod)){let a=await eY(m,r,n.submission,d,t,y,f.active,n&&!0===n.initialHydration,{replace:n.replace,flushSync:h});if(a.shortCircuited)return;if(a.pendingActionResult){let[e,t]=a.pendingActionResult;if(eh(t)&&(0,o.pX)(t.error)&&404===t.error.status){v=null,eI(r,{matches:a.matches,loaderData:{},errors:{[e]:t.error}});return}}d=a.matches||d,u=a.pendingActionResult,p=eR(r,d,t,n.submission),h=!1,f.active=!1,m=ee(e.history,m.url,m.signal)}let{shortCircuited:g,matches:w,loaderData:b,errors:R,workingFetchers:E}=await eq(m,r,d,t,y,f.active,p,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,h,u,n&&n.callSiteDefaultShouldRevalidate);g||(v=null,eI(r,{matches:w||d,...eo(u),loaderData:b,errors:R,...E?{fetchers:E}:{}}))}async function eY(t,r,n,a,o,i,l,s,u={}){var c,d,h;let f;if(e0(),eV({navigation:(c=r,d=a,{state:"submitting",location:c,matches:d,historyAction:o,formMethod:(h=n).formMethod,formAction:h.formAction,formEncType:h.formEncType,formData:h.formData,json:h.json,text:h.text})},{flushSync:!0===u.flushSync}),l){let e=await to(a,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=el(N.activeRoutes);return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=ei(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(e.matches)a=e.matches;else{let{notFoundMatches:e,error:t,route:n}=tt(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:t}]}}}let p=eg(a,r);if(p.route.action||p.route.lazy){let e=await eZ(t,r,Y(U,z,t,r,a,p,s?[]:C,i),i,null);if(!(f=e[p.route.id])){for(let t of a)if(e[t.route.id]){f=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}else f={type:"error",error:es(405,{method:t.method,pathname:r.pathname,routeId:p.route.id})};if(ef(f)){let r;return r=u&&null!=u.replace?u.replace:Q(f.response.headers.get("Location"),new URL(t.url),_,e.history)===ed.location.pathname+ed.location.search,await eK(t,f,!0,{submission:n,replace:r}),{shortCircuited:!0}}if(eh(f)){let e=ei(a,p.route.id);return!0!==(u&&u.replace)&&(ep="PUSH"),{matches:a,pendingActionResult:[e.route.id,f,p.route.id]}}return{matches:a,pendingActionResult:[p.route.id,f]}}async function eq(t,r,n,a,o,i,l,s,u,c,d,h,f,p){let m=l||eR(r,n,a,s),y=s||u||eb(m),g=!eD&&!d;if(i){if(g){let e=eJ(f);eV({navigation:m,...void 0!==e?{actionData:e}:{}},{flushSync:h})}let e=await to(n,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=el(N.activeRoutes);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=ei(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)n=e.matches;else{let{error:e,notFoundMatches:t,route:n}=tt(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}}let w=N.activeRoutes,{dsMatches:b,revalidatingFetchers:R}=O(t,o,U,z,e.history,ed,n,y,r,d?[]:C,!0===d,eM,eO,e_,ez,eU,w,_,null!=e.patchRoutesOnNavigation,N.branches,f,p);if(eA=++e$,!e.dataStrategy&&!b.some(e=>e.shouldLoad)&&!b.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===R.length){let e=new Map(ed.fetchers),t=e6(e);return eI(r,{matches:n,loaderData:{},errors:f&&eh(f[1])?{[f[0]]:f[1].error}:null,...eo(f),...t?{fetchers:e}:{}},{flushSync:h}),{shortCircuited:!0}}if(g){var E;let e,t={};if(!i){t.navigation=m;let e=eJ(f);void 0!==e&&(t.actionData=e)}R.length>0&&(E=R,e=new Map(ed.fetchers),E.forEach(t=>{let r=e.get(t.key),n=eE(void 0,r?r.data:void 0);e.set(t.key,n)}),t.fetchers=e),eV(t,{flushSync:h})}R.forEach(e=>{e3(e.key),e.controller&&eT.set(e.key,e.controller)});let x=()=>R.forEach(e=>e3(e.key));v&&v.signal.addEventListener("abort",x);let{loaderResults:S,fetcherResults:P}=await eQ(b,R,t,r,o);if(t.signal.aborted)return{shortCircuited:!0};v&&v.signal.removeEventListener("abort",x),R.forEach(e=>eT.delete(e.key));let L=eu(S);if(L)return await eK(t,L.result,!0,{replace:c}),{shortCircuited:!0};if(L=eu(P))return eU.add(L.key),await eK(t,L.result,!0,{replace:c}),{shortCircuited:!0};let k=new Map(ed.fetchers),{loaderData:D,errors:M}=en(ed,n,S,f,R,P,k);d&&ed.errors&&(M={...ed.errors,...M});let T=e6(k),$=e7(eA,k);return{matches:n,loaderData:D,errors:M,...T||$||R.length>0?{workingFetchers:k}:{}}}function eJ(e){if(e&&!eh(e[1]))return{[e[0]]:e[1].data};if(ed.actionData)if(0===Object.keys(ed.actionData).length)return null;else return ed.actionData}async function eG(t,r,n,i,l,s,u,c,d,h){var f,p;e0(),ez.delete(t),e1(t,(f=d,p=ed.fetchers.get(t),{state:"submitting",formMethod:f.formMethod,formAction:f.formAction,formEncType:f.formEncType,formData:f.formData,json:f.json,text:f.text,data:p?p.data:void 0}),{flushSync:u});let m=new AbortController,y=ee(e.history,n,m.signal,d);if(s){let e=await to(i,new URL(y.url).pathname,y.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void e2(t,r,e.error,{flushSync:u});if(!e.matches)return void e2(t,r,es(404,{pathname:n}),{flushSync:u});i=e.matches}let g=eg(i,n);if(!g.route.action&&!g.route.lazy)return void e2(t,r,es(405,{method:d.formMethod,pathname:n,routeId:r}),{flushSync:u});eT.set(t,m);let w=e$,b=Y(U,z,y,n,i,g,C,l),R=await eZ(y,n,b,l,t),E=R[g.route.id];if(!E){for(let e of b)if(R[e.route.id]){E=R[e.route.id];break}}if(y.signal.aborted){eT.get(t)===m&&eT.delete(t);return}if(e_.has(t)){if(ef(E)||eh(E))return void e1(t,ex(void 0))}else{if(ef(E))return(eT.delete(t),eA>w)?void e1(t,ex(void 0)):(eU.add(t),e1(t,eE(d)),eK(y,E,!1,{fetcherSubmission:d,preventScrollReset:c}));if(eh(E))return void e2(t,r,E.error)}let x=ed.navigation.location||ed.location,S=ee(e.history,x,m.signal),P=N.activeRoutes,L="idle"!==ed.navigation.state?(0,o.et)(P,ed.navigation.location,_,!1,N.branches):ed.matches;(0,a.V1)(L,"Didn't find any matches after fetcher action");let k=++e$;ej.set(t,k);let{dsMatches:D,revalidatingFetchers:M}=O(S,l,U,z,e.history,ed,L,d,x,C,!1,eM,eO,e_,ez,eU,P,_,null!=e.patchRoutesOnNavigation,N.branches,[g.route.id,E],h),T=eE(d,E.data),$=new Map(ed.fetchers);$.set(t,T),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=$.get(t),n=eE(void 0,r?r.data:void 0);$.set(t,n),e3(t),e.controller&&eT.set(t,e.controller)}),eV({fetchers:$});let A=()=>M.forEach(e=>e3(e.key));m.signal.addEventListener("abort",A);let{loaderResults:j,fetcherResults:F}=await eQ(D,M,S,x,l);if(m.signal.aborted){ej.get(t)===k&&ej.delete(t);return}m.signal.removeEventListener("abort",A),ej.delete(t),eT.delete(t),M.forEach(e=>eT.delete(e.key));let H=ed.fetchers.has(t),V=e=>{if(!H)return e;let r=new Map(e.fetchers);return r.set(t,ex(E.data)),{...e,fetchers:r}},I=eu(j);if(I)return ed=V(ed),eK(S,I.result,!1,{preventScrollReset:c});if(I=eu(F))return eU.add(I.key),ed=V(ed),eK(S,I.result,!1,{preventScrollReset:c});let W=new Map(ed.fetchers);H&&W.set(t,ex(E.data));let{loaderData:B,errors:q}=en(ed,L,j,void 0,M,F,W);e7(k,W),"loading"===ed.navigation.state&&k>eA?((0,a.V1)(ep,"Expected pending action"),v&&v.abort(),eI(ed.navigation.location,{matches:L,loaderData:B,errors:q,fetchers:W})):(eV({errors:q,loaderData:ea(ed.loaderData,B,L,q),fetchers:W}),eM=!1)}async function eX(t,r,n,a,o,i,l,s,u){let c=ed.fetchers.get(t);e1(t,eE(u,c?c.data:void 0),{flushSync:l});let d=new AbortController,h=ee(e.history,n,d.signal);if(i){let e=await to(a,new URL(h.url).pathname,h.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void e2(t,r,e.error,{flushSync:l});if(!e.matches)return void e2(t,r,es(404,{pathname:n}),{flushSync:l});a=e.matches}let f=eg(a,n);eT.set(t,d);let p=e$,m=await eZ(h,n,Y(U,z,h,n,a,f,C,o),o,t),y=m[f.route.id];if(!y){for(let e of a)if(m[e.route.id]){y=m[e.route.id];break}}if(eT.get(t)===d&&eT.delete(t),!h.signal.aborted){if(e_.has(t))return void e1(t,ex(void 0));if(ef(y))if(eA>p)return void e1(t,ex(void 0));else{eU.add(t),await eK(h,y,!1,{preventScrollReset:s});return}if(eh(y))return void e2(t,r,y.error);e1(t,ex(y.data))}}async function eK(t,r,n,{submission:i,fetcherSubmission:l,preventScrollReset:s,replace:u}={}){n||(ev?.resolve(),ev=null),r.response.headers.has("X-Remix-Revalidate")&&(eM=!0);let c=r.response.headers.get("Location");(0,a.V1)(c,"Expected a Location header on the redirect Response");let d=c,h=new URL(t.url);c=Q(c,h,_,e.history),(0,y.c)(d,c,h,"allow-explicit");let f=(0,a.yJ)(ed.location,c,{_isRedirect:!0});if(L){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else if((0,o.vh)(c)){let t=(0,a.A4)(w,c,!0);e=t.origin!==w.location.origin||null==(0,o.pb)(t.pathname,_)}if(e)return void(u?w.location.replace(c):w.location.assign(c))}v=null;let p=!0===u||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:m,formAction:g,formEncType:b}=ed.navigation;!i&&!l&&m&&g&&b&&(i=eb(ed.navigation));let E=i||l;R.has(r.response.status)&&E&&ey(E.formMethod)?await eB(p,f,{submission:{...E,formAction:c},preventScrollReset:s||eP,enableViewTransition:n?eL:void 0}):await eB(p,f,{overrideNavigation:eR(f,[],p,i),fetcherSubmission:l,preventScrollReset:s||eP,enableViewTransition:n?eL:void 0})}async function eZ(e,t,r,n,i){let l,s={};try{l=await q(H,e,t,r,i,n,!1)}catch(e){return r.filter(e=>e.shouldLoad).forEach(t=>{s[t.route.id]={type:"error",error:e}}),s}if(e.signal.aborted)return s;if(!ey(e.method))for(let e of r){if(l[e.route.id]?.type==="error")break;!l.hasOwnProperty(e.route.id)&&!ed.loaderData.hasOwnProperty(e.route.id)&&(!ed.errors||!ed.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(l[e.route.id]={type:"error",result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,n]of Object.entries(l)){var u;if(em((u=n).result)&&b.has(u.result.status)){let i=n.result;s[t]={type:"redirect",response:function(e,t,r,n,i){let l=e.headers.get("Location");if((0,a.V1)(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!(0,o.vh)(l)){let a=n.slice(0,n.findIndex(e=>e.route.id===r)+1);l=D(new URL(t.url),a,i,l),e.headers.set("Location",l)}return e}(i,e,t,r,_)}}else s[t]=await X(n)}return s}async function eQ(e,t,r,n,a){let o=eZ(r,n,e,a,null),i=Promise.all(t.map(async e=>{if(!e.matches||!e.match||!e.request||!e.controller)return Promise.resolve({[e.key]:{type:"error",error:es(404,{pathname:e.path})}});{let t=(await eZ(e.request,e.path,e.matches,a,e.key))[e.match.route.id];return{[e.key]:t}}}));return{loaderResults:await o,fetcherResults:(await i).reduce((e,t)=>Object.assign(e,t),{})}}function e0(){eM=!0,ez.forEach((e,t)=>{eT.has(t)&&eO.add(t),e3(t)})}function e1(e,t,r={}){let n=new Map(ed.fetchers);n.set(e,t),eV({fetchers:n},{flushSync:!0===(r&&r.flushSync)})}function e2(e,t,r,n={}){let a=ei(ed.matches,t),o=new Map(ed.fetchers);e5(o,e),eV({errors:{[a.route.id]:r},fetchers:o},{flushSync:!0===(n&&n.flushSync)})}function e5(e,t){let r=ed.fetchers.get(t);eT.has(t)&&!(r&&"loading"===r.state&&ej.has(t))&&e3(t),ez.delete(t),ej.delete(t),eU.delete(t),e_.delete(t),eO.delete(t),e.delete(t)}function e3(e,t){let r=eT.get(e);r&&(r.abort(t),eT.delete(e))}function e4(e,t){for(let r of e){let e=t.get(r);(0,a.V1)(e,`Expected fetcher: ${r}`);let n=ex(e.data);t.set(r,n)}}function e6(e){let t=[],r=!1;for(let n of eU){let o=e.get(n);(0,a.V1)(o,`Expected fetcher: ${n}`),"loading"===o.state&&(eU.delete(n),t.push(n),r=!0)}return e4(t,e),r}function e7(e,t){let r=[];for(let[n,o]of ej)if(o<e){let e=t.get(n);(0,a.V1)(e,`Expected fetcher: ${n}`),"loading"===e.state&&(e3(n),ej.delete(n),r.push(n))}return e4(r,t),r.length>0}function e9(e){ed.blockers.delete(e),eF.delete(e)}function e8(e,t){let r=ed.blockers.get(e)||S;(0,a.V1)("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(ed.blockers);n.set(e,t),eV({blockers:n})}function te({currentLocation:e,nextLocation:t,historyAction:r}){if(0===eF.size)return;eF.size>1&&(0,a.$e)(!1,"A router only supports one blocker at a time");let n=Array.from(eF.entries()),[o,i]=n[n.length-1],l=ed.blockers.get(o);if((!l||"proceeding"!==l.state)&&i({currentLocation:e,nextLocation:t,historyAction:r}))return o}function tt(e){let t=es(404,{pathname:e}),{matches:r,route:n}=el(N.activeRoutes);return{notFoundMatches:r,route:n,error:t}}function tr(e,t){return G&&G(e,t.map(e=>(0,o.wy)(e,ed.loaderData)))||e.key}function tn(e,t){if(J){let r=J[tr(e,t)];if("number"==typeof r)return r}return null}function ta(t,r,n){if(e.patchRoutesOnNavigation){let e=N.branches;if(!t)return{active:!0,matches:(0,o.et)(r,n,_,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:(0,o.et)(r,n,_,!0,e)}}return{active:!1,matches:null}}async function to(t,r,n,a){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let i=t;for(;;){let t=z;try{await e.patchRoutesOnNavigation({signal:n,path:r,matches:i,fetcherKey:a,patch:(e,r)=>{n.aborted||j(e,r,N,t,U,!1)}})}catch(e){return{type:"error",error:e,partialMatches:i}}if(n.aborted)return{type:"aborted"};let l=N.branches,s=(0,o.et)(N.activeRoutes,r,_,!1,l),u=null;if(s){if(0===Object.keys(s[0].params).length)return{type:"success",matches:s};else if(!((u=(0,o.et)(N.activeRoutes,r,_,!0,l))&&i.length<u.length&&ti(i,u.slice(0,i.length))))return{type:"success",matches:s}}if(u||(u=(0,o.et)(N.activeRoutes,r,_,!0,l)),!u||ti(i,u))return{type:"success",matches:null};i=u}}function ti(e,t){return e.length===t.length&&e.every((e,r)=>e.route.id===t[r].route.id)}return l={get basename(){return _},get future(){return V},get state(){return ed},get routes(){return N.stableRoutes},get branches(){return N.branches},get manifest(){return z},get window(){return w},initialize:function(){if(I=e.history.listen(({action:t,location:r,delta:n})=>{if(g){g(),g=void 0;return}(0,a.$e)(0===eF.size||null!=n,"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=te({currentLocation:ed.location,nextLocation:r,historyAction:t});if(o&&null!=n){let t=new Promise(e=>{g=e});e.history.go(-1*n),e8(o,{state:"blocked",location:r,proceed(){e8(o,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(ed.blockers);e.set(o,S),eV({blockers:e})}}),ev?.resolve(),ev=null;return}return eB(t,r)}),L){var t=w,r=ek;try{let e=t.sessionStorage.getItem(P);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t||{}))n&&Array.isArray(n)&&r.set(e,new Set(n||[]))}}catch{}let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(P,JSON.stringify(r))}catch(e){(0,a.$e)(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}})(w,ek);w.addEventListener("pagehide",e),eC=()=>w.removeEventListener("pagehide",e)}return ed.initialized||eB("POP",ed.location,{initialHydration:!0}),l},subscribe:function(e){if(W.add(e),B){let{newErrors:t}=B;B=null,e(ed,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>W.delete(e)},enableScrollRestoration:function(e,t,r){if(J=e,K=t,G=r||null,!Z&&ed.navigation===E){Z=!0;let e=tn(ed.location,ed.matches);null!=e&&eV({restoreScrollPosition:e})}return()=>{J=null,K=null,G=null}},navigate:eW,fetch:async function t(t,r,n,a){e3(t);let i=!0===(a&&a.flushSync),s=c(l),u=N.activeRoutes,d=D(ed.location,ed.matches,_,n,r,a?.relative),h=(0,o.et)(u,d,_,!1,N.branches),f=ta(h,u,d);if(f.active&&f.matches&&(h=f.matches),s&&s(ew(e.history,d,h)),!h)return void e2(t,r,es(404,{pathname:d}),{flushSync:i});let{path:p,submission:m,error:y}=M(!0,d,a);if(y)return void e2(t,r,y,{flushSync:i});let v=e.getContext?await e.getContext():new o.aB,g=!0===(a&&a.preventScrollReset);m&&ey(m.formMethod)?await eG(t,r,p,h,v,f.active,i,g,m,a&&a.defaultShouldRevalidate):(ez.set(t,{routeId:r,path:p}),await eX(t,r,p,h,v,f.active,i,g,m))},revalidate:function(){eH||(eH=eS()),e0(),eV({revalidation:"loading"});let e=eH.promise;return"submitting"===ed.navigation.state||("idle"===ed.navigation.state?eB(ed.historyAction,ed.location,{startUninterruptedRevalidation:!0}):eB(ep||ed.historyAction,ed.navigation.location,{overrideNavigation:ed.navigation,enableViewTransition:!0===eL})),e},createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:function(e){return eN.set(e,(eN.get(e)||0)+1),e_.has(e)&&e_.delete(e),ed.fetchers.get(e)||x},resetFetcher:function(e,t){e3(e,t?.reason),e1(e,ex(null))},deleteFetcher:function(e){let t=(eN.get(e)||0)-1;t<=0?(eN.delete(e),e_.add(e)):eN.set(e,t),eV({fetchers:new Map(ed.fetchers)})},dispose:function(){I&&I(),eC&&eC(),W.clear(),v&&v.abort(),ed.fetchers.forEach((e,t)=>e5(ed.fetchers,t)),ed.blockers.forEach((e,t)=>e9(t))},getBlocker:function(e,t){let r=ed.blockers.get(e)||S;return eF.get(e)!==t&&eF.set(e,t),r},deleteBlocker:e9,patchRoutes:function(e,t,r=!1){j(e,t,N,z,U,r),N.hasHMRRoutes||eV({})},_internalFetchControllers:eT,_internalSetRoutes:function(e){z={},N.setHmrRoutes((0,o.R_)(e,U,void 0,z))},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){eV(e)}},e.instrumentations&&(l=function(e,t){var r,n,o,l;let c=[],p=[];if(t.forEach(e=>e({instrument(e){null!=e.navigate&&c.push(e.navigate),null!=e.fetch&&p.push(e.fetch)}})),c.length>0){let t=s(e.navigate),o=async(...r)=>{let n,[o,i]=r,l={to:"number"==typeof o||"string"==typeof o?o:o?(0,a.AO)(o):".",...m(e,i??{})};return d(await h(c,l,async()=>{if("number"==typeof o)return await t(...r);let a=u(e,e=>{n=e});try{return await t(...r)}finally{a()}},e=>({...f(e),meta:n})))};r=o,n=t,r[i]=n,e.navigate=o}if(p.length>0){let t=s(e.fetch),r=async(...r)=>{let n,[a,o,i,l]=r;return d(await h(p,{href:i??".",fetcherKey:a,...m(e,l??{})},async()=>{let a=u(e,e=>{n=e});try{return await t(...r)}finally{a()}},e=>({...f(e),meta:n})))};o=r,l=t,o[i]=l,e.fetch=r}return e}(l,e.instrumentations.map(e=>e.router).filter(Boolean))),l}function D(e,t,r,n,i,l){let s,u;if(i){for(let e of(s=[],t))if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=(0,o.Gh)(n||".",(0,o.PD)(s),(0,o.pb)(e.pathname,r)||e.pathname,"path"===l);if(null==n&&(c.search=e.search,c.hash=e.hash),(null==n||""===n||"."===n)&&u){let e=ev(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"/"!==r&&(c.pathname=(0,o.RW)({basename:r,pathname:c.pathname})),(0,a.AO)(c)}function M(e,t,r){var n;let o,i;if(!r||!(null!=r&&("formData"in r&&null!=r.formData||"body"in r&&void 0!==r.body)))return{path:t};if(r.formMethod&&(n=r.formMethod,!w.has(n.toUpperCase())))return{path:t,error:es(405,{method:r.formMethod})};let l=()=>({path:t,error:es(400,{type:"invalid-body"})}),s=(r.formMethod||"get").toUpperCase(),u=ec(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!ey(s))return l();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}
3
+ `,""):String(r.body);return{path:t,submission:{formMethod:s,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if("application/json"===r.formEncType){if(!ey(s))return l();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:s,formAction:u,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch{return l()}}}if((0,a.V1)("function"==typeof FormData,"FormData is not available in this environment"),r.formData)o=et(r.formData),i=r.formData;else if(r.body instanceof FormData)o=et(r.body),i=r.body;else if(r.body instanceof URLSearchParams)i=er(o=r.body);else if(null==r.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(r.body),i=er(o)}catch{return l()}let c={formMethod:s,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ey(c.formMethod))return{path:t,submission:c};let d=(0,a.Rr)(t);return e&&d.search&&ev(d.search)&&o.append("index",""),d.search=`?${o}`,{path:(0,a.AO)(d),submission:c}}function O(e,t,r,n,a,i,l,s,u,c,d,h,f,p,m,y,v,g,w,b,R,E){let x,S=R?eh(R[1])?R[1].error:R[1].data:void 0,P=a.createURL(i.location),L=a.createURL(u);if(d&&i.errors){let e=Object.keys(i.errors)[0];x=l.findIndex(t=>t.route.id===e)}else if(R&&eh(R[1])){let e=R[0];x=l.findIndex(t=>t.route.id===e)-1}let k=R?R[1].statusCode:void 0,C=k&&k>=400,D={currentUrl:P,currentParams:i.matches[0]?.params||{},nextUrl:L,nextParams:l[0].params,...s,actionResult:S,actionStatus:k},M=(0,o.gU)(l),O=l.map((a,o)=>{var l,s,f,p,m;let y,{route:v}=a,g=null;if(null!=x&&o>x)g=!1;else if(v.lazy)g=!0;else if(T(v))if(d){let{shouldLoad:e}=$(v,i.loaderData,i.errors);g=e}else{let e,t;l=i.loaderData,s=i.matches[o],f=a,e=!s||f.route.id!==s.route.id,t=!l.hasOwnProperty(f.route.id),(e||t)&&(g=!0)}else g=!1;if(null!==g)return B(r,n,e,u,M,a,c,t,g);let w=!1;"boolean"==typeof E?w=E:C?w=!1:h||P.pathname+P.search===L.pathname+L.search||P.search!==L.search?w=!0:(p=i.matches[o],m=a,y=p.route.path,(p.pathname!==m.pathname||null!=y&&y.endsWith("*")&&p.params["*"]!==m.params["*"])&&(w=!0));let b={...D,defaultShouldRevalidate:w};return B(r,n,e,u,M,a,c,t,A(a,b),b,E)}),j=[];return m.forEach((e,s)=>{if(d||!l.some(t=>t.route.id===e.routeId)||p.has(s))return;let u=i.fetchers.get(s),m=u&&"idle"!==u.state&&void 0===u.data,R=(0,o.et)(v,e.path,g??"/",!1,b);if(!R){if(w&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(y.has(s))return;let x=eg(R,e.path),S=new AbortController,P=ee(a,e.path,S.signal),L=null;if(f.has(s))f.delete(s),L=Y(r,n,P,e.path,R,x,c,t);else if(m)h&&(L=Y(r,n,P,e.path,R,x,c,t));else{let a={...D,defaultShouldRevalidate:"boolean"==typeof E?E:!C&&h};A(x,a)&&(L=Y(r,n,P,e.path,R,x,c,t,a))}L&&j.push({key:s,routeId:e.routeId,path:e.path,matches:L,match:x,request:P,controller:S})}),{dsMatches:O,revalidatingFetchers:j}}function T(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function $(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!T(e))return{shouldLoad:!1,renderFallback:!1};let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];if(!n&&a)return{shouldLoad:!1,renderFallback:!1};if("function"==typeof e.loader&&!0===e.loader.hydrate)return{shouldLoad:!0,renderFallback:!n};let o=!n&&!a;return{shouldLoad:o,renderFallback:o}}function A(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function j(e,t,r,n,i,l){let s;if(e){let t=n[e];(0,a.V1)(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),s=t.children}else s=r.activeRoutes;let u=[],c=[];if(t.forEach(e=>{let t=s.find(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||(t.children?.every((t,n)=>r.children?.some(r=>e(t,r)))??!1))})(e,t));t?c.push({existingRoute:t,newRoute:e}):u.push(e)}),u.length>0){let t=(0,o.R_)(u,i,[e||"_","patch",String(s?.length||"0")],n);s.push(...t)}if(l&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:r}=c[e],[n]=(0,o.R_)([r],i,[],{},!0);Object.assign(t,{element:n.element?n.element:t.element,errorElement:n.errorElement?n.errorElement:t.errorElement,hydrateFallbackElement:n.hydrateFallbackElement?n.hydrateFallbackElement:t.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}let U=new WeakMap,z=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let i=r[t.id];if((0,a.V1)(i,"No route found in manifest"),!i.lazy||"object"!=typeof i.lazy)return;let l=i.lazy[e];if(!l)return;let s=U.get(i);s||(s={},U.set(i,s));let u=s[e];if(u)return u;let c=(async()=>{let t=(0,o.pr)(e),r=void 0!==i[e];if(t)(0,a.$e)(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),s[e]=Promise.resolve();else if(r)(0,a.$e)(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await l();null!=t&&(Object.assign(i,{[e]:t}),Object.assign(i,n(i)))}"object"==typeof i.lazy&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>void 0===e)&&(i.lazy=void 0))})();return s[e]=c,c},N=new WeakMap;async function _(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function F(e){return e.matches.some(e=>e.route.middleware)?H(e,()=>_(e)):_(e)}function H(e,t){return V(e,t,e=>{var t,r;if(em(t=e)&&(r=t.status,b.has(r))&&t.headers.has("Location"))throw e;return e},ed,r);async function r(t,r,n){if(n)return Object.assign(n.value,{[r]:{type:"error",result:t}});{let{matches:n}=e,a=Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.shouldCallHandler()),0)),o=n[a].route.id;for(let e of n.slice(0,a+1))try{await e._lazyPromises?.route}catch{o=e.route.id;break}return{[ei(n,o).route.id]:{type:"error",result:t}}}}}async function V(e,t,r,n,a){let{matches:o,...i}=e;return await I(i,o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,r,n,a)}async function I(e,t,r,n,a,o,i=0){let l,{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let u=t[i];if(!u)return await r();let[c,d]=u,h=async()=>{if(l)throw Error("You may only call `next()` once per middleware");try{return(l={value:await I(e,t,r,n,a,o,i+1)}).value}catch(e){return(l={value:await o(e,c,l)}).value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;if(a(r))return r;if(l)return r??l.value;return(l={value:await h()}).value}catch(e){return await o(e,c,l)}}function W(e,t,r,n,i){let l=z({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),s=function(e,t,r,n,i){let l,s=r[e.id];if((0,a.V1)(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=N.get(s);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{(0,a.V1)("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let i=(0,o.ep)(e),l=void 0!==s[e];i?(0,a.$e)(!i,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):l?(0,a.$e)(!l,`Route "${s.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.`):r[e]=n}Object.assign(s,r),Object.assign(s,{...n(s),lazy:void 0})})();return N.set(s,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let u=Object.keys(e.lazy),c=[];for(let a of u){if(i&&i.includes(a))continue;let o=z({key:a,route:e,manifest:r,mapRouteProperties:n});o&&(c.push(o),a===t&&(l=o))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:l}}(n.route,ey(r.method)?"action":"loader",t,e,i);return{middleware:l,route:s.lazyRoutePromise,handler:s.lazyHandlerPromise}}function B(e,t,r,n,a,o,i,l,s,u=null,c){let d=!1,h=W(e,t,r,o,i);return{...o,_lazyPromises:h,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler:e=>(d=!0,u)?"boolean"==typeof c?A(o,{...u,defaultShouldRevalidate:c}):"boolean"==typeof e?A(o,{...u,defaultShouldRevalidate:e}):A(o,u):s,resolve(e){let{lazy:t,loader:i,middleware:u}=o.route,c=d||s||e&&!ey(r.method)&&(t||i),f=u&&u.length>0&&!i&&!t;return c&&(ey(r.method)||!f)?J({request:r,path:n,pattern:a,match:o,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:e,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Y(e,t,r,n,a,i,l,s,u=null){return a.map(c=>c.route.id!==i.route.id?{...c,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:W(e,t,r,c,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:B(e,t,r,n,(0,o.gU)(a),c,l,s,!0,u))}async function q(e,t,r,n,a,i,l){n.some(e=>e._lazyPromises?.middleware)&&await Promise.all(n.map(e=>e._lazyPromises?.middleware));let s={request:t,url:(0,o.cg)(t,r),pattern:(0,o.gU)(n),params:n[0].params,context:i,matches:n},u=l?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>H(s,()=>e({...s,fetcherKey:a,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})),c=await e({...s,fetcherKey:a,runClientMiddleware:u});try{await Promise.all(n.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return c}async function J({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:a,lazyRoutePromise:i,handlerOverride:l,scopedContext:s}){let u,c,d=ey(e.method),h=d?"action":"loader",f=a=>{let i,u=new Promise((e,t)=>i=t);c=()=>i(),e.signal.addEventListener("abort",c);let d=i=>"function"!=typeof a?Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${n.route.id}]`)):a({request:e,url:(0,o.cg)(e,t),pattern:r,params:n.params,context:s},...void 0!==i?[i]:[]);return Promise.race([(async()=>{try{return{type:"data",result:await (l?l(e=>d(e)):d())}}catch(e){return{type:"error",result:e}}})(),u])};try{let t=d?n.route.action:n.route.loader;if(a||i)if(t){let e,[r]=await Promise.all([f(t).catch(t=>{e=t}),a,i]);if(void 0!==e)throw e;u=r}else{await a;let t=d?n.route.action:n.route.loader;if(t)[u]=await Promise.all([f(t),i]);else{if("action"!==h)return{type:"data",result:void 0};let t=new URL(e.url),r=t.pathname+t.search;throw es(405,{method:e.method,pathname:r,routeId:n.route.id})}}else if(t)u=await f(t);else{let t=new URL(e.url);throw es(404,{pathname:t.pathname+t.search})}}catch(e){return{type:"error",result:e}}finally{c&&e.signal.removeEventListener("abort",c)}return u}async function G(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function X(e){let{result:t,type:r}=e;if(em(t)){let e;try{e=await G(t)}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new o.cj(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}if("error"===r){if(ep(t)){var n;return t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:(n=t,new o.cj(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)),statusCode:(0,o.pX)(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}}return{type:"error",error:t,statusCode:(0,o.pX)(t)?t.status:void 0}}return ep(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}let K=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Z(e){try{return K.includes(new URL(e).protocol)}catch{return!1}}function Q(e,t,r,a){if((0,o.vh)(e)){let a=new URL(n.iA.test(e)?(0,n.lS)(e,t.protocol):e);if(Z(a.toString()))throw Error("Invalid redirect location");let i=null!=(0,o.pb)(a.pathname,r);if(a.origin===t.origin&&i)return(0,o.Hv)(a.pathname)+a.search+a.hash}try{if(Z(a.createURL(e).toString()))throw Error("Invalid redirect location")}catch{}return e}function ee(e,t,r,n){let a=e.createURL(ec(t)).toString(),o={signal:r};if(n&&ey(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=et(n.formData):o.body=n.formData}return new Request(a,o)}function et(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function er(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function en(e,t,r,n,i,l,s){let{loaderData:u,errors:c}=function(e,t,r,n=!1,i=!1){let l,s={},u=null,c=!1,d={},h=r&&eh(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let f=r.route.id,p=t[f];if((0,a.V1)(!ef(p),"Cannot handle redirect results in processLoaderData"),eh(p)){let t=p.error;if(void 0!==h&&(t=h,h=void 0),u=u||{},i)u[f]=t;else{let r=ei(e,f);null==u[r.route.id]&&(u[r.route.id]=t)}n||(s[f]=L),c||(c=!0,l=(0,o.pX)(p.error)?p.error.status:500),p.headers&&(d[f]=p.headers)}else s[f]=p.data,p.statusCode&&200!==p.statusCode&&!c&&(l=p.statusCode),p.headers&&(d[f]=p.headers)}),void 0!==h&&r&&(u={[r[0]]:h},r[2]&&(s[r[2]]=void 0)),{loaderData:s,errors:u,statusCode:l||200,loaderHeaders:d}}(t,r,n);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:o}=t;if(o&&o.signal.aborted)return;let i=l[r];if((0,a.V1)(i,"Did not find corresponding fetcher result"),eh(i)){let t=ei(e.matches,n?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:i.error}),s.delete(r)}else if(ef(i))(0,a.V1)(!1,"Unhandled fetcher revalidation redirect");else{let e=ex(i.data);s.set(r,e)}}),{loaderData:u,errors:c}}function ea(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==L).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function eo(e){return e?eh(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ei(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>null!=e.route.ErrorBoundary||null!=e.route.errorElement)||e[0]}function el(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 es(e,{pathname:t,routeId:r,method:n,type:a,message:i}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(l="Bad Request",n&&t&&r?s=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(s="Unable to encode submission body")):403===e?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):404===e?(l="Not Found",s=`No route matches URL "${t}"`):405===e&&(l="Method Not Allowed",n&&t&&r?s=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(s=`Invalid request method "${n.toUpperCase()}"`)),new o.cj(e||500,l,Error(s),!0)}function eu(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(ef(n))return{key:r,result:n}}}function ec(e){return(0,a.AO)({..."string"==typeof e?(0,a.Rr)(e):e,hash:""})}function ed(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>{var r;return"string"==typeof e&&null!=(r=t)&&"object"==typeof r&&"type"in r&&"result"in r&&("data"===r.type||"error"===r.type)})}function eh(e){return"error"===e.type}function ef(e){return"redirect"===(e&&e.type)}function ep(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function em(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function ey(e){return g.has(e.toUpperCase())}function ev(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eg(e,t){let r="string"==typeof t?(0,a.Rr)(t).search:t.search;if(e[e.length-1].route.index&&ev(r||""))return e[e.length-1];let n=(0,o.nr)(e);return n[n.length-1]}function ew(e,t,r){return{url:(0,o.cg)(e.createURL(t),t),pattern:r?(0,o.gU)(r):"",params:r?.[0]?.params?{...r[0].params}:{}}}function eb(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};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function eR(e,t,r,n){return n?{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function eE(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 ex(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 eS(){let e,t,r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch{}},t=async e=>{a(e);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}},2872(e,t,r){function n(e,t){return t+e.replace(/\\/g,"/")}r.d(t,{lS:()=>n},{E6:/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,iA:/^[\\/]{2}/})},9932(e,t,r){var n=r(2872),a=r(7629),o=r(6255),i=class{#a=new Map;constructor(e){if(e)for(let[t,r]of e)this.set(t,r)}get(e){if(this.#a.has(e))return this.#a.get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw Error("No value found for context")}set(e,t){this.#a.set(e,t)}};let l=new Set(["lazy","caseSensitive","path","id","index","children"]);function s(e){return l.has(e)}let u=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function c(e){return u.has(e)}function d(e){let t={};return e.Component&&Object.assign(t,{element:o.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:o.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:o.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function h(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function f(e,t,r="/"){return p(e,t,r,!1)}function p(e,t,r,n,o){let i=x(("string"==typeof t?(0,a.Rr)(t):t).pathname||"/",r);if(null==i)return null;let l=o??y(e),s=null,u=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return(0,a.$e)(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}(i);for(let e=0;null==s&&e<l.length;++e)s=function(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e<n.length;++e){let l=n[e],s=e===n.length-1,u="/"===o?t:t.slice(o.length)||"/",c={path:l.relativePath,caseSensitive:l.caseSensitive,end:s},d=l.matcher&&l.compiledParams?R(c,u,l.matcher,l.compiledParams):b(c,u),h=l.route;if(!d&&s&&r&&!n[n.length-1].route.index&&(d=b({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(a,d.params),i.push({params:a,pathname:O([o,d.pathname]),pathnameBase:$(O([o,d.pathnameBase])),route:h}),"/"!==d.pathnameBase&&(o=O([o,d.pathnameBase]))}return i}(l[e],u,n);return s}function m(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,loaderData:t[r.id],handle:r.handle}}function y(e){let t=function e(t,r=[],n=[],o="",i=!1){let l=(t,l,s=i,u)=>{var c,d;let h,f,p={relativePath:void 0===u?t.path||"":u,caseSensitive:!0===t.caseSensitive,childrenIndex:l,route:t};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(o)&&s)return;(0,a.V1)(p.relativePath.startsWith(o),`Absolute route path "${p.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(o.length)}let m=O([o,p.relativePath]),y=n.concat(p);t.children&&t.children.length>0&&((0,a.V1)(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),e(t.children,r,y,m,s)),(null!=t.path||t.index)&&r.push({path:m,score:(c=m,d=t.index,f=(h=c.split("/")).length,h.some(w)&&(f+=-2),d&&(f+=2),h.filter(e=>!w(e)).reduce((e,t)=>e+(v.test(t)?3:g.test(t)?3.5:""===t?1:10),f)),routesMeta:y.map((e,t)=>{let[r,n]=E(e.relativePath,e.caseSensitive,t===y.length-1);return{...e,matcher:r,compiledParams:n}})})};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.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))l(e,t,!0,r);else l(e,t)}),r}(e);return t.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)}),t}let v=/^:[\w-]+$/,g=/^:[\w-]+/,w=e=>"*"===e;function b(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=E(e.path,e.caseSensitive,e.end);return R(e,t,r,n)}function R(e,t,r,n){let a=t.match(r);if(!a)return null;let o=a[0],i=T(o,1),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=T(o.slice(0,o.length-e.length),1)}let a=l[n];return r&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function E(e,t=!1,r=!0){(0,a.$e)("*"===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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r,a,o)=>{if(n.push({paramName:t,isOptional:null!=r}),r){let t=o.charAt(a+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,"(?:/$1)?");return e.endsWith("*")?(n.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function x(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 S({basename:e,pathname:t}){return"/"===t?e:O([e,t])}function P(e,t){let r=T(t).split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}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 k(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function C(e){let t=k(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function D(e,t,r,n=!1){let o,i;"string"==typeof e?o=(0,a.Rr)(e):(o={...e},(0,a.V1)(!o.pathname||!o.pathname.includes("?"),L("?","pathname","search",o)),(0,a.V1)(!o.pathname||!o.pathname.includes("#"),L("#","pathname","hash",o)),(0,a.V1)(!o.search||!o.search.includes("#"),L("#","search","hash",o)));let l=""===e||""===o.pathname,s=l?"/":o.pathname;if(null==s)i=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=function(e,t="/"){let{pathname:r,search:n="",hash:o=""}="string"==typeof e?(0,a.Rr)(e):e;return{pathname:r?(r=M(r)).startsWith("/")||r.startsWith("\\")?P(r.substring(1),"/"):P(r,t):t,search:A(n),hash:j(o)}}(o,i),c=s&&"/"!==s&&s.endsWith("/"),d=(l||"."===s)&&r.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}let M=e=>e.replace(/[\\/]{2,}/g,"/"),O=e=>M(e.join("/"));function T(e,t=0){let r=e.length;for(;r>t&&47===e.charCodeAt(r-1);)r--;return r===e.length?e:e.slice(0,r)}let $=e=>T(e).replace(/^\/*/,"/"),A=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",j=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var U=class{status;statusText;data;error;internal;constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function z(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function N(e){return O(e.map(e=>e.route.path).filter(Boolean))||"/"}function _(e,t){let r=new URL("string"==typeof e||e instanceof URL?e:e.url),n="string"==typeof t?(0,a.Rr)(t):t;if(r.pathname=n.pathname||"/",n.search){let e=new URLSearchParams(n.search),t=e.getAll("index");for(let r of(e.delete("index"),t.filter(Boolean)))e.append("index",r);let a=e.toString();r.search=a?`?${a}`:""}else r.search="";return r.hash=n.hash||"",r}let F="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function H(e,t){let r=e;if("string"!=typeof r||!n.E6.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let o=r,i=!1;if(F)try{let e=new URL(window.location.href),a=new URL(n.iA.test(r)?(0,n.lS)(r,e.protocol):r),o=x(a.pathname,t);a.origin===e.origin&&null!=o?r=o+a.search+a.hash:i=!0}catch{(0,a.$e)(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:i,to:r}}r.d(t,{B6:()=>b,Gh:()=>D,MT:()=>d,PD:()=>C,RW:()=>S,R_:()=>function e(t,r=d,n=[],o={},i=!1){return t.map((t,l)=>{let s=[...n,String(l)],u="string"==typeof t.id?t.id:s.join("-");if((0,a.V1)(!0!==t.index||!t.children,"Cannot specify children on an index route"),(0,a.V1)(i||!o[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),!0===t.index){let e={...t,id:u};return o[u]=h(e,r(e)),e}{let n={...t,id:u,children:void 0};return o[u]=h(n,r(n)),t.children&&(n.children=e(t.children,r,s,o,i)),n}})},X9:()=>H,aB:()=>i,cg:()=>_,cj:()=>U,ep:()=>c,et:()=>p,gU:()=>N,nr:()=>k,oI:()=>y,pX:()=>z,pb:()=>x,pr:()=>s,ue:()=>f,wy:()=>m},{Bd:F,HS:O,Hv:M,WF:["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vh:e=>n.E6.test(e)})}}]);