@tanstack/react-router 0.0.1-beta.3 → 0.0.1-beta.30

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.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("use-sync-external-store/shim")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.shim)}(this,(function(e,t,n){"use strict";function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r,o=a(t);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},i.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}
11
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactRouter={},t.React,t.shim)}(this,(function(t,e,n){"use strict";function a(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o,r=a(e);function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},i.apply(this,arguments)}function s(t,e){if(null==t)return{};var n,a,o={},r=Object.keys(t);for(a=0;a<r.length;a++)n=r[a],e.indexOf(n)>=0||(o[n]=t[n]);return o}function l(){return l=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},l.apply(this,arguments)}!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(o||(o={}));var c="beforeunload",u="popstate";function h(t){void 0===t&&(t={});var e=t.window,n=void 0===e?document.defaultView:e,a=n.history;function r(){var t=n.location,e=t.pathname,o=t.search,r=t.hash,i=a.state||{};return[i.idx,{pathname:e,search:o,hash:r,state:i.usr||null,key:i.key||"default"}]}var i=null;n.addEventListener(u,(function(){if(i)_.call(i),i=null;else{var t=o.Pop,e=r(),n=e[0],a=e[1];if(_.length){if(null!=n){var s=d-n;s&&(i={action:t,location:a,retry:function(){S(-1*s)}},S(s))}}else R(t)}}));var s=o.Pop,h=r(),d=h[0],f=h[1],b=m(),_=m();function P(t){return"string"==typeof t?t:g(t)}function w(t,e){return void 0===e&&(e=null),l({pathname:f.pathname,hash:"",search:""},"string"==typeof t?y(t):t,{state:e,key:v()})}function E(t,e){return[{usr:t.state,key:t.key,idx:e},P(t)]}function x(t,e,n){return!_.length||(_.call({action:t,location:e,retry:n}),!1)}function R(t){s=t;var e=r();d=e[0],f=e[1],b.call({action:s,location:f})}function S(t){a.go(t)}null==d&&(d=0,a.replaceState(l({},a.state,{idx:d}),""));var I={get action(){return s},get location(){return f},createHref:P,push:function t(e,r){var i=o.Push,s=w(e,r);if(x(i,s,(function(){t(e,r)}))){var l=E(s,d+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(t){n.location.assign(u)}R(i)}},replace:function t(e,n){var r=o.Replace,i=w(e,n);if(x(r,i,(function(){t(e,n)}))){var s=E(i,d),l=s[0],c=s[1];a.replaceState(l,"",c),R(r)}},go:S,back:function(){S(-1)},forward:function(){S(1)},listen:function(t){return b.push(t)},block:function(t){var e=_.push(t);return 1===_.length&&n.addEventListener(c,p),function(){e(),_.length||n.removeEventListener(c,p)}}};return I}function d(t){void 0===t&&(t={});var e=t,n=e.initialEntries,a=void 0===n?["/"]:n,r=e.initialIndex,i=a.map((function(t){return l({pathname:"/",search:"",hash:"",state:null,key:v()},"string"==typeof t?y(t):t)})),s=f(null==r?i.length-1:r,0,i.length-1),c=o.Pop,u=i[s],h=m(),d=m();function p(t,e){return void 0===e&&(e=null),l({pathname:u.pathname,search:"",hash:""},"string"==typeof t?y(t):t,{state:e,key:v()})}function b(t,e,n){return!d.length||(d.call({action:t,location:e,retry:n}),!1)}function _(t,e){c=t,u=e,h.call({action:c,location:u})}function P(t){var e=f(s+t,0,i.length-1),n=o.Pop,a=i[e];b(n,a,(function(){P(t)}))&&(s=e,_(n,a))}var w={get index(){return s},get action(){return c},get location(){return u},createHref:function(t){return"string"==typeof t?t:g(t)},push:function t(e,n){var a=o.Push,r=p(e,n);b(a,r,(function(){t(e,n)}))&&(s+=1,i.splice(s,i.length,r),_(a,r))},replace:function t(e,n){var a=o.Replace,r=p(e,n);b(a,r,(function(){t(e,n)}))&&(i[s]=r,_(a,r))},go:P,back:function(){P(-1)},forward:function(){P(1)},listen:function(t){return h.push(t)},block:function(t){return d.push(t)}};return w}function f(t,e,n){return Math.min(Math.max(t,e),n)}function p(t){t.preventDefault(),t.returnValue=""}function m(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter((function(t){return t!==e}))}},call:function(e){t.forEach((function(t){return t&&t(e)}))}}}function v(){return Math.random().toString(36).substr(2,8)}function g(t){var e=t.pathname,n=void 0===e?"/":e,a=t.search,o=void 0===a?"":a,r=t.hash,i=void 0===r?"":r;return o&&"?"!==o&&(n+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(n+="#"===i.charAt(0)?i:"#"+i),n}function y(t){var e={};if(t){var n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));var a=t.indexOf("?");a>=0&&(e.search=t.substr(a),t=t.substr(0,a)),t&&(e.pathname=t)}return e}function b(t,e){if(!t)throw new Error("Invariant failed")}
12
12
  /**
13
13
  * router-core
14
14
  *
@@ -18,5 +18,5 @@
18
18
  * LICENSE.md file in the root directory of this source tree.
19
19
  *
20
20
  * @license MIT
21
- */function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(r||(r={}));var c="beforeunload",u="popstate";function d(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function o(){var e=n.location,t=e.pathname,r=e.search,o=e.hash,i=a.state||{};return[i.idx,{pathname:t,search:r,hash:o,state:i.usr||null,key:i.key||"default"}]}var i=null;n.addEventListener(u,(function(){if(i)P.call(i),i=null;else{var e=r.Pop,t=o(),n=t[0],a=t[1];if(P.length){if(null!=n){var s=h-n;s&&(i={action:e,location:a,retry:function(){M(-1*s)}},M(s))}}else R(e)}}));var s=r.Pop,d=o(),h=d[0],f=d[1],_=m(),P=m();function b(e){return"string"==typeof e?e:g(e)}function w(e,t){return void 0===t&&(t=null),l({pathname:f.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function E(e,t){return[{usr:e.state,key:e.key,idx:t},b(e)]}function x(e,t,n){return!P.length||(P.call({action:e,location:t,retry:n}),!1)}function R(e){s=e;var t=o();h=t[0],f=t[1],_.call({action:s,location:f})}function M(e){a.go(e)}null==h&&(h=0,a.replaceState(l({},a.state,{idx:h}),""));var A={get action(){return s},get location(){return f},createHref:b,push:function e(t,o){var i=r.Push,s=w(t,o);if(x(i,s,(function(){e(t,o)}))){var l=E(s,h+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}R(i)}},replace:function e(t,n){var o=r.Replace,i=w(t,n);if(x(o,i,(function(){e(t,n)}))){var s=E(i,h),l=s[0],c=s[1];a.replaceState(l,"",c),R(o)}},go:M,back:function(){M(-1)},forward:function(){M(1)},listen:function(e){return _.push(e)},block:function(e){var t=P.push(e);return 1===P.length&&n.addEventListener(c,p),function(){t(),P.length||n.removeEventListener(c,p)}}};return A}function h(e){void 0===e&&(e={});var t=e,n=t.initialEntries,a=void 0===n?["/"]:n,o=t.initialIndex,i=a.map((function(e){return l({pathname:"/",search:"",hash:"",state:null,key:v()},"string"==typeof e?y(e):e)})),s=f(null==o?i.length-1:o,0,i.length-1),c=r.Pop,u=i[s],d=m(),h=m();function p(e,t){return void 0===t&&(t=null),l({pathname:u.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function _(e,t,n){return!h.length||(h.call({action:e,location:t,retry:n}),!1)}function P(e,t){c=e,u=t,d.call({action:c,location:u})}function b(e){var t=f(s+e,0,i.length-1),n=r.Pop,a=i[t];_(n,a,(function(){b(e)}))&&(s=t,P(n,a))}var w={get index(){return s},get action(){return c},get location(){return u},createHref:function(e){return"string"==typeof e?e:g(e)},push:function e(t,n){var a=r.Push,o=p(t,n);_(a,o,(function(){e(t,n)}))&&(s+=1,i.splice(s,i.length,o),P(a,o))},replace:function e(t,n){var a=r.Replace,o=p(t,n);_(a,o,(function(){e(t,n)}))&&(i[s]=o,P(a,o))},go:b,back:function(){b(-1)},forward:function(){b(1)},listen:function(e){return d.push(e)},block:function(e){return h.push(e)}};return w}function f(e,t,n){return Math.min(Math.max(e,t),n)}function p(e){e.preventDefault(),e.returnValue=""}function m(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function v(){return Math.random().toString(36).substr(2,8)}function g(e){var t=e.pathname,n=void 0===t?"/":t,a=e.search,r=void 0===a?"":a,o=e.hash,i=void 0===o?"":o;return r&&"?"!==r&&(n+="?"===r.charAt(0)?r:"?"+r),i&&"#"!==i&&(n+="#"===i.charAt(0)?i:"#"+i),n}function y(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}function _(e,t){if(!e)throw new Error("Invariant failed")}function P(e,t){if(e===t)return e;const n=Array.isArray(e)&&Array.isArray(t);if(n||b(e)&&b(t)){const a=n?e.length:Object.keys(e).length,r=n?t:Object.keys(t),o=r.length,i=n?[]:{};let s=0;for(let a=0;a<o;a++){const o=n?a:r[a];i[o]=P(e[o],t[o]),i[o]===e[o]&&s++}return a===o&&s===a?e:i}return t}function b(e){if(!w(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!w(n)&&!!n.hasOwnProperty("isPrototypeOf")}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return e[e.length-1]}function x(e,t){if(e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}return!0}function R(e,t){return"function"==typeof e?e(t):e}function M(e){return A(e.filter(Boolean).join("/"))}function A(e){return e.replace(/\/{2,}/g,"/")}function S(e){return"/"===e?e:e.replace(/^\/{1,}/,"")}function I(e){return"/"===e?e:e.replace(/\/{1,}$/,"")}function L(e){return I(S(e))}function C(e,t,n){t=t.replace(new RegExp("^"+e),"/"),n=n.replace(new RegExp("^"+e),"/");let a=k(t);const r=k(n);r.forEach(((e,t)=>{if("/"===e.value)t?t===r.length-1&&a.push(e):a=[e];else if(".."===e.value){var n;a.length>1&&"/"===(null==(n=E(a))?void 0:n.value)&&a.pop(),a.pop()}else{if("."===e.value)return;a.push(e)}}));return A(M([e,...a.map((e=>e.value))]))}function k(e){if(!e)return[];const t=[];if("/"===(e=A(e)).slice(0,1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map((e=>e.startsWith("*")?{type:"wildcard",value:e}:":"===e.charAt(0)?{type:"param",value:e}:{type:"pathname",value:e}))),"/"===e.slice(-1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function O(e,t,n){return M(k(e).map((e=>{return"*"!==e.value||n?"param"===e.type?null!=(a=t[e.value.substring(1)])?a:"":e.value:"";var a})))}function j(e,t){const n=D(e,t);if(!t.to||n)return null!=n?n:{}}function D(e,t){var n;const a=k(e),r=k(""+(null!=(n=t.to)?n:"*")),o={};return(()=>{for(let e=0;e<Math.max(a.length,r.length);e++){const n=a[e],i=r[e],s=e===r.length-1,l=e===a.length-1;if(i){if("wildcard"===i.type)return!(null==n||!n.value)&&(o["*"]=M(a.slice(e).map((e=>e.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==n||!n.value))return!0;if(n)if(t.caseSensitive){if(i.value!==n.value)return!1}else if(i.value.toLowerCase()!==n.value.toLowerCase())return!1}if(!n)return!1;if("param"===i.type){if("/"===(null==n?void 0:n.value))return!1;n.value.startsWith(":")||(o[i.value.substring(1)]=n.value)}}if(s&&!l)return!!t.fuzzy}return!0})()?o:void 0}function T(e,t){var n,a,r,o="";for(n in e)if(void 0!==(r=e[n]))if(Array.isArray(r))for(a=0;a<r.length;a++)o&&(o+="&"),o+=encodeURIComponent(n)+"="+encodeURIComponent(r[a]);else o&&(o+="&"),o+=encodeURIComponent(n)+"="+encodeURIComponent(r);return(t||"")+o}function F(e){if(!e)return"";var t=decodeURIComponent(e);return"false"!==t&&("true"===t||(0*+t==0?+t:t))}function N(e){for(var t,n,a={},r=e.split("&");t=r.shift();)void 0!==a[n=(t=t.split("=")).shift()]?a[n]=[].concat(a[n],F(t.shift())):a[n]=F(t.shift());return a}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},B.apply(this,arguments)}function H(e,t,n,a){const{id:r,routeId:o,path:i,fullPath:s}=e,l=a.state.actions[r]||(a.state.actions[r]={pending:[],submit:async(e,t)=>{var n;if(!u)return;const r=null==(n=null==t?void 0:t.invalidate)||n,o={submittedAt:Date.now(),status:"pending",submission:e};l.current=o,l.latest=o,l.pending.push(o),a.state=B({},a.state,{currentAction:o,latestAction:o}),a.notify();try{const t=await(null==u.options.action?void 0:u.options.action(e));return o.data=t,r&&(a.invalidateRoute({to:".",fromCurrent:!0}),await a.reload()),o.status="success",t}catch(e){console.error(e),o.error=e,o.status="error"}finally{l.pending=l.pending.filter((e=>e!==o)),a.removeActionQueue.push({action:l,actionState:o}),a.notify()}}},a.state.actions[r]),c=a.state.loaders[r]||(a.state.loaders[r]={pending:[],fetch:async e=>{if(!u)return;const t={loadedAt:Date.now(),loaderContext:e};c.current=t,c.latest=t,c.pending.push(t),a.notify();try{return await(null==u.options.loader?void 0:u.options.loader(e))}finally{c.pending=c.pending.filter((e=>e!==t)),a.notify()}}},a.state.loaders[r]);let u={routeId:r,routeRouteId:o,routePath:i,fullPath:s,options:t,router:a,childRoutes:void 0,parentRoute:n,action:l,loader:c,buildLink:e=>a.buildLink(B({},e,{from:s})),navigate:e=>a.navigate(B({},e,{from:s})),matchRoute:(e,t)=>a.matchRoute(B({},e,{from:s}),t)};return null==a.options.createRoute||a.options.createRoute({router:a,route:u}),u}function U(e){e.forEach(((t,n)=>{const a=e[n-1];a&&(t.loaderData=P(t.loaderData,B({},a.loaderData,t.routeLoaderData)))}))}const z="__root__",G=["element","errorElement","catchElement","pendingElement"];function W(e,t,n){const a=B({},t,n,{router:e,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isPending:!1,isFetching:!1,isInvalid:!1,invalidAt:1/0,getIsInvalid:()=>{const e=Date.now();return a.isInvalid||a.invalidAt<e},__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{a.__.resolve(),a.router.notify()},startPending:()=>{var t,n;const r=null!=(t=a.options.pendingMs)?t:e.options.defaultPendingMs,o=null!=(n=a.options.pendingMinMs)?n:e.options.defaultPendingMinMs;a.__.pendingTimeout||"loading"!==a.status||void 0===r||(a.__.pendingTimeout=setTimeout((()=>{a.isPending=!0,a.__.resolve(),void 0!==o&&(a.__.pendingMinPromise=new Promise((e=>a.__.pendingMinTimeout=setTimeout(e,o))))}),r))},cancelPending:()=>{a.isPending=!1,clearTimeout(a.__.pendingTimeout),clearTimeout(a.__.pendingMinTimeout),delete a.__.pendingMinPromise},validate:()=>{var t,n;const r=null!=(t=null==(n=a.parentMatch)?void 0:n.search)?t:e.location.search;try{const e=a.routeSearch,t="object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch;let n=P(e,null==t?void 0:t(r));e!==n&&(a.isInvalid=!0),a.routeSearch=n,a.search=P(r,B({},r,n))}catch(e){console.error(e);const t=new Error("Invalid search params found",{cause:e});return t.code="INVALID_SEARCH_PARAMS",a.status="error",void(a.error=t)}}},cancel:()=>{var e;null==(e=a.__.abortController)||e.abort(),a.__.cancelPending()},invalidate:()=>{a.isInvalid=!0},hasLoaders:()=>!(!t.options.loader&&!G.some((e=>"function"==typeof t.options[e]))),load:async t=>{const n=Date.now(),r=null!=t&&t.preload?Math.max(null==t?void 0:t.maxAge,null==t?void 0:t.gcMaxAge):0;if(null!=t&&t.preload&&r>0){if(e.state.matches.find((e=>e.matchId===a.matchId)))return;e.matchCache[a.matchId]={gc:n+t.gcMaxAge,match:a}}if("success"===a.status&&a.getIsInvalid()||"error"===a.status||"idle"===a.status){const e=null!=t&&t.preload?null==t?void 0:t.maxAge:void 0;a.fetch({maxAge:e})}},fetch:async t=>{const n=""+Date.now()+Math.random();return a.__.latestId=n,"idle"===a.status&&(a.status="loading"),a.isInvalid=!1,a.__.loadPromise=new Promise((async r=>{a.isFetching=!0,a.__.resolve=r;const o=(async()=>{a.__.elementsPromise=(async()=>{await Promise.all(G.map((async t=>{const n=a.options[t];a.__[t]||(a.__[t]=await e.options.createElement(n))})))})(),a.__.dataPromise=Promise.resolve().then((async()=>{try{var r,o,i;if(a.options.loader){const e=await a.options.loader({params:a.params,search:a.routeSearch,signal:a.__.abortController.signal});if(n!==a.__.latestId)return a.__.loaderPromise;a.routeLoaderData=P(a.routeLoaderData,e)}a.error=void 0,a.status="success",a.updatedAt=Date.now(),a.invalidAt=a.updatedAt+(null!=(r=null!=(o=null!=(i=null==t?void 0:t.maxAge)?i:a.options.loaderMaxAge)?o:e.options.defaultLoaderMaxAge)?r:0)}catch(e){if(n!==a.__.latestId)return a.__.loaderPromise;a.error=e,a.status="error",a.updatedAt=Date.now()}}));try{if(await Promise.all([a.__.elementsPromise,a.__.dataPromise]),n!==a.__.latestId)return a.__.loaderPromise;a.__.pendingMinPromise&&(await a.__.pendingMinPromise,delete a.__.pendingMinPromise)}finally{if(n!==a.__.latestId)return a.__.loaderPromise;a.__.cancelPending(),a.isPending=!1,a.isFetching=!1,a.__.notify()}})();if(a.__.loaderPromise=o,await o,n!==a.__.latestId)return a.__.loaderPromise;delete a.__.loaderPromise})),await a.__.loadPromise}});return a.hasLoaders()||(a.status="success"),a}const q=Q(JSON.parse),K=V(JSON.stringify);function Q(e){return t=>{"?"===t.substring(0,1)&&(t=t.substring(1));let n=N(t);for(let t in n){const a=n[t];if("string"==typeof a)try{n[t]=e(a)}catch(e){}}return n}}function V(e){return t=>{(t=B({},t))&&Object.keys(t).forEach((n=>{const a=t[n];if(void 0===a||void 0===a)delete t[n];else if(a&&"object"==typeof a&&null!==a)try{t[n]=e(a)}catch(e){}}));const n=T(t).toString();return n?"?"+n:""}}var J;const X="undefined"==typeof window||!(null!=(J=window.document)&&J.createElement);function Y(e){var t,n;const a=(null==e?void 0:e.history)||(X?h():d()),r=B({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50},e,{stringifySearch:null!=(t=null==e?void 0:e.stringifySearch)?t:K,parseSearch:null!=(n=null==e?void 0:e.parseSearch)?n:q});let o={history:a,options:r,listeners:[],removeActionQueue:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,allRouteInfo:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},matchCache:{},state:{status:"idle",location:null,matches:[],actions:{},loaders:{},loaderData:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1},startedLoadingAt:Date.now(),subscribe:e=>(o.listeners.push(e),()=>{o.listeners=o.listeners.filter((t=>t!==e))}),getRoute:e=>o.routesById[e],notify:()=>{o.state=B({},o.state,{isFetching:"loading"===o.state.status||o.state.matches.some((e=>e.isFetching)),isPreloading:Object.values(o.matchCache).some((e=>e.match.isFetching&&!o.state.matches.find((t=>t.matchId===e.match.matchId))))}),U(o.state.matches),o.listeners.forEach((e=>e(o)))},mount:()=>{const e=o.__.buildLocation({to:".",search:!0,hash:!0});e.href!==o.location.href?o.__.commitLocation(e,!0):o.loadLocation();const t=a.listen((e=>{o.loadLocation(o.__.parseLocation(e.location,o.location))}));return!X&&window.addEventListener&&(window.addEventListener("visibilitychange",o.onFocus,!1),window.addEventListener("focus",o.onFocus,!1)),()=>{t(),window.removeEventListener("visibilitychange",o.onFocus),window.removeEventListener("focus",o.onFocus)}},onFocus:()=>{o.loadLocation()},update:e=>{Object.assign(o.options,e);const{basepath:t,routeConfig:n}=o.options;return o.basepath=A("/"+(null!=t?t:"")),n&&(o.routesById={},o.routeTree=o.__.buildRouteTree(n)),o},cancelMatches:()=>{var e,t;[...o.state.matches,...null!=(e=null==(t=o.state.pending)?void 0:t.matches)?e:[]].forEach((e=>{e.cancel()}))},loadLocation:async e=>{const t=Math.random();o.startedLoadingAt=t,e&&(o.location=e),o.removeActionQueue.forEach((e=>{let{action:t,actionState:n}=e;o.state.currentAction===n&&(o.state.currentAction=void 0),t.current===n&&(t.current=void 0)})),o.removeActionQueue=[],o.cancelMatches();const n=o.matchRoutes(location.pathname,{strictParseParams:!0});if(o.state=B({},o.state,{pending:{matches:n,location:o.location},status:"loading"}),o.notify(),await o.loadMatches(n,{withPending:!0}),o.startedLoadingAt!==t)return o.navigationPromise;const a=o.state.matches,r=[],i=[];a.forEach((e=>{n.find((t=>t.matchId===e.matchId))?i.push(e):r.push(e)}));const s=Date.now();r.forEach((e=>{var t,n,a,r;null==e.__.onExit||e.__.onExit({params:e.params,search:e.routeSearch}),"error"!==e.status||e.isFetching||(e.status="idle",e.error=void 0);const i=Math.max(null!=(t=null!=(n=e.options.loaderGcMaxAge)?n:o.options.defaultLoaderGcMaxAge)?t:0,null!=(a=null!=(r=e.options.loaderMaxAge)?r:o.options.defaultLoaderMaxAge)?a:0);i>0&&(o.matchCache[e.matchId]={gc:i==1/0?Number.MAX_SAFE_INTEGER:s+i,match:e})})),i.forEach((e=>{null==e.options.onTransition||e.options.onTransition({params:e.params,search:e.routeSearch})}));n.filter((e=>!a.find((t=>t.matchId===e.matchId)))).forEach((e=>{e.__.onExit=null==e.options.onMatch?void 0:e.options.onMatch({params:e.params,search:e.search}),delete o.matchCache[e.matchId]})),n.some((e=>"loading"===e.status))&&(o.notify(),await Promise.all(n.map((e=>e.__.loaderPromise||Promise.resolve())))),o.startedLoadingAt===t&&(o.state=B({},o.state,{location:o.location,matches:n,pending:void 0,status:"idle"}),o.notify(),o.resolveNavigation())},cleanMatchCache:()=>{const e=Date.now();Object.keys(o.matchCache).forEach((t=>{const n=o.matchCache[t];"loading"!==n.match.status&&(n.gc>0&&n.gc>e||delete o.matchCache[t])}))},loadRoute:async function(e){void 0===e&&(e=o.location);const t=o.buildNext(e),n=o.matchRoutes(t.pathname,{strictParseParams:!0});return await o.loadMatches(n),n},preloadRoute:async function(e,t){var n,a,r,i,s,l;void 0===e&&(e=o.location);const c=o.buildNext(e),u=o.matchRoutes(c.pathname,{strictParseParams:!0});return await o.loadMatches(u,{preload:!0,maxAge:null!=(n=null!=(a=null!=(r=t.maxAge)?r:o.options.defaultPreloadMaxAge)?a:o.options.defaultLoaderMaxAge)?n:0,gcMaxAge:null!=(i=null!=(s=null!=(l=t.gcMaxAge)?l:o.options.defaultPreloadGcMaxAge)?s:o.options.defaultLoaderGcMaxAge)?i:0}),u},matchRoutes:(e,t)=>{var n,a;o.cleanMatchCache();const r=[];if(!o.routeTree)return r;const i=[...o.state.matches,...null!=(n=null==(a=o.state.pending)?void 0:a.matches)?n:[]],s=async n=>{var a,l,c;const u=E(r);let d=null!=(a=null==u?void 0:u.params)?a:{};const h=null!=(l=null==o.options.filterRoutes?void 0:o.options.filterRoutes(n))?l:n;let f=[];const p=(n,a)=>(a.some((a=>{var r,i,s;if(!a.routePath&&null!=(r=a.childRoutes)&&r.length)return p([...f,a],a.childRoutes);const l=!!("/"!==a.routePath||null!=(i=a.childRoutes)&&i.length),c=j(e,{to:a.fullPath,fuzzy:l,caseSensitive:null!=(s=a.options.caseSensitive)?s:o.options.caseSensitive});if(c){let e;try{var u;e=null!=(u=null==a.options.parseParams?void 0:a.options.parseParams(c))?u:c}catch(e){if(null!=t&&t.strictParseParams)throw e}d=B({},d,e)}return c&&(f=[...n,a]),!!f.length})),!!f.length);if(p([],h),!f.length)return;f.forEach((t=>{var n;const a=O(t.routePath,d),s=O(t.routeId,d,!0),l=i.find((e=>e.matchId===s))||(null==(n=o.matchCache[s])?void 0:n.match)||W(o,t,{matchId:s,params:d,pathname:M([e,a])});r.push(l)}));const m=E(f);null!=(c=m.childRoutes)&&c.length&&s(m.childRoutes)};return s([o.routeTree]),U(r),r},loadMatches:async(e,t)=>{const n=e.map((async e=>{e.__.validate(),e.load(t),"loading"===e.status&&(null!=t&&t.withPending&&e.__.startPending(),await e.__.loadPromise)}));o.notify(),await Promise.all(n)},invalidateRoute:e=>{var t,n;const a=o.buildNext(e),r=o.matchRoutes(a.pathname).map((e=>e.matchId));[...o.state.matches,...null!=(t=null==(n=o.state.pending)?void 0:n.matches)?t:[]].forEach((e=>{r.includes(e.matchId)&&e.invalidate()}))},reload:()=>o.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(e,t)=>C(o.basepath,e,A(t)),matchRoute:(e,t)=>{var n;e=B({},e,{to:e.to?o.resolvePath(null!=(n=e.from)?n:"",e.to):void 0});const a=o.buildNext(e);var r;return null!=t&&t.pending?!(null==(r=o.state.pending)||!r.location)&&!!j(o.state.pending.location.pathname,B({},t,{to:a.pathname})):!!j(o.state.location.pathname,B({},t,{to:a.pathname}))},navigate:async e=>{let{from:t,to:n=".",search:a,hash:r,replace:i,params:s}=e;const l=String(n),c=String(t);let u;try{new URL(""+l),u=!0}catch(e){}return _(!u),o.__.navigate({from:c,to:l,search:a,hash:r,replace:i,params:s})},buildLink:e=>{var t,n;let{from:a,to:r=".",search:i,params:s,hash:l,target:c,replace:u,activeOptions:d,preload:h,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=e;try{return new URL(""+r),{type:"external",href:r}}catch(e){}const g={from:a,to:r,search:i,params:s,hash:l,replace:u},y=o.buildNext(g);h=null!=(t=h)?t:o.options.defaultPreload;const _=null!=(n=null!=m?m:o.options.defaultPreloadDelay)?n:0,P=o.state.location.pathname===y.pathname,b=o.state.location.pathname.split("/"),w=y.pathname.split("/").every(((e,t)=>e===b[t])),E=o.state.location.hash===y.hash,x=null!=d&&d.exact?P:w,R=null==d||!d.includeHash||E;return{type:"internal",next:y,handleFocus:e=>{h&&o.preloadRoute(g,{maxAge:f,gcMaxAge:p})},handleClick:e=>{v||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||e.defaultPrevented||c&&"_self"!==c||0!==e.button||(e.preventDefault(),!P||i||l||o.invalidateRoute(g),o.__.navigate(g))},handleEnter:e=>{const t=e.target||{};if(h){if(t.preloadTimeout)return;t.preloadTimeout=setTimeout((()=>{t.preloadTimeout=null,o.preloadRoute(g,{maxAge:f,gcMaxAge:p})}),_)}},handleLeave:e=>{const t=e.target||{};t.preloadTimeout&&(clearTimeout(t.preloadTimeout),t.preloadTimeout=null)},isActive:x&&R,disabled:v}},buildNext:e=>{const t=o.__.buildLocation(e),n=o.matchRoutes(t.pathname),a=n.map((e=>{var t;return null!=(t=e.options.preSearchFilters)?t:[]})).flat().filter(Boolean),r=n.map((e=>{var t;return null!=(t=e.options.postSearchFilters)?t:[]})).flat().filter(Boolean);return o.__.buildLocation(B({},e,{__preSearchFilters:a,__postSearchFilters:r}))},__:{buildRouteTree:e=>{const t=(e,n)=>e.map((e=>{const a=H(e,e.options,n,o);if(o.routesById[a.routeId])throw new Error;o.routesById[a.routeId]=a;const r=e.children;return a.childRoutes=null!=r&&r.length?t(r,a):void 0,a}));return t([e])[0]},parseLocation:(e,t)=>{var n;const a=o.options.parseSearch(e.search);return{pathname:e.pathname,searchStr:e.search,search:P(null==t?void 0:t.search,a),hash:null!=(n=e.hash.split("#").reverse()[0])?n:"",href:""+e.pathname+e.search+e.hash,state:e.state,key:e.key}},navigate:e=>{const t=o.buildNext(e);return o.__.commitLocation(t,e.replace)},buildLocation:function(e){var t,n,a,r,i,s,l,c,u;void 0===e&&(e={});const d=e.fromCurrent?o.location.pathname:null!=(t=e.from)?t:o.location.pathname;let h=C(null!=(n=o.basepath)?n:"/",d,""+(null!=(a=e.to)?a:"."));const f=o.matchRoutes(o.location.pathname,{strictParseParams:!0}),p=o.matchRoutes(h),m=B({},null==(r=E(f))?void 0:r.params);let v=!0===(null==(i=e.params)||i)?m:R(e.params,m);v&&p.map((e=>e.options.stringifyParams)).filter(Boolean).forEach((e=>{Object.assign({},v,e(v))})),h=O(h,null!=v?v:{});const g=null!=(s=e.__preSearchFilters)&&s.length?e.__preSearchFilters.reduce(((e,t)=>t(e)),o.location.search):o.location.search,y=!0===e.search?g:e.search?null!=(l=R(e.search,g))?l:{}:null!=(c=e.__preSearchFilters)&&c.length?g:{},_=null!=(u=e.__postSearchFilters)&&u.length?e.__postSearchFilters.reduce(((e,t)=>t(e)),y):y,b=P(o.location.search,_),w=o.options.stringifySearch(b);let x=!0===e.hash?o.location.hash:R(e.hash,o.location.hash);return x=x?"#"+x:"",{pathname:h,search:b,searchStr:w,state:o.location.state,hash:x,href:""+h+w+x,key:e.key}},commitLocation:(e,t)=>{const n=""+Date.now()+Math.random();o.navigateTimeout&&clearTimeout(o.navigateTimeout);let r="replace";t||(r="push");return o.__.parseLocation(a.location).href===e.href&&!e.key&&(r="replace"),"replace"===r?a.replace({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}):a.push({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}),o.navigationPromise=new Promise((e=>{const t=o.resolveNavigation;o.resolveNavigation=()=>{t(),e()}})),o.navigationPromise}}};return o.location=o.__.parseLocation(a.location),o.state.location=o.location,o.update(e),null==o.options.createRouter||o.options.createRouter(o),o}const $=["type","children","target","activeProps","inactiveProps","activeOptions","disabled","hash","search","params","to","preload","preloadDelay","preloadMaxAge","replace","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd"],Z=["pending","caseSensitive","children"],ee=["children","router"],te=o.createContext(null),ne=o.createContext(null),ae=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement)?o.useLayoutEffect:o.useEffect;function re(e){return o.createElement(te.Provider,e)}const oe=e=>{n.useSyncExternalStore((t=>e.subscribe((()=>t()))),(()=>e.state),(()=>e.state))};function ie(){const e=o.useContext(ne);return x(!e,"useRouter must be used inside a <Router> component!"),oe(e.router),e.router}function se(){return o.useContext(te)}function le(){var e;const t=ie(),[,...n]=se(),a=n[0];if(!a)return null;const r=(()=>{var e,n;if(!a)return null;const r=null!=(e=a.__.errorElement)?e:t.options.defaultErrorElement;if("error"===a.status){if(r)return r;if(a.options.useErrorBoundary||t.options.useErrorBoundary)throw a.error;return o.createElement(ue,{error:a.error})}if("loading"===a.status||"idle"===a.status){if(a.isPending){var i;const e=null!=(i=a.__.pendingElement)?i:t.options.defaultPendingElement;var s;if(a.options.pendingMs||e)return null!=(s=e)?s:null}return null}return null!=(n=a.__.element)?n:t.options.defaultElement})(),i=null!=(e=null==a?void 0:a.options.catchElement)?e:t.options.defaultCatchElement;return o.createElement(re,{value:n,key:a.matchId},o.createElement(ce,{catchElement:i},r))}class ce extends o.Component{constructor(){super(...arguments),this.state={error:!1},this.reset=()=>{this.setState({error:!1,info:!1})}}componentDidCatch(e,t){console.error(e),this.setState({error:e,info:t})}render(){var e;const t=null!=(e=this.props.catchElement)?e:ue;return this.state.error?"function"==typeof t?t(this.state):t:this.props.children}}function ue(e){let{error:t}=e;return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),o.createElement("div",{style:{height:".5rem"}}),o.createElement("div",null,o.createElement("pre",null,t.message?o.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},t.message):null)),o.createElement("div",{style:{height:"1rem"}}),o.createElement("div",{style:{fontSize:".8em",borderLeft:"3px solid rgba(127, 127, 127, 1)",paddingLeft:".5rem",opacity:.5}},"If you are the owner of this website, it's highly recommended that you configure your own custom Catch/Error boundaries for the router. You can optionally configure a boundary for each route."))}function de(e,t){const n=ie();o.useEffect((()=>{if(!t)return;let a=n.history.block((t=>{window.confirm(e)?(a(),t.retry()):n.location.pathname=window.location.pathname}));return a}),[t,location,e])}e.DefaultErrorBoundary=ue,e.MatchesProvider=re,e.Outlet=le,e.Prompt=function(e){let{message:t,when:n,children:a}=e;return de(t,null==n||n),null!=a?a:null},e.RouterProvider=function(e){let{children:t,router:n}=e,a=s(e,ee);return n.update(a),oe(n),ae((()=>n.mount()),[n]),o.createElement(ne.Provider,{value:{router:n}},o.createElement(re,{value:n.state.matches},null!=t?t:o.createElement(le,null)))},e.cascadeLoaderData=U,e.cleanPath=A,e.createBrowserHistory=d,e.createHashHistory=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function o(){var e=y(n.location.hash.substr(1)),t=e.pathname,r=void 0===t?"/":t,o=e.search,i=void 0===o?"":o,s=e.hash,l=void 0===s?"":s,c=a.state||{};return[c.idx,{pathname:r,search:i,hash:l,state:c.usr||null,key:c.key||"default"}]}var i=null;function s(){if(i)b.call(i),i=null;else{var e=r.Pop,t=o(),n=t[0],a=t[1];if(b.length){if(null!=n){var s=f-n;s&&(i={action:e,location:a,retry:function(){A(-1*s)}},A(s))}}else M(e)}}n.addEventListener(u,s),n.addEventListener("hashchange",(function(){g(o()[1])!==g(_)&&s()}));var d=r.Pop,h=o(),f=h[0],_=h[1],P=m(),b=m();function w(e){return function(){var e=document.querySelector("base"),t="";if(e&&e.getAttribute("href")){var a=n.location.href,r=a.indexOf("#");t=-1===r?a:a.slice(0,r)}return t}()+"#"+("string"==typeof e?e:g(e))}function E(e,t){return void 0===t&&(t=null),l({pathname:_.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function x(e,t){return[{usr:e.state,key:e.key,idx:t},w(e)]}function R(e,t,n){return!b.length||(b.call({action:e,location:t,retry:n}),!1)}function M(e){d=e;var t=o();f=t[0],_=t[1],P.call({action:d,location:_})}function A(e){a.go(e)}null==f&&(f=0,a.replaceState(l({},a.state,{idx:f}),""));var S={get action(){return d},get location(){return _},createHref:w,push:function e(t,o){var i=r.Push,s=E(t,o);if(R(i,s,(function(){e(t,o)}))){var l=x(s,f+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}M(i)}},replace:function e(t,n){var o=r.Replace,i=E(t,n);if(R(o,i,(function(){e(t,n)}))){var s=x(i,f),l=s[0],c=s[1];a.replaceState(l,"",c),M(o)}},go:A,back:function(){A(-1)},forward:function(){A(1)},listen:function(e){return P.push(e)},block:function(e){var t=b.push(e);return 1===b.length&&n.addEventListener(c,p),function(){t(),b.length||n.removeEventListener(c,p)}}};return S},e.createMemoryHistory=h,e.createReactRouter=function(e){const t=(e,t)=>({useRoute:function(n){void 0===n&&(n=".");const a=t.resolvePath(e.routeId,n),r=t.getRoute(a);return oe(t),_(r),r},linkProps:t=>{var n,a;const{target:r,activeProps:o=(()=>({className:"active"})),inactiveProps:l=(()=>({})),disabled:c,style:u,className:d,onClick:h,onFocus:f,onMouseEnter:p,onMouseLeave:m}=t,v=s(t,$),g=e.buildLink(t);if("external"===g.type){const{href:e}=g;return{href:e}}const{handleClick:y,handleFocus:_,handleEnter:P,handleLeave:b,isActive:w,next:E}=g,x=e=>t=>{t.persist(),e.forEach((e=>{e&&e(t)}))},M=w&&null!=(n=R(o,{}))?n:{},A=w?{}:null!=(a=R(l,{}))?a:{};return i({},M,A,v,{href:c?void 0:E.href,onClick:x([y,h]),onFocus:x([_,f]),onMouseEnter:x([P,p]),onMouseLeave:x([b,m]),target:r,style:i({},u,M.style,A.style),className:[d,M.className,A.className].filter(Boolean).join(" ")||void 0},c?{role:"link","aria-disabled":!0}:void 0,{"data-status":w?"active":void 0})},Link:o.forwardRef(((n,a)=>{const r=e.linkProps(n);return oe(t),o.createElement("a",i({ref:a},r,{children:"function"==typeof n.children?n.children({isActive:"active"===r["data-status"]}):n.children}))})),MatchRoute:t=>{const{pending:n,caseSensitive:a}=t,r=s(t,Z),o=e.matchRoute(r,{pending:n,caseSensitive:a});return o?"function"==typeof t.children?t.children(o):t.children:null}});return Y(i({},e,{createRouter:e=>{const n={useState:()=>(oe(e),e.state),useMatch:t=>{oe(e),_(t!==z);const n=null==(a=se())?void 0:a[0];var a;const r=e.state.matches.find((e=>e.routeId===t));return _(r),_(n.routeId==(null==r?void 0:r.routeId),(null==r||r.routeId,n.routeId,null==r||r.routeId)),r||_("Match not found!"),r}},a=t(e.getRoute("/"),e);Object.assign(e,n,a)},createRoute:e=>{let{router:n,route:a}=e;const r=t(a,n);Object.assign(a,r)},createElement:async e=>{if("function"==typeof e){const t=await e();return"object"==typeof t&&t.default?o.createElement(t.default):t}return e}}))},e.createRoute=H,e.createRouteConfig=function e(t,n,a,r,o){void 0===t&&(t={}),void 0===a&&(a=!0),a&&(t.path=z),r===z&&(r="");let i=a?z:t.path;i&&"/"!==i&&(i=L(i));const s=i||t.id;let l=M([r,s]);i===z&&(i="/"),l!==z&&(l=M(["/",l]));const c=l===z?"/":I(M([o,i]));return{id:l,routeId:s,path:i,fullPath:c,options:t,children:n,createChildren:n=>e(t,n((t=>e(t,void 0,!1,l,c))),!1,r,o),addChildren:n=>e(t,n,!1,r,o),createRoute:t=>e(t,void 0,!1,l,c)}},e.createRouteMatch=W,e.createRouter=Y,e.decode=N,e.defaultParseSearch=q,e.defaultStringifySearch=K,e.encode=T,e.functionalUpdate=R,e.interpolatePath=O,e.invariant=_,e.joinPaths=M,e.last=E,e.matchByPath=D,e.matchPathname=j,e.parsePathname=k,e.parseSearchWith=Q,e.replaceEqualDeep=P,e.resolvePath=C,e.rootRouteId=z,e.stringifySearchWith=V,e.trimPath=L,e.trimPathLeft=S,e.trimPathRight=I,e.usePrompt=de,e.warning=x,Object.defineProperty(e,"__esModule",{value:!0})}));
21
+ */function _(t,e){if(t===e)return t;const n=Array.isArray(t)&&Array.isArray(e);if(n||P(t)&&P(e)){const a=n?t.length:Object.keys(t).length,o=n?e:Object.keys(e),r=o.length,i=n?[]:{};let s=0;for(let a=0;a<r;a++){const r=n?a:o[a];i[r]=_(t[r],e[r]),i[r]===t[r]&&s++}return a===r&&s===a?t:i}return e}function P(t){if(!w(t))return!1;const e=t.constructor;if(void 0===e)return!0;const n=e.prototype;return!!w(n)&&!!n.hasOwnProperty("isPrototypeOf")}function w(t){return"[object Object]"===Object.prototype.toString.call(t)}function E(t){return t[t.length-1]}function x(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}return!0}function R(t,e){return"function"==typeof t?t(e):t}function S(t,e){return e.reduce(((e,n)=>(e[n]=t[n],e)),{})}function I(t){return M(t.filter(Boolean).join("/"))}function M(t){return t.replace(/\/{2,}/g,"/")}function A(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function L(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function C(t){return L(A(t))}function k(t,e,n){e=e.replace(new RegExp("^"+t),"/"),n=n.replace(new RegExp("^"+t),"/");let a=O(e);const o=O(n);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&a.push(t):a=[t];else if(".."===t.value){var n;a.length>1&&"/"===(null==(n=E(a))?void 0:n.value)&&a.pop(),a.pop()}else{if("."===t.value)return;a.push(t)}}));return M(I([t,...a.map((t=>t.value))]))}function O(t){if(!t)return[];const e=[];if("/"===(t=M(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const n=t.split("/").filter(Boolean);return e.push(...n.map((t=>t.startsWith("*")?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function D(t,e,n){return I(O(t).map((t=>{return"*"!==t.value||n?"param"===t.type?null!=(a=e[t.value.substring(1)])?a:"":t.value:"";var a})))}function j(t,e){const n=F(t,e);if(!e.to||n)return null!=n?n:{}}function F(t,e){var n;const a=O(t),o=O(""+(null!=(n=e.to)?n:"*")),r={};return(()=>{for(let t=0;t<Math.max(a.length,o.length);t++){const n=a[t],i=o[t],s=t===o.length-1,l=t===a.length-1;if(i){if("wildcard"===i.type)return!(null==n||!n.value)&&(r["*"]=I(a.slice(t).map((t=>t.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==n||!n.value))return!0;if(n)if(e.caseSensitive){if(i.value!==n.value)return!1}else if(i.value.toLowerCase()!==n.value.toLowerCase())return!1}if(!n)return!1;if("param"===i.type){if("/"===(null==n?void 0:n.value))return!1;"$"!==n.value.charAt(0)&&(r[i.value.substring(1)]=n.value)}}if(s&&!l)return!!e.fuzzy}return!0})()?r:void 0}function T(t,e){var n,a,o,r="";for(n in t)if(void 0!==(o=t[n]))if(Array.isArray(o))for(a=0;a<o.length;a++)r&&(r+="&"),r+=encodeURIComponent(n)+"="+encodeURIComponent(o[a]);else r&&(r+="&"),r+=encodeURIComponent(n)+"="+encodeURIComponent(o);return(e||"")+r}function N(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function B(t){for(var e,n,a={},o=t.split("&");e=o.shift();)void 0!==a[n=(e=e.split("=")).shift()]?a[n]=[].concat(a[n],N(e.shift())):a[n]=N(e.shift());return a}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},U.apply(this,arguments)}function H(t,e,n,a){const{id:o,routeId:r,path:i,fullPath:s}=t,l=a.state.actions[o]||(a.state.actions[o]={submissions:[],submit:async(t,e)=>{var n;if(!u)return;const o=null==(n=null==e?void 0:e.invalidate)||n;null!=e&&e.multi||(l.submissions=l.submissions.filter((t=>t.isMulti)));const r={submittedAt:Date.now(),status:"pending",submission:t,isMulti:!(null==e||!e.multi)};l.current=r,l.latest=r,l.submissions.push(r),a.notify();try{const e=await(null==u.options.action?void 0:u.options.action(t));return r.data=e,o&&(a.invalidateRoute({to:".",fromCurrent:!0}),await a.reload()),r.status="success",e}catch(t){console.log("tanner"),console.error(t),r.error=t,r.status="error"}finally{a.notify()}}},a.state.actions[o]),c=a.state.loaders[o]||(a.state.loaders[o]={pending:[],fetch:async t=>{if(!u)return;const e={loadedAt:Date.now(),loaderContext:t};c.current=e,c.latest=e,c.pending.push(e),a.notify();try{return await(null==u.options.loader?void 0:u.options.loader(t))}finally{c.pending=c.pending.filter((t=>t!==e)),a.notify()}}},a.state.loaders[o]);let u={routeInfo:void 0,routeId:o,routeRouteId:r,routePath:i,fullPath:s,options:e,router:a,childRoutes:void 0,parentRoute:n,action:l,loader:c,buildLink:t=>a.buildLink(U({},t,{from:s})),navigate:t=>a.navigate(U({},t,{from:s})),matchRoute:(t,e)=>a.matchRoute(U({},t,{from:s}),e)};return null==a.options.createRoute||a.options.createRoute({router:a,route:u}),u}const z="__root__",G=["component","errorComponent","pendingComponent"];function q(t,e,n){const a=U({},e,n,{router:t,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isFetching:!1,isInvalid:!1,invalidAt:1/0,getIsInvalid:()=>{const t=Date.now();return a.isInvalid||a.invalidAt<t},__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{a.__.resolve(),a.router.notify()},validate:()=>{var e,n;const o=null!=(e=null==(n=a.parentMatch)?void 0:n.search)?e:t.location.search;try{var r;const t=a.routeSearch,e="object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch;let n=_(t,null!=(r=null==e?void 0:e(o))?r:{});t!==n&&(a.isInvalid=!0),a.routeSearch=n,a.search=_(o,U({},o,n)),G.map((async t=>{const e=a.options[t];"function"!=typeof a.__[t]&&(a.__[t]=e)}))}catch(t){console.error(t);const e=new Error("Invalid search params found",{cause:t});return e.code="INVALID_SEARCH_PARAMS",a.status="error",void(a.error=e)}}},cancel:()=>{var t;null==(t=a.__.abortController)||t.abort()},invalidate:()=>{a.isInvalid=!0},hasLoaders:()=>!(!e.options.loader&&!G.some((t=>{var n;return null==(n=e.options[t])?void 0:n.preload}))),load:async e=>{const n=Date.now(),o=null!=e&&e.preload?Math.max(null==e?void 0:e.maxAge,null==e?void 0:e.gcMaxAge):0;if(null!=e&&e.preload&&o>0){if(t.state.matches.find((t=>t.matchId===a.matchId)))return;t.matchCache[a.matchId]={gc:n+e.gcMaxAge,match:a}}if("success"===a.status&&a.getIsInvalid()||"error"===a.status||"idle"===a.status){const t=null!=e&&e.preload?null==e?void 0:e.maxAge:void 0;await a.fetch({maxAge:t})}},fetch:async e=>{const n=""+Date.now()+Math.random();a.__.latestId=n;const o=async()=>{if(n!==a.__.latestId)return new Promise((()=>{}))};"idle"===a.status&&(a.status="loading"),a.isInvalid=!1,a.__.loadPromise=new Promise((async n=>{a.isFetching=!0,a.__.resolve=n,a.__.componentsPromise=(async()=>{await Promise.all(G.map((async e=>{var n;const o=a.options[e];null!=(n=a.__[e])&&n.preload&&(a.__[e]=await t.options.loadComponent(o))})))})(),a.__.dataPromise=Promise.resolve().then((async()=>{try{var n,r,i;if(a.options.loader){const e=await t.loadMatchData(a);await o(),a.routeLoaderData=_(a.routeLoaderData,e)}return a.error=void 0,a.status="success",a.updatedAt=Date.now(),a.invalidAt=a.updatedAt+(null!=(n=null!=(r=null!=(i=null==e?void 0:e.maxAge)?i:a.options.loaderMaxAge)?r:t.options.defaultLoaderMaxAge)?n:0),a.routeLoaderData}catch(t){throw await o(),a.error=t,a.status="error",a.updatedAt=Date.now(),t}}));const r=async()=>{await o(),a.isFetching=!1,delete a.__.loadPromise,a.__.notify()};try{await Promise.all([a.__.componentsPromise,a.__.dataPromise.catch((()=>{}))]),r()}catch(t){r()}})),await a.__.loadPromise,await o()}});return a.hasLoaders()||(a.status="success"),a}const K=W(JSON.parse),V=$(JSON.stringify);function W(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let n=B(e);for(let e in n){const a=n[e];if("string"==typeof a)try{n[e]=t(a)}catch(t){}}return n}}function $(t){return e=>{(e=U({},e))&&Object.keys(e).forEach((n=>{const a=e[n];if(void 0===a||void 0===a)delete e[n];else if(a&&"object"==typeof a&&null!==a)try{e[n]=t(a)}catch(t){}}));const n=T(e).toString();return n?"?"+n:""}}var J;const X="undefined"==typeof window||!(null!=(J=window.document)&&J.createElement);function Q(){return{status:"idle",location:null,matches:[],actions:{},loaders:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1}}function Y(t){var e,n;const a=(null==t?void 0:t.history)||(X?d():h()),o=U({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50,context:void 0},t,{stringifySearch:null!=(e=null==t?void 0:t.stringifySearch)?e:V,parseSearch:null!=(n=null==t?void 0:t.parseSearch)?n:K});let r={types:void 0,history:a,options:o,listeners:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,resolveNavigation:()=>{},matchCache:{},state:Q(),reset:()=>{r.state=Q(),r.notify()},startedLoadingAt:Date.now(),subscribe:t=>(r.listeners.push(t),()=>{r.listeners=r.listeners.filter((e=>e!==t))}),getRoute:t=>r.routesById[t],notify:()=>{const t="loading"===r.state.status||r.state.matches.some((t=>t.isFetching)),e=Object.values(r.matchCache).some((t=>t.match.isFetching&&!r.state.matches.find((e=>e.matchId===t.match.matchId))));r.state.isFetching===t&&r.state.isPreloading===e||(r.state=U({},r.state,{isFetching:t,isPreloading:e})),Z(r.state.matches),r.listeners.forEach((t=>t(r)))},dehydrate:()=>({location:r.location,state:U({},S(r.state,["status","location","lastUpdated","location"]),{matches:r.state.matches.map((t=>S(t,["matchId","status","routeLoaderData","loaderData","isInvalid","invalidAt"])))}),context:r.options.context}),hydrate:t=>{r.location=t.location,r.options.context=t.context;const e=r.matchRoutes(r.location.pathname,{strictParseParams:!0});e.forEach(((e,n)=>{const a=t.state.matches[n];b(a),Object.assign(e,a)})),e.forEach((t=>t.__.validate())),r.state=U({},r.state,t,{matches:e})},mount:()=>{const t=r.__.buildLocation({to:".",search:!0,hash:!0});t.href!==r.location.href&&r.__.commitLocation(t,!0),r.state.matches.length||r.load();const e=r.history.listen((t=>{r.load(r.__.parseLocation(t.location,r.location))}));return!X&&window.addEventListener&&(window.addEventListener("visibilitychange",r.onFocus,!1),window.addEventListener("focus",r.onFocus,!1)),()=>{e(),!X&&window.removeEventListener&&(window.removeEventListener("visibilitychange",r.onFocus),window.removeEventListener("focus",r.onFocus))}},onFocus:()=>{r.load()},update:t=>{const e=(null==t?void 0:t.history)!==r.history;r.location&&!e||(null!=t&&t.history&&(r.history=t.history),r.location=r.__.parseLocation(r.history.location),r.state.location=r.location),Object.assign(r.options,t);const{basepath:n,routeConfig:a}=r.options;return r.basepath=M("/"+(null!=n?n:"")),a&&(r.routesById={},r.routeTree=r.__.buildRouteTree(a)),r},cancelMatches:()=>{var t,e;[...r.state.matches,...null!=(t=null==(e=r.state.pending)?void 0:e.matches)?t:[]].forEach((t=>{t.cancel()}))},load:async t=>{const e=Math.random();r.startedLoadingAt=e,t&&(r.location=t),r.cancelMatches();const n=r.matchRoutes(r.location.pathname,{strictParseParams:!0});"undefined"!=typeof document?r.state=U({},r.state,{pending:{matches:n,location:r.location},status:"loading"}):r.state=U({},r.state,{matches:n,location:r.location,status:"loading"});try{await Promise.all(n.map((t=>null==t.options.beforeLoad?void 0:t.options.beforeLoad({router:r,match:t}))))}catch(t){throw null!=t&&t.then&&await new Promise((()=>{})),t}if(r.notify(),await r.loadMatches(n),r.startedLoadingAt!==e)return r.navigationPromise;const a=r.state.matches,o=[],i=[];a.forEach((t=>{n.find((e=>e.matchId===t.matchId))?i.push(t):o.push(t)}));const s=n.filter((t=>!a.find((e=>e.matchId===t.matchId)))),l=Date.now();o.forEach((t=>{var e,n,a,o;null==t.__.onExit||t.__.onExit({params:t.params,search:t.routeSearch}),"error"!==t.status||t.isFetching||(t.status="idle",t.error=void 0);const i=Math.max(null!=(e=null!=(n=t.options.loaderGcMaxAge)?n:r.options.defaultLoaderGcMaxAge)?e:0,null!=(a=null!=(o=t.options.loaderMaxAge)?o:r.options.defaultLoaderMaxAge)?a:0);i>0&&(r.matchCache[t.matchId]={gc:i==1/0?Number.MAX_SAFE_INTEGER:l+i,match:t})})),i.forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.routeSearch})})),s.forEach((t=>{t.__.onExit=null==t.options.onLoaded?void 0:t.options.onLoaded({params:t.params,search:t.search}),delete r.matchCache[t.matchId]})),r.startedLoadingAt===e&&(n.forEach((t=>{t.action&&(t.action.current=void 0,t.action.submissions=[])})),r.state=U({},r.state,{location:r.location,matches:n,pending:void 0,status:"idle"}),r.notify(),r.resolveNavigation())},cleanMatchCache:()=>{const t=Date.now();Object.keys(r.matchCache).forEach((e=>{const n=r.matchCache[e];"loading"!==n.match.status&&(n.gc>0&&n.gc>t||delete r.matchCache[e])}))},loadRoute:async function(t){void 0===t&&(t=r.location);const e=r.buildNext(t),n=r.matchRoutes(e.pathname,{strictParseParams:!0});return await r.loadMatches(n),n},preloadRoute:async function(t,e){var n,a,o,i,s,l;void 0===t&&(t=r.location);const c=r.buildNext(t),u=r.matchRoutes(c.pathname,{strictParseParams:!0});return await r.loadMatches(u,{preload:!0,maxAge:null!=(n=null!=(a=null!=(o=e.maxAge)?o:r.options.defaultPreloadMaxAge)?a:r.options.defaultLoaderMaxAge)?n:0,gcMaxAge:null!=(i=null!=(s=null!=(l=e.gcMaxAge)?l:r.options.defaultPreloadGcMaxAge)?s:r.options.defaultLoaderGcMaxAge)?i:0}),u},matchRoutes:(t,e)=>{var n,a;r.cleanMatchCache();const o=[];if(!r.routeTree)return o;const i=[...r.state.matches,...null!=(n=null==(a=r.state.pending)?void 0:a.matches)?n:[]],s=async n=>{var a,l,c;const u=E(o);let h=null!=(a=null==u?void 0:u.params)?a:{};const d=null!=(l=null==r.options.filterRoutes?void 0:r.options.filterRoutes(n))?l:n;let f=[];const p=(n,a)=>(a.some((a=>{var o,i,s;if(!a.routePath&&null!=(o=a.childRoutes)&&o.length)return p([...f,a],a.childRoutes);const l=!!("/"!==a.routePath||null!=(i=a.childRoutes)&&i.length),c=j(t,{to:a.fullPath,fuzzy:l,caseSensitive:null!=(s=a.options.caseSensitive)?s:r.options.caseSensitive});if(c){let t;try{var u;t=null!=(u=null==a.options.parseParams?void 0:a.options.parseParams(c))?u:c}catch(t){if(null!=e&&e.strictParseParams)throw t}h=U({},h,t)}return c&&(f=[...n,a]),!!f.length})),!!f.length);if(p([],d),!f.length)return;f.forEach((t=>{var e;const n=D(t.routePath,h),a=D(t.routeId,h,!0),s=i.find((t=>t.matchId===a))||(null==(e=r.matchCache[a])?void 0:e.match)||q(r,t,{parentMatch:u,matchId:a,params:h,pathname:I([r.basepath,n])});o.push(s)}));const m=E(f);null!=(c=m.childRoutes)&&c.length&&s(m.childRoutes)};return s([r.routeTree]),Z(o),o},loadMatches:async(t,e)=>{const n=t.map((async t=>{t.__.validate(),t.load(e);const n=t.search;n.__data&&n.__data.matchId!==t.matchId||t.__.loadPromise&&await t.__.loadPromise}));r.notify(),await Promise.all(n)},loadMatchData:async t=>{var e;if(X||!r.options.useServerData)return null!=(e=await(null==t.options.loader?void 0:t.options.loader({params:t.params,search:t.routeSearch,signal:t.__.abortController.signal})))?e:{};{const e=r.buildNext({to:".",search:e=>U({},null!=e?e:{},{__data:{matchId:t.matchId}})}),n=await fetch(e.href,{method:"GET"});if(n.ok)return n.json();throw new Error("Failed to fetch match data")}},invalidateRoute:t=>{var e,n;const a=r.buildNext(t),o=r.matchRoutes(a.pathname).map((t=>t.matchId));[...r.state.matches,...null!=(e=null==(n=r.state.pending)?void 0:n.matches)?e:[]].forEach((t=>{o.includes(t.matchId)&&t.invalidate()}))},reload:()=>r.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>k(r.basepath,t,M(e)),matchRoute:(t,e)=>{var n;t=U({},t,{to:t.to?r.resolvePath(null!=(n=t.from)?n:"",t.to):void 0});const a=r.buildNext(t);var o;return null!=e&&e.pending?!(null==(o=r.state.pending)||!o.location)&&!!j(r.state.pending.location.pathname,U({},e,{to:a.pathname})):!!j(r.state.location.pathname,U({},e,{to:a.pathname}))},navigate:async t=>{let{from:e,to:n=".",search:a,hash:o,replace:i,params:s}=t;const l=String(n),c=String(e);let u;try{new URL(""+l),u=!0}catch(t){}return b(!u),r.__.navigate({from:c,to:l,search:a,hash:o,replace:i,params:s})},buildLink:t=>{var e,n;let{from:a,to:o=".",search:i,params:s,hash:l,target:c,replace:u,activeOptions:h,preload:d,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=t;try{return new URL(""+o),{type:"external",href:o}}catch(t){}const g={from:a,to:o,search:i,params:s,hash:l,replace:u},y=r.buildNext(g);d=null!=(e=d)?e:r.options.defaultPreload;const b=null!=(n=null!=m?m:r.options.defaultPreloadDelay)?n:0,_=r.state.location.pathname===y.pathname,P=r.state.location.pathname.split("/"),w=y.pathname.split("/").every(((t,e)=>t===P[e])),E=r.state.location.hash===y.hash,x=null!=h&&h.exact?_:w,R=null==h||!h.includeHash||E;return{type:"internal",next:y,handleFocus:t=>{d&&r.preloadRoute(g,{maxAge:f,gcMaxAge:p})},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||c&&"_self"!==c||0!==t.button||(t.preventDefault(),!_||i||l||r.invalidateRoute(g),r.__.navigate(g))},handleEnter:t=>{const e=t.target||{};if(d){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,r.preloadRoute(g,{maxAge:f,gcMaxAge:p})}),b)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:x&&R,disabled:v}},buildNext:t=>{const e=r.__.buildLocation(t),n=r.matchRoutes(e.pathname),a=n.map((t=>{var e;return null!=(e=t.options.preSearchFilters)?e:[]})).flat().filter(Boolean),o=n.map((t=>{var e;return null!=(e=t.options.postSearchFilters)?e:[]})).flat().filter(Boolean);return r.__.buildLocation(U({},t,{__preSearchFilters:a,__postSearchFilters:o}))},__:{buildRouteTree:t=>{const e=(t,n)=>t.map((t=>{const a=H(t,t.options,n,r);if(r.routesById[a.routeId])throw new Error;r.routesById[a.routeId]=a;const o=t.children;return a.childRoutes=null!=o&&o.length?e(o,a):void 0,a}));return e([t])[0]},parseLocation:(t,e)=>{var n;const a=r.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:_(null==e?void 0:e.search,a),hash:null!=(n=t.hash.split("#").reverse()[0])?n:"",href:""+t.pathname+t.search+t.hash,state:t.state,key:t.key}},navigate:t=>{const e=r.buildNext(t);return r.__.commitLocation(e,t.replace)},buildLocation:function(t){var e,n,a,o,i,s,l,c,u;void 0===t&&(t={});const h=t.fromCurrent?r.location.pathname:null!=(e=t.from)?e:r.location.pathname;let d=k(null!=(n=r.basepath)?n:"/",h,""+(null!=(a=t.to)?a:"."));const f=r.matchRoutes(r.location.pathname,{strictParseParams:!0}),p=r.matchRoutes(d),m=U({},null==(o=E(f))?void 0:o.params);let v=!0===(null==(i=t.params)||i)?m:R(t.params,m);v&&p.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},v,t(v))})),d=D(d,null!=v?v:{});const g=null!=(s=t.__preSearchFilters)&&s.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),r.location.search):r.location.search,y=!0===t.search?g:t.search?null!=(l=R(t.search,g))?l:{}:null!=(c=t.__preSearchFilters)&&c.length?g:{},b=null!=(u=t.__postSearchFilters)&&u.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),y):y,P=_(r.location.search,b),w=r.options.stringifySearch(P);let x=!0===t.hash?r.location.hash:R(t.hash,r.location.hash);return x=x?"#"+x:"",{pathname:d,search:P,searchStr:w,state:r.location.state,hash:x,href:""+d+w+x,key:t.key}},commitLocation:(t,e)=>{const n=""+Date.now()+Math.random();r.navigateTimeout&&clearTimeout(r.navigateTimeout);let o="replace";e||(o="push");return r.__.parseLocation(a.location).href===t.href&&!t.key&&(o="replace"),"replace"===o?a.replace({pathname:t.pathname,hash:t.hash,search:t.searchStr},U({id:n},t.state)):a.push({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:n}),r.navigationPromise=new Promise((t=>{const e=r.resolveNavigation;r.resolveNavigation=()=>{e(),t(),delete r.navigationPromise}})),r.navigationPromise}}};return r.update(t),null==r.options.createRouter||r.options.createRouter(r),r}function Z(t){t.forEach(((e,n)=>{const a=t[n-1];a&&(e.loaderData=_(e.loaderData,U({},a.loaderData,e.routeLoaderData)))}))}const tt=["type","children","target","activeProps","inactiveProps","activeOptions","disabled","hash","search","params","to","preload","preloadDelay","preloadMaxAge","replace","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd"],et=["pending","caseSensitive","children"],nt=["router"];const at=r.createContext(null),ot=r.createContext(null);function rt(t){return r.createElement(at.Provider,t)}const it=t=>{n.useSyncExternalStore((e=>t.subscribe((()=>e()))),(()=>t.state),(()=>t.state))};function st(){const t=r.useContext(ot);return x(!t,"useRouter must be used inside a <Router> component!"),it(t.router),t.router}function lt(){return r.useContext(at)}function ct(){const t=lt()[0];return b(t),t}function ut(){var t,e,n;const a=st(),o=lt().slice(1),i=o[0],s=r.useCallback((()=>null),[]);if(!i)return null;const l=null!=(t=null!=(e=i.__.pendingComponent)?e:a.options.defaultPendingComponent)?t:s,c=null!=(n=i.__.errorComponent)?n:a.options.defaultErrorComponent;return r.createElement(rt,{value:o},r.createElement(r.Suspense,{fallback:r.createElement(l,null)},r.createElement(ht,{key:i.routeId,errorComponent:c,match:i},(()=>{if("error"===i.status)throw i.error;var t,e;if("success"===i.status)return r.createElement(null!=(t=null!=(e=i.__.component)?e:a.options.defaultComponent)?t:ut);throw i.__.loadPromise})())))}class ht extends r.Component{constructor(){super(...arguments),this.state={error:!1,info:void 0}}componentDidCatch(t,e){console.error("Error in route match: "+this.props.match.matchId),console.error(t),this.setState({error:t,info:e})}render(){return r.createElement(dt,i({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function dt(t){var e;const[n,a]=r.useState(t.errorState),o=st(),i=null!=(e=t.errorComponent)?e:ft;return r.useEffect((()=>{if(n){let t=o.state.location.key;return o.subscribe((()=>{o.state.location.key!==t&&(t=o.state.location.key,a({}))}))}}),[n]),r.useEffect((()=>{t.errorState.error&&a(t.errorState),t.reset()}),[t.errorState.error]),n.error?r.createElement(i,n):t.children}function ft(t){let{error:e}=t;return r.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},r.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),r.createElement("div",{style:{height:".5rem"}}),r.createElement("div",null,r.createElement("pre",null,e.message?r.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},e.message):null)))}function pt(t,e){const n=st();r.useEffect((()=>{if(!e)return;let a=n.history.block((e=>{window.confirm(t)?(a(),e.retry()):n.location.pathname=window.location.pathname}));return a}),[e,location,t])}t.DefaultErrorBoundary=ft,t.Link=function(t){const e=st();return r.createElement(e.Link,t)},t.MatchRoute=function(t){const e=st();return r.createElement(e.MatchRoute,t)},t.MatchesProvider=rt,t.Outlet=ut,t.Prompt=function(t){let{message:e,when:n,children:a}=t;return pt(e,null==n||n),null!=a?a:null},t.RouterProvider=function(t){let{router:e}=t,n=s(t,nt);return e.update(n),it(e),r.useEffect((()=>e.mount()),[e]),r.createElement(r.Fragment,null,r.createElement(ot.Provider,{value:{router:e}},r.createElement(rt,{value:[void 0,...e.state.matches]},r.createElement(ut,null))))},t.cleanPath=M,t.createBrowserHistory=h,t.createHashHistory=function(t){void 0===t&&(t={});var e=t.window,n=void 0===e?document.defaultView:e,a=n.history;function r(){var t=y(n.location.hash.substr(1)),e=t.pathname,o=void 0===e?"/":e,r=t.search,i=void 0===r?"":r,s=t.hash,l=void 0===s?"":s,c=a.state||{};return[c.idx,{pathname:o,search:i,hash:l,state:c.usr||null,key:c.key||"default"}]}var i=null;function s(){if(i)P.call(i),i=null;else{var t=o.Pop,e=r(),n=e[0],a=e[1];if(P.length){if(null!=n){var s=f-n;s&&(i={action:t,location:a,retry:function(){I(-1*s)}},I(s))}}else S(t)}}n.addEventListener(u,s),n.addEventListener("hashchange",(function(){g(r()[1])!==g(b)&&s()}));var h=o.Pop,d=r(),f=d[0],b=d[1],_=m(),P=m();function w(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var a=n.location.href,o=a.indexOf("#");e=-1===o?a:a.slice(0,o)}return e}()+"#"+("string"==typeof t?t:g(t))}function E(t,e){return void 0===e&&(e=null),l({pathname:b.pathname,hash:"",search:""},"string"==typeof t?y(t):t,{state:e,key:v()})}function x(t,e){return[{usr:t.state,key:t.key,idx:e},w(t)]}function R(t,e,n){return!P.length||(P.call({action:t,location:e,retry:n}),!1)}function S(t){h=t;var e=r();f=e[0],b=e[1],_.call({action:h,location:b})}function I(t){a.go(t)}null==f&&(f=0,a.replaceState(l({},a.state,{idx:f}),""));var M={get action(){return h},get location(){return b},createHref:w,push:function t(e,r){var i=o.Push,s=E(e,r);if(R(i,s,(function(){t(e,r)}))){var l=x(s,f+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(t){n.location.assign(u)}S(i)}},replace:function t(e,n){var r=o.Replace,i=E(e,n);if(R(r,i,(function(){t(e,n)}))){var s=x(i,f),l=s[0],c=s[1];a.replaceState(l,"",c),S(r)}},go:I,back:function(){I(-1)},forward:function(){I(1)},listen:function(t){return _.push(t)},block:function(t){var e=P.push(t);return 1===P.length&&n.addEventListener(c,p),function(){e(),P.length||n.removeEventListener(c,p)}}};return M},t.createMemoryHistory=d,t.createReactRouter=function(t){const e=(t,e)=>({useRoute:function(n){void 0===n&&(n=".");const a=e.resolvePath(t.routeId,n),o=e.getRoute(a);return it(e),b(o),o},linkProps:e=>{var n,a;const{target:o,activeProps:l=(()=>({className:"active"})),inactiveProps:c=(()=>({})),disabled:u,style:h,className:d,onClick:f,onFocus:p,onMouseEnter:m,onMouseLeave:v}=e,g=s(e,tt),y=t.buildLink(e);if("external"===y.type){const{href:t}=y;return{href:t}}const{handleClick:b,handleFocus:_,handleEnter:P,handleLeave:w,isActive:E,next:x}=y,S=t=>e=>{e.persist(),t.forEach((t=>{t&&t(e)}))},I=E&&null!=(n=R(l,{}))?n:{},M=E?{}:null!=(a=R(c,{}))?a:{};return i({},I,M,g,{href:u?void 0:x.href,onClick:S([t=>{r.startTransition?r.startTransition((()=>{b(t)})):b(t)},f]),onFocus:S([_,p]),onMouseEnter:S([P,m]),onMouseLeave:S([w,v]),target:o,style:i({},h,I.style,M.style),className:[d,I.className,M.className].filter(Boolean).join(" ")||void 0},u?{role:"link","aria-disabled":!0}:void 0,{"data-status":E?"active":void 0})},Link:r.forwardRef(((n,a)=>{const o=t.linkProps(n);return it(e),r.createElement("a",i({ref:a},o,{children:"function"==typeof n.children?n.children({isActive:"active"===o["data-status"]}):n.children}))})),MatchRoute:e=>{const{pending:n,caseSensitive:a}=e,o=s(e,et),r=t.matchRoute(o,{pending:n,caseSensitive:a});return r?"function"==typeof e.children?e.children(r):e.children:null}}),n=Y(i({},t,{createRouter:t=>{const n={useState:()=>(it(t),t.state),useMatch:(e,n)=>{var a;it(t),b(e!==z);const o=ct(),r=t.state.matches.find((t=>t.routeId===e));return(null==(a=null==n?void 0:n.strict)||a)&&(b(r),b(o.routeId==(null==r?void 0:r.routeId),(null==r||r.routeId,o.routeId,null==r||r.routeId,null==r||r.routeId))),r}},a=e(t.getRoute(z),t);Object.assign(t,n,a)},createRoute:t=>{let{router:n,route:a}=t;const o=e(a,n);Object.assign(a,o)},loadComponent:async t=>(t.preload&&"undefined"!=typeof document&&t.preload(),t)}));return n},t.createRoute=H,t.createRouteConfig=function t(e,n,a,o,r){void 0===e&&(e={}),void 0===a&&(a=!0),a&&(e.path=z),o===z&&(o="");let i=a?z:e.path;i&&"/"!==i&&(i=C(i));const s=i||e.id;let l=I([o,s]);i===z&&(i="/"),l!==z&&(l=I(["/",l]));const c=l===z?"/":L(I([r,i]));return{id:l,routeId:s,path:i,fullPath:c,options:e,children:n,addChildren:n=>t(e,n,!1,o,r),createRoute:e=>t(e,void 0,!1,l,c),generate:()=>{b(!1)}}},t.createRouteMatch=q,t.createRouter=Y,t.decode=B,t.defaultParseSearch=K,t.defaultStringifySearch=V,t.encode=T,t.functionalUpdate=R,t.interpolatePath=D,t.invariant=b,t.joinPaths=I,t.last=E,t.lazy=function(t){const e=r.lazy(t);let n,a;const o=r.forwardRef(((t,n)=>{const o=r.useRef(a||e);return r.createElement(o.current,i({},n?{ref:n}:{},t))}));return o.preload=()=>(n||(n=t().then((t=>(a=t.default,a)))),n),o},t.linkProps=function(t){return st().linkProps(t)},t.matchByPath=F,t.matchPathname=j,t.matchesContext=at,t.parsePathname=O,t.parseSearchWith=W,t.pick=S,t.replaceEqualDeep=_,t.resolvePath=k,t.rootRouteId=z,t.routerContext=ot,t.stringifySearchWith=$,t.trimPath=C,t.trimPathLeft=A,t.trimPathRight=L,t.useMatch=function(t,e){return st().useMatch(t,e)},t.useMatches=lt,t.useNearestMatch=ct,t.usePrompt=pt,t.useRoute=function(t){return st().useRoute(t)},t.useRouter=st,t.useSearch=function(t){return st().state.location.search},t.warning=x,Object.defineProperty(t,"__esModule",{value:!0})}));
22
22
  //# sourceMappingURL=index.production.js.map