@openmrs/esm-stock-management-app 3.2.0 → 3.2.1-pre.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.
Files changed (141) hide show
  1. package/.turbo/cache/c469b46f2f5a9ac5-meta.json +1 -0
  2. package/.turbo/cache/c469b46f2f5a9ac5.tar.zst +0 -0
  3. package/.turbo/turbo-build.log +45 -0
  4. package/dist/1116.js +1 -1
  5. package/dist/1116.js.map +1 -1
  6. package/dist/1119.js +1 -1
  7. package/dist/1197.js +1 -1
  8. package/dist/1351.js +1 -0
  9. package/dist/1351.js.map +1 -0
  10. package/dist/1728.js +1 -0
  11. package/dist/1728.js.map +1 -0
  12. package/dist/2146.js +1 -1
  13. package/dist/2177.js +1 -1
  14. package/dist/2177.js.map +1 -1
  15. package/dist/2461.js +1 -0
  16. package/dist/2461.js.map +1 -0
  17. package/dist/2591.js +1 -0
  18. package/dist/{3824.js.map → 2591.js.map} +1 -1
  19. package/dist/2690.js +1 -1
  20. package/dist/282.js +1 -1
  21. package/dist/282.js.map +1 -1
  22. package/dist/3041.js +1 -1
  23. package/dist/3041.js.map +1 -1
  24. package/dist/3099.js +1 -1
  25. package/dist/3184.js +1 -1
  26. package/dist/3184.js.map +1 -1
  27. package/dist/3449.js +1 -1
  28. package/dist/3449.js.map +1 -1
  29. package/dist/3584.js +1 -1
  30. package/dist/4055.js +1 -1
  31. package/dist/4069.js +1 -0
  32. package/dist/{5609.js.map → 4069.js.map} +1 -1
  33. package/dist/4087.js +1 -0
  34. package/dist/4132.js +1 -1
  35. package/dist/4225.js +1 -1
  36. package/dist/4225.js.map +1 -1
  37. package/dist/4300.js +1 -1
  38. package/dist/4335.js +1 -1
  39. package/dist/4353.js +1 -1
  40. package/dist/4353.js.map +1 -1
  41. package/dist/439.js +1 -1
  42. package/dist/4618.js +1 -1
  43. package/dist/4652.js +1 -1
  44. package/dist/4802.js +1 -1
  45. package/dist/4802.js.map +1 -1
  46. package/dist/4944.js +1 -1
  47. package/dist/5173.js +1 -1
  48. package/dist/5241.js +1 -1
  49. package/dist/5354.js +1 -1
  50. package/dist/5354.js.map +1 -1
  51. package/dist/5422.js +1 -1
  52. package/dist/5422.js.map +1 -1
  53. package/dist/5442.js +1 -1
  54. package/dist/5661.js +1 -1
  55. package/dist/6022.js +1 -1
  56. package/dist/6078.js +2 -0
  57. package/dist/6078.js.map +1 -0
  58. package/dist/6131.js +1 -0
  59. package/dist/6131.js.map +1 -0
  60. package/dist/6184.js +1 -1
  61. package/dist/6184.js.map +1 -1
  62. package/dist/6468.js +1 -1
  63. package/dist/6468.js.map +1 -0
  64. package/dist/6540.js +1 -1
  65. package/dist/6540.js.map +1 -1
  66. package/dist/6589.js +1 -1
  67. package/dist/6606.js +1 -1
  68. package/dist/6606.js.map +1 -1
  69. package/dist/6679.js +1 -1
  70. package/dist/6840.js +1 -1
  71. package/dist/6859.js +1 -1
  72. package/dist/6917.js +1 -0
  73. package/dist/6917.js.map +1 -0
  74. package/dist/7097.js +1 -1
  75. package/dist/7159.js +1 -1
  76. package/dist/7182.js +1 -0
  77. package/dist/7182.js.map +1 -0
  78. package/dist/723.js +1 -1
  79. package/dist/7255.js +1 -1
  80. package/dist/7255.js.map +1 -1
  81. package/dist/744.js +1 -1
  82. package/dist/744.js.map +1 -1
  83. package/dist/7617.js +1 -1
  84. package/dist/7631.js +1 -0
  85. package/dist/7631.js.map +1 -0
  86. package/dist/7889.js +1 -0
  87. package/dist/7889.js.map +1 -0
  88. package/dist/795.js +1 -1
  89. package/dist/8044.js +1 -0
  90. package/dist/{8161.js.map → 8044.js.map} +1 -1
  91. package/dist/8163.js +1 -1
  92. package/dist/8349.js +1 -1
  93. package/dist/8371.js +1 -1
  94. package/dist/8618.js +1 -1
  95. package/dist/890.js +1 -1
  96. package/dist/9214.js +1 -1
  97. package/dist/9538.js +1 -1
  98. package/dist/9569.js +1 -1
  99. package/dist/961.js +1 -1
  100. package/dist/961.js.map +1 -1
  101. package/dist/986.js +1 -1
  102. package/dist/9879.js +1 -1
  103. package/dist/9895.js +1 -1
  104. package/dist/9900.js +1 -1
  105. package/dist/9913.js +1 -1
  106. package/dist/main.js +1 -1
  107. package/dist/main.js.map +1 -1
  108. package/dist/openmrs-esm-stock-management-app.js +1 -1
  109. package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +302 -301
  110. package/dist/openmrs-esm-stock-management-app.js.map +1 -1
  111. package/dist/routes.json +1 -1
  112. package/e2e/support/github/Dockerfile +1 -1
  113. package/package.json +3 -6
  114. package/translations/de.json +368 -368
  115. package/translations/zh.json +279 -279
  116. package/turbo.json +23 -0
  117. package/dist/130.js +0 -1
  118. package/dist/130.js.map +0 -1
  119. package/dist/2415.js +0 -2
  120. package/dist/2415.js.map +0 -1
  121. package/dist/3220.js +0 -1
  122. package/dist/3220.js.map +0 -1
  123. package/dist/3824.js +0 -1
  124. package/dist/4732.js +0 -1
  125. package/dist/4732.js.map +0 -1
  126. package/dist/5125.js +0 -1
  127. package/dist/5125.js.map +0 -1
  128. package/dist/5333.js +0 -1
  129. package/dist/5333.js.map +0 -1
  130. package/dist/5609.js +0 -1
  131. package/dist/6757.js +0 -1
  132. package/dist/6757.js.map +0 -1
  133. package/dist/8161.js +0 -1
  134. package/dist/886.js +0 -1
  135. package/dist/886.js.map +0 -1
  136. package/dist/9186.js +0 -1
  137. package/dist/9186.js.map +0 -1
  138. package/dist/9797.js +0 -2
  139. package/dist/9797.js.LICENSE.txt +0 -14
  140. package/dist/9797.js.map +0 -1
  141. /package/dist/{2415.js.LICENSE.txt → 6078.js.LICENSE.txt} +0 -0
package/dist/282.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 282.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([[282],{20282:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>Y,Await:()=>Wt,BrowserRouter:()=>Sr,Form:()=>kr,HashRouter:()=>Rr,Link:()=>Lr,MemoryRouter:()=>Ft,NavLink:()=>Pr,Navigate:()=>Nt,NavigationType:()=>n,Outlet:()=>Bt,Route:()=>It,Router:()=>zt,RouterProvider:()=>wr,Routes:()=>Ht,ScrollRestoration:()=>_r,UNSAFE_DataRouterContext:()=>Je,UNSAFE_DataRouterStateContext:()=>qe,UNSAFE_FetchersContext:()=>mr,UNSAFE_LocationContext:()=>Xe,UNSAFE_NavigationContext:()=>Ye,UNSAFE_RouteContext:()=>Ge,UNSAFE_ViewTransitionContext:()=>pr,UNSAFE_useRouteId:()=>Rt,UNSAFE_useScrollRestoration:()=>$r,createBrowserRouter:()=>cr,createHashRouter:()=>dr,createMemoryRouter:()=>Gt,createPath:()=>v,createRoutesFromChildren:()=>Vt,createRoutesFromElements:()=>Vt,createSearchParams:()=>nr,defer:()=>Q,generatePath:()=>j,isRouteErrorResponse:()=>re,json:()=>V,matchPath:()=>O,matchRoutes:()=>S,parsePath:()=>y,redirect:()=>Z,redirectDocument:()=>ee,renderMatches:()=>Yt,resolvePath:()=>B,unstable_HistoryRouter:()=>xr,unstable_usePrompt:()=>qr,unstable_useViewTransitionState:()=>Vr,useActionData:()=>kt,useAsyncError:()=>At,useAsyncValue:()=>Tt,useBeforeUnload:()=>Jr,useBlocker:()=>Mt,useFetcher:()=>zr,useFetchers:()=>Hr,useFormAction:()=>Ir,useHref:()=>Ze,useInRouterContext:()=>et,useLinkClickHandler:()=>jr,useLoaderData:()=>Lt,useLocation:()=>tt,useMatch:()=>nt,useMatches:()=>Ct,useNavigate:()=>ot,useNavigation:()=>xt,useNavigationType:()=>rt,useOutlet:()=>st,useOutletContext:()=>lt,useParams:()=>ut,useResolvedPath:()=>ct,useRevalidator:()=>Dt,useRouteError:()=>_t,useRouteLoaderData:()=>Pt,useRoutes:()=>dt,useSearchParams:()=>Or,useSubmit:()=>Br});var n,a=r(16072),o=r(40961),i=r.t(o,2);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const s="popstate";function u(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map(((e,t)=>d(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=u(null==a?t.length-1:a),l=n.Pop,s=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function d(e,r,n){void 0===r&&(r=null);let a=m(t?c().pathname:"/",e,r,n);return f("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function h(e){return"string"==typeof e?e:v(e)}return{get index(){return i},get action(){return l},get location(){return c()},createHref:h,createURL:e=>new URL(h(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?y(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&s&&s({action:l,location:a,delta:1})},replace(e,r){l=n.Replace;let a=d(e,r);t[i]=a,o&&s&&s({action:l,location:a,delta:0})},go(e){l=n.Pop;let r=u(i+e),a=t[r];i=r,s&&s({action:l,location:a,delta:e})},listen:e=>(s=e,()=>{s=null})}}function c(e){return void 0===e&&(e={}),g((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:v(t)}),null,e)}function d(e){return void 0===e&&(e={}),g((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=y(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),m("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:v(t))}),(function(e,t){f("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function h(e,t){if(!1===e||null==e)throw new Error(t)}function f(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function p(e,t){return{usr:e.state,key:e.key,idx:t}}function m(e,t,r,n){return void 0===r&&(r=null),l({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?y(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function v(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function y(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function g(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:i=!1}=a,u=o.history,c=n.Pop,d=null,f=y();function y(){return(u.state||{idx:null}).idx}function g(){c=n.Pop;let e=y(),t=null==e?null:e-f;f=e,d&&d({action:c,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:v(e);return h(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==f&&(f=0,u.replaceState(l({},u.state,{idx:f}),""));let w={get action(){return c},get location(){return e(o,u)},listen(e){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(s,g),d=e,()=>{o.removeEventListener(s,g),d=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=n.Push;let a=m(w.location,e,t);r&&r(a,e),f=y()+1;let l=p(a,f),s=w.createHref(a);try{u.pushState(l,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(s)}i&&d&&d({action:c,location:w.location,delta:1})},replace:function(e,t){c=n.Replace;let a=m(w.location,e,t);r&&r(a,e),f=y();let o=p(a,f),l=w.createHref(a);u.replaceState(o,"",l),i&&d&&d({action:c,location:w.location,delta:0})},go:e=>u.go(e)};return w}var b;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(b||(b={}));const w=new Set(["lazy","caseSensitive","path","id","index","children"]);function E(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(h(!0!==e.index||!e.children,"Cannot specify children on an index route"),h(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=l({},e,t(e),{id:i});return n[i]=r,r}{let r=l({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=E(e.children,t,o,n)),r}}))}function S(e,t,r){void 0===r&&(r="/");let n=N(("string"==typeof t?y(t):t).pathname||"/",r);if(null==n)return null;let a=x(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)))))}(a);let o=null;for(let e=0;null==o&&e<a.length;++e)o=M(a[e],F(n));return o}function R(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function x(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(h(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=K([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(h(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),x(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 D(e.path))a(e,t,r);else a(e,t)})),t}function D(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=D(n.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const C=/^:\w+$/,L=3,P=2,k=1,_=10,T=-2,A=e=>"*"===e;function U(e,t){let r=e.split("/"),n=r.length;return r.some(A)&&(n+=T),t&&(n+=P),r.filter((e=>!A(e))).reduce(((e,t)=>e+(C.test(t)?L:""===t?k:_)),n)}function M(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",u=O({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:K([a,u.pathname]),pathnameBase:$(K([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=K([a,u.pathnameBase]))}return o}function j(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(f(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);const o=e.match(/^:(\w+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return h("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function O(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),f("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:function(e,t){try{return decodeURIComponent(e)}catch(r){return f(!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}}(s||"",n),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function F(e){try{return decodeURI(e)}catch(t){return f(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function N(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:a=""}="string"==typeof e?y(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:J(n),hash:q(a)}}function I(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 z(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function H(e,t){let r=z(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function W(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=y(e):(a=l({},e),h(!a.pathname||!a.pathname.includes("?"),I("?","pathname","search",a)),h(!a.pathname||!a.pathname.includes("#"),I("#","pathname","hash",a)),h(!a.search||!a.search.includes("#"),I("#","search","hash",a)));let o,i=""===e||""===a.pathname,s=i?"/":a.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=B(a,o),c=s&&"/"!==s&&s.endsWith("/"),d=(i||"."===s)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!d||(u.pathname+="/"),u}const K=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),J=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",q=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",V=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),l({},r,{headers:n}))};class Y extends Error{}class X{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],h(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new Y("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 Y)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 h(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:G(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function G(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const Q=function(e,t){return void 0===t&&(t={}),new X(e,"number"==typeof t?{status:t}:t)},Z=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,l({},r,{headers:n}))},ee=(e,t)=>{let r=Z(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class te{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 re(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const ne=["post","put","patch","delete"],ae=new Set(ne),oe=["get",...ne],ie=new Set(oe),le=new Set([301,302,303,307,308]),se=new Set([307,308]),ue={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ce={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},de={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},he=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fe=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),pe="remix-router-transitions";function me(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,a=!r;let o;if(h(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=fe;let i,s,u={},c=E(e.routes,o,void 0,u),d=e.basename||"/",p=l({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),v=null,y=new Set,g=null,w=null,x=null,D=null!=e.hydrationData,C=S(c,e.history.location,d),L=null;if(null==C){let t=_e(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=ke(c);C=r,L={[n.id]:t}}let P,k=C.some((e=>e.route.lazy)),_=C.some((e=>e.route.loader));if(k)s=!1;else if(_)if(p.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;s=C.every((e=>e.route.loader&&!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id])))}else s=null!=e.hydrationData;else s=!0;let T,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:s,navigation:ue,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||L,fetchers:new Map,blockers:new Map},U=n.Pop,M=!1,j=!1,O=new Map,F=null,B=!1,I=!1,z=[],H=[],W=new Map,K=0,$=-1,J=new Map,q=new Set,V=new Map,Y=new Map,X=new Set,G=new Map,Q=new Map,Z=!1;function ee(e,t){void 0===t&&(t={}),A=l({},A,e);let r=[],n=[];p.v7_fetcherPersist&&A.fetchers.forEach(((e,t)=>{"idle"===e.state&&(X.has(t)?n.push(t):r.push(t))})),[...y].forEach((e=>e(A,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),p.v7_fetcherPersist&&(r.forEach((e=>A.fetchers.delete(e))),n.forEach((e=>be(e))))}function te(t,r,a){var o,s;let u,{flushSync:d}=void 0===a?{}:a,h=null!=A.actionData&&null!=A.navigation.formMethod&&Oe(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);u=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:h?A.actionData:null;let f=r.loaderData?Le(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,p=A.blockers;p.size>0&&(p=new Map(p),p.forEach(((e,t)=>p.set(t,de))));let m,v=!0===M||null!=A.navigation.formMethod&&Oe(A.navigation.formMethod)&&!0!==(null==(s=t.state)?void 0:s._isRedirect);if(i&&(c=i,i=void 0),B||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),U===n.Pop){let e=O.get(A.location.pathname);e&&e.has(t.pathname)?m={currentLocation:A.location,nextLocation:t}:O.has(t.pathname)&&(m={currentLocation:t,nextLocation:A.location})}else if(j){let e=O.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),O.set(A.location.pathname,e)),m={currentLocation:A.location,nextLocation:t}}ee(l({},r,{actionData:u,loaderData:f,historyAction:U,location:t,initialized:!0,navigation:ue,revalidation:"idle",restoreScrollPosition:Ve(t,r.matches||A.matches),preventScrollReset:v,blockers:p}),{viewTransitionOpts:m,flushSync:!0===d}),U=n.Pop,M=!1,j=!1,B=!1,I=!1,z=[],H=[]}async function re(t,r,a){T&&T.abort(),T=null,U=t,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(g&&x){let r=qe(e,t);g[r]=x()}}(A.location,A.matches),M=!0===(a&&a.preventScrollReset),j=!0===(a&&a.enableViewTransition);let s=i||c,h=a&&a.overrideNavigation,f=S(s,r,d),m=!0===(a&&a.flushSync);if(!f){let e=_e(404,{pathname:r.pathname}),{matches:t,route:n}=ke(s);return Je(),void te(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:m})}if(A.initialized&&!I&&(v=A.location,y=r,v.pathname===y.pathname&&v.search===y.search&&(""===v.hash?""!==y.hash:v.hash===y.hash||""!==y.hash))&&!(a&&a.submission&&Oe(a.submission.formMethod)))return void te(r,{matches:f},{flushSync:m});var v,y;T=new AbortController;let w,E,R=Re(e.history,r,T.signal,a&&a.submission);if(a&&a.pendingError)E={[Pe(f).route.id]:a.pendingError};else if(a&&a.submission&&Oe(a.submission.formMethod)){let e=await async function(e,t,r,a,i){void 0===i&&(i={}),oe();let l,s=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);ee({navigation:s},{flushSync:!0===i.flushSync});let c=Ie(a,t);if(c.route.action||c.route.lazy){if(l=await Se("action",e,c,a,u,o,d,p.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else l={type:b.error,error:_e(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(je(l)){let e;return e=i&&null!=i.replace?i.replace:l.location===A.location.pathname+A.location.search,await ne(A,l,{submission:r,replace:e}),{shortCircuited:!0}}if(Me(l)){let e=Pe(a,c.route.id);return!0!==(i&&i.replace)&&(U=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Ue(l))throw _e(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(R,r,a.submission,f,{replace:a.replace,flushSync:m});if(e.shortCircuited)return;w=e.pendingActionData,E=e.pendingActionError,h=He(r,a.submission),m=!1,R=new Request(R.url,{signal:R.signal})}let{shortCircuited:D,loaderData:C,errors:L}=await async function(t,r,n,a,o,s,u,h,f,m,v){let y=a||He(r,o),g=o||s||ze(y),b=i||c,[w,E]=ge(e.history,A,n,g,r,p.v7_partialHydration&&!0===h,I,z,H,X,V,q,b,d,m,v);if(Je((e=>!(n&&n.some((t=>t.route.id===e)))||w&&w.some((t=>t.route.id===e)))),$=++K,0===w.length&&0===E.length){let e=xe();return te(r,l({matches:n,loaderData:{},errors:v||null},m?{actionData:m}:{},e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:f}),{shortCircuited:!0}}if(!(B||p.v7_partialHydration&&h)){E.forEach((e=>{let t=A.fetchers.get(e.key),r=We(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}));let e=m||A.actionData;ee(l({navigation:y},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},E.length>0?{fetchers:new Map(A.fetchers)}:{}),{flushSync:f})}E.forEach((e=>{W.has(e.key)&&we(e.key),e.controller&&W.set(e.key,e.controller)}));let S=()=>E.forEach((e=>we(e.key)));T&&T.signal.addEventListener("abort",S);let{results:R,loaderResults:x,fetcherResults:D}=await ae(A.matches,n,w,E,t);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",S),E.forEach((e=>W.delete(e.key)));let C=Te(R);if(C){if(C.idx>=w.length){let e=E[C.idx-w.length].key;q.add(e)}return await ne(A,C.result,{replace:u}),{shortCircuited:!0}}let{loaderData:L,errors:P}=Ce(A,n,w,x,v,E,D,G);G.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&G.delete(t)}))}));let k=xe(),_=De($);return l({loaderData:L,errors:P},k||_||E.length>0?{fetchers:new Map(A.fetchers)}:{})}(R,r,f,h,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,m,w,E);D||(T=null,te(r,l({matches:f},w?{actionData:w}:{},{loaderData:C,errors:L})))}async function ne(a,o,i){let{submission:s,fetcherSubmission:u,replace:c}=void 0===i?{}:i;o.revalidate&&(I=!0);let f=m(a.location,o.location,{_isRedirect:!0});if(h(f,"Expected a location on the redirect navigation"),r){let r=!1;if(o.reloadDocument)r=!0;else if(he.test(o.location)){const n=e.history.createURL(o.location);r=n.origin!==t.location.origin||null==N(n.pathname,d)}if(r)return void(c?t.location.replace(o.location):t.location.assign(o.location))}T=null;let p=!0===c?n.Replace:n.Push,{formMethod:v,formAction:y,formEncType:g}=a.navigation;!s&&!u&&v&&y&&g&&(s=ze(a.navigation));let b=s||u;if(se.has(o.status)&&b&&Oe(b.formMethod))await re(p,f,{submission:l({},b,{formAction:o.location}),preventScrollReset:M});else{let e=He(f,s);await re(p,f,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:M})}}async function ae(t,r,n,a,i){let l=await Promise.all([...n.map((e=>Se("loader",i,e,r,u,o,d,p.v7_relativeSplatPath))),...a.map((t=>t.matches&&t.match&&t.controller?Se("loader",Re(e.history,t.path,t.controller.signal),t.match,t.matches,u,o,d,p.v7_relativeSplatPath):{type:b.error,error:_e(404,{pathname:t.path})}))]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Fe(t,n,s,s.map((()=>i.signal)),!1,A.loaderData),Fe(t,a.map((e=>e.match)),c,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function oe(){I=!0,z.push(...Je()),V.forEach(((e,t)=>{W.has(t)&&(H.push(t),we(t))}))}function ie(e,t,r){void 0===r&&(r={}),A.fetchers.set(e,t),ee({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function le(e,t,r,n){void 0===n&&(n={});let a=Pe(A.matches,t);be(e),ee({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function me(e){return p.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),X.has(e)&&X.delete(e)),A.fetchers.get(e)||ce}function be(e){let t=A.fetchers.get(e);!W.has(e)||t&&"loading"===t.state&&J.has(e)||we(e),V.delete(e),J.delete(e),q.delete(e),X.delete(e),A.fetchers.delete(e)}function we(e){let t=W.get(e);h(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function Ee(e){for(let t of e){let e=Ke(me(t).data);A.fetchers.set(t,e)}}function xe(){let e=[],t=!1;for(let r of q){let n=A.fetchers.get(r);h(n,"Expected fetcher: "+r),"loading"===n.state&&(q.delete(r),e.push(r),t=!0)}return Ee(e),t}function De(e){let t=[];for(let[r,n]of J)if(n<e){let e=A.fetchers.get(r);h(e,"Expected fetcher: "+r),"loading"===e.state&&(we(r),J.delete(r),t.push(r))}return Ee(t),t.length>0}function Ae(e){A.blockers.delete(e),Q.delete(e)}function Be(e,t){let r=A.blockers.get(e)||de;h("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let n=new Map(A.blockers);n.set(e,t),ee({blockers:n})}function $e(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Q.size)return;Q.size>1&&f(!1,"A router only supports one blocker at a time");let a=Array.from(Q.entries()),[o,i]=a[a.length-1],l=A.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function Je(e){let t=[];return G.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),G.delete(n))})),t}function qe(e,t){return w&&w(e,t.map((e=>R(e,A.loaderData))))||e.key}function Ve(e,t){if(g){let r=qe(e,t),n=g[r];if("number"==typeof n)return n}return null}return P={get basename(){return d},get future(){return p},get state(){return A},get routes(){return c},get window(){return t},initialize:function(){if(v=e.history.listen((t=>{let{action:r,location:n,delta:a}=t;if(Z)return void(Z=!1);f(0===Q.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=$e({currentLocation:A.location,nextLocation:n,historyAction:r});return o&&null!=a?(Z=!0,e.history.go(-1*a),void Be(o,{state:"blocked",location:n,proceed(){Be(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(A.blockers);e.set(o,de),ee({blockers:e})}})):re(r,n)})),r){!function(e,t){try{let r=e.sessionStorage.getItem(pe);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,O);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(pe,JSON.stringify(r))}catch(e){f(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,O);t.addEventListener("pagehide",e),F=()=>t.removeEventListener("pagehide",e)}return A.initialized||re(n.Pop,A.location,{initialHydration:!0}),P},subscribe:function(e){return y.add(e),()=>y.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,x=t,w=r||null,!D&&A.navigation===ue){D=!0;let e=Ve(A.location,A.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{g=null,x=null,w=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=ve(A.location,A.matches,d,p.v7_prependBasename,r,p.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:i,submission:s,error:u}=ye(p.v7_normalizeFormMethod,!1,o,a),c=A.location,h=m(A.location,i,a&&a.state);h=l({},h,e.history.encodeLocation(h));let f=a&&null!=a.replace?a.replace:void 0,v=n.Push;!0===f?v=n.Replace:!1===f||null!=s&&Oe(s.formMethod)&&s.formAction===A.location.pathname+A.location.search&&(v=n.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=!0===(a&&a.unstable_flushSync),b=$e({currentLocation:c,nextLocation:h,historyAction:v});if(!b)return await re(v,h,{submission:s,pendingError:u,preventScrollReset:y,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:g});Be(b,{state:"blocked",location:h,proceed(){Be(b,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),t(r,a)},reset(){let e=new Map(A.blockers);e.set(b,de),ee({blockers:e})}})},fetch:function(t,r,n,l){if(a)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.");W.has(t)&&we(t);let s=!0===(l&&l.unstable_flushSync),f=i||c,m=ve(A.location,A.matches,d,p.v7_prependBasename,n,p.v7_relativeSplatPath,r,null==l?void 0:l.relative),v=S(f,m,d);if(!v)return void le(t,r,_e(404,{pathname:m}),{flushSync:s});let{path:y,submission:g,error:b}=ye(p.v7_normalizeFormMethod,!0,m,l);if(b)return void le(t,r,b,{flushSync:s});let w=Ie(v,y);M=!0===(l&&l.preventScrollReset),g&&Oe(g.formMethod)?async function(t,r,n,a,l,s,f){if(oe(),V.delete(t),!a.route.action&&!a.route.lazy){let e=_e(405,{method:f.formMethod,pathname:n,routeId:r});return void le(t,r,e,{flushSync:s})}let m=A.fetchers.get(t);ie(t,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,m),{flushSync:s});let v=new AbortController,y=Re(e.history,n,v.signal,f);W.set(t,v);let g=K,b=await Se("action",y,a,l,u,o,d,p.v7_relativeSplatPath);if(y.signal.aborted)return void(W.get(t)===v&&W.delete(t));if(p.v7_fetcherPersist&&X.has(t)){if(je(b)||Me(b))return void ie(t,Ke(void 0))}else{if(je(b))return W.delete(t),$>g?void ie(t,Ke(void 0)):(q.add(t),ie(t,We(f)),ne(A,b,{fetcherSubmission:f}));if(Me(b))return void le(t,r,b.error)}if(Ue(b))throw _e(400,{type:"defer-action"});let w=A.navigation.location||A.location,E=Re(e.history,w,v.signal),R=i||c,x="idle"!==A.navigation.state?S(R,A.navigation.location,d):A.matches;h(x,"Didn't find any matches after fetcher action");let D=++K;J.set(t,D);let C=We(f,b.data);A.fetchers.set(t,C);let[L,P]=ge(e.history,A,x,f,w,!1,I,z,H,X,V,q,R,d,{[a.route.id]:b.data},void 0);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=A.fetchers.get(t),n=We(void 0,r?r.data:void 0);A.fetchers.set(t,n),W.has(t)&&we(t),e.controller&&W.set(t,e.controller)})),ee({fetchers:new Map(A.fetchers)});let k=()=>P.forEach((e=>we(e.key)));v.signal.addEventListener("abort",k);let{results:_,loaderResults:M,fetcherResults:j}=await ae(A.matches,x,L,P,E);if(v.signal.aborted)return;v.signal.removeEventListener("abort",k),J.delete(t),W.delete(t),P.forEach((e=>W.delete(e.key)));let O=Te(_);if(O){if(O.idx>=L.length){let e=P[O.idx-L.length].key;q.add(e)}return ne(A,O.result)}let{loaderData:F,errors:N}=Ce(A,A.matches,L,M,void 0,P,j,G);if(A.fetchers.has(t)){let e=Ke(b.data);A.fetchers.set(t,e)}De(D),"loading"===A.navigation.state&&D>$?(h(U,"Expected pending action"),T&&T.abort(),te(A.navigation.location,{matches:x,loaderData:F,errors:N,fetchers:new Map(A.fetchers)})):(ee({errors:N,loaderData:Le(A.loaderData,F,x,N),fetchers:new Map(A.fetchers)}),I=!1)}(t,r,y,w,v,s,g):(V.set(t,{routeId:r,path:y}),async function(t,r,n,a,i,l,s){let c=A.fetchers.get(t);ie(t,We(s,c?c.data:void 0),{flushSync:l});let f=new AbortController,m=Re(e.history,n,f.signal);W.set(t,f);let v=K,y=await Se("loader",m,a,i,u,o,d,p.v7_relativeSplatPath);if(Ue(y)&&(y=await Ne(y,m.signal,!0)||y),W.get(t)===f&&W.delete(t),!m.signal.aborted){if(!X.has(t))return je(y)?$>v?void ie(t,Ke(void 0)):(q.add(t),void await ne(A,y)):void(Me(y)?le(t,r,y.error):(h(!Ue(y),"Unhandled fetcher deferred data"),ie(t,Ke(y.data))));ie(t,Ke(void 0))}}(t,r,y,w,v,s,g))},revalidate:function(){oe(),ee({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?re(U||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):re(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:me,deleteFetcher:function(e){if(p.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),X.add(e)):Y.set(e,t)}else be(e);ee({fetchers:new Map(A.fetchers)})},dispose:function(){v&&v(),F&&F(),y.clear(),T&&T.abort(),A.fetchers.forEach(((e,t)=>be(t))),A.blockers.forEach(((e,t)=>Ae(t)))},getBlocker:function(e,t){let r=A.blockers.get(e)||de;return Q.get(e)!==t&&Q.set(e,t),r},deleteBlocker:Ae,_internalFetchControllers:W,_internalActiveDeferreds:G,_internalSetRoutes:function(e){u={},i=E(e,o,void 0,u)}},P}function ve(e,t,r,n,a,o,i,l){let s,u;if(i){s=[];for(let e of t)if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=W(a||".",H(s,o),N(e.pathname,r)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||Be(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:K([r,c.pathname])),v(c)}function ye(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!ie.has(a.toLowerCase())))return{path:r,error:_e(405,{method:n.formMethod})};var a;let o,i,l=()=>({path:r,error:_e(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=Ae(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Oe(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:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Oe(u))return l();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return l()}}}if(h("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=xe(n.formData),i=n.formData;else if(n.body instanceof FormData)o=xe(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=De(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=De(o)}catch(e){return l()}let d={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Oe(d.formMethod))return{path:r,submission:d};let f=y(r);return t&&f.search&&Be(f.search)&&o.append("index",""),f.search="?"+o,{path:v(f),submission:d}}function ge(e,t,r,n,a,o,i,s,u,c,d,h,f,p,m,v){let y=v?Object.values(v)[0]:m?Object.values(m)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),w=v?Object.keys(v)[0]:void 0,E=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,w).filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!!a.loader.hydrate||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||s.some((t=>t===e.route.id)))return!0;let u=t.matches[r],c=e;return we(e,l({currentUrl:g,currentParams:u.params,nextUrl:b,nextParams:c.params},n,{actionResult:y,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||be(u,c)}))})),R=[];return d.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||c.has(a))return;let s=S(f,e.path,p);if(!s)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let d=t.fetchers.get(a),m=Ie(s,e.path),v=!1;v=!h.has(a)&&(!!u.includes(a)||(d&&"idle"!==d.state&&void 0===d.data?i:we(m,l({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:i})))),v&&R.push({key:a,routeId:e.routeId,path:e.path,matches:s,match:m,controller:new AbortController})})),[E,R]}function be(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function we(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function Ee(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];h(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;f(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||w.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,l({},t(a),{lazy:void 0}))}async function Se(e,t,r,n,a,o,i,l,s){let u,c,d;void 0===s&&(s={});let f=e=>{let n,a=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,t=await Promise.all([f(n).catch((t=>{e=t})),Ee(r.route,o,a)]);if(e)throw e;c=t[0]}else{if(await Ee(r.route,o,a),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw _e(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:b.data,data:void 0}}c=await f(n)}else{if(!n){let e=new URL(t.url);throw _e(404,{pathname:e.pathname+e.search})}c=await f(n)}h(void 0!==c,"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){u=b.error,c=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(p=c)&&"number"==typeof p.status&&"string"==typeof p.statusText&&"object"==typeof p.headers&&void 0!==p.body){let e,a=c.status;if(le.has(a)){let e=c.headers.get("Location");if(h(e,"Redirects returned/thrown from loaders/actions must have a Location header"),he.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),a=null!=N(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=ve(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,l);if(s.isStaticRequest)throw c.headers.set("Location",e),c;return{type:b.redirect,status:a,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate"),reloadDocument:null!==c.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest)throw{type:u===b.error?b.error:b.data,response:c};try{let t=c.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?await c.json():await c.text()}catch(e){return{type:b.error,error:e}}return u===b.error?{type:u,error:new te(a,c.statusText,e),headers:c.headers}:{type:b.data,data:e,statusCode:c.status,headers:c.headers}}var p,m,v;return u===b.error?{type:u,error:c}: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}(c)?{type:b.deferred,deferredData:c,statusCode:null==(m=c.init)?void 0:m.status,headers:(null==(v=c.init)?void 0:v.headers)&&new Headers(c.init.headers)}:{type:b.data,data:c}}function Re(e,t,r,n){let a=e.createURL(Ae(t)).toString(),o={signal:r};if(n&&Oe(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=xe(n.formData):o.body=n.formData}return new Request(a,o)}function xe(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function De(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Ce(e,t,r,n,a,o,i,s){let{loaderData:u,errors:c}=function(e,t,r,n,a){let o,i={},l=null,s=!1,u={};return r.forEach(((r,c)=>{let d=t[c].route.id;if(h(!je(r),"Cannot handle redirect results in processLoaderData"),Me(r)){let t=Pe(e,d),a=r.error;n&&(a=Object.values(n)[0],n=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=a),i[d]=void 0,s||(s=!0,o=re(r.error)?r.error.status:500),r.headers&&(u[d]=r.headers)}else Ue(r)?(a.set(d,r.deferredData),i[d]=r.deferredData.data):i[d]=r.data,null==r.statusCode||200===r.statusCode||s||(o=r.statusCode),r.headers&&(u[d]=r.headers)})),n&&(l=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n,a,s);for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];h(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let s=i[t];if(!a||!a.signal.aborted)if(Me(s)){let t=Pe(e.matches,null==n?void 0:n.route.id);c&&c[t.route.id]||(c=l({},c,{[t.route.id]:s.error})),e.fetchers.delete(r)}else if(je(s))h(!1,"Unhandled fetcher revalidation redirect");else if(Ue(s))h(!1,"Unhandled fetcher deferred data");else{let t=Ke(s.data);e.fetchers.set(r,t)}}return{loaderData:u,errors:c}}function Le(e,t,r,n){let a=l({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function Pe(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 ke(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 _e(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new te(e||500,i,new Error(l),!0)}function Te(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(je(r))return{result:r,idx:t}}}function Ae(e){return v(l({},"string"==typeof e?y(e):e,{hash:""}))}function Ue(e){return e.type===b.deferred}function Me(e){return e.type===b.error}function je(e){return(e&&e.type)===b.redirect}function Oe(e){return ae.has(e.toLowerCase())}async function Fe(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find((e=>e.route.id===s.route.id)),c=null!=u&&!be(u,s)&&void 0!==(o&&o[s.route.id]);if(Ue(l)&&(a||c)){let e=n[i];h(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Ne(l,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Ne(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:b.data,data:e.deferredData.unwrappedData}}catch(e){return{type:b.error,error:e}}return{type:b.data,data:e.deferredData.data}}}function Be(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ie(e,t){let r="string"==typeof t?y(t).search:t.search;if(e[e.length-1].route.index&&Be(r||""))return e[e.length-1];let n=z(e);return n[n.length-1]}function ze(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function He(e,t){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 We(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 Ke(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$e.apply(this,arguments)}Symbol("deferred");const Je=a.createContext(null),qe=a.createContext(null),Ve=a.createContext(null),Ye=a.createContext(null),Xe=a.createContext(null),Ge=a.createContext({outlet:null,matches:[],isDataRoute:!1}),Qe=a.createContext(null);function Ze(e,t){let{relative:r}=void 0===t?{}:t;et()||h(!1);let{basename:n,navigator:o}=a.useContext(Ye),{hash:i,pathname:l,search:s}=ct(e,{relative:r}),u=l;return"/"!==n&&(u="/"===l?n:K([n,l])),o.createHref({pathname:u,search:s,hash:i})}function et(){return null!=a.useContext(Xe)}function tt(){return et()||h(!1),a.useContext(Xe).location}function rt(){return a.useContext(Xe).navigationType}function nt(e){et()||h(!1);let{pathname:t}=tt();return a.useMemo((()=>O(e,t)),[t,e])}function at(e){a.useContext(Ye).static||a.useLayoutEffect(e)}function ot(){let{isDataRoute:e}=a.useContext(Ge);return e?function(){let{router:e}=wt(gt.UseNavigateStable),t=St(bt.UseNavigateStable),r=a.useRef(!1);return at((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,$e({fromRouteId:t},a)))}),[e,t])}():function(){et()||h(!1);let e=a.useContext(Je),{basename:t,future:r,navigator:n}=a.useContext(Ye),{matches:o}=a.useContext(Ge),{pathname:i}=tt(),l=JSON.stringify(H(o,r.v7_relativeSplatPath)),s=a.useRef(!1);return at((()=>{s.current=!0})),a.useCallback((function(r,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof r)return void n.go(r);let o=W(r,JSON.parse(l),i,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:K([t,o.pathname])),(a.replace?n.replace:n.push)(o,a.state,a)}),[t,n,l,i,e])}()}const it=a.createContext(null);function lt(){return a.useContext(it)}function st(e){let t=a.useContext(Ge).outlet;return t?a.createElement(it.Provider,{value:e},t):t}function ut(){let{matches:e}=a.useContext(Ge),t=e[e.length-1];return t?t.params:{}}function ct(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=a.useContext(Ye),{matches:o}=a.useContext(Ge),{pathname:i}=tt(),l=JSON.stringify(H(o,n.v7_relativeSplatPath));return a.useMemo((()=>W(e,JSON.parse(l),i,"path"===r)),[e,l,i,r])}function dt(e,t){return ht(e,t)}function ht(e,t,r,o){et()||h(!1);let{navigator:i}=a.useContext(Ye),{matches:l}=a.useContext(Ge),s=l[l.length-1],u=s?s.params:{},c=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let d,f=tt();if(t){var p;let e="string"==typeof t?y(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||h(!1),d=e}else d=f;let m=d.pathname||"/",v=S(e,{pathname:"/"===c?m:m.slice(c.length)||"/"}),g=yt(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:K([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:K([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,r,o);return t&&g?a.createElement(Xe.Provider,{value:{location:$e({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:n.Pop}},g):g}function ft(){let e=_t(),t=re(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 a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:n},r):null,null)}const pt=a.createElement(ft,null);class mt extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(Ge.Provider,{value:this.props.routeContext},a.createElement(Qe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vt(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(Je);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(Ge.Provider,{value:t},n)}function yt(e,t,r,n){var o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let l=e,s=null==(o=r)?void 0:o.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||h(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){u=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}}return l.reduceRight(((e,n,o)=>{let i,d=!1,h=null,f=null;var p;r&&(i=s&&n.route.id?s[n.route.id]:void 0,h=n.route.errorElement||pt,u&&(c<0&&0===o?(jt[p="route-fallback"]||(jt[p]=!0),d=!0,f=null):c===o&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=i?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(vt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?a.createElement(mt,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()}),null)}var gt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(gt||{}),bt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(bt||{});function wt(e){let t=a.useContext(Je);return t||h(!1),t}function Et(e){let t=a.useContext(qe);return t||h(!1),t}function St(e){let t=function(){let e=a.useContext(Ge);return e||h(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||h(!1),r.route.id}function Rt(){return St(bt.UseRouteId)}function xt(){return Et(bt.UseNavigation).navigation}function Dt(){let e=wt(gt.UseRevalidator),t=Et(bt.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])}function Ct(){let{matches:e,loaderData:t}=Et(bt.UseMatches);return a.useMemo((()=>e.map((e=>R(e,t)))),[e,t])}function Lt(){let e=Et(bt.UseLoaderData),t=St(bt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function Pt(e){return Et(bt.UseRouteLoaderData).loaderData[e]}function kt(){let e=Et(bt.UseActionData),t=St(bt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function _t(){var e;let t=a.useContext(Qe),r=Et(bt.UseRouteError),n=St(bt.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function Tt(){let e=a.useContext(Ve);return null==e?void 0:e._data}function At(){let e=a.useContext(Ve);return null==e?void 0:e._error}let Ut=0;function Mt(e){let{router:t,basename:r}=wt(gt.UseBlocker),n=Et(bt.UseBlocker),[o,i]=a.useState(""),l=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:$e({},n,{pathname:N(n.pathname,r)||n.pathname}),nextLocation:$e({},a,{pathname:N(a.pathname,r)||a.pathname}),historyAction:o})}),[r,e]);return a.useEffect((()=>{let e=String(++Ut);return i(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==o&&t.getBlocker(o,l)}),[t,o,l]),o&&n.blockers.has(o)?n.blockers.get(o):de}const jt={},Ot=a.startTransition;function Ft(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:i}=e,l=a.useRef();null==l.current&&(l.current=u({initialEntries:n,initialIndex:o,v5Compat:!0}));let s=l.current,[c,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:h}=i||{},f=a.useCallback((e=>{h&&Ot?Ot((()=>d(e))):d(e)}),[d,h]);return a.useLayoutEffect((()=>s.listen(f)),[s,f]),a.createElement(zt,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:s,future:i})}function Nt(e){let{to:t,replace:r,state:n,relative:o}=e;et()||h(!1);let{future:i,static:l}=a.useContext(Ye),{matches:s}=a.useContext(Ge),{pathname:u}=tt(),c=ot(),d=W(t,H(s,i.v7_relativeSplatPath),u,"path"===o),f=JSON.stringify(d);return a.useEffect((()=>c(JSON.parse(f),{replace:r,state:n,relative:o})),[c,f,o,r,n]),null}function Bt(e){return st(e.context)}function It(e){h(!1)}function zt(e){let{basename:t="/",children:r=null,location:o,navigationType:i=n.Pop,navigator:l,static:s=!1,future:u}=e;et()&&h(!1);let c=t.replace(/^\/*/,"/"),d=a.useMemo((()=>({basename:c,navigator:l,static:s,future:$e({v7_relativeSplatPath:!1},u)})),[c,u,l,s]);"string"==typeof o&&(o=y(o));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:g="default"}=o,b=a.useMemo((()=>{let e=N(f,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:i}}),[c,f,p,m,v,g,i]);return null==b?null:a.createElement(Ye.Provider,{value:d},a.createElement(Xe.Provider,{children:r,value:b}))}function Ht(e){let{children:t,location:r}=e;return dt(Vt(t),r)}function Wt(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(Jt,{resolve:n,errorElement:r},a.createElement(qt,null,t))}var Kt=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Kt||{});const $t=new Promise((()=>{}));class Jt extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=Kt.pending;if(r instanceof Promise)if(this.state.error){o=Kt.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,o=void 0!==n._error?Kt.error:void 0!==n._data?Kt.success:Kt.pending):(o=Kt.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then((e=>Object.defineProperty(r,"_data",{get:()=>e})),(e=>Object.defineProperty(r,"_error",{get:()=>e}))));else o=Kt.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===Kt.error&&n._error instanceof Y)throw $t;if(o===Kt.error&&!t)throw n._error;if(o===Kt.error)return a.createElement(Ve.Provider,{value:n,children:t});if(o===Kt.success)return a.createElement(Ve.Provider,{value:n,children:e});throw n}}function qt(e){let{children:t}=e,r=Tt(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function Vt(e,t){void 0===t&&(t=[]);let r=[];return a.Children.forEach(e,((e,n)=>{if(!a.isValidElement(e))return;let o=[...t,n];if(e.type===a.Fragment)return void r.push.apply(r,Vt(e.props.children,o));e.type!==It&&h(!1),e.props.index&&e.props.children&&h(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=Vt(e.props.children,o)),r.push(i)})),r}function Yt(e){return yt(e)}function Xt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function Gt(e,t){return me({basename:null==t?void 0:t.basename,future:$e({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:u({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Xt}).initialize()}function Qt(){return Qt=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},Qt.apply(this,arguments)}function Zt(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const er="get",tr="application/x-www-form-urlencoded";function rr(e){return null!=e&&"string"==typeof e.tagName}function nr(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}let ar=null;const or=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ir(e){return null==e||or.has(e)?e:null}const lr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],sr=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ur=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];function cr(e,t){return me({basename:null==t?void 0:t.basename,future:Qt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:c({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||hr(),routes:e,mapRouteProperties:Xt,window:null==t?void 0:t.window}).initialize()}function dr(e,t){return me({basename:null==t?void 0:t.basename,future:Qt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:d({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||hr(),routes:e,mapRouteProperties:Xt,window:null==t?void 0:t.window}).initialize()}function hr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Qt({},t,{errors:fr(t.errors)})),t}function fr(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 te(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const pr=a.createContext({isTransitioning:!1}),mr=a.createContext(new Map),vr=a.startTransition,yr=i.flushSync;function gr(e){yr?yr(e):e()}class br{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}}function wr(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=a.useState(r.state),[l,s]=a.useState(),[u,c]=a.useState({isTransitioning:!1}),[d,h]=a.useState(),[f,p]=a.useState(),[m,v]=a.useState(),y=a.useRef(new Map),{v7_startTransition:g}=n||{},b=a.useCallback((e=>{g?function(e){vr?vr(e):e()}(e):e()}),[g]),w=a.useCallback(((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:o}=t;n.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let l=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(o&&!l){if(a){gr((()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})}));let t=r.window.document.startViewTransition((()=>{gr((()=>i(e)))}));return t.finished.finally((()=>{gr((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})}))})),void gr((()=>p(t)))}f?(d&&d.resolve(),f.skipTransition(),v({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else a?gr((()=>i(e))):b((()=>i(e)))}),[r.window,f,d,y,b]);a.useLayoutEffect((()=>r.subscribe(w)),[r,w]),a.useEffect((()=>{u.isTransitioning&&!u.flushSync&&h(new br)}),[u]),a.useEffect((()=>{if(d&&l&&r.window){let e=l,t=d.promise,n=r.window.document.startViewTransition((async()=>{b((()=>i(e))),await t}));n.finished.finally((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})})),p(n)}}),[b,l,d,r.window]),a.useEffect((()=>{d&&l&&o.location.key===l.location.key&&d.resolve()}),[d,f,o.location,l]),a.useEffect((()=>{!u.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))}),[u.isTransitioning,m]),a.useEffect((()=>{}),[]);let E=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),S=r.basename||"/",R=a.useMemo((()=>({router:r,navigator:E,static:!1,basename:S})),[r,E,S]);return a.createElement(a.Fragment,null,a.createElement(Je.Provider,{value:R},a.createElement(qe.Provider,{value:o},a.createElement(mr.Provider,{value:y.current},a.createElement(pr.Provider,{value:u},a.createElement(zt,{basename:S,location:o.location,navigationType:o.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(Er,{routes:r.routes,future:r.future,state:o}):t))))),null)}function Er(e){let{routes:t,future:r,state:n}=e;return ht(t,void 0,n,r)}function Sr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=c({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:d}=n||{},h=a.useCallback((e=>{d&&vr?vr((()=>u(e))):u(e)}),[u,d]);return a.useLayoutEffect((()=>l.listen(h)),[l,h]),a.createElement(zt,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function Rr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=d({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:c}=n||{},h=a.useCallback((e=>{c&&vr?vr((()=>u(e))):u(e)}),[u,c]);return a.useLayoutEffect((()=>l.listen(h)),[l,h]),a.createElement(zt,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function xr(e){let{basename:t,children:r,future:n,history:o}=e,[i,l]=a.useState({action:o.action,location:o.location}),{v7_startTransition:s}=n||{},u=a.useCallback((e=>{s&&vr?vr((()=>l(e))):l(e)}),[l,s]);return a.useLayoutEffect((()=>o.listen(u)),[o,u]),a.createElement(zt,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o,future:n})}const Dr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Cr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lr=a.forwardRef((function(e,t){let r,{onClick:n,relative:o,reloadDocument:i,replace:l,state:s,target:u,to:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=Zt(e,lr),{basename:p}=a.useContext(Ye),m=!1;if("string"==typeof c&&Cr.test(c)&&(r=c,Dr))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=N(t.pathname,p);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:m=!0}catch(e){}let v=Ze(c,{relative:o}),y=jr(c,{replace:l,state:s,target:u,preventScrollReset:d,relative:o,unstable_viewTransition:h});return a.createElement("a",Qt({},f,{href:r||v,onClick:m||i?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:u}))})),Pr=a.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:u,children:c}=e,d=Zt(e,sr),h=ct(s,{relative:d.relative}),f=tt(),p=a.useContext(qe),{navigator:m}=a.useContext(Ye),v=null!=p&&Vr(h)&&!0===u,y=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,g=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(g=g.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase());const w="/"!==y&&y.endsWith("/")?y.length-1:y.length;let E,S=g===y||!i&&g.startsWith(y)&&"/"===g.charAt(w),R=null!=b&&(b===y||!i&&b.startsWith(y)&&"/"===b.charAt(y.length)),x={isActive:S,isPending:R,isTransitioning:v},D=S?r:void 0;E="function"==typeof o?o(x):[o,S?"active":null,R?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof l?l(x):l;return a.createElement(Lr,Qt({},d,{"aria-current":D,className:E,ref:t,style:C,to:s,unstable_viewTransition:u}),"function"==typeof c?c(x):c)})),kr=a.forwardRef(((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:o,replace:i,state:l,method:s=er,action:u,onSubmit:c,relative:d,preventScrollReset:h,unstable_viewTransition:f}=e,p=Zt(e,ur),m=Br(),v=Ir(u,{relative:d}),y="get"===s.toLowerCase()?"get":"post";return a.createElement("form",Qt({ref:t,method:y,action:v,onSubmit:o?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||s;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:l,relative:d,preventScrollReset:h,unstable_viewTransition:f})}},p))}));function _r(e){let{getKey:t,storageKey:r}=e;return $r({getKey:t,storageKey:r}),null}var Tr,Ar;function Ur(e){let t=a.useContext(Je);return t||h(!1),t}function Mr(e){let t=a.useContext(qe);return t||h(!1),t}function jr(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===t?{}:t,u=ot(),c=tt(),d=ct(e,{relative:l});return a.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:v(c)===v(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[c,u,d,n,o,r,e,i,l,s])}function Or(e){let t=a.useRef(nr(e)),r=a.useRef(!1),n=tt(),o=a.useMemo((()=>function(e,t){let r=nr(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(n.search,r.current?null:t.current)),[n.search]),i=ot(),l=a.useCallback(((e,t)=>{const n=nr("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)}),[i,o]);return[o,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Tr||(Tr={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Ar||(Ar={}));let Fr=0,Nr=()=>"__"+String(++Fr)+"__";function Br(){let{router:e}=Ur(Tr.UseSubmit),{basename:t}=a.useContext(Ye),r=Rt();return a.useCallback((function(n,a){void 0===a&&(a={}),function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(rr(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?N(i,t):null,r=e.getAttribute("method")||er,a=ir(e.getAttribute("enctype"))||tr,o=new FormData(e)}else if(function(e){return rr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return rr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?N(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||er,a=ir(e.getAttribute("formenctype"))||ir(i.getAttribute("enctype"))||tr,o=new FormData(i,e),!function(){if(null===ar)try{new FormData(document.createElement("form"),0),ar=!1}catch(e){ar=!0}return ar}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";o.append(e+"x","0"),o.append(e+"y","0")}else t&&o.append(t,n)}}else{if(rr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=er,n=null,a=tr,i=e}var l;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||Nr();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})}),[e,t,r])}function Ir(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=a.useContext(Ye),o=a.useContext(Ge);o||h(!1);let[i]=o.matches.slice(-1),l=Qt({},ct(e||".",{relative:r})),s=tt();if(null==e){l.search=s.search;let e=new URLSearchParams(l.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),l.search=e.toString()?"?"+e.toString():"")}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(l.pathname="/"===l.pathname?n:K([n,l.pathname])),v(l)}function zr(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=Ur(Tr.UseFetcher),o=Mr(Ar.UseFetcher),i=a.useContext(mr),l=a.useContext(Ge),s=null==(t=l.matches[l.matches.length-1])?void 0:t.route.id;i||h(!1),l||h(!1),null==s&&h(!1);let[u,c]=a.useState(r||"");r&&r!==u?c(r):u||c(Nr()),a.useEffect((()=>(n.getFetcher(u),()=>{n.deleteFetcher(u)})),[n,u]);let d=a.useCallback(((e,t)=>{s||h(!1),n.fetch(u,s,e,t)}),[u,s,n]),f=Br(),p=a.useCallback(((e,t)=>{f(e,Qt({},t,{navigate:!1,fetcherKey:u}))}),[u,f]),m=a.useMemo((()=>a.forwardRef(((e,t)=>a.createElement(kr,Qt({},e,{navigate:!1,fetcherKey:u,ref:t}))))),[u]),v=o.fetchers.get(u)||ce,y=i.get(u);return a.useMemo((()=>Qt({Form:m,submit:p,load:d},v,{data:y})),[m,p,d,v,y])}function Hr(){let e=Mr(Ar.UseFetchers);return Array.from(e.fetchers.entries()).map((e=>{let[t,r]=e;return Qt({},r,{key:t})}))}const Wr="react-router-scroll-positions";let Kr={};function $r(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=Ur(Tr.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=Mr(Ar.UseScrollRestoration),{basename:l}=a.useContext(Ye),s=tt(),u=Ct(),c=xt();a.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(e){let{capture:t}={};a.useEffect((()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}}),[e,t])}(a.useCallback((()=>{if("idle"===c.state){let e=(t?t(s,u):null)||s.key;Kr[e]=window.scrollY}try{sessionStorage.setItem(r||Wr,JSON.stringify(Kr))}catch(e){}window.history.scrollRestoration="auto"}),[r,t,c.state,s,u])),"undefined"!=typeof document&&(a.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||Wr);e&&(Kr=JSON.parse(e))}catch(e){}}),[r]),a.useLayoutEffect((()=>{let e=t&&"/"!==l?(e,r)=>t(Qt({},e,{pathname:N(e.pathname,l)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(Kr,(()=>window.scrollY),e);return()=>r&&r()}),[n,l,t]),a.useLayoutEffect((()=>{if(!1!==o)if("number"!=typeof o){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[s,o,i]))}function Jr(e,t){let{capture:r}=t||{};a.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}}),[e,r])}function qr(e){let{when:t,message:r}=e,n=Mt(t);a.useEffect((()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())}),[n,r]),a.useEffect((()=>{"blocked"!==n.state||t||n.reset()}),[n,t])}function Vr(e,t){void 0===t&&(t={});let r=a.useContext(pr);null==r&&h(!1);let{basename:n}=Ur(Tr.useViewTransitionState),o=ct(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=N(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=N(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=O(o.pathname,l)||null!=O(o.pathname,i)}}}]);
2
+ "use strict";(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([[282],{20282(e,t,r){r.r(t),r.d(t,{AbortedDeferredError:()=>$,Await:()=>Bt,BrowserRouter:()=>gr,Form:()=>Dr,HashRouter:()=>br,Link:()=>Rr,MemoryRouter:()=>Ut,NavLink:()=>xr,Navigate:()=>Mt,NavigationType:()=>n,Outlet:()=>jt,Route:()=>Ot,Router:()=>Ft,RouterProvider:()=>vr,Routes:()=>Nt,ScrollRestoration:()=>Cr,UNSAFE_DataRouterContext:()=>He,UNSAFE_DataRouterStateContext:()=>We,UNSAFE_FetchersContext:()=>dr,UNSAFE_LocationContext:()=>Je,UNSAFE_NavigationContext:()=>$e,UNSAFE_RouteContext:()=>qe,UNSAFE_ViewTransitionContext:()=>cr,UNSAFE_useRouteId:()=>bt,UNSAFE_useScrollRestoration:()=>zr,createBrowserRouter:()=>ir,createHashRouter:()=>lr,createMemoryRouter:()=>qt,createPath:()=>y,createRoutesFromChildren:()=>Kt,createRoutesFromElements:()=>Kt,createSearchParams:()=>Zt,defer:()=>V,generatePath:()=>T,isRouteErrorResponse:()=>Q,json:()=>K,matchPath:()=>A,matchRoutes:()=>R,parsePath:()=>g,redirect:()=>Y,redirectDocument:()=>X,renderMatches:()=>$t,resolvePath:()=>j,unstable_HistoryRouter:()=>wr,unstable_usePrompt:()=>Wr,unstable_useViewTransitionState:()=>Kr,useActionData:()=>Dt,useAsyncError:()=>Pt,useAsyncValue:()=>Lt,useBeforeUnload:()=>Hr,useBlocker:()=>_t,useFetcher:()=>Fr,useFetchers:()=>Nr,useFormAction:()=>Or,useHref:()=>Ye,useInRouterContext:()=>Xe,useLinkClickHandler:()=>Tr,useLoaderData:()=>Rt,useLocation:()=>Ge,useMatch:()=>Ze,useMatches:()=>St,useNavigate:()=>tt,useNavigation:()=>wt,useNavigationType:()=>Qe,useOutlet:()=>at,useOutletContext:()=>nt,useParams:()=>ot,useResolvedPath:()=>it,useRevalidator:()=>Et,useRouteError:()=>Ct,useRouteLoaderData:()=>xt,useRoutes:()=>lt,useSearchParams:()=>Ar,useSubmit:()=>jr});var n,a=r(16072),o=r.t(a,2),i=r(40961),l=r.t(i,2);function s(){return s=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},s.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));const u="popstate";function c(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:o=!1}=e;t=r.map(((e,t)=>d(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=u(null==a?t.length-1:a),l=n.Pop,s=null;function u(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function d(e,r,n){void 0===r&&(r=null);let a=v(t?c().pathname:"/",e,r,n);return p("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function h(e){return"string"==typeof e?e:y(e)}return{get index(){return i},get action(){return l},get location(){return c()},createHref:h,createURL:e=>new URL(h(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?g(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){l=n.Push;let a=d(e,r);i+=1,t.splice(i,t.length,a),o&&s&&s({action:l,location:a,delta:1})},replace(e,r){l=n.Replace;let a=d(e,r);t[i]=a,o&&s&&s({action:l,location:a,delta:0})},go(e){l=n.Pop;let r=u(i+e),a=t[r];i=r,s&&s({action:l,location:a,delta:e})},listen:e=>(s=e,()=>{s=null})}}function d(e){return void 0===e&&(e={}),b((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return v("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:y(t)}),null,e)}function h(e){return void 0===e&&(e={}),b((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=g(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),v("",{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:y(t))}),(function(e,t){p("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function f(e,t){if(!1===e||null==e)throw new Error(t)}function p(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function m(e,t){return{usr:e.state,key:e.key,idx:t}}function v(e,t,r,n){return void 0===r&&(r=null),s({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?g(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function y(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 g(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 b(e,t,r,a){void 0===a&&(a={});let{window:o=document.defaultView,v5Compat:i=!1}=a,l=o.history,c=n.Pop,d=null,h=p();function p(){return(l.state||{idx:null}).idx}function g(){c=n.Pop;let e=p(),t=null==e?null:e-h;h=e,d&&d({action:c,location:w.location,delta:t})}function b(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,r="string"==typeof e?e:y(e);return f(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==h&&(h=0,l.replaceState(s({},l.state,{idx:h}),""));let w={get action(){return c},get location(){return e(o,l)},listen(e){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(u,g),d=e,()=>{o.removeEventListener(u,g),d=null}},createHref:e=>t(o,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=n.Push;let a=v(w.location,e,t);r&&r(a,e),h=p()+1;let s=m(a,h),u=w.createHref(a);try{l.pushState(s,"",u)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(u)}i&&d&&d({action:c,location:w.location,delta:1})},replace:function(e,t){c=n.Replace;let a=v(w.location,e,t);r&&r(a,e),h=p();let o=m(a,h),s=w.createHref(a);l.replaceState(o,"",s),i&&d&&d({action:c,location:w.location,delta:0})},go:e=>l.go(e)};return w}var w;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(w||(w={}));const E=new Set(["lazy","caseSensitive","path","id","index","children"]);function S(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(((e,a)=>{let o=[...r,a],i="string"==typeof e.id?e.id:o.join("-");if(f(!0!==e.index||!e.children,"Cannot specify children on an index route"),f(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=s({},e,t(e),{id:i});return n[i]=r,r}{let r=s({},e,t(e),{id:i,children:void 0});return n[i]=r,e.children&&(r.children=S(e.children,t,o,n)),r}}))}function R(e,t,r){void 0===r&&(r="/");let n=M(("string"==typeof t?g(t):t).pathname||"/",r);if(null==n)return null;let a=D(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)))))}(a);let o=null;for(let e=0;null==o&&e<a.length;++e)o=_(a[e],U(n));return o}function x(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function D(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(f(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=I([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(f(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),D(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:k(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 C(e.path))a(e,t,r);else a(e,t)})),t}function C(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=C(n.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const L=/^:\w+$/,P=e=>"*"===e;function k(e,t){let r=e.split("/"),n=r.length;return r.some(P)&&(n+=-2),t&&(n+=2),r.filter((e=>!P(e))).reduce(((e,t)=>e+(L.test(t)?3:""===t?1:10)),n)}function _(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",u=A({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!u)return null;Object.assign(n,u.params);let c=i.route;o.push({params:n,pathname:I([a,u.pathname]),pathnameBase:z(I([a,u.pathnameBase])),route:c}),"/"!==u.pathnameBase&&(a=I([a,u.pathnameBase]))}return o}function T(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(p(!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("/")?"/":"",a=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e)return a(t["*"]);const o=e.match(/^:(\w+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return f("?"===r||null!=n,'Missing ":'+e+'" param'),a(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),p("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce(((e,t,r)=>{let{paramName:n,isOptional:a}=t;if("*"===n){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[r];return e[n]=a&&!s?void 0:function(e,t){try{return decodeURIComponent(e)}catch(r){return p(!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}}(s||"",n),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function U(e){try{return decodeURI(e)}catch(t){return p(!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 M(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 j(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?g(e):e,o=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:o,search:H(n),hash:W(a)}}function O(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 N(e,t){let r=F(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function B(e,t,r,n){let a;void 0===n&&(n=!1),"string"==typeof e?a=g(e):(a=s({},e),f(!a.pathname||!a.pathname.includes("?"),O("?","pathname","search",a)),f(!a.pathname||!a.pathname.includes("#"),O("#","pathname","hash",a)),f(!a.search||!a.search.includes("#"),O("#","search","hash",a)));let o,i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let u=j(a,o),c=l&&"/"!==l&&l.endsWith("/"),d=(i||"."===l)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!d||(u.pathname+="/"),u}const I=e=>e.join("/").replace(/\/\/+/g,"/"),z=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),H=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",W=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),s({},r,{headers:n}))};class $ extends Error{}class J{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],f(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 $("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 $)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 f(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]:q(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function q(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)},Y=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,s({},r,{headers:n}))},X=(e,t)=>{let r=Y(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class G{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 Q(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const Z=["post","put","patch","delete"],ee=new Set(Z),te=["get",...Z],re=new Set(te),ne=new Set([301,302,303,307,308]),ae=new Set([307,308]),oe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ie={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},le={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},se=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ue=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),ce="remix-router-transitions";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,a=!r;let o;if(f(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;o=e=>({hasErrorBoundary:t(e)})}else o=ue;let i,l,u={},c=S(e.routes,o,void 0,u),d=e.basename||"/",h=s({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),m=null,y=new Set,g=null,b=null,E=null,D=null!=e.hydrationData,C=R(c,e.history.location,d),L=null;if(null==C){let t=Ce(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=De(c);C=r,L={[n.id]:t}}let P,k=C.some((e=>e.route.lazy)),_=C.some((e=>e.route.loader));if(k)l=!1;else if(_)if(h.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;l=C.every((e=>e.route.loader&&!0!==e.route.loader.hydrate&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id])))}else l=null!=e.hydrationData;else l=!0;let T,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:l,navigation:oe,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||L,fetchers:new Map,blockers:new Map},U=n.Pop,j=!1,O=!1,F=new Map,N=null,B=!1,I=!1,z=[],H=[],W=new Map,K=0,$=-1,J=new Map,q=new Set,V=new Map,Y=new Map,X=new Set,G=new Map,Q=new Map,Z=!1;function ee(e,t){void 0===t&&(t={}),A=s({},A,e);let r=[],n=[];h.v7_fetcherPersist&&A.fetchers.forEach(((e,t)=>{"idle"===e.state&&(X.has(t)?n.push(t):r.push(t))})),[...y].forEach((e=>e(A,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),h.v7_fetcherPersist&&(r.forEach((e=>A.fetchers.delete(e))),n.forEach((e=>Ee(e))))}function te(t,r,a){var o,l;let u,{flushSync:d}=void 0===a?{}:a,h=null!=A.actionData&&null!=A.navigation.formMethod&&Ae(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);u=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:h?A.actionData:null;let f=r.loaderData?Re(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,p=A.blockers;p.size>0&&(p=new Map(p),p.forEach(((e,t)=>p.set(t,le))));let m,v=!0===j||null!=A.navigation.formMethod&&Ae(A.navigation.formMethod)&&!0!==(null==(l=t.state)?void 0:l._isRedirect);if(i&&(c=i,i=void 0),B||U===n.Pop||(U===n.Push?e.history.push(t,t.state):U===n.Replace&&e.history.replace(t,t.state)),U===n.Pop){let e=F.get(A.location.pathname);e&&e.has(t.pathname)?m={currentLocation:A.location,nextLocation:t}:F.has(t.pathname)&&(m={currentLocation:t,nextLocation:A.location})}else if(O){let e=F.get(A.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),F.set(A.location.pathname,e)),m={currentLocation:A.location,nextLocation:t}}ee(s({},r,{actionData:u,loaderData:f,historyAction:U,location:t,initialized:!0,navigation:oe,revalidation:"idle",restoreScrollPosition:Ve(t,r.matches||A.matches),preventScrollReset:v,blockers:p}),{viewTransitionOpts:m,flushSync:!0===d}),U=n.Pop,j=!1,O=!1,B=!1,I=!1,z=[],H=[]}async function re(t,r,a){T&&T.abort(),T=null,U=t,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(g&&E){let r=qe(e,t);g[r]=E()}}(A.location,A.matches),j=!0===(a&&a.preventScrollReset),O=!0===(a&&a.enableViewTransition);let l=i||c,f=a&&a.overrideNavigation,p=R(l,r,d),m=!0===(a&&a.flushSync);if(!p){let e=Ce(404,{pathname:r.pathname}),{matches:t,route:n}=De(l);return Je(),void te(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:m})}if(A.initialized&&!I&&(v=A.location,y=r,v.pathname===y.pathname&&v.search===y.search&&(""===v.hash?""!==y.hash:v.hash===y.hash||""!==y.hash))&&!(a&&a.submission&&Ae(a.submission.formMethod)))return void te(r,{matches:p},{flushSync:m});var v,y;T=new AbortController;let b,S,x=be(e.history,r,T.signal,a&&a.submission);if(a&&a.pendingError)S={[xe(p).route.id]:a.pendingError};else if(a&&a.submission&&Ae(a.submission.formMethod)){let e=await async function(e,t,r,a,i){void 0===i&&(i={}),me();let l,s=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);ee({navigation:s},{flushSync:!0===i.flushSync});let c=Oe(a,t);if(c.route.action||c.route.lazy){if(l=await ge("action",e,c,a,u,o,d,h.v7_relativeSplatPath),e.signal.aborted)return{shortCircuited:!0}}else l={type:w.error,error:Ce(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(Te(l)){let e;return e=i&&null!=i.replace?i.replace:l.location===A.location.pathname+A.location.search,await ne(A,l,{submission:r,replace:e}),{shortCircuited:!0}}if(_e(l)){let e=xe(a,c.route.id);return!0!==(i&&i.replace)&&(U=n.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(ke(l))throw Ce(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(x,r,a.submission,p,{replace:a.replace,flushSync:m});if(e.shortCircuited)return;b=e.pendingActionData,S=e.pendingActionError,f=Ne(r,a.submission),m=!1,x=new Request(x.url,{signal:x.signal})}let{shortCircuited:D,loaderData:C,errors:L}=await async function(t,r,n,a,o,l,u,f,p,m,v){let y=a||Ne(r,o),g=o||l||Fe(y),b=i||c,[w,E]=pe(e.history,A,n,g,r,h.v7_partialHydration&&!0===f,I,z,H,X,V,q,b,d,m,v);if(Je((e=>!(n&&n.some((t=>t.route.id===e)))||w&&w.some((t=>t.route.id===e)))),$=++K,0===w.length&&0===E.length){let e=ze();return te(r,s({matches:n,loaderData:{},errors:v||null},m?{actionData:m}:{},e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:p}),{shortCircuited:!0}}if(!(B||h.v7_partialHydration&&f)){E.forEach((e=>{let t=A.fetchers.get(e.key),r=Be(void 0,t?t.data:void 0);A.fetchers.set(e.key,r)}));let e=m||A.actionData;ee(s({navigation:y},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},E.length>0?{fetchers:new Map(A.fetchers)}:{}),{flushSync:p})}E.forEach((e=>{W.has(e.key)&&Pe(e.key),e.controller&&W.set(e.key,e.controller)}));let S=()=>E.forEach((e=>Pe(e.key)));T&&T.signal.addEventListener("abort",S);let{results:R,loaderResults:x,fetcherResults:D}=await de(A.matches,n,w,E,t);if(t.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",S),E.forEach((e=>W.delete(e.key)));let C=Le(R);if(C){if(C.idx>=w.length){let e=E[C.idx-w.length].key;q.add(e)}return await ne(A,C.result,{replace:u}),{shortCircuited:!0}}let{loaderData:L,errors:P}=Se(A,n,w,x,v,E,D,G);G.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&G.delete(t)}))}));let k=ze(),_=He($);return s({loaderData:L,errors:P},k||_||E.length>0?{fetchers:new Map(A.fetchers)}:{})}(x,r,p,f,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,a&&!0===a.initialHydration,m,b,S);D||(T=null,te(r,s({matches:p},b?{actionData:b}:{},{loaderData:C,errors:L})))}async function ne(a,o,i){let{submission:l,fetcherSubmission:u,replace:c}=void 0===i?{}:i;o.revalidate&&(I=!0);let h=v(a.location,o.location,{_isRedirect:!0});if(f(h,"Expected a location on the redirect navigation"),r){let r=!1;if(o.reloadDocument)r=!0;else if(se.test(o.location)){const n=e.history.createURL(o.location);r=n.origin!==t.location.origin||null==M(n.pathname,d)}if(r)return void(c?t.location.replace(o.location):t.location.assign(o.location))}T=null;let p=!0===c?n.Replace:n.Push,{formMethod:m,formAction:y,formEncType:g}=a.navigation;!l&&!u&&m&&y&&g&&(l=Fe(a.navigation));let b=l||u;if(ae.has(o.status)&&b&&Ae(b.formMethod))await re(p,h,{submission:s({},b,{formAction:o.location}),preventScrollReset:j});else{let e=Ne(h,l);await re(p,h,{overrideNavigation:e,fetcherSubmission:u,preventScrollReset:j})}}async function de(t,r,n,a,i){let l=await Promise.all([...n.map((e=>ge("loader",i,e,r,u,o,d,h.v7_relativeSplatPath))),...a.map((t=>t.matches&&t.match&&t.controller?ge("loader",be(e.history,t.path,t.controller.signal),t.match,t.matches,u,o,d,h.v7_relativeSplatPath):{type:w.error,error:Ce(404,{pathname:t.path})}))]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Ue(t,n,s,s.map((()=>i.signal)),!1,A.loaderData),Ue(t,a.map((e=>e.match)),c,a.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function me(){I=!0,z.push(...Je()),V.forEach(((e,t)=>{W.has(t)&&(H.push(t),Pe(t))}))}function ve(e,t,r){void 0===r&&(r={}),A.fetchers.set(e,t),ee({fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function ye(e,t,r,n){void 0===n&&(n={});let a=xe(A.matches,t);Ee(e),ee({errors:{[a.route.id]:r},fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function we(e){return h.v7_fetcherPersist&&(Y.set(e,(Y.get(e)||0)+1),X.has(e)&&X.delete(e)),A.fetchers.get(e)||ie}function Ee(e){let t=A.fetchers.get(e);!W.has(e)||t&&"loading"===t.state&&J.has(e)||Pe(e),V.delete(e),J.delete(e),q.delete(e),X.delete(e),A.fetchers.delete(e)}function Pe(e){let t=W.get(e);f(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function je(e){for(let t of e){let e=Ie(we(t).data);A.fetchers.set(t,e)}}function ze(){let e=[],t=!1;for(let r of q){let n=A.fetchers.get(r);f(n,"Expected fetcher: "+r),"loading"===n.state&&(q.delete(r),e.push(r),t=!0)}return je(e),t}function He(e){let t=[];for(let[r,n]of J)if(n<e){let e=A.fetchers.get(r);f(e,"Expected fetcher: "+r),"loading"===e.state&&(Pe(r),J.delete(r),t.push(r))}return je(t),t.length>0}function We(e){A.blockers.delete(e),Q.delete(e)}function Ke(e,t){let r=A.blockers.get(e)||le;f("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),ee({blockers:n})}function $e(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===Q.size)return;Q.size>1&&p(!1,"A router only supports one blocker at a time");let a=Array.from(Q.entries()),[o,i]=a[a.length-1],l=A.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function Je(e){let t=[];return G.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),G.delete(n))})),t}function qe(e,t){return b&&b(e,t.map((e=>x(e,A.loaderData))))||e.key}function Ve(e,t){if(g){let r=qe(e,t),n=g[r];if("number"==typeof n)return n}return null}return P={get basename(){return d},get future(){return h},get state(){return A},get routes(){return c},get window(){return t},initialize:function(){if(m=e.history.listen((t=>{let{action:r,location:n,delta:a}=t;if(Z)return void(Z=!1);p(0===Q.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=$e({currentLocation:A.location,nextLocation:n,historyAction:r});return o&&null!=a?(Z=!0,e.history.go(-1*a),void Ke(o,{state:"blocked",location:n,proceed(){Ke(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){let e=new Map(A.blockers);e.set(o,le),ee({blockers:e})}})):re(r,n)})),r){!function(e,t){try{let r=e.sessionStorage.getItem(ce);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,F);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(ce,JSON.stringify(r))}catch(e){p(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,F);t.addEventListener("pagehide",e),N=()=>t.removeEventListener("pagehide",e)}return A.initialized||re(n.Pop,A.location,{initialHydration:!0}),P},subscribe:function(e){return y.add(e),()=>y.delete(e)},enableScrollRestoration:function(e,t,r){if(g=e,E=t,b=r||null,!D&&A.navigation===oe){D=!0;let e=Ve(A.location,A.matches);null!=e&&ee({restoreScrollPosition:e})}return()=>{g=null,E=null,b=null}},navigate:async function t(r,a){if("number"==typeof r)return void e.history.go(r);let o=he(A.location,A.matches,d,h.v7_prependBasename,r,h.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:i,submission:l,error:u}=fe(h.v7_normalizeFormMethod,!1,o,a),c=A.location,f=v(A.location,i,a&&a.state);f=s({},f,e.history.encodeLocation(f));let p=a&&null!=a.replace?a.replace:void 0,m=n.Push;!0===p?m=n.Replace:!1===p||null!=l&&Ae(l.formMethod)&&l.formAction===A.location.pathname+A.location.search&&(m=n.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=!0===(a&&a.unstable_flushSync),b=$e({currentLocation:c,nextLocation:f,historyAction:m});if(!b)return await re(m,f,{submission:l,pendingError:u,preventScrollReset:y,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:g});Ke(b,{state:"blocked",location:f,proceed(){Ke(b,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),t(r,a)},reset(){let e=new Map(A.blockers);e.set(b,le),ee({blockers:e})}})},fetch:function(t,r,n,l){if(a)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.");W.has(t)&&Pe(t);let s=!0===(l&&l.unstable_flushSync),p=i||c,m=he(A.location,A.matches,d,h.v7_prependBasename,n,h.v7_relativeSplatPath,r,null==l?void 0:l.relative),v=R(p,m,d);if(!v)return void ye(t,r,Ce(404,{pathname:m}),{flushSync:s});let{path:y,submission:g,error:b}=fe(h.v7_normalizeFormMethod,!0,m,l);if(b)return void ye(t,r,b,{flushSync:s});let w=Oe(v,y);j=!0===(l&&l.preventScrollReset),g&&Ae(g.formMethod)?async function(t,r,n,a,l,s,p){if(me(),V.delete(t),!a.route.action&&!a.route.lazy){let e=Ce(405,{method:p.formMethod,pathname:n,routeId:r});return void ye(t,r,e,{flushSync:s})}let m=A.fetchers.get(t);ve(t,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}}(p,m),{flushSync:s});let v=new AbortController,y=be(e.history,n,v.signal,p);W.set(t,v);let g=K,b=await ge("action",y,a,l,u,o,d,h.v7_relativeSplatPath);if(y.signal.aborted)return void(W.get(t)===v&&W.delete(t));if(h.v7_fetcherPersist&&X.has(t)){if(Te(b)||_e(b))return void ve(t,Ie(void 0))}else{if(Te(b))return W.delete(t),$>g?void ve(t,Ie(void 0)):(q.add(t),ve(t,Be(p)),ne(A,b,{fetcherSubmission:p}));if(_e(b))return void ye(t,r,b.error)}if(ke(b))throw Ce(400,{type:"defer-action"});let w=A.navigation.location||A.location,E=be(e.history,w,v.signal),S=i||c,x="idle"!==A.navigation.state?R(S,A.navigation.location,d):A.matches;f(x,"Didn't find any matches after fetcher action");let D=++K;J.set(t,D);let C=Be(p,b.data);A.fetchers.set(t,C);let[L,P]=pe(e.history,A,x,p,w,!1,I,z,H,X,V,q,S,d,{[a.route.id]:b.data},void 0);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=A.fetchers.get(t),n=Be(void 0,r?r.data:void 0);A.fetchers.set(t,n),W.has(t)&&Pe(t),e.controller&&W.set(t,e.controller)})),ee({fetchers:new Map(A.fetchers)});let k=()=>P.forEach((e=>Pe(e.key)));v.signal.addEventListener("abort",k);let{results:_,loaderResults:M,fetcherResults:j}=await de(A.matches,x,L,P,E);if(v.signal.aborted)return;v.signal.removeEventListener("abort",k),J.delete(t),W.delete(t),P.forEach((e=>W.delete(e.key)));let O=Le(_);if(O){if(O.idx>=L.length){let e=P[O.idx-L.length].key;q.add(e)}return ne(A,O.result)}let{loaderData:F,errors:N}=Se(A,A.matches,L,M,void 0,P,j,G);if(A.fetchers.has(t)){let e=Ie(b.data);A.fetchers.set(t,e)}He(D),"loading"===A.navigation.state&&D>$?(f(U,"Expected pending action"),T&&T.abort(),te(A.navigation.location,{matches:x,loaderData:F,errors:N,fetchers:new Map(A.fetchers)})):(ee({errors:N,loaderData:Re(A.loaderData,F,x,N),fetchers:new Map(A.fetchers)}),I=!1)}(t,r,y,w,v,s,g):(V.set(t,{routeId:r,path:y}),async function(t,r,n,a,i,l,s){let c=A.fetchers.get(t);ve(t,Be(s,c?c.data:void 0),{flushSync:l});let p=new AbortController,m=be(e.history,n,p.signal);W.set(t,p);let v=K,y=await ge("loader",m,a,i,u,o,d,h.v7_relativeSplatPath);if(ke(y)&&(y=await Me(y,m.signal,!0)||y),W.get(t)===p&&W.delete(t),!m.signal.aborted){if(!X.has(t))return Te(y)?$>v?void ve(t,Ie(void 0)):(q.add(t),void await ne(A,y)):void(_e(y)?ye(t,r,y.error):(f(!ke(y),"Unhandled fetcher deferred data"),ve(t,Ie(y.data))));ve(t,Ie(void 0))}}(t,r,y,w,v,s,g))},revalidate:function(){me(),ee({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?re(U||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):re(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:we,deleteFetcher:function(e){if(h.v7_fetcherPersist){let t=(Y.get(e)||0)-1;t<=0?(Y.delete(e),X.add(e)):Y.set(e,t)}else Ee(e);ee({fetchers:new Map(A.fetchers)})},dispose:function(){m&&m(),N&&N(),y.clear(),T&&T.abort(),A.fetchers.forEach(((e,t)=>Ee(t))),A.blockers.forEach(((e,t)=>We(t)))},getBlocker:function(e,t){let r=A.blockers.get(e)||le;return Q.get(e)!==t&&Q.set(e,t),r},deleteBlocker:We,_internalFetchControllers:W,_internalActiveDeferreds:G,_internalSetRoutes:function(e){u={},i=S(e,o,void 0,u)}},P}function he(e,t,r,n,a,o,i,l){let s,u;if(i){s=[];for(let e of t)if(s.push(e),e.route.id===i){u=e;break}}else s=t,u=t[t.length-1];let c=B(a||".",N(s,o),M(e.pathname,r)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||je(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:I([r,c.pathname])),y(c)}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&&(a=n.formMethod,!re.has(a.toLowerCase())))return{path:r,error:Ce(405,{method:n.formMethod})};var a;let o,i,l=()=>({path:r,error:Ce(400,{type:"invalid-body"})}),s=n.formMethod||"get",u=e?s.toUpperCase():s.toLowerCase(),c=Pe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Ae(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:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!Ae(u))return l();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:c,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return l()}}}if(f("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=we(n.formData),i=n.formData;else if(n.body instanceof FormData)o=we(n.body),i=n.body;else if(n.body instanceof URLSearchParams)o=n.body,i=Ee(o);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{o=new URLSearchParams(n.body),i=Ee(o)}catch(e){return l()}let d={formMethod:u,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Ae(d.formMethod))return{path:r,submission:d};let h=g(r);return t&&h.search&&je(h.search)&&o.append("index",""),h.search="?"+o,{path:y(h),submission:d}}function pe(e,t,r,n,a,o,i,l,u,c,d,h,f,p,m,v){let y=v?Object.values(v)[0]:m?Object.values(m)[0]:void 0,g=e.createURL(t.location),b=e.createURL(a),w=v?Object.keys(v)[0]:void 0,E=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,w).filter(((e,r)=>{let{route:a}=e;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!!a.loader.hydrate||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||l.some((t=>t===e.route.id)))return!0;let u=t.matches[r],c=e;return ve(e,s({currentUrl:g,currentParams:u.params,nextUrl:b,nextParams:c.params},n,{actionResult:y,defaultShouldRevalidate:i||g.pathname+g.search===b.pathname+b.search||g.search!==b.search||me(u,c)}))})),S=[];return d.forEach(((e,a)=>{if(o||!r.some((t=>t.route.id===e.routeId))||c.has(a))return;let l=R(f,e.path,p);if(!l)return void S.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let d=t.fetchers.get(a),m=Oe(l,e.path),v=!1;v=!h.has(a)&&(!!u.includes(a)||(d&&"idle"!==d.state&&void 0===d.data?i:ve(m,s({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:y,defaultShouldRevalidate:i})))),v&&S.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:m,controller:new AbortController})})),[E,S]}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 a=r[e.id];f(a,"No route found in manifest");let o={};for(let e in n){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;p(!t,'Route "'+a.id+'" has a static property "'+e+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+e+'" will be ignored.'),t||E.has(e)||(o[e]=n[e])}Object.assign(a,o),Object.assign(a,s({},t(a),{lazy:void 0}))}async function ge(e,t,r,n,a,o,i,l,s){let u,c,d;void 0===s&&(s={});let h=e=>{let n,a=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])};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,o,a)]);if(e)throw e;c=t[0]}else{if(await ye(r.route,o,a),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:w.data,data:void 0}}c=await h(n)}else{if(!n){let e=new URL(t.url);throw Ce(404,{pathname:e.pathname+e.search})}c=await h(n)}f(void 0!==c,"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){u=w.error,c=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(p=c)&&"number"==typeof p.status&&"string"==typeof p.statusText&&"object"==typeof p.headers&&void 0!==p.body){let e,a=c.status;if(ne.has(a)){let e=c.headers.get("Location");if(f(e,"Redirects returned/thrown from loaders/actions must have a Location header"),se.test(e)){if(!s.isStaticRequest){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),a=null!=M(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=he(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e,l);if(s.isStaticRequest)throw c.headers.set("Location",e),c;return{type:w.redirect,status:a,location:e,revalidate:null!==c.headers.get("X-Remix-Revalidate"),reloadDocument:null!==c.headers.get("X-Remix-Reload-Document")}}if(s.isRouteRequest)throw{type:u===w.error?w.error:w.data,response:c};try{let t=c.headers.get("Content-Type");e=t&&/\bapplication\/json\b/.test(t)?await c.json():await c.text()}catch(e){return{type:w.error,error:e}}return u===w.error?{type:u,error:new G(a,c.statusText,e),headers:c.headers}:{type:w.data,data:e,statusCode:c.status,headers:c.headers}}var p,m,v;return u===w.error?{type:u,error:c}: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}(c)?{type:w.deferred,deferredData:c,statusCode:null==(m=c.init)?void 0:m.status,headers:(null==(v=c.init)?void 0:v.headers)&&new Headers(c.init.headers)}:{type:w.data,data:c}}function be(e,t,r,n){let a=e.createURL(Pe(t)).toString(),o={signal:r};if(n&&Ae(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=we(n.formData):o.body=n.formData}return new Request(a,o)}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 Se(e,t,r,n,a,o,i,l){let{loaderData:u,errors:c}=function(e,t,r,n,a){let o,i={},l=null,s=!1,u={};return r.forEach(((r,c)=>{let d=t[c].route.id;if(f(!Te(r),"Cannot handle redirect results in processLoaderData"),_e(r)){let t=xe(e,d),a=r.error;n&&(a=Object.values(n)[0],n=void 0),l=l||{},null==l[t.route.id]&&(l[t.route.id]=a),i[d]=void 0,s||(s=!0,o=Q(r.error)?r.error.status:500),r.headers&&(u[d]=r.headers)}else ke(r)?(a.set(d,r.deferredData),i[d]=r.deferredData.data):i[d]=r.data,null==r.statusCode||200===r.statusCode||s||(o=r.statusCode),r.headers&&(u[d]=r.headers)})),n&&(l=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,n,a,l);for(let t=0;t<o.length;t++){let{key:r,match:n,controller:a}=o[t];f(void 0!==i&&void 0!==i[t],"Did not find corresponding fetcher result");let l=i[t];if(!a||!a.signal.aborted)if(_e(l)){let t=xe(e.matches,null==n?void 0:n.route.id);c&&c[t.route.id]||(c=s({},c,{[t.route.id]:l.error})),e.fetchers.delete(r)}else if(Te(l))f(!1,"Unhandled fetcher revalidation redirect");else if(ke(l))f(!1,"Unhandled fetcher deferred data");else{let t=Ie(l.data);e.fetchers.set(r,t)}}return{loaderData:u,errors:c}}function Re(e,t,r,n){let a=s({},t);for(let o of r){let r=o.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(a[r]=t[r]):void 0!==e[r]&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function xe(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=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 Ce(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o?l="defer() is not supported in actions":"invalid-body"===o&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new G(e||500,i,new Error(l),!0)}function Le(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Te(r))return{result:r,idx:t}}}function Pe(e){return y(s({},"string"==typeof e?g(e):e,{hash:""}))}function ke(e){return e.type===w.deferred}function _e(e){return e.type===w.error}function Te(e){return(e&&e.type)===w.redirect}function Ae(e){return ee.has(e.toLowerCase())}async function Ue(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let u=e.find((e=>e.route.id===s.route.id)),c=null!=u&&!me(u,s)&&void 0!==(o&&o[s.route.id]);if(ke(l)&&(a||c)){let e=n[i];f(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Me(l,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Me(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:w.data,data:e.deferredData.unwrappedData}}catch(e){return{type:w.error,error:e}}return{type:w.data,data:e.deferredData.data}}}function je(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Oe(e,t){let r="string"==typeof t?g(t).search:t.search;if(e[e.length-1].route.index&&je(r||""))return e[e.length-1];let n=F(e);return n[n.length-1]}function Fe(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n)return null!=a?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function 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 Be(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 He=a.createContext(null),We=a.createContext(null),Ke=a.createContext(null),$e=a.createContext(null),Je=a.createContext(null),qe=a.createContext({outlet:null,matches:[],isDataRoute:!1}),Ve=a.createContext(null);function Ye(e,t){let{relative:r}=void 0===t?{}:t;Xe()||f(!1);let{basename:n,navigator:o}=a.useContext($e),{hash:i,pathname:l,search:s}=it(e,{relative:r}),u=l;return"/"!==n&&(u="/"===l?n:I([n,l])),o.createHref({pathname:u,search:s,hash:i})}function Xe(){return null!=a.useContext(Je)}function Ge(){return Xe()||f(!1),a.useContext(Je).location}function Qe(){return a.useContext(Je).navigationType}function Ze(e){Xe()||f(!1);let{pathname:t}=Ge();return a.useMemo((()=>A(e,t)),[t,e])}function et(e){a.useContext($e).static||a.useLayoutEffect(e)}function tt(){let{isDataRoute:e}=a.useContext(qe);return e?function(){let{router:e}=vt(pt.UseNavigateStable),t=gt(mt.UseNavigateStable),r=a.useRef(!1);return et((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,ze({fromRouteId:t},a)))}),[e,t])}():function(){Xe()||f(!1);let e=a.useContext(He),{basename:t,future:r,navigator:n}=a.useContext($e),{matches:o}=a.useContext(qe),{pathname:i}=Ge(),l=JSON.stringify(N(o,r.v7_relativeSplatPath)),s=a.useRef(!1);return et((()=>{s.current=!0})),a.useCallback((function(r,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof r)return void n.go(r);let o=B(r,JSON.parse(l),i,"path"===a.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:I([t,o.pathname])),(a.replace?n.replace:n.push)(o,a.state,a)}),[t,n,l,i,e])}()}const rt=a.createContext(null);function nt(){return a.useContext(rt)}function at(e){let t=a.useContext(qe).outlet;return t?a.createElement(rt.Provider,{value:e},t):t}function ot(){let{matches:e}=a.useContext(qe),t=e[e.length-1];return t?t.params:{}}function it(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=a.useContext($e),{matches:o}=a.useContext(qe),{pathname:i}=Ge(),l=JSON.stringify(N(o,n.v7_relativeSplatPath));return a.useMemo((()=>B(e,JSON.parse(l),i,"path"===r)),[e,l,i,r])}function lt(e,t){return st(e,t)}function st(e,t,r,o){Xe()||f(!1);let{navigator:i}=a.useContext($e),{matches:l}=a.useContext(qe),s=l[l.length-1],u=s?s.params:{},c=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let d,h=Ge();if(t){var p;let e="string"==typeof t?g(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||f(!1),d=e}else d=h;let m=d.pathname||"/",v=R(e,{pathname:"/"===c?m:m.slice(c.length)||"/"}),y=ft(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},u,e.params),pathname:I([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:I([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,r,o);return t&&y?a.createElement(Je.Provider,{value:{location:ze({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:n.Pop}},y):y}function ut(){let e=Ct(),t=Q(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 a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),r?a.createElement("pre",{style:n},r):null,null)}const ct=a.createElement(ut,null);class dt extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(qe.Provider,{value:this.props.routeContext},a.createElement(Ve.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ht(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(He);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(qe.Provider,{value:t},n)}function ft(e,t,r,n){var o;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let l=e,s=null==(o=r)?void 0:o.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||f(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:n}=r,a=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||a){u=!0,l=c>=0?l.slice(0,c+1):[l[0]];break}}}return l.reduceRight(((e,n,o)=>{let i,d=!1,h=null,f=null;var p;r&&(i=s&&n.route.id?s[n.route.id]:void 0,h=n.route.errorElement||ct,u&&(c<0&&0===o?(Tt[p="route-fallback"]||(Tt[p]=!0),d=!0,f=null):c===o&&(d=!0,f=n.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),v=()=>{let t;return t=i?h:d?f:n.route.Component?a.createElement(n.route.Component,null):n.route.element?n.route.element:e,a.createElement(ht,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===o)?a.createElement(dt,{location:r.location,revalidation:r.revalidation,component:h,error:i,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()}),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.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(mt||{});function vt(e){let t=a.useContext(He);return t||f(!1),t}function yt(e){let t=a.useContext(We);return t||f(!1),t}function gt(e){let t=function(){let e=a.useContext(qe);return e||f(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||f(!1),r.route.id}function bt(){return gt(mt.UseRouteId)}function wt(){return yt(mt.UseNavigation).navigation}function Et(){let e=vt(pt.UseRevalidator),t=yt(mt.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])}function St(){let{matches:e,loaderData:t}=yt(mt.UseMatches);return a.useMemo((()=>e.map((e=>x(e,t)))),[e,t])}function Rt(){let e=yt(mt.UseLoaderData),t=gt(mt.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function xt(e){return yt(mt.UseRouteLoaderData).loaderData[e]}function Dt(){let e=yt(mt.UseActionData),t=gt(mt.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function Ct(){var e;let t=a.useContext(Ve),r=yt(mt.UseRouteError),n=gt(mt.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function Lt(){let e=a.useContext(Ke);return null==e?void 0:e._data}function Pt(){let e=a.useContext(Ke);return null==e?void 0:e._error}let kt=0;function _t(e){let{router:t,basename:r}=vt(pt.UseBlocker),n=yt(mt.UseBlocker),[o,i]=a.useState(""),l=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:a,historyAction:o}=t;return e({currentLocation:ze({},n,{pathname:M(n.pathname,r)||n.pathname}),nextLocation:ze({},a,{pathname:M(a.pathname,r)||a.pathname}),historyAction:o})}),[r,e]);return a.useEffect((()=>{let e=String(++kt);return i(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==o&&t.getBlocker(o,l)}),[t,o,l]),o&&n.blockers.has(o)?n.blockers.get(o):le}const Tt={},At=o.startTransition;function Ut(e){let{basename:t,children:r,initialEntries:n,initialIndex:o,future:i}=e,l=a.useRef();null==l.current&&(l.current=c({initialEntries:n,initialIndex:o,v5Compat:!0}));let s=l.current,[u,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:h}=i||{},f=a.useCallback((e=>{h&&At?At((()=>d(e))):d(e)}),[d,h]);return a.useLayoutEffect((()=>s.listen(f)),[s,f]),a.createElement(Ft,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:s,future:i})}function Mt(e){let{to:t,replace:r,state:n,relative:o}=e;Xe()||f(!1);let{future:i,static:l}=a.useContext($e),{matches:s}=a.useContext(qe),{pathname:u}=Ge(),c=tt(),d=B(t,N(s,i.v7_relativeSplatPath),u,"path"===o),h=JSON.stringify(d);return a.useEffect((()=>c(JSON.parse(h),{replace:r,state:n,relative:o})),[c,h,o,r,n]),null}function jt(e){return at(e.context)}function Ot(e){f(!1)}function Ft(e){let{basename:t="/",children:r=null,location:o,navigationType:i=n.Pop,navigator:l,static:s=!1,future:u}=e;Xe()&&f(!1);let c=t.replace(/^\/*/,"/"),d=a.useMemo((()=>({basename:c,navigator:l,static:s,future:ze({v7_relativeSplatPath:!1},u)})),[c,u,l,s]);"string"==typeof o&&(o=g(o));let{pathname:h="/",search:p="",hash:m="",state:v=null,key:y="default"}=o,b=a.useMemo((()=>{let e=M(h,c);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:y},navigationType:i}}),[c,h,p,m,v,y,i]);return null==b?null:a.createElement($e.Provider,{value:d},a.createElement(Je.Provider,{children:r,value:b}))}function Nt(e){let{children:t,location:r}=e;return lt(Kt(t),r)}function Bt(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(Ht,{resolve:n,errorElement:r},a.createElement(Wt,null,t))}var It=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(It||{});const zt=new Promise((()=>{}));class Ht extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=It.pending;if(r instanceof Promise)if(this.state.error){o=It.error;let e=this.state.error;n=Promise.reject().catch((()=>{})),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,o=void 0!==n._error?It.error:void 0!==n._data?It.success:It.pending):(o=It.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then((e=>Object.defineProperty(r,"_data",{get:()=>e})),(e=>Object.defineProperty(r,"_error",{get:()=>e}))));else o=It.success,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(o===It.error&&n._error instanceof $)throw zt;if(o===It.error&&!t)throw n._error;if(o===It.error)return a.createElement(Ke.Provider,{value:n,children:t});if(o===It.success)return a.createElement(Ke.Provider,{value:n,children:e});throw n}}function Wt(e){let{children:t}=e,r=Lt(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function Kt(e,t){void 0===t&&(t=[]);let r=[];return a.Children.forEach(e,((e,n)=>{if(!a.isValidElement(e))return;let o=[...t,n];if(e.type===a.Fragment)return void r.push.apply(r,Kt(e.props.children,o));e.type!==Ot&&f(!1),e.props.index&&e.props.children&&f(!1);let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=Kt(e.props.children,o)),r.push(i)})),r}function $t(e){return ft(e)}function Jt(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function qt(e,t){return de({basename:null==t?void 0:t.basename,future:ze({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:c({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Jt}).initialize()}function Vt(){return Vt=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},Vt.apply(this,arguments)}function Yt(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const Xt="get",Gt="application/x-www-form-urlencoded";function Qt(e){return null!=e&&"string"==typeof e.tagName}function Zt(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}let er=null;const tr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rr(e){return null==e||tr.has(e)?e:null}const nr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],ar=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],or=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"];function ir(e,t){return de({basename:null==t?void 0:t.basename,future:Vt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:d({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||sr(),routes:e,mapRouteProperties:Jt,window:null==t?void 0:t.window}).initialize()}function lr(e,t){return de({basename:null==t?void 0:t.basename,future:Vt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:h({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||sr(),routes:e,mapRouteProperties:Jt,window:null==t?void 0:t.window}).initialize()}function sr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Vt({},t,{errors:ur(t.errors)})),t}function ur(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 G(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const cr=a.createContext({isTransitioning:!1}),dr=a.createContext(new Map),hr=o.startTransition,fr=l.flushSync;function pr(e){fr?fr(e):e()}class mr{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}}function vr(e){let{fallbackElement:t,router:r,future:n}=e,[o,i]=a.useState(r.state),[l,s]=a.useState(),[u,c]=a.useState({isTransitioning:!1}),[d,h]=a.useState(),[f,p]=a.useState(),[m,v]=a.useState(),y=a.useRef(new Map),{v7_startTransition:g}=n||{},b=a.useCallback((e=>{g?function(e){hr?hr(e):e()}(e):e()}),[g]),w=a.useCallback(((e,t)=>{let{deletedFetchers:n,unstable_flushSync:a,unstable_viewTransitionOpts:o}=t;n.forEach((e=>y.current.delete(e))),e.fetchers.forEach(((e,t)=>{void 0!==e.data&&y.current.set(t,e.data)}));let l=null==r.window||"function"!=typeof r.window.document.startViewTransition;if(o&&!l){if(a){pr((()=>{f&&(d&&d.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:o.currentLocation,nextLocation:o.nextLocation})}));let t=r.window.document.startViewTransition((()=>{pr((()=>i(e)))}));return t.finished.finally((()=>{pr((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})}))})),void pr((()=>p(t)))}f?(d&&d.resolve(),f.skipTransition(),v({state:e,currentLocation:o.currentLocation,nextLocation:o.nextLocation})):(s(e),c({isTransitioning:!0,flushSync:!1,currentLocation:o.currentLocation,nextLocation:o.nextLocation}))}else a?pr((()=>i(e))):b((()=>i(e)))}),[r.window,f,d,y,b]);a.useLayoutEffect((()=>r.subscribe(w)),[r,w]),a.useEffect((()=>{u.isTransitioning&&!u.flushSync&&h(new mr)}),[u]),a.useEffect((()=>{if(d&&l&&r.window){let e=l,t=d.promise,n=r.window.document.startViewTransition((async()=>{b((()=>i(e))),await t}));n.finished.finally((()=>{h(void 0),p(void 0),s(void 0),c({isTransitioning:!1})})),p(n)}}),[b,l,d,r.window]),a.useEffect((()=>{d&&l&&o.location.key===l.location.key&&d.resolve()}),[d,f,o.location,l]),a.useEffect((()=>{!u.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))}),[u.isTransitioning,m]),a.useEffect((()=>{}),[]);let E=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),S=r.basename||"/",R=a.useMemo((()=>({router:r,navigator:E,static:!1,basename:S})),[r,E,S]);return a.createElement(a.Fragment,null,a.createElement(He.Provider,{value:R},a.createElement(We.Provider,{value:o},a.createElement(dr.Provider,{value:y.current},a.createElement(cr.Provider,{value:u},a.createElement(Ft,{basename:S,location:o.location,navigationType:o.historyAction,navigator:E,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(yr,{routes:r.routes,future:r.future,state:o}):t))))),null)}function yr(e){let{routes:t,future:r,state:n}=e;return st(t,void 0,n,r)}function gr(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=d({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:c}=n||{},h=a.useCallback((e=>{c&&hr?hr((()=>u(e))):u(e)}),[u,c]);return a.useLayoutEffect((()=>l.listen(h)),[l,h]),a.createElement(Ft,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function br(e){let{basename:t,children:r,future:n,window:o}=e,i=a.useRef();null==i.current&&(i.current=h({window:o,v5Compat:!0}));let l=i.current,[s,u]=a.useState({action:l.action,location:l.location}),{v7_startTransition:c}=n||{},d=a.useCallback((e=>{c&&hr?hr((()=>u(e))):u(e)}),[u,c]);return a.useLayoutEffect((()=>l.listen(d)),[l,d]),a.createElement(Ft,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:l,future:n})}function wr(e){let{basename:t,children:r,future:n,history:o}=e,[i,l]=a.useState({action:o.action,location:o.location}),{v7_startTransition:s}=n||{},u=a.useCallback((e=>{s&&hr?hr((()=>l(e))):l(e)}),[l,s]);return a.useLayoutEffect((()=>o.listen(u)),[o,u]),a.createElement(Ft,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:o,future:n})}const Er="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Sr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rr=a.forwardRef((function(e,t){let r,{onClick:n,relative:o,reloadDocument:i,replace:l,state:s,target:u,to:c,preventScrollReset:d,unstable_viewTransition:h}=e,f=Yt(e,nr),{basename:p}=a.useContext($e),m=!1;if("string"==typeof c&&Sr.test(c)&&(r=c,Er))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),r=M(t.pathname,p);t.origin===e.origin&&null!=r?c=r+t.search+t.hash:m=!0}catch(e){}let v=Ye(c,{relative:o}),y=Tr(c,{replace:l,state:s,target:u,preventScrollReset:d,relative:o,unstable_viewTransition:h});return a.createElement("a",Vt({},f,{href:r||v,onClick:m||i?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:u}))})),xr=a.forwardRef((function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:o="",end:i=!1,style:l,to:s,unstable_viewTransition:u,children:c}=e,d=Yt(e,ar),h=it(s,{relative:d.relative}),f=Ge(),p=a.useContext(We),{navigator:m}=a.useContext($e),v=null!=p&&Kr(h)&&!0===u,y=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,g=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(g=g.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase());const w="/"!==y&&y.endsWith("/")?y.length-1:y.length;let E,S=g===y||!i&&g.startsWith(y)&&"/"===g.charAt(w),R=null!=b&&(b===y||!i&&b.startsWith(y)&&"/"===b.charAt(y.length)),x={isActive:S,isPending:R,isTransitioning:v},D=S?r:void 0;E="function"==typeof o?o(x):[o,S?"active":null,R?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof l?l(x):l;return a.createElement(Rr,Vt({},d,{"aria-current":D,className:E,ref:t,style:C,to:s,unstable_viewTransition:u}),"function"==typeof c?c(x):c)})),Dr=a.forwardRef(((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:o,replace:i,state:l,method:s=Xt,action:u,onSubmit:c,relative:d,preventScrollReset:h,unstable_viewTransition:f}=e,p=Yt(e,or),m=jr(),v=Or(u,{relative:d}),y="get"===s.toLowerCase()?"get":"post";return a.createElement("form",Vt({ref:t,method:y,action:v,onSubmit:o?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=(null==t?void 0:t.getAttribute("formmethod"))||s;m(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:l,relative:d,preventScrollReset:h,unstable_viewTransition:f})}},p))}));function Cr(e){let{getKey:t,storageKey:r}=e;return zr({getKey:t,storageKey:r}),null}var Lr,Pr;function kr(e){let t=a.useContext(He);return t||f(!1),t}function _r(e){let t=a.useContext(We);return t||f(!1),t}function Tr(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===t?{}:t,u=tt(),c=Ge(),d=it(e,{relative:l});return a.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:y(c)===y(d);u(e,{replace:r,state:o,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[c,u,d,n,o,r,e,i,l,s])}function Ar(e){let t=a.useRef(Zt(e)),r=a.useRef(!1),n=Ge(),o=a.useMemo((()=>function(e,t){let r=Zt(e);return t&&t.forEach(((e,n)=>{r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}))})),r}(n.search,r.current?null:t.current)),[n.search]),i=tt(),l=a.useCallback(((e,t)=>{const n=Zt("function"==typeof e?e(o):e);r.current=!0,i("?"+n,t)}),[i,o]);return[o,l]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Lr||(Lr={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Pr||(Pr={}));let Ur=0,Mr=()=>"__"+String(++Ur)+"__";function jr(){let{router:e}=kr(Lr.UseSubmit),{basename:t}=a.useContext($e),r=bt();return a.useCallback((function(n,a){void 0===a&&(a={}),function(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}();let{action:o,method:i,encType:l,formData:s,body:u}=function(e,t){let r,n,a,o,i;if(Qt(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?M(i,t):null,r=e.getAttribute("method")||Xt,a=rr(e.getAttribute("enctype"))||Gt,o=new FormData(e)}else if(function(e){return Qt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Qt(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?M(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Xt,a=rr(e.getAttribute("formenctype"))||rr(i.getAttribute("enctype"))||Gt,o=new FormData(i,e),!function(){if(null===er)try{new FormData(document.createElement("form"),0),er=!1}catch(e){er=!0}return er}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";o.append(e+"x","0"),o.append(e+"y","0")}else t&&o.append(t,n)}}else{if(Qt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Xt,n=null,a=Gt,i=e}var l;return o&&"text/plain"===a&&(i=o,o=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:o,body:i}}(n,t);if(!1===a.navigate){let t=a.fetcherKey||Mr();e.fetch(t,r,a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:s,body:u,formMethod:a.method||i,formEncType:a.encType||l,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})}),[e,t,r])}function Or(e,t){let{relative:r}=void 0===t?{}:t,{basename:n}=a.useContext($e),o=a.useContext(qe);o||f(!1);let[i]=o.matches.slice(-1),l=Vt({},it(e||".",{relative:r})),s=Ge();if(null==e){l.search=s.search;let e=new URLSearchParams(l.search);e.has("index")&&""===e.get("index")&&(e.delete("index"),l.search=e.toString()?"?"+e.toString():"")}return e&&"."!==e||!i.route.index||(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(l.pathname="/"===l.pathname?n:I([n,l.pathname])),y(l)}function Fr(e){var t;let{key:r}=void 0===e?{}:e,{router:n}=kr(Lr.UseFetcher),o=_r(Pr.UseFetcher),i=a.useContext(dr),l=a.useContext(qe),s=null==(t=l.matches[l.matches.length-1])?void 0:t.route.id;i||f(!1),l||f(!1),null==s&&f(!1);let[u,c]=a.useState(r||"");r&&r!==u?c(r):u||c(Mr()),a.useEffect((()=>(n.getFetcher(u),()=>{n.deleteFetcher(u)})),[n,u]);let d=a.useCallback(((e,t)=>{s||f(!1),n.fetch(u,s,e,t)}),[u,s,n]),h=jr(),p=a.useCallback(((e,t)=>{h(e,Vt({},t,{navigate:!1,fetcherKey:u}))}),[u,h]),m=a.useMemo((()=>a.forwardRef(((e,t)=>a.createElement(Dr,Vt({},e,{navigate:!1,fetcherKey:u,ref:t}))))),[u]),v=o.fetchers.get(u)||ie,y=i.get(u);return a.useMemo((()=>Vt({Form:m,submit:p,load:d},v,{data:y})),[m,p,d,v,y])}function Nr(){let e=_r(Pr.UseFetchers);return Array.from(e.fetchers.entries()).map((e=>{let[t,r]=e;return Vt({},r,{key:t})}))}const Br="react-router-scroll-positions";let Ir={};function zr(e){let{getKey:t,storageKey:r}=void 0===e?{}:e,{router:n}=kr(Lr.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=_r(Pr.UseScrollRestoration),{basename:l}=a.useContext($e),s=Ge(),u=St(),c=wt();a.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(e){let{capture:t}={};a.useEffect((()=>{let r=null!=t?{capture:t}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}}),[e,t])}(a.useCallback((()=>{if("idle"===c.state){let e=(t?t(s,u):null)||s.key;Ir[e]=window.scrollY}try{sessionStorage.setItem(r||Br,JSON.stringify(Ir))}catch(e){}window.history.scrollRestoration="auto"}),[r,t,c.state,s,u])),"undefined"!=typeof document&&(a.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||Br);e&&(Ir=JSON.parse(e))}catch(e){}}),[r]),a.useLayoutEffect((()=>{let e=t&&"/"!==l?(e,r)=>t(Vt({},e,{pathname:M(e.pathname,l)||e.pathname}),r):t,r=null==n?void 0:n.enableScrollRestoration(Ir,(()=>window.scrollY),e);return()=>r&&r()}),[n,l,t]),a.useLayoutEffect((()=>{if(!1!==o)if("number"!=typeof o){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[s,o,i]))}function Hr(e,t){let{capture:r}=t||{};a.useEffect((()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}}),[e,r])}function Wr(e){let{when:t,message:r}=e,n=_t(t);a.useEffect((()=>{"blocked"===n.state&&(window.confirm(r)?setTimeout(n.proceed,0):n.reset())}),[n,r]),a.useEffect((()=>{"blocked"!==n.state||t||n.reset()}),[n,t])}function Kr(e,t){void 0===t&&(t={});let r=a.useContext(cr);null==r&&f(!1);let{basename:n}=kr(Lr.useViewTransitionState),o=it(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=M(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=M(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=A(o.pathname,l)||null!=A(o.pathname,i)}}}]);