@openmrs/esm-patient-vitals-app
Version:
Patient vitals microfrontend for the OpenMRS SPA
2 lines • 69.4 kB
JavaScript
/*! For license information please see 2913.js.LICENSE.txt */
"use strict";(globalThis.webpackChunk_openmrs_esm_patient_vitals_app=globalThis.webpackChunk_openmrs_esm_patient_vitals_app||[]).push([[2913],{52913:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>q,Await:()=>It,BrowserRouter:()=>fr,Form:()=>wr,HashRouter:()=>pr,Link:()=>gr,MemoryRouter:()=>Tt,NavLink:()=>br,Navigate:()=>_t,NavigationType:()=>n,Outlet:()=>Ot,Route:()=>Bt,Router:()=>Nt,RouterProvider:()=>Mt,Routes:()=>Ft,ScrollRestoration:()=>Rr,UNSAFE_DataRouterContext:()=>We,UNSAFE_DataRouterStateContext:()=>He,UNSAFE_LocationContext:()=>qe,UNSAFE_NavigationContext:()=>Ke,UNSAFE_RouteContext:()=>Je,UNSAFE_useRouteId:()=>bt,UNSAFE_useScrollRestoration:()=>Nr,createBrowserRouter:()=>sr,createHashRouter:()=>ur,createMemoryRouter:()=>Yt,createPath:()=>p,createRoutesFromChildren:()=>Kt,createRoutesFromElements:()=>Kt,createSearchParams:()=>er,defer:()=>V,generatePath:()=>j,isRouteErrorResponse:()=>Z,json:()=>K,matchPath:()=>T,matchRoutes:()=>w,parsePath:()=>m,redirect:()=>X,redirectDocument:()=>G,renderMatches:()=>qt,resolvePath:()=>B,unstable_HistoryRouter:()=>mr,unstable_useBlocker:()=>At,unstable_usePrompt:()=>Ir,useActionData:()=>Dt,useAsyncError:()=>kt,useAsyncValue:()=>Pt,useBeforeUnload:()=>Fr,useFetcher:()=>Tr,useFetchers:()=>_r,useFormAction:()=>Mr,useHref:()=>Ve,useInRouterContext:()=>Xe,useLinkClickHandler:()=>Pr,useLoaderData:()=>xt,useLocation:()=>Ge,useMatch:()=>Ze,useMatches:()=>Rt,useNavigate:()=>tt,useNavigation:()=>wt,useNavigationType:()=>Qe,useOutlet:()=>ot,useOutletContext:()=>nt,useParams:()=>at,useResolvedPath:()=>it,useRevalidator:()=>Et,useRouteError:()=>Ct,useRouteLoaderData:()=>St,useRoutes:()=>lt,useSearchParams:()=>kr,useSubmit:()=>Ar});var n,o=r(1343);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const i="popstate";function l(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:o,v5Compat:a=!1}=e;t=r.map(((e,t)=>h(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=u(null==o?t.length-1:o),l=n.Pop,s=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function h(e,r,n){void 0===r&&(r=null);let o=f(t?c().pathname:"/",e,r,n);return d("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function v(e){return"string"==typeof e?e:p(e)}return{get index(){return i},get action(){return l},get location(){return c()},createHref:v,createURL:e=>new URL(v(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?m(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let o=h(e,r);i+=1,t.splice(i,t.length,o),a&&s&&s({action:l,location:o,delta:1})},replace(e,r){l=n.Replace;let o=h(e,r);t[i]=o,a&&s&&s({action:l,location:o,delta:0})},go(e){l=n.Pop;let r=u(i+e),o=t[r];i=r,s&&s({action:l,location:o,delta:e})},listen:e=>(s=e,()=>{s=null})}}function s(e){return void 0===e&&(e={}),v((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return f("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:p(t)}),null,e)}function u(e){return void 0===e&&(e={}),v((function(e,t){let{pathname:r="/",search:n="",hash:o=""}=m(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),f("",{pathname:r,search:n,hash:o},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:p(t))}),(function(e,t){d("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function c(e,t){if(!1===e||null==e)throw new Error(t)}function d(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function h(e,t){return{usr:e.state,key:e.key,idx:t}}function f(e,t,r,n){return void 0===r&&(r=null),a({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?m(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function p(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function m(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function v(e,t,r,o){void 0===o&&(o={});let{window:l=document.defaultView,v5Compat:s=!1}=o,u=l.history,d=n.Pop,m=null,v=y();function y(){return(u.state||{idx:null}).idx}function g(){d=n.Pop;let e=y(),t=null==e?null:e-v;v=e,m&&m({action:d,location:w.location,delta:t})}function b(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,r="string"==typeof e?e:p(e);return c(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,u.replaceState(a({},u.state,{idx:v}),""));let w={get action(){return d},get location(){return e(l,u)},listen(e){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(i,g),m=e,()=>{l.removeEventListener(i,g),m=null}},createHref:e=>t(l,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){d=n.Push;let o=f(w.location,e,t);r&&r(o,e),v=y()+1;let a=h(o,v),i=w.createHref(o);try{u.pushState(a,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(i)}s&&m&&m({action:d,location:w.location,delta:1})},replace:function(e,t){d=n.Replace;let o=f(w.location,e,t);r&&r(o,e),v=y();let a=h(o,v),i=w.createHref(o);u.replaceState(a,"",i),s&&m&&m({action:d,location:w.location,delta:0})},go:e=>u.go(e)};return w}var y;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(y||(y={}));const g=new Set(["lazy","caseSensitive","path","id","index","children"]);function b(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,o)=>{let i=[...r,o],l="string"==typeof e.id?e.id:i.join("-");if(c(!0!==e.index||!e.children,"Cannot specify children on an index route"),c(!n[l],'Found a route id collision on id "'+l+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=a({},e,t(e),{id:l});return n[l]=r,r}{let r=a({},e,t(e),{id:l,children:void 0});return n[l]=r,e.children&&(r.children=b(e.children,t,i,n)),r}}))}function w(e,t,r){void 0===r&&(r="/");let n=O(("string"==typeof t?m(t):t).pathname||"/",r);if(null==n)return null;let o=R(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let e=0;null==a&&e<o.length;++e)a=M(o[e],_(n));return a}function E(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}function R(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(c(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let l=z([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(c(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),R(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:U(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of x(e.path))o(e,t,r);else o(e,t)})),t}function x(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=x(n.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const S=/^:\w+$/,D=3,C=2,P=1,k=10,L=-2,A=e=>"*"===e;function U(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=L),t&&(n+=C),r.filter((e=>!A(e))).reduce(((e,t)=>e+(S.test(t)?D:""===t?P:k)),n)}function M(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===o?t:t.slice(o.length)||"/",u=T({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;a.push({params:n,pathname:z([o,u.pathname]),pathnameBase:W(z([o,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(o=z([o,u.pathnameBase]))}return a}function j(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(d(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",o=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e)return o(t["*"]);const a=e.match(/^:(\w+)(\??)$/);if(a){const[,e,r]=a;let n=t[e];return c("?"===r||null!=n,'Missing ":'+e+'" param'),o(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function T(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),d("*"===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)=>(n.push(t),"/([^\\/]+)")));return e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce(((e,t,r)=>{if("*"===t){let e=l[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return d(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l[r]||"",t),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function _(e){try{return decodeURI(e)}catch(t){return d(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function O(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 B(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"==typeof e?m(e):e,a=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:a,search:H(n),hash:$(o)}}function N(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 F(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function I(e,t,r,n){let o;void 0===n&&(n=!1),"string"==typeof e?o=m(e):(o=a({},e),c(!o.pathname||!o.pathname.includes("?"),N("?","pathname","search",o)),c(!o.pathname||!o.pathname.includes("#"),N("#","pathname","hash",o)),c(!o.search||!o.search.includes("#"),N("#","search","hash",o)));let i,l=""===e||""===o.pathname,s=l?"/":o.pathname;if(n||null==s)i=r;else{let e=t.length-1;if(s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=B(o,i),d=s&&"/"!==s&&s.endsWith("/"),h=(l||"."===s)&&r.endsWith("/");return u.pathname.endsWith("/")||!d&&!h||(u.pathname+="/"),u}const z=e=>e.join("/").replace(/\/\/+/g,"/"),W=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",$=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",K=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),a({},r,{headers:n}))};class q extends Error{}class J{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],c(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new q("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof q)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n)}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return c(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:Y(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Y(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const V=function(e,t){return void 0===t&&(t={}),new J(e,"number"==typeof t?{status:t}:t)},X=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,a({},r,{headers:n}))},G=(e,t)=>{let r=X(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Q{constructor(e,t,r,n){void 0===n&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Z(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const ee=["post","put","patch","delete"],te=new Set(ee),re=["get",...ee],ne=new Set(re),oe=new Set([301,302,303,307,308]),ae=new Set([307,308]),ie={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},le={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},se={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ce=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function de(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,o=!r;let i;if(c(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=ce;let l,s={},u=b(e.routes,i,void 0,s),h=e.basename||"/",p=a({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),m=null,v=new Set,g=null,R=null,x=null,S=null!=e.hydrationData,D=w(u,e.history.location,h),C=null;if(null==D){let t=Ce(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=De(u);D=r,C={[n.id]:t}}let P,k,L=!(D.some((e=>e.route.lazy))||D.some((e=>e.route.loader))&&null==e.hydrationData),A={historyAction:e.history.action,location:e.history.location,matches:D,initialized:L,navigation:ie,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||C,fetchers:new Map,blockers:new Map},U=n.Pop,M=!1,j=!1,T=!1,_=[],B=[],N=new Map,F=0,I=-1,z=new Map,W=new Set,H=new Map,$=new Map,K=new Map,q=!1;function J(e){A=a({},A,e),v.forEach((e=>e(A)))}function Y(t,r){var o,i;let s,c=null!=A.actionData&&null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);s=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:c?A.actionData:null;let d=r.loaderData?xe(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,h=A.blockers;h.size>0&&(h=new Map(h),h.forEach(((e,t)=>h.set(t,se))));let f=!0===M||null!=A.navigation.formMethod&&Me(A.navigation.formMethod)&&!0!==(null==(i=t.state)?void 0:i._isRedirect);l&&(u=l,l=void 0),j||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),J(a({},r,{actionData:s,loaderData:d,historyAction:U,location:t,initialized:!0,navigation:ie,revalidation:"idle",restoreScrollPosition:ke(t,r.matches||A.matches),preventScrollReset:f,blockers:h})),U=n.Pop,M=!1,j=!1,T=!1,_=[],B=[]}async function V(t,r,o){k&&k.abort(),k=null,U=t,j=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(g&&x){let r=Ee(e,t);g[r]=x()}}(A.location,A.matches),M=!0===(o&&o.preventScrollReset);let c=l||u,d=o&&o.overrideNavigation,f=w(c,r,h);if(!f){let e=Ce(404,{pathname:r.pathname}),{matches:t,route:n}=De(c);return we(),void Y(r,{matches:t,loaderData:{},errors:{[n.id]:e}})}if(A.initialized&&!T&&(p=A.location,m=r,p.pathname===m.pathname&&p.search===m.search&&(""===p.hash?""!==m.hash:p.hash===m.hash||""!==m.hash))&&!(o&&o.submission&&Me(o.submission.formMethod)))return void Y(r,{matches:f});var p,m;k=new AbortController;let v,b,E=be(e.history,r,k.signal,o&&o.submission);if(o&&o.pendingError)b={[Se(f).route.id]:o.pendingError};else if(o&&o.submission&&Me(o.submission.formMethod)){let e=await async function(e,t,r,o,a){void 0===a&&(a={}),Z();let l,u=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(t,r);J({navigation:u});let c=Oe(o,t);if(c.route.action||c.route.lazy){if(l=await ge("action",e,c,o,s,i,h),e.signal.aborted)return{shortCircuited:!0}}else l={type:y.error,error:Ce(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(Ue(l)){let e;return e=a&&null!=a.replace?a.replace:l.location===A.location.pathname+A.location.search,await G(A,l,{submission:r,replace:e}),{shortCircuited:!0}}if(Ae(l)){let e=Se(o,c.route.id);return!0!==(a&&a.replace)&&(U=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Le(l))throw Ce(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(E,r,o.submission,f,{replace:o.replace});if(e.shortCircuited)return;v=e.pendingActionData,b=e.pendingActionError,d=Ne(r,o.submission),E=new Request(E.url,{signal:E.signal})}let{shortCircuited:R,loaderData:S,errors:D}=await async function(t,r,n,o,i,s,c,d,f){let p=o||Ne(r,i),m=i||s||Be(p),v=l||u,[y,g]=pe(e.history,A,n,m,r,T,_,B,H,W,v,h,d,f);if(we((e=>!(n&&n.some((t=>t.route.id===e)))||y&&y.some((t=>t.route.id===e)))),I=++F,0===y.length&&0===g.length){let e=oe();return Y(r,a({matches:n,loaderData:{},errors:f||null},d?{actionData:d}:{},e?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!j){g.forEach((e=>{let t=A.fetchers.get(e.key),r=Fe(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}));let e=d||A.actionData;J(a({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},g.length>0?{fetchers:new Map(A.fetchers)}:{}))}g.forEach((e=>{N.has(e.key)&&re(e.key),e.controller&&N.set(e.key,e.controller)}));let b=()=>g.forEach((e=>re(e.key)));k&&k.signal.addEventListener("abort",b);let{results:w,loaderResults:E,fetcherResults:R}=await Q(A.matches,n,y,g,t);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",b),g.forEach((e=>N.delete(e.key)));let x=Pe(w);if(x){if(x.idx>=y.length){let e=g[x.idx-y.length].key;W.add(e)}return await G(A,x.result,{replace:c}),{shortCircuited:!0}}let{loaderData:S,errors:D}=Re(A,n,y,E,f,g,R,$);$.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&$.delete(t)}))}));let C=oe(),P=de(I);return a({loaderData:S,errors:D},C||P||g.length>0?{fetchers:new Map(A.fetchers)}:{})}(E,r,f,d,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,v,b);R||(k=null,Y(r,a({matches:f},v?{actionData:v}:{},{loaderData:S,errors:D})))}function X(e){return A.fetchers.get(e)||le}async function G(o,i,l){let{submission:s,fetcherSubmission:u,replace:d}=void 0===l?{}:l;i.revalidate&&(T=!0);let p=f(o.location,i.location,{_isRedirect:!0});if(c(p,"Expected a location on the redirect navigation"),r){let r=!1;if(i.reloadDocument)r=!0;else if(ue.test(i.location)){const n=e.history.createURL(i.location);r=n.origin!==t.location.origin||null==O(n.pathname,h)}if(r)return void(d?t.location.replace(i.location):t.location.assign(i.location))}k=null;let m=!0===d?n.Replace:n.Push,{formMethod:v,formAction:y,formEncType:g}=o.navigation;!s&&!u&&v&&y&&g&&(s=Be(o.navigation));let b=s||u;if(ae.has(i.status)&&b&&Me(b.formMethod))await V(m,p,{submission:a({},b,{formAction:i.location}),preventScrollReset:M});else{let e=Ne(p,s);await V(m,p,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:M})}}async function Q(t,r,n,o,a){let l=await Promise.all([...n.map((e=>ge("loader",a,e,r,s,i,h))),...o.map((t=>t.matches&&t.match&&t.controller?ge("loader",be(e.history,t.path,t.controller.signal),t.match,t.matches,s,i,h):{type:y.error,error:Ce(404,{pathname:t.path})}))]),u=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([je(t,n,u,u.map((()=>a.signal)),!1,A.loaderData),je(t,o.map((e=>e.match)),c,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:u,fetcherResults:c}}function Z(){T=!0,_.push(...we()),H.forEach(((e,t)=>{N.has(t)&&(B.push(t),re(t))}))}function ee(e,t,r){let n=Se(A.matches,t);te(e),J({errors:{[n.route.id]:r},fetchers:new Map(A.fetchers)})}function te(e){let t=A.fetchers.get(e);!N.has(e)||t&&"loading"===t.state&&z.has(e)||re(e),H.delete(e),z.delete(e),W.delete(e),A.fetchers.delete(e)}function re(e){let t=N.get(e);c(t,"Expected fetch controller: "+e),t.abort(),N.delete(e)}function ne(e){for(let t of e){let e=Ie(X(t).data);A.fetchers.set(t,e)}}function oe(){let e=[],t=!1;for(let r of W){let n=A.fetchers.get(r);c(n,"Expected fetcher: "+r),"loading"===n.state&&(W.delete(r),e.push(r),t=!0)}return ne(e),t}function de(e){let t=[];for(let[r,n]of z)if(n<e){let e=A.fetchers.get(r);c(e,"Expected fetcher: "+r),"loading"===e.state&&(re(r),z.delete(r),t.push(r))}return ne(t),t.length>0}function me(e){A.blockers.delete(e),K.delete(e)}function ve(e,t){let r=A.blockers.get(e)||se;c("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(A.blockers);n.set(e,t),J({blockers:n})}function ye(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===K.size)return;K.size>1&&d(!1,"A router only supports one blocker at a time");let o=Array.from(K.entries()),[a,i]=o[o.length-1],l=A.blockers.get(a);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function we(e){let t=[];return $.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),$.delete(n))})),t}function Ee(e,t){return R&&R(e,t.map((e=>E(e,A.loaderData))))||e.key}function ke(e,t){if(g){let r=Ee(e,t),n=g[r];if("number"==typeof n)return n}return null}return P={get basename(){return h},get state(){return A},get routes(){return u},initialize:function(){return m=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if(q)return void(q=!1);d(0===K.size||null!=o,"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 a=ye({currentLocation:A.location,nextLocation:n,historyAction:r});return a&&null!=o?(q=!0,e.history.go(-1*o),void ve(a,{state:"blocked",location:n,proceed(){ve(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(A.blockers);e.set(a,se),J({blockers:e})}})):V(r,n)})),A.initialized||V(n.Pop,A.location),P},subscribe:function(e){return v.add(e),()=>v.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,x=t,R=r||null,!S&&A.navigation===ie){S=!0;let e=ke(A.location,A.matches);null!=e&&J({restoreScrollPosition:e})}return()=>{g=null,x=null,R=null}},navigate:async function t(r,o){if("number"==typeof r)return void e.history.go(r);let i=he(A.location,A.matches,h,p.v7_prependBasename,r,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),{path:l,submission:s,error:u}=fe(p.v7_normalizeFormMethod,!1,i,o),c=A.location,d=f(A.location,l,o&&o.state);d=a({},d,e.history.encodeLocation(d));let m=o&&null!=o.replace?o.replace:void 0,v=n.Push;!0===m?v=n.Replace:!1===m||null!=s&&Me(s.formMethod)&&s.formAction===A.location.pathname+A.location.search&&(v=n.Replace);let y=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,g=ye({currentLocation:c,nextLocation:d,historyAction:v});if(!g)return await V(v,d,{submission:s,pendingError:u,preventScrollReset:y,replace:o&&o.replace});ve(g,{state:"blocked",location:d,proceed(){ve(g,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,o)},reset(){let e=new Map(A.blockers);e.set(g,se),J({blockers:e})}})},fetch:function(t,r,n,d){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");N.has(t)&&re(t);let f=l||u,m=he(A.location,A.matches,h,p.v7_prependBasename,n,r,null==d?void 0:d.relative),v=w(f,m,h);if(!v)return void ee(t,r,Ce(404,{pathname:m}));let{path:y,submission:g,error:b}=fe(p.v7_normalizeFormMethod,!0,m,d);if(b)return void ee(t,r,b);let E=Oe(v,y);M=!0===(d&&d.preventScrollReset),g&&Me(g.formMethod)?async function(t,r,n,o,d,f){if(Z(),H.delete(t),!o.route.action&&!o.route.lazy){let e=Ce(405,{method:f.formMethod,pathname:n,routeId:r});return void ee(t,r,e)}let p=function(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}(f,A.fetchers.get(t));A.fetchers.set(t,p),J({fetchers:new Map(A.fetchers)});let m=new AbortController,v=be(e.history,n,m.signal,f);N.set(t,m);let y=F,g=await ge("action",v,o,d,s,i,h);if(v.signal.aborted)return void(N.get(t)===m&&N.delete(t));if(Ue(g)){if(N.delete(t),I>y){let e=Ie(void 0);return A.fetchers.set(t,e),void J({fetchers:new Map(A.fetchers)})}{W.add(t);let e=Fe(f);return A.fetchers.set(t,e),J({fetchers:new Map(A.fetchers)}),G(A,g,{fetcherSubmission:f})}}if(Ae(g))return void ee(t,r,g.error);if(Le(g))throw Ce(400,{type:"defer-action"});let b=A.navigation.location||A.location,E=be(e.history,b,m.signal),R=l||u,x="idle"!==A.navigation.state?w(R,A.navigation.location,h):A.matches;c(x,"Didn't find any matches after fetcher action");let S=++F;z.set(t,S);let D=Fe(f,g.data);A.fetchers.set(t,D);let[C,P]=pe(e.history,A,x,f,b,T,_,B,H,W,R,h,{[o.route.id]:g.data},void 0);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=A.fetchers.get(t),n=Fe(void 0,r?r.data:void 0);A.fetchers.set(t,n),N.has(t)&&re(t),e.controller&&N.set(t,e.controller)})),J({fetchers:new Map(A.fetchers)});let L=()=>P.forEach((e=>re(e.key)));m.signal.addEventListener("abort",L);let{results:M,loaderResults:j,fetcherResults:O}=await Q(A.matches,x,C,P,E);if(m.signal.aborted)return;m.signal.removeEventListener("abort",L),z.delete(t),N.delete(t),P.forEach((e=>N.delete(e.key)));let K=Pe(M);if(K){if(K.idx>=C.length){let e=P[K.idx-C.length].key;W.add(e)}return G(A,K.result)}let{loaderData:q,errors:V}=Re(A,A.matches,C,j,void 0,P,O,$);if(A.fetchers.has(t)){let e=Ie(g.data);A.fetchers.set(t,e)}let X=de(S);"loading"===A.navigation.state&&S>I?(c(U,"Expected pending action"),k&&k.abort(),Y(A.navigation.location,{matches:x,loaderData:q,errors:V,fetchers:new Map(A.fetchers)})):(J(a({errors:V,loaderData:xe(A.loaderData,q,x,V)},X||P.length>0?{fetchers:new Map(A.fetchers)}:{})),T=!1)}(t,r,y,E,v,g):(H.set(t,{routeId:r,path:y}),async function(t,r,n,o,a,l){let u=A.fetchers.get(t),d=Fe(l,u?u.data:void 0);A.fetchers.set(t,d),J({fetchers:new Map(A.fetchers)});let f=new AbortController,p=be(e.history,n,f.signal);N.set(t,f);let m=F,v=await ge("loader",p,o,a,s,i,h);if(Le(v)&&(v=await Te(v,p.signal,!0)||v),N.get(t)===f&&N.delete(t),p.signal.aborted)return;if(Ue(v)){if(I>m){let e=Ie(void 0);return A.fetchers.set(t,e),void J({fetchers:new Map(A.fetchers)})}return W.add(t),void await G(A,v)}if(Ae(v)){let e=Se(A.matches,r);return A.fetchers.delete(t),void J({fetchers:new Map(A.fetchers),errors:{[e.route.id]:v.error}})}c(!Le(v),"Unhandled fetcher deferred data");let y=Ie(v.data);A.fetchers.set(t,y),J({fetchers:new Map(A.fetchers)})}(t,r,y,E,v,g))},revalidate:function(){Z(),J({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?V(U||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):V(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:X,deleteFetcher:te,dispose:function(){m&&m(),v.clear(),k&&k.abort(),A.fetchers.forEach(((e,t)=>te(t))),A.blockers.forEach(((e,t)=>me(t)))},getBlocker:function(e,t){let r=A.blockers.get(e)||se;return K.get(e)!==t&&K.set(e,t),r},deleteBlocker:me,_internalFetchControllers:N,_internalActiveDeferreds:$,_internalSetRoutes:function(e){s={},l=b(e,i,void 0,s)}},P}function he(e,t,r,n,o,a,i){let l,s;if(null!=a&&"path"!==i){l=[];for(let e of t)if(l.push(e),e.route.id===a){s=e;break}}else l=t,s=t[t.length-1];let u=I(o||".",F(l).map((e=>e.pathnameBase)),O(e.pathname,r)||e.pathname,"path"===i);return null==o&&(u.search=e.search,u.hash=e.hash),null!=o&&""!==o&&"."!==o||!s||!s.route.index||_e(u.search)||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(u.pathname="/"===u.pathname?r:z([r,u.pathname])),p(u)}function fe(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(o=n.formMethod,!ne.has(o.toLowerCase())))return{path:r,error:Ce(405,{method:n.formMethod})};var o;let a,i,l=()=>({path:r,error:Ce(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),d=ke(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Me(u))return l();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:d,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Me(u))return l();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:d,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return l()}}}if(c("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=we(n.formData),i=n.formData;else if(n.body instanceof FormData)a=we(n.body),i=n.body;else if(n.body instanceof URLSearchParams)a=n.body,i=Ee(a);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(n.body),i=Ee(a)}catch(e){return l()}let h={formMethod:u,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Me(h.formMethod))return{path:r,submission:h};let f=m(r);return t&&f.search&&_e(f.search)&&a.append("index",""),f.search="?"+a,{path:p(f),submission:h}}function pe(e,t,r,n,o,i,l,s,u,c,d,h,f,p){let m=p?Object.values(p)[0]:f?Object.values(f)[0]:void 0,v=e.createURL(t.location),y=e.createURL(o),g=p?Object.keys(p)[0]:void 0,b=function(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}(r,g).filter(((e,r)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(t.loaderData,t.matches[r],e)||l.some((t=>t===e.route.id)))return!0;let o=t.matches[r],s=e;return ve(e,a({currentUrl:v,currentParams:o.params,nextUrl:y,nextParams:s.params},n,{actionResult:m,defaultShouldRevalidate:i||v.pathname+v.search===y.pathname+y.search||v.search!==y.search||me(o,s)}))})),E=[];return u.forEach(((e,o)=>{if(!r.some((t=>t.route.id===e.routeId)))return;let l=w(d,e.path,h);if(!l)return void E.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let u=t.fetchers.get(o),f=Oe(l,e.path),p=!1;p=!c.has(o)&&(!!s.includes(o)||(u&&"idle"!==u.state&&void 0===u.data?i:ve(f,a({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:r[r.length-1].params},n,{actionResult:m,defaultShouldRevalidate:i})))),p&&E.push({key:o,routeId:e.routeId,path:e.path,matches:l,match:f,controller:new AbortController})})),[b,E]}function me(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ve(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function ye(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];c(o,"No route found in manifest");let i={};for(let e in n){let t=void 0!==o[e]&&"hasErrorBoundary"!==e;d(!t,'Route "'+o.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||g.has(e)||(i[e]=n[e])}Object.assign(o,i),Object.assign(o,a({},t(o),{lazy:void 0}))}async function ge(e,t,r,n,o,a,i,l){let s,u,d;void 0===l&&(l={});let h=e=>{let n,o=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:l.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([h(n).catch((t=>{e=t})),ye(r.route,a,o)]);if(e)throw e;u=t[0]}else{if(await ye(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Ce(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:y.data,data:void 0}}u=await h(n)}else{if(!n){let e=new URL(t.url);throw Ce(404,{pathname:e.pathname+e.search})}u=await h(n)}c(void 0!==u,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){s=y.error,u=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(f=u)&&"number"==typeof f.status&&"string"==typeof f.statusText&&"object"==typeof f.headers&&void 0!==f.body){let e,o=u.status;if(oe.has(o)){let e=u.headers.get("Location");if(c(e,"Redirects returned/thrown from loaders/actions must have a Location header"),ue.test(e)){if(!l.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=O(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=he(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(l.isStaticRequest)throw u.headers.set("Location",e),u;return{type:y.redirect,status:o,location:e,revalidate:null!==u.headers.get("X-Remix-Revalidate"),reloadDocument:null!==u.headers.get("X-Remix-Reload-Document")}}if(l.isRouteRequest)throw{type:s===y.error?y.error:y.data,response:u};let a=u.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await u.json():await u.text(),s===y.error?{type:s,error:new Q(o,u.statusText,e),headers:u.headers}:{type:y.data,data:e,statusCode:u.status,headers:u.headers}}var f,p,m;return s===y.error?{type:s,error:u}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(u)?{type:y.deferred,deferredData:u,statusCode:null==(p=u.init)?void 0:p.status,headers:(null==(m=u.init)?void 0:m.headers)&&new Headers(u.init.headers)}:{type:y.data,data:u}}function be(e,t,r,n){let o=e.createURL(ke(t)).toString(),a={signal:r};if(n&&Me(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=we(n.formData):a.body=n.formData}return new Request(o,a)}function we(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function Ee(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Re(e,t,r,n,o,i,l,s){let{loaderData:u,errors:d}=function(e,t,r,n,o){let a,i={},l=null,s=!1,u={};return r.forEach(((r,d)=>{let h=t[d].route.id;if(c(!Ue(r),"Cannot handle redirect results in processLoaderData"),Ae(r)){let t=Se(e,h),o=r.error;n&&(o=Object.values(n)[0],n=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=o),i[h]=void 0,s||(s=!0,a=Z(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else Le(r)?(o.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||s||(a=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(l=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:l,statusCode:a||200,loaderHeaders:u}}(t,r,n,o,s);for(let t=0;t<i.length;t++){let{key:r,match:n,controller:o}=i[t];c(void 0!==l&&void 0!==l[t],"Did not find corresponding fetcher result");let s=l[t];if(!o||!o.signal.aborted)if(Ae(s)){let t=Se(e.matches,null==n?void 0:n.route.id);d&&d[t.route.id]||(d=a({},d,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(Ue(s))c(!1,"Unhandled fetcher revalidation redirect");else if(Le(s))c(!1,"Unhandled fetcher deferred data");else{let t=Ie(s.data);e.fetchers.set(r,t)}}return{loaderData:u,errors:d}}function xe(e,t,r,n){let o=a({},t);for(let a of r){let r=a.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(o[r]=t[r]):void 0!==e[r]&&a.route.loader&&(o[r]=e[r]),n&&n.hasOwnProperty(r))break}return o}function Se(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function De(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ce(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a?l="defer() is not supported in actions":"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Q(e||500,i,new Error(l),!0)}function Pe(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ue(r))return{result:r,idx:t}}}function ke(e){return p(a({},"string"==typeof e?m(e):e,{hash:""}))}function Le(e){return e.type===y.deferred}function Ae(e){return e.type===y.error}function Ue(e){return(e&&e.type)===y.redirect}function Me(e){return te.has(e.toLowerCase())}async function je(e,t,r,n,o,a){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find((e=>e.route.id===s.route.id)),d=null!=u&&!me(u,s)&&void 0!==(a&&a[s.route.id]);if(Le(l)&&(o||d)){let e=n[i];c(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Te(l,e,o).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Te(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:y.data,data:e.deferredData.unwrappedData}}catch(e){return{type:y.error,error:e}}return{type:y.data,data:e.deferredData.data}}}function _e(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Oe(e,t){let r="string"==typeof t?m(t).search:t.search;if(e[e.length-1].route.index&&_e(r||""))return e[e.length-1];let n=F(e);return n[n.length-1]}function Be(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n)return null!=o?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function Ne(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Fe(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 Ie(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 ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ze.apply(this,arguments)}Symbol("deferred");const We=o.createContext(null),He=o.createContext(null),$e=o.createContext(null),Ke=o.createContext(null),qe=o.createContext(null),Je=o.createContext({outlet:null,matches:[],isDataRoute:!1}),Ye=o.createContext(null);function Ve(e,t){let{relative:r}=void 0===t?{}:t;Xe()||c(!1);let{basename:n,navigator:a}=o.useContext(Ke),{hash:i,pathname:l,search:s}=it(e,{relative:r}),u=l;return"/"!==n&&(u="/"===l?n:z([n,l])),a.createHref({pathname:u,search:s,hash:i})}function Xe(){return null!=o.useContext(qe)}function Ge(){return Xe()||c(!1),o.useContext(qe).location}function Qe(){return o.useContext(qe).navigationType}function Ze(e){Xe()||c(!1);let{pathname:t}=Ge();return o.useMemo((()=>T(e,t)),[t,e])}function et(e){o.useContext(Ke).static||o.useLayoutEffect(e)}function tt(){let{isDataRoute:e}=o.useContext(Je);return e?function(){let{router:e}=vt(pt.UseNavigateStable),t=gt(mt.UseNavigateStable),r=o.useRef(!1);return et((()=>{r.current=!0})),o.useCallback((function(n,o){void 0===o&&(o={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,ze({fromRouteId:t},o)))}),[e,t])}():function(){Xe()||c(!1);let e=o.useContext(We),{basename:t,navigator:r}=o.useContext(Ke),{matches:n}=o.useContext(Je),{pathname:a}=Ge(),i=JSON.stringify(F(n).map((e=>e.pathnameBase))),l=o.useRef(!1);return et((()=>{l.current=!0})),o.useCallback((function(n,o){if(void 0===o&&(o={}),!l.current)return;if("number"==typeof n)return void r.go(n);let s=I(n,JSON.parse(i),a,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:z([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)}),[t,r,i,a,e])}()}const rt=o.createContext(null);function nt(){return o.useContext(rt)}function ot(e){let t=o.useContext(Je).outlet;return t?o.createElement(rt.Provider,{value:e},t):t}function at(){let{matches:e}=o.useContext(Je),t=e[e.length-1];return t?t.params:{}}function it(e,t){let{relative:r}=void 0===t?{}:t,{matches:n}=o.useContext(Je),{pathname:a}=Ge(),i=JSON.stringify(F(n).map((e=>e.pathnameBase)));return o.useMemo((()=>I(e,JSON.parse(i),a,"path"===r)),[e,i,a,r])}function lt(e,t){return st(e,t)}function st(e,t,r){Xe()||c(!1);let{navigator:a}=o.useContext(Ke),{matches:i}=o.useContext(Je),l=i[i.length-1],s=l?l.params:{},u=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let d,h=Ge();if(t){var f;let e="string"==typeof t?m(t):t;"/"===u||(null==(f=e.pathname)?void 0:f.startsWith(u))||c(!1),d=e}else d=h;let p=d.pathname||"/",v=w(e,{pathname:"/"===u?p:p.slice(u.length)||"/"}),y=ft(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:z([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:z([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,r);return t&&y?o.createElement(qe.Provider,{value:{location:ze({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:n.Pop}},y):y}function ut(){let e=Ct(),t=Z(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return o.createElement(o.Fragment,null,o.createElement("h2",null,"Unexpected Application Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},t),r?o.createElement("pre",{style:n},r):null,null)}const ct=o.createElement(ut,null);class dt extends o.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?o.createElement(Je.Provider,{value:this.props.routeContext},o.createElement(Ye.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ht(e){let{routeContext:t,match:r,children:n}=e,a=o.useContext(We);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),o.createElement(Je.Provider,{value:t},n)}function ft(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r=null),null==e){var a;if(null==(a=r)||!a.errors)return null;e=r.matches}let i=e,l=null==(n=r)?void 0:n.errors;if(null!=l){let e=i.findIndex((e=>e.route.id&&(null==l?void 0:l[e.route.id])));e>=0||c(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((e,n,a)=>{let s=n.route.id?null==l?void 0:l[n.route.id]:null,u=null;r&&(u=n.route.errorElement||ct);let c=t.concat(i.slice(0,a+1)),d=()=>{let t;return t=s?u:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(ht,{match:n,routeContext:{outlet:e,matches:c,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?o.createElement(dt,{location:r.location,revalidation:r.revalidation,component:u,error:s,children:d(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):d()}),null)}var pt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pt||{}),mt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRev