nlm-memory 0.4.1 → 0.5.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 (90) hide show
  1. package/dist/cli/nlm.js +221 -32
  2. package/dist/cli/nlm.js.map +1 -1
  3. package/dist/core/adapters/cursor.d.ts +45 -0
  4. package/dist/core/adapters/cursor.js +397 -0
  5. package/dist/core/adapters/cursor.js.map +1 -0
  6. package/dist/core/adapters/from-source.js +10 -0
  7. package/dist/core/adapters/from-source.js.map +1 -1
  8. package/dist/core/adapters/windsurf.d.ts +44 -0
  9. package/dist/core/adapters/windsurf.js +299 -0
  10. package/dist/core/adapters/windsurf.js.map +1 -0
  11. package/dist/core/hook/claude-settings.d.ts +12 -5
  12. package/dist/core/hook/claude-settings.js +21 -6
  13. package/dist/core/hook/claude-settings.js.map +1 -1
  14. package/dist/core/sources/source-registry.d.ts +1 -1
  15. package/dist/core/sources/source-registry.js +18 -0
  16. package/dist/core/sources/source-registry.js.map +1 -1
  17. package/dist/core/storage/sqlite-session-store.d.ts +2 -0
  18. package/dist/core/storage/sqlite-session-store.js +38 -2
  19. package/dist/core/storage/sqlite-session-store.js.map +1 -1
  20. package/dist/hook/hook-auth.d.ts +13 -0
  21. package/dist/hook/hook-auth.js +19 -0
  22. package/dist/hook/hook-auth.js.map +1 -0
  23. package/dist/hook/prompt-recall-hook.js +7 -1
  24. package/dist/hook/prompt-recall-hook.js.map +1 -1
  25. package/dist/hook/session-start-hook.js +4 -1
  26. package/dist/hook/session-start-hook.js.map +1 -1
  27. package/dist/hook/stop-hook.js +4 -1
  28. package/dist/hook/stop-hook.js.map +1 -1
  29. package/dist/http/app.d.ts +2 -0
  30. package/dist/http/app.js +74 -0
  31. package/dist/http/app.js.map +1 -1
  32. package/dist/install/claude-code.js +1 -1
  33. package/dist/install/claude-code.js.map +1 -1
  34. package/dist/install/cursor.d.ts +25 -0
  35. package/dist/install/cursor.js +43 -0
  36. package/dist/install/cursor.js.map +1 -0
  37. package/dist/install/nlm-dir-perms.d.ts +19 -0
  38. package/dist/install/nlm-dir-perms.js +43 -0
  39. package/dist/install/nlm-dir-perms.js.map +1 -0
  40. package/dist/install/ollama.d.ts +18 -1
  41. package/dist/install/ollama.js +68 -10
  42. package/dist/install/ollama.js.map +1 -1
  43. package/dist/install/setup.d.ts +4 -0
  44. package/dist/install/setup.js +141 -18
  45. package/dist/install/setup.js.map +1 -1
  46. package/dist/install/windsurf.d.ts +25 -0
  47. package/dist/install/windsurf.js +43 -0
  48. package/dist/install/windsurf.js.map +1 -0
  49. package/dist/shared/types.d.ts +4 -0
  50. package/dist/ui/assets/{index-BA6IpU8g.css → index-C8cpwbYJ.css} +1 -1
  51. package/dist/ui/assets/index-CB50QnL-.js +69 -0
  52. package/dist/ui/index.html +2 -2
  53. package/logs/CHANGELOG/CHANGELOG-2026.md +186 -0
  54. package/logs/CHANGELOG/CHANGELOG.md +107 -235
  55. package/migrations/014_sources_cursor.sql +30 -0
  56. package/migrations/015_sources_windsurf.sql +30 -0
  57. package/package.json +1 -1
  58. package/plugin/scripts/prompt-recall-hook.mjs +55 -4
  59. package/plugin/scripts/stop-hook.mjs +57 -6
  60. package/src/cli/nlm.ts +224 -31
  61. package/src/core/adapters/cursor.ts +486 -0
  62. package/src/core/adapters/from-source.ts +10 -0
  63. package/src/core/adapters/windsurf.ts +386 -0
  64. package/src/core/hook/claude-settings.ts +30 -9
  65. package/src/core/sources/source-registry.ts +19 -1
  66. package/src/core/storage/sqlite-session-store.ts +46 -1
  67. package/src/hook/hook-auth.ts +18 -0
  68. package/src/hook/prompt-recall-hook.ts +7 -1
  69. package/src/hook/session-start-hook.ts +4 -1
  70. package/src/hook/stop-hook.ts +4 -1
  71. package/src/http/app.ts +78 -0
  72. package/src/install/claude-code.ts +1 -1
  73. package/src/install/cursor.ts +68 -0
  74. package/src/install/nlm-dir-perms.ts +55 -0
  75. package/src/install/ollama.ts +86 -10
  76. package/src/install/setup.ts +138 -17
  77. package/src/install/windsurf.ts +68 -0
  78. package/src/shared/types.ts +4 -0
  79. package/src/ui/components/SessionDrawer.tsx +97 -34
  80. package/src/ui/pages/River.tsx +90 -44
  81. package/src/ui/pages/Search.tsx +357 -64
  82. package/src/ui/pages/Thread.tsx +267 -56
  83. package/src/ui/styles.css +129 -5
  84. package/tests/integration/getbyids-sqlite.test.ts +40 -0
  85. package/tests/integration/hook-claude-settings.test.ts +14 -1
  86. package/tests/integration/mcp.test.ts +12 -0
  87. package/tests/integration/source-registry.test.ts +5 -3
  88. package/tests/unit/core/adapters/cursor.test.ts +485 -0
  89. package/tests/unit/core/adapters/windsurf.test.ts +416 -0
  90. package/dist/ui/assets/index-B_qIVV0k.js +0 -69
@@ -1,69 +0,0 @@
1
- function Td(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const a=Object.getOwnPropertyDescriptor(r,l);a&&Object.defineProperty(e,l,a.get?a:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const a of l)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const a={};return l.integrity&&(a.integrity=l.integrity),l.referrerPolicy&&(a.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?a.credentials="include":l.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(l){if(l.ep)return;l.ep=!0;const a=n(l);fetch(l.href,a)}})();function Rd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var eu={exports:{}},Ol={},tu={exports:{}},$={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 wr=Symbol.for("react.element"),Md=Symbol.for("react.portal"),Od=Symbol.for("react.fragment"),zd=Symbol.for("react.strict_mode"),Id=Symbol.for("react.profiler"),Dd=Symbol.for("react.provider"),$d=Symbol.for("react.context"),Fd=Symbol.for("react.forward_ref"),Ud=Symbol.for("react.suspense"),Ad=Symbol.for("react.memo"),bd=Symbol.for("react.lazy"),Ti=Symbol.iterator;function Bd(e){return e===null||typeof e!="object"?null:(e=Ti&&e[Ti]||e["@@iterator"],typeof e=="function"?e:null)}var nu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ru=Object.assign,lu={};function Cn(e,t,n){this.props=e,this.context=t,this.refs=lu,this.updater=n||nu}Cn.prototype.isReactComponent={};Cn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Cn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function su(){}su.prototype=Cn.prototype;function Ma(e,t,n){this.props=e,this.context=t,this.refs=lu,this.updater=n||nu}var Oa=Ma.prototype=new su;Oa.constructor=Ma;ru(Oa,Cn.prototype);Oa.isPureReactComponent=!0;var Ri=Array.isArray,au=Object.prototype.hasOwnProperty,za={current:null},iu={key:!0,ref:!0,__self:!0,__source:!0};function ou(e,t,n){var r,l={},a=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)au.call(t,r)&&!iu.hasOwnProperty(r)&&(l[r]=t[r]);var o=arguments.length-2;if(o===1)l.children=n;else if(1<o){for(var u=Array(o),d=0;d<o;d++)u[d]=arguments[d+2];l.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)l[r]===void 0&&(l[r]=o[r]);return{$$typeof:wr,type:e,key:a,ref:i,props:l,_owner:za.current}}function Wd(e,t){return{$$typeof:wr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ia(e){return typeof e=="object"&&e!==null&&e.$$typeof===wr}function Vd(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mi=/\/+/g;function ts(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Vd(""+e.key):t.toString(36)}function Yr(e,t,n,r,l){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case wr:case Md:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+ts(i,0):r,Ri(l)?(n="",e!=null&&(n=e.replace(Mi,"$&/")+"/"),Yr(l,t,n,"",function(d){return d})):l!=null&&(Ia(l)&&(l=Wd(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(Mi,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",Ri(e))for(var o=0;o<e.length;o++){a=e[o];var u=r+ts(a,o);i+=Yr(a,t,n,u,l)}else if(u=Bd(e),typeof u=="function")for(e=u.call(e),o=0;!(a=e.next()).done;)a=a.value,u=r+ts(a,o++),i+=Yr(a,t,n,u,l);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Lr(e,t,n){if(e==null)return e;var r=[],l=0;return Yr(e,r,"","",function(a){return t.call(n,a,l++)}),r}function Hd(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ge={current:null},Xr={transition:null},Kd={ReactCurrentDispatcher:ge,ReactCurrentBatchConfig:Xr,ReactCurrentOwner:za};function uu(){throw Error("act(...) is not supported in production builds of React.")}$.Children={map:Lr,forEach:function(e,t,n){Lr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Lr(e,function(){t++}),t},toArray:function(e){return Lr(e,function(t){return t})||[]},only:function(e){if(!Ia(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};$.Component=Cn;$.Fragment=Od;$.Profiler=Id;$.PureComponent=Ma;$.StrictMode=zd;$.Suspense=Ud;$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kd;$.act=uu;$.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ru({},e.props),l=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=za.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)au.call(t,u)&&!iu.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var d=0;d<u;d++)o[d]=arguments[d+2];r.children=o}return{$$typeof:wr,type:e.type,key:l,ref:a,props:r,_owner:i}};$.createContext=function(e){return e={$$typeof:$d,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Dd,_context:e},e.Consumer=e};$.createElement=ou;$.createFactory=function(e){var t=ou.bind(null,e);return t.type=e,t};$.createRef=function(){return{current:null}};$.forwardRef=function(e){return{$$typeof:Fd,render:e}};$.isValidElement=Ia;$.lazy=function(e){return{$$typeof:bd,_payload:{_status:-1,_result:e},_init:Hd}};$.memo=function(e,t){return{$$typeof:Ad,type:e,compare:t===void 0?null:t}};$.startTransition=function(e){var t=Xr.transition;Xr.transition={};try{e()}finally{Xr.transition=t}};$.unstable_act=uu;$.useCallback=function(e,t){return ge.current.useCallback(e,t)};$.useContext=function(e){return ge.current.useContext(e)};$.useDebugValue=function(){};$.useDeferredValue=function(e){return ge.current.useDeferredValue(e)};$.useEffect=function(e,t){return ge.current.useEffect(e,t)};$.useId=function(){return ge.current.useId()};$.useImperativeHandle=function(e,t,n){return ge.current.useImperativeHandle(e,t,n)};$.useInsertionEffect=function(e,t){return ge.current.useInsertionEffect(e,t)};$.useLayoutEffect=function(e,t){return ge.current.useLayoutEffect(e,t)};$.useMemo=function(e,t){return ge.current.useMemo(e,t)};$.useReducer=function(e,t,n){return ge.current.useReducer(e,t,n)};$.useRef=function(e){return ge.current.useRef(e)};$.useState=function(e){return ge.current.useState(e)};$.useSyncExternalStore=function(e,t,n){return ge.current.useSyncExternalStore(e,t,n)};$.useTransition=function(){return ge.current.useTransition()};$.version="18.3.1";tu.exports=$;var y=tu.exports;const cu=Rd(y),Qd=Td({__proto__:null,default:cu},[y]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its 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 Yd=y,Xd=Symbol.for("react.element"),Gd=Symbol.for("react.fragment"),Jd=Object.prototype.hasOwnProperty,Zd=Yd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,qd={key:!0,ref:!0,__self:!0,__source:!0};function du(e,t,n){var r,l={},a=null,i=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Jd.call(t,r)&&!qd.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:Xd,type:e,key:a,ref:i,props:l,_owner:Zd.current}}Ol.Fragment=Gd;Ol.jsx=du;Ol.jsxs=du;eu.exports=Ol;var s=eu.exports,fu={exports:{}},Le={},pu={exports:{}},hu={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its 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
- */(function(e){function t(T,z){var D=T.length;T.push(z);e:for(;0<D;){var Z=D-1>>>1,re=T[Z];if(0<l(re,z))T[Z]=z,T[D]=re,D=Z;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var z=T[0],D=T.pop();if(D!==z){T[0]=D;e:for(var Z=0,re=T.length,_r=re>>>1;Z<_r;){var Mt=2*(Z+1)-1,es=T[Mt],Ot=Mt+1,Pr=T[Ot];if(0>l(es,D))Ot<re&&0>l(Pr,es)?(T[Z]=Pr,T[Ot]=D,Z=Ot):(T[Z]=es,T[Mt]=D,Z=Mt);else if(Ot<re&&0>l(Pr,D))T[Z]=Pr,T[Ot]=D,Z=Ot;else break e}}return z}function l(T,z){var D=T.sortIndex-z.sortIndex;return D!==0?D:T.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var u=[],d=[],m=1,p=null,h=3,w=!1,v=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(T){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=T)r(d),z.sortIndex=z.expirationTime,t(u,z);else break;z=n(d)}}function x(T){if(j=!1,g(T),!v)if(n(u)!==null)v=!0,B(k);else{var z=n(d);z!==null&&G(x,z.startTime-T)}}function k(T,z){v=!1,j&&(j=!1,c(_),_=-1),w=!0;var D=h;try{for(g(z),p=n(u);p!==null&&(!(p.expirationTime>z)||T&&!U());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,h=p.priorityLevel;var re=Z(p.expirationTime<=z);z=e.unstable_now(),typeof re=="function"?p.callback=re:p===n(u)&&r(u),g(z)}else r(u);p=n(u)}if(p!==null)var _r=!0;else{var Mt=n(d);Mt!==null&&G(x,Mt.startTime-z),_r=!1}return _r}finally{p=null,h=D,w=!1}}var S=!1,C=null,_=-1,O=5,M=-1;function U(){return!(e.unstable_now()-M<O)}function xe(){if(C!==null){var T=e.unstable_now();M=T;var z=!0;try{z=C(!0,T)}finally{z?L():(S=!1,C=null)}}else S=!1}var L;if(typeof f=="function")L=function(){f(xe)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,I=P.port2;P.port1.onmessage=xe,L=function(){I.postMessage(null)}}else L=function(){N(xe,0)};function B(T){C=T,S||(S=!0,L())}function G(T,z){_=N(function(){T(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){v||w||(v=!0,B(k))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var D=h;h=z;try{return T()}finally{h=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,z){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var D=h;h=T;try{return z()}finally{h=D}},e.unstable_scheduleCallback=function(T,z,D){var Z=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?Z+D:Z):D=Z,T){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=D+re,T={id:m++,callback:z,priorityLevel:T,startTime:D,expirationTime:re,sortIndex:-1},D>Z?(T.sortIndex=D,t(d,T),n(u)===null&&T===n(d)&&(j?(c(_),_=-1):j=!0,G(x,D-Z))):(T.sortIndex=re,t(u,T),v||w||(v=!0,B(k))),T},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(T){var z=h;return function(){var D=h;h=z;try{return T.apply(this,arguments)}finally{h=D}}}})(hu);pu.exports=hu;var ef=pu.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its 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 tf=y,Pe=ef;function E(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var mu=new Set,nr={};function Kt(e,t){gn(e,t),gn(e+"Capture",t)}function gn(e,t){for(nr[e]=t,e=0;e<t.length;e++)mu.add(t[e])}var tt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zs=Object.prototype.hasOwnProperty,nf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Oi={},zi={};function rf(e){return zs.call(zi,e)?!0:zs.call(Oi,e)?!1:nf.test(e)?zi[e]=!0:(Oi[e]=!0,!1)}function lf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sf(e,t,n,r){if(t===null||typeof t>"u"||lf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ye(e,t,n,r,l,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){oe[e]=new ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];oe[t]=new ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){oe[e]=new ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){oe[e]=new ye(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){oe[e]=new ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){oe[e]=new ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){oe[e]=new ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){oe[e]=new ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){oe[e]=new ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var Da=/[\-:]([a-z])/g;function $a(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Da,$a);oe[t]=new ye(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Da,$a);oe[t]=new ye(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Da,$a);oe[t]=new ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){oe[e]=new ye(e,1,!1,e.toLowerCase(),null,!1,!1)});oe.xlinkHref=new ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){oe[e]=new ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fa(e,t,n,r){var l=oe.hasOwnProperty(t)?oe[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(sf(t,n,l,r)&&(n=null),r||l===null?rf(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var st=tf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Tr=Symbol.for("react.element"),Jt=Symbol.for("react.portal"),Zt=Symbol.for("react.fragment"),Ua=Symbol.for("react.strict_mode"),Is=Symbol.for("react.profiler"),vu=Symbol.for("react.provider"),gu=Symbol.for("react.context"),Aa=Symbol.for("react.forward_ref"),Ds=Symbol.for("react.suspense"),$s=Symbol.for("react.suspense_list"),ba=Symbol.for("react.memo"),ot=Symbol.for("react.lazy"),yu=Symbol.for("react.offscreen"),Ii=Symbol.iterator;function Mn(e){return e===null||typeof e!="object"?null:(e=Ii&&e[Ii]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,ns;function An(e){if(ns===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ns=t&&t[1]||""}return`
34
- `+ns+e}var rs=!1;function ls(e,t){if(!e||rs)return"";rs=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var l=d.stack.split(`
35
- `),a=r.stack.split(`
36
- `),i=l.length-1,o=a.length-1;1<=i&&0<=o&&l[i]!==a[o];)o--;for(;1<=i&&0<=o;i--,o--)if(l[i]!==a[o]){if(i!==1||o!==1)do if(i--,o--,0>o||l[i]!==a[o]){var u=`
37
- `+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=o);break}}}finally{rs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?An(e):""}function af(e){switch(e.tag){case 5:return An(e.type);case 16:return An("Lazy");case 13:return An("Suspense");case 19:return An("SuspenseList");case 0:case 2:case 15:return e=ls(e.type,!1),e;case 11:return e=ls(e.type.render,!1),e;case 1:return e=ls(e.type,!0),e;default:return""}}function Fs(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Zt:return"Fragment";case Jt:return"Portal";case Is:return"Profiler";case Ua:return"StrictMode";case Ds:return"Suspense";case $s:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gu:return(e.displayName||"Context")+".Consumer";case vu:return(e._context.displayName||"Context")+".Provider";case Aa:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ba:return t=e.displayName||null,t!==null?t:Fs(e.type)||"Memo";case ot:t=e._payload,e=e._init;try{return Fs(e(t))}catch{}}return null}function of(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fs(t);case 8:return t===Ua?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ct(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uf(e){var t=xu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rr(e){e._valueTracker||(e._valueTracker=uf(e))}function ju(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function il(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Us(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Di(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ct(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wu(e,t){t=t.checked,t!=null&&Fa(e,"checked",t,!1)}function As(e,t){wu(e,t);var n=Ct(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bs(e,t.type,n):t.hasOwnProperty("defaultValue")&&bs(e,t.type,Ct(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $i(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function bs(e,t,n){(t!=="number"||il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bn=Array.isArray;function cn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ct(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Bs(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(E(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fi(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(E(92));if(bn(n)){if(1<n.length)throw Error(E(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ct(n)}}function Nu(e,t){var n=Ct(t.value),r=Ct(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Ui(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Su(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ws(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Su(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mr,ku=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Mr=Mr||document.createElement("div"),Mr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},cf=["Webkit","ms","Moz","O"];Object.keys(Vn).forEach(function(e){cf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vn[t]=Vn[e]})});function Cu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vn.hasOwnProperty(e)&&Vn[e]?(""+t).trim():t+"px"}function Eu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Cu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var df=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vs(e,t){if(t){if(df[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(E(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(E(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(E(61))}if(t.style!=null&&typeof t.style!="object")throw Error(E(62))}}function Hs(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ks=null;function Ba(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qs=null,dn=null,fn=null;function Ai(e){if(e=kr(e)){if(typeof Qs!="function")throw Error(E(280));var t=e.stateNode;t&&(t=Fl(t),Qs(e.stateNode,e.type,t))}}function _u(e){dn?fn?fn.push(e):fn=[e]:dn=e}function Pu(){if(dn){var e=dn,t=fn;if(fn=dn=null,Ai(e),t)for(e=0;e<t.length;e++)Ai(t[e])}}function Lu(e,t){return e(t)}function Tu(){}var ss=!1;function Ru(e,t,n){if(ss)return e(t,n);ss=!0;try{return Lu(e,t,n)}finally{ss=!1,(dn!==null||fn!==null)&&(Tu(),Pu())}}function lr(e,t){var n=e.stateNode;if(n===null)return null;var r=Fl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(E(231,t,typeof n));return n}var Ys=!1;if(tt)try{var On={};Object.defineProperty(On,"passive",{get:function(){Ys=!0}}),window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{Ys=!1}function ff(e,t,n,r,l,a,i,o,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(m){this.onError(m)}}var Hn=!1,ol=null,ul=!1,Xs=null,pf={onError:function(e){Hn=!0,ol=e}};function hf(e,t,n,r,l,a,i,o,u){Hn=!1,ol=null,ff.apply(pf,arguments)}function mf(e,t,n,r,l,a,i,o,u){if(hf.apply(this,arguments),Hn){if(Hn){var d=ol;Hn=!1,ol=null}else throw Error(E(198));ul||(ul=!0,Xs=d)}}function Qt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Mu(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bi(e){if(Qt(e)!==e)throw Error(E(188))}function vf(e){var t=e.alternate;if(!t){if(t=Qt(e),t===null)throw Error(E(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var a=l.alternate;if(a===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===a.child){for(a=l.child;a;){if(a===n)return bi(l),e;if(a===r)return bi(l),t;a=a.sibling}throw Error(E(188))}if(n.return!==r.return)n=l,r=a;else{for(var i=!1,o=l.child;o;){if(o===n){i=!0,n=l,r=a;break}if(o===r){i=!0,r=l,n=a;break}o=o.sibling}if(!i){for(o=a.child;o;){if(o===n){i=!0,n=a,r=l;break}if(o===r){i=!0,r=a,n=l;break}o=o.sibling}if(!i)throw Error(E(189))}}if(n.alternate!==r)throw Error(E(190))}if(n.tag!==3)throw Error(E(188));return n.stateNode.current===n?e:t}function Ou(e){return e=vf(e),e!==null?zu(e):null}function zu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zu(e);if(t!==null)return t;e=e.sibling}return null}var Iu=Pe.unstable_scheduleCallback,Bi=Pe.unstable_cancelCallback,gf=Pe.unstable_shouldYield,yf=Pe.unstable_requestPaint,q=Pe.unstable_now,xf=Pe.unstable_getCurrentPriorityLevel,Wa=Pe.unstable_ImmediatePriority,Du=Pe.unstable_UserBlockingPriority,cl=Pe.unstable_NormalPriority,jf=Pe.unstable_LowPriority,$u=Pe.unstable_IdlePriority,zl=null,Qe=null;function wf(e){if(Qe&&typeof Qe.onCommitFiberRoot=="function")try{Qe.onCommitFiberRoot(zl,e,void 0,(e.current.flags&128)===128)}catch{}}var be=Math.clz32?Math.clz32:kf,Nf=Math.log,Sf=Math.LN2;function kf(e){return e>>>=0,e===0?32:31-(Nf(e)/Sf|0)|0}var Or=64,zr=4194304;function Bn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~l;o!==0?r=Bn(o):(a&=i,a!==0&&(r=Bn(a)))}else i=n&~l,i!==0?r=Bn(i):a!==0&&(r=Bn(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,a=t&-t,l>=a||l===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-be(t),l=1<<n,r|=e[n],t&=~l;return r}function Cf(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ef(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-be(a),o=1<<i,u=l[i];u===-1?(!(o&n)||o&r)&&(l[i]=Cf(o,t)):u<=t&&(e.expiredLanes|=o),a&=~o}}function Gs(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fu(){var e=Or;return Or<<=1,!(Or&4194240)&&(Or=64),e}function as(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Nr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-be(t),e[t]=n}function _f(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-be(n),a=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~a}}function Va(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-be(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var A=0;function Uu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Au,Ha,bu,Bu,Wu,Js=!1,Ir=[],vt=null,gt=null,yt=null,sr=new Map,ar=new Map,ct=[],Pf="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Wi(e,t){switch(e){case"focusin":case"focusout":vt=null;break;case"dragenter":case"dragleave":gt=null;break;case"mouseover":case"mouseout":yt=null;break;case"pointerover":case"pointerout":sr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ar.delete(t.pointerId)}}function zn(e,t,n,r,l,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[l]},t!==null&&(t=kr(t),t!==null&&Ha(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function Lf(e,t,n,r,l){switch(t){case"focusin":return vt=zn(vt,e,t,n,r,l),!0;case"dragenter":return gt=zn(gt,e,t,n,r,l),!0;case"mouseover":return yt=zn(yt,e,t,n,r,l),!0;case"pointerover":var a=l.pointerId;return sr.set(a,zn(sr.get(a)||null,e,t,n,r,l)),!0;case"gotpointercapture":return a=l.pointerId,ar.set(a,zn(ar.get(a)||null,e,t,n,r,l)),!0}return!1}function Vu(e){var t=Dt(e.target);if(t!==null){var n=Qt(t);if(n!==null){if(t=n.tag,t===13){if(t=Mu(n),t!==null){e.blockedOn=t,Wu(e.priority,function(){bu(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zs(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ks=r,n.target.dispatchEvent(r),Ks=null}else return t=kr(n),t!==null&&Ha(t),e.blockedOn=n,!1;t.shift()}return!0}function Vi(e,t,n){Gr(e)&&n.delete(t)}function Tf(){Js=!1,vt!==null&&Gr(vt)&&(vt=null),gt!==null&&Gr(gt)&&(gt=null),yt!==null&&Gr(yt)&&(yt=null),sr.forEach(Vi),ar.forEach(Vi)}function In(e,t){e.blockedOn===t&&(e.blockedOn=null,Js||(Js=!0,Pe.unstable_scheduleCallback(Pe.unstable_NormalPriority,Tf)))}function ir(e){function t(l){return In(l,e)}if(0<Ir.length){In(Ir[0],e);for(var n=1;n<Ir.length;n++){var r=Ir[n];r.blockedOn===e&&(r.blockedOn=null)}}for(vt!==null&&In(vt,e),gt!==null&&In(gt,e),yt!==null&&In(yt,e),sr.forEach(t),ar.forEach(t),n=0;n<ct.length;n++)r=ct[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ct.length&&(n=ct[0],n.blockedOn===null);)Vu(n),n.blockedOn===null&&ct.shift()}var pn=st.ReactCurrentBatchConfig,fl=!0;function Rf(e,t,n,r){var l=A,a=pn.transition;pn.transition=null;try{A=1,Ka(e,t,n,r)}finally{A=l,pn.transition=a}}function Mf(e,t,n,r){var l=A,a=pn.transition;pn.transition=null;try{A=4,Ka(e,t,n,r)}finally{A=l,pn.transition=a}}function Ka(e,t,n,r){if(fl){var l=Zs(e,t,n,r);if(l===null)vs(e,t,r,pl,n),Wi(e,r);else if(Lf(l,e,t,n,r))r.stopPropagation();else if(Wi(e,r),t&4&&-1<Pf.indexOf(e)){for(;l!==null;){var a=kr(l);if(a!==null&&Au(a),a=Zs(e,t,n,r),a===null&&vs(e,t,r,pl,n),a===l)break;l=a}l!==null&&r.stopPropagation()}else vs(e,t,r,null,n)}}var pl=null;function Zs(e,t,n,r){if(pl=null,e=Ba(r),e=Dt(e),e!==null)if(t=Qt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Mu(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return pl=e,null}function Hu(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(xf()){case Wa:return 1;case Du:return 4;case cl:case jf:return 16;case $u:return 536870912;default:return 16}default:return 16}}var ft=null,Qa=null,Jr=null;function Ku(){if(Jr)return Jr;var e,t=Qa,n=t.length,r,l="value"in ft?ft.value:ft.textContent,a=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===l[a-r];r++);return Jr=l.slice(e,1<r?1-r:void 0)}function Zr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Dr(){return!0}function Hi(){return!1}function Te(e){function t(n,r,l,a,i){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Dr:Hi,this.isPropagationStopped=Hi,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Dr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Dr)},persist:function(){},isPersistent:Dr}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ya=Te(En),Sr=X({},En,{view:0,detail:0}),Of=Te(Sr),is,os,Dn,Il=X({},Sr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xa,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Dn&&(Dn&&e.type==="mousemove"?(is=e.screenX-Dn.screenX,os=e.screenY-Dn.screenY):os=is=0,Dn=e),is)},movementY:function(e){return"movementY"in e?e.movementY:os}}),Ki=Te(Il),zf=X({},Il,{dataTransfer:0}),If=Te(zf),Df=X({},Sr,{relatedTarget:0}),us=Te(Df),$f=X({},En,{animationName:0,elapsedTime:0,pseudoElement:0}),Ff=Te($f),Uf=X({},En,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Af=Te(Uf),bf=X({},En,{data:0}),Qi=Te(bf),Bf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Vf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vf[e])?!!t[e]:!1}function Xa(){return Hf}var Kf=X({},Sr,{key:function(e){if(e.key){var t=Bf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xa,charCode:function(e){return e.type==="keypress"?Zr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qf=Te(Kf),Yf=X({},Il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yi=Te(Yf),Xf=X({},Sr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xa}),Gf=Te(Xf),Jf=X({},En,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zf=Te(Jf),qf=X({},Il,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ep=Te(qf),tp=[9,13,27,32],Ga=tt&&"CompositionEvent"in window,Kn=null;tt&&"documentMode"in document&&(Kn=document.documentMode);var np=tt&&"TextEvent"in window&&!Kn,Qu=tt&&(!Ga||Kn&&8<Kn&&11>=Kn),Xi=" ",Gi=!1;function Yu(e,t){switch(e){case"keyup":return tp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qt=!1;function rp(e,t){switch(e){case"compositionend":return Xu(t);case"keypress":return t.which!==32?null:(Gi=!0,Xi);case"textInput":return e=t.data,e===Xi&&Gi?null:e;default:return null}}function lp(e,t){if(qt)return e==="compositionend"||!Ga&&Yu(e,t)?(e=Ku(),Jr=Qa=ft=null,qt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qu&&t.locale!=="ko"?null:t.data;default:return null}}var sp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ji(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sp[e.type]:t==="textarea"}function Gu(e,t,n,r){_u(r),t=hl(t,"onChange"),0<t.length&&(n=new Ya("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qn=null,or=null;function ap(e){ic(e,0)}function Dl(e){var t=nn(e);if(ju(t))return e}function ip(e,t){if(e==="change")return t}var Ju=!1;if(tt){var cs;if(tt){var ds="oninput"in document;if(!ds){var Zi=document.createElement("div");Zi.setAttribute("oninput","return;"),ds=typeof Zi.oninput=="function"}cs=ds}else cs=!1;Ju=cs&&(!document.documentMode||9<document.documentMode)}function qi(){Qn&&(Qn.detachEvent("onpropertychange",Zu),or=Qn=null)}function Zu(e){if(e.propertyName==="value"&&Dl(or)){var t=[];Gu(t,or,e,Ba(e)),Ru(ap,t)}}function op(e,t,n){e==="focusin"?(qi(),Qn=t,or=n,Qn.attachEvent("onpropertychange",Zu)):e==="focusout"&&qi()}function up(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Dl(or)}function cp(e,t){if(e==="click")return Dl(t)}function dp(e,t){if(e==="input"||e==="change")return Dl(t)}function fp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var We=typeof Object.is=="function"?Object.is:fp;function ur(e,t){if(We(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!zs.call(t,l)||!We(e[l],t[l]))return!1}return!0}function eo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function to(e,t){var n=eo(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=eo(n)}}function qu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ec(){for(var e=window,t=il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=il(e.document)}return t}function Ja(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function pp(e){var t=ec(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qu(n.ownerDocument.documentElement,n)){if(r!==null&&Ja(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,a=Math.min(r.start,l);r=r.end===void 0?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=to(n,a);var i=to(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hp=tt&&"documentMode"in document&&11>=document.documentMode,en=null,qs=null,Yn=null,ea=!1;function no(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ea||en==null||en!==il(r)||(r=en,"selectionStart"in r&&Ja(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yn&&ur(Yn,r)||(Yn=r,r=hl(qs,"onSelect"),0<r.length&&(t=new Ya("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=en)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var tn={animationend:$r("Animation","AnimationEnd"),animationiteration:$r("Animation","AnimationIteration"),animationstart:$r("Animation","AnimationStart"),transitionend:$r("Transition","TransitionEnd")},fs={},tc={};tt&&(tc=document.createElement("div").style,"AnimationEvent"in window||(delete tn.animationend.animation,delete tn.animationiteration.animation,delete tn.animationstart.animation),"TransitionEvent"in window||delete tn.transitionend.transition);function $l(e){if(fs[e])return fs[e];if(!tn[e])return e;var t=tn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tc)return fs[e]=t[n];return e}var nc=$l("animationend"),rc=$l("animationiteration"),lc=$l("animationstart"),sc=$l("transitionend"),ac=new Map,ro="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function _t(e,t){ac.set(e,t),Kt(t,[e])}for(var ps=0;ps<ro.length;ps++){var hs=ro[ps],mp=hs.toLowerCase(),vp=hs[0].toUpperCase()+hs.slice(1);_t(mp,"on"+vp)}_t(nc,"onAnimationEnd");_t(rc,"onAnimationIteration");_t(lc,"onAnimationStart");_t("dblclick","onDoubleClick");_t("focusin","onFocus");_t("focusout","onBlur");_t(sc,"onTransitionEnd");gn("onMouseEnter",["mouseout","mouseover"]);gn("onMouseLeave",["mouseout","mouseover"]);gn("onPointerEnter",["pointerout","pointerover"]);gn("onPointerLeave",["pointerout","pointerover"]);Kt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Kt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Kt("onBeforeInput",["compositionend","keypress","textInput","paste"]);Kt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Kt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Kt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),gp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wn));function lo(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,mf(r,t,void 0,e),e.currentTarget=null}function ic(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],u=o.instance,d=o.currentTarget;if(o=o.listener,u!==a&&l.isPropagationStopped())break e;lo(l,o,d),a=u}else for(i=0;i<r.length;i++){if(o=r[i],u=o.instance,d=o.currentTarget,o=o.listener,u!==a&&l.isPropagationStopped())break e;lo(l,o,d),a=u}}}if(ul)throw e=Xs,ul=!1,Xs=null,e}function W(e,t){var n=t[sa];n===void 0&&(n=t[sa]=new Set);var r=e+"__bubble";n.has(r)||(oc(t,e,2,!1),n.add(r))}function ms(e,t,n){var r=0;t&&(r|=4),oc(n,e,r,t)}var Fr="_reactListening"+Math.random().toString(36).slice(2);function cr(e){if(!e[Fr]){e[Fr]=!0,mu.forEach(function(n){n!=="selectionchange"&&(gp.has(n)||ms(n,!1,e),ms(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fr]||(t[Fr]=!0,ms("selectionchange",!1,t))}}function oc(e,t,n,r){switch(Hu(t)){case 1:var l=Rf;break;case 4:l=Mf;break;default:l=Ka}n=l.bind(null,t,n,e),l=void 0,!Ys||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function vs(e,t,n,r,l){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var o=r.stateNode.containerInfo;if(o===l||o.nodeType===8&&o.parentNode===l)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;i=i.return}for(;o!==null;){if(i=Dt(o),i===null)return;if(u=i.tag,u===5||u===6){r=a=i;continue e}o=o.parentNode}}r=r.return}Ru(function(){var d=a,m=Ba(n),p=[];e:{var h=ac.get(e);if(h!==void 0){var w=Ya,v=e;switch(e){case"keypress":if(Zr(n)===0)break e;case"keydown":case"keyup":w=Qf;break;case"focusin":v="focus",w=us;break;case"focusout":v="blur",w=us;break;case"beforeblur":case"afterblur":w=us;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=Ki;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=If;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=Gf;break;case nc:case rc:case lc:w=Ff;break;case sc:w=Zf;break;case"scroll":w=Of;break;case"wheel":w=ep;break;case"copy":case"cut":case"paste":w=Af;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=Yi}var j=(t&4)!==0,N=!j&&e==="scroll",c=j?h!==null?h+"Capture":null:h;j=[];for(var f=d,g;f!==null;){g=f;var x=g.stateNode;if(g.tag===5&&x!==null&&(g=x,c!==null&&(x=lr(f,c),x!=null&&j.push(dr(f,x,g)))),N)break;f=f.return}0<j.length&&(h=new w(h,v,null,n,m),p.push({event:h,listeners:j}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",h&&n!==Ks&&(v=n.relatedTarget||n.fromElement)&&(Dt(v)||v[nt]))break e;if((w||h)&&(h=m.window===m?m:(h=m.ownerDocument)?h.defaultView||h.parentWindow:window,w?(v=n.relatedTarget||n.toElement,w=d,v=v?Dt(v):null,v!==null&&(N=Qt(v),v!==N||v.tag!==5&&v.tag!==6)&&(v=null)):(w=null,v=d),w!==v)){if(j=Ki,x="onMouseLeave",c="onMouseEnter",f="mouse",(e==="pointerout"||e==="pointerover")&&(j=Yi,x="onPointerLeave",c="onPointerEnter",f="pointer"),N=w==null?h:nn(w),g=v==null?h:nn(v),h=new j(x,f+"leave",w,n,m),h.target=N,h.relatedTarget=g,x=null,Dt(m)===d&&(j=new j(c,f+"enter",v,n,m),j.target=g,j.relatedTarget=N,x=j),N=x,w&&v)t:{for(j=w,c=v,f=0,g=j;g;g=Gt(g))f++;for(g=0,x=c;x;x=Gt(x))g++;for(;0<f-g;)j=Gt(j),f--;for(;0<g-f;)c=Gt(c),g--;for(;f--;){if(j===c||c!==null&&j===c.alternate)break t;j=Gt(j),c=Gt(c)}j=null}else j=null;w!==null&&so(p,h,w,j,!1),v!==null&&N!==null&&so(p,N,v,j,!0)}}e:{if(h=d?nn(d):window,w=h.nodeName&&h.nodeName.toLowerCase(),w==="select"||w==="input"&&h.type==="file")var k=ip;else if(Ji(h))if(Ju)k=dp;else{k=up;var S=op}else(w=h.nodeName)&&w.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=cp);if(k&&(k=k(e,d))){Gu(p,k,n,m);break e}S&&S(e,h,d),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&bs(h,"number",h.value)}switch(S=d?nn(d):window,e){case"focusin":(Ji(S)||S.contentEditable==="true")&&(en=S,qs=d,Yn=null);break;case"focusout":Yn=qs=en=null;break;case"mousedown":ea=!0;break;case"contextmenu":case"mouseup":case"dragend":ea=!1,no(p,n,m);break;case"selectionchange":if(hp)break;case"keydown":case"keyup":no(p,n,m)}var C;if(Ga)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else qt?Yu(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(Qu&&n.locale!=="ko"&&(qt||_!=="onCompositionStart"?_==="onCompositionEnd"&&qt&&(C=Ku()):(ft=m,Qa="value"in ft?ft.value:ft.textContent,qt=!0)),S=hl(d,_),0<S.length&&(_=new Qi(_,e,null,n,m),p.push({event:_,listeners:S}),C?_.data=C:(C=Xu(n),C!==null&&(_.data=C)))),(C=np?rp(e,n):lp(e,n))&&(d=hl(d,"onBeforeInput"),0<d.length&&(m=new Qi("onBeforeInput","beforeinput",null,n,m),p.push({event:m,listeners:d}),m.data=C))}ic(p,t)})}function dr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,a=l.stateNode;l.tag===5&&a!==null&&(l=a,a=lr(e,n),a!=null&&r.unshift(dr(e,a,l)),a=lr(e,t),a!=null&&r.push(dr(e,a,l))),e=e.return}return r}function Gt(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function so(e,t,n,r,l){for(var a=t._reactName,i=[];n!==null&&n!==r;){var o=n,u=o.alternate,d=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&d!==null&&(o=d,l?(u=lr(n,a),u!=null&&i.unshift(dr(n,u,o))):l||(u=lr(n,a),u!=null&&i.push(dr(n,u,o)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var yp=/\r\n?/g,xp=/\u0000|\uFFFD/g;function ao(e){return(typeof e=="string"?e:""+e).replace(yp,`
38
- `).replace(xp,"")}function Ur(e,t,n){if(t=ao(t),ao(e)!==t&&n)throw Error(E(425))}function ml(){}var ta=null,na=null;function ra(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var la=typeof setTimeout=="function"?setTimeout:void 0,jp=typeof clearTimeout=="function"?clearTimeout:void 0,io=typeof Promise=="function"?Promise:void 0,wp=typeof queueMicrotask=="function"?queueMicrotask:typeof io<"u"?function(e){return io.resolve(null).then(e).catch(Np)}:la;function Np(e){setTimeout(function(){throw e})}function gs(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),ir(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);ir(t)}function xt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function oo(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var _n=Math.random().toString(36).slice(2),Ke="__reactFiber$"+_n,fr="__reactProps$"+_n,nt="__reactContainer$"+_n,sa="__reactEvents$"+_n,Sp="__reactListeners$"+_n,kp="__reactHandles$"+_n;function Dt(e){var t=e[Ke];if(t)return t;for(var n=e.parentNode;n;){if(t=n[nt]||n[Ke]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=oo(e);e!==null;){if(n=e[Ke])return n;e=oo(e)}return t}e=n,n=e.parentNode}return null}function kr(e){return e=e[Ke]||e[nt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function nn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(E(33))}function Fl(e){return e[fr]||null}var aa=[],rn=-1;function Pt(e){return{current:e}}function V(e){0>rn||(e.current=aa[rn],aa[rn]=null,rn--)}function b(e,t){rn++,aa[rn]=e.current,e.current=t}var Et={},he=Pt(Et),Ne=Pt(!1),bt=Et;function yn(e,t){var n=e.type.contextTypes;if(!n)return Et;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in n)l[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Se(e){return e=e.childContextTypes,e!=null}function vl(){V(Ne),V(he)}function uo(e,t,n){if(he.current!==Et)throw Error(E(168));b(he,t),b(Ne,n)}function uc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(E(108,of(e)||"Unknown",l));return X({},n,r)}function gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Et,bt=he.current,b(he,e),b(Ne,Ne.current),!0}function co(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=uc(e,t,bt),r.__reactInternalMemoizedMergedChildContext=e,V(Ne),V(he),b(he,e)):V(Ne),b(Ne,n)}var Je=null,Ul=!1,ys=!1;function cc(e){Je===null?Je=[e]:Je.push(e)}function Cp(e){Ul=!0,cc(e)}function Lt(){if(!ys&&Je!==null){ys=!0;var e=0,t=A;try{var n=Je;for(A=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Je=null,Ul=!1}catch(l){throw Je!==null&&(Je=Je.slice(e+1)),Iu(Wa,Lt),l}finally{A=t,ys=!1}}return null}var ln=[],sn=0,yl=null,xl=0,Re=[],Me=0,Bt=null,Ze=1,qe="";function zt(e,t){ln[sn++]=xl,ln[sn++]=yl,yl=e,xl=t}function dc(e,t,n){Re[Me++]=Ze,Re[Me++]=qe,Re[Me++]=Bt,Bt=e;var r=Ze;e=qe;var l=32-be(r)-1;r&=~(1<<l),n+=1;var a=32-be(t)+l;if(30<a){var i=l-l%5;a=(r&(1<<i)-1).toString(32),r>>=i,l-=i,Ze=1<<32-be(t)+l|n<<l|r,qe=a+e}else Ze=1<<a|n<<l|r,qe=e}function Za(e){e.return!==null&&(zt(e,1),dc(e,1,0))}function qa(e){for(;e===yl;)yl=ln[--sn],ln[sn]=null,xl=ln[--sn],ln[sn]=null;for(;e===Bt;)Bt=Re[--Me],Re[Me]=null,qe=Re[--Me],Re[Me]=null,Ze=Re[--Me],Re[Me]=null}var _e=null,Ee=null,H=!1,Ae=null;function fc(e,t){var n=Oe(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function fo(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,_e=e,Ee=xt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_e=e,Ee=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Bt!==null?{id:Ze,overflow:qe}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Oe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,_e=e,Ee=null,!0):!1;default:return!1}}function ia(e){return(e.mode&1)!==0&&(e.flags&128)===0}function oa(e){if(H){var t=Ee;if(t){var n=t;if(!fo(e,t)){if(ia(e))throw Error(E(418));t=xt(n.nextSibling);var r=_e;t&&fo(e,t)?fc(r,n):(e.flags=e.flags&-4097|2,H=!1,_e=e)}}else{if(ia(e))throw Error(E(418));e.flags=e.flags&-4097|2,H=!1,_e=e}}}function po(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_e=e}function Ar(e){if(e!==_e)return!1;if(!H)return po(e),H=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ra(e.type,e.memoizedProps)),t&&(t=Ee)){if(ia(e))throw pc(),Error(E(418));for(;t;)fc(e,t),t=xt(t.nextSibling)}if(po(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ee=xt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ee=null}}else Ee=_e?xt(e.stateNode.nextSibling):null;return!0}function pc(){for(var e=Ee;e;)e=xt(e.nextSibling)}function xn(){Ee=_e=null,H=!1}function ei(e){Ae===null?Ae=[e]:Ae.push(e)}var Ep=st.ReactCurrentBatchConfig;function $n(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(E(309));var r=n.stateNode}if(!r)throw Error(E(147,e));var l=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var o=l.refs;i===null?delete o[a]:o[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(E(284));if(!n._owner)throw Error(E(290,e))}return e}function br(e,t){throw e=Object.prototype.toString.call(t),Error(E(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ho(e){var t=e._init;return t(e._payload)}function hc(e){function t(c,f){if(e){var g=c.deletions;g===null?(c.deletions=[f],c.flags|=16):g.push(f)}}function n(c,f){if(!e)return null;for(;f!==null;)t(c,f),f=f.sibling;return null}function r(c,f){for(c=new Map;f!==null;)f.key!==null?c.set(f.key,f):c.set(f.index,f),f=f.sibling;return c}function l(c,f){return c=St(c,f),c.index=0,c.sibling=null,c}function a(c,f,g){return c.index=g,e?(g=c.alternate,g!==null?(g=g.index,g<f?(c.flags|=2,f):g):(c.flags|=2,f)):(c.flags|=1048576,f)}function i(c){return e&&c.alternate===null&&(c.flags|=2),c}function o(c,f,g,x){return f===null||f.tag!==6?(f=Cs(g,c.mode,x),f.return=c,f):(f=l(f,g),f.return=c,f)}function u(c,f,g,x){var k=g.type;return k===Zt?m(c,f,g.props.children,x,g.key):f!==null&&(f.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ot&&ho(k)===f.type)?(x=l(f,g.props),x.ref=$n(c,f,g),x.return=c,x):(x=sl(g.type,g.key,g.props,null,c.mode,x),x.ref=$n(c,f,g),x.return=c,x)}function d(c,f,g,x){return f===null||f.tag!==4||f.stateNode.containerInfo!==g.containerInfo||f.stateNode.implementation!==g.implementation?(f=Es(g,c.mode,x),f.return=c,f):(f=l(f,g.children||[]),f.return=c,f)}function m(c,f,g,x,k){return f===null||f.tag!==7?(f=At(g,c.mode,x,k),f.return=c,f):(f=l(f,g),f.return=c,f)}function p(c,f,g){if(typeof f=="string"&&f!==""||typeof f=="number")return f=Cs(""+f,c.mode,g),f.return=c,f;if(typeof f=="object"&&f!==null){switch(f.$$typeof){case Tr:return g=sl(f.type,f.key,f.props,null,c.mode,g),g.ref=$n(c,null,f),g.return=c,g;case Jt:return f=Es(f,c.mode,g),f.return=c,f;case ot:var x=f._init;return p(c,x(f._payload),g)}if(bn(f)||Mn(f))return f=At(f,c.mode,g,null),f.return=c,f;br(c,f)}return null}function h(c,f,g,x){var k=f!==null?f.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:o(c,f,""+g,x);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Tr:return g.key===k?u(c,f,g,x):null;case Jt:return g.key===k?d(c,f,g,x):null;case ot:return k=g._init,h(c,f,k(g._payload),x)}if(bn(g)||Mn(g))return k!==null?null:m(c,f,g,x,null);br(c,g)}return null}function w(c,f,g,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return c=c.get(g)||null,o(f,c,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Tr:return c=c.get(x.key===null?g:x.key)||null,u(f,c,x,k);case Jt:return c=c.get(x.key===null?g:x.key)||null,d(f,c,x,k);case ot:var S=x._init;return w(c,f,g,S(x._payload),k)}if(bn(x)||Mn(x))return c=c.get(g)||null,m(f,c,x,k,null);br(f,x)}return null}function v(c,f,g,x){for(var k=null,S=null,C=f,_=f=0,O=null;C!==null&&_<g.length;_++){C.index>_?(O=C,C=null):O=C.sibling;var M=h(c,C,g[_],x);if(M===null){C===null&&(C=O);break}e&&C&&M.alternate===null&&t(c,C),f=a(M,f,_),S===null?k=M:S.sibling=M,S=M,C=O}if(_===g.length)return n(c,C),H&&zt(c,_),k;if(C===null){for(;_<g.length;_++)C=p(c,g[_],x),C!==null&&(f=a(C,f,_),S===null?k=C:S.sibling=C,S=C);return H&&zt(c,_),k}for(C=r(c,C);_<g.length;_++)O=w(C,c,_,g[_],x),O!==null&&(e&&O.alternate!==null&&C.delete(O.key===null?_:O.key),f=a(O,f,_),S===null?k=O:S.sibling=O,S=O);return e&&C.forEach(function(U){return t(c,U)}),H&&zt(c,_),k}function j(c,f,g,x){var k=Mn(g);if(typeof k!="function")throw Error(E(150));if(g=k.call(g),g==null)throw Error(E(151));for(var S=k=null,C=f,_=f=0,O=null,M=g.next();C!==null&&!M.done;_++,M=g.next()){C.index>_?(O=C,C=null):O=C.sibling;var U=h(c,C,M.value,x);if(U===null){C===null&&(C=O);break}e&&C&&U.alternate===null&&t(c,C),f=a(U,f,_),S===null?k=U:S.sibling=U,S=U,C=O}if(M.done)return n(c,C),H&&zt(c,_),k;if(C===null){for(;!M.done;_++,M=g.next())M=p(c,M.value,x),M!==null&&(f=a(M,f,_),S===null?k=M:S.sibling=M,S=M);return H&&zt(c,_),k}for(C=r(c,C);!M.done;_++,M=g.next())M=w(C,c,_,M.value,x),M!==null&&(e&&M.alternate!==null&&C.delete(M.key===null?_:M.key),f=a(M,f,_),S===null?k=M:S.sibling=M,S=M);return e&&C.forEach(function(xe){return t(c,xe)}),H&&zt(c,_),k}function N(c,f,g,x){if(typeof g=="object"&&g!==null&&g.type===Zt&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Tr:e:{for(var k=g.key,S=f;S!==null;){if(S.key===k){if(k=g.type,k===Zt){if(S.tag===7){n(c,S.sibling),f=l(S,g.props.children),f.return=c,c=f;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ot&&ho(k)===S.type){n(c,S.sibling),f=l(S,g.props),f.ref=$n(c,S,g),f.return=c,c=f;break e}n(c,S);break}else t(c,S);S=S.sibling}g.type===Zt?(f=At(g.props.children,c.mode,x,g.key),f.return=c,c=f):(x=sl(g.type,g.key,g.props,null,c.mode,x),x.ref=$n(c,f,g),x.return=c,c=x)}return i(c);case Jt:e:{for(S=g.key;f!==null;){if(f.key===S)if(f.tag===4&&f.stateNode.containerInfo===g.containerInfo&&f.stateNode.implementation===g.implementation){n(c,f.sibling),f=l(f,g.children||[]),f.return=c,c=f;break e}else{n(c,f);break}else t(c,f);f=f.sibling}f=Es(g,c.mode,x),f.return=c,c=f}return i(c);case ot:return S=g._init,N(c,f,S(g._payload),x)}if(bn(g))return v(c,f,g,x);if(Mn(g))return j(c,f,g,x);br(c,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,f!==null&&f.tag===6?(n(c,f.sibling),f=l(f,g),f.return=c,c=f):(n(c,f),f=Cs(g,c.mode,x),f.return=c,c=f),i(c)):n(c,f)}return N}var jn=hc(!0),mc=hc(!1),jl=Pt(null),wl=null,an=null,ti=null;function ni(){ti=an=wl=null}function ri(e){var t=jl.current;V(jl),e._currentValue=t}function ua(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function hn(e,t){wl=e,ti=an=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(we=!0),e.firstContext=null)}function Ie(e){var t=e._currentValue;if(ti!==e)if(e={context:e,memoizedValue:t,next:null},an===null){if(wl===null)throw Error(E(308));an=e,wl.dependencies={lanes:0,firstContext:e}}else an=an.next=e;return t}var $t=null;function li(e){$t===null?$t=[e]:$t.push(e)}function vc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,li(t)):(n.next=l.next,l.next=n),t.interleaved=n,rt(e,r)}function rt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ut=!1;function si(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function et(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,F&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,rt(e,n)}return l=r.interleaved,l===null?(t.next=t,li(r)):(t.next=l.next,l.next=t),r.interleaved=t,rt(e,n)}function qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Va(e,n)}}function mo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?l=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?l=a=t:a=a.next=t}else l=a=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Nl(e,t,n,r){var l=e.updateQueue;ut=!1;var a=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var u=o,d=u.next;u.next=null,i===null?a=d:i.next=d,i=u;var m=e.alternate;m!==null&&(m=m.updateQueue,o=m.lastBaseUpdate,o!==i&&(o===null?m.firstBaseUpdate=d:o.next=d,m.lastBaseUpdate=u))}if(a!==null){var p=l.baseState;i=0,m=d=u=null,o=a;do{var h=o.lane,w=o.eventTime;if((r&h)===h){m!==null&&(m=m.next={eventTime:w,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var v=e,j=o;switch(h=t,w=n,j.tag){case 1:if(v=j.payload,typeof v=="function"){p=v.call(w,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=j.payload,h=typeof v=="function"?v.call(w,p,h):v,h==null)break e;p=X({},p,h);break e;case 2:ut=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[o]:h.push(o))}else w={eventTime:w,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},m===null?(d=m=w,u=p):m=m.next=w,i|=h;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;h=o,o=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(m===null&&(u=p),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=m,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else a===null&&(l.shared.lanes=0);Vt|=i,e.lanes=i,e.memoizedState=p}}function vo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(E(191,l));l.call(r)}}}var Cr={},Ye=Pt(Cr),pr=Pt(Cr),hr=Pt(Cr);function Ft(e){if(e===Cr)throw Error(E(174));return e}function ai(e,t){switch(b(hr,t),b(pr,e),b(Ye,Cr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ws(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ws(t,e)}V(Ye),b(Ye,t)}function wn(){V(Ye),V(pr),V(hr)}function yc(e){Ft(hr.current);var t=Ft(Ye.current),n=Ws(t,e.type);t!==n&&(b(pr,e),b(Ye,n))}function ii(e){pr.current===e&&(V(Ye),V(pr))}var K=Pt(0);function Sl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var xs=[];function oi(){for(var e=0;e<xs.length;e++)xs[e]._workInProgressVersionPrimary=null;xs.length=0}var el=st.ReactCurrentDispatcher,js=st.ReactCurrentBatchConfig,Wt=0,Q=null,te=null,le=null,kl=!1,Xn=!1,mr=0,_p=0;function ue(){throw Error(E(321))}function ui(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!We(e[n],t[n]))return!1;return!0}function ci(e,t,n,r,l,a){if(Wt=a,Q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,el.current=e===null||e.memoizedState===null?Rp:Mp,e=n(r,l),Xn){a=0;do{if(Xn=!1,mr=0,25<=a)throw Error(E(301));a+=1,le=te=null,t.updateQueue=null,el.current=Op,e=n(r,l)}while(Xn)}if(el.current=Cl,t=te!==null&&te.next!==null,Wt=0,le=te=Q=null,kl=!1,t)throw Error(E(300));return e}function di(){var e=mr!==0;return mr=0,e}function He(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return le===null?Q.memoizedState=le=e:le=le.next=e,le}function De(){if(te===null){var e=Q.alternate;e=e!==null?e.memoizedState:null}else e=te.next;var t=le===null?Q.memoizedState:le.next;if(t!==null)le=t,te=e;else{if(e===null)throw Error(E(310));te=e,e={memoizedState:te.memoizedState,baseState:te.baseState,baseQueue:te.baseQueue,queue:te.queue,next:null},le===null?Q.memoizedState=le=e:le=le.next=e}return le}function vr(e,t){return typeof t=="function"?t(e):t}function ws(e){var t=De(),n=t.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=e;var r=te,l=r.baseQueue,a=n.pending;if(a!==null){if(l!==null){var i=l.next;l.next=a.next,a.next=i}r.baseQueue=l=a,n.pending=null}if(l!==null){a=l.next,r=r.baseState;var o=i=null,u=null,d=a;do{var m=d.lane;if((Wt&m)===m)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var p={lane:m,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(o=u=p,i=r):u=u.next=p,Q.lanes|=m,Vt|=m}d=d.next}while(d!==null&&d!==a);u===null?i=r:u.next=o,We(r,t.memoizedState)||(we=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do a=l.lane,Q.lanes|=a,Vt|=a,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ns(e){var t=De(),n=t.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,a=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do a=e(a,i.action),i=i.next;while(i!==l);We(a,t.memoizedState)||(we=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function xc(){}function jc(e,t){var n=Q,r=De(),l=t(),a=!We(r.memoizedState,l);if(a&&(r.memoizedState=l,we=!0),r=r.queue,fi(Sc.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||le!==null&&le.memoizedState.tag&1){if(n.flags|=2048,gr(9,Nc.bind(null,n,r,l,t),void 0,null),se===null)throw Error(E(349));Wt&30||wc(n,t,l)}return l}function wc(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Q.updateQueue,t===null?(t={lastEffect:null,stores:null},Q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nc(e,t,n,r){t.value=n,t.getSnapshot=r,kc(t)&&Cc(e)}function Sc(e,t,n){return n(function(){kc(t)&&Cc(e)})}function kc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!We(e,n)}catch{return!0}}function Cc(e){var t=rt(e,1);t!==null&&Be(t,e,1,-1)}function go(e){var t=He();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:e},t.queue=e,e=e.dispatch=Tp.bind(null,Q,e),[t.memoizedState,e]}function gr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Q.updateQueue,t===null?(t={lastEffect:null,stores:null},Q.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ec(){return De().memoizedState}function tl(e,t,n,r){var l=He();Q.flags|=e,l.memoizedState=gr(1|t,n,void 0,r===void 0?null:r)}function Al(e,t,n,r){var l=De();r=r===void 0?null:r;var a=void 0;if(te!==null){var i=te.memoizedState;if(a=i.destroy,r!==null&&ui(r,i.deps)){l.memoizedState=gr(t,n,a,r);return}}Q.flags|=e,l.memoizedState=gr(1|t,n,a,r)}function yo(e,t){return tl(8390656,8,e,t)}function fi(e,t){return Al(2048,8,e,t)}function _c(e,t){return Al(4,2,e,t)}function Pc(e,t){return Al(4,4,e,t)}function Lc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tc(e,t,n){return n=n!=null?n.concat([e]):null,Al(4,4,Lc.bind(null,t,e),n)}function pi(){}function Rc(e,t){var n=De();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ui(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Mc(e,t){var n=De();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ui(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Oc(e,t,n){return Wt&21?(We(n,t)||(n=Fu(),Q.lanes|=n,Vt|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,we=!0),e.memoizedState=n)}function Pp(e,t){var n=A;A=n!==0&&4>n?n:4,e(!0);var r=js.transition;js.transition={};try{e(!1),t()}finally{A=n,js.transition=r}}function zc(){return De().memoizedState}function Lp(e,t,n){var r=Nt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ic(e))Dc(t,n);else if(n=vc(e,t,n,r),n!==null){var l=ve();Be(n,e,r,l),$c(n,t,r)}}function Tp(e,t,n){var r=Nt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ic(e))Dc(t,l);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,o=a(i,n);if(l.hasEagerState=!0,l.eagerState=o,We(o,i)){var u=t.interleaved;u===null?(l.next=l,li(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=vc(e,t,l,r),n!==null&&(l=ve(),Be(n,e,r,l),$c(n,t,r))}}function Ic(e){var t=e.alternate;return e===Q||t!==null&&t===Q}function Dc(e,t){Xn=kl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $c(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Va(e,n)}}var Cl={readContext:Ie,useCallback:ue,useContext:ue,useEffect:ue,useImperativeHandle:ue,useInsertionEffect:ue,useLayoutEffect:ue,useMemo:ue,useReducer:ue,useRef:ue,useState:ue,useDebugValue:ue,useDeferredValue:ue,useTransition:ue,useMutableSource:ue,useSyncExternalStore:ue,useId:ue,unstable_isNewReconciler:!1},Rp={readContext:Ie,useCallback:function(e,t){return He().memoizedState=[e,t===void 0?null:t],e},useContext:Ie,useEffect:yo,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,tl(4194308,4,Lc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return tl(4,2,e,t)},useMemo:function(e,t){var n=He();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=He();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Lp.bind(null,Q,e),[r.memoizedState,e]},useRef:function(e){var t=He();return e={current:e},t.memoizedState=e},useState:go,useDebugValue:pi,useDeferredValue:function(e){return He().memoizedState=e},useTransition:function(){var e=go(!1),t=e[0];return e=Pp.bind(null,e[1]),He().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Q,l=He();if(H){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),se===null)throw Error(E(349));Wt&30||wc(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,yo(Sc.bind(null,r,a,e),[e]),r.flags|=2048,gr(9,Nc.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=He(),t=se.identifierPrefix;if(H){var n=qe,r=Ze;n=(r&~(1<<32-be(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=_p++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Mp={readContext:Ie,useCallback:Rc,useContext:Ie,useEffect:fi,useImperativeHandle:Tc,useInsertionEffect:_c,useLayoutEffect:Pc,useMemo:Mc,useReducer:ws,useRef:Ec,useState:function(){return ws(vr)},useDebugValue:pi,useDeferredValue:function(e){var t=De();return Oc(t,te.memoizedState,e)},useTransition:function(){var e=ws(vr)[0],t=De().memoizedState;return[e,t]},useMutableSource:xc,useSyncExternalStore:jc,useId:zc,unstable_isNewReconciler:!1},Op={readContext:Ie,useCallback:Rc,useContext:Ie,useEffect:fi,useImperativeHandle:Tc,useInsertionEffect:_c,useLayoutEffect:Pc,useMemo:Mc,useReducer:Ns,useRef:Ec,useState:function(){return Ns(vr)},useDebugValue:pi,useDeferredValue:function(e){var t=De();return te===null?t.memoizedState=e:Oc(t,te.memoizedState,e)},useTransition:function(){var e=Ns(vr)[0],t=De().memoizedState;return[e,t]},useMutableSource:xc,useSyncExternalStore:jc,useId:zc,unstable_isNewReconciler:!1};function Fe(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ca(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bl={isMounted:function(e){return(e=e._reactInternals)?Qt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ve(),l=Nt(e),a=et(r,l);a.payload=t,n!=null&&(a.callback=n),t=jt(e,a,l),t!==null&&(Be(t,e,l,r),qr(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ve(),l=Nt(e),a=et(r,l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=jt(e,a,l),t!==null&&(Be(t,e,l,r),qr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ve(),r=Nt(e),l=et(n,r);l.tag=2,t!=null&&(l.callback=t),t=jt(e,l,r),t!==null&&(Be(t,e,r,n),qr(t,e,r))}};function xo(e,t,n,r,l,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!ur(n,r)||!ur(l,a):!0}function Fc(e,t,n){var r=!1,l=Et,a=t.contextType;return typeof a=="object"&&a!==null?a=Ie(a):(l=Se(t)?bt:he.current,r=t.contextTypes,a=(r=r!=null)?yn(e,l):Et),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=bl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function jo(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bl.enqueueReplaceState(t,t.state,null)}function da(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},si(e);var a=t.contextType;typeof a=="object"&&a!==null?l.context=Ie(a):(a=Se(t)?bt:he.current,l.context=yn(e,a)),l.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ca(e,t,a,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&bl.enqueueReplaceState(l,l.state,null),Nl(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Nn(e,t){try{var n="",r=t;do n+=af(r),r=r.return;while(r);var l=n}catch(a){l=`
39
- Error generating stack: `+a.message+`
40
- `+a.stack}return{value:e,source:t,stack:l,digest:null}}function Ss(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function fa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var zp=typeof WeakMap=="function"?WeakMap:Map;function Uc(e,t,n){n=et(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_l||(_l=!0,Na=r),fa(e,t)},n}function Ac(e,t,n){n=et(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){fa(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){fa(e,t),typeof r!="function"&&(wt===null?wt=new Set([this]):wt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function wo(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zp;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Yp.bind(null,e,t,n),t.then(e,e))}function No(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function So(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=et(-1,1),t.tag=2,jt(n,t,1))),n.lanes|=1),e)}var Ip=st.ReactCurrentOwner,we=!1;function me(e,t,n,r){t.child=e===null?mc(t,null,n,r):jn(t,e.child,n,r)}function ko(e,t,n,r,l){n=n.render;var a=t.ref;return hn(t,l),r=ci(e,t,n,r,a,l),n=di(),e!==null&&!we?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,lt(e,t,l)):(H&&n&&Za(t),t.flags|=1,me(e,t,r,l),t.child)}function Co(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!wi(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,bc(e,t,a,r,l)):(e=sl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&l)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:ur,n(i,r)&&e.ref===t.ref)return lt(e,t,l)}return t.flags|=1,e=St(a,r),e.ref=t.ref,e.return=t,t.child=e}function bc(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(ur(a,r)&&e.ref===t.ref)if(we=!1,t.pendingProps=r=a,(e.lanes&l)!==0)e.flags&131072&&(we=!0);else return t.lanes=e.lanes,lt(e,t,l)}return pa(e,t,n,r,l)}function Bc(e,t,n){var r=t.pendingProps,l=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},b(un,Ce),Ce|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,b(un,Ce),Ce|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,b(un,Ce),Ce|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,b(un,Ce),Ce|=r;return me(e,t,l,n),t.child}function Wc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function pa(e,t,n,r,l){var a=Se(n)?bt:he.current;return a=yn(t,a),hn(t,l),n=ci(e,t,n,r,a,l),r=di(),e!==null&&!we?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,lt(e,t,l)):(H&&r&&Za(t),t.flags|=1,me(e,t,n,l),t.child)}function Eo(e,t,n,r,l){if(Se(n)){var a=!0;gl(t)}else a=!1;if(hn(t,l),t.stateNode===null)nl(e,t),Fc(t,n,r),da(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var u=i.context,d=n.contextType;typeof d=="object"&&d!==null?d=Ie(d):(d=Se(n)?bt:he.current,d=yn(t,d));var m=n.getDerivedStateFromProps,p=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function";p||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==r||u!==d)&&jo(t,i,r,d),ut=!1;var h=t.memoizedState;i.state=h,Nl(t,r,i,l),u=t.memoizedState,o!==r||h!==u||Ne.current||ut?(typeof m=="function"&&(ca(t,n,m,r),u=t.memoizedState),(o=ut||xo(t,n,o,r,h,u,d))?(p||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=d,r=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,gc(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:Fe(t.type,o),i.props=d,p=t.pendingProps,h=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ie(u):(u=Se(n)?bt:he.current,u=yn(t,u));var w=n.getDerivedStateFromProps;(m=typeof w=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==p||h!==u)&&jo(t,i,r,u),ut=!1,h=t.memoizedState,i.state=h,Nl(t,r,i,l);var v=t.memoizedState;o!==p||h!==v||Ne.current||ut?(typeof w=="function"&&(ca(t,n,w,r),v=t.memoizedState),(d=ut||xo(t,n,d,r,h,v,u)||!1)?(m||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,v,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,v,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),i.props=r,i.state=v,i.context=u,r=d):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ha(e,t,n,r,a,l)}function ha(e,t,n,r,l,a){Wc(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&co(t,n,!1),lt(e,t,a);r=t.stateNode,Ip.current=t;var o=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=jn(t,e.child,null,a),t.child=jn(t,null,o,a)):me(e,t,o,a),t.memoizedState=r.state,l&&co(t,n,!0),t.child}function Vc(e){var t=e.stateNode;t.pendingContext?uo(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uo(e,t.context,!1),ai(e,t.containerInfo)}function _o(e,t,n,r,l){return xn(),ei(l),t.flags|=256,me(e,t,n,r),t.child}var ma={dehydrated:null,treeContext:null,retryLane:0};function va(e){return{baseLanes:e,cachePool:null,transitions:null}}function Hc(e,t,n){var r=t.pendingProps,l=K.current,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(l&2)!==0),o?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),b(K,l&1),e===null)return oa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,a?(r=t.mode,a=t.child,i={mode:"hidden",children:i},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=Vl(i,r,0,null),e=At(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=va(n),t.memoizedState=ma,e):hi(t,i));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return Dp(e,t,i,r,o,l,n);if(a){a=r.fallback,i=t.mode,l=e.child,o=l.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=St(l,u),r.subtreeFlags=l.subtreeFlags&14680064),o!==null?a=St(o,a):(a=At(a,i,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,i=e.child.memoizedState,i=i===null?va(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~n,t.memoizedState=ma,r}return a=e.child,e=a.sibling,r=St(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function hi(e,t){return t=Vl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Br(e,t,n,r){return r!==null&&ei(r),jn(t,e.child,null,n),e=hi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dp(e,t,n,r,l,a,i){if(n)return t.flags&256?(t.flags&=-257,r=Ss(Error(E(422))),Br(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,l=t.mode,r=Vl({mode:"visible",children:r.children},l,0,null),a=At(a,l,i,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&jn(t,e.child,null,i),t.child.memoizedState=va(i),t.memoizedState=ma,a);if(!(t.mode&1))return Br(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(E(419)),r=Ss(a,r,void 0),Br(e,t,i,r)}if(o=(i&e.childLanes)!==0,we||o){if(r=se,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==a.retryLane&&(a.retryLane=l,rt(e,l),Be(r,e,l,-1))}return ji(),r=Ss(Error(E(421))),Br(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Xp.bind(null,e),l._reactRetry=t,null):(e=a.treeContext,Ee=xt(l.nextSibling),_e=t,H=!0,Ae=null,e!==null&&(Re[Me++]=Ze,Re[Me++]=qe,Re[Me++]=Bt,Ze=e.id,qe=e.overflow,Bt=t),t=hi(t,r.children),t.flags|=4096,t)}function Po(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ua(e.return,t,n)}function ks(e,t,n,r,l){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=l)}function Kc(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(me(e,t,r.children,n),r=K.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Po(e,n,t);else if(e.tag===19)Po(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(b(K,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Sl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),ks(t,!1,l,n,a);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Sl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}ks(t,!0,n,null,a);break;case"together":ks(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function lt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(E(153));if(t.child!==null){for(e=t.child,n=St(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=St(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function $p(e,t,n){switch(t.tag){case 3:Vc(t),xn();break;case 5:yc(t);break;case 1:Se(t.type)&&gl(t);break;case 4:ai(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;b(jl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(b(K,K.current&1),t.flags|=128,null):n&t.child.childLanes?Hc(e,t,n):(b(K,K.current&1),e=lt(e,t,n),e!==null?e.sibling:null);b(K,K.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kc(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),b(K,K.current),r)break;return null;case 22:case 23:return t.lanes=0,Bc(e,t,n)}return lt(e,t,n)}var Qc,ga,Yc,Xc;Qc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ga=function(){};Yc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Ft(Ye.current);var a=null;switch(n){case"input":l=Us(e,l),r=Us(e,r),a=[];break;case"select":l=X({},l,{value:void 0}),r=X({},r,{value:void 0}),a=[];break;case"textarea":l=Bs(e,l),r=Bs(e,r),a=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ml)}Vs(n,r);var i;n=null;for(d in l)if(!r.hasOwnProperty(d)&&l.hasOwnProperty(d)&&l[d]!=null)if(d==="style"){var o=l[d];for(i in o)o.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(nr.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in r){var u=r[d];if(o=l!=null?l[d]:void 0,r.hasOwnProperty(d)&&u!==o&&(u!=null||o!=null))if(d==="style")if(o){for(i in o)!o.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&o[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(a||(a=[]),a.push(d,n)),n=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(a=a||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(nr.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&W("scroll",e),a||o===u||(a=[])):(a=a||[]).push(d,u))}n&&(a=a||[]).push("style",n);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};Xc=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fn(e,t){if(!H)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ce(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fp(e,t,n){var r=t.pendingProps;switch(qa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ce(t),null;case 1:return Se(t.type)&&vl(),ce(t),null;case 3:return r=t.stateNode,wn(),V(Ne),V(he),oi(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ar(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ae!==null&&(Ca(Ae),Ae=null))),ga(e,t),ce(t),null;case 5:ii(t);var l=Ft(hr.current);if(n=t.type,e!==null&&t.stateNode!=null)Yc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(E(166));return ce(t),null}if(e=Ft(Ye.current),Ar(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Ke]=t,r[fr]=a,e=(t.mode&1)!==0,n){case"dialog":W("cancel",r),W("close",r);break;case"iframe":case"object":case"embed":W("load",r);break;case"video":case"audio":for(l=0;l<Wn.length;l++)W(Wn[l],r);break;case"source":W("error",r);break;case"img":case"image":case"link":W("error",r),W("load",r);break;case"details":W("toggle",r);break;case"input":Di(r,a),W("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},W("invalid",r);break;case"textarea":Fi(r,a),W("invalid",r)}Vs(n,a),l=null;for(var i in a)if(a.hasOwnProperty(i)){var o=a[i];i==="children"?typeof o=="string"?r.textContent!==o&&(a.suppressHydrationWarning!==!0&&Ur(r.textContent,o,e),l=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&Ur(r.textContent,o,e),l=["children",""+o]):nr.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&W("scroll",r)}switch(n){case"input":Rr(r),$i(r,a,!0);break;case"textarea":Rr(r),Ui(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=ml)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Su(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ke]=t,e[fr]=r,Qc(e,t,!1,!1),t.stateNode=e;e:{switch(i=Hs(n,r),n){case"dialog":W("cancel",e),W("close",e),l=r;break;case"iframe":case"object":case"embed":W("load",e),l=r;break;case"video":case"audio":for(l=0;l<Wn.length;l++)W(Wn[l],e);l=r;break;case"source":W("error",e),l=r;break;case"img":case"image":case"link":W("error",e),W("load",e),l=r;break;case"details":W("toggle",e),l=r;break;case"input":Di(e,r),l=Us(e,r),W("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=X({},r,{value:void 0}),W("invalid",e);break;case"textarea":Fi(e,r),l=Bs(e,r),W("invalid",e);break;default:l=r}Vs(n,l),o=l;for(a in o)if(o.hasOwnProperty(a)){var u=o[a];a==="style"?Eu(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&ku(e,u)):a==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&rr(e,u):typeof u=="number"&&rr(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(nr.hasOwnProperty(a)?u!=null&&a==="onScroll"&&W("scroll",e):u!=null&&Fa(e,a,u,i))}switch(n){case"input":Rr(e),$i(e,r,!1);break;case"textarea":Rr(e),Ui(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ct(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?cn(e,!!r.multiple,a,!1):r.defaultValue!=null&&cn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=ml)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ce(t),null;case 6:if(e&&t.stateNode!=null)Xc(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(E(166));if(n=Ft(hr.current),Ft(Ye.current),Ar(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ke]=t,(a=r.nodeValue!==n)&&(e=_e,e!==null))switch(e.tag){case 3:Ur(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ur(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ke]=t,t.stateNode=r}return ce(t),null;case 13:if(V(K),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(H&&Ee!==null&&t.mode&1&&!(t.flags&128))pc(),xn(),t.flags|=98560,a=!1;else if(a=Ar(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(E(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(E(317));a[Ke]=t}else xn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ce(t),a=!1}else Ae!==null&&(Ca(Ae),Ae=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||K.current&1?ne===0&&(ne=3):ji())),t.updateQueue!==null&&(t.flags|=4),ce(t),null);case 4:return wn(),ga(e,t),e===null&&cr(t.stateNode.containerInfo),ce(t),null;case 10:return ri(t.type._context),ce(t),null;case 17:return Se(t.type)&&vl(),ce(t),null;case 19:if(V(K),a=t.memoizedState,a===null)return ce(t),null;if(r=(t.flags&128)!==0,i=a.rendering,i===null)if(r)Fn(a,!1);else{if(ne!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Sl(e),i!==null){for(t.flags|=128,Fn(a,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return b(K,K.current&1|2),t.child}e=e.sibling}a.tail!==null&&q()>Sn&&(t.flags|=128,r=!0,Fn(a,!1),t.lanes=4194304)}else{if(!r)if(e=Sl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!H)return ce(t),null}else 2*q()-a.renderingStartTime>Sn&&n!==1073741824&&(t.flags|=128,r=!0,Fn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(n=a.last,n!==null?n.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=q(),t.sibling=null,n=K.current,b(K,r?n&1|2:n&1),t):(ce(t),null);case 22:case 23:return xi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ce&1073741824&&(ce(t),t.subtreeFlags&6&&(t.flags|=8192)):ce(t),null;case 24:return null;case 25:return null}throw Error(E(156,t.tag))}function Up(e,t){switch(qa(t),t.tag){case 1:return Se(t.type)&&vl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wn(),V(Ne),V(he),oi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ii(t),null;case 13:if(V(K),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(K),null;case 4:return wn(),null;case 10:return ri(t.type._context),null;case 22:case 23:return xi(),null;case 24:return null;default:return null}}var Wr=!1,fe=!1,Ap=typeof WeakSet=="function"?WeakSet:Set,R=null;function on(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){J(e,t,r)}else n.current=null}function ya(e,t,n){try{n()}catch(r){J(e,t,r)}}var Lo=!1;function bp(e,t){if(ta=fl,e=ec(),Ja(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,o=-1,u=-1,d=0,m=0,p=e,h=null;t:for(;;){for(var w;p!==n||l!==0&&p.nodeType!==3||(o=i+l),p!==a||r!==0&&p.nodeType!==3||(u=i+r),p.nodeType===3&&(i+=p.nodeValue.length),(w=p.firstChild)!==null;)h=p,p=w;for(;;){if(p===e)break t;if(h===n&&++d===l&&(o=i),h===a&&++m===r&&(u=i),(w=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=w}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(na={focusedElem:e,selectionRange:n},fl=!1,R=t;R!==null;)if(t=R,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,R=e;else for(;R!==null;){t=R;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var j=v.memoizedProps,N=v.memoizedState,c=t.stateNode,f=c.getSnapshotBeforeUpdate(t.elementType===t.type?j:Fe(t.type,j),N);c.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(E(163))}}catch(x){J(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,R=e;break}R=t.return}return v=Lo,Lo=!1,v}function Gn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,a!==void 0&&ya(t,n,a)}l=l.next}while(l!==r)}}function Bl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xa(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Gc(e){var t=e.alternate;t!==null&&(e.alternate=null,Gc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ke],delete t[fr],delete t[sa],delete t[Sp],delete t[kp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Jc(e){return e.tag===5||e.tag===3||e.tag===4}function To(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ja(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ml));else if(r!==4&&(e=e.child,e!==null))for(ja(e,t,n),e=e.sibling;e!==null;)ja(e,t,n),e=e.sibling}function wa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(wa(e,t,n),e=e.sibling;e!==null;)wa(e,t,n),e=e.sibling}var ae=null,Ue=!1;function it(e,t,n){for(n=n.child;n!==null;)Zc(e,t,n),n=n.sibling}function Zc(e,t,n){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(zl,n)}catch{}switch(n.tag){case 5:fe||on(n,t);case 6:var r=ae,l=Ue;ae=null,it(e,t,n),ae=r,Ue=l,ae!==null&&(Ue?(e=ae,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ae.removeChild(n.stateNode));break;case 18:ae!==null&&(Ue?(e=ae,n=n.stateNode,e.nodeType===8?gs(e.parentNode,n):e.nodeType===1&&gs(e,n),ir(e)):gs(ae,n.stateNode));break;case 4:r=ae,l=Ue,ae=n.stateNode.containerInfo,Ue=!0,it(e,t,n),ae=r,Ue=l;break;case 0:case 11:case 14:case 15:if(!fe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var a=l,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&ya(n,t,i),l=l.next}while(l!==r)}it(e,t,n);break;case 1:if(!fe&&(on(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){J(n,t,o)}it(e,t,n);break;case 21:it(e,t,n);break;case 22:n.mode&1?(fe=(r=fe)||n.memoizedState!==null,it(e,t,n),fe=r):it(e,t,n);break;default:it(e,t,n)}}function Ro(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ap),t.forEach(function(r){var l=Gp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function $e(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var a=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 5:ae=o.stateNode,Ue=!1;break e;case 3:ae=o.stateNode.containerInfo,Ue=!0;break e;case 4:ae=o.stateNode.containerInfo,Ue=!0;break e}o=o.return}if(ae===null)throw Error(E(160));Zc(a,i,l),ae=null,Ue=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(d){J(l,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qc(t,e),t=t.sibling}function qc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if($e(t,e),Ve(e),r&4){try{Gn(3,e,e.return),Bl(3,e)}catch(j){J(e,e.return,j)}try{Gn(5,e,e.return)}catch(j){J(e,e.return,j)}}break;case 1:$e(t,e),Ve(e),r&512&&n!==null&&on(n,n.return);break;case 5:if($e(t,e),Ve(e),r&512&&n!==null&&on(n,n.return),e.flags&32){var l=e.stateNode;try{rr(l,"")}catch(j){J(e,e.return,j)}}if(r&4&&(l=e.stateNode,l!=null)){var a=e.memoizedProps,i=n!==null?n.memoizedProps:a,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&wu(l,a),Hs(o,i);var d=Hs(o,a);for(i=0;i<u.length;i+=2){var m=u[i],p=u[i+1];m==="style"?Eu(l,p):m==="dangerouslySetInnerHTML"?ku(l,p):m==="children"?rr(l,p):Fa(l,m,p,d)}switch(o){case"input":As(l,a);break;case"textarea":Nu(l,a);break;case"select":var h=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!a.multiple;var w=a.value;w!=null?cn(l,!!a.multiple,w,!1):h!==!!a.multiple&&(a.defaultValue!=null?cn(l,!!a.multiple,a.defaultValue,!0):cn(l,!!a.multiple,a.multiple?[]:"",!1))}l[fr]=a}catch(j){J(e,e.return,j)}}break;case 6:if($e(t,e),Ve(e),r&4){if(e.stateNode===null)throw Error(E(162));l=e.stateNode,a=e.memoizedProps;try{l.nodeValue=a}catch(j){J(e,e.return,j)}}break;case 3:if($e(t,e),Ve(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ir(t.containerInfo)}catch(j){J(e,e.return,j)}break;case 4:$e(t,e),Ve(e);break;case 13:$e(t,e),Ve(e),l=e.child,l.flags&8192&&(a=l.memoizedState!==null,l.stateNode.isHidden=a,!a||l.alternate!==null&&l.alternate.memoizedState!==null||(gi=q())),r&4&&Ro(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(fe=(d=fe)||m,$e(t,e),fe=d):$e(t,e),Ve(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!m&&e.mode&1)for(R=e,m=e.child;m!==null;){for(p=R=m;R!==null;){switch(h=R,w=h.child,h.tag){case 0:case 11:case 14:case 15:Gn(4,h,h.return);break;case 1:on(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(j){J(r,n,j)}}break;case 5:on(h,h.return);break;case 22:if(h.memoizedState!==null){Oo(p);continue}}w!==null?(w.return=h,R=w):Oo(p)}m=m.sibling}e:for(m=null,p=e;;){if(p.tag===5){if(m===null){m=p;try{l=p.stateNode,d?(a=l.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=p.stateNode,u=p.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=Cu("display",i))}catch(j){J(e,e.return,j)}}}else if(p.tag===6){if(m===null)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(j){J(e,e.return,j)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;m===p&&(m=null),p=p.return}m===p&&(m=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:$e(t,e),Ve(e),r&4&&Ro(e);break;case 21:break;default:$e(t,e),Ve(e)}}function Ve(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Jc(n)){var r=n;break e}n=n.return}throw Error(E(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(rr(l,""),r.flags&=-33);var a=To(e);wa(e,a,l);break;case 3:case 4:var i=r.stateNode.containerInfo,o=To(e);ja(e,o,i);break;default:throw Error(E(161))}}catch(u){J(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Bp(e,t,n){R=e,ed(e)}function ed(e,t,n){for(var r=(e.mode&1)!==0;R!==null;){var l=R,a=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||Wr;if(!i){var o=l.alternate,u=o!==null&&o.memoizedState!==null||fe;o=Wr;var d=fe;if(Wr=i,(fe=u)&&!d)for(R=l;R!==null;)i=R,u=i.child,i.tag===22&&i.memoizedState!==null?zo(l):u!==null?(u.return=i,R=u):zo(l);for(;a!==null;)R=a,ed(a),a=a.sibling;R=l,Wr=o,fe=d}Mo(e)}else l.subtreeFlags&8772&&a!==null?(a.return=l,R=a):Mo(e)}}function Mo(e){for(;R!==null;){var t=R;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:fe||Bl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!fe)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:Fe(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&vo(t,a,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}vo(t,i,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var m=d.memoizedState;if(m!==null){var p=m.dehydrated;p!==null&&ir(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(E(163))}fe||t.flags&512&&xa(t)}catch(h){J(t,t.return,h)}}if(t===e){R=null;break}if(n=t.sibling,n!==null){n.return=t.return,R=n;break}R=t.return}}function Oo(e){for(;R!==null;){var t=R;if(t===e){R=null;break}var n=t.sibling;if(n!==null){n.return=t.return,R=n;break}R=t.return}}function zo(e){for(;R!==null;){var t=R;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Bl(4,t)}catch(u){J(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){J(t,l,u)}}var a=t.return;try{xa(t)}catch(u){J(t,a,u)}break;case 5:var i=t.return;try{xa(t)}catch(u){J(t,i,u)}}}catch(u){J(t,t.return,u)}if(t===e){R=null;break}var o=t.sibling;if(o!==null){o.return=t.return,R=o;break}R=t.return}}var Wp=Math.ceil,El=st.ReactCurrentDispatcher,mi=st.ReactCurrentOwner,ze=st.ReactCurrentBatchConfig,F=0,se=null,ee=null,ie=0,Ce=0,un=Pt(0),ne=0,yr=null,Vt=0,Wl=0,vi=0,Jn=null,je=null,gi=0,Sn=1/0,Ge=null,_l=!1,Na=null,wt=null,Vr=!1,pt=null,Pl=0,Zn=0,Sa=null,rl=-1,ll=0;function ve(){return F&6?q():rl!==-1?rl:rl=q()}function Nt(e){return e.mode&1?F&2&&ie!==0?ie&-ie:Ep.transition!==null?(ll===0&&(ll=Fu()),ll):(e=A,e!==0||(e=window.event,e=e===void 0?16:Hu(e.type)),e):1}function Be(e,t,n,r){if(50<Zn)throw Zn=0,Sa=null,Error(E(185));Nr(e,n,r),(!(F&2)||e!==se)&&(e===se&&(!(F&2)&&(Wl|=n),ne===4&&dt(e,ie)),ke(e,r),n===1&&F===0&&!(t.mode&1)&&(Sn=q()+500,Ul&&Lt()))}function ke(e,t){var n=e.callbackNode;Ef(e,t);var r=dl(e,e===se?ie:0);if(r===0)n!==null&&Bi(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Bi(n),t===1)e.tag===0?Cp(Io.bind(null,e)):cc(Io.bind(null,e)),wp(function(){!(F&6)&&Lt()}),n=null;else{switch(Uu(r)){case 1:n=Wa;break;case 4:n=Du;break;case 16:n=cl;break;case 536870912:n=$u;break;default:n=cl}n=od(n,td.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function td(e,t){if(rl=-1,ll=0,F&6)throw Error(E(327));var n=e.callbackNode;if(mn()&&e.callbackNode!==n)return null;var r=dl(e,e===se?ie:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ll(e,r);else{t=r;var l=F;F|=2;var a=rd();(se!==e||ie!==t)&&(Ge=null,Sn=q()+500,Ut(e,t));do try{Kp();break}catch(o){nd(e,o)}while(!0);ni(),El.current=a,F=l,ee!==null?t=0:(se=null,ie=0,t=ne)}if(t!==0){if(t===2&&(l=Gs(e),l!==0&&(r=l,t=ka(e,l))),t===1)throw n=yr,Ut(e,0),dt(e,r),ke(e,q()),n;if(t===6)dt(e,r);else{if(l=e.current.alternate,!(r&30)&&!Vp(l)&&(t=Ll(e,r),t===2&&(a=Gs(e),a!==0&&(r=a,t=ka(e,a))),t===1))throw n=yr,Ut(e,0),dt(e,r),ke(e,q()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(E(345));case 2:It(e,je,Ge);break;case 3:if(dt(e,r),(r&130023424)===r&&(t=gi+500-q(),10<t)){if(dl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){ve(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=la(It.bind(null,e,je,Ge),t);break}It(e,je,Ge);break;case 4:if(dt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var i=31-be(r);a=1<<i,i=t[i],i>l&&(l=i),r&=~a}if(r=l,r=q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Wp(r/1960))-r,10<r){e.timeoutHandle=la(It.bind(null,e,je,Ge),r);break}It(e,je,Ge);break;case 5:It(e,je,Ge);break;default:throw Error(E(329))}}}return ke(e,q()),e.callbackNode===n?td.bind(null,e):null}function ka(e,t){var n=Jn;return e.current.memoizedState.isDehydrated&&(Ut(e,t).flags|=256),e=Ll(e,t),e!==2&&(t=je,je=n,t!==null&&Ca(t)),e}function Ca(e){je===null?je=e:je.push.apply(je,e)}function Vp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],a=l.getSnapshot;l=l.value;try{if(!We(a(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function dt(e,t){for(t&=~vi,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-be(t),r=1<<n;e[n]=-1,t&=~r}}function Io(e){if(F&6)throw Error(E(327));mn();var t=dl(e,0);if(!(t&1))return ke(e,q()),null;var n=Ll(e,t);if(e.tag!==0&&n===2){var r=Gs(e);r!==0&&(t=r,n=ka(e,r))}if(n===1)throw n=yr,Ut(e,0),dt(e,t),ke(e,q()),n;if(n===6)throw Error(E(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,It(e,je,Ge),ke(e,q()),null}function yi(e,t){var n=F;F|=1;try{return e(t)}finally{F=n,F===0&&(Sn=q()+500,Ul&&Lt())}}function Ht(e){pt!==null&&pt.tag===0&&!(F&6)&&mn();var t=F;F|=1;var n=ze.transition,r=A;try{if(ze.transition=null,A=1,e)return e()}finally{A=r,ze.transition=n,F=t,!(F&6)&&Lt()}}function xi(){Ce=un.current,V(un)}function Ut(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jp(n)),ee!==null)for(n=ee.return;n!==null;){var r=n;switch(qa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&vl();break;case 3:wn(),V(Ne),V(he),oi();break;case 5:ii(r);break;case 4:wn();break;case 13:V(K);break;case 19:V(K);break;case 10:ri(r.type._context);break;case 22:case 23:xi()}n=n.return}if(se=e,ee=e=St(e.current,null),ie=Ce=t,ne=0,yr=null,vi=Wl=Vt=0,je=Jn=null,$t!==null){for(t=0;t<$t.length;t++)if(n=$t[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,a=n.pending;if(a!==null){var i=a.next;a.next=l,r.next=i}n.pending=r}$t=null}return e}function nd(e,t){do{var n=ee;try{if(ni(),el.current=Cl,kl){for(var r=Q.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}kl=!1}if(Wt=0,le=te=Q=null,Xn=!1,mr=0,mi.current=null,n===null||n.return===null){ne=1,yr=t,ee=null;break}e:{var a=e,i=n.return,o=n,u=t;if(t=ie,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,m=o,p=m.tag;if(!(m.mode&1)&&(p===0||p===11||p===15)){var h=m.alternate;h?(m.updateQueue=h.updateQueue,m.memoizedState=h.memoizedState,m.lanes=h.lanes):(m.updateQueue=null,m.memoizedState=null)}var w=No(i);if(w!==null){w.flags&=-257,So(w,i,o,a,t),w.mode&1&&wo(a,d,t),t=w,u=d;var v=t.updateQueue;if(v===null){var j=new Set;j.add(u),t.updateQueue=j}else v.add(u);break e}else{if(!(t&1)){wo(a,d,t),ji();break e}u=Error(E(426))}}else if(H&&o.mode&1){var N=No(i);if(N!==null){!(N.flags&65536)&&(N.flags|=256),So(N,i,o,a,t),ei(Nn(u,o));break e}}a=u=Nn(u,o),ne!==4&&(ne=2),Jn===null?Jn=[a]:Jn.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var c=Uc(a,u,t);mo(a,c);break e;case 1:o=u;var f=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof f.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(wt===null||!wt.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var x=Ac(a,o,t);mo(a,x);break e}}a=a.return}while(a!==null)}sd(n)}catch(k){t=k,ee===n&&n!==null&&(ee=n=n.return);continue}break}while(!0)}function rd(){var e=El.current;return El.current=Cl,e===null?Cl:e}function ji(){(ne===0||ne===3||ne===2)&&(ne=4),se===null||!(Vt&268435455)&&!(Wl&268435455)||dt(se,ie)}function Ll(e,t){var n=F;F|=2;var r=rd();(se!==e||ie!==t)&&(Ge=null,Ut(e,t));do try{Hp();break}catch(l){nd(e,l)}while(!0);if(ni(),F=n,El.current=r,ee!==null)throw Error(E(261));return se=null,ie=0,ne}function Hp(){for(;ee!==null;)ld(ee)}function Kp(){for(;ee!==null&&!gf();)ld(ee)}function ld(e){var t=id(e.alternate,e,Ce);e.memoizedProps=e.pendingProps,t===null?sd(e):ee=t,mi.current=null}function sd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Up(n,t),n!==null){n.flags&=32767,ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ne=6,ee=null;return}}else if(n=Fp(n,t,Ce),n!==null){ee=n;return}if(t=t.sibling,t!==null){ee=t;return}ee=t=e}while(t!==null);ne===0&&(ne=5)}function It(e,t,n){var r=A,l=ze.transition;try{ze.transition=null,A=1,Qp(e,t,n,r)}finally{ze.transition=l,A=r}return null}function Qp(e,t,n,r){do mn();while(pt!==null);if(F&6)throw Error(E(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(E(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(_f(e,a),e===se&&(ee=se=null,ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Vr||(Vr=!0,od(cl,function(){return mn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=ze.transition,ze.transition=null;var i=A;A=1;var o=F;F|=4,mi.current=null,bp(e,n),qc(n,e),pp(na),fl=!!ta,na=ta=null,e.current=n,Bp(n),yf(),F=o,A=i,ze.transition=a}else e.current=n;if(Vr&&(Vr=!1,pt=e,Pl=l),a=e.pendingLanes,a===0&&(wt=null),wf(n.stateNode),ke(e,q()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(_l)throw _l=!1,e=Na,Na=null,e;return Pl&1&&e.tag!==0&&mn(),a=e.pendingLanes,a&1?e===Sa?Zn++:(Zn=0,Sa=e):Zn=0,Lt(),null}function mn(){if(pt!==null){var e=Uu(Pl),t=ze.transition,n=A;try{if(ze.transition=null,A=16>e?16:e,pt===null)var r=!1;else{if(e=pt,pt=null,Pl=0,F&6)throw Error(E(331));var l=F;for(F|=4,R=e.current;R!==null;){var a=R,i=a.child;if(R.flags&16){var o=a.deletions;if(o!==null){for(var u=0;u<o.length;u++){var d=o[u];for(R=d;R!==null;){var m=R;switch(m.tag){case 0:case 11:case 15:Gn(8,m,a)}var p=m.child;if(p!==null)p.return=m,R=p;else for(;R!==null;){m=R;var h=m.sibling,w=m.return;if(Gc(m),m===d){R=null;break}if(h!==null){h.return=w,R=h;break}R=w}}}var v=a.alternate;if(v!==null){var j=v.child;if(j!==null){v.child=null;do{var N=j.sibling;j.sibling=null,j=N}while(j!==null)}}R=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,R=i;else e:for(;R!==null;){if(a=R,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Gn(9,a,a.return)}var c=a.sibling;if(c!==null){c.return=a.return,R=c;break e}R=a.return}}var f=e.current;for(R=f;R!==null;){i=R;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,R=g;else e:for(i=f;R!==null;){if(o=R,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Bl(9,o)}}catch(k){J(o,o.return,k)}if(o===i){R=null;break e}var x=o.sibling;if(x!==null){x.return=o.return,R=x;break e}R=o.return}}if(F=l,Lt(),Qe&&typeof Qe.onPostCommitFiberRoot=="function")try{Qe.onPostCommitFiberRoot(zl,e)}catch{}r=!0}return r}finally{A=n,ze.transition=t}}return!1}function Do(e,t,n){t=Nn(n,t),t=Uc(e,t,1),e=jt(e,t,1),t=ve(),e!==null&&(Nr(e,1,t),ke(e,t))}function J(e,t,n){if(e.tag===3)Do(e,e,n);else for(;t!==null;){if(t.tag===3){Do(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(wt===null||!wt.has(r))){e=Nn(n,e),e=Ac(t,e,1),t=jt(t,e,1),e=ve(),t!==null&&(Nr(t,1,e),ke(t,e));break}}t=t.return}}function Yp(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ve(),e.pingedLanes|=e.suspendedLanes&n,se===e&&(ie&n)===n&&(ne===4||ne===3&&(ie&130023424)===ie&&500>q()-gi?Ut(e,0):vi|=n),ke(e,t)}function ad(e,t){t===0&&(e.mode&1?(t=zr,zr<<=1,!(zr&130023424)&&(zr=4194304)):t=1);var n=ve();e=rt(e,t),e!==null&&(Nr(e,t,n),ke(e,n))}function Xp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function Gp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(E(314))}r!==null&&r.delete(t),ad(e,n)}var id;id=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ne.current)we=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return we=!1,$p(e,t,n);we=!!(e.flags&131072)}else we=!1,H&&t.flags&1048576&&dc(t,xl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;nl(e,t),e=t.pendingProps;var l=yn(t,he.current);hn(t,n),l=ci(null,t,r,e,l,n);var a=di();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Se(r)?(a=!0,gl(t)):a=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,si(t),l.updater=bl,t.stateNode=l,l._reactInternals=t,da(t,r,e,n),t=ha(null,t,r,!0,a,n)):(t.tag=0,H&&a&&Za(t),me(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(nl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Zp(r),e=Fe(r,e),l){case 0:t=pa(null,t,r,e,n);break e;case 1:t=Eo(null,t,r,e,n);break e;case 11:t=ko(null,t,r,e,n);break e;case 14:t=Co(null,t,r,Fe(r.type,e),n);break e}throw Error(E(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),pa(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),Eo(e,t,r,l,n);case 3:e:{if(Vc(t),e===null)throw Error(E(387));r=t.pendingProps,a=t.memoizedState,l=a.element,gc(e,t),Nl(t,r,null,n);var i=t.memoizedState;if(r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){l=Nn(Error(E(423)),t),t=_o(e,t,r,n,l);break e}else if(r!==l){l=Nn(Error(E(424)),t),t=_o(e,t,r,n,l);break e}else for(Ee=xt(t.stateNode.containerInfo.firstChild),_e=t,H=!0,Ae=null,n=mc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xn(),r===l){t=lt(e,t,n);break e}me(e,t,r,n)}t=t.child}return t;case 5:return yc(t),e===null&&oa(t),r=t.type,l=t.pendingProps,a=e!==null?e.memoizedProps:null,i=l.children,ra(r,l)?i=null:a!==null&&ra(r,a)&&(t.flags|=32),Wc(e,t),me(e,t,i,n),t.child;case 6:return e===null&&oa(t),null;case 13:return Hc(e,t,n);case 4:return ai(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=jn(t,null,r,n):me(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),ko(e,t,r,l,n);case 7:return me(e,t,t.pendingProps,n),t.child;case 8:return me(e,t,t.pendingProps.children,n),t.child;case 12:return me(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,a=t.memoizedProps,i=l.value,b(jl,r._currentValue),r._currentValue=i,a!==null)if(We(a.value,i)){if(a.children===l.children&&!Ne.current){t=lt(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){i=a.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(a.tag===1){u=et(-1,n&-n),u.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?u.next=u:(u.next=m.next,m.next=u),d.pending=u}}a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),ua(a.return,n,t),o.lanes|=n;break}u=u.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(E(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),ua(i,n,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}me(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,hn(t,n),l=Ie(l),r=r(l),t.flags|=1,me(e,t,r,n),t.child;case 14:return r=t.type,l=Fe(r,t.pendingProps),l=Fe(r.type,l),Co(e,t,r,l,n);case 15:return bc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Fe(r,l),nl(e,t),t.tag=1,Se(r)?(e=!0,gl(t)):e=!1,hn(t,n),Fc(t,r,l),da(t,r,l,n),ha(null,t,r,!0,e,n);case 19:return Kc(e,t,n);case 22:return Bc(e,t,n)}throw Error(E(156,t.tag))};function od(e,t){return Iu(e,t)}function Jp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Oe(e,t,n,r){return new Jp(e,t,n,r)}function wi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zp(e){if(typeof e=="function")return wi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Aa)return 11;if(e===ba)return 14}return 2}function St(e,t){var n=e.alternate;return n===null?(n=Oe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function sl(e,t,n,r,l,a){var i=2;if(r=e,typeof e=="function")wi(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Zt:return At(n.children,l,a,t);case Ua:i=8,l|=8;break;case Is:return e=Oe(12,n,t,l|2),e.elementType=Is,e.lanes=a,e;case Ds:return e=Oe(13,n,t,l),e.elementType=Ds,e.lanes=a,e;case $s:return e=Oe(19,n,t,l),e.elementType=$s,e.lanes=a,e;case yu:return Vl(n,l,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case vu:i=10;break e;case gu:i=9;break e;case Aa:i=11;break e;case ba:i=14;break e;case ot:i=16,r=null;break e}throw Error(E(130,e==null?e:typeof e,""))}return t=Oe(i,n,t,l),t.elementType=e,t.type=r,t.lanes=a,t}function At(e,t,n,r){return e=Oe(7,e,r,t),e.lanes=n,e}function Vl(e,t,n,r){return e=Oe(22,e,r,t),e.elementType=yu,e.lanes=n,e.stateNode={isHidden:!1},e}function Cs(e,t,n){return e=Oe(6,e,null,t),e.lanes=n,e}function Es(e,t,n){return t=Oe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=as(0),this.expirationTimes=as(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=as(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ni(e,t,n,r,l,a,i,o,u){return e=new qp(e,t,n,o,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Oe(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},si(a),e}function eh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jt,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ud(e){if(!e)return Et;e=e._reactInternals;e:{if(Qt(e)!==e||e.tag!==1)throw Error(E(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Se(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(E(171))}if(e.tag===1){var n=e.type;if(Se(n))return uc(e,n,t)}return t}function cd(e,t,n,r,l,a,i,o,u){return e=Ni(n,r,!0,e,l,a,i,o,u),e.context=ud(null),n=e.current,r=ve(),l=Nt(n),a=et(r,l),a.callback=t??null,jt(n,a,l),e.current.lanes=l,Nr(e,l,r),ke(e,r),e}function Hl(e,t,n,r){var l=t.current,a=ve(),i=Nt(l);return n=ud(n),t.context===null?t.context=n:t.pendingContext=n,t=et(a,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=jt(l,t,i),e!==null&&(Be(e,l,i,a),qr(e,l,i)),i}function Tl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function $o(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Si(e,t){$o(e,t),(e=e.alternate)&&$o(e,t)}function th(){return null}var dd=typeof reportError=="function"?reportError:function(e){console.error(e)};function ki(e){this._internalRoot=e}Kl.prototype.render=ki.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(E(409));Hl(e,t,null,null)};Kl.prototype.unmount=ki.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ht(function(){Hl(null,e,null,null)}),t[nt]=null}};function Kl(e){this._internalRoot=e}Kl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ct.length&&t!==0&&t<ct[n].priority;n++);ct.splice(n,0,e),n===0&&Vu(e)}};function Ci(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ql(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fo(){}function nh(e,t,n,r,l){if(l){if(typeof r=="function"){var a=r;r=function(){var d=Tl(i);a.call(d)}}var i=cd(t,r,e,0,null,!1,!1,"",Fo);return e._reactRootContainer=i,e[nt]=i.current,cr(e.nodeType===8?e.parentNode:e),Ht(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var o=r;r=function(){var d=Tl(u);o.call(d)}}var u=Ni(e,0,!1,null,null,!1,!1,"",Fo);return e._reactRootContainer=u,e[nt]=u.current,cr(e.nodeType===8?e.parentNode:e),Ht(function(){Hl(t,u,n,r)}),u}function Yl(e,t,n,r,l){var a=n._reactRootContainer;if(a){var i=a;if(typeof l=="function"){var o=l;l=function(){var u=Tl(i);o.call(u)}}Hl(t,i,e,l)}else i=nh(n,t,e,l,r);return Tl(i)}Au=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Bn(t.pendingLanes);n!==0&&(Va(t,n|1),ke(t,q()),!(F&6)&&(Sn=q()+500,Lt()))}break;case 13:Ht(function(){var r=rt(e,1);if(r!==null){var l=ve();Be(r,e,1,l)}}),Si(e,1)}};Ha=function(e){if(e.tag===13){var t=rt(e,134217728);if(t!==null){var n=ve();Be(t,e,134217728,n)}Si(e,134217728)}};bu=function(e){if(e.tag===13){var t=Nt(e),n=rt(e,t);if(n!==null){var r=ve();Be(n,e,t,r)}Si(e,t)}};Bu=function(){return A};Wu=function(e,t){var n=A;try{return A=e,t()}finally{A=n}};Qs=function(e,t,n){switch(t){case"input":if(As(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=Fl(r);if(!l)throw Error(E(90));ju(r),As(r,l)}}}break;case"textarea":Nu(e,n);break;case"select":t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}};Lu=yi;Tu=Ht;var rh={usingClientEntryPoint:!1,Events:[kr,nn,Fl,_u,Pu,yi]},Un={findFiberByHostInstance:Dt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lh={bundleType:Un.bundleType,version:Un.version,rendererPackageName:Un.rendererPackageName,rendererConfig:Un.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:st.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ou(e),e===null?null:e.stateNode},findFiberByHostInstance:Un.findFiberByHostInstance||th,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hr.isDisabled&&Hr.supportsFiber)try{zl=Hr.inject(lh),Qe=Hr}catch{}}Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rh;Le.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ci(t))throw Error(E(200));return eh(e,t,null,n)};Le.createRoot=function(e,t){if(!Ci(e))throw Error(E(299));var n=!1,r="",l=dd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=Ni(e,1,!1,null,null,n,!1,r,l),e[nt]=t.current,cr(e.nodeType===8?e.parentNode:e),new ki(t)};Le.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(E(188)):(e=Object.keys(e).join(","),Error(E(268,e)));return e=Ou(t),e=e===null?null:e.stateNode,e};Le.flushSync=function(e){return Ht(e)};Le.hydrate=function(e,t,n){if(!Ql(t))throw Error(E(200));return Yl(null,e,t,!0,n)};Le.hydrateRoot=function(e,t,n){if(!Ci(e))throw Error(E(405));var r=n!=null&&n.hydratedSources||null,l=!1,a="",i=dd;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=cd(t,null,e,1,n??null,l,!1,a,i),e[nt]=t.current,cr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new Kl(t)};Le.render=function(e,t,n){if(!Ql(t))throw Error(E(200));return Yl(null,e,t,!1,n)};Le.unmountComponentAtNode=function(e){if(!Ql(e))throw Error(E(40));return e._reactRootContainer?(Ht(function(){Yl(null,null,e,!1,function(){e._reactRootContainer=null,e[nt]=null})}),!0):!1};Le.unstable_batchedUpdates=yi;Le.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ql(n))throw Error(E(200));if(e==null||e._reactInternals===void 0)throw Error(E(38));return Yl(e,t,n,!1,r)};Le.version="18.3.1-next-f1338f8080-20240426";function fd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fd)}catch(e){console.error(e)}}fd(),fu.exports=Le;var sh=fu.exports,pd,Uo=sh;pd=Uo.createRoot,Uo.hydrateRoot;/**
41
- * @remix-run/router v1.23.2
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function xr(){return xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xr.apply(this,arguments)}var ht;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ht||(ht={}));const Ao="popstate";function ah(e){e===void 0&&(e={});function t(r,l){let{pathname:a,search:i,hash:o}=r.location;return Ea("",{pathname:a,search:i,hash:o},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:Rl(l)}return oh(t,n,null,e)}function Y(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ei(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ih(){return Math.random().toString(36).substr(2,8)}function bo(e,t){return{usr:e.state,key:e.key,idx:t}}function Ea(e,t,n,r){return n===void 0&&(n=null),xr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pn(t):t,{state:n,key:t&&t.key||r||ih()})}function Rl(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Pn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function oh(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:a=!1}=r,i=l.history,o=ht.Pop,u=null,d=m();d==null&&(d=0,i.replaceState(xr({},i.state,{idx:d}),""));function m(){return(i.state||{idx:null}).idx}function p(){o=ht.Pop;let N=m(),c=N==null?null:N-d;d=N,u&&u({action:o,location:j.location,delta:c})}function h(N,c){o=ht.Push;let f=Ea(j.location,N,c);d=m()+1;let g=bo(f,d),x=j.createHref(f);try{i.pushState(g,"",x)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;l.location.assign(x)}a&&u&&u({action:o,location:j.location,delta:1})}function w(N,c){o=ht.Replace;let f=Ea(j.location,N,c);d=m();let g=bo(f,d),x=j.createHref(f);i.replaceState(g,"",x),a&&u&&u({action:o,location:j.location,delta:0})}function v(N){let c=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof N=="string"?N:Rl(N);return f=f.replace(/ $/,"%20"),Y(c,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,c)}let j={get action(){return o},get location(){return e(l,i)},listen(N){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Ao,p),u=N,()=>{l.removeEventListener(Ao,p),u=null}},createHref(N){return t(l,N)},createURL:v,encodeLocation(N){let c=v(N);return{pathname:c.pathname,search:c.search,hash:c.hash}},push:h,replace:w,go(N){return i.go(N)}};return j}var Bo;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Bo||(Bo={}));function uh(e,t,n){return n===void 0&&(n="/"),ch(e,t,n)}function ch(e,t,n,r){let l=typeof t=="string"?Pn(t):t,a=kn(l.pathname||"/",n);if(a==null)return null;let i=hd(e);dh(i);let o=null;for(let u=0;o==null&&u<i.length;++u){let d=Nh(a);o=jh(i[u],d)}return o}function hd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(a,i,o)=>{let u={relativePath:o===void 0?a.path||"":o,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};u.relativePath.startsWith("/")&&(Y(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let d=kt([r,u.relativePath]),m=n.concat(u);a.children&&a.children.length>0&&(Y(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),hd(a.children,t,m,d)),!(a.path==null&&!a.index)&&t.push({path:d,score:yh(d,a.index),routesMeta:m})};return e.forEach((a,i)=>{var o;if(a.path===""||!((o=a.path)!=null&&o.includes("?")))l(a,i);else for(let u of md(a.path))l(a,i,u)}),t}function md(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return l?[a,""]:[a];let i=md(r.join("/")),o=[];return o.push(...i.map(u=>u===""?a:[a,u].join("/"))),l&&o.push(...i),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function dh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const fh=/^:[\w-]+$/,ph=3,hh=2,mh=1,vh=10,gh=-2,Wo=e=>e==="*";function yh(e,t){let n=e.split("/"),r=n.length;return n.some(Wo)&&(r+=gh),t&&(r+=hh),n.filter(l=>!Wo(l)).reduce((l,a)=>l+(fh.test(a)?ph:a===""?mh:vh),r)}function xh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function jh(e,t,n){let{routesMeta:r}=e,l={},a="/",i=[];for(let o=0;o<r.length;++o){let u=r[o],d=o===r.length-1,m=a==="/"?t:t.slice(a.length)||"/",p=_a({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},m),h=u.route;if(!p)return null;Object.assign(l,p.params),i.push({params:l,pathname:kt([a,p.pathname]),pathnameBase:_h(kt([a,p.pathnameBase])),route:h}),p.pathnameBase!=="/"&&(a=kt([a,p.pathnameBase]))}return i}function _a(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=wh(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let a=l[0],i=a.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:r.reduce((d,m,p)=>{let{paramName:h,isOptional:w}=m;if(h==="*"){let j=o[p]||"";i=a.slice(0,a.length-j.length).replace(/(.)\/+$/,"$1")}const v=o[p];return w&&!v?d[h]=void 0:d[h]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:i,pattern:e}}function wh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ei(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Nh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ei(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function kn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const Sh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kh=e=>Sh.test(e);function Ch(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Pn(e):e,a;if(n)if(kh(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),Ei(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?a=Vo(n.substring(1),"/"):a=Vo(n,t)}else a=t;return{pathname:a,search:Ph(r),hash:Lh(l)}}function Vo(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function _s(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Eh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _i(e,t){let n=Eh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Pi(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Pn(e):(l=xr({},e),Y(!l.pathname||!l.pathname.includes("?"),_s("?","pathname","search",l)),Y(!l.pathname||!l.pathname.includes("#"),_s("#","pathname","hash",l)),Y(!l.search||!l.search.includes("#"),_s("#","search","hash",l)));let a=e===""||l.pathname==="",i=a?"/":l.pathname,o;if(i==null)o=n;else{let p=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),p-=1;l.pathname=h.join("/")}o=p>=0?t[p]:"/"}let u=Ch(l,o),d=i&&i!=="/"&&i.endsWith("/"),m=(a||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||m)&&(u.pathname+="/"),u}const kt=e=>e.join("/").replace(/\/\/+/g,"/"),_h=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ph=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Lh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Th(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const vd=["post","put","patch","delete"];new Set(vd);const Rh=["get",...vd];new Set(Rh);/**
50
- * React Router v6.30.3
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function jr(){return jr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jr.apply(this,arguments)}const Xl=y.createContext(null),gd=y.createContext(null),at=y.createContext(null),Gl=y.createContext(null),Tt=y.createContext({outlet:null,matches:[],isDataRoute:!1}),yd=y.createContext(null);function Mh(e,t){let{relative:n}=t===void 0?{}:t;Ln()||Y(!1);let{basename:r,navigator:l}=y.useContext(at),{hash:a,pathname:i,search:o}=Jl(e,{relative:n}),u=i;return r!=="/"&&(u=i==="/"?r:kt([r,i])),l.createHref({pathname:u,search:o,hash:a})}function Ln(){return y.useContext(Gl)!=null}function Rt(){return Ln()||Y(!1),y.useContext(Gl).location}function xd(e){y.useContext(at).static||y.useLayoutEffect(e)}function Er(){let{isDataRoute:e}=y.useContext(Tt);return e?Hh():Oh()}function Oh(){Ln()||Y(!1);let e=y.useContext(Xl),{basename:t,future:n,navigator:r}=y.useContext(at),{matches:l}=y.useContext(Tt),{pathname:a}=Rt(),i=JSON.stringify(_i(l,n.v7_relativeSplatPath)),o=y.useRef(!1);return xd(()=>{o.current=!0}),y.useCallback(function(d,m){if(m===void 0&&(m={}),!o.current)return;if(typeof d=="number"){r.go(d);return}let p=Pi(d,JSON.parse(i),a,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:kt([t,p.pathname])),(m.replace?r.replace:r.push)(p,m.state,m)},[t,r,i,a,e])}function Jl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(at),{matches:l}=y.useContext(Tt),{pathname:a}=Rt(),i=JSON.stringify(_i(l,r.v7_relativeSplatPath));return y.useMemo(()=>Pi(e,JSON.parse(i),a,n==="path"),[e,i,a,n])}function zh(e,t){return Ih(e,t)}function Ih(e,t,n,r){Ln()||Y(!1);let{navigator:l}=y.useContext(at),{matches:a}=y.useContext(Tt),i=a[a.length-1],o=i?i.params:{};i&&i.pathname;let u=i?i.pathnameBase:"/";i&&i.route;let d=Rt(),m;if(t){var p;let N=typeof t=="string"?Pn(t):t;u==="/"||(p=N.pathname)!=null&&p.startsWith(u)||Y(!1),m=N}else m=d;let h=m.pathname||"/",w=h;if(u!=="/"){let N=u.replace(/^\//,"").split("/");w="/"+h.replace(/^\//,"").split("/").slice(N.length).join("/")}let v=uh(e,{pathname:w}),j=Ah(v&&v.map(N=>Object.assign({},N,{params:Object.assign({},o,N.params),pathname:kt([u,l.encodeLocation?l.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?u:kt([u,l.encodeLocation?l.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),a,n,r);return t&&j?y.createElement(Gl.Provider,{value:{location:jr({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:ht.Pop}},j):j}function Dh(){let e=Vh(),t=Th(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:l},n):null,null)}const $h=y.createElement(Dh,null);class Fh extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(Tt.Provider,{value:this.props.routeContext},y.createElement(yd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Uh(e){let{routeContext:t,match:n,children:r}=e,l=y.useContext(Xl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Tt.Provider,{value:t},r)}function Ah(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=(l=n)==null?void 0:l.errors;if(o!=null){let m=i.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);m>=0||Y(!1),i=i.slice(0,Math.min(i.length,m+1))}let u=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let m=0;m<i.length;m++){let p=i[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=m),p.route.id){let{loaderData:h,errors:w}=n,v=p.route.loader&&h[p.route.id]===void 0&&(!w||w[p.route.id]===void 0);if(p.route.lazy||v){u=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}return i.reduceRight((m,p,h)=>{let w,v=!1,j=null,N=null;n&&(w=o&&p.route.id?o[p.route.id]:void 0,j=p.route.errorElement||$h,u&&(d<0&&h===0?(Kh("route-fallback"),v=!0,N=null):d===h&&(v=!0,N=p.route.hydrateFallbackElement||null)));let c=t.concat(i.slice(0,h+1)),f=()=>{let g;return w?g=j:v?g=N:p.route.Component?g=y.createElement(p.route.Component,null):p.route.element?g=p.route.element:g=m,y.createElement(Uh,{match:p,routeContext:{outlet:m,matches:c,isDataRoute:n!=null},children:g})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?y.createElement(Fh,{location:n.location,revalidation:n.revalidation,component:j,error:w,children:f(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):f()},null)}var jd=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(jd||{}),wd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wd||{});function bh(e){let t=y.useContext(Xl);return t||Y(!1),t}function Bh(e){let t=y.useContext(gd);return t||Y(!1),t}function Wh(e){let t=y.useContext(Tt);return t||Y(!1),t}function Nd(e){let t=Wh(),n=t.matches[t.matches.length-1];return n.route.id||Y(!1),n.route.id}function Vh(){var e;let t=y.useContext(yd),n=Bh(),r=Nd();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Hh(){let{router:e}=bh(jd.UseNavigateStable),t=Nd(wd.UseNavigateStable),n=y.useRef(!1);return xd(()=>{n.current=!0}),y.useCallback(function(l,a){a===void 0&&(a={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,jr({fromRouteId:t},a)))},[e,t])}const Ho={};function Kh(e,t,n){Ho[e]||(Ho[e]=!0)}function Qh(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Yh(e){let{to:t,replace:n,state:r,relative:l}=e;Ln()||Y(!1);let{future:a,static:i}=y.useContext(at),{matches:o}=y.useContext(Tt),{pathname:u}=Rt(),d=Er(),m=Pi(t,_i(o,a.v7_relativeSplatPath),u,l==="path"),p=JSON.stringify(m);return y.useEffect(()=>d(JSON.parse(p),{replace:n,state:r,relative:l}),[d,p,l,n,r]),null}function de(e){Y(!1)}function Xh(e){let{basename:t="/",children:n=null,location:r,navigationType:l=ht.Pop,navigator:a,static:i=!1,future:o}=e;Ln()&&Y(!1);let u=t.replace(/^\/*/,"/"),d=y.useMemo(()=>({basename:u,navigator:a,static:i,future:jr({v7_relativeSplatPath:!1},o)}),[u,o,a,i]);typeof r=="string"&&(r=Pn(r));let{pathname:m="/",search:p="",hash:h="",state:w=null,key:v="default"}=r,j=y.useMemo(()=>{let N=kn(m,u);return N==null?null:{location:{pathname:N,search:p,hash:h,state:w,key:v},navigationType:l}},[u,m,p,h,w,v,l]);return j==null?null:y.createElement(at.Provider,{value:d},y.createElement(Gl.Provider,{children:n,value:j}))}function Gh(e){let{children:t,location:n}=e;return zh(Pa(t),n)}new Promise(()=>{});function Pa(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,l)=>{if(!y.isValidElement(r))return;let a=[...t,l];if(r.type===y.Fragment){n.push.apply(n,Pa(r.props.children,a));return}r.type!==de&&Y(!1),!r.props.index||!r.props.children||Y(!1);let i={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Pa(r.props.children,a)),n.push(i)}),n}/**
59
- * React Router DOM v6.30.3
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ml.apply(this,arguments)}function Sd(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,a;for(a=0;a<r.length;a++)l=r[a],!(t.indexOf(l)>=0)&&(n[l]=e[l]);return n}function Jh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zh(e,t){return e.button===0&&(!t||t==="_self")&&!Jh(e)}function La(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function qh(e,t){let n=La(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(a=>{n.append(l,a)})}),n}const em=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tm=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],nm="6";try{window.__reactRouterVersion=nm}catch{}const rm=y.createContext({isTransitioning:!1}),lm="startTransition",Ko=Qd[lm];function sm(e){let{basename:t,children:n,future:r,window:l}=e,a=y.useRef();a.current==null&&(a.current=ah({window:l,v5Compat:!0}));let i=a.current,[o,u]=y.useState({action:i.action,location:i.location}),{v7_startTransition:d}=r||{},m=y.useCallback(p=>{d&&Ko?Ko(()=>u(p)):u(p)},[u,d]);return y.useLayoutEffect(()=>i.listen(m),[i,m]),y.useEffect(()=>Qh(r),[r]),y.createElement(Xh,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:i,future:r})}const am=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",im=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tn=y.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:a,replace:i,state:o,target:u,to:d,preventScrollReset:m,viewTransition:p}=t,h=Sd(t,em),{basename:w}=y.useContext(at),v,j=!1;if(typeof d=="string"&&im.test(d)&&(v=d,am))try{let g=new URL(window.location.href),x=d.startsWith("//")?new URL(g.protocol+d):new URL(d),k=kn(x.pathname,w);x.origin===g.origin&&k!=null?d=k+x.search+x.hash:j=!0}catch{}let N=Mh(d,{relative:l}),c=um(d,{replace:i,state:o,target:u,preventScrollReset:m,relative:l,viewTransition:p});function f(g){r&&r(g),g.defaultPrevented||c(g)}return y.createElement("a",Ml({},h,{href:v||N,onClick:j||a?r:f,ref:n,target:u}))}),Ta=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:a="",end:i=!1,style:o,to:u,viewTransition:d,children:m}=t,p=Sd(t,tm),h=Jl(u,{relative:p.relative}),w=Rt(),v=y.useContext(gd),{navigator:j,basename:N}=y.useContext(at),c=v!=null&&cm(h)&&d===!0,f=j.encodeLocation?j.encodeLocation(h).pathname:h.pathname,g=w.pathname,x=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;l||(g=g.toLowerCase(),x=x?x.toLowerCase():null,f=f.toLowerCase()),x&&N&&(x=kn(x,N)||x);const k=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let S=g===f||!i&&g.startsWith(f)&&g.charAt(k)==="/",C=x!=null&&(x===f||!i&&x.startsWith(f)&&x.charAt(f.length)==="/"),_={isActive:S,isPending:C,isTransitioning:c},O=S?r:void 0,M;typeof a=="function"?M=a(_):M=[a,S?"active":null,C?"pending":null,c?"transitioning":null].filter(Boolean).join(" ");let U=typeof o=="function"?o(_):o;return y.createElement(Tn,Ml({},p,{"aria-current":O,className:M,ref:n,style:U,to:u,viewTransition:d}),typeof m=="function"?m(_):m)});var Ra;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ra||(Ra={}));var Qo;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qo||(Qo={}));function om(e){let t=y.useContext(Xl);return t||Y(!1),t}function um(e,t){let{target:n,replace:r,state:l,preventScrollReset:a,relative:i,viewTransition:o}=t===void 0?{}:t,u=Er(),d=Rt(),m=Jl(e,{relative:i});return y.useCallback(p=>{if(Zh(p,n)){p.preventDefault();let h=r!==void 0?r:Rl(d)===Rl(m);u(e,{replace:h,state:l,preventScrollReset:a,relative:i,viewTransition:o})}},[d,u,m,r,l,n,e,a,i,o])}function kd(e){let t=y.useRef(La(e)),n=y.useRef(!1),r=Rt(),l=y.useMemo(()=>qh(r.search,n.current?null:t.current),[r.search]),a=Er(),i=y.useCallback((o,u)=>{const d=La(typeof o=="function"?o(l):o);n.current=!0,a("?"+d,u)},[a,l]);return[l,i]}function cm(e,t){t===void 0&&(t={});let n=y.useContext(rm);n==null&&Y(!1);let{basename:r}=om(Ra.useViewTransitionState),l=Jl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=kn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=kn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _a(l.pathname,i)!=null||_a(l.pathname,a)!=null}const Yo="nlm.sidenav.collapsed",dm=[{to:"/live",label:"Live",icon:pm()},{to:"/pulse",label:"Pulse",icon:hm()},{to:"/river",label:"River",icon:mm()},{to:"/thread",label:"Thread",icon:vm()},{to:"/search",label:"Search",icon:gm()},{to:"/recall",label:"Recall",icon:ym()},{to:"/settings",label:"Settings",icon:xm()}];function fm(){const[e,t]=y.useState(()=>typeof window>"u"?!1:window.localStorage.getItem(Yo)==="1");return y.useEffect(()=>{document.body.style.setProperty("--sidenav-w",e?"52px":"180px"),window.localStorage.setItem(Yo,e?"1":"0")},[e]),s.jsxs("nav",{className:`sidenav${e?" collapsed":""}`,"aria-label":"Primary navigation",children:[s.jsxs("div",{className:"sidenav-header",children:[s.jsx("span",{className:"sidenav-wordmark",children:"NLM"}),s.jsx("button",{className:"sidenav-toggle","aria-label":"Toggle sidebar",onClick:()=>t(n=>!n),children:e?Nm():wm()})]}),s.jsx("div",{className:"sidenav-items",children:dm.map(n=>s.jsxs(Ta,{to:n.to,className:({isActive:r})=>`sidenav-item${r?" active":""}`,"data-label":n.label,children:[s.jsx("span",{className:"item-icon",children:n.icon}),s.jsx("span",{className:"item-label",children:n.label})]},n.to))}),s.jsx("div",{className:"sidenav-footer",children:s.jsxs(Ta,{to:"/settings/data",className:"sidenav-item sidenav-data","data-label":"Data",children:[s.jsx("span",{className:"item-icon",children:jm()}),s.jsx("span",{className:"item-label",children:"Data"})]})})]})}function Yt(e,t=16){return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",children:e})}function pm(){return Yt(s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M19 12a7 7 0 00-14 0M22 12a10 10 0 00-20 0"})]}))}function hm(){return Yt(s.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"}))}function mm(){return Yt(s.jsx("path",{d:"M2 12c1.5-3 3-4.5 4.5-4.5S9 9 10.5 12s3 4.5 4.5 4.5S18 15 19.5 12 21 7.5 22 7.5"}))}function vm(){return Yt(s.jsxs(s.Fragment,{children:[s.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),s.jsx("circle",{cx:"18",cy:"6",r:"3"}),s.jsx("circle",{cx:"6",cy:"18",r:"3"}),s.jsx("path",{d:"M18 9a9 9 0 01-9 9"})]}))}function gm(){return Yt(s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}))}function ym(){return Yt(s.jsxs(s.Fragment,{children:[s.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"13"}),s.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),s.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"9"})]}))}function xm(){return Yt(s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]}))}function jm(){return s.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M21 12c0 1.657-4.03 3-9 3S3 13.657 3 12"}),s.jsx("path",{d:"M3 5v14c0 1.657 4.03 3 9 3s9-1.343 9-3V5"})]})}function wm(){return s.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Nm(){return s.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})})}async function Sm(e){const t=await fetch(e);if(!t.ok)throw new Error(`${e} → ${t.status}`);return t.json()}function qn(e,t,n){const[r,l]=y.useState({data:n,error:null,lastUpdated:null,loading:!0});return y.useEffect(()=>{let a=!1;const i=async()=>{try{const u=await Sm(e);a||l({data:u,error:null,lastUpdated:Date.now(),loading:!1})}catch(u){a||l(d=>({...d,error:u instanceof Error?u.message:String(u),loading:!1}))}};i();const o=setInterval(i,t);return()=>{a=!0,clearInterval(o)}},[e,t]),r}function al(e){if(!e)return"";const t=Date.parse(e);if(!Number.isFinite(t))return"";const n=Math.max(0,Math.floor((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const l=Math.floor(r/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function pe({w:e,h:t=12,radius:n=4,className:r}){const l={width:typeof e=="number"?`${e}px`:e??"100%",height:typeof t=="number"?`${t}px`:t,borderRadius:n};return s.jsx("span",{className:`skeleton${r?` ${r}`:""}`,style:l,"aria-hidden":"true"})}function km(){return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"kpi-row",children:[Array.from({length:4}).map((e,t)=>s.jsxs("div",{className:"kpi",children:[s.jsx(pe,{h:10,w:70}),s.jsx(pe,{h:28,w:90}),s.jsx(pe,{h:10,w:60})]},t)),s.jsx("div",{className:"kpi",children:s.jsx(pe,{h:56})})]}),s.jsx("div",{className:"pulse-grid",children:Array.from({length:4}).map((e,t)=>s.jsxs("section",{className:"card",children:[s.jsx("header",{className:"card-head",children:s.jsx(pe,{h:14,w:140})}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:"12px 0"},children:Array.from({length:5}).map((n,r)=>s.jsx(pe,{h:12,w:`${65+r*7%30}%`},r))})]},t))})]})}function Cm({rows:e=6}){return s.jsx("ul",{className:"session-list",children:Array.from({length:e}).map((t,n)=>s.jsxs("li",{className:"session-row session-row-detail",children:[s.jsx(pe,{h:18,w:56,radius:10}),s.jsxs("div",{className:"session-row-main",children:[s.jsx(pe,{h:13,w:`${50+n*11%35}%`}),s.jsx(pe,{h:11,w:`${30+n*13%50}%`})]}),s.jsx(pe,{h:10,w:48})]},n))})}function Em({rows:e=8,cols:t=6}){return s.jsx("tbody",{children:Array.from({length:e}).map((n,r)=>s.jsx("tr",{children:Array.from({length:t}).map((l,a)=>s.jsx("td",{children:s.jsx(pe,{h:12,w:a===0?"70%":a===t-1?"60%":"50%"})},a))},r))})}function _m(){return s.jsxs("div",{className:"drawer-body",children:[s.jsx("dl",{className:"kv-list",children:Array.from({length:5}).map((e,t)=>s.jsxs("div",{style:{display:"contents"},children:[s.jsx("dt",{className:"kv-label",children:s.jsx(pe,{h:10,w:70})}),s.jsx("dd",{className:"kv-value",children:s.jsx(pe,{h:12,w:`${40+t*13%50}%`})})]},t))}),s.jsx("h4",{className:"drawer-section",children:s.jsx(pe,{h:12,w:100})}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Array.from({length:4}).map((e,t)=>s.jsx(pe,{h:12,w:`${55+t*7%35}%`},t))})]})}function Zl({sessionId:e,onClose:t,entityColor:n}){const[r,l]=y.useState(null),[a,i]=y.useState(null);return y.useEffect(()=>{l(null),i(null),fetch(`/api/session/${encodeURIComponent(e)}`).then(async o=>{if(!o.ok)throw new Error(`HTTP ${o.status}`);const u=await o.json();l({id:String(u.id??e),label:String(u.label??""),summary:String(u.summary??""),body:String(u.body??""),status:String(u.status??"closed"),startedAt:typeof u.startedAt=="string"?u.startedAt:null,endedAt:typeof u.endedAt=="string"?u.endedAt:null,durationMin:typeof u.durationMin=="number"?u.durationMin:null,runtime:String(u.runtime??""),entities:Array.isArray(u.entities)?u.entities:[],decisions:Array.isArray(u.decisions)?u.decisions:[],open:Array.isArray(u.open)?u.open:[]})}).catch(o=>i(o instanceof Error?o.message:String(o)))},[e]),y.useEffect(()=>{const o=u=>{u.key==="Escape"&&t()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"drawer-backdrop",onClick:t}),s.jsxs("aside",{className:"session-drawer",role:"dialog","aria-modal":"true",children:[s.jsxs("header",{className:"drawer-head",children:[n&&s.jsx("span",{className:"dot",style:{background:n}}),s.jsx("h3",{className:"drawer-title",children:(r==null?void 0:r.label)??e}),s.jsx("button",{type:"button",className:"drawer-close",onClick:t,"aria-label":"Close",children:"×"})]}),a&&s.jsx("div",{className:"muted error drawer-body",children:a}),!r&&!a&&s.jsx(_m,{}),r&&s.jsxs("div",{className:"drawer-body",children:[s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Status"}),s.jsx("dd",{className:"kv-value",children:s.jsx("span",{className:`chip-inline status-${r.status}`,children:r.status})}),s.jsx("dt",{className:"kv-label",children:"Started"}),s.jsx("dd",{className:"kv-value mono small",children:r.startedAt??"—"}),s.jsx("dt",{className:"kv-label",children:"Duration"}),s.jsxs("dd",{className:"kv-value",children:[r.durationMin??"—"," min"]}),s.jsx("dt",{className:"kv-label",children:"Runtime"}),s.jsx("dd",{className:"kv-value mono small",children:r.runtime}),s.jsx("dt",{className:"kv-label",children:"Session ID"}),s.jsx("dd",{className:"kv-value mono small",children:r.id})]}),r.entities.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Entities"}),s.jsx("div",{className:"entity-chips",children:r.entities.map(o=>s.jsx(Tn,{to:`/thread?entity=${encodeURIComponent(o)}`,className:"chip",onClick:t,children:o},o))})]}),r.decisions.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Decisions"}),s.jsx("ul",{className:"drawer-list",children:r.decisions.map((o,u)=>s.jsxs("li",{children:[s.jsx("span",{className:"live-tag","data-kind":"decision",children:"decision"})," ",o]},u))})]}),r.open.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Open questions"}),s.jsx("ul",{className:"drawer-list",children:r.open.map((o,u)=>s.jsxs("li",{children:[s.jsx("span",{className:"live-tag","data-kind":"open",children:"open"})," ",o]},u))})]}),r.summary&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Summary"}),s.jsx("p",{className:"drawer-paragraph",children:r.summary})]}),r.body&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"drawer-section",children:"Transcript excerpt"}),s.jsxs("pre",{className:"drawer-body-text",children:[r.body.slice(0,3e3),r.body.length>3e3?`
68
-
69
- […truncated]`:""]})]})]})]})]})}const er=3e3,Pm=er*3;function Ps(e){const t=y.useRef(null),[n,r]=y.useState(new Set),l=e.join("|");return y.useEffect(()=>{if(e.length===0)return;if(t.current===null){t.current=new Set(e);return}const a=e.filter(o=>!t.current.has(o));for(const o of e)t.current.add(o);if(a.length===0)return;r(o=>new Set([...o,...a]));const i=setTimeout(()=>{r(o=>{const u=new Set(o);for(const d of a)u.delete(d);return u})},1200);return()=>clearTimeout(i)},[l]),n}function Lm(){const e=qn("/api/recall/recent?limit=50",er,{entries:[]}),t=qn("/api/live/recent-writes?limit=50",er,{writes:[]}),n=qn("/api/live/recent-markers?limit=50",er,{markers:[]}),[r,l]=y.useState(null),a=e.data.entries.map(p=>`${p.ts}|${p.source}|${p.query??""}`),i=t.data.writes.map(p=>p.id),o=n.data.markers.map(p=>`${p.sessionId}|${p.kind}|${p.text}`),u=Ps(a),d=Ps(i),m=Ps(o);return s.jsxs("div",{className:"live-page",children:[s.jsx(Tm,{reads:e,writes:t,markers:n}),s.jsxs("div",{className:"live-board",children:[s.jsx(Ls,{title:"Reads",count:e.data.entries.length,loading:e.loading,emptyLabel:"no recent recall",children:e.data.entries.map((p,h)=>{const w=a[h];return s.jsxs("div",{className:`live-row${u.has(w)?" is-new":""}`,children:[s.jsx("span",{className:"live-tag",children:p.source}),s.jsx("span",{className:"label",children:p.query??"(no query)"}),s.jsxs("div",{className:"body",children:[p.mode," · ",p.nResults," hit",p.nResults===1?"":"s"]}),s.jsx("div",{className:"meta",children:al(p.ts)})]},w)})}),s.jsx(Ls,{title:"Writes",count:t.data.writes.length,loading:t.loading,emptyLabel:"no recent writes",children:t.data.writes.map(p=>s.jsxs(Xo,{fresh:d.has(p.id),onOpen:()=>l(p.id),children:[s.jsx("span",{className:"live-tag",children:p.runtime.split("/")[0]}),s.jsx("span",{className:"label",children:p.label}),s.jsx("div",{className:"body",children:p.summary}),s.jsxs("div",{className:"meta",children:[al(p.createdAt)," · ",p.id]})]},p.id))}),s.jsx(Ls,{title:"Markers",count:n.data.markers.length,loading:n.loading,emptyLabel:"no recent markers",children:n.data.markers.map((p,h)=>{const w=o[h];return s.jsxs(Xo,{fresh:m.has(w),onOpen:()=>l(p.sessionId),children:[s.jsx("span",{className:"live-tag","data-kind":p.kind,children:p.kind}),s.jsx("span",{className:"label",children:p.text}),s.jsx("div",{className:"body",children:p.label}),s.jsx("div",{className:"meta",children:al(p.createdAt)})]},w)})})]}),r&&s.jsx(Zl,{sessionId:r,onClose:()=>l(null)})]})}function Tm({reads:e,writes:t,markers:n}){const r=[e,t,n],l=r.every(p=>p.loading),a=r.map(p=>p.lastUpdated).filter(p=>p!==null),i=a.length>0?Math.max(...a):null,o=r.some(p=>p.error!==null),u=i!==null&&Date.now()-i>Pm;let d;l?d="connecting":u||o?d="reconnecting":d="live";const m=d==="connecting"?"Connecting…":d==="reconnecting"?"Reconnecting…":"Live";return s.jsxs("div",{className:"live-status",children:[s.jsx("span",{className:`live-status-dot live-status-${d}`,"aria-hidden":"true"}),s.jsx("span",{className:"live-status-label",children:m}),i!==null&&s.jsxs("span",{className:"muted small",children:["updated ",al(new Date(i).toISOString())]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small mono",children:["polling every ",er/1e3,"s"]})]})}function Ls({title:e,count:t,loading:n,emptyLabel:r,children:l}){const a=t===0;return s.jsxs("section",{className:"live-col",children:[s.jsxs("header",{className:"live-col-head",children:[s.jsx("span",{className:"live-col-title",children:e}),s.jsx("span",{className:"live-col-count",children:t})]}),s.jsx("div",{className:"live-col-body",children:a?s.jsx("div",{className:"live-empty",children:n?"loading…":r}):l})]})}function Xo({fresh:e,onOpen:t,children:n}){return s.jsx("div",{className:`live-row clickable${e?" is-new":""}`,onClick:t,role:"button",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),t())},children:n})}function Rn(e){const[t,n]=y.useState({data:null,loading:!0,error:null}),r=y.useRef(!1),l=y.useCallback(async()=>{try{const a=await fetch("/api/dataset");if(!a.ok)throw new Error(`HTTP ${a.status}`);const i=await a.json();r.current||n({data:i,loading:!1,error:null})}catch(a){if(!r.current){const i=a instanceof Error?a.message:String(a);n(o=>({data:o.data,loading:!1,error:i}))}}},[]);return y.useEffect(()=>(r.current=!1,l(),()=>{r.current=!0}),[e,l]),{...t,refetch:l}}function Xe(e){if(!e)return"—";const t=Date.parse(e);if(!Number.isFinite(t))return"—";const n=Math.floor((Date.now()-t)/864e5);if(n<=0)return"today";if(n===1)return"1d";if(n<30)return`${n}d`;const r=Math.floor(n/30);return r<12?`${r}mo`:`${Math.floor(n/365)}y`}async function vn(e){const t=await fetch("/api/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,runtime:e.runtime??"web-ui"})});if(!t.ok)throw new Error(`POST /api/action → ${t.status}`);return(await t.json()).id}function Cd({openId:e,defaultText:t,onPromoted:n}){const[r,l]=y.useState(!1),[a,i]=y.useState(!1),[o,u]=y.useState(t),d=async()=>{const m=o.trim();if(m){i(!0);try{await vn({kind:"promote_open",subject_type:"open_question",subject_id:e,payload:{resolution:m,original_text:t}}),await n(),l(!1)}catch{i(!1)}}};return r?s.jsxs("div",{className:"promote-editor",onClick:m=>m.stopPropagation(),children:[s.jsx("input",{className:"form-input form-input-inline promote-input",value:o,onChange:m=>u(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),d()),m.key==="Escape"&&(m.preventDefault(),l(!1))},disabled:a,autoFocus:!0}),s.jsx("button",{type:"button",className:"chip",onClick:()=>void d(),disabled:a||!o.trim(),children:"save"}),s.jsx("button",{type:"button",className:"chip",onClick:()=>l(!1),disabled:a,children:"cancel"})]}):s.jsx("button",{type:"button",className:"chip promote-chip",onClick:()=>{u(t),l(!0)},children:"→ decision"})}function Rm(){const{data:e,loading:t,error:n,refetch:r}=Rn(),[l,a]=y.useState("all"),[i,o]=y.useState("oldest"),[u,d]=y.useState(null),[m,p]=y.useState(null),h=y.useMemo(()=>e?[...l==="all"?e.alerts:e.alerts.filter(f=>f.severity===l)].sort((f,g)=>i==="oldest"?g.age_days-f.age_days:f.age_days-g.age_days):[],[e,l,i]),w=async c=>{await vn({kind:"dismiss",subject_type:"alert",subject_id:c}),await r()},v=async(c,f)=>{const g=new Date(Date.now()+f*864e5).toISOString();await vn({kind:"snooze",subject_type:"alert",subject_id:c,payload:{snoozed_until:g}}),await r()},j=y.useMemo(()=>e?[...e.sessions].sort((c,f)=>(f.started_at??"").localeCompare(c.started_at??"")).slice(0,20):[],[e]);if(t&&!e)return s.jsx(km,{});if(n&&!e)return s.jsx("div",{className:"page-pad",children:s.jsx("div",{className:"muted error",children:n})});if(!e)return null;const N=u?e.alerts.find(c=>c.id===u)??null:null;return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"kpi-row",children:[s.jsx(Kr,{label:"This week",value:e.metrics.this_week,hint:`${e.metrics.last_week} last week`}),s.jsx(Kr,{label:"Sessions",value:e.meta.sessions_total,hint:"total"}),s.jsx(Kr,{label:"Entities",value:e.meta.entities_total,hint:"catalogued"}),s.jsx(Kr,{label:"Decisions",value:e.metrics.closed_decisions,hint:"non-superseded"}),s.jsx(zm,{values:e.metrics.sparkline})]}),s.jsxs("div",{className:"pulse-grid",children:[s.jsxs("section",{className:"card pulse-area-coherence",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:"Coherence"})}),s.jsx(Im,{metrics:e.metrics})]}),s.jsxs("section",{className:"card pulse-area-runtimes",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:"Runtimes"})}),s.jsx(Dm,{runtimes:e.runtimes})]}),s.jsxs("section",{className:"card pulse-scroll-card pulse-area-recent",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:"Recent sessions"})}),s.jsx("div",{className:"pulse-scroll-body",children:s.jsx("ul",{className:"session-list",children:j.map(c=>s.jsxs("li",{className:"session-row clickable",onClick:()=>p(c.id),role:"button",tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),p(c.id))},children:[s.jsx("span",{className:`chip-inline status-${c.status}`,children:c.status}),s.jsx("span",{className:"session-label",children:c.label}),s.jsxs("span",{className:"session-meta",children:[Xe(c.started_at)," · ",c.entities.slice(0,3).join(", "),c.entities.length>3?` +${c.entities.length-3}`:""]})]},c.id))})})]}),s.jsxs("section",{className:"card pulse-scroll-card pulse-area-stale",children:[s.jsxs("header",{className:"card-head card-head-stack",children:[s.jsxs("div",{className:"card-head-row",children:[s.jsx("h3",{children:"Stale alerts"}),s.jsxs("span",{className:"muted small",children:[h.length,h.length!==e.alerts.length?` / ${e.alerts.length}`:""]})]}),s.jsxs("div",{className:"card-filters",children:[s.jsx("div",{className:"filter-group",role:"group","aria-label":"Severity",children:["all","high","medium"].map(c=>s.jsx("button",{type:"button",className:`chip${l===c?" active":""}`,"data-severity":c==="all"?void 0:c,onClick:()=>a(c),children:c},c))}),s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Sort",children:[s.jsx("button",{type:"button",className:`chip${i==="oldest"?" active":""}`,onClick:()=>o("oldest"),children:"oldest"}),s.jsx("button",{type:"button",className:`chip${i==="recent"?" active":""}`,onClick:()=>o("recent"),children:"recent"})]})]})]}),s.jsx("div",{className:"pulse-scroll-body",children:s.jsxs("ul",{className:"alert-list",children:[h.map(c=>s.jsxs("li",{className:"alert-row clickable",onClick:()=>d(c.id),role:"button",tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),d(c.id))},children:[s.jsx("span",{className:`chip-inline severity-${c.severity}`,children:c.severity}),s.jsx("span",{className:"alert-entity",children:c.entity}),s.jsx("span",{className:"alert-summary",children:c.summary}),s.jsxs("div",{className:"alert-actions",onClick:f=>f.stopPropagation(),children:[s.jsx("button",{type:"button",className:"chip",onClick:()=>void v(c.id,7),children:"snooze 7d"}),s.jsx("button",{type:"button",className:"chip",onClick:()=>void w(c.id),children:"dismiss"})]})]},c.id)),h.length===0&&s.jsx("li",{className:"muted alert-row-empty",children:e.alerts.length===0?"No stale alerts.":"No alerts match the current filters."})]})})]})]}),N&&s.jsx(Om,{alert:N,entity:e.entities.find(c=>c.canonical===N.entity)??null,entityColor:e.entity_colors[N.entity]??"#666",sessions:e.sessions,onClose:()=>d(null),onDismiss:async()=>{await w(N.id),d(null)},onSnooze:async c=>{await v(N.id,c),d(null)},onPromoted:r}),m&&s.jsx(Zl,{sessionId:m,onClose:()=>p(null),entityColor:(()=>{const c=e.sessions.find(g=>g.id===m),f=c==null?void 0:c.entities[0];return f?e.entity_colors[f]:void 0})()})]})}const Mm=[10,25,50];function Om({alert:e,entity:t,entityColor:n,sessions:r,onClose:l,onDismiss:a,onSnooze:i,onPromoted:o}){const u=Er(),[d,m]=y.useState(10),[p,h]=y.useState(0),w=y.useMemo(()=>r.filter(x=>x.entities.includes(e.entity)).sort((x,k)=>(k.started_at??"").localeCompare(x.started_at??"")),[r,e.entity]);y.useEffect(()=>{h(0)},[e.id,d]);const v=Math.max(1,Math.ceil(w.length/d)),j=Math.min(p,v-1),N=j*d,c=w.slice(N,N+d),f=y.useMemo(()=>w.flatMap(x=>x.open_questions.map(k=>({id:k.id,text:k.text,sid:x.id,when:x.started_at}))),[w]),g=y.useMemo(()=>w.flatMap(x=>x.decisions.map(k=>({text:k,sid:x.id,when:x.started_at}))),[w]);return y.useEffect(()=>{const x=k=>{k.key==="Escape"&&l()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[l]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"drawer-backdrop",onClick:l}),s.jsxs("aside",{className:"session-drawer",role:"dialog","aria-modal":"true","aria-label":`Alert detail: ${e.entity}`,children:[s.jsxs("header",{className:"drawer-head",children:[s.jsx("span",{className:"dot lg",style:{background:n}}),s.jsx("h3",{className:"drawer-title",children:e.entity}),s.jsx("span",{className:`chip-inline severity-${e.severity}`,children:e.severity}),s.jsx("button",{type:"button",className:"drawer-close",onClick:l,"aria-label":"Close",children:"×"})]}),s.jsxs("div",{className:"drawer-body",children:[s.jsx("p",{className:"drawer-paragraph",children:e.summary}),s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Last touch"}),s.jsxs("dd",{className:"kv-value",children:[e.age_days," day",e.age_days===1?"":"s"," ago"]}),s.jsx("dt",{className:"kv-label",children:"Last session"}),s.jsx("dd",{className:"kv-value mono small",children:e.last_touch_at??"—"}),t&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{className:"kv-label",children:"Entity type"}),s.jsx("dd",{className:"kv-value",children:t.type}),s.jsx("dt",{className:"kv-label",children:"Total sessions"}),s.jsx("dd",{className:"kv-value mono",children:t.session_count})]})]}),s.jsxs("div",{className:"drawer-actions",children:[s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>u(`/thread?entity=${encodeURIComponent(e.entity)}`),children:"Open thread"}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void i(7),children:"Snooze 7d"}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void i(30),children:"Snooze 30d"}),s.jsx("button",{type:"button",className:"btn btn-danger",onClick:()=>void a(),children:"Dismiss"})]}),f.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"drawer-section",children:["Open questions (",f.length,")"]}),s.jsx("ul",{className:"drawer-list",children:f.slice(0,12).map((x,k)=>s.jsxs("li",{className:"marker-row-promotable",children:[s.jsx("span",{className:"live-tag","data-kind":"open",children:"open"}),s.jsx("span",{className:"marker-text",children:x.text}),s.jsx(Cd,{openId:x.id,defaultText:x.text,onPromoted:o}),s.jsx("span",{className:"muted small",children:Xe(x.when)})]},`${x.id}-${k}`))}),f.length>12&&s.jsxs("p",{className:"muted small",children:["Showing first 12 of ",f.length,"."]})]}),g.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"drawer-section",children:["Decisions (",g.length,")"]}),s.jsx("ul",{className:"drawer-list",children:g.slice(0,8).map((x,k)=>s.jsxs("li",{children:[s.jsx("span",{className:"live-tag","data-kind":"decision",children:"decision"}),s.jsx("span",{className:"marker-text",children:x.text}),s.jsx("span",{className:"muted small",children:Xe(x.when)})]},`${x.sid}-${k}`))}),g.length>8&&s.jsxs("p",{className:"muted small",children:["Showing first 8 of ",g.length,"."]})]}),s.jsxs("h4",{className:"drawer-section",children:["Recent sessions (",w.length,")"]}),s.jsx("ul",{className:"session-list",children:c.map(x=>s.jsxs("li",{className:"session-row",children:[s.jsx("span",{className:`chip-inline status-${x.status}`,children:x.status}),s.jsxs("div",{className:"session-row-main",children:[s.jsx(Tn,{to:`/thread?entity=${encodeURIComponent(e.entity)}&session=${encodeURIComponent(x.id)}`,className:"session-label",children:x.label}),s.jsx("span",{className:"session-meta",children:x.summary})]}),s.jsx("span",{className:"muted small mono",children:Xe(x.started_at)})]},x.id))}),w.length>0&&s.jsxs("div",{className:"pagination pagination-compact",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:d,onChange:x=>m(Number.parseInt(x.target.value,10)),children:Mm.map(x=>s.jsx("option",{value:x,children:x},x))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[N+1,"–",Math.min(N+d,w.length)," of ",w.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:j===0,onClick:()=>h(0),children:"«"}),s.jsx("button",{type:"button",className:"chip",disabled:j===0,onClick:()=>h(x=>Math.max(0,x-1)),children:"‹"}),s.jsxs("span",{className:"page-indicator mono",children:[j+1," / ",v]}),s.jsx("button",{type:"button",className:"chip",disabled:j>=v-1,onClick:()=>h(x=>Math.min(v-1,x+1)),children:"›"}),s.jsx("button",{type:"button",className:"chip",disabled:j>=v-1,onClick:()=>h(v-1),children:"»"})]})]})]})]})]})}function Kr({label:e,value:t,hint:n}){return s.jsxs("div",{className:"kpi",children:[s.jsx("span",{className:"kpi-label",children:e}),s.jsx("span",{className:"kpi-value",children:t.toLocaleString()}),n&&s.jsx("span",{className:"kpi-hint",children:n})]})}function zm({values:e}){const t=Math.max(1,...e);return s.jsxs("div",{className:"kpi kpi-sparkline",children:[s.jsx("span",{className:"kpi-label",children:"Last 7 days"}),s.jsx("div",{className:"sparkline",children:e.map((n,r)=>s.jsx("span",{className:"spark-bar",style:{height:`${n/t*100}%`},title:`${n} sessions`},r))})]})}function Im({metrics:e}){const t=e.healthy+e.sparse+e.stale,n=r=>t>0?r/t*100:0;return s.jsxs("div",{className:"bar-stack",children:[s.jsx(Ts,{tone:"active",label:"Healthy",value:e.healthy,pct:n(e.healthy)}),s.jsx(Ts,{tone:"warn",label:"Sparse",value:e.sparse,pct:n(e.sparse)}),s.jsx(Ts,{tone:"danger",label:"Stale",value:e.stale,pct:n(e.stale)})]})}function Dm({runtimes:e}){return e.length===0?s.jsx("div",{className:"muted small",style:{padding:"8px 12px"},children:"No runtime activity yet."}):s.jsx("ul",{className:"runtime-list",children:e.map(t=>s.jsxs("li",{className:"runtime-row",children:[s.jsx("span",{className:`runtime-dot runtime-${t.status}`,title:t.status}),s.jsx("span",{className:"runtime-name mono",children:t.name}),s.jsxs("span",{className:"runtime-counts muted small",children:[t.this_week,s.jsx("span",{className:"runtime-counts-sep",children:"·"}),s.jsxs("span",{className:"runtime-counts-prev",children:[t.last_week," prev"]})]}),s.jsx("span",{className:"muted small mono runtime-age",children:Xe(t.last_session_at)})]},t.name))})}function Ts({tone:e,label:t,value:n,pct:r}){const l=Math.round(r);return s.jsxs("div",{className:"bar-item",children:[s.jsx("span",{className:"bar-label",children:t}),s.jsx("div",{className:"bar-track",title:`${n.toLocaleString()} entit${n===1?"y":"ies"} · ${l}% of total`,children:s.jsx("div",{className:`bar-fill tone-${e}`,style:{width:`${r}%`}})}),s.jsxs("span",{className:"bar-value mono",children:[n.toLocaleString(),s.jsxs("span",{className:"bar-pct muted small",children:[" · ",l,"%"]})]})]})}const Ed="nlm.settings.views",mt={landing:"live",riverDensity:"comfortable",threadSort:"recent"};function ql(){if(typeof window>"u")return mt;try{const e=window.localStorage.getItem(Ed);return e?{...mt,...JSON.parse(e)}:mt}catch{return mt}}function $m(e){typeof window>"u"||window.localStorage.setItem(Ed,JSON.stringify(e))}const Go={"7d":7,"30d":30,"90d":90,all:null};function Fm(){const{data:e,loading:t,error:n}=Rn(),[r,l]=y.useState("30d"),[a,i]=y.useState(null),[o,u]=y.useState(null),[d,m]=y.useState(null),p=Er(),[h]=y.useState(()=>ql().riverDensity),w=y.useRef(null),v=y.useRef(null),[j,N]=y.useState(null),c=y.useMemo(()=>{if(!e)return null;const S=Go[r],C=e.sessions.filter(P=>P.started_at!==null),_=Date.now(),O=S?C.filter(P=>(_-Date.parse(P.started_at))/864e5<=S):C,M=new Map,U=new Set;for(const P of O){const I=(P.started_at??"").slice(0,10);if(I){U.add(I);for(const B of P.entities){const G=M.get(B)??new Map;G.set(I,(G.get(I)??0)+1),M.set(B,G)}}}const xe=[...U].sort(),L=[...M.entries()].map(([P,I])=>({entity:P,total:[...I.values()].reduce((B,G)=>B+G,0),perDate:I})).sort((P,I)=>I.total-P.total).slice(0,24);return{dates:xe,laneRows:L,total:O.length}},[e,r]),f=(S,C)=>{if(!e)return;const _=e.sessions.filter(O=>(O.started_at??"").slice(0,10)===C&&O.entities.includes(S)).sort((O,M)=>(M.started_at??"").localeCompare(O.started_at??""));if(_.length!==0){if(_.length===1){m(_[0].id);return}u({entity:S,date:C,sessions:_})}},g=S=>{if(!w.current)return;const C=w.current.getBoundingClientRect();v.current={startX:S.clientX,rect:C}},x=S=>{if(!v.current)return;const{startX:C,rect:_}=v.current,O=Math.min(C,S.clientX)-_.left,M=Math.max(C,S.clientX)-_.left;if(M-O<6){N(null);return}N({from:O,to:M})},k=()=>{if(!v.current||!j||!c){v.current=null,N(null);return}const S=w.current,C=S==null?void 0:S.querySelector(".river-lane-label"),_=(C==null?void 0:C.offsetWidth)??0,O=(S==null?void 0:S.offsetWidth)??0,U=Math.max(1,O-_)/c.dates.length,xe=_+12,L=Math.max(0,Math.floor((j.from-xe)/U)),P=Math.min(c.dates.length-1,Math.floor((j.to-xe)/U));if(P<=L){v.current=null,N(null);return}const I=c.dates[L],B=c.dates[P];if(I&&B){const G=Math.max(1,Math.ceil((Date.parse(B)-Date.parse(I))/864e5));l(G<=7?"7d":G<=30?"30d":G<=90?"90d":"all")}v.current=null,N(null)};return t&&!e?s.jsx("div",{className:"page-pad",children:s.jsx("div",{className:"muted",children:"Loading dataset…"})}):n&&!e?s.jsx("div",{className:"page-pad",children:s.jsx("div",{className:"muted error",children:n})}):!e||!c?null:s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"river-toolbar",children:[s.jsx("span",{className:"page-title",children:"River"}),s.jsxs("span",{className:"muted small",children:[c.total," sessions · ",c.laneRows.length," lanes · ",c.dates.length," days"]}),s.jsx("span",{className:"header-spacer"}),Object.keys(Go).map(S=>s.jsx("button",{type:"button",className:`ctrl-btn${S===r?" active":""}`,onClick:()=>l(S),children:S},S))]}),s.jsxs("div",{className:`river-grid card river-density-${h}`,ref:w,onMouseDown:g,onMouseMove:x,onMouseUp:k,onMouseLeave:()=>{v.current=null,N(null),i(null)},style:{"--cells":c.dates.length},children:[j&&s.jsx("div",{className:"river-drag-rect",style:{left:`${j.from}px`,width:`${j.to-j.from}px`}}),s.jsxs("div",{className:"river-row river-row-dates",children:[s.jsx("div",{className:"river-lane-label river-lane-label--header","aria-hidden":"true"}),s.jsx("div",{className:"river-cells",children:c.dates.map(S=>s.jsx("div",{className:"river-date-cell",title:S,children:S.slice(5)},S))})]}),c.laneRows.map(({entity:S,perDate:C,total:_})=>s.jsxs("div",{className:"river-row",children:[s.jsxs("button",{type:"button",className:"river-lane-label",onClick:()=>p(`/thread?entity=${encodeURIComponent(S)}`),children:[s.jsx("span",{className:"dot",style:{background:e.entity_colors[S]??"#666"}}),s.jsx("span",{className:"river-lane-name",children:S}),s.jsx("span",{className:"muted small",children:_})]}),s.jsx("div",{className:"river-cells",children:c.dates.map(O=>{const M=C.get(O)??0;return s.jsx("div",{className:`river-cell tier-${Am(M)}`,onMouseEnter:U=>i({entity:S,date:O,count:M,x:U.clientX,y:U.clientY}),onMouseMove:U=>i({entity:S,date:O,count:M,x:U.clientX,y:U.clientY}),onMouseLeave:()=>i(null),onClick:()=>M>0&&f(S,O),style:M>0?{cursor:"pointer"}:{}},O)})})]},S))]}),c.laneRows.length===0&&s.jsx("div",{className:"muted",children:"No entities in this window."}),a&&a.count>0&&s.jsxs("div",{className:"river-hover",style:{left:a.x+12,top:a.y+12},children:[s.jsx("span",{className:"dot",style:{background:e.entity_colors[a.entity]??"#666"}}),s.jsx("span",{className:"river-hover-name",children:a.entity}),s.jsxs("span",{className:"muted small",children:[a.date," · ",a.count," session",a.count===1?"":"s"]})]}),o&&s.jsx(Um,{state:o,entityColor:e.entity_colors[o.entity]??"#666",onClose:()=>u(null),onPick:S=>{u(null),m(S)},onOpenThread:()=>p(`/thread?entity=${encodeURIComponent(o.entity)}`)}),d&&s.jsx(Zl,{sessionId:d,onClose:()=>m(null),entityColor:(()=>{const S=e.sessions.find(_=>_.id===d),C=S==null?void 0:S.entities[0];return C?e.entity_colors[C]:void 0})()})]})}function Um({state:e,entityColor:t,onClose:n,onPick:r,onOpenThread:l}){return y.useEffect(()=>{const a=i=>{i.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"drawer-backdrop",onClick:n}),s.jsxs("aside",{className:"session-drawer",role:"dialog","aria-modal":"true","aria-label":`Sessions on ${e.date}`,children:[s.jsxs("header",{className:"drawer-head",children:[s.jsx("span",{className:"dot lg",style:{background:t}}),s.jsx("h3",{className:"drawer-title",children:e.entity}),s.jsx("span",{className:"muted small",children:e.date}),s.jsx("button",{type:"button",className:"drawer-close",onClick:n,"aria-label":"Close",children:"×"})]}),s.jsxs("div",{className:"drawer-body",children:[s.jsxs("p",{className:"muted small",children:[e.sessions.length," sessions on this day. Pick one to inspect."]}),s.jsx("div",{className:"drawer-actions",children:s.jsx("button",{type:"button",className:"btn btn-accent",onClick:l,children:"Open thread"})}),s.jsx("ul",{className:"session-list",children:e.sessions.map(a=>s.jsxs("li",{className:"session-row session-row-detail clickable",onClick:()=>r(a.id),role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),r(a.id))},children:[s.jsx("span",{className:`chip-inline status-${a.status}`,children:a.status}),s.jsxs("div",{className:"session-row-main",children:[s.jsx("span",{className:"session-label",children:a.label}),s.jsx("span",{className:"session-meta",children:a.summary})]}),s.jsx("span",{className:"muted small mono",children:Xe(a.started_at)})]},a.id))})]})]})]})}function Am(e){return e===0?0:e===1?1:e<=3?2:e<=6?3:4}function bm(){const{data:e,loading:t,error:n}=Rn(),[r,l]=kd(),a=r.get("q")??"",i=r.get("entity")??"",[o,u]=y.useState(a),d=y.useMemo(()=>a.toLowerCase().split(/\s+/).filter(Boolean),[a]),m=y.useMemo(()=>{if(!e)return[];const h=i?e.sessions.filter(v=>v.entities.includes(i)):e.sessions;return d.length===0?h.slice(-50).reverse():h.map(v=>({session:v,score:Bm(v,d)})).filter(v=>v.score>0).sort((v,j)=>j.score-v.score).slice(0,100).map(v=>v.session)},[e,d,i]),p=h=>{h.preventDefault();const w=new URLSearchParams(r);o?w.set("q",o):w.delete("q"),l(w)};return s.jsxs("div",{className:"page-pad",children:[s.jsxs("form",{onSubmit:p,className:"search-bar",children:[s.jsx("input",{className:"search-input search-big",placeholder:"search sessions, decisions, open questions…",value:o,onChange:h=>u(h.target.value),autoFocus:!0}),i&&s.jsxs("span",{className:"chip-inline",children:["entity: ",i,s.jsx("button",{type:"button",className:"chip-x",onClick:()=>{const h=new URLSearchParams(r);h.delete("entity"),l(h)},children:"×"})]})]}),t&&!e&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),s.jsxs("div",{className:"muted small search-meta",children:[m.length," result",m.length===1?"":"s"]}),s.jsx("ul",{className:"session-list compact",children:m.map(h=>s.jsxs("li",{className:"session-row",children:[s.jsx("span",{className:`chip-inline status-${h.status}`,children:h.status}),s.jsx(Tn,{to:`/thread?entity=${encodeURIComponent(h.entities[0]??"")}`,className:"session-label",children:h.label}),s.jsxs("span",{className:"session-meta",children:[Xe(h.started_at)," · ",h.entities.slice(0,4).join(", ")]})]},h.id))})]})}function Bm(e,t){let n=0;const r=e.label.toLowerCase(),l=e.summary.toLowerCase(),a=e.decisions.join(" ").toLowerCase(),i=e.open.join(" ").toLowerCase();for(const o of t)r.includes(o)&&(n+=3),a.includes(o)&&(n+=2),i.includes(o)&&(n+=2),l.includes(o)&&(n+=1);return n}function Wm(){const{data:e,loading:t,error:n,refetch:r}=Rn(),[l,a]=kd(),i=l.get("entity")??"",o=l.get("session"),[u,d]=y.useState(()=>ql().threadSort),m=y.useMemo(()=>{if(!e||!i)return[];const N=e.sessions.filter(c=>c.entities.includes(i));return N.sort((c,f)=>{const g=c.started_at??"",x=f.started_at??"";return u==="recent"?x.localeCompare(g):g.localeCompare(x)}),N},[e,i,u]),p=i&&e?e.entity_colors[i]??"#666":"#666";y.useEffect(()=>{i&&e&&(document.title=`${i} — Thread`)},[i,e]);const h=N=>{const c=new URLSearchParams(l);c.set("session",N),a(c)},w=()=>{const N=new URLSearchParams(l);N.delete("session"),a(N)};if(t&&!e)return s.jsxs("div",{className:"page-pad",children:[s.jsx(pe,{h:22,w:220}),s.jsx("div",{style:{marginTop:16},children:s.jsx(Cm,{rows:8})})]});if(n&&!e)return s.jsx("div",{className:"page-pad",children:s.jsx("div",{className:"muted error",children:n})});if(!e)return null;if(!i)return s.jsxs("div",{className:"page-pad",children:[s.jsx("h2",{className:"page-title",children:"Thread"}),s.jsx("p",{className:"muted",children:"Pick an entity to view its reasoning history."}),s.jsx("ul",{className:"entity-grid",children:e.entities.slice(0,48).map(N=>s.jsx("li",{children:s.jsxs(Tn,{to:`/thread?entity=${encodeURIComponent(N.canonical)}`,className:"card card-lift entity-card",children:[s.jsx("span",{className:"dot",style:{background:e.entity_colors[N.canonical]??"#666"}}),s.jsx("span",{className:"entity-name",children:N.canonical}),s.jsx("span",{className:"muted small",children:N.session_count})]})},N.canonical))})]});const v=m.flatMap(N=>N.decisions.map(c=>({d:c,sid:N.id,when:N.started_at}))),j=m.flatMap(N=>N.open_questions.map(c=>({id:c.id,q:c.text,sid:N.id,when:N.started_at})));return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"thread-header",children:[s.jsx("span",{className:"dot lg",style:{background:p}}),s.jsx("h2",{className:"page-title",children:i}),s.jsxs("span",{className:"muted",children:[m.length," session",m.length===1?"":"s"]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("select",{className:"form-input",value:u,onChange:N=>d(N.target.value),children:[s.jsx("option",{value:"recent",children:"Most recent first"}),s.jsx("option",{value:"oldest",children:"Oldest first"})]})]}),s.jsxs("div",{className:"thread-grid",children:[s.jsxs("section",{className:"card",children:[s.jsxs("header",{className:"card-head",children:[s.jsx("h3",{children:"Decisions"}),s.jsx("span",{className:"muted small",children:v.length})]}),s.jsxs("ul",{className:"marker-list",children:[v.slice(0,30).map((N,c)=>s.jsxs("li",{className:"marker-row",children:[s.jsx("span",{className:"live-tag","data-kind":"decision",children:"decision"}),s.jsx("span",{className:"marker-text",children:N.d}),s.jsx("button",{type:"button",className:"link-button",onClick:()=>h(N.sid),children:Xe(N.when)})]},c)),v.length===0&&s.jsx("li",{className:"muted small",children:"No decisions captured."})]})]}),s.jsxs("section",{className:"card",children:[s.jsxs("header",{className:"card-head",children:[s.jsx("h3",{children:"Open questions"}),s.jsx("span",{className:"muted small",children:j.length})]}),s.jsxs("ul",{className:"marker-list",children:[j.slice(0,30).map((N,c)=>s.jsxs("li",{className:"marker-row marker-row-promotable",children:[s.jsx("span",{className:"live-tag","data-kind":"open",children:"open"}),s.jsx("span",{className:"marker-text",children:N.q}),s.jsxs("div",{className:"marker-actions",children:[s.jsx(Cd,{openId:N.id,defaultText:N.q,onPromoted:r}),s.jsx("button",{type:"button",className:"link-button",onClick:()=>h(N.sid),children:Xe(N.when)})]})]},`${N.id}-${c}`)),j.length===0&&s.jsx("li",{className:"muted small",children:"No open questions."})]})]})]}),s.jsx(Hm,{thread:m,onOpenSession:h}),o&&s.jsx(Zl,{sessionId:o,onClose:w,entityColor:p})]})}const Vm=[10,25,50,100];function Hm({thread:e,onOpenSession:t}){const[n,r]=y.useState(""),[l,a]=y.useState("all"),[i,o]=y.useState("all"),[u,d]=y.useState(25),[m,p]=y.useState(0),h=y.useMemo(()=>{const c=n.toLowerCase().trim();return e.filter(f=>l!=="all"&&f.status!==l||i==="decisions"&&f.decisions.length===0||i==="open"&&f.open_questions.length===0?!1:c?f.label.toLowerCase().includes(c)||f.summary.toLowerCase().includes(c)||f.decisions.some(g=>g.toLowerCase().includes(c))||f.open.some(g=>g.toLowerCase().includes(c)):!0)},[e,n,l,i]);y.useEffect(()=>{p(0)},[n,l,i,u]);const w=Math.max(1,Math.ceil(h.length/u)),v=Math.min(m,w-1),j=v*u,N=h.slice(j,j+u);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"thread-sessions-head",children:[s.jsx("h3",{className:"section-title thread-sessions-title",children:"Sessions"}),s.jsx("input",{className:"search-input",placeholder:"search label, summary, decisions, open…",value:n,onChange:c=>r(c.target.value)})]}),s.jsxs("div",{className:"thread-filters",children:[s.jsx("div",{className:"filter-group",role:"group","aria-label":"Status filter",children:["all","active","idle","closed","superseded"].map(c=>s.jsx("button",{type:"button",className:`chip${l===c?" active":""}`,"data-status":c==="all"?void 0:c,onClick:()=>a(c),children:c},c))}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Marker filter",children:["all","decisions","open"].map(c=>s.jsx("button",{type:"button",className:`chip${i===c?" active":""}`,"data-marker":c==="all"?void 0:c,onClick:()=>o(c),children:c==="all"?"all markers":c},c))}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[h.length," match",h.length===1?"":"es"]})]}),s.jsxs("ul",{className:"session-list",children:[N.map(c=>s.jsxs("li",{className:"session-row session-row-detail clickable",onClick:()=>t(c.id),children:[s.jsx("span",{className:`chip-inline status-${c.status}`,children:c.status}),s.jsxs("div",{className:"session-row-main",children:[s.jsx("span",{className:"session-label",children:c.label}),s.jsx("span",{className:"session-meta",children:c.summary})]}),s.jsx("span",{className:"muted small mono",children:Xe(c.started_at)})]},c.id)),N.length===0&&s.jsx("li",{className:"muted small empty-row",children:e.length===0?"No sessions yet.":"No sessions match the current filters."})]}),h.length>0&&s.jsxs("div",{className:"pagination",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:u,onChange:c=>d(Number.parseInt(c.target.value,10)),children:Vm.map(c=>s.jsx("option",{value:c,children:c},c))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[j+1,"–",Math.min(j+u,h.length)," of ",h.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:v===0,onClick:()=>p(0),children:"« first"}),s.jsx("button",{type:"button",className:"chip",disabled:v===0,onClick:()=>p(c=>Math.max(0,c-1)),children:"‹ prev"}),s.jsxs("span",{className:"page-indicator mono",children:[v+1," / ",w]}),s.jsx("button",{type:"button",className:"chip",disabled:v>=w-1,onClick:()=>p(c=>Math.min(w-1,c+1)),children:"next ›"}),s.jsx("button",{type:"button",className:"chip",disabled:v>=w-1,onClick:()=>p(w-1),children:"last »"})]})]})]})}const Km={days:7,total:0,with_results:0,hit_rate:0,by_source:{},top_queries:[],log_present:!1},Qm={days:7,total:0,with_results:0,hit_rate:0,by_source:{},top_subjects:[],top_predicates:[],log_present:!1},Ym=[7,30,90];function Xm(){const[e,t]=y.useState(7),n=qn(`/api/recall/stats?days=${e}`,3e4,Km),r=qn(`/api/recall/facts/stats?days=${e}`,3e4,Qm);return s.jsxs("div",{className:"page-pad",children:[s.jsxs("div",{className:"recall-head",children:[s.jsxs("p",{className:"muted small recall-note",children:["Hit rate measures whether recall returned something — not whether the agent used it. Watch ",s.jsx("strong",{children:"by source"})," for adoption and ",s.jsx("strong",{children:"hit rate"})," for whether the corpus covers what's being asked."]}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Time window",children:Ym.map(l=>s.jsxs("button",{type:"button",className:`chip${e===l?" active":""}`,onClick:()=>t(l),children:[l,"d"]},l))})]}),s.jsx(Jo,{title:"Session recall",subtitle:"What the orchestrator pulls when answering questions about past work — the human-operator surface.",stats:n.data,error:n.error,topLabel:"Top queries",topRows:n.data.top_queries.map(l=>({label:l.query,count:l.count}))}),s.jsx(Jo,{title:"Fact recall",subtitle:"Structured facts agents pull mid-task — the orchestrator surface.",stats:r.data,error:r.error,topLabel:"Top subjects",topRows:r.data.top_subjects.map(l=>({label:l.subject,count:l.count})),extraLabel:"Top predicates",extraRows:r.data.top_predicates.map(l=>({label:l.predicate,count:l.count}))})]})}function Jo({title:e,subtitle:t,stats:n,error:r,topLabel:l,topRows:a,extraLabel:i,extraRows:o}){const u=n.total-n.with_results,d=Object.entries(n.by_source).map(([m,p])=>({label:m,count:p})).sort((m,p)=>p.count-m.count);return s.jsxs("section",{className:"recall-block",children:[s.jsxs("header",{className:"recall-block-head",children:[s.jsx("h2",{className:"page-title",children:e}),s.jsx("p",{className:"muted small",children:t})]}),r&&s.jsx("div",{className:"muted error small",children:r}),n.log_present?n.total===0?s.jsxs("div",{className:"card recall-empty muted",children:["No queries in the last ",n.days," days. The log exists but this window is empty."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"kpi-row",children:[s.jsx(Qr,{label:"Queries",value:n.total,hint:`last ${n.days}d`}),s.jsx(Qr,{label:"Hit rate",value:`${Math.round(n.hit_rate*100)}%`,hint:`${n.with_results.toLocaleString()} returned ≥1`}),s.jsx(Qr,{label:"Zero-result",value:u,hint:u>0?"corpus gaps":"full coverage"}),s.jsx(Qr,{label:"Sources",value:d.length,hint:"distinct callers"})]}),s.jsxs("div",{className:"recall-cards",children:[s.jsx(Rs,{title:"By source",rows:d,emptyText:"No sources recorded."}),s.jsx(Rs,{title:l,rows:a,emptyText:"None recorded."}),i&&o&&s.jsx(Rs,{title:i,rows:o,emptyText:"None recorded."})]})]}):s.jsx("div",{className:"card recall-empty muted",children:"No query log on disk yet — nothing has called this recall surface."})]})}function Qr({label:e,value:t,hint:n}){return s.jsxs("div",{className:"kpi",children:[s.jsx("span",{className:"kpi-label",children:e}),s.jsx("span",{className:"kpi-value",children:typeof t=="number"?t.toLocaleString():t}),n&&s.jsx("span",{className:"kpi-hint",children:n})]})}function Rs({title:e,rows:t,emptyText:n}){const r=Math.max(1,...t.map(l=>l.count));return s.jsxs("section",{className:"card",children:[s.jsx("header",{className:"card-head",children:s.jsx("h3",{children:e})}),s.jsxs("div",{className:"bar-stack recall-bars",children:[t.length===0&&s.jsx("div",{className:"muted small recall-bars-empty",children:n}),t.map(l=>s.jsxs("div",{className:"bar-item",children:[s.jsx("span",{className:"bar-label recall-bar-label",title:l.label,children:l.label}),s.jsx("div",{className:"bar-track",children:s.jsx("div",{className:"bar-fill tone-active",style:{width:`${l.count/r*100}%`}})}),s.jsx("span",{className:"bar-value mono",children:l.count.toLocaleString()})]},l.label))]})]})}const Gm=[{to:"/settings",label:"Overview"},{to:"/settings/sources",label:"Sources"},{to:"/settings/providers",label:"Providers"},{to:"/settings/classifier",label:"Classifier"},{to:"/settings/labels",label:"Labels"},{to:"/settings/data",label:"Data"},{to:"/settings/views",label:"Views"}];function Xt(){return s.jsx("div",{className:"subnav",children:Gm.map(e=>s.jsx(Ta,{to:e.to,end:e.to==="/settings",className:({isActive:t})=>`subnav-link${t?" active":""}`,children:e.label},e.to))})}const Jm=[{to:"/settings/sources",title:"Sources",body:()=>"Transcript origins the daemon scans. Add Claude Code, Hermes, pi.dev, custom JSONL directories, or webhook ingest."},{to:"/settings/providers",title:"Providers",body:()=>"LLM endpoints (DeepSeek, Ollama, OpenAI, Anthropic, OpenRouter, custom). Manage keys and test connections."},{to:"/settings/labels",title:"Labels",body:({entities:e})=>`${e} entities catalogued. Promote candidates and edit types.`},{to:"/settings/classifier",title:"Classifier",body:({classifierProvider:e})=>e?`Active provider: ${e}.`:"Classifier provider unknown."},{to:"/settings/data",title:"Data",body:({sessions:e})=>`${e} sessions in the canonical store. Inspect path and backup posture.`},{to:"/settings/views",title:"Views",body:()=>"Default landing page, density, sort, density tier."}];function Zm(){const{data:e}=Rn(),t={sessions:(e==null?void 0:e.meta.sessions_total)??0,entities:(e==null?void 0:e.meta.entities_total)??0,classifierProvider:null};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Xt,{}),s.jsx("div",{className:"settings-grid",children:Jm.map(n=>s.jsxs(Tn,{to:n.to,className:"card card-lift settings-card",children:[s.jsx("h3",{className:"settings-card-title",children:n.title}),s.jsx("p",{className:"settings-card-body",children:n.body(t)})]},n.to))})]})}function qm(e){if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=100?0:1)} ${t[r]}`}function ev(){var p;const[e,t]=y.useState(null),[n,r]=y.useState(null),[l,a]=y.useState(null),[i,o]=y.useState(!1),u=y.useRef(null),d=y.useCallback(async()=>{try{const h=await fetch("/api/data/stats");if(!h.ok)throw new Error(`HTTP ${h.status}`);t(await h.json()),r(null)}catch(h){r(h instanceof Error?h.message:String(h))}},[]);y.useEffect(()=>{d()},[d]);const m=async()=>{var w,v;const h=(v=(w=u.current)==null?void 0:w.files)==null?void 0:v[0];if(h&&confirm(`Restore from "${h.name}"? Your current database is archived (not deleted), and the new one takes effect after the daemon restarts.`)){o(!0),a(null);try{const j=new FormData;j.append("file",h);const c=await(await fetch("/api/data/restore",{method:"POST",body:j})).json();a(c),c.staged&&u.current&&(u.current.value="")}catch(j){a({error:j instanceof Error?j.message:String(j)})}finally{o(!1)}}};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Xt,{}),s.jsx("h2",{className:"page-title",children:"Data"}),!e&&!n&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),e&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-title",children:"Storage"}),s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Canonical SQLite"}),s.jsx("dd",{className:"kv-value mono",children:e.dbPath}),s.jsx("dt",{className:"kv-label",children:"On disk"}),s.jsxs("dd",{className:"kv-value mono",children:[qm(e.dbBytes),!e.dbPresent&&s.jsx("span",{className:"muted small",children:" · file missing"})]}),s.jsx("dt",{className:"kv-label",children:"Schema version"}),s.jsxs("dd",{className:"kv-value mono",children:[e.schemaVersion??"—",e.migrations.length>0&&s.jsxs("span",{className:"muted small",children:[" · ",e.migrations.length," migrations applied"]})]})]}),s.jsx("h3",{className:"section-title",children:"Tables"}),s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Table"}),s.jsx("th",{children:"Rows"})]})}),s.jsx("tbody",{children:e.tables.map(h=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono small",children:h.name}),s.jsx("td",{className:"mono",children:h.rows.toLocaleString()})]},h.name))})]}),e.runtimes.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"section-title",children:"Sessions by runtime"}),s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Runtime"}),s.jsx("th",{children:"Sessions"})]})}),s.jsx("tbody",{children:e.runtimes.map(h=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono small",children:h.runtime}),s.jsx("td",{className:"mono",children:h.n.toLocaleString()})]},h.runtime))})]})]}),s.jsx("h3",{className:"section-title",children:"Backup"}),s.jsx("p",{className:"muted small",children:"Downloads a clean, defragmented snapshot of the canonical store. Safe to run while the daemon is ingesting."}),s.jsx("div",{className:"form-row",children:s.jsx("a",{className:"btn btn-accent",href:"/api/data/backup",download:!0,children:"Download backup"})}),s.jsx("h3",{className:"section-title",children:"Restore"}),s.jsxs("p",{className:"muted small",children:["Replace the canonical store with an ",s.jsx("code",{children:".sqlite"})," backup. The current database is archived alongside it (",s.jsx("code",{children:".pre-restore-<timestamp>"}),"), never deleted. Takes effect on the next daemon restart."]}),s.jsxs("div",{className:"form-row",children:[s.jsx("input",{ref:u,type:"file",accept:".sqlite,application/x-sqlite3",className:"file-input",disabled:i}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void m(),disabled:i,children:i?"Validating…":"Restore from backup"})]}),(l==null?void 0:l.staged)&&s.jsx("div",{className:"card",style:{borderColor:"var(--accent)",padding:"0.75rem 1rem",marginTop:"0.75rem"},children:s.jsxs("p",{className:"small",style:{margin:0},children:["Backup validated and staged (",(p=l.sessions)==null?void 0:p.toLocaleString()," sessions, schema v",l.schemaVersion,").",s.jsx("strong",{children:" Restart the daemon"})," to apply it. Your current database will be archived automatically."]})}),(l==null?void 0:l.error)&&s.jsx("p",{className:"muted error small",children:l.error})]})]})}function tv(){const[e,t]=y.useState(()=>ql()),[n,r]=y.useState(!1),l=y.useRef(!0);y.useEffect(()=>{if(l.current){l.current=!1;return}$m(e),r(!0);const i=setTimeout(()=>r(!1),1800);return()=>clearTimeout(i)},[e]);const a=e.landing===mt.landing&&e.riverDensity===mt.riverDensity&&e.threadSort===mt.threadSort;return s.jsxs("div",{className:"page-pad",children:[s.jsx(Xt,{}),s.jsxs("div",{className:"form-row",style:{justifyContent:"space-between"},children:[s.jsx("h2",{className:"page-title",style:{margin:0},children:"Views"}),n&&s.jsx("span",{className:"muted small",children:"Saved"})]}),s.jsxs("div",{className:"form-grid",children:[s.jsx(Ms,{label:"Default landing",children:s.jsxs("select",{className:"form-input",value:e.landing,onChange:i=>t({...e,landing:i.target.value}),children:[s.jsx("option",{value:"live",children:"Live"}),s.jsx("option",{value:"pulse",children:"Pulse"}),s.jsx("option",{value:"river",children:"River"}),s.jsx("option",{value:"thread",children:"Thread"}),s.jsx("option",{value:"search",children:"Search"})]})}),s.jsx(Ms,{label:"River density",children:s.jsxs("select",{className:"form-input",value:e.riverDensity,onChange:i=>t({...e,riverDensity:i.target.value}),children:[s.jsx("option",{value:"compact",children:"Compact"}),s.jsx("option",{value:"comfortable",children:"Comfortable"}),s.jsx("option",{value:"spacious",children:"Spacious"})]})}),s.jsx(Ms,{label:"Thread sort",children:s.jsxs("select",{className:"form-input",value:e.threadSort,onChange:i=>t({...e,threadSort:i.target.value}),children:[s.jsx("option",{value:"recent",children:"Most recent first"}),s.jsx("option",{value:"oldest",children:"Oldest first"})]})})]}),s.jsx("div",{className:"form-row",children:s.jsx("button",{type:"button",className:"btn",onClick:()=>t(mt),disabled:a,children:"Reset to defaults"})}),s.jsx("p",{className:"muted small",children:"Preferences are stored per-device in localStorage. Landing applies on next load; River density and Thread sort apply when you open those pages."})]})}function Ms({label:e,children:t}){return s.jsxs("label",{className:"form-field",children:[s.jsx("span",{className:"form-label",children:e}),t]})}const Os=["candidate","project","tool","contact","service","concept"],nv=["all","active","snoozed","retired"],rv=[{value:"sessions-desc",label:"Sessions (high → low)"},{value:"sessions-asc",label:"Sessions (low → high)"},{value:"name-asc",label:"Name (A → Z)"},{value:"name-desc",label:"Name (Z → A)"},{value:"recent",label:"Most recently seen"},{value:"oldest",label:"Least recently seen"}],lv=[25,50,100,200];function sv(){const{data:e,loading:t,error:n,refetch:r}=Rn(),[l,a]=y.useState(""),[i,o]=y.useState("all"),[u,d]=y.useState("all"),[m,p]=y.useState("sessions-desc"),[h,w]=y.useState(50),[v,j]=y.useState(0),[N,c]=y.useState(null),f=(e==null?void 0:e.entities)??[],g=y.useMemo(()=>{const L=new Set(Os);for(const P of f)L.add(P.type);return["all",...[...L].sort()]},[f]),x=y.useMemo(()=>{const L=l.toLowerCase().trim(),I=[...f.filter(B=>i!=="all"&&B.type!==i||u!=="all"&&B.status!==u?!1:L?B.canonical.toLowerCase().includes(L)||B.type.toLowerCase().includes(L):!0)];return I.sort((B,G)=>{switch(m){case"sessions-desc":return G.session_count-B.session_count;case"sessions-asc":return B.session_count-G.session_count;case"name-asc":return B.canonical.localeCompare(G.canonical);case"name-desc":return G.canonical.localeCompare(B.canonical);case"recent":return(G.last_seen_session??"").localeCompare(B.last_seen_session??"");case"oldest":return(B.last_seen_session??"").localeCompare(G.last_seen_session??"")}}),I},[f,l,i,u,m]);y.useEffect(()=>{j(0)},[l,i,u,m,h]);const k=Math.max(1,Math.ceil(x.length/h)),S=Math.min(v,k-1),C=S*h,_=x.slice(C,C+h),O=async(L,P)=>{c(L);try{await P(),await r()}finally{c(null)}},M=(L,P)=>O(L,()=>vn({kind:"label_entity",subject_type:"entity",subject_id:L,payload:{new_type:P}}).then(()=>{})),U=L=>O(L,()=>vn({kind:"retire_entity",subject_type:"entity",subject_id:L}).then(()=>{})),xe=L=>{const P=new Date(Date.now()+2592e6).toISOString();return O(L,()=>vn({kind:"snooze",subject_type:"entity",subject_id:L,payload:{snoozed_until:P}}).then(()=>{}))};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Xt,{}),s.jsxs("div",{className:"page-header",children:[s.jsx("h2",{className:"page-title",children:"Labels"}),s.jsx("input",{className:"search-input",placeholder:"search canonical or type…",value:l,onChange:L=>a(L.target.value)})]}),s.jsxs("div",{className:"thread-filters",children:[s.jsx("div",{className:"filter-group",role:"group","aria-label":"Status filter",children:nv.map(L=>s.jsx("button",{type:"button",className:`chip${u===L?" active":""}`,onClick:()=>d(L),children:L},L))}),s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Type filter",children:[s.jsx("label",{className:"form-label",children:"Type"}),s.jsx("select",{className:"form-input form-input-inline",value:i,onChange:L=>o(L.target.value),children:g.map(L=>s.jsx("option",{value:L,children:L},L))})]}),s.jsxs("div",{className:"filter-group",role:"group","aria-label":"Sort",children:[s.jsx("label",{className:"form-label",children:"Sort"}),s.jsx("select",{className:"form-input form-input-inline",value:m,onChange:L=>p(L.target.value),children:rv.map(L=>s.jsx("option",{value:L.value,children:L.label},L.value))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[x.length," match",x.length===1?"":"es"]})]}),n&&s.jsx("div",{className:"muted error",children:n}),s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Canonical"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Status"}),s.jsx("th",{className:"right",children:"Sessions"}),s.jsx("th",{children:"Last seen"}),s.jsx("th",{children:"Actions"})]})}),t&&!e&&s.jsx(Em,{rows:8,cols:6}),s.jsxs("tbody",{children:[_.map(L=>{const P=N===L.canonical;return s.jsxs("tr",{className:P?"row-busy":"",children:[s.jsxs("td",{className:"canonical",children:[s.jsx("span",{className:"dot",style:{background:(e==null?void 0:e.entity_colors[L.canonical])??"#666"}}),L.canonical]}),s.jsx("td",{children:s.jsx("select",{className:"form-input form-input-inline",value:Os.includes(L.type)?L.type:"candidate",onChange:I=>void M(L.canonical,I.target.value),disabled:P,children:Os.map(I=>s.jsx("option",{value:I,children:I},I))})}),s.jsx("td",{children:s.jsx("span",{className:`chip-inline status-${L.status}`,children:L.status})}),s.jsx("td",{className:"right mono",children:L.session_count}),s.jsx("td",{className:"mono small",children:L.last_seen_session??"—"}),s.jsxs("td",{className:"row-actions",children:[s.jsx("button",{type:"button",className:"chip",disabled:P,onClick:()=>void xe(L.canonical),children:"snooze 30d"}),s.jsx("button",{type:"button",className:"chip",disabled:P,onClick:()=>void U(L.canonical),children:"retire"})]})]},L.canonical)}),_.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,className:"muted small empty-row",children:f.length===0?"No entities yet.":"No entities match the current filters."})})]})]}),x.length>0&&s.jsxs("div",{className:"pagination",children:[s.jsxs("div",{className:"page-size",children:[s.jsx("label",{className:"form-label",children:"Per page"}),s.jsx("select",{className:"form-input form-input-inline",value:h,onChange:L=>w(Number.parseInt(L.target.value,10)),children:lv.map(L=>s.jsx("option",{value:L,children:L},L))})]}),s.jsx("span",{className:"header-spacer"}),s.jsxs("span",{className:"muted small",children:[C+1,"–",Math.min(C+h,x.length)," of ",x.length]}),s.jsxs("div",{className:"page-nav",children:[s.jsx("button",{type:"button",className:"chip",disabled:S===0,onClick:()=>j(0),children:"« first"}),s.jsx("button",{type:"button",className:"chip",disabled:S===0,onClick:()=>j(L=>Math.max(0,L-1)),children:"‹ prev"}),s.jsxs("span",{className:"page-indicator mono",children:[S+1," / ",k]}),s.jsx("button",{type:"button",className:"chip",disabled:S>=k-1,onClick:()=>j(L=>Math.min(k-1,L+1)),children:"next ›"}),s.jsx("button",{type:"button",className:"chip",disabled:S>=k-1,onClick:()=>j(k-1),children:"last »"})]})]}),s.jsx("p",{className:"muted small",children:"Changes are append-only actions; refresh re-applies the overlay over the persisted store."})]})}const av=["claude-code","hermes","pi","jsonl-generic","webhook"],iv=["deepseek","ollama","openai","anthropic","openrouter","openai-compatible"],tr={deepseek:"DeepSeek",ollama:"Ollama",openai:"OpenAI",anthropic:"Anthropic",openrouter:"OpenRouter","openai-compatible":"OpenAI-compatible"},_d={"claude-code":"Claude Code",hermes:"Hermes",pi:"pi.dev","jsonl-generic":"Custom JSONL",webhook:"Webhook"},Zo={"claude-code":{name:"Claude Code",runtimeLabel:"claude-code",pathOrUrl:"~/.claude/projects",parseConfig:{}},hermes:{name:"Hermes",runtimeLabel:"hermes",pathOrUrl:"~/.hermes/sessions",parseConfig:{}},pi:{name:"pi.dev",runtimeLabel:"pi",pathOrUrl:"~/.pi/transcripts",parseConfig:{}},"jsonl-generic":{name:"",runtimeLabel:"",pathOrUrl:"",parseConfig:{idField:"session_id",textField:"text",startedAtField:"started_at",endedAtField:"ended_at"}},webhook:{name:"",runtimeLabel:"",pathOrUrl:null,parseConfig:{}}},qo={deepseek:{baseUrl:"https://api.deepseek.com",defaultModel:"deepseek-v4-flash"},ollama:{baseUrl:"http://localhost:11434",defaultModel:"phi4-mini:latest"},openai:{baseUrl:"https://api.openai.com/v1",defaultModel:"gpt-4o-mini"},anthropic:{baseUrl:"https://api.anthropic.com",defaultModel:"claude-haiku-4-5-20251001"},openrouter:{baseUrl:"https://openrouter.ai/api/v1",defaultModel:"anthropic/claude-haiku-4-5"},"openai-compatible":{baseUrl:"",defaultModel:null}};async function ov(){const e=await fetch("/api/sources");if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.json()).sources}async function Pd(){const e=await fetch("/api/providers");if(!e.ok)throw new Error(`HTTP ${e.status}`);return(await e.json()).providers}async function uv(e){const t=await fetch(`/api/providers/${e}/models`),n=await t.json();if(!t.ok||n.error)throw new Error(n.error??`HTTP ${t.status}`);return n.models??[]}async function Li(e){return await(await fetch(`/api/providers/${e}/test`,{method:"POST"})).json()}function cv(){const[e,t]=y.useState(null),[n,r]=y.useState([]),[l,a]=y.useState([]),[i,o]=y.useState(null),[u,d]=y.useState(null),[m,p]=y.useState(""),[h,w]=y.useState(null),[v,j]=y.useState(null),[N,c]=y.useState(!1),[f,g]=y.useState(null),[x,k]=y.useState(null),S=y.useCallback(async()=>{try{const[P,I]=await Promise.all([fetch("/api/classifier/info").then(z=>z.json()),Pd()]);t(P),r(I);const B=I.find(z=>z.kind===P.provider&&z.enabled),G=I.find(z=>z.enabled)??I[0]??null,T=B??G;d(T?T.id:null),p(P.model),k(null)}catch(P){k(P instanceof Error?P.message:String(P))}},[]);y.useEffect(()=>{S()},[S]);const C=y.useMemo(()=>n.find(P=>P.id===u)??null,[n,u]);y.useEffect(()=>{if(!C){a([]);return}let P=!1;return o(null),a([]),uv(C.id).then(I=>{P||(a(I),(!m||!I.includes(m))&&p(C.defaultModel??I[0]??""))}).catch(I=>{P||o(I instanceof Error?I.message:String(I))}),()=>{P=!0}},[C==null?void 0:C.id]);const _=C?`${C.id}|${m}`:"",O=(h==null?void 0:h.ok)===!0&&v===_,U=(e&&C?C.kind!==e.provider||m!==e.model:!1)&&m.length>0&&!N&&O,xe=async()=>{if(C){c(!0),w(null),j(null);try{const P=await Li(C.id);w(P),P.ok&&j(_)}catch(P){w({ok:!1,latencyMs:0,error:P instanceof Error?P.message:String(P)})}finally{c(!1)}}},L=async()=>{if(C){c(!0),g(null);try{const P=await fetch("/api/classifier",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:C.kind,model:m})}),I=await P.json();!P.ok||I.error?g(`Error: ${I.error??P.statusText}`):(g(`Active: ${I.provider} · ${I.model}`),await S())}catch(P){g(`Error: ${P instanceof Error?P.message:String(P)}`)}finally{c(!1)}}};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Xt,{}),s.jsx("h2",{className:"page-title",children:"Classifier"}),!e&&!x&&s.jsx("div",{className:"muted",children:"Loading…"}),x&&s.jsx("div",{className:"muted error",children:x}),e&&s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Active provider"}),s.jsx("dd",{className:"kv-value mono",children:e.provider}),s.jsx("dt",{className:"kv-label",children:"Active model"}),s.jsx("dd",{className:"kv-value mono",children:e.model})]}),s.jsx("h3",{className:"section-title",children:"Switch model"}),n.length===0?s.jsxs("p",{className:"muted small",children:["No providers configured. Add one on the ",s.jsx("a",{href:"/settings/providers",children:"Providers"})," page first."]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Provider"}),s.jsx("select",{className:"form-input form-input-inline",value:u??"",onChange:P=>{d(Number.parseInt(P.target.value,10)),w(null),j(null)},disabled:N,children:n.map(P=>s.jsxs("option",{value:P.id,disabled:!P.enabled,children:[P.name," (",tr[P.kind],")",P.enabled?"":" — disabled",P.kind!=="ollama"&&!P.hasApiKey?" — no key":""]},P.id))}),s.jsx("label",{className:"form-label",children:"Model"}),s.jsxs("select",{className:"form-input form-input-inline",value:m,onChange:P=>{p(P.target.value),j(null)},disabled:N||l.length===0,children:[l.map(P=>s.jsx("option",{value:P,children:P},P)),!l.includes(m)&&m&&s.jsx("option",{value:m,children:m})]}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void xe(),disabled:N||!C,children:N&&!h?"Testing…":"Test connection"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>void L(),disabled:!U,title:O?void 0:"Run a successful test before saving",children:N&&(h!=null&&h.ok)?"Saving…":"Save"})]}),i&&s.jsxs("p",{className:"muted error small",children:["Model list failed: ",i]}),h&&s.jsx("p",{className:`small ${h.ok?"muted":"muted error"}`,children:h.ok?`Connection OK · ${h.modelCount??"?"} models · ${h.latencyMs}ms`:`Connection failed: ${h.error??"unknown"} (${h.latencyMs}ms)`}),f&&s.jsx("p",{className:"muted small",children:f}),s.jsx("p",{className:"muted small",children:"Save is gated on a passing connection test for the selected provider + model."})]}),s.jsx("h3",{className:"section-title",children:"Embedder"}),s.jsxs("dl",{className:"kv-list",children:[s.jsx("dt",{className:"kv-label",children:"Provider"}),s.jsx("dd",{className:"kv-value mono",children:e.embedder.provider}),s.jsx("dt",{className:"kv-label",children:"Model"}),s.jsx("dd",{className:"kv-value mono",children:e.embedder.model}),s.jsx("dt",{className:"kv-label",children:"Dimensions"}),s.jsx("dd",{className:"kv-value mono",children:e.embedder.dims})]}),s.jsx("p",{className:"muted small",children:"Embedder is fixed at build time. Recall vectors must match the index dims, so it isn't hot-swappable. DeepSeek has no embeddings endpoint; Ollama serves both classification (optional) and embedding (always)."})]})]})}function dv(){const[e,t]=y.useState([]),[n,r]=y.useState(null),[l,a]=y.useState(!0),[i,o]=y.useState(!1),[u,d]=y.useState(null),m=y.useCallback(async()=>{a(!0);try{t(await ov()),r(null)}catch(v){r(v instanceof Error?v.message:String(v))}finally{a(!1)}},[]);y.useEffect(()=>{m()},[m]);const p=async v=>{await fetch(`/api/sources/${v.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!v.enabled})}),await m()},h=async v=>{confirm(`Delete source "${v.name}"? This stops scanning but leaves ingested sessions in place.`)&&(await fetch(`/api/sources/${v.id}`,{method:"DELETE"}),await m())},w=async v=>{if(!confirm(`Regenerate token for "${v.name}"? Any client using the current token will stop working.`))return;const j=await fetch(`/api/sources/${v.id}/regenerate-token`,{method:"POST"}),N=await j.json();N.token?(d({name:v.name,token:N.token}),await m()):alert(`Failed: ${N.error??j.statusText}`)};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Xt,{}),s.jsxs("div",{className:"form-row",style:{justifyContent:"space-between"},children:[s.jsx("h2",{className:"page-title",style:{margin:0},children:"Sources"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>o(!0),children:"Add source"})]}),u&&s.jsx(fv,{name:u.name,token:u.token,onDismiss:()=>d(null)}),l&&e.length===0&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),e.length>0&&s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Kind"}),s.jsx("th",{children:"Runtime"}),s.jsx("th",{children:"Path / URL"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:e.map(v=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:v.name}),s.jsx("td",{children:_d[v.kind]}),s.jsx("td",{className:"mono small",children:v.runtimeLabel}),s.jsx("td",{className:"mono small",children:v.pathOrUrl??(v.kind==="webhook"?"—":"")}),s.jsx("td",{children:s.jsx("span",{className:`chip-inline ${v.enabled?"status-active":"status-stale"}`,children:v.enabled?"enabled":"disabled"})}),s.jsx("td",{children:s.jsxs("div",{className:"form-row",style:{gap:"0.5rem"},children:[s.jsx("button",{type:"button",className:"btn small",onClick:()=>void p(v),children:v.enabled?"Disable":"Enable"}),v.kind==="webhook"&&s.jsx("button",{type:"button",className:"btn small",onClick:()=>void w(v),children:"Regenerate token"}),s.jsx("button",{type:"button",className:"btn small",onClick:()=>void h(v),children:"Delete"})]})})]},v.id))})]}),!l&&e.length===0&&s.jsx("p",{className:"muted small",children:'No sources yet. Click "Add source" to scan your first transcript directory.'}),i&&s.jsx(pv,{onClose:()=>o(!1),onCreated:v=>{o(!1),v.kind==="webhook"&&v.token&&d({name:v.name,token:v.token}),m()}})]})}function fv({name:e,token:t,onDismiss:n}){return s.jsxs("div",{className:"card",style:{borderColor:"var(--accent)",padding:"1rem",marginTop:"1rem"},children:[s.jsxs("h3",{className:"section-title",style:{marginTop:0},children:['One-time token for "',e,'"']}),s.jsxs("p",{className:"muted small",children:["Copy this now. It's stored hashed on the daemon and won't be shown again. Send sessions with"," ",s.jsx("code",{children:"Authorization: Bearer <token>"})," to ",s.jsx("code",{children:"POST /api/ingest"}),"."]}),s.jsx("pre",{className:"mono",style:{padding:"0.5rem",overflow:"auto"},children:t}),s.jsxs("div",{className:"form-row",children:[s.jsx("button",{type:"button",className:"btn",onClick:()=>void navigator.clipboard.writeText(t),children:"Copy"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:n,children:"I've stored it"})]})]})}function pv({onClose:e,onCreated:t}){const[n,r]=y.useState("claude-code"),l=Zo[n],[a,i]=y.useState(l.name),[o,u]=y.useState(l.runtimeLabel),[d,m]=y.useState(l.pathOrUrl??""),[p,h]=y.useState({idField:"session_id",textField:"text",startedAtField:"started_at",endedAtField:"ended_at"}),[w,v]=y.useState(!1),[j,N]=y.useState(null);y.useEffect(()=>{const k=Zo[n];i(k.name),u(k.runtimeLabel),m(k.pathOrUrl??""),N(null)},[n]);const c=n!=="webhook",f=n==="jsonl-generic",g=async()=>{v(!0),N(null);try{const k={kind:n,name:a,runtimeLabel:o};c&&(k.pathOrUrl=d),f&&(k.parseConfig=p);const S=await fetch("/api/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),C=await S.json();if(!S.ok||C.error){N(C.error??S.statusText);return}t(C)}catch(k){N(k instanceof Error?k.message:String(k))}finally{v(!1)}},x=!w&&a.length>0&&o.length>0&&(!c||d.length>0);return s.jsxs("div",{className:"card",style:{padding:"1rem",marginTop:"1rem"},children:[s.jsx("h3",{className:"section-title",style:{marginTop:0},children:"Add source"}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Kind"}),s.jsx("select",{className:"form-input form-input-inline",value:n,onChange:k=>r(k.target.value),disabled:w,children:av.map(k=>s.jsx("option",{value:k,children:_d[k]},k))})]}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Name"}),s.jsx("input",{className:"form-input form-input-inline",value:a,onChange:k=>i(k.target.value),placeholder:f||n==="webhook"?"e.g. my-agent":"",disabled:w}),s.jsx("label",{className:"form-label",children:"Runtime label"}),s.jsx("input",{className:"form-input form-input-inline",value:o,onChange:k=>u(k.target.value),placeholder:"appears on Pulse Runtimes card",disabled:w})]}),c&&s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:n==="jsonl-generic"?"Directory":"Path"}),s.jsx("input",{className:"form-input form-input-inline",style:{minWidth:"32rem"},value:d,onChange:k=>m(k.target.value),placeholder:"absolute or ~/ path to JSONL directory",disabled:w})]}),f&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"section-title",style:{fontSize:"0.875rem"},children:"JSONL field mapping"}),s.jsx("p",{className:"muted small",children:"How to read your JSONL files. Each row should be one session. Use dot.notation for nested fields."}),["idField","textField","startedAtField","endedAtField"].map(k=>s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:k}),s.jsx("input",{className:"form-input form-input-inline",value:p[k],onChange:S=>h({...p,[k]:S.target.value}),disabled:w})]},k))]}),n==="webhook"&&s.jsxs("p",{className:"muted small",children:["A bearer token will be generated and shown ",s.jsx("strong",{children:"once"})," when you create this source. Use it to ",s.jsx("code",{children:"POST /api/ingest"})," from any agent or script."]}),j&&s.jsx("p",{className:"muted error small",children:j}),s.jsxs("div",{className:"form-row",children:[s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>void g(),disabled:!x,children:w?"Creating…":"Create"}),s.jsx("button",{type:"button",className:"btn",onClick:e,disabled:w,children:"Cancel"})]})]})}function hv(){const[e,t]=y.useState([]),[n,r]=y.useState(null),[l,a]=y.useState(!0),[i,o]=y.useState(!1),[u,d]=y.useState({}),m=y.useCallback(async()=>{a(!0);try{t(await Pd()),r(null)}catch(v){r(v instanceof Error?v.message:String(v))}finally{a(!1)}},[]);y.useEffect(()=>{m()},[m]);const p=async v=>{await fetch(`/api/providers/${v.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!v.enabled})}),await m()},h=async v=>{confirm(`Delete provider "${v.name}"? The Classifier will fall back to another provider if this one was active.`)&&(await fetch(`/api/providers/${v.id}`,{method:"DELETE"}),await m())},w=async v=>{d(j=>({...j,[v.id]:"running"}));try{const j=await Li(v.id);d(N=>({...N,[v.id]:j}))}catch(j){d(N=>({...N,[v.id]:{ok:!1,latencyMs:0,error:j instanceof Error?j.message:String(j)}}))}};return s.jsxs("div",{className:"page-pad",children:[s.jsx(Xt,{}),s.jsxs("div",{className:"form-row",style:{justifyContent:"space-between"},children:[s.jsx("h2",{className:"page-title",style:{margin:0},children:"Providers"}),s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>o(!0),children:"Add provider"})]}),l&&e.length===0&&s.jsx("div",{className:"muted",children:"Loading…"}),n&&s.jsx("div",{className:"muted error",children:n}),e.length>0&&s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Kind"}),s.jsx("th",{children:"Base URL"}),s.jsx("th",{children:"Default model"}),s.jsx("th",{children:"API key"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Last test"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:e.map(v=>{const j=u[v.id];return s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:v.name}),s.jsx("td",{children:tr[v.kind]}),s.jsx("td",{className:"mono small",children:v.baseUrl??"—"}),s.jsx("td",{className:"mono small",children:v.defaultModel??"—"}),s.jsx("td",{children:v.kind==="ollama"||v.kind==="openai-compatible"?s.jsx("span",{className:"muted small",children:v.hasApiKey?"set":"n/a"}):s.jsx("span",{className:`chip-inline ${v.hasApiKey?"status-active":"status-stale"}`,children:v.hasApiKey?"set":"missing"})}),s.jsx("td",{children:s.jsx("span",{className:`chip-inline ${v.enabled?"status-active":"status-stale"}`,children:v.enabled?"enabled":"disabled"})}),s.jsxs("td",{className:"small",children:[j==="running"&&s.jsx("span",{className:"muted",children:"testing…"}),j&&j!=="running"&&j.ok&&s.jsxs("span",{className:"muted",children:["OK · ",j.modelCount," models · ",j.latencyMs,"ms"]}),j&&j!=="running"&&!j.ok&&s.jsxs("span",{className:"muted error",children:["fail: ",j.error]})]}),s.jsx("td",{children:s.jsxs("div",{className:"form-row",style:{gap:"0.5rem"},children:[s.jsx("button",{type:"button",className:"btn small",onClick:()=>void w(v),children:"Test"}),s.jsx("button",{type:"button",className:"btn small",onClick:()=>void p(v),children:v.enabled?"Disable":"Enable"}),s.jsx("button",{type:"button",className:"btn small",onClick:()=>void h(v),children:"Delete"})]})})]},v.id)})})]}),!l&&e.length===0&&s.jsx("p",{className:"muted small",children:'No providers yet. Click "Add provider" to wire up DeepSeek, Ollama, or any OpenAI-compatible endpoint.'}),i&&s.jsx(mv,{onClose:()=>o(!1),onCreated:()=>{o(!1),m()}})]})}function mv({onClose:e,onCreated:t}){const[n,r]=y.useState("deepseek"),l=qo[n],[a,i]=y.useState(tr[n]),[o,u]=y.useState(l.baseUrl??""),[d,m]=y.useState(""),[p,h]=y.useState(l.defaultModel??""),[w,v]=y.useState(!1),[j,N]=y.useState(null),[c,f]=y.useState(null);y.useEffect(()=>{const S=qo[n];i(tr[n]),u(S.baseUrl??""),h(S.defaultModel??""),f(null),N(null)},[n]);const g=n!=="ollama"&&n!=="openai-compatible",x=async S=>{v(!0),N(null);try{const C={kind:n,name:a};o&&(C.baseUrl=o),d&&(C.apiKey=d),p&&(C.defaultModel=p);const _=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)}),O=await _.json();if(!_.ok||O.error){N(O.error??_.statusText);return}if(S){const M=await Li(O.id);if(f(M),!M.ok)return}t()}catch(C){N(C instanceof Error?C.message:String(C))}finally{v(!1)}},k=!w&&a.length>0&&(!g||d.length>0);return s.jsxs("div",{className:"card",style:{padding:"1rem",marginTop:"1rem"},children:[s.jsx("h3",{className:"section-title",style:{marginTop:0},children:"Add provider"}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Kind"}),s.jsx("select",{className:"form-input form-input-inline",value:n,onChange:S=>r(S.target.value),disabled:w,children:iv.map(S=>s.jsx("option",{value:S,children:tr[S]},S))}),s.jsx("label",{className:"form-label",children:"Name"}),s.jsx("input",{className:"form-input form-input-inline",value:a,onChange:S=>i(S.target.value),placeholder:"Display name (must be unique)",disabled:w})]}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Base URL"}),s.jsx("input",{className:"form-input form-input-inline",style:{minWidth:"28rem"},value:o,onChange:S=>u(S.target.value),placeholder:n==="openai-compatible"?"https://your-endpoint/v1":"",disabled:w})]}),s.jsxs("div",{className:"form-row",children:[s.jsxs("label",{className:"form-label",children:["API key",g?"":" (optional)"]}),s.jsx("input",{type:"password",className:"form-input form-input-inline",style:{minWidth:"28rem"},value:d,onChange:S=>m(S.target.value),autoComplete:"off",disabled:w})]}),s.jsxs("div",{className:"form-row",children:[s.jsx("label",{className:"form-label",children:"Default model"}),s.jsx("input",{className:"form-input form-input-inline",value:p,onChange:S=>h(S.target.value),placeholder:"optional",disabled:w})]}),c&&!c.ok&&s.jsxs("p",{className:"muted error small",children:["Saved, but test failed: ",c.error," (",c.latencyMs,"ms). You can edit or delete from the list."]}),j&&s.jsx("p",{className:"muted error small",children:j}),s.jsxs("div",{className:"form-row",children:[s.jsx("button",{type:"button",className:"btn btn-accent",onClick:()=>void x(!0),disabled:!k,children:w?"Saving…":"Save & test"}),s.jsx("button",{type:"button",className:"btn",onClick:()=>void x(!1),disabled:!k,children:"Save without testing"}),s.jsx("button",{type:"button",className:"btn",onClick:e,disabled:w,children:"Cancel"})]})]})}function vv({page:e}){return s.jsxs("div",{className:"stub-shell",children:[s.jsxs("span",{className:"stub-name",children:["/",e]}),s.jsx("p",{children:"not yet ported from the Astro UI."}),s.jsx("p",{className:"stub-hint",children:"Tracked in NocoDB #95 (Vite + React SPA port)."})]})}function gv(){return s.jsxs("div",{className:"page-shell",children:[s.jsx(fm,{}),s.jsxs("div",{className:"page-main",children:[s.jsx(yv,{}),s.jsxs(Gh,{children:[s.jsx(de,{path:"/",element:s.jsx(Yh,{to:`/${ql().landing}`,replace:!0})}),s.jsx(de,{path:"/live",element:s.jsx(Lm,{})}),s.jsx(de,{path:"/pulse",element:s.jsx(Rm,{})}),s.jsx(de,{path:"/river",element:s.jsx(Fm,{})}),s.jsx(de,{path:"/thread",element:s.jsx(Wm,{})}),s.jsx(de,{path:"/search",element:s.jsx(bm,{})}),s.jsx(de,{path:"/recall",element:s.jsx(Xm,{})}),s.jsx(de,{path:"/settings",element:s.jsx(Zm,{})}),s.jsx(de,{path:"/settings/sources",element:s.jsx(dv,{})}),s.jsx(de,{path:"/settings/providers",element:s.jsx(hv,{})}),s.jsx(de,{path:"/settings/labels",element:s.jsx(sv,{})}),s.jsx(de,{path:"/settings/classifier",element:s.jsx(cv,{})}),s.jsx(de,{path:"/settings/data",element:s.jsx(ev,{})}),s.jsx(de,{path:"/settings/views",element:s.jsx(tv,{})}),s.jsx(de,{path:"*",element:s.jsx(vv,{page:"not found"})})]})]})]})}function yv(){const{pathname:e}=Rt(),t=e.replace(/^\//,"").replace(/\/+$/,"")||"live";return s.jsxs("header",{className:"app-header",children:[s.jsx("span",{className:"wordmark-page",children:t}),s.jsx("span",{className:"header-spacer"}),s.jsx("span",{className:"status-dot","aria-hidden":"true"}),s.jsx("span",{className:"header-info",children:"nlm-memory · :3940"})]})}const Ld=document.getElementById("root");if(!Ld)throw new Error("missing #root");pd(Ld).render(s.jsx(cu.StrictMode,{children:s.jsx(sm,{basename:"/ui",children:s.jsx(gv,{})})}));