@reposkein/mcp 0.2.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +73 -1
  2. package/binary-digests.json +4 -4
  3. package/dist/SKILL.md +63 -1
  4. package/dist/cli/adr.d.ts +37 -0
  5. package/dist/cli/adr.js +231 -0
  6. package/dist/cli/adr.js.map +1 -0
  7. package/dist/cli/agentAdapters.d.ts +68 -0
  8. package/dist/cli/agentAdapters.js +223 -0
  9. package/dist/cli/agentAdapters.js.map +1 -0
  10. package/dist/cli/ansi.d.ts +24 -0
  11. package/dist/cli/ansi.js +40 -0
  12. package/dist/cli/ansi.js.map +1 -0
  13. package/dist/cli/doctor.d.ts +34 -2
  14. package/dist/cli/doctor.js +53 -5
  15. package/dist/cli/doctor.js.map +1 -1
  16. package/dist/cli/doctorDecisions.d.ts +5 -0
  17. package/dist/cli/doctorDecisions.js +83 -0
  18. package/dist/cli/doctorDecisions.js.map +1 -0
  19. package/dist/cli/doctorFreshness.d.ts +43 -0
  20. package/dist/cli/doctorFreshness.js +111 -0
  21. package/dist/cli/doctorFreshness.js.map +1 -0
  22. package/dist/cli/doctorSummaries.d.ts +2 -0
  23. package/dist/cli/doctorSummaries.js +95 -0
  24. package/dist/cli/doctorSummaries.js.map +1 -0
  25. package/dist/cli/federatedDiscovery.d.ts +16 -0
  26. package/dist/cli/federatedDiscovery.js +75 -0
  27. package/dist/cli/federatedDiscovery.js.map +1 -0
  28. package/dist/cli/init.d.ts +69 -6
  29. package/dist/cli/init.js +194 -28
  30. package/dist/cli/init.js.map +1 -1
  31. package/dist/cli/sourceSlices.d.ts +17 -0
  32. package/dist/cli/sourceSlices.js +59 -0
  33. package/dist/cli/sourceSlices.js.map +1 -0
  34. package/dist/cli/stats.d.ts +29 -0
  35. package/dist/cli/stats.js +180 -0
  36. package/dist/cli/stats.js.map +1 -0
  37. package/dist/cli/view.d.ts +71 -3
  38. package/dist/cli/view.js +147 -12
  39. package/dist/cli/view.js.map +1 -1
  40. package/dist/guard/decisionValidation.d.ts +29 -0
  41. package/dist/guard/decisionValidation.js +51 -0
  42. package/dist/guard/decisionValidation.js.map +1 -0
  43. package/dist/guard/summaryValidation.d.ts +3 -0
  44. package/dist/guard/summaryValidation.js +5 -3
  45. package/dist/guard/summaryValidation.js.map +1 -1
  46. package/dist/index.d.ts +48 -0
  47. package/dist/index.js +355 -78
  48. package/dist/index.js.map +1 -1
  49. package/dist/indexer/decisionsAffected.d.ts +42 -0
  50. package/dist/indexer/decisionsAffected.js +149 -0
  51. package/dist/indexer/decisionsAffected.js.map +1 -0
  52. package/dist/indexer/fetchBinary.d.ts +14 -0
  53. package/dist/indexer/fetchBinary.js +81 -40
  54. package/dist/indexer/fetchBinary.js.map +1 -1
  55. package/dist/indexer/runIndexer.d.ts +3 -2
  56. package/dist/indexer/runIndexer.js +8 -4
  57. package/dist/indexer/runIndexer.js.map +1 -1
  58. package/dist/profile/decisions.d.ts +37 -0
  59. package/dist/profile/decisions.js +112 -0
  60. package/dist/profile/decisions.js.map +1 -0
  61. package/dist/profile/types.d.ts +8 -0
  62. package/dist/store/GraphStore.d.ts +5 -0
  63. package/dist/store/JsonlGraphStore.d.ts +14 -3
  64. package/dist/store/JsonlGraphStore.js +66 -19
  65. package/dist/store/JsonlGraphStore.js.map +1 -1
  66. package/dist/store/decisions.d.ts +131 -0
  67. package/dist/store/decisions.js +321 -0
  68. package/dist/store/decisions.js.map +1 -0
  69. package/dist/store/indexedAt.d.ts +18 -0
  70. package/dist/store/indexedAt.js +56 -0
  71. package/dist/store/indexedAt.js.map +1 -0
  72. package/dist/store/instrumentTool.d.ts +40 -0
  73. package/dist/store/instrumentTool.js +82 -0
  74. package/dist/store/instrumentTool.js.map +1 -0
  75. package/dist/store/repoContextCache.d.ts +15 -0
  76. package/dist/store/repoContextCache.js +26 -0
  77. package/dist/store/repoContextCache.js.map +1 -0
  78. package/dist/store/repoSession.d.ts +63 -0
  79. package/dist/store/repoSession.js +123 -0
  80. package/dist/store/repoSession.js.map +1 -0
  81. package/dist/store/resolveRepoPath.d.ts +31 -0
  82. package/dist/store/resolveRepoPath.js +85 -0
  83. package/dist/store/resolveRepoPath.js.map +1 -0
  84. package/dist/store/sessionLog.d.ts +98 -0
  85. package/dist/store/sessionLog.js +216 -0
  86. package/dist/store/sessionLog.js.map +1 -0
  87. package/dist/store/sessionStats.d.ts +55 -0
  88. package/dist/store/sessionStats.js +140 -0
  89. package/dist/store/sessionStats.js.map +1 -0
  90. package/dist/store/sidecar.d.ts +39 -3
  91. package/dist/store/sidecar.js +89 -5
  92. package/dist/store/sidecar.js.map +1 -1
  93. package/dist/store/summaryShards.d.ts +117 -0
  94. package/dist/store/summaryShards.js +291 -0
  95. package/dist/store/summaryShards.js.map +1 -0
  96. package/dist/store/teamConfig.d.ts +13 -0
  97. package/dist/store/teamConfig.js +49 -0
  98. package/dist/store/teamConfig.js.map +1 -0
  99. package/dist/tools/getContextProfile.d.ts +1 -1
  100. package/dist/tools/getContextProfile.js +9 -1
  101. package/dist/tools/getContextProfile.js.map +1 -1
  102. package/dist/tools/getDecision.d.ts +6 -0
  103. package/dist/tools/getDecision.js +59 -0
  104. package/dist/tools/getDecision.js.map +1 -0
  105. package/dist/tools/impact.d.ts +1 -1
  106. package/dist/tools/impact.js +13 -1
  107. package/dist/tools/impact.js.map +1 -1
  108. package/dist/tools/indexerTools.d.ts +16 -2
  109. package/dist/tools/indexerTools.js +44 -5
  110. package/dist/tools/indexerTools.js.map +1 -1
  111. package/dist/tools/listDecisions.d.ts +19 -0
  112. package/dist/tools/listDecisions.js +93 -0
  113. package/dist/tools/listDecisions.js.map +1 -0
  114. package/dist/tools/reaffirmDecision.d.ts +11 -0
  115. package/dist/tools/reaffirmDecision.js +55 -0
  116. package/dist/tools/reaffirmDecision.js.map +1 -0
  117. package/dist/tools/recordDecision.d.ts +24 -0
  118. package/dist/tools/recordDecision.js +135 -0
  119. package/dist/tools/recordDecision.js.map +1 -0
  120. package/dist/tools/semanticFind.d.ts +9 -2
  121. package/dist/tools/semanticFind.js +44 -2
  122. package/dist/tools/semanticFind.js.map +1 -1
  123. package/dist/tools/setDecisionStatus.d.ts +8 -0
  124. package/dist/tools/setDecisionStatus.js +34 -0
  125. package/dist/tools/setDecisionStatus.js.map +1 -0
  126. package/dist/viz/assets/{graph.worker-CC7BeE-8.js → graph.worker-DkH6-lMU.js} +1 -1
  127. package/dist/viz/assets/index-CxqeGuRS.css +1 -0
  128. package/dist/viz/assets/index-DiNZyrXx.js +9 -0
  129. package/dist/viz/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  130. package/dist/viz/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  131. package/dist/viz/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2 +0 -0
  132. package/dist/viz/assets/r3f-BZY3QR6_.js +336 -0
  133. package/dist/viz/assets/tanstack-CjXr-L-s.js +62 -0
  134. package/dist/viz/assets/three-Cpu5RUEM.js +4116 -0
  135. package/dist/viz/index.html +5 -4
  136. package/package.json +5 -4
  137. package/dist/viz/assets/index-C_8UkiJ8.js +0 -9
  138. package/dist/viz/assets/r3f-Cku1OhB-.js +0 -277
  139. package/dist/viz/assets/tanstack-DyXcNRWk.js +0 -77
  140. package/dist/viz/assets/three-Z8XaLGmf.js +0 -3839
@@ -0,0 +1,62 @@
1
+ function mo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mt={exports:{}},ke={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var In;function pr(){if(In)return ke;In=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(o,r,s){var i=null;if(s!==void 0&&(i=""+s),r.key!==void 0&&(i=""+r.key),"key"in r){s={};for(var l in r)l!=="key"&&(s[l]=r[l])}else s=r;return r=s.ref,{$$typeof:e,type:o,key:i,ref:r!==void 0?r:null,props:s}}return ke.Fragment=n,ke.jsx=t,ke.jsxs=t,ke}var Ln;function mr(){return Ln||(Ln=1,Mt.exports=pr()),Mt.exports}var E=mr(),It={exports:{}},$={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var En;function vr(){if(En)return $;En=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),h=Symbol.iterator;function f(m){return m===null||typeof m!="object"?null:(m=h&&m[h]||m["@@iterator"],typeof m=="function"?m:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,v={};function y(m,_,b){this.props=m,this.context=_,this.refs=v,this.updater=b||g}y.prototype.isReactComponent={},y.prototype.setState=function(m,_){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,_,"setState")},y.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function S(){}S.prototype=y.prototype;function w(m,_,b){this.props=m,this.context=_,this.refs=v,this.updater=b||g}var C=w.prototype=new S;C.constructor=w,p(C,y.prototype),C.isPureReactComponent=!0;var P=Array.isArray;function M(){}var R={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function I(m,_,b){var F=b.ref;return{$$typeof:e,type:m,key:_,ref:F!==void 0?F:null,props:b}}function k(m,_){return I(m.type,_,m.props)}function A(m){return typeof m=="object"&&m!==null&&m.$$typeof===e}function V(m){var _={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(b){return _[b]})}var Z=/\/+/g;function z(m,_){return typeof m=="object"&&m!==null&&m.key!=null?V(""+m.key):_.toString(36)}function oe(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(M,M):(m.status="pending",m.then(function(_){m.status==="pending"&&(m.status="fulfilled",m.value=_)},function(_){m.status==="pending"&&(m.status="rejected",m.reason=_)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function re(m,_,b,F,D){var j=typeof m;(j==="undefined"||j==="boolean")&&(m=null);var H=!1;if(m===null)H=!0;else switch(j){case"bigint":case"string":case"number":H=!0;break;case"object":switch(m.$$typeof){case e:case n:H=!0;break;case c:return H=m._init,re(H(m._payload),_,b,F,D)}}if(H)return D=D(m),H=F===""?"."+z(m,0):F,P(D)?(b="",H!=null&&(b=H.replace(Z,"$&/")+"/"),re(D,_,b,"",function($e){return $e})):D!=null&&(A(D)&&(D=k(D,b+(D.key==null||m&&m.key===D.key?"":(""+D.key).replace(Z,"$&/")+"/")+H)),_.push(D)),1;H=0;var q=F===""?".":F+":";if(P(m))for(var N=0;N<m.length;N++)F=m[N],j=q+z(F,N),H+=re(F,_,b,j,D);else if(N=f(m),typeof N=="function")for(m=N.call(m),N=0;!(F=m.next()).done;)F=F.value,j=q+z(F,N++),H+=re(F,_,b,j,D);else if(j==="object"){if(typeof m.then=="function")return re(oe(m),_,b,F,D);throw _=String(m),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return H}function U(m,_,b){if(m==null)return m;var F=[],D=0;return re(m,F,"","",function(j){return _.call(b,j,D++)}),F}function ve(m){if(m._status===-1){var _=m._result;_=_(),_.then(function(b){(m._status===0||m._status===-1)&&(m._status=1,m._result=b)},function(b){(m._status===0||m._status===-1)&&(m._status=2,m._result=b)}),m._status===-1&&(m._status=0,m._result=_)}if(m._status===1)return m._result.default;throw m._result}var De=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},Je={map:U,forEach:function(m,_,b){U(m,function(){_.apply(this,arguments)},b)},count:function(m){var _=0;return U(m,function(){_++}),_},toArray:function(m){return U(m,function(_){return _})||[]},only:function(m){if(!A(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return $.Activity=d,$.Children=Je,$.Component=y,$.Fragment=t,$.Profiler=r,$.PureComponent=w,$.StrictMode=o,$.Suspense=a,$.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,$.__COMPILER_RUNTIME={__proto__:null,c:function(m){return R.H.useMemoCache(m)}},$.cache=function(m){return function(){return m.apply(null,arguments)}},$.cacheSignal=function(){return null},$.cloneElement=function(m,_,b){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var F=p({},m.props),D=m.key;if(_!=null)for(j in _.key!==void 0&&(D=""+_.key),_)!x.call(_,j)||j==="key"||j==="__self"||j==="__source"||j==="ref"&&_.ref===void 0||(F[j]=_[j]);var j=arguments.length-2;if(j===1)F.children=b;else if(1<j){for(var H=Array(j),q=0;q<j;q++)H[q]=arguments[q+2];F.children=H}return I(m.type,D,F)},$.createContext=function(m){return m={$$typeof:i,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:s,_context:m},m},$.createElement=function(m,_,b){var F,D={},j=null;if(_!=null)for(F in _.key!==void 0&&(j=""+_.key),_)x.call(_,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(D[F]=_[F]);var H=arguments.length-2;if(H===1)D.children=b;else if(1<H){for(var q=Array(H),N=0;N<H;N++)q[N]=arguments[N+2];D.children=q}if(m&&m.defaultProps)for(F in H=m.defaultProps,H)D[F]===void 0&&(D[F]=H[F]);return I(m,j,D)},$.createRef=function(){return{current:null}},$.forwardRef=function(m){return{$$typeof:l,render:m}},$.isValidElement=A,$.lazy=function(m){return{$$typeof:c,_payload:{_status:-1,_result:m},_init:ve}},$.memo=function(m,_){return{$$typeof:u,type:m,compare:_===void 0?null:_}},$.startTransition=function(m){var _=R.T,b={};R.T=b;try{var F=m(),D=R.S;D!==null&&D(b,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(M,De)}catch(j){De(j)}finally{_!==null&&b.types!==null&&(_.types=b.types),R.T=_}},$.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},$.use=function(m){return R.H.use(m)},$.useActionState=function(m,_,b){return R.H.useActionState(m,_,b)},$.useCallback=function(m,_){return R.H.useCallback(m,_)},$.useContext=function(m){return R.H.useContext(m)},$.useDebugValue=function(){},$.useDeferredValue=function(m,_){return R.H.useDeferredValue(m,_)},$.useEffect=function(m,_){return R.H.useEffect(m,_)},$.useEffectEvent=function(m){return R.H.useEffectEvent(m)},$.useId=function(){return R.H.useId()},$.useImperativeHandle=function(m,_,b){return R.H.useImperativeHandle(m,_,b)},$.useInsertionEffect=function(m,_){return R.H.useInsertionEffect(m,_)},$.useLayoutEffect=function(m,_){return R.H.useLayoutEffect(m,_)},$.useMemo=function(m,_){return R.H.useMemo(m,_)},$.useOptimistic=function(m,_){return R.H.useOptimistic(m,_)},$.useReducer=function(m,_,b){return R.H.useReducer(m,_,b)},$.useRef=function(m){return R.H.useRef(m)},$.useState=function(m){return R.H.useState(m)},$.useSyncExternalStore=function(m,_,b){return R.H.useSyncExternalStore(m,_,b)},$.useTransition=function(){return R.H.useTransition()},$.version="19.2.8",$}var Fn;function St(){return Fn||(Fn=1,It.exports=vr()),It.exports}var L=St();const ze=mo(L);var Lt={exports:{}},K={};/**
18
+ * @license React
19
+ * react-dom.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var bn;function yr(){if(bn)return K;bn=1;var e=St();function n(a){var u="https://react.dev/errors/"+a;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)u+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var o={d:{f:t,r:function(){throw Error(n(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(a,u,c){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:d==null?null:""+d,children:a,containerInfo:u,implementation:c}}var i=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(a,u){if(a==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return K.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,K.createPortal=function(a,u){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(n(299));return s(a,u,null,c)},K.flushSync=function(a){var u=i.T,c=o.p;try{if(i.T=null,o.p=2,a)return a()}finally{i.T=u,o.p=c,o.d.f()}},K.preconnect=function(a,u){typeof a=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,o.d.C(a,u))},K.prefetchDNS=function(a){typeof a=="string"&&o.d.D(a)},K.preinit=function(a,u){if(typeof a=="string"&&u&&typeof u.as=="string"){var c=u.as,d=l(c,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,f=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;c==="style"?o.d.S(a,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:d,integrity:h,fetchPriority:f}):c==="script"&&o.d.X(a,{crossOrigin:d,integrity:h,fetchPriority:f,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},K.preinitModule=function(a,u){if(typeof a=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var c=l(u.as,u.crossOrigin);o.d.M(a,{crossOrigin:c,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&o.d.M(a)},K.preload=function(a,u){if(typeof a=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var c=u.as,d=l(c,u.crossOrigin);o.d.L(a,c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},K.preloadModule=function(a,u){if(typeof a=="string")if(u){var c=l(u.as,u.crossOrigin);o.d.m(a,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:c,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else o.d.m(a)},K.requestFormReset=function(a){o.d.r(a)},K.unstable_batchedUpdates=function(a,u){return a(u)},K.useFormState=function(a,u,c){return i.H.useFormState(a,u,c)},K.useFormStatus=function(){return i.H.useHostTransitionStatus()},K.version="19.2.8",K}var Tn;function Sr(){if(Tn)return Lt.exports;Tn=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Lt.exports=yr(),Lt.exports}var Rt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Rr=class extends Rt{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},vo=new Rr,wr={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},Cr=class{#e=wr;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},Wt=new Cr;function _r(e){setTimeout(e,0)}var Pr=typeof window>"u"||"Deno"in globalThis;function se(){}function xr(e,n){return typeof e=="function"?e(n):e}function Mr(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ir(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Qt(e,n){return typeof e=="function"?e(n):e}function Lr(e,n){return typeof e=="function"?e(n):e}function On(e,n){const{type:t="all",exact:o,fetchStatus:r,predicate:s,queryKey:i,stale:l}=e;if(i){if(o){if(n.queryHash!==dn(i,n.options))return!1}else if(!qe(n.queryKey,i))return!1}if(t!=="all"){const a=n.isActive();if(t==="active"&&!a||t==="inactive"&&a)return!1}return!(typeof l=="boolean"&&n.isStale()!==l||r&&r!==n.state.fetchStatus||s&&!s(n))}function An(e,n){const{exact:t,status:o,predicate:r,mutationKey:s}=e;if(s){if(!n.options.mutationKey)return!1;if(t){if(Ue(n.options.mutationKey)!==Ue(s))return!1}else if(!qe(n.options.mutationKey,s))return!1}return!(o&&n.state.status!==o||r&&!r(n))}function dn(e,n){return(n?.queryKeyHashFn||Ue)(e)}function Ue(e){return JSON.stringify(e,(n,t)=>Yt(t)?Object.keys(t).sort().reduce((o,r)=>(o[r]=t[r],o),{}):t)}function qe(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(t=>qe(e[t],n[t])):!1}var Er=Object.prototype.hasOwnProperty;function yo(e,n,t=0){if(e===n)return e;if(t>500)return n;const o=Dn(e)&&Dn(n);if(!o&&!(Yt(e)&&Yt(n)))return n;const s=(o?e:Object.keys(e)).length,i=o?n:Object.keys(n),l=i.length,a=o?new Array(l):{};let u=0;for(let c=0;c<l;c++){const d=o?c:i[c],h=e[d],f=n[d];if(h===f){a[d]=h,(o?c<s:Er.call(e,d))&&u++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){a[d]=f;continue}const g=yo(h,f,t+1);a[d]=g,g===h&&u++}return s===l&&u===s?e:a}function Dn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yt(e){if(!$n(e))return!1;const n=e.constructor;if(n===void 0)return!0;const t=n.prototype;return!(!$n(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $n(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fr(e){return new Promise(n=>{Wt.setTimeout(n,e)})}function br(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?yo(e,n):n}function Tr(e,n,t=0){const o=[...e,n];return t&&o.length>t?o.slice(1):o}function Or(e,n,t=0){const o=[n,...e];return t&&o.length>t?o.slice(0,-1):o}var fn=Symbol();function So(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===fn?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ar(e,n,t){let o=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=n(),o||(o=!0,r.aborted?t():r.addEventListener("abort",t,{once:!0})),r)}),e}var Ro=(()=>{let e=()=>Pr;return{isServer(){return e()},setIsServer(n){e=n}}})();function Dr(){let e,n;const t=new Promise((r,s)=>{e=r,n=s});t.status="pending",t.catch(()=>{});function o(r){Object.assign(t,r),delete t.resolve,delete t.reject}return t.resolve=r=>{o({status:"fulfilled",value:r}),e(r)},t.reject=r=>{o({status:"rejected",reason:r}),n(r)},t}var $r=_r;function kr(){let e=[],n=0,t=l=>{l()},o=l=>{l()},r=$r;const s=l=>{n?e.push(l):r(()=>{t(l)})},i=()=>{const l=e;e=[],l.length&&r(()=>{o(()=>{l.forEach(a=>{t(a)})})})};return{batch:l=>{let a;n++;try{a=l()}finally{n--,n||i()}return a},batchCalls:l=>(...a)=>{s(()=>{l(...a)})},schedule:s,setNotifyFunction:l=>{t=l},setBatchNotifyFunction:l=>{o=l},setScheduler:l=>{r=l}}}var Y=kr(),Vr=class extends Rt{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),t=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}},ht=new Vr;function jr(e){return Math.min(1e3*2**e,3e4)}function wo(e){return(e??"online")==="online"?ht.isOnline():!0}var Xt=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Co(e){let n=!1,t=0,o;const r=Dr(),s=()=>r.status!=="pending",i=p=>{if(!s()){const v=new Xt(p);h(v),e.onCancel?.(v)}},l=()=>{n=!0},a=()=>{n=!1},u=()=>vo.isFocused()&&(e.networkMode==="always"||ht.isOnline())&&e.canRun(),c=()=>wo(e.networkMode)&&e.canRun(),d=p=>{s()||(o?.(),r.resolve(p))},h=p=>{s()||(o?.(),r.reject(p))},f=()=>new Promise(p=>{o=v=>{(s()||u())&&p(v)},e.onPause?.()}).then(()=>{o=void 0,s()||e.onContinue?.()}),g=()=>{if(s())return;let p;const v=t===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(d).catch(y=>{if(s())return;const S=e.retry??(Ro.isServer()?0:3),w=e.retryDelay??jr,C=typeof w=="function"?w(t,y):w,P=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,y);if(n||!P){h(y);return}t++,e.onFail?.(t,y),Fr(C).then(()=>u()?void 0:f()).then(()=>{n?h(y):g()})})};return{promise:r,status:()=>r.status,cancel:i,continue:()=>(o?.(),r),cancelRetry:l,continueRetry:a,canStart:c,start:()=>(c()?g():f().then(g),r)}}var _o=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mr(this.gcTime)&&(this.#e=Wt.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ro.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Wt.clearTimeout(this.#e),this.#e=void 0)}};function Hr(e){return{onFetch:(n,t)=>{const o=n.options,r=n.fetchOptions?.meta?.fetchMore?.direction,s=n.state.data?.pages||[],i=n.state.data?.pageParams||[];let l={pages:[],pageParams:[]},a=0;const u=async()=>{let c=!1;const d=g=>{Ar(g,()=>n.signal,()=>c=!0)},h=So(n.options,n.fetchOptions),f=async(g,p,v)=>{if(c)return Promise.reject(n.signal.reason);if(p==null&&g.pages.length)return Promise.resolve(g);const S=(()=>{const M={client:n.client,queryKey:n.queryKey,pageParam:p,direction:v?"backward":"forward",meta:n.options.meta};return d(M),M})(),w=await h(S),{maxPages:C}=n.options,P=v?Or:Tr;return{pages:P(g.pages,w,C),pageParams:P(g.pageParams,p,C)}};if(r&&s.length){const g=r==="backward",p=g?Br:kn,v={pages:s,pageParams:i},y=p(o,v);l=await f(v,y,g)}else{const g=e??s.length;do{const p=a===0?i[0]??o.initialPageParam:kn(o,l);if(a>0&&p==null)break;l=await f(l,p),a++}while(a<g)}return l};n.options.persister?n.fetchFn=()=>n.options.persister?.(u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t):n.fetchFn=u}}}function kn(e,{pages:n,pageParams:t}){const o=n.length-1;return n.length>0?e.getNextPageParam(n[o],n,t[o],t):void 0}function Br(e,{pages:n,pageParams:t}){return n.length>0?e.getPreviousPageParam?.(n[0],n,t[0],t):void 0}var Gr=class extends _o{#e;#t;#n;#r;#s;#o;#u;#i;constructor(e){super(),this.#i=!1,this.#u=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#r=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=jn(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#o?.promise}setOptions(e){if(this.options={...this.#u,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=jn(this.options);n.data!==void 0&&(this.setState(Vn(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,n){const t=br(this.state.data,e,this.options);return this.#a({data:t,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),t}setState(e){this.#a({type:"setState",state:e})}cancel(e){const n=this.#o?.promise;return this.#o?.cancel(e),n?n.then(se).catch(se):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Lr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fn||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Qt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Ir(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#o&&(this.#i||this.#l()?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#o?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(u=>u.options.queryFn);a&&this.setOptions(a.options)}const t=new AbortController,o=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#i=!0,t.signal)})},r=()=>{const a=So(this.options,n),c=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return o(d),d})();return this.#i=!1,this.options.persister?this.options.persister(a,c,this):a(c)},i=(()=>{const a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:r};return o(a),a})();(this.#e==="infinite"?Hr(this.options.pages):this.options.behavior)?.onFetch(i,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#a({type:"fetch",meta:i.fetchOptions?.meta}),this.#o=Co({initialPromise:n?.initialPromise,fn:i.fetchFn,onCancel:a=>{a instanceof Xt&&a.revert&&this.setState({...this.#n,fetchStatus:"idle"}),t.abort()},onFail:(a,u)=>{this.#a({type:"failed",failureCount:a,error:u})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const a=await this.#o.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#r.config.onSuccess?.(a,this),this.#r.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Xt){if(a.silent)return this.#o.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#a({type:"error",error:a}),this.#r.config.onError?.(a,this),this.#r.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#a(e){const n=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...Nr(t.data,this.options),fetchMeta:e.meta??null};case"success":const o={...t,...Vn(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?o:void 0,o;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=n(this.state),Y.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Nr(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wo(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Vn(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jn(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,o=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var zr=class extends _o{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ur(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#s({type:"continue"})},t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Co({fn:()=>this.options.mutationFn?this.options.mutationFn(e,t):Promise.reject(new Error("No mutationFn found")),onFail:(s,i)=>{this.#s({type:"failed",failureCount:s,error:i})},onPause:()=>{this.#s({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",r=!this.#r.canStart();try{if(o)n();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,t);const i=await this.options.onMutate?.(e,t);i!==this.state.context&&this.#s({type:"pending",context:i,variables:e,isPaused:r})}const s=await this.#r.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,t),await this.options.onSuccess?.(s,e,this.state.context,t),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(s,null,e,this.state.context,t),this.#s({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,t)}catch(i){Promise.reject(i)}try{await this.options.onError?.(s,e,this.state.context,t)}catch(i){Promise.reject(i)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,t)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,t)}catch(i){Promise.reject(i)}throw this.#s({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#s(e){const n=t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Y.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Ur(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qr=class extends Rt{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,t){const o=new zr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:t});return this.add(o),o}add(e){this.#e.add(e);const n=tt(e);if(typeof n=="string"){const t=this.#t.get(n);t?t.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=tt(e);if(typeof n=="string"){const t=this.#t.get(n);if(t)if(t.length>1){const o=t.indexOf(e);o!==-1&&t.splice(o,1)}else t[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=tt(e);if(typeof n=="string"){const o=this.#t.get(n)?.find(r=>r.state.status==="pending");return!o||o===e}else return!0}runNext(e){const n=tt(e);return typeof n=="string"?this.#t.get(n)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Y.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(t=>An(n,t))}findAll(e={}){return this.getAll().filter(n=>An(e,n))}notify(e){Y.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Y.batch(()=>Promise.all(e.map(n=>n.continue().catch(se))))}};function tt(e){return e.options.scope?.id}var Kr=class extends Rt{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,t){const o=n.queryKey,r=n.queryHash??dn(o,n);let s=this.get(r);return s||(s=new Gr({client:e,queryKey:o,queryHash:r,options:e.defaultQueryOptions(n),state:t,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Y.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(t=>On(n,t))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(t=>On(e,t)):n}notify(e){Y.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Y.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Y.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},xa=class{#e;#t;#n;#r;#s;#o;#u;#i;constructor(e={}){this.#e=e.queryCache||new Kr,this.#t=e.mutationCache||new qr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#u=vo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=ht.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#u?.(),this.#u=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=this.#e.build(this,n),o=t.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime(Qt(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:t})=>{const o=t.data;return[n,o]})}setQueryData(e,n,t){const o=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(o.queryHash)?.state.data,i=xr(n,s);if(i!==void 0)return this.#e.build(this,o).setData(i,{...t,manual:!0})}setQueriesData(e,n,t){return Y.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,n,t)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Y.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=this.#e;return Y.batch(()=>(t.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const t={revert:!0,...n},o=Y.batch(()=>this.#e.findAll(e).map(r=>r.cancel(t)));return Promise.all(o).then(se).catch(se)}invalidateQueries(e,n={}){return Y.batch(()=>(this.#e.findAll(e).forEach(t=>{t.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},o=Y.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let s=r.fetch(void 0,t);return t.throwOnError||(s=s.catch(se)),r.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(se)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=this.#e.build(this,n);return t.isStaleByTime(Qt(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(se).catch(se)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(se).catch(se)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ht.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#r.set(Ue(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#r.values()],t={};return n.forEach(o=>{qe(e,o.queryKey)&&Object.assign(t,o.defaultOptions)}),t}setMutationDefaults(e,n){this.#s.set(Ue(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#s.values()],t={};return n.forEach(o=>{qe(e,o.mutationKey)&&Object.assign(t,o.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=dn(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===fn&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Wr=L.createContext(void 0),Ma=({client:e,children:n})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(Wr.Provider,{value:e,children:n})),Ge=typeof window<"u"?L.useLayoutEffect:L.useEffect;function Et(e){const n=L.useRef({value:e,prev:null}),t=n.current.value;return e!==t&&(n.current={value:e,prev:t}),n.current.prev}function Qr(e,n,t={},o={}){L.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([s])=>{n(s)},t);return r.observe(e.current),()=>{r.disconnect()}},[n,t,o.disabled,e])}function Yr(e){const n=L.useRef(null);return L.useImperativeHandle(e,()=>n.current,[]),n}const Po=!1;function Ke(e){return e[e.length-1]}function Xr(e){return typeof e=="function"}function we(e,n){return Xr(e)?e(n):e}const xo=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable;function Mo(e){for(const n in e)if(xo.call(e,n))return!0;return!1}const Jr=()=>Object.create(null),Re=(e,n)=>Ce(e,n,Jr);function Ce(e,n,t=()=>({}),o=0){if(e===n)return e;if(o>500)return n;const r=n,s=Nn(e)&&Nn(r);if(!s&&!(gt(e)&&gt(r)))return r;const i=s?e:Bn(e);if(!i)return r;const l=s?r:Bn(r);if(!l)return r;const a=i.length,u=l.length,c=s?new Array(u):t();let d=0;for(let h=0;h<u;h++){const f=s?h:l[h],g=e[f],p=r[f];if(g===p){c[f]=g,(s?h<a:xo.call(e,f))&&d++;continue}if(g===null||p===null||typeof g!="object"||typeof p!="object"){c[f]=p;continue}const v=Ce(g,p,t,o+1);c[f]=v,v===g&&d++}return a===u&&d===a?e:c}function Bn(e){const n=Object.getOwnPropertyNames(e);for(const r of n)if(!Hn.call(e,r))return!1;const t=Object.getOwnPropertySymbols(e);if(t.length===0)return n;const o=n;for(const r of t){if(!Hn.call(e,r))return!1;o.push(r)}return o}function gt(e){if(!Gn(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const t=n.prototype;return!(!Gn(t)||!t.hasOwnProperty("isPrototypeOf"))}function Gn(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pe(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let o=0,r=e.length;o<r;o++)if(!Pe(e[o],n[o],t))return!1;return!0}if(gt(e)&&gt(n)){const o=t?.ignoreUndefined??!0;if(t?.partial){for(const i in n)if((!o||n[i]!==void 0)&&!Pe(e[i],n[i],t))return!1;return!0}let r=0;if(!o)r=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&r++;let s=0;for(const i in n)if((!o||n[i]!==void 0)&&(s++,s>r||!Pe(e[i],n[i],t)))return!1;return r===s}return!1}function Ae(e){let n,t;const o=new Promise((r,s)=>{n=r,t=s});return o.status="pending",o.resolve=r=>{o.status="resolved",o.value=r,n(r),e?.(r)},o.reject=r=>{o.status="rejected",t(r)},o}function We(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Zr(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function zn(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return Zr(n)}const es=["http:","https:","mailto:","tel:"];function pt(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function Ve(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,o="",r;for(;(r=n.exec(e))!==null;)o+=zn(e.slice(t,r.index))+r[0],t=n.lastIndex;o=o+zn(t?e.slice(t):e);let s=!1;return o.startsWith("//")&&(s=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:s}}function ts(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ns(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function ce(){throw new Error("Invariant failed")}function Qe(e){const n=new Map;let t,o;const r=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,o&&(o.next=s,s.prev=o)):(s.next.prev=void 0,t=s.next,s.next=void 0,o&&(s.prev=o,o.next=s)),o=s)};return{get(s){const i=n.get(s);if(i)return r(i),i.value},set(s,i){if(n.size>=e&&t){const a=t;n.delete(a.key),a.next&&(t=a.next,a.next.prev=void 0),a===o&&(o=void 0)}const l=n.get(s);if(l)l.value=i,r(l);else{const a={key:s,value:i,prev:o};o&&(o.next=a),o=a,t||(t=a),n.set(s,a)}},clear(){n.clear(),t=void 0,o=void 0}}}const fe=4,Io=5;function os(e){const n=e.indexOf("{");if(n===-1)return null;const t=e.indexOf("}",n);return t===-1||n+1>=e.length?null:[n,t]}function Lo(e,n,t=new Uint16Array(6)){const o=e.indexOf("/",n),r=o===-1?e.length:o,s=e.substring(n,r);if(!s||!s.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=r,t[4]=r,t[5]=r,t;if(s==="$"){const l=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=l,t[4]=l,t[5]=l,t}if(s.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=r,t[4]=r,t[5]=r,t;const i=os(s);if(i){const[l,a]=i,u=s.charCodeAt(l+1);if(u===45){if(l+2<s.length&&s.charCodeAt(l+2)===36){const c=l+3,d=a;if(c<d)return t[0]=3,t[1]=n+l,t[2]=n+c,t[3]=n+d,t[4]=n+a+1,t[5]=r,t}}else if(u===36){const c=l+1,d=l+2;return d===a?(t[0]=2,t[1]=n+l,t[2]=n+c,t[3]=n+d,t[4]=n+a+1,t[5]=e.length,t):(t[0]=1,t[1]=n+l,t[2]=n+d,t[3]=n+a,t[4]=n+a+1,t[5]=r,t)}}return t[0]=0,t[1]=n,t[2]=n,t[3]=r,t[4]=r,t[5]=r,t}function wt(e,n,t,o,r,s,i){i?.(t);let l=o;{const a=t.fullPath??t.from,u=a.length,c=t.options?.caseSensitive??e,d=t.options?.params?.parse??t.options?.parseParams;for(;l<u;){const f=Lo(a,l,n);let g;const p=l,v=f[5];switch(l=v+1,s++,f[0]){case 0:{const y=a.substring(f[2],f[3]);if(c){const S=r.static?.get(y);if(S)g=S;else{r.static??=new Map;const w=_e(t.fullPath??t.from);w.parent=r,w.depth=s,g=w,r.static.set(y,w)}}else{const S=y.toLowerCase(),w=r.staticInsensitive?.get(S);if(w)g=w;else{r.staticInsensitive??=new Map;const C=_e(t.fullPath??t.from);C.parent=r,C.depth=s,g=C,r.staticInsensitive.set(S,C)}}break}case 1:{const y=a.substring(p,f[1]),S=a.substring(f[4],v),w=c&&!!(y||S),C=y?w?y:y.toLowerCase():void 0,P=S?w?S:S.toLowerCase():void 0,M=!d&&r.dynamic?.find(R=>!R.parse&&R.caseSensitive===w&&R.prefix===C&&R.suffix===P);if(M)g=M;else{const R=bt(1,t.fullPath??t.from,w,C,P);g=R,R.depth=s,R.parent=r,r.dynamic??=[],r.dynamic.push(R)}break}case 3:{const y=a.substring(p,f[1]),S=a.substring(f[4],v),w=c&&!!(y||S),C=y?w?y:y.toLowerCase():void 0,P=S?w?S:S.toLowerCase():void 0,M=!d&&r.optional?.find(R=>!R.parse&&R.caseSensitive===w&&R.prefix===C&&R.suffix===P);if(M)g=M;else{const R=bt(3,t.fullPath??t.from,w,C,P);g=R,R.parent=r,R.depth=s,r.optional??=[],r.optional.push(R)}break}case 2:{const y=a.substring(p,f[1]),S=a.substring(f[4],v),w=c&&!!(y||S),C=y?w?y:y.toLowerCase():void 0,P=S?w?S:S.toLowerCase():void 0,M=bt(2,t.fullPath??t.from,w,C,P);g=M,M.parent=r,M.depth=s,r.wildcard??=[],r.wildcard.push(M)}}r=g}if(d&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const f=_e(t.fullPath??t.from);f.kind=Io,f.parent=r,s++,f.depth=s,r.pathless??=[],r.pathless.push(f),r=f}const h=(t.path||!t.children)&&!t.isRoot;if(h&&a.endsWith("/")){const f=_e(t.fullPath??t.from);f.kind=fe,f.parent=r,s++,f.depth=s,r.index=f,r=f}r.parse=d??null,r.priority=t.options?.params?.priority??0,h&&!r.route&&(r.route=t,r.fullPath=t.fullPath??t.from)}if(t.children)for(const a of t.children)wt(e,n,a,l,r,s,i)}function Ft(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function de(e){if(e.pathless)for(const n of e.pathless)de(n);if(e.static)for(const n of e.static.values())de(n);if(e.staticInsensitive)for(const n of e.staticInsensitive.values())de(n);if(e.dynamic?.length){e.dynamic.sort(Ft);for(const n of e.dynamic)de(n)}if(e.optional?.length){e.optional.sort(Ft);for(const n of e.optional)de(n)}if(e.wildcard?.length){e.wildcard.sort(Ft);for(const n of e.wildcard)de(n)}}function _e(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function bt(e,n,t,o,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:o,suffix:r}}function rs(e,n){const t=_e("/"),o=new Uint16Array(6);for(const r of e)wt(!1,o,r,1,t,0);de(t),n.masksTree=t,n.flatCache=Qe(1e3)}function ss(e,n){e||="/";const t=n.flatCache.get(e);if(t)return t;const o=hn(e,n.masksTree);return n.flatCache.set(e,o),o}function is(e,n,t,o,r){e||="/",o||="/";const s=n?`case\0${e}`:e;let i=r.singleCache.get(s);return i||(i=_e("/"),wt(n,new Uint16Array(6),{from:e},1,i,0),r.singleCache.set(s,i)),hn(o,i,t)}function as(e,n,t=!1){const o=t?e:`nofuzz\0${e}`,r=n.matchCache.get(o);if(r!==void 0)return r;e||="/";let s;try{s=hn(e,n.segmentTree,t)}catch(i){if(i instanceof URIError)s=null;else throw i}return s&&(s.branch=Fo(s.route)),n.matchCache.set(o,s),s}function us(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function ls(e,n=!1,t){const o=_e(e.fullPath),r=new Uint16Array(6),s={},i={};let l=0;return wt(n,r,e,1,o,0,a=>{if(t?.(a,l),a.id in s&&ce(),s[a.id]=a,l!==0&&a.path){const u=us(a.fullPath);(!i[u]||a.fullPath.endsWith("/"))&&(i[u]=a)}l++}),de(o),{processedTree:{segmentTree:o,singleCache:Qe(1e3),matchCache:Qe(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:i}}function hn(e,n,t=!1){const o=e.split("/"),r=ds(e,o,n,t);if(!r)return null;const[s]=Eo(e,o,r);return{route:r.node.route,rawParams:s}}function Eo(e,n,t){const o=cs(t.node);let r=null;const s=Object.create(null);let i=t.extract?.part??0,l=t.extract?.node??0,a=t.extract?.path??0,u=t.extract?.segment??0;for(;l<o.length;i++,l++,a++,u++){const c=o[l];if(c.kind===fe)break;if(c.kind===Io){u--,i--,a--;continue}const d=n[i],h=a;if(d&&(a+=d.length),c.kind===1){r??=t.node.fullPath.split("/");const f=r[u],g=c.prefix?.length??0;if(f.charCodeAt(g)===123){const p=c.suffix?.length??0,v=f.substring(g+2,f.length-p-1),y=d.substring(g,d.length-p);s[v]=decodeURIComponent(y)}else{const p=f.substring(1);s[p]=decodeURIComponent(d)}}else if(c.kind===3){if(t.skipped&1<<l){i--,a=h-1;continue}r??=t.node.fullPath.split("/");const f=r[u],g=c.prefix?.length??0,p=c.suffix?.length??0,v=f.substring(g+3,f.length-p-1),y=c.suffix||c.prefix?d.substring(g,d.length-p):d;y&&(s[v]=decodeURIComponent(y))}else if(c.kind===2){const f=c,g=e.substring(h+(f.prefix?.length??0),e.length-(f.suffix?.length??0)),p=decodeURIComponent(g);s["*"]=p,s._splat=p;break}}return t.rawParams&&Object.assign(s,t.rawParams),[s,{part:i,node:l,path:a,segment:u}]}function Fo(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function cs(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function ds(e,n,t,o){if(e==="/"&&t.index)return{node:t.index,skipped:0};const r=!Ke(n),s=r&&e!=="/",i=n.length-(r?1:0),l=[{node:t,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let a=null,u=null;for(;l.length;){const c=l.pop(),{node:d,index:h,skipped:f,depth:g,statics:p,dynamics:v,optionals:y}=c;let{extract:S,rawParams:w}=c;if(d.kind===2&&d.route&&!ot(u,c))continue;if(d.parse){if(!Un(e,n,c))continue;w=c.rawParams,S=c.extract}o&&d.route&&d.kind!==fe&&ot(a,c)&&(a=c);const C=h===i;if(C&&(d.route&&(!s||d.kind===fe||d.kind===2)&&ot(u,c)&&(u=c),!d.optional&&!d.wildcard&&!d.index&&!d.pathless))continue;const P=C?void 0:n[h];let M;if(C&&d.index){const R={node:d.index,index:h,skipped:f,depth:g+1,statics:p,dynamics:v,optionals:y,extract:S,rawParams:w};let x=!0;if(d.index.parse&&(Un(e,n,R)||(x=!1)),x){if(!v&&!y&&!f&&fs(p,i))return R;ot(u,R)&&(u=R)}}if(d.wildcard)for(let R=d.wildcard.length-1;R>=0;R--){const x=d.wildcard[R],{prefix:I,suffix:k}=x;if(!(I&&(C||!(x.caseSensitive?P:M??=P.toLowerCase()).startsWith(I)))){if(k){if(C)continue;const A=n.slice(h).join("/").slice(-k.length);if((x.caseSensitive?A:A.toLowerCase())!==k)continue}l.push({node:x,index:i,skipped:f,depth:g+1,statics:p,dynamics:v,optionals:y,extract:S,rawParams:w})}}if(d.optional){const R=f|1<<g,x=g+1;for(let I=d.optional.length-1;I>=0;I--){const k=d.optional[I];l.push({node:k,index:h,skipped:R,depth:x,statics:p,dynamics:v,optionals:y,extract:S,rawParams:w})}if(!C)for(let I=d.optional.length-1;I>=0;I--){const k=d.optional[I],{prefix:A,suffix:V}=k;if(A||V){const Z=k.caseSensitive?P:M??=P.toLowerCase();if(A&&!Z.startsWith(A)||V&&!Z.endsWith(V))continue}l.push({node:k,index:h+1,skipped:f,depth:x,statics:p,dynamics:v,optionals:y+nt(i,h),extract:S,rawParams:w})}}if(!C&&d.dynamic&&P)for(let R=d.dynamic.length-1;R>=0;R--){const x=d.dynamic[R],{prefix:I,suffix:k}=x;if(I||k){const A=x.caseSensitive?P:M??=P.toLowerCase();if(I&&!A.startsWith(I)||k&&!A.endsWith(k))continue}l.push({node:x,index:h+1,skipped:f,depth:g+1,statics:p,dynamics:v+nt(i,h),optionals:y,extract:S,rawParams:w})}if(!C&&d.staticInsensitive){const R=d.staticInsensitive.get(M??=P.toLowerCase());R&&l.push({node:R,index:h+1,skipped:f,depth:g+1,statics:p+nt(i,h),dynamics:v,optionals:y,extract:S,rawParams:w})}if(!C&&d.static){const R=d.static.get(P);R&&l.push({node:R,index:h+1,skipped:f,depth:g+1,statics:p+nt(i,h),dynamics:v,optionals:y,extract:S,rawParams:w})}if(d.pathless){const R=g+1;for(let x=d.pathless.length-1;x>=0;x--){const I=d.pathless[x];l.push({node:I,index:h,skipped:f,depth:R,statics:p,dynamics:v,optionals:y,extract:S,rawParams:w})}}}if(u)return u;if(o&&a){let c=a.index;for(let h=0;h<a.index;h++)c+=n[h].length;const d=c===e.length?"/":e.slice(c);return a.rawParams??=Object.create(null),a.rawParams["**"]=decodeURIComponent(d),a}return null}function nt(e,n){return 2**(e-n-1)}function fs(e,n){return e===2**(n-1)-1}function Un(e,n,t){let o,r;try{[o,r]=Eo(e,n,t)}catch{return null}if(t.rawParams=o,t.extract=r,!t.node.parse)return!0;try{if(t.node.parse(o)===!1)return null}catch{}return!0}function ot(e,n){return e?n.statics>e.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===fe)>(e.node.kind===fe)||n.node.kind===fe==(e.node.kind===fe)&&n.depth>e.depth))):!0}function lt(e){return gn(e.filter(n=>n!==void 0).join("/"))}function gn(e){return e.replace(/\/{2,}/g,"/")}function bo(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function le(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function To(e){return le(bo(e))}function mt(e,n){return e?.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function hs(e,n,t){return mt(e,t)===mt(n,t)}function gs({base:e,to:n,trailingSlash:t="never",cache:o}){const r=n.startsWith("/"),s=!r&&n===".";let i;if(o){i=r?n:s?e:e+"\0"+n;const u=o.get(i);if(u)return u}let l;if(s)l=e.split("/");else if(r)l=n.split("/");else{for(l=e.split("/");l.length>1&&Ke(l)==="";)l.pop();const u=n.split("/");for(let c=0,d=u.length;c<d;c++){const h=u[c];h===""?c?c===d-1&&l.push(h):l=[h]:h===".."?l.pop():h==="."||l.push(h)}}l.length>1&&(Ke(l)===""?t==="never"&&l.pop():t==="always"&&l.push(""));const a=gn(l.join("/"))||"/";return i&&o&&o.set(i,a),a}function ps(e){const n=new Map(e.map(r=>[encodeURIComponent(r),r])),t=Array.from(n.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(t,"g");return r=>r.replace(o,s=>n.get(s)??s)}function Tt(e,n,t){const o=n[e];return typeof o!="string"?o:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(r=>Kn(r,t)).join("/"):Kn(o,t)}function qn({path:e,params:n,decoder:t,...o}){let r=!1;const s=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:s,isMissingParams:r};const i=e.length;let l=0,a,u="";for(;l<i;){const c=l;a=Lo(e,c,a);const d=a[5];if(l=d+1,c===d)continue;const h=a[0];if(h===0){u+="/"+e.substring(c,d);continue}if(h===2){const f=n._splat;s._splat=f,s["*"]=f;const g=e.substring(c,a[1]),p=e.substring(a[4],d);if(!f){r=!0,(g||p)&&(u+="/"+g+p);continue}const v=Tt("_splat",n,t);u+="/"+g+v+p;continue}if(h===1){const f=e.substring(a[2],a[3]);!r&&!(f in n)&&(r=!0),s[f]=n[f];const g=e.substring(c,a[1]),p=e.substring(a[4],d),v=Tt(f,n,t)??"undefined";u+="/"+g+v+p;continue}if(h===3){const f=e.substring(a[2],a[3]),g=n[f];if(g==null)continue;s[f]=g;const p=e.substring(c,a[1]),v=e.substring(a[4],d),y=Tt(f,n,t)??"";u+="/"+p+y+v;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:s,interpolatedPath:u||"/",isMissingParams:r}}function Kn(e,n){const t=encodeURIComponent(e);return n?.(t)??t}function Q(e){return e?.isNotFound===!0}function ms(e,n=String){const t=new URLSearchParams;for(const o in e){const r=e[o];r!==void 0&&t.set(o,n(r))}return t.toString()}function Ot(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function vs(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[o,r]of n.entries()){const s=t[o];s==null?t[o]=Ot(r):Array.isArray(s)?s.push(Ot(r)):t[o]=[s,Ot(r)]}return t}const ys=Rs(JSON.parse),Ss=ws(JSON.stringify,JSON.parse);function Rs(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=vs(n);for(const o in t){const r=t[o];if(typeof r=="string")try{t[o]=e(r)}catch{}}return t}}function ws(e,n){const t=typeof n=="function";function o(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(t&&typeof r=="string")try{return n(r),e(r)}catch{}return r}return r=>{const s=ms(r,o);return s?`?${s}`:""}}const xe="__root__";function Cs(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function J(e){return e instanceof Response&&!!e.options}const Jt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},_s=e=>e.stores.matchesId.get().some(n=>e.stores.matchStores.get(n)?.get()._forcePending),Ct=(e,n)=>!!(e.preload&&!e.router.stores.matchStores.has(n)),Me=(e,n,t=!0)=>{const o={...e.router.options.context??{}},r=t?n:n-1;for(let s=0;s<=r;s++){const i=e.matches[s];if(!i)continue;const l=e.router.getMatch(i.id);l&&Object.assign(o,l.__routeContext,l.__beforeLoadContext)}return o},Wn=(e,n)=>{if(!e.matches.length)return;const t=n.routeId,o=e.matches.findIndex(i=>i.routeId===e.router.routeTree.id),r=o>=0?o:0;let s=t?e.matches.findIndex(i=>i.routeId===t):e.firstBadMatchIndex??e.matches.length-1;s<0&&(s=r);for(let i=s;i>=0;i--){const l=e.matches[i];if(e.router.looseRoutesById[l.routeId].options.notFoundComponent)return i}return t?s:r},he=(e,n,t)=>{if(!(!J(t)&&!Q(t)))throw J(t)&&t.redirectHandled&&!t.options.reloadDocument||(n&&(n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0,n._nonReactive.error=t,e.updateMatch(n.id,o=>({...o,status:J(t)?"redirected":Q(t)?"notFound":o.status==="pending"?"success":o.status,context:Me(e,n.index),isFetching:!1,error:t})),Q(t)&&!t.routeId&&(t.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()),J(t)&&(e.rendered=!0,t.options._fromLocation=e.location,t.redirectHandled=!0,t=e.router.resolveRedirect(t))),t},Oo=(e,n)=>{const t=e.router.getMatch(n);return!!(!t||t._nonReactive.dehydrated)},Qn=(e,n,t)=>{const o=Me(e,t);e.updateMatch(n,r=>({...r,context:o}))},je=(e,n,t)=>{const{id:o,routeId:r}=e.matches[n],s=e.router.looseRoutesById[r];if(t instanceof Promise)throw t;e.firstBadMatchIndex??=n,he(e,e.router.getMatch(o),t);try{s.options.onError?.(t)}catch(i){t=i,he(e,e.router.getMatch(o),t)}e.updateMatch(o,i=>(i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loadPromise?.resolve(),{...i,error:t,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!J(t)&&!Q(t)&&(e.serialError??=t)},Ao=(e,n,t,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const r=t.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ct(e,n)&&(t.options.loader||t.options.beforeLoad||$o(t))&&typeof r=="number"&&r!==1/0&&(t.options.pendingComponent??e.router.options?.defaultPendingComponent)){const s=setTimeout(()=>{Jt(e)},r);o._nonReactive.pendingTimeout=s}},Ps=(e,n,t)=>{const o=e.router.getMatch(n);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Ao(e,n,t,o);const r=()=>{const s=e.router.getMatch(n);s.preload&&(s.status==="redirected"||s.status==="notFound")&&he(e,s,s.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(r):r()},xs=(e,n,t,o)=>{const r=e.router.getMatch(n);let s=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Ae(()=>{s?.resolve(),s=void 0});const{paramsError:i,searchError:l}=r;i&&je(e,t,i),l&&je(e,t,l),Ao(e,n,o,r);const a=new AbortController;let u=!1;const c=()=>{u||(u=!0,e.updateMatch(n,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:a})))},d=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,C=>({...C,isFetching:!1}))};if(!o.options.beforeLoad){e.router.batch(()=>{c(),d()});return}r._nonReactive.beforeLoadPromise=Ae();const h={...Me(e,t,!1),...r.__routeContext},{search:f,params:g,cause:p}=r,v=Ct(e,n),y={search:f,abortController:a,params:g,preload:v,context:h,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?"preload":p,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},S=C=>{if(C===void 0){e.router.batch(()=>{c(),d()});return}(J(C)||Q(C))&&(c(),je(e,t,C)),e.router.batch(()=>{c(),e.updateMatch(n,P=>({...P,__beforeLoadContext:C})),d()})};let w;try{if(w=o.options.beforeLoad(y),We(w))return c(),w.catch(C=>{je(e,t,C)}).then(S)}catch(C){c(),je(e,t,C)}S(w)},Ms=(e,n)=>{const{id:t,routeId:o}=e.matches[n],r=e.router.looseRoutesById[o],s=()=>l(),i=()=>xs(e,t,n,r),l=()=>{if(Oo(e,t))return;const a=Ps(e,t,r);return We(a)?a.then(i):i()};return s()},Is=(e,n,t)=>{const o=e.router.getMatch(n);if(!o||!t.options.head&&!t.options.scripts&&!t.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([t.options.head?.(r),t.options.scripts?.(r),t.options.headers?.(r)]).then(([s,i,l])=>({meta:s?.meta,links:s?.links,headScripts:s?.scripts,headers:l,scripts:i,styles:s?.styles}))},Do=(e,n,t,o,r)=>{const s=n[o-1],{params:i,loaderDeps:l,abortController:a,cause:u}=e.router.getMatch(t),c=Me(e,o),d=Ct(e,t);return{params:i,deps:l,preload:!!d,parentMatchPromise:s,abortController:a,context:c,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":u,route:r,...e.router.options.additionalContext}},Yn=async(e,n,t,o,r)=>{try{const s=e.router.getMatch(t);try{(!(Po??e.router.isServer)||s.ssr===!0)&&Ye(r);const i=r.options.loader,l=typeof i=="function"?i:i?.handler,a=l?.(Do(e,n,t,o,r)),u=!!l&&We(a);if((u||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||s._nonReactive.minPendingPromise)&&e.updateMatch(t,d=>({...d,isFetching:"loader"})),l){const d=u?await a:a;he(e,e.router.getMatch(t),d),d!==void 0&&e.updateMatch(t,h=>({...h,loaderData:d}))}r._lazyPromise&&await r._lazyPromise;const c=s._nonReactive.minPendingPromise;c&&await c,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,d=>({...d,error:void 0,context:Me(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let l=i;if(l?.name==="AbortError"){if(s.abortController.signal.aborted){s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,u=>({...u,status:u.status==="pending"?"success":u.status,isFetching:!1,context:Me(e,o)}));return}const a=s._nonReactive.minPendingPromise;a&&await a,Q(i)&&await r.options.notFoundComponent?.preload?.(),he(e,e.router.getMatch(t),i);try{r.options.onError?.(i)}catch(u){l=u,he(e,e.router.getMatch(t),u)}!J(l)&&!Q(l)&&await Ye(r,["errorComponent"]),e.updateMatch(t,u=>({...u,error:l,context:Me(e,o),status:"error",isFetching:!1}))}}catch(s){const i=e.router.getMatch(t);i&&(i._nonReactive.loaderPromise=void 0),he(e,i,s)}},Ls=async(e,n,t)=>{async function o(f,g,p,v,y){const S=Date.now()-g.updatedAt,w=f?y.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:y.options.staleTime??e.router.options.defaultStaleTime??0,C=y.options.shouldReload,P=typeof C=="function"?C(Do(e,n,r,t,y)):C,{status:M,invalid:R}=v,x=S>=w&&(!!e.forceStaleReload||v.cause==="enter"||p!==void 0&&p!==v.id);i=M==="success"&&(R||(P??x)),f&&y.options.preload===!1||(i&&!e.sync&&c?(l=!0,(async()=>{try{await Yn(e,n,r,t,y);const I=e.router.getMatch(r);I._nonReactive.loaderPromise?.resolve(),I._nonReactive.loadPromise?.resolve(),I._nonReactive.loaderPromise=void 0,I._nonReactive.loadPromise=void 0}catch(I){J(I)&&await e.router.navigate(I.options)}})()):M!=="success"||i?await Yn(e,n,r,t,y):Qn(e,r,t))}const{id:r,routeId:s}=e.matches[t];let i=!1,l=!1;const a=e.router.looseRoutesById[s],u=a.options.loader,c=((typeof u=="function"?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Oo(e,r)){if(!e.router.getMatch(r))return e.matches[t];Qn(e,r,t)}else{const f=e.router.getMatch(r),g=e.router.stores.matchesId.get()[t],p=(g&&e.router.stores.matchStores.get(g)||null)?.routeId===s?g:e.router.stores.matches.get().find(y=>y.routeId===s)?.id,v=Ct(e,r);if(f._nonReactive.loaderPromise){if(f.status==="success"&&!e.sync&&!f.preload&&c)return f;await f._nonReactive.loaderPromise;const y=e.router.getMatch(r),S=y._nonReactive.error||y.error;S&&he(e,y,S),y.status==="pending"&&await o(v,f,p,y,a)}else{const y=v&&!e.router.stores.matchStores.has(r),S=e.router.getMatch(r);S._nonReactive.loaderPromise=Ae(),y!==S.preload&&e.updateMatch(r,w=>({...w,preload:y})),await o(v,f,p,S,a)}}const d=e.router.getMatch(r);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(r,f=>({...f,isFetching:h,invalid:!1})),e.router.getMatch(r)):d};async function Xn(e){const n=e,t=[];_s(n.router)&&Jt(n);let o;for(let h=0;h<n.matches.length;h++){try{const f=Ms(n,h);We(f)&&await f}catch(f){if(J(f))throw f;if(Q(f))o=f;else if(!n.preload)throw f;break}if(n.serialError||n.firstBadMatchIndex!=null)break}const r=n.firstBadMatchIndex??n.matches.length,s=o&&!n.preload?Wn(n,o):void 0,i=o&&n.preload?0:s!==void 0?Math.min(s+1,r):r;let l,a;for(let h=0;h<i;h++)t.push(Ls(n,t,h));try{await Promise.all(t)}catch{const h=await Promise.allSettled(t);for(const f of h){if(f.status!=="rejected")continue;const g=f.reason;if(J(g))throw g;Q(g)?l??=g:a??=g}if(a!==void 0)throw a}const u=l??(o&&!n.preload?o:void 0);let c=n.firstBadMatchIndex!==void 0?n.firstBadMatchIndex:n.matches.length-1;if(!u&&o&&n.preload)return n.matches;if(u){const h=Wn(n,u);h===void 0&&ce();const f=n.matches[h],g=n.router.looseRoutesById[f.routeId],p=n.router.options?.defaultNotFoundComponent;!g.options.notFoundComponent&&p&&(g.options.notFoundComponent=p),u.routeId=f.routeId;const v=f.routeId===n.router.routeTree.id;n.updateMatch(f.id,y=>({...y,...v?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),c=h,await Ye(g,["notFoundComponent"])}else if(!n.preload){const h=n.matches[0];h.globalNotFound||n.router.getMatch(h.id)?.globalNotFound&&n.updateMatch(h.id,f=>({...f,globalNotFound:!1,error:void 0}))}if(n.serialError&&n.firstBadMatchIndex!==void 0){const h=n.router.looseRoutesById[n.matches[n.firstBadMatchIndex].routeId];await Ye(h,["errorComponent"])}for(let h=0;h<=c;h++){const{id:f,routeId:g}=n.matches[h],p=n.router.looseRoutesById[g];try{const v=Is(n,f,p);if(v){const y=await v;n.updateMatch(f,S=>({...S,...y}))}}catch(v){console.error(`Error executing head for route ${g}:`,v)}}const d=Jt(n);if(We(d)&&await d,u)throw u;if(n.serialError&&!n.preload&&!n.onReady)throw n.serialError;return n.matches}function Jn(e,n){const t=n.map(o=>e.options[o]?.preload?.()).filter(Boolean);if(t.length!==0)return Promise.all(t)}function Ye(e,n=ct){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(o=>{const{id:r,...s}=o.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const t=()=>e._componentsLoaded?void 0:n===ct?(()=>{if(e._componentsPromise===void 0){const o=Jn(e,ct);o?e._componentsPromise=o.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Jn(e,n);return e._lazyPromise?e._lazyPromise.then(t):t()}function $o(e){for(const n of ct)if(e.options[n]?.preload)return!0;return!1}const ct=["component","errorComponent","pendingComponent","notFoundComponent"];function Es(e){return{input:({url:n})=>{for(const t of e)n=Zt(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=ko(e[t],n);return n}}}function Fs(e){const n=To(e.basepath),t=`/${n}`,o=e.caseSensitive?t:t.toLowerCase(),r=`${o}/`;return{input:({url:s})=>{const i=e.caseSensitive?s.pathname:s.pathname.toLowerCase();return i===o?s.pathname="/":i.startsWith(r)&&(s.pathname=s.pathname.slice(t.length)),s},output:({url:s})=>(s.pathname=lt(["/",n,s.pathname]),s)}}function Zt(e,n){const t=e?.input?.({url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function ko(e,n){const t=e?.output?.({url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function bs(e,n){const{createMutableStore:t,createReadonlyStore:o,batch:r,init:s}=n,i=new Map,l=new Map,a=new Map,u=t(e.status),c=t(e.loadedAt),d=t(e.isLoading),h=t(e.isTransitioning),f=t(e.location),g=t(e.resolvedLocation),p=t(e.statusCode),v=t(e.redirect),y=t([]),S=t([]),w=t([]),C=o(()=>At(i,y.get())),P=o(()=>At(l,S.get())),M=o(()=>At(a,w.get())),R=o(()=>y.get()[0]),x=o(()=>y.get().some(U=>i.get(U)?.get().status==="pending")),I=o(()=>({locationHref:f.get().href,resolvedLocationHref:g.get()?.href,status:u.get()})),k=o(()=>({status:u.get(),loadedAt:c.get(),isLoading:d.get(),isTransitioning:h.get(),matches:C.get(),location:f.get(),resolvedLocation:g.get(),statusCode:p.get(),redirect:v.get()})),A=Qe(64);function V(U){let ve=A.get(U);return ve||(ve=o(()=>{const De=y.get();for(const Je of De){const m=i.get(Je);if(m&&m.routeId===U)return m.get()}}),A.set(U,ve)),ve}const Z={status:u,loadedAt:c,isLoading:d,isTransitioning:h,location:f,resolvedLocation:g,statusCode:p,redirect:v,matchesId:y,pendingIds:S,cachedIds:w,matches:C,pendingMatches:P,cachedMatches:M,firstId:R,hasPending:x,matchRouteDeps:I,matchStores:i,pendingMatchStores:l,cachedMatchStores:a,__store:k,getRouteMatchStore:V,setMatches:z,setPending:oe,setCached:re};z(e.matches),s?.(Z);function z(U){Dt(U,i,y,t,r)}function oe(U){Dt(U,l,S,t,r)}function re(U){Dt(U,a,w,t,r)}return Z}function At(e,n){const t=[];for(const o of n){const r=e.get(o);r&&t.push(r.get())}return t}function Dt(e,n,t,o,r){const s=e.map(l=>l.id),i=new Set(s);r(()=>{for(const l of n.keys())i.has(l)||n.delete(l);for(const l of e){const a=n.get(l.id);if(!a){const u=o(l);u.routeId=l.routeId,n.set(l.id,u);continue}a.routeId=l.routeId,a.get()!==l&&a.set(l)}ns(t.get(),s)||t.set(s)})}var pe="__TSR_index",Zn="popstate",eo="beforeunload";function Ts(e){let n=e.getLocation();const t=new Set,o=i=>{n=e.getLocation(),t.forEach(l=>l({location:n,action:i}))},r=i=>{e.notifyOnIndexChange??!0?o(i):n=e.getLocation()},s=async({task:i,navigateOpts:l,...a})=>{if(l?.ignoreBlocker??!1){i();return}const u=e.getBlockers?.()??[],c=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&c)for(const d of u){const h=Xe(a.path,a.state);if(await d.blockerFn({currentLocation:n,nextLocation:h,action:a.type})){e.onBlocked?.();return}}i()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:i=>(t.add(i),()=>{t.delete(i)}),push:(i,l,a)=>{const u=n.state[pe];l=to(u+1,l),s({task:()=>{e.pushState(i,l),o({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:l})},replace:(i,l,a)=>{const u=n.state[pe];l=to(u,l),s({task:()=>{e.replaceState(i,l),o({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:l})},go:(i,l)=>{s({task:()=>{e.go(i),r({type:"GO",index:i})},navigateOpts:l,type:"GO"})},back:i=>{s({task:()=>{e.back(i?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{s({task:()=>{e.forward(i?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>n.state[pe]!==0,createHref:i=>e.createHref(i),block:i=>{if(!e.setBlockers)return()=>{};const l=e.getBlockers?.()??[];return e.setBlockers([...l,i]),()=>{const a=e.getBlockers?.()??[];e.setBlockers?.(a.filter(u=>u!==i))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:o}}function to(e,n){n||(n={});const t=pn();return{...n,key:t,__TSR_key:t,[pe]:e}}function Vo(e){const n=e?.window??(typeof document<"u"?window:void 0),t=n.history.pushState,o=n.history.replaceState;let r=[];const s=()=>r,i=x=>r=x,l=e?.createHref??(x=>x),a=e?.parseLocation??(()=>Xe(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const x=pn();n.history.replaceState({[pe]:0,key:x,__TSR_key:x},"")}let u=a(),c,d=!1,h=!1,f=!1,g=!1;const p=()=>u;let v,y;const S=()=>{v&&(R._ignoreSubscribers=!0,(v.isPush?n.history.pushState:n.history.replaceState)(v.state,"",v.href),R._ignoreSubscribers=!1,v=void 0,y=void 0,c=void 0)},w=(x,I,k)=>{const A=l(I);y||(c=u),u=Xe(I,k),v={href:A,state:k,isPush:v?.isPush||x==="push"},y||(y=Promise.resolve().then(()=>S()))},C=x=>{u=a(),R.notify({type:x})},P=async()=>{if(h){h=!1;return}const x=a(),I=x.state[pe]-u.state[pe],k=I===1,A=I===-1,V=!k&&!A||d;d=!1;const Z=V?"GO":A?"BACK":"FORWARD",z=V?{type:"GO",index:I}:{type:A?"BACK":"FORWARD"};if(f)f=!1;else{const oe=s();if(typeof document<"u"&&oe.length){for(const re of oe)if(await re.blockerFn({currentLocation:u,nextLocation:x,action:Z})){h=!0,n.history.go(1),R.notify(z);return}}}u=a(),R.notify(z)},M=x=>{if(g){g=!1;return}let I=!1;const k=s();if(typeof document<"u"&&k.length)for(const A of k){const V=A.enableBeforeUnload??!0;if(V===!0){I=!0;break}if(typeof V=="function"&&V()===!0){I=!0;break}}if(I)return x.preventDefault(),x.returnValue=""},R=Ts({getLocation:p,getLength:()=>n.history.length,pushState:(x,I)=>w("push",x,I),replaceState:(x,I)=>w("replace",x,I),back:x=>(x&&(f=!0),g=!0,n.history.back()),forward:x=>{x&&(f=!0),g=!0,n.history.forward()},go:x=>{d=!0,n.history.go(x)},createHref:x=>l(x),flush:S,destroy:()=>{n.history.pushState=t,n.history.replaceState=o,n.removeEventListener(eo,M,{capture:!0}),n.removeEventListener(Zn,P)},onBlocked:()=>{c&&u!==c&&(u=c)},getBlockers:s,setBlockers:i,notifyOnIndexChange:!1});return n.addEventListener(eo,M,{capture:!0}),n.addEventListener(Zn,P),n.history.pushState=function(...x){const I=t.apply(n.history,x);return R._ignoreSubscribers||C("PUSH"),I},n.history.replaceState=function(...x){const I=o.apply(n.history,x);return R._ignoreSubscribers||C("REPLACE"),I},R}function Ia(e){const n=typeof document<"u"?window:void 0;return Vo({window:n,parseLocation:()=>{const t=n.location.hash.split("#").slice(1),o=t[0]??"/",r=n.location.search,s=t.slice(1);return Xe(`${o}${r}${s.length===0?"":`#${s.join("#")}`}`,n.history.state)},createHref:t=>`${n.location.pathname}${n.location.search}#${t}`})}function Os(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Xe(e,n){const t=Os(e),o=t.indexOf("#"),r=t.indexOf("?"),s=pn();return{href:t,pathname:t.substring(0,o>0?r>0?Math.min(o,r):o:r>0?r:t.length),hash:o>-1?t.substring(o):"",search:r>-1?t.slice(r,o===-1?void 0:o):"",state:n||{[pe]:0,key:s,__TSR_key:s}}}function pn(){return(Math.random()+1).toString(36).substring(7)}function Oe(e,n){const t=n,o=e;return{fromLocation:t,toLocation:o,pathChanged:t?.pathname!==o.pathname,hrefChanged:t?.href!==o.href,hashChanged:t?.hash!==o.hash}}const en=new WeakMap;var As=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=t=>t(),this.update=t=>{const o=this.options,r=this.basepath??o?.basepath??"/",s=this.basepath===void 0,i=o?.rewrite;if(this.options={...o,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ps(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Vo()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let c;this.resolvePathCache=Qe(1e3),c=this.buildRouteTree(),this.setRoutes(c)}if(!this.stores&&this.latestLocation){const c=this.getStoreConfig(this);this.batch=c.batch,this.stores=bs($s(this.latestLocation),c),Ks(this)}let l=!1;const a=this.options.basepath??"/",u=this.options.rewrite;if(s||r!==a||i!==u){this.basepath=a;const c=[],d=To(a);d&&d!=="/"&&c.push(Fs({basepath:a})),u&&c.push(u),this.rewrite=c.length===0?void 0:c.length===1?c[0]:Es(c),this.history&&this.updateLatestLocation(),l=!0}l&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=ls(this.routeTree,this.options.caseSensitive,(o,r)=>{o.init({originalIndex:r})});return this.options.routeMasks&&rs(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,o)=>{const r={eventType:t,fn:o};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(o=>{o.eventType===t.type&&o.fn(t)})},this.parseLocation=(t,o)=>{const r=({pathname:a,search:u,hash:c,href:d,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(a)){const y=this.options.parseSearch(u),S=this.options.stringifySearch(y);return{href:a+S+c,publicHref:a+S+c,pathname:Ve(a).path,external:!1,searchStr:S,search:Re(o?.search,y),hash:Ve(c.slice(1)).path,state:Ce(o?.state,h)}}const f=new URL(d,this.origin),g=Zt(this.rewrite,f),p=this.options.parseSearch(g.search),v=this.options.stringifySearch(p);return g.search=v,{href:g.href.replace(g.origin,""),publicHref:d,pathname:Ve(g.pathname).path,external:!!this.rewrite&&g.origin!==this.origin,searchStr:v,search:Re(o?.search,p),hash:Ve(g.hash.slice(1)).path,state:Ce(o?.state,h)}},s=r(t),{__tempLocation:i,__tempKey:l}=s.state;if(i&&(!l||l===this.tempLocationKey)){const a=r(i);return a.state.key=s.state.key,a.state.__TSR_key=s.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:s}}return s},this.resolvePathWithBase=(t,o)=>gs({base:t,to:o.includes("//")?gn(o):o,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,o,r)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:o},r):this.matchRoutesInternal(t,o),this.getMatchedRoutes=t=>ks({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const o=this.getMatch(t);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(t=>{this.cancelMatch(t)}),this.stores.matchesId.get().forEach(t=>{if(this.stores.pendingMatchStores.has(t))return;const o=this.stores.matchStores.get(t)?.get();o&&(o.status==="pending"||o.isFetching==="loader")&&this.cancelMatch(t)})},this.buildLocation=t=>{const o=(s={})=>{const i=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(i);s.from;const a=s.unsafeRelative==="path"?i.pathname:s.from??l.fullPath,u=s.to?`${s.to}`:void 0,c=l.search,d=Object.assign(Object.create(null),l.params),h=u?.charCodeAt(0)===47?"/":this.resolvePathWithBase(a,"."),f=u?this.resolvePathWithBase(h,u):h,g=s.params===!1||s.params===null?Object.create(null):(s.params??!0)===!0?d:Object.assign(d,we(s.params,d)),p=this.routesByPath[le(f)];let v;if(p)v=this.getRouteBranch(p);else if(f.includes("$"))v=[];else{const A=this.getMatchedRoutes(f);v=A.matchedRoutes,this.options.notFoundRoute&&(!A.foundRoute||A.foundRoute.path!=="/"&&A.routeParams["**"])&&(v=[...v,this.options.notFoundRoute])}if(v.length&&Mo(g))for(const A of v){const V=A.options.params?.stringify??A.options.stringifyParams;if(V)try{Object.assign(g,V(g))}catch{}}const y=t.leaveParams?f:Ve(qn({path:f,params:g,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let S=c;if(t._includeValidateSearch&&this.options.search?.strict){const A={};v.forEach(V=>{if(V.options.validateSearch)try{Object.assign(A,dt(V.options.validateSearch,{...A,...S}))}catch{}}),S=A}S=Vs({search:S,dest:s,destRoutes:v,_includeValidateSearch:t._includeValidateSearch}),S=Re(c,S);const w=this.options.stringifySearch(S),C=s.hash===!0?i.hash:s.hash?we(s.hash,i.hash):void 0,P=C?`#${C}`:"";let M=s.state===!0?i.state:s.state?we(s.state,i.state):{};M=Ce(i.state,M);const R=`${y}${w}${P}`;let x,I,k=!1;if(this.rewrite){const A=new URL(R,this.origin),V=ko(this.rewrite,A);x=A.href.replace(A.origin,""),V.origin!==this.origin?(I=V.href,k=!0):I=V.pathname+V.search+V.hash}else x=ts(R),I=x;return{publicHref:I,href:x,pathname:y,search:S,searchStr:w,state:M,hash:C??"",external:k,unmaskOnReload:s.unmaskOnReload}},r=(s={},i)=>{const l=o(s);let a=i?o(i):void 0;if(!a){const u=Object.create(null);if(this.options.routeMasks){const c=ss(l.pathname,this.processedTree);if(c){Object.assign(u,c.rawParams);const{from:d,params:h,...f}=c.route,g=h===!1||h===null?Object.create(null):(h??!0)===!0?u:Object.assign(u,we(h,u));i={from:t.from,...f,params:g},a=o(i)}}}return a&&(l.maskedLocation=a),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:o,...r})=>{let s;const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(d=>{r.state[d]=this.latestLocation.state[d]});const c=Pe(r.state,this.latestLocation.state);return u.forEach(d=>{delete r.state[d]}),c},l=le(this.latestLocation.href)===le(r.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=Ae(()=>{a?.resolve(),a=void 0}),l&&i())this.load();else{let{maskedLocation:u,hashScrollIntoView:c,...d}=r;u&&(d={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...d,search:d.searchStr,state:{...d.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(d.unmaskOnReload??this.options.unmaskOnReload??!1)&&(d.state.__tempKey=this.tempLocationKey)),d.state.__hashScrollIntoViewOptions=c??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,s=r.replace?"REPLACE":"PUSH",this.history[s==="REPLACE"?"replace":"push"](d.publicHref,d.state,{ignoreBlocker:o})}return this._scroll.next=r.resetScroll??!0,this.history.subscribers.size||this.load(s?{action:{type:s}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:o,hashScrollIntoView:r,viewTransition:s,ignoreBlocker:i,href:l,...a}={})=>{if(l){const d=this.history.location.state.__TSR_index,h=Xe(l,{__TSR_index:t?d:d+1}),f=new URL(h.pathname,this.origin);a.to=Zt(this.rewrite,f).pathname,a.search=this.options.parseSearch(h.search),a.hash=h.hash.slice(1)}const u=this.buildLocation({...a,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const c=this.commitLocation({...u,viewTransition:s,replace:t,resetScroll:o,hashScrollIntoView:r,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:t,reloadDocument:o,href:r,publicHref:s,...i})=>{let l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!o&&(o=!0),o){if(t!==void 0||!r){const u=this.buildLocation({to:t,...i});r=r??u.publicHref,s=s??u.publicHref}const a=!l&&s?s:r;if(pt(a,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const c of u)if(c?.blockerFn&&await c.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(a):window.location.href=a,Promise.resolve()}return this.buildAndCommitLocation({...i,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation),o=this.stores.cachedMatches.get().filter(r=>!t.some(s=>s.id===r.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(t),this.stores.setCached(o)})},this.load=async t=>{const o=t?.action?.type;let r,s,i;const l=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad(),o?en.set(this.latestLocation,o):en.delete(this.latestLocation);const c=this.latestLocation,d=Oe(c,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...d}),this.emit({type:"onBeforeLoad",...d}),await Xn({router:this,sync:t?.sync,forceStaleReload:l.href===c.href,matches:this.stores.pendingMatches.get(),location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let h=null,f=null,g=null,p=null;this.batch(()=>{const v=this.stores.pendingMatches.get(),y=v.length,S=this.stores.matches.get();h=y?S.filter(P=>!this.stores.pendingMatchStores.has(P.id)):null;const w=new Set;for(const P of this.stores.pendingMatchStores.values())P.routeId&&w.add(P.routeId);const C=new Set;for(const P of this.stores.matchStores.values())P.routeId&&C.add(P.routeId);f=y?S.filter(P=>!w.has(P.routeId)):null,g=y?v.filter(P=>!C.has(P.routeId)):null,p=y?v.filter(P=>C.has(P.routeId)):S,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),y&&(this.stores.setMatches(v),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...h.filter(P=>P.status!=="error"&&P.status!=="notFound"&&P.status!=="redirected")]),this.clearExpiredCache())});for(const[v,y]of[[f,"onLeave"],[g,"onEnter"],[p,"onStay"]])if(v)for(const S of v)this.looseRoutesById[S.routeId].options[y]?.(S)})})}})}catch(c){J(c)?(r=c,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Q(c)&&(s=c);const d=r?r.status:s?404:this.stores.matches.get().some(h=>h.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(d),this.stores.redirect.set(r)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(u=>u.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=t=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,i=this.stores.resolvedLocation.get(),l=typeof o.types=="function"?o.types(Oe(s,i)):o.types;if(l===!1){t();return}r={update:t,types:l}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,o)=>{this.startTransition(()=>{const r=this.stores.pendingMatchStores.get(t);if(r){r.set(o);return}const s=this.stores.matchStores.get(t);if(s){s.set(o);return}const i=this.stores.cachedMatchStores.get(t);if(i){const l=o(i.get());l.status==="redirected"?this.stores.cachedMatchStores.delete(t)&&this.stores.cachedIds.set(a=>a.filter(u=>u!==t)):i.set(l)}})},this.getMatch=t=>this.stores.cachedMatchStores.get(t)?.get()??this.stores.pendingMatchStores.get(t)?.get()??this.stores.matchStores.get(t)?.get(),this.invalidate=t=>{const o=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(o)),this.stores.setCached(this.stores.cachedMatches.get().map(o)),this.stores.setPending(this.stores.pendingMatches.get().map(o))}),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const o=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),s=this.getParsedLocationHref(r);t.options.href=s,t.headers.set("Location",s)}else if(o)try{const r=new URL(o);if(this.origin&&r.origin===this.origin){const s=r.pathname+r.search+r.hash;t.options.href=s,t.headers.set("Location",s)}}catch{}if(t.options.href&&!t.options._builtLocation&&pt(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const o=t?.filter;o!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(r=>!o(r))):this.stores.setCached([])},this.clearExpiredCache=()=>{const t=Date.now(),o=r=>{const s=this.looseRoutesById[r.routeId];if(!s.options.loader)return!0;const i=(r.preload?s.options.preloadGcTime??this.options.defaultPreloadGcTime:s.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:t-r.updatedAt>=i};this.clearCache({filter:o})},this.loadRouteChunk=Ye,this.preloadRoute=async t=>{const o=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:t});const s=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...s,...this.stores.cachedIds.get()]),l=r.filter(a=>!i.has(a.id));if(l.length){const a=this.stores.cachedMatches.get();this.stores.setCached([...a,...l])}try{return r=await Xn({router:this,matches:r,location:o,preload:!0,updateMatch:(a,u)=>{s.has(a)?r=r.map(c=>c.id===a?u(c):c):this.updateMatch(a,u)}}),r}catch(a){if(J(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:o});Q(a)||console.error(a);return}},this.matchRoute=(t,o)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},s=this.buildLocation(r);if(o?.pending&&this.stores.status.get()!=="pending")return!1;const i=(o?.pending===void 0?!this.stores.isLoading.get():o.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),l=is(s.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,i.pathname,this.processedTree);return!l||t.params&&!Pe(l.rawParams,t.params,{partial:!0})?!1:o?.includeSearch??!0?Pe(i.search,s.search,{partial:!0})?l.rawParams:!1:l.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(t=>t.status==="notFound"||t.globalNotFound),this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Ss,parseSearch:e.parseSearch??ys,protocolAllowlist:e.protocolAllowlist??es}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=Fo(e),this.routeBranchCache.set(e,n)),n}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,n){const t=this.getMatchedRoutes(e.pathname),{foundRoute:o,routeParams:r}=t;let{matchedRoutes:s}=t,i=!1;(o?o.path!=="/"&&r["**"]:le(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:i=!0);const l=i?Hs(this.options.notFoundMode,s):void 0,a=new Array(s.length),u=new Map;for(const c of this.stores.matchStores.values())c.routeId&&u.set(c.routeId,c.get());for(let c=0;c<s.length;c++){const d=s[c],h=a[c-1];let f,g,p;{const V=h?.search??e.search,Z=h?._strictSearch??void 0;try{const z=dt(d.options.validateSearch,{...V})??void 0;f={...V,...z},g={...Z,...z},p=void 0}catch(z){let oe=z;if(z instanceof vt||(oe=new vt(z.message,{cause:z})),n?.throwOnError)throw oe;f=V,g={},p=oe}}const v=d.options.loaderDeps?.({search:f})??"",y=v?JSON.stringify(v):"",{interpolatedPath:S,usedParams:w}=qn({path:d.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),C=d.id+S+y,P=this.getMatch(C),M=u.get(d.id),R=P?._strictParams??w;let x;if(!P)try{no(d,R)}catch(V){if(Q(V)||J(V)?x=V:x=new Ds(V.message,{cause:V}),n?.throwOnError)throw x}Object.assign(r,R);const I=M?"stay":"enter";let k;if(P)k={...P,cause:I,params:M?.params??r,_strictParams:R,search:Re(M?M.search:P.search,f),_strictSearch:g};else{const V=d.options.loader||d.options.beforeLoad||d.lazyFn||$o(d)?"pending":"success";k={id:C,ssr:d.options.ssr,index:c,routeId:d.id,params:M?.params??r,_strictParams:R,pathname:S,updatedAt:Date.now(),search:M?Re(M.search,f):f,_strictSearch:g,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:Ae()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:I,loaderDeps:M?Ce(M.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:d.options.staticData||{},fullPath:d.fullPath}}n?.preload||(k.globalNotFound=l===d.id),k.searchError=p;const A=this.getParentContext(h);k.context={...A,...k.__routeContext,...k.__beforeLoadContext},a[c]=k}for(let c=0;c<a.length;c++){const d=a[c],h=this.looseRoutesById[d.routeId],f=this.getMatch(d.id),g=u.get(d.routeId);if(d.params=g?Re(g.params,r):r,!f){const p=a[c-1],v=this.getParentContext(p);if(h.options.context){const y={deps:d.loaderDeps,params:d.params,context:v??{},location:e,navigate:S=>this.navigate({...S,_fromLocation:e}),buildLocation:this.buildLocation,cause:d.cause,abortController:d.abortController,preload:!!d.preload,matches:a,routeId:h.id};d.__routeContext=h.options.context(y)??void 0}d.context={...v,...d.__routeContext,...d.__beforeLoadContext}}}return a}matchRoutesLightweight(e){const{matchedRoutes:n,routeParams:t}=this.getMatchedRoutes(e.pathname),o=Ke(n),r={...e.search};for(const u of n)try{Object.assign(r,dt(u.options.validateSearch,r))}catch{}const s=Ke(this.stores.matchesId.get()),i=s&&this.stores.matchStores.get(s)?.get(),l=i&&i.routeId===o.id&&i.pathname===e.pathname;let a;if(l)a=i.params;else{const u=Object.assign(Object.create(null),t);for(const c of n)try{no(c,u)}catch{}a=u}return{matchedRoutes:n,fullPath:o.fullPath,search:r,params:a}}},vt=class extends Error{},Ds=class extends Error{};function $s(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function dt(e,n){if(e==null)return{};if("~standard"in e){const t=e["~standard"].validate(n);if(t instanceof Promise)throw new vt("Async validation not supported");if(t.issues)throw new vt(JSON.stringify(t.issues,void 0,2),{cause:t});return t.value}return"parse"in e?e.parse(n):typeof e=="function"?e(n):{}}function ks({pathname:e,routesById:n,processedTree:t}){const o=Object.create(null),r=le(e);let s;const i=as(r,t,!0);return i&&(s=i.route,Object.assign(o,i.rawParams)),{matchedRoutes:i?.branch||[n.__root__],routeParams:o,foundRoute:s}}function Vs({search:e,dest:n,destRoutes:t,_includeValidateSearch:o}){return js(t)(e,n,o??!1)}function js(e){let n,t;const o=[];for(const s of e){const i=s.options;if("search"in i)i.search?.middlewares&&o.push(...i.search.middlewares);else if(i.preSearchFilters||i.postSearchFilters){const a=({search:u,next:c})=>{const d=c(i.preSearchFilters?i.preSearchFilters.reduce((h,f)=>f(h),u):u);return i.postSearchFilters?i.postSearchFilters.reduce((h,f)=>f(h),d):d};o.push(a)}const l=i.validateSearch;if(l){const a=({search:u,next:c,meta:d})=>{const h=c(u);if(t)try{const f=dt(l,h);if(d&&f)for(const g in f)g in h||(d.defaulted||=new Map).set(g,f[g]);return{...h,...f}}catch{}return h};o.push(a)}}const r=(s,i,l)=>{if(s>=o.length){if(!n.search)return{};if(n.search===!0)return i;const u=we(n.search,i);return l&&(l.explicit=u),u}const a=(u,c)=>{if(c){const d=l||{};return{search:r(s+1,u,d),meta:d}}return r(s+1,u,l)};return o[s]({search:i,next:a,meta:l})};return function(i,l,a){return n=l,t=a,r(0,i)}}function Hs(e,n){if(e!=="root")for(let t=n.length-1;t>=0;t--){const o=n[t];if(o.children)return o.id}return xe}function no(e,n){const t=e.options.params?.parse??e.options.parseParams;if(t){const o=t(n);if(o===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(n,o)}}function Bs(){try{return sessionStorage}catch{return}}const Gs="tsr-scroll-restoration-v1_3",jo=Bs();function Ns(){try{return JSON.parse(jo?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function zs(){try{jo?.setItem(Gs,JSON.stringify(Fe))}catch{}}const Fe=Ns(),oo="data-scroll-restoration-id",Us=e=>e.state.__TSR_key||e.href;function qs(e){const n=e.getAttribute(oo);if(n)return`[${oo}="${n}"]`;let t="",o=e,r;for(;r=o.parentNode;){let s=1,i=o;for(;i=i.previousElementSibling;)s++;const l=`${o.localName}:nth-child(${s})`;t=t?`${l} > ${t}`:l,o=r}return t}let rt=!1;const be="window";function tn(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function ro(e){const n=[];for(const t of e){if(t===be)continue;const o=tn(t);o&&n.push(o)}return n}function Ks(e,n){const t=e.options.scrollRestoration,o=e._scroll;t&&(o.restoring=!0);const r=e.options.getScrollRestorationKey||Us,s=new Map,i=(u,c,d)=>{const h=s.get(u)||{};h.scrollX=c,h.scrollY=d,s.set(u,h)},l=u=>{if(!(rt||!o.restoring))if(u.target===document)i(be,scrollX,scrollY);else{const c=u.target;i(c,c.scrollLeft,c.scrollTop)}},a=u=>{if(!o.restoring)return;const c=Fe[u]||={};for(const[d,h]of s)d===be?c[be]=h:d.isConnected&&(c[qs(d)]=h)};t&&!o.restoration&&(o.restoration=!0,rt=!1,history.scrollRestoration="manual",document.addEventListener("scroll",l,!0),e.subscribe("onBeforeLoad",u=>{u.fromLocation&&a(r(u.fromLocation)),s.clear()}),addEventListener("pagehide",()=>{a(r(e.stores.resolvedLocation.get()??e.stores.location.get())),zs()})),!o.reset&&(o.reset=!0,e.subscribe("onRendered",u=>{const c=e.options.scrollRestorationBehavior,d=e.options.scrollToTopSelectors,h=o.next;let f;if(s.clear(),h||(o.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const g=r(u.toLocation),p=u.fromLocation&&r(u.fromLocation);if(o.restoring&&p&&p!==g){const v=Fe[p];if(v){let y=Fe[g];for(const S in v){if(S===be){if(h)continue}else{const w=tn(S);if(!w||h&&d&&(f??=ro(d),f.includes(w)))continue}y||(y=Fe[g]={}),y[S]??=v[S]}}}rt=!0;try{const v=u.toLocation.hash,y=u.toLocation.state.__hashScrollIntoViewOptions??!0;let S=!1;if(h){const w=en.get(u.toLocation),C=v&&y&&(w==="PUSH"||w==="REPLACE"),P=o.restoring?Fe[g]:void 0;if(P)for(const M in P){const{scrollX:R,scrollY:x}=P[M];if(M===be){if(C)continue;scrollTo({top:x,left:R,behavior:c}),S=!0}else{const I=tn(M);I&&(I.scrollLeft=R,I.scrollTop=x)}}if(!S&&!v){const M={top:0,left:0,behavior:c};if(scrollTo(M),d){f??=ro(d);for(const R of f)R.scrollTo(M)}}}!S&&v&&y&&document.getElementById(v)?.scrollIntoView(y)}finally{rt=!1}}))}const Ws="Error preloading route! ☝️";var Ho=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{this.originalIndex=n.originalIndex;const t=this.options,o=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=xe:this.parentRoute||ce();let r=o?xe:t?.path;r&&r!=="/"&&(r=bo(r));const s=t?.id||r;let i=o?xe:lt([this.parentRoute.id==="__root__"?"":this.parentRoute.id,s]);r==="__root__"&&(r="/"),i!=="__root__"&&(i=lt(["/",i]));const l=i==="__root__"?"/":lt([this.parentRoute.fullPath,r]);this._path=r,this._id=i,this._fullPath=l,this._to=le(l)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Cs({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},Qs=class extends Ho{constructor(e){super(e)}};function mn(e){const n=e.errorComponent??vn;return E.jsx(Ys,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:t,reset:o})=>t?L.createElement(n,{error:t,reset:o}):e.children})}var Ys=class extends L.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,n){this.props.onCatch&&this.props.onCatch(e,n)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function vn({error:e}){const[n,t]=L.useState(!1);return E.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[E.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[E.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),E.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(o=>!o),children:n?"Hide Error":"Show Error"})]}),E.jsx("div",{style:{height:".25rem"}}),n?E.jsx("div",{children:E.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?E.jsx("code",{children:e.message}):null})}):null]})}function Xs({children:e,fallback:n=null}){return Bo()?E.jsx(ze.Fragment,{children:e}):E.jsx(ze.Fragment,{children:n})}function Bo(){return ze.useSyncExternalStore(Js,()=>!0,()=>!1)}function Js(){return()=>{}}var Go=L.createContext(null);function ne(e){return L.useContext(Go)}var _t=L.createContext(void 0),Zs=L.createContext(void 0),G=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(G||{});function ei({update:e,notify:n,unwatched:t}){return{link:o,unlink:r,propagate:s,checkDirty:i,shallowPropagate:l};function o(u,c,d){const h=c.depsTail;if(h!==void 0&&h.dep===u)return;const f=h!==void 0?h.nextDep:c.deps;if(f!==void 0&&f.dep===u){f.version=d,c.depsTail=f;return}const g=u.subsTail;if(g!==void 0&&g.version===d&&g.sub===c)return;const p=c.depsTail=u.subsTail={version:d,dep:u,sub:c,prevDep:h,nextDep:f,prevSub:g,nextSub:void 0};f!==void 0&&(f.prevDep=p),h!==void 0?h.nextDep=p:c.deps=p,g!==void 0?g.nextSub=p:u.subs=p}function r(u,c=u.sub){const d=u.dep,h=u.prevDep,f=u.nextDep,g=u.nextSub,p=u.prevSub;return f!==void 0?f.prevDep=h:c.depsTail=h,h!==void 0?h.nextDep=f:c.deps=f,g!==void 0?g.prevSub=p:d.subsTail=p,p!==void 0?p.nextSub=g:(d.subs=g)===void 0&&t(d),f}function s(u){let c=u.nextSub,d;e:do{const h=u.sub;let f=h.flags;if(f&60?f&12?f&4?!(f&48)&&a(u,h)?(h.flags=f|40,f&=1):f=0:h.flags=f&-9|32:f=0:h.flags=f|32,f&2&&n(h),f&1){const g=h.subs;if(g!==void 0){const p=(u=g).nextSub;p!==void 0&&(d={value:c,prev:d},c=p);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;d!==void 0;)if(u=d.value,d=d.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function i(u,c){let d,h=0,f=!1;e:do{const g=u.dep,p=g.flags;if(c.flags&16)f=!0;else if((p&17)===17){if(e(g)){const v=g.subs;v.nextSub!==void 0&&l(v),f=!0}}else if((p&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(d={value:u,prev:d}),u=g.deps,c=g,++h;continue}if(!f){const v=u.nextDep;if(v!==void 0){u=v;continue}}for(;h--;){const v=c.subs,y=v.nextSub!==void 0;if(y?(u=d.value,d=d.prev):u=v,f){if(e(c)){y&&l(v),c=u.sub;continue}f=!1}else c.flags&=-33;c=u.sub;const S=u.nextDep;if(S!==void 0){u=S;continue e}}return f}while(!0)}function l(u){do{const c=u.sub,d=c.flags;(d&48)===32&&(c.flags=d|16,(d&6)===2&&n(c))}while((u=u.nextSub)!==void 0)}function a(u,c){let d=c.depsTail;for(;d!==void 0;){if(d===u)return!0;d=d.prevDep}return!1}}function ti(e,n,t){const o=typeof e=="object",r=o?e:void 0;return{next:(o?e.next:e)?.bind(r),error:(o?e.error:n)?.bind(r),complete:(o?e.complete:t)?.bind(r)}}const nn=[];let ft=0;const{link:so,unlink:ni,propagate:oi,checkDirty:No,shallowPropagate:io}=ei({update(e){return e._update()},notify(e){nn[on++]=e,e.flags&=~G.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=G.Mutable|G.Dirty,yt(e))}});let st=0,on=0,ae,rn=0;function zo(e){try{++rn,e()}finally{--rn||Uo()}}function yt(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=ni(t,e)}function Uo(){if(!(rn>0)){for(;st<on;){const e=nn[st];nn[st++]=void 0,e.notify()}st=0,on=0}}function ao(e,n){const t=typeof e=="function",o=e,r={_snapshot:t?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:t?G.None:G.Mutable,get(){return ae!==void 0&&so(r,ae,ft),r._snapshot},subscribe(s){const i=ti(s),l={current:!1},a=ri(()=>{r.get(),l.current?i.next?.(r._snapshot):l.current=!0});return{unsubscribe:()=>{a.stop()}}},_update(s){const i=ae,l=n?.compare??Object.is;if(t)ae=r,++ft,r.depsTail=void 0;else if(s===void 0)return!1;t&&(r.flags=G.Mutable|G.RecursedCheck);try{const a=r._snapshot,u=typeof s=="function"?s(a):s===void 0&&t?o(a):s;return a===void 0||!l(a,u)?(r._snapshot=u,!0):!1}finally{ae=i,t&&(r.flags&=~G.RecursedCheck),yt(r)}}};return t?(r.flags=G.Mutable|G.Dirty,r.get=function(){const s=r.flags;if(s&G.Dirty||s&G.Pending&&No(r.deps,r)){if(r._update()){const i=r.subs;i!==void 0&&io(i)}}else s&G.Pending&&(r.flags=s&~G.Pending);return ae!==void 0&&so(r,ae,ft),r._snapshot}):r.set=function(s){if(r._update(s)){const i=r.subs;i!==void 0&&(oi(i),io(i),Uo())}},r}function ri(e){const n=()=>{const o=ae;ae=t,++ft,t.depsTail=void 0,t.flags=G.Watching|G.RecursedCheck;try{return e()}finally{ae=o,t.flags&=~G.RecursedCheck,yt(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:G.Watching|G.RecursedCheck,notify(){const o=this.flags;o&G.Dirty||o&G.Pending&&No(this.deps,this)?n():this.flags=G.Watching},stop(){this.flags=G.None,this.depsTail=void 0,yt(this)}};return n(),t}var $t={exports:{}},kt={},Vt={exports:{}},jt={};/**
26
+ * @license React
27
+ * use-sync-external-store-shim.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var uo;function si(){if(uo)return jt;uo=1;var e=St();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var t=typeof Object.is=="function"?Object.is:n,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function l(d,h){var f=h(),g=o({inst:{value:f,getSnapshot:h}}),p=g[0].inst,v=g[1];return s(function(){p.value=f,p.getSnapshot=h,a(p)&&v({inst:p})},[d,f,h]),r(function(){return a(p)&&v({inst:p}),d(function(){a(p)&&v({inst:p})})},[d]),i(f),f}function a(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!t(d,f)}catch{return!0}}function u(d,h){return h()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return jt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,jt}var lo;function ii(){return lo||(lo=1,Vt.exports=si()),Vt.exports}/**
34
+ * @license React
35
+ * use-sync-external-store-shim/with-selector.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var co;function ai(){if(co)return kt;co=1;var e=St(),n=ii();function t(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var o=typeof Object.is=="function"?Object.is:t,r=n.useSyncExternalStore,s=e.useRef,i=e.useEffect,l=e.useMemo,a=e.useDebugValue;return kt.useSyncExternalStoreWithSelector=function(u,c,d,h,f){var g=s(null);if(g.current===null){var p={hasValue:!1,value:null};g.current=p}else p=g.current;g=l(function(){function y(M){if(!S){if(S=!0,w=M,M=h(M),f!==void 0&&p.hasValue){var R=p.value;if(f(R,M))return C=R}return C=M}if(R=C,o(w,M))return R;var x=h(M);return f!==void 0&&f(R,x)?(w=M,R):(w=M,C=x)}var S=!1,w,C,P=d===void 0?null:d;return[function(){return y(c())},P===null?void 0:function(){return y(P())}]},[c,d,h,f]);var v=r(u,g[0],g[1]);return i(function(){p.hasValue=!0,p.value=v},[v]),a(v),v},kt}var fo;function ui(){return fo||(fo=1,$t.exports=ai()),$t.exports}var qo=ui();const La=mo(qo);function li(e,n){return e===n}function ee(e,n,t=li){const o=L.useCallback(i=>{if(!e)return()=>{};const{unsubscribe:l}=e.subscribe(i);return l},[e]),r=L.useCallback(()=>e?.get(),[e]);return qo.useSyncExternalStoreWithSelector(o,r,r,n,t)}var ci={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function Ie(e){const n=ne(),t=L.useContext(e.from?Zs:_t),o=e.from??t,r=o?e.from?n.stores.getRouteMatchStore(o):n.stores.matchStores.get(o):void 0,s=L.useRef(void 0);return ee(r??ci,i=>{if((e.shouldThrow??!0)&&!i&&ce(),i===void 0)return;const l=e.select?e.select(i):i;if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Ce(s.current,l);return s.current=a,a}return l})}function Ko(e){return Ie({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function Wo(e){const{select:n,...t}=e;return Ie({...t,select:o=>n?n(o.loaderDeps):o.loaderDeps})}function Qo(e){return Ie({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function Yo(e){return Ie({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Xo(e){const n=ne();return L.useCallback(t=>n.navigate({...t,from:t.from??e?.from}),[e?.from,n])}function Jo(e){return Ie({...e,select:n=>e.select?e.select(n.context):n.context})}var di=Sr();function fi(e,n){const t=ne(),o=Yr(n),{activeProps:r,inactiveProps:s,activeOptions:i,to:l,preload:a,preloadDelay:u,preloadIntentProximity:c,hashScrollIntoView:d,replace:h,startTransition:f,resetScroll:g,viewTransition:p,children:v,target:y,disabled:S,style:w,className:C,onClick:P,onBlur:M,onFocus:R,onMouseEnter:x,onMouseLeave:I,onTouchStart:k,ignoreBlocker:A,params:V,search:Z,hash:z,state:oe,mask:re,reloadDocument:U,unsafeRelative:ve,from:De,_fromLocation:Je,...m}=e,_=Bo(),b=L.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),F=ee(t.stores.location,B=>B,(B,X)=>B.href===X.href),D=L.useMemo(()=>{const B={_fromLocation:F,...b};return t.buildLocation(B)},[t,F,b]),j=D.maskedLocation?D.maskedLocation.publicHref:D.publicHref,H=D.maskedLocation?D.maskedLocation.external:D.external,q=L.useMemo(()=>yi(j,H,t.history,S),[S,H,j,t.history]),N=L.useMemo(()=>{if(q?.external)return pt(q.href,t.protocolAllowlist)?void 0:q.href;if(!Si(l)&&!(typeof l!="string"||l.indexOf(":")===-1))try{return new URL(l),pt(l,t.protocolAllowlist)?void 0:l}catch{}},[l,q,t.protocolAllowlist]),$e=L.useMemo(()=>{if(N)return!1;if(i?.exact){if(!hs(F.pathname,D.pathname,t.basepath))return!1}else{const B=mt(F.pathname,t.basepath),X=mt(D.pathname,t.basepath);if(!(B.startsWith(X)&&(B.length===X.length||B[X.length]==="/")))return!1}return(i?.includeSearch??!0)&&!Pe(F.search,D.search,{partial:!i?.exact,ignoreUndefined:!i?.explicitUndefined})?!1:i?.includeHash?_&&F.hash===D.hash:!0},[i?.exact,i?.explicitUndefined,i?.includeHash,i?.includeSearch,F,N,_,D.hash,D.pathname,D.search,t.basepath]),Ze=$e?we(r,{})??hi:Ht,et=$e?Ht:we(s,{})??Ht,wn=[C,Ze.className,et.className].filter(Boolean).join(" "),Cn=(w||Ze.style||et.style)&&{...w,...Ze.style,...et.style},[dr,_n]=L.useState(!1),Pn=L.useRef(!1),Le=e.reloadDocument||N?!1:a??t.options.defaultPreload,xt=u??t.options.defaultPreloadDelay??0,ye=L.useCallback(()=>{t.preloadRoute({...b,_builtLocation:D}).catch(B=>{console.warn(B),console.warn(Ws)})},[t,b,D]);Qr(o,L.useCallback(B=>{B?.isIntersecting&&ye()},[ye]),vi,{disabled:!!S||Le!=="viewport"}),L.useEffect(()=>{Pn.current||!S&&Le==="render"&&(ye(),Pn.current=!0)},[S,ye,Le]);const fr=B=>{const X=B.currentTarget.getAttribute("target"),Se=y!==void 0?y:X;if(!S&&!Ri(B)&&!B.defaultPrevented&&(!Se||Se==="_self")&&B.button===0){B.preventDefault(),di.flushSync(()=>{_n(!0)});const gr=t.subscribe("onResolved",()=>{gr(),_n(!1)});t.navigate({...b,replace:h,resetScroll:g,hashScrollIntoView:d,startTransition:f,viewTransition:p,ignoreBlocker:A})}};if(N)return{...m,ref:o,href:N,...v&&{children:v},...y&&{target:y},...S&&{disabled:S},...w&&{style:w},...C&&{className:C},...P&&{onClick:P},...M&&{onBlur:M},...R&&{onFocus:R},...x&&{onMouseEnter:x},...I&&{onMouseLeave:I},...k&&{onTouchStart:k}};const xn=B=>{if(S||Le!=="intent")return;if(!xt){ye();return}const X=B.currentTarget;if(He.has(X))return;const Se=setTimeout(()=>{He.delete(X),ye()},xt);He.set(X,Se)},hr=B=>{S||Le!=="intent"||ye()},Mn=B=>{if(S||!Le||!xt)return;const X=B.currentTarget,Se=He.get(X);Se&&(clearTimeout(Se),He.delete(X))};return{...m,...Ze,...et,href:q?.href,ref:o,onClick:Ee([P,fr]),onBlur:Ee([M,Mn]),onFocus:Ee([R,xn]),onMouseEnter:Ee([x,xn]),onMouseLeave:Ee([I,Mn]),onTouchStart:Ee([k,hr]),disabled:!!S,target:y,...Cn&&{style:Cn},...wn&&{className:wn},...S&&gi,...$e&&pi,..._&&dr&&mi}}var Ht={},hi={className:"active"},gi={role:"link","aria-disabled":!0},pi={"data-status":"active","aria-current":"page"},mi={"data-transitioning":"transitioning"},He=new WeakMap,vi={rootMargin:"100px"},Ee=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function yi(e,n,t,o){if(!o)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function Si(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Zo=L.forwardRef((e,n)=>{const{_asChild:t,...o}=e,{type:r,...s}=fi(o,n),i=typeof o.children=="function"?o.children({isActive:s["data-status"]==="active"}):o.children;if(!t){const{disabled:l,...a}=s;return L.createElement("a",a,i)}return L.createElement(t,s,i)});function Ri(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var wi=class extends Ho{constructor(e){super(e),this.useMatch=n=>Ie({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Jo({...n,from:this.id}),this.useSearch=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Qo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Wo({...n,from:this.id}),this.useLoaderData=n=>Ko({...n,from:this.id}),this.useNavigate=()=>Xo({from:this.fullPath}),this.Link=ze.forwardRef((n,t)=>E.jsx(Zo,{ref:t,from:this.fullPath,...n}))}};function Ea(e){return new wi(e)}var Ci=class extends Qs{constructor(e){super(e),this.useMatch=n=>Ie({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Jo({...n,from:this.id}),this.useSearch=n=>Yo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Qo({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Wo({...n,from:this.id}),this.useLoaderData=n=>Ko({...n,from:this.id}),this.useNavigate=()=>Xo({from:this.fullPath}),this.Link=ze.forwardRef((n,t)=>E.jsx(Zo,{ref:t,from:this.fullPath,...n}))}};function Fa(e){return new Ci(e)}function _i(e){const n=ne(),t=`not-found-${ee(n.stores.location,o=>o.pathname)}-${ee(n.stores.status,o=>o)}`;return E.jsx(mn,{getResetKey:()=>t,onCatch:(o,r)=>{if(Q(o))e.onCatch?.(o,r);else throw o},errorComponent:({error:o})=>{if(Q(o))return e.fallback?.(o);throw o},children:e.children})}function Pi(){return E.jsx("p",{children:"Not Found"})}function Te(e){return E.jsx(E.Fragment,{children:e.children})}function er(e,n,t){return n.options.notFoundComponent?E.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?E.jsx(e.options.defaultNotFoundComponent,{...t}):E.jsx(Pi,{})}function xi(e){return null}function Mi(){return xi(ne()),null}var tr=L.memo(function({matchId:n}){const t=ne(),o=t.stores.matchStores.get(n);o||ce();const r=ee(t.stores.loadedAt,i=>i),s=ee(o,i=>i);return E.jsx(Ii,{router:t,matchId:n,resetKey:r,matchState:L.useMemo(()=>{const i=s.routeId,l=t.routesById[i].parentRoute?.id;return{routeId:i,ssr:s.ssr,_displayPending:s._displayPending,parentRouteId:l}},[s._displayPending,s.routeId,s.ssr,t.routesById])})});function Ii({router:e,matchId:n,resetKey:t,matchState:o}){const r=e.routesById[o.routeId],s=r.options.pendingComponent??e.options.defaultPendingComponent,i=s?E.jsx(s,{}):null,l=r.options.errorComponent??e.options.defaultErrorComponent,a=r.options.onCatch??e.options.defaultOnCatch,u=r.isRoot?r.options.notFoundComponent??e.options.notFoundRoute?.options.component:r.options.notFoundComponent,c=o.ssr===!1||o.ssr==="data-only",d=(!r.isRoot||r.options.wrapInSuspense||c)&&(r.options.wrapInSuspense??s??(r.options.errorComponent?.preload||c))?L.Suspense:Te,h=l?mn:Te,f=u?_i:Te;return E.jsxs(r.isRoot?r.options.shellComponent??Te:Te,{children:[E.jsx(_t.Provider,{value:n,children:E.jsx(d,{fallback:i,children:E.jsx(h,{getResetKey:()=>t,errorComponent:l||vn,onCatch:(g,p)=>{if(Q(g))throw g.routeId??=o.routeId,g;a?.(g,p)},children:E.jsx(f,{fallback:g=>{if(g.routeId??=o.routeId,!u||g.routeId&&g.routeId!==o.routeId||!g.routeId&&!r.isRoot)throw g;return L.createElement(u,g)},children:c||o._displayPending?E.jsx(Xs,{fallback:i,children:E.jsx(ho,{matchId:n})}):E.jsx(ho,{matchId:n})})})})}),o.parentRouteId===xe?E.jsxs(E.Fragment,{children:[E.jsx(Li,{resetKey:t}),e.options.scrollRestoration&&Po?E.jsx(Mi,{}):null]}):null]})}function Li({resetKey:e}){const n=ne(),t=L.useRef(void 0);return Ge(()=>{const o=n.latestLocation.href;(t.current===void 0||t.current!==o)&&(n.emit({type:"onRendered",...Oe(n.stores.location.get(),n.stores.resolvedLocation.get())}),t.current=o)},[n.latestLocation.state.__TSR_key,e,n]),null}var ho=L.memo(function({matchId:n}){const t=ne(),o=(c,d)=>t.getMatch(c.id)?._nonReactive[d]??c._nonReactive[d],r=t.stores.matchStores.get(n);r||ce();const s=ee(r,c=>c),i=s.routeId,l=t.routesById[i],a=L.useMemo(()=>{const c=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:s.loaderDeps,params:s._strictParams,search:s._strictSearch});return c?JSON.stringify(c):void 0},[i,s.loaderDeps,s._strictParams,s._strictSearch,t.options.defaultRemountDeps,t.routesById]),u=L.useMemo(()=>{const c=l.options.component??t.options.defaultComponent;return c?E.jsx(c,{},a):E.jsx(Ei,{})},[a,l.options.component,t.options.defaultComponent]);if(s._displayPending)throw o(s,"displayPendingPromise");if(s._forcePending)throw o(s,"minPendingPromise");if(s.status==="pending"){const c=l.options.pendingMinMs??t.options.defaultPendingMinMs;if(c){const d=t.getMatch(s.id);if(d&&!d._nonReactive.minPendingPromise){const h=Ae();d._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),d._nonReactive.minPendingPromise=void 0},c)}}throw o(s,"loadPromise")}if(s.status==="notFound")return Q(s.error)||ce(),er(t,l,s.error);if(s.status==="redirected")throw J(s.error)||ce(),o(s,"loadPromise");if(s.status==="error")throw s.error;return u}),Ei=L.memo(function(){const n=ne(),t=L.useContext(_t);let o,r=!1,s;{const u=t?n.stores.matchStores.get(t):void 0;[o,r]=ee(u,c=>[c?.routeId,c?.globalNotFound??!1]),s=ee(n.stores.matchesId,c=>c[c.findIndex(d=>d===t)+1])}const i=o?n.routesById[o]:void 0,l=n.options.defaultPendingComponent?E.jsx(n.options.defaultPendingComponent,{}):null;if(r)return i||ce(),er(n,i,void 0);if(!s)return null;const a=E.jsx(tr,{matchId:s});return o===xe?E.jsx(L.Suspense,{fallback:l,children:a}):a});function Fi(){const e=ne(),n=L.useRef({router:e,mounted:!1}),[t,o]=L.useState(!1),r=ee(e.stores.isLoading,d=>d),s=ee(e.stores.hasPending,d=>d),i=Et(r),l=r||t||s,a=Et(l),u=r||s,c=Et(u);return e.startTransition=d=>{o(!0),L.startTransition(()=>{d(),o(!1)})},L.useEffect(()=>{const d=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return le(e.latestLocation.publicHref)!==le(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{d()}},[e,e.history]),Ge(()=>{if(typeof window<"u"&&e.ssr||n.current.router===e&&n.current.mounted)return;n.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),Ge(()=>{i&&!r&&e.emit({type:"onLoad",...Oe(e.stores.location.get(),e.stores.resolvedLocation.get())})},[i,e,r]),Ge(()=>{c&&!u&&e.emit({type:"onBeforeRouteMount",...Oe(e.stores.location.get(),e.stores.resolvedLocation.get())})},[u,c,e]),Ge(()=>{if(a&&!l){const d=Oe(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...d}),zo(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[l,a,e]),null}function bi(){const e=ne(),n=e.routesById[xe].options.pendingComponent??e.options.defaultPendingComponent,t=n?E.jsx(n,{}):null,o=E.jsxs(typeof document<"u"&&e.ssr?Te:L.Suspense,{fallback:t,children:[E.jsx(Fi,{}),E.jsx(Ti,{})]});return e.options.InnerWrap?E.jsx(e.options.InnerWrap,{children:o}):o}function Ti(){const e=ne(),n=ee(e.stores.firstId,r=>r),t=ee(e.stores.loadedAt,r=>r),o=n?E.jsx(tr,{matchId:n}):null;return E.jsx(_t.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?o:E.jsx(mn,{getResetKey:()=>t,errorComponent:vn,onCatch:void 0,children:o})})}var Oi=e=>({createMutableStore:ao,createReadonlyStore:ao,batch:zo}),ba=e=>new Ai(e),Ai=class extends As{constructor(e){super(e,Oi)}};function Di({router:e,children:n,...t}){Mo(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const o=E.jsx(Go.Provider,{value:e,children:n});return e.options.Wrap?E.jsx(e.options.Wrap,{children:o}):o}function Ta({router:e,...n}){return E.jsx(Di,{router:e,...n,children:E.jsx(bi,{})})}/**
42
+ * table-core
43
+ *
44
+ * Copyright (c) TanStack
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE.md file in the root directory of this source tree.
48
+ *
49
+ * @license MIT
50
+ */function Oa(){return{accessor:(e,n)=>typeof e=="function"?{...n,accessorFn:e}:{...n,accessorKey:e},display:e=>e,group:e=>e}}function ge(e,n){return typeof e=="function"?e(n):e}function te(e,n){return t=>{n.setState(o=>({...o,[e]:ge(t,o[e])}))}}function Pt(e){return e instanceof Function}function $i(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function ki(e,n){const t=[],o=r=>{r.forEach(s=>{t.push(s);const i=n(s);i!=null&&i.length&&o(i)})};return o(e),t}function T(e,n,t){let o=[],r;return s=>{let i;t.key&&t.debug&&(i=Date.now());const l=e(s);if(!(l.length!==o.length||l.some((c,d)=>o[d]!==c)))return r;o=l;let u;if(t.key&&t.debug&&(u=Date.now()),r=n(...l),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const c=Math.round((Date.now()-i)*100)/100,d=Math.round((Date.now()-u)*100)/100,h=d/16,f=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${f(d,5)} /${f(c,5)} ms`,`
51
+ font-size: .6rem;
52
+ font-weight: bold;
53
+ color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,t?.key)}return r}}function O(e,n,t,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[n]},key:!1,onChange:o}}function Vi(e,n,t,o){const r=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:T(()=>[e,t,n,s],(i,l,a,u)=>({table:i,column:l,row:a,cell:u,getValue:u.getValue,renderValue:u.renderValue}),O(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,t,n,e)},{}),s}function ji(e,n,t,o){var r,s;const l={...e._getDefaultColumnDef(),...n},a=l.accessorKey;let u=(r=(s=l.id)!=null?s:a?typeof String.prototype.replaceAll=="function"?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,c;if(l.accessorFn?c=l.accessorFn:a&&(a.includes(".")?c=h=>{let f=h;for(const p of a.split(".")){var g;f=(g=f)==null?void 0:g[p]}return f}:c=h=>h[l.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:c,parent:o,depth:t,columnDef:l,columns:[],getFlatColumns:T(()=>[!0],()=>{var h;return[d,...(h=d.columns)==null?void 0:h.flatMap(f=>f.getFlatColumns())]},O(e.options,"debugColumns")),getLeafColumns:T(()=>[e._getOrderColumnsFn()],h=>{var f;if((f=d.columns)!=null&&f.length){let g=d.columns.flatMap(p=>p.getLeafColumns());return h(g)}return[d]},O(e.options,"debugColumns"))};for(const h of e._features)h.createColumn==null||h.createColumn(d,e);return d}const W="debugHeaders";function go(e,n,t){var o;let s={id:(o=t.id)!=null?o:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(l),i.push(a)};return l(s),i},getContext:()=>({table:e,header:s,column:n})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Hi={createTable:e=>{e.getHeaderGroups=T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var s,i;const l=(s=o?.map(d=>t.find(h=>h.id===d)).filter(Boolean))!=null?s:[],a=(i=r?.map(d=>t.find(h=>h.id===d)).filter(Boolean))!=null?i:[],u=t.filter(d=>!(o!=null&&o.includes(d.id))&&!(r!=null&&r.includes(d.id)));return it(n,[...l,...u,...a],e)},O(e.options,W)),e.getCenterHeaderGroups=T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>(t=t.filter(s=>!(o!=null&&o.includes(s.id))&&!(r!=null&&r.includes(s.id))),it(n,t,e,"center")),O(e.options,W)),e.getLeftHeaderGroups=T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const s=(r=o?.map(i=>t.find(l=>l.id===i)).filter(Boolean))!=null?r:[];return it(n,s,e,"left")},O(e.options,W)),e.getRightHeaderGroups=T(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const s=(r=o?.map(i=>t.find(l=>l.id===i)).filter(Boolean))!=null?r:[];return it(n,s,e,"right")},O(e.options,W)),e.getFooterGroups=T(()=>[e.getHeaderGroups()],n=>[...n].reverse(),O(e.options,W)),e.getLeftFooterGroups=T(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),O(e.options,W)),e.getCenterFooterGroups=T(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),O(e.options,W)),e.getRightFooterGroups=T(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),O(e.options,W)),e.getFlatHeaders=T(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),O(e.options,W)),e.getLeftFlatHeaders=T(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),O(e.options,W)),e.getCenterFlatHeaders=T(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),O(e.options,W)),e.getRightFlatHeaders=T(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),O(e.options,W)),e.getCenterLeafHeaders=T(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),O(e.options,W)),e.getLeftLeafHeaders=T(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),O(e.options,W)),e.getRightLeafHeaders=T(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),O(e.options,W)),e.getLeafHeaders=T(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,s,i,l,a,u;return[...(r=(s=n[0])==null?void 0:s.headers)!=null?r:[],...(i=(l=t[0])==null?void 0:l.headers)!=null?i:[],...(a=(u=o[0])==null?void 0:u.headers)!=null?a:[]].map(c=>c.getLeafHeaders()).flat()},O(e.options,W))}};function it(e,n,t,o){var r,s;let i=0;const l=function(h,f){f===void 0&&(f=1),i=Math.max(i,f),h.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&l(g.columns,f+1)},0)};l(e);let a=[];const u=(h,f)=>{const g={depth:f,id:[o,`${f}`].filter(Boolean).join("_"),headers:[]},p=[];h.forEach(v=>{const y=[...p].reverse()[0],S=v.column.depth===g.depth;let w,C=!1;if(S&&v.column.parent?w=v.column.parent:(w=v.column,C=!0),y&&y?.column===w)y.subHeaders.push(v);else{const P=go(t,w,{id:[o,f,w.id,v?.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${p.filter(M=>M.column===w).length}`:void 0,depth:f,index:p.length});P.subHeaders.push(v),p.push(P)}g.headers.push(v),v.headerGroup=g}),a.push(g),f>0&&u(p,f-1)},c=n.map((h,f)=>go(t,h,{depth:i,index:f}));u(c,i-1),a.reverse();const d=h=>h.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,v=0,y=[0];g.subHeaders&&g.subHeaders.length?(y=[],d(g.subHeaders).forEach(w=>{let{colSpan:C,rowSpan:P}=w;p+=C,y.push(P)})):p=1;const S=Math.min(...y);return v=v+S,g.colSpan=p,g.rowSpan=v,{colSpan:p,rowSpan:v}});return d((r=(s=a[0])==null?void 0:s.headers)!=null?r:[]),a}const Bi=(e,n,t,o,r,s,i)=>{let l={id:n,index:o,original:t,depth:r,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(l._valuesCache.hasOwnProperty(a))return l._valuesCache[a];const u=e.getColumn(a);if(u!=null&&u.accessorFn)return l._valuesCache[a]=u.accessorFn(l.original,o),l._valuesCache[a]},getUniqueValues:a=>{if(l._uniqueValuesCache.hasOwnProperty(a))return l._uniqueValuesCache[a];const u=e.getColumn(a);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[a]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[a]):(l._uniqueValuesCache[a]=[l.getValue(a)],l._uniqueValuesCache[a])},renderValue:a=>{var u;return(u=l.getValue(a))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ki(l.subRows,a=>a.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let a=[],u=l;for(;;){const c=u.getParentRow();if(!c)break;a.push(c),u=c}return a.reverse()},getAllCells:T(()=>[e.getAllLeafColumns()],a=>a.map(u=>Vi(e,l,u,u.id)),O(e.options,"debugRows")),_getAllCellsByColumnId:T(()=>[l.getAllCells()],a=>a.reduce((u,c)=>(u[c.column.id]=c,u),{}),O(e.options,"debugRows"))};for(let a=0;a<e._features.length;a++){const u=e._features[a];u==null||u.createRow==null||u.createRow(l,e)}return l},Gi={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},nr=(e,n,t)=>{var o,r;const s=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(n))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};nr.autoRemove=e=>ie(e);const or=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};or.autoRemove=e=>ie(e);const rr=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===t?.toLowerCase()};rr.autoRemove=e=>ie(e);const sr=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};sr.autoRemove=e=>ie(e);const ir=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});ir.autoRemove=e=>ie(e)||!(e!=null&&e.length);const ar=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});ar.autoRemove=e=>ie(e)||!(e!=null&&e.length);const ur=(e,n,t)=>e.getValue(n)===t;ur.autoRemove=e=>ie(e);const lr=(e,n,t)=>e.getValue(n)==t;lr.autoRemove=e=>ie(e);const yn=(e,n,t)=>{let[o,r]=t;const s=e.getValue(n);return s>=o&&s<=r};yn.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,r=typeof t!="number"?parseFloat(t):t,s=n===null||Number.isNaN(o)?-1/0:o,i=t===null||Number.isNaN(r)?1/0:r;if(s>i){const l=s;s=i,i=l}return[s,i]};yn.autoRemove=e=>ie(e)||ie(e[0])&&ie(e[1]);const ue={includesString:nr,includesStringSensitive:or,equalsString:rr,arrIncludes:sr,arrIncludesAll:ir,arrIncludesSome:ar,equals:ur,weakEquals:lr,inNumberRange:yn};function ie(e){return e==null||e===""}const Ni={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:te("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);return typeof o=="string"?ue.includesString:typeof o=="number"?ue.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?ue.equals:Array.isArray(o)?ue.arrIncludes:ue.weakEquals},e.getFilterFn=()=>{var t,o;return Pt(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?t:ue[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const r=e.getFilterFn(),s=o?.find(c=>c.id===e.id),i=ge(t,s?s.value:void 0);if(po(r,i,e)){var l;return(l=o?.filter(c=>c.id!==e.id))!=null?l:[]}const a={id:e.id,value:i};if(s){var u;return(u=o?.map(c=>c.id===e.id?a:c))!=null?u:[]}return o!=null&&o.length?[...o,a]:[a]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=r=>{var s;return(s=ge(n,r))==null?void 0:s.filter(i=>{const l=t.find(a=>a.id===i.id);if(l){const a=l.getFilterFn();if(po(a,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var t,o;e.setColumnFilters(n?[]:(t=(o=e.initialState)==null?void 0:o.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function po(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const zi=(e,n,t)=>t.reduce((o,r)=>{const s=r.getValue(e);return o+(typeof s=="number"?s:0)},0),Ui=(e,n,t)=>{let o;return t.forEach(r=>{const s=r.getValue(e);s!=null&&(o>s||o===void 0&&s>=s)&&(o=s)}),o},qi=(e,n,t)=>{let o;return t.forEach(r=>{const s=r.getValue(e);s!=null&&(o<s||o===void 0&&s>=s)&&(o=s)}),o},Ki=(e,n,t)=>{let o,r;return t.forEach(s=>{const i=s.getValue(e);i!=null&&(o===void 0?i>=i&&(o=r=i):(o>i&&(o=i),r<i&&(r=i)))}),[o,r]},Wi=(e,n)=>{let t=0,o=0;if(n.forEach(r=>{let s=r.getValue(e);s!=null&&(s=+s)>=s&&(++t,o+=s)}),t)return o/t},Qi=(e,n)=>{if(!n.length)return;const t=n.map(s=>s.getValue(e));if(!$i(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((s,i)=>s-i);return t.length%2!==0?r[o]:(r[o-1]+r[o])/2},Yi=(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),Xi=(e,n)=>new Set(n.map(t=>t.getValue(e))).size,Ji=(e,n)=>n.length,Bt={sum:zi,min:Ui,max:qi,extent:Ki,mean:Wi,median:Qi,unique:Yi,uniqueCount:Xi,count:Ji},Zi={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:te("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(o=>o!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,o;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);if(typeof o=="number")return Bt.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Bt.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return Pt(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?t:Bt[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function ea(e,n,t){if(!(n!=null&&n.length)||!t)return e;const o=e.filter(s=>!n.includes(s.id));return t==="remove"?o:[...n.map(s=>e.find(i=>i.id===s)).filter(Boolean),...o]}const ta={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:te("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=T(t=>[Ne(n,t)],t=>t.findIndex(o=>o.id===e.id),O(n.options,"debugColumns")),e.getIsFirstColumn=t=>{var o;return((o=Ne(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const r=Ne(n,t);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=T(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let s=[];if(!(n!=null&&n.length))s=r;else{const i=[...n],l=[...r];for(;l.length&&i.length;){const a=i.shift(),u=l.findIndex(c=>c.id===a);u>-1&&s.push(l.splice(u,1)[0])}s=[...s,...l]}return ea(s,t,o)},O(e.options,"debugTable"))}},Gt=()=>({left:[],right:[]}),na={getInitialState:e=>({columnPinning:Gt(),...e}),getDefaultOptions:e=>({onColumnPinningChange:te("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var s,i;if(t==="right"){var l,a;return{left:((l=r?.left)!=null?l:[]).filter(d=>!(o!=null&&o.includes(d))),right:[...((a=r?.right)!=null?a:[]).filter(d=>!(o!=null&&o.includes(d))),...o]}}if(t==="left"){var u,c;return{left:[...((u=r?.left)!=null?u:[]).filter(d=>!(o!=null&&o.includes(d))),...o],right:((c=r?.right)!=null?c:[]).filter(d=>!(o!=null&&o.includes(d)))}}return{left:((s=r?.left)!=null?s:[]).filter(d=>!(o!=null&&o.includes(d))),right:((i=r?.right)!=null?i:[]).filter(d=>!(o!=null&&o.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,s,i;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((s=(i=n.options.enableColumnPinning)!=null?i:n.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=n.getState().columnPinning,s=t.some(l=>o?.includes(l)),i=t.some(l=>r?.includes(l));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();return r?(t=(o=n.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=T(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const s=[...o??[],...r??[]];return t.filter(i=>!s.includes(i.column.id))},O(n.options,"debugRows")),e.getLeftVisibleCells=T(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,o)=>(o??[]).map(s=>t.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),O(n.options,"debugRows")),e.getRightVisibleCells=T(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(s=>t.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),O(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,o;return e.setColumnPinning(n?Gt():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:Gt())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var r,s;return!!((r=o.left)!=null&&r.length||(s=o.right)!=null&&s.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=T(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),O(e.options,"debugColumns")),e.getRightLeafColumns=T(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),O(e.options,"debugColumns")),e.getCenterLeafColumns=T(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const r=[...t??[],...o??[]];return n.filter(s=>!r.includes(s.id))},O(e.options,"debugColumns"))}};function oa(e){return e||(typeof document<"u"?document:null)}const at={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Nt=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),ra={getDefaultColumnDef:()=>at,getInitialState:e=>({columnSizing:{},columnSizingInfo:Nt(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:te("columnSizing",e),onColumnSizingInfoChange:te("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,r;const s=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:at.minSize,(o=s??e.columnDef.size)!=null?o:at.size),(r=e.columnDef.maxSize)!=null?r:at.maxSize)},e.getStart=T(t=>[t,Ne(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((r,s)=>r+s.getSize(),0),O(n.options,"debugColumns")),e.getAfter=T(t=>[t,Ne(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((r,s)=>r+s.getSize(),0),O(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...r}=t;return r})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var s;t+=(s=r.column.getSize())!=null?s:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),r=o?.getCanResize();return s=>{if(!o||!r||(s.persist==null||s.persist(),zt(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[o.id,o.getSize()]],a=zt(s)?Math.round(s.touches[0].clientX):s.clientX,u={},c=(y,S)=>{typeof S=="number"&&(n.setColumnSizingInfo(w=>{var C,P;const M=n.options.columnResizeDirection==="rtl"?-1:1,R=(S-((C=w?.startOffset)!=null?C:0))*M,x=Math.max(R/((P=w?.startSize)!=null?P:0),-.999999);return w.columnSizingStart.forEach(I=>{let[k,A]=I;u[k]=Math.round(Math.max(A+A*x,0)*100)/100}),{...w,deltaOffset:R,deltaPercentage:x}}),(n.options.columnResizeMode==="onChange"||y==="end")&&n.setColumnSizing(w=>({...w,...u})))},d=y=>c("move",y),h=y=>{c("end",y),n.setColumnSizingInfo(S=>({...S,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=oa(t),g={moveHandler:y=>d(y.clientX),upHandler:y=>{f?.removeEventListener("mousemove",g.moveHandler),f?.removeEventListener("mouseup",g.upHandler),h(y.clientX)}},p={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var S;f?.removeEventListener("touchmove",p.moveHandler),f?.removeEventListener("touchend",p.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),h((S=y.touches[0])==null?void 0:S.clientX)}},v=sa()?{passive:!1}:!1;zt(s)?(f?.addEventListener("touchmove",p.moveHandler,v),f?.addEventListener("touchend",p.upHandler,v)):(f?.addEventListener("mousemove",g.moveHandler,v),f?.addEventListener("mouseup",g.upHandler,v)),n.setColumnSizingInfo(y=>({...y,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?Nt():(t=e.initialState.columnSizingInfo)!=null?t:Nt())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0}}};let ut=null;function sa(){if(typeof ut=="boolean")return ut;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return ut=e,ut}function zt(e){return e.type==="touchstart"}const ia={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:te("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;const r=e.columns;return(t=r.length?r.some(s=>s.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=T(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),O(n.options,"debugRows")),e.getVisibleCells=T(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],O(n.options,"debugRows"))},createTable:e=>{const n=(t,o)=>T(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),O(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,s)=>({...r,[s.id]:t||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}};function Ne(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const aa={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},ua={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:te("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,o,r,s;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&((s=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ue.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return Pt(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:ue[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},la={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:te("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,s;e.setExpanded(o?{}:(r=(s=e.initialState)==null?void 0:s.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");o=Math.max(o,i.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var r;const s=o===!0?!0:!!(o!=null&&o[e.id]);let i={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=o,t=(r=t)!=null?r:!s,!s&&t)return{...i,[e.id]:!0};if(s&&!t){const{[e.id]:l,...a}=i;return a}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o?.[e.id])},e.getCanExpand=()=>{var t,o,r;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},sn=0,an=10,Ut=()=>({pageIndex:sn,pageSize:an}),ca={getInitialState:e=>({...e,pagination:{...Ut(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:te("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const r=s=>ge(o,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Ut():(r=e.initialState.pagination)!=null?r:Ut())},e.setPageIndex=o=>{e.setPagination(r=>{let s=ge(o,r.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...r,pageIndex:s}})},e.resetPageIndex=o=>{var r,s;e.setPageIndex(o?sn:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?r:sn)},e.resetPageSize=o=>{var r,s;e.setPageSize(o?an:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?r:an)},e.setPageSize=o=>{e.setPagination(r=>{const s=Math.max(1,ge(o,r.pageSize)),i=r.pageSize*r.pageIndex,l=Math.floor(i/s);return{...r,pageIndex:l,pageSize:s}})},e.setPageCount=o=>e.setPagination(r=>{var s;let i=ge(o,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...r,pageCount:i}}),e.getPageOptions=T(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((s,i)=>i)),r},O(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},qt=()=>({top:[],bottom:[]}),da={getInitialState:e=>({rowPinning:qt(),...e}),getDefaultOptions:e=>({onRowPinningChange:te("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,r)=>{const s=o?e.getLeafRows().map(a=>{let{id:u}=a;return u}):[],i=r?e.getParentRows().map(a=>{let{id:u}=a;return u}):[],l=new Set([...i,e.id,...s]);n.setRowPinning(a=>{var u,c;if(t==="bottom"){var d,h;return{top:((d=a?.top)!=null?d:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((h=a?.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(t==="top"){var f,g;return{top:[...((f=a?.top)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((g=a?.bottom)!=null?g:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=a?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((c=a?.bottom)!=null?c:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:r}=n.options;return typeof o=="function"?o(e):(t=o??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:r}=n.getState().rowPinning,s=t.some(l=>o?.includes(l)),i=t.some(l=>r?.includes(l));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();if(!r)return-1;const s=(t=r==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(i=>{let{id:l}=i;return l});return(o=s?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,o;return e.setRowPinning(n?qt():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:qt())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var r,s;return!!((r=o.top)!=null&&r.length||(s=o.bottom)!=null&&s.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(i=>n.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:o}))},e.getTopRows=T(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),O(e.options,"debugRows")),e.getBottomRows=T(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),O(e.options,"debugRows")),e.getCenterRows=T(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const r=new Set([...t??[],...o??[]]);return n.filter(s=>!r.has(s.id))},O(e.options,"debugRows"))}},fa={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:te("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},r=e.getPreGroupedRowModel().flatRows;return n?r.forEach(s=>{s.getCanSelect()&&(o[s.id]=!0)}):r.forEach(s=>{delete o[s.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(s=>{un(r,s.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=T(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?Kt(e,t):{rows:[],flatRows:[],rowsById:{}},O(e.options,"debugTable")),e.getFilteredSelectedRowModel=T(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?Kt(e,t):{rows:[],flatRows:[],rowsById:{}},O(e.options,"debugTable")),e.getGroupedSelectedRowModel=T(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?Kt(e,t):{rows:[],flatRows:[],rowsById:{}},O(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(r=>r.getCanSelect()&&!t[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(r=>!t[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const r=e.getIsSelected();n.setRowSelection(s=>{var i;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return s;const l={...s};return un(l,e.id,t,(i=o?.selectChildren)!=null?i:!0,n),l})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return Sn(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return ln(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return ln(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var r;t&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},un=(e,n,t,o,r)=>{var s;const i=r.getRow(n,!0);t?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>un(e,l.id,t,o,r))};function Kt(e,n){const t=e.getState().rowSelection,o=[],r={},s=function(i,l){return i.map(a=>{var u;const c=Sn(a,t);if(c&&(o.push(a),r[a.id]=a),(u=a.subRows)!=null&&u.length&&(a={...a,subRows:s(a.subRows)}),c)return a}).filter(Boolean)};return{rows:s(n.rows),flatRows:o,rowsById:r}}function Sn(e,n){var t;return(t=n[e.id])!=null?t:!1}function ln(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!r)&&(i.getCanSelect()&&(Sn(i,n)?s=!0:r=!1),i.subRows&&i.subRows.length)){const l=ln(i,n);l==="all"?s=!0:(l==="some"&&(s=!0),r=!1)}}),r?"all":s?"some":!1}const cn=/([0-9]+)/gm,ha=(e,n,t)=>cr(me(e.getValue(t)).toLowerCase(),me(n.getValue(t)).toLowerCase()),ga=(e,n,t)=>cr(me(e.getValue(t)),me(n.getValue(t))),pa=(e,n,t)=>Rn(me(e.getValue(t)).toLowerCase(),me(n.getValue(t)).toLowerCase()),ma=(e,n,t)=>Rn(me(e.getValue(t)),me(n.getValue(t))),va=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},ya=(e,n,t)=>Rn(e.getValue(t),n.getValue(t));function Rn(e,n){return e===n?0:e>n?1:-1}function me(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function cr(e,n){const t=e.split(cn).filter(Boolean),o=n.split(cn).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),s=o.shift(),i=parseInt(r,10),l=parseInt(s,10),a=[i,l].sort();if(isNaN(a[0])){if(r>s)return 1;if(s>r)return-1;continue}if(isNaN(a[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return t.length-o.length}const Be={alphanumeric:ha,alphanumericCaseSensitive:ga,text:pa,textCaseSensitive:ma,datetime:va,basic:ya},Sa={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:te("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of t){const s=r?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return Be.datetime;if(typeof s=="string"&&(o=!0,s.split(cn).length>1))return Be.alphanumeric}return o?Be.text:Be.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return Pt(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?t:Be[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const r=e.getNextSortingOrder(),s=typeof t<"u"&&t!==null;n.setSorting(i=>{const l=i?.find(f=>f.id===e.id),a=i?.findIndex(f=>f.id===e.id);let u=[],c,d=s?t:r==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&o?l?c="toggle":c="add":i!=null&&i.length&&a!==i.length-1?c="replace":l?c="toggle":c="replace",c==="toggle"&&(s||r||(c="remove")),c==="add"){var h;u=[...i,{id:e.id,desc:d}],u.splice(0,u.length-((h=n.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=i.map(f=>f.id===e.id?{...f,desc:d}:f):c==="remove"?u=i.filter(f=>f.id!==e.id):u=[{id:e.id,desc:d}];return u})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,r;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Ra=[Hi,ia,ta,na,Gi,Ni,aa,ua,Sa,Zi,la,ca,da,fa,ra];function wa(e){var n,t;const o=[...Ra,...(n=e._features)!=null?n:[]];let r={_features:o};const s=r._features.reduce((h,f)=>Object.assign(h,f.getDefaultOptions==null?void 0:f.getDefaultOptions(r)),{}),i=h=>r.options.mergeOptions?r.options.mergeOptions(s,h):{...s,...h};let a={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(h=>{var f;a=(f=h.getInitialState==null?void 0:h.getInitialState(a))!=null?f:a});const u=[];let c=!1;const d={_features:o,options:{...s,...e},initialState:a,_queue:h=>{u.push(h),c||(c=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();c=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{r.setState(r.initialState)},setOptions:h=>{const f=ge(h,r.options);r.options=i(f)},getState:()=>r.options.state,setState:h=>{r.options.onStateChange==null||r.options.onStateChange(h)},_getRowId:(h,f,g)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(h,f,g))!=null?p:`${g?[g.id,f].join("."):f}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(h,f)=>{let g=(f?r.getPrePaginationRowModel():r.getRowModel()).rowsById[h];if(!g&&(g=r.getCoreRowModel().rowsById[h],!g))throw new Error;return g},_getDefaultColumnDef:T(()=>[r.options.defaultColumn],h=>{var f;return h=(f=h)!=null?f:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,v;return(p=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...r._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...h}},O(e,"debugColumns")),_getColumnDefs:()=>r.options.columns,getAllColumns:T(()=>[r._getColumnDefs()],h=>{const f=function(g,p,v){return v===void 0&&(v=0),g.map(y=>{const S=ji(r,y,v,p),w=y;return S.columns=w.columns?f(w.columns,S,v+1):[],S})};return f(h)},O(e,"debugColumns")),getAllFlatColumns:T(()=>[r.getAllColumns()],h=>h.flatMap(f=>f.getFlatColumns()),O(e,"debugColumns")),_getAllFlatColumnsById:T(()=>[r.getAllFlatColumns()],h=>h.reduce((f,g)=>(f[g.id]=g,f),{}),O(e,"debugColumns")),getAllLeafColumns:T(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(h,f)=>{let g=h.flatMap(p=>p.getLeafColumns());return f(g)},O(e,"debugColumns")),getColumn:h=>r._getAllFlatColumnsById()[h]};Object.assign(r,d);for(let h=0;h<r._features.length;h++){const f=r._features[h];f==null||f.createTable==null||f.createTable(r)}return r}function Aa(){return e=>T(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,s,i){s===void 0&&(s=0);const l=[];for(let u=0;u<r.length;u++){const c=Bi(e,e._getRowId(r[u],u,i),r[u],u,s,void 0,i?.id);if(t.flatRows.push(c),t.rowsById[c.id]=c,l.push(c),e.options.getSubRows){var a;c.originalSubRows=e.options.getSubRows(r[u],u),(a=c.originalSubRows)!=null&&a.length&&(c.subRows=o(c.originalSubRows,s+1,c))}}return l};return t.rows=o(n),t},O(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Da(){return e=>T(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,r=[],s=o.filter(a=>{var u;return(u=e.getColumn(a.id))==null?void 0:u.getCanSort()}),i={};s.forEach(a=>{const u=e.getColumn(a.id);u&&(i[a.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=a=>{const u=a.map(c=>({...c}));return u.sort((c,d)=>{for(let f=0;f<s.length;f+=1){var h;const g=s[f],p=i[g.id],v=p.sortUndefined,y=(h=g?.desc)!=null?h:!1;let S=0;if(v){const w=c.getValue(g.id),C=d.getValue(g.id),P=w===void 0,M=C===void 0;if(P||M){if(v==="first")return P?-1:1;if(v==="last")return P?1:-1;S=P&&M?0:P?v:-v}}if(S===0&&(S=p.sortingFn(c,d,g.id)),S!==0)return y&&(S*=-1),p.invertSorting&&(S*=-1),S}return c.index-d.index}),u.forEach(c=>{var d;r.push(c),(d=c.subRows)!=null&&d.length&&(c.subRows=l(c.subRows))}),u};return{rows:l(t.rows),flatRows:r,rowsById:t.rowsById}},O(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
54
+ * react-table
55
+ *
56
+ * Copyright (c) TanStack
57
+ *
58
+ * This source code is licensed under the MIT license found in the
59
+ * LICENSE.md file in the root directory of this source tree.
60
+ *
61
+ * @license MIT
62
+ */function $a(e,n){return e?Ca(e)?L.createElement(e,n):e:null}function Ca(e){return _a(e)||typeof e=="function"||Pa(e)}function _a(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function Pa(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function ka(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=L.useState(()=>({current:wa(n)})),[o,r]=L.useState(()=>t.current.initialState);return t.current.setOptions(s=>({...s,...e,state:{...o,...e.state},onStateChange:i=>{r(i),e.onStateChange==null||e.onStateChange(i)}})),t.current}export{Ei as O,xa as Q,ze as R,Sr as a,L as b,ka as c,Oa as d,Da as e,$a as f,mo as g,Aa as h,Yo as i,E as j,Xo as k,Fa as l,Ea as m,ba as n,Ia as o,Ma as p,Ta as q,St as r,La as u};