claude-terminal-prism 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as C,a as ml}from"./vendor-zustand-zAtGz-1b.js";import{r as
|
|
1
|
+
import{r as C,a as ml}from"./vendor-zustand-zAtGz-1b.js";import{r as U0,R as Gn,B as xs,C as Xn,X as Qn,Y as Zn,T as Vn,a as Vt,b as Mr,L as B0,c as R0}from"./vendor-charts-U984Iaxn.js";import{f as ot,c as ge,a as Er,b as H0}from"./vendor-utils-DvX5ZkRV.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function l(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(a){if(a.ep)return;a.ep=!0;const s=l(a);fetch(a.href,s)}})();var Dr={exports:{}},Zs={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ import{r as C,a as ml}from"./vendor-zustand-zAtGz-1b.js";import{r as O0,R as Yn,
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var _0=Symbol.for("react.transitional.element"),L0=Symbol.for("react.fragment");function Or(e,t,l){var n=null;if(l!==void 0&&(n=""+l),t.key!==void 0&&(n=""+t.key),"key"in t){l={};for(var a in t)a!=="key"&&(l[a]=t[a])}else l=t;return t=l.ref,{$$typeof:_0,type:e,key:n,ref:t!==void 0?t:null,props:l}}Zs.Fragment=L0;Zs.jsx=Or;Zs.jsxs=Or;Dr.exports=Zs;var i=Dr.exports,Ur={exports:{}},Vs={},Br={exports:{}},Rr={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* scheduler.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ import{r as C,a as ml}from"./vendor-zustand-zAtGz-1b.js";import{r as O0,R as Yn,
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/(function(e){function t(w,B){var k=w.length;w.push(B);e:for(;0<k;){var O=k-1>>>1,$=w[O];if(0<a($,B))w[O]=B,w[k]=$,k=O;else break e}}function l(w){return w.length===0?null:w[0]}function n(w){if(w.length===0)return null;var B=w[0],k=w.pop();if(k!==B){w[0]=k;e:for(var O=0,$=w.length,we=$>>>1;O<we;){var Lt=2*(O+1)-1,_l=w[Lt],vt=Lt+1,U=w[vt];if(0>a(_l,k))vt<$&&0>a(U,_l)?(w[O]=U,w[vt]=k,O=vt):(w[O]=_l,w[Lt]=k,O=Lt);else if(vt<$&&0>a(U,k))w[O]=U,w[vt]=k,O=vt;else break e}}return B}function a(w,B){var k=w.sortIndex-B.sortIndex;return k!==0?k:w.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,o=c.now();e.unstable_now=function(){return c.now()-o}}var u=[],r=[],h=1,p=null,m=3,g=!1,y=!1,j=!1,b=!1,f=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function v(w){for(var B=l(r);B!==null;){if(B.callback===null)n(r);else if(B.startTime<=w)n(r),B.sortIndex=B.expirationTime,t(u,B);else break;B=l(r)}}function S(w){if(j=!1,v(w),!y)if(l(u)!==null)y=!0,z||(z=!0,te());else{var B=l(r);B!==null&&F(S,B.startTime-w)}}var z=!1,N=-1,M=5,A=-1;function D(){return b?!0:!(e.unstable_now()-A<M)}function X(){if(b=!1,z){var w=e.unstable_now();A=w;var B=!0;try{e:{y=!1,j&&(j=!1,d(N),N=-1),g=!0;var k=m;try{t:{for(v(w),p=l(u);p!==null&&!(p.expirationTime>w&&D());){var O=p.callback;if(typeof O=="function"){p.callback=null,m=p.priorityLevel;var $=O(p.expirationTime<=w);if(w=e.unstable_now(),typeof $=="function"){p.callback=$,v(w),B=!0;break t}p===l(u)&&n(u),v(w)}else n(u);p=l(u)}if(p!==null)B=!0;else{var we=l(r);we!==null&&F(S,we.startTime-w),B=!1}}break e}finally{p=null,m=k,g=!1}B=void 0}}finally{B?te():z=!1}}}var te;if(typeof x=="function")te=function(){x(X)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,_=E.port2;E.port1.onmessage=X,te=function(){_.postMessage(null)}}else te=function(){f(X,0)};function F(w,B){N=f(function(){w(e.unstable_now())},B)}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(w){w.callback=null},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(w){switch(m){case 1:case 2:case 3:var B=3;break;default:B=m}var k=m;m=B;try{return w()}finally{m=k}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(w,B){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var k=m;m=w;try{return B()}finally{m=k}},e.unstable_scheduleCallback=function(w,B,k){var O=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?O+k:O):k=O,w){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=k+$,w={id:h++,callback:B,priorityLevel:w,startTime:k,expirationTime:$,sortIndex:-1},k>O?(w.sortIndex=k,t(r,w),l(u)===null&&w===l(r)&&(j?(d(N),N=-1):j=!0,F(S,k-O))):(w.sortIndex=$,t(u,w),y||g||(y=!0,z||(z=!0,te()))),w},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(w){var B=m;return function(){var k=m;m=B;try{return w.apply(this,arguments)}finally{m=k}}}})(
|
|
17
|
+
*/(function(e){function t(w,B){var k=w.length;w.push(B);e:for(;0<k;){var O=k-1>>>1,$=w[O];if(0<a($,B))w[O]=B,w[k]=$,k=O;else break e}}function l(w){return w.length===0?null:w[0]}function n(w){if(w.length===0)return null;var B=w[0],k=w.pop();if(k!==B){w[0]=k;e:for(var O=0,$=w.length,we=$>>>1;O<we;){var Lt=2*(O+1)-1,_l=w[Lt],vt=Lt+1,U=w[vt];if(0>a(_l,k))vt<$&&0>a(U,_l)?(w[O]=U,w[vt]=k,O=vt):(w[O]=_l,w[Lt]=k,O=Lt);else if(vt<$&&0>a(U,k))w[O]=U,w[vt]=k,O=vt;else break e}}return B}function a(w,B){var k=w.sortIndex-B.sortIndex;return k!==0?k:w.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,o=c.now();e.unstable_now=function(){return c.now()-o}}var u=[],r=[],h=1,p=null,m=3,g=!1,y=!1,j=!1,b=!1,f=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function v(w){for(var B=l(r);B!==null;){if(B.callback===null)n(r);else if(B.startTime<=w)n(r),B.sortIndex=B.expirationTime,t(u,B);else break;B=l(r)}}function S(w){if(j=!1,v(w),!y)if(l(u)!==null)y=!0,z||(z=!0,te());else{var B=l(r);B!==null&&F(S,B.startTime-w)}}var z=!1,N=-1,M=5,A=-1;function D(){return b?!0:!(e.unstable_now()-A<M)}function X(){if(b=!1,z){var w=e.unstable_now();A=w;var B=!0;try{e:{y=!1,j&&(j=!1,d(N),N=-1),g=!0;var k=m;try{t:{for(v(w),p=l(u);p!==null&&!(p.expirationTime>w&&D());){var O=p.callback;if(typeof O=="function"){p.callback=null,m=p.priorityLevel;var $=O(p.expirationTime<=w);if(w=e.unstable_now(),typeof $=="function"){p.callback=$,v(w),B=!0;break t}p===l(u)&&n(u),v(w)}else n(u);p=l(u)}if(p!==null)B=!0;else{var we=l(r);we!==null&&F(S,we.startTime-w),B=!1}}break e}finally{p=null,m=k,g=!1}B=void 0}}finally{B?te():z=!1}}}var te;if(typeof x=="function")te=function(){x(X)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,_=E.port2;E.port1.onmessage=X,te=function(){_.postMessage(null)}}else te=function(){f(X,0)};function F(w,B){N=f(function(){w(e.unstable_now())},B)}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(w){w.callback=null},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(w){switch(m){case 1:case 2:case 3:var B=3;break;default:B=m}var k=m;m=B;try{return w()}finally{m=k}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(w,B){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var k=m;m=w;try{return B()}finally{m=k}},e.unstable_scheduleCallback=function(w,B,k){var O=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?O+k:O):k=O,w){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=k+$,w={id:h++,callback:B,priorityLevel:w,startTime:k,expirationTime:$,sortIndex:-1},k>O?(w.sortIndex=k,t(r,w),l(u)===null&&w===l(r)&&(j?(d(N),N=-1):j=!0,F(S,k-O))):(w.sortIndex=$,t(u,w),y||g||(y=!0,z||(z=!0,te()))),w},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(w){var B=m;return function(){var k=m;m=B;try{return w.apply(this,arguments)}finally{m=k}}}})(Rr);Br.exports=Rr;var $0=Br.exports;/**
|
|
18
18
|
* @license React
|
|
19
19
|
* react-dom-client.production.js
|
|
20
20
|
*
|
|
@@ -22,35 +22,35 @@ import{r as C,a as ml}from"./vendor-zustand-zAtGz-1b.js";import{r as O0,R as Yn,
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var ve
|
|
25
|
+
*/var ve=$0,Hr=C,q0=U0;function T(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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."}function _r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ja(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function Lr(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 $r(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Io(e){if(ja(e)!==e)throw Error(T(188))}function Y0(e){var t=e.alternate;if(!t){if(t=ja(e),t===null)throw Error(T(188));return t!==e?null:e}for(var l=e,n=t;;){var a=l.return;if(a===null)break;var s=a.alternate;if(s===null){if(n=a.return,n!==null){l=n;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===l)return Io(a),e;if(s===n)return Io(a),t;s=s.sibling}throw Error(T(188))}if(l.return!==n.return)l=a,n=s;else{for(var c=!1,o=a.child;o;){if(o===l){c=!0,l=a,n=s;break}if(o===n){c=!0,n=a,l=s;break}o=o.sibling}if(!c){for(o=s.child;o;){if(o===l){c=!0,l=s,n=a;break}if(o===n){c=!0,n=s,l=a;break}o=o.sibling}if(!c)throw Error(T(189))}}if(l.alternate!==n)throw Error(T(190))}if(l.tag!==3)throw Error(T(188));return l.stateNode.current===l?e:t}function qr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=qr(e),t!==null)return t;e=e.sibling}return null}var se=Object.assign,G0=Symbol.for("react.element"),Ua=Symbol.for("react.transitional.element"),_n=Symbol.for("react.portal"),Ql=Symbol.for("react.fragment"),Yr=Symbol.for("react.strict_mode"),lc=Symbol.for("react.profiler"),Gr=Symbol.for("react.consumer"),kt=Symbol.for("react.context"),eo=Symbol.for("react.forward_ref"),nc=Symbol.for("react.suspense"),ac=Symbol.for("react.suspense_list"),to=Symbol.for("react.memo"),qt=Symbol.for("react.lazy"),sc=Symbol.for("react.activity"),X0=Symbol.for("react.memo_cache_sentinel"),Po=Symbol.iterator;function En(e){return e===null||typeof e!="object"?null:(e=Po&&e[Po]||e["@@iterator"],typeof e=="function"?e:null)}var Q0=Symbol.for("react.client.reference");function ic(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ql:return"Fragment";case lc:return"Profiler";case Yr:return"StrictMode";case nc:return"Suspense";case ac:return"SuspenseList";case sc:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _n:return"Portal";case kt:return e.displayName||"Context";case Gr:return(e._context.displayName||"Context")+".Consumer";case eo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case to:return t=e.displayName||null,t!==null?t:ic(e.type)||"Memo";case qt:t=e._payload,e=e._init;try{return ic(e(t))}catch{}}return null}var Ln=Array.isArray,R=Hr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=q0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Nl={pending:!1,data:null,method:null,action:null},cc=[],Zl=-1;function gt(e){return{current:e}}function Se(e){0>Zl||(e.current=cc[Zl],cc[Zl]=null,Zl--)}function le(e,t){Zl++,cc[Zl]=e.current,e.current=t}var pt=gt(null),ca=gt(null),Pt=gt(null),ps=gt(null);function gs(e,t){switch(le(Pt,t),le(ca,e),le(pt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sr(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sr(t),e=r0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Se(pt),le(pt,e)}function mn(){Se(pt),Se(ca),Se(Pt)}function oc(e){e.memoizedState!==null&&le(ps,e);var t=pt.current,l=r0(t,e.type);t!==l&&(le(ca,e),le(pt,l))}function ys(e){ca.current===e&&(Se(pt),Se(ca)),ps.current===e&&(Se(ps),ya._currentValue=Nl)}var hi,eu;function gl(e){if(hi===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);hi=t&&t[1]||"",eu=-1<l.stack.indexOf(`
|
|
26
26
|
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
27
|
-
`+
|
|
27
|
+
`+hi+e+eu}var xi=!1;function pi(e,t){if(!e||xi)return"";xi=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[])}catch(g){var m=g}Reflect.construct(e,[],p)}else{try{p.call()}catch(g){m=g}e.call(p.prototype)}}else{try{throw Error()}catch(g){m=g}(p=e())&&typeof p.catch=="function"&&p.catch(function(){})}}catch(g){if(g&&m&&typeof g.stack=="string")return[g.stack,m.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=n.DetermineComponentFrameRoot(),c=s[0],o=s[1];if(c&&o){var u=c.split(`
|
|
28
28
|
`),r=o.split(`
|
|
29
29
|
`);for(a=n=0;n<u.length&&!u[n].includes("DetermineComponentFrameRoot");)n++;for(;a<r.length&&!r[a].includes("DetermineComponentFrameRoot");)a++;if(n===u.length||a===r.length)for(n=u.length-1,a=r.length-1;1<=n&&0<=a&&u[n]!==r[a];)a--;for(;1<=n&&0<=a;n--,a--)if(u[n]!==r[a]){if(n!==1||a!==1)do if(n--,a--,0>a||u[n]!==r[a]){var h=`
|
|
30
|
-
`+u[n].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=n&&0<=a);break}}}finally{
|
|
30
|
+
`+u[n].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=n&&0<=a);break}}}finally{xi=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?gl(l):""}function Z0(e,t){switch(e.tag){case 26:case 27:case 5:return gl(e.type);case 16:return gl("Lazy");case 13:return e.child!==t&&t!==null?gl("Suspense Fallback"):gl("Suspense");case 19:return gl("SuspenseList");case 0:case 15:return pi(e.type,!1);case 11:return pi(e.type.render,!1);case 1:return pi(e.type,!0);case 31:return gl("Activity");default:return""}}function tu(e){try{var t="",l=null;do t+=Z0(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
|
|
31
31
|
Error generating stack: `+n.message+`
|
|
32
|
-
`+n.stack}}var oc=Object.prototype.hasOwnProperty,to=ve.unstable_scheduleCallback,pi=ve.unstable_cancelCallback,Z0=ve.unstable_shouldYield,V0=ve.unstable_requestPaint,Qe=ve.unstable_now,J0=ve.unstable_getCurrentPriorityLevel,Gr=ve.unstable_ImmediatePriority,Xr=ve.unstable_UserBlockingPriority,ys=ve.unstable_NormalPriority,K0=ve.unstable_LowPriority,Qr=ve.unstable_IdlePriority,F0=ve.log,W0=ve.unstable_setDisableYieldValue,ja=null,Ze=null;function Jt(e){if(typeof F0=="function"&&W0(e),Ze&&typeof Ze.setStrictMode=="function")try{Ze.setStrictMode(ja,e)}catch{}}var Ve=Math.clz32?Math.clz32:em,I0=Math.log,P0=Math.LN2;function em(e){return e>>>=0,e===0?32:31-(I0(e)/P0|0)|0}var Ua=256,Ba=262144,Ra=4194304;function yl(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vs(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var a=0,s=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var o=n&134217727;return o!==0?(n=o&~s,n!==0?a=yl(n):(c&=o,c!==0?a=yl(c):l||(l=o&~e,l!==0&&(a=yl(l))))):(o=n&~s,o!==0?a=yl(o):c!==0?a=yl(c):l||(l=n&~e,l!==0&&(a=yl(l)))),a===0?0:t!==0&&t!==a&&!(t&s)&&(s=a&-a,l=t&-t,s>=l||s===32&&(l&4194048)!==0)?t:a}function Sa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zr(){var e=Ra;return Ra<<=1,!(Ra&62914560)&&(Ra=4194304),e}function gi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Na(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function lm(e,t,l,n,a,s){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var o=e.entanglements,u=e.expirationTimes,r=e.hiddenUpdates;for(l=c&~l;0<l;){var h=31-Ve(l),p=1<<h;o[h]=0,u[h]=-1;var m=r[h];if(m!==null)for(r[h]=null,h=0;h<m.length;h++){var g=m[h];g!==null&&(g.lane&=-536870913)}l&=~p}n!==0&&Vr(e,n,0),s!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=s&~(c&~t))}function Vr(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ve(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function Jr(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-Ve(l),a=1<<n;a&t|e[n]&t&&(e[n]|=t),l&=~a}}function Kr(e,t){var l=t&-t;return l=l&42?1:lo(l),l&(e.suspendedLanes|t)?0:l}function lo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function no(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Fr(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:b0(e.type))}function tu(e,t){var l=V.p;try{return V.p=e,t()}finally{V.p=l}}var hl=Math.random().toString(36).slice(2),ze="__reactFiber$"+hl,He="__reactProps$"+hl,Nn="__reactContainer$"+hl,uc="__reactEvents$"+hl,nm="__reactListeners$"+hl,am="__reactHandles$"+hl,lu="__reactResources$"+hl,za="__reactMarker$"+hl;function ao(e){delete e[ze],delete e[He],delete e[uc],delete e[nm],delete e[am]}function Vl(e){var t=e[ze];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Nn]||l[ze]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ur(e);e!==null;){if(l=e[ze])return l;e=ur(e)}return t}e=l,l=e.parentNode}return null}function zn(e){if(e=e[ze]||e[Nn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ln(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(T(33))}function an(e){var t=e[lu];return t||(t=e[lu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function je(e){e[za]=!0}var Wr=new Set,Ir={};function Ol(e,t){mn(e,t),mn(e+"Capture",t)}function mn(e,t){for(Ir[e]=t,e=0;e<t.length;e++)Wr.add(t[e])}var sm=RegExp("^[: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]*$"),nu={},au={};function im(e){return oc.call(au,e)?!0:oc.call(nu,e)?!1:sm.test(e)?au[e]=!0:(nu[e]=!0,!1)}function Ia(e,t,l){if(im(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Ha(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function bt(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function Pe(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cm(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(c){l=""+c,s.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rc(e){if(!e._valueTracker){var t=Pr(e)?"checked":"value";e._valueTracker=cm(e,t,""+e[t])}}function ef(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=Pr(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function vs(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}}var om=/[\n"\\]/g;function lt(e){return e.replace(om,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function fc(e,t,l,n,a,s,c,o){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pe(t)):e.value!==""+Pe(t)&&(e.value=""+Pe(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?dc(e,c,Pe(t)):l!=null?dc(e,c,Pe(l)):n!=null&&e.removeAttribute("value"),a==null&&s!=null&&(e.defaultChecked=!!s),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Pe(o):e.removeAttribute("name")}function tf(e,t,l,n,a,s,c,o){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||l!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){rc(e);return}l=l!=null?""+Pe(l):"",t=t!=null?""+Pe(t):l,o||t===e.value||(e.value=t),e.defaultValue=t}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=o?e.checked:!!n,e.defaultChecked=!!n,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),rc(e)}function dc(e,t,l){t==="number"&&vs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function sn(e,t,l,n){if(e=e.options,t){t={};for(var a=0;a<l.length;a++)t["$"+l[a]]=!0;for(l=0;l<e.length;l++)a=t.hasOwnProperty("$"+e[l].value),e[l].selected!==a&&(e[l].selected=a),a&&n&&(e[l].defaultSelected=!0)}else{for(l=""+Pe(l),t=null,a=0;a<e.length;a++){if(e[a].value===l){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function lf(e,t,l){if(t!=null&&(t=""+Pe(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Pe(l):""}function nf(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(T(92));if(_n(n)){if(1<n.length)throw Error(T(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Pe(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),rc(e)}function hn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var um=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function su(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||um.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function af(e,t,l){if(t!=null&&typeof t!="object")throw Error(T(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var a in t)n=t[a],t.hasOwnProperty(a)&&l[a]!==n&&su(e,a,n)}else for(var s in t)t.hasOwnProperty(s)&&su(e,s,t[s])}function so(e){if(e.indexOf("-")===-1)return!1;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 rm=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),fm=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Pa(e){return fm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function wt(){}var mc=null;function io(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jl=null,cn=null;function iu(e){var t=zn(e);if(t&&(e=t.stateNode)){var l=e[He]||null;e:switch(e=t.stateNode,t.type){case"input":if(fc(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+lt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var a=n[He]||null;if(!a)throw Error(T(90));fc(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&ef(n)}break e;case"textarea":lf(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&sn(e,!!l.multiple,t,!1)}}}var yi=!1;function sf(e,t,l){if(yi)return e(t,l);yi=!0;try{var n=e(t);return n}finally{if(yi=!1,(Jl!==null||cn!==null)&&(si(),Jl&&(t=Jl,e=cn,cn=Jl=null,iu(t),e)))for(t=0;t<e.length;t++)iu(e[t])}}function ca(e,t){var l=e.stateNode;if(l===null)return null;var n=l[He]||null;if(n===null)return null;l=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(T(231,t,typeof l));return l}var Ot=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hc=!1;if(Ot)try{var En={};Object.defineProperty(En,"passive",{get:function(){hc=!0}}),window.addEventListener("test",En,En),window.removeEventListener("test",En,En)}catch{hc=!1}var Kt=null,co=null,es=null;function cf(){if(es)return es;var e,t=co,l=t.length,n,a="value"in Kt?Kt.value:Kt.textContent,s=a.length;for(e=0;e<l&&t[e]===a[e];e++);var c=l-e;for(n=1;n<=c&&t[l-n]===a[s-n];n++);return es=a.slice(e,1<n?1-n:void 0)}function ts(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 _a(){return!0}function cu(){return!1}function _e(e){function t(l,n,a,s,c){this._reactName=l,this._targetInst=a,this.type=n,this.nativeEvent=s,this.target=c,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(l=e[o],this[o]=l?l(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?_a:cu,this.isPropagationStopped=cu,this}return se(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=_a)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=_a)},persist:function(){},isPersistent:_a}),t}var Ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Js=_e(Ul),Ca=se({},Ul,{view:0,detail:0}),dm=_e(Ca),vi,bi,Dn,Ks=se({},Ca,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oo,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"?(vi=e.screenX-Dn.screenX,bi=e.screenY-Dn.screenY):bi=vi=0,Dn=e),vi)},movementY:function(e){return"movementY"in e?e.movementY:bi}}),ou=_e(Ks),mm=se({},Ks,{dataTransfer:0}),hm=_e(mm),xm=se({},Ca,{relatedTarget:0}),ji=_e(xm),pm=se({},Ul,{animationName:0,elapsedTime:0,pseudoElement:0}),gm=_e(pm),ym=se({},Ul,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vm=_e(ym),bm=se({},Ul,{data:0}),uu=_e(bm),jm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sm={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"},Nm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nm[e])?!!t[e]:!1}function oo(){return zm}var Cm=se({},Ca,{key:function(e){if(e.key){var t=jm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ts(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oo,charCode:function(e){return e.type==="keypress"?ts(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ts(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Tm=_e(Cm),km=se({},Ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ru=_e(km),wm=se({},Ca,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oo}),Am=_e(wm),Mm=se({},Ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),Em=_e(Mm),Dm=se({},Ks,{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}),Om=_e(Dm),Um=se({},Ul,{newState:0,oldState:0}),Bm=_e(Um),Rm=[9,13,27,32],uo=Ot&&"CompositionEvent"in window,Vn=null;Ot&&"documentMode"in document&&(Vn=document.documentMode);var Hm=Ot&&"TextEvent"in window&&!Vn,of=Ot&&(!uo||Vn&&8<Vn&&11>=Vn),fu=" ",du=!1;function uf(e,t){switch(e){case"keyup":return Rm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kl=!1;function _m(e,t){switch(e){case"compositionend":return rf(t);case"keypress":return t.which!==32?null:(du=!0,fu);case"textInput":return e=t.data,e===fu&&du?null:e;default:return null}}function Lm(e,t){if(Kl)return e==="compositionend"||!uo&&uf(e,t)?(e=cf(),es=co=Kt=null,Kl=!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 of&&t.locale!=="ko"?null:t.data;default:return null}}var $m={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 mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$m[e.type]:t==="textarea"}function ff(e,t,l,n){Jl?cn?cn.push(n):cn=[n]:Jl=n,t=Hs(t,"onChange"),0<t.length&&(l=new Js("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var Jn=null,oa=null;function qm(e){i0(e,0)}function Fs(e){var t=Ln(e);if(ef(t))return e}function hu(e,t){if(e==="change")return t}var df=!1;if(Ot){var Si;if(Ot){var Ni="oninput"in document;if(!Ni){var xu=document.createElement("div");xu.setAttribute("oninput","return;"),Ni=typeof xu.oninput=="function"}Si=Ni}else Si=!1;df=Si&&(!document.documentMode||9<document.documentMode)}function pu(){Jn&&(Jn.detachEvent("onpropertychange",mf),oa=Jn=null)}function mf(e){if(e.propertyName==="value"&&Fs(oa)){var t=[];ff(t,oa,e,io(e)),sf(qm,t)}}function Ym(e,t,l){e==="focusin"?(pu(),Jn=t,oa=l,Jn.attachEvent("onpropertychange",mf)):e==="focusout"&&pu()}function Gm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fs(oa)}function Xm(e,t){if(e==="click")return Fs(t)}function Qm(e,t){if(e==="input"||e==="change")return Fs(t)}function Zm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ke=typeof Object.is=="function"?Object.is:Zm;function ua(e,t){if(Ke(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var a=l[n];if(!oc.call(t,a)||!Ke(e[a],t[a]))return!1}return!0}function gu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yu(e,t){var l=gu(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=gu(l)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=vs(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=vs(e.document)}return t}function ro(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")}var Vm=Ot&&"documentMode"in document&&11>=document.documentMode,Fl=null,xc=null,Kn=null,pc=!1;function vu(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;pc||Fl==null||Fl!==vs(n)||(n=Fl,"selectionStart"in n&&ro(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Kn&&ua(Kn,n)||(Kn=n,n=Hs(xc,"onSelect"),0<n.length&&(t=new Js("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=Fl)))}function pl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Wl={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionrun:pl("Transition","TransitionRun"),transitionstart:pl("Transition","TransitionStart"),transitioncancel:pl("Transition","TransitionCancel"),transitionend:pl("Transition","TransitionEnd")},zi={},pf={};Ot&&(pf=document.createElement("div").style,"AnimationEvent"in window||(delete Wl.animationend.animation,delete Wl.animationiteration.animation,delete Wl.animationstart.animation),"TransitionEvent"in window||delete Wl.transitionend.transition);function Bl(e){if(zi[e])return zi[e];if(!Wl[e])return e;var t=Wl[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in pf)return zi[e]=t[l];return e}var gf=Bl("animationend"),yf=Bl("animationiteration"),vf=Bl("animationstart"),Jm=Bl("transitionrun"),Km=Bl("transitionstart"),Fm=Bl("transitioncancel"),bf=Bl("transitionend"),jf=new Map,gc="abort auxClick beforeToggle 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(" ");gc.push("scrollEnd");function dt(e,t){jf.set(e,t),Ol(t,[e])}var bs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ie=[],Il=0,fo=0;function Ws(){for(var e=Il,t=fo=Il=0;t<e;){var l=Ie[t];Ie[t++]=null;var n=Ie[t];Ie[t++]=null;var a=Ie[t];Ie[t++]=null;var s=Ie[t];if(Ie[t++]=null,n!==null&&a!==null){var c=n.pending;c===null?a.next=a:(a.next=c.next,c.next=a),n.pending=a}s!==0&&Sf(l,a,s)}}function Is(e,t,l,n){Ie[Il++]=e,Ie[Il++]=t,Ie[Il++]=l,Ie[Il++]=n,fo|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function mo(e,t,l,n){return Is(e,t,l,n),js(e)}function Rl(e,t){return Is(e,null,null,t),js(e)}function Sf(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var a=!1,s=e.return;s!==null;)s.childLanes|=l,n=s.alternate,n!==null&&(n.childLanes|=l),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(a=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,a&&t!==null&&(a=31-Ve(l),e=s.hiddenUpdates,n=e[a],n===null?e[a]=[t]:n.push(t),t.lane=l|536870912),s):null}function js(e){if(50<aa)throw aa=0,_c=null,Error(T(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pl={};function Wm(e,t,l,n){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ge(e,t,l,n){return new Wm(e,t,l,n)}function ho(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mt(e,t){var l=e.alternate;return l===null?(l=Ge(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Nf(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ls(e,t,l,n,a,s){var c=0;if(n=e,typeof e=="function")ho(e)&&(c=1);else if(typeof e=="string")c=lx(e,l,pt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ac:return e=Ge(31,l,t,a),e.elementType=ac,e.lanes=s,e;case Ql:return zl(l.children,a,s,t);case qr:c=8,a|=24;break;case tc:return e=Ge(12,l,t,a|2),e.elementType=tc,e.lanes=s,e;case lc:return e=Ge(13,l,t,a),e.elementType=lc,e.lanes=s,e;case nc:return e=Ge(19,l,t,a),e.elementType=nc,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kt:c=10;break e;case Yr:c=9;break e;case Pc:c=11;break e;case eo:c=14;break e;case qt:c=16,n=null;break e}c=29,l=Error(T(130,e===null?"null":typeof e,"")),n=null}return t=Ge(c,l,t,a),t.elementType=e,t.type=n,t.lanes=s,t}function zl(e,t,l,n){return e=Ge(7,e,n,t),e.lanes=l,e}function Ci(e,t,l){return e=Ge(6,e,null,t),e.lanes=l,e}function zf(e){var t=Ge(18,null,null,0);return t.stateNode=e,t}function Ti(e,t,l){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bu=new WeakMap;function nt(e,t){if(typeof e=="object"&&e!==null){var l=bu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:eu(t)},bu.set(e,t),t)}return{value:e,source:t,stack:eu(t)}}var en=[],tn=0,Ss=null,ra=0,et=[],tt=0,ol=null,mt=1,ht="";function Ct(e,t){en[tn++]=ra,en[tn++]=Ss,Ss=e,ra=t}function Cf(e,t,l){et[tt++]=mt,et[tt++]=ht,et[tt++]=ol,ol=e;var n=mt;e=ht;var a=32-Ve(n)-1;n&=~(1<<a),l+=1;var s=32-Ve(t)+a;if(30<s){var c=a-a%5;s=(n&(1<<c)-1).toString(32),n>>=c,a-=c,mt=1<<32-Ve(t)+a|l<<a|n,ht=s+e}else mt=1<<s|l<<a|n,ht=e}function xo(e){e.return!==null&&(Ct(e,1),Cf(e,1,0))}function po(e){for(;e===Ss;)Ss=en[--tn],en[tn]=null,ra=en[--tn],en[tn]=null;for(;e===ol;)ol=et[--tt],et[tt]=null,ht=et[--tt],et[tt]=null,mt=et[--tt],et[tt]=null}function Tf(e,t){et[tt++]=mt,et[tt++]=ht,et[tt++]=ol,mt=t.id,ht=t.overflow,ol=e}var Ce=null,ae=null,Q=!1,el=null,at=!1,yc=Error(T(519));function ul(e){var t=Error(T(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw fa(nt(t,e)),yc}function ju(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[ze]=e,t[He]=n,l){case"dialog":q("cancel",t),q("close",t);break;case"iframe":case"object":case"embed":q("load",t);break;case"video":case"audio":for(l=0;l<xa.length;l++)q(xa[l],t);break;case"source":q("error",t);break;case"img":case"image":case"link":q("error",t),q("load",t);break;case"details":q("toggle",t);break;case"input":q("invalid",t),tf(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":q("invalid",t);break;case"textarea":q("invalid",t),nf(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||o0(t.textContent,l)?(n.popover!=null&&(q("beforetoggle",t),q("toggle",t)),n.onScroll!=null&&q("scroll",t),n.onScrollEnd!=null&&q("scrollend",t),n.onClick!=null&&(t.onclick=wt),t=!0):t=!1,t||ul(e,!0)}function Su(e){for(Ce=e.return;Ce;)switch(Ce.tag){case 5:case 31:case 13:at=!1;return;case 27:case 3:at=!0;return;default:Ce=Ce.return}}function Ll(e){if(e!==Ce)return!1;if(!Q)return Su(e),Q=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Gc(e.type,e.memoizedProps)),l=!l),l&&ae&&ul(e),Su(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));ae=or(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));ae=or(e)}else t===27?(t=ae,xl(e.type)?(e=Vc,Vc=null,ae=e):ae=t):ae=Ce?ct(e.stateNode.nextSibling):null;return!0}function wl(){ae=Ce=null,Q=!1}function ki(){var e=el;return e!==null&&(Be===null?Be=e:Be.push.apply(Be,e),el=null),e}function fa(e){el===null?el=[e]:el.push(e)}var vc=gt(null),Hl=null,At=null;function Gt(e,t,l){le(vc,t._currentValue),t._currentValue=l}function Et(e){e._currentValue=vc.current,Se(vc)}function bc(e,t,l){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===l)break;e=e.return}}function jc(e,t,l,n){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){var c=a.child;s=s.firstContext;e:for(;s!==null;){var o=s;s=a;for(var u=0;u<t.length;u++)if(o.context===t[u]){s.lanes|=l,o=s.alternate,o!==null&&(o.lanes|=l),bc(s.return,l,e),n||(c=null);break e}s=o.next}}else if(a.tag===18){if(c=a.return,c===null)throw Error(T(341));c.lanes|=l,s=c.alternate,s!==null&&(s.lanes|=l),bc(c,l,e),c=null}else c=a.child;if(c!==null)c.return=a;else for(c=a;c!==null;){if(c===e){c=null;break}if(a=c.sibling,a!==null){a.return=c.return,c=a;break}c=c.return}a=c}}function Cn(e,t,l,n){e=null;for(var a=t,s=!1;a!==null;){if(!s){if(a.flags&524288)s=!0;else if(a.flags&262144)break}if(a.tag===10){var c=a.alternate;if(c===null)throw Error(T(387));if(c=c.memoizedProps,c!==null){var o=a.type;Ke(a.pendingProps.value,c.value)||(e!==null?e.push(o):e=[o])}}else if(a===xs.current){if(c=a.alternate,c===null)throw Error(T(387));c.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(ga):e=[ga])}a=a.return}e!==null&&jc(t,e,l,n),t.flags|=262144}function Ns(e){for(e=e.firstContext;e!==null;){if(!Ke(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Al(e){Hl=e,At=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Te(e){return kf(Hl,e)}function La(e,t){return Hl===null&&Al(e),kf(e,t)}function kf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},At===null){if(e===null)throw Error(T(308));At=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else At=At.next=t;return l}var Im=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Pm=ve.unstable_scheduleCallback,eh=ve.unstable_NormalPriority,xe={$$typeof:kt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function go(){return{controller:new Im,data:new Map,refCount:0}}function Ta(e){e.refCount--,e.refCount===0&&Pm(eh,function(){e.controller.abort()})}var Fn=null,Sc=0,xn=0,on=null;function th(e,t){if(Fn===null){var l=Fn=[];Sc=0,xn=Yo(),on={status:"pending",value:void 0,then:function(n){l.push(n)}}}return Sc++,t.then(Nu,Nu),t}function Nu(){if(--Sc===0&&Fn!==null){on!==null&&(on.status="fulfilled");var e=Fn;Fn=null,xn=0,on=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function lh(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(a){l.push(a)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var a=0;a<l.length;a++)(0,l[a])(t)},function(a){for(n.status="rejected",n.reason=a,a=0;a<l.length;a++)(0,l[a])(void 0)}),n}var zu=R.S;R.S=function(e,t){qd=Qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&th(e,t),zu!==null&&zu(e,t)};var Cl=gt(null);function yo(){var e=Cl.current;return e!==null?e:ee.pooledCache}function ns(e,t){t===null?le(Cl,Cl.current):le(Cl,t.pool)}function wf(){var e=yo();return e===null?null:{parent:xe._currentValue,pool:e}}var Tn=Error(T(460)),vo=Error(T(474)),Ps=Error(T(542)),zs={then:function(){}};function Cu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Af(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(wt,wt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ku(e),e;default:if(typeof t.status=="string")t.then(wt,wt);else{if(e=ee,e!==null&&100<e.shellSuspendCounter)throw Error(T(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=n}},function(n){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ku(e),e}throw Tl=t,Tn}}function vl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Tl=l,Tn):l}}var Tl=null;function Tu(){if(Tl===null)throw Error(T(459));var e=Tl;return Tl=null,e}function ku(e){if(e===Tn||e===Ps)throw Error(T(483))}var un=null,da=0;function $a(e){var t=da;return da+=1,un===null&&(un=[]),Af(un,e,t)}function On(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qa(e,t){throw t.$$typeof===Y0?Error(T(525)):(e=Object.prototype.toString.call(t),Error(T(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Mf(e){function t(f,d){if(e){var x=f.deletions;x===null?(f.deletions=[d],f.flags|=16):x.push(d)}}function l(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function n(f){for(var d=new Map;f!==null;)f.key!==null?d.set(f.key,f):d.set(f.index,f),f=f.sibling;return d}function a(f,d){return f=Mt(f,d),f.index=0,f.sibling=null,f}function s(f,d,x){return f.index=x,e?(x=f.alternate,x!==null?(x=x.index,x<d?(f.flags|=67108866,d):x):(f.flags|=67108866,d)):(f.flags|=1048576,d)}function c(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function o(f,d,x,v){return d===null||d.tag!==6?(d=Ci(x,f.mode,v),d.return=f,d):(d=a(d,x),d.return=f,d)}function u(f,d,x,v){var S=x.type;return S===Ql?h(f,d,x.props.children,v,x.key):d!==null&&(d.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===qt&&vl(S)===d.type)?(d=a(d,x.props),On(d,x),d.return=f,d):(d=ls(x.type,x.key,x.props,null,f.mode,v),On(d,x),d.return=f,d)}function r(f,d,x,v){return d===null||d.tag!==4||d.stateNode.containerInfo!==x.containerInfo||d.stateNode.implementation!==x.implementation?(d=Ti(x,f.mode,v),d.return=f,d):(d=a(d,x.children||[]),d.return=f,d)}function h(f,d,x,v,S){return d===null||d.tag!==7?(d=zl(x,f.mode,v,S),d.return=f,d):(d=a(d,x),d.return=f,d)}function p(f,d,x){if(typeof d=="string"&&d!==""||typeof d=="number"||typeof d=="bigint")return d=Ci(""+d,f.mode,x),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Oa:return x=ls(d.type,d.key,d.props,null,f.mode,x),On(x,d),x.return=f,x;case Hn:return d=Ti(d,f.mode,x),d.return=f,d;case qt:return d=vl(d),p(f,d,x)}if(_n(d)||Mn(d))return d=zl(d,f.mode,x,null),d.return=f,d;if(typeof d.then=="function")return p(f,$a(d),x);if(d.$$typeof===kt)return p(f,La(f,d),x);qa(f,d)}return null}function m(f,d,x,v){var S=d!==null?d.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return S!==null?null:o(f,d,""+x,v);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Oa:return x.key===S?u(f,d,x,v):null;case Hn:return x.key===S?r(f,d,x,v):null;case qt:return x=vl(x),m(f,d,x,v)}if(_n(x)||Mn(x))return S!==null?null:h(f,d,x,v,null);if(typeof x.then=="function")return m(f,d,$a(x),v);if(x.$$typeof===kt)return m(f,d,La(f,x),v);qa(f,x)}return null}function g(f,d,x,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return f=f.get(x)||null,o(d,f,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Oa:return f=f.get(v.key===null?x:v.key)||null,u(d,f,v,S);case Hn:return f=f.get(v.key===null?x:v.key)||null,r(d,f,v,S);case qt:return v=vl(v),g(f,d,x,v,S)}if(_n(v)||Mn(v))return f=f.get(x)||null,h(d,f,v,S,null);if(typeof v.then=="function")return g(f,d,x,$a(v),S);if(v.$$typeof===kt)return g(f,d,x,La(d,v),S);qa(d,v)}return null}function y(f,d,x,v){for(var S=null,z=null,N=d,M=d=0,A=null;N!==null&&M<x.length;M++){N.index>M?(A=N,N=null):A=N.sibling;var D=m(f,N,x[M],v);if(D===null){N===null&&(N=A);break}e&&N&&D.alternate===null&&t(f,N),d=s(D,d,M),z===null?S=D:z.sibling=D,z=D,N=A}if(M===x.length)return l(f,N),Q&&Ct(f,M),S;if(N===null){for(;M<x.length;M++)N=p(f,x[M],v),N!==null&&(d=s(N,d,M),z===null?S=N:z.sibling=N,z=N);return Q&&Ct(f,M),S}for(N=n(N);M<x.length;M++)A=g(N,f,M,x[M],v),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?M:A.key),d=s(A,d,M),z===null?S=A:z.sibling=A,z=A);return e&&N.forEach(function(X){return t(f,X)}),Q&&Ct(f,M),S}function j(f,d,x,v){if(x==null)throw Error(T(151));for(var S=null,z=null,N=d,M=d=0,A=null,D=x.next();N!==null&&!D.done;M++,D=x.next()){N.index>M?(A=N,N=null):A=N.sibling;var X=m(f,N,D.value,v);if(X===null){N===null&&(N=A);break}e&&N&&X.alternate===null&&t(f,N),d=s(X,d,M),z===null?S=X:z.sibling=X,z=X,N=A}if(D.done)return l(f,N),Q&&Ct(f,M),S;if(N===null){for(;!D.done;M++,D=x.next())D=p(f,D.value,v),D!==null&&(d=s(D,d,M),z===null?S=D:z.sibling=D,z=D);return Q&&Ct(f,M),S}for(N=n(N);!D.done;M++,D=x.next())D=g(N,f,M,D.value,v),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?M:D.key),d=s(D,d,M),z===null?S=D:z.sibling=D,z=D);return e&&N.forEach(function(te){return t(f,te)}),Q&&Ct(f,M),S}function b(f,d,x,v){if(typeof x=="object"&&x!==null&&x.type===Ql&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Oa:e:{for(var S=x.key;d!==null;){if(d.key===S){if(S=x.type,S===Ql){if(d.tag===7){l(f,d.sibling),v=a(d,x.props.children),v.return=f,f=v;break e}}else if(d.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===qt&&vl(S)===d.type){l(f,d.sibling),v=a(d,x.props),On(v,x),v.return=f,f=v;break e}l(f,d);break}else t(f,d);d=d.sibling}x.type===Ql?(v=zl(x.props.children,f.mode,v,x.key),v.return=f,f=v):(v=ls(x.type,x.key,x.props,null,f.mode,v),On(v,x),v.return=f,f=v)}return c(f);case Hn:e:{for(S=x.key;d!==null;){if(d.key===S)if(d.tag===4&&d.stateNode.containerInfo===x.containerInfo&&d.stateNode.implementation===x.implementation){l(f,d.sibling),v=a(d,x.children||[]),v.return=f,f=v;break e}else{l(f,d);break}else t(f,d);d=d.sibling}v=Ti(x,f.mode,v),v.return=f,f=v}return c(f);case qt:return x=vl(x),b(f,d,x,v)}if(_n(x))return y(f,d,x,v);if(Mn(x)){if(S=Mn(x),typeof S!="function")throw Error(T(150));return x=S.call(x),j(f,d,x,v)}if(typeof x.then=="function")return b(f,d,$a(x),v);if(x.$$typeof===kt)return b(f,d,La(f,x),v);qa(f,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,d!==null&&d.tag===6?(l(f,d.sibling),v=a(d,x),v.return=f,f=v):(l(f,d),v=Ci(x,f.mode,v),v.return=f,f=v),c(f)):l(f,d)}return function(f,d,x,v){try{da=0;var S=b(f,d,x,v);return un=null,S}catch(N){if(N===Tn||N===Ps)throw N;var z=Ge(29,N,null,f.mode);return z.lanes=v,z.return=f,z}finally{}}}var Ml=Mf(!0),Ef=Mf(!1),Yt=!1;function bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function tl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ll(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Z&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,t=js(e),Sf(e,null,l),t}return Is(e,n,t,l),js(e)}function Wn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,Jr(e,l)}}function wi(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,s=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};s===null?a=s=c:s=s.next=c,l=l.next}while(l!==null);s===null?a=s=t:s=s.next=t}else a=s=t;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var zc=!1;function In(){if(zc){var e=on;if(e!==null)throw e}}function Pn(e,t,l,n){zc=!1;var a=e.updateQueue;Yt=!1;var s=a.firstBaseUpdate,c=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var u=o,r=u.next;u.next=null,c===null?s=r:c.next=r,c=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==c&&(o===null?h.firstBaseUpdate=r:o.next=r,h.lastBaseUpdate=u))}if(s!==null){var p=a.baseState;c=0,h=r=u=null,o=s;do{var m=o.lane&-536870913,g=m!==o.lane;if(g?(G&m)===m:(n&m)===m){m!==0&&m===xn&&(zc=!0),h!==null&&(h=h.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=e,j=o;m=t;var b=l;switch(j.tag){case 1:if(y=j.payload,typeof y=="function"){p=y.call(b,p,m);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=j.payload,m=typeof y=="function"?y.call(b,p,m):y,m==null)break e;p=se({},p,m);break e;case 2:Yt=!0}}m=o.callback,m!==null&&(e.flags|=64,g&&(e.flags|=8192),g=a.callbacks,g===null?a.callbacks=[m]:g.push(m))}else g={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(r=h=g,u=p):h=h.next=g,c|=m;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;g=o,o=g.next,g.next=null,a.lastBaseUpdate=g,a.shared.pending=null}}while(!0);h===null&&(u=p),a.baseState=u,a.firstBaseUpdate=r,a.lastBaseUpdate=h,s===null&&(a.shared.lanes=0),fl|=c,e.lanes=c,e.memoizedState=p}}function Df(e,t){if(typeof e!="function")throw Error(T(191,e));e.call(t)}function Of(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Df(l[e],t)}var pn=gt(null),Cs=gt(0);function wu(e,t){e=Ht,le(Cs,e),le(pn,t),Ht=e|t.baseLanes}function Cc(){le(Cs,Ht),le(pn,pn.current)}function jo(){Ht=Cs.current,Se(pn),Se(Cs)}var Fe=gt(null),it=null;function Xt(e){var t=e.alternate;le(re,re.current&1),le(Fe,e),it===null&&(t===null||pn.current!==null||t.memoizedState!==null)&&(it=e)}function Tc(e){le(re,re.current),le(Fe,e),it===null&&(it=e)}function Uf(e){e.tag===22?(le(re,re.current),le(Fe,e),it===null&&(it=e)):Qt()}function Qt(){le(re,re.current),le(Fe,Fe.current)}function Ye(e){Se(Fe),it===e&&(it=null),Se(re)}var re=gt(0);function Ts(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Qc(l)||Zc(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 Ut=0,L=null,P=null,me=null,ks=!1,rn=!1,El=!1,ws=0,ma=0,fn=null,nh=0;function oe(){throw Error(T(321))}function So(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Ke(e[l],t[l]))return!1;return!0}function No(e,t,l,n,a,s){return Ut=s,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?fd:Uo,El=!1,s=l(n,a),El=!1,rn&&(s=Rf(t,l,n,a)),Bf(e),s}function Bf(e){R.H=ha;var t=P!==null&&P.next!==null;if(Ut=0,me=P=L=null,ks=!1,ma=0,fn=null,t)throw Error(T(300));e===null||pe||(e=e.dependencies,e!==null&&Ns(e)&&(pe=!0))}function Rf(e,t,l,n){L=e;var a=0;do{if(rn&&(fn=null),ma=0,rn=!1,25<=a)throw Error(T(301));if(a+=1,me=P=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}R.H=dd,s=t(l,n)}while(rn);return s}function ah(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?ka(t):t,e=e.useState()[0],(P!==null?P.memoizedState:null)!==e&&(L.flags|=1024),t}function zo(){var e=ws!==0;return ws=0,e}function Co(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function To(e){if(ks){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ks=!1}Ut=0,me=P=L=null,rn=!1,ma=ws=0,fn=null}function Me(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return me===null?L.memoizedState=me=e:me=me.next=e,me}function fe(){if(P===null){var e=L.alternate;e=e!==null?e.memoizedState:null}else e=P.next;var t=me===null?L.memoizedState:me.next;if(t!==null)me=t,P=e;else{if(e===null)throw L.alternate===null?Error(T(467)):Error(T(310));P=e,e={memoizedState:P.memoizedState,baseState:P.baseState,baseQueue:P.baseQueue,queue:P.queue,next:null},me===null?L.memoizedState=me=e:me=me.next=e}return me}function ei(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ka(e){var t=ma;return ma+=1,fn===null&&(fn=[]),e=Af(fn,e,t),t=L,(me===null?t.memoizedState:me.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?fd:Uo),e}function ti(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ka(e);if(e.$$typeof===kt)return Te(e)}throw Error(T(438,String(e)))}function ko(e){var t=null,l=L.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=L.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=ei(),L.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=G0;return t.index++,l}function Bt(e,t){return typeof t=="function"?t(e):t}function as(e){var t=fe();return wo(t,P,e)}function wo(e,t,l){var n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=l;var a=e.baseQueue,s=n.pending;if(s!==null){if(a!==null){var c=a.next;a.next=s.next,s.next=c}t.baseQueue=a=s,n.pending=null}if(s=e.baseState,a===null)e.memoizedState=s;else{t=a.next;var o=c=null,u=null,r=t,h=!1;do{var p=r.lane&-536870913;if(p!==r.lane?(G&p)===p:(Ut&p)===p){var m=r.revertLane;if(m===0)u!==null&&(u=u.next={lane:0,revertLane:0,gesture:null,action:r.action,hasEagerState:r.hasEagerState,eagerState:r.eagerState,next:null}),p===xn&&(h=!0);else if((Ut&m)===m){r=r.next,m===xn&&(h=!0);continue}else p={lane:0,revertLane:r.revertLane,gesture:null,action:r.action,hasEagerState:r.hasEagerState,eagerState:r.eagerState,next:null},u===null?(o=u=p,c=s):u=u.next=p,L.lanes|=m,fl|=m;p=r.action,El&&l(s,p),s=r.hasEagerState?r.eagerState:l(s,p)}else m={lane:p,revertLane:r.revertLane,gesture:r.gesture,action:r.action,hasEagerState:r.hasEagerState,eagerState:r.eagerState,next:null},u===null?(o=u=m,c=s):u=u.next=m,L.lanes|=p,fl|=p;r=r.next}while(r!==null&&r!==t);if(u===null?c=s:u.next=o,!Ke(s,e.memoizedState)&&(pe=!0,h&&(l=on,l!==null)))throw l;e.memoizedState=s,e.baseState=c,e.baseQueue=u,n.lastRenderedState=s}return a===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Ai(e){var t=fe(),l=t.queue;if(l===null)throw Error(T(311));l.lastRenderedReducer=e;var n=l.dispatch,a=l.pending,s=t.memoizedState;if(a!==null){l.pending=null;var c=a=a.next;do s=e(s,c.action),c=c.next;while(c!==a);Ke(s,t.memoizedState)||(pe=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),l.lastRenderedState=s}return[s,n]}function Hf(e,t,l){var n=L,a=fe(),s=Q;if(s){if(l===void 0)throw Error(T(407));l=l()}else l=t();var c=!Ke((P||a).memoizedState,l);if(c&&(a.memoizedState=l,pe=!0),a=a.queue,Ao($f.bind(null,n,a,e),[e]),a.getSnapshot!==t||c||me!==null&&me.memoizedState.tag&1){if(n.flags|=2048,gn(9,{destroy:void 0},Lf.bind(null,n,a,l,t),null),ee===null)throw Error(T(349));s||Ut&127||_f(n,t,l)}return l}function _f(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=L.updateQueue,t===null?(t=ei(),L.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Lf(e,t,l,n){t.value=l,t.getSnapshot=n,qf(t)&&Yf(e)}function $f(e,t,l){return l(function(){qf(t)&&Yf(e)})}function qf(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Ke(e,l)}catch{return!0}}function Yf(e){var t=Rl(e,2);t!==null&&Re(t,e,2)}function kc(e){var t=Me();if(typeof e=="function"){var l=e;if(e=l(),El){Jt(!0);try{l()}finally{Jt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:e},t}function Gf(e,t,l,n){return e.baseState=l,wo(e,P,typeof n=="function"?n:Bt)}function sh(e,t,l,n,a){if(ni(e))throw Error(T(485));if(e=t.action,e!==null){var s={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){s.listeners.push(c)}};R.T!==null?l(!0):s.isTransition=!1,n(s),l=t.pending,l===null?(s.next=t.pending=s,Xf(t,s)):(s.next=l.next,t.pending=l.next=s)}}function Xf(e,t){var l=t.action,n=t.payload,a=e.state;if(t.isTransition){var s=R.T,c={};R.T=c;try{var o=l(a,n),u=R.S;u!==null&&u(c,o),Au(e,t,o)}catch(r){wc(e,t,r)}finally{s!==null&&c.types!==null&&(s.types=c.types),R.T=s}}else try{s=l(a,n),Au(e,t,s)}catch(r){wc(e,t,r)}}function Au(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Mu(e,t,n)},function(n){return wc(e,t,n)}):Mu(e,t,l)}function Mu(e,t,l){t.status="fulfilled",t.value=l,Qf(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Xf(e,l)))}function wc(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Qf(t),t=t.next;while(t!==n)}e.action=null}function Qf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zf(e,t){return t}function Eu(e,t){if(Q){var l=ee.formState;if(l!==null){e:{var n=L;if(Q){if(ae){t:{for(var a=ae,s=at;a.nodeType!==8;){if(!s){a=null;break t}if(a=ct(a.nextSibling),a===null){a=null;break t}}s=a.data,a=s==="F!"||s==="F"?a:null}if(a){ae=ct(a.nextSibling),n=a.data==="F!";break e}}ul(n)}n=!1}n&&(t=l[0])}}return l=Me(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zf,lastRenderedState:t},l.queue=n,l=od.bind(null,L,n),n.dispatch=l,n=kc(!1),s=Oo.bind(null,L,!1,n.queue),n=Me(),a={state:t,dispatch:null,action:e,pending:null},n.queue=a,l=sh.bind(null,L,a,s,l),a.dispatch=l,n.memoizedState=e,[t,l,!1]}function Du(e){var t=fe();return Vf(t,P,e)}function Vf(e,t,l){if(t=wo(e,t,Zf)[0],e=as(Bt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ka(t)}catch(c){throw c===Tn?Ps:c}else n=t;t=fe();var a=t.queue,s=a.dispatch;return l!==t.memoizedState&&(L.flags|=2048,gn(9,{destroy:void 0},ih.bind(null,a,l),null)),[n,s,e]}function ih(e,t){e.action=t}function Ou(e){var t=fe(),l=P;if(l!==null)return Vf(t,l,e);fe(),t=t.memoizedState,l=fe();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function gn(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=L.updateQueue,t===null&&(t=ei(),L.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function Jf(){return fe().memoizedState}function ss(e,t,l,n){var a=Me();L.flags|=e,a.memoizedState=gn(1|t,{destroy:void 0},l,n===void 0?null:n)}function li(e,t,l,n){var a=fe();n=n===void 0?null:n;var s=a.memoizedState.inst;P!==null&&n!==null&&So(n,P.memoizedState.deps)?a.memoizedState=gn(t,s,l,n):(L.flags|=e,a.memoizedState=gn(1|t,s,l,n))}function Uu(e,t){ss(8390656,8,e,t)}function Ao(e,t){li(2048,8,e,t)}function ch(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=ei(),L.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Kf(e){var t=fe().memoizedState;return ch({ref:t,nextImpl:e}),function(){if(Z&2)throw Error(T(440));return t.impl.apply(void 0,arguments)}}function Ff(e,t){return li(4,2,e,t)}function Wf(e,t){return li(4,4,e,t)}function If(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Pf(e,t,l){l=l!=null?l.concat([e]):null,li(4,4,If.bind(null,t,e),l)}function Mo(){}function ed(e,t){var l=fe();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&So(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function td(e,t){var l=fe();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&So(t,n[1]))return n[0];if(n=e(),El){Jt(!0);try{e()}finally{Jt(!1)}}return l.memoizedState=[n,t],n}function Eo(e,t,l){return l===void 0||Ut&1073741824&&!(G&261930)?e.memoizedState=t:(e.memoizedState=l,e=Gd(),L.lanes|=e,fl|=e,l)}function ld(e,t,l,n){return Ke(l,t)?l:pn.current!==null?(e=Eo(e,l,n),Ke(e,t)||(pe=!0),e):!(Ut&42)||Ut&1073741824&&!(G&261930)?(pe=!0,e.memoizedState=l):(e=Gd(),L.lanes|=e,fl|=e,t)}function nd(e,t,l,n,a){var s=V.p;V.p=s!==0&&8>s?s:8;var c=R.T,o={};R.T=o,Oo(e,!1,t,l);try{var u=a(),r=R.S;if(r!==null&&r(o,u),u!==null&&typeof u=="object"&&typeof u.then=="function"){var h=lh(u,n);ea(e,t,h,Je(e))}else ea(e,t,n,Je(e))}catch(p){ea(e,t,{then:function(){},status:"rejected",reason:p},Je())}finally{V.p=s,c!==null&&o.types!==null&&(c.types=o.types),R.T=c}}function oh(){}function Ac(e,t,l,n){if(e.tag!==5)throw Error(T(476));var a=ad(e).queue;nd(e,a,t,Nl,l===null?oh:function(){return sd(e),l(n)})}function ad(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Nl,baseState:Nl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:Nl},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sd(e){var t=ad(e);t.next===null&&(t=e.alternate.memoizedState),ea(e,t.next.queue,{},Je())}function Do(){return Te(ga)}function id(){return fe().memoizedState}function cd(){return fe().memoizedState}function uh(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Je();e=tl(l);var n=ll(t,e,l);n!==null&&(Re(n,t,l),Wn(n,t,l)),t={cache:go()},e.payload=t;return}t=t.return}}function rh(e,t,l){var n=Je();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ni(e)?ud(t,l):(l=mo(e,t,l,n),l!==null&&(Re(l,e,n),rd(l,t,n)))}function od(e,t,l){var n=Je();ea(e,t,l,n)}function ea(e,t,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ni(e))ud(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var c=t.lastRenderedState,o=s(c,l);if(a.hasEagerState=!0,a.eagerState=o,Ke(o,c))return Is(e,t,a,0),ee===null&&Ws(),!1}catch{}finally{}if(l=mo(e,t,a,n),l!==null)return Re(l,e,n),rd(l,t,n),!0}return!1}function Oo(e,t,l,n){if(n={lane:2,revertLane:Yo(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ni(e)){if(t)throw Error(T(479))}else t=mo(e,l,n,2),t!==null&&Re(t,e,2)}function ni(e){var t=e.alternate;return e===L||t!==null&&t===L}function ud(e,t){rn=ks=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function rd(e,t,l){if(l&4194048){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,Jr(e,l)}}var ha={readContext:Te,use:ti,useCallback:oe,useContext:oe,useEffect:oe,useImperativeHandle:oe,useLayoutEffect:oe,useInsertionEffect:oe,useMemo:oe,useReducer:oe,useRef:oe,useState:oe,useDebugValue:oe,useDeferredValue:oe,useTransition:oe,useSyncExternalStore:oe,useId:oe,useHostTransitionStatus:oe,useFormState:oe,useActionState:oe,useOptimistic:oe,useMemoCache:oe,useCacheRefresh:oe};ha.useEffectEvent=oe;var fd={readContext:Te,use:ti,useCallback:function(e,t){return Me().memoizedState=[e,t===void 0?null:t],e},useContext:Te,useEffect:Uu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,ss(4194308,4,If.bind(null,t,e),l)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var l=Me();t=t===void 0?null:t;var n=e();if(El){Jt(!0);try{e()}finally{Jt(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=Me();if(l!==void 0){var a=l(t);if(El){Jt(!0);try{l(t)}finally{Jt(!1)}}}else a=t;return n.memoizedState=n.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},n.queue=e,e=e.dispatch=rh.bind(null,L,e),[n.memoizedState,e]},useRef:function(e){var t=Me();return e={current:e},t.memoizedState=e},useState:function(e){e=kc(e);var t=e.queue,l=od.bind(null,L,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Mo,useDeferredValue:function(e,t){var l=Me();return Eo(l,e,t)},useTransition:function(){var e=kc(!1);return e=nd.bind(null,L,e.queue,!0,!1),Me().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=L,a=Me();if(Q){if(l===void 0)throw Error(T(407));l=l()}else{if(l=t(),ee===null)throw Error(T(349));G&127||_f(n,t,l)}a.memoizedState=l;var s={value:l,getSnapshot:t};return a.queue=s,Uu($f.bind(null,n,s,e),[e]),n.flags|=2048,gn(9,{destroy:void 0},Lf.bind(null,n,s,l,t),null),l},useId:function(){var e=Me(),t=ee.identifierPrefix;if(Q){var l=ht,n=mt;l=(n&~(1<<32-Ve(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ws++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=nh++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Do,useFormState:Eu,useActionState:Eu,useOptimistic:function(e){var t=Me();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Oo.bind(null,L,!0,l),l.dispatch=t,[e,t]},useMemoCache:ko,useCacheRefresh:function(){return Me().memoizedState=uh.bind(null,L)},useEffectEvent:function(e){var t=Me(),l={impl:e};return t.memoizedState=l,function(){if(Z&2)throw Error(T(440));return l.impl.apply(void 0,arguments)}}},Uo={readContext:Te,use:ti,useCallback:ed,useContext:Te,useEffect:Ao,useImperativeHandle:Pf,useInsertionEffect:Ff,useLayoutEffect:Wf,useMemo:td,useReducer:as,useRef:Jf,useState:function(){return as(Bt)},useDebugValue:Mo,useDeferredValue:function(e,t){var l=fe();return ld(l,P.memoizedState,e,t)},useTransition:function(){var e=as(Bt)[0],t=fe().memoizedState;return[typeof e=="boolean"?e:ka(e),t]},useSyncExternalStore:Hf,useId:id,useHostTransitionStatus:Do,useFormState:Du,useActionState:Du,useOptimistic:function(e,t){var l=fe();return Gf(l,P,e,t)},useMemoCache:ko,useCacheRefresh:cd};Uo.useEffectEvent=Kf;var dd={readContext:Te,use:ti,useCallback:ed,useContext:Te,useEffect:Ao,useImperativeHandle:Pf,useInsertionEffect:Ff,useLayoutEffect:Wf,useMemo:td,useReducer:Ai,useRef:Jf,useState:function(){return Ai(Bt)},useDebugValue:Mo,useDeferredValue:function(e,t){var l=fe();return P===null?Eo(l,e,t):ld(l,P.memoizedState,e,t)},useTransition:function(){var e=Ai(Bt)[0],t=fe().memoizedState;return[typeof e=="boolean"?e:ka(e),t]},useSyncExternalStore:Hf,useId:id,useHostTransitionStatus:Do,useFormState:Ou,useActionState:Ou,useOptimistic:function(e,t){var l=fe();return P!==null?Gf(l,P,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:ko,useCacheRefresh:cd};dd.useEffectEvent=Kf;function Mi(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:se({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Mc={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=Je(),a=tl(n);a.payload=t,l!=null&&(a.callback=l),t=ll(e,a,n),t!==null&&(Re(t,e,n),Wn(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=Je(),a=tl(n);a.tag=1,a.payload=t,l!=null&&(a.callback=l),t=ll(e,a,n),t!==null&&(Re(t,e,n),Wn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Je(),n=tl(l);n.tag=2,t!=null&&(n.callback=t),t=ll(e,n,l),t!==null&&(Re(t,e,l),Wn(t,e,l))}};function Bu(e,t,l,n,a,s,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,c):t.prototype&&t.prototype.isPureReactComponent?!ua(l,n)||!ua(a,s):!0}function Ru(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&Mc.enqueueReplaceState(t,t.state,null)}function Dl(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=se({},l));for(var a in e)l[a]===void 0&&(l[a]=e[a])}return l}function md(e){bs(e)}function hd(e){console.error(e)}function xd(e){bs(e)}function As(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Hu(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Ec(e,t,l){return l=tl(l),l.tag=3,l.payload={element:null},l.callback=function(){As(e,t)},l}function pd(e){return e=tl(e),e.tag=3,e}function gd(e,t,l,n){var a=l.type.getDerivedStateFromError;if(typeof a=="function"){var s=n.value;e.payload=function(){return a(s)},e.callback=function(){Hu(t,l,n)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){Hu(t,l,n),typeof a!="function"&&(nl===null?nl=new Set([this]):nl.add(this));var o=n.stack;this.componentDidCatch(n.value,{componentStack:o!==null?o:""})})}function fh(e,t,l,n,a){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Cn(t,l,a,!0),l=Fe.current,l!==null){switch(l.tag){case 31:case 13:return it===null?Us():l.alternate===null&&ue===0&&(ue=3),l.flags&=-257,l.flags|=65536,l.lanes=a,n===zs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),qi(e,n,a)),!1;case 22:return l.flags|=65536,n===zs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),qi(e,n,a)),!1}throw Error(T(435,l.tag))}return qi(e,n,a),Us(),!1}if(Q)return t=Fe.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,n!==yc&&(e=Error(T(422),{cause:n}),fa(nt(e,l)))):(n!==yc&&(t=Error(T(423),{cause:n}),fa(nt(t,l))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,n=nt(n,l),a=Ec(e.stateNode,n,a),wi(e,a),ue!==4&&(ue=2)),!1;var s=Error(T(520),{cause:n});if(s=nt(s,l),na===null?na=[s]:na.push(s),ue!==4&&(ue=2),t===null)return!0;n=nt(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=a&-a,l.lanes|=e,e=Ec(l.stateNode,n,e),wi(l,e),!1;case 1:if(t=l.type,s=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(nl===null||!nl.has(s))))return l.flags|=65536,a&=-a,l.lanes|=a,a=pd(a),gd(a,e,l,n),wi(l,a),!1}l=l.return}while(l!==null);return!1}var Bo=Error(T(461)),pe=!1;function Ne(e,t,l,n){t.child=e===null?Ef(t,null,l,n):Ml(t,e.child,l,n)}function _u(e,t,l,n,a){l=l.render;var s=t.ref;if("ref"in n){var c={};for(var o in n)o!=="ref"&&(c[o]=n[o])}else c=n;return Al(t),n=No(e,t,l,c,s,a),o=zo(),e!==null&&!pe?(Co(e,t,a),Rt(e,t,a)):(Q&&o&&xo(t),t.flags|=1,Ne(e,t,n,a),t.child)}function Lu(e,t,l,n,a){if(e===null){var s=l.type;return typeof s=="function"&&!ho(s)&&s.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=s,yd(e,t,s,n,a)):(e=ls(l.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Ro(e,a)){var c=s.memoizedProps;if(l=l.compare,l=l!==null?l:ua,l(c,n)&&e.ref===t.ref)return Rt(e,t,a)}return t.flags|=1,e=Mt(s,n),e.ref=t.ref,e.return=t,t.child=e}function yd(e,t,l,n,a){if(e!==null){var s=e.memoizedProps;if(ua(s,n)&&e.ref===t.ref)if(pe=!1,t.pendingProps=n=s,Ro(e,a))e.flags&131072&&(pe=!0);else return t.lanes=e.lanes,Rt(e,t,a)}return Dc(e,t,l,n,a)}function vd(e,t,l,n){var a=n.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if(t.flags&128){if(s=s!==null?s.baseLanes|l:l,e!==null){for(n=t.child=e.child,a=0;n!==null;)a=a|n.lanes|n.childLanes,n=n.sibling;n=a&~s}else n=0,t.child=null;return $u(e,t,s,l,n)}if(l&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ns(t,s!==null?s.cachePool:null),s!==null?wu(t,s):Cc(),Uf(t);else return n=t.lanes=536870912,$u(e,t,s!==null?s.baseLanes|l:l,l,n)}else s!==null?(ns(t,s.cachePool),wu(t,s),Qt(),t.memoizedState=null):(e!==null&&ns(t,null),Cc(),Qt());return Ne(e,t,a,l),t.child}function $n(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $u(e,t,l,n,a){var s=yo();return s=s===null?null:{parent:xe._currentValue,pool:s},t.memoizedState={baseLanes:l,cachePool:s},e!==null&&ns(t,null),Cc(),Uf(t),e!==null&&Cn(e,t,n,!0),t.childLanes=a,null}function is(e,t){return t=Ms({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qu(e,t,l){return Ml(t,e.child,null,l),e=is(t,t.pendingProps),e.flags|=2,Ye(t),t.memoizedState=null,e}function dh(e,t,l){var n=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Q){if(n.mode==="hidden")return e=is(t,n),t.lanes=536870912,$n(null,e);if(Tc(t),(e=ae)?(e=f0(e,at),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:mt,overflow:ht}:null,retryLane:536870912,hydrationErrors:null},l=zf(e),l.return=t,t.child=l,Ce=t,ae=null)):e=null,e===null)throw ul(t);return t.lanes=536870912,null}return is(t,n)}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(Tc(t),a)if(t.flags&256)t.flags&=-257,t=qu(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(T(558));else if(pe||Cn(e,t,l,!1),a=(l&e.childLanes)!==0,pe||a){if(n=ee,n!==null&&(c=Kr(n,l),c!==0&&c!==s.retryLane))throw s.retryLane=c,Rl(e,c),Re(n,e,c),Bo;Us(),t=qu(e,t,l)}else e=s.treeContext,ae=ct(c.nextSibling),Ce=t,Q=!0,el=null,at=!1,e!==null&&Tf(t,e),t=is(t,n),t.flags|=4096;return t}return e=Mt(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cs(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(T(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Dc(e,t,l,n,a){return Al(t),l=No(e,t,l,n,void 0,a),n=zo(),e!==null&&!pe?(Co(e,t,a),Rt(e,t,a)):(Q&&n&&xo(t),t.flags|=1,Ne(e,t,l,a),t.child)}function Yu(e,t,l,n,a,s){return Al(t),t.updateQueue=null,l=Rf(t,n,l,a),Bf(e),n=zo(),e!==null&&!pe?(Co(e,t,s),Rt(e,t,s)):(Q&&n&&xo(t),t.flags|=1,Ne(e,t,l,s),t.child)}function Gu(e,t,l,n,a){if(Al(t),t.stateNode===null){var s=Pl,c=l.contextType;typeof c=="object"&&c!==null&&(s=Te(c)),s=new l(n,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Mc,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=n,s.state=t.memoizedState,s.refs={},bo(t),c=l.contextType,s.context=typeof c=="object"&&c!==null?Te(c):Pl,s.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(Mi(t,l,c,n),s.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(c=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),c!==s.state&&Mc.enqueueReplaceState(s,s.state,null),Pn(t,n,s,a),In(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){s=t.stateNode;var o=t.memoizedProps,u=Dl(l,o);s.props=u;var r=s.context,h=l.contextType;c=Pl,typeof h=="object"&&h!==null&&(c=Te(h));var p=l.getDerivedStateFromProps;h=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o||r!==c)&&Ru(t,s,n,c),Yt=!1;var m=t.memoizedState;s.state=m,Pn(t,n,s,a),In(),r=t.memoizedState,o||m!==r||Yt?(typeof p=="function"&&(Mi(t,l,p,n),r=t.memoizedState),(u=Yt||Bu(t,l,u,n,m,r,c))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=r),s.props=n,s.state=r,s.context=c,n=u):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Nc(e,t),c=t.memoizedProps,h=Dl(l,c),s.props=h,p=t.pendingProps,m=s.context,r=l.contextType,u=Pl,typeof r=="object"&&r!==null&&(u=Te(r)),o=l.getDerivedStateFromProps,(r=typeof o=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(c!==p||m!==u)&&Ru(t,s,n,u),Yt=!1,m=t.memoizedState,s.state=m,Pn(t,n,s,a),In();var g=t.memoizedState;c!==p||m!==g||Yt||e!==null&&e.dependencies!==null&&Ns(e.dependencies)?(typeof o=="function"&&(Mi(t,l,o,n),g=t.memoizedState),(h=Yt||Bu(t,l,h,n,m,g,u)||e!==null&&e.dependencies!==null&&Ns(e.dependencies))?(r||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,g,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,g,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),s.props=n,s.state=g,s.context=u,n=h):(typeof s.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return s=n,cs(e,t),n=(t.flags&128)!==0,s||n?(s=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&n?(t.child=Ml(t,e.child,null,a),t.child=Ml(t,null,l,a)):Ne(e,t,l,a),t.memoizedState=s.state,e=t.child):e=Rt(e,t,a),e}function Xu(e,t,l,n){return wl(),t.flags|=256,Ne(e,t,l,n),t.child}var Ei={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Di(e){return{baseLanes:e,cachePool:wf()}}function Oi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Xe),e}function bd(e,t,l){var n=t.pendingProps,a=!1,s=(t.flags&128)!==0,c;if((c=s)||(c=e!==null&&e.memoizedState===null?!1:(re.current&2)!==0),c&&(a=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(Q){if(a?Xt(t):Qt(),(e=ae)?(e=f0(e,at),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:mt,overflow:ht}:null,retryLane:536870912,hydrationErrors:null},l=zf(e),l.return=t,t.child=l,Ce=t,ae=null)):e=null,e===null)throw ul(t);return Zc(e)?t.lanes=32:t.lanes=536870912,null}var o=n.children;return n=n.fallback,a?(Qt(),a=t.mode,o=Ms({mode:"hidden",children:o},a),n=zl(n,a,l,null),o.return=t,n.return=t,o.sibling=n,t.child=o,n=t.child,n.memoizedState=Di(l),n.childLanes=Oi(e,c,l),t.memoizedState=Ei,$n(null,n)):(Xt(t),Oc(t,o))}var u=e.memoizedState;if(u!==null&&(o=u.dehydrated,o!==null)){if(s)t.flags&256?(Xt(t),t.flags&=-257,t=Ui(e,t,l)):t.memoizedState!==null?(Qt(),t.child=e.child,t.flags|=128,t=null):(Qt(),o=n.fallback,a=t.mode,n=Ms({mode:"visible",children:n.children},a),o=zl(o,a,l,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,Ml(t,e.child,null,l),n=t.child,n.memoizedState=Di(l),n.childLanes=Oi(e,c,l),t.memoizedState=Ei,t=$n(null,n));else if(Xt(t),Zc(o)){if(c=o.nextSibling&&o.nextSibling.dataset,c)var r=c.dgst;c=r,n=Error(T(419)),n.stack="",n.digest=c,fa({value:n,source:null,stack:null}),t=Ui(e,t,l)}else if(pe||Cn(e,t,l,!1),c=(l&e.childLanes)!==0,pe||c){if(c=ee,c!==null&&(n=Kr(c,l),n!==0&&n!==u.retryLane))throw u.retryLane=n,Rl(e,n),Re(c,e,n),Bo;Qc(o)||Us(),t=Ui(e,t,l)}else Qc(o)?(t.flags|=192,t.child=e.child,t=null):(e=u.treeContext,ae=ct(o.nextSibling),Ce=t,Q=!0,el=null,at=!1,e!==null&&Tf(t,e),t=Oc(t,n.children),t.flags|=4096);return t}return a?(Qt(),o=n.fallback,a=t.mode,u=e.child,r=u.sibling,n=Mt(u,{mode:"hidden",children:n.children}),n.subtreeFlags=u.subtreeFlags&65011712,r!==null?o=Mt(r,o):(o=zl(o,a,l,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,$n(null,n),n=t.child,o=e.child.memoizedState,o===null?o=Di(l):(a=o.cachePool,a!==null?(u=xe._currentValue,a=a.parent!==u?{parent:u,pool:u}:a):a=wf(),o={baseLanes:o.baseLanes|l,cachePool:a}),n.memoizedState=o,n.childLanes=Oi(e,c,l),t.memoizedState=Ei,$n(e.child,n)):(Xt(t),l=e.child,e=l.sibling,l=Mt(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function Oc(e,t){return t=Ms({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ms(e,t){return e=Ge(22,e,null,t),e.lanes=0,e}function Ui(e,t,l){return Ml(t,e.child,null,l),e=Oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qu(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),bc(e.return,t,l)}function Bi(e,t,l,n,a,s){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:a,treeForkCount:s}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=n,c.tail=l,c.tailMode=a,c.treeForkCount=s)}function jd(e,t,l){var n=t.pendingProps,a=n.revealOrder,s=n.tail;n=n.children;var c=re.current,o=(c&2)!==0;if(o?(c=c&1|2,t.flags|=128):c&=1,le(re,c),Ne(e,t,n,l),n=Q?ra:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qu(e,l,t);else if(e.tag===19)Qu(e,l,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}switch(a){case"forwards":for(l=t.child,a=null;l!==null;)e=l.alternate,e!==null&&Ts(e)===null&&(a=l),l=l.sibling;l=a,l===null?(a=t.child,t.child=null):(a=l.sibling,l.sibling=null),Bi(t,!1,a,l,s,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ts(e)===null){t.child=a;break}e=a.sibling,a.sibling=l,l=a,a=e}Bi(t,!0,l,null,s,n);break;case"together":Bi(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Rt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),fl|=t.lanes,!(l&t.childLanes))if(e!==null){if(Cn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(T(153));if(t.child!==null){for(e=t.child,l=Mt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Mt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ro(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Ns(e)))}function mh(e,t,l){switch(t.tag){case 3:ps(t,t.stateNode.containerInfo),Gt(t,xe,e.memoizedState.cache),wl();break;case 27:case 5:cc(t);break;case 4:ps(t,t.stateNode.containerInfo);break;case 10:Gt(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Tc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Xt(t),t.flags|=128,null):l&t.child.childLanes?bd(e,t,l):(Xt(t),e=Rt(e,t,l),e!==null?e.sibling:null);Xt(t);break;case 19:var a=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Cn(e,t,l,!1),n=(l&t.childLanes)!==0),a){if(n)return jd(e,t,l);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),le(re,re.current),n)break;return null;case 22:return t.lanes=0,vd(e,t,l,t.pendingProps);case 24:Gt(t,xe,e.memoizedState.cache)}return Rt(e,t,l)}function Sd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)pe=!0;else{if(!Ro(e,l)&&!(t.flags&128))return pe=!1,mh(e,t,l);pe=!!(e.flags&131072)}else pe=!1,Q&&t.flags&1048576&&Cf(t,ra,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=vl(t.elementType),t.type=e,typeof e=="function")ho(e)?(n=Dl(e,n),t.tag=1,t=Gu(null,t,e,n,l)):(t.tag=0,t=Dc(null,t,e,n,l));else{if(e!=null){var a=e.$$typeof;if(a===Pc){t.tag=11,t=_u(null,t,e,n,l);break e}else if(a===eo){t.tag=14,t=Lu(null,t,e,n,l);break e}}throw t=sc(e)||e,Error(T(306,t,""))}}return t;case 0:return Dc(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,a=Dl(n,t.pendingProps),Gu(e,t,n,a,l);case 3:e:{if(ps(t,t.stateNode.containerInfo),e===null)throw Error(T(387));n=t.pendingProps;var s=t.memoizedState;a=s.element,Nc(e,t),Pn(t,n,null,l);var c=t.memoizedState;if(n=c.cache,Gt(t,xe,n),n!==s.cache&&jc(t,[xe],l,!0),In(),n=c.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=Xu(e,t,n,l);break e}else if(n!==a){a=nt(Error(T(424)),t),fa(a),t=Xu(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ae=ct(e.firstChild),Ce=t,Q=!0,el=null,at=!0,l=Ef(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(wl(),n===a){t=Rt(e,t,l);break e}Ne(e,t,n,l)}t=t.child}return t;case 26:return cs(e,t),e===null?(l=fr(t.type,null,t.pendingProps,null))?t.memoizedState=l:Q||(l=t.type,e=t.pendingProps,n=_s(Pt.current).createElement(l),n[ze]=t,n[He]=e,ke(n,l,e),je(n),t.stateNode=n):t.memoizedState=fr(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return cc(t),e===null&&Q&&(n=t.stateNode=d0(t.type,t.pendingProps,Pt.current),Ce=t,at=!0,a=ae,xl(t.type)?(Vc=a,ae=ct(n.firstChild)):ae=a),Ne(e,t,t.pendingProps.children,l),cs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Q&&((a=n=ae)&&(n=Gh(n,t.type,t.pendingProps,at),n!==null?(t.stateNode=n,Ce=t,ae=ct(n.firstChild),at=!1,a=!0):a=!1),a||ul(t)),cc(t),a=t.type,s=t.pendingProps,c=e!==null?e.memoizedProps:null,n=s.children,Gc(a,s)?n=null:c!==null&&Gc(a,c)&&(t.flags|=32),t.memoizedState!==null&&(a=No(e,t,ah,null,null,l),ga._currentValue=a),cs(e,t),Ne(e,t,n,l),t.child;case 6:return e===null&&Q&&((e=l=ae)&&(l=Xh(l,t.pendingProps,at),l!==null?(t.stateNode=l,Ce=t,ae=null,e=!0):e=!1),e||ul(t)),null;case 13:return bd(e,t,l);case 4:return ps(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ml(t,null,n,l):Ne(e,t,n,l),t.child;case 11:return _u(e,t,t.type,t.pendingProps,l);case 7:return Ne(e,t,t.pendingProps,l),t.child;case 8:return Ne(e,t,t.pendingProps.children,l),t.child;case 12:return Ne(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,Gt(t,t.type,n.value),Ne(e,t,n.children,l),t.child;case 9:return a=t.type._context,n=t.pendingProps.children,Al(t),a=Te(a),n=n(a),t.flags|=1,Ne(e,t,n,l),t.child;case 14:return Lu(e,t,t.type,t.pendingProps,l);case 15:return yd(e,t,t.type,t.pendingProps,l);case 19:return jd(e,t,l);case 31:return dh(e,t,l);case 22:return vd(e,t,l,t.pendingProps);case 24:return Al(t),n=Te(xe),e===null?(a=yo(),a===null&&(a=ee,s=go(),a.pooledCache=s,s.refCount++,s!==null&&(a.pooledCacheLanes|=l),a=s),t.memoizedState={parent:n,cache:a},bo(t),Gt(t,xe,a)):(e.lanes&l&&(Nc(e,t),Pn(t,null,null,l),In()),a=e.memoizedState,s=t.memoizedState,a.parent!==n?(a={parent:n,cache:n},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Gt(t,xe,n)):(n=s.cache,Gt(t,xe,n),n!==a.cache&&jc(t,[xe],l,!0))),Ne(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(T(156,t.tag))}function jt(e){e.flags|=4}function Ri(e,t,l,n,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Zd())e.flags|=8192;else throw Tl=zs,vo}else e.flags&=-16777217}function Zu(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!x0(t))if(Zd())e.flags|=8192;else throw Tl=zs,vo}function Ya(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Zr():536870912,e.lanes|=t,yn|=t)}function Un(e,t){if(!Q)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags&65011712,n|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function hh(e,t,l){var n=t.pendingProps;switch(po(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ne(t),null;case 1:return ne(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Et(xe),dn(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?jt(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ki())),ne(t),null;case 26:var a=t.type,s=t.memoizedState;return e===null?(jt(t),s!==null?(ne(t),Zu(t,s)):(ne(t),Ri(t,a,null,n,l))):s?s!==e.memoizedState?(jt(t),ne(t),Zu(t,s)):(ne(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&jt(t),ne(t),Ri(t,a,e,n,l)),null;case 27:if(gs(t),l=Pt.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&jt(t);else{if(!n){if(t.stateNode===null)throw Error(T(166));return ne(t),null}e=pt.current,Ll(t)?ju(t):(e=d0(a,n,l),t.stateNode=e,jt(t))}return ne(t),null;case 5:if(gs(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&jt(t);else{if(!n){if(t.stateNode===null)throw Error(T(166));return ne(t),null}if(s=pt.current,Ll(t))ju(t);else{var c=_s(Pt.current);switch(s){case 1:s=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:s=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":s=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":s=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":s=c.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof n.is=="string"?c.createElement("select",{is:n.is}):c.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s=typeof n.is=="string"?c.createElement(a,{is:n.is}):c.createElement(a)}}s[ze]=t,s[He]=n;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)s.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=s;e:switch(ke(s,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&jt(t)}}return ne(t),Ri(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&jt(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(T(166));if(e=Pt.current,Ll(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,a=Ce,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}e[ze]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||o0(e.nodeValue,l)),e||ul(t,!0)}else e=_s(e).createTextNode(n),e[ze]=t,t.stateNode=e}return ne(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ll(t),l!==null){if(e===null){if(!n)throw Error(T(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(557));e[ze]=t}else wl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ne(t),e=!1}else l=ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Ye(t),t):(Ye(t),null);if(t.flags&128)throw Error(T(558))}return ne(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ll(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(T(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(T(317));a[ze]=t}else wl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ne(t),a=!1}else a=ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ye(t),t):(Ye(t),null)}return Ye(t),t.flags&128?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ya(t,t.updateQueue),ne(t),null);case 4:return dn(),e===null&&Go(t.stateNode.containerInfo),ne(t),null;case 10:return Et(t.type),ne(t),null;case 19:if(Se(re),n=t.memoizedState,n===null)return ne(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)Un(n,!1);else{if(ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ts(e),s!==null){for(t.flags|=128,Un(n,!1),e=s.updateQueue,t.updateQueue=e,Ya(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Nf(l,e),l=l.sibling;return le(re,re.current&1|2),Q&&Ct(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Qe()>Ds&&(t.flags|=128,a=!0,Un(n,!1),t.lanes=4194304)}else{if(!a)if(e=Ts(s),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ya(t,e),Un(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Q)return ne(t),null}else 2*Qe()-n.renderingStartTime>Ds&&l!==536870912&&(t.flags|=128,a=!0,Un(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(e=n.last,e!==null?e.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Qe(),e.sibling=null,l=re.current,le(re,a?l&1|2:l&1),Q&&Ct(t,n.treeForkCount),e):(ne(t),null);case 22:case 23:return Ye(t),jo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?l&536870912&&!(t.flags&128)&&(ne(t),t.subtreeFlags&6&&(t.flags|=8192)):ne(t),l=t.updateQueue,l!==null&&Ya(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&Se(Cl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Et(xe),ne(t),null;case 25:return null;case 30:return null}throw Error(T(156,t.tag))}function xh(e,t){switch(po(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Et(xe),dn(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gs(t),null;case 31:if(t.memoizedState!==null){if(Ye(t),t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ye(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(re),null;case 4:return dn(),null;case 10:return Et(t.type),null;case 22:case 23:return Ye(t),jo(),e!==null&&Se(Cl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Et(xe),null;case 25:return null;default:return null}}function Nd(e,t){switch(po(t),t.tag){case 3:Et(xe),dn();break;case 26:case 27:case 5:gs(t);break;case 4:dn();break;case 31:t.memoizedState!==null&&Ye(t);break;case 13:Ye(t);break;case 19:Se(re);break;case 10:Et(t.type);break;case 22:case 23:Ye(t),jo(),e!==null&&Se(Cl);break;case 24:Et(xe)}}function wa(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&e)===e){n=void 0;var s=l.create,c=l.inst;n=s(),c.destroy=n}l=l.next}while(l!==a)}}catch(o){K(t,t.return,o)}}function rl(e,t,l){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){var c=n.inst,o=c.destroy;if(o!==void 0){c.destroy=void 0,a=t;var u=l,r=o;try{r()}catch(h){K(a,u,h)}}}n=n.next}while(n!==s)}}catch(h){K(t,t.return,h)}}function zd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Of(t,l)}catch(n){K(e,e.return,n)}}}function Cd(e,t,l){l.props=Dl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){K(e,t,n)}}function ta(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(a){K(e,t,a)}}function xt(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){K(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){K(e,t,a)}else l.current=null}function Td(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){K(e,e.return,a)}}function Hi(e,t,l){try{var n=e.stateNode;Hh(n,e.type,l,t),n[He]=t}catch(a){K(e,e.return,a)}}function kd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xl(e.type)||e.tag===4}function _i(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kd(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.tag===27&&xl(e.type)||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 Uc(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=wt));else if(n!==4&&(n===27&&xl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Uc(e,t,l),e=e.sibling;e!==null;)Uc(e,t,l),e=e.sibling}function Es(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&xl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Es(e,t,l),e=e.sibling;e!==null;)Es(e,t,l),e=e.sibling}function wd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);ke(t,n,l),t[ze]=e,t[He]=l}catch(s){K(e,e.return,s)}}var Tt=!1,he=!1,Li=!1,Vu=typeof WeakSet=="function"?WeakSet:Set,be=null;function ph(e,t){if(e=e.containerInfo,qc=Ys,e=xf(e),ro(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var a=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{l.nodeType,s.nodeType}catch{l=null;break e}var c=0,o=-1,u=-1,r=0,h=0,p=e,m=null;t:for(;;){for(var g;p!==l||a!==0&&p.nodeType!==3||(o=c+a),p!==s||n!==0&&p.nodeType!==3||(u=c+n),p.nodeType===3&&(c+=p.nodeValue.length),(g=p.firstChild)!==null;)m=p,p=g;for(;;){if(p===e)break t;if(m===l&&++r===a&&(o=c),m===s&&++h===n&&(u=c),(g=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=g}l=o===-1||u===-1?null:{start:o,end:u}}else l=null}l=l||{start:0,end:0}}else l=null;for(Yc={focusedElem:e,selectionRange:l},Ys=!1,be=t;be!==null;)if(t=be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,be=e;else for(;be!==null;){switch(t=be,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)a=e[l],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,l=t,a=s.memoizedProps,s=s.memoizedState,n=l.stateNode;try{var y=Dl(l.type,a);e=n.getSnapshotBeforeUpdate(y,s),n.__reactInternalSnapshotBeforeUpdate=e}catch(j){K(l,l.return,j)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Xc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Xc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(T(163))}if(e=t.sibling,e!==null){e.return=t.return,be=e;break}be=t.return}}function Ad(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:Nt(e,l),n&4&&wa(5,l);break;case 1:if(Nt(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){K(l,l.return,c)}else{var a=Dl(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){K(l,l.return,c)}}n&64&&zd(l),n&512&&ta(l,l.return);break;case 3:if(Nt(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Of(e,t)}catch(c){K(l,l.return,c)}}break;case 27:t===null&&n&4&&wd(l);case 26:case 5:Nt(e,l),t===null&&n&4&&Td(l),n&512&&ta(l,l.return);break;case 12:Nt(e,l);break;case 31:Nt(e,l),n&4&&Dd(e,l);break;case 13:Nt(e,l),n&4&&Od(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Ch.bind(null,l),Qh(e,l))));break;case 22:if(n=l.memoizedState!==null||Tt,!n){t=t!==null&&t.memoizedState!==null||he,a=Tt;var s=he;Tt=n,(he=t)&&!s?zt(e,l,(l.subtreeFlags&8772)!==0):Nt(e,l),Tt=a,he=s}break;case 30:break;default:Nt(e,l)}}function Md(e){var t=e.alternate;t!==null&&(e.alternate=null,Md(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ao(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ie=null,Ue=!1;function St(e,t,l){for(l=l.child;l!==null;)Ed(e,t,l),l=l.sibling}function Ed(e,t,l){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(ja,l)}catch{}switch(l.tag){case 26:he||xt(l,t),St(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:he||xt(l,t);var n=ie,a=Ue;xl(l.type)&&(ie=l.stateNode,Ue=!1),St(e,t,l),sa(l.stateNode),ie=n,Ue=a;break;case 5:he||xt(l,t);case 6:if(n=ie,a=Ue,ie=null,St(e,t,l),ie=n,Ue=a,ie!==null)if(Ue)try{(ie.nodeType===9?ie.body:ie.nodeName==="HTML"?ie.ownerDocument.body:ie).removeChild(l.stateNode)}catch(s){K(l,t,s)}else try{ie.removeChild(l.stateNode)}catch(s){K(l,t,s)}break;case 18:ie!==null&&(Ue?(e=ie,ir(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Sn(e)):ir(ie,l.stateNode));break;case 4:n=ie,a=Ue,ie=l.stateNode.containerInfo,Ue=!0,St(e,t,l),ie=n,Ue=a;break;case 0:case 11:case 14:case 15:rl(2,l,t),he||rl(4,l,t),St(e,t,l);break;case 1:he||(xt(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Cd(l,t,n)),St(e,t,l);break;case 21:St(e,t,l);break;case 22:he=(n=he)||l.memoizedState!==null,St(e,t,l),he=n;break;default:St(e,t,l)}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Sn(e)}catch(l){K(t,t.return,l)}}}function Od(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Sn(e)}catch(l){K(t,t.return,l)}}function gh(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Vu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Vu),t;default:throw Error(T(435,e.tag))}}function Ga(e,t){var l=gh(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var a=Th.bind(null,e,n);n.then(a,a)}})}function De(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n],s=e,c=t,o=c;e:for(;o!==null;){switch(o.tag){case 27:if(xl(o.type)){ie=o.stateNode,Ue=!1;break e}break;case 5:ie=o.stateNode,Ue=!1;break e;case 3:case 4:ie=o.stateNode.containerInfo,Ue=!0;break e}o=o.return}if(ie===null)throw Error(T(160));Ed(s,c,a),ie=null,Ue=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ud(t,e),t=t.sibling}var ft=null;function Ud(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:De(t,e),Oe(e),n&4&&(rl(3,e,e.return),wa(3,e),rl(5,e,e.return));break;case 1:De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),n&64&&Tt&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var a=ft;if(De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),n&4){var s=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,a=a.ownerDocument||a;t:switch(n){case"title":s=a.getElementsByTagName("title")[0],(!s||s[za]||s[ze]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=a.createElement(n),a.head.insertBefore(s,a.querySelector("head > title"))),ke(s,n,l),s[ze]=e,je(s),n=s;break e;case"link":var c=mr("link","href",a).get(n+(l.href||""));if(c){for(var o=0;o<c.length;o++)if(s=c[o],s.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&s.getAttribute("rel")===(l.rel==null?null:l.rel)&&s.getAttribute("title")===(l.title==null?null:l.title)&&s.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(o,1);break t}}s=a.createElement(n),ke(s,n,l),a.head.appendChild(s);break;case"meta":if(c=mr("meta","content",a).get(n+(l.content||""))){for(o=0;o<c.length;o++)if(s=c[o],s.getAttribute("content")===(l.content==null?null:""+l.content)&&s.getAttribute("name")===(l.name==null?null:l.name)&&s.getAttribute("property")===(l.property==null?null:l.property)&&s.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&s.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(o,1);break t}}s=a.createElement(n),ke(s,n,l),a.head.appendChild(s);break;default:throw Error(T(468,n))}s[ze]=e,je(s),n=s}e.stateNode=n}else hr(a,e.type,e.stateNode);else e.stateNode=dr(a,n,e.memoizedProps);else s!==n?(s===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):s.count--,n===null?hr(a,e.type,e.stateNode):dr(a,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Hi(e,e.memoizedProps,l.memoizedProps)}break;case 27:De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),l!==null&&n&4&&Hi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),e.flags&32){a=e.stateNode;try{hn(a,"")}catch(y){K(e,e.return,y)}}n&4&&e.stateNode!=null&&(a=e.memoizedProps,Hi(e,a,l!==null?l.memoizedProps:a)),n&1024&&(Li=!0);break;case 6:if(De(t,e),Oe(e),n&4){if(e.stateNode===null)throw Error(T(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(y){K(e,e.return,y)}}break;case 3:if(rs=null,a=ft,ft=Ls(t.containerInfo),De(t,e),ft=a,Oe(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{Sn(t.containerInfo)}catch(y){K(e,e.return,y)}Li&&(Li=!1,Bd(e));break;case 4:n=ft,ft=Ls(e.stateNode.containerInfo),De(t,e),Oe(e),ft=n;break;case 12:De(t,e),Oe(e);break;case 31:De(t,e),Oe(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ga(e,n)));break;case 13:De(t,e),Oe(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ai=Qe()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ga(e,n)));break;case 22:a=e.memoizedState!==null;var u=l!==null&&l.memoizedState!==null,r=Tt,h=he;if(Tt=r||a,he=h||u,De(t,e),he=h,Tt=r,Oe(e),n&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(l===null||u||Tt||he||bl(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){u=l=t;try{if(s=u.stateNode,a)c=s.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{o=u.stateNode;var p=u.memoizedProps.style,m=p!=null&&p.hasOwnProperty("display")?p.display:null;o.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(y){K(u,u.return,y)}}}else if(t.tag===6){if(l===null){u=t;try{u.stateNode.nodeValue=a?"":u.memoizedProps}catch(y){K(u,u.return,y)}}}else if(t.tag===18){if(l===null){u=t;try{var g=u.stateNode;a?cr(g,!0):cr(u.stateNode,!1)}catch(y){K(u,u.return,y)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Ga(e,l))));break;case 19:De(t,e),Oe(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ga(e,n)));break;case 30:break;case 21:break;default:De(t,e),Oe(e)}}function Oe(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(kd(n)){l=n;break}n=n.return}if(l==null)throw Error(T(160));switch(l.tag){case 27:var a=l.stateNode,s=_i(e);Es(e,s,a);break;case 5:var c=l.stateNode;l.flags&32&&(hn(c,""),l.flags&=-33);var o=_i(e);Es(e,o,c);break;case 3:case 4:var u=l.stateNode.containerInfo,r=_i(e);Uc(e,r,u);break;default:throw Error(T(161))}}catch(h){K(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Bd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Bd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ad(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:rl(4,t,t.return),bl(t);break;case 1:xt(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Cd(t,t.return,l),bl(t);break;case 27:sa(t.stateNode);case 26:case 5:xt(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function zt(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,a=e,s=t,c=s.flags;switch(s.tag){case 0:case 11:case 15:zt(a,s,l),wa(4,s);break;case 1:if(zt(a,s,l),n=s,a=n.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(r){K(n,n.return,r)}if(n=s,a=n.updateQueue,a!==null){var o=n.stateNode;try{var u=a.shared.hiddenCallbacks;if(u!==null)for(a.shared.hiddenCallbacks=null,a=0;a<u.length;a++)Df(u[a],o)}catch(r){K(n,n.return,r)}}l&&c&64&&zd(s),ta(s,s.return);break;case 27:wd(s);case 26:case 5:zt(a,s,l),l&&n===null&&c&4&&Td(s),ta(s,s.return);break;case 12:zt(a,s,l);break;case 31:zt(a,s,l),l&&c&4&&Dd(a,s);break;case 13:zt(a,s,l),l&&c&4&&Od(a,s);break;case 22:s.memoizedState===null&&zt(a,s,l),ta(s,s.return);break;case 30:break;default:zt(a,s,l)}t=t.sibling}}function Ho(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Ta(l))}function _o(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ta(e))}function rt(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rd(e,t,l,n),t=t.sibling}function Rd(e,t,l,n){var a=t.flags;switch(t.tag){case 0:case 11:case 15:rt(e,t,l,n),a&2048&&wa(9,t);break;case 1:rt(e,t,l,n);break;case 3:rt(e,t,l,n),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ta(e)));break;case 12:if(a&2048){rt(e,t,l,n),e=t.stateNode;try{var s=t.memoizedProps,c=s.id,o=s.onPostCommit;typeof o=="function"&&o(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(u){K(t,t.return,u)}}else rt(e,t,l,n);break;case 31:rt(e,t,l,n);break;case 13:rt(e,t,l,n);break;case 23:break;case 22:s=t.stateNode,c=t.alternate,t.memoizedState!==null?s._visibility&2?rt(e,t,l,n):la(e,t):s._visibility&2?rt(e,t,l,n):(s._visibility|=2,ql(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),a&2048&&Ho(c,t);break;case 24:rt(e,t,l,n),a&2048&&_o(t.alternate,t);break;default:rt(e,t,l,n)}}function ql(e,t,l,n,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,c=t,o=l,u=n,r=c.flags;switch(c.tag){case 0:case 11:case 15:ql(s,c,o,u,a),wa(8,c);break;case 23:break;case 22:var h=c.stateNode;c.memoizedState!==null?h._visibility&2?ql(s,c,o,u,a):la(s,c):(h._visibility|=2,ql(s,c,o,u,a)),a&&r&2048&&Ho(c.alternate,c);break;case 24:ql(s,c,o,u,a),a&&r&2048&&_o(c.alternate,c);break;default:ql(s,c,o,u,a)}t=t.sibling}}function la(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,a=n.flags;switch(n.tag){case 22:la(l,n),a&2048&&Ho(n.alternate,n);break;case 24:la(l,n),a&2048&&_o(n.alternate,n);break;default:la(l,n)}t=t.sibling}}var qn=8192;function $l(e,t,l){if(e.subtreeFlags&qn)for(e=e.child;e!==null;)Hd(e,t,l),e=e.sibling}function Hd(e,t,l){switch(e.tag){case 26:$l(e,t,l),e.flags&qn&&e.memoizedState!==null&&nx(l,ft,e.memoizedState,e.memoizedProps);break;case 5:$l(e,t,l);break;case 3:case 4:var n=ft;ft=Ls(e.stateNode.containerInfo),$l(e,t,l),ft=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=qn,qn=16777216,$l(e,t,l),qn=n):$l(e,t,l));break;default:$l(e,t,l)}}function _d(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Bn(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];be=n,$d(n,e)}_d(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ld(e),e=e.sibling}function Ld(e){switch(e.tag){case 0:case 11:case 15:Bn(e),e.flags&2048&&rl(9,e,e.return);break;case 3:Bn(e);break;case 12:Bn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,os(e)):Bn(e);break;default:Bn(e)}}function os(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];be=n,$d(n,e)}_d(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:rl(8,t,t.return),os(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,os(t));break;default:os(t)}e=e.sibling}}function $d(e,t){for(;be!==null;){var l=be;switch(l.tag){case 0:case 11:case 15:rl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Ta(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,be=n;else e:for(l=e;be!==null;){n=be;var a=n.sibling,s=n.return;if(Md(n),n===l){be=null;break e}if(a!==null){a.return=s,be=a;break e}be=s}}}var yh={getCacheForType:function(e){var t=Te(xe),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Te(xe).controller.signal}},vh=typeof WeakMap=="function"?WeakMap:Map,Z=0,ee=null,Y=null,G=0,J=0,qe=null,Ft=!1,kn=!1,Lo=!1,Ht=0,ue=0,fl=0,kl=0,$o=0,Xe=0,yn=0,na=null,Be=null,Bc=!1,ai=0,qd=0,Ds=1/0,Os=null,nl=null,ye=0,al=null,vn=null,Dt=0,Rc=0,Hc=null,Yd=null,aa=0,_c=null;function Je(){return Z&2&&G!==0?G&-G:R.T!==null?Yo():Fr()}function Gd(){if(Xe===0)if(!(G&536870912)||Q){var e=Ba;Ba<<=1,!(Ba&3932160)&&(Ba=262144),Xe=e}else Xe=536870912;return e=Fe.current,e!==null&&(e.flags|=32),Xe}function Re(e,t,l){(e===ee&&(J===2||J===9)||e.cancelPendingCommit!==null)&&(bn(e,0),Wt(e,G,Xe,!1)),Na(e,l),(!(Z&2)||e!==ee)&&(e===ee&&(!(Z&2)&&(kl|=l),ue===4&&Wt(e,G,Xe,!1)),yt(e))}function Xd(e,t,l){if(Z&6)throw Error(T(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Sa(e,t),a=n?Sh(e,t):$i(e,t,!0),s=n;do{if(a===0){kn&&!n&&Wt(e,t,0,!1);break}else{if(l=e.current.alternate,s&&!bh(l)){a=$i(e,t,!1),s=!1;continue}if(a===2){if(s=t,e.errorRecoveryDisabledLanes&s)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var o=e;a=na;var u=o.current.memoizedState.isDehydrated;if(u&&(bn(o,c).flags|=256),c=$i(o,c,!1),c!==2){if(Lo&&!u){o.errorRecoveryDisabledLanes|=s,kl|=s,a=4;break e}s=Be,Be=a,s!==null&&(Be===null?Be=s:Be.push.apply(Be,s))}a=c}if(s=!1,a!==2)continue}}if(a===1){bn(e,0),Wt(e,t,0,!0);break}e:{switch(n=e,s=a,s){case 0:case 1:throw Error(T(345));case 4:if((t&4194048)!==t)break;case 6:Wt(n,t,Xe,!Ft);break e;case 2:Be=null;break;case 3:case 5:break;default:throw Error(T(329))}if((t&62914560)===t&&(a=ai+300-Qe(),10<a)){if(Wt(n,t,Xe,!Ft),Vs(n,0,!0)!==0)break e;Dt=t,n.timeoutHandle=r0(Ju.bind(null,n,l,Be,Os,Bc,t,Xe,kl,yn,Ft,s,"Throttled",-0,0),a);break e}Ju(n,l,Be,Os,Bc,t,Xe,kl,yn,Ft,s,null,-0,0)}}break}while(!0);yt(e)}function Ju(e,t,l,n,a,s,c,o,u,r,h,p,m,g){if(e.timeoutHandle=-1,p=t.subtreeFlags,p&8192||(p&16785408)===16785408){p={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wt},Hd(t,s,p);var y=(s&62914560)===s?ai-Qe():(s&4194048)===s?qd-Qe():0;if(y=ax(p,y),y!==null){Dt=s,e.cancelPendingCommit=y(Fu.bind(null,e,t,s,l,n,a,c,o,u,h,p,null,m,g)),Wt(e,s,c,!r);return}}Fu(e,t,s,l,n,a,c,o,u)}function bh(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var a=l[n],s=a.getSnapshot;a=a.value;try{if(!Ke(s(),a))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Wt(e,t,l,n){t&=~$o,t&=~kl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var a=t;0<a;){var s=31-Ve(a),c=1<<s;n[s]=-1,a&=~c}l!==0&&Vr(e,l,t)}function si(){return Z&6?!0:(Aa(0),!1)}function qo(){if(Y!==null){if(J===0)var e=Y.return;else e=Y,At=Hl=null,To(e),un=null,da=0,e=Y;for(;e!==null;)Nd(e.alternate,e),e=e.return;Y=null}}function bn(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,$h(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Dt=0,qo(),ee=e,Y=l=Mt(e.current,null),G=t,J=0,qe=null,Ft=!1,kn=Sa(e,t),Lo=!1,yn=Xe=$o=kl=fl=ue=0,Be=na=null,Bc=!1,t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-Ve(n),s=1<<a;t|=e[a],n&=~s}return Ht=t,Ws(),l}function Qd(e,t){L=null,R.H=ha,t===Tn||t===Ps?(t=Tu(),J=3):t===vo?(t=Tu(),J=4):J=t===Bo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qe=t,Y===null&&(ue=1,As(e,nt(t,e.current)))}function Zd(){var e=Fe.current;return e===null?!0:(G&4194048)===G?it===null:(G&62914560)===G||G&536870912?e===it:!1}function Vd(){var e=R.H;return R.H=ha,e===null?ha:e}function Jd(){var e=R.A;return R.A=yh,e}function Us(){ue=4,Ft||(G&4194048)!==G&&Fe.current!==null||(kn=!0),!(fl&134217727)&&!(kl&134217727)||ee===null||Wt(ee,G,Xe,!1)}function $i(e,t,l){var n=Z;Z|=2;var a=Vd(),s=Jd();(ee!==e||G!==t)&&(Os=null,bn(e,t)),t=!1;var c=ue;e:do try{if(J!==0&&Y!==null){var o=Y,u=qe;switch(J){case 8:qo(),c=6;break e;case 3:case 2:case 9:case 6:Fe.current===null&&(t=!0);var r=J;if(J=0,qe=null,ln(e,o,u,r),l&&kn){c=0;break e}break;default:r=J,J=0,qe=null,ln(e,o,u,r)}}jh(),c=ue;break}catch(h){Qd(e,h)}while(!0);return t&&e.shellSuspendCounter++,At=Hl=null,Z=n,R.H=a,R.A=s,Y===null&&(ee=null,G=0,Ws()),c}function jh(){for(;Y!==null;)Kd(Y)}function Sh(e,t){var l=Z;Z|=2;var n=Vd(),a=Jd();ee!==e||G!==t?(Os=null,Ds=Qe()+500,bn(e,t)):kn=Sa(e,t);e:do try{if(J!==0&&Y!==null){t=Y;var s=qe;t:switch(J){case 1:J=0,qe=null,ln(e,t,s,1);break;case 2:case 9:if(Cu(s)){J=0,qe=null,Ku(t);break}t=function(){J!==2&&J!==9||ee!==e||(J=7),yt(e)},s.then(t,t);break e;case 3:J=7;break e;case 4:J=5;break e;case 7:Cu(s)?(J=0,qe=null,Ku(t)):(J=0,qe=null,ln(e,t,s,7));break;case 5:var c=null;switch(Y.tag){case 26:c=Y.memoizedState;case 5:case 27:var o=Y;if(c?x0(c):o.stateNode.complete){J=0,qe=null;var u=o.sibling;if(u!==null)Y=u;else{var r=o.return;r!==null?(Y=r,ii(r)):Y=null}break t}}J=0,qe=null,ln(e,t,s,5);break;case 6:J=0,qe=null,ln(e,t,s,6);break;case 8:qo(),ue=6;break e;default:throw Error(T(462))}}Nh();break}catch(h){Qd(e,h)}while(!0);return At=Hl=null,R.H=n,R.A=a,Z=l,Y!==null?0:(ee=null,G=0,Ws(),ue)}function Nh(){for(;Y!==null&&!Z0();)Kd(Y)}function Kd(e){var t=Sd(e.alternate,e,Ht);e.memoizedProps=e.pendingProps,t===null?ii(e):Y=t}function Ku(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Yu(l,t,t.pendingProps,t.type,void 0,G);break;case 11:t=Yu(l,t,t.pendingProps,t.type.render,t.ref,G);break;case 5:To(t);default:Nd(l,t),t=Y=Nf(t,Ht),t=Sd(l,t,Ht)}e.memoizedProps=e.pendingProps,t===null?ii(e):Y=t}function ln(e,t,l,n){At=Hl=null,To(t),un=null,da=0;var a=t.return;try{if(fh(e,a,t,l,G)){ue=1,As(e,nt(l,e.current)),Y=null;return}}catch(s){if(a!==null)throw Y=a,s;ue=1,As(e,nt(l,e.current)),Y=null;return}t.flags&32768?(Q||n===1?e=!0:kn||G&536870912?e=!1:(Ft=e=!0,(n===2||n===9||n===3||n===6)&&(n=Fe.current,n!==null&&n.tag===13&&(n.flags|=16384))),Fd(t,e)):ii(t)}function ii(e){var t=e;do{if(t.flags&32768){Fd(t,Ft);return}e=t.return;var l=hh(t.alternate,t,Ht);if(l!==null){Y=l;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);ue===0&&(ue=5)}function Fd(e,t){do{var l=xh(e.alternate,e);if(l!==null){l.flags&=32767,Y=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=l}while(e!==null);ue=6,Y=null}function Fu(e,t,l,n,a,s,c,o,u){e.cancelPendingCommit=null;do ci();while(ye!==0);if(Z&6)throw Error(T(327));if(t!==null){if(t===e.current)throw Error(T(177));if(s=t.lanes|t.childLanes,s|=fo,lm(e,l,s,c,o,u),e===ee&&(Y=ee=null,G=0),vn=t,al=e,Dt=l,Rc=s,Hc=a,Yd=n,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,kh(ys,function(){return t0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,t.subtreeFlags&13878||n){n=R.T,R.T=null,a=V.p,V.p=2,c=Z,Z|=4;try{ph(e,t,l)}finally{Z=c,V.p=a,R.T=n}}ye=1,Wd(),Id(),Pd()}}function Wd(){if(ye===1){ye=0;var e=al,t=vn,l=(t.flags&13878)!==0;if(t.subtreeFlags&13878||l){l=R.T,R.T=null;var n=V.p;V.p=2;var a=Z;Z|=4;try{Ud(t,e);var s=Yc,c=xf(e.containerInfo),o=s.focusedElem,u=s.selectionRange;if(c!==o&&o&&o.ownerDocument&&hf(o.ownerDocument.documentElement,o)){if(u!==null&&ro(o)){var r=u.start,h=u.end;if(h===void 0&&(h=r),"selectionStart"in o)o.selectionStart=r,o.selectionEnd=Math.min(h,o.value.length);else{var p=o.ownerDocument||document,m=p&&p.defaultView||window;if(m.getSelection){var g=m.getSelection(),y=o.textContent.length,j=Math.min(u.start,y),b=u.end===void 0?j:Math.min(u.end,y);!g.extend&&j>b&&(c=b,b=j,j=c);var f=yu(o,j),d=yu(o,b);if(f&&d&&(g.rangeCount!==1||g.anchorNode!==f.node||g.anchorOffset!==f.offset||g.focusNode!==d.node||g.focusOffset!==d.offset)){var x=p.createRange();x.setStart(f.node,f.offset),g.removeAllRanges(),j>b?(g.addRange(x),g.extend(d.node,d.offset)):(x.setEnd(d.node,d.offset),g.addRange(x))}}}}for(p=[],g=o;g=g.parentNode;)g.nodeType===1&&p.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<p.length;o++){var v=p[o];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}Ys=!!qc,Yc=qc=null}finally{Z=a,V.p=n,R.T=l}}e.current=t,ye=2}}function Id(){if(ye===2){ye=0;var e=al,t=vn,l=(t.flags&8772)!==0;if(t.subtreeFlags&8772||l){l=R.T,R.T=null;var n=V.p;V.p=2;var a=Z;Z|=4;try{Ad(e,t.alternate,t)}finally{Z=a,V.p=n,R.T=l}}ye=3}}function Pd(){if(ye===4||ye===3){ye=0,V0();var e=al,t=vn,l=Dt,n=Yd;t.subtreeFlags&10256||t.flags&10256?ye=5:(ye=0,vn=al=null,e0(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(nl=null),no(l),t=t.stateNode,Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(ja,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=R.T,a=V.p,V.p=2,R.T=null;try{for(var s=e.onRecoverableError,c=0;c<n.length;c++){var o=n[c];s(o.value,{componentStack:o.stack})}}finally{R.T=t,V.p=a}}Dt&3&&ci(),yt(e),a=e.pendingLanes,l&261930&&a&42?e===_c?aa++:(aa=0,_c=e):aa=0,Aa(0)}}function e0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ta(t)))}function ci(){return Wd(),Id(),Pd(),t0()}function t0(){if(ye!==5)return!1;var e=al,t=Rc;Rc=0;var l=no(Dt),n=R.T,a=V.p;try{V.p=32>l?32:l,R.T=null,l=Hc,Hc=null;var s=al,c=Dt;if(ye=0,vn=al=null,Dt=0,Z&6)throw Error(T(331));var o=Z;if(Z|=4,Ld(s.current),Rd(s,s.current,c,l),Z=o,Aa(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(ja,s)}catch{}return!0}finally{V.p=a,R.T=n,e0(e,t)}}function Wu(e,t,l){t=nt(l,t),t=Ec(e.stateNode,t,2),e=ll(e,t,2),e!==null&&(Na(e,2),yt(e))}function K(e,t,l){if(e.tag===3)Wu(e,e,l);else for(;t!==null;){if(t.tag===3){Wu(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(nl===null||!nl.has(n))){e=nt(l,e),l=pd(2),n=ll(t,l,2),n!==null&&(gd(l,n,t,e),Na(n,2),yt(n));break}}t=t.return}}function qi(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new vh;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(l)||(Lo=!0,a.add(l),e=zh.bind(null,e,t,l),t.then(e,e))}function zh(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,ee===e&&(G&l)===l&&(ue===4||ue===3&&(G&62914560)===G&&300>Qe()-ai?!(Z&2)&&bn(e,0):$o|=l,yn===G&&(yn=0)),yt(e)}function l0(e,t){t===0&&(t=Zr()),e=Rl(e,t),e!==null&&(Na(e,t),yt(e))}function Ch(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),l0(e,l)}function Th(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(T(314))}n!==null&&n.delete(t),l0(e,l)}function kh(e,t){return to(e,t)}var Bs=null,Yl=null,Lc=!1,Rs=!1,Yi=!1,It=0;function yt(e){e!==Yl&&e.next===null&&(Yl===null?Bs=Yl=e:Yl=Yl.next=e),Rs=!0,Lc||(Lc=!0,Ah())}function Aa(e,t){if(!Yi&&Rs){Yi=!0;do for(var l=!1,n=Bs;n!==null;){if(e!==0){var a=n.pendingLanes;if(a===0)var s=0;else{var c=n.suspendedLanes,o=n.pingedLanes;s=(1<<31-Ve(42|e)+1)-1,s&=a&~(c&~o),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(l=!0,Iu(n,s))}else s=G,s=Vs(n,n===ee?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(s&3)||Sa(n,s)||(l=!0,Iu(n,s));n=n.next}while(l);Yi=!1}}function wh(){n0()}function n0(){Rs=Lc=!1;var e=0;It!==0&&Lh()&&(e=It);for(var t=Qe(),l=null,n=Bs;n!==null;){var a=n.next,s=a0(n,t);s===0?(n.next=null,l===null?Bs=a:l.next=a,a===null&&(Yl=l)):(l=n,(e!==0||s&3)&&(Rs=!0)),n=a}ye!==0&&ye!==5||Aa(e),It!==0&&(It=0)}function a0(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var c=31-Ve(s),o=1<<c,u=a[c];u===-1?(!(o&l)||o&n)&&(a[c]=tm(o,t)):u<=t&&(e.expiredLanes|=o),s&=~o}if(t=ee,l=G,l=Vs(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(J===2||J===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&pi(n),e.callbackNode=null,e.callbackPriority=0;if(!(l&3)||Sa(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&pi(n),no(l)){case 2:case 8:l=Xr;break;case 32:l=ys;break;case 268435456:l=Qr;break;default:l=ys}return n=s0.bind(null,e),l=to(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&pi(n),e.callbackPriority=2,e.callbackNode=null,2}function s0(e,t){if(ye!==0&&ye!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(ci()&&e.callbackNode!==l)return null;var n=G;return n=Vs(e,e===ee?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Xd(e,n,t),a0(e,Qe()),e.callbackNode!=null&&e.callbackNode===l?s0.bind(null,e):null)}function Iu(e,t){if(ci())return null;Xd(e,t,!0)}function Ah(){qh(function(){Z&6?to(Gr,wh):n0()})}function Yo(){if(It===0){var e=xn;e===0&&(e=Ua,Ua<<=1,!(Ua&261888)&&(Ua=256)),It=e}return It}function Pu(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Pa(""+e)}function er(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Mh(e,t,l,n,a){if(t==="submit"&&l&&l.stateNode===a){var s=Pu((a[He]||null).action),c=n.submitter;c&&(t=(t=c[He]||null)?Pu(t.formAction):c.getAttribute("formAction"),t!==null&&(s=t,c=null));var o=new Js("action","action",null,n,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(It!==0){var u=c?er(a,c):new FormData(a);Ac(l,{pending:!0,data:u,method:a.method,action:s},null,u)}}else typeof s=="function"&&(o.preventDefault(),u=c?er(a,c):new FormData(a),Ac(l,{pending:!0,data:u,method:a.method,action:s},s,u))},currentTarget:a}]})}}for(var Gi=0;Gi<gc.length;Gi++){var Xi=gc[Gi],Eh=Xi.toLowerCase(),Dh=Xi[0].toUpperCase()+Xi.slice(1);dt(Eh,"on"+Dh)}dt(gf,"onAnimationEnd");dt(yf,"onAnimationIteration");dt(vf,"onAnimationStart");dt("dblclick","onDoubleClick");dt("focusin","onFocus");dt("focusout","onBlur");dt(Jm,"onTransitionRun");dt(Km,"onTransitionStart");dt(Fm,"onTransitionCancel");dt(bf,"onTransitionEnd");mn("onMouseEnter",["mouseout","mouseover"]);mn("onMouseLeave",["mouseout","mouseover"]);mn("onPointerEnter",["pointerout","pointerover"]);mn("onPointerLeave",["pointerout","pointerover"]);Ol("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ol("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ol("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ol("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ol("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ol("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xa="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(" "),Oh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xa));function i0(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],a=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var c=n.length-1;0<=c;c--){var o=n[c],u=o.instance,r=o.currentTarget;if(o=o.listener,u!==s&&a.isPropagationStopped())break e;s=o,a.currentTarget=r;try{s(a)}catch(h){bs(h)}a.currentTarget=null,s=u}else for(c=0;c<n.length;c++){if(o=n[c],u=o.instance,r=o.currentTarget,o=o.listener,u!==s&&a.isPropagationStopped())break e;s=o,a.currentTarget=r;try{s(a)}catch(h){bs(h)}a.currentTarget=null,s=u}}}}function q(e,t){var l=t[uc];l===void 0&&(l=t[uc]=new Set);var n=e+"__bubble";l.has(n)||(c0(t,e,2,!1),l.add(n))}function Qi(e,t,l){var n=0;t&&(n|=4),c0(l,e,n,t)}var Xa="_reactListening"+Math.random().toString(36).slice(2);function Go(e){if(!e[Xa]){e[Xa]=!0,Wr.forEach(function(l){l!=="selectionchange"&&(Oh.has(l)||Qi(l,!1,e),Qi(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xa]||(t[Xa]=!0,Qi("selectionchange",!1,t))}}function c0(e,t,l,n){switch(b0(t)){case 2:var a=cx;break;case 8:a=ox;break;default:a=Vo}l=a.bind(null,t,l,e),a=void 0,!hc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,l,{capture:!0,passive:a}):e.addEventListener(t,l,!0):a!==void 0?e.addEventListener(t,l,{passive:a}):e.addEventListener(t,l,!1)}function Zi(e,t,l,n,a){var s=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var c=n.tag;if(c===3||c===4){var o=n.stateNode.containerInfo;if(o===a)break;if(c===4)for(c=n.return;c!==null;){var u=c.tag;if((u===3||u===4)&&c.stateNode.containerInfo===a)return;c=c.return}for(;o!==null;){if(c=Vl(o),c===null)return;if(u=c.tag,u===5||u===6||u===26||u===27){n=s=c;continue e}o=o.parentNode}}n=n.return}sf(function(){var r=s,h=io(l),p=[];e:{var m=jf.get(e);if(m!==void 0){var g=Js,y=e;switch(e){case"keypress":if(ts(l)===0)break e;case"keydown":case"keyup":g=Tm;break;case"focusin":y="focus",g=ji;break;case"focusout":y="blur",g=ji;break;case"beforeblur":case"afterblur":g=ji;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=ou;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=hm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Am;break;case gf:case yf:case vf:g=gm;break;case bf:g=Em;break;case"scroll":case"scrollend":g=dm;break;case"wheel":g=Om;break;case"copy":case"cut":case"paste":g=vm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=ru;break;case"toggle":case"beforetoggle":g=Bm}var j=(t&4)!==0,b=!j&&(e==="scroll"||e==="scrollend"),f=j?m!==null?m+"Capture":null:m;j=[];for(var d=r,x;d!==null;){var v=d;if(x=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||x===null||f===null||(v=ca(d,f),v!=null&&j.push(pa(d,v,x))),b)break;d=d.return}0<j.length&&(m=new g(m,y,null,l,h),p.push({event:m,listeners:j}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",m&&l!==mc&&(y=l.relatedTarget||l.fromElement)&&(Vl(y)||y[Nn]))break e;if((g||m)&&(m=h.window===h?h:(m=h.ownerDocument)?m.defaultView||m.parentWindow:window,g?(y=l.relatedTarget||l.toElement,g=r,y=y?Vl(y):null,y!==null&&(b=ba(y),j=y.tag,y!==b||j!==5&&j!==27&&j!==6)&&(y=null)):(g=null,y=r),g!==y)){if(j=ou,v="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(j=ru,v="onPointerLeave",f="onPointerEnter",d="pointer"),b=g==null?m:Ln(g),x=y==null?m:Ln(y),m=new j(v,d+"leave",g,l,h),m.target=b,m.relatedTarget=x,v=null,Vl(h)===r&&(j=new j(f,d+"enter",y,l,h),j.target=x,j.relatedTarget=b,v=j),b=v,g&&y)t:{for(j=Uh,f=g,d=y,x=0,v=f;v;v=j(v))x++;v=0;for(var S=d;S;S=j(S))v++;for(;0<x-v;)f=j(f),x--;for(;0<v-x;)d=j(d),v--;for(;x--;){if(f===d||d!==null&&f===d.alternate){j=f;break t}f=j(f),d=j(d)}j=null}else j=null;g!==null&&tr(p,m,g,j,!1),y!==null&&b!==null&&tr(p,b,y,j,!0)}}e:{if(m=r?Ln(r):window,g=m.nodeName&&m.nodeName.toLowerCase(),g==="select"||g==="input"&&m.type==="file")var z=hu;else if(mu(m))if(df)z=Qm;else{z=Gm;var N=Ym}else g=m.nodeName,!g||g.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?r&&so(r.elementType)&&(z=hu):z=Xm;if(z&&(z=z(e,r))){ff(p,z,l,h);break e}N&&N(e,m,r),e==="focusout"&&r&&m.type==="number"&&r.memoizedProps.value!=null&&dc(m,"number",m.value)}switch(N=r?Ln(r):window,e){case"focusin":(mu(N)||N.contentEditable==="true")&&(Fl=N,xc=r,Kn=null);break;case"focusout":Kn=xc=Fl=null;break;case"mousedown":pc=!0;break;case"contextmenu":case"mouseup":case"dragend":pc=!1,vu(p,l,h);break;case"selectionchange":if(Vm)break;case"keydown":case"keyup":vu(p,l,h)}var M;if(uo)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Kl?uf(e,l)&&(A="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(A="onCompositionStart");A&&(of&&l.locale!=="ko"&&(Kl||A!=="onCompositionStart"?A==="onCompositionEnd"&&Kl&&(M=cf()):(Kt=h,co="value"in Kt?Kt.value:Kt.textContent,Kl=!0)),N=Hs(r,A),0<N.length&&(A=new uu(A,e,null,l,h),p.push({event:A,listeners:N}),M?A.data=M:(M=rf(l),M!==null&&(A.data=M)))),(M=Hm?_m(e,l):Lm(e,l))&&(A=Hs(r,"onBeforeInput"),0<A.length&&(N=new uu("onBeforeInput","beforeinput",null,l,h),p.push({event:N,listeners:A}),N.data=M)),Mh(p,e,r,l,h)}i0(p,t)})}function pa(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Hs(e,t){for(var l=t+"Capture",n=[];e!==null;){var a=e,s=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||s===null||(a=ca(e,l),a!=null&&n.unshift(pa(e,a,s)),a=ca(e,t),a!=null&&n.push(pa(e,a,s))),e.tag===3)return n;e=e.return}return[]}function Uh(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tr(e,t,l,n,a){for(var s=t._reactName,c=[];l!==null&&l!==n;){var o=l,u=o.alternate,r=o.stateNode;if(o=o.tag,u!==null&&u===n)break;o!==5&&o!==26&&o!==27||r===null||(u=r,a?(r=ca(l,s),r!=null&&c.unshift(pa(l,r,u))):a||(r=ca(l,s),r!=null&&c.push(pa(l,r,u)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var Bh=/\r\n?/g,Rh=/\u0000|\uFFFD/g;function lr(e){return(typeof e=="string"?e:""+e).replace(Bh,`
|
|
33
|
-
`).replace(Rh,"")}function o0(e,t){return t=lr(t),lr(e)===t}function I(e,t,l,n,a,s){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||hn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&hn(e,""+n);break;case"className":Ha(e,"class",n);break;case"tabIndex":Ha(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ha(e,l,n);break;case"style":af(e,n,s);break;case"data":if(t!=="object"){Ha(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=Pa(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(l==="formAction"?(t!=="input"&&I(e,t,"name",a.name,a,null),I(e,t,"formEncType",a.formEncType,a,null),I(e,t,"formMethod",a.formMethod,a,null),I(e,t,"formTarget",a.formTarget,a,null)):(I(e,t,"encType",a.encType,a,null),I(e,t,"method",a.method,a,null),I(e,t,"target",a.target,a,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=Pa(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=wt);break;case"onScroll":n!=null&&q("scroll",e);break;case"onScrollEnd":n!=null&&q("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(T(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(T(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=Pa(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":q("beforetoggle",e),q("toggle",e),Ia(e,"popover",n);break;case"xlinkActuate":bt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":bt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":bt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":bt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":bt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":bt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":bt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":bt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":bt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Ia(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=rm.get(l)||l,Ia(e,l,n))}}function $c(e,t,l,n,a,s){switch(l){case"style":af(e,n,s);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(T(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(T(60));e.innerHTML=l}}break;case"children":typeof n=="string"?hn(e,n):(typeof n=="number"||typeof n=="bigint")&&hn(e,""+n);break;case"onScroll":n!=null&&q("scroll",e);break;case"onScrollEnd":n!=null&&q("scrollend",e);break;case"onClick":n!=null&&(e.onclick=wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ir.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(a=l.endsWith("Capture"),t=l.slice(2,a?l.length-7:void 0),s=e[He]||null,s=s!=null?s[l]:null,typeof s=="function"&&e.removeEventListener(t,s,a),typeof n=="function")){typeof s!="function"&&s!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,a);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):Ia(e,l,n)}}}function ke(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":q("error",e),q("load",e);var n=!1,a=!1,s;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];if(c!=null)switch(s){case"src":n=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(T(137,t));default:I(e,t,s,c,l,null)}}a&&I(e,t,"srcSet",l.srcSet,l,null),n&&I(e,t,"src",l.src,l,null);return;case"input":q("invalid",e);var o=s=c=a=null,u=null,r=null;for(n in l)if(l.hasOwnProperty(n)){var h=l[n];if(h!=null)switch(n){case"name":a=h;break;case"type":c=h;break;case"checked":u=h;break;case"defaultChecked":r=h;break;case"value":s=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(T(137,t));break;default:I(e,t,n,h,l,null)}}tf(e,s,o,u,r,c,a,!1);return;case"select":q("invalid",e),n=c=s=null;for(a in l)if(l.hasOwnProperty(a)&&(o=l[a],o!=null))switch(a){case"value":s=o;break;case"defaultValue":c=o;break;case"multiple":n=o;default:I(e,t,a,o,l,null)}t=s,l=c,e.multiple=!!n,t!=null?sn(e,!!n,t,!1):l!=null&&sn(e,!!n,l,!0);return;case"textarea":q("invalid",e),s=a=n=null;for(c in l)if(l.hasOwnProperty(c)&&(o=l[c],o!=null))switch(c){case"value":n=o;break;case"defaultValue":a=o;break;case"children":s=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(T(91));break;default:I(e,t,c,o,l,null)}nf(e,n,a,s);return;case"option":for(u in l)if(l.hasOwnProperty(u)&&(n=l[u],n!=null))switch(u){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:I(e,t,u,n,l,null)}return;case"dialog":q("beforetoggle",e),q("toggle",e),q("cancel",e),q("close",e);break;case"iframe":case"object":q("load",e);break;case"video":case"audio":for(n=0;n<xa.length;n++)q(xa[n],e);break;case"image":q("error",e),q("load",e);break;case"details":q("toggle",e);break;case"embed":case"source":case"link":q("error",e),q("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(r in l)if(l.hasOwnProperty(r)&&(n=l[r],n!=null))switch(r){case"children":case"dangerouslySetInnerHTML":throw Error(T(137,t));default:I(e,t,r,n,l,null)}return;default:if(so(t)){for(h in l)l.hasOwnProperty(h)&&(n=l[h],n!==void 0&&$c(e,t,h,n,l,void 0));return}}for(o in l)l.hasOwnProperty(o)&&(n=l[o],n!=null&&I(e,t,o,n,l,null))}function Hh(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,s=null,c=null,o=null,u=null,r=null,h=null;for(g in l){var p=l[g];if(l.hasOwnProperty(g)&&p!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":u=p;default:n.hasOwnProperty(g)||I(e,t,g,null,n,p)}}for(var m in n){var g=n[m];if(p=l[m],n.hasOwnProperty(m)&&(g!=null||p!=null))switch(m){case"type":s=g;break;case"name":a=g;break;case"checked":r=g;break;case"defaultChecked":h=g;break;case"value":c=g;break;case"defaultValue":o=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(T(137,t));break;default:g!==p&&I(e,t,m,g,n,p)}}fc(e,c,o,u,r,h,s,a);return;case"select":g=c=o=m=null;for(s in l)if(u=l[s],l.hasOwnProperty(s)&&u!=null)switch(s){case"value":break;case"multiple":g=u;default:n.hasOwnProperty(s)||I(e,t,s,null,n,u)}for(a in n)if(s=n[a],u=l[a],n.hasOwnProperty(a)&&(s!=null||u!=null))switch(a){case"value":m=s;break;case"defaultValue":o=s;break;case"multiple":c=s;default:s!==u&&I(e,t,a,s,n,u)}t=o,l=c,n=g,m!=null?sn(e,!!l,m,!1):!!n!=!!l&&(t!=null?sn(e,!!l,t,!0):sn(e,!!l,l?[]:"",!1));return;case"textarea":g=m=null;for(o in l)if(a=l[o],l.hasOwnProperty(o)&&a!=null&&!n.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:I(e,t,o,null,n,a)}for(c in n)if(a=n[c],s=l[c],n.hasOwnProperty(c)&&(a!=null||s!=null))switch(c){case"value":m=a;break;case"defaultValue":g=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(T(91));break;default:a!==s&&I(e,t,c,a,n,s)}lf(e,m,g);return;case"option":for(var y in l)if(m=l[y],l.hasOwnProperty(y)&&m!=null&&!n.hasOwnProperty(y))switch(y){case"selected":e.selected=!1;break;default:I(e,t,y,null,n,m)}for(u in n)if(m=n[u],g=l[u],n.hasOwnProperty(u)&&m!==g&&(m!=null||g!=null))switch(u){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:I(e,t,u,m,n,g)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var j in l)m=l[j],l.hasOwnProperty(j)&&m!=null&&!n.hasOwnProperty(j)&&I(e,t,j,null,n,m);for(r in n)if(m=n[r],g=l[r],n.hasOwnProperty(r)&&m!==g&&(m!=null||g!=null))switch(r){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(T(137,t));break;default:I(e,t,r,m,n,g)}return;default:if(so(t)){for(var b in l)m=l[b],l.hasOwnProperty(b)&&m!==void 0&&!n.hasOwnProperty(b)&&$c(e,t,b,void 0,n,m);for(h in n)m=n[h],g=l[h],!n.hasOwnProperty(h)||m===g||m===void 0&&g===void 0||$c(e,t,h,m,n,g);return}}for(var f in l)m=l[f],l.hasOwnProperty(f)&&m!=null&&!n.hasOwnProperty(f)&&I(e,t,f,null,n,m);for(p in n)m=n[p],g=l[p],!n.hasOwnProperty(p)||m===g||m==null&&g==null||I(e,t,p,m,n,g)}function nr(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _h(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var a=l[n],s=a.transferSize,c=a.initiatorType,o=a.duration;if(s&&o&&nr(c)){for(c=0,o=a.responseEnd,n+=1;n<l.length;n++){var u=l[n],r=u.startTime;if(r>o)break;var h=u.transferSize,p=u.initiatorType;h&&nr(p)&&(u=u.responseEnd,c+=h*(u<o?1:(o-r)/(u-r)))}if(--n,t+=8*(s+c)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var qc=null,Yc=null;function _s(e){return e.nodeType===9?e:e.ownerDocument}function ar(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function u0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vi=null;function Lh(){var e=window.event;return e&&e.type==="popstate"?e===Vi?!1:(Vi=e,!0):(Vi=null,!1)}var r0=typeof setTimeout=="function"?setTimeout:void 0,$h=typeof clearTimeout=="function"?clearTimeout:void 0,sr=typeof Promise=="function"?Promise:void 0,qh=typeof queueMicrotask=="function"?queueMicrotask:typeof sr<"u"?function(e){return sr.resolve(null).then(e).catch(Yh)}:r0;function Yh(e){setTimeout(function(){throw e})}function xl(e){return e==="head"}function ir(e,t){var l=t,n=0;do{var a=l.nextSibling;if(e.removeChild(l),a&&a.nodeType===8)if(l=a.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(a),Sn(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")sa(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,sa(l);for(var s=l.firstChild;s;){var c=s.nextSibling,o=s.nodeName;s[za]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&s.rel.toLowerCase()==="stylesheet"||l.removeChild(s),s=c}}else l==="body"&&sa(e.ownerDocument.body);l=a}while(l);Sn(t)}function cr(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function Xc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Xc(l),ao(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Gh(e,t,l,n){for(;e.nodeType===1;){var a=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[za])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=ct(e.nextSibling),e===null)break}return null}function Xh(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=ct(e.nextSibling),e===null))return null;return e}function f0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ct(e.nextSibling),e===null))return null;return e}function Qc(e){return e.data==="$?"||e.data==="$~"}function Zc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Qh(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ct(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Vc=null;function or(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return ct(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ur(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function d0(e,t,l){switch(t=_s(l),e){case"html":if(e=t.documentElement,!e)throw Error(T(452));return e;case"head":if(e=t.head,!e)throw Error(T(453));return e;case"body":if(e=t.body,!e)throw Error(T(454));return e;default:throw Error(T(451))}}function sa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ao(e)}var ut=new Map,rr=new Set;function Ls(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _t=V.d;V.d={f:Zh,r:Vh,D:Jh,C:Kh,L:Fh,m:Wh,X:Ph,S:Ih,M:ex};function Zh(){var e=_t.f(),t=si();return e||t}function Vh(e){var t=zn(e);t!==null&&t.tag===5&&t.type==="form"?sd(t):_t.r(e)}var wn=typeof document>"u"?null:document;function m0(e,t,l){var n=wn;if(n&&typeof t=="string"&&t){var a=lt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),rr.has(a)||(rr.add(a),e={rel:e,crossOrigin:l,href:t},n.querySelector(a)===null&&(t=n.createElement("link"),ke(t,"link",e),je(t),n.head.appendChild(t)))}}function Jh(e){_t.D(e),m0("dns-prefetch",e,null)}function Kh(e,t){_t.C(e,t),m0("preconnect",e,t)}function Fh(e,t,l){_t.L(e,t,l);var n=wn;if(n&&e&&t){var a='link[rel="preload"][as="'+lt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+lt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+lt(l.imageSizes)+'"]')):a+='[href="'+lt(e)+'"]';var s=a;switch(t){case"style":s=jn(e);break;case"script":s=An(e)}ut.has(s)||(e=se({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),ut.set(s,e),n.querySelector(a)!==null||t==="style"&&n.querySelector(Ma(s))||t==="script"&&n.querySelector(Ea(s))||(t=n.createElement("link"),ke(t,"link",e),je(t),n.head.appendChild(t)))}}function Wh(e,t){_t.m(e,t);var l=wn;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+lt(n)+'"][href="'+lt(e)+'"]',s=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=An(e)}if(!ut.has(s)&&(e=se({rel:"modulepreload",href:e},t),ut.set(s,e),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ea(s)))return}n=l.createElement("link"),ke(n,"link",e),je(n),l.head.appendChild(n)}}}function Ih(e,t,l){_t.S(e,t,l);var n=wn;if(n&&e){var a=an(n).hoistableStyles,s=jn(e);t=t||"default";var c=a.get(s);if(!c){var o={loading:0,preload:null};if(c=n.querySelector(Ma(s)))o.loading=5;else{e=se({rel:"stylesheet",href:e,"data-precedence":t},l),(l=ut.get(s))&&Xo(e,l);var u=c=n.createElement("link");je(u),ke(u,"link",e),u._p=new Promise(function(r,h){u.onload=r,u.onerror=h}),u.addEventListener("load",function(){o.loading|=1}),u.addEventListener("error",function(){o.loading|=2}),o.loading|=4,us(c,t,n)}c={type:"stylesheet",instance:c,count:1,state:o},a.set(s,c)}}}function Ph(e,t){_t.X(e,t);var l=wn;if(l&&e){var n=an(l).hoistableScripts,a=An(e),s=n.get(a);s||(s=l.querySelector(Ea(a)),s||(e=se({src:e,async:!0},t),(t=ut.get(a))&&Qo(e,t),s=l.createElement("script"),je(s),ke(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function ex(e,t){_t.M(e,t);var l=wn;if(l&&e){var n=an(l).hoistableScripts,a=An(e),s=n.get(a);s||(s=l.querySelector(Ea(a)),s||(e=se({src:e,async:!0,type:"module"},t),(t=ut.get(a))&&Qo(e,t),s=l.createElement("script"),je(s),ke(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function fr(e,t,l,n){var a=(a=Pt.current)?Ls(a):null;if(!a)throw Error(T(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=jn(l.href),l=an(a).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=jn(l.href);var s=an(a).hoistableStyles,c=s.get(e);if(c||(a=a.ownerDocument||a,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,c),(s=a.querySelector(Ma(e)))&&!s._p&&(c.instance=s,c.state.loading=5),ut.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ut.set(e,l),s||tx(a,e,l,c.state))),t&&n===null)throw Error(T(528,""));return c}if(t&&n!==null)throw Error(T(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=An(l),l=an(a).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(T(444,e))}}function jn(e){return'href="'+lt(e)+'"'}function Ma(e){return'link[rel="stylesheet"]['+e+"]"}function h0(e){return se({},e,{"data-precedence":e.precedence,precedence:null})}function tx(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),ke(t,"link",l),je(t),e.head.appendChild(t))}function An(e){return'[src="'+lt(e)+'"]'}function Ea(e){return"script[async]"+e}function dr(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+lt(l.href)+'"]');if(n)return t.instance=n,je(n),n;var a=se({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),je(n),ke(n,"style",a),us(n,l.precedence,e),t.instance=n;case"stylesheet":a=jn(l.href);var s=e.querySelector(Ma(a));if(s)return t.state.loading|=4,t.instance=s,je(s),s;n=h0(l),(a=ut.get(a))&&Xo(n,a),s=(e.ownerDocument||e).createElement("link"),je(s);var c=s;return c._p=new Promise(function(o,u){c.onload=o,c.onerror=u}),ke(s,"link",n),t.state.loading|=4,us(s,l.precedence,e),t.instance=s;case"script":return s=An(l.src),(a=e.querySelector(Ea(s)))?(t.instance=a,je(a),a):(n=l,(a=ut.get(s))&&(n=se({},l),Qo(n,a)),e=e.ownerDocument||e,a=e.createElement("script"),je(a),ke(a,"link",n),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(T(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(n=t.instance,t.state.loading|=4,us(n,l.precedence,e));return t.instance}function us(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,s=a,c=0;c<n.length;c++){var o=n[c];if(o.dataset.precedence===t)s=o;else if(s!==a)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Xo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Qo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rs=null;function mr(e,t,l){if(rs===null){var n=new Map,a=rs=new Map;a.set(l,n)}else a=rs,n=a.get(l),n||(n=new Map,a.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),a=0;a<l.length;a++){var s=l[a];if(!(s[za]||s[ze]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var c=s.getAttribute(t)||"";c=e+c;var o=n.get(c);o?o.push(s):n.set(c,[s])}}return n}function hr(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function lx(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function x0(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function nx(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(l.state.loading&4)){if(l.instance===null){var a=jn(n.href),s=t.querySelector(Ma(a));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=$s.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=s,je(s);return}s=t.ownerDocument||t,n=h0(n),(a=ut.get(a))&&Xo(n,a),s=s.createElement("link"),je(s);var c=s;c._p=new Promise(function(o,u){c.onload=o,c.onerror=u}),ke(s,"link",n),l.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&!(l.state.loading&3)&&(e.count++,l=$s.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Ji=0;function ax(e,t){return e.stylesheets&&e.count===0&&fs(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&fs(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Ji===0&&(Ji=62500*_h());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fs(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Ji?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function $s(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qs=null;function fs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qs=new Map,t.forEach(sx,e),qs=null,$s.call(e))}function sx(e,t){if(!(t.state.loading&4)){var l=qs.get(e);if(l)var n=l.get(null);else{l=new Map,qs.set(e,l);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var c=a[s];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),n=c)}n&&l.set(null,n)}a=t.instance,c=a.getAttribute("data-precedence"),s=l.get(c)||n,s===n&&l.set(null,a),l.set(c,a),this.count++,n=$s.bind(this),a.addEventListener("load",n),a.addEventListener("error",n),s?s.parentNode.insertBefore(a,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var ga={$$typeof:kt,Provider:null,Consumer:null,_currentValue:Nl,_currentValue2:Nl,_threadCount:0};function ix(e,t,l,n,a,s,c,o,u){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gi(0),this.hiddenUpdates=gi(null),this.identifierPrefix=n,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=u,this.incompleteTransitions=new Map}function p0(e,t,l,n,a,s,c,o,u,r,h,p){return e=new ix(e,t,l,c,u,r,h,p,o),t=1,s===!0&&(t|=24),s=Ge(3,null,null,t),e.current=s,s.stateNode=e,t=go(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:n,isDehydrated:l,cache:t},bo(s),e}function g0(e){return e?(e=Pl,e):Pl}function y0(e,t,l,n,a,s){a=g0(a),n.context===null?n.context=a:n.pendingContext=a,n=tl(t),n.payload={element:l},s=s===void 0?null:s,s!==null&&(n.callback=s),l=ll(e,n,t),l!==null&&(Re(l,e,t),Wn(l,e,t))}function xr(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Zo(e,t){xr(e,t),(e=e.alternate)&&xr(e,t)}function v0(e){if(e.tag===13||e.tag===31){var t=Rl(e,67108864);t!==null&&Re(t,e,67108864),Zo(e,67108864)}}function pr(e){if(e.tag===13||e.tag===31){var t=Je();t=lo(t);var l=Rl(e,t);l!==null&&Re(l,e,t),Zo(e,t)}}var Ys=!0;function cx(e,t,l,n){var a=R.T;R.T=null;var s=V.p;try{V.p=2,Vo(e,t,l,n)}finally{V.p=s,R.T=a}}function ox(e,t,l,n){var a=R.T;R.T=null;var s=V.p;try{V.p=8,Vo(e,t,l,n)}finally{V.p=s,R.T=a}}function Vo(e,t,l,n){if(Ys){var a=Jc(n);if(a===null)Zi(e,t,n,Gs,l),gr(e,n);else if(rx(a,e,t,l,n))n.stopPropagation();else if(gr(e,n),t&4&&-1<ux.indexOf(e)){for(;a!==null;){var s=zn(a);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var c=yl(s.pendingLanes);if(c!==0){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;c;){var u=1<<31-Ve(c);o.entanglements[1]|=u,c&=~u}yt(s),!(Z&6)&&(Ds=Qe()+500,Aa(0))}}break;case 31:case 13:o=Rl(s,2),o!==null&&Re(o,s,2),si(),Zo(s,2)}if(s=Jc(n),s===null&&Zi(e,t,n,Gs,l),s===a)break;a=s}a!==null&&n.stopPropagation()}else Zi(e,t,n,null,l)}}function Jc(e){return e=io(e),Jo(e)}var Gs=null;function Jo(e){if(Gs=null,e=Vl(e),e!==null){var t=ba(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=_r(t),e!==null)return e;e=null}else if(l===31){if(e=Lr(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gs=e,null}function b0(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(J0()){case Gr:return 2;case Xr:return 8;case ys:case K0:return 32;case Qr:return 268435456;default:return 32}default:return 32}}var Kc=!1,sl=null,il=null,cl=null,ya=new Map,va=new Map,Zt=[],ux="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".split(" ");function gr(e,t){switch(e){case"focusin":case"focusout":sl=null;break;case"dragenter":case"dragleave":il=null;break;case"mouseover":case"mouseout":cl=null;break;case"pointerover":case"pointerout":ya.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":va.delete(t.pointerId)}}function Rn(e,t,l,n,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:s,targetContainers:[a]},t!==null&&(t=zn(t),t!==null&&v0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function rx(e,t,l,n,a){switch(t){case"focusin":return sl=Rn(sl,e,t,l,n,a),!0;case"dragenter":return il=Rn(il,e,t,l,n,a),!0;case"mouseover":return cl=Rn(cl,e,t,l,n,a),!0;case"pointerover":var s=a.pointerId;return ya.set(s,Rn(ya.get(s)||null,e,t,l,n,a)),!0;case"gotpointercapture":return s=a.pointerId,va.set(s,Rn(va.get(s)||null,e,t,l,n,a)),!0}return!1}function j0(e){var t=Vl(e.target);if(t!==null){var l=ba(t);if(l!==null){if(t=l.tag,t===13){if(t=_r(l),t!==null){e.blockedOn=t,tu(e.priority,function(){pr(l)});return}}else if(t===31){if(t=Lr(l),t!==null){e.blockedOn=t,tu(e.priority,function(){pr(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ds(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Jc(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);mc=n,l.target.dispatchEvent(n),mc=null}else return t=zn(l),t!==null&&v0(t),e.blockedOn=l,!1;t.shift()}return!0}function yr(e,t,l){ds(e)&&l.delete(t)}function fx(){Kc=!1,sl!==null&&ds(sl)&&(sl=null),il!==null&&ds(il)&&(il=null),cl!==null&&ds(cl)&&(cl=null),ya.forEach(yr),va.forEach(yr)}function Qa(e,t){e.blockedOn===t&&(e.blockedOn=null,Kc||(Kc=!0,ve.unstable_scheduleCallback(ve.unstable_NormalPriority,fx)))}var Za=null;function vr(e){Za!==e&&(Za=e,ve.unstable_scheduleCallback(ve.unstable_NormalPriority,function(){Za===e&&(Za=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],a=e[t+2];if(typeof n!="function"){if(Jo(n||l)===null)continue;break}var s=zn(l);s!==null&&(e.splice(t,3),t-=3,Ac(s,{pending:!0,data:a,method:l.method,action:n},n,a))}}))}function Sn(e){function t(u){return Qa(u,e)}sl!==null&&Qa(sl,e),il!==null&&Qa(il,e),cl!==null&&Qa(cl,e),ya.forEach(t),va.forEach(t);for(var l=0;l<Zt.length;l++){var n=Zt[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Zt.length&&(l=Zt[0],l.blockedOn===null);)j0(l),l.blockedOn===null&&Zt.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var a=l[n],s=l[n+1],c=a[He]||null;if(typeof s=="function")c||vr(l);else if(c){var o=null;if(s&&s.hasAttribute("formAction")){if(a=s,c=s[He]||null)o=c.formAction;else if(Jo(a)!==null)continue}else o=c.action;typeof o=="function"?l[n+1]=o:(l.splice(n,3),n-=3),vr(l)}}}function S0(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(c){return a=c})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Ko(e){this._internalRoot=e}oi.prototype.render=Ko.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(T(409));var l=t.current,n=Je();y0(l,n,e,t,null,null)};oi.prototype.unmount=Ko.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;y0(e.current,2,null,e,null,null),si(),t[Nn]=null}};function oi(e){this._internalRoot=e}oi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fr();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Zt.length&&t!==0&&t<Zt[l].priority;l++);Zt.splice(l,0,e),l===0&&j0(e)}};var br=Rr.version;if(br!=="19.2.5")throw Error(T(527,br,"19.2.5"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(T(188)):(e=Object.keys(e).join(","),Error(T(268,e)));return e=q0(t),e=e!==null?$r(e):null,e=e===null?null:e.stateNode,e};var dx={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Va=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Va.isDisabled&&Va.supportsFiber)try{ja=Va.inject(dx),Ze=Va}catch{}}Zs.createRoot=function(e,t){if(!Hr(e))throw Error(T(299));var l=!1,n="",a=md,s=hd,c=xd;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=p0(e,1,!1,null,null,l,n,null,a,s,c,S0),e[Nn]=t.current,Go(e),new Ko(t)};Zs.hydrateRoot=function(e,t,l){if(!Hr(e))throw Error(T(299));var n=!1,a="",s=md,c=hd,o=xd,u=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(a=l.identifierPrefix),l.onUncaughtError!==void 0&&(s=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(o=l.onRecoverableError),l.formState!==void 0&&(u=l.formState)),t=p0(e,1,!0,t,l??null,n,a,u,s,c,o,S0),t.context=g0(null),l=t.current,n=Je(),n=lo(n),a=tl(n),a.callback=null,ll(l,a,n),l=n,t.current.lanes=l,Na(t,l),yt(t),e[Nn]=t.current,Go(e),new oi(t)};Zs.version="19.2.5";function N0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(N0)}catch(e){console.error(e)}}N0(),Or.exports=Zs;var mx=Or.exports;const ce=ml((e,t)=>({sessions:[],activeSessionId:null,setActiveSession:l=>{e({activeSessionId:l})},setSessions:l=>{if(e({sessions:l}),!t().activeSessionId&&l.length>0){const a=l.find(s=>s.status==="active")??l[0];a&&e({activeSessionId:a.id})}},upsertSession:l=>{e(n=>{const a=n.sessions.findIndex(s=>s.id===l.id);if(a>=0){const s=[...n.sessions];return s[a]=l,{sessions:s}}return{sessions:[l,...n.sessions]}}),t().activeSessionId||e({activeSessionId:l.id})},removeSession:l=>{e(n=>{var c;const a=n.sessions.filter(o=>o.id!==l),s=n.activeSessionId===l?((c=a.find(o=>o.status==="active")??a[0])==null?void 0:c.id)??null:n.activeSessionId;return{sessions:a,activeSessionId:s}})},getActiveSession:()=>{const{sessions:l,activeSessionId:n}=t();return l.find(a=>a.id===n)??null}}));var wr;const hx=typeof window<"u"&&((wr=window.location)!=null&&wr.host)?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`:"ws://localhost:4700/ws",Da=ml((e,t)=>({status:"disconnected",ws:null,lastHeartbeat:null,collectorUrl:hx,connect:l=>{const n=t().ws;n&&n.close(),e({status:"connecting",collectorUrl:l});const a=new WebSocket(l);a.onopen=()=>{e({status:"connected",ws:a,lastHeartbeat:Date.now()})},a.onclose=()=>{e({status:"disconnected",ws:null})},a.onerror=()=>{e({status:"error",ws:null})},e({ws:a})},disconnect:()=>{const l=t().ws;l&&l.close(),e({status:"disconnected",ws:null})},send:l=>{const n=t().ws;n&&n.readyState===WebSocket.OPEN&&n.send(JSON.stringify(l))},setStatus:l=>e({status:l}),setLastHeartbeat:l=>e({lastHeartbeat:l})}));function xx(e,t){let l;try{l=e()}catch{return}return{getItem:a=>{var s;const c=u=>u===null?null:JSON.parse(u,void 0),o=(s=l.getItem(a))!=null?s:null;return o instanceof Promise?o.then(c):c(o)},setItem:(a,s)=>l.setItem(a,JSON.stringify(s,void 0)),removeItem:a=>l.removeItem(a)}}const Fc=e=>t=>{try{const l=e(t);return l instanceof Promise?l:{then(n){return Fc(n)(l)},catch(n){return this}}}catch(l){return{then(n){return this},catch(n){return Fc(n)(l)}}}},px=(e,t)=>(l,n,a)=>{let s={storage:xx(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,f)=>({...f,...b}),...t},c=!1,o=0;const u=new Set,r=new Set;let h=s.storage;if(!h)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),l(...b)},n,a);const p=()=>{const b=s.partialize({...n()});return h.setItem(s.name,{state:b,version:s.version})},m=a.setState;a.setState=(b,f)=>(m(b,f),p());const g=e((...b)=>(l(...b),p()),n,a);a.getInitialState=()=>g;let y;const j=()=>{var b,f;if(!h)return;const d=++o;c=!1,u.forEach(v=>{var S;return v((S=n())!=null?S:g)});const x=((f=s.onRehydrateStorage)==null?void 0:f.call(s,(b=n())!=null?b:g))||void 0;return Fc(h.getItem.bind(h))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate){const S=s.migrate(v.state,v.version);return S instanceof Promise?S.then(z=>[!0,z]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var S;if(d!==o)return;const[z,N]=v;if(y=s.merge(N,(S=n())!=null?S:g),l(y,!0),z)return p()}).then(()=>{d===o&&(x==null||x(n(),void 0),y=n(),c=!0,r.forEach(v=>v(y)))}).catch(v=>{d===o&&(x==null||x(void 0,v))})};return a.persist={setOptions:b=>{s={...s,...b},b.storage&&(h=b.storage)},clearStorage:()=>{h==null||h.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>j(),hasHydrated:()=>c,onHydrate:b=>(u.add(b),()=>{u.delete(b)}),onFinishHydration:b=>(r.add(b),()=>{r.delete(b)})},s.skipHydration||j(),y||g},gx=px,ui=ml()(gx(e=>({themeId:"neon",setTheme:t=>e({themeId:t})}),{name:"prism-theme"})),z0={neon:{id:"neon",label:"Neon",bg:"#09090B",headerBg:"rgba(9,9,11,0.95)",toolbarBg:"rgba(9,9,11,0.8)",sidebarBg:"rgba(9,9,11,0.95)",running:"#00FF88",success:"#00FF88",error:"#FF3366",info:"#00BBFF",warn:"#FFAA00",purple:"#BB88FF",chartColors:["#00FF88","#00BBFF","#FFAA00","#FF3366","#BB88FF","#FF8844","#44FFBB"]},claude:{id:"claude",label:"Claude",bg:"#1C1B19",headerBg:"rgba(24,23,19,0.95)",toolbarBg:"rgba(24,23,19,0.8)",sidebarBg:"rgba(22,21,17,0.95)",running:"#CC785C",success:"#7FB069",error:"#C0392B",info:"#5B8DB8",warn:"#E8A838",purple:"#9B7FC4",chartColors:["#CC785C","#5B8DB8","#E8A838","#C0392B","#9B7FC4","#D4956A","#7FB069"]}};function H(){const e=ui(t=>t.themeId);return z0[e]}function yx({status:e,url:t="localhost:4700"}){const l=H(),a={connected:{label:"Connected",color:l.success,glow:!0},connecting:{label:"Connecting…",color:l.warn,pulse:!0},disconnected:{label:"Disconnected",color:"#52525b"},error:{label:"Error",color:l.error,glow:!0}}[e];return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:a.pulse?"h-2 w-2 rounded-full flex-shrink-0 animate-pulse":"h-2 w-2 rounded-full flex-shrink-0",style:{background:a.color,boxShadow:a.glow?`0 0 6px ${a.color}`:"none"}}),i.jsxs("div",{className:"flex flex-col leading-none",children:[i.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:a.color},children:a.label}),i.jsx("span",{className:"text-[10px] font-mono text-zinc-300",children:t})]})]})}function Ki(){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:i.jsx("path",{d:"M2 3h8M5 3V2h2v1M4 3v6.5a.5.5 0 00.5.5h3a.5.5 0 00.5-.5V3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function vx(){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:i.jsx("path",{d:"M7.5 1.5L9 3M9 3l-5 5-2 .5.5-2 5-5L9 3zM3 8l1 1",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}const jl=3,bx=jl*24*60*60*1e3;function jx({open:e}){return i.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",className:ge("transition-transform duration-150",e?"rotate-180":""),children:i.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Sx(){const{sessions:e,activeSessionId:t,setActiveSession:l,removeSession:n}=ce(),{status:a,collectorUrl:s}=Da(),{themeId:c,setTheme:o}=ui(),u=H(),[r,h]=C.useState(!1),[p,m]=C.useState(null),[g,y]=C.useState(null),[j,b]=C.useState(!1),[f,d]=C.useState(!1),x=C.useRef(null),v=s.replace(/^ws/,"http").replace(/\/ws$/,""),S=Date.now(),z=E=>S-(E.lastActivityAt??E.startedAt)>=bx,N=e.filter(z).length;C.useEffect(()=>{if(!r)return;function E(_){var F;(F=x.current)!=null&&F.contains(_.target)||h(!1)}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[r]),C.useEffect(()=>{if(!r)return;function E(_){_.key==="Escape"&&h(!1)}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[r]);const M=e.find(E=>E.id===t);async function A(E,_){_.stopPropagation();const F=e.find(B=>B.id===E),w=F?`${F.name} — ${ot(new Date(F.startedAt),"MMM d, HH:mm:ss")}`:E;if(confirm(`Delete session "${w}"? This cannot be undone.`)){m(E);try{const B=await fetch(`${v}/api/sessions/${E}`,{method:"DELETE"});if(!B.ok)throw new Error(`HTTP ${B.status}`);n(E)}catch(B){alert(`Failed to delete: ${B instanceof Error?B.message:String(B)}`)}finally{m(null)}}}async function D(){const E=e.find(_=>_.id===t);if(E&&confirm(`Purge tool calls for "${E.name}"?
|
|
32
|
+
`+n.stack}}var uc=Object.prototype.hasOwnProperty,lo=ve.unstable_scheduleCallback,gi=ve.unstable_cancelCallback,V0=ve.unstable_shouldYield,J0=ve.unstable_requestPaint,Qe=ve.unstable_now,K0=ve.unstable_getCurrentPriorityLevel,Xr=ve.unstable_ImmediatePriority,Qr=ve.unstable_UserBlockingPriority,vs=ve.unstable_NormalPriority,F0=ve.unstable_LowPriority,Zr=ve.unstable_IdlePriority,W0=ve.log,I0=ve.unstable_setDisableYieldValue,Sa=null,Ze=null;function Jt(e){if(typeof W0=="function"&&I0(e),Ze&&typeof Ze.setStrictMode=="function")try{Ze.setStrictMode(Sa,e)}catch{}}var Ve=Math.clz32?Math.clz32:tm,P0=Math.log,em=Math.LN2;function tm(e){return e>>>=0,e===0?32:31-(P0(e)/em|0)|0}var Ba=256,Ra=262144,Ha=4194304;function yl(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Js(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var a=0,s=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var o=n&134217727;return o!==0?(n=o&~s,n!==0?a=yl(n):(c&=o,c!==0?a=yl(c):l||(l=o&~e,l!==0&&(a=yl(l))))):(o=n&~s,o!==0?a=yl(o):c!==0?a=yl(c):l||(l=n&~e,l!==0&&(a=yl(l)))),a===0?0:t!==0&&t!==a&&!(t&s)&&(s=a&-a,l=t&-t,s>=l||s===32&&(l&4194048)!==0)?t:a}function Na(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vr(){var e=Ha;return Ha<<=1,!(Ha&62914560)&&(Ha=4194304),e}function yi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function za(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nm(e,t,l,n,a,s){var c=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var o=e.entanglements,u=e.expirationTimes,r=e.hiddenUpdates;for(l=c&~l;0<l;){var h=31-Ve(l),p=1<<h;o[h]=0,u[h]=-1;var m=r[h];if(m!==null)for(r[h]=null,h=0;h<m.length;h++){var g=m[h];g!==null&&(g.lane&=-536870913)}l&=~p}n!==0&&Jr(e,n,0),s!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=s&~(c&~t))}function Jr(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ve(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function Kr(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-Ve(l),a=1<<n;a&t|e[n]&t&&(e[n]|=t),l&=~a}}function Fr(e,t){var l=t&-t;return l=l&42?1:no(l),l&(e.suspendedLanes|t)?0:l}function no(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ao(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Wr(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:j0(e.type))}function lu(e,t){var l=V.p;try{return V.p=e,t()}finally{V.p=l}}var hl=Math.random().toString(36).slice(2),ze="__reactFiber$"+hl,He="__reactProps$"+hl,zn="__reactContainer$"+hl,rc="__reactEvents$"+hl,am="__reactListeners$"+hl,sm="__reactHandles$"+hl,nu="__reactResources$"+hl,Ca="__reactMarker$"+hl;function so(e){delete e[ze],delete e[He],delete e[rc],delete e[am],delete e[sm]}function Vl(e){var t=e[ze];if(t)return t;for(var l=e.parentNode;l;){if(t=l[zn]||l[ze]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=rr(e);e!==null;){if(l=e[ze])return l;e=rr(e)}return t}e=l,l=e.parentNode}return null}function Cn(e){if(e=e[ze]||e[zn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $n(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(T(33))}function sn(e){var t=e[nu];return t||(t=e[nu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function je(e){e[Ca]=!0}var Ir=new Set,Pr={};function Ol(e,t){hn(e,t),hn(e+"Capture",t)}function hn(e,t){for(Pr[e]=t,e=0;e<t.length;e++)Ir.add(t[e])}var im=RegExp("^[: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]*$"),au={},su={};function cm(e){return uc.call(su,e)?!0:uc.call(au,e)?!1:im.test(e)?su[e]=!0:(au[e]=!0,!1)}function Pa(e,t,l){if(cm(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function _a(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function bt(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function Pe(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ef(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function om(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(c){l=""+c,s.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fc(e){if(!e._valueTracker){var t=ef(e)?"checked":"value";e._valueTracker=om(e,t,""+e[t])}}function tf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=ef(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function bs(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}}var um=/[\n"\\]/g;function lt(e){return e.replace(um,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function dc(e,t,l,n,a,s,c,o){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pe(t)):e.value!==""+Pe(t)&&(e.value=""+Pe(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?mc(e,c,Pe(t)):l!=null?mc(e,c,Pe(l)):n!=null&&e.removeAttribute("value"),a==null&&s!=null&&(e.defaultChecked=!!s),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Pe(o):e.removeAttribute("name")}function lf(e,t,l,n,a,s,c,o){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||l!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){fc(e);return}l=l!=null?""+Pe(l):"",t=t!=null?""+Pe(t):l,o||t===e.value||(e.value=t),e.defaultValue=t}n=n??a,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=o?e.checked:!!n,e.defaultChecked=!!n,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),fc(e)}function mc(e,t,l){t==="number"&&bs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function cn(e,t,l,n){if(e=e.options,t){t={};for(var a=0;a<l.length;a++)t["$"+l[a]]=!0;for(l=0;l<e.length;l++)a=t.hasOwnProperty("$"+e[l].value),e[l].selected!==a&&(e[l].selected=a),a&&n&&(e[l].defaultSelected=!0)}else{for(l=""+Pe(l),t=null,a=0;a<e.length;a++){if(e[a].value===l){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function nf(e,t,l){if(t!=null&&(t=""+Pe(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Pe(l):""}function af(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(T(92));if(Ln(n)){if(1<n.length)throw Error(T(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Pe(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),fc(e)}function xn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var rm=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function iu(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||rm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function sf(e,t,l){if(t!=null&&typeof t!="object")throw Error(T(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var a in t)n=t[a],t.hasOwnProperty(a)&&l[a]!==n&&iu(e,a,n)}else for(var s in t)t.hasOwnProperty(s)&&iu(e,s,t[s])}function io(e){if(e.indexOf("-")===-1)return!1;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 fm=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dm=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function es(e){return dm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function wt(){}var hc=null;function co(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jl=null,on=null;function cu(e){var t=Cn(e);if(t&&(e=t.stateNode)){var l=e[He]||null;e:switch(e=t.stateNode,t.type){case"input":if(dc(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+lt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var a=n[He]||null;if(!a)throw Error(T(90));dc(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&tf(n)}break e;case"textarea":nf(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&cn(e,!!l.multiple,t,!1)}}}var vi=!1;function cf(e,t,l){if(vi)return e(t,l);vi=!0;try{var n=e(t);return n}finally{if(vi=!1,(Jl!==null||on!==null)&&(ii(),Jl&&(t=Jl,e=on,on=Jl=null,cu(t),e)))for(t=0;t<e.length;t++)cu(e[t])}}function oa(e,t){var l=e.stateNode;if(l===null)return null;var n=l[He]||null;if(n===null)return null;l=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(T(231,t,typeof l));return l}var Ot=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xc=!1;if(Ot)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){xc=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{xc=!1}var Kt=null,oo=null,ts=null;function of(){if(ts)return ts;var e,t=oo,l=t.length,n,a="value"in Kt?Kt.value:Kt.textContent,s=a.length;for(e=0;e<l&&t[e]===a[e];e++);var c=l-e;for(n=1;n<=c&&t[l-n]===a[s-n];n++);return ts=a.slice(e,1<n?1-n:void 0)}function ls(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 La(){return!0}function ou(){return!1}function _e(e){function t(l,n,a,s,c){this._reactName=l,this._targetInst=a,this.type=n,this.nativeEvent=s,this.target=c,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(l=e[o],this[o]=l?l(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?La:ou,this.isPropagationStopped=ou,this}return se(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=La)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=La)},persist:function(){},isPersistent:La}),t}var Ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ks=_e(Ul),Ta=se({},Ul,{view:0,detail:0}),mm=_e(Ta),bi,ji,On,Fs=se({},Ta,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uo,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!==On&&(On&&e.type==="mousemove"?(bi=e.screenX-On.screenX,ji=e.screenY-On.screenY):ji=bi=0,On=e),bi)},movementY:function(e){return"movementY"in e?e.movementY:ji}}),uu=_e(Fs),hm=se({},Fs,{dataTransfer:0}),xm=_e(hm),pm=se({},Ta,{relatedTarget:0}),Si=_e(pm),gm=se({},Ul,{animationName:0,elapsedTime:0,pseudoElement:0}),ym=_e(gm),vm=se({},Ul,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bm=_e(vm),jm=se({},Ul,{data:0}),ru=_e(jm),Sm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nm={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"},zm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zm[e])?!!t[e]:!1}function uo(){return Cm}var Tm=se({},Ta,{key:function(e){if(e.key){var t=Sm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ls(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uo,charCode:function(e){return e.type==="keypress"?ls(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ls(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),km=_e(Tm),wm=se({},Fs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fu=_e(wm),Am=se({},Ta,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uo}),Mm=_e(Am),Em=se({},Ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dm=_e(Em),Om=se({},Fs,{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}),Um=_e(Om),Bm=se({},Ul,{newState:0,oldState:0}),Rm=_e(Bm),Hm=[9,13,27,32],ro=Ot&&"CompositionEvent"in window,Jn=null;Ot&&"documentMode"in document&&(Jn=document.documentMode);var _m=Ot&&"TextEvent"in window&&!Jn,uf=Ot&&(!ro||Jn&&8<Jn&&11>=Jn),du=" ",mu=!1;function rf(e,t){switch(e){case"keyup":return Hm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kl=!1;function Lm(e,t){switch(e){case"compositionend":return ff(t);case"keypress":return t.which!==32?null:(mu=!0,du);case"textInput":return e=t.data,e===du&&mu?null:e;default:return null}}function $m(e,t){if(Kl)return e==="compositionend"||!ro&&rf(e,t)?(e=of(),ts=oo=Kt=null,Kl=!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 uf&&t.locale!=="ko"?null:t.data;default:return null}}var qm={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 hu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qm[e.type]:t==="textarea"}function df(e,t,l,n){Jl?on?on.push(n):on=[n]:Jl=n,t=_s(t,"onChange"),0<t.length&&(l=new Ks("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var Kn=null,ua=null;function Ym(e){c0(e,0)}function Ws(e){var t=$n(e);if(tf(t))return e}function xu(e,t){if(e==="change")return t}var mf=!1;if(Ot){var Ni;if(Ot){var zi="oninput"in document;if(!zi){var pu=document.createElement("div");pu.setAttribute("oninput","return;"),zi=typeof pu.oninput=="function"}Ni=zi}else Ni=!1;mf=Ni&&(!document.documentMode||9<document.documentMode)}function gu(){Kn&&(Kn.detachEvent("onpropertychange",hf),ua=Kn=null)}function hf(e){if(e.propertyName==="value"&&Ws(ua)){var t=[];df(t,ua,e,co(e)),cf(Ym,t)}}function Gm(e,t,l){e==="focusin"?(gu(),Kn=t,ua=l,Kn.attachEvent("onpropertychange",hf)):e==="focusout"&&gu()}function Xm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ws(ua)}function Qm(e,t){if(e==="click")return Ws(t)}function Zm(e,t){if(e==="input"||e==="change")return Ws(t)}function Vm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ke=typeof Object.is=="function"?Object.is:Vm;function ra(e,t){if(Ke(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var a=l[n];if(!uc.call(t,a)||!Ke(e[a],t[a]))return!1}return!0}function yu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vu(e,t){var l=yu(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=yu(l)}}function xf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bs(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=bs(e.document)}return t}function fo(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")}var Jm=Ot&&"documentMode"in document&&11>=document.documentMode,Fl=null,pc=null,Fn=null,gc=!1;function bu(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;gc||Fl==null||Fl!==bs(n)||(n=Fl,"selectionStart"in n&&fo(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Fn&&ra(Fn,n)||(Fn=n,n=_s(pc,"onSelect"),0<n.length&&(t=new Ks("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=Fl)))}function pl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Wl={animationend:pl("Animation","AnimationEnd"),animationiteration:pl("Animation","AnimationIteration"),animationstart:pl("Animation","AnimationStart"),transitionrun:pl("Transition","TransitionRun"),transitionstart:pl("Transition","TransitionStart"),transitioncancel:pl("Transition","TransitionCancel"),transitionend:pl("Transition","TransitionEnd")},Ci={},gf={};Ot&&(gf=document.createElement("div").style,"AnimationEvent"in window||(delete Wl.animationend.animation,delete Wl.animationiteration.animation,delete Wl.animationstart.animation),"TransitionEvent"in window||delete Wl.transitionend.transition);function Bl(e){if(Ci[e])return Ci[e];if(!Wl[e])return e;var t=Wl[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in gf)return Ci[e]=t[l];return e}var yf=Bl("animationend"),vf=Bl("animationiteration"),bf=Bl("animationstart"),Km=Bl("transitionrun"),Fm=Bl("transitionstart"),Wm=Bl("transitioncancel"),jf=Bl("transitionend"),Sf=new Map,yc="abort auxClick beforeToggle 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(" ");yc.push("scrollEnd");function dt(e,t){Sf.set(e,t),Ol(t,[e])}var js=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ie=[],Il=0,mo=0;function Is(){for(var e=Il,t=mo=Il=0;t<e;){var l=Ie[t];Ie[t++]=null;var n=Ie[t];Ie[t++]=null;var a=Ie[t];Ie[t++]=null;var s=Ie[t];if(Ie[t++]=null,n!==null&&a!==null){var c=n.pending;c===null?a.next=a:(a.next=c.next,c.next=a),n.pending=a}s!==0&&Nf(l,a,s)}}function Ps(e,t,l,n){Ie[Il++]=e,Ie[Il++]=t,Ie[Il++]=l,Ie[Il++]=n,mo|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function ho(e,t,l,n){return Ps(e,t,l,n),Ss(e)}function Rl(e,t){return Ps(e,null,null,t),Ss(e)}function Nf(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var a=!1,s=e.return;s!==null;)s.childLanes|=l,n=s.alternate,n!==null&&(n.childLanes|=l),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(a=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,a&&t!==null&&(a=31-Ve(l),e=s.hiddenUpdates,n=e[a],n===null?e[a]=[t]:n.push(t),t.lane=l|536870912),s):null}function Ss(e){if(50<sa)throw sa=0,Lc=null,Error(T(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pl={};function Im(e,t,l,n){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ge(e,t,l,n){return new Im(e,t,l,n)}function xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mt(e,t){var l=e.alternate;return l===null?(l=Ge(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function zf(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ns(e,t,l,n,a,s){var c=0;if(n=e,typeof e=="function")xo(e)&&(c=1);else if(typeof e=="string")c=nx(e,l,pt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case sc:return e=Ge(31,l,t,a),e.elementType=sc,e.lanes=s,e;case Ql:return zl(l.children,a,s,t);case Yr:c=8,a|=24;break;case lc:return e=Ge(12,l,t,a|2),e.elementType=lc,e.lanes=s,e;case nc:return e=Ge(13,l,t,a),e.elementType=nc,e.lanes=s,e;case ac:return e=Ge(19,l,t,a),e.elementType=ac,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kt:c=10;break e;case Gr:c=9;break e;case eo:c=11;break e;case to:c=14;break e;case qt:c=16,n=null;break e}c=29,l=Error(T(130,e===null?"null":typeof e,"")),n=null}return t=Ge(c,l,t,a),t.elementType=e,t.type=n,t.lanes=s,t}function zl(e,t,l,n){return e=Ge(7,e,n,t),e.lanes=l,e}function Ti(e,t,l){return e=Ge(6,e,null,t),e.lanes=l,e}function Cf(e){var t=Ge(18,null,null,0);return t.stateNode=e,t}function ki(e,t,l){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ju=new WeakMap;function nt(e,t){if(typeof e=="object"&&e!==null){var l=ju.get(e);return l!==void 0?l:(t={value:e,source:t,stack:tu(t)},ju.set(e,t),t)}return{value:e,source:t,stack:tu(t)}}var en=[],tn=0,Ns=null,fa=0,et=[],tt=0,ol=null,mt=1,ht="";function Ct(e,t){en[tn++]=fa,en[tn++]=Ns,Ns=e,fa=t}function Tf(e,t,l){et[tt++]=mt,et[tt++]=ht,et[tt++]=ol,ol=e;var n=mt;e=ht;var a=32-Ve(n)-1;n&=~(1<<a),l+=1;var s=32-Ve(t)+a;if(30<s){var c=a-a%5;s=(n&(1<<c)-1).toString(32),n>>=c,a-=c,mt=1<<32-Ve(t)+a|l<<a|n,ht=s+e}else mt=1<<s|l<<a|n,ht=e}function po(e){e.return!==null&&(Ct(e,1),Tf(e,1,0))}function go(e){for(;e===Ns;)Ns=en[--tn],en[tn]=null,fa=en[--tn],en[tn]=null;for(;e===ol;)ol=et[--tt],et[tt]=null,ht=et[--tt],et[tt]=null,mt=et[--tt],et[tt]=null}function kf(e,t){et[tt++]=mt,et[tt++]=ht,et[tt++]=ol,mt=t.id,ht=t.overflow,ol=e}var Ce=null,ae=null,Q=!1,el=null,at=!1,vc=Error(T(519));function ul(e){var t=Error(T(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw da(nt(t,e)),vc}function Su(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[ze]=e,t[He]=n,l){case"dialog":q("cancel",t),q("close",t);break;case"iframe":case"object":case"embed":q("load",t);break;case"video":case"audio":for(l=0;l<pa.length;l++)q(pa[l],t);break;case"source":q("error",t);break;case"img":case"image":case"link":q("error",t),q("load",t);break;case"details":q("toggle",t);break;case"input":q("invalid",t),lf(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":q("invalid",t);break;case"textarea":q("invalid",t),af(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||u0(t.textContent,l)?(n.popover!=null&&(q("beforetoggle",t),q("toggle",t)),n.onScroll!=null&&q("scroll",t),n.onScrollEnd!=null&&q("scrollend",t),n.onClick!=null&&(t.onclick=wt),t=!0):t=!1,t||ul(e,!0)}function Nu(e){for(Ce=e.return;Ce;)switch(Ce.tag){case 5:case 31:case 13:at=!1;return;case 27:case 3:at=!0;return;default:Ce=Ce.return}}function Ll(e){if(e!==Ce)return!1;if(!Q)return Nu(e),Q=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Xc(e.type,e.memoizedProps)),l=!l),l&&ae&&ul(e),Nu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));ae=ur(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));ae=ur(e)}else t===27?(t=ae,xl(e.type)?(e=Jc,Jc=null,ae=e):ae=t):ae=Ce?ct(e.stateNode.nextSibling):null;return!0}function wl(){ae=Ce=null,Q=!1}function wi(){var e=el;return e!==null&&(Be===null?Be=e:Be.push.apply(Be,e),el=null),e}function da(e){el===null?el=[e]:el.push(e)}var bc=gt(null),Hl=null,At=null;function Gt(e,t,l){le(bc,t._currentValue),t._currentValue=l}function Et(e){e._currentValue=bc.current,Se(bc)}function jc(e,t,l){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===l)break;e=e.return}}function Sc(e,t,l,n){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var s=a.dependencies;if(s!==null){var c=a.child;s=s.firstContext;e:for(;s!==null;){var o=s;s=a;for(var u=0;u<t.length;u++)if(o.context===t[u]){s.lanes|=l,o=s.alternate,o!==null&&(o.lanes|=l),jc(s.return,l,e),n||(c=null);break e}s=o.next}}else if(a.tag===18){if(c=a.return,c===null)throw Error(T(341));c.lanes|=l,s=c.alternate,s!==null&&(s.lanes|=l),jc(c,l,e),c=null}else c=a.child;if(c!==null)c.return=a;else for(c=a;c!==null;){if(c===e){c=null;break}if(a=c.sibling,a!==null){a.return=c.return,c=a;break}c=c.return}a=c}}function Tn(e,t,l,n){e=null;for(var a=t,s=!1;a!==null;){if(!s){if(a.flags&524288)s=!0;else if(a.flags&262144)break}if(a.tag===10){var c=a.alternate;if(c===null)throw Error(T(387));if(c=c.memoizedProps,c!==null){var o=a.type;Ke(a.pendingProps.value,c.value)||(e!==null?e.push(o):e=[o])}}else if(a===ps.current){if(c=a.alternate,c===null)throw Error(T(387));c.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(ya):e=[ya])}a=a.return}e!==null&&Sc(t,e,l,n),t.flags|=262144}function zs(e){for(e=e.firstContext;e!==null;){if(!Ke(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Al(e){Hl=e,At=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Te(e){return wf(Hl,e)}function $a(e,t){return Hl===null&&Al(e),wf(e,t)}function wf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},At===null){if(e===null)throw Error(T(308));At=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else At=At.next=t;return l}var Pm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},eh=ve.unstable_scheduleCallback,th=ve.unstable_NormalPriority,xe={$$typeof:kt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yo(){return{controller:new Pm,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&eh(th,function(){e.controller.abort()})}var Wn=null,Nc=0,pn=0,un=null;function lh(e,t){if(Wn===null){var l=Wn=[];Nc=0,pn=Go(),un={status:"pending",value:void 0,then:function(n){l.push(n)}}}return Nc++,t.then(zu,zu),t}function zu(){if(--Nc===0&&Wn!==null){un!==null&&(un.status="fulfilled");var e=Wn;Wn=null,pn=0,un=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function nh(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(a){l.push(a)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var a=0;a<l.length;a++)(0,l[a])(t)},function(a){for(n.status="rejected",n.reason=a,a=0;a<l.length;a++)(0,l[a])(void 0)}),n}var Cu=R.S;R.S=function(e,t){Yd=Qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&lh(e,t),Cu!==null&&Cu(e,t)};var Cl=gt(null);function vo(){var e=Cl.current;return e!==null?e:ee.pooledCache}function as(e,t){t===null?le(Cl,Cl.current):le(Cl,t.pool)}function Af(){var e=vo();return e===null?null:{parent:xe._currentValue,pool:e}}var kn=Error(T(460)),bo=Error(T(474)),ei=Error(T(542)),Cs={then:function(){}};function Tu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Mf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(wt,wt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wu(e),e;default:if(typeof t.status=="string")t.then(wt,wt);else{if(e=ee,e!==null&&100<e.shellSuspendCounter)throw Error(T(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=n}},function(n){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wu(e),e}throw Tl=t,kn}}function vl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Tl=l,kn):l}}var Tl=null;function ku(){if(Tl===null)throw Error(T(459));var e=Tl;return Tl=null,e}function wu(e){if(e===kn||e===ei)throw Error(T(483))}var rn=null,ma=0;function qa(e){var t=ma;return ma+=1,rn===null&&(rn=[]),Mf(rn,e,t)}function Un(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ya(e,t){throw t.$$typeof===G0?Error(T(525)):(e=Object.prototype.toString.call(t),Error(T(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ef(e){function t(f,d){if(e){var x=f.deletions;x===null?(f.deletions=[d],f.flags|=16):x.push(d)}}function l(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function n(f){for(var d=new Map;f!==null;)f.key!==null?d.set(f.key,f):d.set(f.index,f),f=f.sibling;return d}function a(f,d){return f=Mt(f,d),f.index=0,f.sibling=null,f}function s(f,d,x){return f.index=x,e?(x=f.alternate,x!==null?(x=x.index,x<d?(f.flags|=67108866,d):x):(f.flags|=67108866,d)):(f.flags|=1048576,d)}function c(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function o(f,d,x,v){return d===null||d.tag!==6?(d=Ti(x,f.mode,v),d.return=f,d):(d=a(d,x),d.return=f,d)}function u(f,d,x,v){var S=x.type;return S===Ql?h(f,d,x.props.children,v,x.key):d!==null&&(d.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===qt&&vl(S)===d.type)?(d=a(d,x.props),Un(d,x),d.return=f,d):(d=ns(x.type,x.key,x.props,null,f.mode,v),Un(d,x),d.return=f,d)}function r(f,d,x,v){return d===null||d.tag!==4||d.stateNode.containerInfo!==x.containerInfo||d.stateNode.implementation!==x.implementation?(d=ki(x,f.mode,v),d.return=f,d):(d=a(d,x.children||[]),d.return=f,d)}function h(f,d,x,v,S){return d===null||d.tag!==7?(d=zl(x,f.mode,v,S),d.return=f,d):(d=a(d,x),d.return=f,d)}function p(f,d,x){if(typeof d=="string"&&d!==""||typeof d=="number"||typeof d=="bigint")return d=Ti(""+d,f.mode,x),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Ua:return x=ns(d.type,d.key,d.props,null,f.mode,x),Un(x,d),x.return=f,x;case _n:return d=ki(d,f.mode,x),d.return=f,d;case qt:return d=vl(d),p(f,d,x)}if(Ln(d)||En(d))return d=zl(d,f.mode,x,null),d.return=f,d;if(typeof d.then=="function")return p(f,qa(d),x);if(d.$$typeof===kt)return p(f,$a(f,d),x);Ya(f,d)}return null}function m(f,d,x,v){var S=d!==null?d.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return S!==null?null:o(f,d,""+x,v);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ua:return x.key===S?u(f,d,x,v):null;case _n:return x.key===S?r(f,d,x,v):null;case qt:return x=vl(x),m(f,d,x,v)}if(Ln(x)||En(x))return S!==null?null:h(f,d,x,v,null);if(typeof x.then=="function")return m(f,d,qa(x),v);if(x.$$typeof===kt)return m(f,d,$a(f,x),v);Ya(f,x)}return null}function g(f,d,x,v,S){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return f=f.get(x)||null,o(d,f,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ua:return f=f.get(v.key===null?x:v.key)||null,u(d,f,v,S);case _n:return f=f.get(v.key===null?x:v.key)||null,r(d,f,v,S);case qt:return v=vl(v),g(f,d,x,v,S)}if(Ln(v)||En(v))return f=f.get(x)||null,h(d,f,v,S,null);if(typeof v.then=="function")return g(f,d,x,qa(v),S);if(v.$$typeof===kt)return g(f,d,x,$a(d,v),S);Ya(d,v)}return null}function y(f,d,x,v){for(var S=null,z=null,N=d,M=d=0,A=null;N!==null&&M<x.length;M++){N.index>M?(A=N,N=null):A=N.sibling;var D=m(f,N,x[M],v);if(D===null){N===null&&(N=A);break}e&&N&&D.alternate===null&&t(f,N),d=s(D,d,M),z===null?S=D:z.sibling=D,z=D,N=A}if(M===x.length)return l(f,N),Q&&Ct(f,M),S;if(N===null){for(;M<x.length;M++)N=p(f,x[M],v),N!==null&&(d=s(N,d,M),z===null?S=N:z.sibling=N,z=N);return Q&&Ct(f,M),S}for(N=n(N);M<x.length;M++)A=g(N,f,M,x[M],v),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?M:A.key),d=s(A,d,M),z===null?S=A:z.sibling=A,z=A);return e&&N.forEach(function(X){return t(f,X)}),Q&&Ct(f,M),S}function j(f,d,x,v){if(x==null)throw Error(T(151));for(var S=null,z=null,N=d,M=d=0,A=null,D=x.next();N!==null&&!D.done;M++,D=x.next()){N.index>M?(A=N,N=null):A=N.sibling;var X=m(f,N,D.value,v);if(X===null){N===null&&(N=A);break}e&&N&&X.alternate===null&&t(f,N),d=s(X,d,M),z===null?S=X:z.sibling=X,z=X,N=A}if(D.done)return l(f,N),Q&&Ct(f,M),S;if(N===null){for(;!D.done;M++,D=x.next())D=p(f,D.value,v),D!==null&&(d=s(D,d,M),z===null?S=D:z.sibling=D,z=D);return Q&&Ct(f,M),S}for(N=n(N);!D.done;M++,D=x.next())D=g(N,f,M,D.value,v),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?M:D.key),d=s(D,d,M),z===null?S=D:z.sibling=D,z=D);return e&&N.forEach(function(te){return t(f,te)}),Q&&Ct(f,M),S}function b(f,d,x,v){if(typeof x=="object"&&x!==null&&x.type===Ql&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ua:e:{for(var S=x.key;d!==null;){if(d.key===S){if(S=x.type,S===Ql){if(d.tag===7){l(f,d.sibling),v=a(d,x.props.children),v.return=f,f=v;break e}}else if(d.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===qt&&vl(S)===d.type){l(f,d.sibling),v=a(d,x.props),Un(v,x),v.return=f,f=v;break e}l(f,d);break}else t(f,d);d=d.sibling}x.type===Ql?(v=zl(x.props.children,f.mode,v,x.key),v.return=f,f=v):(v=ns(x.type,x.key,x.props,null,f.mode,v),Un(v,x),v.return=f,f=v)}return c(f);case _n:e:{for(S=x.key;d!==null;){if(d.key===S)if(d.tag===4&&d.stateNode.containerInfo===x.containerInfo&&d.stateNode.implementation===x.implementation){l(f,d.sibling),v=a(d,x.children||[]),v.return=f,f=v;break e}else{l(f,d);break}else t(f,d);d=d.sibling}v=ki(x,f.mode,v),v.return=f,f=v}return c(f);case qt:return x=vl(x),b(f,d,x,v)}if(Ln(x))return y(f,d,x,v);if(En(x)){if(S=En(x),typeof S!="function")throw Error(T(150));return x=S.call(x),j(f,d,x,v)}if(typeof x.then=="function")return b(f,d,qa(x),v);if(x.$$typeof===kt)return b(f,d,$a(f,x),v);Ya(f,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,d!==null&&d.tag===6?(l(f,d.sibling),v=a(d,x),v.return=f,f=v):(l(f,d),v=Ti(x,f.mode,v),v.return=f,f=v),c(f)):l(f,d)}return function(f,d,x,v){try{ma=0;var S=b(f,d,x,v);return rn=null,S}catch(N){if(N===kn||N===ei)throw N;var z=Ge(29,N,null,f.mode);return z.lanes=v,z.return=f,z}finally{}}}var Ml=Ef(!0),Df=Ef(!1),Yt=!1;function jo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function tl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ll(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Z&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,t=Ss(e),Nf(e,null,l),t}return Ps(e,n,t,l),Ss(e)}function In(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,Kr(e,l)}}function Ai(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var a=null,s=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};s===null?a=s=c:s=s.next=c,l=l.next}while(l!==null);s===null?a=s=t:s=s.next=t}else a=s=t;l={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:s,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Cc=!1;function Pn(){if(Cc){var e=un;if(e!==null)throw e}}function ea(e,t,l,n){Cc=!1;var a=e.updateQueue;Yt=!1;var s=a.firstBaseUpdate,c=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var u=o,r=u.next;u.next=null,c===null?s=r:c.next=r,c=u;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==c&&(o===null?h.firstBaseUpdate=r:o.next=r,h.lastBaseUpdate=u))}if(s!==null){var p=a.baseState;c=0,h=r=u=null,o=s;do{var m=o.lane&-536870913,g=m!==o.lane;if(g?(G&m)===m:(n&m)===m){m!==0&&m===pn&&(Cc=!0),h!==null&&(h=h.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var y=e,j=o;m=t;var b=l;switch(j.tag){case 1:if(y=j.payload,typeof y=="function"){p=y.call(b,p,m);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=j.payload,m=typeof y=="function"?y.call(b,p,m):y,m==null)break e;p=se({},p,m);break e;case 2:Yt=!0}}m=o.callback,m!==null&&(e.flags|=64,g&&(e.flags|=8192),g=a.callbacks,g===null?a.callbacks=[m]:g.push(m))}else g={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(r=h=g,u=p):h=h.next=g,c|=m;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;g=o,o=g.next,g.next=null,a.lastBaseUpdate=g,a.shared.pending=null}}while(!0);h===null&&(u=p),a.baseState=u,a.firstBaseUpdate=r,a.lastBaseUpdate=h,s===null&&(a.shared.lanes=0),fl|=c,e.lanes=c,e.memoizedState=p}}function Of(e,t){if(typeof e!="function")throw Error(T(191,e));e.call(t)}function Uf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Of(l[e],t)}var gn=gt(null),Ts=gt(0);function Au(e,t){e=Ht,le(Ts,e),le(gn,t),Ht=e|t.baseLanes}function Tc(){le(Ts,Ht),le(gn,gn.current)}function So(){Ht=Ts.current,Se(gn),Se(Ts)}var Fe=gt(null),it=null;function Xt(e){var t=e.alternate;le(re,re.current&1),le(Fe,e),it===null&&(t===null||gn.current!==null||t.memoizedState!==null)&&(it=e)}function kc(e){le(re,re.current),le(Fe,e),it===null&&(it=e)}function Bf(e){e.tag===22?(le(re,re.current),le(Fe,e),it===null&&(it=e)):Qt()}function Qt(){le(re,re.current),le(Fe,Fe.current)}function Ye(e){Se(Fe),it===e&&(it=null),Se(re)}var re=gt(0);function ks(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Zc(l)||Vc(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 Ut=0,L=null,P=null,me=null,ws=!1,fn=!1,El=!1,As=0,ha=0,dn=null,ah=0;function oe(){throw Error(T(321))}function No(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Ke(e[l],t[l]))return!1;return!0}function zo(e,t,l,n,a,s){return Ut=s,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?dd:Bo,El=!1,s=l(n,a),El=!1,fn&&(s=Hf(t,l,n,a)),Rf(e),s}function Rf(e){R.H=xa;var t=P!==null&&P.next!==null;if(Ut=0,me=P=L=null,ws=!1,ha=0,dn=null,t)throw Error(T(300));e===null||pe||(e=e.dependencies,e!==null&&zs(e)&&(pe=!0))}function Hf(e,t,l,n){L=e;var a=0;do{if(fn&&(dn=null),ha=0,fn=!1,25<=a)throw Error(T(301));if(a+=1,me=P=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}R.H=md,s=t(l,n)}while(fn);return s}function sh(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?wa(t):t,e=e.useState()[0],(P!==null?P.memoizedState:null)!==e&&(L.flags|=1024),t}function Co(){var e=As!==0;return As=0,e}function To(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function ko(e){if(ws){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ws=!1}Ut=0,me=P=L=null,fn=!1,ha=As=0,dn=null}function Me(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return me===null?L.memoizedState=me=e:me=me.next=e,me}function fe(){if(P===null){var e=L.alternate;e=e!==null?e.memoizedState:null}else e=P.next;var t=me===null?L.memoizedState:me.next;if(t!==null)me=t,P=e;else{if(e===null)throw L.alternate===null?Error(T(467)):Error(T(310));P=e,e={memoizedState:P.memoizedState,baseState:P.baseState,baseQueue:P.baseQueue,queue:P.queue,next:null},me===null?L.memoizedState=me=e:me=me.next=e}return me}function ti(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wa(e){var t=ha;return ha+=1,dn===null&&(dn=[]),e=Mf(dn,e,t),t=L,(me===null?t.memoizedState:me.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?dd:Bo),e}function li(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wa(e);if(e.$$typeof===kt)return Te(e)}throw Error(T(438,String(e)))}function wo(e){var t=null,l=L.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=L.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=ti(),L.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=X0;return t.index++,l}function Bt(e,t){return typeof t=="function"?t(e):t}function ss(e){var t=fe();return Ao(t,P,e)}function Ao(e,t,l){var n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=l;var a=e.baseQueue,s=n.pending;if(s!==null){if(a!==null){var c=a.next;a.next=s.next,s.next=c}t.baseQueue=a=s,n.pending=null}if(s=e.baseState,a===null)e.memoizedState=s;else{t=a.next;var o=c=null,u=null,r=t,h=!1;do{var p=r.lane&-536870913;if(p!==r.lane?(G&p)===p:(Ut&p)===p){var m=r.revertLane;if(m===0)u!==null&&(u=u.next={lane:0,revertLane:0,gesture:null,action:r.action,hasEagerState:r.hasEagerState,eagerState:r.eagerState,next:null}),p===pn&&(h=!0);else if((Ut&m)===m){r=r.next,m===pn&&(h=!0);continue}else p={lane:0,revertLane:r.revertLane,gesture:null,action:r.action,hasEagerState:r.hasEagerState,eagerState:r.eagerState,next:null},u===null?(o=u=p,c=s):u=u.next=p,L.lanes|=m,fl|=m;p=r.action,El&&l(s,p),s=r.hasEagerState?r.eagerState:l(s,p)}else m={lane:p,revertLane:r.revertLane,gesture:r.gesture,action:r.action,hasEagerState:r.hasEagerState,eagerState:r.eagerState,next:null},u===null?(o=u=m,c=s):u=u.next=m,L.lanes|=p,fl|=p;r=r.next}while(r!==null&&r!==t);if(u===null?c=s:u.next=o,!Ke(s,e.memoizedState)&&(pe=!0,h&&(l=un,l!==null)))throw l;e.memoizedState=s,e.baseState=c,e.baseQueue=u,n.lastRenderedState=s}return a===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Mi(e){var t=fe(),l=t.queue;if(l===null)throw Error(T(311));l.lastRenderedReducer=e;var n=l.dispatch,a=l.pending,s=t.memoizedState;if(a!==null){l.pending=null;var c=a=a.next;do s=e(s,c.action),c=c.next;while(c!==a);Ke(s,t.memoizedState)||(pe=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),l.lastRenderedState=s}return[s,n]}function _f(e,t,l){var n=L,a=fe(),s=Q;if(s){if(l===void 0)throw Error(T(407));l=l()}else l=t();var c=!Ke((P||a).memoizedState,l);if(c&&(a.memoizedState=l,pe=!0),a=a.queue,Mo(qf.bind(null,n,a,e),[e]),a.getSnapshot!==t||c||me!==null&&me.memoizedState.tag&1){if(n.flags|=2048,yn(9,{destroy:void 0},$f.bind(null,n,a,l,t),null),ee===null)throw Error(T(349));s||Ut&127||Lf(n,t,l)}return l}function Lf(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=L.updateQueue,t===null?(t=ti(),L.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function $f(e,t,l,n){t.value=l,t.getSnapshot=n,Yf(t)&&Gf(e)}function qf(e,t,l){return l(function(){Yf(t)&&Gf(e)})}function Yf(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Ke(e,l)}catch{return!0}}function Gf(e){var t=Rl(e,2);t!==null&&Re(t,e,2)}function wc(e){var t=Me();if(typeof e=="function"){var l=e;if(e=l(),El){Jt(!0);try{l()}finally{Jt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:e},t}function Xf(e,t,l,n){return e.baseState=l,Ao(e,P,typeof n=="function"?n:Bt)}function ih(e,t,l,n,a){if(ai(e))throw Error(T(485));if(e=t.action,e!==null){var s={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){s.listeners.push(c)}};R.T!==null?l(!0):s.isTransition=!1,n(s),l=t.pending,l===null?(s.next=t.pending=s,Qf(t,s)):(s.next=l.next,t.pending=l.next=s)}}function Qf(e,t){var l=t.action,n=t.payload,a=e.state;if(t.isTransition){var s=R.T,c={};R.T=c;try{var o=l(a,n),u=R.S;u!==null&&u(c,o),Mu(e,t,o)}catch(r){Ac(e,t,r)}finally{s!==null&&c.types!==null&&(s.types=c.types),R.T=s}}else try{s=l(a,n),Mu(e,t,s)}catch(r){Ac(e,t,r)}}function Mu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Eu(e,t,n)},function(n){return Ac(e,t,n)}):Eu(e,t,l)}function Eu(e,t,l){t.status="fulfilled",t.value=l,Zf(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Qf(e,l)))}function Ac(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Zf(t),t=t.next;while(t!==n)}e.action=null}function Zf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vf(e,t){return t}function Du(e,t){if(Q){var l=ee.formState;if(l!==null){e:{var n=L;if(Q){if(ae){t:{for(var a=ae,s=at;a.nodeType!==8;){if(!s){a=null;break t}if(a=ct(a.nextSibling),a===null){a=null;break t}}s=a.data,a=s==="F!"||s==="F"?a:null}if(a){ae=ct(a.nextSibling),n=a.data==="F!";break e}}ul(n)}n=!1}n&&(t=l[0])}}return l=Me(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vf,lastRenderedState:t},l.queue=n,l=ud.bind(null,L,n),n.dispatch=l,n=wc(!1),s=Uo.bind(null,L,!1,n.queue),n=Me(),a={state:t,dispatch:null,action:e,pending:null},n.queue=a,l=ih.bind(null,L,a,s,l),a.dispatch=l,n.memoizedState=e,[t,l,!1]}function Ou(e){var t=fe();return Jf(t,P,e)}function Jf(e,t,l){if(t=Ao(e,t,Vf)[0],e=ss(Bt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=wa(t)}catch(c){throw c===kn?ei:c}else n=t;t=fe();var a=t.queue,s=a.dispatch;return l!==t.memoizedState&&(L.flags|=2048,yn(9,{destroy:void 0},ch.bind(null,a,l),null)),[n,s,e]}function ch(e,t){e.action=t}function Uu(e){var t=fe(),l=P;if(l!==null)return Jf(t,l,e);fe(),t=t.memoizedState,l=fe();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function yn(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=L.updateQueue,t===null&&(t=ti(),L.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function Kf(){return fe().memoizedState}function is(e,t,l,n){var a=Me();L.flags|=e,a.memoizedState=yn(1|t,{destroy:void 0},l,n===void 0?null:n)}function ni(e,t,l,n){var a=fe();n=n===void 0?null:n;var s=a.memoizedState.inst;P!==null&&n!==null&&No(n,P.memoizedState.deps)?a.memoizedState=yn(t,s,l,n):(L.flags|=e,a.memoizedState=yn(1|t,s,l,n))}function Bu(e,t){is(8390656,8,e,t)}function Mo(e,t){ni(2048,8,e,t)}function oh(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=ti(),L.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Ff(e){var t=fe().memoizedState;return oh({ref:t,nextImpl:e}),function(){if(Z&2)throw Error(T(440));return t.impl.apply(void 0,arguments)}}function Wf(e,t){return ni(4,2,e,t)}function If(e,t){return ni(4,4,e,t)}function Pf(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ed(e,t,l){l=l!=null?l.concat([e]):null,ni(4,4,Pf.bind(null,t,e),l)}function Eo(){}function td(e,t){var l=fe();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&No(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function ld(e,t){var l=fe();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&No(t,n[1]))return n[0];if(n=e(),El){Jt(!0);try{e()}finally{Jt(!1)}}return l.memoizedState=[n,t],n}function Do(e,t,l){return l===void 0||Ut&1073741824&&!(G&261930)?e.memoizedState=t:(e.memoizedState=l,e=Xd(),L.lanes|=e,fl|=e,l)}function nd(e,t,l,n){return Ke(l,t)?l:gn.current!==null?(e=Do(e,l,n),Ke(e,t)||(pe=!0),e):!(Ut&42)||Ut&1073741824&&!(G&261930)?(pe=!0,e.memoizedState=l):(e=Xd(),L.lanes|=e,fl|=e,t)}function ad(e,t,l,n,a){var s=V.p;V.p=s!==0&&8>s?s:8;var c=R.T,o={};R.T=o,Uo(e,!1,t,l);try{var u=a(),r=R.S;if(r!==null&&r(o,u),u!==null&&typeof u=="object"&&typeof u.then=="function"){var h=nh(u,n);ta(e,t,h,Je(e))}else ta(e,t,n,Je(e))}catch(p){ta(e,t,{then:function(){},status:"rejected",reason:p},Je())}finally{V.p=s,c!==null&&o.types!==null&&(c.types=o.types),R.T=c}}function uh(){}function Mc(e,t,l,n){if(e.tag!==5)throw Error(T(476));var a=sd(e).queue;ad(e,a,t,Nl,l===null?uh:function(){return id(e),l(n)})}function sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Nl,baseState:Nl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:Nl},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function id(e){var t=sd(e);t.next===null&&(t=e.alternate.memoizedState),ta(e,t.next.queue,{},Je())}function Oo(){return Te(ya)}function cd(){return fe().memoizedState}function od(){return fe().memoizedState}function rh(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Je();e=tl(l);var n=ll(t,e,l);n!==null&&(Re(n,t,l),In(n,t,l)),t={cache:yo()},e.payload=t;return}t=t.return}}function fh(e,t,l){var n=Je();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ai(e)?rd(t,l):(l=ho(e,t,l,n),l!==null&&(Re(l,e,n),fd(l,t,n)))}function ud(e,t,l){var n=Je();ta(e,t,l,n)}function ta(e,t,l,n){var a={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ai(e))rd(t,a);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var c=t.lastRenderedState,o=s(c,l);if(a.hasEagerState=!0,a.eagerState=o,Ke(o,c))return Ps(e,t,a,0),ee===null&&Is(),!1}catch{}finally{}if(l=ho(e,t,a,n),l!==null)return Re(l,e,n),fd(l,t,n),!0}return!1}function Uo(e,t,l,n){if(n={lane:2,revertLane:Go(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ai(e)){if(t)throw Error(T(479))}else t=ho(e,l,n,2),t!==null&&Re(t,e,2)}function ai(e){var t=e.alternate;return e===L||t!==null&&t===L}function rd(e,t){fn=ws=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function fd(e,t,l){if(l&4194048){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,Kr(e,l)}}var xa={readContext:Te,use:li,useCallback:oe,useContext:oe,useEffect:oe,useImperativeHandle:oe,useLayoutEffect:oe,useInsertionEffect:oe,useMemo:oe,useReducer:oe,useRef:oe,useState:oe,useDebugValue:oe,useDeferredValue:oe,useTransition:oe,useSyncExternalStore:oe,useId:oe,useHostTransitionStatus:oe,useFormState:oe,useActionState:oe,useOptimistic:oe,useMemoCache:oe,useCacheRefresh:oe};xa.useEffectEvent=oe;var dd={readContext:Te,use:li,useCallback:function(e,t){return Me().memoizedState=[e,t===void 0?null:t],e},useContext:Te,useEffect:Bu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,is(4194308,4,Pf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var l=Me();t=t===void 0?null:t;var n=e();if(El){Jt(!0);try{e()}finally{Jt(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=Me();if(l!==void 0){var a=l(t);if(El){Jt(!0);try{l(t)}finally{Jt(!1)}}}else a=t;return n.memoizedState=n.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},n.queue=e,e=e.dispatch=fh.bind(null,L,e),[n.memoizedState,e]},useRef:function(e){var t=Me();return e={current:e},t.memoizedState=e},useState:function(e){e=wc(e);var t=e.queue,l=ud.bind(null,L,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Eo,useDeferredValue:function(e,t){var l=Me();return Do(l,e,t)},useTransition:function(){var e=wc(!1);return e=ad.bind(null,L,e.queue,!0,!1),Me().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=L,a=Me();if(Q){if(l===void 0)throw Error(T(407));l=l()}else{if(l=t(),ee===null)throw Error(T(349));G&127||Lf(n,t,l)}a.memoizedState=l;var s={value:l,getSnapshot:t};return a.queue=s,Bu(qf.bind(null,n,s,e),[e]),n.flags|=2048,yn(9,{destroy:void 0},$f.bind(null,n,s,l,t),null),l},useId:function(){var e=Me(),t=ee.identifierPrefix;if(Q){var l=ht,n=mt;l=(n&~(1<<32-Ve(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=As++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=ah++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oo,useFormState:Du,useActionState:Du,useOptimistic:function(e){var t=Me();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Uo.bind(null,L,!0,l),l.dispatch=t,[e,t]},useMemoCache:wo,useCacheRefresh:function(){return Me().memoizedState=rh.bind(null,L)},useEffectEvent:function(e){var t=Me(),l={impl:e};return t.memoizedState=l,function(){if(Z&2)throw Error(T(440));return l.impl.apply(void 0,arguments)}}},Bo={readContext:Te,use:li,useCallback:td,useContext:Te,useEffect:Mo,useImperativeHandle:ed,useInsertionEffect:Wf,useLayoutEffect:If,useMemo:ld,useReducer:ss,useRef:Kf,useState:function(){return ss(Bt)},useDebugValue:Eo,useDeferredValue:function(e,t){var l=fe();return nd(l,P.memoizedState,e,t)},useTransition:function(){var e=ss(Bt)[0],t=fe().memoizedState;return[typeof e=="boolean"?e:wa(e),t]},useSyncExternalStore:_f,useId:cd,useHostTransitionStatus:Oo,useFormState:Ou,useActionState:Ou,useOptimistic:function(e,t){var l=fe();return Xf(l,P,e,t)},useMemoCache:wo,useCacheRefresh:od};Bo.useEffectEvent=Ff;var md={readContext:Te,use:li,useCallback:td,useContext:Te,useEffect:Mo,useImperativeHandle:ed,useInsertionEffect:Wf,useLayoutEffect:If,useMemo:ld,useReducer:Mi,useRef:Kf,useState:function(){return Mi(Bt)},useDebugValue:Eo,useDeferredValue:function(e,t){var l=fe();return P===null?Do(l,e,t):nd(l,P.memoizedState,e,t)},useTransition:function(){var e=Mi(Bt)[0],t=fe().memoizedState;return[typeof e=="boolean"?e:wa(e),t]},useSyncExternalStore:_f,useId:cd,useHostTransitionStatus:Oo,useFormState:Uu,useActionState:Uu,useOptimistic:function(e,t){var l=fe();return P!==null?Xf(l,P,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:wo,useCacheRefresh:od};md.useEffectEvent=Ff;function Ei(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:se({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ec={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=Je(),a=tl(n);a.payload=t,l!=null&&(a.callback=l),t=ll(e,a,n),t!==null&&(Re(t,e,n),In(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=Je(),a=tl(n);a.tag=1,a.payload=t,l!=null&&(a.callback=l),t=ll(e,a,n),t!==null&&(Re(t,e,n),In(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Je(),n=tl(l);n.tag=2,t!=null&&(n.callback=t),t=ll(e,n,l),t!==null&&(Re(t,e,l),In(t,e,l))}};function Ru(e,t,l,n,a,s,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,c):t.prototype&&t.prototype.isPureReactComponent?!ra(l,n)||!ra(a,s):!0}function Hu(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&Ec.enqueueReplaceState(t,t.state,null)}function Dl(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=se({},l));for(var a in e)l[a]===void 0&&(l[a]=e[a])}return l}function hd(e){js(e)}function xd(e){console.error(e)}function pd(e){js(e)}function Ms(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function _u(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Dc(e,t,l){return l=tl(l),l.tag=3,l.payload={element:null},l.callback=function(){Ms(e,t)},l}function gd(e){return e=tl(e),e.tag=3,e}function yd(e,t,l,n){var a=l.type.getDerivedStateFromError;if(typeof a=="function"){var s=n.value;e.payload=function(){return a(s)},e.callback=function(){_u(t,l,n)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(e.callback=function(){_u(t,l,n),typeof a!="function"&&(nl===null?nl=new Set([this]):nl.add(this));var o=n.stack;this.componentDidCatch(n.value,{componentStack:o!==null?o:""})})}function dh(e,t,l,n,a){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Tn(t,l,a,!0),l=Fe.current,l!==null){switch(l.tag){case 31:case 13:return it===null?Bs():l.alternate===null&&ue===0&&(ue=3),l.flags&=-257,l.flags|=65536,l.lanes=a,n===Cs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),Yi(e,n,a)),!1;case 22:return l.flags|=65536,n===Cs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),Yi(e,n,a)),!1}throw Error(T(435,l.tag))}return Yi(e,n,a),Bs(),!1}if(Q)return t=Fe.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,n!==vc&&(e=Error(T(422),{cause:n}),da(nt(e,l)))):(n!==vc&&(t=Error(T(423),{cause:n}),da(nt(t,l))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,n=nt(n,l),a=Dc(e.stateNode,n,a),Ai(e,a),ue!==4&&(ue=2)),!1;var s=Error(T(520),{cause:n});if(s=nt(s,l),aa===null?aa=[s]:aa.push(s),ue!==4&&(ue=2),t===null)return!0;n=nt(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=a&-a,l.lanes|=e,e=Dc(l.stateNode,n,e),Ai(l,e),!1;case 1:if(t=l.type,s=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(nl===null||!nl.has(s))))return l.flags|=65536,a&=-a,l.lanes|=a,a=gd(a),yd(a,e,l,n),Ai(l,a),!1}l=l.return}while(l!==null);return!1}var Ro=Error(T(461)),pe=!1;function Ne(e,t,l,n){t.child=e===null?Df(t,null,l,n):Ml(t,e.child,l,n)}function Lu(e,t,l,n,a){l=l.render;var s=t.ref;if("ref"in n){var c={};for(var o in n)o!=="ref"&&(c[o]=n[o])}else c=n;return Al(t),n=zo(e,t,l,c,s,a),o=Co(),e!==null&&!pe?(To(e,t,a),Rt(e,t,a)):(Q&&o&&po(t),t.flags|=1,Ne(e,t,n,a),t.child)}function $u(e,t,l,n,a){if(e===null){var s=l.type;return typeof s=="function"&&!xo(s)&&s.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=s,vd(e,t,s,n,a)):(e=ns(l.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Ho(e,a)){var c=s.memoizedProps;if(l=l.compare,l=l!==null?l:ra,l(c,n)&&e.ref===t.ref)return Rt(e,t,a)}return t.flags|=1,e=Mt(s,n),e.ref=t.ref,e.return=t,t.child=e}function vd(e,t,l,n,a){if(e!==null){var s=e.memoizedProps;if(ra(s,n)&&e.ref===t.ref)if(pe=!1,t.pendingProps=n=s,Ho(e,a))e.flags&131072&&(pe=!0);else return t.lanes=e.lanes,Rt(e,t,a)}return Oc(e,t,l,n,a)}function bd(e,t,l,n){var a=n.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if(t.flags&128){if(s=s!==null?s.baseLanes|l:l,e!==null){for(n=t.child=e.child,a=0;n!==null;)a=a|n.lanes|n.childLanes,n=n.sibling;n=a&~s}else n=0,t.child=null;return qu(e,t,s,l,n)}if(l&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&as(t,s!==null?s.cachePool:null),s!==null?Au(t,s):Tc(),Bf(t);else return n=t.lanes=536870912,qu(e,t,s!==null?s.baseLanes|l:l,l,n)}else s!==null?(as(t,s.cachePool),Au(t,s),Qt(),t.memoizedState=null):(e!==null&&as(t,null),Tc(),Qt());return Ne(e,t,a,l),t.child}function qn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function qu(e,t,l,n,a){var s=vo();return s=s===null?null:{parent:xe._currentValue,pool:s},t.memoizedState={baseLanes:l,cachePool:s},e!==null&&as(t,null),Tc(),Bf(t),e!==null&&Tn(e,t,n,!0),t.childLanes=a,null}function cs(e,t){return t=Es({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Yu(e,t,l){return Ml(t,e.child,null,l),e=cs(t,t.pendingProps),e.flags|=2,Ye(t),t.memoizedState=null,e}function mh(e,t,l){var n=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Q){if(n.mode==="hidden")return e=cs(t,n),t.lanes=536870912,qn(null,e);if(kc(t),(e=ae)?(e=d0(e,at),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:mt,overflow:ht}:null,retryLane:536870912,hydrationErrors:null},l=Cf(e),l.return=t,t.child=l,Ce=t,ae=null)):e=null,e===null)throw ul(t);return t.lanes=536870912,null}return cs(t,n)}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(kc(t),a)if(t.flags&256)t.flags&=-257,t=Yu(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(T(558));else if(pe||Tn(e,t,l,!1),a=(l&e.childLanes)!==0,pe||a){if(n=ee,n!==null&&(c=Fr(n,l),c!==0&&c!==s.retryLane))throw s.retryLane=c,Rl(e,c),Re(n,e,c),Ro;Bs(),t=Yu(e,t,l)}else e=s.treeContext,ae=ct(c.nextSibling),Ce=t,Q=!0,el=null,at=!1,e!==null&&kf(t,e),t=cs(t,n),t.flags|=4096;return t}return e=Mt(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function os(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(T(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Oc(e,t,l,n,a){return Al(t),l=zo(e,t,l,n,void 0,a),n=Co(),e!==null&&!pe?(To(e,t,a),Rt(e,t,a)):(Q&&n&&po(t),t.flags|=1,Ne(e,t,l,a),t.child)}function Gu(e,t,l,n,a,s){return Al(t),t.updateQueue=null,l=Hf(t,n,l,a),Rf(e),n=Co(),e!==null&&!pe?(To(e,t,s),Rt(e,t,s)):(Q&&n&&po(t),t.flags|=1,Ne(e,t,l,s),t.child)}function Xu(e,t,l,n,a){if(Al(t),t.stateNode===null){var s=Pl,c=l.contextType;typeof c=="object"&&c!==null&&(s=Te(c)),s=new l(n,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ec,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=n,s.state=t.memoizedState,s.refs={},jo(t),c=l.contextType,s.context=typeof c=="object"&&c!==null?Te(c):Pl,s.state=t.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(Ei(t,l,c,n),s.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(c=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),c!==s.state&&Ec.enqueueReplaceState(s,s.state,null),ea(t,n,s,a),Pn(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){s=t.stateNode;var o=t.memoizedProps,u=Dl(l,o);s.props=u;var r=s.context,h=l.contextType;c=Pl,typeof h=="object"&&h!==null&&(c=Te(h));var p=l.getDerivedStateFromProps;h=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o||r!==c)&&Hu(t,s,n,c),Yt=!1;var m=t.memoizedState;s.state=m,ea(t,n,s,a),Pn(),r=t.memoizedState,o||m!==r||Yt?(typeof p=="function"&&(Ei(t,l,p,n),r=t.memoizedState),(u=Yt||Ru(t,l,u,n,m,r,c))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=r),s.props=n,s.state=r,s.context=c,n=u):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,zc(e,t),c=t.memoizedProps,h=Dl(l,c),s.props=h,p=t.pendingProps,m=s.context,r=l.contextType,u=Pl,typeof r=="object"&&r!==null&&(u=Te(r)),o=l.getDerivedStateFromProps,(r=typeof o=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(c!==p||m!==u)&&Hu(t,s,n,u),Yt=!1,m=t.memoizedState,s.state=m,ea(t,n,s,a),Pn();var g=t.memoizedState;c!==p||m!==g||Yt||e!==null&&e.dependencies!==null&&zs(e.dependencies)?(typeof o=="function"&&(Ei(t,l,o,n),g=t.memoizedState),(h=Yt||Ru(t,l,h,n,m,g,u)||e!==null&&e.dependencies!==null&&zs(e.dependencies))?(r||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,g,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,g,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),s.props=n,s.state=g,s.context=u,n=h):(typeof s.componentDidUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return s=n,os(e,t),n=(t.flags&128)!==0,s||n?(s=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&n?(t.child=Ml(t,e.child,null,a),t.child=Ml(t,null,l,a)):Ne(e,t,l,a),t.memoizedState=s.state,e=t.child):e=Rt(e,t,a),e}function Qu(e,t,l,n){return wl(),t.flags|=256,Ne(e,t,l,n),t.child}var Di={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oi(e){return{baseLanes:e,cachePool:Af()}}function Ui(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Xe),e}function jd(e,t,l){var n=t.pendingProps,a=!1,s=(t.flags&128)!==0,c;if((c=s)||(c=e!==null&&e.memoizedState===null?!1:(re.current&2)!==0),c&&(a=!0,t.flags&=-129),c=(t.flags&32)!==0,t.flags&=-33,e===null){if(Q){if(a?Xt(t):Qt(),(e=ae)?(e=d0(e,at),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:mt,overflow:ht}:null,retryLane:536870912,hydrationErrors:null},l=Cf(e),l.return=t,t.child=l,Ce=t,ae=null)):e=null,e===null)throw ul(t);return Vc(e)?t.lanes=32:t.lanes=536870912,null}var o=n.children;return n=n.fallback,a?(Qt(),a=t.mode,o=Es({mode:"hidden",children:o},a),n=zl(n,a,l,null),o.return=t,n.return=t,o.sibling=n,t.child=o,n=t.child,n.memoizedState=Oi(l),n.childLanes=Ui(e,c,l),t.memoizedState=Di,qn(null,n)):(Xt(t),Uc(t,o))}var u=e.memoizedState;if(u!==null&&(o=u.dehydrated,o!==null)){if(s)t.flags&256?(Xt(t),t.flags&=-257,t=Bi(e,t,l)):t.memoizedState!==null?(Qt(),t.child=e.child,t.flags|=128,t=null):(Qt(),o=n.fallback,a=t.mode,n=Es({mode:"visible",children:n.children},a),o=zl(o,a,l,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,Ml(t,e.child,null,l),n=t.child,n.memoizedState=Oi(l),n.childLanes=Ui(e,c,l),t.memoizedState=Di,t=qn(null,n));else if(Xt(t),Vc(o)){if(c=o.nextSibling&&o.nextSibling.dataset,c)var r=c.dgst;c=r,n=Error(T(419)),n.stack="",n.digest=c,da({value:n,source:null,stack:null}),t=Bi(e,t,l)}else if(pe||Tn(e,t,l,!1),c=(l&e.childLanes)!==0,pe||c){if(c=ee,c!==null&&(n=Fr(c,l),n!==0&&n!==u.retryLane))throw u.retryLane=n,Rl(e,n),Re(c,e,n),Ro;Zc(o)||Bs(),t=Bi(e,t,l)}else Zc(o)?(t.flags|=192,t.child=e.child,t=null):(e=u.treeContext,ae=ct(o.nextSibling),Ce=t,Q=!0,el=null,at=!1,e!==null&&kf(t,e),t=Uc(t,n.children),t.flags|=4096);return t}return a?(Qt(),o=n.fallback,a=t.mode,u=e.child,r=u.sibling,n=Mt(u,{mode:"hidden",children:n.children}),n.subtreeFlags=u.subtreeFlags&65011712,r!==null?o=Mt(r,o):(o=zl(o,a,l,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,qn(null,n),n=t.child,o=e.child.memoizedState,o===null?o=Oi(l):(a=o.cachePool,a!==null?(u=xe._currentValue,a=a.parent!==u?{parent:u,pool:u}:a):a=Af(),o={baseLanes:o.baseLanes|l,cachePool:a}),n.memoizedState=o,n.childLanes=Ui(e,c,l),t.memoizedState=Di,qn(e.child,n)):(Xt(t),l=e.child,e=l.sibling,l=Mt(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(c=t.deletions,c===null?(t.deletions=[e],t.flags|=16):c.push(e)),t.child=l,t.memoizedState=null,l)}function Uc(e,t){return t=Es({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Es(e,t){return e=Ge(22,e,null,t),e.lanes=0,e}function Bi(e,t,l){return Ml(t,e.child,null,l),e=Uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zu(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),jc(e.return,t,l)}function Ri(e,t,l,n,a,s){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:a,treeForkCount:s}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=n,c.tail=l,c.tailMode=a,c.treeForkCount=s)}function Sd(e,t,l){var n=t.pendingProps,a=n.revealOrder,s=n.tail;n=n.children;var c=re.current,o=(c&2)!==0;if(o?(c=c&1|2,t.flags|=128):c&=1,le(re,c),Ne(e,t,n,l),n=Q?fa:0,!o&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zu(e,l,t);else if(e.tag===19)Zu(e,l,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}switch(a){case"forwards":for(l=t.child,a=null;l!==null;)e=l.alternate,e!==null&&ks(e)===null&&(a=l),l=l.sibling;l=a,l===null?(a=t.child,t.child=null):(a=l.sibling,l.sibling=null),Ri(t,!1,a,l,s,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ks(e)===null){t.child=a;break}e=a.sibling,a.sibling=l,l=a,a=e}Ri(t,!0,l,null,s,n);break;case"together":Ri(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Rt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),fl|=t.lanes,!(l&t.childLanes))if(e!==null){if(Tn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(T(153));if(t.child!==null){for(e=t.child,l=Mt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Mt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ho(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&zs(e)))}function hh(e,t,l){switch(t.tag){case 3:gs(t,t.stateNode.containerInfo),Gt(t,xe,e.memoizedState.cache),wl();break;case 27:case 5:oc(t);break;case 4:gs(t,t.stateNode.containerInfo);break;case 10:Gt(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,kc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Xt(t),t.flags|=128,null):l&t.child.childLanes?jd(e,t,l):(Xt(t),e=Rt(e,t,l),e!==null?e.sibling:null);Xt(t);break;case 19:var a=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Tn(e,t,l,!1),n=(l&t.childLanes)!==0),a){if(n)return Sd(e,t,l);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),le(re,re.current),n)break;return null;case 22:return t.lanes=0,bd(e,t,l,t.pendingProps);case 24:Gt(t,xe,e.memoizedState.cache)}return Rt(e,t,l)}function Nd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)pe=!0;else{if(!Ho(e,l)&&!(t.flags&128))return pe=!1,hh(e,t,l);pe=!!(e.flags&131072)}else pe=!1,Q&&t.flags&1048576&&Tf(t,fa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=vl(t.elementType),t.type=e,typeof e=="function")xo(e)?(n=Dl(e,n),t.tag=1,t=Xu(null,t,e,n,l)):(t.tag=0,t=Oc(null,t,e,n,l));else{if(e!=null){var a=e.$$typeof;if(a===eo){t.tag=11,t=Lu(null,t,e,n,l);break e}else if(a===to){t.tag=14,t=$u(null,t,e,n,l);break e}}throw t=ic(e)||e,Error(T(306,t,""))}}return t;case 0:return Oc(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,a=Dl(n,t.pendingProps),Xu(e,t,n,a,l);case 3:e:{if(gs(t,t.stateNode.containerInfo),e===null)throw Error(T(387));n=t.pendingProps;var s=t.memoizedState;a=s.element,zc(e,t),ea(t,n,null,l);var c=t.memoizedState;if(n=c.cache,Gt(t,xe,n),n!==s.cache&&Sc(t,[xe],l,!0),Pn(),n=c.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:c.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=Qu(e,t,n,l);break e}else if(n!==a){a=nt(Error(T(424)),t),da(a),t=Qu(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ae=ct(e.firstChild),Ce=t,Q=!0,el=null,at=!0,l=Df(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(wl(),n===a){t=Rt(e,t,l);break e}Ne(e,t,n,l)}t=t.child}return t;case 26:return os(e,t),e===null?(l=dr(t.type,null,t.pendingProps,null))?t.memoizedState=l:Q||(l=t.type,e=t.pendingProps,n=Ls(Pt.current).createElement(l),n[ze]=t,n[He]=e,ke(n,l,e),je(n),t.stateNode=n):t.memoizedState=dr(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oc(t),e===null&&Q&&(n=t.stateNode=m0(t.type,t.pendingProps,Pt.current),Ce=t,at=!0,a=ae,xl(t.type)?(Jc=a,ae=ct(n.firstChild)):ae=a),Ne(e,t,t.pendingProps.children,l),os(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Q&&((a=n=ae)&&(n=Xh(n,t.type,t.pendingProps,at),n!==null?(t.stateNode=n,Ce=t,ae=ct(n.firstChild),at=!1,a=!0):a=!1),a||ul(t)),oc(t),a=t.type,s=t.pendingProps,c=e!==null?e.memoizedProps:null,n=s.children,Xc(a,s)?n=null:c!==null&&Xc(a,c)&&(t.flags|=32),t.memoizedState!==null&&(a=zo(e,t,sh,null,null,l),ya._currentValue=a),os(e,t),Ne(e,t,n,l),t.child;case 6:return e===null&&Q&&((e=l=ae)&&(l=Qh(l,t.pendingProps,at),l!==null?(t.stateNode=l,Ce=t,ae=null,e=!0):e=!1),e||ul(t)),null;case 13:return jd(e,t,l);case 4:return gs(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ml(t,null,n,l):Ne(e,t,n,l),t.child;case 11:return Lu(e,t,t.type,t.pendingProps,l);case 7:return Ne(e,t,t.pendingProps,l),t.child;case 8:return Ne(e,t,t.pendingProps.children,l),t.child;case 12:return Ne(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,Gt(t,t.type,n.value),Ne(e,t,n.children,l),t.child;case 9:return a=t.type._context,n=t.pendingProps.children,Al(t),a=Te(a),n=n(a),t.flags|=1,Ne(e,t,n,l),t.child;case 14:return $u(e,t,t.type,t.pendingProps,l);case 15:return vd(e,t,t.type,t.pendingProps,l);case 19:return Sd(e,t,l);case 31:return mh(e,t,l);case 22:return bd(e,t,l,t.pendingProps);case 24:return Al(t),n=Te(xe),e===null?(a=vo(),a===null&&(a=ee,s=yo(),a.pooledCache=s,s.refCount++,s!==null&&(a.pooledCacheLanes|=l),a=s),t.memoizedState={parent:n,cache:a},jo(t),Gt(t,xe,a)):(e.lanes&l&&(zc(e,t),ea(t,null,null,l),Pn()),a=e.memoizedState,s=t.memoizedState,a.parent!==n?(a={parent:n,cache:n},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Gt(t,xe,n)):(n=s.cache,Gt(t,xe,n),n!==a.cache&&Sc(t,[xe],l,!0))),Ne(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(T(156,t.tag))}function jt(e){e.flags|=4}function Hi(e,t,l,n,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw Tl=Cs,bo}else e.flags&=-16777217}function Vu(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!p0(t))if(Vd())e.flags|=8192;else throw Tl=Cs,bo}function Ga(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Vr():536870912,e.lanes|=t,vn|=t)}function Bn(e,t){if(!Q)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags&65011712,n|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)l|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function xh(e,t,l){var n=t.pendingProps;switch(go(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ne(t),null;case 1:return ne(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Et(xe),mn(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?jt(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wi())),ne(t),null;case 26:var a=t.type,s=t.memoizedState;return e===null?(jt(t),s!==null?(ne(t),Vu(t,s)):(ne(t),Hi(t,a,null,n,l))):s?s!==e.memoizedState?(jt(t),ne(t),Vu(t,s)):(ne(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&jt(t),ne(t),Hi(t,a,e,n,l)),null;case 27:if(ys(t),l=Pt.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&jt(t);else{if(!n){if(t.stateNode===null)throw Error(T(166));return ne(t),null}e=pt.current,Ll(t)?Su(t):(e=m0(a,n,l),t.stateNode=e,jt(t))}return ne(t),null;case 5:if(ys(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&jt(t);else{if(!n){if(t.stateNode===null)throw Error(T(166));return ne(t),null}if(s=pt.current,Ll(t))Su(t);else{var c=Ls(Pt.current);switch(s){case 1:s=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:s=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":s=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":s=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":s=c.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof n.is=="string"?c.createElement("select",{is:n.is}):c.createElement("select"),n.multiple?s.multiple=!0:n.size&&(s.size=n.size);break;default:s=typeof n.is=="string"?c.createElement(a,{is:n.is}):c.createElement(a)}}s[ze]=t,s[He]=n;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)s.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=s;e:switch(ke(s,a,n),a){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&jt(t)}}return ne(t),Hi(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&jt(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(T(166));if(e=Pt.current,Ll(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,a=Ce,a!==null)switch(a.tag){case 27:case 5:n=a.memoizedProps}e[ze]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||u0(e.nodeValue,l)),e||ul(t,!0)}else e=Ls(e).createTextNode(n),e[ze]=t,t.stateNode=e}return ne(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ll(t),l!==null){if(e===null){if(!n)throw Error(T(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(557));e[ze]=t}else wl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ne(t),e=!1}else l=wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Ye(t),t):(Ye(t),null);if(t.flags&128)throw Error(T(558))}return ne(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ll(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(T(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(T(317));a[ze]=t}else wl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ne(t),a=!1}else a=wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ye(t),t):(Ye(t),null)}return Ye(t),t.flags&128?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,a=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(a=n.alternate.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ga(t,t.updateQueue),ne(t),null);case 4:return mn(),e===null&&Xo(t.stateNode.containerInfo),ne(t),null;case 10:return Et(t.type),ne(t),null;case 19:if(Se(re),n=t.memoizedState,n===null)return ne(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)Bn(n,!1);else{if(ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ks(e),s!==null){for(t.flags|=128,Bn(n,!1),e=s.updateQueue,t.updateQueue=e,Ga(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)zf(l,e),l=l.sibling;return le(re,re.current&1|2),Q&&Ct(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Qe()>Os&&(t.flags|=128,a=!0,Bn(n,!1),t.lanes=4194304)}else{if(!a)if(e=ks(s),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ga(t,e),Bn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Q)return ne(t),null}else 2*Qe()-n.renderingStartTime>Os&&l!==536870912&&(t.flags|=128,a=!0,Bn(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(e=n.last,e!==null?e.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Qe(),e.sibling=null,l=re.current,le(re,a?l&1|2:l&1),Q&&Ct(t,n.treeForkCount),e):(ne(t),null);case 22:case 23:return Ye(t),So(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?l&536870912&&!(t.flags&128)&&(ne(t),t.subtreeFlags&6&&(t.flags|=8192)):ne(t),l=t.updateQueue,l!==null&&Ga(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&Se(Cl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Et(xe),ne(t),null;case 25:return null;case 30:return null}throw Error(T(156,t.tag))}function ph(e,t){switch(go(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Et(xe),mn(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ys(t),null;case 31:if(t.memoizedState!==null){if(Ye(t),t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ye(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));wl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(re),null;case 4:return mn(),null;case 10:return Et(t.type),null;case 22:case 23:return Ye(t),So(),e!==null&&Se(Cl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Et(xe),null;case 25:return null;default:return null}}function zd(e,t){switch(go(t),t.tag){case 3:Et(xe),mn();break;case 26:case 27:case 5:ys(t);break;case 4:mn();break;case 31:t.memoizedState!==null&&Ye(t);break;case 13:Ye(t);break;case 19:Se(re);break;case 10:Et(t.type);break;case 22:case 23:Ye(t),So(),e!==null&&Se(Cl);break;case 24:Et(xe)}}function Aa(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var a=n.next;l=a;do{if((l.tag&e)===e){n=void 0;var s=l.create,c=l.inst;n=s(),c.destroy=n}l=l.next}while(l!==a)}}catch(o){K(t,t.return,o)}}function rl(e,t,l){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var s=a.next;n=s;do{if((n.tag&e)===e){var c=n.inst,o=c.destroy;if(o!==void 0){c.destroy=void 0,a=t;var u=l,r=o;try{r()}catch(h){K(a,u,h)}}}n=n.next}while(n!==s)}}catch(h){K(t,t.return,h)}}function Cd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Uf(t,l)}catch(n){K(e,e.return,n)}}}function Td(e,t,l){l.props=Dl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){K(e,t,n)}}function la(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(a){K(e,t,a)}}function xt(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(a){K(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(a){K(e,t,a)}else l.current=null}function kd(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(a){K(e,e.return,a)}}function _i(e,t,l){try{var n=e.stateNode;_h(n,e.type,l,t),n[He]=t}catch(a){K(e,e.return,a)}}function wd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xl(e.type)||e.tag===4}function Li(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wd(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.tag===27&&xl(e.type)||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 Bc(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=wt));else if(n!==4&&(n===27&&xl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Bc(e,t,l),e=e.sibling;e!==null;)Bc(e,t,l),e=e.sibling}function Ds(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&xl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Ds(e,t,l),e=e.sibling;e!==null;)Ds(e,t,l),e=e.sibling}function Ad(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);ke(t,n,l),t[ze]=e,t[He]=l}catch(s){K(e,e.return,s)}}var Tt=!1,he=!1,$i=!1,Ju=typeof WeakSet=="function"?WeakSet:Set,be=null;function gh(e,t){if(e=e.containerInfo,Yc=Gs,e=pf(e),fo(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var a=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{l.nodeType,s.nodeType}catch{l=null;break e}var c=0,o=-1,u=-1,r=0,h=0,p=e,m=null;t:for(;;){for(var g;p!==l||a!==0&&p.nodeType!==3||(o=c+a),p!==s||n!==0&&p.nodeType!==3||(u=c+n),p.nodeType===3&&(c+=p.nodeValue.length),(g=p.firstChild)!==null;)m=p,p=g;for(;;){if(p===e)break t;if(m===l&&++r===a&&(o=c),m===s&&++h===n&&(u=c),(g=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=g}l=o===-1||u===-1?null:{start:o,end:u}}else l=null}l=l||{start:0,end:0}}else l=null;for(Gc={focusedElem:e,selectionRange:l},Gs=!1,be=t;be!==null;)if(t=be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,be=e;else for(;be!==null;){switch(t=be,s=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)a=e[l],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&s!==null){e=void 0,l=t,a=s.memoizedProps,s=s.memoizedState,n=l.stateNode;try{var y=Dl(l.type,a);e=n.getSnapshotBeforeUpdate(y,s),n.__reactInternalSnapshotBeforeUpdate=e}catch(j){K(l,l.return,j)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Qc(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Qc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(T(163))}if(e=t.sibling,e!==null){e.return=t.return,be=e;break}be=t.return}}function Md(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:Nt(e,l),n&4&&Aa(5,l);break;case 1:if(Nt(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(c){K(l,l.return,c)}else{var a=Dl(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(c){K(l,l.return,c)}}n&64&&Cd(l),n&512&&la(l,l.return);break;case 3:if(Nt(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Uf(e,t)}catch(c){K(l,l.return,c)}}break;case 27:t===null&&n&4&&Ad(l);case 26:case 5:Nt(e,l),t===null&&n&4&&kd(l),n&512&&la(l,l.return);break;case 12:Nt(e,l);break;case 31:Nt(e,l),n&4&&Od(e,l);break;case 13:Nt(e,l),n&4&&Ud(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Th.bind(null,l),Zh(e,l))));break;case 22:if(n=l.memoizedState!==null||Tt,!n){t=t!==null&&t.memoizedState!==null||he,a=Tt;var s=he;Tt=n,(he=t)&&!s?zt(e,l,(l.subtreeFlags&8772)!==0):Nt(e,l),Tt=a,he=s}break;case 30:break;default:Nt(e,l)}}function Ed(e){var t=e.alternate;t!==null&&(e.alternate=null,Ed(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&so(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ie=null,Ue=!1;function St(e,t,l){for(l=l.child;l!==null;)Dd(e,t,l),l=l.sibling}function Dd(e,t,l){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(Sa,l)}catch{}switch(l.tag){case 26:he||xt(l,t),St(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:he||xt(l,t);var n=ie,a=Ue;xl(l.type)&&(ie=l.stateNode,Ue=!1),St(e,t,l),ia(l.stateNode),ie=n,Ue=a;break;case 5:he||xt(l,t);case 6:if(n=ie,a=Ue,ie=null,St(e,t,l),ie=n,Ue=a,ie!==null)if(Ue)try{(ie.nodeType===9?ie.body:ie.nodeName==="HTML"?ie.ownerDocument.body:ie).removeChild(l.stateNode)}catch(s){K(l,t,s)}else try{ie.removeChild(l.stateNode)}catch(s){K(l,t,s)}break;case 18:ie!==null&&(Ue?(e=ie,cr(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Nn(e)):cr(ie,l.stateNode));break;case 4:n=ie,a=Ue,ie=l.stateNode.containerInfo,Ue=!0,St(e,t,l),ie=n,Ue=a;break;case 0:case 11:case 14:case 15:rl(2,l,t),he||rl(4,l,t),St(e,t,l);break;case 1:he||(xt(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Td(l,t,n)),St(e,t,l);break;case 21:St(e,t,l);break;case 22:he=(n=he)||l.memoizedState!==null,St(e,t,l),he=n;break;default:St(e,t,l)}}function Od(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Nn(e)}catch(l){K(t,t.return,l)}}}function Ud(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Nn(e)}catch(l){K(t,t.return,l)}}function yh(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ju),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ju),t;default:throw Error(T(435,e.tag))}}function Xa(e,t){var l=yh(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var a=kh.bind(null,e,n);n.then(a,a)}})}function De(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var a=l[n],s=e,c=t,o=c;e:for(;o!==null;){switch(o.tag){case 27:if(xl(o.type)){ie=o.stateNode,Ue=!1;break e}break;case 5:ie=o.stateNode,Ue=!1;break e;case 3:case 4:ie=o.stateNode.containerInfo,Ue=!0;break e}o=o.return}if(ie===null)throw Error(T(160));Dd(s,c,a),ie=null,Ue=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Bd(t,e),t=t.sibling}var ft=null;function Bd(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:De(t,e),Oe(e),n&4&&(rl(3,e,e.return),Aa(3,e),rl(5,e,e.return));break;case 1:De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),n&64&&Tt&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var a=ft;if(De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),n&4){var s=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,a=a.ownerDocument||a;t:switch(n){case"title":s=a.getElementsByTagName("title")[0],(!s||s[Ca]||s[ze]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=a.createElement(n),a.head.insertBefore(s,a.querySelector("head > title"))),ke(s,n,l),s[ze]=e,je(s),n=s;break e;case"link":var c=hr("link","href",a).get(n+(l.href||""));if(c){for(var o=0;o<c.length;o++)if(s=c[o],s.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&s.getAttribute("rel")===(l.rel==null?null:l.rel)&&s.getAttribute("title")===(l.title==null?null:l.title)&&s.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(o,1);break t}}s=a.createElement(n),ke(s,n,l),a.head.appendChild(s);break;case"meta":if(c=hr("meta","content",a).get(n+(l.content||""))){for(o=0;o<c.length;o++)if(s=c[o],s.getAttribute("content")===(l.content==null?null:""+l.content)&&s.getAttribute("name")===(l.name==null?null:l.name)&&s.getAttribute("property")===(l.property==null?null:l.property)&&s.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&s.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(o,1);break t}}s=a.createElement(n),ke(s,n,l),a.head.appendChild(s);break;default:throw Error(T(468,n))}s[ze]=e,je(s),n=s}e.stateNode=n}else xr(a,e.type,e.stateNode);else e.stateNode=mr(a,n,e.memoizedProps);else s!==n?(s===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):s.count--,n===null?xr(a,e.type,e.stateNode):mr(a,n,e.memoizedProps)):n===null&&e.stateNode!==null&&_i(e,e.memoizedProps,l.memoizedProps)}break;case 27:De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),l!==null&&n&4&&_i(e,e.memoizedProps,l.memoizedProps);break;case 5:if(De(t,e),Oe(e),n&512&&(he||l===null||xt(l,l.return)),e.flags&32){a=e.stateNode;try{xn(a,"")}catch(y){K(e,e.return,y)}}n&4&&e.stateNode!=null&&(a=e.memoizedProps,_i(e,a,l!==null?l.memoizedProps:a)),n&1024&&($i=!0);break;case 6:if(De(t,e),Oe(e),n&4){if(e.stateNode===null)throw Error(T(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(y){K(e,e.return,y)}}break;case 3:if(fs=null,a=ft,ft=$s(t.containerInfo),De(t,e),ft=a,Oe(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{Nn(t.containerInfo)}catch(y){K(e,e.return,y)}$i&&($i=!1,Rd(e));break;case 4:n=ft,ft=$s(e.stateNode.containerInfo),De(t,e),Oe(e),ft=n;break;case 12:De(t,e),Oe(e);break;case 31:De(t,e),Oe(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xa(e,n)));break;case 13:De(t,e),Oe(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(si=Qe()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xa(e,n)));break;case 22:a=e.memoizedState!==null;var u=l!==null&&l.memoizedState!==null,r=Tt,h=he;if(Tt=r||a,he=h||u,De(t,e),he=h,Tt=r,Oe(e),n&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(l===null||u||Tt||he||bl(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){u=l=t;try{if(s=u.stateNode,a)c=s.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{o=u.stateNode;var p=u.memoizedProps.style,m=p!=null&&p.hasOwnProperty("display")?p.display:null;o.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(y){K(u,u.return,y)}}}else if(t.tag===6){if(l===null){u=t;try{u.stateNode.nodeValue=a?"":u.memoizedProps}catch(y){K(u,u.return,y)}}}else if(t.tag===18){if(l===null){u=t;try{var g=u.stateNode;a?or(g,!0):or(u.stateNode,!1)}catch(y){K(u,u.return,y)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Xa(e,l))));break;case 19:De(t,e),Oe(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xa(e,n)));break;case 30:break;case 21:break;default:De(t,e),Oe(e)}}function Oe(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(wd(n)){l=n;break}n=n.return}if(l==null)throw Error(T(160));switch(l.tag){case 27:var a=l.stateNode,s=Li(e);Ds(e,s,a);break;case 5:var c=l.stateNode;l.flags&32&&(xn(c,""),l.flags&=-33);var o=Li(e);Ds(e,o,c);break;case 3:case 4:var u=l.stateNode.containerInfo,r=Li(e);Bc(e,r,u);break;default:throw Error(T(161))}}catch(h){K(e,e.return,h)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nt(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Md(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:rl(4,t,t.return),bl(t);break;case 1:xt(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Td(t,t.return,l),bl(t);break;case 27:ia(t.stateNode);case 26:case 5:xt(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function zt(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,a=e,s=t,c=s.flags;switch(s.tag){case 0:case 11:case 15:zt(a,s,l),Aa(4,s);break;case 1:if(zt(a,s,l),n=s,a=n.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(r){K(n,n.return,r)}if(n=s,a=n.updateQueue,a!==null){var o=n.stateNode;try{var u=a.shared.hiddenCallbacks;if(u!==null)for(a.shared.hiddenCallbacks=null,a=0;a<u.length;a++)Of(u[a],o)}catch(r){K(n,n.return,r)}}l&&c&64&&Cd(s),la(s,s.return);break;case 27:Ad(s);case 26:case 5:zt(a,s,l),l&&n===null&&c&4&&kd(s),la(s,s.return);break;case 12:zt(a,s,l);break;case 31:zt(a,s,l),l&&c&4&&Od(a,s);break;case 13:zt(a,s,l),l&&c&4&&Ud(a,s);break;case 22:s.memoizedState===null&&zt(a,s,l),la(s,s.return);break;case 30:break;default:zt(a,s,l)}t=t.sibling}}function _o(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&ka(l))}function Lo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function rt(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Hd(e,t,l,n),t=t.sibling}function Hd(e,t,l,n){var a=t.flags;switch(t.tag){case 0:case 11:case 15:rt(e,t,l,n),a&2048&&Aa(9,t);break;case 1:rt(e,t,l,n);break;case 3:rt(e,t,l,n),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e)));break;case 12:if(a&2048){rt(e,t,l,n),e=t.stateNode;try{var s=t.memoizedProps,c=s.id,o=s.onPostCommit;typeof o=="function"&&o(c,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(u){K(t,t.return,u)}}else rt(e,t,l,n);break;case 31:rt(e,t,l,n);break;case 13:rt(e,t,l,n);break;case 23:break;case 22:s=t.stateNode,c=t.alternate,t.memoizedState!==null?s._visibility&2?rt(e,t,l,n):na(e,t):s._visibility&2?rt(e,t,l,n):(s._visibility|=2,ql(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),a&2048&&_o(c,t);break;case 24:rt(e,t,l,n),a&2048&&Lo(t.alternate,t);break;default:rt(e,t,l,n)}}function ql(e,t,l,n,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,c=t,o=l,u=n,r=c.flags;switch(c.tag){case 0:case 11:case 15:ql(s,c,o,u,a),Aa(8,c);break;case 23:break;case 22:var h=c.stateNode;c.memoizedState!==null?h._visibility&2?ql(s,c,o,u,a):na(s,c):(h._visibility|=2,ql(s,c,o,u,a)),a&&r&2048&&_o(c.alternate,c);break;case 24:ql(s,c,o,u,a),a&&r&2048&&Lo(c.alternate,c);break;default:ql(s,c,o,u,a)}t=t.sibling}}function na(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,a=n.flags;switch(n.tag){case 22:na(l,n),a&2048&&_o(n.alternate,n);break;case 24:na(l,n),a&2048&&Lo(n.alternate,n);break;default:na(l,n)}t=t.sibling}}var Yn=8192;function $l(e,t,l){if(e.subtreeFlags&Yn)for(e=e.child;e!==null;)_d(e,t,l),e=e.sibling}function _d(e,t,l){switch(e.tag){case 26:$l(e,t,l),e.flags&Yn&&e.memoizedState!==null&&ax(l,ft,e.memoizedState,e.memoizedProps);break;case 5:$l(e,t,l);break;case 3:case 4:var n=ft;ft=$s(e.stateNode.containerInfo),$l(e,t,l),ft=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Yn,Yn=16777216,$l(e,t,l),Yn=n):$l(e,t,l));break;default:$l(e,t,l)}}function Ld(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Rn(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];be=n,qd(n,e)}Ld(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$d(e),e=e.sibling}function $d(e){switch(e.tag){case 0:case 11:case 15:Rn(e),e.flags&2048&&rl(9,e,e.return);break;case 3:Rn(e);break;case 12:Rn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,us(e)):Rn(e);break;default:Rn(e)}}function us(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];be=n,qd(n,e)}Ld(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:rl(8,t,t.return),us(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,us(t));break;default:us(t)}e=e.sibling}}function qd(e,t){for(;be!==null;){var l=be;switch(l.tag){case 0:case 11:case 15:rl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:ka(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,be=n;else e:for(l=e;be!==null;){n=be;var a=n.sibling,s=n.return;if(Ed(n),n===l){be=null;break e}if(a!==null){a.return=s,be=a;break e}be=s}}}var vh={getCacheForType:function(e){var t=Te(xe),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Te(xe).controller.signal}},bh=typeof WeakMap=="function"?WeakMap:Map,Z=0,ee=null,Y=null,G=0,J=0,qe=null,Ft=!1,wn=!1,$o=!1,Ht=0,ue=0,fl=0,kl=0,qo=0,Xe=0,vn=0,aa=null,Be=null,Rc=!1,si=0,Yd=0,Os=1/0,Us=null,nl=null,ye=0,al=null,bn=null,Dt=0,Hc=0,_c=null,Gd=null,sa=0,Lc=null;function Je(){return Z&2&&G!==0?G&-G:R.T!==null?Go():Wr()}function Xd(){if(Xe===0)if(!(G&536870912)||Q){var e=Ra;Ra<<=1,!(Ra&3932160)&&(Ra=262144),Xe=e}else Xe=536870912;return e=Fe.current,e!==null&&(e.flags|=32),Xe}function Re(e,t,l){(e===ee&&(J===2||J===9)||e.cancelPendingCommit!==null)&&(jn(e,0),Wt(e,G,Xe,!1)),za(e,l),(!(Z&2)||e!==ee)&&(e===ee&&(!(Z&2)&&(kl|=l),ue===4&&Wt(e,G,Xe,!1)),yt(e))}function Qd(e,t,l){if(Z&6)throw Error(T(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Na(e,t),a=n?Nh(e,t):qi(e,t,!0),s=n;do{if(a===0){wn&&!n&&Wt(e,t,0,!1);break}else{if(l=e.current.alternate,s&&!jh(l)){a=qi(e,t,!1),s=!1;continue}if(a===2){if(s=t,e.errorRecoveryDisabledLanes&s)var c=0;else c=e.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){t=c;e:{var o=e;a=aa;var u=o.current.memoizedState.isDehydrated;if(u&&(jn(o,c).flags|=256),c=qi(o,c,!1),c!==2){if($o&&!u){o.errorRecoveryDisabledLanes|=s,kl|=s,a=4;break e}s=Be,Be=a,s!==null&&(Be===null?Be=s:Be.push.apply(Be,s))}a=c}if(s=!1,a!==2)continue}}if(a===1){jn(e,0),Wt(e,t,0,!0);break}e:{switch(n=e,s=a,s){case 0:case 1:throw Error(T(345));case 4:if((t&4194048)!==t)break;case 6:Wt(n,t,Xe,!Ft);break e;case 2:Be=null;break;case 3:case 5:break;default:throw Error(T(329))}if((t&62914560)===t&&(a=si+300-Qe(),10<a)){if(Wt(n,t,Xe,!Ft),Js(n,0,!0)!==0)break e;Dt=t,n.timeoutHandle=f0(Ku.bind(null,n,l,Be,Us,Rc,t,Xe,kl,vn,Ft,s,"Throttled",-0,0),a);break e}Ku(n,l,Be,Us,Rc,t,Xe,kl,vn,Ft,s,null,-0,0)}}break}while(!0);yt(e)}function Ku(e,t,l,n,a,s,c,o,u,r,h,p,m,g){if(e.timeoutHandle=-1,p=t.subtreeFlags,p&8192||(p&16785408)===16785408){p={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wt},_d(t,s,p);var y=(s&62914560)===s?si-Qe():(s&4194048)===s?Yd-Qe():0;if(y=sx(p,y),y!==null){Dt=s,e.cancelPendingCommit=y(Wu.bind(null,e,t,s,l,n,a,c,o,u,h,p,null,m,g)),Wt(e,s,c,!r);return}}Wu(e,t,s,l,n,a,c,o,u)}function jh(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var a=l[n],s=a.getSnapshot;a=a.value;try{if(!Ke(s(),a))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Wt(e,t,l,n){t&=~qo,t&=~kl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var a=t;0<a;){var s=31-Ve(a),c=1<<s;n[s]=-1,a&=~c}l!==0&&Jr(e,l,t)}function ii(){return Z&6?!0:(Ma(0),!1)}function Yo(){if(Y!==null){if(J===0)var e=Y.return;else e=Y,At=Hl=null,ko(e),rn=null,ma=0,e=Y;for(;e!==null;)zd(e.alternate,e),e=e.return;Y=null}}function jn(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,qh(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Dt=0,Yo(),ee=e,Y=l=Mt(e.current,null),G=t,J=0,qe=null,Ft=!1,wn=Na(e,t),$o=!1,vn=Xe=qo=kl=fl=ue=0,Be=aa=null,Rc=!1,t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var a=31-Ve(n),s=1<<a;t|=e[a],n&=~s}return Ht=t,Is(),l}function Zd(e,t){L=null,R.H=xa,t===kn||t===ei?(t=ku(),J=3):t===bo?(t=ku(),J=4):J=t===Ro?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qe=t,Y===null&&(ue=1,Ms(e,nt(t,e.current)))}function Vd(){var e=Fe.current;return e===null?!0:(G&4194048)===G?it===null:(G&62914560)===G||G&536870912?e===it:!1}function Jd(){var e=R.H;return R.H=xa,e===null?xa:e}function Kd(){var e=R.A;return R.A=vh,e}function Bs(){ue=4,Ft||(G&4194048)!==G&&Fe.current!==null||(wn=!0),!(fl&134217727)&&!(kl&134217727)||ee===null||Wt(ee,G,Xe,!1)}function qi(e,t,l){var n=Z;Z|=2;var a=Jd(),s=Kd();(ee!==e||G!==t)&&(Us=null,jn(e,t)),t=!1;var c=ue;e:do try{if(J!==0&&Y!==null){var o=Y,u=qe;switch(J){case 8:Yo(),c=6;break e;case 3:case 2:case 9:case 6:Fe.current===null&&(t=!0);var r=J;if(J=0,qe=null,ln(e,o,u,r),l&&wn){c=0;break e}break;default:r=J,J=0,qe=null,ln(e,o,u,r)}}Sh(),c=ue;break}catch(h){Zd(e,h)}while(!0);return t&&e.shellSuspendCounter++,At=Hl=null,Z=n,R.H=a,R.A=s,Y===null&&(ee=null,G=0,Is()),c}function Sh(){for(;Y!==null;)Fd(Y)}function Nh(e,t){var l=Z;Z|=2;var n=Jd(),a=Kd();ee!==e||G!==t?(Us=null,Os=Qe()+500,jn(e,t)):wn=Na(e,t);e:do try{if(J!==0&&Y!==null){t=Y;var s=qe;t:switch(J){case 1:J=0,qe=null,ln(e,t,s,1);break;case 2:case 9:if(Tu(s)){J=0,qe=null,Fu(t);break}t=function(){J!==2&&J!==9||ee!==e||(J=7),yt(e)},s.then(t,t);break e;case 3:J=7;break e;case 4:J=5;break e;case 7:Tu(s)?(J=0,qe=null,Fu(t)):(J=0,qe=null,ln(e,t,s,7));break;case 5:var c=null;switch(Y.tag){case 26:c=Y.memoizedState;case 5:case 27:var o=Y;if(c?p0(c):o.stateNode.complete){J=0,qe=null;var u=o.sibling;if(u!==null)Y=u;else{var r=o.return;r!==null?(Y=r,ci(r)):Y=null}break t}}J=0,qe=null,ln(e,t,s,5);break;case 6:J=0,qe=null,ln(e,t,s,6);break;case 8:Yo(),ue=6;break e;default:throw Error(T(462))}}zh();break}catch(h){Zd(e,h)}while(!0);return At=Hl=null,R.H=n,R.A=a,Z=l,Y!==null?0:(ee=null,G=0,Is(),ue)}function zh(){for(;Y!==null&&!V0();)Fd(Y)}function Fd(e){var t=Nd(e.alternate,e,Ht);e.memoizedProps=e.pendingProps,t===null?ci(e):Y=t}function Fu(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Gu(l,t,t.pendingProps,t.type,void 0,G);break;case 11:t=Gu(l,t,t.pendingProps,t.type.render,t.ref,G);break;case 5:ko(t);default:zd(l,t),t=Y=zf(t,Ht),t=Nd(l,t,Ht)}e.memoizedProps=e.pendingProps,t===null?ci(e):Y=t}function ln(e,t,l,n){At=Hl=null,ko(t),rn=null,ma=0;var a=t.return;try{if(dh(e,a,t,l,G)){ue=1,Ms(e,nt(l,e.current)),Y=null;return}}catch(s){if(a!==null)throw Y=a,s;ue=1,Ms(e,nt(l,e.current)),Y=null;return}t.flags&32768?(Q||n===1?e=!0:wn||G&536870912?e=!1:(Ft=e=!0,(n===2||n===9||n===3||n===6)&&(n=Fe.current,n!==null&&n.tag===13&&(n.flags|=16384))),Wd(t,e)):ci(t)}function ci(e){var t=e;do{if(t.flags&32768){Wd(t,Ft);return}e=t.return;var l=xh(t.alternate,t,Ht);if(l!==null){Y=l;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);ue===0&&(ue=5)}function Wd(e,t){do{var l=ph(e.alternate,e);if(l!==null){l.flags&=32767,Y=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=l}while(e!==null);ue=6,Y=null}function Wu(e,t,l,n,a,s,c,o,u){e.cancelPendingCommit=null;do oi();while(ye!==0);if(Z&6)throw Error(T(327));if(t!==null){if(t===e.current)throw Error(T(177));if(s=t.lanes|t.childLanes,s|=mo,nm(e,l,s,c,o,u),e===ee&&(Y=ee=null,G=0),bn=t,al=e,Dt=l,Hc=s,_c=a,Gd=n,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,wh(vs,function(){return l0(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,t.subtreeFlags&13878||n){n=R.T,R.T=null,a=V.p,V.p=2,c=Z,Z|=4;try{gh(e,t,l)}finally{Z=c,V.p=a,R.T=n}}ye=1,Id(),Pd(),e0()}}function Id(){if(ye===1){ye=0;var e=al,t=bn,l=(t.flags&13878)!==0;if(t.subtreeFlags&13878||l){l=R.T,R.T=null;var n=V.p;V.p=2;var a=Z;Z|=4;try{Bd(t,e);var s=Gc,c=pf(e.containerInfo),o=s.focusedElem,u=s.selectionRange;if(c!==o&&o&&o.ownerDocument&&xf(o.ownerDocument.documentElement,o)){if(u!==null&&fo(o)){var r=u.start,h=u.end;if(h===void 0&&(h=r),"selectionStart"in o)o.selectionStart=r,o.selectionEnd=Math.min(h,o.value.length);else{var p=o.ownerDocument||document,m=p&&p.defaultView||window;if(m.getSelection){var g=m.getSelection(),y=o.textContent.length,j=Math.min(u.start,y),b=u.end===void 0?j:Math.min(u.end,y);!g.extend&&j>b&&(c=b,b=j,j=c);var f=vu(o,j),d=vu(o,b);if(f&&d&&(g.rangeCount!==1||g.anchorNode!==f.node||g.anchorOffset!==f.offset||g.focusNode!==d.node||g.focusOffset!==d.offset)){var x=p.createRange();x.setStart(f.node,f.offset),g.removeAllRanges(),j>b?(g.addRange(x),g.extend(d.node,d.offset)):(x.setEnd(d.node,d.offset),g.addRange(x))}}}}for(p=[],g=o;g=g.parentNode;)g.nodeType===1&&p.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<p.length;o++){var v=p[o];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}Gs=!!Yc,Gc=Yc=null}finally{Z=a,V.p=n,R.T=l}}e.current=t,ye=2}}function Pd(){if(ye===2){ye=0;var e=al,t=bn,l=(t.flags&8772)!==0;if(t.subtreeFlags&8772||l){l=R.T,R.T=null;var n=V.p;V.p=2;var a=Z;Z|=4;try{Md(e,t.alternate,t)}finally{Z=a,V.p=n,R.T=l}}ye=3}}function e0(){if(ye===4||ye===3){ye=0,J0();var e=al,t=bn,l=Dt,n=Gd;t.subtreeFlags&10256||t.flags&10256?ye=5:(ye=0,bn=al=null,t0(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(nl=null),ao(l),t=t.stateNode,Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(Sa,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=R.T,a=V.p,V.p=2,R.T=null;try{for(var s=e.onRecoverableError,c=0;c<n.length;c++){var o=n[c];s(o.value,{componentStack:o.stack})}}finally{R.T=t,V.p=a}}Dt&3&&oi(),yt(e),a=e.pendingLanes,l&261930&&a&42?e===Lc?sa++:(sa=0,Lc=e):sa=0,Ma(0)}}function t0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function oi(){return Id(),Pd(),e0(),l0()}function l0(){if(ye!==5)return!1;var e=al,t=Hc;Hc=0;var l=ao(Dt),n=R.T,a=V.p;try{V.p=32>l?32:l,R.T=null,l=_c,_c=null;var s=al,c=Dt;if(ye=0,bn=al=null,Dt=0,Z&6)throw Error(T(331));var o=Z;if(Z|=4,$d(s.current),Hd(s,s.current,c,l),Z=o,Ma(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(Sa,s)}catch{}return!0}finally{V.p=a,R.T=n,t0(e,t)}}function Iu(e,t,l){t=nt(l,t),t=Dc(e.stateNode,t,2),e=ll(e,t,2),e!==null&&(za(e,2),yt(e))}function K(e,t,l){if(e.tag===3)Iu(e,e,l);else for(;t!==null;){if(t.tag===3){Iu(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(nl===null||!nl.has(n))){e=nt(l,e),l=gd(2),n=ll(t,l,2),n!==null&&(yd(l,n,t,e),za(n,2),yt(n));break}}t=t.return}}function Yi(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new bh;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(l)||($o=!0,a.add(l),e=Ch.bind(null,e,t,l),t.then(e,e))}function Ch(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,ee===e&&(G&l)===l&&(ue===4||ue===3&&(G&62914560)===G&&300>Qe()-si?!(Z&2)&&jn(e,0):qo|=l,vn===G&&(vn=0)),yt(e)}function n0(e,t){t===0&&(t=Vr()),e=Rl(e,t),e!==null&&(za(e,t),yt(e))}function Th(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),n0(e,l)}function kh(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(l=a.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(T(314))}n!==null&&n.delete(t),n0(e,l)}function wh(e,t){return lo(e,t)}var Rs=null,Yl=null,$c=!1,Hs=!1,Gi=!1,It=0;function yt(e){e!==Yl&&e.next===null&&(Yl===null?Rs=Yl=e:Yl=Yl.next=e),Hs=!0,$c||($c=!0,Mh())}function Ma(e,t){if(!Gi&&Hs){Gi=!0;do for(var l=!1,n=Rs;n!==null;){if(e!==0){var a=n.pendingLanes;if(a===0)var s=0;else{var c=n.suspendedLanes,o=n.pingedLanes;s=(1<<31-Ve(42|e)+1)-1,s&=a&~(c&~o),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(l=!0,Pu(n,s))}else s=G,s=Js(n,n===ee?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(s&3)||Na(n,s)||(l=!0,Pu(n,s));n=n.next}while(l);Gi=!1}}function Ah(){a0()}function a0(){Hs=$c=!1;var e=0;It!==0&&$h()&&(e=It);for(var t=Qe(),l=null,n=Rs;n!==null;){var a=n.next,s=s0(n,t);s===0?(n.next=null,l===null?Rs=a:l.next=a,a===null&&(Yl=l)):(l=n,(e!==0||s&3)&&(Hs=!0)),n=a}ye!==0&&ye!==5||Ma(e),It!==0&&(It=0)}function s0(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var c=31-Ve(s),o=1<<c,u=a[c];u===-1?(!(o&l)||o&n)&&(a[c]=lm(o,t)):u<=t&&(e.expiredLanes|=o),s&=~o}if(t=ee,l=G,l=Js(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(J===2||J===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&gi(n),e.callbackNode=null,e.callbackPriority=0;if(!(l&3)||Na(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&gi(n),ao(l)){case 2:case 8:l=Qr;break;case 32:l=vs;break;case 268435456:l=Zr;break;default:l=vs}return n=i0.bind(null,e),l=lo(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&gi(n),e.callbackPriority=2,e.callbackNode=null,2}function i0(e,t){if(ye!==0&&ye!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(oi()&&e.callbackNode!==l)return null;var n=G;return n=Js(e,e===ee?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Qd(e,n,t),s0(e,Qe()),e.callbackNode!=null&&e.callbackNode===l?i0.bind(null,e):null)}function Pu(e,t){if(oi())return null;Qd(e,t,!0)}function Mh(){Yh(function(){Z&6?lo(Xr,Ah):a0()})}function Go(){if(It===0){var e=pn;e===0&&(e=Ba,Ba<<=1,!(Ba&261888)&&(Ba=256)),It=e}return It}function er(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:es(""+e)}function tr(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Eh(e,t,l,n,a){if(t==="submit"&&l&&l.stateNode===a){var s=er((a[He]||null).action),c=n.submitter;c&&(t=(t=c[He]||null)?er(t.formAction):c.getAttribute("formAction"),t!==null&&(s=t,c=null));var o=new Ks("action","action",null,n,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(It!==0){var u=c?tr(a,c):new FormData(a);Mc(l,{pending:!0,data:u,method:a.method,action:s},null,u)}}else typeof s=="function"&&(o.preventDefault(),u=c?tr(a,c):new FormData(a),Mc(l,{pending:!0,data:u,method:a.method,action:s},s,u))},currentTarget:a}]})}}for(var Xi=0;Xi<yc.length;Xi++){var Qi=yc[Xi],Dh=Qi.toLowerCase(),Oh=Qi[0].toUpperCase()+Qi.slice(1);dt(Dh,"on"+Oh)}dt(yf,"onAnimationEnd");dt(vf,"onAnimationIteration");dt(bf,"onAnimationStart");dt("dblclick","onDoubleClick");dt("focusin","onFocus");dt("focusout","onBlur");dt(Km,"onTransitionRun");dt(Fm,"onTransitionStart");dt(Wm,"onTransitionCancel");dt(jf,"onTransitionEnd");hn("onMouseEnter",["mouseout","mouseover"]);hn("onMouseLeave",["mouseout","mouseover"]);hn("onPointerEnter",["pointerout","pointerover"]);hn("onPointerLeave",["pointerout","pointerover"]);Ol("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ol("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ol("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ol("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ol("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ol("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var pa="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(" "),Uh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pa));function c0(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],a=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var c=n.length-1;0<=c;c--){var o=n[c],u=o.instance,r=o.currentTarget;if(o=o.listener,u!==s&&a.isPropagationStopped())break e;s=o,a.currentTarget=r;try{s(a)}catch(h){js(h)}a.currentTarget=null,s=u}else for(c=0;c<n.length;c++){if(o=n[c],u=o.instance,r=o.currentTarget,o=o.listener,u!==s&&a.isPropagationStopped())break e;s=o,a.currentTarget=r;try{s(a)}catch(h){js(h)}a.currentTarget=null,s=u}}}}function q(e,t){var l=t[rc];l===void 0&&(l=t[rc]=new Set);var n=e+"__bubble";l.has(n)||(o0(t,e,2,!1),l.add(n))}function Zi(e,t,l){var n=0;t&&(n|=4),o0(l,e,n,t)}var Qa="_reactListening"+Math.random().toString(36).slice(2);function Xo(e){if(!e[Qa]){e[Qa]=!0,Ir.forEach(function(l){l!=="selectionchange"&&(Uh.has(l)||Zi(l,!1,e),Zi(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qa]||(t[Qa]=!0,Zi("selectionchange",!1,t))}}function o0(e,t,l,n){switch(j0(t)){case 2:var a=ox;break;case 8:a=ux;break;default:a=Jo}l=a.bind(null,t,l,e),a=void 0,!xc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,l,{capture:!0,passive:a}):e.addEventListener(t,l,!0):a!==void 0?e.addEventListener(t,l,{passive:a}):e.addEventListener(t,l,!1)}function Vi(e,t,l,n,a){var s=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var c=n.tag;if(c===3||c===4){var o=n.stateNode.containerInfo;if(o===a)break;if(c===4)for(c=n.return;c!==null;){var u=c.tag;if((u===3||u===4)&&c.stateNode.containerInfo===a)return;c=c.return}for(;o!==null;){if(c=Vl(o),c===null)return;if(u=c.tag,u===5||u===6||u===26||u===27){n=s=c;continue e}o=o.parentNode}}n=n.return}cf(function(){var r=s,h=co(l),p=[];e:{var m=Sf.get(e);if(m!==void 0){var g=Ks,y=e;switch(e){case"keypress":if(ls(l)===0)break e;case"keydown":case"keyup":g=km;break;case"focusin":y="focus",g=Si;break;case"focusout":y="blur",g=Si;break;case"beforeblur":case"afterblur":g=Si;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=uu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=xm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Mm;break;case yf:case vf:case bf:g=ym;break;case jf:g=Dm;break;case"scroll":case"scrollend":g=mm;break;case"wheel":g=Um;break;case"copy":case"cut":case"paste":g=bm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=fu;break;case"toggle":case"beforetoggle":g=Rm}var j=(t&4)!==0,b=!j&&(e==="scroll"||e==="scrollend"),f=j?m!==null?m+"Capture":null:m;j=[];for(var d=r,x;d!==null;){var v=d;if(x=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||x===null||f===null||(v=oa(d,f),v!=null&&j.push(ga(d,v,x))),b)break;d=d.return}0<j.length&&(m=new g(m,y,null,l,h),p.push({event:m,listeners:j}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",m&&l!==hc&&(y=l.relatedTarget||l.fromElement)&&(Vl(y)||y[zn]))break e;if((g||m)&&(m=h.window===h?h:(m=h.ownerDocument)?m.defaultView||m.parentWindow:window,g?(y=l.relatedTarget||l.toElement,g=r,y=y?Vl(y):null,y!==null&&(b=ja(y),j=y.tag,y!==b||j!==5&&j!==27&&j!==6)&&(y=null)):(g=null,y=r),g!==y)){if(j=uu,v="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(j=fu,v="onPointerLeave",f="onPointerEnter",d="pointer"),b=g==null?m:$n(g),x=y==null?m:$n(y),m=new j(v,d+"leave",g,l,h),m.target=b,m.relatedTarget=x,v=null,Vl(h)===r&&(j=new j(f,d+"enter",y,l,h),j.target=x,j.relatedTarget=b,v=j),b=v,g&&y)t:{for(j=Bh,f=g,d=y,x=0,v=f;v;v=j(v))x++;v=0;for(var S=d;S;S=j(S))v++;for(;0<x-v;)f=j(f),x--;for(;0<v-x;)d=j(d),v--;for(;x--;){if(f===d||d!==null&&f===d.alternate){j=f;break t}f=j(f),d=j(d)}j=null}else j=null;g!==null&&lr(p,m,g,j,!1),y!==null&&b!==null&&lr(p,b,y,j,!0)}}e:{if(m=r?$n(r):window,g=m.nodeName&&m.nodeName.toLowerCase(),g==="select"||g==="input"&&m.type==="file")var z=xu;else if(hu(m))if(mf)z=Zm;else{z=Xm;var N=Gm}else g=m.nodeName,!g||g.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?r&&io(r.elementType)&&(z=xu):z=Qm;if(z&&(z=z(e,r))){df(p,z,l,h);break e}N&&N(e,m,r),e==="focusout"&&r&&m.type==="number"&&r.memoizedProps.value!=null&&mc(m,"number",m.value)}switch(N=r?$n(r):window,e){case"focusin":(hu(N)||N.contentEditable==="true")&&(Fl=N,pc=r,Fn=null);break;case"focusout":Fn=pc=Fl=null;break;case"mousedown":gc=!0;break;case"contextmenu":case"mouseup":case"dragend":gc=!1,bu(p,l,h);break;case"selectionchange":if(Jm)break;case"keydown":case"keyup":bu(p,l,h)}var M;if(ro)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Kl?rf(e,l)&&(A="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(A="onCompositionStart");A&&(uf&&l.locale!=="ko"&&(Kl||A!=="onCompositionStart"?A==="onCompositionEnd"&&Kl&&(M=of()):(Kt=h,oo="value"in Kt?Kt.value:Kt.textContent,Kl=!0)),N=_s(r,A),0<N.length&&(A=new ru(A,e,null,l,h),p.push({event:A,listeners:N}),M?A.data=M:(M=ff(l),M!==null&&(A.data=M)))),(M=_m?Lm(e,l):$m(e,l))&&(A=_s(r,"onBeforeInput"),0<A.length&&(N=new ru("onBeforeInput","beforeinput",null,l,h),p.push({event:N,listeners:A}),N.data=M)),Eh(p,e,r,l,h)}c0(p,t)})}function ga(e,t,l){return{instance:e,listener:t,currentTarget:l}}function _s(e,t){for(var l=t+"Capture",n=[];e!==null;){var a=e,s=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||s===null||(a=oa(e,l),a!=null&&n.unshift(ga(e,a,s)),a=oa(e,t),a!=null&&n.push(ga(e,a,s))),e.tag===3)return n;e=e.return}return[]}function Bh(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function lr(e,t,l,n,a){for(var s=t._reactName,c=[];l!==null&&l!==n;){var o=l,u=o.alternate,r=o.stateNode;if(o=o.tag,u!==null&&u===n)break;o!==5&&o!==26&&o!==27||r===null||(u=r,a?(r=oa(l,s),r!=null&&c.unshift(ga(l,r,u))):a||(r=oa(l,s),r!=null&&c.push(ga(l,r,u)))),l=l.return}c.length!==0&&e.push({event:t,listeners:c})}var Rh=/\r\n?/g,Hh=/\u0000|\uFFFD/g;function nr(e){return(typeof e=="string"?e:""+e).replace(Rh,`
|
|
33
|
+
`).replace(Hh,"")}function u0(e,t){return t=nr(t),nr(e)===t}function I(e,t,l,n,a,s){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||xn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&xn(e,""+n);break;case"className":_a(e,"class",n);break;case"tabIndex":_a(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":_a(e,l,n);break;case"style":sf(e,n,s);break;case"data":if(t!=="object"){_a(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=es(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(l==="formAction"?(t!=="input"&&I(e,t,"name",a.name,a,null),I(e,t,"formEncType",a.formEncType,a,null),I(e,t,"formMethod",a.formMethod,a,null),I(e,t,"formTarget",a.formTarget,a,null)):(I(e,t,"encType",a.encType,a,null),I(e,t,"method",a.method,a,null),I(e,t,"target",a.target,a,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=es(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=wt);break;case"onScroll":n!=null&&q("scroll",e);break;case"onScrollEnd":n!=null&&q("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(T(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(T(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=es(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":q("beforetoggle",e),q("toggle",e),Pa(e,"popover",n);break;case"xlinkActuate":bt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":bt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":bt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":bt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":bt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":bt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":bt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":bt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":bt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Pa(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=fm.get(l)||l,Pa(e,l,n))}}function qc(e,t,l,n,a,s){switch(l){case"style":sf(e,n,s);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(T(61));if(l=n.__html,l!=null){if(a.children!=null)throw Error(T(60));e.innerHTML=l}}break;case"children":typeof n=="string"?xn(e,n):(typeof n=="number"||typeof n=="bigint")&&xn(e,""+n);break;case"onScroll":n!=null&&q("scroll",e);break;case"onScrollEnd":n!=null&&q("scrollend",e);break;case"onClick":n!=null&&(e.onclick=wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(a=l.endsWith("Capture"),t=l.slice(2,a?l.length-7:void 0),s=e[He]||null,s=s!=null?s[l]:null,typeof s=="function"&&e.removeEventListener(t,s,a),typeof n=="function")){typeof s!="function"&&s!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,a);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):Pa(e,l,n)}}}function ke(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":q("error",e),q("load",e);var n=!1,a=!1,s;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];if(c!=null)switch(s){case"src":n=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(T(137,t));default:I(e,t,s,c,l,null)}}a&&I(e,t,"srcSet",l.srcSet,l,null),n&&I(e,t,"src",l.src,l,null);return;case"input":q("invalid",e);var o=s=c=a=null,u=null,r=null;for(n in l)if(l.hasOwnProperty(n)){var h=l[n];if(h!=null)switch(n){case"name":a=h;break;case"type":c=h;break;case"checked":u=h;break;case"defaultChecked":r=h;break;case"value":s=h;break;case"defaultValue":o=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(T(137,t));break;default:I(e,t,n,h,l,null)}}lf(e,s,o,u,r,c,a,!1);return;case"select":q("invalid",e),n=c=s=null;for(a in l)if(l.hasOwnProperty(a)&&(o=l[a],o!=null))switch(a){case"value":s=o;break;case"defaultValue":c=o;break;case"multiple":n=o;default:I(e,t,a,o,l,null)}t=s,l=c,e.multiple=!!n,t!=null?cn(e,!!n,t,!1):l!=null&&cn(e,!!n,l,!0);return;case"textarea":q("invalid",e),s=a=n=null;for(c in l)if(l.hasOwnProperty(c)&&(o=l[c],o!=null))switch(c){case"value":n=o;break;case"defaultValue":a=o;break;case"children":s=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(T(91));break;default:I(e,t,c,o,l,null)}af(e,n,a,s);return;case"option":for(u in l)if(l.hasOwnProperty(u)&&(n=l[u],n!=null))switch(u){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:I(e,t,u,n,l,null)}return;case"dialog":q("beforetoggle",e),q("toggle",e),q("cancel",e),q("close",e);break;case"iframe":case"object":q("load",e);break;case"video":case"audio":for(n=0;n<pa.length;n++)q(pa[n],e);break;case"image":q("error",e),q("load",e);break;case"details":q("toggle",e);break;case"embed":case"source":case"link":q("error",e),q("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(r in l)if(l.hasOwnProperty(r)&&(n=l[r],n!=null))switch(r){case"children":case"dangerouslySetInnerHTML":throw Error(T(137,t));default:I(e,t,r,n,l,null)}return;default:if(io(t)){for(h in l)l.hasOwnProperty(h)&&(n=l[h],n!==void 0&&qc(e,t,h,n,l,void 0));return}}for(o in l)l.hasOwnProperty(o)&&(n=l[o],n!=null&&I(e,t,o,n,l,null))}function _h(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,s=null,c=null,o=null,u=null,r=null,h=null;for(g in l){var p=l[g];if(l.hasOwnProperty(g)&&p!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":u=p;default:n.hasOwnProperty(g)||I(e,t,g,null,n,p)}}for(var m in n){var g=n[m];if(p=l[m],n.hasOwnProperty(m)&&(g!=null||p!=null))switch(m){case"type":s=g;break;case"name":a=g;break;case"checked":r=g;break;case"defaultChecked":h=g;break;case"value":c=g;break;case"defaultValue":o=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(T(137,t));break;default:g!==p&&I(e,t,m,g,n,p)}}dc(e,c,o,u,r,h,s,a);return;case"select":g=c=o=m=null;for(s in l)if(u=l[s],l.hasOwnProperty(s)&&u!=null)switch(s){case"value":break;case"multiple":g=u;default:n.hasOwnProperty(s)||I(e,t,s,null,n,u)}for(a in n)if(s=n[a],u=l[a],n.hasOwnProperty(a)&&(s!=null||u!=null))switch(a){case"value":m=s;break;case"defaultValue":o=s;break;case"multiple":c=s;default:s!==u&&I(e,t,a,s,n,u)}t=o,l=c,n=g,m!=null?cn(e,!!l,m,!1):!!n!=!!l&&(t!=null?cn(e,!!l,t,!0):cn(e,!!l,l?[]:"",!1));return;case"textarea":g=m=null;for(o in l)if(a=l[o],l.hasOwnProperty(o)&&a!=null&&!n.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:I(e,t,o,null,n,a)}for(c in n)if(a=n[c],s=l[c],n.hasOwnProperty(c)&&(a!=null||s!=null))switch(c){case"value":m=a;break;case"defaultValue":g=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(T(91));break;default:a!==s&&I(e,t,c,a,n,s)}nf(e,m,g);return;case"option":for(var y in l)if(m=l[y],l.hasOwnProperty(y)&&m!=null&&!n.hasOwnProperty(y))switch(y){case"selected":e.selected=!1;break;default:I(e,t,y,null,n,m)}for(u in n)if(m=n[u],g=l[u],n.hasOwnProperty(u)&&m!==g&&(m!=null||g!=null))switch(u){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:I(e,t,u,m,n,g)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var j in l)m=l[j],l.hasOwnProperty(j)&&m!=null&&!n.hasOwnProperty(j)&&I(e,t,j,null,n,m);for(r in n)if(m=n[r],g=l[r],n.hasOwnProperty(r)&&m!==g&&(m!=null||g!=null))switch(r){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(T(137,t));break;default:I(e,t,r,m,n,g)}return;default:if(io(t)){for(var b in l)m=l[b],l.hasOwnProperty(b)&&m!==void 0&&!n.hasOwnProperty(b)&&qc(e,t,b,void 0,n,m);for(h in n)m=n[h],g=l[h],!n.hasOwnProperty(h)||m===g||m===void 0&&g===void 0||qc(e,t,h,m,n,g);return}}for(var f in l)m=l[f],l.hasOwnProperty(f)&&m!=null&&!n.hasOwnProperty(f)&&I(e,t,f,null,n,m);for(p in n)m=n[p],g=l[p],!n.hasOwnProperty(p)||m===g||m==null&&g==null||I(e,t,p,m,n,g)}function ar(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lh(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var a=l[n],s=a.transferSize,c=a.initiatorType,o=a.duration;if(s&&o&&ar(c)){for(c=0,o=a.responseEnd,n+=1;n<l.length;n++){var u=l[n],r=u.startTime;if(r>o)break;var h=u.transferSize,p=u.initiatorType;h&&ar(p)&&(u=u.responseEnd,c+=h*(u<o?1:(o-r)/(u-r)))}if(--n,t+=8*(s+c)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Yc=null,Gc=null;function Ls(e){return e.nodeType===9?e:e.ownerDocument}function sr(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function r0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Xc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ji=null;function $h(){var e=window.event;return e&&e.type==="popstate"?e===Ji?!1:(Ji=e,!0):(Ji=null,!1)}var f0=typeof setTimeout=="function"?setTimeout:void 0,qh=typeof clearTimeout=="function"?clearTimeout:void 0,ir=typeof Promise=="function"?Promise:void 0,Yh=typeof queueMicrotask=="function"?queueMicrotask:typeof ir<"u"?function(e){return ir.resolve(null).then(e).catch(Gh)}:f0;function Gh(e){setTimeout(function(){throw e})}function xl(e){return e==="head"}function cr(e,t){var l=t,n=0;do{var a=l.nextSibling;if(e.removeChild(l),a&&a.nodeType===8)if(l=a.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(a),Nn(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")ia(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,ia(l);for(var s=l.firstChild;s;){var c=s.nextSibling,o=s.nodeName;s[Ca]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&s.rel.toLowerCase()==="stylesheet"||l.removeChild(s),s=c}}else l==="body"&&ia(e.ownerDocument.body);l=a}while(l);Nn(t)}function or(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function Qc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Qc(l),so(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Xh(e,t,l,n){for(;e.nodeType===1;){var a=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Ca])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=ct(e.nextSibling),e===null)break}return null}function Qh(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=ct(e.nextSibling),e===null))return null;return e}function d0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ct(e.nextSibling),e===null))return null;return e}function Zc(e){return e.data==="$?"||e.data==="$~"}function Vc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Zh(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ct(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Jc=null;function ur(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return ct(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function rr(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function m0(e,t,l){switch(t=Ls(l),e){case"html":if(e=t.documentElement,!e)throw Error(T(452));return e;case"head":if(e=t.head,!e)throw Error(T(453));return e;case"body":if(e=t.body,!e)throw Error(T(454));return e;default:throw Error(T(451))}}function ia(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);so(e)}var ut=new Map,fr=new Set;function $s(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _t=V.d;V.d={f:Vh,r:Jh,D:Kh,C:Fh,L:Wh,m:Ih,X:ex,S:Ph,M:tx};function Vh(){var e=_t.f(),t=ii();return e||t}function Jh(e){var t=Cn(e);t!==null&&t.tag===5&&t.type==="form"?id(t):_t.r(e)}var An=typeof document>"u"?null:document;function h0(e,t,l){var n=An;if(n&&typeof t=="string"&&t){var a=lt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof l=="string"&&(a+='[crossorigin="'+l+'"]'),fr.has(a)||(fr.add(a),e={rel:e,crossOrigin:l,href:t},n.querySelector(a)===null&&(t=n.createElement("link"),ke(t,"link",e),je(t),n.head.appendChild(t)))}}function Kh(e){_t.D(e),h0("dns-prefetch",e,null)}function Fh(e,t){_t.C(e,t),h0("preconnect",e,t)}function Wh(e,t,l){_t.L(e,t,l);var n=An;if(n&&e&&t){var a='link[rel="preload"][as="'+lt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(a+='[imagesrcset="'+lt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(a+='[imagesizes="'+lt(l.imageSizes)+'"]')):a+='[href="'+lt(e)+'"]';var s=a;switch(t){case"style":s=Sn(e);break;case"script":s=Mn(e)}ut.has(s)||(e=se({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),ut.set(s,e),n.querySelector(a)!==null||t==="style"&&n.querySelector(Ea(s))||t==="script"&&n.querySelector(Da(s))||(t=n.createElement("link"),ke(t,"link",e),je(t),n.head.appendChild(t)))}}function Ih(e,t){_t.m(e,t);var l=An;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+lt(n)+'"][href="'+lt(e)+'"]',s=a;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Mn(e)}if(!ut.has(s)&&(e=se({rel:"modulepreload",href:e},t),ut.set(s,e),l.querySelector(a)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Da(s)))return}n=l.createElement("link"),ke(n,"link",e),je(n),l.head.appendChild(n)}}}function Ph(e,t,l){_t.S(e,t,l);var n=An;if(n&&e){var a=sn(n).hoistableStyles,s=Sn(e);t=t||"default";var c=a.get(s);if(!c){var o={loading:0,preload:null};if(c=n.querySelector(Ea(s)))o.loading=5;else{e=se({rel:"stylesheet",href:e,"data-precedence":t},l),(l=ut.get(s))&&Qo(e,l);var u=c=n.createElement("link");je(u),ke(u,"link",e),u._p=new Promise(function(r,h){u.onload=r,u.onerror=h}),u.addEventListener("load",function(){o.loading|=1}),u.addEventListener("error",function(){o.loading|=2}),o.loading|=4,rs(c,t,n)}c={type:"stylesheet",instance:c,count:1,state:o},a.set(s,c)}}}function ex(e,t){_t.X(e,t);var l=An;if(l&&e){var n=sn(l).hoistableScripts,a=Mn(e),s=n.get(a);s||(s=l.querySelector(Da(a)),s||(e=se({src:e,async:!0},t),(t=ut.get(a))&&Zo(e,t),s=l.createElement("script"),je(s),ke(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function tx(e,t){_t.M(e,t);var l=An;if(l&&e){var n=sn(l).hoistableScripts,a=Mn(e),s=n.get(a);s||(s=l.querySelector(Da(a)),s||(e=se({src:e,async:!0,type:"module"},t),(t=ut.get(a))&&Zo(e,t),s=l.createElement("script"),je(s),ke(s,"link",e),l.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},n.set(a,s))}}function dr(e,t,l,n){var a=(a=Pt.current)?$s(a):null;if(!a)throw Error(T(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Sn(l.href),l=sn(a).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Sn(l.href);var s=sn(a).hoistableStyles,c=s.get(e);if(c||(a=a.ownerDocument||a,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,c),(s=a.querySelector(Ea(e)))&&!s._p&&(c.instance=s,c.state.loading=5),ut.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ut.set(e,l),s||lx(a,e,l,c.state))),t&&n===null)throw Error(T(528,""));return c}if(t&&n!==null)throw Error(T(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Mn(l),l=sn(a).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(T(444,e))}}function Sn(e){return'href="'+lt(e)+'"'}function Ea(e){return'link[rel="stylesheet"]['+e+"]"}function x0(e){return se({},e,{"data-precedence":e.precedence,precedence:null})}function lx(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),ke(t,"link",l),je(t),e.head.appendChild(t))}function Mn(e){return'[src="'+lt(e)+'"]'}function Da(e){return"script[async]"+e}function mr(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+lt(l.href)+'"]');if(n)return t.instance=n,je(n),n;var a=se({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),je(n),ke(n,"style",a),rs(n,l.precedence,e),t.instance=n;case"stylesheet":a=Sn(l.href);var s=e.querySelector(Ea(a));if(s)return t.state.loading|=4,t.instance=s,je(s),s;n=x0(l),(a=ut.get(a))&&Qo(n,a),s=(e.ownerDocument||e).createElement("link"),je(s);var c=s;return c._p=new Promise(function(o,u){c.onload=o,c.onerror=u}),ke(s,"link",n),t.state.loading|=4,rs(s,l.precedence,e),t.instance=s;case"script":return s=Mn(l.src),(a=e.querySelector(Da(s)))?(t.instance=a,je(a),a):(n=l,(a=ut.get(s))&&(n=se({},l),Zo(n,a)),e=e.ownerDocument||e,a=e.createElement("script"),je(a),ke(a,"link",n),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(T(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(n=t.instance,t.state.loading|=4,rs(n,l.precedence,e));return t.instance}function rs(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=n.length?n[n.length-1]:null,s=a,c=0;c<n.length;c++){var o=n[c];if(o.dataset.precedence===t)s=o;else if(s!==a)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Qo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var fs=null;function hr(e,t,l){if(fs===null){var n=new Map,a=fs=new Map;a.set(l,n)}else a=fs,n=a.get(l),n||(n=new Map,a.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),a=0;a<l.length;a++){var s=l[a];if(!(s[Ca]||s[ze]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var c=s.getAttribute(t)||"";c=e+c;var o=n.get(c);o?o.push(s):n.set(c,[s])}}return n}function xr(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function nx(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function p0(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function ax(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(l.state.loading&4)){if(l.instance===null){var a=Sn(n.href),s=t.querySelector(Ea(a));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qs.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=s,je(s);return}s=t.ownerDocument||t,n=x0(n),(a=ut.get(a))&&Qo(n,a),s=s.createElement("link"),je(s);var c=s;c._p=new Promise(function(o,u){c.onload=o,c.onerror=u}),ke(s,"link",n),l.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&!(l.state.loading&3)&&(e.count++,l=qs.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Ki=0;function sx(e,t){return e.stylesheets&&e.count===0&&ds(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&ds(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Ki===0&&(Ki=62500*Lh());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ds(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Ki?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(a)}}:null}function qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ds(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ys=null;function ds(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ys=new Map,t.forEach(ix,e),Ys=null,qs.call(e))}function ix(e,t){if(!(t.state.loading&4)){var l=Ys.get(e);if(l)var n=l.get(null);else{l=new Map,Ys.set(e,l);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<a.length;s++){var c=a[s];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),n=c)}n&&l.set(null,n)}a=t.instance,c=a.getAttribute("data-precedence"),s=l.get(c)||n,s===n&&l.set(null,a),l.set(c,a),this.count++,n=qs.bind(this),a.addEventListener("load",n),a.addEventListener("error",n),s?s.parentNode.insertBefore(a,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var ya={$$typeof:kt,Provider:null,Consumer:null,_currentValue:Nl,_currentValue2:Nl,_threadCount:0};function cx(e,t,l,n,a,s,c,o,u){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yi(0),this.hiddenUpdates=yi(null),this.identifierPrefix=n,this.onUncaughtError=a,this.onCaughtError=s,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=u,this.incompleteTransitions=new Map}function g0(e,t,l,n,a,s,c,o,u,r,h,p){return e=new cx(e,t,l,c,u,r,h,p,o),t=1,s===!0&&(t|=24),s=Ge(3,null,null,t),e.current=s,s.stateNode=e,t=yo(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:n,isDehydrated:l,cache:t},jo(s),e}function y0(e){return e?(e=Pl,e):Pl}function v0(e,t,l,n,a,s){a=y0(a),n.context===null?n.context=a:n.pendingContext=a,n=tl(t),n.payload={element:l},s=s===void 0?null:s,s!==null&&(n.callback=s),l=ll(e,n,t),l!==null&&(Re(l,e,t),In(l,e,t))}function pr(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Vo(e,t){pr(e,t),(e=e.alternate)&&pr(e,t)}function b0(e){if(e.tag===13||e.tag===31){var t=Rl(e,67108864);t!==null&&Re(t,e,67108864),Vo(e,67108864)}}function gr(e){if(e.tag===13||e.tag===31){var t=Je();t=no(t);var l=Rl(e,t);l!==null&&Re(l,e,t),Vo(e,t)}}var Gs=!0;function ox(e,t,l,n){var a=R.T;R.T=null;var s=V.p;try{V.p=2,Jo(e,t,l,n)}finally{V.p=s,R.T=a}}function ux(e,t,l,n){var a=R.T;R.T=null;var s=V.p;try{V.p=8,Jo(e,t,l,n)}finally{V.p=s,R.T=a}}function Jo(e,t,l,n){if(Gs){var a=Kc(n);if(a===null)Vi(e,t,n,Xs,l),yr(e,n);else if(fx(a,e,t,l,n))n.stopPropagation();else if(yr(e,n),t&4&&-1<rx.indexOf(e)){for(;a!==null;){var s=Cn(a);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var c=yl(s.pendingLanes);if(c!==0){var o=s;for(o.pendingLanes|=2,o.entangledLanes|=2;c;){var u=1<<31-Ve(c);o.entanglements[1]|=u,c&=~u}yt(s),!(Z&6)&&(Os=Qe()+500,Ma(0))}}break;case 31:case 13:o=Rl(s,2),o!==null&&Re(o,s,2),ii(),Vo(s,2)}if(s=Kc(n),s===null&&Vi(e,t,n,Xs,l),s===a)break;a=s}a!==null&&n.stopPropagation()}else Vi(e,t,n,null,l)}}function Kc(e){return e=co(e),Ko(e)}var Xs=null;function Ko(e){if(Xs=null,e=Vl(e),e!==null){var t=ja(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=Lr(t),e!==null)return e;e=null}else if(l===31){if(e=$r(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Xs=e,null}function j0(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(K0()){case Xr:return 2;case Qr:return 8;case vs:case F0:return 32;case Zr:return 268435456;default:return 32}default:return 32}}var Fc=!1,sl=null,il=null,cl=null,va=new Map,ba=new Map,Zt=[],rx="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".split(" ");function yr(e,t){switch(e){case"focusin":case"focusout":sl=null;break;case"dragenter":case"dragleave":il=null;break;case"mouseover":case"mouseout":cl=null;break;case"pointerover":case"pointerout":va.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ba.delete(t.pointerId)}}function Hn(e,t,l,n,a,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:s,targetContainers:[a]},t!==null&&(t=Cn(t),t!==null&&b0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function fx(e,t,l,n,a){switch(t){case"focusin":return sl=Hn(sl,e,t,l,n,a),!0;case"dragenter":return il=Hn(il,e,t,l,n,a),!0;case"mouseover":return cl=Hn(cl,e,t,l,n,a),!0;case"pointerover":var s=a.pointerId;return va.set(s,Hn(va.get(s)||null,e,t,l,n,a)),!0;case"gotpointercapture":return s=a.pointerId,ba.set(s,Hn(ba.get(s)||null,e,t,l,n,a)),!0}return!1}function S0(e){var t=Vl(e.target);if(t!==null){var l=ja(t);if(l!==null){if(t=l.tag,t===13){if(t=Lr(l),t!==null){e.blockedOn=t,lu(e.priority,function(){gr(l)});return}}else if(t===31){if(t=$r(l),t!==null){e.blockedOn=t,lu(e.priority,function(){gr(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ms(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Kc(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);hc=n,l.target.dispatchEvent(n),hc=null}else return t=Cn(l),t!==null&&b0(t),e.blockedOn=l,!1;t.shift()}return!0}function vr(e,t,l){ms(e)&&l.delete(t)}function dx(){Fc=!1,sl!==null&&ms(sl)&&(sl=null),il!==null&&ms(il)&&(il=null),cl!==null&&ms(cl)&&(cl=null),va.forEach(vr),ba.forEach(vr)}function Za(e,t){e.blockedOn===t&&(e.blockedOn=null,Fc||(Fc=!0,ve.unstable_scheduleCallback(ve.unstable_NormalPriority,dx)))}var Va=null;function br(e){Va!==e&&(Va=e,ve.unstable_scheduleCallback(ve.unstable_NormalPriority,function(){Va===e&&(Va=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],a=e[t+2];if(typeof n!="function"){if(Ko(n||l)===null)continue;break}var s=Cn(l);s!==null&&(e.splice(t,3),t-=3,Mc(s,{pending:!0,data:a,method:l.method,action:n},n,a))}}))}function Nn(e){function t(u){return Za(u,e)}sl!==null&&Za(sl,e),il!==null&&Za(il,e),cl!==null&&Za(cl,e),va.forEach(t),ba.forEach(t);for(var l=0;l<Zt.length;l++){var n=Zt[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Zt.length&&(l=Zt[0],l.blockedOn===null);)S0(l),l.blockedOn===null&&Zt.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var a=l[n],s=l[n+1],c=a[He]||null;if(typeof s=="function")c||br(l);else if(c){var o=null;if(s&&s.hasAttribute("formAction")){if(a=s,c=s[He]||null)o=c.formAction;else if(Ko(a)!==null)continue}else o=c.action;typeof o=="function"?l[n+1]=o:(l.splice(n,3),n-=3),br(l)}}}function N0(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(c){return a=c})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Fo(e){this._internalRoot=e}ui.prototype.render=Fo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(T(409));var l=t.current,n=Je();v0(l,n,e,t,null,null)};ui.prototype.unmount=Fo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;v0(e.current,2,null,e,null,null),ii(),t[zn]=null}};function ui(e){this._internalRoot=e}ui.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wr();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Zt.length&&t!==0&&t<Zt[l].priority;l++);Zt.splice(l,0,e),l===0&&S0(e)}};var jr=Hr.version;if(jr!=="19.2.5")throw Error(T(527,jr,"19.2.5"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(T(188)):(e=Object.keys(e).join(","),Error(T(268,e)));return e=Y0(t),e=e!==null?qr(e):null,e=e===null?null:e.stateNode,e};var mx={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ja=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ja.isDisabled&&Ja.supportsFiber)try{Sa=Ja.inject(mx),Ze=Ja}catch{}}Vs.createRoot=function(e,t){if(!_r(e))throw Error(T(299));var l=!1,n="",a=hd,s=xd,c=pd;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=g0(e,1,!1,null,null,l,n,null,a,s,c,N0),e[zn]=t.current,Xo(e),new Fo(t)};Vs.hydrateRoot=function(e,t,l){if(!_r(e))throw Error(T(299));var n=!1,a="",s=hd,c=xd,o=pd,u=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(a=l.identifierPrefix),l.onUncaughtError!==void 0&&(s=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(o=l.onRecoverableError),l.formState!==void 0&&(u=l.formState)),t=g0(e,1,!0,t,l??null,n,a,u,s,c,o,N0),t.context=y0(null),l=t.current,n=Je(),n=no(n),a=tl(n),a.callback=null,ll(l,a,n),l=n,t.current.lanes=l,za(t,l),yt(t),e[zn]=t.current,Xo(e),new ui(t)};Vs.version="19.2.5";function z0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z0)}catch(e){console.error(e)}}z0(),Ur.exports=Vs;var hx=Ur.exports;const ce=ml((e,t)=>({sessions:[],activeSessionId:null,setActiveSession:l=>{e({activeSessionId:l})},setSessions:l=>{if(e({sessions:l}),!t().activeSessionId&&l.length>0){const a=l.find(s=>s.status==="active")??l[0];a&&e({activeSessionId:a.id})}},upsertSession:l=>{e(n=>{const a=n.sessions.findIndex(s=>s.id===l.id);if(a>=0){const s=[...n.sessions];return s[a]=l,{sessions:s}}return{sessions:[l,...n.sessions]}}),t().activeSessionId||e({activeSessionId:l.id})},removeSession:l=>{e(n=>{var c;const a=n.sessions.filter(o=>o.id!==l),s=n.activeSessionId===l?((c=a.find(o=>o.status==="active")??a[0])==null?void 0:c.id)??null:n.activeSessionId;return{sessions:a,activeSessionId:s}})},getActiveSession:()=>{const{sessions:l,activeSessionId:n}=t();return l.find(a=>a.id===n)??null}}));var Ar;const xx=typeof window<"u"&&((Ar=window.location)!=null&&Ar.host)?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`:"ws://localhost:4700/ws",Oa=ml((e,t)=>({status:"disconnected",ws:null,lastHeartbeat:null,collectorUrl:xx,connect:l=>{const n=t().ws;n&&n.close(),e({status:"connecting",collectorUrl:l});const a=new WebSocket(l);a.onopen=()=>{e({status:"connected",ws:a,lastHeartbeat:Date.now()})},a.onclose=()=>{e({status:"disconnected",ws:null})},a.onerror=()=>{e({status:"error",ws:null})},e({ws:a})},disconnect:()=>{const l=t().ws;l&&l.close(),e({status:"disconnected",ws:null})},send:l=>{const n=t().ws;n&&n.readyState===WebSocket.OPEN&&n.send(JSON.stringify(l))},setStatus:l=>e({status:l}),setLastHeartbeat:l=>e({lastHeartbeat:l})}));function px(e,t){let l;try{l=e()}catch{return}return{getItem:a=>{var s;const c=u=>u===null?null:JSON.parse(u,void 0),o=(s=l.getItem(a))!=null?s:null;return o instanceof Promise?o.then(c):c(o)},setItem:(a,s)=>l.setItem(a,JSON.stringify(s,void 0)),removeItem:a=>l.removeItem(a)}}const Wc=e=>t=>{try{const l=e(t);return l instanceof Promise?l:{then(n){return Wc(n)(l)},catch(n){return this}}}catch(l){return{then(n){return this},catch(n){return Wc(n)(l)}}}},gx=(e,t)=>(l,n,a)=>{let s={storage:px(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,f)=>({...f,...b}),...t},c=!1,o=0;const u=new Set,r=new Set;let h=s.storage;if(!h)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),l(...b)},n,a);const p=()=>{const b=s.partialize({...n()});return h.setItem(s.name,{state:b,version:s.version})},m=a.setState;a.setState=(b,f)=>(m(b,f),p());const g=e((...b)=>(l(...b),p()),n,a);a.getInitialState=()=>g;let y;const j=()=>{var b,f;if(!h)return;const d=++o;c=!1,u.forEach(v=>{var S;return v((S=n())!=null?S:g)});const x=((f=s.onRehydrateStorage)==null?void 0:f.call(s,(b=n())!=null?b:g))||void 0;return Wc(h.getItem.bind(h))(s.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==s.version){if(s.migrate){const S=s.migrate(v.state,v.version);return S instanceof Promise?S.then(z=>[!0,z]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var S;if(d!==o)return;const[z,N]=v;if(y=s.merge(N,(S=n())!=null?S:g),l(y,!0),z)return p()}).then(()=>{d===o&&(x==null||x(n(),void 0),y=n(),c=!0,r.forEach(v=>v(y)))}).catch(v=>{d===o&&(x==null||x(void 0,v))})};return a.persist={setOptions:b=>{s={...s,...b},b.storage&&(h=b.storage)},clearStorage:()=>{h==null||h.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>j(),hasHydrated:()=>c,onHydrate:b=>(u.add(b),()=>{u.delete(b)}),onFinishHydration:b=>(r.add(b),()=>{r.delete(b)})},s.skipHydration||j(),y||g},yx=gx,ri=ml()(yx(e=>({themeId:"neon",setTheme:t=>e({themeId:t})}),{name:"prism-theme"})),C0={neon:{id:"neon",label:"Neon",bg:"#09090B",headerBg:"rgba(9,9,11,0.95)",toolbarBg:"rgba(9,9,11,0.8)",sidebarBg:"rgba(9,9,11,0.95)",running:"#00FF88",success:"#00FF88",error:"#FF3366",info:"#00BBFF",warn:"#FFAA00",purple:"#BB88FF",chartColors:["#00FF88","#00BBFF","#FFAA00","#FF3366","#BB88FF","#FF8844","#44FFBB"]},claude:{id:"claude",label:"Claude",bg:"#1C1B19",headerBg:"rgba(24,23,19,0.95)",toolbarBg:"rgba(24,23,19,0.8)",sidebarBg:"rgba(22,21,17,0.95)",running:"#CC785C",success:"#7FB069",error:"#C0392B",info:"#5B8DB8",warn:"#E8A838",purple:"#9B7FC4",chartColors:["#CC785C","#5B8DB8","#E8A838","#C0392B","#9B7FC4","#D4956A","#7FB069"]}};function H(){const e=ri(t=>t.themeId);return C0[e]}const vx=2*60*1e3;function nn(e,t=Date.now()){return t-(e.lastActivityAt??e.startedAt)<vx}function bx({status:e,url:t="localhost:4700"}){const l=H(),a={connected:{label:"Connected",color:l.success,glow:!0},connecting:{label:"Connecting…",color:l.warn,pulse:!0},disconnected:{label:"Disconnected",color:"#52525b"},error:{label:"Error",color:l.error,glow:!0}}[e];return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:a.pulse?"h-2 w-2 rounded-full flex-shrink-0 animate-pulse":"h-2 w-2 rounded-full flex-shrink-0",style:{background:a.color,boxShadow:a.glow?`0 0 6px ${a.color}`:"none"}}),i.jsxs("div",{className:"flex flex-col leading-none",children:[i.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:a.color},children:a.label}),i.jsx("span",{className:"text-[10px] font-mono text-zinc-300",children:t})]})]})}function Fi(){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:i.jsx("path",{d:"M2 3h8M5 3V2h2v1M4 3v6.5a.5.5 0 00.5.5h3a.5.5 0 00.5-.5V3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function jx(){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:i.jsx("path",{d:"M7.5 1.5L9 3M9 3l-5 5-2 .5.5-2 5-5L9 3zM3 8l1 1",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}const jl=3,Sx=jl*24*60*60*1e3;function Nx({open:e}){return i.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",className:ge("transition-transform duration-150",e?"rotate-180":""),children:i.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function zx(){const{sessions:e,activeSessionId:t,setActiveSession:l,removeSession:n}=ce(),{status:a,collectorUrl:s}=Oa(),{themeId:c,setTheme:o}=ri(),u=H(),[r,h]=C.useState(!1),[p,m]=C.useState(null),[g,y]=C.useState(null),[j,b]=C.useState(!1),[f,d]=C.useState(!1),x=C.useRef(null),v=s.replace(/^ws/,"http").replace(/\/ws$/,""),S=Date.now(),z=E=>S-(E.lastActivityAt??E.startedAt)>=Sx,N=e.filter(z).length;C.useEffect(()=>{if(!r)return;function E(_){var F;(F=x.current)!=null&&F.contains(_.target)||h(!1)}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[r]),C.useEffect(()=>{if(!r)return;function E(_){_.key==="Escape"&&h(!1)}return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[r]);const M=e.find(E=>E.id===t);async function A(E,_){_.stopPropagation();const F=e.find(B=>B.id===E),w=F?`${F.name} — ${ot(new Date(F.startedAt),"MMM d, HH:mm:ss")}`:E;if(confirm(`Delete session "${w}"? This cannot be undone.`)){m(E);try{const B=await fetch(`${v}/api/sessions/${E}`,{method:"DELETE"});if(!B.ok)throw new Error(`HTTP ${B.status}`);n(E)}catch(B){alert(`Failed to delete: ${B instanceof Error?B.message:String(B)}`)}finally{m(null)}}}async function D(){const E=e.find(_=>_.id===t);if(E&&confirm(`Purge tool calls for "${E.name}"?
|
|
34
34
|
|
|
35
35
|
This deletes tool call events and their inputs/outputs, but keeps the rest of the session intact. A tombstone event records the count and reclaimed bytes.`)){y(E.id);try{const _=await fetch(`${v}/api/sessions/${E.id}/purge-tool-calls`,{method:"POST"});if(!_.ok)throw new Error(`HTTP ${_.status}`);const F=await _.json(),w=(F.reclaimedBytes/1024).toFixed(1);alert(`Purged ${F.eventsPurged} tool calls (${w} KB reclaimed).`)}catch(_){alert(`Failed to purge tool calls: ${_ instanceof Error?_.message:String(_)}`)}finally{y(null)}}}async function X(){const E=e.length;if(E===0){alert("Database is already empty.");return}if(confirm(`Delete ALL ${E} session${E===1?"":"s"} and reset the database?
|
|
36
36
|
|
|
37
37
|
Every event, agent, tool call, and checkpoint will be permanently erased. This cannot be undone.`)&&confirm(`Really wipe all ${E} session${E===1?"":"s"}? Last chance.`)){d(!0);try{const _=await fetch(`${v}/api/sessions`,{method:"DELETE"});if(!_.ok)throw new Error(`HTTP ${_.status}`);window.location.reload()}catch(_){alert(`Failed to reset database: ${_ instanceof Error?_.message:String(_)}`),d(!1)}}}async function te(){if(N===0){alert(`No sessions have been idle for ${jl}+ days.`);return}if(confirm(`Delete ${N} session${N===1?"":"s"} with no activity in ${jl}+ days?
|
|
38
38
|
|
|
39
|
-
This cannot be undone.`)){b(!0);try{const E=await fetch(`${v}/api/sessions/stale?idleDays=${jl}`,{method:"DELETE"});if(!E.ok)throw new Error(`HTTP ${E.status}`);const _=await E.json();for(const F of _.deletedIds)n(F);alert(`Deleted ${_.count} stale session${_.count===1?"":"s"}.`)}catch(E){alert(`Failed to clean stale sessions: ${E instanceof Error?E.message:String(E)}`)}finally{b(!1)}}}return i.jsxs("header",{className:"flex h-14 flex-shrink-0 items-center justify-between border-b px-5",style:{borderColor:"rgba(255,255,255,0.08)",background:u.headerBg,backdropFilter:"blur(12px)"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md text-xs font-bold",style:{background:`${u.running}1E`,border:`1px solid ${u.running}4D`},children:i.jsx("span",{style:{color:u.running,fontFamily:"JetBrains Mono, monospace"},children:"P"})}),i.jsxs("div",{className:"leading-none",children:[i.jsx("span",{className:"text-sm font-bold tracking-tight",style:{color:u.running,fontFamily:"JetBrains Mono, monospace"},children:"PRISM"}),i.jsx("p",{className:"text-[10px] text-zinc-300 font-mono",children:"agentic visibility"})]})]}),i.jsxs("div",{className:"flex-1 flex items-center gap-2 mx-6",children:[i.jsx("div",{className:"flex-1 max-w-sm",ref:x,children:e.length===0?i.jsx("p",{className:"text-xs font-mono text-zinc-300 text-center",children:"No sessions yet"}):i.jsxs("div",{className:"relative",children:[i.jsxs("button",{onClick:()=>h(E=>!E),className:"flex w-full items-center gap-2 rounded border px-3 py-1.5 text-xs font-mono text-zinc-300 transition-colors hover:bg-white/[0.03]",style:{borderColor:r?"rgba(255,255,255,0.18)":"rgba(255,255,255,0.10)",background:"rgba(24,24,27,0.8)"},children:[M?i.jsxs("span",{className:"flex-1 flex items-center gap-1.5 min-w-0 truncate",children:[i.jsx("span",{className:"truncate",children:M.name}),M.totalCostUsd>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsxs("span",{className:"shrink-0",style:{color:u.running},children:["$",M.totalCostUsd.toFixed(4)]})]}),i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsx("span",{className:"shrink-0 text-[9px] px-1 py-0.5 rounded",style:M.status==="active"?{background:`${u.running}1A`,color:u.running,border:`1px solid ${u.running}33`}:{background:"rgba(255,255,255,0.04)",color:"#71717a",border:"1px solid rgba(255,255,255,0.08)"},children:M.status==="active"?"live":"ended"})]}):i.jsx("span",{className:"flex-1 text-left text-zinc-600",children:"Select session"}),i.jsx("span",{className:"text-zinc-500 flex-shrink-0",children:i.jsx(jx,{open:r})})]}),r&&i.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 rounded-lg border overflow-hidden z-50",style:{background:"rgba(15,15,18,0.98)",borderColor:"rgba(255,255,255,0.12)",backdropFilter:"blur(16px)",boxShadow:"0 8px 32px rgba(0,0,0,0.6)"},children:i.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(E=>{const _=E.id===t,F=p===E.id;return i.jsxs("div",{className:"group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors hover:bg-white/[0.04]",style:{background:_?"rgba(255,255,255,0.04)":"transparent",borderBottom:"1px solid rgba(255,255,255,0.05)"},onClick:()=>{l(E.id),h(!1)},children:[i.jsx("div",{className:"h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:_?u.running:"transparent",border:_?"none":"1px solid rgba(255,255,255,0.15)"}}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs text-zinc-300 truncate",children:[i.jsx("span",{className:"truncate",children:E.name}),E.totalCostUsd>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsxs("span",{className:"shrink-0",style:{color:u.running},children:["$",E.totalCostUsd.toFixed(4)]})]}),i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsx("span",{className:"shrink-0 text-[9px] px-1 py-0.5 rounded",style:E.status==="active"?{background:`${u.running}1A`,color:u.running,border:`1px solid ${u.running}33`}:{background:"rgba(255,255,255,0.04)",color:"#71717a",border:"1px solid rgba(255,255,255,0.08)"},children:E.status==="active"?"live":"ended"})]}),i.jsx("p",{className:"font-mono text-[10px] text-zinc-600 mt-0.5",children:ot(new Date(E.startedAt),"MMM d, HH:mm:ss")})]}),i.jsx("button",{onClick:w=>A(E.id,w),disabled:F,title:"Delete session",className:"flex-shrink-0 flex h-6 w-6 items-center justify-center rounded transition-colors disabled:opacity-40",style:{color:F?`${u.error}66`:u.error,background:`${u.error}14`,border:`1px solid ${u.error}33`},children:F?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(Ki,{})})]},E.id)})})})]})}),e.length>0&&(()=>{const E=e.find(w=>w.id===t),_=E?z(E):!1,F=E?g===E.id:!1;return i.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[i.jsxs("button",{onClick:D,disabled:!E||!_||F,title:E?_?`Purge tool calls for "${E.name}" (reclaims storage)`:`Available when the selected session has been idle for ${jl}+ days`:"Select a session first",className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:_?u.warn:"#71717a",background:_?`${u.warn}14`:"rgba(255,255,255,0.03)",borderColor:_?`${u.warn}40`:"rgba(255,255,255,0.08)"},children:[F?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(vx,{}),i.jsx("span",{children:"Purge tools"})]}),i.jsxs("button",{onClick:te,disabled:N===0||j,title:N===0?`No sessions idle for ${jl}+ days`:`Delete ${N} session${N===1?"":"s"} idle for ${jl}+ days`,className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:N>0?u.error:"#71717a",background:N>0?`${u.error}14`:"rgba(255,255,255,0.03)",borderColor:N>0?`${u.error}40`:"rgba(255,255,255,0.08)"},children:[j?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(Ki,{}),i.jsxs("span",{children:["Clean stale",N>0?` (${N})`:""]})]}),i.jsxs("button",{onClick:X,disabled:e.length===0||f,title:e.length===0?"Database is already empty":`Delete all ${e.length} session${e.length===1?"":"s"} and reset the database`,className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:e.length>0?u.error:"#71717a",background:e.length>0?`${u.error}22`:"rgba(255,255,255,0.03)",borderColor:e.length>0?`${u.error}66`:"rgba(255,255,255,0.08)"},children:[f?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(Ki,{}),i.jsxs("span",{children:["Reset DB",e.length>0?` (${e.length})`:""]})]})]})})()]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"flex items-center gap-0.5 rounded-md border p-0.5",style:{borderColor:"rgba(255,255,255,0.18)",background:"rgba(255,255,255,0.04)"},children:["neon","claude"].map(E=>i.jsx("button",{onClick:()=>o(E),className:ge("rounded px-2.5 py-1 text-[10px] font-mono transition-colors capitalize",c===E?"bg-white/10 text-zinc-300":"text-zinc-400 hover:text-zinc-300"),children:E},E))}),i.jsx(yx,{status:a})]})]})}function C0({content:e,children:t,side:l="top",className:n}){const[a,s]=C.useState(!1),c=C.useRef(null),o=()=>{c.current=setTimeout(()=>s(!0),300)},u=()=>{c.current&&clearTimeout(c.current),s(!1)},r={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return i.jsxs("div",{className:"relative inline-flex",onMouseEnter:o,onMouseLeave:u,children:[t,a&&i.jsx("div",{className:ge("pointer-events-none absolute z-50 whitespace-nowrap rounded border border-white/[0.12]","bg-zinc-800 px-2 py-1 text-xs text-zinc-300 shadow-xl animate-fade-in",r[l],n),children:e})]})}function Nx(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}function zx(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"5",r:"2"}),i.jsx("circle",{cx:"5",cy:"19",r:"2"}),i.jsx("circle",{cx:"19",cy:"19",r:"2"}),i.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"13"}),i.jsx("line",{x1:"12",y1:"13",x2:"5",y2:"17"}),i.jsx("line",{x1:"12",y1:"13",x2:"19",y2:"17"})]})}function Cx(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),i.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]})}function Tx(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.44-3.54z"}),i.jsx("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.44-3.54z"})]})}function kx(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"1 4 1 10 7 10"}),i.jsx("path",{d:"M3.51 15a9 9 0 1 0 .49-4"})]})}function wx(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})})}function Ax(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),i.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),i.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}const Mx=[{id:"events",label:"Event Stream",icon:i.jsx(Nx,{})},{id:"cost",label:"Cost Analytics",icon:i.jsx(Cx,{})},{id:"intelligence",label:"Session Intelligence",icon:i.jsx(Tx,{})},{id:"tools",label:"Tool Inspector",icon:i.jsx(wx,{})},{id:"context",label:"Context Window",icon:i.jsx(Ax,{})},{id:"agents",label:"Agent Tree",icon:i.jsx(zx,{})},{id:"history",label:"Session History",icon:i.jsx(kx,{})}];function Ex({activePanel:e,onPanelChange:t}){const l=H(),n=Mx;return i.jsx("aside",{className:"flex w-14 flex-shrink-0 flex-col items-center border-r py-3 gap-1",style:{borderColor:"rgba(255,255,255,0.08)",background:l.sidebarBg},children:n.map(a=>{const s=e===a.id;return i.jsx(C0,{content:a.label,side:"right",children:i.jsx("button",{onClick:()=>t(a.id),className:ge("flex h-10 w-10 items-center justify-center rounded-lg transition-all duration-150",!s&&"text-zinc-300 hover:bg-white/5 hover:text-zinc-400"),style:s?{background:`${l.running}1A`,color:l.running,border:`1px solid ${l.running}33`}:{border:"1px solid transparent"},"aria-label":a.label,children:a.icon})},a.id)})})}const Ja=1e3,Le=ml((e,t)=>({events:[],totalReceived:0,addEvent:l=>{e(n=>{const a=[l,...n.events];return{events:a.length>Ja?a.slice(0,Ja):a,totalReceived:n.totalReceived+1}})},addEvents:l=>{e(n=>{const a=new Map(n.events.map(c=>[c.id,c]));for(const c of l)a.set(c.id,c);const s=Array.from(a.values()).sort((c,o)=>o.timestamp-c.timestamp);return{events:s.length>Ja?s.slice(0,Ja):s,totalReceived:n.totalReceived+l.length}})},clearEvents:()=>{e({events:[],totalReceived:0})},getEventsByType:l=>t().events.filter(n=>n.type===l),getEventsBySession:l=>t().events.filter(n=>n.sessionId===l),getEventsByAgent:l=>t().events.filter(n=>n.payload.agentId===l)}));function Dx(e,t){switch(e){case"green":return t.success;case"red":return t.error;case"blue":return t.info;case"yellow":return t.warn;case"purple":return t.purple;default:return null}}function dl({children:e,variant:t="default",size:l="xs",className:n}){const a=ui(o=>o.themeId),s=z0[a],c=Dx(t,s);return i.jsx("span",{className:ge("inline-flex items-center rounded border font-mono font-medium uppercase tracking-wider",l==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-1 text-xs",!c&&(t==="gray"?"bg-white/5 text-zinc-400 border-white/10":"bg-white/5 text-zinc-300 border-white/10"),n),style:c?{background:`${c}1A`,color:c,borderColor:`${c}33`}:void 0,children:e})}function We({icon:e,title:t,description:l,action:n}){return i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-8 text-center",children:[e&&i.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl border border-white/[0.08] bg-white/[0.03] text-zinc-300",children:e}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-zinc-400",children:t}),l&&i.jsx("p",{className:"mt-1 text-xs text-zinc-300",children:l})]}),n&&i.jsx("div",{className:"mt-2",children:n})]})}const Fi=[{id:"all",label:"All",match:e=>!0},{id:"tool",label:"Tools",match:e=>e.startsWith("tool.")},{id:"api",label:"API",match:e=>e.startsWith("api.")},{id:"agent",label:"Agents",match:e=>e.startsWith("agent.")},{id:"user",label:"Prompts",match:e=>e==="user.prompt"},{id:"cost",label:"Cost",match:e=>e==="cost.update"},{id:"session",label:"Session",match:e=>e.startsWith("session.")},{id:"mcp",label:"MCP",match:e=>e.startsWith("mcp.")}];function T0(e){if(e.type==="cost.update"){const t=e.payload;return{tokens:(t.inputTokens??0)+(t.outputTokens??0),costUsd:t.totalCostUsd??0}}if(e.type==="api.response"){const t=e.payload,l=t.usage;if(!l)return null;const n=(l.inputTokens??l.input_tokens??0)+(l.outputTokens??l.output_tokens??0);return n===0?null:{tokens:n,costUsd:t.costUsd??0}}return null}function k0(e){return e.startsWith("api.")?"blue":e.startsWith("agent.")?"green":e.startsWith("tool.")?"yellow":e.startsWith("mcp.")?"purple":e.includes("error")||e.includes("fail")||e==="loop.detected"?"red":e.startsWith("session.")?"gray":"default"}function Ox(e){var l,n,a;const t=e.payload;switch(e.type){case"tool.call":{const s=t.toolName??"",c=t.input,o=t.status;let u="";if(c){const r=((l=c.command)==null?void 0:l.split(`
|
|
40
|
-
`)[0])??"",h=c.file_path??c.path??"";u=(r||h||c.pattern||"").slice(0,60)}return`${s}${o?` [${o}]`:""}${u?` ${u}`:""}`}case"tool.call.purged":{const s=t.count??0,c=((t.reclaimedBytes??0)/1024).toFixed(1);return`${s} tool calls purged • ${c} KB reclaimed`}case"user.prompt":return((n=t.text)==null?void 0:n.slice(0,80))??"";case"cost.update":{const s=t;return`$${(s.totalCostUsd??0).toFixed(6)} ${((s.inputTokens??0)+(s.outputTokens??0)).toLocaleString()} tokens ${s.model??""}`}case"agent.spawn":return`${t.name??""} (${String(t.agentId??"").slice(0,8)})`;case"agent.state_change":return`${t.previousState??"?"} → ${t.nextState??"?"}${t.reason?` (${t.reason})`:""}`;case"agent.log":return`[${t.level??"info"}] ${((a=t.message)==null?void 0:a.slice(0,80))??""}`;case"session.summary":{const s=t.turnCount??0,c=t.totalCostUsd??0,o=t.cacheHitRate??0;return`${s} turns $${c.toFixed(4)} ${o}% cache`}case"mcp.tool.call":return`${t.serverName??""} / ${t.toolName??""}`;default:{const s=[];for(const c of Object.keys(t).slice(0,3)){const o=t[c];o!=null&&(typeof o=="string"?s.push(`${c}: "${o.length>24?o.slice(0,24)+"…":o}"`):typeof o=="number"||typeof o=="boolean"?s.push(`${c}: ${String(o)}`):Array.isArray(o)?s.push(`${c}: [${o.length}]`):s.push(`${c}: {…}`))}return s.join(" ")}}}function
|
|
41
|
-
`)});break}default:for(const[r,h]of Object.entries(s))h!=null&&u.push({label:r,value:typeof h=="string"?h:JSON.stringify(h)})}return i.jsxs("div",{className:"flex flex-col border-l overflow-hidden",style:{width:320,flexShrink:0,borderColor:"rgba(255,255,255,0.08)",background:"rgba(0,0,0,0.4)"},children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2 border-b",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(dl,{variant:c,className:"text-[10px] shrink-0",children:e.type}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600 truncate",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i.jsx("button",{onClick:()=>a(r=>!r),className:"font-mono text-[9px] px-1.5 py-0.5 rounded",style:n?{background:`${l.info}22`,color:l.info,border:`1px solid ${l.info}44`}:{color:"#52525b",border:"1px solid rgba(255,255,255,0.06)"},children:n?"Fields":"Raw"}),i.jsx("button",{onClick:t,className:"ml-1 text-zinc-600 hover:text-zinc-400 text-sm leading-none px-1",children:"✕"})]})]}),i.jsxs("div",{className:"flex shrink-0 gap-3 px-3 py-1.5 border-b",style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsxs("span",{className:"font-mono text-[10px] text-zinc-600",children:["src: ",i.jsx("span",{className:"text-zinc-400",children:e.source})]}),o&&i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"font-mono text-[10px]",style:{color:l.info},children:[o.tokens.toLocaleString(),"t"]}),o.costUsd>0&&i.jsxs("span",{className:"font-mono text-[10px]",style:{color:l.running},children:["$",o.costUsd.toFixed(6)]})]}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-700 truncate",children:e.id.slice(0,16)})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?i.jsx("pre",{className:"font-mono text-[10px] text-zinc-300 whitespace-pre-wrap break-all",children:JSON.stringify(e.payload,null,2)}):i.jsxs("div",{className:"space-y-3",children:[u.map((r,h)=>i.jsx(Ux,{label:r.label,value:r.value,color:r.color},h)),u.length===0&&i.jsx("span",{className:"text-[11px] text-zinc-600 font-mono",children:"No fields"})]})})]})}function jr(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),l=Math.floor(e%6e4/1e3);return l>0?`${t}m ${l}s`:`${t}m`}function Rx({event:e,isSelected:t,onSelect:l}){const n=k0(e.type),a=Ox(e),s=H(),c=T0(e),o=e.type==="tool.call"?e.payload.status:void 0,u=o==="error"?s.error:o==="complete"?s.running:o==="pending"?s.warn:null;return i.jsx("div",{className:ge("border-b cursor-pointer transition-colors duration-100",t?"bg-white/[0.04]":"hover:bg-white/[0.02]"),style:{borderColor:"rgba(255,255,255,0.04)"},onClick:l,children:i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[i.jsx("span",{className:"w-24 flex-shrink-0 font-mono text-[10px] text-zinc-500",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),i.jsx(dl,{variant:n,className:"w-44 flex-shrink-0 truncate justify-center text-[10px]",children:e.type}),i.jsx("span",{className:"w-14 flex-shrink-0 font-mono text-[10px] text-zinc-600 truncate",children:e.source}),i.jsx("span",{className:"flex-1 truncate font-mono text-[11px] text-zinc-400",children:a}),o?i.jsx("span",{className:"w-16 flex-shrink-0 text-right font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:u??"#52525b",background:u?`${u}1A`:"transparent"},children:o}):i.jsx("span",{className:"w-16 flex-shrink-0 text-right font-mono text-[11px]",style:{color:c?s.info:"#3f3f46"},children:c?c.tokens.toLocaleString():"—"}),i.jsx("span",{className:"w-24 flex-shrink-0 text-right font-mono text-[11px]",style:{color:((c==null?void 0:c.costUsd)??0)>0?s.running:"#3f3f46"},children:((c==null?void 0:c.costUsd)??0)>0?`$${c.costUsd.toFixed(6)}`:"—"}),i.jsx("div",{className:"w-1 h-4 rounded-full flex-shrink-0",style:{background:t?s.info:"transparent"}})]})})}function Hx(){const{events:e}=Le(),{activeSessionId:t}=ce(),l=H(),[n,a]=C.useState("all"),[s,c]=C.useState(""),[o,u]=C.useState(null),[r,h]=C.useState(!1),[p,m]=C.useState("stream"),g=C.useRef(null),y=C.useRef(e.length);C.useEffect(()=>{var x;r||e.length!==y.current&&(y.current=e.length,(x=g.current)==null||x.scrollTo({top:0}))},[e.length,r]);const j=C.useCallback(x=>{p==="stream"?(m("inspect"),u(x),h(!0)):(u(v=>(v==null?void 0:v.id)===x.id?null:x),h(!0))},[p]),b=C.useCallback(()=>{m("stream"),u(null),h(!1)},[]),f=Fi.find(x=>x.id===n)??Fi[0],d=e.filter(x=>{if(t&&x.sessionId!==t||!f.match(x.type))return!1;if(s){const v=s.toLowerCase();if(!x.type.includes(v)&&!JSON.stringify(x.payload).toLowerCase().includes(v))return!1}return!0});return i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2 border-b px-4 py-2 flex-wrap",style:{borderColor:"rgba(255,255,255,0.07)",background:l.toolbarBg},children:[i.jsx("div",{className:"flex items-center gap-0.5 rounded border p-0.5 mr-1",style:{borderColor:"rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.03)"},children:["stream","inspect"].map(x=>i.jsx("button",{onClick:()=>x==="stream"?b():m("inspect"),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors capitalize",style:p===x?{background:"rgba(255,255,255,0.10)",color:"#d4d4d8"}:{color:"#52525b"},children:x==="stream"?"⏵ Stream":"⊞ Inspect"},x))}),i.jsx("div",{className:"h-4 w-px",style:{background:"rgba(255,255,255,0.08)"}}),Fi.map(x=>i.jsx("button",{onClick:()=>a(x.id),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:n===x.id?{background:`${l.info}22`,color:l.info,border:`1px solid ${l.info}44`}:{color:"#71717a",border:"1px solid transparent"},children:x.label},x.id)),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),i.jsx("input",{type:"text",placeholder:"search…",value:s,onChange:x=>c(x.target.value),className:"h-6 rounded border bg-transparent px-2 text-[11px] font-mono text-zinc-300 placeholder-zinc-700 outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:130}}),s&&i.jsx("button",{onClick:()=>c(""),className:"font-mono text-[10px] text-zinc-600 hover:text-zinc-400",children:"✕"}),i.jsx("div",{className:"flex-1"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:d.length}),i.jsx("button",{onClick:()=>{h(x=>!x),r&&u(null)},className:"h-6 rounded border px-2 text-[10px] font-mono transition-colors",style:r?{borderColor:`${l.warn}44`,background:`${l.warn}1A`,color:l.warn}:{borderColor:"rgba(255,255,255,0.08)",color:"#71717a"},children:r?"▶ Resume":"⏸ Pause"})]}),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-1",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.25)"},children:[i.jsx("span",{className:"w-24 flex-shrink-0 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Time"}),i.jsx("span",{className:"w-44 flex-shrink-0 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Type"}),i.jsx("span",{className:"w-14 flex-shrink-0 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Src"}),i.jsx("span",{className:"flex-1 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Payload"}),i.jsx("span",{className:"w-20 flex-shrink-0 text-right text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Tokens"}),i.jsx("span",{className:"w-24 flex-shrink-0 text-right text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Cost"}),i.jsx("div",{className:"w-1"})]}),i.jsx("div",{ref:g,className:"flex-1 overflow-y-auto",onMouseEnter:()=>{!o&&p==="stream"&&h(!0)},onMouseLeave:()=>{!o&&p==="stream"&&h(!1)},children:d.length===0?i.jsx(We,{icon:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),title:"No events",description:n==="all"?"Events will appear here as your agents run":`No ${n} events in this session`}):d.map(x=>i.jsx(Rx,{event:x,isSelected:(o==null?void 0:o.id)===x.id,onSelect:()=>j(x)},x.id))})]}),p==="inspect"&&o&&i.jsx(Bx,{event:o,onClose:()=>{u(null),h(!1)}})]})}function _x(e){const t=[],l=new Map;for(const[a,s]of e.entries())l.set(a,{...s,children:[]});for(const a of l.values())if(a.parentId===null)t.push(a);else{const s=l.get(a.parentId);s?s.children.push(a):t.push(a)}const n=a=>{a.sort((s,c)=>s.spawnedAt-c.spawnedAt);for(const s of a)n(s.children)};return n(t),t}const Ae=ml((e,t)=>({agents:new Map,loopAlerts:[],upsertAgent:l=>{e(n=>{const a=new Map(n.agents),s=a.get(l.id);return s?a.set(l.id,{...s,...l,children:[]}):a.set(l.id,{...l,children:[]}),{agents:a}})},updateAgentStatus:(l,n,a)=>{e(s=>{const c=new Map(s.agents),o=c.get(l);return o?(c.set(l,{...o,status:n,...a!==void 0?{completedAt:a}:{}}),{agents:c}):{}})},incrementToolCallCount:l=>{e(n=>{const a=new Map(n.agents),s=a.get(l);return s?(a.set(l,{...s,toolCallCount:s.toolCallCount+1}),{agents:a}):{}})},addAgentLog:(l,n)=>{e(a=>{const s=new Map(a.agents),c=s.get(l);return c?(s.set(l,{...c,logs:[...c.logs,n]}),{agents:s}):{}})},addLoopAlert:l=>{e(n=>({loopAlerts:[l,...n.loopAlerts].slice(0,50)}))},dismissLoopAlert:l=>{e(n=>({loopAlerts:n.loopAlerts.filter(a=>a.id!==l)}))},getAgentTree:()=>_x(t().agents),getAgent:l=>t().agents.get(l)}));function Lx(e,t){switch(e){case"running":return t.running;case"waiting":return t.warn;case"failed":return t.error;case"completed":return"#52525b";default:return"#52525b"}}function $x(e){switch(e){case"running":return"green";case"waiting":return"yellow";case"failed":return"red";case"completed":return"gray";default:return"gray"}}function qx(e,t){const l=t??Date.now();return Mr(new Date(e),new Date(l),{addSuffix:!1})}function w0(e){return e===0?"$0.00":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function Ka(e){return e<1e3?e.toString():e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function Yx(e,t){let l=0,n=0,a=0,s=0,c=0;const o=new Map,u=new Map,r=new Set,h=new Set,p=[];let m=null,g=null;const y=(b,f)=>{(!g||b>g.at)&&(g={at:b,text:f})};for(const b of e){const f=b.payload;if(f.agentId===t){if(b.type==="api.response"){l+=f.inputTokens??0,n+=f.outputTokens??0,a+=f.cacheReadTokens??0,s+=f.cacheWriteTokens??0,c+=f.costUsd??0;const d=f.model;d&&r.add(d)}else if(b.type==="cost.update"){const d=f.totalCostUsd??0;d>0&&(c+=d);const x=f.model;x&&r.add(x)}else if(b.type==="tool.call"){const d=f.toolName;if(d){o.set(d,(o.get(d)??0)+1);const x=f.input??{},v=x.file_path??x.path;if(v&&typeof v=="string"&&h.add(v),d==="Bash"){const S=x.command;S&&p.push({command:S,at:b.timestamp})}y(b.timestamp,`${d}${v?` ${v}`:""}`)}}else if(b.type==="tool.error"){const d=f.toolName;d&&u.set(d,(u.get(d)??0)+1)}else if(b.type==="agent.fail"){const d=f.error;d&&(m=d)}else if(b.type==="agent.log"){const d=f.message;d&&y(b.timestamp,d)}}}const j=Array.from(o.entries()).sort((b,f)=>f[1]-b[1]).slice(0,8).map(([b,f])=>({name:b,count:f,errors:u.get(b)??0}));return{inputTokens:l,outputTokens:n,cacheReadTokens:a,cacheWriteTokens:s,costUsd:c,topTools:j,models:Array.from(r),filesTouched:Array.from(h),bashCommands:p.slice(-10),failureReason:m,lastActivity:g}}function Gx({agent:e,depth:t,parentName:l}){var o;const n=H(),a=Le(u=>u.events),s=C.useMemo(()=>Yx(a,e.id),[a,e.id]),c=s.inputTokens>0||s.outputTokens>0||s.costUsd>0||s.topTools.length>0||s.models.length>0;return!c&&e.logs.length===0?i.jsx("div",{className:"border-b px-4 py-3",style:{paddingLeft:`${16+t*20+24}px`,borderColor:"rgba(255,255,255,0.05)",background:"rgba(0,0,0,0.3)"},children:i.jsx("p",{className:"font-mono text-[11px] italic text-zinc-500",children:"No reasoning trace, tool calls, or token usage captured for this agent."})}):i.jsxs("div",{className:"border-b px-4 py-3 space-y-3",style:{paddingLeft:`${16+t*20+24}px`,borderColor:"rgba(255,255,255,0.05)",background:"rgba(0,0,0,0.3)"},children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 font-mono text-[10px] text-zinc-500",children:[i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Spawned"}),i.jsx("span",{className:"text-zinc-300",children:new Date(e.spawnedAt).toLocaleTimeString("en",{hour12:!1})})]}),l&&i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Parent"}),i.jsx("span",{className:"text-zinc-300",children:l})]}),i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Depth"}),i.jsx("span",{className:"text-zinc-300",children:e.depth})]}),s.models.length>0&&i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Model"}),i.jsx("span",{className:"text-zinc-300",children:s.models.join(", ")})]}),e.loopCount>0&&i.jsxs("span",{style:{color:n.error},children:[i.jsx("span",{className:"uppercase tracking-widest mr-1.5 opacity-70",children:"Loops"}),e.loopCount]})]}),c&&(s.inputTokens>0||s.outputTokens>0||s.costUsd>0)&&i.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 font-mono text-[11px]",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Input"}),i.jsx("span",{className:"text-zinc-200",children:Ka(s.inputTokens)})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Output"}),i.jsx("span",{className:"text-zinc-200",children:Ka(s.outputTokens)})]}),s.cacheReadTokens>0&&i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Cache Read"}),i.jsx("span",{className:"text-zinc-200",children:Ka(s.cacheReadTokens)})]}),s.cacheWriteTokens>0&&i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Cache Write"}),i.jsx("span",{className:"text-zinc-200",children:Ka(s.cacheWriteTokens)})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Cost"}),i.jsx("span",{style:{color:n.info},children:w0(s.costUsd)})]})]}),e.status==="failed"&&(s.failureReason||e.logs.some(u=>u.level==="error"))&&i.jsxs("div",{className:"rounded border px-2.5 py-2",style:{background:`${n.error}14`,borderColor:`${n.error}33`},children:[i.jsx("p",{className:"mb-1 text-[10px] font-mono uppercase tracking-widest",style:{color:n.error},children:"Failure"}),i.jsx("p",{className:"font-mono text-[11px]",style:{color:n.error},children:s.failureReason??((o=e.logs.filter(u=>u.level==="error").at(-1))==null?void 0:o.message)})]}),s.topTools.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"mb-1.5 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Tools Used"}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.topTools.map(({name:u,count:r,errors:h})=>i.jsxs("span",{className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 font-mono text-[10px]",style:{background:"rgba(255,255,255,0.03)",borderColor:h>0?`${n.error}33`:"rgba(255,255,255,0.08)",color:"#d4d4d8"},children:[i.jsx("span",{children:u}),i.jsxs("span",{className:"text-zinc-500",children:["×",r]}),h>0&&i.jsxs("span",{style:{color:n.error},children:["· ",h," err"]})]},u))})]}),s.filesTouched.length>0&&i.jsxs("div",{children:[i.jsxs("p",{className:"mb-1.5 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:["Files Touched (",s.filesTouched.length,")"]}),i.jsx("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:s.filesTouched.map(u=>i.jsx("div",{className:"font-mono text-[11px] text-zinc-400 truncate",title:u,children:u},u))})]}),s.bashCommands.length>0&&i.jsxs("div",{children:[i.jsxs("p",{className:"mb-1.5 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:["Recent Bash (",s.bashCommands.length,")"]}),i.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:s.bashCommands.map((u,r)=>i.jsxs("div",{className:"font-mono text-[11px] text-zinc-400 truncate",style:{color:"#a1a1aa"},title:u.command,children:[i.jsx("span",{className:"text-zinc-700 mr-1.5",children:"$"}),u.command]},r))})]}),e.logs.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"mb-2 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Reasoning Trace"}),i.jsx("div",{className:"space-y-1.5",children:e.logs.map((u,r)=>i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"flex-shrink-0 font-mono text-[10px] text-zinc-700 mt-0.5 w-20",children:new Date(u.timestamp).toLocaleTimeString("en",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}),i.jsx("span",{className:"font-mono text-[11px]",style:{color:u.level==="info"?n.success:u.level==="warn"?n.warn:u.level==="error"?n.error:"#71717a"},children:u.message})]},r))})]})]})}function A0({agent:e,depth:t,parentName:l,selectedId:n,expandedIds:a,onToggle:s,onSelect:c}){const o=H(),u=e.children.length>0,r=a.has(e.id),h=n===e.id,p=Lx(e.status,o),m=e.status==="running"&&e.logs.length>0?e.logs[e.logs.length-1]:null;return i.jsxs("div",{children:[i.jsxs("div",{className:ge("group flex flex-col gap-0.5 px-4 py-2.5 cursor-pointer transition-colors duration-100","border-b hover:bg-white/[0.02]",h?"bg-white/[0.03]":""),style:{paddingLeft:`${16+t*20}px`,borderColor:"rgba(255,255,255,0.05)"},onClick:()=>c(e.id),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[u?i.jsx("button",{className:"flex-shrink-0 text-zinc-300 hover:text-zinc-400 w-4",onClick:g=>{g.stopPropagation(),s(e.id)},children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:ge("transition-transform",r?"rotate-90":""),children:i.jsx("polyline",{points:"9 18 15 12 9 6"})})}):i.jsx("span",{className:"w-4 flex-shrink-0"}),i.jsx("div",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:p,boxShadow:e.status==="running"?`0 0 6px ${p}`:"none"}}),i.jsx("span",{className:"flex-1 font-mono text-sm font-medium truncate",style:{color:e.status==="running"?o.running:"#a1a1aa"},children:e.name}),e.loopCount>0&&i.jsxs(dl,{variant:"red",size:"xs",className:"ml-1",children:["loop ×",e.loopCount]}),i.jsx(dl,{variant:$x(e.status),size:"xs",children:e.status}),i.jsx("span",{className:"w-20 text-right font-mono text-[11px] text-zinc-300",children:qx(e.spawnedAt,e.completedAt)}),i.jsxs("span",{className:"w-14 text-right font-mono text-[11px] text-zinc-300",children:[e.toolCallCount," calls"]})]}),m&&!h&&i.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] truncate",style:{paddingLeft:"24px",color:"#71717a"},children:[i.jsx("span",{className:"text-zinc-700",children:"→"}),i.jsx("span",{className:"truncate",title:m.message,children:m.message})]})]}),h&&i.jsx(Gx,{agent:e,depth:t,parentName:l}),u&&r&&i.jsx("div",{children:e.children.map(g=>i.jsx(A0,{agent:g,depth:t+1,parentName:e.name,selectedId:n,expandedIds:a,onToggle:s,onSelect:c},g.id))})]})}function Xx({alert:e,onDismiss:t}){const l=H();return i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 text-sm border-b",style:{background:`${l.error}14`,borderColor:`${l.error}33`},children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:l.error,strokeWidth:"2",children:[i.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),i.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),i.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),i.jsxs("span",{style:{color:l.error},className:"font-mono text-xs font-medium flex-1",children:["Loop detected — ",i.jsx("span",{className:"font-bold",children:e.agentName})," called"," ",i.jsx("span",{className:"font-bold",children:e.toolName})," ",e.loopCount,"× in a tight window"]}),i.jsx("button",{onClick:()=>t(e.id),className:"font-mono text-[11px] transition-colors",style:{color:`${l.error}99`},onMouseEnter:n=>n.currentTarget.style.color=l.error,onMouseLeave:n=>n.currentTarget.style.color=`${l.error}99`,children:"Dismiss"})]})}const Qx=new Set;function Sr(e){const t=[],l=n=>{for(const a of n)t.push(a),a.children.length>0&&l(a.children)};return l(e),t}function Zx(){const{loopAlerts:e,dismissLoopAlert:t}=Ae(),l=Ae(z=>z.getAgentTree),{activeSessionId:n}=ce(),a=Le(z=>z.events),s=H(),[c,o]=C.useState(new Set),[u,r]=C.useState(null),[h,p]=C.useState(""),m=l(),g=n?m.filter(z=>z.sessionId===n):m,y=n?e.filter(z=>{const N=Ae.getState().getAgent(z.agentId);return(N==null?void 0:N.sessionId)===n}):e,j=C.useCallback(z=>{o(N=>{const M=new Set(N);return M.has(z)?M.delete(z):M.add(z),M})},[]),b=C.useCallback(z=>{r(N=>N===z?null:z)},[]),{runningCount:f,failedCount:d,totalCost:x}=C.useMemo(()=>{const z=Sr(g),N=new Set(z.map(X=>X.id));let M=0,A=0;for(const X of z)X.status==="running"?M++:X.status==="failed"&&A++;let D=0;for(const X of a){const te=X.payload,E=te.agentId;!E||!N.has(E)||(X.type==="api.response"?D+=te.costUsd??0:X.type==="cost.update"&&(D+=te.totalCostUsd??0))}return{runningCount:M,failedCount:A,totalCost:D}},[g,a]),v=h.trim().toLowerCase(),S=v?Sr(g).filter(z=>z.name.toLowerCase().includes(v)):g;return i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:s.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Agent Tree"}),f>0&&i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("div",{className:"h-1.5 w-1.5 rounded-full animate-pulse-slow",style:{background:s.running,boxShadow:`0 0 4px ${s.running}`}}),i.jsxs("span",{className:"font-mono text-[11px]",style:{color:s.running},children:[f," running"]})]}),d>0&&i.jsxs("span",{className:"font-mono text-[11px]",style:{color:s.error},children:[d," failed"]}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[g.length," agents"]}),x>0&&i.jsxs("span",{className:"font-mono text-[11px]",style:{color:s.info},children:[w0(x)," total"]}),i.jsx("div",{className:"flex-1"}),i.jsx("input",{type:"text",value:h,onChange:z=>p(z.target.value),placeholder:"Filter agents…",className:"w-40 rounded border bg-transparent px-2 py-1 font-mono text-[11px] text-zinc-300 placeholder:text-zinc-700 focus:outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)"}})]}),y.map(z=>i.jsx(Xx,{alert:z,onDismiss:t},z.id)),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2 border-b px-4 py-1.5",style:{borderColor:"rgba(255,255,255,0.05)",background:"rgba(0,0,0,0.3)"},children:[i.jsx("span",{className:"flex-1 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Agent"}),i.jsx("span",{className:"w-20 text-right text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Status"}),i.jsx("span",{className:"w-20 text-right text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Duration"}),i.jsx("span",{className:"w-14 text-right text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Calls"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:g.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("circle",{cx:"12",cy:"5",r:"2"}),i.jsx("circle",{cx:"5",cy:"19",r:"2"}),i.jsx("circle",{cx:"19",cy:"19",r:"2"}),i.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"13"}),i.jsx("line",{x1:"12",y1:"13",x2:"5",y2:"17"}),i.jsx("line",{x1:"12",y1:"13",x2:"19",y2:"17"})]}),title:"No agents yet",description:"Agent hierarchy will appear as your workflows run"}):S.length===0?i.jsx("div",{className:"flex h-full items-center justify-center px-6 py-10 text-center",children:i.jsxs("p",{className:"font-mono text-[11px] text-zinc-500",children:['No agents match "',h,'"']})}):S.map(z=>i.jsx(A0,{agent:z,depth:0,parentName:null,selectedId:u,expandedIds:v?Qx:c,onToggle:j,onSelect:b},z.id))})]})}const ri=ml((e,t)=>({summaries:new Map,setSummary:(l,n)=>{e(a=>{const s=new Map(a.summaries);return s.set(l,n),{summaries:s}})},getSummary:l=>t().summaries.get(l)}));function Ee({children:e,className:t,glass:l=!1,padding:n="md"}){const a={none:"",sm:"p-3",md:"p-4",lg:"p-6"};return i.jsx("div",{className:ge("rounded-lg border","border-white/[0.08]",l?"bg-white/[0.03] backdrop-blur-sm":"bg-zinc-900/80",a[n],t),children:e})}function st({title:e,subtitle:t,actions:l,className:n}){return i.jsxs("div",{className:ge("flex items-center justify-between",n),children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-xs font-mono uppercase tracking-widest text-zinc-500",children:e}),t&&i.jsx("p",{className:"mt-0.5 text-xs text-zinc-300",children:t})]}),l&&i.jsx("div",{className:"flex items-center gap-2",children:l})]})}function Vx(e){if(e.type==="cost.update"){const t=e.payload;return{agentId:t.agentId??"unknown",model:t.model??"unknown",inputTokens:t.inputTokens??0,outputTokens:t.outputTokens??0,cacheReadTokens:t.cacheReadTokens??0,cacheWriteTokens:t.cacheWriteTokens??0,costUsd:t.totalCostUsd??0,timestamp:e.timestamp,source:e.source}}if(e.type==="api.response"){const t=e.payload,l=t.costUsd??0;return l===0?null:{agentId:t.agentId??"unknown",model:t.model??"unknown",inputTokens:t.inputTokens??0,outputTokens:t.outputTokens??0,cacheReadTokens:t.cacheReadTokens??0,cacheWriteTokens:t.cacheWriteTokens??0,costUsd:l,timestamp:e.timestamp,source:e.source}}if(e.type==="api.stream.end"){const t=e.payload,l=t.costUsd??0;return l===0?null:{agentId:"stream",model:"streaming",inputTokens:t.inputTokens??0,outputTokens:t.outputTokens??0,cacheReadTokens:t.cacheReadTokens??0,cacheWriteTokens:t.cacheWriteTokens??0,costUsd:l,timestamp:e.timestamp,source:e.source}}return null}function Sl({label:e,value:t,sub:l,accentColor:n}){return i.jsxs(Ee,{glass:!0,className:"flex flex-col gap-1.5 flex-1 min-w-0",children:[i.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-300",children:e}),i.jsx("span",{className:"font-mono text-2xl font-semibold",style:{color:n},children:t}),l&&i.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:l})]})}function ms({active:e,payload:t,label:l}){return!e||!(t!=null&&t.length)?null:i.jsxs("div",{className:"rounded border px-3 py-2 text-xs font-mono",style:{background:"#1a1a1e",borderColor:"rgba(255,255,255,0.12)"},children:[i.jsx("p",{className:"text-zinc-400 mb-1",children:l}),t.map((n,a)=>{var s;return i.jsxs("p",{style:{color:n.color},children:[n.name,": ",typeof n.value=="number"&&((s=n.name)!=null&&s.includes("$"))?`$${n.value.toFixed(4)}`:typeof n.value=="number"?n.value.toLocaleString():n.value]},a)})]})}function Jx(){var c,o;const{sessions:e}=ce(),t=ri(u=>u.summaries),l=H(),n=C.useMemo(()=>e.filter(u=>u.totalCostUsd>0).sort((u,r)=>r.totalCostUsd-u.totalCostUsd).slice(0,20).map(u=>{const r=t.get(u.id);return{name:u.name,id:u.id,costUsd:u.totalCostUsd,inputTokens:(r==null?void 0:r.inputTokens)??0,outputTokens:(r==null?void 0:r.outputTokens)??0,cacheReadTokens:(r==null?void 0:r.cacheReadTokens)??0,turnCount:(r==null?void 0:r.turnCount)??0,cacheHitRate:(r==null?void 0:r.cacheHitRate)??0}}),[e,t]),a=n.reduce((u,r)=>u+r.costUsd,0),s=n.reduce((u,r)=>u+r.inputTokens+r.outputTokens,0);return n.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),i.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),title:"No cross-session cost data",description:"Sessions with cost data will appear here"}):i.jsxs("div",{className:"flex flex-col gap-4 p-4 overflow-y-auto",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx(Sl,{label:"Total Spend",value:`$${a.toFixed(4)}`,sub:`${n.length} sessions`,accentColor:l.running}),i.jsx(Sl,{label:"Total Tokens",value:s>=1e6?`${(s/1e6).toFixed(2)}M`:`${(s/1e3).toFixed(1)}k`,sub:"input + output",accentColor:l.info}),i.jsx(Sl,{label:"Most Expensive",value:`$${((c=n[0])==null?void 0:c.costUsd.toFixed(4))??"0"}`,sub:((o=n[0])==null?void 0:o.name)??"—",accentColor:l.warn})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Cost per Session (top 20)",className:"mb-3"}),i.jsx(Yn,{width:"100%",height:220,children:i.jsxs(hs,{data:n,margin:{top:4,right:4,bottom:40,left:8},children:[i.jsx(Gn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Xn,{dataKey:"name",tick:{fontSize:9,fontFamily:"JetBrains Mono, monospace",fill:"#52525b"},axisLine:!1,tickLine:!1,angle:-35,textAnchor:"end",interval:0}),i.jsx(Qn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:u=>`$${u.toFixed(2)}`}),i.jsx(Zn,{content:({active:u,payload:r})=>{var p;if(!u||!(r!=null&&r.length))return null;const h=(p=r[0])==null?void 0:p.payload;return i.jsxs("div",{className:"rounded border px-3 py-2 text-xs font-mono",style:{background:"#1a1a1e",borderColor:"rgba(255,255,255,0.12)"},children:[i.jsx("p",{className:"text-zinc-300 font-semibold mb-1",children:h.name}),i.jsxs("p",{style:{color:l.running},children:["$",h.costUsd.toFixed(6)]}),h.turnCount>0&&i.jsxs("p",{className:"text-zinc-400",children:[h.turnCount," turns"]}),h.cacheHitRate>0&&i.jsxs("p",{style:{color:l.warn},children:[h.cacheHitRate,"% cache hit"]})]})},cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"costUsd",radius:[3,3,0,0],children:n.map((u,r)=>i.jsx(Ar,{fill:l.chartColors[r%l.chartColors.length],fillOpacity:.8},r))})]})})]}),n.some(u=>u.inputTokens>0)&&i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Token Breakdown per Session",className:"mb-3"}),i.jsx(Yn,{width:"100%",height:180,children:i.jsxs(hs,{data:n,margin:{top:4,right:4,bottom:40,left:8},children:[i.jsx(Gn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Xn,{dataKey:"name",tick:{fontSize:9,fontFamily:"JetBrains Mono, monospace",fill:"#52525b"},axisLine:!1,tickLine:!1,angle:-35,textAnchor:"end",interval:0}),i.jsx(Qn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:u=>u>=1e3?`${(u/1e3).toFixed(0)}k`:String(u)}),i.jsx(Zn,{content:i.jsx(ms,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"inputTokens",name:"Input",fill:l.info,fillOpacity:.8,stackId:"a"}),i.jsx(Vt,{dataKey:"outputTokens",name:"Output",fill:l.warn,fillOpacity:.8,stackId:"a"}),i.jsx(Vt,{dataKey:"cacheReadTokens",name:"Cache Read",fill:l.purple,fillOpacity:.8,stackId:"a",radius:[3,3,0,0]})]})})]})]})}function Kx(){var v;const{events:e}=Le(),{agents:t}=Ae(),{activeSessionId:l}=ce(),n=H(),[a,s]=C.useState("session"),c=l?e.filter(S=>S.sessionId===l):e,o=C.useMemo(()=>c.map(S=>Vx(S)).filter(S=>S!==null).sort((S,z)=>S.timestamp-z.timestamp),[c]),u=C.useMemo(()=>{let S=0,z=0,N=0,M=0,A=0;for(const D of o)S+=D.costUsd,z+=D.inputTokens,N+=D.outputTokens,M+=D.cacheReadTokens,A+=D.cacheWriteTokens;return{costUsd:S,inputTokens:z,outputTokens:N,cacheReadTokens:M,cacheWriteTokens:A}},[o]),r=C.useMemo(()=>{var z;const S=new Map;for(const N of o){const M=((z=t.get(N.agentId))==null?void 0:z.name)??N.agentId.slice(0,8),A=S.get(N.agentId);A?A.costUsd+=N.costUsd:S.set(N.agentId,{agentId:N.agentId,name:M,costUsd:N.costUsd})}return Array.from(S.values()).sort((N,M)=>M.costUsd-N.costUsd)},[o,t]),h=C.useMemo(()=>{let S=0;return o.map(z=>(S+=z.costUsd,{timestamp:z.timestamp,time:ot(new Date(z.timestamp),"HH:mm:ss"),costUsd:S}))},[o]),p=C.useMemo(()=>{const S=new Map;for(const z of o){const N=z.model.replace("claude-","").replace("-20","-"),M=S.get(z.model);M?(M.inputTokens+=z.inputTokens,M.outputTokens+=z.outputTokens,M.cacheReadTokens+=z.cacheReadTokens):S.set(z.model,{model:N,inputTokens:z.inputTokens,outputTokens:z.outputTokens,cacheReadTokens:z.cacheReadTokens})}return Array.from(S.values())},[o]),m=2e5,g=((v=[...o].reverse().find(S=>S.inputTokens>0))==null?void 0:v.inputTokens)??0,y=Math.min(g/m*100,100),j=y>80?n.error:y>60?n.warn:n.success,b=l?/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(l):!1,f=c.length,d=S=>S?{background:`${n.info}22`,color:n.info,border:`1px solid ${n.info}44`}:{color:"#52525b",border:"1px solid transparent"},x=o.length===0?i.jsxs("div",{className:"flex flex-col min-h-0",children:[i.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[b&&i.jsxs("div",{className:"rounded-lg border px-4 py-3 text-[12px] font-mono",style:{borderColor:`${n.warn}33`,background:`${n.warn}0D`,color:n.warn},children:[i.jsx("p",{className:"font-semibold mb-1",children:"Hook session — no API cost data"}),i.jsxs("p",{className:"text-[11px] opacity-80",children:["Claude Code hook sessions (",l==null?void 0:l.slice(0,8),"…) don't capture Anthropic API calls. Select a session with a ULID ID (e.g. 01KN…) from the header dropdown to see cost data."]})]}),!b&&f>0&&i.jsxs("div",{className:"rounded-lg border px-4 py-3 text-[12px] font-mono",style:{borderColor:`${n.info}33`,background:`${n.info}0D`,color:n.info},children:[i.jsxs("p",{className:"font-semibold mb-1",children:["SDK session — ",f," events, no cost events yet"]}),i.jsx("p",{className:"text-[11px] opacity-80",children:"Events are loaded but none are cost.update or api.response type yet. Make API calls through a prism()-wrapped client."})]}),!b&&f===0&&i.jsxs("div",{className:"rounded-lg border px-4 py-3 text-[12px] font-mono",style:{borderColor:"rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.03)",color:"#71717a"},children:[i.jsx("p",{className:"font-semibold mb-1",children:"No events loaded for this session"}),i.jsx("p",{className:"text-[11px] opacity-80",children:"The session snapshot may not have loaded yet. Try switching away and back, or check that the collector is running."})]})]}),i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),i.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),title:"No cost data for this session",description:"Use the session dropdown (top) to switch to an SDK session (01KN… ULID format), or switch to Portfolio view."})]}):i.jsxs("div",{className:"flex flex-col gap-4 p-4 overflow-y-auto",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx(Sl,{label:"Total Cost",value:`$${u.costUsd.toFixed(4)}`,sub:"USD",accentColor:n.running}),i.jsx(Sl,{label:"Input Tokens",value:u.inputTokens.toLocaleString(),sub:"prompt tokens",accentColor:n.info}),i.jsx(Sl,{label:"Output Tokens",value:u.outputTokens.toLocaleString(),sub:"completion tokens",accentColor:n.warn}),i.jsx(Sl,{label:"Cache Tokens",value:(u.cacheReadTokens+u.cacheWriteTokens).toLocaleString(),sub:`${u.cacheReadTokens.toLocaleString()} read / ${u.cacheWriteTokens.toLocaleString()} write`,accentColor:n.purple})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Context Window Utilization",className:"mb-2"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex-1 h-3 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${y}%`,background:j,boxShadow:`0 0 8px ${j}`}})}),i.jsxs("span",{className:"font-mono text-xs text-zinc-400 w-16 text-right",children:[y.toFixed(1),"%"]}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[g.toLocaleString()," / ",m.toLocaleString()]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Cost per Agent",className:"mb-3"}),i.jsx(Yn,{width:"100%",height:200,children:i.jsxs(hs,{data:r,margin:{top:4,right:4,bottom:4,left:4},children:[i.jsx(Gn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Xn,{dataKey:"name",tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1}),i.jsx(Qn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:S=>`$${S.toFixed(3)}`}),i.jsx(Zn,{content:i.jsx(ms,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"costUsd",name:"Cost $",radius:[3,3,0,0],children:r.map((S,z)=>i.jsx(Ar,{fill:n.chartColors[z%n.chartColors.length],fillOpacity:.8},z))})]})})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Cumulative Cost Over Time",className:"mb-3"}),i.jsx(Yn,{width:"100%",height:200,children:i.jsxs(U0,{data:h,margin:{top:4,right:4,bottom:4,left:4},children:[i.jsx(Gn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Xn,{dataKey:"time",tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1}),i.jsx(Qn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:S=>`$${S.toFixed(3)}`}),i.jsx(Zn,{content:i.jsx(ms,{})}),i.jsx(B0,{type:"monotone",dataKey:"costUsd",name:"Cumulative $",stroke:n.running,strokeWidth:2,dot:!1,activeDot:{r:4,fill:n.running}})]})})]})]}),p.length>0&&i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Token Breakdown by Model",className:"mb-3"}),i.jsx(Yn,{width:"100%",height:180,children:i.jsxs(hs,{data:p,margin:{top:4,right:4,bottom:4,left:4},children:[i.jsx(Gn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Xn,{dataKey:"model",tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1}),i.jsx(Qn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:S=>S>=1e3?`${(S/1e3).toFixed(0)}k`:String(S)}),i.jsx(Zn,{content:i.jsx(ms,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"inputTokens",name:"Input",fill:n.info,fillOpacity:.8,stackId:"a",radius:[0,0,0,0]}),i.jsx(Vt,{dataKey:"outputTokens",name:"Output",fill:n.warn,fillOpacity:.8,stackId:"a"}),i.jsx(Vt,{dataKey:"cacheReadTokens",name:"Cache Read",fill:n.purple,fillOpacity:.8,stackId:"a",radius:[3,3,0,0]})]})})]})]});return i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:n.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Cost Analytics"}),a==="session"&&o.length>0&&i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[o.length," API calls"]}),i.jsx("div",{className:"flex-1"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:"view:"}),i.jsx("button",{onClick:()=>s("session"),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:d(a==="session"),children:"Session"}),i.jsx("button",{onClick:()=>s("portfolio"),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:d(a==="portfolio"),children:"Portfolio"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:a==="portfolio"?i.jsx(Jx,{}):x})]})}const Fo=ml((e,t)=>({checkpoints:[],selectedCheckpointId:null,addCheckpoint:l=>{e(n=>{const a=n.checkpoints.findIndex(s=>s.id===l.id);if(a>=0){const s=[...n.checkpoints];return s[a]=l,{checkpoints:s}}return{checkpoints:[l,...n.checkpoints]}})},selectCheckpoint:l=>{e({selectedCheckpointId:l})},getCheckpoint:l=>t().checkpoints.find(n=>n.id===l),getCheckpointsBySession:l=>t().checkpoints.filter(n=>n.sessionId===l).sort((n,a)=>n.timestamp-a.timestamp),getPreviousCheckpoint:l=>{const n=t().checkpoints.find(c=>c.id===l);if(!n)return;const a=t().checkpoints.filter(c=>c.sessionId===n.sessionId&&c.agentId===n.agentId).sort((c,o)=>c.timestamp-o.timestamp),s=a.findIndex(c=>c.id===l);return s>0?a[s-1]:void 0}}));function Fx(e,t){const l=e.split(`
|
|
39
|
+
This cannot be undone.`)){b(!0);try{const E=await fetch(`${v}/api/sessions/stale?idleDays=${jl}`,{method:"DELETE"});if(!E.ok)throw new Error(`HTTP ${E.status}`);const _=await E.json();for(const F of _.deletedIds)n(F);alert(`Deleted ${_.count} stale session${_.count===1?"":"s"}.`)}catch(E){alert(`Failed to clean stale sessions: ${E instanceof Error?E.message:String(E)}`)}finally{b(!1)}}}return i.jsxs("header",{className:"flex h-14 flex-shrink-0 items-center justify-between border-b px-5",style:{borderColor:"rgba(255,255,255,0.08)",background:u.headerBg,backdropFilter:"blur(12px)"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md text-xs font-bold",style:{background:`${u.running}1E`,border:`1px solid ${u.running}4D`},children:i.jsx("span",{style:{color:u.running,fontFamily:"JetBrains Mono, monospace"},children:"P"})}),i.jsxs("div",{className:"leading-none",children:[i.jsx("span",{className:"text-sm font-bold tracking-tight",style:{color:u.running,fontFamily:"JetBrains Mono, monospace"},children:"PRISM"}),i.jsx("p",{className:"text-[10px] text-zinc-300 font-mono",children:"agentic visibility"})]})]}),i.jsxs("div",{className:"flex-1 flex items-center gap-2 mx-6",children:[i.jsx("div",{className:"flex-1 max-w-sm",ref:x,children:e.length===0?i.jsx("p",{className:"text-xs font-mono text-zinc-300 text-center",children:"No sessions yet"}):i.jsxs("div",{className:"relative",children:[i.jsxs("button",{onClick:()=>h(E=>!E),className:"flex w-full items-center gap-2 rounded border px-3 py-1.5 text-xs font-mono text-zinc-300 transition-colors hover:bg-white/[0.03]",style:{borderColor:r?"rgba(255,255,255,0.18)":"rgba(255,255,255,0.10)",background:"rgba(24,24,27,0.8)"},children:[M?i.jsxs("span",{className:"flex-1 flex items-center gap-1.5 min-w-0 truncate",children:[i.jsx("span",{className:"truncate",children:M.name}),M.totalCostUsd>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsxs("span",{className:"shrink-0",style:{color:u.running},children:["$",M.totalCostUsd.toFixed(4)]})]}),i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsx("span",{className:"shrink-0 text-[9px] px-1 py-0.5 rounded",style:nn(M)?{background:`${u.running}1A`,color:u.running,border:`1px solid ${u.running}33`}:{background:"rgba(255,255,255,0.04)",color:"#71717a",border:"1px solid rgba(255,255,255,0.08)"},children:nn(M)?"live":"ended"})]}):i.jsx("span",{className:"flex-1 text-left text-zinc-600",children:"Select session"}),i.jsx("span",{className:"text-zinc-500 flex-shrink-0",children:i.jsx(Nx,{open:r})})]}),r&&i.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 rounded-lg border overflow-hidden z-50",style:{background:"rgba(15,15,18,0.98)",borderColor:"rgba(255,255,255,0.12)",backdropFilter:"blur(16px)",boxShadow:"0 8px 32px rgba(0,0,0,0.6)"},children:i.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(E=>{const _=E.id===t,F=p===E.id;return i.jsxs("div",{className:"group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors hover:bg-white/[0.04]",style:{background:_?"rgba(255,255,255,0.04)":"transparent",borderBottom:"1px solid rgba(255,255,255,0.05)"},onClick:()=>{l(E.id),h(!1)},children:[i.jsx("div",{className:"h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:_?u.running:"transparent",border:_?"none":"1px solid rgba(255,255,255,0.15)"}}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs text-zinc-300 truncate",children:[i.jsx("span",{className:"truncate",children:E.name}),E.totalCostUsd>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsxs("span",{className:"shrink-0",style:{color:u.running},children:["$",E.totalCostUsd.toFixed(4)]})]}),i.jsx("span",{className:"text-zinc-700 shrink-0",children:"•"}),i.jsx("span",{className:"shrink-0 text-[9px] px-1 py-0.5 rounded",style:nn(E)?{background:`${u.running}1A`,color:u.running,border:`1px solid ${u.running}33`}:{background:"rgba(255,255,255,0.04)",color:"#71717a",border:"1px solid rgba(255,255,255,0.08)"},children:nn(E)?"live":"ended"})]}),i.jsx("p",{className:"font-mono text-[10px] text-zinc-600 mt-0.5",children:ot(new Date(E.startedAt),"MMM d, HH:mm:ss")})]}),i.jsx("button",{onClick:w=>A(E.id,w),disabled:F,title:"Delete session",className:"flex-shrink-0 flex h-6 w-6 items-center justify-center rounded transition-colors disabled:opacity-40",style:{color:F?`${u.error}66`:u.error,background:`${u.error}14`,border:`1px solid ${u.error}33`},children:F?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(Fi,{})})]},E.id)})})})]})}),e.length>0&&(()=>{const E=e.find(w=>w.id===t),_=E?z(E):!1,F=E?g===E.id:!1;return i.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[i.jsxs("button",{onClick:D,disabled:!E||!_||F,title:E?_?`Purge tool calls for "${E.name}" (reclaims storage)`:`Available when the selected session has been idle for ${jl}+ days`:"Select a session first",className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:_?u.warn:"#71717a",background:_?`${u.warn}14`:"rgba(255,255,255,0.03)",borderColor:_?`${u.warn}40`:"rgba(255,255,255,0.08)"},children:[F?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(jx,{}),i.jsx("span",{children:"Purge tools"})]}),i.jsxs("button",{onClick:te,disabled:N===0||j,title:N===0?`No sessions idle for ${jl}+ days`:`Delete ${N} session${N===1?"":"s"} idle for ${jl}+ days`,className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:N>0?u.error:"#71717a",background:N>0?`${u.error}14`:"rgba(255,255,255,0.03)",borderColor:N>0?`${u.error}40`:"rgba(255,255,255,0.08)"},children:[j?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(Fi,{}),i.jsxs("span",{children:["Clean stale",N>0?` (${N})`:""]})]}),i.jsxs("button",{onClick:X,disabled:e.length===0||f,title:e.length===0?"Database is already empty":`Delete all ${e.length} session${e.length===1?"":"s"} and reset the database`,className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:e.length>0?u.error:"#71717a",background:e.length>0?`${u.error}22`:"rgba(255,255,255,0.03)",borderColor:e.length>0?`${u.error}66`:"rgba(255,255,255,0.08)"},children:[f?i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})}):i.jsx(Fi,{}),i.jsxs("span",{children:["Reset DB",e.length>0?` (${e.length})`:""]})]})]})})()]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"flex items-center gap-0.5 rounded-md border p-0.5",style:{borderColor:"rgba(255,255,255,0.18)",background:"rgba(255,255,255,0.04)"},children:["neon","claude"].map(E=>i.jsx("button",{onClick:()=>o(E),className:ge("rounded px-2.5 py-1 text-[10px] font-mono transition-colors capitalize",c===E?"bg-white/10 text-zinc-300":"text-zinc-400 hover:text-zinc-300"),children:E},E))}),i.jsx(bx,{status:a})]})]})}function T0({content:e,children:t,side:l="top",className:n}){const[a,s]=C.useState(!1),c=C.useRef(null),o=()=>{c.current=setTimeout(()=>s(!0),300)},u=()=>{c.current&&clearTimeout(c.current),s(!1)},r={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return i.jsxs("div",{className:"relative inline-flex",onMouseEnter:o,onMouseLeave:u,children:[t,a&&i.jsx("div",{className:ge("pointer-events-none absolute z-50 whitespace-nowrap rounded border border-white/[0.12]","bg-zinc-800 px-2 py-1 text-xs text-zinc-300 shadow-xl animate-fade-in",r[l],n),children:e})]})}function Cx(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}function Tx(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"5",r:"2"}),i.jsx("circle",{cx:"5",cy:"19",r:"2"}),i.jsx("circle",{cx:"19",cy:"19",r:"2"}),i.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"13"}),i.jsx("line",{x1:"12",y1:"13",x2:"5",y2:"17"}),i.jsx("line",{x1:"12",y1:"13",x2:"19",y2:"17"})]})}function kx(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),i.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]})}function wx(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.44-3.54z"}),i.jsx("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.44-3.54z"})]})}function Ax(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"1 4 1 10 7 10"}),i.jsx("path",{d:"M3.51 15a9 9 0 1 0 .49-4"})]})}function Mx(){return i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})})}function Ex(){return i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),i.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),i.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}const Dx=[{id:"events",label:"Event Stream",icon:i.jsx(Cx,{})},{id:"cost",label:"Cost Analytics",icon:i.jsx(kx,{})},{id:"intelligence",label:"Session Intelligence",icon:i.jsx(wx,{})},{id:"tools",label:"Tool Inspector",icon:i.jsx(Mx,{})},{id:"context",label:"Context Window",icon:i.jsx(Ex,{})},{id:"agents",label:"Agent Tree",icon:i.jsx(Tx,{})},{id:"history",label:"Session History",icon:i.jsx(Ax,{})}];function Ox({activePanel:e,onPanelChange:t}){const l=H(),n=Dx;return i.jsx("aside",{className:"flex w-14 flex-shrink-0 flex-col items-center border-r py-3 gap-1",style:{borderColor:"rgba(255,255,255,0.08)",background:l.sidebarBg},children:n.map(a=>{const s=e===a.id;return i.jsx(T0,{content:a.label,side:"right",children:i.jsx("button",{onClick:()=>t(a.id),className:ge("flex h-10 w-10 items-center justify-center rounded-lg transition-all duration-150",!s&&"text-zinc-300 hover:bg-white/5 hover:text-zinc-400"),style:s?{background:`${l.running}1A`,color:l.running,border:`1px solid ${l.running}33`}:{border:"1px solid transparent"},"aria-label":a.label,children:a.icon})},a.id)})})}const Ka=1e3,Le=ml((e,t)=>({events:[],totalReceived:0,addEvent:l=>{e(n=>{const a=[l,...n.events];return{events:a.length>Ka?a.slice(0,Ka):a,totalReceived:n.totalReceived+1}})},addEvents:l=>{e(n=>{const a=new Map(n.events.map(c=>[c.id,c]));for(const c of l)a.set(c.id,c);const s=Array.from(a.values()).sort((c,o)=>o.timestamp-c.timestamp);return{events:s.length>Ka?s.slice(0,Ka):s,totalReceived:n.totalReceived+l.length}})},clearEvents:()=>{e({events:[],totalReceived:0})},getEventsByType:l=>t().events.filter(n=>n.type===l),getEventsBySession:l=>t().events.filter(n=>n.sessionId===l),getEventsByAgent:l=>t().events.filter(n=>n.payload.agentId===l)}));function Ux(e,t){switch(e){case"green":return t.success;case"red":return t.error;case"blue":return t.info;case"yellow":return t.warn;case"purple":return t.purple;default:return null}}function dl({children:e,variant:t="default",size:l="xs",className:n}){const a=ri(o=>o.themeId),s=C0[a],c=Ux(t,s);return i.jsx("span",{className:ge("inline-flex items-center rounded border font-mono font-medium uppercase tracking-wider",l==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-1 text-xs",!c&&(t==="gray"?"bg-white/5 text-zinc-400 border-white/10":"bg-white/5 text-zinc-300 border-white/10"),n),style:c?{background:`${c}1A`,color:c,borderColor:`${c}33`}:void 0,children:e})}function We({icon:e,title:t,description:l,action:n}){return i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-8 text-center",children:[e&&i.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl border border-white/[0.08] bg-white/[0.03] text-zinc-300",children:e}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-zinc-400",children:t}),l&&i.jsx("p",{className:"mt-1 text-xs text-zinc-300",children:l})]}),n&&i.jsx("div",{className:"mt-2",children:n})]})}const Wi=[{id:"all",label:"All",match:e=>!0},{id:"tool",label:"Tools",match:e=>e.startsWith("tool.")},{id:"api",label:"API",match:e=>e.startsWith("api.")},{id:"agent",label:"Agents",match:e=>e.startsWith("agent.")},{id:"user",label:"Prompts",match:e=>e==="user.prompt"},{id:"cost",label:"Cost",match:e=>e==="cost.update"},{id:"session",label:"Session",match:e=>e.startsWith("session.")},{id:"mcp",label:"MCP",match:e=>e.startsWith("mcp.")}];function k0(e){if(e.type==="cost.update"){const t=e.payload;return{tokens:(t.inputTokens??0)+(t.outputTokens??0),costUsd:t.totalCostUsd??0}}if(e.type==="api.response"){const t=e.payload,l=t.usage;if(!l)return null;const n=(l.inputTokens??l.input_tokens??0)+(l.outputTokens??l.output_tokens??0);return n===0?null:{tokens:n,costUsd:t.costUsd??0}}return null}function w0(e){return e.startsWith("api.")?"blue":e.startsWith("agent.")?"green":e.startsWith("tool.")?"yellow":e.startsWith("mcp.")?"purple":e.includes("error")||e.includes("fail")||e==="loop.detected"?"red":e.startsWith("session.")?"gray":"default"}function Bx(e){var l,n,a;const t=e.payload;switch(e.type){case"tool.call":{const s=t.toolName??"",c=t.input,o=t.status;let u="";if(c){const r=((l=c.command)==null?void 0:l.split(`
|
|
40
|
+
`)[0])??"",h=c.file_path??c.path??"";u=(r||h||c.pattern||"").slice(0,60)}return`${s}${o?` [${o}]`:""}${u?` ${u}`:""}`}case"tool.call.purged":{const s=t.count??0,c=((t.reclaimedBytes??0)/1024).toFixed(1);return`${s} tool calls purged • ${c} KB reclaimed`}case"user.prompt":return((n=t.text)==null?void 0:n.slice(0,80))??"";case"cost.update":{const s=t;return`$${(s.totalCostUsd??0).toFixed(6)} ${((s.inputTokens??0)+(s.outputTokens??0)).toLocaleString()} tokens ${s.model??""}`}case"agent.spawn":return`${t.name??""} (${String(t.agentId??"").slice(0,8)})`;case"agent.state_change":return`${t.previousState??"?"} → ${t.nextState??"?"}${t.reason?` (${t.reason})`:""}`;case"agent.log":return`[${t.level??"info"}] ${((a=t.message)==null?void 0:a.slice(0,80))??""}`;case"session.summary":{const s=t.turnCount??0,c=t.totalCostUsd??0,o=t.cacheHitRate??0;return`${s} turns $${c.toFixed(4)} ${o}% cache`}case"mcp.tool.call":return`${t.serverName??""} / ${t.toolName??""}`;default:{const s=[];for(const c of Object.keys(t).slice(0,3)){const o=t[c];o!=null&&(typeof o=="string"?s.push(`${c}: "${o.length>24?o.slice(0,24)+"…":o}"`):typeof o=="number"||typeof o=="boolean"?s.push(`${c}: ${String(o)}`):Array.isArray(o)?s.push(`${c}: [${o.length}]`):s.push(`${c}: {…}`))}return s.join(" ")}}}function Rx({label:e,value:t,mono:l=!0,color:n}){return i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"text-[9px] font-mono uppercase tracking-widest text-zinc-600",children:e}),i.jsx("span",{className:ge("text-[11px] break-all",l?"font-mono":""),style:{color:n??"#d4d4d8"},children:t})]})}function Hx({event:e,onClose:t}){const l=H(),[n,a]=C.useState(!1),s=e.payload,c=w0(e.type),o=k0(e),u=[];switch(e.type){case"tool.call":{const r=s.input,h=s.output;u.push({label:"Tool",value:s.toolName??""}),s.agentId&&u.push({label:"Agent ID",value:s.agentId}),(s.callId??s.toolCallId)&&u.push({label:"Call ID",value:s.callId??s.toolCallId});const p=s.status;if(p&&u.push({label:"Status",value:p,color:p==="complete"?l.running:p==="error"?l.error:l.warn}),r)for(const[m,g]of Object.entries(r)){if(g==null)continue;const y=typeof g=="string"?g:JSON.stringify(g,null,2);u.push({label:`input.${m}`,value:y.slice(0,800)})}if(h&&Object.keys(h).length>0){const m=JSON.stringify(h).slice(0,300);u.push({label:"Output",value:m})}break}case"user.prompt":u.push({label:"Prompt",value:s.text??""}),s.promptSource&&u.push({label:"Source",value:s.promptSource});break;case"cost.update":{const r=s;u.push({label:"Cost",value:`$${(r.totalCostUsd??0).toFixed(8)}`,color:l.running}),u.push({label:"Model",value:r.model??""}),u.push({label:"Input Tokens",value:(r.inputTokens??0).toLocaleString()}),u.push({label:"Output Tokens",value:(r.outputTokens??0).toLocaleString()});const h=s.cacheReadTokens??0,p=s.cacheWriteTokens??0;h&&u.push({label:"Cache Reads",value:h.toLocaleString(),color:l.warn}),p&&u.push({label:"Cache Writes",value:p.toLocaleString(),color:l.warn}),u.push({label:"Input Cost",value:`$${(r.inputCostUsd??0).toFixed(8)}`}),u.push({label:"Output Cost",value:`$${(r.outputCostUsd??0).toFixed(8)}`});const m=s.agentId;m&&u.push({label:"Agent ID",value:m});break}case"agent.spawn":u.push({label:"Agent ID",value:s.agentId??""}),u.push({label:"Name",value:s.name??""}),s.parentAgentId&&u.push({label:"Parent",value:s.parentAgentId}),s.depth!==void 0&&u.push({label:"Depth",value:String(s.depth)});break;case"agent.state_change":u.push({label:"Agent ID",value:s.agentId??""}),u.push({label:"Previous State",value:s.previousState??""}),u.push({label:"Next State",value:s.nextState??"",color:l.running}),s.reason&&u.push({label:"Reason",value:s.reason});break;case"agent.log":u.push({label:"Agent ID",value:s.agentId??""}),u.push({label:"Level",value:s.level??"info"}),u.push({label:"Message",value:s.message??""});break;case"session.summary":{u.push({label:"Turns",value:String(s.turnCount??0)}),u.push({label:"Total Duration",value:Sr(s.totalDurationMs??0)}),u.push({label:"Avg Turn Duration",value:Sr(s.avgTurnDurationMs??0)}),u.push({label:"Stop Reason",value:s.stopReason??""}),u.push({label:"Model",value:s.model??""}),u.push({label:"Total Cost",value:`$${(s.totalCostUsd??0).toFixed(8)}`,color:l.running}),u.push({label:"Cache Saved",value:`$${(s.cacheSavedUsd??0).toFixed(6)}`,color:l.warn}),u.push({label:"Cache Hit Rate",value:`${s.cacheHitRate??0}%`});const r=s.toolBreakdown;if(r){const p=Object.entries(r).sort((m,g)=>g[1]-m[1]).slice(0,8);u.push({label:"Tools",value:p.map(([m,g])=>`${m}×${g}`).join(" ")})}const h=s.filesModified;h!=null&&h.length&&u.push({label:`Files (${h.length})`,value:h.slice(0,10).map(p=>p.split("/").pop()).join(`
|
|
41
|
+
`)});break}default:for(const[r,h]of Object.entries(s))h!=null&&u.push({label:r,value:typeof h=="string"?h:JSON.stringify(h)})}return i.jsxs("div",{className:"flex flex-col border-l overflow-hidden",style:{width:320,flexShrink:0,borderColor:"rgba(255,255,255,0.08)",background:"rgba(0,0,0,0.4)"},children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2 border-b",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(dl,{variant:c,className:"text-[10px] shrink-0",children:e.type}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600 truncate",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i.jsx("button",{onClick:()=>a(r=>!r),className:"font-mono text-[9px] px-1.5 py-0.5 rounded",style:n?{background:`${l.info}22`,color:l.info,border:`1px solid ${l.info}44`}:{color:"#52525b",border:"1px solid rgba(255,255,255,0.06)"},children:n?"Fields":"Raw"}),i.jsx("button",{onClick:t,className:"ml-1 text-zinc-600 hover:text-zinc-400 text-sm leading-none px-1",children:"✕"})]})]}),i.jsxs("div",{className:"flex shrink-0 gap-3 px-3 py-1.5 border-b",style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsxs("span",{className:"font-mono text-[10px] text-zinc-600",children:["src: ",i.jsx("span",{className:"text-zinc-400",children:e.source})]}),o&&i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:"font-mono text-[10px]",style:{color:l.info},children:[o.tokens.toLocaleString(),"t"]}),o.costUsd>0&&i.jsxs("span",{className:"font-mono text-[10px]",style:{color:l.running},children:["$",o.costUsd.toFixed(6)]})]}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-700 truncate",children:e.id.slice(0,16)})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:n?i.jsx("pre",{className:"font-mono text-[10px] text-zinc-300 whitespace-pre-wrap break-all",children:JSON.stringify(e.payload,null,2)}):i.jsxs("div",{className:"space-y-3",children:[u.map((r,h)=>i.jsx(Rx,{label:r.label,value:r.value,color:r.color},h)),u.length===0&&i.jsx("span",{className:"text-[11px] text-zinc-600 font-mono",children:"No fields"})]})})]})}function Sr(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),l=Math.floor(e%6e4/1e3);return l>0?`${t}m ${l}s`:`${t}m`}function _x({event:e,isSelected:t,onSelect:l}){const n=w0(e.type),a=Bx(e),s=H(),c=k0(e),o=e.type==="tool.call"?e.payload.status:void 0,u=o==="error"?s.error:o==="complete"?s.running:o==="pending"?s.warn:null;return i.jsx("div",{className:ge("border-b cursor-pointer transition-colors duration-100",t?"bg-white/[0.04]":"hover:bg-white/[0.02]"),style:{borderColor:"rgba(255,255,255,0.04)"},onClick:l,children:i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[i.jsx("span",{className:"w-24 flex-shrink-0 font-mono text-[10px] text-zinc-500",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),i.jsx(dl,{variant:n,className:"w-44 flex-shrink-0 truncate justify-center text-[10px]",children:e.type}),i.jsx("span",{className:"w-14 flex-shrink-0 font-mono text-[10px] text-zinc-600 truncate",children:e.source}),i.jsx("span",{className:"flex-1 truncate font-mono text-[11px] text-zinc-400",children:a}),o?i.jsx("span",{className:"w-16 flex-shrink-0 text-right font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:u??"#52525b",background:u?`${u}1A`:"transparent"},children:o}):i.jsx("span",{className:"w-16 flex-shrink-0 text-right font-mono text-[11px]",style:{color:c?s.info:"#3f3f46"},children:c?c.tokens.toLocaleString():"—"}),i.jsx("span",{className:"w-24 flex-shrink-0 text-right font-mono text-[11px]",style:{color:((c==null?void 0:c.costUsd)??0)>0?s.running:"#3f3f46"},children:((c==null?void 0:c.costUsd)??0)>0?`$${c.costUsd.toFixed(6)}`:"—"}),i.jsx("div",{className:"w-1 h-4 rounded-full flex-shrink-0",style:{background:t?s.info:"transparent"}})]})})}function Lx(){const{events:e}=Le(),{activeSessionId:t}=ce(),l=H(),[n,a]=C.useState("all"),[s,c]=C.useState(""),[o,u]=C.useState(null),[r,h]=C.useState(!1),[p,m]=C.useState("stream"),g=C.useRef(null),y=C.useRef(e.length);C.useEffect(()=>{var x;r||e.length!==y.current&&(y.current=e.length,(x=g.current)==null||x.scrollTo({top:0}))},[e.length,r]);const j=C.useCallback(x=>{p==="stream"?(m("inspect"),u(x),h(!0)):(u(v=>(v==null?void 0:v.id)===x.id?null:x),h(!0))},[p]),b=C.useCallback(()=>{m("stream"),u(null),h(!1)},[]),f=Wi.find(x=>x.id===n)??Wi[0],d=e.filter(x=>{if(t&&x.sessionId!==t||!f.match(x.type))return!1;if(s){const v=s.toLowerCase();if(!x.type.includes(v)&&!JSON.stringify(x.payload).toLowerCase().includes(v))return!1}return!0});return i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2 border-b px-4 py-2 flex-wrap",style:{borderColor:"rgba(255,255,255,0.07)",background:l.toolbarBg},children:[i.jsx("div",{className:"flex items-center gap-0.5 rounded border p-0.5 mr-1",style:{borderColor:"rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.03)"},children:["stream","inspect"].map(x=>i.jsx("button",{onClick:()=>x==="stream"?b():m("inspect"),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors capitalize",style:p===x?{background:"rgba(255,255,255,0.10)",color:"#d4d4d8"}:{color:"#52525b"},children:x==="stream"?"⏵ Stream":"⊞ Inspect"},x))}),i.jsx("div",{className:"h-4 w-px",style:{background:"rgba(255,255,255,0.08)"}}),Wi.map(x=>i.jsx("button",{onClick:()=>a(x.id),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:n===x.id?{background:`${l.info}22`,color:l.info,border:`1px solid ${l.info}44`}:{color:"#71717a",border:"1px solid transparent"},children:x.label},x.id)),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),i.jsx("input",{type:"text",placeholder:"search…",value:s,onChange:x=>c(x.target.value),className:"h-6 rounded border bg-transparent px-2 text-[11px] font-mono text-zinc-300 placeholder-zinc-700 outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:130}}),s&&i.jsx("button",{onClick:()=>c(""),className:"font-mono text-[10px] text-zinc-600 hover:text-zinc-400",children:"✕"}),i.jsx("div",{className:"flex-1"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:d.length}),i.jsx("button",{onClick:()=>{h(x=>!x),r&&u(null)},className:"h-6 rounded border px-2 text-[10px] font-mono transition-colors",style:r?{borderColor:`${l.warn}44`,background:`${l.warn}1A`,color:l.warn}:{borderColor:"rgba(255,255,255,0.08)",color:"#71717a"},children:r?"▶ Resume":"⏸ Pause"})]}),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-1",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.25)"},children:[i.jsx("span",{className:"w-24 flex-shrink-0 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Time"}),i.jsx("span",{className:"w-44 flex-shrink-0 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Type"}),i.jsx("span",{className:"w-14 flex-shrink-0 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Src"}),i.jsx("span",{className:"flex-1 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Payload"}),i.jsx("span",{className:"w-20 flex-shrink-0 text-right text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Tokens"}),i.jsx("span",{className:"w-24 flex-shrink-0 text-right text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"Cost"}),i.jsx("div",{className:"w-1"})]}),i.jsx("div",{ref:g,className:"flex-1 overflow-y-auto",onMouseEnter:()=>{!o&&p==="stream"&&h(!0)},onMouseLeave:()=>{!o&&p==="stream"&&h(!1)},children:d.length===0?i.jsx(We,{icon:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),title:"No events",description:n==="all"?"Events will appear here as your agents run":`No ${n} events in this session`}):d.map(x=>i.jsx(_x,{event:x,isSelected:(o==null?void 0:o.id)===x.id,onSelect:()=>j(x)},x.id))})]}),p==="inspect"&&o&&i.jsx(Hx,{event:o,onClose:()=>{u(null),h(!1)}})]})}function $x(e){const t=[],l=new Map;for(const[a,s]of e.entries())l.set(a,{...s,children:[]});for(const a of l.values())if(a.parentId===null)t.push(a);else{const s=l.get(a.parentId);s?s.children.push(a):t.push(a)}const n=a=>{a.sort((s,c)=>s.spawnedAt-c.spawnedAt);for(const s of a)n(s.children)};return n(t),t}const Ae=ml((e,t)=>({agents:new Map,loopAlerts:[],upsertAgent:l=>{e(n=>{const a=new Map(n.agents),s=a.get(l.id);return s?a.set(l.id,{...s,...l,children:[]}):a.set(l.id,{...l,children:[]}),{agents:a}})},updateAgentStatus:(l,n,a)=>{e(s=>{const c=new Map(s.agents),o=c.get(l);return o?(c.set(l,{...o,status:n,...a!==void 0?{completedAt:a}:{}}),{agents:c}):{}})},incrementToolCallCount:l=>{e(n=>{const a=new Map(n.agents),s=a.get(l);return s?(a.set(l,{...s,toolCallCount:s.toolCallCount+1}),{agents:a}):{}})},addAgentLog:(l,n)=>{e(a=>{const s=new Map(a.agents),c=s.get(l);return c?(s.set(l,{...c,logs:[...c.logs,n]}),{agents:s}):{}})},addLoopAlert:l=>{e(n=>({loopAlerts:[l,...n.loopAlerts].slice(0,50)}))},dismissLoopAlert:l=>{e(n=>({loopAlerts:n.loopAlerts.filter(a=>a.id!==l)}))},getAgentTree:()=>$x(t().agents),getAgent:l=>t().agents.get(l)}));function qx(e,t){switch(e){case"running":return t.running;case"waiting":return t.warn;case"failed":return t.error;case"completed":return"#52525b";default:return"#52525b"}}function Yx(e){switch(e){case"running":return"green";case"waiting":return"yellow";case"failed":return"red";case"completed":return"gray";default:return"gray"}}function Gx(e,t){const l=t??Date.now();return Er(new Date(e),new Date(l),{addSuffix:!1})}function A0(e){return e===0?"$0.00":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function Fa(e){return e<1e3?e.toString():e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function Xx(e,t){let l=0,n=0,a=0,s=0,c=0;const o=new Map,u=new Map,r=new Set,h=new Set,p=[];let m=null,g=null;const y=(b,f)=>{(!g||b>g.at)&&(g={at:b,text:f})};for(const b of e){const f=b.payload;if(f.agentId===t){if(b.type==="api.response"){l+=f.inputTokens??0,n+=f.outputTokens??0,a+=f.cacheReadTokens??0,s+=f.cacheWriteTokens??0,c+=f.costUsd??0;const d=f.model;d&&r.add(d)}else if(b.type==="cost.update"){const d=f.totalCostUsd??0;d>0&&(c+=d);const x=f.model;x&&r.add(x)}else if(b.type==="tool.call"){const d=f.toolName;if(d){o.set(d,(o.get(d)??0)+1);const x=f.input??{},v=x.file_path??x.path;if(v&&typeof v=="string"&&h.add(v),d==="Bash"){const S=x.command;S&&p.push({command:S,at:b.timestamp})}y(b.timestamp,`${d}${v?` ${v}`:""}`)}}else if(b.type==="tool.error"){const d=f.toolName;d&&u.set(d,(u.get(d)??0)+1)}else if(b.type==="agent.fail"){const d=f.error;d&&(m=d)}else if(b.type==="agent.log"){const d=f.message;d&&y(b.timestamp,d)}}}const j=Array.from(o.entries()).sort((b,f)=>f[1]-b[1]).slice(0,8).map(([b,f])=>({name:b,count:f,errors:u.get(b)??0}));return{inputTokens:l,outputTokens:n,cacheReadTokens:a,cacheWriteTokens:s,costUsd:c,topTools:j,models:Array.from(r),filesTouched:Array.from(h),bashCommands:p.slice(-10),failureReason:m,lastActivity:g}}function Qx({agent:e,depth:t,parentName:l}){var o;const n=H(),a=Le(u=>u.events),s=C.useMemo(()=>Xx(a,e.id),[a,e.id]),c=s.inputTokens>0||s.outputTokens>0||s.costUsd>0||s.topTools.length>0||s.models.length>0;return!c&&e.logs.length===0?i.jsx("div",{className:"border-b px-4 py-3",style:{paddingLeft:`${16+t*20+24}px`,borderColor:"rgba(255,255,255,0.05)",background:"rgba(0,0,0,0.3)"},children:i.jsx("p",{className:"font-mono text-[11px] italic text-zinc-500",children:"No reasoning trace, tool calls, or token usage captured for this agent."})}):i.jsxs("div",{className:"border-b px-4 py-3 space-y-3",style:{paddingLeft:`${16+t*20+24}px`,borderColor:"rgba(255,255,255,0.05)",background:"rgba(0,0,0,0.3)"},children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 font-mono text-[10px] text-zinc-500",children:[i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Spawned"}),i.jsx("span",{className:"text-zinc-300",children:new Date(e.spawnedAt).toLocaleTimeString("en",{hour12:!1})})]}),l&&i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Parent"}),i.jsx("span",{className:"text-zinc-300",children:l})]}),i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Depth"}),i.jsx("span",{className:"text-zinc-300",children:e.depth})]}),s.models.length>0&&i.jsxs("span",{children:[i.jsx("span",{className:"text-zinc-700 uppercase tracking-widest mr-1.5",children:"Model"}),i.jsx("span",{className:"text-zinc-300",children:s.models.join(", ")})]}),e.loopCount>0&&i.jsxs("span",{style:{color:n.error},children:[i.jsx("span",{className:"uppercase tracking-widest mr-1.5 opacity-70",children:"Loops"}),e.loopCount]})]}),c&&(s.inputTokens>0||s.outputTokens>0||s.costUsd>0)&&i.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 font-mono text-[11px]",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Input"}),i.jsx("span",{className:"text-zinc-200",children:Fa(s.inputTokens)})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Output"}),i.jsx("span",{className:"text-zinc-200",children:Fa(s.outputTokens)})]}),s.cacheReadTokens>0&&i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Cache Read"}),i.jsx("span",{className:"text-zinc-200",children:Fa(s.cacheReadTokens)})]}),s.cacheWriteTokens>0&&i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Cache Write"}),i.jsx("span",{className:"text-zinc-200",children:Fa(s.cacheWriteTokens)})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-[9px] uppercase tracking-widest text-zinc-700",children:"Cost"}),i.jsx("span",{style:{color:n.info},children:A0(s.costUsd)})]})]}),e.status==="failed"&&(s.failureReason||e.logs.some(u=>u.level==="error"))&&i.jsxs("div",{className:"rounded border px-2.5 py-2",style:{background:`${n.error}14`,borderColor:`${n.error}33`},children:[i.jsx("p",{className:"mb-1 text-[10px] font-mono uppercase tracking-widest",style:{color:n.error},children:"Failure"}),i.jsx("p",{className:"font-mono text-[11px]",style:{color:n.error},children:s.failureReason??((o=e.logs.filter(u=>u.level==="error").at(-1))==null?void 0:o.message)})]}),s.topTools.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"mb-1.5 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Tools Used"}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.topTools.map(({name:u,count:r,errors:h})=>i.jsxs("span",{className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 font-mono text-[10px]",style:{background:"rgba(255,255,255,0.03)",borderColor:h>0?`${n.error}33`:"rgba(255,255,255,0.08)",color:"#d4d4d8"},children:[i.jsx("span",{children:u}),i.jsxs("span",{className:"text-zinc-500",children:["×",r]}),h>0&&i.jsxs("span",{style:{color:n.error},children:["· ",h," err"]})]},u))})]}),s.filesTouched.length>0&&i.jsxs("div",{children:[i.jsxs("p",{className:"mb-1.5 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:["Files Touched (",s.filesTouched.length,")"]}),i.jsx("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:s.filesTouched.map(u=>i.jsx("div",{className:"font-mono text-[11px] text-zinc-400 truncate",title:u,children:u},u))})]}),s.bashCommands.length>0&&i.jsxs("div",{children:[i.jsxs("p",{className:"mb-1.5 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:["Recent Bash (",s.bashCommands.length,")"]}),i.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:s.bashCommands.map((u,r)=>i.jsxs("div",{className:"font-mono text-[11px] text-zinc-400 truncate",style:{color:"#a1a1aa"},title:u.command,children:[i.jsx("span",{className:"text-zinc-700 mr-1.5",children:"$"}),u.command]},r))})]}),e.logs.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"mb-2 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Reasoning Trace"}),i.jsx("div",{className:"space-y-1.5",children:e.logs.map((u,r)=>i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"flex-shrink-0 font-mono text-[10px] text-zinc-700 mt-0.5 w-20",children:new Date(u.timestamp).toLocaleTimeString("en",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}),i.jsx("span",{className:"font-mono text-[11px]",style:{color:u.level==="info"?n.success:u.level==="warn"?n.warn:u.level==="error"?n.error:"#71717a"},children:u.message})]},r))})]})]})}function M0({agent:e,depth:t,parentName:l,selectedId:n,expandedIds:a,onToggle:s,onSelect:c}){const o=H(),u=e.children.length>0,r=a.has(e.id),h=n===e.id,p=qx(e.status,o),m=e.status==="running"&&e.logs.length>0?e.logs[e.logs.length-1]:null;return i.jsxs("div",{children:[i.jsxs("div",{className:ge("group flex flex-col gap-0.5 px-4 py-2.5 cursor-pointer transition-colors duration-100","border-b hover:bg-white/[0.02]",h?"bg-white/[0.03]":""),style:{paddingLeft:`${16+t*20}px`,borderColor:"rgba(255,255,255,0.05)"},onClick:()=>c(e.id),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[u?i.jsx("button",{className:"flex-shrink-0 text-zinc-300 hover:text-zinc-400 w-4",onClick:g=>{g.stopPropagation(),s(e.id)},children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:ge("transition-transform",r?"rotate-90":""),children:i.jsx("polyline",{points:"9 18 15 12 9 6"})})}):i.jsx("span",{className:"w-4 flex-shrink-0"}),i.jsx("div",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:p,boxShadow:e.status==="running"?`0 0 6px ${p}`:"none"}}),i.jsx("span",{className:"flex-1 font-mono text-sm font-medium truncate",style:{color:e.status==="running"?o.running:"#a1a1aa"},children:e.name}),e.loopCount>0&&i.jsxs(dl,{variant:"red",size:"xs",className:"ml-1",children:["loop ×",e.loopCount]}),i.jsx(dl,{variant:Yx(e.status),size:"xs",children:e.status}),i.jsx("span",{className:"w-20 text-right font-mono text-[11px] text-zinc-300",children:Gx(e.spawnedAt,e.completedAt)}),i.jsxs("span",{className:"w-14 text-right font-mono text-[11px] text-zinc-300",children:[e.toolCallCount," calls"]})]}),m&&!h&&i.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px] truncate",style:{paddingLeft:"24px",color:"#71717a"},children:[i.jsx("span",{className:"text-zinc-700",children:"→"}),i.jsx("span",{className:"truncate",title:m.message,children:m.message})]})]}),h&&i.jsx(Qx,{agent:e,depth:t,parentName:l}),u&&r&&i.jsx("div",{children:e.children.map(g=>i.jsx(M0,{agent:g,depth:t+1,parentName:e.name,selectedId:n,expandedIds:a,onToggle:s,onSelect:c},g.id))})]})}function Zx({alert:e,onDismiss:t}){const l=H();return i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 text-sm border-b",style:{background:`${l.error}14`,borderColor:`${l.error}33`},children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:l.error,strokeWidth:"2",children:[i.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),i.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),i.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),i.jsxs("span",{style:{color:l.error},className:"font-mono text-xs font-medium flex-1",children:["Loop detected — ",i.jsx("span",{className:"font-bold",children:e.agentName})," called"," ",i.jsx("span",{className:"font-bold",children:e.toolName})," ",e.loopCount,"× in a tight window"]}),i.jsx("button",{onClick:()=>t(e.id),className:"font-mono text-[11px] transition-colors",style:{color:`${l.error}99`},onMouseEnter:n=>n.currentTarget.style.color=l.error,onMouseLeave:n=>n.currentTarget.style.color=`${l.error}99`,children:"Dismiss"})]})}const Vx=new Set;function Nr(e){const t=[],l=n=>{for(const a of n)t.push(a),a.children.length>0&&l(a.children)};return l(e),t}function Jx(){const{loopAlerts:e,dismissLoopAlert:t}=Ae(),l=Ae(z=>z.getAgentTree),{activeSessionId:n}=ce(),a=Le(z=>z.events),s=H(),[c,o]=C.useState(new Set),[u,r]=C.useState(null),[h,p]=C.useState(""),m=l(),g=n?m.filter(z=>z.sessionId===n):m,y=n?e.filter(z=>{const N=Ae.getState().getAgent(z.agentId);return(N==null?void 0:N.sessionId)===n}):e,j=C.useCallback(z=>{o(N=>{const M=new Set(N);return M.has(z)?M.delete(z):M.add(z),M})},[]),b=C.useCallback(z=>{r(N=>N===z?null:z)},[]),{runningCount:f,failedCount:d,totalCost:x}=C.useMemo(()=>{const z=Nr(g),N=new Set(z.map(X=>X.id));let M=0,A=0;for(const X of z)X.status==="running"?M++:X.status==="failed"&&A++;let D=0;for(const X of a){const te=X.payload,E=te.agentId;!E||!N.has(E)||(X.type==="api.response"?D+=te.costUsd??0:X.type==="cost.update"&&(D+=te.totalCostUsd??0))}return{runningCount:M,failedCount:A,totalCost:D}},[g,a]),v=h.trim().toLowerCase(),S=v?Nr(g).filter(z=>z.name.toLowerCase().includes(v)):g;return i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:s.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Agent Tree"}),f>0&&i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("div",{className:"h-1.5 w-1.5 rounded-full animate-pulse-slow",style:{background:s.running,boxShadow:`0 0 4px ${s.running}`}}),i.jsxs("span",{className:"font-mono text-[11px]",style:{color:s.running},children:[f," running"]})]}),d>0&&i.jsxs("span",{className:"font-mono text-[11px]",style:{color:s.error},children:[d," failed"]}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[g.length," agents"]}),x>0&&i.jsxs("span",{className:"font-mono text-[11px]",style:{color:s.info},children:[A0(x)," total"]}),i.jsx("div",{className:"flex-1"}),i.jsx("input",{type:"text",value:h,onChange:z=>p(z.target.value),placeholder:"Filter agents…",className:"w-40 rounded border bg-transparent px-2 py-1 font-mono text-[11px] text-zinc-300 placeholder:text-zinc-700 focus:outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)"}})]}),y.map(z=>i.jsx(Zx,{alert:z,onDismiss:t},z.id)),i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2 border-b px-4 py-1.5",style:{borderColor:"rgba(255,255,255,0.05)",background:"rgba(0,0,0,0.3)"},children:[i.jsx("span",{className:"flex-1 text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Agent"}),i.jsx("span",{className:"w-20 text-right text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Status"}),i.jsx("span",{className:"w-20 text-right text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Duration"}),i.jsx("span",{className:"w-14 text-right text-[10px] font-mono uppercase tracking-widest text-zinc-700",children:"Calls"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:g.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("circle",{cx:"12",cy:"5",r:"2"}),i.jsx("circle",{cx:"5",cy:"19",r:"2"}),i.jsx("circle",{cx:"19",cy:"19",r:"2"}),i.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"13"}),i.jsx("line",{x1:"12",y1:"13",x2:"5",y2:"17"}),i.jsx("line",{x1:"12",y1:"13",x2:"19",y2:"17"})]}),title:"No agents yet",description:"Agent hierarchy will appear as your workflows run"}):S.length===0?i.jsx("div",{className:"flex h-full items-center justify-center px-6 py-10 text-center",children:i.jsxs("p",{className:"font-mono text-[11px] text-zinc-500",children:['No agents match "',h,'"']})}):S.map(z=>i.jsx(M0,{agent:z,depth:0,parentName:null,selectedId:u,expandedIds:v?Vx:c,onToggle:j,onSelect:b},z.id))})]})}const fi=ml((e,t)=>({summaries:new Map,setSummary:(l,n)=>{e(a=>{const s=new Map(a.summaries);return s.set(l,n),{summaries:s}})},getSummary:l=>t().summaries.get(l)}));function Ee({children:e,className:t,glass:l=!1,padding:n="md"}){const a={none:"",sm:"p-3",md:"p-4",lg:"p-6"};return i.jsx("div",{className:ge("rounded-lg border","border-white/[0.08]",l?"bg-white/[0.03] backdrop-blur-sm":"bg-zinc-900/80",a[n],t),children:e})}function st({title:e,subtitle:t,actions:l,className:n}){return i.jsxs("div",{className:ge("flex items-center justify-between",n),children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-xs font-mono uppercase tracking-widest text-zinc-500",children:e}),t&&i.jsx("p",{className:"mt-0.5 text-xs text-zinc-300",children:t})]}),l&&i.jsx("div",{className:"flex items-center gap-2",children:l})]})}function Kx(e){if(e.type==="cost.update"){const t=e.payload;return{agentId:t.agentId??"unknown",model:t.model??"unknown",inputTokens:t.inputTokens??0,outputTokens:t.outputTokens??0,cacheReadTokens:t.cacheReadTokens??0,cacheWriteTokens:t.cacheWriteTokens??0,costUsd:t.totalCostUsd??0,timestamp:e.timestamp,source:e.source}}if(e.type==="api.response"){const t=e.payload,l=t.costUsd??0;return l===0?null:{agentId:t.agentId??"unknown",model:t.model??"unknown",inputTokens:t.inputTokens??0,outputTokens:t.outputTokens??0,cacheReadTokens:t.cacheReadTokens??0,cacheWriteTokens:t.cacheWriteTokens??0,costUsd:l,timestamp:e.timestamp,source:e.source}}if(e.type==="api.stream.end"){const t=e.payload,l=t.costUsd??0;return l===0?null:{agentId:"stream",model:"streaming",inputTokens:t.inputTokens??0,outputTokens:t.outputTokens??0,cacheReadTokens:t.cacheReadTokens??0,cacheWriteTokens:t.cacheWriteTokens??0,costUsd:l,timestamp:e.timestamp,source:e.source}}return null}function Sl({label:e,value:t,sub:l,accentColor:n}){return i.jsxs(Ee,{glass:!0,className:"flex flex-col gap-1.5 flex-1 min-w-0",children:[i.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-300",children:e}),i.jsx("span",{className:"font-mono text-2xl font-semibold",style:{color:n},children:t}),l&&i.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:l})]})}function hs({active:e,payload:t,label:l}){return!e||!(t!=null&&t.length)?null:i.jsxs("div",{className:"rounded border px-3 py-2 text-xs font-mono",style:{background:"#1a1a1e",borderColor:"rgba(255,255,255,0.12)"},children:[i.jsx("p",{className:"text-zinc-400 mb-1",children:l}),t.map((n,a)=>{var s;return i.jsxs("p",{style:{color:n.color},children:[n.name,": ",typeof n.value=="number"&&((s=n.name)!=null&&s.includes("$"))?`$${n.value.toFixed(4)}`:typeof n.value=="number"?n.value.toLocaleString():n.value]},a)})]})}function Fx(){var c,o;const{sessions:e}=ce(),t=fi(u=>u.summaries),l=H(),n=C.useMemo(()=>e.filter(u=>u.totalCostUsd>0).sort((u,r)=>r.totalCostUsd-u.totalCostUsd).slice(0,20).map(u=>{const r=t.get(u.id);return{name:u.name,id:u.id,costUsd:u.totalCostUsd,inputTokens:(r==null?void 0:r.inputTokens)??0,outputTokens:(r==null?void 0:r.outputTokens)??0,cacheReadTokens:(r==null?void 0:r.cacheReadTokens)??0,turnCount:(r==null?void 0:r.turnCount)??0,cacheHitRate:(r==null?void 0:r.cacheHitRate)??0}}),[e,t]),a=n.reduce((u,r)=>u+r.costUsd,0),s=n.reduce((u,r)=>u+r.inputTokens+r.outputTokens,0);return n.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),i.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),title:"No cross-session cost data",description:"Sessions with cost data will appear here"}):i.jsxs("div",{className:"flex flex-col gap-4 p-4 overflow-y-auto",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx(Sl,{label:"Total Spend",value:`$${a.toFixed(4)}`,sub:`${n.length} sessions`,accentColor:l.running}),i.jsx(Sl,{label:"Total Tokens",value:s>=1e6?`${(s/1e6).toFixed(2)}M`:`${(s/1e3).toFixed(1)}k`,sub:"input + output",accentColor:l.info}),i.jsx(Sl,{label:"Most Expensive",value:`$${((c=n[0])==null?void 0:c.costUsd.toFixed(4))??"0"}`,sub:((o=n[0])==null?void 0:o.name)??"—",accentColor:l.warn})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Cost per Session (top 20)",className:"mb-3"}),i.jsx(Gn,{width:"100%",height:220,children:i.jsxs(xs,{data:n,margin:{top:4,right:4,bottom:40,left:8},children:[i.jsx(Xn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Qn,{dataKey:"name",tick:{fontSize:9,fontFamily:"JetBrains Mono, monospace",fill:"#52525b"},axisLine:!1,tickLine:!1,angle:-35,textAnchor:"end",interval:0}),i.jsx(Zn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:u=>`$${u.toFixed(2)}`}),i.jsx(Vn,{content:({active:u,payload:r})=>{var p;if(!u||!(r!=null&&r.length))return null;const h=(p=r[0])==null?void 0:p.payload;return i.jsxs("div",{className:"rounded border px-3 py-2 text-xs font-mono",style:{background:"#1a1a1e",borderColor:"rgba(255,255,255,0.12)"},children:[i.jsx("p",{className:"text-zinc-300 font-semibold mb-1",children:h.name}),i.jsxs("p",{style:{color:l.running},children:["$",h.costUsd.toFixed(6)]}),h.turnCount>0&&i.jsxs("p",{className:"text-zinc-400",children:[h.turnCount," turns"]}),h.cacheHitRate>0&&i.jsxs("p",{style:{color:l.warn},children:[h.cacheHitRate,"% cache hit"]})]})},cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"costUsd",radius:[3,3,0,0],children:n.map((u,r)=>i.jsx(Mr,{fill:l.chartColors[r%l.chartColors.length],fillOpacity:.8},r))})]})})]}),n.some(u=>u.inputTokens>0)&&i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Token Breakdown per Session",className:"mb-3"}),i.jsx(Gn,{width:"100%",height:180,children:i.jsxs(xs,{data:n,margin:{top:4,right:4,bottom:40,left:8},children:[i.jsx(Xn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Qn,{dataKey:"name",tick:{fontSize:9,fontFamily:"JetBrains Mono, monospace",fill:"#52525b"},axisLine:!1,tickLine:!1,angle:-35,textAnchor:"end",interval:0}),i.jsx(Zn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:u=>u>=1e3?`${(u/1e3).toFixed(0)}k`:String(u)}),i.jsx(Vn,{content:i.jsx(hs,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"inputTokens",name:"Input",fill:l.info,fillOpacity:.8,stackId:"a"}),i.jsx(Vt,{dataKey:"outputTokens",name:"Output",fill:l.warn,fillOpacity:.8,stackId:"a"}),i.jsx(Vt,{dataKey:"cacheReadTokens",name:"Cache Read",fill:l.purple,fillOpacity:.8,stackId:"a",radius:[3,3,0,0]})]})})]})]})}function Wx(){var v;const{events:e}=Le(),{agents:t}=Ae(),{activeSessionId:l}=ce(),n=H(),[a,s]=C.useState("session"),c=l?e.filter(S=>S.sessionId===l):e,o=C.useMemo(()=>c.map(S=>Kx(S)).filter(S=>S!==null).sort((S,z)=>S.timestamp-z.timestamp),[c]),u=C.useMemo(()=>{let S=0,z=0,N=0,M=0,A=0;for(const D of o)S+=D.costUsd,z+=D.inputTokens,N+=D.outputTokens,M+=D.cacheReadTokens,A+=D.cacheWriteTokens;return{costUsd:S,inputTokens:z,outputTokens:N,cacheReadTokens:M,cacheWriteTokens:A}},[o]),r=C.useMemo(()=>{var z;const S=new Map;for(const N of o){const M=((z=t.get(N.agentId))==null?void 0:z.name)??N.agentId.slice(0,8),A=S.get(N.agentId);A?A.costUsd+=N.costUsd:S.set(N.agentId,{agentId:N.agentId,name:M,costUsd:N.costUsd})}return Array.from(S.values()).sort((N,M)=>M.costUsd-N.costUsd)},[o,t]),h=C.useMemo(()=>{let S=0;return o.map(z=>(S+=z.costUsd,{timestamp:z.timestamp,time:ot(new Date(z.timestamp),"HH:mm:ss"),costUsd:S}))},[o]),p=C.useMemo(()=>{const S=new Map;for(const z of o){const N=z.model.replace("claude-","").replace("-20","-"),M=S.get(z.model);M?(M.inputTokens+=z.inputTokens,M.outputTokens+=z.outputTokens,M.cacheReadTokens+=z.cacheReadTokens):S.set(z.model,{model:N,inputTokens:z.inputTokens,outputTokens:z.outputTokens,cacheReadTokens:z.cacheReadTokens})}return Array.from(S.values())},[o]),m=2e5,g=((v=[...o].reverse().find(S=>S.inputTokens>0))==null?void 0:v.inputTokens)??0,y=Math.min(g/m*100,100),j=y>80?n.error:y>60?n.warn:n.success,b=l?/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(l):!1,f=c.length,d=S=>S?{background:`${n.info}22`,color:n.info,border:`1px solid ${n.info}44`}:{color:"#52525b",border:"1px solid transparent"},x=o.length===0?i.jsxs("div",{className:"flex flex-col min-h-0",children:[i.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[b&&i.jsxs("div",{className:"rounded-lg border px-4 py-3 text-[12px] font-mono",style:{borderColor:`${n.warn}33`,background:`${n.warn}0D`,color:n.warn},children:[i.jsx("p",{className:"font-semibold mb-1",children:"Hook session — no API cost data"}),i.jsxs("p",{className:"text-[11px] opacity-80",children:["Claude Code hook sessions (",l==null?void 0:l.slice(0,8),"…) don't capture Anthropic API calls. Select a session with a ULID ID (e.g. 01KN…) from the header dropdown to see cost data."]})]}),!b&&f>0&&i.jsxs("div",{className:"rounded-lg border px-4 py-3 text-[12px] font-mono",style:{borderColor:`${n.info}33`,background:`${n.info}0D`,color:n.info},children:[i.jsxs("p",{className:"font-semibold mb-1",children:["SDK session — ",f," events, no cost events yet"]}),i.jsx("p",{className:"text-[11px] opacity-80",children:"Events are loaded but none are cost.update or api.response type yet. Make API calls through a prism()-wrapped client."})]}),!b&&f===0&&i.jsxs("div",{className:"rounded-lg border px-4 py-3 text-[12px] font-mono",style:{borderColor:"rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.03)",color:"#71717a"},children:[i.jsx("p",{className:"font-semibold mb-1",children:"No events loaded for this session"}),i.jsx("p",{className:"text-[11px] opacity-80",children:"The session snapshot may not have loaded yet. Try switching away and back, or check that the collector is running."})]})]}),i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),i.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),title:"No cost data for this session",description:"Use the session dropdown (top) to switch to an SDK session (01KN… ULID format), or switch to Portfolio view."})]}):i.jsxs("div",{className:"flex flex-col gap-4 p-4 overflow-y-auto",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx(Sl,{label:"Total Cost",value:`$${u.costUsd.toFixed(4)}`,sub:"USD",accentColor:n.running}),i.jsx(Sl,{label:"Input Tokens",value:u.inputTokens.toLocaleString(),sub:"prompt tokens",accentColor:n.info}),i.jsx(Sl,{label:"Output Tokens",value:u.outputTokens.toLocaleString(),sub:"completion tokens",accentColor:n.warn}),i.jsx(Sl,{label:"Cache Tokens",value:(u.cacheReadTokens+u.cacheWriteTokens).toLocaleString(),sub:`${u.cacheReadTokens.toLocaleString()} read / ${u.cacheWriteTokens.toLocaleString()} write`,accentColor:n.purple})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Context Window Utilization",className:"mb-2"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex-1 h-3 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${y}%`,background:j,boxShadow:`0 0 8px ${j}`}})}),i.jsxs("span",{className:"font-mono text-xs text-zinc-400 w-16 text-right",children:[y.toFixed(1),"%"]}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[g.toLocaleString()," / ",m.toLocaleString()]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Cost per Agent",className:"mb-3"}),i.jsx(Gn,{width:"100%",height:200,children:i.jsxs(xs,{data:r,margin:{top:4,right:4,bottom:4,left:4},children:[i.jsx(Xn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Qn,{dataKey:"name",tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1}),i.jsx(Zn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:S=>`$${S.toFixed(3)}`}),i.jsx(Vn,{content:i.jsx(hs,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"costUsd",name:"Cost $",radius:[3,3,0,0],children:r.map((S,z)=>i.jsx(Mr,{fill:n.chartColors[z%n.chartColors.length],fillOpacity:.8},z))})]})})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Cumulative Cost Over Time",className:"mb-3"}),i.jsx(Gn,{width:"100%",height:200,children:i.jsxs(B0,{data:h,margin:{top:4,right:4,bottom:4,left:4},children:[i.jsx(Xn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Qn,{dataKey:"time",tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1}),i.jsx(Zn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:S=>`$${S.toFixed(3)}`}),i.jsx(Vn,{content:i.jsx(hs,{})}),i.jsx(R0,{type:"monotone",dataKey:"costUsd",name:"Cumulative $",stroke:n.running,strokeWidth:2,dot:!1,activeDot:{r:4,fill:n.running}})]})})]})]}),p.length>0&&i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Token Breakdown by Model",className:"mb-3"}),i.jsx(Gn,{width:"100%",height:180,children:i.jsxs(xs,{data:p,margin:{top:4,right:4,bottom:4,left:4},children:[i.jsx(Xn,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),i.jsx(Qn,{dataKey:"model",tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1}),i.jsx(Zn,{tick:{fontSize:10,fontFamily:"JetBrains Mono, monospace",fill:"#71717a"},axisLine:!1,tickLine:!1,tickFormatter:S=>S>=1e3?`${(S/1e3).toFixed(0)}k`:String(S)}),i.jsx(Vn,{content:i.jsx(hs,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),i.jsx(Vt,{dataKey:"inputTokens",name:"Input",fill:n.info,fillOpacity:.8,stackId:"a",radius:[0,0,0,0]}),i.jsx(Vt,{dataKey:"outputTokens",name:"Output",fill:n.warn,fillOpacity:.8,stackId:"a"}),i.jsx(Vt,{dataKey:"cacheReadTokens",name:"Cache Read",fill:n.purple,fillOpacity:.8,stackId:"a",radius:[3,3,0,0]})]})})]})]});return i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:n.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Cost Analytics"}),a==="session"&&o.length>0&&i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[o.length," API calls"]}),i.jsx("div",{className:"flex-1"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:"view:"}),i.jsx("button",{onClick:()=>s("session"),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:d(a==="session"),children:"Session"}),i.jsx("button",{onClick:()=>s("portfolio"),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:d(a==="portfolio"),children:"Portfolio"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:a==="portfolio"?i.jsx(Fx,{}):x})]})}const Wo=ml((e,t)=>({checkpoints:[],selectedCheckpointId:null,addCheckpoint:l=>{e(n=>{const a=n.checkpoints.findIndex(s=>s.id===l.id);if(a>=0){const s=[...n.checkpoints];return s[a]=l,{checkpoints:s}}return{checkpoints:[l,...n.checkpoints]}})},selectCheckpoint:l=>{e({selectedCheckpointId:l})},getCheckpoint:l=>t().checkpoints.find(n=>n.id===l),getCheckpointsBySession:l=>t().checkpoints.filter(n=>n.sessionId===l).sort((n,a)=>n.timestamp-a.timestamp),getPreviousCheckpoint:l=>{const n=t().checkpoints.find(c=>c.id===l);if(!n)return;const a=t().checkpoints.filter(c=>c.sessionId===n.sessionId&&c.agentId===n.agentId).sort((c,o)=>c.timestamp-o.timestamp),s=a.findIndex(c=>c.id===l);return s>0?a[s-1]:void 0}}));function Ix(e,t){const l=e.split(`
|
|
42
42
|
`),n=t.split(`
|
|
43
|
-
`),a=[],s=new Set(l),c=new Set(n);for(const o of l)c.has(o)||a.push({type:"removed",content:o});for(const o of n)s.has(o)?a.push({type:"unchanged",content:o}):a.push({type:"added",content:o});return a.slice(0,50)}function
|
|
44
|
-
…`:c.content})]},o)})}),n==="diff"&&t&&i.jsx("div",{className:"space-y-3",children:i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"State Diff",className:"mb-2"}),i.jsx("div",{className:"font-mono text-[11px]",children:Fx(JSON.stringify(t.agentState,null,2),JSON.stringify(e.agentState,null,2)).map((c,o)=>i.jsxs("div",{className:"px-2 py-0.5",style:{background:c.type==="added"?`${l.success}0D`:c.type==="removed"?`${l.error}0D`:"transparent",color:c.type==="added"?l.success:c.type==="removed"?l.error:"#52525b"},children:[i.jsx("span",{className:"select-none mr-2",children:c.type==="added"?"+":c.type==="removed"?"-":" "}),c.content]},o))})]})})]})]})}function Px(){const{checkpoints:e,selectedCheckpointId:t,selectCheckpoint:l,getPreviousCheckpoint:n}=Fo(),{activeSessionId:a}=ce(),s=H(),c=a?e.filter(r=>r.sessionId===a).sort((r,h)=>h.timestamp-r.timestamp):[...e].sort((r,h)=>h.timestamp-r.timestamp),o=t?e.find(r=>r.id===t):null,u=t?n(t):void 0;return i.jsxs("div",{className:"flex h-full",children:[i.jsxs("div",{className:"flex w-72 flex-shrink-0 flex-col border-r",style:{borderColor:"rgba(255,255,255,0.08)"},children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:s.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Checkpoints"}),i.jsx("span",{className:"font-mono text-[11px] text-zinc-300",children:c.length})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:c.length===0?i.jsx(We,{icon:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})}),title:"No checkpoints yet",description:"Use ctx.checkpoint() in your agent to create checkpoints"}):c.map(r=>i.jsx(Wx,{checkpoint:r,isSelected:t===r.id,onSelect:()=>l(r.id)},r.id))})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o?i.jsx(Ix,{checkpoint:o,prevCheckpoint:u}):i.jsx(We,{title:"Select a checkpoint",description:"Click a checkpoint on the left to inspect it"})})]})}const Gl=ml((e,t)=>({servers:new Map,callRecords:[],upsertServer:l=>{e(n=>{const a=new Map(n.servers);return a.set(l.id,l),{servers:a}})},setServerStatus:(l,n)=>{e(a=>{const s=new Map(a.servers),c=s.get(l);return c?(s.set(l,{...c,status:n}),{servers:s}):{}})},updateHeartbeat:(l,n)=>{e(a=>{const s=new Map(a.servers),c=s.get(l);return c?(s.set(l,{...c,lastHeartbeat:n}),{servers:s}):{}})},addCallRecord:l=>{e(n=>({callRecords:[l,...n.callRecords].slice(0,500)})),e(n=>{const a=new Map(n.servers),s=a.get(l.serverId);return s?(a.set(l.serverId,{...s,callCount:s.callCount+1}),{servers:a}):{}})},updateCallRecord:(l,n)=>{e(a=>{const s=a.callRecords.findIndex(u=>u.callId===l);if(s<0)return{};const c=[...a.callRecords],o=c[s];if(!o)return{};if(c[s]={...o,...n},n.isError&&n.serverId){const u=new Map(a.servers),r=u.get(n.serverId);if(r)return u.set(n.serverId,{...r,errorCount:r.errorCount+1}),{callRecords:c,servers:u}}return{callRecords:c}})},getServerList:()=>Array.from(t().servers.values()),getAllTools:()=>{const l=[];for(const n of t().servers.values())for(const a of n.tools)l.push({...a,serverName:n.name,serverId:n.id});return l}}));function ep({server:e,isSelected:t,onSelect:l}){const n=H(),a=e.status==="connected";return i.jsxs("button",{onClick:l,className:"w-full text-left rounded-lg border p-3 transition-all duration-150",style:t?{borderColor:`${n.running}4D`,background:`${n.running}0D`}:{borderColor:"rgba(255,255,255,0.08)",background:"rgba(24,24,27,0.8)"},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("div",{className:"h-2 w-2 rounded-full flex-shrink-0",style:{background:a?n.success:"#52525b",boxShadow:a?`0 0 6px ${n.success}`:"none"}}),i.jsx("span",{className:"font-mono text-sm font-medium text-zinc-300 truncate flex-1",children:e.name}),i.jsx(dl,{variant:a?"green":"gray",size:"xs",children:e.status})]}),i.jsxs("div",{className:"flex items-center gap-3 text-[11px] font-mono text-zinc-300",children:[i.jsxs("span",{children:[e.tools.length," tools"]}),i.jsx("span",{children:"·"}),i.jsxs("span",{children:[e.callCount," calls"]}),e.errorCount>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{style:{color:n.error},children:[e.errorCount," errors"]})]}),e.lastHeartbeat&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsx("span",{children:R0(new Date(e.lastHeartbeat),{addSuffix:!0})})]})]})]})}function tp({tools:e}){const t=H(),[l,n]=C.useState(""),[a,s]=C.useState(null),c=e.filter(o=>o.name.toLowerCase().includes(l.toLowerCase())||o.description.toLowerCase().includes(l.toLowerCase()));return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",placeholder:"Search tools…",value:l,onChange:o=>n(o.target.value),className:"h-7 flex-1 rounded border bg-zinc-900/80 px-2.5 text-[11px] font-mono text-zinc-300 placeholder-zinc-700",style:{borderColor:"rgba(255,255,255,0.10)",outline:"none"}}),i.jsxs("span",{className:"text-[11px] font-mono text-zinc-300",children:[c.length," tools"]})]}),i.jsxs("div",{className:"space-y-1",children:[c.map(o=>{const u=`${o.serverId}:${o.name}`,r=a===u;return i.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"rgba(255,255,255,0.07)"},children:[i.jsxs("button",{onClick:()=>s(r?null:u),className:"w-full flex items-center gap-3 px-3 py-2 hover:bg-white/[0.02] text-left transition-colors",children:[i.jsx("span",{className:"font-mono text-xs font-medium",style:{color:t.purple},children:o.name}),i.jsx("span",{className:"flex-1 truncate text-[11px] font-mono text-zinc-300",children:o.description}),i.jsx(dl,{variant:"gray",size:"xs",children:o.serverName}),i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:ge("text-zinc-700 transition-transform",r?"rotate-90":""),children:i.jsx("polyline",{points:"9 18 15 12 9 6"})})]}),r&&i.jsx("div",{className:"px-3 pb-3",children:i.jsx("pre",{className:"rounded-md p-2 text-[10px] font-mono text-zinc-400 overflow-x-auto",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.05)"},children:JSON.stringify(o.inputSchema,null,2)})})]},u)}),c.length===0&&l&&i.jsxs("p",{className:"text-center py-4 text-xs font-mono text-zinc-300",children:['No tools matching "',l,'"']})]})]})}function lp({record:e}){const t=H(),[l,n]=C.useState(!1),a=e.status==="completed"?t.success:e.status==="error"?t.error:t.warn;return i.jsxs("div",{className:"border-b cursor-pointer hover:bg-white/[0.01] transition-colors",style:{borderColor:"rgba(255,255,255,0.05)"},onClick:()=>n(s=>!s),children:[i.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[i.jsx("div",{className:"h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:a}}),i.jsx("span",{className:"font-mono text-[11px]",style:{color:t.purple},children:e.toolName}),i.jsx("span",{className:"text-[10px] font-mono text-zinc-300",children:e.serverName}),i.jsx("span",{className:"flex-1"}),e.durationMs!==void 0&&i.jsxs("span",{className:"font-mono text-[10px] text-zinc-300",children:[e.durationMs,"ms"]}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-700",children:new Date(e.timestamp).toLocaleTimeString("en",{hour12:!1})}),i.jsx(dl,{variant:e.status==="completed"?"green":e.status==="error"?"red":"yellow",size:"xs",children:e.status})]}),l&&i.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Input"}),i.jsx("pre",{className:"rounded p-2 text-[10px] font-mono text-zinc-400 overflow-x-auto",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.05)"},children:JSON.stringify(e.input,null,2)})]}),e.output!==void 0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Output"}),i.jsx("pre",{className:"rounded p-2 text-[10px] font-mono text-zinc-400 overflow-x-auto max-h-40",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.05)"},children:JSON.stringify(e.output,null,2)})]})]})]})}function np(){const{servers:e,callRecords:t,getServerList:l,getAllTools:n}=Gl(),a=H(),[s,c]=C.useState(null),o=l(),u=n(),r=s?t.filter(p=>p.serverId===s):t,h=t.length>0?(t.filter(p=>p.status==="error").length/t.length*100).toFixed(1):"0.0";return o.length===0?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:a.toolbarBg},children:i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"MCP Monitor"})}),i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),i.jsx("polyline",{points:"15 3 21 3 21 9"}),i.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),title:"No MCP servers connected",description:"MCP server data will appear when agents use tool servers"})]}):i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex w-72 flex-shrink-0 flex-col border-r overflow-y-auto",style:{borderColor:"rgba(255,255,255,0.08)"},children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:a.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"MCP Monitor"}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[o.filter(p=>p.status==="connected").length,"/",o.length," online"]})]}),i.jsx("div",{className:"p-3 space-y-2",children:i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Total Calls"}),i.jsx("p",{className:"font-mono text-lg font-semibold",style:{color:a.info},children:t.length})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Error Rate"}),i.jsxs("p",{className:"font-mono text-lg font-semibold",style:{color:parseFloat(h)>5?a.error:a.success},children:[h,"%"]})]})]})}),i.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[i.jsx("button",{onClick:()=>c(null),className:"w-full text-left rounded-md border px-3 py-2 text-xs font-mono transition-colors",style:s===null?{borderColor:`${a.running}4D`,background:`${a.running}0D`,color:a.running}:{borderColor:"rgba(255,255,255,0.08)",color:"#52525b"},children:"All Servers"}),o.map(p=>i.jsx(ep,{server:p,isSelected:s===p.id,onSelect:()=>c(s===p.id?null:p.id)},p.id))]})]}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsx("div",{className:"flex-1 overflow-y-auto border-b p-4",style:{borderColor:"rgba(255,255,255,0.08)"},children:i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Tool Registry",className:"mb-3"}),i.jsx(tp,{tools:s?u.filter(p=>p.serverId===s):u})]})}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b flex-shrink-0",style:{borderColor:"rgba(255,255,255,0.08)",background:a.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Call Trace"}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[r.length," calls"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:r.length===0?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-xs font-mono text-zinc-300",children:"No calls yet"})}):r.map(p=>i.jsx(lp,{record:p},p.id))})]})]})]})}function Wc(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),l=Math.floor(e%6e4/1e3);return l>0?`${t}m ${l}s`:`${t}m`}function nn(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ap({data:e,color:t}){const l=[{label:"Turns",value:String(e.turnCount)},{label:"Total Duration",value:Wc(e.totalDurationMs)},{label:"Avg Turn",value:Wc(e.avgTurnDurationMs)},{label:"Last Turn Stop",value:e.stopReason.replace("_"," ")},{label:"Model",value:e.model.replace("claude-","cl-")},{label:"Total Cost",value:`$${e.totalCostUsd.toFixed(8)}`},{label:"Input Tokens",value:nn(e.inputTokens)},{label:"Output Tokens",value:nn(e.outputTokens)},{label:"Cache Writes",value:nn(e.cacheWriteTokens)},{label:"Cache Reads",value:nn(e.cacheReadTokens)},{label:"Cache Saved",value:`$${e.cacheSavedUsd.toFixed(6)}`},{label:"Cache Hit Rate",value:`${e.cacheHitRate}%`}];return i.jsx("div",{className:"grid grid-cols-3 gap-2",children:l.map(({label:n,value:a})=>i.jsxs("div",{className:"rounded-md border px-3 py-2",style:{borderColor:"rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.3)"},children:[i.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest text-zinc-600",children:n}),i.jsx("div",{className:"mt-0.5 font-mono text-xs font-semibold",style:{color:t},children:a})]},n))})}function sp({toolBreakdown:e,topTools:t}){var s;const l=H(),n=t.length>0?t:Object.entries(e).sort((c,o)=>o[1]-c[1]).slice(0,10).map(([c,o])=>({name:c,count:o}));if(n.length===0)return i.jsx("div",{className:"text-xs text-zinc-600",children:"No tool calls recorded"});const a=((s=n[0])==null?void 0:s.count)??1;return i.jsx("div",{className:"space-y-1.5",children:n.map(({name:c,count:o})=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-24 shrink-0 truncate font-mono text-[11px] text-zinc-400",children:c}),i.jsxs("div",{className:"relative flex-1 h-4 rounded overflow-hidden",style:{background:"rgba(255,255,255,0.04)"},children:[i.jsx("div",{className:"absolute inset-y-0 left-0 rounded",style:{width:`${o/a*100}%`,background:`${l.info}44`}}),i.jsx("div",{className:"absolute inset-0 flex items-center px-1.5",style:{background:"transparent"},children:i.jsx("span",{className:"font-mono text-[10px]",style:{color:l.info},children:o})})]})]},c))})}function ip({files:e}){const t=H();return e.length===0?i.jsx("div",{className:"text-xs text-zinc-600",children:"No files recorded"}):i.jsx("div",{className:"space-y-0.5 max-h-48 overflow-y-auto",children:e.map((l,n)=>{const a=l.split("/"),s=a[a.length-1]??l,c=a.slice(0,-1).join("/");return i.jsxs("div",{className:"flex items-baseline gap-1.5 font-mono text-[11px]",children:[i.jsx("span",{style:{color:t.running},children:s}),c&&i.jsx("span",{className:"text-zinc-600 truncate",children:c})]},n)})})}function cp(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),n=C.useMemo(()=>{const s=(l?t.filter(c=>c.sessionId===l):t).find(c=>c.type==="session.summary");return s?s.payload:null},[t,l]);return n?i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsx("span",{className:"text-xs font-mono uppercase tracking-widest text-zinc-500",children:"Session Intelligence"}),i.jsxs("span",{className:"font-mono text-[10px]",style:{color:e.running},children:[n.turnCount," turns · ",Wc(n.totalDurationMs)]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Session Stats",className:"mb-3"}),i.jsx(ap,{data:n,color:e.running})]}),i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Tool Breakdown",subtitle:`${Object.values(n.toolBreakdown).reduce((a,s)=>a+s,0)} total calls`,className:"mb-3"}),i.jsx(sp,{toolBreakdown:n.toolBreakdown,topTools:n.topTools})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Files Touched",subtitle:`${n.filesModified.length} file${n.filesModified.length!==1?"s":""}`,className:"mb-3"}),i.jsx(ip,{files:n.filesModified})]}),i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Cache Efficiency",className:"mb-3"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("span",{className:"text-[10px] font-mono text-zinc-600",children:"Hit Rate"}),i.jsxs("span",{className:"text-[10px] font-mono",style:{color:e.running},children:[n.cacheHitRate,"%"]})]}),i.jsx("div",{className:"h-2 rounded overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded transition-all",style:{width:`${n.cacheHitRate}%`,background:e.running}})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-zinc-600",children:"Reads"}),i.jsx("div",{style:{color:e.info},children:nn(n.cacheReadTokens)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-zinc-600",children:"Writes"}),i.jsx("div",{style:{color:e.warn},children:nn(n.cacheWriteTokens)})]}),i.jsxs("div",{className:"col-span-2",children:[i.jsx("div",{className:"text-zinc-600",children:"Saved"}),i.jsxs("div",{style:{color:e.running},children:["$",n.cacheSavedUsd.toFixed(6)]})]})]})]})]})]})]})]}):i.jsx(We,{icon:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),title:"No Session Summary Yet",description:"Session intelligence is generated when a Claude Code session ends (Stop hook). Start and complete a Claude Code session to see analytics here."})}function op({cmd:e,index:t}){const l=H(),[n,a]=C.useState(!1),s=e.exitCode===0||e.exitCode===null,c=e.exitCode===null?"#52525b":e.exitCode===0?l.running:l.error,o=e.command.split(`
|
|
45
|
-
`),u=o[0]??"",r=o.length>1,h=n?e.command:u;return i.jsx("div",{className:"border-b transition-colors duration-100 hover:bg-white/[0.02]",style:{borderColor:"rgba(255,255,255,0.05)"},children:i.jsxs("div",{className:"flex items-start gap-3 px-4 py-2 cursor-pointer",onClick:()=>r&&a(p=>!p),children:[i.jsx("span",{className:"shrink-0 mt-0.5 w-6 text-right font-mono text-[10px] text-zinc-700 select-none",children:t+1}),i.jsx("div",{className:"shrink-0 mt-0.5 w-6 h-4 rounded text-[9px] font-mono font-bold flex items-center justify-center",style:{background:`${c}22`,color:c,border:`1px solid ${c}44`},children:e.exitCode??"?"}),i.jsxs("pre",{className:"flex-1 font-mono text-[11px] whitespace-pre-wrap break-all leading-relaxed",style:{color:s?"#d4d4d8":l.error},children:[h,r&&!n&&i.jsxs("span",{className:"ml-1 text-zinc-600 text-[10px]",children:["…",o.length-1," more line",o.length>2?"s":""]})]}),e.durationMs!==void 0&&i.jsx("span",{className:"shrink-0 font-mono text-[10px] text-zinc-600 mt-0.5",children:e.durationMs<1e3?`${e.durationMs}ms`:`${(e.durationMs/1e3).toFixed(1)}s`})]})})}function
|
|
43
|
+
`),a=[],s=new Set(l),c=new Set(n);for(const o of l)c.has(o)||a.push({type:"removed",content:o});for(const o of n)s.has(o)?a.push({type:"unchanged",content:o}):a.push({type:"added",content:o});return a.slice(0,50)}function Px({checkpoint:e,isSelected:t,onSelect:l}){const n=H();return i.jsx("button",{onClick:l,className:ge("w-full text-left px-4 py-3 border-b transition-colors duration-100","hover:bg-white/[0.02]",t?"bg-white/[0.03]":""),style:{borderColor:"rgba(255,255,255,0.05)"},children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"mt-1 flex h-6 w-6 flex-shrink-0 items-center justify-center rounded",style:{background:`${n.info}1A`,border:`1px solid ${n.info}33`},children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:n.info,strokeWidth:"2",children:i.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("span",{className:"font-mono text-sm font-medium text-zinc-300 truncate",children:e.label})}),i.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-[11px] text-zinc-300",children:e.agentName}),i.jsx("span",{className:"text-zinc-700",children:"·"}),i.jsx("span",{className:"font-mono text-[11px] text-zinc-300",children:ot(new Date(e.timestamp),"HH:mm:ss")}),i.jsx("span",{className:"text-zinc-700",children:"·"}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[e.conversationHistory.length," messages"]}),e.fileSnapshots.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-zinc-700",children:"·"}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[e.fileSnapshots.length," files"]})]})]})]}),t&&i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:n.info,strokeWidth:"2",className:"flex-shrink-0 mt-1",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})})]})})}function ep({checkpoint:e,prevCheckpoint:t}){const l=H(),[n,a]=C.useState("history"),s=[{id:"history",label:"Conversation"},{id:"state",label:"Agent State"},{id:"files",label:`Files (${e.fileSnapshots.length})`},...t?[{id:"diff",label:"Diff"}]:[]];return i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between px-4 py-3 border-b",style:{borderColor:"rgba(255,255,255,0.08)"},children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-mono text-sm font-semibold text-zinc-300",children:e.label}),i.jsxs("p",{className:"font-mono text-[11px] text-zinc-300 mt-0.5",children:[e.agentName," — ",ot(new Date(e.timestamp),"MMM d, HH:mm:ss")]})]}),i.jsx(T0,{content:"Restore — coming soon",side:"left",children:i.jsx("button",{disabled:!0,className:"h-8 rounded border px-3 text-xs font-mono text-zinc-300 cursor-not-allowed opacity-40",style:{borderColor:"rgba(255,255,255,0.08)"},children:"Restore"})})]}),i.jsx("div",{className:"flex flex-shrink-0 gap-1 border-b px-4 pt-2",style:{borderColor:"rgba(255,255,255,0.08)"},children:s.map(c=>i.jsx("button",{onClick:()=>a(c.id),className:"px-3 py-1.5 font-mono text-[11px] border-b-2 transition-colors",style:n===c.id?{borderColor:l.running,color:l.running}:{borderColor:"transparent",color:"#52525b"},children:c.label},c.id))}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[n==="history"&&i.jsx("div",{className:"space-y-3",children:e.conversationHistory.map((c,o)=>i.jsxs("div",{className:ge("flex gap-3",c.role==="assistant"?"flex-row-reverse":""),children:[i.jsx("div",{className:"flex-shrink-0 h-6 w-6 rounded-full flex items-center justify-center text-[10px] font-mono font-bold",style:{background:c.role==="assistant"?`${l.running}1E`:`${l.info}1E`,border:`1px solid ${c.role==="assistant"?l.running:l.info}33`,color:c.role==="assistant"?l.running:l.info},children:c.role==="assistant"?"A":"U"}),i.jsx("div",{className:"flex-1 rounded-lg px-3 py-2 text-xs font-mono text-zinc-300 max-w-[80%]",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:i.jsx("p",{className:"whitespace-pre-wrap break-words",children:typeof c.content=="string"?c.content.length>500?c.content.slice(0,500)+"…":c.content:JSON.stringify(c.content)})})]},o))}),n==="state"&&i.jsx("pre",{className:"rounded-md p-3 text-[11px] font-mono text-zinc-300 overflow-x-auto",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.06)"},children:JSON.stringify(e.agentState,null,2)}),n==="files"&&i.jsx("div",{className:"space-y-3",children:e.fileSnapshots.length===0?i.jsx("p",{className:"text-xs font-mono text-zinc-300",children:"No file snapshots in this checkpoint"}):e.fileSnapshots.map((c,o)=>{var u;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[i.jsx(dl,{variant:"blue",size:"xs",children:((u=c.path.split(".").pop())==null?void 0:u.toUpperCase())??"FILE"}),i.jsx("span",{className:"font-mono text-[11px] text-zinc-400",children:c.path})]}),i.jsx("pre",{className:"rounded-md p-3 text-[11px] font-mono text-zinc-300 overflow-x-auto max-h-64",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.06)"},children:c.content.length>2e3?c.content.slice(0,2e3)+`
|
|
44
|
+
…`:c.content})]},o)})}),n==="diff"&&t&&i.jsx("div",{className:"space-y-3",children:i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"State Diff",className:"mb-2"}),i.jsx("div",{className:"font-mono text-[11px]",children:Ix(JSON.stringify(t.agentState,null,2),JSON.stringify(e.agentState,null,2)).map((c,o)=>i.jsxs("div",{className:"px-2 py-0.5",style:{background:c.type==="added"?`${l.success}0D`:c.type==="removed"?`${l.error}0D`:"transparent",color:c.type==="added"?l.success:c.type==="removed"?l.error:"#52525b"},children:[i.jsx("span",{className:"select-none mr-2",children:c.type==="added"?"+":c.type==="removed"?"-":" "}),c.content]},o))})]})})]})]})}function tp(){const{checkpoints:e,selectedCheckpointId:t,selectCheckpoint:l,getPreviousCheckpoint:n}=Wo(),{activeSessionId:a}=ce(),s=H(),c=a?e.filter(r=>r.sessionId===a).sort((r,h)=>h.timestamp-r.timestamp):[...e].sort((r,h)=>h.timestamp-r.timestamp),o=t?e.find(r=>r.id===t):null,u=t?n(t):void 0;return i.jsxs("div",{className:"flex h-full",children:[i.jsxs("div",{className:"flex w-72 flex-shrink-0 flex-col border-r",style:{borderColor:"rgba(255,255,255,0.08)"},children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:s.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Checkpoints"}),i.jsx("span",{className:"font-mono text-[11px] text-zinc-300",children:c.length})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:c.length===0?i.jsx(We,{icon:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"})}),title:"No checkpoints yet",description:"Use ctx.checkpoint() in your agent to create checkpoints"}):c.map(r=>i.jsx(Px,{checkpoint:r,isSelected:t===r.id,onSelect:()=>l(r.id)},r.id))})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o?i.jsx(ep,{checkpoint:o,prevCheckpoint:u}):i.jsx(We,{title:"Select a checkpoint",description:"Click a checkpoint on the left to inspect it"})})]})}const Gl=ml((e,t)=>({servers:new Map,callRecords:[],upsertServer:l=>{e(n=>{const a=new Map(n.servers);return a.set(l.id,l),{servers:a}})},setServerStatus:(l,n)=>{e(a=>{const s=new Map(a.servers),c=s.get(l);return c?(s.set(l,{...c,status:n}),{servers:s}):{}})},updateHeartbeat:(l,n)=>{e(a=>{const s=new Map(a.servers),c=s.get(l);return c?(s.set(l,{...c,lastHeartbeat:n}),{servers:s}):{}})},addCallRecord:l=>{e(n=>({callRecords:[l,...n.callRecords].slice(0,500)})),e(n=>{const a=new Map(n.servers),s=a.get(l.serverId);return s?(a.set(l.serverId,{...s,callCount:s.callCount+1}),{servers:a}):{}})},updateCallRecord:(l,n)=>{e(a=>{const s=a.callRecords.findIndex(u=>u.callId===l);if(s<0)return{};const c=[...a.callRecords],o=c[s];if(!o)return{};if(c[s]={...o,...n},n.isError&&n.serverId){const u=new Map(a.servers),r=u.get(n.serverId);if(r)return u.set(n.serverId,{...r,errorCount:r.errorCount+1}),{callRecords:c,servers:u}}return{callRecords:c}})},getServerList:()=>Array.from(t().servers.values()),getAllTools:()=>{const l=[];for(const n of t().servers.values())for(const a of n.tools)l.push({...a,serverName:n.name,serverId:n.id});return l}}));function lp({server:e,isSelected:t,onSelect:l}){const n=H(),a=e.status==="connected";return i.jsxs("button",{onClick:l,className:"w-full text-left rounded-lg border p-3 transition-all duration-150",style:t?{borderColor:`${n.running}4D`,background:`${n.running}0D`}:{borderColor:"rgba(255,255,255,0.08)",background:"rgba(24,24,27,0.8)"},children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("div",{className:"h-2 w-2 rounded-full flex-shrink-0",style:{background:a?n.success:"#52525b",boxShadow:a?`0 0 6px ${n.success}`:"none"}}),i.jsx("span",{className:"font-mono text-sm font-medium text-zinc-300 truncate flex-1",children:e.name}),i.jsx(dl,{variant:a?"green":"gray",size:"xs",children:e.status})]}),i.jsxs("div",{className:"flex items-center gap-3 text-[11px] font-mono text-zinc-300",children:[i.jsxs("span",{children:[e.tools.length," tools"]}),i.jsx("span",{children:"·"}),i.jsxs("span",{children:[e.callCount," calls"]}),e.errorCount>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsxs("span",{style:{color:n.error},children:[e.errorCount," errors"]})]}),e.lastHeartbeat&&i.jsxs(i.Fragment,{children:[i.jsx("span",{children:"·"}),i.jsx("span",{children:H0(new Date(e.lastHeartbeat),{addSuffix:!0})})]})]})]})}function np({tools:e}){const t=H(),[l,n]=C.useState(""),[a,s]=C.useState(null),c=e.filter(o=>o.name.toLowerCase().includes(l.toLowerCase())||o.description.toLowerCase().includes(l.toLowerCase()));return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",placeholder:"Search tools…",value:l,onChange:o=>n(o.target.value),className:"h-7 flex-1 rounded border bg-zinc-900/80 px-2.5 text-[11px] font-mono text-zinc-300 placeholder-zinc-700",style:{borderColor:"rgba(255,255,255,0.10)",outline:"none"}}),i.jsxs("span",{className:"text-[11px] font-mono text-zinc-300",children:[c.length," tools"]})]}),i.jsxs("div",{className:"space-y-1",children:[c.map(o=>{const u=`${o.serverId}:${o.name}`,r=a===u;return i.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"rgba(255,255,255,0.07)"},children:[i.jsxs("button",{onClick:()=>s(r?null:u),className:"w-full flex items-center gap-3 px-3 py-2 hover:bg-white/[0.02] text-left transition-colors",children:[i.jsx("span",{className:"font-mono text-xs font-medium",style:{color:t.purple},children:o.name}),i.jsx("span",{className:"flex-1 truncate text-[11px] font-mono text-zinc-300",children:o.description}),i.jsx(dl,{variant:"gray",size:"xs",children:o.serverName}),i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:ge("text-zinc-700 transition-transform",r?"rotate-90":""),children:i.jsx("polyline",{points:"9 18 15 12 9 6"})})]}),r&&i.jsx("div",{className:"px-3 pb-3",children:i.jsx("pre",{className:"rounded-md p-2 text-[10px] font-mono text-zinc-400 overflow-x-auto",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.05)"},children:JSON.stringify(o.inputSchema,null,2)})})]},u)}),c.length===0&&l&&i.jsxs("p",{className:"text-center py-4 text-xs font-mono text-zinc-300",children:['No tools matching "',l,'"']})]})]})}function ap({record:e}){const t=H(),[l,n]=C.useState(!1),a=e.status==="completed"?t.success:e.status==="error"?t.error:t.warn;return i.jsxs("div",{className:"border-b cursor-pointer hover:bg-white/[0.01] transition-colors",style:{borderColor:"rgba(255,255,255,0.05)"},onClick:()=>n(s=>!s),children:[i.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[i.jsx("div",{className:"h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:a}}),i.jsx("span",{className:"font-mono text-[11px]",style:{color:t.purple},children:e.toolName}),i.jsx("span",{className:"text-[10px] font-mono text-zinc-300",children:e.serverName}),i.jsx("span",{className:"flex-1"}),e.durationMs!==void 0&&i.jsxs("span",{className:"font-mono text-[10px] text-zinc-300",children:[e.durationMs,"ms"]}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-700",children:new Date(e.timestamp).toLocaleTimeString("en",{hour12:!1})}),i.jsx(dl,{variant:e.status==="completed"?"green":e.status==="error"?"red":"yellow",size:"xs",children:e.status})]}),l&&i.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Input"}),i.jsx("pre",{className:"rounded p-2 text-[10px] font-mono text-zinc-400 overflow-x-auto",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.05)"},children:JSON.stringify(e.input,null,2)})]}),e.output!==void 0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Output"}),i.jsx("pre",{className:"rounded p-2 text-[10px] font-mono text-zinc-400 overflow-x-auto max-h-40",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.05)"},children:JSON.stringify(e.output,null,2)})]})]})]})}function sp(){const{servers:e,callRecords:t,getServerList:l,getAllTools:n}=Gl(),a=H(),[s,c]=C.useState(null),o=l(),u=n(),r=s?t.filter(p=>p.serverId===s):t,h=t.length>0?(t.filter(p=>p.status==="error").length/t.length*100).toFixed(1):"0.0";return o.length===0?i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:a.toolbarBg},children:i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"MCP Monitor"})}),i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),i.jsx("polyline",{points:"15 3 21 3 21 9"}),i.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),title:"No MCP servers connected",description:"MCP server data will appear when agents use tool servers"})]}):i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex w-72 flex-shrink-0 flex-col border-r overflow-y-auto",style:{borderColor:"rgba(255,255,255,0.08)"},children:[i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-3 border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.08)",background:a.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"MCP Monitor"}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[o.filter(p=>p.status==="connected").length,"/",o.length," online"]})]}),i.jsx("div",{className:"p-3 space-y-2",children:i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Total Calls"}),i.jsx("p",{className:"font-mono text-lg font-semibold",style:{color:a.info},children:t.length})]}),i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx("p",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-700 mb-1",children:"Error Rate"}),i.jsxs("p",{className:"font-mono text-lg font-semibold",style:{color:parseFloat(h)>5?a.error:a.success},children:[h,"%"]})]})]})}),i.jsxs("div",{className:"px-3 pb-3 space-y-2",children:[i.jsx("button",{onClick:()=>c(null),className:"w-full text-left rounded-md border px-3 py-2 text-xs font-mono transition-colors",style:s===null?{borderColor:`${a.running}4D`,background:`${a.running}0D`,color:a.running}:{borderColor:"rgba(255,255,255,0.08)",color:"#52525b"},children:"All Servers"}),o.map(p=>i.jsx(lp,{server:p,isSelected:s===p.id,onSelect:()=>c(s===p.id?null:p.id)},p.id))]})]}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsx("div",{className:"flex-1 overflow-y-auto border-b p-4",style:{borderColor:"rgba(255,255,255,0.08)"},children:i.jsxs(Ee,{glass:!0,padding:"sm",children:[i.jsx(st,{title:"Tool Registry",className:"mb-3"}),i.jsx(np,{tools:s?u.filter(p=>p.serverId===s):u})]})}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b flex-shrink-0",style:{borderColor:"rgba(255,255,255,0.08)",background:a.toolbarBg},children:[i.jsx("span",{className:"text-[11px] font-mono uppercase tracking-widest text-zinc-300",children:"Call Trace"}),i.jsxs("span",{className:"font-mono text-[11px] text-zinc-300",children:[r.length," calls"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:r.length===0?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-xs font-mono text-zinc-300",children:"No calls yet"})}):r.map(p=>i.jsx(ap,{record:p},p.id))})]})]})]})}function Ic(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),l=Math.floor(e%6e4/1e3);return l>0?`${t}m ${l}s`:`${t}m`}function an(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ip({data:e,color:t}){const l=[{label:"Turns",value:String(e.turnCount)},{label:"Total Duration",value:Ic(e.totalDurationMs)},{label:"Avg Turn",value:Ic(e.avgTurnDurationMs)},{label:"Last Turn Stop",value:e.stopReason.replace("_"," ")},{label:"Model",value:e.model.replace("claude-","cl-")},{label:"Total Cost",value:`$${e.totalCostUsd.toFixed(8)}`},{label:"Input Tokens",value:an(e.inputTokens)},{label:"Output Tokens",value:an(e.outputTokens)},{label:"Cache Writes",value:an(e.cacheWriteTokens)},{label:"Cache Reads",value:an(e.cacheReadTokens)},{label:"Cache Saved",value:`$${e.cacheSavedUsd.toFixed(6)}`},{label:"Cache Hit Rate",value:`${e.cacheHitRate}%`}];return i.jsx("div",{className:"grid grid-cols-3 gap-2",children:l.map(({label:n,value:a})=>i.jsxs("div",{className:"rounded-md border px-3 py-2",style:{borderColor:"rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.3)"},children:[i.jsx("div",{className:"text-[9px] font-mono uppercase tracking-widest text-zinc-600",children:n}),i.jsx("div",{className:"mt-0.5 font-mono text-xs font-semibold",style:{color:t},children:a})]},n))})}function cp({toolBreakdown:e,topTools:t}){var s;const l=H(),n=t.length>0?t:Object.entries(e).sort((c,o)=>o[1]-c[1]).slice(0,10).map(([c,o])=>({name:c,count:o}));if(n.length===0)return i.jsx("div",{className:"text-xs text-zinc-600",children:"No tool calls recorded"});const a=((s=n[0])==null?void 0:s.count)??1;return i.jsx("div",{className:"space-y-1.5",children:n.map(({name:c,count:o})=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-24 shrink-0 truncate font-mono text-[11px] text-zinc-400",children:c}),i.jsxs("div",{className:"relative flex-1 h-4 rounded overflow-hidden",style:{background:"rgba(255,255,255,0.04)"},children:[i.jsx("div",{className:"absolute inset-y-0 left-0 rounded",style:{width:`${o/a*100}%`,background:`${l.info}44`}}),i.jsx("div",{className:"absolute inset-0 flex items-center px-1.5",style:{background:"transparent"},children:i.jsx("span",{className:"font-mono text-[10px]",style:{color:l.info},children:o})})]})]},c))})}function op({files:e}){const t=H();return e.length===0?i.jsx("div",{className:"text-xs text-zinc-600",children:"No files recorded"}):i.jsx("div",{className:"space-y-0.5 max-h-48 overflow-y-auto",children:e.map((l,n)=>{const a=l.split("/"),s=a[a.length-1]??l,c=a.slice(0,-1).join("/");return i.jsxs("div",{className:"flex items-baseline gap-1.5 font-mono text-[11px]",children:[i.jsx("span",{style:{color:t.running},children:s}),c&&i.jsx("span",{className:"text-zinc-600 truncate",children:c})]},n)})})}function up(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),n=C.useMemo(()=>{const s=(l?t.filter(c=>c.sessionId===l):t).find(c=>c.type==="session.summary");return s?s.payload:null},[t,l]);return n?i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b px-4 py-2.5",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsx("span",{className:"text-xs font-mono uppercase tracking-widest text-zinc-500",children:"Session Intelligence"}),i.jsxs("span",{className:"font-mono text-[10px]",style:{color:e.running},children:[n.turnCount," turns · ",Ic(n.totalDurationMs)]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Session Stats",className:"mb-3"}),i.jsx(ip,{data:n,color:e.running})]}),i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Tool Breakdown",subtitle:`${Object.values(n.toolBreakdown).reduce((a,s)=>a+s,0)} total calls`,className:"mb-3"}),i.jsx(cp,{toolBreakdown:n.toolBreakdown,topTools:n.topTools})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Files Touched",subtitle:`${n.filesModified.length} file${n.filesModified.length!==1?"s":""}`,className:"mb-3"}),i.jsx(op,{files:n.filesModified})]}),i.jsxs(Ee,{padding:"sm",children:[i.jsx(st,{title:"Cache Efficiency",className:"mb-3"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between mb-1",children:[i.jsx("span",{className:"text-[10px] font-mono text-zinc-600",children:"Hit Rate"}),i.jsxs("span",{className:"text-[10px] font-mono",style:{color:e.running},children:[n.cacheHitRate,"%"]})]}),i.jsx("div",{className:"h-2 rounded overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded transition-all",style:{width:`${n.cacheHitRate}%`,background:e.running}})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-zinc-600",children:"Reads"}),i.jsx("div",{style:{color:e.info},children:an(n.cacheReadTokens)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-zinc-600",children:"Writes"}),i.jsx("div",{style:{color:e.warn},children:an(n.cacheWriteTokens)})]}),i.jsxs("div",{className:"col-span-2",children:[i.jsx("div",{className:"text-zinc-600",children:"Saved"}),i.jsxs("div",{style:{color:e.running},children:["$",n.cacheSavedUsd.toFixed(6)]})]})]})]})]})]})]})]}):i.jsx(We,{icon:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),title:"No Session Summary Yet",description:"Session intelligence is generated when a Claude Code session ends (Stop hook). Start and complete a Claude Code session to see analytics here."})}function rp({cmd:e,index:t}){const l=H(),[n,a]=C.useState(!1),s=e.exitCode===0||e.exitCode===null,c=e.exitCode===null?"#52525b":e.exitCode===0?l.running:l.error,o=e.command.split(`
|
|
45
|
+
`),u=o[0]??"",r=o.length>1,h=n?e.command:u;return i.jsx("div",{className:"border-b transition-colors duration-100 hover:bg-white/[0.02]",style:{borderColor:"rgba(255,255,255,0.05)"},children:i.jsxs("div",{className:"flex items-start gap-3 px-4 py-2 cursor-pointer",onClick:()=>r&&a(p=>!p),children:[i.jsx("span",{className:"shrink-0 mt-0.5 w-6 text-right font-mono text-[10px] text-zinc-700 select-none",children:t+1}),i.jsx("div",{className:"shrink-0 mt-0.5 w-6 h-4 rounded text-[9px] font-mono font-bold flex items-center justify-center",style:{background:`${c}22`,color:c,border:`1px solid ${c}44`},children:e.exitCode??"?"}),i.jsxs("pre",{className:"flex-1 font-mono text-[11px] whitespace-pre-wrap break-all leading-relaxed",style:{color:s?"#d4d4d8":l.error},children:[h,r&&!n&&i.jsxs("span",{className:"ml-1 text-zinc-600 text-[10px]",children:["…",o.length-1," more line",o.length>2?"s":""]})]}),e.durationMs!==void 0&&i.jsx("span",{className:"shrink-0 font-mono text-[10px] text-zinc-600 mt-0.5",children:e.durationMs<1e3?`${e.durationMs}ms`:`${(e.durationMs/1e3).toFixed(1)}s`})]})})}function fp(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),[n,a]=C.useState(""),[s,c]=C.useState(!1),o=C.useMemo(()=>{const p=(l?t.filter(g=>g.sessionId===l):t).find(g=>g.type==="session.summary");return p?p.payload.bashCommands??[]:[]},[t,l]),u=C.useMemo(()=>o.filter(h=>!(s&&h.exitCode!==null&&h.exitCode===0||n&&!h.command.toLowerCase().includes(n.toLowerCase()))),[o,n,s]),r=o.filter(h=>h.exitCode!==null&&h.exitCode!==0).length;return o.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"4 17 10 11 4 5"}),i.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),title:"No Bash Commands",description:"Bash commands are captured when a Claude Code session ends. Complete a session that uses the Bash tool to see commands here."}):i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b px-4 py-2",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsx("span",{className:"text-xs font-mono uppercase tracking-widest text-zinc-500",children:"Bash Inspector"}),i.jsxs("span",{className:"font-mono text-[10px] text-zinc-600",children:[o.length," commands",r>0&&i.jsxs("span",{style:{color:e.error},children:[" · ",r," errors"]})]}),i.jsx("div",{className:"flex-1"}),i.jsx("button",{onClick:()=>c(h=>!h),className:"flex items-center gap-1.5 rounded px-2 py-1 font-mono text-[10px] transition-colors",style:{background:s?`${e.error}22`:"rgba(255,255,255,0.04)",color:s?e.error:"#71717a",border:`1px solid ${s?`${e.error}44`:"rgba(255,255,255,0.08)"}`},children:"Errors Only"}),i.jsx("input",{type:"text",value:n,onChange:h=>a(h.target.value),placeholder:"filter commands...",className:"rounded border bg-transparent px-2 py-1 font-mono text-[11px] text-zinc-300 outline-none placeholder:text-zinc-700 focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:180}})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b px-4 py-1",style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsx("div",{className:"w-6"}),i.jsx("div",{className:"w-6 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"exit"}),i.jsx("div",{className:"flex-1 text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"command"}),i.jsx("div",{className:"w-12 text-right text-[9px] font-mono uppercase tracking-widest text-zinc-700",children:"dur"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:u.length===0?i.jsx("div",{className:"flex items-center justify-center h-24 text-xs text-zinc-600 font-mono",children:"no matching commands"}):u.map((h,p)=>i.jsx(rp,{cmd:h,index:p},p))})]})}const Xl=3,dp=Xl*24*60*60*1e3;function Pc(){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:i.jsx("path",{d:"M2 3h8M5 3V2h2v1M4 3v6.5a.5.5 0 00.5.5h3a.5.5 0 00.5-.5V3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function mp(){return i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:i.jsx("path",{d:"M7.5 1.5L9 3M9 3l-5 5-2 .5.5-2 5-5L9 3zM3 8l1 1",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Qs(){return i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"animate-spin",children:i.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"14 8"})})}function hp(e,t){return[...e].sort((l,n)=>{switch(t){case"cost":return n.totalCostUsd-l.totalCostUsd;case"duration":{const a=l.endedAt?l.endedAt-l.startedAt:1/0;return(n.endedAt?n.endedAt-n.startedAt:1/0)-a}case"name":return l.name.localeCompare(n.name);case"date":default:return n.startedAt-l.startedAt}})}function xp(e,t){if(!t)return"live";try{return Er(new Date(e),new Date(t))}catch{return"—"}}function pp(e){return e===0?"—":e<.01?`$${e.toFixed(6)}`:`$${e.toFixed(4)}`}function gp({session:e,costUsd:t,isActive:l,meta:n,onSelect:a,onDelete:s,onPurge:c,deleting:o,purging:u}){const r=H(),h=nn(e),p=xp(e.startedAt,e.endedAt);return i.jsxs("div",{onClick:a,className:ge("flex items-center gap-4 border-b px-5 py-3 cursor-pointer transition-colors",l?"bg-white/[0.04]":"hover:bg-white/[0.02]"),style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsx("div",{className:"h-1.5 w-1.5 rounded-full flex-shrink-0",style:{background:l?r.running:"transparent",border:l?"none":"1px solid rgba(255,255,255,0.12)"}}),i.jsxs("div",{className:"w-48 flex-shrink-0 min-w-0",children:[i.jsx("div",{className:"font-mono text-[12px] text-zinc-200 truncate",children:e.name}),i.jsx("div",{className:"font-mono text-[10px] text-zinc-600 mt-0.5",children:ot(new Date(e.startedAt),"MMM d, HH:mm")})]}),i.jsx("div",{className:"w-14 flex-shrink-0",children:i.jsx("span",{className:"font-mono text-[9px] px-1.5 py-0.5 rounded",style:h?{background:`${r.running}1A`,color:r.running,border:`1px solid ${r.running}33`}:{background:"rgba(255,255,255,0.04)",color:"#52525b",border:"1px solid rgba(255,255,255,0.08)"},children:h?"live":"ended"})}),i.jsx("div",{className:"w-24 flex-shrink-0 font-mono text-[11px]",style:{color:h?r.running:"#71717a"},children:p}),i.jsx("div",{className:"w-24 flex-shrink-0 font-mono text-[12px]",style:{color:t>0?r.running:"#3f3f46"},children:pp(t)}),i.jsx("div",{className:"w-14 flex-shrink-0 font-mono text-[11px]",style:{color:n.turnCount?r.info:"#3f3f46"},children:n.turnCount!==null?`${n.turnCount}t`:"—"}),i.jsx("div",{className:"w-14 flex-shrink-0 font-mono text-[11px]",style:{color:n.cacheHitRate!==null?r.warn:"#3f3f46"},children:n.cacheHitRate!==null?`${n.cacheHitRate}%`:"—"}),i.jsx("div",{className:"flex-1 flex flex-wrap gap-1 min-w-0",children:n.topTools.slice(0,5).map(m=>i.jsx("span",{className:"font-mono text-[9px] px-1 py-0.5 rounded",style:{background:"rgba(255,255,255,0.04)",color:"#71717a",border:"1px solid rgba(255,255,255,0.06)"},children:m},m))}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i.jsx("button",{onClick:c,disabled:u,title:"Purge tool calls for this session (reclaims storage; tombstone retained)",className:"flex h-6 w-6 items-center justify-center rounded transition-colors disabled:opacity-40",style:{color:r.warn,background:`${r.warn}14`,border:`1px solid ${r.warn}33`},children:u?i.jsx(Qs,{}):i.jsx(mp,{})}),i.jsx("button",{onClick:s,disabled:o,title:"Delete session",className:"flex h-6 w-6 items-center justify-center rounded transition-colors disabled:opacity-40",style:{color:r.error,background:`${r.error}14`,border:`1px solid ${r.error}33`},children:o?i.jsx(Qs,{}):i.jsx(Pc,{})})]})]})}function yp(e){return{turnCount:e.turnCount,topTools:(e.topTools??[]).slice(0,5).map(t=>t.name),cacheHitRate:e.cacheHitRate}}function vp(){const{sessions:e,activeSessionId:t,setActiveSession:l,removeSession:n}=ce(),{events:a}=Le(),s=fi(k=>k.summaries),{collectorUrl:c}=Oa(),o=H(),[u,r]=C.useState(""),[h,p]=C.useState("date"),[m,g]=C.useState(null),[y,j]=C.useState(null),[b,f]=C.useState(!1),[d,x]=C.useState(!1),v=c.replace(/^ws/,"http").replace(/\/ws$/,""),S=Date.now(),z=k=>S-(k.lastActivityAt??k.startedAt)>=dp,N=e.filter(z).length;async function M(k,O){O.stopPropagation();const $=`${k.name} — ${ot(new Date(k.startedAt),"MMM d, HH:mm:ss")}`;if(confirm(`Delete session "${$}"? This cannot be undone.`)){g(k.id);try{const we=await fetch(`${v}/api/sessions/${k.id}`,{method:"DELETE"});if(!we.ok)throw new Error(`HTTP ${we.status}`);n(k.id)}catch(we){alert(`Failed to delete: ${we instanceof Error?we.message:String(we)}`)}finally{g(null)}}}async function A(k,O){if(O.stopPropagation(),!!confirm(`Purge tool calls for "${k.name}"?
|
|
46
46
|
|
|
47
47
|
This deletes tool call events and their inputs/outputs, but keeps the rest of the session intact. A tombstone event records the count and reclaimed bytes.`)){j(k.id);try{const $=await fetch(`${v}/api/sessions/${k.id}/purge-tool-calls`,{method:"POST"});if(!$.ok)throw new Error(`HTTP ${$.status}`);const we=await $.json(),Lt=(we.reclaimedBytes/1024).toFixed(1);alert(`Purged ${we.eventsPurged} tool calls (${Lt} KB reclaimed).`)}catch($){alert(`Failed to purge tool calls: ${$ instanceof Error?$.message:String($)}`)}finally{j(null)}}}async function D(){if(N===0){alert(`No sessions have been idle for ${Xl}+ days.`);return}if(confirm(`Delete ${N} session${N===1?"":"s"} with no activity in ${Xl}+ days?
|
|
48
48
|
|
|
49
49
|
This cannot be undone.`)){f(!0);try{const k=await fetch(`${v}/api/sessions/stale?idleDays=${Xl}`,{method:"DELETE"});if(!k.ok)throw new Error(`HTTP ${k.status}`);const O=await k.json();for(const $ of O.deletedIds)n($);alert(`Deleted ${O.count} stale session${O.count===1?"":"s"}.`)}catch(k){alert(`Failed to clean stale sessions: ${k instanceof Error?k.message:String(k)}`)}finally{f(!1)}}}async function X(){const k=e.length;if(k===0){alert("Database is already empty.");return}if(confirm(`Delete ALL ${k} session${k===1?"":"s"} and reset the database?
|
|
50
50
|
|
|
51
|
-
Every event, agent, tool call, and checkpoint will be permanently erased. This cannot be undone.`)&&confirm(`Really wipe all ${k} session${k===1?"":"s"}? Last chance.`)){x(!0);try{const O=await fetch(`${v}/api/sessions`,{method:"DELETE"});if(!O.ok)throw new Error(`HTTP ${O.status}`);window.location.reload()}catch(O){alert(`Failed to reset database: ${O instanceof Error?O.message:String(O)}`),x(!1)}}}const te=C.useMemo(()=>{const k=new Map;for(const O of a){if(O.type!=="cost.update")continue;const $=O.payload.totalCostUsd??0;k.set(O.sessionId,(k.get(O.sessionId)??0)+$)}return k},[a]),E=k=>te.get(k.id)??k.totalCostUsd,_=C.useMemo(()=>{const k=u.toLowerCase().trim(),O=k?e.filter($=>$.name.toLowerCase().includes(k)||$.id.toLowerCase().includes(k)):e;return
|
|
52
|
-
`)[0])==null?void 0:s.slice(0,80))??"";const l=e.file_path??e.path;if(l)return l;const n=e.pattern;return n||Object.keys(e).slice(0,2).map(c=>{var o;return`${c}: ${(o=JSON.stringify(e[c]))==null?void 0:o.slice(0,30)}`}).join(" ")}const vp={Bash:"#FFAA00",Read:"#00BBFF",Write:"#00FF88",Edit:"#BB88FF",MultiEdit:"#BB88FF",Glob:"#00BBFF",Grep:"#00BBFF",Task:"#FF8844",WebFetch:"#FF3366",WebSearch:"#FF3366",TodoWrite:"#44FFBB",TodoRead:"#44FFBB"};function fi(e,t){return vp[e]??t}function Nr({data:e,label:t}){const l=H(),[n,a]=C.useState(!1),s=JSON.stringify(e,null,2);return i.jsxs("div",{className:"mt-3",children:[i.jsxs("button",{className:"flex items-center gap-1.5 mb-1",onClick:()=>a(c=>!c),children:[i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest",style:{color:"#52525b"},children:t}),i.jsx("span",{className:"font-mono text-[9px]",style:{color:"#52525b"},children:n?"▶":"▼"})]}),!n&&i.jsx("pre",{className:"rounded p-2.5 font-mono text-[10px] leading-relaxed overflow-x-auto whitespace-pre-wrap break-all",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.07)",color:l.info},children:s})]})}function bp({call:e,onClose:t}){const l=H(),n=fi(e.toolName,l.info),a=e.status==="error"?l.error:e.status==="complete"?l.running:l.warn;return i.jsxs("div",{className:"flex flex-col border-l overflow-hidden",style:{width:380,flexShrink:0,borderColor:"rgba(255,255,255,0.08)",background:"rgba(0,0,0,0.4)"},children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2 border-b",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-semibold px-2 py-0.5 rounded",style:{background:`${n}1A`,color:n,border:`1px solid ${n}44`},children:e.toolName}),e.status&&i.jsx("span",{className:"font-mono text-[9px]",style:{color:a},children:e.status})]}),i.jsx("button",{onClick:t,className:"text-zinc-600 hover:text-zinc-400 text-sm px-1",children:"✕"})]}),i.jsxs("div",{className:"flex gap-3 px-3 py-1.5 border-b shrink-0",style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),e.durationMs!==void 0&&i.jsx("span",{className:"font-mono text-[10px]",style:{color:l.warn},children:M0(e.durationMs)}),e.agentId&&i.jsxs("span",{className:"font-mono text-[10px] text-zinc-600 truncate",children:["agent: ",e.agentId.slice(0,12)]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[i.jsx(Nr,{data:e.input,label:"Input"}),e.output!==void 0&&i.jsx(Nr,{data:e.output,label:"Output"})]})]})}function jp({call:e,isSelected:t,onSelect:l}){const n=H(),a=fi(e.toolName,n.info),s=e.status==="error"?n.error:e.status==="complete"?n.running:n.warn;return i.jsx("div",{className:ge("border-b cursor-pointer transition-colors duration-100",t?"bg-white/[0.04]":"hover:bg-white/[0.02]"),style:{borderColor:"rgba(255,255,255,0.04)"},onClick:l,children:i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[i.jsx("span",{className:"w-24 shrink-0 font-mono text-[10px] text-zinc-500",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),i.jsx("span",{className:"w-28 shrink-0 font-mono text-[11px] font-medium truncate",style:{color:a},children:e.toolName}),i.jsx("span",{className:"flex-1 font-mono text-[11px] text-zinc-400 truncate",children:yp(e.input)}),e.durationMs!==void 0&&i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[10px]",style:{color:n.warn},children:M0(e.durationMs)}),e.status&&i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:s,background:`${s}1A`},children:e.status}),i.jsx("div",{className:"w-1 h-4 rounded-full shrink-0",style:{background:t?n.info:"transparent"}})]})})}function Sp({calls:e}){const t=H(),l=e.length,n=e.filter(o=>o.status==="error").length,a=new Set(e.map(o=>o.toolName)).size,s=e.reduce((o,u)=>(o[u.toolName]=(o[u.toolName]??0)+1,o),{}),c=Object.entries(s).sort((o,u)=>u[1]-o[1])[0];return i.jsxs("div",{className:"flex gap-4 px-4 py-1.5 border-b shrink-0",style:{borderColor:"rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.25)"},children:[i.jsx(Fa,{label:"Total",value:String(l),color:t.info}),n>0&&i.jsx(Fa,{label:"Errors",value:String(n),color:t.error}),i.jsx(Fa,{label:"Unique Tools",value:String(a),color:t.purple}),c&&i.jsx(Fa,{label:`Top: ${c[0]}`,value:`×${c[1]}`,color:fi(c[0],t.warn)})]})}function Fa({label:e,value:t,color:l}){return i.jsxs("div",{className:"flex items-baseline gap-1.5",children:[i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600",children:e}),i.jsx("span",{className:"font-mono text-xs font-semibold",style:{color:l},children:t})]})}function Np(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),[n,a]=C.useState(""),[s,c]=C.useState("all"),[o,u]=C.useState(null),r=C.useMemo(()=>(l?t.filter(g=>g.sessionId===l):t).filter(g=>g.type==="tool.call").map(g=>{const y=g.payload;return{id:g.id,timestamp:g.timestamp,toolName:y.toolName??"unknown",agentId:y.agentId,callId:y.callId??y.toolCallId,status:y.status,input:y.input??{},output:y.output,durationMs:y.durationMs}}),[t,l]),h=C.useMemo(()=>["all",...Array.from(new Set(r.map(g=>g.toolName))).sort()],[r]),p=C.useMemo(()=>r.filter(m=>{if(s!=="all"&&m.toolName!==s)return!1;if(n){const g=n.toLowerCase();if(!m.toolName.toLowerCase().includes(g)&&!JSON.stringify(m.input).toLowerCase().includes(g))return!1}return!0}),[r,s,n]);return r.length===0?i.jsx(We,{icon:i.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),title:"No Tool Calls",description:"Tool calls will appear here as your agent runs. Start a Claude Code session to see Bash, Read, Write, and other tool calls in real time."}):i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-2 flex-wrap",style:{borderColor:"rgba(255,255,255,0.07)",background:e.toolbarBg},children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-zinc-500",children:"Tool Inspector"}),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),i.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:h.map(m=>{const g=m==="all"?e.info:fi(m,e.info),y=s===m;return i.jsx("button",{onClick:()=>c(m),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors capitalize",style:y?{background:`${g}22`,color:g,border:`1px solid ${g}44`}:{color:"#71717a",border:"1px solid transparent"},children:m},m)})}),i.jsx("div",{className:"flex-1"}),i.jsx("input",{type:"text",placeholder:"search input...",value:n,onChange:m=>a(m.target.value),className:"h-6 rounded border bg-transparent px-2 text-[11px] font-mono text-zinc-300 placeholder-zinc-700 outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:150}}),n&&i.jsx("button",{onClick:()=>a(""),className:"font-mono text-[10px] text-zinc-600 hover:text-zinc-400",children:"✕"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:p.length})]}),i.jsx(Sp,{calls:p}),i.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b px-4 py-1",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.25)"},children:[i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Time"}),i.jsx("span",{className:"w-28 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Tool"}),i.jsx("span",{className:"flex-1 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Input Summary"}),i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Dur"}),i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Status"}),i.jsx("div",{className:"w-1"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:p.length===0?i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"no matching tool calls"}):p.map(m=>i.jsx(jp,{call:m,isSelected:(o==null?void 0:o.id)===m.id,onSelect:()=>u(g=>(g==null?void 0:g.id)===m.id?null:m)},m.id))})]}),o&&i.jsx(bp,{call:o,onClose:()=>u(null)})]})}function zp({level:e}){const t=H(),l=e==="error"?t.error:e==="warn"?t.warn:e==="debug"?t.purple:t.info;return i.jsx("span",{className:"shrink-0 font-mono text-[8px] uppercase tracking-widest px-1.5 py-0.5 rounded",style:{color:l,background:`${l}1A`,border:`1px solid ${l}33`},children:e})}function Cp({type:e}){const t=H(),n={log:"#52525b",state:t.warn,checkpoint:t.running,spawn:t.purple,complete:t.running}[e];return i.jsx("span",{className:"shrink-0 font-mono text-[8px] uppercase tracking-widest",style:{color:n},children:e})}function Tp({step:e,showAgent:t}){const l=H(),[n,a]=C.useState(!1),s=!!e.detail;return i.jsxs("div",{className:ge("border-b transition-colors",s?"cursor-pointer hover:bg-white/[0.02]":""),style:{borderColor:"rgba(255,255,255,0.04)"},onClick:()=>s&&a(c=>!c),children:[i.jsxs("div",{className:"flex items-start gap-3 px-4 py-2",children:[i.jsx("span",{className:"shrink-0 mt-0.5 font-mono text-[10px] text-zinc-600 w-24",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),i.jsx("div",{className:"shrink-0 mt-0.5 w-20",children:i.jsx(Cp,{type:e.type})}),i.jsx("div",{className:"shrink-0 mt-0.5 w-12",children:i.jsx(zp,{level:e.level})}),t&&i.jsx("span",{className:"shrink-0 mt-0.5 w-24 font-mono text-[10px] truncate",style:{color:e.agentName?l.purple:"#3f3f46"},children:e.agentName??"—"}),i.jsx("span",{className:ge("flex-1 font-mono text-[11px] break-all",n?"whitespace-pre-wrap":"truncate"),style:{color:e.level==="error"?l.error:e.level==="warn"?l.warn:"#d4d4d8"},children:e.message}),s&&i.jsx("span",{className:"shrink-0 font-mono text-[9px] text-zinc-600 mt-0.5",children:n?"▲":"▼"})]}),n&&e.detail&&i.jsx("div",{className:"px-4 pb-2 pl-44",children:i.jsx("pre",{className:"rounded p-2 font-mono text-[10px] whitespace-pre-wrap break-all",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.06)",color:l.info},children:e.detail})})]})}function zr({name:e,isActive:t,color:l,onClick:n}){return i.jsx("button",{onClick:n,className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:t?{background:`${l}22`,color:l,border:`1px solid ${l}44`}:{color:"#71717a",border:"1px solid transparent"},children:e})}function kp(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),n=Ae(b=>b.agents),[a,s]=C.useState("all"),[c,o]=C.useState("all"),[u,r]=C.useState(""),h=C.useMemo(()=>{const b=new Map;for(const[f,d]of n.entries())b.set(f,d.name);return b},[n]),p=C.useMemo(()=>(l?t.filter(f=>f.sessionId===l):t).filter(f=>["agent.log","agent.state_change","checkpoint.create","agent.spawn","agent.complete","loop.detected"].includes(f.type)).map(f=>{const d=f.payload,x=d.agentId,v=x?h.get(x):void 0;switch(f.type){case"agent.log":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:d.message??"",level:d.level??"info",type:"log",detail:d.data?JSON.stringify(d.data,null,2):void 0};case"agent.state_change":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`State → ${d.nextState}${d.reason?` (${d.reason})`:""}`,level:d.nextState==="error"?"error":"info",type:"state"};case"checkpoint.create":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`Checkpoint: ${d.label??""}`,level:"info",type:"checkpoint",detail:d.metadata?JSON.stringify(d.metadata,null,2):void 0};case"agent.spawn":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:d.name??v,message:`Agent spawned: ${d.name??x??""}`,level:"info",type:"spawn"};case"agent.complete":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`Agent complete — ${(d.durationMs??0)>0?`${(d.durationMs/1e3).toFixed(1)}s`:"done"}${d.errorMessage?`: ${d.errorMessage}`:""}`,level:d.state==="error"?"error":"info",type:"complete"};case"loop.detected":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`Loop detected: ${d.toolName??""} called ${d.callCount??0}× in ${d.windowSeconds??60}s window`,level:"warn",type:"log"};default:return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:JSON.stringify(d).slice(0,120),level:"debug",type:"log"}}}),[t,l,h]),m=C.useMemo(()=>{const b=new Map;for(const f of p)f.agentId&&!b.has(f.agentId)&&b.set(f.agentId,f.agentName??f.agentId.slice(0,8));return Array.from(b.entries())},[p]),g=C.useMemo(()=>{const b=[e.purple,e.info,e.running,e.warn,"#FF8844","#44FFBB"],f=new Map;return m.forEach(([d],x)=>f.set(d,b[x%b.length])),f},[m,e]),y=C.useMemo(()=>p.filter(b=>{var f;if(a!=="all"&&b.agentId!==a||c!=="all"&&b.level!==c)return!1;if(u){const d=u.toLowerCase();if(!b.message.toLowerCase().includes(d)&&!((f=b.agentName)!=null&&f.toLowerCase().includes(d)))return!1}return!0}),[p,a,c,u]),j=a==="all"&&m.length>1;return p.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.44-3.54z"}),i.jsx("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.44-3.54z"})]}),title:"No Reasoning Steps",description:"Agent logs, state transitions, and checkpoints will appear here as your agent runs."}):i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-2 flex-wrap",style:{borderColor:"rgba(255,255,255,0.07)",background:e.toolbarBg},children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-zinc-500 mr-1",children:"Reasoning"}),i.jsx("div",{className:"h-4 w-px",style:{background:"rgba(255,255,255,0.08)"}}),i.jsx(zr,{name:"all",isActive:a==="all",color:e.info,onClick:()=>s("all")}),m.map(([b,f])=>i.jsx(zr,{name:f,isActive:a===b,color:g.get(b)??e.purple,onClick:()=>s(b)},b)),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),["all","info","warn","error","debug"].map(b=>{const f=b==="all"?"#52525b":b==="error"?e.error:b==="warn"?e.warn:b==="debug"?e.purple:e.info;return i.jsx("button",{onClick:()=>o(b),className:"rounded px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-widest transition-colors",style:c===b?{background:`${f}22`,color:f,border:`1px solid ${f}44`}:{color:"#52525b",border:"1px solid transparent"},children:b},b)}),i.jsx("div",{className:"flex-1"}),i.jsx("input",{type:"text",placeholder:"search...",value:u,onChange:b=>r(b.target.value),className:"h-6 rounded border bg-transparent px-2 text-[11px] font-mono text-zinc-300 placeholder-zinc-700 outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:130}}),u&&i.jsx("button",{onClick:()=>r(""),className:"font-mono text-[10px] text-zinc-600",children:"✕"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:y.length})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b px-4 py-1",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.25)"},children:[i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Time"}),i.jsx("span",{className:"w-20 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Type"}),i.jsx("span",{className:"w-12 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Level"}),j&&i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Agent"}),i.jsx("span",{className:"flex-1 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Message"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:y.length===0?i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"no matching steps"}):y.map(b=>i.jsx(Tp,{step:b,showAgent:j},b.id))})]})}const Wi={"claude-opus-4-7":2e5,"claude-opus-4-6":2e5,"claude-sonnet-4-6":2e5,"claude-sonnet-4-5":2e5,"claude-sonnet-4-5-20251001":2e5,"claude-haiku-4-5":2e5,"claude-haiku-4-5-20251001":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-haiku-20241022":2e5,"claude-3-opus-20240229":2e5},Ii={"claude-opus-4-7":"Claude Opus 4.7","claude-opus-4-6":"Claude Opus 4.6","claude-sonnet-4-6":"Claude Sonnet 4.6","claude-sonnet-4-5":"Claude Sonnet 4.5","claude-haiku-4-5":"Claude Haiku 4.5"};function Cr(e){if(Wi[e])return Wi[e];for(const[t,l]of Object.entries(Wi))if(e.startsWith(t.split("-").slice(0,3).join("-")))return l;return 2e5}function wp(e){if(Ii[e])return Ii[e];for(const[t,l]of Object.entries(Ii))if(e===t||e.startsWith(`${t}-`))return l;return e}function Ap({pct:e,color:t,label:l}){const n=Math.min(100,Math.max(0,e)),a=n>=90?"#FF3366":n>=70?"#FFAA00":t;return i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-600 w-20 text-right",children:l}),i.jsx("div",{className:"flex-1 rounded-full overflow-hidden",style:{height:6,background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${n}%`,background:a,boxShadow:n>50?`0 0 8px ${a}66`:"none"}})}),i.jsxs("span",{className:"shrink-0 font-mono text-xs font-semibold w-12 text-right",style:{color:a},children:[n.toFixed(1),"%"]})]})}function Wa({label:e,value:t,color:l,pct:n,caption:a}){const s=Math.min(100,Math.max(0,n));return i.jsxs("div",{className:"flex flex-col gap-1.5 rounded-lg p-3",style:{background:`${l}0D`,border:`1px solid ${l}22`},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest",style:{color:`${l}99`},children:e}),i.jsx("span",{className:"font-mono text-xs font-bold",style:{color:l},children:t.toLocaleString()})]}),i.jsx("div",{className:"rounded-full overflow-hidden",style:{height:3,background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded-full",style:{width:`${s}%`,background:l}})}),i.jsx("span",{className:"font-mono text-[9px]",style:{color:`${l}77`},children:a})]})}function Mp({point:e,isLast:t}){const l=H(),n=Math.min(100,Math.max(2,e.pct)),a=e.pct>=90?l.error:e.pct>=70?l.warn:l.info,s=e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens;return i.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[i.jsx("div",{className:"flex-1 min-w-0 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.04)"},children:i.jsx("div",{className:"h-2 rounded-full transition-all",style:{width:`${n}%`,background:a,opacity:t?1:.5}})}),i.jsxs("span",{className:"font-mono text-[9px] shrink-0 tabular-nums w-12 text-right",style:{color:a},children:[e.pct.toFixed(1),"%"]}),i.jsxs("span",{className:"font-mono text-[9px] shrink-0 text-zinc-600 tabular-nums w-20 text-right",children:[s.toLocaleString()," tok"]})]})}function Ep(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),n=C.useMemo(()=>(l?t.filter(b=>b.sessionId===l):t).filter(b=>b.type==="cost.update"),[t,l]),a=C.useMemo(()=>n.slice().reverse().map(j=>{const b=j.payload,f=b.inputTokens??0,d=b.outputTokens??0,x=b.cacheReadTokens??0,v=b.cacheWriteTokens??0,S=b.model??"",z=Cr(S),N=f+x+v,M=z>0?N/z*100:0;return{timestamp:j.timestamp,inputTokens:f,outputTokens:d,cacheReadTokens:x,cacheWriteTokens:v,model:S,contextLimit:z,pct:M}}),[n]),s=C.useMemo(()=>a[a.length-1]??null,[a]),c=C.useMemo(()=>(l?t.filter(b=>b.sessionId===l):t).find(b=>b.type==="session.summary"),[t,l]),o=C.useMemo(()=>{if(!c)return null;const j=c.payload;return{input:j.inputTokens??0,output:j.outputTokens??0,cacheRead:j.cacheReadTokens??0,cacheWrite:j.cacheWriteTokens??0,model:c.payload.model??""}},[c]),u=s?{input:s.inputTokens,output:s.outputTokens,cacheRead:s.cacheReadTokens,cacheWrite:s.cacheWriteTokens,model:s.model}:o;if(!u&&a.length===0)return i.jsx(We,{icon:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),i.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),i.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),title:"No Context Data",description:"Context window utilization will appear here once your agent makes API calls."});const r=u?Cr(u.model):2e5,h=u?u.input+u.cacheRead+u.cacheWrite:0,p=r>0?h/r*100:0,m=p>=90?e.error:p>=70?e.warn:e.running,g=j=>r>0?j/r*100:0,y=j=>`${g(j).toFixed(1)}% of ctx`;return i.jsxs("div",{className:"flex h-full flex-col overflow-y-auto p-5 gap-6 w-full mx-auto",style:{maxWidth:"95vw"},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"font-mono text-sm font-bold text-zinc-200",children:"Context Window"}),i.jsxs("p",{className:"font-mono text-[10px] text-zinc-600 mt-0.5",children:[u!=null&&u.model?wp(u.model):"unknown model"," — ",r.toLocaleString()," token limit"]})]}),i.jsxs("div",{className:"flex flex-col items-end",style:{color:m},children:[i.jsxs("span",{className:"font-mono text-3xl font-bold leading-none",children:[p.toFixed(1),"%"]}),i.jsx("span",{className:"font-mono text-[10px] mt-0.5",children:"utilization"})]})]}),i.jsx("div",{className:"space-y-3",children:i.jsx(Ap,{pct:p,color:e.info,label:"Input ctx"})}),u&&i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(Wa,{label:"Input Tokens",value:u.input,color:e.info,pct:g(u.input),caption:y(u.input)}),i.jsx(Wa,{label:"Output Tokens",value:u.output,color:e.running,pct:g(u.output),caption:"generated (not in ctx)"}),i.jsx(Wa,{label:"Cache Reads",value:u.cacheRead,color:e.warn,pct:g(u.cacheRead),caption:y(u.cacheRead)}),i.jsx(Wa,{label:"Cache Writes",value:u.cacheWrite,color:e.purple,pct:g(u.cacheWrite),caption:y(u.cacheWrite)})]}),p>=70&&i.jsxs("div",{className:"rounded-lg p-3 flex items-start gap-2",style:{background:`${m}0D`,border:`1px solid ${m}33`},children:[i.jsx("span",{className:"text-lg leading-none",children:p>=90?"⚠️":"📊"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-mono text-xs font-semibold",style:{color:m},children:p>=90?"Context Critical":"Context Pressure"}),i.jsx("p",{className:"font-mono text-[10px] text-zinc-400 mt-1",children:p>=90?`Context window is ${p.toFixed(0)}% full. The model may truncate or refuse soon.`:`At ${p.toFixed(0)}% utilization. Consider summarizing or starting a new session.`})]})]}),a.length>1&&i.jsxs("div",{children:[i.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600 mb-2",children:["Context Growth (",a.length," snapshots)"]}),i.jsx("div",{className:"space-y-0.5",children:a.map((j,b)=>i.jsx(Mp,{point:j,isLast:b===a.length-1},j.timestamp))})]})]})}function Dp({line:e}){const t=H();return e.startsWith("+++")||e.startsWith("---")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:"#71717a"},children:e}):e.startsWith("+")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:t.running,background:`${t.running}0A`},children:e}):e.startsWith("-")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:t.error,background:`${t.error}0A`},children:e}):e.startsWith("@@")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:t.info},children:e}):i.jsx("div",{className:"font-mono text-[10px] leading-relaxed text-zinc-500",children:e})}function E0({node:e,depth:t,statusMap:l,selectedFile:n,onSelect:a}){var g,y;const s=H(),[c,o]=C.useState(t<2),u=l.get(e.path),r=n===e.path;if(e.type==="dir"){const j=((g=e.children)==null?void 0:g.some(b=>l.has(b.path)))??!1;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-1 cursor-pointer hover:bg-white/[0.03] rounded px-1 py-0.5",style:{paddingLeft:`${t*12+4}px`},onClick:()=>o(b=>!b),children:[i.jsx("span",{className:"font-mono text-[10px] text-zinc-600 shrink-0 w-3",children:c?"▾":"▸"}),i.jsxs("span",{className:"font-mono text-[10px] truncate",style:{color:j?s.warn:"#52525b"},children:[e.name,"/"]})]}),c&&((y=e.children)==null?void 0:y.map(b=>i.jsx(E0,{node:b,depth:t+1,statusMap:l,selectedFile:n,onSelect:a},b.path)))]})}let h="#52525b",p="",m="#52525b";return u&&(u.staged?(p=u.status,m=u.status==="A"?s.running:u.status==="D"?s.error:s.warn,h="#d4d4d8"):u.untracked?(p="?",m="#52525b",h="#71717a"):(p=u.workStatus,m=u.workStatus==="D"?s.error:s.warn,h="#a1a1aa")),i.jsxs("div",{className:ge("flex items-center gap-1 cursor-pointer rounded px-1 py-0.5 transition-colors",r?"bg-white/[0.06]":"hover:bg-white/[0.03]"),style:{paddingLeft:`${t*12+4}px`},onClick:()=>u&&a(e.path,u.staged),children:[p?i.jsx("span",{className:"shrink-0 font-mono text-[9px] font-bold w-3 text-center",style:{color:m},children:p}):i.jsx("span",{className:"shrink-0 w-3"}),i.jsx("span",{className:"font-mono text-[10px] truncate",style:{color:h},children:e.name})]})}function Pi({title:e,files:t,color:l,selectedFile:n,staged:a,onSelect:s,onStage:c,onUnstage:o,onDiscard:u,loading:r}){const h=H(),[p,m]=C.useState(new Set);if(t.length===0)return null;const g=f=>{m(d=>{const x=new Set(d);return x.has(f)?x.delete(f):x.add(f),x})},y=t.every(f=>p.has(f.path)),j=()=>{m(y?new Set:new Set(t.map(f=>f.path)))},b=t.filter(f=>p.has(f.path)).map(f=>f.path);return i.jsxs("div",{className:"mb-1",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 sticky top-0",style:{background:"rgba(9,9,11,0.95)",borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:j,className:"flex items-center gap-1",children:i.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center",style:{borderColor:y?l:"rgba(255,255,255,0.15)",background:y?l:"transparent"},children:y&&i.jsx("span",{style:{color:"#09090B",fontSize:8,fontWeight:900},children:"✓"})})}),i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest",style:{color:l},children:e}),i.jsx("span",{className:"font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:l,background:`${l}1A`,border:`1px solid ${l}33`},children:t.length})]}),i.jsx("div",{className:"flex items-center gap-1",children:b.length>0&&i.jsxs(i.Fragment,{children:[c&&i.jsxs("button",{disabled:r,onClick:()=>{c(b),m(new Set)},className:"font-mono text-[9px] px-1.5 py-0.5 rounded transition-colors disabled:opacity-40",style:{color:h.running,background:`${h.running}1A`,border:`1px solid ${h.running}33`},children:["Stage ",b.length]}),o&&i.jsxs("button",{disabled:r,onClick:()=>{o(b),m(new Set)},className:"font-mono text-[9px] px-1.5 py-0.5 rounded transition-colors disabled:opacity-40",style:{color:h.warn,background:`${h.warn}1A`,border:`1px solid ${h.warn}33`},children:["Unstage ",b.length]}),u&&i.jsxs("button",{disabled:r,onClick:()=>{confirm(`Discard changes to ${b.length} file(s)?`)&&(u(b),m(new Set))},className:"font-mono text-[9px] px-1.5 py-0.5 rounded transition-colors disabled:opacity-40",style:{color:h.error,background:`${h.error}1A`,border:`1px solid ${h.error}33`},children:["Discard ",b.length]})]})})]}),t.map(f=>{const d=a?f.status:f.untracked?"?":f.workStatus,x=d==="A"?h.running:d==="D"?h.error:d==="?"?"#52525b":h.warn,v=n===f.path;return i.jsxs("div",{className:ge("flex items-center gap-2 px-3 py-1 cursor-pointer transition-colors",v?"bg-white/[0.05]":"hover:bg-white/[0.02]"),onClick:()=>s(f.path,a),children:[i.jsx("button",{onClick:S=>{S.stopPropagation(),g(f.path)},className:"shrink-0",children:i.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center",style:{borderColor:p.has(f.path)?x:"rgba(255,255,255,0.15)",background:p.has(f.path)?x:"transparent",display:"inline-flex"},children:p.has(f.path)&&i.jsx("span",{style:{color:"#09090B",fontSize:8,fontWeight:900},children:"✓"})})}),i.jsx("span",{className:"shrink-0 font-mono text-[9px] font-bold w-3 text-center",style:{color:x},children:d}),i.jsx("span",{className:"flex-1 font-mono text-[10px] text-zinc-300 truncate",title:f.path,children:f.path.split("/").pop()}),i.jsx("span",{className:"font-mono text-[9px] text-zinc-600 truncate max-w-32",title:f.path,children:f.path.includes("/")?f.path.slice(0,f.path.lastIndexOf("/")):""})]},f.path)})]})}function Op({status:e,gitRoot:t,onSuccess:l,loading:n,setLoading:a}){var M;const s=H(),{collectorUrl:c}=Da(),[o,u]=C.useState(""),[r,h]=C.useState(""),[p,m]=C.useState(""),g=C.useRef(null),y=c.replace(/^ws/,"http").replace(/\/ws$/,""),j=(e==null?void 0:e.staged.length)??0,b=(e==null?void 0:e.remotes[0])??"origin",f=(e==null?void 0:e.branch)??"",d=((M=e==null?void 0:e.aheadBehind)==null?void 0:M.ahead)??0,x=o.trim().length>0&&j>0,v=d>0||j===0;async function S(){if(x){a(!0),m(""),h("");try{const A=await fetch(`${y}/api/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:o.trim(),gitRoot:t})}),D=await A.json();if(!A.ok||D.error){m(D.error??"Commit failed");return}h(D.output??"Committed"),u(""),l()}catch(A){m(A instanceof Error?A.message:String(A))}finally{a(!1)}}}async function z(){a(!0),m(""),h("");try{const A=await fetch(`${y}/api/git/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({remote:b,branch:f,gitRoot:t})}),D=await A.json();if(!A.ok||D.error){m(D.error??"Push failed");return}h(D.output||"Pushed successfully"),l()}catch(A){m(A instanceof Error?A.message:String(A))}finally{a(!1)}}async function N(){a(!0),m(""),h("");try{const A=await fetch(`${y}/api/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:o.trim(),gitRoot:t})}),D=await A.json();if(!A.ok||D.error){m(D.error??"Commit failed");return}const X=await fetch(`${y}/api/git/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({remote:b,branch:f,gitRoot:t})}),te=await X.json();if(!X.ok||te.error){h(`Committed. Push failed: ${te.error??""}`);return}h(`${D.output??"Committed"}
|
|
51
|
+
Every event, agent, tool call, and checkpoint will be permanently erased. This cannot be undone.`)&&confirm(`Really wipe all ${k} session${k===1?"":"s"}? Last chance.`)){x(!0);try{const O=await fetch(`${v}/api/sessions`,{method:"DELETE"});if(!O.ok)throw new Error(`HTTP ${O.status}`);window.location.reload()}catch(O){alert(`Failed to reset database: ${O instanceof Error?O.message:String(O)}`),x(!1)}}}const te=C.useMemo(()=>{const k=new Map;for(const O of a){if(O.type!=="cost.update")continue;const $=O.payload.totalCostUsd??0;k.set(O.sessionId,(k.get(O.sessionId)??0)+$)}return k},[a]),E=k=>te.get(k.id)??k.totalCostUsd,_=C.useMemo(()=>{const k=u.toLowerCase().trim(),O=k?e.filter($=>$.name.toLowerCase().includes(k)||$.id.toLowerCase().includes(k)):e;return hp(O,h)},[e,u,h]),F=e.reduce((k,O)=>k+E(O),0),w=e.filter(k=>nn(k)).length,B=[{key:"date",label:"Recent"},{key:"cost",label:"Cost"},{key:"duration",label:"Duration"},{key:"name",label:"Name"}];return e.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("polyline",{points:"12 6 12 12 16 14"})]}),title:"No sessions",description:"Sessions will appear here once Claude Code starts reporting to PRISM"}):i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b px-5 py-2",style:{borderColor:"rgba(255,255,255,0.07)",background:o.toolbarBg},children:[i.jsxs("span",{className:"font-mono text-[10px] text-zinc-500",children:[e.length," sessions"]}),w>0&&i.jsxs("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded",style:{background:`${o.running}1A`,color:o.running},children:[w," live"]}),i.jsx("span",{className:"font-mono text-[10px]",style:{color:o.running},children:F>0?`$${F.toFixed(4)} total`:""}),i.jsx("div",{className:"flex-1"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:"sort:"}),B.map(({key:k,label:O})=>i.jsx("button",{onClick:()=>p(k),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:h===k?{background:`${o.info}22`,color:o.info,border:`1px solid ${o.info}44`}:{color:"#52525b",border:"1px solid transparent"},children:O},k)),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),i.jsx("input",{type:"text",placeholder:"search sessions…",value:u,onChange:k=>r(k.target.value),className:"h-6 rounded border bg-transparent px-2 text-[11px] font-mono text-zinc-300 placeholder-zinc-700 outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:160}}),u&&i.jsx("button",{onClick:()=>r(""),className:"font-mono text-[10px] text-zinc-600 hover:text-zinc-400",children:"✕"}),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),i.jsxs("button",{onClick:D,disabled:N===0||b,title:N===0?`No sessions idle for ${Xl}+ days`:`Delete ${N} session${N===1?"":"s"} idle for ${Xl}+ days`,className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:N>0?o.error:"#71717a",background:N>0?`${o.error}14`:"rgba(255,255,255,0.03)",borderColor:N>0?`${o.error}40`:"rgba(255,255,255,0.08)"},children:[b?i.jsx(Qs,{}):i.jsx(Pc,{}),i.jsxs("span",{children:["Clean stale",N>0?` (${N})`:""]})]}),i.jsxs("button",{onClick:X,disabled:e.length===0||d,title:e.length===0?"Database is already empty":`Delete all ${e.length} session${e.length===1?"":"s"} and reset the database`,className:"flex items-center gap-1 rounded border px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed",style:{color:e.length>0?o.error:"#71717a",background:e.length>0?`${o.error}22`:"rgba(255,255,255,0.03)",borderColor:e.length>0?`${o.error}66`:"rgba(255,255,255,0.08)"},children:[d?i.jsx(Qs,{}):i.jsx(Pc,{}),i.jsxs("span",{children:["Reset DB",e.length>0?` (${e.length})`:""]})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-4 border-b px-5 py-1.5",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.25)"},children:[i.jsx("div",{className:"w-1.5 shrink-0"}),i.jsx("span",{className:"w-48 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Session"}),i.jsx("span",{className:"w-14 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Status"}),i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Duration"}),i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Cost"}),i.jsx("span",{className:"w-14 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Turns"}),i.jsx("span",{className:"w-14 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Cache"}),i.jsx("span",{className:"flex-1 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Top Tools"}),i.jsx("span",{className:"w-[54px] shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700 text-right",children:"Actions"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:_.length===0?i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsxs("p",{className:"font-mono text-xs text-zinc-600",children:['No sessions match "',u,'"']})}):_.map(k=>i.jsx(gp,{session:k,costUsd:E(k),isActive:k.id===t,meta:s.has(k.id)?yp(s.get(k.id)):{turnCount:null,topTools:[],cacheHitRate:null},onSelect:()=>l(k.id),onDelete:O=>M(k,O),onPurge:O=>A(k,O),deleting:m===k.id,purging:y===k.id},k.id))})]})}function E0(e){return e===void 0?"—":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function bp(e){var s;const t=e.command;if(t)return((s=t.split(`
|
|
52
|
+
`)[0])==null?void 0:s.slice(0,80))??"";const l=e.file_path??e.path;if(l)return l;const n=e.pattern;return n||Object.keys(e).slice(0,2).map(c=>{var o;return`${c}: ${(o=JSON.stringify(e[c]))==null?void 0:o.slice(0,30)}`}).join(" ")}const jp={Bash:"#FFAA00",Read:"#00BBFF",Write:"#00FF88",Edit:"#BB88FF",MultiEdit:"#BB88FF",Glob:"#00BBFF",Grep:"#00BBFF",Task:"#FF8844",WebFetch:"#FF3366",WebSearch:"#FF3366",TodoWrite:"#44FFBB",TodoRead:"#44FFBB"};function di(e,t){return jp[e]??t}function zr({data:e,label:t}){const l=H(),[n,a]=C.useState(!1),s=JSON.stringify(e,null,2);return i.jsxs("div",{className:"mt-3",children:[i.jsxs("button",{className:"flex items-center gap-1.5 mb-1",onClick:()=>a(c=>!c),children:[i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest",style:{color:"#52525b"},children:t}),i.jsx("span",{className:"font-mono text-[9px]",style:{color:"#52525b"},children:n?"▶":"▼"})]}),!n&&i.jsx("pre",{className:"rounded p-2.5 font-mono text-[10px] leading-relaxed overflow-x-auto whitespace-pre-wrap break-all",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.07)",color:l.info},children:s})]})}function Sp({call:e,onClose:t}){const l=H(),n=di(e.toolName,l.info),a=e.status==="error"?l.error:e.status==="complete"?l.running:l.warn;return i.jsxs("div",{className:"flex flex-col border-l overflow-hidden",style:{width:380,flexShrink:0,borderColor:"rgba(255,255,255,0.08)",background:"rgba(0,0,0,0.4)"},children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3 py-2 border-b",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs font-semibold px-2 py-0.5 rounded",style:{background:`${n}1A`,color:n,border:`1px solid ${n}44`},children:e.toolName}),e.status&&i.jsx("span",{className:"font-mono text-[9px]",style:{color:a},children:e.status})]}),i.jsx("button",{onClick:t,className:"text-zinc-600 hover:text-zinc-400 text-sm px-1",children:"✕"})]}),i.jsxs("div",{className:"flex gap-3 px-3 py-1.5 border-b shrink-0",style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),e.durationMs!==void 0&&i.jsx("span",{className:"font-mono text-[10px]",style:{color:l.warn},children:E0(e.durationMs)}),e.agentId&&i.jsxs("span",{className:"font-mono text-[10px] text-zinc-600 truncate",children:["agent: ",e.agentId.slice(0,12)]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[i.jsx(zr,{data:e.input,label:"Input"}),e.output!==void 0&&i.jsx(zr,{data:e.output,label:"Output"})]})]})}function Np({call:e,isSelected:t,onSelect:l}){const n=H(),a=di(e.toolName,n.info),s=e.status==="error"?n.error:e.status==="complete"?n.running:n.warn;return i.jsx("div",{className:ge("border-b cursor-pointer transition-colors duration-100",t?"bg-white/[0.04]":"hover:bg-white/[0.02]"),style:{borderColor:"rgba(255,255,255,0.04)"},onClick:l,children:i.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[i.jsx("span",{className:"w-24 shrink-0 font-mono text-[10px] text-zinc-500",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),i.jsx("span",{className:"w-28 shrink-0 font-mono text-[11px] font-medium truncate",style:{color:a},children:e.toolName}),i.jsx("span",{className:"flex-1 font-mono text-[11px] text-zinc-400 truncate",children:bp(e.input)}),e.durationMs!==void 0&&i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[10px]",style:{color:n.warn},children:E0(e.durationMs)}),e.status&&i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:s,background:`${s}1A`},children:e.status}),i.jsx("div",{className:"w-1 h-4 rounded-full shrink-0",style:{background:t?n.info:"transparent"}})]})})}function zp({calls:e}){const t=H(),l=e.length,n=e.filter(o=>o.status==="error").length,a=new Set(e.map(o=>o.toolName)).size,s=e.reduce((o,u)=>(o[u.toolName]=(o[u.toolName]??0)+1,o),{}),c=Object.entries(s).sort((o,u)=>u[1]-o[1])[0];return i.jsxs("div",{className:"flex gap-4 px-4 py-1.5 border-b shrink-0",style:{borderColor:"rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.25)"},children:[i.jsx(Wa,{label:"Total",value:String(l),color:t.info}),n>0&&i.jsx(Wa,{label:"Errors",value:String(n),color:t.error}),i.jsx(Wa,{label:"Unique Tools",value:String(a),color:t.purple}),c&&i.jsx(Wa,{label:`Top: ${c[0]}`,value:`×${c[1]}`,color:di(c[0],t.warn)})]})}function Wa({label:e,value:t,color:l}){return i.jsxs("div",{className:"flex items-baseline gap-1.5",children:[i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600",children:e}),i.jsx("span",{className:"font-mono text-xs font-semibold",style:{color:l},children:t})]})}function Cp(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),[n,a]=C.useState(""),[s,c]=C.useState("all"),[o,u]=C.useState(null),r=C.useMemo(()=>(l?t.filter(g=>g.sessionId===l):t).filter(g=>g.type==="tool.call").map(g=>{const y=g.payload;return{id:g.id,timestamp:g.timestamp,toolName:y.toolName??"unknown",agentId:y.agentId,callId:y.callId??y.toolCallId,status:y.status,input:y.input??{},output:y.output,durationMs:y.durationMs}}),[t,l]),h=C.useMemo(()=>["all",...Array.from(new Set(r.map(g=>g.toolName))).sort()],[r]),p=C.useMemo(()=>r.filter(m=>{if(s!=="all"&&m.toolName!==s)return!1;if(n){const g=n.toLowerCase();if(!m.toolName.toLowerCase().includes(g)&&!JSON.stringify(m.input).toLowerCase().includes(g))return!1}return!0}),[r,s,n]);return r.length===0?i.jsx(We,{icon:i.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),title:"No Tool Calls",description:"Tool calls will appear here as your agent runs. Start a Claude Code session to see Bash, Read, Write, and other tool calls in real time."}):i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-2 flex-wrap",style:{borderColor:"rgba(255,255,255,0.07)",background:e.toolbarBg},children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-zinc-500",children:"Tool Inspector"}),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),i.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:h.map(m=>{const g=m==="all"?e.info:di(m,e.info),y=s===m;return i.jsx("button",{onClick:()=>c(m),className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors capitalize",style:y?{background:`${g}22`,color:g,border:`1px solid ${g}44`}:{color:"#71717a",border:"1px solid transparent"},children:m},m)})}),i.jsx("div",{className:"flex-1"}),i.jsx("input",{type:"text",placeholder:"search input...",value:n,onChange:m=>a(m.target.value),className:"h-6 rounded border bg-transparent px-2 text-[11px] font-mono text-zinc-300 placeholder-zinc-700 outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:150}}),n&&i.jsx("button",{onClick:()=>a(""),className:"font-mono text-[10px] text-zinc-600 hover:text-zinc-400",children:"✕"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:p.length})]}),i.jsx(zp,{calls:p}),i.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b px-4 py-1",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.25)"},children:[i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Time"}),i.jsx("span",{className:"w-28 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Tool"}),i.jsx("span",{className:"flex-1 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Input Summary"}),i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Dur"}),i.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Status"}),i.jsx("div",{className:"w-1"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:p.length===0?i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"no matching tool calls"}):p.map(m=>i.jsx(Np,{call:m,isSelected:(o==null?void 0:o.id)===m.id,onSelect:()=>u(g=>(g==null?void 0:g.id)===m.id?null:m)},m.id))})]}),o&&i.jsx(Sp,{call:o,onClose:()=>u(null)})]})}function Tp({level:e}){const t=H(),l=e==="error"?t.error:e==="warn"?t.warn:e==="debug"?t.purple:t.info;return i.jsx("span",{className:"shrink-0 font-mono text-[8px] uppercase tracking-widest px-1.5 py-0.5 rounded",style:{color:l,background:`${l}1A`,border:`1px solid ${l}33`},children:e})}function kp({type:e}){const t=H(),n={log:"#52525b",state:t.warn,checkpoint:t.running,spawn:t.purple,complete:t.running}[e];return i.jsx("span",{className:"shrink-0 font-mono text-[8px] uppercase tracking-widest",style:{color:n},children:e})}function wp({step:e,showAgent:t}){const l=H(),[n,a]=C.useState(!1),s=!!e.detail;return i.jsxs("div",{className:ge("border-b transition-colors",s?"cursor-pointer hover:bg-white/[0.02]":""),style:{borderColor:"rgba(255,255,255,0.04)"},onClick:()=>s&&a(c=>!c),children:[i.jsxs("div",{className:"flex items-start gap-3 px-4 py-2",children:[i.jsx("span",{className:"shrink-0 mt-0.5 font-mono text-[10px] text-zinc-600 w-24",children:ot(new Date(e.timestamp),"HH:mm:ss.SSS")}),i.jsx("div",{className:"shrink-0 mt-0.5 w-20",children:i.jsx(kp,{type:e.type})}),i.jsx("div",{className:"shrink-0 mt-0.5 w-12",children:i.jsx(Tp,{level:e.level})}),t&&i.jsx("span",{className:"shrink-0 mt-0.5 w-24 font-mono text-[10px] truncate",style:{color:e.agentName?l.purple:"#3f3f46"},children:e.agentName??"—"}),i.jsx("span",{className:ge("flex-1 font-mono text-[11px] break-all",n?"whitespace-pre-wrap":"truncate"),style:{color:e.level==="error"?l.error:e.level==="warn"?l.warn:"#d4d4d8"},children:e.message}),s&&i.jsx("span",{className:"shrink-0 font-mono text-[9px] text-zinc-600 mt-0.5",children:n?"▲":"▼"})]}),n&&e.detail&&i.jsx("div",{className:"px-4 pb-2 pl-44",children:i.jsx("pre",{className:"rounded p-2 font-mono text-[10px] whitespace-pre-wrap break-all",style:{background:"rgba(0,0,0,0.4)",border:"1px solid rgba(255,255,255,0.06)",color:l.info},children:e.detail})})]})}function Cr({name:e,isActive:t,color:l,onClick:n}){return i.jsx("button",{onClick:n,className:"rounded px-2 py-0.5 font-mono text-[10px] transition-colors",style:t?{background:`${l}22`,color:l,border:`1px solid ${l}44`}:{color:"#71717a",border:"1px solid transparent"},children:e})}function Ap(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),n=Ae(b=>b.agents),[a,s]=C.useState("all"),[c,o]=C.useState("all"),[u,r]=C.useState(""),h=C.useMemo(()=>{const b=new Map;for(const[f,d]of n.entries())b.set(f,d.name);return b},[n]),p=C.useMemo(()=>(l?t.filter(f=>f.sessionId===l):t).filter(f=>["agent.log","agent.state_change","checkpoint.create","agent.spawn","agent.complete","loop.detected"].includes(f.type)).map(f=>{const d=f.payload,x=d.agentId,v=x?h.get(x):void 0;switch(f.type){case"agent.log":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:d.message??"",level:d.level??"info",type:"log",detail:d.data?JSON.stringify(d.data,null,2):void 0};case"agent.state_change":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`State → ${d.nextState}${d.reason?` (${d.reason})`:""}`,level:d.nextState==="error"?"error":"info",type:"state"};case"checkpoint.create":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`Checkpoint: ${d.label??""}`,level:"info",type:"checkpoint",detail:d.metadata?JSON.stringify(d.metadata,null,2):void 0};case"agent.spawn":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:d.name??v,message:`Agent spawned: ${d.name??x??""}`,level:"info",type:"spawn"};case"agent.complete":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`Agent complete — ${(d.durationMs??0)>0?`${(d.durationMs/1e3).toFixed(1)}s`:"done"}${d.errorMessage?`: ${d.errorMessage}`:""}`,level:d.state==="error"?"error":"info",type:"complete"};case"loop.detected":return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:`Loop detected: ${d.toolName??""} called ${d.callCount??0}× in ${d.windowSeconds??60}s window`,level:"warn",type:"log"};default:return{id:f.id,timestamp:f.timestamp,agentId:x,agentName:v,message:JSON.stringify(d).slice(0,120),level:"debug",type:"log"}}}),[t,l,h]),m=C.useMemo(()=>{const b=new Map;for(const f of p)f.agentId&&!b.has(f.agentId)&&b.set(f.agentId,f.agentName??f.agentId.slice(0,8));return Array.from(b.entries())},[p]),g=C.useMemo(()=>{const b=[e.purple,e.info,e.running,e.warn,"#FF8844","#44FFBB"],f=new Map;return m.forEach(([d],x)=>f.set(d,b[x%b.length])),f},[m,e]),y=C.useMemo(()=>p.filter(b=>{var f;if(a!=="all"&&b.agentId!==a||c!=="all"&&b.level!==c)return!1;if(u){const d=u.toLowerCase();if(!b.message.toLowerCase().includes(d)&&!((f=b.agentName)!=null&&f.toLowerCase().includes(d)))return!1}return!0}),[p,a,c,u]),j=a==="all"&&m.length>1;return p.length===0?i.jsx(We,{icon:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.44-3.54z"}),i.jsx("path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.44-3.54z"})]}),title:"No Reasoning Steps",description:"Agent logs, state transitions, and checkpoints will appear here as your agent runs."}):i.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-4 py-2 flex-wrap",style:{borderColor:"rgba(255,255,255,0.07)",background:e.toolbarBg},children:[i.jsx("span",{className:"font-mono text-[10px] uppercase tracking-widest text-zinc-500 mr-1",children:"Reasoning"}),i.jsx("div",{className:"h-4 w-px",style:{background:"rgba(255,255,255,0.08)"}}),i.jsx(Cr,{name:"all",isActive:a==="all",color:e.info,onClick:()=>s("all")}),m.map(([b,f])=>i.jsx(Cr,{name:f,isActive:a===b,color:g.get(b)??e.purple,onClick:()=>s(b)},b)),i.jsx("div",{className:"h-4 w-px mx-1",style:{background:"rgba(255,255,255,0.08)"}}),["all","info","warn","error","debug"].map(b=>{const f=b==="all"?"#52525b":b==="error"?e.error:b==="warn"?e.warn:b==="debug"?e.purple:e.info;return i.jsx("button",{onClick:()=>o(b),className:"rounded px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-widest transition-colors",style:c===b?{background:`${f}22`,color:f,border:`1px solid ${f}44`}:{color:"#52525b",border:"1px solid transparent"},children:b},b)}),i.jsx("div",{className:"flex-1"}),i.jsx("input",{type:"text",placeholder:"search...",value:u,onChange:b=>r(b.target.value),className:"h-6 rounded border bg-transparent px-2 text-[11px] font-mono text-zinc-300 placeholder-zinc-700 outline-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.08)",width:130}}),u&&i.jsx("button",{onClick:()=>r(""),className:"font-mono text-[10px] text-zinc-600",children:"✕"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:y.length})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b px-4 py-1",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(0,0,0,0.25)"},children:[i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Time"}),i.jsx("span",{className:"w-20 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Type"}),i.jsx("span",{className:"w-12 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Level"}),j&&i.jsx("span",{className:"w-24 shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Agent"}),i.jsx("span",{className:"flex-1 font-mono text-[9px] uppercase tracking-widest text-zinc-700",children:"Message"})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:y.length===0?i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"no matching steps"}):y.map(b=>i.jsx(wp,{step:b,showAgent:j},b.id))})]})}const Ii={"claude-opus-4-7":2e5,"claude-opus-4-6":2e5,"claude-sonnet-4-6":2e5,"claude-sonnet-4-5":2e5,"claude-sonnet-4-5-20251001":2e5,"claude-haiku-4-5":2e5,"claude-haiku-4-5-20251001":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-haiku-20241022":2e5,"claude-3-opus-20240229":2e5},Pi={"claude-opus-4-7":"Claude Opus 4.7","claude-opus-4-6":"Claude Opus 4.6","claude-sonnet-4-6":"Claude Sonnet 4.6","claude-sonnet-4-5":"Claude Sonnet 4.5","claude-haiku-4-5":"Claude Haiku 4.5"};function Tr(e){if(Ii[e])return Ii[e];for(const[t,l]of Object.entries(Ii))if(e.startsWith(t.split("-").slice(0,3).join("-")))return l;return 2e5}function Mp(e){if(Pi[e])return Pi[e];for(const[t,l]of Object.entries(Pi))if(e===t||e.startsWith(`${t}-`))return l;return e}function Ep({pct:e,color:t,label:l}){const n=Math.min(100,Math.max(0,e)),a=n>=90?"#FF3366":n>=70?"#FFAA00":t;return i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"shrink-0 font-mono text-[9px] uppercase tracking-widest text-zinc-600 w-20 text-right",children:l}),i.jsx("div",{className:"flex-1 rounded-full overflow-hidden",style:{height:6,background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${n}%`,background:a,boxShadow:n>50?`0 0 8px ${a}66`:"none"}})}),i.jsxs("span",{className:"shrink-0 font-mono text-xs font-semibold w-12 text-right",style:{color:a},children:[n.toFixed(1),"%"]})]})}function Ia({label:e,value:t,color:l,pct:n,caption:a}){const s=Math.min(100,Math.max(0,n));return i.jsxs("div",{className:"flex flex-col gap-1.5 rounded-lg p-3",style:{background:`${l}0D`,border:`1px solid ${l}22`},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest",style:{color:`${l}99`},children:e}),i.jsx("span",{className:"font-mono text-xs font-bold",style:{color:l},children:t.toLocaleString()})]}),i.jsx("div",{className:"rounded-full overflow-hidden",style:{height:3,background:"rgba(255,255,255,0.06)"},children:i.jsx("div",{className:"h-full rounded-full",style:{width:`${s}%`,background:l}})}),i.jsx("span",{className:"font-mono text-[9px]",style:{color:`${l}77`},children:a})]})}function Dp({point:e,isLast:t}){const l=H(),n=Math.min(100,Math.max(2,e.pct)),a=e.pct>=90?l.error:e.pct>=70?l.warn:l.info,s=e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens;return i.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[i.jsx("div",{className:"flex-1 min-w-0 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.04)"},children:i.jsx("div",{className:"h-2 rounded-full transition-all",style:{width:`${n}%`,background:a,opacity:t?1:.5}})}),i.jsxs("span",{className:"font-mono text-[9px] shrink-0 tabular-nums w-12 text-right",style:{color:a},children:[e.pct.toFixed(1),"%"]}),i.jsxs("span",{className:"font-mono text-[9px] shrink-0 text-zinc-600 tabular-nums w-20 text-right",children:[s.toLocaleString()," tok"]})]})}function Op(){const e=H(),{events:t}=Le(),{activeSessionId:l}=ce(),n=C.useMemo(()=>(l?t.filter(b=>b.sessionId===l):t).filter(b=>b.type==="cost.update"),[t,l]),a=C.useMemo(()=>n.slice().reverse().map(j=>{const b=j.payload,f=b.inputTokens??0,d=b.outputTokens??0,x=b.cacheReadTokens??0,v=b.cacheWriteTokens??0,S=b.model??"",z=Tr(S),N=f+x+v,M=z>0?N/z*100:0;return{timestamp:j.timestamp,inputTokens:f,outputTokens:d,cacheReadTokens:x,cacheWriteTokens:v,model:S,contextLimit:z,pct:M}}),[n]),s=C.useMemo(()=>a[a.length-1]??null,[a]),c=C.useMemo(()=>(l?t.filter(b=>b.sessionId===l):t).find(b=>b.type==="session.summary"),[t,l]),o=C.useMemo(()=>{if(!c)return null;const j=c.payload;return{input:j.inputTokens??0,output:j.outputTokens??0,cacheRead:j.cacheReadTokens??0,cacheWrite:j.cacheWriteTokens??0,model:c.payload.model??""}},[c]),u=s?{input:s.inputTokens,output:s.outputTokens,cacheRead:s.cacheReadTokens,cacheWrite:s.cacheWriteTokens,model:s.model}:o;if(!u&&a.length===0)return i.jsx(We,{icon:i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[i.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),i.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),i.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),title:"No Context Data",description:"Context window utilization will appear here once your agent makes API calls."});const r=u?Tr(u.model):2e5,h=u?u.input+u.cacheRead+u.cacheWrite:0,p=r>0?h/r*100:0,m=p>=90?e.error:p>=70?e.warn:e.running,g=j=>r>0?j/r*100:0,y=j=>`${g(j).toFixed(1)}% of ctx`;return i.jsxs("div",{className:"flex h-full flex-col overflow-y-auto p-5 gap-6 w-full mx-auto",style:{maxWidth:"95vw"},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"font-mono text-sm font-bold text-zinc-200",children:"Context Window"}),i.jsxs("p",{className:"font-mono text-[10px] text-zinc-600 mt-0.5",children:[u!=null&&u.model?Mp(u.model):"unknown model"," — ",r.toLocaleString()," token limit"]})]}),i.jsxs("div",{className:"flex flex-col items-end",style:{color:m},children:[i.jsxs("span",{className:"font-mono text-3xl font-bold leading-none",children:[p.toFixed(1),"%"]}),i.jsx("span",{className:"font-mono text-[10px] mt-0.5",children:"utilization"})]})]}),i.jsx("div",{className:"space-y-3",children:i.jsx(Ep,{pct:p,color:e.info,label:"Input ctx"})}),u&&i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(Ia,{label:"Input Tokens",value:u.input,color:e.info,pct:g(u.input),caption:y(u.input)}),i.jsx(Ia,{label:"Output Tokens",value:u.output,color:e.running,pct:g(u.output),caption:"generated (not in ctx)"}),i.jsx(Ia,{label:"Cache Reads",value:u.cacheRead,color:e.warn,pct:g(u.cacheRead),caption:y(u.cacheRead)}),i.jsx(Ia,{label:"Cache Writes",value:u.cacheWrite,color:e.purple,pct:g(u.cacheWrite),caption:y(u.cacheWrite)})]}),p>=70&&i.jsxs("div",{className:"rounded-lg p-3 flex items-start gap-2",style:{background:`${m}0D`,border:`1px solid ${m}33`},children:[i.jsx("span",{className:"text-lg leading-none",children:p>=90?"⚠️":"📊"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-mono text-xs font-semibold",style:{color:m},children:p>=90?"Context Critical":"Context Pressure"}),i.jsx("p",{className:"font-mono text-[10px] text-zinc-400 mt-1",children:p>=90?`Context window is ${p.toFixed(0)}% full. The model may truncate or refuse soon.`:`At ${p.toFixed(0)}% utilization. Consider summarizing or starting a new session.`})]})]}),a.length>1&&i.jsxs("div",{children:[i.jsxs("p",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600 mb-2",children:["Context Growth (",a.length," snapshots)"]}),i.jsx("div",{className:"space-y-0.5",children:a.map((j,b)=>i.jsx(Dp,{point:j,isLast:b===a.length-1},j.timestamp))})]})]})}function Up({line:e}){const t=H();return e.startsWith("+++")||e.startsWith("---")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:"#71717a"},children:e}):e.startsWith("+")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:t.running,background:`${t.running}0A`},children:e}):e.startsWith("-")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:t.error,background:`${t.error}0A`},children:e}):e.startsWith("@@")?i.jsx("div",{className:"font-mono text-[10px] leading-relaxed",style:{color:t.info},children:e}):i.jsx("div",{className:"font-mono text-[10px] leading-relaxed text-zinc-500",children:e})}function D0({node:e,depth:t,statusMap:l,selectedFile:n,onSelect:a}){var g,y;const s=H(),[c,o]=C.useState(t<2),u=l.get(e.path),r=n===e.path;if(e.type==="dir"){const j=((g=e.children)==null?void 0:g.some(b=>l.has(b.path)))??!1;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-1 cursor-pointer hover:bg-white/[0.03] rounded px-1 py-0.5",style:{paddingLeft:`${t*12+4}px`},onClick:()=>o(b=>!b),children:[i.jsx("span",{className:"font-mono text-[10px] text-zinc-600 shrink-0 w-3",children:c?"▾":"▸"}),i.jsxs("span",{className:"font-mono text-[10px] truncate",style:{color:j?s.warn:"#52525b"},children:[e.name,"/"]})]}),c&&((y=e.children)==null?void 0:y.map(b=>i.jsx(D0,{node:b,depth:t+1,statusMap:l,selectedFile:n,onSelect:a},b.path)))]})}let h="#52525b",p="",m="#52525b";return u&&(u.staged?(p=u.status,m=u.status==="A"?s.running:u.status==="D"?s.error:s.warn,h="#d4d4d8"):u.untracked?(p="?",m="#52525b",h="#71717a"):(p=u.workStatus,m=u.workStatus==="D"?s.error:s.warn,h="#a1a1aa")),i.jsxs("div",{className:ge("flex items-center gap-1 cursor-pointer rounded px-1 py-0.5 transition-colors",r?"bg-white/[0.06]":"hover:bg-white/[0.03]"),style:{paddingLeft:`${t*12+4}px`},onClick:()=>u&&a(e.path,u.staged),children:[p?i.jsx("span",{className:"shrink-0 font-mono text-[9px] font-bold w-3 text-center",style:{color:m},children:p}):i.jsx("span",{className:"shrink-0 w-3"}),i.jsx("span",{className:"font-mono text-[10px] truncate",style:{color:h},children:e.name})]})}function ec({title:e,files:t,color:l,selectedFile:n,staged:a,onSelect:s,onStage:c,onUnstage:o,onDiscard:u,loading:r}){const h=H(),[p,m]=C.useState(new Set);if(t.length===0)return null;const g=f=>{m(d=>{const x=new Set(d);return x.has(f)?x.delete(f):x.add(f),x})},y=t.every(f=>p.has(f.path)),j=()=>{m(y?new Set:new Set(t.map(f=>f.path)))},b=t.filter(f=>p.has(f.path)).map(f=>f.path);return i.jsxs("div",{className:"mb-1",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 sticky top-0",style:{background:"rgba(9,9,11,0.95)",borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:j,className:"flex items-center gap-1",children:i.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center",style:{borderColor:y?l:"rgba(255,255,255,0.15)",background:y?l:"transparent"},children:y&&i.jsx("span",{style:{color:"#09090B",fontSize:8,fontWeight:900},children:"✓"})})}),i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest",style:{color:l},children:e}),i.jsx("span",{className:"font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:l,background:`${l}1A`,border:`1px solid ${l}33`},children:t.length})]}),i.jsx("div",{className:"flex items-center gap-1",children:b.length>0&&i.jsxs(i.Fragment,{children:[c&&i.jsxs("button",{disabled:r,onClick:()=>{c(b),m(new Set)},className:"font-mono text-[9px] px-1.5 py-0.5 rounded transition-colors disabled:opacity-40",style:{color:h.running,background:`${h.running}1A`,border:`1px solid ${h.running}33`},children:["Stage ",b.length]}),o&&i.jsxs("button",{disabled:r,onClick:()=>{o(b),m(new Set)},className:"font-mono text-[9px] px-1.5 py-0.5 rounded transition-colors disabled:opacity-40",style:{color:h.warn,background:`${h.warn}1A`,border:`1px solid ${h.warn}33`},children:["Unstage ",b.length]}),u&&i.jsxs("button",{disabled:r,onClick:()=>{confirm(`Discard changes to ${b.length} file(s)?`)&&(u(b),m(new Set))},className:"font-mono text-[9px] px-1.5 py-0.5 rounded transition-colors disabled:opacity-40",style:{color:h.error,background:`${h.error}1A`,border:`1px solid ${h.error}33`},children:["Discard ",b.length]})]})})]}),t.map(f=>{const d=a?f.status:f.untracked?"?":f.workStatus,x=d==="A"?h.running:d==="D"?h.error:d==="?"?"#52525b":h.warn,v=n===f.path;return i.jsxs("div",{className:ge("flex items-center gap-2 px-3 py-1 cursor-pointer transition-colors",v?"bg-white/[0.05]":"hover:bg-white/[0.02]"),onClick:()=>s(f.path,a),children:[i.jsx("button",{onClick:S=>{S.stopPropagation(),g(f.path)},className:"shrink-0",children:i.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center",style:{borderColor:p.has(f.path)?x:"rgba(255,255,255,0.15)",background:p.has(f.path)?x:"transparent",display:"inline-flex"},children:p.has(f.path)&&i.jsx("span",{style:{color:"#09090B",fontSize:8,fontWeight:900},children:"✓"})})}),i.jsx("span",{className:"shrink-0 font-mono text-[9px] font-bold w-3 text-center",style:{color:x},children:d}),i.jsx("span",{className:"flex-1 font-mono text-[10px] text-zinc-300 truncate",title:f.path,children:f.path.split("/").pop()}),i.jsx("span",{className:"font-mono text-[9px] text-zinc-600 truncate max-w-32",title:f.path,children:f.path.includes("/")?f.path.slice(0,f.path.lastIndexOf("/")):""})]},f.path)})]})}function Bp({status:e,gitRoot:t,onSuccess:l,loading:n,setLoading:a}){var M;const s=H(),{collectorUrl:c}=Oa(),[o,u]=C.useState(""),[r,h]=C.useState(""),[p,m]=C.useState(""),g=C.useRef(null),y=c.replace(/^ws/,"http").replace(/\/ws$/,""),j=(e==null?void 0:e.staged.length)??0,b=(e==null?void 0:e.remotes[0])??"origin",f=(e==null?void 0:e.branch)??"",d=((M=e==null?void 0:e.aheadBehind)==null?void 0:M.ahead)??0,x=o.trim().length>0&&j>0,v=d>0||j===0;async function S(){if(x){a(!0),m(""),h("");try{const A=await fetch(`${y}/api/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:o.trim(),gitRoot:t})}),D=await A.json();if(!A.ok||D.error){m(D.error??"Commit failed");return}h(D.output??"Committed"),u(""),l()}catch(A){m(A instanceof Error?A.message:String(A))}finally{a(!1)}}}async function z(){a(!0),m(""),h("");try{const A=await fetch(`${y}/api/git/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({remote:b,branch:f,gitRoot:t})}),D=await A.json();if(!A.ok||D.error){m(D.error??"Push failed");return}h(D.output||"Pushed successfully"),l()}catch(A){m(A instanceof Error?A.message:String(A))}finally{a(!1)}}async function N(){a(!0),m(""),h("");try{const A=await fetch(`${y}/api/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:o.trim(),gitRoot:t})}),D=await A.json();if(!A.ok||D.error){m(D.error??"Commit failed");return}const X=await fetch(`${y}/api/git/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({remote:b,branch:f,gitRoot:t})}),te=await X.json();if(!X.ok||te.error){h(`Committed. Push failed: ${te.error??""}`);return}h(`${D.output??"Committed"}
|
|
53
53
|
|
|
54
|
-
${te.output||"Pushed"}`),u(""),l()}catch(A){m(A instanceof Error?A.message:String(A))}finally{a(!1)}}return i.jsxs("div",{className:"flex flex-col h-full p-4 gap-4",children:[i.jsxs("div",{className:"rounded-lg p-3 flex items-center justify-between",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)"},children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-mono text-xs font-semibold text-zinc-200",children:f}),i.jsxs("p",{className:"font-mono text-[10px] text-zinc-600",children:[j," staged file",j!==1?"s":"",(e==null?void 0:e.aheadBehind)&&i.jsxs("span",{className:"ml-2",style:{color:d>0?s.warn:"#52525b"},children:["↑",d," ↓",e.aheadBehind.behind]})]})]}),b&&i.jsx("span",{className:"font-mono text-[9px] text-zinc-600",children:b})]}),j===0&&i.jsx("div",{className:"rounded px-3 py-2 font-mono text-[10px]",style:{background:`${s.warn}0D`,border:`1px solid ${s.warn}22`,color:s.warn},children:"No staged changes. Stage files to commit."}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600",children:"Commit Message"}),i.jsx("textarea",{ref:g,value:o,onChange:A=>u(A.target.value),placeholder:"feat: describe what you changed...",rows:4,className:"rounded border bg-transparent px-3 py-2 font-mono text-xs text-zinc-200 placeholder-zinc-700 outline-none resize-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.10)",background:"rgba(0,0,0,0.3)"},onKeyDown:A=>{A.key==="Enter"&&(A.metaKey||A.ctrlKey)&&S()}}),i.jsx("p",{className:"font-mono text-[9px] text-zinc-700",children:"⌘↵ to commit"})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("button",{disabled:!x||n,onClick:S,className:"w-full rounded py-2 font-mono text-xs font-semibold transition-all disabled:opacity-40",style:{background:`${s.running}22`,color:s.running,border:`1px solid ${s.running}44`},children:n?"Working...":`Commit (${j} file${j!==1?"s":""})`}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("button",{disabled:n||!v,onClick:z,className:"flex-1 rounded py-1.5 font-mono text-xs transition-all disabled:opacity-40",style:{color:s.info,border:`1px solid ${s.info}44`,background:`${s.info}0D`},children:["Push",b?` → ${b}`:""]}),i.jsx("button",{disabled:!x||n,onClick:N,className:"flex-1 rounded py-1.5 font-mono text-xs transition-all disabled:opacity-40",style:{color:s.purple,border:`1px solid ${s.purple}44`,background:`${s.purple}0D`},children:"Commit + Push"})]})]}),r&&i.jsx("div",{className:"rounded p-2.5 font-mono text-[10px] whitespace-pre-wrap",style:{background:`${s.running}0D`,border:`1px solid ${s.running}22`,color:s.running},children:r}),p&&i.jsx("div",{className:"rounded p-2.5 font-mono text-[10px] whitespace-pre-wrap",style:{background:`${s.error}0D`,border:`1px solid ${s.error}33`,color:s.error},children:p})]})}function Up(){const e=H(),{collectorUrl:t}=Da(),l=t.replace(/^ws/,"http").replace(/\/ws$/,""),{events:n}=Le(),{activeSessionId:a}=ce(),[s,c]=C.useState(null),[o,u]=C.useState([]),[r,h]=C.useState(!1),[p,m]=C.useState(!1),[g,y]=C.useState(!1),[j,b]=C.useState(""),[f,d]=C.useState(""),[x,v]=C.useState(""),[S,z]=C.useState(null),[N,M]=C.useState(!1),[A,D]=C.useState(""),[X,te]=C.useState("diff"),[E,_]=C.useState(!1),F=C.useMemo(()=>{const U=new Map;for(const W of n){if(W.type!=="git.context")continue;const de=W.payload.gitRoot;if(!de||U.has(de))continue;const $e=de.split("/").filter(Boolean),di=$e.length>=2?`${$e[$e.length-2]}/${$e[$e.length-1]}`:$e[$e.length-1]??de;U.set(de,di)}return Array.from(U.entries()).map(([W,de])=>({root:W,label:de}))},[n]);C.useEffect(()=>{if(!a)return;const U=n.find(W=>W.sessionId===a&&W.type==="git.context");if(U){const W=U.payload.gitRoot;W&&W!==f&&(d(W),v(""))}},[a,n]);const w=C.useCallback(async U=>{h(!0),b("");try{const W=U?`?gitRoot=${encodeURIComponent(U)}`:"",de=await fetch(`${l}/api/git/status${W}`),$e=await de.json();if(!de.ok||$e.error){b($e.error??"Failed to load git status");return}c($e),d($e.gitRoot)}catch(W){b(W instanceof Error?W.message:"Network error")}finally{h(!1)}},[l]),B=C.useCallback(async U=>{try{const de=await(await fetch(`${l}/api/git/files?gitRoot=${encodeURIComponent(U)}`)).json();de.tree&&u(de.tree)}catch{}},[l]);C.useEffect(()=>{w(f||void 0)},[w,f]),C.useEffect(()=>{f&&E&&B(f)},[f,E,B]);const k=C.useCallback(async(U,W)=>{m(!0),D("");try{const de=new URLSearchParams({file:U,gitRoot:f});W&&de.set("staged","1");const di=await(await fetch(`${l}/api/git/diff?${de}`)).json();D(di.diff??"")}catch{}finally{m(!1)}},[l,f]),O=C.useCallback((U,W)=>{z(U),M(W),te("diff"),k(U,W)},[k]);async function $(U){y(!0);try{await fetch(`${l}/api/git/stage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:U,gitRoot:f})}),await w(f)}finally{y(!1)}}async function we(U){y(!0);try{await fetch(`${l}/api/git/unstage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:U,gitRoot:f})}),await w(f)}finally{y(!1)}}async function Lt(U){y(!0);try{await fetch(`${l}/api/git/discard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:U,gitRoot:f})}),await w(f)}finally{y(!1)}}const _l=new Map;if(s)for(const U of[...s.staged,...s.unstaged,...s.untracked])_l.set(U.path,U);const vt=s?s.staged.length+s.unstaged.length+s.untracked.length:0;return i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex flex-col overflow-hidden border-r",style:{width:320,flexShrink:0,borderColor:"rgba(255,255,255,0.08)"},children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",style:{borderColor:"rgba(255,255,255,0.08)",background:e.toolbarBg},children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"shrink-0 text-zinc-400",children:[i.jsx("circle",{cx:"12",cy:"12",r:"4"}),i.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),i.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),i.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),i.jsx("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),i.jsx("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),i.jsx("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),i.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),i.jsx("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"})]}),s?i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"font-mono text-xs font-semibold text-zinc-200 truncate block",children:s.branch}),s.aheadBehind&&i.jsxs("span",{className:"font-mono text-[9px]",style:{color:s.aheadBehind.ahead>0?e.warn:"#52525b"},children:["↑",s.aheadBehind.ahead," ↓",s.aheadBehind.behind]})]}):i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:"not a git repo"})]}),i.jsx("button",{onClick:()=>w(f),disabled:r,className:"shrink-0 p-1 rounded hover:bg-white/[0.05] transition-colors disabled:opacity-40",title:"Refresh",children:i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:r?"animate-spin":"",children:[i.jsx("polyline",{points:"23 4 23 10 17 10"}),i.jsx("polyline",{points:"1 20 1 14 7 14"}),i.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})})]}),i.jsxs("div",{className:"shrink-0 flex flex-col gap-0 border-b",style:{borderColor:"rgba(255,255,255,0.05)"},children:[F.length>0&&i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b",style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"shrink-0 text-zinc-600",children:[i.jsx("circle",{cx:"18",cy:"18",r:"3"}),i.jsx("circle",{cx:"6",cy:"6",r:"3"}),i.jsx("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),i.jsx("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),i.jsx("select",{value:f,onChange:U=>{d(U.target.value),v(""),w(U.target.value)},className:"flex-1 bg-transparent font-mono text-[10px] text-zinc-300 outline-none cursor-pointer",style:{background:"transparent"},children:F.map(({root:U,label:W})=>i.jsx("option",{value:U,style:{background:"#09090B",color:"#d4d4d8"},children:W},U))})]}),i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5",children:[i.jsx("input",{type:"text",value:x,onChange:U=>v(U.target.value),onKeyDown:U=>{U.key==="Enter"&&w(x||void 0)},placeholder:f||"git root path (Enter to apply)",className:"flex-1 bg-transparent font-mono text-[10px] text-zinc-500 placeholder-zinc-700 outline-none truncate"}),x&&i.jsx("button",{onClick:()=>{w(x)},className:"shrink-0 font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:e.info,border:`1px solid ${e.info}33`},children:"Go"})]})]}),j&&i.jsx("div",{className:"shrink-0 px-3 py-2 font-mono text-[10px]",style:{color:e.error,background:`${e.error}0D`},children:j}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s&&i.jsxs(i.Fragment,{children:[vt===0&&i.jsx("div",{className:"flex items-center justify-center h-16 font-mono text-[10px] text-zinc-600",children:"Working tree clean"}),i.jsx(Pi,{title:"Staged",files:s.staged,color:e.running,selectedFile:S,staged:!0,onSelect:O,onUnstage:we,loading:g}),i.jsx(Pi,{title:"Changes",files:s.unstaged,color:e.warn,selectedFile:S,staged:!1,onSelect:O,onStage:$,onDiscard:Lt,loading:g}),i.jsx(Pi,{title:"Untracked",files:s.untracked,color:"#52525b",selectedFile:S,staged:!1,onSelect:O,onStage:$,loading:g})]}),f&&i.jsxs("div",{className:"mt-2 border-t",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsxs("button",{onClick:()=>_(U=>!U),className:"flex items-center gap-1.5 w-full px-3 py-2 text-left hover:bg-white/[0.02] transition-colors",children:[i.jsx("span",{className:"font-mono text-[9px] text-zinc-600",children:E?"▾":"▸"}),i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600",children:"All Files"})]}),E&&i.jsx("div",{className:"pb-2",children:o.map(U=>i.jsx(E0,{node:U,depth:0,statusMap:_l,selectedFile:S,onSelect:O},U.path))})]})]})]}),i.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b px-3 py-1.5",style:{borderColor:"rgba(255,255,255,0.08)",background:e.toolbarBg},children:[["diff","commit"].map(U=>{const W=X===U,de=U==="commit"?e.running:e.info;return i.jsx("button",{onClick:()=>te(U),className:"rounded px-3 py-1 font-mono text-[10px] capitalize transition-colors",style:W?{background:`${de}1A`,color:de,border:`1px solid ${de}33`}:{color:"#52525b",border:"1px solid transparent"},children:U==="commit"?i.jsxs("span",{className:"flex items-center gap-1",children:["Commit",s!=null&&s.staged.length?i.jsx("span",{className:"font-mono text-[8px] px-1 py-0.5 rounded-full",style:{background:`${e.running}22`,color:e.running},children:s.staged.length}):null]}):S?`diff: ${S.split("/").pop()}`:"Diff"},U)}),S&&X==="diff"&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"font-mono text-[9px] text-zinc-600 mx-1",children:"—"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-400 truncate",children:S}),i.jsx("span",{className:"font-mono text-[9px] px-1.5 py-0.5 rounded ml-1",style:{color:N?e.running:e.warn,background:N?`${e.running}1A`:`${e.warn}1A`},children:N?"staged":"unstaged"})]})]}),X==="diff"?i.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:p?i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"Loading diff..."}):S?A?i.jsx("div",{children:A.split(`
|
|
55
|
-
`).map((U,W)=>i.jsx(Dp,{line:U},W))}):i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"No diff available"}):i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center",children:[i.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",className:"text-zinc-700",children:[i.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"}),i.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),i.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),i.jsx("polyline",{points:"10 9 9 9 8 9"})]}),i.jsx("p",{className:"font-mono text-xs text-zinc-600",children:"Select a file to view its diff"})]})}):i.jsx(Op,{status:s,gitRoot:f,onSuccess:()=>w(f),loading:g,setLoading:y})]})]})}function Bp({activePanel:e}){return i.jsxs("main",{className:"flex-1 overflow-hidden",children:[e==="events"&&i.jsx(Hx,{}),e==="agents"&&i.jsx(Zx,{}),e==="tools"&&i.jsx(Np,{}),e==="reasoning"&&i.jsx(kp,{}),e==="context"&&i.jsx(Ep,{}),e==="cost"&&i.jsx(Kx,{}),e==="checkpoints"&&i.jsx(Px,{}),e==="mcp"&&i.jsx(np,{}),e==="git"&&i.jsx(Up,{}),e==="bash"&&i.jsx(up,{}),e==="intelligence"&&i.jsx(cp,{}),e==="history"&&i.jsx(gp,{})]})}const Rp=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,Tr=1e3,Hp=3e4,_p=1.5;function ec(e,t){if(!e)return t;try{return JSON.parse(e)}catch{return t}}function kr(e){const t=e.id,l=e.name??"";return{id:t,name:l||t.slice(0,8),startedAt:e.startedAt??e.started_at,endedAt:e.endedAt??e.ended_at??void 0,lastActivityAt:e.lastActivityAt??e.last_activity_at??void 0,totalCostUsd:e.totalCostUsd??e.total_cost??0,totalEvents:e.totalEvents??e.total_tokens??0,agentCount:e.agentCount??e.agent_count??0,status:e.status==="active"?"active":"ended"}}function Lp(e){const t=e.payload,l=typeof t=="string"?JSON.parse(t):t??{};return{id:e.id,sessionId:e.sessionId??e.session_id,timestamp:e.timestamp,type:e.type,source:e.source,payload:l}}function $p(e){return{id:e.id,sessionId:e.sessionId??e.session_id,parentId:e.parentId??e.parent_id,name:e.name,status:e.status,spawnedAt:e.spawnedAt??e.spawned_at,completedAt:e.completedAt??e.completed_at??void 0,depth:e.depth??0,loopCount:e.loopCount??e.loop_count??0,toolCallCount:0,logs:[],children:[]}}function qp(e){const t=Le.getState().addEvent,l=Ae.getState().upsertAgent,n=Ae.getState().updateAgentStatus,a=Ae.getState().incrementToolCallCount,s=Ae.getState().addAgentLog,c=Ae.getState().addLoopAlert,o=ce.getState().upsertSession,u=Gl.getState().upsertServer,r=Gl.getState().setServerStatus,h=Gl.getState().updateHeartbeat,p=Gl.getState().addCallRecord,m=Gl.getState().updateCallRecord,g=Fo.getState().addCheckpoint;t(e);{const y=ce.getState().sessions.find(j=>j.id===e.sessionId);y&&(y.lastActivityAt??0)<e.timestamp&&o({...y,lastActivityAt:e.timestamp})}switch(e.type){case"session.start":{const y=e.payload,j=y.sessionId??e.sessionId;o({id:j,name:y.name??j.slice(0,8),startedAt:y.startedAt??e.timestamp,totalCostUsd:0,totalEvents:0,agentCount:0,status:"active"});break}case"session.end":{const y=e.payload,j=y.sessionId??e.sessionId,f=ce.getState().sessions.find(d=>d.id===j);f&&o({...f,status:"ended",endedAt:e.timestamp,totalCostUsd:f.totalCostUsd||y.totalCostUsd,totalEvents:f.totalEvents||y.totalEvents});break}case"agent.spawn":{const y=e.payload;l({id:y.agentId,sessionId:e.sessionId,parentId:y.parentId,name:y.name,status:"running",spawnedAt:e.timestamp,depth:y.depth,loopCount:0,toolCallCount:0,logs:[],children:[]});const b=ce.getState().sessions.find(f=>f.id===e.sessionId);b&&ce.getState().upsertSession({...b,agentCount:b.agentCount+1});break}case"agent.complete":{const y=e.payload;n(y.agentId,"completed",e.timestamp);break}case"agent.state_change":{const y=e.payload;y.nextState==="error"?(n(y.agentId,"failed",e.timestamp),y.reason&&s(y.agentId,{timestamp:e.timestamp,message:`Failed: ${y.reason}`,level:"error"})):y.nextState==="complete"?n(y.agentId,"completed",e.timestamp):y.nextState==="running"?n(y.agentId,"running"):y.nextState==="waiting"&&n(y.agentId,"waiting");break}case"agent.fail":{const y=e.payload;n(y.agentId,"failed",e.timestamp),s(y.agentId,{timestamp:e.timestamp,message:`Agent failed: ${y.error}`,level:"error"});break}case"agent.log":{const y=e.payload;s(y.agentId,{timestamp:e.timestamp,message:y.message,level:y.level});break}case"agent.checkpoint":{const y=e.payload,j=Ae.getState().getAgent(y.agentId);g({id:y.checkpointId,sessionId:e.sessionId,agentId:y.agentId,agentName:(j==null?void 0:j.name)??y.agentId,label:y.label,timestamp:e.timestamp,conversationHistory:y.conversationHistory,agentState:y.agentState,fileSnapshots:y.fileSnapshots});break}case"checkpoint.create":{const y=e.payload,j=Ae.getState().getAgent(y.agentId);g({id:e.id,sessionId:e.sessionId,agentId:y.agentId,agentName:(j==null?void 0:j.name)??y.agentId,label:y.label,timestamp:e.timestamp,conversationHistory:[],agentState:y.metadata??{},fileSnapshots:[]});break}case"cost.update":break;case"tool.call":{const y=e.payload;a(y.agentId);break}case"session.summary":{ri.getState().setSummary(e.sessionId,e.payload);break}case"loop.detected":{const y=e.payload,j=Ae.getState().getAgent(y.agentId);j&&Ae.getState().upsertAgent({...j,loopCount:y.loopCount}),c({id:e.id,agentId:y.agentId,agentName:y.agentName,toolName:y.toolName,loopCount:y.loopCount,detectedAt:e.timestamp});break}case"mcp.connect":{const y=e.payload;u({id:y.serverId,name:y.serverName,status:"connected",tools:y.tools,callCount:0,errorCount:0,lastHeartbeat:e.timestamp,connectedAt:e.timestamp});break}case"mcp.disconnect":{const y=e.payload;r(y.serverId,"disconnected");break}case"mcp.tool.call":{const y=e.payload;p({id:e.id,serverId:y.serverId,serverName:y.serverName,toolName:y.toolName,callId:y.callId,input:y.input,timestamp:e.timestamp,status:"pending"});break}case"mcp.tool.result":{const y=e.payload;m(y.callId,{output:y.output,durationMs:y.durationMs,isError:y.isError,status:y.isError?"error":"completed",serverId:y.serverId});break}case"mcp.heartbeat":{const y=e.payload;h(y.serverId,y.timestamp);break}}}function Yp(){const e=C.useRef(null),t=C.useRef(Tr),l=C.useRef(null),n=C.useRef(!0),{setStatus:a,setLastHeartbeat:s}=Da(),{activeSessionId:c}=ce(),o=C.useCallback((p,m)=>{p.readyState===WebSocket.OPEN&&p.send(JSON.stringify({type:"subscribe",sessionId:m}))},[]),u=C.useCallback(async()=>{var p;try{const[m,g]=await Promise.allSettled([(async()=>{var f;const y=[];let j=1,b=1;do{const d=await fetch(`/api/sessions?page=${j}&pageSize=100`);if(!d.ok)break;const x=await d.json();Array.isArray(x.data)&&y.push(...x.data),b=((f=x.meta)==null?void 0:f.totalPages)??1,j++}while(j<=b);return y})(),fetch("/api/summaries").then(y=>y.ok?y.json():null)]);if(m.status==="fulfilled"){const y=m.value.map(j=>kr(j));ce.getState().setSessions(y)}if(g.status==="fulfilled"&&((p=g.value)!=null&&p.data)){const y=ri.getState().setSummary;for(const{sessionId:j,summary:b}of g.value.data)j&&b&&y(j,b)}}catch{}},[]),r=C.useCallback(()=>{n.current&&(l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{t.current=Math.min(t.current*_p,Hp),h()},t.current))},[]),h=C.useCallback(()=>{if(!n.current||e.current&&e.current.readyState===WebSocket.OPEN)return;a("connecting");const p=new WebSocket(Rp);e.current=p,p.onopen=()=>{if(!n.current)return;t.current=Tr,a("connected"),s(Date.now()),o(p,"*"),u();const m=ce.getState().activeSessionId;m&&o(p,m)},p.onmessage=m=>{if(!n.current)return;s(Date.now());let g;try{g=JSON.parse(m.data)}catch{return}if(g.type==="event")qp(g.data);else if(g.type==="snapshot"){const y=g.data,j=y.session,b=y.events??[],f=y.agents??[],d=y.checkpoints??[];ce.getState().upsertSession(kr(j)),Le.getState().addEvents(b.map(Lp));for(const x of f)Ae.getState().upsertAgent($p(x));for(const x of d){const v=x.agent_id??x.agentId;if(!v)continue;const S=Ae.getState().getAgent(v);Fo.getState().addCheckpoint({id:x.id,sessionId:x.session_id??x.sessionId,agentId:v,agentName:(S==null?void 0:S.name)??v,label:x.label,timestamp:x.created_at??x.createdAt,conversationHistory:ec(x.conversation_history,[]),agentState:ec(x.agent_state,{}),fileSnapshots:ec(x.file_snapshots,[])})}}else g.type==="error"&&console.error("[PRISM WS]",g.data.message)},p.onclose=()=>{n.current&&(a("disconnected"),e.current=null,r())},p.onerror=()=>{n.current&&a("error")}},[u,r,s,a,o]);return C.useEffect(()=>(n.current=!0,h(),()=>{var p;n.current=!1,l.current&&clearTimeout(l.current),(p=e.current)==null||p.close()}),[h]),C.useEffect(()=>{const p=setInterval(()=>{n.current&&u()},6e4);return()=>clearInterval(p)},[u]),C.useEffect(()=>{var p;c&&((p=e.current)==null?void 0:p.readyState)===WebSocket.OPEN&&o(e.current,c)},[c,o]),{send:p=>{var m;((m=e.current)==null?void 0:m.readyState)===WebSocket.OPEN&&e.current.send(JSON.stringify(p))}}}function Gp(){const e=H(),{events:t}=Le(),{activeSessionId:l,sessions:n}=ce(),a=n.find(h=>h.id===l),s=C.useMemo(()=>{const h=l?t.filter(z=>z.sessionId===l):[];let p=0,m=null,g=null;for(const z of h)if(z.type==="tool.call")p++;else if(z.type==="session.summary"&&m===null){const N=z.payload;m=N.turnCount,g=N.cacheHitRate}let y=0,j=0,b=0,f=0,d=0,x=0,v=0,S=0;for(const z of h){if(z.type!=="cost.update")continue;const N=z.payload,M=N,A=N.totalCostUsd??0,D=N.inputTokens??0,X=N.outputTokens??0,te=M.cacheReadTokens??0;z.source==="hook"?(y+=A,j+=D,b+=X,f+=te):(d+=A,x+=D,v+=X,S+=te)}return{hookCost:y,hookInputTokens:j,hookOutputTokens:b,hookCacheReadTokens:f,sdkCost:d,sdkInputTokens:x,sdkOutputTokens:v,sdkCacheReadTokens:S,toolCalls:p,turnCount:m,cacheHitRate:g,eventCount:h.length}},[t,l]);if(!a)return null;const c=s.hookCost>0,o=s.sdkCost>0,u=s.hookInputTokens+s.hookOutputTokens,r=s.sdkInputTokens+s.sdkOutputTokens;return i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-6 border-b px-5 py-1.5 overflow-x-auto",style:{borderColor:"rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.3)"},children:[c&&i.jsx($t,{label:"Hook Cost",value:`$${s.hookCost.toFixed(6)}`,color:e.running,sub:u>0?`${s.hookInputTokens.toLocaleString()} in / ${s.hookOutputTokens.toLocaleString()} out`:void 0}),o&&i.jsx($t,{label:"SDK Cost",value:`$${s.sdkCost.toFixed(6)}`,color:e.running,sub:r>0?`${s.sdkInputTokens.toLocaleString()} in / ${s.sdkOutputTokens.toLocaleString()} out`:void 0}),!c&&!o&&i.jsx($t,{label:"Cost",value:"—",color:"#3f3f46"}),s.hookCacheReadTokens+s.sdkCacheReadTokens>0&&i.jsx($t,{label:"Cache Reads",value:(s.hookCacheReadTokens+s.sdkCacheReadTokens).toLocaleString(),color:e.warn}),s.cacheHitRate!==null&&i.jsx($t,{label:"Cache Hit",value:`${s.cacheHitRate}%`,color:e.warn}),s.turnCount!==null&&i.jsx($t,{label:"Turns",value:String(s.turnCount),color:e.purple}),i.jsx($t,{label:"Tools",value:String(s.toolCalls),color:e.purple}),i.jsx($t,{label:"Events",value:String(s.eventCount),color:"#52525b"})]})}function $t({label:e,value:t,color:l,sub:n}){return i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-300",children:e}),i.jsx("span",{className:"font-mono text-sm font-semibold",style:{color:l},children:t}),n&&i.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:n})]})}function Xp(){const[e,t]=C.useState("events"),l=H(),n=ui(a=>a.themeId);return Yp(),i.jsxs("div",{"data-theme":n,className:"flex h-screen flex-col overflow-hidden",style:{background:l.bg,fontFamily:"Geist Sans, Inter, system-ui, sans-serif"},children:[i.jsx(Sx,{}),i.jsx(Gp,{}),i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[i.jsx(Ex,{activePanel:e,onPanelChange:t}),i.jsx(Bp,{activePanel:e})]})]})}const D0=document.getElementById("root");if(!D0)throw new Error("Root element #root not found");mx.createRoot(D0).render(i.jsx(C.StrictMode,{children:i.jsx(Xp,{})}));
|
|
56
|
-
//# sourceMappingURL=index-
|
|
54
|
+
${te.output||"Pushed"}`),u(""),l()}catch(A){m(A instanceof Error?A.message:String(A))}finally{a(!1)}}return i.jsxs("div",{className:"flex flex-col h-full p-4 gap-4",children:[i.jsxs("div",{className:"rounded-lg p-3 flex items-center justify-between",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)"},children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-mono text-xs font-semibold text-zinc-200",children:f}),i.jsxs("p",{className:"font-mono text-[10px] text-zinc-600",children:[j," staged file",j!==1?"s":"",(e==null?void 0:e.aheadBehind)&&i.jsxs("span",{className:"ml-2",style:{color:d>0?s.warn:"#52525b"},children:["↑",d," ↓",e.aheadBehind.behind]})]})]}),b&&i.jsx("span",{className:"font-mono text-[9px] text-zinc-600",children:b})]}),j===0&&i.jsx("div",{className:"rounded px-3 py-2 font-mono text-[10px]",style:{background:`${s.warn}0D`,border:`1px solid ${s.warn}22`,color:s.warn},children:"No staged changes. Stage files to commit."}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("label",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600",children:"Commit Message"}),i.jsx("textarea",{ref:g,value:o,onChange:A=>u(A.target.value),placeholder:"feat: describe what you changed...",rows:4,className:"rounded border bg-transparent px-3 py-2 font-mono text-xs text-zinc-200 placeholder-zinc-700 outline-none resize-none focus:border-zinc-500",style:{borderColor:"rgba(255,255,255,0.10)",background:"rgba(0,0,0,0.3)"},onKeyDown:A=>{A.key==="Enter"&&(A.metaKey||A.ctrlKey)&&S()}}),i.jsx("p",{className:"font-mono text-[9px] text-zinc-700",children:"⌘↵ to commit"})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("button",{disabled:!x||n,onClick:S,className:"w-full rounded py-2 font-mono text-xs font-semibold transition-all disabled:opacity-40",style:{background:`${s.running}22`,color:s.running,border:`1px solid ${s.running}44`},children:n?"Working...":`Commit (${j} file${j!==1?"s":""})`}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("button",{disabled:n||!v,onClick:z,className:"flex-1 rounded py-1.5 font-mono text-xs transition-all disabled:opacity-40",style:{color:s.info,border:`1px solid ${s.info}44`,background:`${s.info}0D`},children:["Push",b?` → ${b}`:""]}),i.jsx("button",{disabled:!x||n,onClick:N,className:"flex-1 rounded py-1.5 font-mono text-xs transition-all disabled:opacity-40",style:{color:s.purple,border:`1px solid ${s.purple}44`,background:`${s.purple}0D`},children:"Commit + Push"})]})]}),r&&i.jsx("div",{className:"rounded p-2.5 font-mono text-[10px] whitespace-pre-wrap",style:{background:`${s.running}0D`,border:`1px solid ${s.running}22`,color:s.running},children:r}),p&&i.jsx("div",{className:"rounded p-2.5 font-mono text-[10px] whitespace-pre-wrap",style:{background:`${s.error}0D`,border:`1px solid ${s.error}33`,color:s.error},children:p})]})}function Rp(){const e=H(),{collectorUrl:t}=Oa(),l=t.replace(/^ws/,"http").replace(/\/ws$/,""),{events:n}=Le(),{activeSessionId:a}=ce(),[s,c]=C.useState(null),[o,u]=C.useState([]),[r,h]=C.useState(!1),[p,m]=C.useState(!1),[g,y]=C.useState(!1),[j,b]=C.useState(""),[f,d]=C.useState(""),[x,v]=C.useState(""),[S,z]=C.useState(null),[N,M]=C.useState(!1),[A,D]=C.useState(""),[X,te]=C.useState("diff"),[E,_]=C.useState(!1),F=C.useMemo(()=>{const U=new Map;for(const W of n){if(W.type!=="git.context")continue;const de=W.payload.gitRoot;if(!de||U.has(de))continue;const $e=de.split("/").filter(Boolean),mi=$e.length>=2?`${$e[$e.length-2]}/${$e[$e.length-1]}`:$e[$e.length-1]??de;U.set(de,mi)}return Array.from(U.entries()).map(([W,de])=>({root:W,label:de}))},[n]);C.useEffect(()=>{if(!a)return;const U=n.find(W=>W.sessionId===a&&W.type==="git.context");if(U){const W=U.payload.gitRoot;W&&W!==f&&(d(W),v(""))}},[a,n]);const w=C.useCallback(async U=>{h(!0),b("");try{const W=U?`?gitRoot=${encodeURIComponent(U)}`:"",de=await fetch(`${l}/api/git/status${W}`),$e=await de.json();if(!de.ok||$e.error){b($e.error??"Failed to load git status");return}c($e),d($e.gitRoot)}catch(W){b(W instanceof Error?W.message:"Network error")}finally{h(!1)}},[l]),B=C.useCallback(async U=>{try{const de=await(await fetch(`${l}/api/git/files?gitRoot=${encodeURIComponent(U)}`)).json();de.tree&&u(de.tree)}catch{}},[l]);C.useEffect(()=>{w(f||void 0)},[w,f]),C.useEffect(()=>{f&&E&&B(f)},[f,E,B]);const k=C.useCallback(async(U,W)=>{m(!0),D("");try{const de=new URLSearchParams({file:U,gitRoot:f});W&&de.set("staged","1");const mi=await(await fetch(`${l}/api/git/diff?${de}`)).json();D(mi.diff??"")}catch{}finally{m(!1)}},[l,f]),O=C.useCallback((U,W)=>{z(U),M(W),te("diff"),k(U,W)},[k]);async function $(U){y(!0);try{await fetch(`${l}/api/git/stage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:U,gitRoot:f})}),await w(f)}finally{y(!1)}}async function we(U){y(!0);try{await fetch(`${l}/api/git/unstage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:U,gitRoot:f})}),await w(f)}finally{y(!1)}}async function Lt(U){y(!0);try{await fetch(`${l}/api/git/discard`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:U,gitRoot:f})}),await w(f)}finally{y(!1)}}const _l=new Map;if(s)for(const U of[...s.staged,...s.unstaged,...s.untracked])_l.set(U.path,U);const vt=s?s.staged.length+s.unstaged.length+s.untracked.length:0;return i.jsxs("div",{className:"flex h-full overflow-hidden",children:[i.jsxs("div",{className:"flex flex-col overflow-hidden border-r",style:{width:320,flexShrink:0,borderColor:"rgba(255,255,255,0.08)"},children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",style:{borderColor:"rgba(255,255,255,0.08)",background:e.toolbarBg},children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"shrink-0 text-zinc-400",children:[i.jsx("circle",{cx:"12",cy:"12",r:"4"}),i.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),i.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),i.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),i.jsx("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),i.jsx("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),i.jsx("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),i.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),i.jsx("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"})]}),s?i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"font-mono text-xs font-semibold text-zinc-200 truncate block",children:s.branch}),s.aheadBehind&&i.jsxs("span",{className:"font-mono text-[9px]",style:{color:s.aheadBehind.ahead>0?e.warn:"#52525b"},children:["↑",s.aheadBehind.ahead," ↓",s.aheadBehind.behind]})]}):i.jsx("span",{className:"font-mono text-[10px] text-zinc-600",children:"not a git repo"})]}),i.jsx("button",{onClick:()=>w(f),disabled:r,className:"shrink-0 p-1 rounded hover:bg-white/[0.05] transition-colors disabled:opacity-40",title:"Refresh",children:i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:r?"animate-spin":"",children:[i.jsx("polyline",{points:"23 4 23 10 17 10"}),i.jsx("polyline",{points:"1 20 1 14 7 14"}),i.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})})]}),i.jsxs("div",{className:"shrink-0 flex flex-col gap-0 border-b",style:{borderColor:"rgba(255,255,255,0.05)"},children:[F.length>0&&i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b",style:{borderColor:"rgba(255,255,255,0.04)"},children:[i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"shrink-0 text-zinc-600",children:[i.jsx("circle",{cx:"18",cy:"18",r:"3"}),i.jsx("circle",{cx:"6",cy:"6",r:"3"}),i.jsx("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),i.jsx("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),i.jsx("select",{value:f,onChange:U=>{d(U.target.value),v(""),w(U.target.value)},className:"flex-1 bg-transparent font-mono text-[10px] text-zinc-300 outline-none cursor-pointer",style:{background:"transparent"},children:F.map(({root:U,label:W})=>i.jsx("option",{value:U,style:{background:"#09090B",color:"#d4d4d8"},children:W},U))})]}),i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5",children:[i.jsx("input",{type:"text",value:x,onChange:U=>v(U.target.value),onKeyDown:U=>{U.key==="Enter"&&w(x||void 0)},placeholder:f||"git root path (Enter to apply)",className:"flex-1 bg-transparent font-mono text-[10px] text-zinc-500 placeholder-zinc-700 outline-none truncate"}),x&&i.jsx("button",{onClick:()=>{w(x)},className:"shrink-0 font-mono text-[9px] px-1.5 py-0.5 rounded",style:{color:e.info,border:`1px solid ${e.info}33`},children:"Go"})]})]}),j&&i.jsx("div",{className:"shrink-0 px-3 py-2 font-mono text-[10px]",style:{color:e.error,background:`${e.error}0D`},children:j}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s&&i.jsxs(i.Fragment,{children:[vt===0&&i.jsx("div",{className:"flex items-center justify-center h-16 font-mono text-[10px] text-zinc-600",children:"Working tree clean"}),i.jsx(ec,{title:"Staged",files:s.staged,color:e.running,selectedFile:S,staged:!0,onSelect:O,onUnstage:we,loading:g}),i.jsx(ec,{title:"Changes",files:s.unstaged,color:e.warn,selectedFile:S,staged:!1,onSelect:O,onStage:$,onDiscard:Lt,loading:g}),i.jsx(ec,{title:"Untracked",files:s.untracked,color:"#52525b",selectedFile:S,staged:!1,onSelect:O,onStage:$,loading:g})]}),f&&i.jsxs("div",{className:"mt-2 border-t",style:{borderColor:"rgba(255,255,255,0.06)"},children:[i.jsxs("button",{onClick:()=>_(U=>!U),className:"flex items-center gap-1.5 w-full px-3 py-2 text-left hover:bg-white/[0.02] transition-colors",children:[i.jsx("span",{className:"font-mono text-[9px] text-zinc-600",children:E?"▾":"▸"}),i.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest text-zinc-600",children:"All Files"})]}),E&&i.jsx("div",{className:"pb-2",children:o.map(U=>i.jsx(D0,{node:U,depth:0,statusMap:_l,selectedFile:S,onSelect:O},U.path))})]})]})]}),i.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[i.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b px-3 py-1.5",style:{borderColor:"rgba(255,255,255,0.08)",background:e.toolbarBg},children:[["diff","commit"].map(U=>{const W=X===U,de=U==="commit"?e.running:e.info;return i.jsx("button",{onClick:()=>te(U),className:"rounded px-3 py-1 font-mono text-[10px] capitalize transition-colors",style:W?{background:`${de}1A`,color:de,border:`1px solid ${de}33`}:{color:"#52525b",border:"1px solid transparent"},children:U==="commit"?i.jsxs("span",{className:"flex items-center gap-1",children:["Commit",s!=null&&s.staged.length?i.jsx("span",{className:"font-mono text-[8px] px-1 py-0.5 rounded-full",style:{background:`${e.running}22`,color:e.running},children:s.staged.length}):null]}):S?`diff: ${S.split("/").pop()}`:"Diff"},U)}),S&&X==="diff"&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"font-mono text-[9px] text-zinc-600 mx-1",children:"—"}),i.jsx("span",{className:"font-mono text-[10px] text-zinc-400 truncate",children:S}),i.jsx("span",{className:"font-mono text-[9px] px-1.5 py-0.5 rounded ml-1",style:{color:N?e.running:e.warn,background:N?`${e.running}1A`:`${e.warn}1A`},children:N?"staged":"unstaged"})]})]}),X==="diff"?i.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:p?i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"Loading diff..."}):S?A?i.jsx("div",{children:A.split(`
|
|
55
|
+
`).map((U,W)=>i.jsx(Up,{line:U},W))}):i.jsx("div",{className:"flex items-center justify-center h-24 font-mono text-xs text-zinc-600",children:"No diff available"}):i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center",children:[i.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",className:"text-zinc-700",children:[i.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"}),i.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),i.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),i.jsx("polyline",{points:"10 9 9 9 8 9"})]}),i.jsx("p",{className:"font-mono text-xs text-zinc-600",children:"Select a file to view its diff"})]})}):i.jsx(Bp,{status:s,gitRoot:f,onSuccess:()=>w(f),loading:g,setLoading:y})]})]})}function Hp({activePanel:e}){return i.jsxs("main",{className:"flex-1 overflow-hidden",children:[e==="events"&&i.jsx(Lx,{}),e==="agents"&&i.jsx(Jx,{}),e==="tools"&&i.jsx(Cp,{}),e==="reasoning"&&i.jsx(Ap,{}),e==="context"&&i.jsx(Op,{}),e==="cost"&&i.jsx(Wx,{}),e==="checkpoints"&&i.jsx(tp,{}),e==="mcp"&&i.jsx(sp,{}),e==="git"&&i.jsx(Rp,{}),e==="bash"&&i.jsx(fp,{}),e==="intelligence"&&i.jsx(up,{}),e==="history"&&i.jsx(vp,{})]})}const _p=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,kr=1e3,Lp=3e4,$p=1.5;function tc(e,t){if(!e)return t;try{return JSON.parse(e)}catch{return t}}function wr(e){const t=e.id,l=e.name??"";return{id:t,name:l||t.slice(0,8),startedAt:e.startedAt??e.started_at,endedAt:e.endedAt??e.ended_at??void 0,lastActivityAt:e.lastActivityAt??e.last_activity_at??void 0,totalCostUsd:e.totalCostUsd??e.total_cost??0,totalEvents:e.totalEvents??e.total_tokens??0,agentCount:e.agentCount??e.agent_count??0,status:e.status==="active"?"active":"ended"}}function qp(e){const t=e.payload,l=typeof t=="string"?JSON.parse(t):t??{};return{id:e.id,sessionId:e.sessionId??e.session_id,timestamp:e.timestamp,type:e.type,source:e.source,payload:l}}function Yp(e){return{id:e.id,sessionId:e.sessionId??e.session_id,parentId:e.parentId??e.parent_id,name:e.name,status:e.status,spawnedAt:e.spawnedAt??e.spawned_at,completedAt:e.completedAt??e.completed_at??void 0,depth:e.depth??0,loopCount:e.loopCount??e.loop_count??0,toolCallCount:0,logs:[],children:[]}}function Gp(e){const t=Le.getState().addEvent,l=Ae.getState().upsertAgent,n=Ae.getState().updateAgentStatus,a=Ae.getState().incrementToolCallCount,s=Ae.getState().addAgentLog,c=Ae.getState().addLoopAlert,o=ce.getState().upsertSession,u=Gl.getState().upsertServer,r=Gl.getState().setServerStatus,h=Gl.getState().updateHeartbeat,p=Gl.getState().addCallRecord,m=Gl.getState().updateCallRecord,g=Wo.getState().addCheckpoint;t(e);{const y=ce.getState().sessions.find(j=>j.id===e.sessionId);y&&(y.lastActivityAt??0)<e.timestamp&&o({...y,lastActivityAt:e.timestamp})}switch(e.type){case"session.start":{const y=e.payload,j=y.sessionId??e.sessionId;o({id:j,name:y.name??j.slice(0,8),startedAt:y.startedAt??e.timestamp,totalCostUsd:0,totalEvents:0,agentCount:0,status:"active"});break}case"session.end":{const y=e.payload,j=y.sessionId??e.sessionId,f=ce.getState().sessions.find(d=>d.id===j);f&&o({...f,status:"ended",endedAt:e.timestamp,totalCostUsd:f.totalCostUsd||y.totalCostUsd,totalEvents:f.totalEvents||y.totalEvents});break}case"agent.spawn":{const y=e.payload;l({id:y.agentId,sessionId:e.sessionId,parentId:y.parentId,name:y.name,status:"running",spawnedAt:e.timestamp,depth:y.depth,loopCount:0,toolCallCount:0,logs:[],children:[]});const b=ce.getState().sessions.find(f=>f.id===e.sessionId);b&&ce.getState().upsertSession({...b,agentCount:b.agentCount+1});break}case"agent.complete":{const y=e.payload;n(y.agentId,"completed",e.timestamp);break}case"agent.state_change":{const y=e.payload;y.nextState==="error"?(n(y.agentId,"failed",e.timestamp),y.reason&&s(y.agentId,{timestamp:e.timestamp,message:`Failed: ${y.reason}`,level:"error"})):y.nextState==="complete"?n(y.agentId,"completed",e.timestamp):y.nextState==="running"?n(y.agentId,"running"):y.nextState==="waiting"&&n(y.agentId,"waiting");break}case"agent.fail":{const y=e.payload;n(y.agentId,"failed",e.timestamp),s(y.agentId,{timestamp:e.timestamp,message:`Agent failed: ${y.error}`,level:"error"});break}case"agent.log":{const y=e.payload;s(y.agentId,{timestamp:e.timestamp,message:y.message,level:y.level});break}case"agent.checkpoint":{const y=e.payload,j=Ae.getState().getAgent(y.agentId);g({id:y.checkpointId,sessionId:e.sessionId,agentId:y.agentId,agentName:(j==null?void 0:j.name)??y.agentId,label:y.label,timestamp:e.timestamp,conversationHistory:y.conversationHistory,agentState:y.agentState,fileSnapshots:y.fileSnapshots});break}case"checkpoint.create":{const y=e.payload,j=Ae.getState().getAgent(y.agentId);g({id:e.id,sessionId:e.sessionId,agentId:y.agentId,agentName:(j==null?void 0:j.name)??y.agentId,label:y.label,timestamp:e.timestamp,conversationHistory:[],agentState:y.metadata??{},fileSnapshots:[]});break}case"cost.update":break;case"tool.call":{const y=e.payload;a(y.agentId);break}case"session.summary":{fi.getState().setSummary(e.sessionId,e.payload);break}case"loop.detected":{const y=e.payload,j=Ae.getState().getAgent(y.agentId);j&&Ae.getState().upsertAgent({...j,loopCount:y.loopCount}),c({id:e.id,agentId:y.agentId,agentName:y.agentName,toolName:y.toolName,loopCount:y.loopCount,detectedAt:e.timestamp});break}case"mcp.connect":{const y=e.payload;u({id:y.serverId,name:y.serverName,status:"connected",tools:y.tools,callCount:0,errorCount:0,lastHeartbeat:e.timestamp,connectedAt:e.timestamp});break}case"mcp.disconnect":{const y=e.payload;r(y.serverId,"disconnected");break}case"mcp.tool.call":{const y=e.payload;p({id:e.id,serverId:y.serverId,serverName:y.serverName,toolName:y.toolName,callId:y.callId,input:y.input,timestamp:e.timestamp,status:"pending"});break}case"mcp.tool.result":{const y=e.payload;m(y.callId,{output:y.output,durationMs:y.durationMs,isError:y.isError,status:y.isError?"error":"completed",serverId:y.serverId});break}case"mcp.heartbeat":{const y=e.payload;h(y.serverId,y.timestamp);break}}}function Xp(){const e=C.useRef(null),t=C.useRef(kr),l=C.useRef(null),n=C.useRef(!0),{setStatus:a,setLastHeartbeat:s}=Oa(),{activeSessionId:c}=ce(),o=C.useCallback((p,m)=>{p.readyState===WebSocket.OPEN&&p.send(JSON.stringify({type:"subscribe",sessionId:m}))},[]),u=C.useCallback(async()=>{var p;try{const[m,g]=await Promise.allSettled([(async()=>{var f;const y=[];let j=1,b=1;do{const d=await fetch(`/api/sessions?page=${j}&pageSize=100`);if(!d.ok)break;const x=await d.json();Array.isArray(x.data)&&y.push(...x.data),b=((f=x.meta)==null?void 0:f.totalPages)??1,j++}while(j<=b);return y})(),fetch("/api/summaries").then(y=>y.ok?y.json():null)]);if(m.status==="fulfilled"){const y=m.value.map(j=>wr(j));ce.getState().setSessions(y)}if(g.status==="fulfilled"&&((p=g.value)!=null&&p.data)){const y=fi.getState().setSummary;for(const{sessionId:j,summary:b}of g.value.data)j&&b&&y(j,b)}}catch{}},[]),r=C.useCallback(()=>{n.current&&(l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{t.current=Math.min(t.current*$p,Lp),h()},t.current))},[]),h=C.useCallback(()=>{if(!n.current||e.current&&e.current.readyState===WebSocket.OPEN)return;a("connecting");const p=new WebSocket(_p);e.current=p,p.onopen=()=>{if(!n.current)return;t.current=kr,a("connected"),s(Date.now()),o(p,"*"),u();const m=ce.getState().activeSessionId;m&&o(p,m)},p.onmessage=m=>{if(!n.current)return;s(Date.now());let g;try{g=JSON.parse(m.data)}catch{return}if(g.type==="event")Gp(g.data);else if(g.type==="snapshot"){const y=g.data,j=y.session,b=y.events??[],f=y.agents??[],d=y.checkpoints??[];ce.getState().upsertSession(wr(j)),Le.getState().addEvents(b.map(qp));for(const x of f)Ae.getState().upsertAgent(Yp(x));for(const x of d){const v=x.agent_id??x.agentId;if(!v)continue;const S=Ae.getState().getAgent(v);Wo.getState().addCheckpoint({id:x.id,sessionId:x.session_id??x.sessionId,agentId:v,agentName:(S==null?void 0:S.name)??v,label:x.label,timestamp:x.created_at??x.createdAt,conversationHistory:tc(x.conversation_history,[]),agentState:tc(x.agent_state,{}),fileSnapshots:tc(x.file_snapshots,[])})}}else g.type==="error"&&console.error("[PRISM WS]",g.data.message)},p.onclose=()=>{n.current&&(a("disconnected"),e.current=null,r())},p.onerror=()=>{n.current&&a("error")}},[u,r,s,a,o]);return C.useEffect(()=>(n.current=!0,h(),()=>{var p;n.current=!1,l.current&&clearTimeout(l.current),(p=e.current)==null||p.close()}),[h]),C.useEffect(()=>{const p=setInterval(()=>{n.current&&u()},6e4);return()=>clearInterval(p)},[u]),C.useEffect(()=>{var p;c&&((p=e.current)==null?void 0:p.readyState)===WebSocket.OPEN&&o(e.current,c)},[c,o]),{send:p=>{var m;((m=e.current)==null?void 0:m.readyState)===WebSocket.OPEN&&e.current.send(JSON.stringify(p))}}}function Qp(){const e=H(),{events:t}=Le(),{activeSessionId:l,sessions:n}=ce(),a=n.find(h=>h.id===l),s=C.useMemo(()=>{const h=l?t.filter(z=>z.sessionId===l):[];let p=0,m=null,g=null;for(const z of h)if(z.type==="tool.call")p++;else if(z.type==="session.summary"&&m===null){const N=z.payload;m=N.turnCount,g=N.cacheHitRate}let y=0,j=0,b=0,f=0,d=0,x=0,v=0,S=0;for(const z of h){if(z.type!=="cost.update")continue;const N=z.payload,M=N,A=N.totalCostUsd??0,D=N.inputTokens??0,X=N.outputTokens??0,te=M.cacheReadTokens??0;z.source==="hook"?(y+=A,j+=D,b+=X,f+=te):(d+=A,x+=D,v+=X,S+=te)}return{hookCost:y,hookInputTokens:j,hookOutputTokens:b,hookCacheReadTokens:f,sdkCost:d,sdkInputTokens:x,sdkOutputTokens:v,sdkCacheReadTokens:S,toolCalls:p,turnCount:m,cacheHitRate:g,eventCount:h.length}},[t,l]);if(!a)return null;const c=s.hookCost>0,o=s.sdkCost>0,u=s.hookInputTokens+s.hookOutputTokens,r=s.sdkInputTokens+s.sdkOutputTokens;return i.jsxs("div",{className:"flex flex-shrink-0 items-center gap-6 border-b px-5 py-1.5 overflow-x-auto",style:{borderColor:"rgba(255,255,255,0.06)",background:"rgba(0,0,0,0.3)"},children:[c&&i.jsx($t,{label:"Hook Cost",value:`$${s.hookCost.toFixed(6)}`,color:e.running,sub:u>0?`${s.hookInputTokens.toLocaleString()} in / ${s.hookOutputTokens.toLocaleString()} out`:void 0}),o&&i.jsx($t,{label:"SDK Cost",value:`$${s.sdkCost.toFixed(6)}`,color:e.running,sub:r>0?`${s.sdkInputTokens.toLocaleString()} in / ${s.sdkOutputTokens.toLocaleString()} out`:void 0}),!c&&!o&&i.jsx($t,{label:"Cost",value:"—",color:"#3f3f46"}),s.hookCacheReadTokens+s.sdkCacheReadTokens>0&&i.jsx($t,{label:"Cache Reads",value:(s.hookCacheReadTokens+s.sdkCacheReadTokens).toLocaleString(),color:e.warn}),s.cacheHitRate!==null&&i.jsx($t,{label:"Cache Hit",value:`${s.cacheHitRate}%`,color:e.warn}),s.turnCount!==null&&i.jsx($t,{label:"Turns",value:String(s.turnCount),color:e.purple}),i.jsx($t,{label:"Tools",value:String(s.toolCalls),color:e.purple}),i.jsx($t,{label:"Events",value:String(s.eventCount),color:"#52525b"})]})}function $t({label:e,value:t,color:l,sub:n}){return i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"text-[10px] font-mono uppercase tracking-widest text-zinc-300",children:e}),i.jsx("span",{className:"font-mono text-sm font-semibold",style:{color:l},children:t}),n&&i.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:n})]})}function Zp(){const[e,t]=C.useState("events"),l=H(),n=ri(a=>a.themeId);return Xp(),i.jsxs("div",{"data-theme":n,className:"flex h-screen flex-col overflow-hidden",style:{background:l.bg,fontFamily:"Geist Sans, Inter, system-ui, sans-serif"},children:[i.jsx(zx,{}),i.jsx(Qp,{}),i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[i.jsx(Ox,{activePanel:e,onPanelChange:t}),i.jsx(Hp,{activePanel:e})]})]})}const O0=document.getElementById("root");if(!O0)throw new Error("Root element #root not found");hx.createRoot(O0).render(i.jsx(C.StrictMode,{children:i.jsx(Zp,{})}));
|
|
56
|
+
//# sourceMappingURL=index-DYDSFr0z.js.map
|