{"version":3,"file":"index-hxbIYpvW.js","sources":["../../../node_modules/react/cjs/react.production.min.js","../../../node_modules/react/index.js","../../../node_modules/scheduler/cjs/scheduler.production.min.js","../../../node_modules/scheduler/index.js","../../../node_modules/react-dom/cjs/react-dom.production.min.js","../../../node_modules/react-dom/index.js","../../../node_modules/react-dom/client.js","../../../node_modules/@tanstack/history/dist/esm/index.js","../../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../node_modules/react/jsx-runtime.js","../../../node_modules/@tanstack/react-router/dist/esm/routerContext.js","../../../node_modules/@tanstack/react-router/dist/esm/useRouter.js","../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../../node_modules/use-sync-external-store/shim/index.js","../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js","../../../node_modules/use-sync-external-store/shim/with-selector.js","../../../node_modules/@tanstack/store/build/modern/index.js","../../../node_modules/@tanstack/react-store/build/modern/index.js","../../../node_modules/@tanstack/react-router/dist/esm/CatchBoundary.js","../../../node_modules/@tanstack/react-router/dist/esm/useRouterState.js","../../../node_modules/@tanstack/react-router/dist/esm/utils.js","../../../node_modules/@tanstack/react-router/dist/esm/not-found.js","../../../node_modules/@tanstack/react-router/dist/esm/Matches.js","../../../node_modules/@tanstack/react-router/dist/esm/path.js","../../../node_modules/@tanstack/react-router/dist/esm/useParams.js","../../../node_modules/@tanstack/react-router/dist/esm/useSearch.js","../../../node_modules/@tanstack/react-router/dist/esm/route.js","../../../node_modules/@tanstack/react-router/dist/esm/qss.js","../../../node_modules/@tanstack/react-router/dist/esm/searchParams.js","../../../node_modules/@tanstack/react-router/dist/esm/RouterProvider.js","../../../node_modules/@tanstack/react-router/dist/esm/redirects.js","../../../node_modules/@tanstack/react-router/dist/esm/router.js","../../../node_modules/@tanstack/react-router/dist/esm/link.js","../../../node_modules/tslib/tslib.es6.js","../../../node_modules/stylis/src/Enum.js","../../../node_modules/stylis/src/Utility.js","../../../node_modules/stylis/src/Tokenizer.js","../../../node_modules/stylis/src/Parser.js","../../../node_modules/stylis/src/Prefixer.js","../../../node_modules/stylis/src/Serializer.js","../../../node_modules/stylis/src/Middleware.js","../../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../../node_modules/styled-components/dist/styled-components.browser.esm.js","../../../app/frontend/components/staticPages/common/staticContentWrapper.tsx","../../../app/assets/images/patatasBravas.png","../../../app/frontend/components/staticPages/activated.tsx","../../../app/assets/images/spinach.jpg","../../../app/frontend/components/App.jsx","../../../app/assets/images/areYouSure.png","../../../app/assets/images/deleteProfile.png","../../../app/assets/images/lastChance.png","../../../app/frontend/components/staticPages/deleteAccount.tsx","../../../app/assets/images/sausageAndLentils.png","../../../app/frontend/components/staticPages/reactivated.tsx","../../../app/assets/images/reverseSearedSteak.png","../../../app/frontend/components/staticPages/reactivationConfirmed.tsx","../../../app/assets/images/sausageSweetPotato.png","../../../app/frontend/components/staticPages/reactivationRejected.tsx","../../../app/assets/images/toadInTheHole.png","../../../app/frontend/components/staticPages/rejected.tsx","../../../app/assets/images/chickenAndMushroomMarsala.png","../../../app/frontend/components/staticPages/support.tsx","../../../app/assets/images/chickenBaconMushroom.png","../../../app/assets/images/filters.png","../../../app/assets/images/getItOnAppleAppstore.png","../../../app/assets/images/getItOnGooglePlay.png","../../../app/assets/images/login.png","../../../app/assets/images/recipeList.png","../../../app/assets/images/register.png","../../../app/frontend/components/staticPages/welcome.tsx","../../../app/frontend/components/router/routes.ts","../../../app/frontend/components/router/router.tsx","../../../app/frontend/entrypoints/index.jsx"],"sourcesContent":["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3 {\n event.preventDefault();\n return event.returnValue = \"\";\n};\nconst stopBlocking = () => {\n removeEventListener(beforeUnloadEvent, beforeUnloadListener, {\n capture: true\n });\n};\nfunction createHistory(opts) {\n let location = opts.getLocation();\n let subscribers = /* @__PURE__ */ new Set();\n let blockers = [];\n const onUpdate = () => {\n location = opts.getLocation();\n subscribers.forEach((subscriber) => subscriber());\n };\n const tryNavigation = async (task) => {\n var _a;\n if (typeof document !== \"undefined\" && blockers.length) {\n for (let blocker of blockers) {\n const allowed = await blocker();\n if (!allowed) {\n (_a = opts.onBlocked) == null ? void 0 : _a.call(opts, onUpdate);\n return;\n }\n }\n }\n task();\n };\n return {\n get location() {\n return location;\n },\n subscribe: (cb) => {\n subscribers.add(cb);\n return () => {\n subscribers.delete(cb);\n };\n },\n push: (path, state) => {\n state = assignKey(state);\n tryNavigation(() => {\n opts.pushState(path, state);\n onUpdate();\n });\n },\n replace: (path, state) => {\n state = assignKey(state);\n tryNavigation(() => {\n opts.replaceState(path, state);\n onUpdate();\n });\n },\n go: (index) => {\n tryNavigation(() => {\n opts.go(index);\n });\n },\n back: () => {\n tryNavigation(() => {\n opts.back();\n });\n },\n forward: () => {\n tryNavigation(() => {\n opts.forward();\n });\n },\n createHref: (str) => opts.createHref(str),\n block: (blocker) => {\n blockers.push(blocker);\n if (blockers.length === 1) {\n addEventListener(beforeUnloadEvent, beforeUnloadListener, {\n capture: true\n });\n }\n return () => {\n blockers = blockers.filter((b) => b !== blocker);\n if (!blockers.length) {\n stopBlocking();\n }\n };\n },\n flush: () => {\n var _a;\n return (_a = opts.flush) == null ? void 0 : _a.call(opts);\n },\n destroy: () => {\n var _a;\n return (_a = opts.destroy) == null ? void 0 : _a.call(opts);\n },\n notify: onUpdate\n };\n}\nfunction assignKey(state) {\n if (!state) {\n state = {};\n }\n return {\n ...state,\n key: createRandomKey()\n };\n}\nfunction createBrowserHistory(opts) {\n const win = (opts == null ? void 0 : opts.window) ?? (typeof document !== \"undefined\" ? window : void 0);\n const createHref = (opts == null ? void 0 : opts.createHref) ?? ((path) => path);\n const parseLocation = (opts == null ? void 0 : opts.parseLocation) ?? (() => parseHref(\n `${win.location.pathname}${win.location.search}${win.location.hash}`,\n win.history.state\n ));\n let currentLocation = parseLocation();\n let rollbackLocation;\n const getLocation = () => currentLocation;\n let next;\n let tracking = true;\n let scheduled;\n const untrack = (fn) => {\n tracking = false;\n fn();\n tracking = true;\n };\n const flush = () => {\n untrack(() => {\n if (!next)\n return;\n win.history[next.isPush ? \"pushState\" : \"replaceState\"](\n next.state,\n \"\",\n next.href\n );\n next = void 0;\n scheduled = void 0;\n rollbackLocation = void 0;\n });\n };\n const queueHistoryAction = (type, destHref, state) => {\n const href = createHref(destHref);\n if (!scheduled) {\n rollbackLocation = currentLocation;\n }\n currentLocation = parseHref(destHref, state);\n next = {\n href,\n state,\n isPush: (next == null ? void 0 : next.isPush) || type === \"push\"\n };\n if (!scheduled) {\n scheduled = Promise.resolve().then(() => flush());\n }\n };\n const onPushPop = () => {\n currentLocation = parseLocation();\n history.notify();\n };\n var originalPushState = win.history.pushState;\n var originalReplaceState = win.history.replaceState;\n const history = createHistory({\n getLocation,\n pushState: (href, state) => queueHistoryAction(\"push\", href, state),\n replaceState: (href, state) => queueHistoryAction(\"replace\", href, state),\n back: () => win.history.back(),\n forward: () => win.history.forward(),\n go: (n) => win.history.go(n),\n createHref: (href) => createHref(href),\n flush,\n destroy: () => {\n win.history.pushState = originalPushState;\n win.history.replaceState = originalReplaceState;\n win.removeEventListener(pushStateEvent, onPushPop);\n win.removeEventListener(popStateEvent, onPushPop);\n },\n onBlocked: (onUpdate) => {\n if (rollbackLocation && currentLocation !== rollbackLocation) {\n currentLocation = rollbackLocation;\n onUpdate();\n }\n }\n });\n win.addEventListener(pushStateEvent, onPushPop);\n win.addEventListener(popStateEvent, onPushPop);\n win.history.pushState = function() {\n let res = originalPushState.apply(win.history, arguments);\n if (tracking)\n history.notify();\n return res;\n };\n win.history.replaceState = function() {\n let res = originalReplaceState.apply(win.history, arguments);\n if (tracking)\n history.notify();\n return res;\n };\n return history;\n}\nfunction createHashHistory(opts) {\n const win = (opts == null ? void 0 : opts.window) ?? (typeof document !== \"undefined\" ? window : void 0);\n return createBrowserHistory({\n window: win,\n parseLocation: () => {\n const hashHref = win.location.hash.split(\"#\").slice(1).join(\"#\") ?? \"/\";\n return parseHref(hashHref, win.history.state);\n },\n createHref: (href) => `${win.location.pathname}${win.location.search}#${href}`\n });\n}\nfunction createMemoryHistory(opts = {\n initialEntries: [\"/\"]\n}) {\n const entries = opts.initialEntries;\n let index = opts.initialIndex ?? entries.length - 1;\n let currentState = {\n key: createRandomKey()\n };\n const getLocation = () => parseHref(entries[index], currentState);\n return createHistory({\n getLocation,\n pushState: (path, state) => {\n currentState = state;\n entries.push(path);\n index++;\n },\n replaceState: (path, state) => {\n currentState = state;\n entries[index] = path;\n },\n back: () => {\n index--;\n },\n forward: () => {\n index = Math.min(index + 1, entries.length - 1);\n },\n go: (n) => {\n index = Math.min(Math.max(index + n, 0), entries.length - 1);\n },\n createHref: (path) => path\n });\n}\nfunction parseHref(href, state) {\n let hashIndex = href.indexOf(\"#\");\n let searchIndex = href.indexOf(\"?\");\n return {\n href,\n pathname: href.substring(\n 0,\n hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length\n ),\n hash: hashIndex > -1 ? href.substring(hashIndex) : \"\",\n search: searchIndex > -1 ? href.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : \"\",\n state: state || {}\n };\n}\nfunction createRandomKey() {\n return (Math.random() + 1).toString(36).substring(7);\n}\nexport {\n createBrowserHistory,\n createHashHistory,\n createHistory,\n createMemoryHistory\n};\n//# sourceMappingURL=index.js.map\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import * as React from \"react\";\nlet routerContext = React.createContext(null);\nfunction getRouterContext() {\n if (typeof document === \"undefined\") {\n return routerContext;\n }\n if (window.__TSR_ROUTER_CONTEXT__) {\n return window.__TSR_ROUTER_CONTEXT__;\n }\n window.__TSR_ROUTER_CONTEXT__ = routerContext;\n return routerContext;\n}\nexport {\n getRouterContext\n};\n//# sourceMappingURL=routerContext.js.map\n","import * as React from \"react\";\nimport warning from \"tiny-warning\";\nimport { getRouterContext } from \"./routerContext.js\";\nfunction useRouter(opts) {\n const value = React.useContext(getRouterContext());\n warning(\n !(((opts == null ? void 0 : opts.warn) ?? true) && !value),\n \"useRouter must be used inside a component!\"\n );\n return value;\n}\nexport {\n useRouter\n};\n//# sourceMappingURL=useRouter.js.map\n","/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","// src/index.ts\nvar Store = class {\n constructor(initialState, options) {\n this.listeners = /* @__PURE__ */ new Set();\n this._batching = false;\n this._flushing = 0;\n this._nextPriority = null;\n this.subscribe = (listener) => {\n this.listeners.add(listener);\n const unsub = this.options?.onSubscribe?.(listener, this);\n return () => {\n this.listeners.delete(listener);\n unsub?.();\n };\n };\n this.setState = (updater, opts) => {\n const previous = this.state;\n this.state = this.options?.updateFn ? this.options.updateFn(previous)(updater) : updater(previous);\n const priority = opts?.priority ?? this.options?.defaultPriority ?? \"high\";\n if (this._nextPriority === null) {\n this._nextPriority = priority;\n } else if (this._nextPriority === \"high\") {\n this._nextPriority = priority;\n } else {\n this._nextPriority = this.options?.defaultPriority ?? \"high\";\n }\n this.options?.onUpdate?.({\n priority: this._nextPriority\n });\n this._flush();\n };\n this._flush = () => {\n if (this._batching)\n return;\n const flushId = ++this._flushing;\n this.listeners.forEach((listener) => {\n if (this._flushing !== flushId)\n return;\n listener({\n priority: this._nextPriority ?? \"high\"\n });\n });\n };\n this.batch = (cb) => {\n if (this._batching)\n return cb();\n this._batching = true;\n cb();\n this._batching = false;\n this._flush();\n };\n this.state = initialState;\n this.options = options;\n }\n};\nexport {\n Store\n};\n//# sourceMappingURL=index.js.map","// src/index.ts\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/shim/with-selector.js\";\nexport * from \"@tanstack/store\";\nfunction useStore(store, selector = (d) => d) {\n const slice = useSyncExternalStoreWithSelector(\n store.subscribe,\n () => store.state,\n () => store.state,\n selector,\n shallow\n );\n return slice;\n}\nfunction shallow(objA, objB) {\n if (Object.is(objA, objB)) {\n return true;\n }\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n if (keysA.length !== Object.keys(objB).length) {\n return false;\n }\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\nexport {\n shallow,\n useStore\n};\n//# sourceMappingURL=index.js.map","import { jsx, jsxs } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nfunction CatchBoundary(props) {\n const errorComponent = props.errorComponent ?? ErrorComponent;\n return /* @__PURE__ */ jsx(\n CatchBoundaryImpl,\n {\n getResetKey: props.getResetKey,\n onCatch: props.onCatch,\n children: ({ error }) => {\n if (error) {\n return React.createElement(errorComponent, {\n error\n });\n }\n return props.children;\n }\n }\n );\n}\nclass CatchBoundaryImpl extends React.Component {\n constructor() {\n super(...arguments);\n this.state = { error: null };\n }\n static getDerivedStateFromProps(props) {\n var _a;\n return { resetKey: (_a = props.getResetKey) == null ? void 0 : _a.call(props) };\n }\n static getDerivedStateFromError(error) {\n return { error };\n }\n componentDidUpdate(prevProps, prevState) {\n if (prevState.error && prevState.resetKey !== this.state.resetKey) {\n this.setState({ error: null });\n }\n }\n componentDidCatch(error) {\n var _a, _b;\n if (this.props.onCatch) {\n (_b = (_a = this.props).onCatch) == null ? void 0 : _b.call(_a, error);\n } else {\n console.error(error);\n }\n }\n render() {\n return this.props.children(this.state);\n }\n}\nfunction ErrorComponent({ error }) {\n const [show, setShow] = React.useState(process.env.NODE_ENV !== \"production\");\n return /* @__PURE__ */ jsxs(\"div\", { style: { padding: \".5rem\", maxWidth: \"100%\" }, children: [\n /* @__PURE__ */ jsxs(\"div\", { style: { display: \"flex\", alignItems: \"center\", gap: \".5rem\" }, children: [\n /* @__PURE__ */ jsx(\"strong\", { style: { fontSize: \"1rem\" }, children: \"Something went wrong!\" }),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n style: {\n appearance: \"none\",\n fontSize: \".6em\",\n border: \"1px solid currentColor\",\n padding: \".1rem .2rem\",\n fontWeight: \"bold\",\n borderRadius: \".25rem\"\n },\n onClick: () => setShow((d) => !d),\n children: show ? \"Hide Error\" : \"Show Error\"\n }\n )\n ] }),\n /* @__PURE__ */ jsx(\"div\", { style: { height: \".25rem\" } }),\n show ? /* @__PURE__ */ jsx(\"div\", { children: /* @__PURE__ */ jsx(\n \"pre\",\n {\n style: {\n fontSize: \".7em\",\n border: \"1px solid red\",\n borderRadius: \".25rem\",\n padding: \".3rem\",\n color: \"red\",\n overflow: \"auto\"\n },\n children: error.message ? /* @__PURE__ */ jsx(\"code\", { children: error.message }) : null\n }\n ) }) : null\n ] });\n}\nexport {\n CatchBoundary,\n CatchBoundaryImpl,\n ErrorComponent\n};\n//# sourceMappingURL=CatchBoundary.js.map\n","import { useStore } from \"@tanstack/react-store\";\nimport { useRouter } from \"./useRouter.js\";\nfunction useRouterState(opts) {\n const contextRouter = useRouter({\n warn: (opts == null ? void 0 : opts.router) === void 0\n });\n return useStore(((opts == null ? void 0 : opts.router) || contextRouter).__store, opts == null ? void 0 : opts.select);\n}\nexport {\n useRouterState\n};\n//# sourceMappingURL=useRouterState.js.map\n","import * as React from \"react\";\nconst isServer = typeof document === \"undefined\";\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nfunction isFunction(d) {\n return typeof d === \"function\";\n}\nfunction functionalUpdate(updater, previous) {\n if (isFunction(updater)) {\n return updater(previous);\n }\n return updater;\n}\nfunction pick(parent, keys) {\n return keys.reduce((obj, key) => {\n obj[key] = parent[key];\n return obj;\n }, {});\n}\nfunction replaceEqualDeep(prev, _next) {\n if (prev === _next) {\n return prev;\n }\n const next = _next;\n const array = isPlainArray(prev) && isPlainArray(next);\n if (array || isPlainObject(prev) && isPlainObject(next)) {\n const prevItems = array ? prev : Object.keys(prev);\n const prevSize = prevItems.length;\n const nextItems = array ? next : Object.keys(next);\n const nextSize = nextItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < nextSize; i++) {\n const key = array ? i : nextItems[i];\n if (!array && prev[key] === void 0 && next[key] === void 0 && prevItems.includes(key)) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(prev[key], next[key]);\n if (copy[key] === prev[key] && prev[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return prevSize === nextSize && equalItems === prevSize ? prev : copy;\n }\n return next;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (typeof ctor === \"undefined\") {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction deepEqual(a, b, partial = false) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (!partial && aKeys.length !== bKeys.length) {\n return false;\n }\n return !bKeys.some(\n (key) => !(key in a) || !deepEqual(a[key], b[key], partial)\n );\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n return !a.some((item, index) => !deepEqual(item, b[index], partial));\n }\n return false;\n}\nfunction useStableCallback(fn) {\n const fnRef = React.useRef(fn);\n fnRef.current = fn;\n const ref = React.useRef((...args) => fnRef.current(...args));\n return ref.current;\n}\nfunction shallow(objA, objB) {\n if (Object.is(objA, objB)) {\n return true;\n }\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n if (keysA.length !== Object.keys(objB).length) {\n return false;\n }\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\nconst useLayoutEffect = typeof window !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\nfunction escapeJSON(jsonString) {\n return jsonString.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\").replace(/\"/g, '\\\\\"');\n}\nexport {\n deepEqual,\n escapeJSON,\n functionalUpdate,\n isPlainArray,\n isPlainObject,\n isServer,\n last,\n pick,\n replaceEqualDeep,\n shallow,\n useLayoutEffect,\n useStableCallback\n};\n//# sourceMappingURL=utils.js.map\n","import { jsx } from \"react/jsx-runtime\";\nimport { CatchBoundary } from \"./CatchBoundary.js\";\nimport { useRouterState } from \"./useRouterState.js\";\nfunction notFound(options = {}) {\n options.isNotFound = true;\n if (options.throw)\n throw options;\n return options;\n}\nfunction isNotFound(obj) {\n return !!(obj == null ? void 0 : obj.isNotFound);\n}\nfunction CatchNotFound(props) {\n const resetKey = useRouterState({\n select: (s) => `not-found-${s.location.pathname}-${s.status}`\n });\n return /* @__PURE__ */ jsx(\n CatchBoundary,\n {\n getResetKey: () => resetKey,\n onCatch: (error) => {\n var _a;\n if (isNotFound(error)) {\n (_a = props.onCatch) == null ? void 0 : _a.call(props, error);\n } else {\n throw error;\n }\n },\n errorComponent: ({ error }) => {\n var _a;\n return (_a = props.fallback) == null ? void 0 : _a.call(props, error);\n },\n children: props.children\n }\n );\n}\nfunction DefaultGlobalNotFound() {\n return /* @__PURE__ */ jsx(\"p\", { children: \"Not Found\" });\n}\nexport {\n CatchNotFound,\n DefaultGlobalNotFound,\n isNotFound,\n notFound\n};\n//# sourceMappingURL=not-found.js.map\n","import { jsx, Fragment } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nimport invariant from \"tiny-invariant\";\nimport warning from \"tiny-warning\";\nimport { CatchBoundary, ErrorComponent } from \"./CatchBoundary.js\";\nimport { useRouterState } from \"./useRouterState.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { rootRouteId } from \"./route.js\";\nimport { pick } from \"./utils.js\";\nimport { isNotFound, DefaultGlobalNotFound, CatchNotFound } from \"./not-found.js\";\nconst matchContext = React.createContext(void 0);\nfunction Matches() {\n const router = useRouter();\n const matchId = useRouterState({\n select: (s) => {\n var _a;\n return (_a = getRenderedMatches(s)[0]) == null ? void 0 : _a.id;\n }\n });\n return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(\n CatchBoundary,\n {\n getResetKey: () => {\n var _a;\n return (_a = router.state.resolvedLocation.state) == null ? void 0 : _a.key;\n },\n errorComponent: ErrorComponent,\n onCatch: (error) => {\n warning(\n false,\n `The following error wasn't caught by any route! 👇 At the very least, consider setting an 'errorComponent' in your RootRoute!`\n );\n console.error(error);\n },\n children: matchId ? /* @__PURE__ */ jsx(Match, { matchId }) : null\n }\n ) });\n}\nfunction SafeFragment(props) {\n return /* @__PURE__ */ jsx(Fragment, { children: props.children });\n}\nfunction Match({ matchId }) {\n var _a, _b, _c, _d;\n const router = useRouter();\n const routeId = useRouterState({\n select: (s) => {\n var _a2;\n return (_a2 = getRenderedMatches(s).find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId;\n }\n });\n invariant(\n routeId,\n `Could not find routeId for matchId \"${matchId}\". Please file an issue!`\n );\n const route = router.routesById[routeId];\n const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent;\n const pendingElement = PendingComponent ? /* @__PURE__ */ jsx(PendingComponent, {}) : null;\n const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent ?? ErrorComponent;\n const routeNotFoundComponent = route.isRoot ? (\n // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n route.options.notFoundComponent ?? ((_a = router.options.notFoundRoute) == null ? void 0 : _a.options.component)\n ) : route.options.notFoundComponent;\n const ResolvedSuspenseBoundary = route.options.wrapInSuspense ?? PendingComponent ?? ((_b = route.options.component) == null ? void 0 : _b.preload) ?? ((_c = route.options.pendingComponent) == null ? void 0 : _c.preload) ?? ((_d = route.options.errorComponent) == null ? void 0 : _d.preload) ? React.Suspense : SafeFragment;\n const ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment;\n const ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment;\n return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(ResolvedSuspenseBoundary, { fallback: pendingElement, children: /* @__PURE__ */ jsx(\n ResolvedCatchBoundary,\n {\n getResetKey: () => {\n var _a2;\n return (_a2 = router.state.resolvedLocation.state) == null ? void 0 : _a2.key;\n },\n errorComponent: routeErrorComponent,\n onCatch: (error) => {\n if (isNotFound(error))\n throw error;\n warning(false, `Error in route match: ${matchId}`);\n console.error(error);\n },\n children: /* @__PURE__ */ jsx(\n ResolvedNotFoundBoundary,\n {\n fallback: (error) => {\n if (!routeNotFoundComponent || error.global && !route.isRoot)\n throw error;\n return React.createElement(routeNotFoundComponent, {\n data: error.data\n });\n },\n children: /* @__PURE__ */ jsx(MatchInner, { matchId, pendingElement })\n }\n )\n }\n ) }) });\n}\nfunction MatchInner({\n matchId,\n pendingElement\n}) {\n var _a;\n const router = useRouter();\n const routeId = useRouterState({\n select: (s) => {\n var _a2;\n return (_a2 = getRenderedMatches(s).find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId;\n }\n });\n const route = router.routesById[routeId];\n const match = useRouterState({\n select: (s) => pick(getRenderedMatches(s).find((d) => d.id === matchId), [\n \"status\",\n \"error\",\n \"showPending\",\n \"loadPromise\",\n \"notFoundError\"\n ])\n });\n if (match.notFoundError) {\n if (routeId === rootRouteId && !route.options.notFoundComponent)\n return /* @__PURE__ */ jsx(DefaultGlobalNotFound, {});\n invariant(\n route.options.notFoundComponent,\n \"Route matched with notFoundError should have a notFoundComponent\"\n );\n return /* @__PURE__ */ jsx(route.options.notFoundComponent, { data: match.notFoundError });\n }\n if (match.status === \"error\") {\n if (isServerSideError(match.error)) {\n const deserializeError = ((_a = router.options.errorSerializer) == null ? void 0 : _a.deserialize) ?? defaultDeserializeError;\n throw deserializeError(match.error.data);\n } else {\n throw match.error;\n }\n }\n if (match.status === \"pending\") {\n if (match.showPending) {\n return pendingElement;\n }\n throw match.loadPromise;\n }\n if (match.status === \"success\") {\n let Comp = route.options.component ?? router.options.defaultComponent;\n if (Comp) {\n return /* @__PURE__ */ jsx(Comp, {});\n }\n return /* @__PURE__ */ jsx(Outlet, {});\n }\n invariant(\n false,\n \"Idle routeMatch status encountered during rendering! You should never see this. File an issue!\"\n );\n}\nconst Outlet = React.memo(function Outlet2() {\n const matchId = React.useContext(matchContext);\n const childMatchId = useRouterState({\n select: (s) => {\n var _a;\n const matches = getRenderedMatches(s);\n const index = matches.findIndex((d) => d.id === matchId);\n return (_a = matches[index + 1]) == null ? void 0 : _a.id;\n }\n });\n if (!childMatchId) {\n return null;\n }\n return /* @__PURE__ */ jsx(Match, { matchId: childMatchId });\n});\nfunction useMatchRoute() {\n useRouterState({ select: (s) => [s.location, s.resolvedLocation] });\n const { matchRoute } = useRouter();\n return React.useCallback(\n (opts) => {\n const { pending, caseSensitive, fuzzy, includeSearch, ...rest } = opts;\n return matchRoute(rest, {\n pending,\n caseSensitive,\n fuzzy,\n includeSearch\n });\n },\n []\n );\n}\nfunction MatchRoute(props) {\n const matchRoute = useMatchRoute();\n const params = matchRoute(props);\n if (typeof props.children === \"function\") {\n return props.children(params);\n }\n return !!params ? props.children : null;\n}\nfunction getRenderedMatches(state) {\n var _a;\n return ((_a = state.pendingMatches) == null ? void 0 : _a.some((d) => d.showPending)) ? state.pendingMatches : state.matches;\n}\nfunction useMatch(opts) {\n var _a;\n const router = useRouter();\n const nearestMatchId = React.useContext(matchContext);\n const nearestMatchRouteId = (_a = getRenderedMatches(router.state).find(\n (d) => d.id === nearestMatchId\n )) == null ? void 0 : _a.routeId;\n const matchRouteId = (() => {\n const matches = getRenderedMatches(router.state);\n const match = (opts == null ? void 0 : opts.from) ? matches.find((d) => d.routeId === (opts == null ? void 0 : opts.from)) : matches.find((d) => d.id === nearestMatchId);\n return match.routeId;\n })();\n if ((opts == null ? void 0 : opts.strict) ?? true) {\n invariant(\n nearestMatchRouteId == matchRouteId,\n `useMatch(\"${matchRouteId}\") is being called in a component that is meant to render the '${nearestMatchRouteId}' route. Did you mean to 'useMatch(\"${matchRouteId}\", { strict: false })' or 'useRoute(\"${matchRouteId}\")' instead?`\n );\n }\n const matchSelection = useRouterState({\n select: (state) => {\n const match = getRenderedMatches(state).find(\n (d) => d.id === nearestMatchId\n );\n invariant(\n match,\n `Could not find ${(opts == null ? void 0 : opts.from) ? `an active match from \"${opts.from}\"` : \"a nearest match!\"}`\n );\n return (opts == null ? void 0 : opts.select) ? opts.select(match) : match;\n }\n });\n return matchSelection;\n}\nfunction useMatches(opts) {\n return useRouterState({\n select: (state) => {\n const matches = getRenderedMatches(state);\n return (opts == null ? void 0 : opts.select) ? opts.select(matches) : matches;\n }\n });\n}\nfunction useParentMatches(opts) {\n const contextMatchId = React.useContext(matchContext);\n return useMatches({\n select: (matches) => {\n matches = matches.slice(\n 0,\n matches.findIndex((d) => d.id === contextMatchId)\n );\n return (opts == null ? void 0 : opts.select) ? opts.select(matches) : matches;\n }\n });\n}\nfunction useChildMatches(opts) {\n const contextMatchId = React.useContext(matchContext);\n return useMatches({\n select: (matches) => {\n matches = matches.slice(\n matches.findIndex((d) => d.id === contextMatchId) + 1\n );\n return (opts == null ? void 0 : opts.select) ? opts.select(matches) : matches;\n }\n });\n}\nfunction useLoaderDeps(opts) {\n return useMatch({\n ...opts,\n select: (s) => {\n return typeof opts.select === \"function\" ? opts.select(s == null ? void 0 : s.loaderDeps) : s == null ? void 0 : s.loaderDeps;\n }\n });\n}\nfunction useLoaderData(opts) {\n return useMatch({\n ...opts,\n select: (s) => {\n return typeof opts.select === \"function\" ? opts.select(s == null ? void 0 : s.loaderData) : s == null ? void 0 : s.loaderData;\n }\n });\n}\nfunction isServerSideError(error) {\n if (!(typeof error === \"object\" && error && \"data\" in error))\n return false;\n if (!(\"__isServerError\" in error && error.__isServerError))\n return false;\n if (!(typeof error.data === \"object\" && error.data))\n return false;\n return error.__isServerError === true;\n}\nfunction defaultDeserializeError(serializedData) {\n if (\"name\" in serializedData && \"message\" in serializedData) {\n const error = new Error(serializedData.message);\n error.name = serializedData.name;\n return error;\n }\n return serializedData.data;\n}\nexport {\n Match,\n MatchRoute,\n Matches,\n Outlet,\n defaultDeserializeError,\n getRenderedMatches,\n isServerSideError,\n matchContext,\n useChildMatches,\n useLoaderData,\n useLoaderDeps,\n useMatch,\n useMatchRoute,\n useMatches,\n useParentMatches\n};\n//# sourceMappingURL=Matches.js.map\n","import { last } from \"./utils.js\";\nfunction joinPaths(paths) {\n return cleanPath(paths.filter(Boolean).join(\"/\"));\n}\nfunction cleanPath(path) {\n return path.replace(/\\/{2,}/g, \"/\");\n}\nfunction trimPathLeft(path) {\n return path === \"/\" ? path : path.replace(/^\\/{1,}/, \"\");\n}\nfunction trimPathRight(path) {\n return path === \"/\" ? path : path.replace(/\\/{1,}$/, \"\");\n}\nfunction trimPath(path) {\n return trimPathRight(trimPathLeft(path));\n}\nfunction resolvePath(basepath, base, to) {\n base = base.replace(new RegExp(`^${basepath}`), \"/\");\n to = to.replace(new RegExp(`^${basepath}`), \"/\");\n let baseSegments = parsePathname(base);\n const toSegments = parsePathname(to);\n toSegments.forEach((toSegment, index) => {\n var _a;\n if (toSegment.value === \"/\") {\n if (!index) {\n baseSegments = [toSegment];\n } else if (index === toSegments.length - 1) {\n baseSegments.push(toSegment);\n } else\n ;\n } else if (toSegment.value === \"..\") {\n if (baseSegments.length > 1 && ((_a = last(baseSegments)) == null ? void 0 : _a.value) === \"/\") {\n baseSegments.pop();\n }\n baseSegments.pop();\n } else if (toSegment.value === \".\") {\n return;\n } else {\n baseSegments.push(toSegment);\n }\n });\n const joined = joinPaths([basepath, ...baseSegments.map((d) => d.value)]);\n return cleanPath(joined);\n}\nfunction parsePathname(pathname) {\n if (!pathname) {\n return [];\n }\n pathname = cleanPath(pathname);\n const segments = [];\n if (pathname.slice(0, 1) === \"/\") {\n pathname = pathname.substring(1);\n segments.push({\n type: \"pathname\",\n value: \"/\"\n });\n }\n if (!pathname) {\n return segments;\n }\n const split = pathname.split(\"/\").filter(Boolean);\n segments.push(\n ...split.map((part) => {\n if (part === \"$\" || part === \"*\") {\n return {\n type: \"wildcard\",\n value: part\n };\n }\n if (part.charAt(0) === \"$\") {\n return {\n type: \"param\",\n value: part\n };\n }\n return {\n type: \"pathname\",\n value: part\n };\n })\n );\n if (pathname.slice(-1) === \"/\") {\n pathname = pathname.substring(1);\n segments.push({\n type: \"pathname\",\n value: \"/\"\n });\n }\n return segments;\n}\nfunction interpolatePath({\n path,\n params,\n leaveWildcards,\n leaveParams\n}) {\n const interpolatedPathSegments = parsePathname(path);\n return joinPaths(\n interpolatedPathSegments.map((segment) => {\n if (segment.type === \"wildcard\") {\n const value = params._splat;\n if (leaveWildcards)\n return `${segment.value}${value ?? \"\"}`;\n return value;\n }\n if (segment.type === \"param\") {\n if (leaveParams) {\n const value = params[segment.value];\n return `${segment.value}${value ?? \"\"}`;\n }\n return params[segment.value.substring(1)] ?? \"undefined\";\n }\n return segment.value;\n })\n );\n}\nfunction matchPathname(basepath, currentPathname, matchLocation) {\n const pathParams = matchByPath(basepath, currentPathname, matchLocation);\n if (matchLocation.to && !pathParams) {\n return;\n }\n return pathParams ?? {};\n}\nfunction removeBasepath(basepath, pathname) {\n return basepath != \"/\" ? pathname.substring(basepath.length) : pathname;\n}\nfunction matchByPath(basepath, from, matchLocation) {\n from = removeBasepath(basepath, from);\n const to = `${matchLocation.to ?? \"$\"}`;\n const baseSegments = parsePathname(from);\n const routeSegments = parsePathname(to);\n if (!from.startsWith(\"/\")) {\n baseSegments.unshift({\n type: \"pathname\",\n value: \"/\"\n });\n }\n if (!to.startsWith(\"/\")) {\n routeSegments.unshift({\n type: \"pathname\",\n value: \"/\"\n });\n }\n const params = {};\n let isMatch = (() => {\n for (let i = 0; i < Math.max(baseSegments.length, routeSegments.length); i++) {\n const baseSegment = baseSegments[i];\n const routeSegment = routeSegments[i];\n const isLastBaseSegment = i >= baseSegments.length - 1;\n const isLastRouteSegment = i >= routeSegments.length - 1;\n if (routeSegment) {\n if (routeSegment.type === \"wildcard\") {\n if (baseSegment == null ? void 0 : baseSegment.value) {\n const _splat = decodeURI(\n joinPaths(baseSegments.slice(i).map((d) => d.value))\n );\n params[\"*\"] = _splat;\n params[\"_splat\"] = _splat;\n return true;\n }\n return false;\n }\n if (routeSegment.type === \"pathname\") {\n if (routeSegment.value === \"/\" && !(baseSegment == null ? void 0 : baseSegment.value)) {\n return true;\n }\n if (baseSegment) {\n if (matchLocation.caseSensitive) {\n if (routeSegment.value !== baseSegment.value) {\n return false;\n }\n } else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase()) {\n return false;\n }\n }\n }\n if (!baseSegment) {\n return false;\n }\n if (routeSegment.type === \"param\") {\n if ((baseSegment == null ? void 0 : baseSegment.value) === \"/\") {\n return false;\n }\n if (baseSegment.value.charAt(0) !== \"$\") {\n params[routeSegment.value.substring(1)] = decodeURI(\n baseSegment.value\n );\n }\n }\n }\n if (!isLastBaseSegment && isLastRouteSegment) {\n params[\"**\"] = joinPaths(baseSegments.slice(i + 1).map((d) => d.value));\n return !!matchLocation.fuzzy && (routeSegment == null ? void 0 : routeSegment.value) !== \"/\";\n }\n }\n return true;\n })();\n return isMatch ? params : void 0;\n}\nexport {\n cleanPath,\n interpolatePath,\n joinPaths,\n matchByPath,\n matchPathname,\n parsePathname,\n removeBasepath,\n resolvePath,\n trimPath,\n trimPathLeft,\n trimPathRight\n};\n//# sourceMappingURL=path.js.map\n","import { last } from \"./utils.js\";\nimport { useRouterState } from \"./useRouterState.js\";\nimport { getRenderedMatches } from \"./Matches.js\";\nfunction useParams(opts) {\n return useRouterState({\n select: (state) => {\n var _a;\n const params = (_a = last(getRenderedMatches(state))) == null ? void 0 : _a.params;\n return (opts == null ? void 0 : opts.select) ? opts.select(params) : params;\n }\n });\n}\nexport {\n useParams\n};\n//# sourceMappingURL=useParams.js.map\n","import { useMatch } from \"./Matches.js\";\nfunction useSearch(opts) {\n return useMatch({\n ...opts,\n select: (match) => {\n return (opts == null ? void 0 : opts.select) ? opts.select(match.search) : match.search;\n }\n });\n}\nexport {\n useSearch\n};\n//# sourceMappingURL=useSearch.js.map\n","import invariant from \"tiny-invariant\";\nimport { useMatch, useLoaderDeps, useLoaderData } from \"./Matches.js\";\nimport { trimPathLeft, joinPaths } from \"./path.js\";\nimport { useParams } from \"./useParams.js\";\nimport { useSearch } from \"./useSearch.js\";\nimport \"@tanstack/history\";\nimport \"tiny-warning\";\nimport { notFound } from \"./not-found.js\";\nconst rootRouteId = \"__root__\";\nfunction getRouteApi(id) {\n return new RouteApi({ id });\n}\nclass RouteApi {\n /**\n * @deprecated Use the `getRouteApi` function instead.\n */\n constructor({ id }) {\n this.useMatch = (opts) => {\n return useMatch({ select: opts == null ? void 0 : opts.select, from: this.id });\n };\n this.useRouteContext = (opts) => {\n return useMatch({\n from: this.id,\n select: (d) => (opts == null ? void 0 : opts.select) ? opts.select(d.context) : d.context\n });\n };\n this.useSearch = (opts) => {\n return useSearch({ ...opts, from: this.id });\n };\n this.useParams = (opts) => {\n return useParams({ ...opts, from: this.id });\n };\n this.useLoaderDeps = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id });\n };\n this.useLoaderData = (opts) => {\n return useLoaderData({ ...opts, from: this.id });\n };\n this.notFound = (opts) => {\n return notFound({ route: this.id, ...opts });\n };\n this.id = id;\n }\n}\nclass Route {\n constructor(options) {\n this.init = (opts) => {\n var _a, _b;\n this.originalIndex = opts.originalIndex;\n const options2 = this.options;\n const isRoot = !(options2 == null ? void 0 : options2.path) && !(options2 == null ? void 0 : options2.id);\n this.parentRoute = (_b = (_a = this.options) == null ? void 0 : _a.getParentRoute) == null ? void 0 : _b.call(_a);\n if (isRoot) {\n this.path = rootRouteId;\n } else {\n invariant(\n this.parentRoute,\n `Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`\n );\n }\n let path = isRoot ? rootRouteId : options2.path;\n if (path && path !== \"/\") {\n path = trimPathLeft(path);\n }\n const customId = (options2 == null ? void 0 : options2.id) || path;\n let id = isRoot ? rootRouteId : joinPaths([\n this.parentRoute.id === rootRouteId ? \"\" : this.parentRoute.id,\n customId\n ]);\n if (path === rootRouteId) {\n path = \"/\";\n }\n if (id !== rootRouteId) {\n id = joinPaths([\"/\", id]);\n }\n const fullPath = id === rootRouteId ? \"/\" : joinPaths([this.parentRoute.fullPath, path]);\n this.path = path;\n this.id = id;\n this.fullPath = fullPath;\n this.to = fullPath;\n };\n this.addChildren = (children) => {\n this.children = children;\n return this;\n };\n this.updateLoader = (options2) => {\n Object.assign(this.options, options2);\n return this;\n };\n this.update = (options2) => {\n Object.assign(this.options, options2);\n return this;\n };\n this.lazy = (lazyFn) => {\n this.lazyFn = lazyFn;\n return this;\n };\n this.useMatch = (opts) => {\n return useMatch({ ...opts, from: this.id });\n };\n this.useRouteContext = (opts) => {\n return useMatch({\n ...opts,\n from: this.id,\n select: (d) => (opts == null ? void 0 : opts.select) ? opts.select(d.context) : d.context\n });\n };\n this.useSearch = (opts) => {\n return useSearch({ ...opts, from: this.id });\n };\n this.useParams = (opts) => {\n return useParams({ ...opts, from: this.id });\n };\n this.useLoaderDeps = (opts) => {\n return useLoaderDeps({ ...opts, from: this.id });\n };\n this.useLoaderData = (opts) => {\n return useLoaderData({ ...opts, from: this.id });\n };\n this.options = options || {};\n this.isRoot = !(options == null ? void 0 : options.getParentRoute);\n invariant(\n !((options == null ? void 0 : options.id) && (options == null ? void 0 : options.path)),\n `Route cannot have both an 'id' and a 'path' option.`\n );\n this.$$typeof = Symbol.for(\"react.memo\");\n }\n}\nfunction createRoute(options) {\n return new Route(options);\n}\nfunction createRootRouteWithContext() {\n return (options) => {\n return createRootRoute(options);\n };\n}\nconst rootRouteWithContext = createRootRouteWithContext;\nclass RootRoute extends Route {\n /**\n * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.\n */\n constructor(options) {\n super(options);\n }\n}\nfunction createRootRoute(options) {\n return new RootRoute(options);\n}\nfunction createRouteMask(opts) {\n return opts;\n}\nclass NotFoundRoute extends Route {\n constructor(options) {\n super({\n ...options,\n id: \"404\"\n });\n }\n}\nexport {\n NotFoundRoute,\n RootRoute,\n Route,\n RouteApi,\n createRootRoute,\n createRootRouteWithContext,\n createRoute,\n createRouteMask,\n getRouteApi,\n rootRouteId,\n rootRouteWithContext\n};\n//# sourceMappingURL=route.js.map\n","function encode(obj, pfx) {\n var k, i, tmp, str = \"\";\n for (k in obj) {\n if ((tmp = obj[k]) !== void 0) {\n if (Array.isArray(tmp)) {\n for (i = 0; i < tmp.length; i++) {\n str && (str += \"&\");\n str += encodeURIComponent(k) + \"=\" + encodeURIComponent(tmp[i]);\n }\n } else {\n str && (str += \"&\");\n str += encodeURIComponent(k) + \"=\" + encodeURIComponent(tmp);\n }\n }\n }\n return (pfx || \"\") + str;\n}\nfunction toValue(mix) {\n if (!mix)\n return \"\";\n var str = decodeURIComponent(mix);\n if (str === \"false\")\n return false;\n if (str === \"true\")\n return true;\n return +str * 0 === 0 && +str + \"\" === str ? +str : str;\n}\nfunction decode(str, pfx) {\n var tmp, k, out = {}, arr = (pfx ? str.substr(pfx.length) : str).split(\"&\");\n while (tmp = arr.shift()) {\n tmp = tmp.split(\"=\");\n k = tmp.shift();\n if (out[k] !== void 0) {\n out[k] = [].concat(out[k], toValue(tmp.shift()));\n } else {\n out[k] = toValue(tmp.shift());\n }\n }\n return out;\n}\nexport {\n decode,\n encode\n};\n//# sourceMappingURL=qss.js.map\n","import { decode, encode } from \"./qss.js\";\nconst defaultParseSearch = parseSearchWith(JSON.parse);\nconst defaultStringifySearch = stringifySearchWith(\n JSON.stringify,\n JSON.parse\n);\nfunction parseSearchWith(parser) {\n return (searchStr) => {\n if (searchStr.substring(0, 1) === \"?\") {\n searchStr = searchStr.substring(1);\n }\n let query = decode(searchStr);\n for (let key in query) {\n const value = query[key];\n if (typeof value === \"string\") {\n try {\n query[key] = parser(value);\n } catch (err) {\n }\n }\n }\n return query;\n };\n}\nfunction stringifySearchWith(stringify, parser) {\n function stringifyValue(val) {\n if (typeof val === \"object\" && val !== null) {\n try {\n return stringify(val);\n } catch (err) {\n }\n } else if (typeof val === \"string\" && typeof parser === \"function\") {\n try {\n parser(val);\n return stringify(val);\n } catch (err) {\n }\n }\n return val;\n }\n return (search) => {\n search = { ...search };\n if (search) {\n Object.keys(search).forEach((key) => {\n const val = search[key];\n if (typeof val === \"undefined\" || val === void 0) {\n delete search[key];\n } else {\n search[key] = stringifyValue(val);\n }\n });\n }\n const searchStr = encode(search).toString();\n return searchStr ? `?${searchStr}` : \"\";\n };\n}\nexport {\n defaultParseSearch,\n defaultStringifySearch,\n parseSearchWith,\n stringifySearchWith\n};\n//# sourceMappingURL=searchParams.js.map\n","import { jsx, jsxs } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nimport { Matches } from \"./Matches.js\";\nimport { pick, useLayoutEffect } from \"./utils.js\";\nimport { useRouter } from \"./useRouter.js\";\nimport { useRouterState } from \"./useRouterState.js\";\nimport { getRouterContext } from \"./routerContext.js\";\nconst useTransition = React.useTransition || (() => [\n false,\n (cb) => {\n cb();\n }\n]);\nfunction RouterProvider({ router, ...rest }) {\n router.update({\n ...router.options,\n ...rest,\n context: {\n ...router.options.context,\n ...rest == null ? void 0 : rest.context\n }\n });\n const matches = router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: /* @__PURE__ */ jsx(Matches, {}) }) : /* @__PURE__ */ jsx(Matches, {});\n const routerContext = getRouterContext();\n const provider = /* @__PURE__ */ jsxs(routerContext.Provider, { value: router, children: [\n matches,\n /* @__PURE__ */ jsx(Transitioner, {})\n ] });\n if (router.options.Wrap) {\n return /* @__PURE__ */ jsx(router.options.Wrap, { children: provider });\n }\n return provider;\n}\nfunction Transitioner() {\n const router = useRouter();\n const mountLoadForRouter = React.useRef({ router, mounted: false });\n const routerState = useRouterState({\n select: (s) => pick(s, [\"isLoading\", \"location\", \"resolvedLocation\", \"isTransitioning\"])\n });\n const [isTransitioning, startReactTransition] = useTransition();\n router.startReactTransition = startReactTransition;\n React.useEffect(() => {\n if (isTransitioning) {\n router.__store.setState((s) => ({\n ...s,\n isTransitioning\n }));\n }\n }, [isTransitioning]);\n const tryLoad = () => {\n const apply = (cb) => {\n if (!routerState.isTransitioning) {\n startReactTransition(() => cb());\n } else {\n cb();\n }\n };\n apply(() => {\n try {\n router.load();\n } catch (err) {\n console.error(err);\n }\n });\n };\n useLayoutEffect(() => {\n const unsub = router.history.subscribe(() => {\n router.latestLocation = router.parseLocation(router.latestLocation);\n if (routerState.location !== router.latestLocation) {\n tryLoad();\n }\n });\n const nextLocation = router.buildLocation({\n search: true,\n params: true,\n hash: true,\n state: true\n });\n if (routerState.location.href !== nextLocation.href) {\n router.commitLocation({ ...nextLocation, replace: true });\n }\n return () => {\n unsub();\n };\n }, [router.history]);\n useLayoutEffect(() => {\n var _a;\n if (React.useTransition ? routerState.isTransitioning && !isTransitioning : !routerState.isLoading && routerState.resolvedLocation !== routerState.location) {\n router.emit({\n type: \"onResolved\",\n fromLocation: routerState.resolvedLocation,\n toLocation: routerState.location,\n pathChanged: routerState.location.href !== ((_a = routerState.resolvedLocation) == null ? void 0 : _a.href)\n });\n if (document.querySelector) {\n if (routerState.location.hash !== \"\") {\n const el = document.getElementById(\n routerState.location.hash\n );\n if (el) {\n el.scrollIntoView();\n }\n }\n }\n router.__store.setState((s) => ({\n ...s,\n isTransitioning: false,\n resolvedLocation: s.location\n }));\n }\n }, [\n routerState.isTransitioning,\n isTransitioning,\n routerState.isLoading,\n routerState.resolvedLocation,\n routerState.location\n ]);\n useLayoutEffect(() => {\n if (window.__TSR_DEHYDRATED__ || mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted) {\n return;\n }\n mountLoadForRouter.current = { router, mounted: true };\n tryLoad();\n }, [router]);\n return null;\n}\nfunction getRouteMatch(state, id) {\n return [\n ...state.cachedMatches,\n ...state.pendingMatches ?? [],\n ...state.matches\n ].find((d) => d.id === id);\n}\nexport {\n RouterProvider,\n getRouteMatch\n};\n//# sourceMappingURL=RouterProvider.js.map\n","function redirect(opts) {\n opts.isRedirect = true;\n if (opts.throw) {\n throw opts;\n }\n return opts;\n}\nfunction isRedirect(obj) {\n return !!(obj == null ? void 0 : obj.isRedirect);\n}\nexport {\n isRedirect,\n redirect\n};\n//# sourceMappingURL=redirects.js.map\n","import { createBrowserHistory, createMemoryHistory } from \"@tanstack/history\";\nimport { Store } from \"@tanstack/react-store\";\nimport { rootRouteId } from \"./route.js\";\nimport { defaultStringifySearch, defaultParseSearch } from \"./searchParams.js\";\nimport { replaceEqualDeep, pick, deepEqual, escapeJSON, last, functionalUpdate } from \"./utils.js\";\nimport { getRouteMatch } from \"./RouterProvider.js\";\nimport { trimPath, trimPathLeft, parsePathname, resolvePath, cleanPath, matchPathname, trimPathRight, interpolatePath, joinPaths } from \"./path.js\";\nimport invariant from \"tiny-invariant\";\nimport { isRedirect } from \"./redirects.js\";\nimport { isNotFound } from \"./not-found.js\";\nimport warning from \"tiny-warning\";\nconst componentTypes = [\n \"component\",\n \"errorComponent\",\n \"pendingComponent\",\n \"notFoundComponent\"\n];\nfunction createRouter(options) {\n return new Router(options);\n}\nclass Router {\n /**\n * @deprecated Use the `createRouter` function instead\n */\n constructor(options) {\n this.tempLocationKey = `${Math.round(\n Math.random() * 1e7\n )}`;\n this.resetNextScroll = true;\n this.navigateTimeout = null;\n this.latestLoadPromise = Promise.resolve();\n this.subscribers = /* @__PURE__ */ new Set();\n this.injectedHtml = [];\n this.startReactTransition = (fn) => fn();\n this.update = (newOptions) => {\n if (newOptions.notFoundRoute) {\n console.warn(\n \"The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.\"\n );\n }\n const previousOptions = this.options;\n this.options = {\n ...this.options,\n ...newOptions\n };\n if (!this.basepath || newOptions.basepath && newOptions.basepath !== previousOptions.basepath) {\n if (newOptions.basepath === void 0 || newOptions.basepath === \"\" || newOptions.basepath === \"/\") {\n this.basepath = \"/\";\n } else {\n this.basepath = `/${trimPath(newOptions.basepath)}`;\n }\n }\n if (!this.history || this.options.history && this.options.history !== this.history) {\n this.history = this.options.history ?? (typeof document !== \"undefined\" ? createBrowserHistory() : createMemoryHistory({\n initialEntries: [this.options.basepath || \"/\"]\n }));\n this.latestLocation = this.parseLocation();\n }\n if (this.options.routeTree !== this.routeTree) {\n this.routeTree = this.options.routeTree;\n this.buildRouteTree();\n }\n if (!this.__store) {\n this.__store = new Store(getInitialRouterState(this.latestLocation), {\n onUpdate: () => {\n this.__store.state = {\n ...this.state,\n status: this.state.isTransitioning || this.state.isLoading ? \"pending\" : \"idle\"\n };\n }\n });\n }\n };\n this.buildRouteTree = () => {\n this.routesById = {};\n this.routesByPath = {};\n const notFoundRoute = this.options.notFoundRoute;\n if (notFoundRoute) {\n notFoundRoute.init({ originalIndex: 99999999999 });\n this.routesById[notFoundRoute.id] = notFoundRoute;\n }\n const recurseRoutes = (childRoutes) => {\n childRoutes.forEach((childRoute, i) => {\n childRoute.init({ originalIndex: i });\n const existingRoute = this.routesById[childRoute.id];\n invariant(\n !existingRoute,\n `Duplicate routes found with id: ${String(childRoute.id)}`\n );\n this.routesById[childRoute.id] = childRoute;\n if (!childRoute.isRoot && childRoute.path) {\n const trimmedFullPath = trimPathRight(childRoute.fullPath);\n if (!this.routesByPath[trimmedFullPath] || childRoute.fullPath.endsWith(\"/\")) {\n this.routesByPath[trimmedFullPath] = childRoute;\n }\n }\n const children = childRoute.children;\n if (children == null ? void 0 : children.length) {\n recurseRoutes(children);\n }\n });\n };\n recurseRoutes([this.routeTree]);\n const scoredRoutes = [];\n Object.values(this.routesById).forEach((d, i) => {\n var _a;\n if (d.isRoot || !d.path) {\n return;\n }\n const trimmed = trimPathLeft(d.fullPath);\n const parsed = parsePathname(trimmed);\n while (parsed.length > 1 && ((_a = parsed[0]) == null ? void 0 : _a.value) === \"/\") {\n parsed.shift();\n }\n const scores = parsed.map((d2) => {\n if (d2.value === \"/\") {\n return 0.75;\n }\n if (d2.type === \"param\") {\n return 0.5;\n }\n if (d2.type === \"wildcard\") {\n return 0.25;\n }\n return 1;\n });\n scoredRoutes.push({ child: d, trimmed, parsed, index: i, scores });\n });\n this.flatRoutes = scoredRoutes.sort((a, b) => {\n const minLength = Math.min(a.scores.length, b.scores.length);\n for (let i = 0; i < minLength; i++) {\n if (a.scores[i] !== b.scores[i]) {\n return b.scores[i] - a.scores[i];\n }\n }\n if (a.scores.length !== b.scores.length) {\n return b.scores.length - a.scores.length;\n }\n for (let i = 0; i < minLength; i++) {\n if (a.parsed[i].value !== b.parsed[i].value) {\n return a.parsed[i].value > b.parsed[i].value ? 1 : -1;\n }\n }\n return a.index - b.index;\n }).map((d, i) => {\n d.child.rank = i;\n return d.child;\n });\n };\n this.subscribe = (eventType, fn) => {\n const listener = {\n eventType,\n fn\n };\n this.subscribers.add(listener);\n return () => {\n this.subscribers.delete(listener);\n };\n };\n this.emit = (routerEvent) => {\n this.subscribers.forEach((listener) => {\n if (listener.eventType === routerEvent.type) {\n listener.fn(routerEvent);\n }\n });\n };\n this.checkLatest = (promise) => {\n return this.latestLoadPromise !== promise ? this.latestLoadPromise : void 0;\n };\n this.parseLocation = (previousLocation) => {\n const parse = ({\n pathname,\n search,\n hash,\n state\n }) => {\n const parsedSearch = this.options.parseSearch(search);\n const searchStr = this.options.stringifySearch(parsedSearch);\n return {\n pathname,\n searchStr,\n search: replaceEqualDeep(previousLocation == null ? void 0 : previousLocation.search, parsedSearch),\n hash: hash.split(\"#\").reverse()[0] ?? \"\",\n href: `${pathname}${searchStr}${hash}`,\n state: replaceEqualDeep(previousLocation == null ? void 0 : previousLocation.state, state)\n };\n };\n const location = parse(this.history.location);\n let { __tempLocation, __tempKey } = location.state;\n if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {\n const parsedTempLocation = parse(__tempLocation);\n parsedTempLocation.state.key = location.state.key;\n delete parsedTempLocation.state.__tempLocation;\n return {\n ...parsedTempLocation,\n maskedLocation: location\n };\n }\n return location;\n };\n this.resolvePathWithBase = (from, path) => {\n return resolvePath(this.basepath, from, cleanPath(path));\n };\n this.matchRoutes = (pathname, locationSearch, opts) => {\n let routeParams = {};\n let foundRoute = this.flatRoutes.find((route) => {\n const matchedParams = matchPathname(\n this.basepath,\n trimPathRight(pathname),\n {\n to: route.fullPath,\n caseSensitive: route.options.caseSensitive ?? this.options.caseSensitive,\n fuzzy: true\n }\n );\n if (matchedParams) {\n routeParams = matchedParams;\n return true;\n }\n return false;\n });\n let routeCursor = foundRoute || this.routesById[\"__root__\"];\n let matchedRoutes = [routeCursor];\n let isGlobalNotFound = false;\n if (\n // If we found a route, and it's not an index route and we have left over path\n foundRoute ? foundRoute.path !== \"/\" && routeParams[\"**\"] : (\n // Or if we didn't find a route and we have left over path\n trimPathRight(pathname)\n )\n ) {\n if (this.options.notFoundRoute) {\n matchedRoutes.push(this.options.notFoundRoute);\n } else {\n isGlobalNotFound = true;\n }\n }\n while (routeCursor == null ? void 0 : routeCursor.parentRoute) {\n routeCursor = routeCursor.parentRoute;\n if (routeCursor)\n matchedRoutes.unshift(routeCursor);\n }\n const parseErrors = matchedRoutes.map((route) => {\n let parsedParamsError;\n if (route.options.parseParams) {\n try {\n const parsedParams = route.options.parseParams(routeParams);\n Object.assign(routeParams, parsedParams);\n } catch (err) {\n parsedParamsError = new PathParamError(err.message, {\n cause: err\n });\n if (opts == null ? void 0 : opts.throwOnError) {\n throw parsedParamsError;\n }\n return parsedParamsError;\n }\n }\n return;\n });\n const matches = [];\n matchedRoutes.forEach((route, index) => {\n var _a, _b, _c, _d, _e, _f;\n const parentMatch = matches[index - 1];\n const [preMatchSearch, searchError] = (() => {\n const parentSearch = (parentMatch == null ? void 0 : parentMatch.search) ?? locationSearch;\n try {\n const validator = typeof route.options.validateSearch === \"object\" ? route.options.validateSearch.parse : route.options.validateSearch;\n let search = (validator == null ? void 0 : validator(parentSearch)) ?? {};\n return [\n {\n ...parentSearch,\n ...search\n },\n void 0\n ];\n } catch (err) {\n const searchError2 = new SearchParamError(err.message, {\n cause: err\n });\n if (opts == null ? void 0 : opts.throwOnError) {\n throw searchError2;\n }\n return [parentSearch, searchError2];\n }\n })();\n const loaderDeps = ((_b = (_a = route.options).loaderDeps) == null ? void 0 : _b.call(_a, {\n search: preMatchSearch\n })) ?? \"\";\n const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : \"\";\n const interpolatedPath = interpolatePath({\n path: route.fullPath,\n params: routeParams\n });\n const matchId = interpolatePath({\n path: route.id,\n params: routeParams,\n leaveWildcards: true\n }) + loaderDepsHash;\n const existingMatch = getRouteMatch(this.state, matchId);\n const cause = this.state.matches.find((d) => d.id === matchId) ? \"stay\" : \"enter\";\n const match = existingMatch ? {\n ...existingMatch,\n cause,\n notFoundError: isGlobalNotFound && route.id === rootRouteId ? { global: true } : void 0,\n params: routeParams\n } : {\n id: matchId,\n routeId: route.id,\n params: routeParams,\n pathname: joinPaths([this.basepath, interpolatedPath]),\n updatedAt: Date.now(),\n search: {},\n searchError: void 0,\n status: \"pending\",\n showPending: false,\n isFetching: false,\n error: void 0,\n paramsError: parseErrors[index],\n loadPromise: Promise.resolve(),\n routeContext: void 0,\n context: void 0,\n abortController: new AbortController(),\n fetchCount: 0,\n cause,\n loaderDeps,\n invalid: false,\n preload: false,\n notFoundError: isGlobalNotFound && route.id === rootRouteId ? { global: true } : void 0,\n links: (_d = (_c = route.options).links) == null ? void 0 : _d.call(_c),\n scripts: (_f = (_e = route.options).scripts) == null ? void 0 : _f.call(_e),\n staticData: route.options.staticData || {}\n };\n match.search = replaceEqualDeep(match.search, preMatchSearch);\n match.searchError = searchError;\n matches.push(match);\n });\n return matches;\n };\n this.cancelMatch = (id) => {\n var _a, _b;\n (_b = (_a = getRouteMatch(this.state, id)) == null ? void 0 : _a.abortController) == null ? void 0 : _b.abort();\n };\n this.cancelMatches = () => {\n var _a;\n (_a = this.state.pendingMatches) == null ? void 0 : _a.forEach((match) => {\n this.cancelMatch(match.id);\n });\n };\n this.buildLocation = (opts) => {\n const build = (dest = {}, matches) => {\n var _a, _b;\n const relevantMatches = this.state.pendingMatches || this.state.matches;\n const fromSearch = ((_a = relevantMatches[relevantMatches.length - 1]) == null ? void 0 : _a.search) || this.latestLocation.search;\n let pathname = this.resolvePathWithBase(\n dest.from ?? this.latestLocation.pathname,\n `${dest.to ?? \"\"}`\n );\n const fromMatches = this.matchRoutes(\n this.latestLocation.pathname,\n fromSearch\n );\n const stayingMatches = matches == null ? void 0 : matches.filter(\n (d) => fromMatches == null ? void 0 : fromMatches.find((e) => e.routeId === d.routeId)\n );\n const prevParams = { ...(_b = last(fromMatches)) == null ? void 0 : _b.params };\n let nextParams = (dest.params ?? true) === true ? prevParams : functionalUpdate(dest.params, prevParams);\n if (nextParams) {\n matches == null ? void 0 : matches.map((d) => this.looseRoutesById[d.routeId].options.stringifyParams).filter(Boolean).forEach((fn) => {\n nextParams = { ...nextParams, ...fn(nextParams) };\n });\n }\n pathname = interpolatePath({\n path: pathname,\n params: nextParams ?? {},\n leaveWildcards: false,\n leaveParams: opts.leaveParams\n });\n const preSearchFilters = (stayingMatches == null ? void 0 : stayingMatches.map(\n (match) => this.looseRoutesById[match.routeId].options.preSearchFilters ?? []\n ).flat().filter(Boolean)) ?? [];\n const postSearchFilters = (stayingMatches == null ? void 0 : stayingMatches.map(\n (match) => this.looseRoutesById[match.routeId].options.postSearchFilters ?? []\n ).flat().filter(Boolean)) ?? [];\n const preFilteredSearch = (preSearchFilters == null ? void 0 : preSearchFilters.length) ? preSearchFilters == null ? void 0 : preSearchFilters.reduce(\n (prev, next) => next(prev),\n fromSearch\n ) : fromSearch;\n const destSearch = dest.search === true ? preFilteredSearch : dest.search ? functionalUpdate(dest.search, preFilteredSearch) ?? {} : (preSearchFilters == null ? void 0 : preSearchFilters.length) ? preFilteredSearch : {};\n const postFilteredSearch = (postSearchFilters == null ? void 0 : postSearchFilters.length) ? postSearchFilters.reduce((prev, next) => next(prev), destSearch) : destSearch;\n const search = replaceEqualDeep(fromSearch, postFilteredSearch);\n const searchStr = this.options.stringifySearch(search);\n const hash = dest.hash === true ? this.latestLocation.hash : dest.hash ? functionalUpdate(dest.hash, this.latestLocation.hash) : void 0;\n const hashStr = hash ? `#${hash}` : \"\";\n let nextState = dest.state === true ? this.latestLocation.state : dest.state ? functionalUpdate(dest.state, this.latestLocation.state) : {};\n nextState = replaceEqualDeep(this.latestLocation.state, nextState);\n return {\n pathname,\n search,\n searchStr,\n state: nextState,\n hash: hash ?? \"\",\n href: `${pathname}${searchStr}${hashStr}`,\n unmaskOnReload: dest.unmaskOnReload\n };\n };\n const buildWithMatches = (dest = {}, maskedDest) => {\n var _a;\n let next = build(dest);\n let maskedNext = maskedDest ? build(maskedDest) : void 0;\n if (!maskedNext) {\n let params = {};\n let foundMask = (_a = this.options.routeMasks) == null ? void 0 : _a.find((d) => {\n const match = matchPathname(this.basepath, next.pathname, {\n to: d.from,\n caseSensitive: false,\n fuzzy: false\n });\n if (match) {\n params = match;\n return true;\n }\n return false;\n });\n if (foundMask) {\n maskedDest = {\n ...pick(opts, [\"from\"]),\n ...foundMask,\n params\n };\n maskedNext = build(maskedDest);\n }\n }\n const nextMatches = this.matchRoutes(next.pathname, next.search);\n const maskedMatches = maskedNext ? this.matchRoutes(maskedNext.pathname, maskedNext.search) : void 0;\n const maskedFinal = maskedNext ? build(maskedDest, maskedMatches) : void 0;\n const final = build(dest, nextMatches);\n if (maskedFinal) {\n final.maskedLocation = maskedFinal;\n }\n return final;\n };\n if (opts.mask) {\n return buildWithMatches(opts, {\n ...pick(opts, [\"from\"]),\n ...opts.mask\n });\n }\n return buildWithMatches(opts);\n };\n this.commitLocation = async ({\n startTransition,\n ...next\n }) => {\n if (this.navigateTimeout)\n clearTimeout(this.navigateTimeout);\n const isSameUrl = this.latestLocation.href === next.href;\n if (!isSameUrl || !next.replace) {\n let { maskedLocation, ...nextHistory } = next;\n if (maskedLocation) {\n nextHistory = {\n ...maskedLocation,\n state: {\n ...maskedLocation.state,\n __tempKey: void 0,\n __tempLocation: {\n ...nextHistory,\n search: nextHistory.searchStr,\n state: {\n ...nextHistory.state,\n __tempKey: void 0,\n __tempLocation: void 0,\n key: void 0\n }\n }\n }\n };\n if (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) {\n nextHistory.state.__tempKey = this.tempLocationKey;\n }\n }\n const apply = () => {\n this.history[next.replace ? \"replace\" : \"push\"](\n nextHistory.href,\n nextHistory.state\n );\n };\n if (startTransition ?? true) {\n this.startReactTransition(apply);\n } else {\n apply();\n }\n }\n this.resetNextScroll = next.resetScroll ?? true;\n return this.latestLoadPromise;\n };\n this.buildAndCommitLocation = ({\n replace,\n resetScroll,\n startTransition,\n ...rest\n } = {}) => {\n const location = this.buildLocation(rest);\n return this.commitLocation({\n ...location,\n startTransition,\n replace,\n resetScroll\n });\n };\n this.navigate = ({ from, to, ...rest }) => {\n const toString = String(to);\n let isExternal;\n try {\n new URL(`${toString}`);\n isExternal = true;\n } catch (e) {\n }\n invariant(\n !isExternal,\n \"Attempting to navigate to external url with this.navigate!\"\n );\n return this.buildAndCommitLocation({\n ...rest,\n from,\n to\n // to: toString,\n });\n };\n this.loadMatches = async ({\n checkLatest,\n matches,\n preload\n }) => {\n var _a, _b;\n let latestPromise;\n let firstBadMatchIndex;\n const updateMatch = (match) => {\n var _a2;\n const isPending = (_a2 = this.state.pendingMatches) == null ? void 0 : _a2.find(\n (d) => d.id === match.id\n );\n const isMatched = this.state.matches.find((d) => d.id === match.id);\n const matchesKey = isPending ? \"pendingMatches\" : isMatched ? \"matches\" : \"cachedMatches\";\n this.__store.setState((s) => {\n var _a3;\n return {\n ...s,\n [matchesKey]: (_a3 = s[matchesKey]) == null ? void 0 : _a3.map(\n (d) => d.id === match.id ? match : d\n )\n };\n });\n };\n try {\n for (let [index, match] of matches.entries()) {\n const parentMatch = matches[index - 1];\n const route = this.looseRoutesById[match.routeId];\n const abortController = new AbortController();\n const handleErrorAndRedirect = (err, code) => {\n var _a2, _b2;\n err.routerCode = code;\n firstBadMatchIndex = firstBadMatchIndex ?? index;\n if (isRedirect(err)) {\n throw err;\n }\n if (isNotFound(err)) {\n this.updateMatchesWithNotFound(matches, match, err);\n }\n try {\n (_b2 = (_a2 = route.options).onError) == null ? void 0 : _b2.call(_a2, err);\n } catch (errorHandlerErr) {\n err = errorHandlerErr;\n if (isRedirect(errorHandlerErr)) {\n throw errorHandlerErr;\n }\n }\n matches[index] = match = {\n ...match,\n error: err,\n status: \"error\",\n updatedAt: Date.now(),\n abortController: new AbortController()\n };\n };\n try {\n if (match.paramsError) {\n handleErrorAndRedirect(match.paramsError, \"PARSE_PARAMS\");\n }\n if (match.searchError) {\n handleErrorAndRedirect(match.searchError, \"VALIDATE_SEARCH\");\n }\n const parentContext = (parentMatch == null ? void 0 : parentMatch.context) ?? this.options.context ?? {};\n const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;\n const pendingPromise = typeof pendingMs === \"number\" && pendingMs <= 0 ? Promise.resolve() : new Promise((r) => setTimeout(r, pendingMs));\n const beforeLoadContext = await ((_b = (_a = route.options).beforeLoad) == null ? void 0 : _b.call(_a, {\n search: match.search,\n abortController,\n params: match.params,\n preload: !!preload,\n context: parentContext,\n location: this.state.location,\n // TOOD: just expose state and router, etc\n navigate: (opts) => this.navigate({ ...opts, from: match.pathname }),\n buildLocation: this.buildLocation,\n cause: preload ? \"preload\" : match.cause\n })) ?? {};\n if (isRedirect(beforeLoadContext)) {\n throw beforeLoadContext;\n }\n const context = {\n ...parentContext,\n ...beforeLoadContext\n };\n matches[index] = match = {\n ...match,\n routeContext: replaceEqualDeep(\n match.routeContext,\n beforeLoadContext\n ),\n context: replaceEqualDeep(match.context, context),\n abortController,\n pendingPromise\n };\n } catch (err) {\n handleErrorAndRedirect(err, \"BEFORE_LOAD\");\n break;\n }\n }\n } catch (err) {\n if (isRedirect(err)) {\n if (!preload)\n this.navigate(err);\n return matches;\n }\n throw err;\n }\n const validResolvedMatches = matches.slice(0, firstBadMatchIndex);\n const matchPromises = [];\n validResolvedMatches.forEach((match, index) => {\n matchPromises.push(\n new Promise(async (resolve) => {\n var _a2;\n const parentMatchPromise = matchPromises[index - 1];\n const route = this.looseRoutesById[match.routeId];\n const handleErrorAndRedirect = (err) => {\n if (isRedirect(err)) {\n if (!preload) {\n this.navigate(err);\n }\n return true;\n }\n if (isNotFound(err)) {\n if (!preload) {\n this.updateMatchesWithNotFound(matches, match, err);\n }\n return true;\n }\n return false;\n };\n let loadPromise;\n matches[index] = match = {\n ...match,\n showPending: false\n };\n let didShowPending = false;\n const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs;\n const pendingMinMs = route.options.pendingMinMs ?? this.options.defaultPendingMinMs;\n const shouldPending = !preload && typeof pendingMs === \"number\" && (route.options.pendingComponent ?? this.options.defaultPendingComponent);\n const loaderContext = {\n params: match.params,\n deps: match.loaderDeps,\n preload: !!preload,\n parentMatchPromise,\n abortController: match.abortController,\n context: match.context,\n location: this.state.location,\n navigate: (opts) => this.navigate({ ...opts, from: match.pathname }),\n cause: preload ? \"preload\" : match.cause\n };\n const fetch = async () => {\n var _a3, _b2, _c, _d, _e, _f, _g, _h;\n if (match.isFetching) {\n loadPromise = (_a3 = getRouteMatch(this.state, match.id)) == null ? void 0 : _a3.loadPromise;\n } else {\n if (match.fetchCount && match.status === \"success\") {\n resolve();\n }\n matches[index] = match = {\n ...match,\n isFetching: true,\n fetchCount: match.fetchCount + 1\n };\n const lazyPromise = ((_b2 = route.lazyFn) == null ? void 0 : _b2.call(route).then((lazyRoute) => {\n Object.assign(route.options, lazyRoute.options);\n })) || Promise.resolve();\n const componentsPromise = lazyPromise.then(\n () => Promise.all(\n componentTypes.map(async (type) => {\n const component = route.options[type];\n if (component == null ? void 0 : component.preload) {\n await component.preload();\n }\n })\n )\n );\n async function loader() {\n var _a4, _b3;\n return await ((_b3 = (_a4 = route.options).loader) == null ? void 0 : _b3.call(_a4, loaderContext));\n }\n const loaderPromise = loader();\n loadPromise = Promise.all([\n componentsPromise,\n loaderPromise,\n lazyPromise\n ]).then((d) => d[1]);\n }\n matches[index] = match = {\n ...match,\n loadPromise\n };\n updateMatch(match);\n try {\n const loaderData = await loadPromise;\n if (latestPromise = checkLatest())\n return await latestPromise;\n if (isRedirect(loaderData) || isNotFound(loaderData)) {\n if (handleErrorAndRedirect(loaderData))\n return;\n }\n if (didShowPending && pendingMinMs) {\n await new Promise((r) => setTimeout(r, pendingMinMs));\n }\n if (latestPromise = checkLatest())\n return await latestPromise;\n const [meta, headers] = await Promise.all([\n (_d = (_c = route.options).meta) == null ? void 0 : _d.call(_c, {\n loaderData\n }),\n (_f = (_e = route.options).headers) == null ? void 0 : _f.call(_e, {\n loaderData\n })\n ]);\n matches[index] = match = {\n ...match,\n error: void 0,\n status: \"success\",\n isFetching: false,\n updatedAt: Date.now(),\n loaderData,\n loadPromise: void 0,\n meta,\n headers\n };\n } catch (error) {\n if (latestPromise = checkLatest())\n return await latestPromise;\n if (handleErrorAndRedirect(error))\n return;\n try {\n (_h = (_g = route.options).onError) == null ? void 0 : _h.call(_g, error);\n } catch (onErrorError) {\n error = onErrorError;\n if (handleErrorAndRedirect(onErrorError))\n return;\n }\n matches[index] = match = {\n ...match,\n error,\n status: \"error\",\n isFetching: false\n };\n }\n updateMatch(match);\n };\n const age = Date.now() - match.updatedAt;\n let staleAge = preload ? route.options.preloadStaleTime ?? this.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? this.options.defaultStaleTime ?? 0;\n let shouldReload;\n const shouldReloadOption = route.options.shouldReload;\n shouldReload = typeof shouldReloadOption === \"function\" ? shouldReloadOption(loaderContext) : shouldReloadOption;\n matches[index] = match = {\n ...match,\n preload: !!preload && !this.state.matches.find((d) => d.id === match.id)\n };\n if (match.status !== \"success\") {\n if (shouldPending) {\n (_a2 = match.pendingPromise) == null ? void 0 : _a2.then(async () => {\n if (latestPromise = checkLatest())\n return latestPromise;\n didShowPending = true;\n matches[index] = match = {\n ...match,\n showPending: true\n };\n updateMatch(match);\n resolve();\n });\n }\n await fetch();\n } else if (match.invalid || (shouldReload ?? age > staleAge)) {\n fetch();\n }\n resolve();\n })\n );\n });\n await Promise.all(matchPromises);\n return matches;\n };\n this.invalidate = () => {\n const invalidate = (d) => ({\n ...d,\n invalid: true\n });\n this.__store.setState((s) => {\n var _a;\n return {\n ...s,\n matches: s.matches.map(invalidate),\n cachedMatches: s.cachedMatches.map(invalidate),\n pendingMatches: (_a = s.pendingMatches) == null ? void 0 : _a.map(invalidate)\n };\n });\n this.load();\n };\n this.load = async () => {\n const promise = new Promise(async (resolve, reject) => {\n const next = this.latestLocation;\n const prevLocation = this.state.resolvedLocation;\n const pathDidChange = prevLocation.href !== next.href;\n let latestPromise;\n this.cancelMatches();\n this.emit({\n type: \"onBeforeLoad\",\n fromLocation: prevLocation,\n toLocation: next,\n pathChanged: pathDidChange\n });\n let pendingMatches;\n const previousMatches = this.state.matches;\n this.__store.batch(() => {\n this.cleanCache();\n pendingMatches = this.matchRoutes(next.pathname, next.search, {\n debug: true\n });\n this.__store.setState((s) => ({\n ...s,\n isLoading: true,\n location: next,\n pendingMatches,\n cachedMatches: s.cachedMatches.filter((d) => {\n return !pendingMatches.find((e) => e.id === d.id);\n })\n }));\n });\n try {\n try {\n await this.loadMatches({\n matches: pendingMatches,\n checkLatest: () => this.checkLatest(promise)\n });\n } catch (err) {\n }\n if (latestPromise = this.checkLatest(promise)) {\n return latestPromise;\n }\n const exitingMatches = previousMatches.filter(\n (match) => !pendingMatches.find((d) => d.id === match.id)\n );\n const enteringMatches = pendingMatches.filter(\n (match) => !previousMatches.find((d) => d.id === match.id)\n );\n const stayingMatches = previousMatches.filter(\n (match) => pendingMatches.find((d) => d.id === match.id)\n );\n this.__store.batch(() => {\n this.__store.setState((s) => ({\n ...s,\n isLoading: false,\n matches: s.pendingMatches,\n pendingMatches: void 0,\n cachedMatches: [\n ...s.cachedMatches,\n ...exitingMatches.filter((d) => d.status !== \"error\")\n ]\n }));\n this.cleanCache();\n });\n [\n [exitingMatches, \"onLeave\"],\n [enteringMatches, \"onEnter\"],\n [stayingMatches, \"onStay\"]\n ].forEach(([matches, hook]) => {\n matches.forEach((match) => {\n var _a, _b;\n (_b = (_a = this.looseRoutesById[match.routeId].options)[hook]) == null ? void 0 : _b.call(_a, match);\n });\n });\n this.emit({\n type: \"onLoad\",\n fromLocation: prevLocation,\n toLocation: next,\n pathChanged: pathDidChange\n });\n resolve();\n } catch (err) {\n if (latestPromise = this.checkLatest(promise)) {\n return latestPromise;\n }\n reject(err);\n }\n });\n this.latestLoadPromise = promise;\n return this.latestLoadPromise;\n };\n this.cleanCache = () => {\n this.__store.setState((s) => {\n return {\n ...s,\n cachedMatches: s.cachedMatches.filter((d) => {\n const route = this.looseRoutesById[d.routeId];\n if (!route.options.loader) {\n return false;\n }\n const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3;\n return d.status !== \"error\" && Date.now() - d.updatedAt < gcTime;\n })\n };\n });\n };\n this.preloadRoute = async (navigateOpts = this.state.location) => {\n var _a;\n let next = this.buildLocation(navigateOpts);\n let matches = this.matchRoutes(next.pathname, next.search, {\n throwOnError: true\n });\n const loadedMatchIds = Object.fromEntries(\n (_a = [\n ...this.state.matches,\n ...this.state.pendingMatches ?? [],\n ...this.state.cachedMatches\n ]) == null ? void 0 : _a.map((d) => [d.id, true])\n );\n this.__store.batch(() => {\n matches.forEach((match) => {\n if (!loadedMatchIds[match.id]) {\n this.__store.setState((s) => ({\n ...s,\n cachedMatches: [...s.cachedMatches, match]\n }));\n }\n });\n });\n matches = await this.loadMatches({\n matches,\n preload: true,\n checkLatest: () => void 0\n });\n return matches;\n };\n this.matchRoute = (location, opts) => {\n const matchLocation = {\n ...location,\n to: location.to ? this.resolvePathWithBase(location.from || \"\", location.to) : void 0,\n params: location.params || {},\n leaveParams: true\n };\n const next = this.buildLocation(matchLocation);\n if ((opts == null ? void 0 : opts.pending) && this.state.status !== \"pending\") {\n return false;\n }\n const baseLocation = (opts == null ? void 0 : opts.pending) ? this.latestLocation : this.state.resolvedLocation;\n if (!baseLocation) {\n return false;\n }\n const match = matchPathname(this.basepath, baseLocation.pathname, {\n ...opts,\n to: next.pathname\n });\n if (!match) {\n return false;\n }\n if (location.params) {\n if (!deepEqual(match, location.params, true)) {\n return false;\n }\n }\n if (match && ((opts == null ? void 0 : opts.includeSearch) ?? true)) {\n return deepEqual(baseLocation.search, next.search, true) ? match : false;\n }\n return match;\n };\n this.injectHtml = async (html) => {\n this.injectedHtml.push(html);\n };\n this.registeredDeferredsIds = /* @__PURE__ */ new Map();\n this.registeredDeferreds = /* @__PURE__ */ new WeakMap();\n this.getDeferred = (uid) => {\n const token = this.registeredDeferredsIds.get(uid);\n if (!token) {\n return void 0;\n }\n return this.registeredDeferreds.get(token);\n };\n this.dehydrateData = (key, getData) => {\n warning(\n false,\n `The dehydrateData method is deprecated. Please use the injectHtml method to inject your own data.`\n );\n if (typeof document === \"undefined\") {\n const strKey = typeof key === \"string\" ? key : JSON.stringify(key);\n this.injectHtml(async () => {\n const id = `__TSR_DEHYDRATED__${strKey}`;\n const data = typeof getData === \"function\" ? await getData() : getData;\n return `