gossipcat 0.5.6 → 0.6.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.
- package/dist-dashboard/assets/index-CUTIQoLn.css +1 -0
- package/dist-dashboard/assets/index-tSxgrLeq.js +79 -0
- package/dist-dashboard/index.html +2 -2
- package/dist-mcp/default-rules/gossipcat-rules.md +1 -1
- package/dist-mcp/mcp-server.js +3555 -2054
- package/docs/HANDBOOK.md +2 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +13 -10
- package/dist-dashboard/assets/index-Chrn1WHu.js +0 -78
- package/dist-dashboard/assets/index-DUZrYB2U.css +0 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var Ip=Object.defineProperty;var Wp=(i,c,u)=>c in i?Ip(i,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[c]=u;var nt=(i,c,u)=>Wp(i,typeof c!="symbol"?c+"":c,u);(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const v of m.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function u(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(d){if(d.ep)return;d.ep=!0;const m=u(d);fetch(d.href,m)}})();var eo={exports:{}},is={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Rm;function Pp(){if(Rm)return is;Rm=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(o,d,m){var v=null;if(m!==void 0&&(v=""+m),d.key!==void 0&&(v=""+d.key),"key"in d){m={};for(var h in d)h!=="key"&&(m[h]=d[h])}else m=d;return d=m.ref,{$$typeof:i,type:o,key:v,ref:d!==void 0?d:null,props:m}}return is.Fragment=c,is.jsx=u,is.jsxs=u,is}var Om;function e0(){return Om||(Om=1,eo.exports=Pp()),eo.exports}var a=e0(),to={exports:{}},xe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Um;function t0(){if(Um)return xe;Um=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),v=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),R=Symbol.iterator;function J(j){return j===null||typeof j!="object"?null:(j=R&&j[R]||j["@@iterator"],typeof j=="function"?j:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,w={};function W(j,q,P){this.props=j,this.context=q,this.refs=w,this.updater=P||$}W.prototype.isReactComponent={},W.prototype.setState=function(j,q){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,q,"setState")},W.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function Q(){}Q.prototype=W.prototype;function ne(j,q,P){this.props=j,this.context=q,this.refs=w,this.updater=P||$}var V=ne.prototype=new Q;V.constructor=ne,Y(V,W.prototype),V.isPureReactComponent=!0;var T=Array.isArray;function Z(){}var z={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function le(j,q,P){var X=P.ref;return{$$typeof:i,type:j,key:q,ref:X!==void 0?X:null,props:P}}function F(j,q){return le(j.type,q,j.props)}function de(j){return typeof j=="object"&&j!==null&&j.$$typeof===i}function ee(j){var q={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(P){return q[P]})}var ae=/\/+/g;function he(j,q){return typeof j=="object"&&j!==null&&j.key!=null?ee(""+j.key):q.toString(36)}function M(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(Z,Z):(j.status="pending",j.then(function(q){j.status==="pending"&&(j.status="fulfilled",j.value=q)},function(q){j.status==="pending"&&(j.status="rejected",j.reason=q)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function E(j,q,P,X,U){var se=typeof j;(se==="undefined"||se==="boolean")&&(j=null);var oe=!1;if(j===null)oe=!0;else switch(se){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(j.$$typeof){case i:case c:oe=!0;break;case y:return oe=j._init,E(oe(j._payload),q,P,X,U)}}if(oe)return U=U(j),oe=X===""?"."+he(j,0):X,T(U)?(P="",oe!=null&&(P=oe.replace(ae,"$&/")+"/"),E(U,q,P,"",function(Je){return Je})):U!=null&&(de(U)&&(U=F(U,P+(U.key==null||j&&j.key===U.key?"":(""+U.key).replace(ae,"$&/")+"/")+oe)),q.push(U)),1;oe=0;var we=X===""?".":X+":";if(T(j))for(var ye=0;ye<j.length;ye++)X=j[ye],se=we+he(X,ye),oe+=E(X,q,P,se,U);else if(ye=J(j),typeof ye=="function")for(j=ye.call(j),ye=0;!(X=j.next()).done;)X=X.value,se=we+he(X,ye++),oe+=E(X,q,P,se,U);else if(se==="object"){if(typeof j.then=="function")return E(M(j),q,P,X,U);throw q=String(j),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return oe}function L(j,q,P){if(j==null)return j;var X=[],U=0;return E(j,X,"","",function(se){return q.call(P,se,U++)}),X}function te(j){if(j._status===-1){var q=j._result;q=q(),q.then(function(P){(j._status===0||j._status===-1)&&(j._status=1,j._result=P)},function(P){(j._status===0||j._status===-1)&&(j._status=2,j._result=P)}),j._status===-1&&(j._status=0,j._result=q)}if(j._status===1)return j._result.default;throw j._result}var ce=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},fe={map:L,forEach:function(j,q,P){L(j,function(){q.apply(this,arguments)},P)},count:function(j){var q=0;return L(j,function(){q++}),q},toArray:function(j){return L(j,function(q){return q})||[]},only:function(j){if(!de(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return xe.Activity=S,xe.Children=fe,xe.Component=W,xe.Fragment=u,xe.Profiler=d,xe.PureComponent=ne,xe.StrictMode=o,xe.Suspense=p,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,xe.__COMPILER_RUNTIME={__proto__:null,c:function(j){return z.H.useMemoCache(j)}},xe.cache=function(j){return function(){return j.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(j,q,P){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var X=Y({},j.props),U=j.key;if(q!=null)for(se in q.key!==void 0&&(U=""+q.key),q)!K.call(q,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&q.ref===void 0||(X[se]=q[se]);var se=arguments.length-2;if(se===1)X.children=P;else if(1<se){for(var oe=Array(se),we=0;we<se;we++)oe[we]=arguments[we+2];X.children=oe}return le(j.type,U,X)},xe.createContext=function(j){return j={$$typeof:v,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:m,_context:j},j},xe.createElement=function(j,q,P){var X,U={},se=null;if(q!=null)for(X in q.key!==void 0&&(se=""+q.key),q)K.call(q,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(U[X]=q[X]);var oe=arguments.length-2;if(oe===1)U.children=P;else if(1<oe){for(var we=Array(oe),ye=0;ye<oe;ye++)we[ye]=arguments[ye+2];U.children=we}if(j&&j.defaultProps)for(X in oe=j.defaultProps,oe)U[X]===void 0&&(U[X]=oe[X]);return le(j,se,U)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(j){return{$$typeof:h,render:j}},xe.isValidElement=de,xe.lazy=function(j){return{$$typeof:y,_payload:{_status:-1,_result:j},_init:te}},xe.memo=function(j,q){return{$$typeof:g,type:j,compare:q===void 0?null:q}},xe.startTransition=function(j){var q=z.T,P={};z.T=P;try{var X=j(),U=z.S;U!==null&&U(P,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(Z,ce)}catch(se){ce(se)}finally{q!==null&&P.types!==null&&(q.types=P.types),z.T=q}},xe.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},xe.use=function(j){return z.H.use(j)},xe.useActionState=function(j,q,P){return z.H.useActionState(j,q,P)},xe.useCallback=function(j,q){return z.H.useCallback(j,q)},xe.useContext=function(j){return z.H.useContext(j)},xe.useDebugValue=function(){},xe.useDeferredValue=function(j,q){return z.H.useDeferredValue(j,q)},xe.useEffect=function(j,q){return z.H.useEffect(j,q)},xe.useEffectEvent=function(j){return z.H.useEffectEvent(j)},xe.useId=function(){return z.H.useId()},xe.useImperativeHandle=function(j,q,P){return z.H.useImperativeHandle(j,q,P)},xe.useInsertionEffect=function(j,q){return z.H.useInsertionEffect(j,q)},xe.useLayoutEffect=function(j,q){return z.H.useLayoutEffect(j,q)},xe.useMemo=function(j,q){return z.H.useMemo(j,q)},xe.useOptimistic=function(j,q){return z.H.useOptimistic(j,q)},xe.useReducer=function(j,q,P){return z.H.useReducer(j,q,P)},xe.useRef=function(j){return z.H.useRef(j)},xe.useState=function(j){return z.H.useState(j)},xe.useSyncExternalStore=function(j,q,P){return z.H.useSyncExternalStore(j,q,P)},xe.useTransition=function(){return z.H.useTransition()},xe.version="19.2.6",xe}var qm;function wo(){return qm||(qm=1,to.exports=t0()),to.exports}var k=wo(),no={exports:{}},rs={},lo={exports:{}},ao={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Bm;function n0(){return Bm||(Bm=1,(function(i){function c(E,L){var te=E.length;E.push(L);e:for(;0<te;){var ce=te-1>>>1,fe=E[ce];if(0<d(fe,L))E[ce]=L,E[te]=fe,te=ce;else break e}}function u(E){return E.length===0?null:E[0]}function o(E){if(E.length===0)return null;var L=E[0],te=E.pop();if(te!==L){E[0]=te;e:for(var ce=0,fe=E.length,j=fe>>>1;ce<j;){var q=2*(ce+1)-1,P=E[q],X=q+1,U=E[X];if(0>d(P,te))X<fe&&0>d(U,P)?(E[ce]=U,E[X]=te,ce=X):(E[ce]=P,E[q]=te,ce=q);else if(X<fe&&0>d(U,te))E[ce]=U,E[X]=te,ce=X;else break e}}return L}function d(E,L){var te=E.sortIndex-L.sortIndex;return te!==0?te:E.id-L.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var v=Date,h=v.now();i.unstable_now=function(){return v.now()-h}}var p=[],g=[],y=1,S=null,R=3,J=!1,$=!1,Y=!1,w=!1,W=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,ne=typeof setImmediate<"u"?setImmediate:null;function V(E){for(var L=u(g);L!==null;){if(L.callback===null)o(g);else if(L.startTime<=E)o(g),L.sortIndex=L.expirationTime,c(p,L);else break;L=u(g)}}function T(E){if(Y=!1,V(E),!$)if(u(p)!==null)$=!0,Z||(Z=!0,ee());else{var L=u(g);L!==null&&M(T,L.startTime-E)}}var Z=!1,z=-1,K=5,le=-1;function F(){return w?!0:!(i.unstable_now()-le<K)}function de(){if(w=!1,Z){var E=i.unstable_now();le=E;var L=!0;try{e:{$=!1,Y&&(Y=!1,Q(z),z=-1),J=!0;var te=R;try{t:{for(V(E),S=u(p);S!==null&&!(S.expirationTime>E&&F());){var ce=S.callback;if(typeof ce=="function"){S.callback=null,R=S.priorityLevel;var fe=ce(S.expirationTime<=E);if(E=i.unstable_now(),typeof fe=="function"){S.callback=fe,V(E),L=!0;break t}S===u(p)&&o(p),V(E)}else o(p);S=u(p)}if(S!==null)L=!0;else{var j=u(g);j!==null&&M(T,j.startTime-E),L=!1}}break e}finally{S=null,R=te,J=!1}L=void 0}}finally{L?ee():Z=!1}}}var ee;if(typeof ne=="function")ee=function(){ne(de)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,he=ae.port2;ae.port1.onmessage=de,ee=function(){he.postMessage(null)}}else ee=function(){W(de,0)};function M(E,L){z=W(function(){E(i.unstable_now())},L)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(E){E.callback=null},i.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<E?Math.floor(1e3/E):5},i.unstable_getCurrentPriorityLevel=function(){return R},i.unstable_next=function(E){switch(R){case 1:case 2:case 3:var L=3;break;default:L=R}var te=R;R=L;try{return E()}finally{R=te}},i.unstable_requestPaint=function(){w=!0},i.unstable_runWithPriority=function(E,L){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var te=R;R=E;try{return L()}finally{R=te}},i.unstable_scheduleCallback=function(E,L,te){var ce=i.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?ce+te:ce):te=ce,E){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=te+fe,E={id:y++,callback:L,priorityLevel:E,startTime:te,expirationTime:fe,sortIndex:-1},te>ce?(E.sortIndex=te,c(g,E),u(p)===null&&E===u(g)&&(Y?(Q(z),z=-1):Y=!0,M(T,te-ce))):(E.sortIndex=fe,c(p,E),$||J||($=!0,Z||(Z=!0,ee()))),E},i.unstable_shouldYield=F,i.unstable_wrapCallback=function(E){var L=R;return function(){var te=R;R=L;try{return E.apply(this,arguments)}finally{R=te}}}})(ao)),ao}var Lm;function l0(){return Lm||(Lm=1,lo.exports=n0()),lo.exports}var so={exports:{}},ot={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Hm;function a0(){if(Hm)return ot;Hm=1;var i=wo();function c(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(p,g,y){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:S==null?null:""+S,children:p,containerInfo:g,implementation:y}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ot.createPortal=function(p,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(c(299));return m(p,g,null,y)},ot.flushSync=function(p){var g=v.T,y=o.p;try{if(v.T=null,o.p=2,p)return p()}finally{v.T=g,o.p=y,o.d.f()}},ot.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(p,g))},ot.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},ot.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var y=g.as,S=h(y,g.crossOrigin),R=typeof g.integrity=="string"?g.integrity:void 0,J=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?o.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:S,integrity:R,fetchPriority:J}):y==="script"&&o.d.X(p,{crossOrigin:S,integrity:R,fetchPriority:J,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ot.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=h(g.as,g.crossOrigin);o.d.M(p,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(p)},ot.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,S=h(y,g.crossOrigin);o.d.L(p,y,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},ot.preloadModule=function(p,g){if(typeof p=="string")if(g){var y=h(g.as,g.crossOrigin);o.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(p)},ot.requestFormReset=function(p){o.d.r(p)},ot.unstable_batchedUpdates=function(p,g){return p(g)},ot.useFormState=function(p,g,y){return v.H.useFormState(p,g,y)},ot.useFormStatus=function(){return v.H.useHostTransitionStatus()},ot.version="19.2.6",ot}var $m;function s0(){if($m)return so.exports;$m=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),so.exports=a0(),so.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Gm;function i0(){if(Gm)return rs;Gm=1;var i=l0(),c=wo(),u=s0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(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 h(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 p(e){if(m(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var s=n.return;if(s===null)break;var r=s.alternate;if(r===null){if(l=s.return,l!==null){n=l;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===n)return p(s),e;if(r===l)return p(s),t;r=r.sibling}throw Error(o(188))}if(n.return!==l.return)n=s,l=r;else{for(var f=!1,x=s.child;x;){if(x===n){f=!0,n=s,l=r;break}if(x===l){f=!0,l=s,n=r;break}x=x.sibling}if(!f){for(x=r.child;x;){if(x===n){f=!0,n=r,l=s;break}if(x===l){f=!0,l=r,n=s;break}x=x.sibling}if(!f)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var S=Object.assign,R=Symbol.for("react.element"),J=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),Y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Y:return"Fragment";case W:return"Profiler";case w:return"StrictMode";case T:return"Suspense";case Z:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case $:return"Portal";case ne:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var M=Array.isArray,E=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ce=[],fe=-1;function j(e){return{current:e}}function q(e){0>fe||(e.current=ce[fe],ce[fe]=null,fe--)}function P(e,t){fe++,ce[fe]=e.current,e.current=t}var X=j(null),U=j(null),se=j(null),oe=j(null);function we(e,t){switch(P(se,t),P(U,e),P(X,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lm(t),e=am(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(X),P(X,e)}function ye(){q(X),q(U),q(se)}function Je(e){e.memoizedState!==null&&P(oe,e);var t=X.current,n=am(t,e.type);t!==n&&(P(U,e),P(X,n))}function Ct(e){U.current===e&&(q(X),q(U)),oe.current===e&&(q(oe),ns._currentValue=te)}var mt,kn;function jt(e){if(mt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mt=t&&t[1]||"",kn=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+mt+e+kn}var Ae=!1;function nn(e,t){if(!e||Ae)return"";Ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(O){var D=O}Reflect.construct(e,[],G)}else{try{G.call()}catch(O){D=O}e.call(G.prototype)}}else{try{throw Error()}catch(O){D=O}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(O){if(O&&D&&typeof O.stack=="string")return[O.stack,D.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=l.DetermineComponentFrameRoot(),f=r[0],x=r[1];if(f&&x){var b=f.split(`
|
|
44
|
+
`),C=x.split(`
|
|
45
|
+
`);for(s=l=0;l<b.length&&!b[l].includes("DetermineComponentFrameRoot");)l++;for(;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;if(l===b.length||s===C.length)for(l=b.length-1,s=C.length-1;1<=l&&0<=s&&b[l]!==C[s];)s--;for(;1<=l&&0<=s;l--,s--)if(b[l]!==C[s]){if(l!==1||s!==1)do if(l--,s--,0>s||b[l]!==C[s]){var B=`
|
|
46
|
+
`+b[l].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=l&&0<=s);break}}}finally{Ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?jt(n):""}function Zt(e,t){switch(e.tag){case 26:case 27:case 5:return jt(e.type);case 16:return jt("Lazy");case 13:return e.child!==t&&t!==null?jt("Suspense Fallback"):jt("Suspense");case 19:return jt("SuspenseList");case 0:case 15:return nn(e.type,!1);case 11:return nn(e.type.render,!1);case 1:return nn(e.type,!0);case 31:return jt("Activity");default:return""}}function _n(e){try{var t="",n=null;do t+=Zt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var I=Object.prototype.hasOwnProperty,pe=i.unstable_scheduleCallback,Te=i.unstable_cancelCallback,Fe=i.unstable_shouldYield,Yt=i.unstable_requestPaint,lt=i.unstable_now,ut=i.unstable_getCurrentPriorityLevel,ma=i.unstable_ImmediatePriority,Pn=i.unstable_UserBlockingPriority,ms=i.unstable_NormalPriority,zh=i.unstable_LowPriority,Uo=i.unstable_IdlePriority,Dh=i.log,Rh=i.unstable_setDisableYieldValue,ha=null,Nt=null;function En(e){if(typeof Dh=="function"&&Rh(e),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(ha,e)}catch{}}var St=Math.clz32?Math.clz32:qh,Oh=Math.log,Uh=Math.LN2;function qh(e){return e>>>=0,e===0?32:31-(Oh(e)/Uh|0)|0}var hs=256,xs=262144,ps=4194304;function el(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,n){var l=e.pendingLanes;if(l===0)return 0;var s=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~r,l!==0?s=el(l):(f&=x,f!==0?s=el(f):n||(n=x&~e,n!==0&&(s=el(n))))):(x=l&~r,x!==0?s=el(x):f!==0?s=el(f):n||(n=l&~e,n!==0&&(s=el(n)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:s}function xa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Bh(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 qo(){var e=ps;return ps<<=1,(ps&62914560)===0&&(ps=4194304),e}function Gi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Lh(e,t,n,l,s,r){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,b=e.expirationTimes,C=e.hiddenUpdates;for(n=f&~n;0<n;){var B=31-St(n),G=1<<B;x[B]=0,b[B]=-1;var D=C[B];if(D!==null)for(C[B]=null,B=0;B<D.length;B++){var O=D[B];O!==null&&(O.lane&=-536870913)}n&=~G}l!==0&&Bo(e,l,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~t))}function Bo(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-St(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Lo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-St(n),s=1<<l;s&t|e[l]&t&&(e[l]|=t),n&=~s}}function Ho(e,t){var n=t&-t;return n=(n&42)!==0?1:Yi(n),(n&(e.suspendedLanes|t))!==0?0:n}function Yi(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 Xi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $o(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:Tm(e.type))}function Go(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var Tn=Math.random().toString(36).slice(2),at="__reactFiber$"+Tn,ht="__reactProps$"+Tn,kl="__reactContainer$"+Tn,Vi="__reactEvents$"+Tn,Hh="__reactListeners$"+Tn,$h="__reactHandles$"+Tn,Yo="__reactResources$"+Tn,va="__reactMarker$"+Tn;function Qi(e){delete e[at],delete e[ht],delete e[Vi],delete e[Hh],delete e[$h]}function _l(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[kl]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dm(e);e!==null;){if(n=e[at])return n;e=dm(e)}return t}e=n,n=e.parentNode}return null}function El(e){if(e=e[at]||e[kl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ga(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Tl(e){var t=e[Yo];return t||(t=e[Yo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[va]=!0}var Xo=new Set,Vo={};function tl(e,t){Ml(e,t),Ml(e+"Capture",t)}function Ml(e,t){for(Vo[e]=t,e=0;e<t.length;e++)Xo.add(t[e])}var Gh=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]*$"),Qo={},Zo={};function Yh(e){return I.call(Zo,e)?!0:I.call(Qo,e)?!1:Gh.test(e)?Zo[e]=!0:(Qo[e]=!0,!1)}function gs(e,t,n){if(Yh(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function ys(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function ln(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ko(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xh(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var s=l.get,r=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){n=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zi(e){if(!e._valueTracker){var t=Ko(e)?"checked":"value";e._valueTracker=Xh(e,t,""+e[t])}}function Jo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Ko(e)?e.checked?"true":"false":e.value),e=l,e!==n?(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 Vh=/[\n"\\]/g;function Dt(e){return e.replace(Vh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ki(e,t,n,l,s,r,f,x){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Ji(e,f,zt(t)):n!=null?Ji(e,f,zt(n)):l!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+zt(x):e.removeAttribute("name")}function Fo(e,t,n,l,s,r,f,x){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Zi(e);return}n=n!=null?""+zt(n):"",t=t!=null?""+zt(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Zi(e)}function Ji(e,t,n){t==="number"&&bs(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function wl(e,t,n,l){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&l&&(e[n].defaultSelected=!0)}else{for(n=""+zt(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Io(e,t,n){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+zt(n):""}function Wo(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(M(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=zt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Zi(e)}function Al(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qh=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 Po(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Qh.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function eu(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var s in t)l=t[s],t.hasOwnProperty(s)&&n[s]!==l&&Po(e,s,l)}else for(var r in t)t.hasOwnProperty(r)&&Po(e,r,t[r])}function Fi(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 Zh=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"]]),Kh=/^[\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 js(e){return Kh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function an(){}var Ii=null;function Wi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cl=null,zl=null;function tu(e){var t=El(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ki(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Dt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var s=l[ht]||null;if(!s)throw Error(o(90));Ki(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Jo(l)}break e;case"textarea":Io(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&wl(e,!!n.multiple,t,!1)}}}var Pi=!1;function nu(e,t,n){if(Pi)return e(t,n);Pi=!0;try{var l=e(t);return l}finally{if(Pi=!1,(Cl!==null||zl!==null)&&(ci(),Cl&&(t=Cl,e=zl,zl=Cl=null,tu(t),e)))for(t=0;t<e.length;t++)tu(e[t])}}function ya(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ht]||null;if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),er=!1;if(sn)try{var ba={};Object.defineProperty(ba,"passive",{get:function(){er=!0}}),window.addEventListener("test",ba,ba),window.removeEventListener("test",ba,ba)}catch{er=!1}var Mn=null,tr=null,Ns=null;function lu(){if(Ns)return Ns;var e,t=tr,n=t.length,l,s="value"in Mn?Mn.value:Mn.textContent,r=s.length;for(e=0;e<n&&t[e]===s[e];e++);var f=n-e;for(l=1;l<=f&&t[n-l]===s[r-l];l++);return Ns=s.slice(e,1<l?1-l:void 0)}function Ss(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 ks(){return!0}function au(){return!1}function xt(e){function t(n,l,s,r,f){this._reactName=n,this._targetInst=s,this.type=l,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(r):r[x]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ks:au,this.isPropagationStopped=au,this}return S(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ks)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ks)},persist:function(){},isPersistent:ks}),t}var nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_s=xt(nl),ja=S({},nl,{view:0,detail:0}),Jh=xt(ja),nr,lr,Na,Es=S({},ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sr,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!==Na&&(Na&&e.type==="mousemove"?(nr=e.screenX-Na.screenX,lr=e.screenY-Na.screenY):lr=nr=0,Na=e),nr)},movementY:function(e){return"movementY"in e?e.movementY:lr}}),su=xt(Es),Fh=S({},Es,{dataTransfer:0}),Ih=xt(Fh),Wh=S({},ja,{relatedTarget:0}),ar=xt(Wh),Ph=S({},nl,{animationName:0,elapsedTime:0,pseudoElement:0}),ex=xt(Ph),tx=S({},nl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nx=xt(tx),lx=S({},nl,{data:0}),iu=xt(lx),ax={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sx={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"},ix={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ix[e])?!!t[e]:!1}function sr(){return rx}var cx=S({},ja,{key:function(e){if(e.key){var t=ax[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ss(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sr,charCode:function(e){return e.type==="keypress"?Ss(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ss(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ox=xt(cx),ux=S({},Es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ru=xt(ux),dx=S({},ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sr}),fx=xt(dx),mx=S({},nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),hx=xt(mx),xx=S({},Es,{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}),px=xt(xx),vx=S({},nl,{newState:0,oldState:0}),gx=xt(vx),yx=[9,13,27,32],ir=sn&&"CompositionEvent"in window,Sa=null;sn&&"documentMode"in document&&(Sa=document.documentMode);var bx=sn&&"TextEvent"in window&&!Sa,cu=sn&&(!ir||Sa&&8<Sa&&11>=Sa),ou=" ",uu=!1;function du(e,t){switch(e){case"keyup":return yx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dl=!1;function jx(e,t){switch(e){case"compositionend":return fu(t);case"keypress":return t.which!==32?null:(uu=!0,ou);case"textInput":return e=t.data,e===ou&&uu?null:e;default:return null}}function Nx(e,t){if(Dl)return e==="compositionend"||!ir&&du(e,t)?(e=lu(),Ns=tr=Mn=null,Dl=!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 cu&&t.locale!=="ko"?null:t.data;default:return null}}var Sx={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"?!!Sx[e.type]:t==="textarea"}function hu(e,t,n,l){Cl?zl?zl.push(l):zl=[l]:Cl=l,t=xi(t,"onChange"),0<t.length&&(n=new _s("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var ka=null,_a=null;function kx(e){If(e,0)}function Ts(e){var t=ga(e);if(Jo(t))return e}function xu(e,t){if(e==="change")return t}var pu=!1;if(sn){var rr;if(sn){var cr="oninput"in document;if(!cr){var vu=document.createElement("div");vu.setAttribute("oninput","return;"),cr=typeof vu.oninput=="function"}rr=cr}else rr=!1;pu=rr&&(!document.documentMode||9<document.documentMode)}function gu(){ka&&(ka.detachEvent("onpropertychange",yu),_a=ka=null)}function yu(e){if(e.propertyName==="value"&&Ts(_a)){var t=[];hu(t,_a,e,Wi(e)),nu(kx,t)}}function _x(e,t,n){e==="focusin"?(gu(),ka=t,_a=n,ka.attachEvent("onpropertychange",yu)):e==="focusout"&&gu()}function Ex(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(_a)}function Tx(e,t){if(e==="click")return Ts(t)}function Mx(e,t){if(e==="input"||e==="change")return Ts(t)}function wx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:wx;function Ea(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var s=n[l];if(!I.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function bu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ju(e,t){var n=bu(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=bu(n)}}function Nu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Su(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 n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bs(e.document)}return t}function or(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 Ax=sn&&"documentMode"in document&&11>=document.documentMode,Rl=null,ur=null,Ta=null,dr=!1;function ku(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;dr||Rl==null||Rl!==bs(l)||(l=Rl,"selectionStart"in l&&or(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ta&&Ea(Ta,l)||(Ta=l,l=xi(ur,"onSelect"),0<l.length&&(t=new _s("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Rl)))}function ll(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ol={animationend:ll("Animation","AnimationEnd"),animationiteration:ll("Animation","AnimationIteration"),animationstart:ll("Animation","AnimationStart"),transitionrun:ll("Transition","TransitionRun"),transitionstart:ll("Transition","TransitionStart"),transitioncancel:ll("Transition","TransitionCancel"),transitionend:ll("Transition","TransitionEnd")},fr={},_u={};sn&&(_u=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function al(e){if(fr[e])return fr[e];if(!Ol[e])return e;var t=Ol[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _u)return fr[e]=t[n];return e}var Eu=al("animationend"),Tu=al("animationiteration"),Mu=al("animationstart"),Cx=al("transitionrun"),zx=al("transitionstart"),Dx=al("transitioncancel"),wu=al("transitionend"),Au=new Map,mr="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(" ");mr.push("scrollEnd");function Xt(e,t){Au.set(e,t),tl(t,[e])}var Ms=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)},Rt=[],Ul=0,hr=0;function ws(){for(var e=Ul,t=hr=Ul=0;t<e;){var n=Rt[t];Rt[t++]=null;var l=Rt[t];Rt[t++]=null;var s=Rt[t];Rt[t++]=null;var r=Rt[t];if(Rt[t++]=null,l!==null&&s!==null){var f=l.pending;f===null?s.next=s:(s.next=f.next,f.next=s),l.pending=s}r!==0&&Cu(n,s,r)}}function As(e,t,n,l){Rt[Ul++]=e,Rt[Ul++]=t,Rt[Ul++]=n,Rt[Ul++]=l,hr|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function xr(e,t,n,l){return As(e,t,n,l),Cs(e)}function sl(e,t){return As(e,null,null,t),Cs(e)}function Cu(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var s=!1,r=e.return;r!==null;)r.childLanes|=n,l=r.alternate,l!==null&&(l.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-St(n),e=r.hiddenUpdates,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=n|536870912),r):null}function Cs(e){if(50<Ja)throw Ja=0,kc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ql={};function Rx(e,t,n,l){this.tag=e,this.key=n,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,n,l){return new Rx(e,t,n,l)}function pr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rn(e,t){var n=e.alternate;return n===null?(n=_t(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function zu(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zs(e,t,n,l,s,r){var f=0;if(l=e,typeof e=="function")pr(e)&&(f=1);else if(typeof e=="string")f=Lp(e,n,X.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=_t(31,n,t,s),e.elementType=le,e.lanes=r,e;case Y:return il(n.children,s,r,t);case w:f=8,s|=24;break;case W:return e=_t(12,n,t,s|2),e.elementType=W,e.lanes=r,e;case T:return e=_t(13,n,t,s),e.elementType=T,e.lanes=r,e;case Z:return e=_t(19,n,t,s),e.elementType=Z,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ne:f=10;break e;case Q:f=9;break e;case V:f=11;break e;case z:f=14;break e;case K:f=16,l=null;break e}f=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=_t(f,n,t,s),t.elementType=e,t.type=l,t.lanes=r,t}function il(e,t,n,l){return e=_t(7,e,l,t),e.lanes=n,e}function vr(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function Du(e){var t=_t(18,null,null,0);return t.stateNode=e,t}function gr(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ru=new WeakMap;function Ot(e,t){if(typeof e=="object"&&e!==null){var n=Ru.get(e);return n!==void 0?n:(t={value:e,source:t,stack:_n(t)},Ru.set(e,t),t)}return{value:e,source:t,stack:_n(t)}}var Bl=[],Ll=0,Ds=null,Ma=0,Ut=[],qt=0,wn=null,Kt=1,Jt="";function cn(e,t){Bl[Ll++]=Ma,Bl[Ll++]=Ds,Ds=e,Ma=t}function Ou(e,t,n){Ut[qt++]=Kt,Ut[qt++]=Jt,Ut[qt++]=wn,wn=e;var l=Kt;e=Jt;var s=32-St(l)-1;l&=~(1<<s),n+=1;var r=32-St(t)+s;if(30<r){var f=s-s%5;r=(l&(1<<f)-1).toString(32),l>>=f,s-=f,Kt=1<<32-St(t)+s|n<<s|l,Jt=r+e}else Kt=1<<r|n<<s|l,Jt=e}function yr(e){e.return!==null&&(cn(e,1),Ou(e,1,0))}function br(e){for(;e===Ds;)Ds=Bl[--Ll],Bl[Ll]=null,Ma=Bl[--Ll],Bl[Ll]=null;for(;e===wn;)wn=Ut[--qt],Ut[qt]=null,Jt=Ut[--qt],Ut[qt]=null,Kt=Ut[--qt],Ut[qt]=null}function Uu(e,t){Ut[qt++]=Kt,Ut[qt++]=Jt,Ut[qt++]=wn,Kt=t.id,Jt=t.overflow,wn=e}var st=null,qe=null,ke=!1,An=null,Bt=!1,jr=Error(o(519));function Cn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wa(Ot(t,e)),jr}function qu(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[at]=e,t[ht]=l,n){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(n=0;n<Ia.length;n++)je(Ia[n],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),Fo(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),Wo(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||tm(t.textContent,n)?(l.popover!=null&&(je("beforetoggle",t),je("toggle",t)),l.onScroll!=null&&je("scroll",t),l.onScrollEnd!=null&&je("scrollend",t),l.onClick!=null&&(t.onclick=an),t=!0):t=!1,t||Cn(e,!0)}function Bu(e){for(st=e.return;st;)switch(st.tag){case 5:case 31:case 13:Bt=!1;return;case 27:case 3:Bt=!0;return;default:st=st.return}}function Hl(e){if(e!==st)return!1;if(!ke)return Bu(e),ke=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Lc(e.type,e.memoizedProps)),n=!n),n&&qe&&Cn(e),Bu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));qe=um(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));qe=um(e)}else t===27?(t=qe,Vn(e.type)?(e=Xc,Xc=null,qe=e):qe=t):qe=st?Ht(e.stateNode.nextSibling):null;return!0}function rl(){qe=st=null,ke=!1}function Nr(){var e=An;return e!==null&&(yt===null?yt=e:yt.push.apply(yt,e),An=null),e}function wa(e){An===null?An=[e]:An.push(e)}var Sr=j(null),cl=null,on=null;function zn(e,t,n){P(Sr,t._currentValue),t._currentValue=n}function un(e){e._currentValue=Sr.current,q(Sr)}function kr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function _r(e,t,n,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var f=s.child;r=r.firstContext;e:for(;r!==null;){var x=r;r=s;for(var b=0;b<t.length;b++)if(x.context===t[b]){r.lanes|=n,x=r.alternate,x!==null&&(x.lanes|=n),kr(r.return,n,e),l||(f=null);break e}r=x.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(o(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),kr(f,n,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function $l(e,t,n,l){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(o(387));if(f=f.memoizedProps,f!==null){var x=s.type;kt(s.pendingProps.value,f.value)||(e!==null?e.push(x):e=[x])}}else if(s===oe.current){if(f=s.alternate,f===null)throw Error(o(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(ns):e=[ns])}s=s.return}e!==null&&_r(t,e,n,l),t.flags|=262144}function Rs(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ol(e){cl=e,on=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function it(e){return Lu(cl,e)}function Os(e,t){return cl===null&&ol(e),Lu(e,t)}function Lu(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},on===null){if(e===null)throw Error(o(308));on=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else on=on.next=t;return n}var Ox=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ux=i.unstable_scheduleCallback,qx=i.unstable_NormalPriority,Ve={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Er(){return{controller:new Ox,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ux(qx,function(){e.controller.abort()})}var Ca=null,Tr=0,Gl=0,Yl=null;function Bx(e,t){if(Ca===null){var n=Ca=[];Tr=0,Gl=Ac(),Yl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Tr++,t.then(Hu,Hu),t}function Hu(){if(--Tr===0&&Ca!==null){Yl!==null&&(Yl.status="fulfilled");var e=Ca;Ca=null,Gl=0,Yl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Lx(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),l}var $u=E.S;E.S=function(e,t){_f=lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Bx(e,t),$u!==null&&$u(e,t)};var ul=j(null);function Mr(){var e=ul.current;return e!==null?e:Ue.pooledCache}function Us(e,t){t===null?P(ul,ul.current):P(ul,t.pool)}function Gu(){var e=Mr();return e===null?null:{parent:Ve._currentValue,pool:e}}var Xl=Error(o(460)),wr=Error(o(474)),qs=Error(o(542)),Bs={then:function(){}};function Yu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(an,an),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Qu(e),e;default:if(typeof t.status=="string")t.then(an,an);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Qu(e),e}throw fl=t,Xl}}function dl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(fl=n,Xl):n}}var fl=null;function Vu(){if(fl===null)throw Error(o(459));var e=fl;return fl=null,e}function Qu(e){if(e===Xl||e===qs)throw Error(o(483))}var Vl=null,za=0;function Ls(e){var t=za;return za+=1,Vl===null&&(Vl=[]),Xu(Vl,e,t)}function Da(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Hs(e,t){throw t.$$typeof===R?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Zu(e){function t(_,N){if(e){var A=_.deletions;A===null?(_.deletions=[N],_.flags|=16):A.push(N)}}function n(_,N){if(!e)return null;for(;N!==null;)t(_,N),N=N.sibling;return null}function l(_){for(var N=new Map;_!==null;)_.key!==null?N.set(_.key,_):N.set(_.index,_),_=_.sibling;return N}function s(_,N){return _=rn(_,N),_.index=0,_.sibling=null,_}function r(_,N,A){return _.index=A,e?(A=_.alternate,A!==null?(A=A.index,A<N?(_.flags|=67108866,N):A):(_.flags|=67108866,N)):(_.flags|=1048576,N)}function f(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function x(_,N,A,H){return N===null||N.tag!==6?(N=vr(A,_.mode,H),N.return=_,N):(N=s(N,A),N.return=_,N)}function b(_,N,A,H){var ue=A.type;return ue===Y?B(_,N,A.props.children,H,A.key):N!==null&&(N.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===K&&dl(ue)===N.type)?(N=s(N,A.props),Da(N,A),N.return=_,N):(N=zs(A.type,A.key,A.props,null,_.mode,H),Da(N,A),N.return=_,N)}function C(_,N,A,H){return N===null||N.tag!==4||N.stateNode.containerInfo!==A.containerInfo||N.stateNode.implementation!==A.implementation?(N=gr(A,_.mode,H),N.return=_,N):(N=s(N,A.children||[]),N.return=_,N)}function B(_,N,A,H,ue){return N===null||N.tag!==7?(N=il(A,_.mode,H,ue),N.return=_,N):(N=s(N,A),N.return=_,N)}function G(_,N,A){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=vr(""+N,_.mode,A),N.return=_,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case J:return A=zs(N.type,N.key,N.props,null,_.mode,A),Da(A,N),A.return=_,A;case $:return N=gr(N,_.mode,A),N.return=_,N;case K:return N=dl(N),G(_,N,A)}if(M(N)||ee(N))return N=il(N,_.mode,A,null),N.return=_,N;if(typeof N.then=="function")return G(_,Ls(N),A);if(N.$$typeof===ne)return G(_,Os(_,N),A);Hs(_,N)}return null}function D(_,N,A,H){var ue=N!==null?N.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return ue!==null?null:x(_,N,""+A,H);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case J:return A.key===ue?b(_,N,A,H):null;case $:return A.key===ue?C(_,N,A,H):null;case K:return A=dl(A),D(_,N,A,H)}if(M(A)||ee(A))return ue!==null?null:B(_,N,A,H,null);if(typeof A.then=="function")return D(_,N,Ls(A),H);if(A.$$typeof===ne)return D(_,N,Os(_,A),H);Hs(_,A)}return null}function O(_,N,A,H,ue){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return _=_.get(A)||null,x(N,_,""+H,ue);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case J:return _=_.get(H.key===null?A:H.key)||null,b(N,_,H,ue);case $:return _=_.get(H.key===null?A:H.key)||null,C(N,_,H,ue);case K:return H=dl(H),O(_,N,A,H,ue)}if(M(H)||ee(H))return _=_.get(A)||null,B(N,_,H,ue,null);if(typeof H.then=="function")return O(_,N,A,Ls(H),ue);if(H.$$typeof===ne)return O(_,N,A,Os(N,H),ue);Hs(N,H)}return null}function ie(_,N,A,H){for(var ue=null,_e=null,re=N,ge=N=0,Se=null;re!==null&&ge<A.length;ge++){re.index>ge?(Se=re,re=null):Se=re.sibling;var Ee=D(_,re,A[ge],H);if(Ee===null){re===null&&(re=Se);break}e&&re&&Ee.alternate===null&&t(_,re),N=r(Ee,N,ge),_e===null?ue=Ee:_e.sibling=Ee,_e=Ee,re=Se}if(ge===A.length)return n(_,re),ke&&cn(_,ge),ue;if(re===null){for(;ge<A.length;ge++)re=G(_,A[ge],H),re!==null&&(N=r(re,N,ge),_e===null?ue=re:_e.sibling=re,_e=re);return ke&&cn(_,ge),ue}for(re=l(re);ge<A.length;ge++)Se=O(re,_,ge,A[ge],H),Se!==null&&(e&&Se.alternate!==null&&re.delete(Se.key===null?ge:Se.key),N=r(Se,N,ge),_e===null?ue=Se:_e.sibling=Se,_e=Se);return e&&re.forEach(function(Fn){return t(_,Fn)}),ke&&cn(_,ge),ue}function me(_,N,A,H){if(A==null)throw Error(o(151));for(var ue=null,_e=null,re=N,ge=N=0,Se=null,Ee=A.next();re!==null&&!Ee.done;ge++,Ee=A.next()){re.index>ge?(Se=re,re=null):Se=re.sibling;var Fn=D(_,re,Ee.value,H);if(Fn===null){re===null&&(re=Se);break}e&&re&&Fn.alternate===null&&t(_,re),N=r(Fn,N,ge),_e===null?ue=Fn:_e.sibling=Fn,_e=Fn,re=Se}if(Ee.done)return n(_,re),ke&&cn(_,ge),ue;if(re===null){for(;!Ee.done;ge++,Ee=A.next())Ee=G(_,Ee.value,H),Ee!==null&&(N=r(Ee,N,ge),_e===null?ue=Ee:_e.sibling=Ee,_e=Ee);return ke&&cn(_,ge),ue}for(re=l(re);!Ee.done;ge++,Ee=A.next())Ee=O(re,_,ge,Ee.value,H),Ee!==null&&(e&&Ee.alternate!==null&&re.delete(Ee.key===null?ge:Ee.key),N=r(Ee,N,ge),_e===null?ue=Ee:_e.sibling=Ee,_e=Ee);return e&&re.forEach(function(Fp){return t(_,Fp)}),ke&&cn(_,ge),ue}function Oe(_,N,A,H){if(typeof A=="object"&&A!==null&&A.type===Y&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case J:e:{for(var ue=A.key;N!==null;){if(N.key===ue){if(ue=A.type,ue===Y){if(N.tag===7){n(_,N.sibling),H=s(N,A.props.children),H.return=_,_=H;break e}}else if(N.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===K&&dl(ue)===N.type){n(_,N.sibling),H=s(N,A.props),Da(H,A),H.return=_,_=H;break e}n(_,N);break}else t(_,N);N=N.sibling}A.type===Y?(H=il(A.props.children,_.mode,H,A.key),H.return=_,_=H):(H=zs(A.type,A.key,A.props,null,_.mode,H),Da(H,A),H.return=_,_=H)}return f(_);case $:e:{for(ue=A.key;N!==null;){if(N.key===ue)if(N.tag===4&&N.stateNode.containerInfo===A.containerInfo&&N.stateNode.implementation===A.implementation){n(_,N.sibling),H=s(N,A.children||[]),H.return=_,_=H;break e}else{n(_,N);break}else t(_,N);N=N.sibling}H=gr(A,_.mode,H),H.return=_,_=H}return f(_);case K:return A=dl(A),Oe(_,N,A,H)}if(M(A))return ie(_,N,A,H);if(ee(A)){if(ue=ee(A),typeof ue!="function")throw Error(o(150));return A=ue.call(A),me(_,N,A,H)}if(typeof A.then=="function")return Oe(_,N,Ls(A),H);if(A.$$typeof===ne)return Oe(_,N,Os(_,A),H);Hs(_,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,N!==null&&N.tag===6?(n(_,N.sibling),H=s(N,A),H.return=_,_=H):(n(_,N),H=vr(A,_.mode,H),H.return=_,_=H),f(_)):n(_,N)}return function(_,N,A,H){try{za=0;var ue=Oe(_,N,A,H);return Vl=null,ue}catch(re){if(re===Xl||re===qs)throw re;var _e=_t(29,re,null,_.mode);return _e.lanes=H,_e.return=_,_e}finally{}}}var ml=Zu(!0),Ku=Zu(!1),Dn=!1;function Ar(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cr(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 Rn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function On(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Me&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=Cs(e),Cu(e,null,n),t}return As(e,l,t,n),Cs(e)}function Ra(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Lo(e,n)}}function zr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var s=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?s=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?s=r=t:r=r.next=t}else s=r=t;n={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Dr=!1;function Oa(){if(Dr){var e=Yl;if(e!==null)throw e}}function Ua(e,t,n,l){Dr=!1;var s=e.updateQueue;Dn=!1;var r=s.firstBaseUpdate,f=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var b=x,C=b.next;b.next=null,f===null?r=C:f.next=C,f=b;var B=e.alternate;B!==null&&(B=B.updateQueue,x=B.lastBaseUpdate,x!==f&&(x===null?B.firstBaseUpdate=C:x.next=C,B.lastBaseUpdate=b))}if(r!==null){var G=s.baseState;f=0,B=C=b=null,x=r;do{var D=x.lane&-536870913,O=D!==x.lane;if(O?(Ne&D)===D:(l&D)===D){D!==0&&D===Gl&&(Dr=!0),B!==null&&(B=B.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ie=e,me=x;D=t;var Oe=n;switch(me.tag){case 1:if(ie=me.payload,typeof ie=="function"){G=ie.call(Oe,G,D);break e}G=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=me.payload,D=typeof ie=="function"?ie.call(Oe,G,D):ie,D==null)break e;G=S({},G,D);break e;case 2:Dn=!0}}D=x.callback,D!==null&&(e.flags|=64,O&&(e.flags|=8192),O=s.callbacks,O===null?s.callbacks=[D]:O.push(D))}else O={lane:D,tag:x.tag,payload:x.payload,callback:x.callback,next:null},B===null?(C=B=O,b=G):B=B.next=O,f|=D;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;O=x,x=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);B===null&&(b=G),s.baseState=b,s.firstBaseUpdate=C,s.lastBaseUpdate=B,r===null&&(s.shared.lanes=0),Hn|=f,e.lanes=f,e.memoizedState=G}}function Ju(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Fu(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ju(n[e],t)}var Ql=j(null),$s=j(0);function Iu(e,t){e=yn,P($s,e),P(Ql,t),yn=e|t.baseLanes}function Rr(){P($s,yn),P(Ql,Ql.current)}function Or(){yn=$s.current,q(Ql),q($s)}var Et=j(null),Lt=null;function Un(e){var t=e.alternate;P(Ge,Ge.current&1),P(Et,e),Lt===null&&(t===null||Ql.current!==null||t.memoizedState!==null)&&(Lt=e)}function Ur(e){P(Ge,Ge.current),P(Et,e),Lt===null&&(Lt=e)}function Wu(e){e.tag===22?(P(Ge,Ge.current),P(Et,e),Lt===null&&(Lt=e)):qn()}function qn(){P(Ge,Ge.current),P(Et,Et.current)}function Tt(e){q(Et),Lt===e&&(Lt=null),q(Ge)}var Ge=j(0);function Gs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Gc(n)||Yc(n)))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)!==0)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 dn=0,ve=null,De=null,Qe=null,Ys=!1,Zl=!1,hl=!1,Xs=0,qa=0,Kl=null,Hx=0;function He(){throw Error(o(321))}function qr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function Br(e,t,n,l,s,r){return dn=r,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Od:Pr,hl=!1,r=n(l,s),hl=!1,Zl&&(r=ed(t,n,l,s)),Pu(e),r}function Pu(e){E.H=Ha;var t=De!==null&&De.next!==null;if(dn=0,Qe=De=ve=null,Ys=!1,qa=0,Kl=null,t)throw Error(o(300));e===null||Ze||(e=e.dependencies,e!==null&&Rs(e)&&(Ze=!0))}function ed(e,t,n,l){ve=e;var s=0;do{if(Zl&&(Kl=null),qa=0,Zl=!1,25<=s)throw Error(o(301));if(s+=1,Qe=De=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}E.H=Ud,r=t(n,l)}while(Zl);return r}function $x(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?Ba(t):t,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(ve.flags|=1024),t}function Lr(){var e=Xs!==0;return Xs=0,e}function Hr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $r(e){if(Ys){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ys=!1}dn=0,Qe=De=ve=null,Zl=!1,qa=Xs=0,Kl=null}function dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?ve.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Ye(){if(De===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var t=Qe===null?ve.memoizedState:Qe.next;if(t!==null)Qe=t,De=e;else{if(e===null)throw ve.alternate===null?Error(o(467)):Error(o(310));De=e,e={memoizedState:De.memoizedState,baseState:De.baseState,baseQueue:De.baseQueue,queue:De.queue,next:null},Qe===null?ve.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Vs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ba(e){var t=qa;return qa+=1,Kl===null&&(Kl=[]),e=Xu(Kl,e,t),t=ve,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Od:Pr),e}function Qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ba(e);if(e.$$typeof===ne)return it(e)}throw Error(o(438,String(e)))}function Gr(e){var t=null,n=ve.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=ve.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Vs(),ve.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=F;return t.index++,n}function fn(e,t){return typeof t=="function"?t(e):t}function Zs(e){var t=Ye();return Yr(t,De,e)}function Yr(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var s=e.baseQueue,r=l.pending;if(r!==null){if(s!==null){var f=s.next;s.next=r.next,r.next=f}t.baseQueue=s=r,l.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var x=f=null,b=null,C=t,B=!1;do{var G=C.lane&-536870913;if(G!==C.lane?(Ne&G)===G:(dn&G)===G){var D=C.revertLane;if(D===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),G===Gl&&(B=!0);else if((dn&D)===D){C=C.next,D===Gl&&(B=!0);continue}else G={lane:0,revertLane:C.revertLane,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},b===null?(x=b=G,f=r):b=b.next=G,ve.lanes|=D,Hn|=D;G=C.action,hl&&n(r,G),r=C.hasEagerState?C.eagerState:n(r,G)}else D={lane:G,revertLane:C.revertLane,gesture:C.gesture,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},b===null?(x=b=D,f=r):b=b.next=D,ve.lanes|=G,Hn|=G;C=C.next}while(C!==null&&C!==t);if(b===null?f=r:b.next=x,!kt(r,e.memoizedState)&&(Ze=!0,B&&(n=Yl,n!==null)))throw n;e.memoizedState=r,e.baseState=f,e.baseQueue=b,l.lastRenderedState=r}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Xr(e){var t=Ye(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,s=n.pending,r=t.memoizedState;if(s!==null){n.pending=null;var f=s=s.next;do r=e(r,f.action),f=f.next;while(f!==s);kt(r,t.memoizedState)||(Ze=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,l]}function td(e,t,n){var l=ve,s=Ye(),r=ke;if(r){if(n===void 0)throw Error(o(407));n=n()}else n=t();var f=!kt((De||s).memoizedState,n);if(f&&(s.memoizedState=n,Ze=!0),s=s.queue,Zr(ad.bind(null,l,s,e),[e]),s.getSnapshot!==t||f||Qe!==null&&Qe.memoizedState.tag&1){if(l.flags|=2048,Jl(9,{destroy:void 0},ld.bind(null,l,s,n,t),null),Ue===null)throw Error(o(349));r||(dn&127)!==0||nd(l,t,n)}return n}function nd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t=Vs(),ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ld(e,t,n,l){t.value=n,t.getSnapshot=l,sd(t)&&id(e)}function ad(e,t,n){return n(function(){sd(t)&&id(e)})}function sd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function id(e){var t=sl(e,2);t!==null&&bt(t,e,2)}function Vr(e){var t=dt();if(typeof e=="function"){var n=e;if(e=n(),hl){En(!0);try{n()}finally{En(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},t}function rd(e,t,n,l){return e.baseState=n,Yr(e,De,typeof l=="function"?l:fn)}function Gx(e,t,n,l,s){if(Fs(e))throw Error(o(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};E.T!==null?n(!0):r.isTransition=!1,l(r),n=t.pending,n===null?(r.next=t.pending=r,cd(t,r)):(r.next=n.next,t.pending=n.next=r)}}function cd(e,t){var n=t.action,l=t.payload,s=e.state;if(t.isTransition){var r=E.T,f={};E.T=f;try{var x=n(s,l),b=E.S;b!==null&&b(f,x),od(e,t,x)}catch(C){Qr(e,t,C)}finally{r!==null&&f.types!==null&&(r.types=f.types),E.T=r}}else try{r=n(s,l),od(e,t,r)}catch(C){Qr(e,t,C)}}function od(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){ud(e,t,l)},function(l){return Qr(e,t,l)}):ud(e,t,n)}function ud(e,t,n){t.status="fulfilled",t.value=n,dd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,cd(e,n)))}function Qr(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,dd(t),t=t.next;while(t!==l)}e.action=null}function dd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function fd(e,t){return t}function md(e,t){if(ke){var n=Ue.formState;if(n!==null){e:{var l=ve;if(ke){if(qe){t:{for(var s=qe,r=Bt;s.nodeType!==8;){if(!r){s=null;break t}if(s=Ht(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){qe=Ht(s.nextSibling),l=s.data==="F!";break e}}Cn(l)}l=!1}l&&(t=n[0])}}return n=dt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fd,lastRenderedState:t},n.queue=l,n=zd.bind(null,ve,l),l.dispatch=n,l=Vr(!1),r=Wr.bind(null,ve,!1,l.queue),l=dt(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,n=Gx.bind(null,ve,s,r,n),s.dispatch=n,l.memoizedState=e,[t,n,!1]}function hd(e){var t=Ye();return xd(t,De,e)}function xd(e,t,n){if(t=Yr(e,t,fd)[0],e=Zs(fn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ba(t)}catch(f){throw f===Xl?qs:f}else l=t;t=Ye();var s=t.queue,r=s.dispatch;return n!==t.memoizedState&&(ve.flags|=2048,Jl(9,{destroy:void 0},Yx.bind(null,s,n),null)),[l,r,e]}function Yx(e,t){e.action=t}function pd(e){var t=Ye(),n=De;if(n!==null)return xd(t,n,e);Ye(),t=t.memoizedState,n=Ye();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Jl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=ve.updateQueue,t===null&&(t=Vs(),ve.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function vd(){return Ye().memoizedState}function Ks(e,t,n,l){var s=dt();ve.flags|=e,s.memoizedState=Jl(1|t,{destroy:void 0},n,l===void 0?null:l)}function Js(e,t,n,l){var s=Ye();l=l===void 0?null:l;var r=s.memoizedState.inst;De!==null&&l!==null&&qr(l,De.memoizedState.deps)?s.memoizedState=Jl(t,r,n,l):(ve.flags|=e,s.memoizedState=Jl(1|t,r,n,l))}function gd(e,t){Ks(8390656,8,e,t)}function Zr(e,t){Js(2048,8,e,t)}function Xx(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=Vs(),ve.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function yd(e){var t=Ye().memoizedState;return Xx({ref:t,nextImpl:e}),function(){if((Me&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function bd(e,t){return Js(4,2,e,t)}function jd(e,t){return Js(4,4,e,t)}function Nd(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Sd(e,t,n){n=n!=null?n.concat([e]):null,Js(4,4,Nd.bind(null,t,e),n)}function Kr(){}function kd(e,t){var n=Ye();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&qr(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function _d(e,t){var n=Ye();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&qr(t,l[1]))return l[0];if(l=e(),hl){En(!0);try{e()}finally{En(!1)}}return n.memoizedState=[l,t],l}function Jr(e,t,n){return n===void 0||(dn&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Tf(),ve.lanes|=e,Hn|=e,n)}function Ed(e,t,n,l){return kt(n,t)?n:Ql.current!==null?(e=Jr(e,n,l),kt(e,t)||(Ze=!0),e):(dn&42)===0||(dn&1073741824)!==0&&(Ne&261930)===0?(Ze=!0,e.memoizedState=n):(e=Tf(),ve.lanes|=e,Hn|=e,t)}function Td(e,t,n,l,s){var r=L.p;L.p=r!==0&&8>r?r:8;var f=E.T,x={};E.T=x,Wr(e,!1,t,n);try{var b=s(),C=E.S;if(C!==null&&C(x,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var B=Lx(b,l);La(e,t,B,At(e))}else La(e,t,l,At(e))}catch(G){La(e,t,{then:function(){},status:"rejected",reason:G},At())}finally{L.p=r,f!==null&&x.types!==null&&(f.types=x.types),E.T=f}}function Vx(){}function Fr(e,t,n,l){if(e.tag!==5)throw Error(o(476));var s=Md(e).queue;Td(e,s,t,te,n===null?Vx:function(){return wd(e),n(l)})}function Md(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wd(e){var t=Md(e);t.next===null&&(t=e.alternate.memoizedState),La(e,t.next.queue,{},At())}function Ir(){return it(ns)}function Ad(){return Ye().memoizedState}function Cd(){return Ye().memoizedState}function Qx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=At();e=Rn(n);var l=On(t,e,n);l!==null&&(bt(l,t,n),Ra(l,t,n)),t={cache:Er()},e.payload=t;return}t=t.return}}function Zx(e,t,n){var l=At();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Dd(t,n):(n=xr(e,t,n,l),n!==null&&(bt(n,e,l),Rd(n,t,l)))}function zd(e,t,n){var l=At();La(e,t,n,l)}function La(e,t,n,l){var s={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Dd(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,x=r(f,n);if(s.hasEagerState=!0,s.eagerState=x,kt(x,f))return As(e,t,s,0),Ue===null&&ws(),!1}catch{}finally{}if(n=xr(e,t,s,l),n!==null)return bt(n,e,l),Rd(n,t,l),!0}return!1}function Wr(e,t,n,l){if(l={lane:2,revertLane:Ac(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(o(479))}else t=xr(e,n,l,2),t!==null&&bt(t,e,2)}function Fs(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function Dd(e,t){Zl=Ys=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Lo(e,n)}}var Ha={readContext:it,use:Qs,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};Ha.useEffectEvent=He;var Od={readContext:it,use:Qs,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:gd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ks(4194308,4,Nd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){Ks(4,2,e,t)},useMemo:function(e,t){var n=dt();t=t===void 0?null:t;var l=e();if(hl){En(!0);try{e()}finally{En(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=dt();if(n!==void 0){var s=n(t);if(hl){En(!0);try{n(t)}finally{En(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=Zx.bind(null,ve,e),[l.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Vr(e);var t=e.queue,n=zd.bind(null,ve,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Kr,useDeferredValue:function(e,t){var n=dt();return Jr(n,e,t)},useTransition:function(){var e=Vr(!1);return e=Td.bind(null,ve,e.queue,!0,!1),dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=ve,s=dt();if(ke){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Ue===null)throw Error(o(349));(Ne&127)!==0||nd(l,t,n)}s.memoizedState=n;var r={value:n,getSnapshot:t};return s.queue=r,gd(ad.bind(null,l,r,e),[e]),l.flags|=2048,Jl(9,{destroy:void 0},ld.bind(null,l,r,n,t),null),n},useId:function(){var e=dt(),t=Ue.identifierPrefix;if(ke){var n=Jt,l=Kt;n=(l&~(1<<32-St(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Xs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Hx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ir,useFormState:md,useActionState:md,useOptimistic:function(e){var t=dt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Wr.bind(null,ve,!0,n),n.dispatch=t,[e,t]},useMemoCache:Gr,useCacheRefresh:function(){return dt().memoizedState=Qx.bind(null,ve)},useEffectEvent:function(e){var t=dt(),n={impl:e};return t.memoizedState=n,function(){if((Me&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Pr={readContext:it,use:Qs,useCallback:kd,useContext:it,useEffect:Zr,useImperativeHandle:Sd,useInsertionEffect:bd,useLayoutEffect:jd,useMemo:_d,useReducer:Zs,useRef:vd,useState:function(){return Zs(fn)},useDebugValue:Kr,useDeferredValue:function(e,t){var n=Ye();return Ed(n,De.memoizedState,e,t)},useTransition:function(){var e=Zs(fn)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:Ba(e),t]},useSyncExternalStore:td,useId:Ad,useHostTransitionStatus:Ir,useFormState:hd,useActionState:hd,useOptimistic:function(e,t){var n=Ye();return rd(n,De,e,t)},useMemoCache:Gr,useCacheRefresh:Cd};Pr.useEffectEvent=yd;var Ud={readContext:it,use:Qs,useCallback:kd,useContext:it,useEffect:Zr,useImperativeHandle:Sd,useInsertionEffect:bd,useLayoutEffect:jd,useMemo:_d,useReducer:Xr,useRef:vd,useState:function(){return Xr(fn)},useDebugValue:Kr,useDeferredValue:function(e,t){var n=Ye();return De===null?Jr(n,e,t):Ed(n,De.memoizedState,e,t)},useTransition:function(){var e=Xr(fn)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:Ba(e),t]},useSyncExternalStore:td,useId:Ad,useHostTransitionStatus:Ir,useFormState:pd,useActionState:pd,useOptimistic:function(e,t){var n=Ye();return De!==null?rd(n,De,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Gr,useCacheRefresh:Cd};Ud.useEffectEvent=yd;function ec(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:S({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var tc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=At(),s=Rn(l);s.payload=t,n!=null&&(s.callback=n),t=On(e,s,l),t!==null&&(bt(t,e,l),Ra(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=At(),s=Rn(l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=On(e,s,l),t!==null&&(bt(t,e,l),Ra(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=At(),l=Rn(n);l.tag=2,t!=null&&(l.callback=t),t=On(e,l,n),t!==null&&(bt(t,e,n),Ra(t,e,n))}};function qd(e,t,n,l,s,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,r,f):t.prototype&&t.prototype.isPureReactComponent?!Ea(n,l)||!Ea(s,r):!0}function Bd(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&tc.enqueueReplaceState(t,t.state,null)}function xl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=S({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function Ld(e){Ms(e)}function Hd(e){console.error(e)}function $d(e){Ms(e)}function Is(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Gd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function nc(e,t,n){return n=Rn(n),n.tag=3,n.payload={element:null},n.callback=function(){Is(e,t)},n}function Yd(e){return e=Rn(e),e.tag=3,e}function Xd(e,t,n,l){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var r=l.value;e.payload=function(){return s(r)},e.callback=function(){Gd(t,n,l)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Gd(t,n,l),typeof s!="function"&&($n===null?$n=new Set([this]):$n.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function Kx(e,t,n,l,s){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&$l(t,n,s,!0),n=Et.current,n!==null){switch(n.tag){case 31:case 13:return Lt===null?oi():n.alternate===null&&$e===0&&($e=3),n.flags&=-257,n.flags|=65536,n.lanes=s,l===Bs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Tc(e,l,s)),!1;case 22:return n.flags|=65536,l===Bs?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Tc(e,l,s)),!1}throw Error(o(435,n.tag))}return Tc(e,l,s),oi(),!1}if(ke)return t=Et.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==jr&&(e=Error(o(422),{cause:l}),wa(Ot(e,n)))):(l!==jr&&(t=Error(o(423),{cause:l}),wa(Ot(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=Ot(l,n),s=nc(e.stateNode,l,s),zr(e,s),$e!==4&&($e=2)),!1;var r=Error(o(520),{cause:l});if(r=Ot(r,n),Ka===null?Ka=[r]:Ka.push(r),$e!==4&&($e=2),t===null)return!0;l=Ot(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=nc(n.stateNode,l,e),zr(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&($n===null||!$n.has(r))))return n.flags|=65536,s&=-s,n.lanes|=s,s=Yd(s),Xd(s,e,n,l),zr(n,s),!1}n=n.return}while(n!==null);return!1}var lc=Error(o(461)),Ze=!1;function rt(e,t,n,l){t.child=e===null?Ku(t,null,n,l):ml(t,e.child,n,l)}function Vd(e,t,n,l,s){n=n.render;var r=t.ref;if("ref"in l){var f={};for(var x in l)x!=="ref"&&(f[x]=l[x])}else f=l;return ol(t),l=Br(e,t,n,f,r,s),x=Lr(),e!==null&&!Ze?(Hr(e,t,s),mn(e,t,s)):(ke&&x&&yr(t),t.flags|=1,rt(e,t,l,s),t.child)}function Qd(e,t,n,l,s){if(e===null){var r=n.type;return typeof r=="function"&&!pr(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Zd(e,t,r,l,s)):(e=zs(n.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!dc(e,s)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:Ea,n(f,l)&&e.ref===t.ref)return mn(e,t,s)}return t.flags|=1,e=rn(r,l),e.ref=t.ref,e.return=t,t.child=e}function Zd(e,t,n,l,s){if(e!==null){var r=e.memoizedProps;if(Ea(r,l)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=l=r,dc(e,s))(e.flags&131072)!==0&&(Ze=!0);else return t.lanes=e.lanes,mn(e,t,s)}return ac(e,t,n,l,s)}function Kd(e,t,n,l){var s=l.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~r}else l=0,t.child=null;return Jd(e,t,r,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Us(t,r!==null?r.cachePool:null),r!==null?Iu(t,r):Rr(),Wu(t);else return l=t.lanes=536870912,Jd(e,t,r!==null?r.baseLanes|n:n,n,l)}else r!==null?(Us(t,r.cachePool),Iu(t,r),qn(),t.memoizedState=null):(e!==null&&Us(t,null),Rr(),qn());return rt(e,t,s,n),t.child}function $a(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jd(e,t,n,l,s){var r=Mr();return r=r===null?null:{parent:Ve._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Us(t,null),Rr(),Wu(t),e!==null&&$l(e,t,l,!0),t.childLanes=s,null}function Ws(e,t){return t=ei({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fd(e,t,n){return ml(t,e.child,null,n),e=Ws(t,t.pendingProps),e.flags|=2,Tt(t),t.memoizedState=null,e}function Jx(e,t,n){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(l.mode==="hidden")return e=Ws(t,l),t.lanes=536870912,$a(null,e);if(Ur(t),(e=qe)?(e=om(e,Bt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Kt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Du(e),n.return=t,t.child=n,st=t,qe=null)):e=null,e===null)throw Cn(t);return t.lanes=536870912,null}return Ws(t,l)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(Ur(t),s)if(t.flags&256)t.flags&=-257,t=Fd(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ze||$l(e,t,n,!1),s=(n&e.childLanes)!==0,Ze||s){if(l=Ue,l!==null&&(f=Ho(l,n),f!==0&&f!==r.retryLane))throw r.retryLane=f,sl(e,f),bt(l,e,f),lc;oi(),t=Fd(e,t,n)}else e=r.treeContext,qe=Ht(f.nextSibling),st=t,ke=!0,An=null,Bt=!1,e!==null&&Uu(t,e),t=Ws(t,l),t.flags|=4096;return t}return e=rn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ps(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ac(e,t,n,l,s){return ol(t),n=Br(e,t,n,l,void 0,s),l=Lr(),e!==null&&!Ze?(Hr(e,t,s),mn(e,t,s)):(ke&&l&&yr(t),t.flags|=1,rt(e,t,n,s),t.child)}function Id(e,t,n,l,s,r){return ol(t),t.updateQueue=null,n=ed(t,l,n,s),Pu(e),l=Lr(),e!==null&&!Ze?(Hr(e,t,r),mn(e,t,r)):(ke&&l&&yr(t),t.flags|=1,rt(e,t,n,r),t.child)}function Wd(e,t,n,l,s){if(ol(t),t.stateNode===null){var r=ql,f=n.contextType;typeof f=="object"&&f!==null&&(r=it(f)),r=new n(l,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=tc,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=l,r.state=t.memoizedState,r.refs={},Ar(t),f=n.contextType,r.context=typeof f=="object"&&f!==null?it(f):ql,r.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(ec(t,n,f,l),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&tc.enqueueReplaceState(r,r.state,null),Ua(t,l,r,s),Oa(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){r=t.stateNode;var x=t.memoizedProps,b=xl(n,x);r.props=b;var C=r.context,B=n.contextType;f=ql,typeof B=="object"&&B!==null&&(f=it(B));var G=n.getDerivedStateFromProps;B=typeof G=="function"||typeof r.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,B||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(x||C!==f)&&Bd(t,r,l,f),Dn=!1;var D=t.memoizedState;r.state=D,Ua(t,l,r,s),Oa(),C=t.memoizedState,x||D!==C||Dn?(typeof G=="function"&&(ec(t,n,G,l),C=t.memoizedState),(b=Dn||qd(t,n,b,l,D,C,f))?(B||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=C),r.props=l,r.state=C,r.context=f,l=b):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{r=t.stateNode,Cr(e,t),f=t.memoizedProps,B=xl(n,f),r.props=B,G=t.pendingProps,D=r.context,C=n.contextType,b=ql,typeof C=="object"&&C!==null&&(b=it(C)),x=n.getDerivedStateFromProps,(C=typeof x=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==G||D!==b)&&Bd(t,r,l,b),Dn=!1,D=t.memoizedState,r.state=D,Ua(t,l,r,s),Oa();var O=t.memoizedState;f!==G||D!==O||Dn||e!==null&&e.dependencies!==null&&Rs(e.dependencies)?(typeof x=="function"&&(ec(t,n,x,l),O=t.memoizedState),(B=Dn||qd(t,n,B,l,D,O,b)||e!==null&&e.dependencies!==null&&Rs(e.dependencies))?(C||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(l,O,b),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(l,O,b)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=O),r.props=l,r.state=O,r.context=b,l=B):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),l=!1)}return r=l,Ps(e,t),l=(t.flags&128)!==0,r||l?(r=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&l?(t.child=ml(t,e.child,null,s),t.child=ml(t,null,n,s)):rt(e,t,n,s),t.memoizedState=r.state,e=t.child):e=mn(e,t,s),e}function Pd(e,t,n,l){return rl(),t.flags|=256,rt(e,t,n,l),t.child}var sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ic(e){return{baseLanes:e,cachePool:Gu()}}function rc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=wt),e}function ef(e,t,n){var l=t.pendingProps,s=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(s?Un(t):qn(),(e=qe)?(e=om(e,Bt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wn!==null?{id:Kt,overflow:Jt}:null,retryLane:536870912,hydrationErrors:null},n=Du(e),n.return=t,t.child=n,st=t,qe=null)):e=null,e===null)throw Cn(t);return Yc(e)?t.lanes=32:t.lanes=536870912,null}var x=l.children;return l=l.fallback,s?(qn(),s=t.mode,x=ei({mode:"hidden",children:x},s),l=il(l,s,n,null),x.return=t,l.return=t,x.sibling=l,t.child=x,l=t.child,l.memoizedState=ic(n),l.childLanes=rc(e,f,n),t.memoizedState=sc,$a(null,l)):(Un(t),cc(t,x))}var b=e.memoizedState;if(b!==null&&(x=b.dehydrated,x!==null)){if(r)t.flags&256?(Un(t),t.flags&=-257,t=oc(e,t,n)):t.memoizedState!==null?(qn(),t.child=e.child,t.flags|=128,t=null):(qn(),x=l.fallback,s=t.mode,l=ei({mode:"visible",children:l.children},s),x=il(x,s,n,null),x.flags|=2,l.return=t,x.return=t,l.sibling=x,t.child=l,ml(t,e.child,null,n),l=t.child,l.memoizedState=ic(n),l.childLanes=rc(e,f,n),t.memoizedState=sc,t=$a(null,l));else if(Un(t),Yc(x)){if(f=x.nextSibling&&x.nextSibling.dataset,f)var C=f.dgst;f=C,l=Error(o(419)),l.stack="",l.digest=f,wa({value:l,source:null,stack:null}),t=oc(e,t,n)}else if(Ze||$l(e,t,n,!1),f=(n&e.childLanes)!==0,Ze||f){if(f=Ue,f!==null&&(l=Ho(f,n),l!==0&&l!==b.retryLane))throw b.retryLane=l,sl(e,l),bt(f,e,l),lc;Gc(x)||oi(),t=oc(e,t,n)}else Gc(x)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,qe=Ht(x.nextSibling),st=t,ke=!0,An=null,Bt=!1,e!==null&&Uu(t,e),t=cc(t,l.children),t.flags|=4096);return t}return s?(qn(),x=l.fallback,s=t.mode,b=e.child,C=b.sibling,l=rn(b,{mode:"hidden",children:l.children}),l.subtreeFlags=b.subtreeFlags&65011712,C!==null?x=rn(C,x):(x=il(x,s,n,null),x.flags|=2),x.return=t,l.return=t,l.sibling=x,t.child=l,$a(null,l),l=t.child,x=e.child.memoizedState,x===null?x=ic(n):(s=x.cachePool,s!==null?(b=Ve._currentValue,s=s.parent!==b?{parent:b,pool:b}:s):s=Gu(),x={baseLanes:x.baseLanes|n,cachePool:s}),l.memoizedState=x,l.childLanes=rc(e,f,n),t.memoizedState=sc,$a(e.child,l)):(Un(t),n=e.child,e=n.sibling,n=rn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function cc(e,t){return t=ei({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ei(e,t){return e=_t(22,e,null,t),e.lanes=0,e}function oc(e,t,n){return ml(t,e.child,null,n),e=cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tf(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),kr(e.return,t,n)}function uc(e,t,n,l,s,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:s,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=n,f.tailMode=s,f.treeForkCount=r)}function nf(e,t,n){var l=t.pendingProps,s=l.revealOrder,r=l.tail;l=l.children;var f=Ge.current,x=(f&2)!==0;if(x?(f=f&1|2,t.flags|=128):f&=1,P(Ge,f),rt(e,t,l,n),l=ke?Ma:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tf(e,n,t);else if(e.tag===19)tf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Gs(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),uc(t,!1,s,n,r,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Gs(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}uc(t,!0,n,null,r,l);break;case"together":uc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if($l(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=rn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=rn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Rs(e)))}function Fx(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),zn(t,Ve,e.memoizedState.cache),rl();break;case 27:case 5:Je(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:zn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ur(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Un(t),t.flags|=128,null):(n&t.child.childLanes)!==0?ef(e,t,n):(Un(t),e=mn(e,t,n),e!==null?e.sibling:null);Un(t);break;case 19:var s=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||($l(e,t,n,!1),l=(n&t.childLanes)!==0),s){if(l)return nf(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),P(Ge,Ge.current),l)break;return null;case 22:return t.lanes=0,Kd(e,t,n,t.pendingProps);case 24:zn(t,Ve,e.memoizedState.cache)}return mn(e,t,n)}function lf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ze=!0;else{if(!dc(e,n)&&(t.flags&128)===0)return Ze=!1,Fx(e,t,n);Ze=(e.flags&131072)!==0}else Ze=!1,ke&&(t.flags&1048576)!==0&&Ou(t,Ma,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=dl(t.elementType),t.type=e,typeof e=="function")pr(e)?(l=xl(e,l),t.tag=1,t=Wd(null,t,e,l,n)):(t.tag=0,t=ac(null,t,e,l,n));else{if(e!=null){var s=e.$$typeof;if(s===V){t.tag=11,t=Vd(null,t,e,l,n);break e}else if(s===z){t.tag=14,t=Qd(null,t,e,l,n);break e}}throw t=he(e)||e,Error(o(306,t,""))}}return t;case 0:return ac(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,s=xl(l,t.pendingProps),Wd(e,t,l,s,n);case 3:e:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var r=t.memoizedState;s=r.element,Cr(e,t),Ua(t,l,null,n);var f=t.memoizedState;if(l=f.cache,zn(t,Ve,l),l!==r.cache&&_r(t,[Ve],n,!0),Oa(),l=f.element,r.isDehydrated)if(r={element:l,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Pd(e,t,l,n);break e}else if(l!==s){s=Ot(Error(o(424)),t),wa(s),t=Pd(e,t,l,n);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(qe=Ht(e.firstChild),st=t,ke=!0,An=null,Bt=!0,n=Ku(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(rl(),l===s){t=mn(e,t,n);break e}rt(e,t,l,n)}t=t.child}return t;case 26:return Ps(e,t),e===null?(n=xm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ke||(n=t.type,e=t.pendingProps,l=pi(se.current).createElement(n),l[at]=t,l[ht]=e,ct(l,n,e),et(l),t.stateNode=l):t.memoizedState=xm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Je(t),e===null&&ke&&(l=t.stateNode=fm(t.type,t.pendingProps,se.current),st=t,Bt=!0,s=qe,Vn(t.type)?(Xc=s,qe=Ht(l.firstChild)):qe=s),rt(e,t,t.pendingProps.children,n),Ps(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((s=l=qe)&&(l=Ep(l,t.type,t.pendingProps,Bt),l!==null?(t.stateNode=l,st=t,qe=Ht(l.firstChild),Bt=!1,s=!0):s=!1),s||Cn(t)),Je(t),s=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,l=r.children,Lc(s,r)?l=null:f!==null&&Lc(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Br(e,t,$x,null,null,n),ns._currentValue=s),Ps(e,t),rt(e,t,l,n),t.child;case 6:return e===null&&ke&&((e=n=qe)&&(n=Tp(n,t.pendingProps,Bt),n!==null?(t.stateNode=n,st=t,qe=null,e=!0):e=!1),e||Cn(t)),null;case 13:return ef(e,t,n);case 4:return we(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ml(t,null,l,n):rt(e,t,l,n),t.child;case 11:return Vd(e,t,t.type,t.pendingProps,n);case 7:return rt(e,t,t.pendingProps,n),t.child;case 8:return rt(e,t,t.pendingProps.children,n),t.child;case 12:return rt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,zn(t,t.type,l.value),rt(e,t,l.children,n),t.child;case 9:return s=t.type._context,l=t.pendingProps.children,ol(t),s=it(s),l=l(s),t.flags|=1,rt(e,t,l,n),t.child;case 14:return Qd(e,t,t.type,t.pendingProps,n);case 15:return Zd(e,t,t.type,t.pendingProps,n);case 19:return nf(e,t,n);case 31:return Jx(e,t,n);case 22:return Kd(e,t,n,t.pendingProps);case 24:return ol(t),l=it(Ve),e===null?(s=Mr(),s===null&&(s=Ue,r=Er(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=n),s=r),t.memoizedState={parent:l,cache:s},Ar(t),zn(t,Ve,s)):((e.lanes&n)!==0&&(Cr(e,t),Ua(t,null,null,n),Oa()),s=e.memoizedState,r=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),zn(t,Ve,l)):(l=r.cache,zn(t,Ve,l),l!==s.cache&&_r(t,[Ve],n,!0))),rt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function hn(e){e.flags|=4}function fc(e,t,n,l,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Cf())e.flags|=8192;else throw fl=Bs,wr}else e.flags&=-16777217}function af(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!bm(t))if(Cf())e.flags|=8192;else throw fl=Bs,wr}function ti(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qo():536870912,e.lanes|=t,Pl|=t)}function Ga(e,t){if(!ke)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags&65011712,l|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Ix(e,t,n){var l=t.pendingProps;switch(br(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return Be(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),un(Ve),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?hn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nr())),Be(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(hn(t),r!==null?(Be(t),af(t,r)):(Be(t),fc(t,s,null,l,n))):r?r!==e.memoizedState?(hn(t),Be(t),af(t,r)):(Be(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&hn(t),Be(t),fc(t,s,e,l,n)),null;case 27:if(Ct(t),n=se.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&hn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Be(t),null}e=X.current,Hl(t)?qu(t):(e=fm(s,l,n),t.stateNode=e,hn(t))}return Be(t),null;case 5:if(Ct(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&hn(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return Be(t),null}if(r=X.current,Hl(t))qu(t);else{var f=pi(se.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?r.multiple=!0:l.size&&(r.size=l.size);break;default:r=typeof l.is=="string"?f.createElement(s,{is:l.is}):f.createElement(s)}}r[at]=t,r[ht]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(ct(r,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&hn(t)}}return Be(t),fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&hn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=se.current,Hl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,s=st,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||tm(e.nodeValue,n)),e||Cn(t,!0)}else e=pi(e).createTextNode(l),e[at]=t,t.stateNode=e}return Be(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Hl(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[at]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),e=!1}else n=Nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Tt(t),t):(Tt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Be(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Hl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[at]=t}else rl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Be(t),s=!1}else s=Nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Tt(t),t):(Tt(t),null)}return Tt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==s&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ti(t,t.updateQueue),Be(t),null);case 4:return ye(),e===null&&Rc(t.stateNode.containerInfo),Be(t),null;case 10:return un(t.type),Be(t),null;case 19:if(q(Ge),l=t.memoizedState,l===null)return Be(t),null;if(s=(t.flags&128)!==0,r=l.rendering,r===null)if(s)Ga(l,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Gs(e),r!==null){for(t.flags|=128,Ga(l,!1),e=r.updateQueue,t.updateQueue=e,ti(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zu(n,e),n=n.sibling;return P(Ge,Ge.current&1|2),ke&&cn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&<()>ii&&(t.flags|=128,s=!0,Ga(l,!1),t.lanes=4194304)}else{if(!s)if(e=Gs(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,ti(t,e),Ga(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!ke)return Be(t),null}else 2*lt()-l.renderingStartTime>ii&&n!==536870912&&(t.flags|=128,s=!0,Ga(l,!1),t.lanes=4194304);l.isBackwards?(r.sibling=t.child,t.child=r):(e=l.last,e!==null?e.sibling=r:t.child=r,l.last=r)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=lt(),e.sibling=null,n=Ge.current,P(Ge,s?n&1|2:n&1),ke&&cn(t,l.treeForkCount),e):(Be(t),null);case 22:case 23:return Tt(t),Or(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),n=t.updateQueue,n!==null&&ti(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&q(ul),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),un(Ve),Be(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Wx(e,t){switch(br(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return un(Ve),ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ct(t),null;case 31:if(t.memoizedState!==null){if(Tt(t),t.alternate===null)throw Error(o(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ge),null;case 4:return ye(),null;case 10:return un(t.type),null;case 22:case 23:return Tt(t),Or(),e!==null&&q(ul),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return un(Ve),null;case 25:return null;default:return null}}function sf(e,t){switch(br(t),t.tag){case 3:un(Ve),ye();break;case 26:case 27:case 5:Ct(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&Tt(t);break;case 13:Tt(t);break;case 19:q(Ge);break;case 10:un(t.type);break;case 22:case 23:Tt(t),Or(),e!==null&&q(ul);break;case 24:un(Ve)}}function Ya(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var s=l.next;n=s;do{if((n.tag&e)===e){l=void 0;var r=n.create,f=n.inst;l=r(),f.destroy=l}n=n.next}while(n!==s)}}catch(x){ze(t,t.return,x)}}function Bn(e,t,n){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var r=s.next;l=r;do{if((l.tag&e)===e){var f=l.inst,x=f.destroy;if(x!==void 0){f.destroy=void 0,s=t;var b=n,C=x;try{C()}catch(B){ze(s,b,B)}}}l=l.next}while(l!==r)}}catch(B){ze(t,t.return,B)}}function rf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Fu(t,n)}catch(l){ze(e,e.return,l)}}}function cf(e,t,n){n.props=xl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){ze(e,t,l)}}function Xa(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(s){ze(e,t,s)}}function Ft(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(s){ze(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){ze(e,t,s)}else n.current=null}function of(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(s){ze(e,e.return,s)}}function mc(e,t,n){try{var l=e.stateNode;bp(l,e.type,n,t),l[ht]=t}catch(s){ze(e,e.return,s)}}function uf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vn(e.type)||e.tag===4}function hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uf(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&&Vn(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 xc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=an));else if(l!==4&&(l===27&&Vn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(xc(e,t,n),e=e.sibling;e!==null;)xc(e,t,n),e=e.sibling}function ni(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Vn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ni(e,t,n),e=e.sibling;e!==null;)ni(e,t,n),e=e.sibling}function df(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ct(t,l,n),t[at]=e,t[ht]=n}catch(r){ze(e,e.return,r)}}var xn=!1,Ke=!1,pc=!1,ff=typeof WeakSet=="function"?WeakSet:Set,tt=null;function Px(e,t){if(e=e.containerInfo,qc=Si,e=Su(e),or(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var s=l.anchorOffset,r=l.focusNode;l=l.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var f=0,x=-1,b=-1,C=0,B=0,G=e,D=null;t:for(;;){for(var O;G!==n||s!==0&&G.nodeType!==3||(x=f+s),G!==r||l!==0&&G.nodeType!==3||(b=f+l),G.nodeType===3&&(f+=G.nodeValue.length),(O=G.firstChild)!==null;)D=G,G=O;for(;;){if(G===e)break t;if(D===n&&++C===s&&(x=f),D===r&&++B===l&&(b=f),(O=G.nextSibling)!==null)break;G=D,D=G.parentNode}G=O}n=x===-1||b===-1?null:{start:x,end:b}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bc={focusedElem:e,selectionRange:n},Si=!1,tt=t;tt!==null;)if(t=tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,tt=e;else for(;tt!==null;){switch(t=tt,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,n=t,s=r.memoizedProps,r=r.memoizedState,l=n.stateNode;try{var ie=xl(n.type,s);e=l.getSnapshotBeforeUpdate(ie,r),l.__reactInternalSnapshotBeforeUpdate=e}catch(me){ze(n,n.return,me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)$c(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":$c(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,tt=e;break}tt=t.return}}function mf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:vn(e,n),l&4&&Ya(5,n);break;case 1:if(vn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){ze(n,n.return,f)}else{var s=xl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){ze(n,n.return,f)}}l&64&&rf(n),l&512&&Xa(n,n.return);break;case 3:if(vn(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Fu(e,t)}catch(f){ze(n,n.return,f)}}break;case 27:t===null&&l&4&&df(n);case 26:case 5:vn(e,n),t===null&&l&4&&of(n),l&512&&Xa(n,n.return);break;case 12:vn(e,n);break;case 31:vn(e,n),l&4&&pf(e,n);break;case 13:vn(e,n),l&4&&vf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=cp.bind(null,n),Mp(e,n))));break;case 22:if(l=n.memoizedState!==null||xn,!l){t=t!==null&&t.memoizedState!==null||Ke,s=xn;var r=Ke;xn=l,(Ke=t)&&!r?gn(e,n,(n.subtreeFlags&8772)!==0):vn(e,n),xn=s,Ke=r}break;case 30:break;default:vn(e,n)}}function hf(e){var t=e.alternate;t!==null&&(e.alternate=null,hf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qi(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 Le=null,pt=!1;function pn(e,t,n){for(n=n.child;n!==null;)xf(e,t,n),n=n.sibling}function xf(e,t,n){if(Nt&&typeof Nt.onCommitFiberUnmount=="function")try{Nt.onCommitFiberUnmount(ha,n)}catch{}switch(n.tag){case 26:Ke||Ft(n,t),pn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||Ft(n,t);var l=Le,s=pt;Vn(n.type)&&(Le=n.stateNode,pt=!1),pn(e,t,n),Pa(n.stateNode),Le=l,pt=s;break;case 5:Ke||Ft(n,t);case 6:if(l=Le,s=pt,Le=null,pn(e,t,n),Le=l,pt=s,Le!==null)if(pt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(r){ze(n,t,r)}else try{Le.removeChild(n.stateNode)}catch(r){ze(n,t,r)}break;case 18:Le!==null&&(pt?(e=Le,rm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ra(e)):rm(Le,n.stateNode));break;case 4:l=Le,s=pt,Le=n.stateNode.containerInfo,pt=!0,pn(e,t,n),Le=l,pt=s;break;case 0:case 11:case 14:case 15:Bn(2,n,t),Ke||Bn(4,n,t),pn(e,t,n);break;case 1:Ke||(Ft(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&cf(n,t,l)),pn(e,t,n);break;case 21:pn(e,t,n);break;case 22:Ke=(l=Ke)||n.memoizedState!==null,pn(e,t,n),Ke=l;break;default:pn(e,t,n)}}function pf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ra(e)}catch(n){ze(t,t.return,n)}}}function vf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ra(e)}catch(n){ze(t,t.return,n)}}function ep(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ff),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ff),t;default:throw Error(o(435,e.tag))}}function li(e,t){var n=ep(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var s=op.bind(null,e,l);l.then(s,s)}})}function vt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var s=n[l],r=e,f=t,x=f;e:for(;x!==null;){switch(x.tag){case 27:if(Vn(x.type)){Le=x.stateNode,pt=!1;break e}break;case 5:Le=x.stateNode,pt=!1;break e;case 3:case 4:Le=x.stateNode.containerInfo,pt=!0;break e}x=x.return}if(Le===null)throw Error(o(160));xf(r,f,s),Le=null,pt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gf(t,e),t=t.sibling}var Vt=null;function gf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vt(t,e),gt(e),l&4&&(Bn(3,e,e.return),Ya(3,e),Bn(5,e,e.return));break;case 1:vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),l&64&&xn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var s=Vt;if(vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),l&4){var r=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(l){case"title":r=s.getElementsByTagName("title")[0],(!r||r[va]||r[at]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(l),s.head.insertBefore(r,s.querySelector("head > title"))),ct(r,l,n),r[at]=e,et(r),l=r;break e;case"link":var f=gm("link","href",s).get(l+(n.href||""));if(f){for(var x=0;x<f.length;x++)if(r=f[x],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(x,1);break t}}r=s.createElement(l),ct(r,l,n),s.head.appendChild(r);break;case"meta":if(f=gm("meta","content",s).get(l+(n.content||""))){for(x=0;x<f.length;x++)if(r=f[x],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(x,1);break t}}r=s.createElement(l),ct(r,l,n),s.head.appendChild(r);break;default:throw Error(o(468,l))}r[at]=e,et(r),l=r}e.stateNode=l}else ym(s,e.type,e.stateNode);else e.stateNode=vm(s,l,e.memoizedProps);else r!==l?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,l===null?ym(s,e.type,e.stateNode):vm(s,l,e.memoizedProps)):l===null&&e.stateNode!==null&&mc(e,e.memoizedProps,n.memoizedProps)}break;case 27:vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),n!==null&&l&4&&mc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(vt(t,e),gt(e),l&512&&(Ke||n===null||Ft(n,n.return)),e.flags&32){s=e.stateNode;try{Al(s,"")}catch(ie){ze(e,e.return,ie)}}l&4&&e.stateNode!=null&&(s=e.memoizedProps,mc(e,s,n!==null?n.memoizedProps:s)),l&1024&&(pc=!0);break;case 6:if(vt(t,e),gt(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ie){ze(e,e.return,ie)}}break;case 3:if(yi=null,s=Vt,Vt=vi(t.containerInfo),vt(t,e),Vt=s,gt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ra(t.containerInfo)}catch(ie){ze(e,e.return,ie)}pc&&(pc=!1,yf(e));break;case 4:l=Vt,Vt=vi(e.stateNode.containerInfo),vt(t,e),gt(e),Vt=l;break;case 12:vt(t,e),gt(e);break;case 31:vt(t,e),gt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,li(e,l)));break;case 13:vt(t,e),gt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(si=lt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,li(e,l)));break;case 22:s=e.memoizedState!==null;var b=n!==null&&n.memoizedState!==null,C=xn,B=Ke;if(xn=C||s,Ke=B||b,vt(t,e),Ke=B,xn=C,gt(e),l&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||b||xn||Ke||pl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){b=n=t;try{if(r=b.stateNode,s)f=r.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{x=b.stateNode;var G=b.memoizedProps.style,D=G!=null&&G.hasOwnProperty("display")?G.display:null;x.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(ie){ze(b,b.return,ie)}}}else if(t.tag===6){if(n===null){b=t;try{b.stateNode.nodeValue=s?"":b.memoizedProps}catch(ie){ze(b,b.return,ie)}}}else if(t.tag===18){if(n===null){b=t;try{var O=b.stateNode;s?cm(O,!0):cm(b.stateNode,!1)}catch(ie){ze(b,b.return,ie)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,li(e,n))));break;case 19:vt(t,e),gt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,li(e,l)));break;case 30:break;case 21:break;default:vt(t,e),gt(e)}}function gt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(uf(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var s=n.stateNode,r=hc(e);ni(e,r,s);break;case 5:var f=n.stateNode;n.flags&32&&(Al(f,""),n.flags&=-33);var x=hc(e);ni(e,x,f);break;case 3:case 4:var b=n.stateNode.containerInfo,C=hc(e);xc(e,C,b);break;default:throw Error(o(161))}}catch(B){ze(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mf(e,t.alternate,t),t=t.sibling}function pl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bn(4,t,t.return),pl(t);break;case 1:Ft(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&cf(t,t.return,n),pl(t);break;case 27:Pa(t.stateNode);case 26:case 5:Ft(t,t.return),pl(t);break;case 22:t.memoizedState===null&&pl(t);break;case 30:pl(t);break;default:pl(t)}e=e.sibling}}function gn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,s=e,r=t,f=r.flags;switch(r.tag){case 0:case 11:case 15:gn(s,r,n),Ya(4,r);break;case 1:if(gn(s,r,n),l=r,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(C){ze(l,l.return,C)}if(l=r,s=l.updateQueue,s!==null){var x=l.stateNode;try{var b=s.shared.hiddenCallbacks;if(b!==null)for(s.shared.hiddenCallbacks=null,s=0;s<b.length;s++)Ju(b[s],x)}catch(C){ze(l,l.return,C)}}n&&f&64&&rf(r),Xa(r,r.return);break;case 27:df(r);case 26:case 5:gn(s,r,n),n&&l===null&&f&4&&of(r),Xa(r,r.return);break;case 12:gn(s,r,n);break;case 31:gn(s,r,n),n&&f&4&&pf(s,r);break;case 13:gn(s,r,n),n&&f&4&&vf(s,r);break;case 22:r.memoizedState===null&&gn(s,r,n),Xa(r,r.return);break;case 30:break;default:gn(s,r,n)}t=t.sibling}}function vc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Aa(n))}function gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function Qt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bf(e,t,n,l),t=t.sibling}function bf(e,t,n,l){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Qt(e,t,n,l),s&2048&&Ya(9,t);break;case 1:Qt(e,t,n,l);break;case 3:Qt(e,t,n,l),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e)));break;case 12:if(s&2048){Qt(e,t,n,l),e=t.stateNode;try{var r=t.memoizedProps,f=r.id,x=r.onPostCommit;typeof x=="function"&&x(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){ze(t,t.return,b)}}else Qt(e,t,n,l);break;case 31:Qt(e,t,n,l);break;case 13:Qt(e,t,n,l);break;case 23:break;case 22:r=t.stateNode,f=t.alternate,t.memoizedState!==null?r._visibility&2?Qt(e,t,n,l):Va(e,t):r._visibility&2?Qt(e,t,n,l):(r._visibility|=2,Fl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),s&2048&&vc(f,t);break;case 24:Qt(e,t,n,l),s&2048&&gc(t.alternate,t);break;default:Qt(e,t,n,l)}}function Fl(e,t,n,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,x=n,b=l,C=f.flags;switch(f.tag){case 0:case 11:case 15:Fl(r,f,x,b,s),Ya(8,f);break;case 23:break;case 22:var B=f.stateNode;f.memoizedState!==null?B._visibility&2?Fl(r,f,x,b,s):Va(r,f):(B._visibility|=2,Fl(r,f,x,b,s)),s&&C&2048&&vc(f.alternate,f);break;case 24:Fl(r,f,x,b,s),s&&C&2048&&gc(f.alternate,f);break;default:Fl(r,f,x,b,s)}t=t.sibling}}function Va(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,s=l.flags;switch(l.tag){case 22:Va(n,l),s&2048&&vc(l.alternate,l);break;case 24:Va(n,l),s&2048&&gc(l.alternate,l);break;default:Va(n,l)}t=t.sibling}}var Qa=8192;function Il(e,t,n){if(e.subtreeFlags&Qa)for(e=e.child;e!==null;)jf(e,t,n),e=e.sibling}function jf(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Qa&&e.memoizedState!==null&&Hp(n,Vt,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var l=Vt;Vt=vi(e.stateNode.containerInfo),Il(e,t,n),Vt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Qa,Qa=16777216,Il(e,t,n),Qa=l):Il(e,t,n));break;default:Il(e,t,n)}}function Nf(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 Za(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];tt=l,kf(l,e)}Nf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sf(e),e=e.sibling}function Sf(e){switch(e.tag){case 0:case 11:case 15:Za(e),e.flags&2048&&Bn(9,e,e.return);break;case 3:Za(e);break;case 12:Za(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ai(e)):Za(e);break;default:Za(e)}}function ai(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];tt=l,kf(l,e)}Nf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bn(8,t,t.return),ai(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ai(t));break;default:ai(t)}e=e.sibling}}function kf(e,t){for(;tt!==null;){var n=tt;switch(n.tag){case 0:case 11:case 15:Bn(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Aa(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,tt=l;else e:for(n=e;tt!==null;){l=tt;var s=l.sibling,r=l.return;if(hf(l),l===n){tt=null;break e}if(s!==null){s.return=r,tt=s;break e}tt=r}}}var tp={getCacheForType:function(e){var t=it(Ve),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return it(Ve).controller.signal}},np=typeof WeakMap=="function"?WeakMap:Map,Me=0,Ue=null,be=null,Ne=0,Ce=0,Mt=null,Ln=!1,Wl=!1,yc=!1,yn=0,$e=0,Hn=0,vl=0,bc=0,wt=0,Pl=0,Ka=null,yt=null,jc=!1,si=0,_f=0,ii=1/0,ri=null,$n=null,Ie=0,Gn=null,ea=null,bn=0,Nc=0,Sc=null,Ef=null,Ja=0,kc=null;function At(){return(Me&2)!==0&&Ne!==0?Ne&-Ne:E.T!==null?Ac():$o()}function Tf(){if(wt===0)if((Ne&536870912)===0||ke){var e=xs;xs<<=1,(xs&3932160)===0&&(xs=262144),wt=e}else wt=536870912;return e=Et.current,e!==null&&(e.flags|=32),wt}function bt(e,t,n){(e===Ue&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(ta(e,0),Yn(e,Ne,wt,!1)),pa(e,n),((Me&2)===0||e!==Ue)&&(e===Ue&&((Me&2)===0&&(vl|=n),$e===4&&Yn(e,Ne,wt,!1)),It(e))}function Mf(e,t,n){if((Me&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||xa(e,t),s=l?sp(e,t):Ec(e,t,!0),r=l;do{if(s===0){Wl&&!l&&Yn(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!lp(n)){s=Ec(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var x=e;s=Ka;var b=x.current.memoizedState.isDehydrated;if(b&&(ta(x,f).flags|=256),f=Ec(x,f,!1),f!==2){if(yc&&!b){x.errorRecoveryDisabledLanes|=r,vl|=r,s=4;break e}r=yt,yt=s,r!==null&&(yt===null?yt=r:yt.push.apply(yt,r))}s=f}if(r=!1,s!==2)continue}}if(s===1){ta(e,0),Yn(e,t,0,!0);break}e:{switch(l=e,r=s,r){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Yn(l,t,wt,!Ln);break e;case 2:yt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=si+300-lt(),10<s)){if(Yn(l,t,wt,!Ln),vs(l,0,!0)!==0)break e;bn=t,l.timeoutHandle=sm(wf.bind(null,l,n,yt,ri,jc,t,wt,vl,Pl,Ln,r,"Throttled",-0,0),s);break e}wf(l,n,yt,ri,jc,t,wt,vl,Pl,Ln,r,null,-0,0)}}break}while(!0);It(e)}function wf(e,t,n,l,s,r,f,x,b,C,B,G,D,O){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:an},jf(t,r,G);var ie=(r&62914560)===r?si-lt():(r&4194048)===r?_f-lt():0;if(ie=$p(G,ie),ie!==null){bn=r,e.cancelPendingCommit=ie(qf.bind(null,e,t,r,n,l,s,f,x,b,B,G,null,D,O)),Yn(e,r,f,!C);return}}qf(e,t,r,n,l,s,f,x,b)}function lp(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var s=n[l],r=s.getSnapshot;s=s.value;try{if(!kt(r(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Yn(e,t,n,l){t&=~bc,t&=~vl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var r=31-St(s),f=1<<r;l[r]=-1,s&=~f}n!==0&&Bo(e,n,t)}function ci(){return(Me&6)===0?(Fa(0),!1):!0}function _c(){if(be!==null){if(Ce===0)var e=be.return;else e=be,on=cl=null,$r(e),Vl=null,za=0,e=be;for(;e!==null;)sf(e.alternate,e),e=e.return;be=null}}function ta(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Sp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bn=0,_c(),Ue=e,be=n=rn(e.current,null),Ne=t,Ce=0,Mt=null,Ln=!1,Wl=xa(e,t),yc=!1,Pl=wt=bc=vl=Hn=$e=0,yt=Ka=null,jc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var s=31-St(l),r=1<<s;t|=e[s],l&=~r}return yn=t,ws(),n}function Af(e,t){ve=null,E.H=Ha,t===Xl||t===qs?(t=Vu(),Ce=3):t===wr?(t=Vu(),Ce=4):Ce=t===lc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mt=t,be===null&&($e=1,Is(e,Ot(t,e.current)))}function Cf(){var e=Et.current;return e===null?!0:(Ne&4194048)===Ne?Lt===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===Lt:!1}function zf(){var e=E.H;return E.H=Ha,e===null?Ha:e}function Df(){var e=E.A;return E.A=tp,e}function oi(){$e=4,Ln||(Ne&4194048)!==Ne&&Et.current!==null||(Wl=!0),(Hn&134217727)===0&&(vl&134217727)===0||Ue===null||Yn(Ue,Ne,wt,!1)}function Ec(e,t,n){var l=Me;Me|=2;var s=zf(),r=Df();(Ue!==e||Ne!==t)&&(ri=null,ta(e,t)),t=!1;var f=$e;e:do try{if(Ce!==0&&be!==null){var x=be,b=Mt;switch(Ce){case 8:_c(),f=6;break e;case 3:case 2:case 9:case 6:Et.current===null&&(t=!0);var C=Ce;if(Ce=0,Mt=null,na(e,x,b,C),n&&Wl){f=0;break e}break;default:C=Ce,Ce=0,Mt=null,na(e,x,b,C)}}ap(),f=$e;break}catch(B){Af(e,B)}while(!0);return t&&e.shellSuspendCounter++,on=cl=null,Me=l,E.H=s,E.A=r,be===null&&(Ue=null,Ne=0,ws()),f}function ap(){for(;be!==null;)Rf(be)}function sp(e,t){var n=Me;Me|=2;var l=zf(),s=Df();Ue!==e||Ne!==t?(ri=null,ii=lt()+500,ta(e,t)):Wl=xa(e,t);e:do try{if(Ce!==0&&be!==null){t=be;var r=Mt;t:switch(Ce){case 1:Ce=0,Mt=null,na(e,t,r,1);break;case 2:case 9:if(Yu(r)){Ce=0,Mt=null,Of(t);break}t=function(){Ce!==2&&Ce!==9||Ue!==e||(Ce=7),It(e)},r.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:Yu(r)?(Ce=0,Mt=null,Of(t)):(Ce=0,Mt=null,na(e,t,r,7));break;case 5:var f=null;switch(be.tag){case 26:f=be.memoizedState;case 5:case 27:var x=be;if(f?bm(f):x.stateNode.complete){Ce=0,Mt=null;var b=x.sibling;if(b!==null)be=b;else{var C=x.return;C!==null?(be=C,ui(C)):be=null}break t}}Ce=0,Mt=null,na(e,t,r,5);break;case 6:Ce=0,Mt=null,na(e,t,r,6);break;case 8:_c(),$e=6;break e;default:throw Error(o(462))}}ip();break}catch(B){Af(e,B)}while(!0);return on=cl=null,E.H=l,E.A=s,Me=n,be!==null?0:(Ue=null,Ne=0,ws(),$e)}function ip(){for(;be!==null&&!Fe();)Rf(be)}function Rf(e){var t=lf(e.alternate,e,yn);e.memoizedProps=e.pendingProps,t===null?ui(e):be=t}function Of(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Id(n,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=Id(n,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:$r(t);default:sf(n,t),t=be=zu(t,yn),t=lf(n,t,yn)}e.memoizedProps=e.pendingProps,t===null?ui(e):be=t}function na(e,t,n,l){on=cl=null,$r(t),Vl=null,za=0;var s=t.return;try{if(Kx(e,s,t,n,Ne)){$e=1,Is(e,Ot(n,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;$e=1,Is(e,Ot(n,e.current)),be=null;return}t.flags&32768?(ke||l===1?e=!0:Wl||(Ne&536870912)!==0?e=!1:(Ln=e=!0,(l===2||l===9||l===3||l===6)&&(l=Et.current,l!==null&&l.tag===13&&(l.flags|=16384))),Uf(t,e)):ui(t)}function ui(e){var t=e;do{if((t.flags&32768)!==0){Uf(t,Ln);return}e=t.return;var n=Ix(t.alternate,t,yn);if(n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);$e===0&&($e=5)}function Uf(e,t){do{var n=Wx(e.alternate,e);if(n!==null){n.flags&=32767,be=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=n}while(e!==null);$e=6,be=null}function qf(e,t,n,l,s,r,f,x,b){e.cancelPendingCommit=null;do di();while(Ie!==0);if((Me&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(r=t.lanes|t.childLanes,r|=hr,Lh(e,n,r,f,x,b),e===Ue&&(be=Ue=null,Ne=0),ea=t,Gn=e,bn=n,Nc=r,Sc=s,Ef=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,up(ms,function(){return Gf(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=E.T,E.T=null,s=L.p,L.p=2,f=Me,Me|=4;try{Px(e,t,n)}finally{Me=f,L.p=s,E.T=l}}Ie=1,Bf(),Lf(),Hf()}}function Bf(){if(Ie===1){Ie=0;var e=Gn,t=ea,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null;var l=L.p;L.p=2;var s=Me;Me|=4;try{gf(t,e);var r=Bc,f=Su(e.containerInfo),x=r.focusedElem,b=r.selectionRange;if(f!==x&&x&&x.ownerDocument&&Nu(x.ownerDocument.documentElement,x)){if(b!==null&&or(x)){var C=b.start,B=b.end;if(B===void 0&&(B=C),"selectionStart"in x)x.selectionStart=C,x.selectionEnd=Math.min(B,x.value.length);else{var G=x.ownerDocument||document,D=G&&G.defaultView||window;if(D.getSelection){var O=D.getSelection(),ie=x.textContent.length,me=Math.min(b.start,ie),Oe=b.end===void 0?me:Math.min(b.end,ie);!O.extend&&me>Oe&&(f=Oe,Oe=me,me=f);var _=ju(x,me),N=ju(x,Oe);if(_&&N&&(O.rangeCount!==1||O.anchorNode!==_.node||O.anchorOffset!==_.offset||O.focusNode!==N.node||O.focusOffset!==N.offset)){var A=G.createRange();A.setStart(_.node,_.offset),O.removeAllRanges(),me>Oe?(O.addRange(A),O.extend(N.node,N.offset)):(A.setEnd(N.node,N.offset),O.addRange(A))}}}}for(G=[],O=x;O=O.parentNode;)O.nodeType===1&&G.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<G.length;x++){var H=G[x];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}Si=!!qc,Bc=qc=null}finally{Me=s,L.p=l,E.T=n}}e.current=t,Ie=2}}function Lf(){if(Ie===2){Ie=0;var e=Gn,t=ea,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=E.T,E.T=null;var l=L.p;L.p=2;var s=Me;Me|=4;try{mf(e,t.alternate,t)}finally{Me=s,L.p=l,E.T=n}}Ie=3}}function Hf(){if(Ie===4||Ie===3){Ie=0,Yt();var e=Gn,t=ea,n=bn,l=Ef;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ie=5:(Ie=0,ea=Gn=null,$f(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&($n=null),Xi(n),t=t.stateNode,Nt&&typeof Nt.onCommitFiberRoot=="function")try{Nt.onCommitFiberRoot(ha,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=E.T,s=L.p,L.p=2,E.T=null;try{for(var r=e.onRecoverableError,f=0;f<l.length;f++){var x=l[f];r(x.value,{componentStack:x.stack})}}finally{E.T=t,L.p=s}}(bn&3)!==0&&di(),It(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===kc?Ja++:(Ja=0,kc=e):Ja=0,Fa(0)}}function $f(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function di(){return Bf(),Lf(),Hf(),Gf()}function Gf(){if(Ie!==5)return!1;var e=Gn,t=Nc;Nc=0;var n=Xi(bn),l=E.T,s=L.p;try{L.p=32>n?32:n,E.T=null,n=Sc,Sc=null;var r=Gn,f=bn;if(Ie=0,ea=Gn=null,bn=0,(Me&6)!==0)throw Error(o(331));var x=Me;if(Me|=4,Sf(r.current),bf(r,r.current,f,n),Me=x,Fa(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(ha,r)}catch{}return!0}finally{L.p=s,E.T=l,$f(e,t)}}function Yf(e,t,n){t=Ot(n,t),t=nc(e.stateNode,t,2),e=On(e,t,2),e!==null&&(pa(e,2),It(e))}function ze(e,t,n){if(e.tag===3)Yf(e,e,n);else for(;t!==null;){if(t.tag===3){Yf(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&($n===null||!$n.has(l))){e=Ot(n,e),n=Yd(2),l=On(t,n,2),l!==null&&(Xd(n,l,t,e),pa(l,2),It(l));break}}t=t.return}}function Tc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new np;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(n)||(yc=!0,s.add(n),e=rp.bind(null,e,t,n),t.then(e,e))}function rp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ue===e&&(Ne&n)===n&&($e===4||$e===3&&(Ne&62914560)===Ne&&300>lt()-si?(Me&2)===0&&ta(e,0):bc|=n,Pl===Ne&&(Pl=0)),It(e)}function Xf(e,t){t===0&&(t=qo()),e=sl(e,t),e!==null&&(pa(e,t),It(e))}function cp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xf(e,n)}function op(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),Xf(e,n)}function up(e,t){return pe(e,t)}var fi=null,la=null,Mc=!1,mi=!1,wc=!1,Xn=0;function It(e){e!==la&&e.next===null&&(la===null?fi=la=e:la=la.next=e),mi=!0,Mc||(Mc=!0,fp())}function Fa(e,t){if(!wc&&mi){wc=!0;do for(var n=!1,l=fi;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var r=0;else{var f=l.suspendedLanes,x=l.pingedLanes;r=(1<<31-St(42|e)+1)-1,r&=s&~(f&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Kf(l,r))}else r=Ne,r=vs(l,l===Ue?r:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(r&3)===0||xa(l,r)||(n=!0,Kf(l,r));l=l.next}while(n);wc=!1}}function dp(){Vf()}function Vf(){mi=Mc=!1;var e=0;Xn!==0&&Np()&&(e=Xn);for(var t=lt(),n=null,l=fi;l!==null;){var s=l.next,r=Qf(l,t);r===0?(l.next=null,n===null?fi=s:n.next=s,s===null&&(la=n)):(n=l,(e!==0||(r&3)!==0)&&(mi=!0)),l=s}Ie!==0&&Ie!==5||Fa(e),Xn!==0&&(Xn=0)}function Qf(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-St(r),x=1<<f,b=s[f];b===-1?((x&n)===0||(x&l)!==0)&&(s[f]=Bh(x,t)):b<=t&&(e.expiredLanes|=x),r&=~x}if(t=Ue,n=Ne,n=vs(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Te(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||xa(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Te(l),Xi(n)){case 2:case 8:n=Pn;break;case 32:n=ms;break;case 268435456:n=Uo;break;default:n=ms}return l=Zf.bind(null,e),n=pe(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Te(l),e.callbackPriority=2,e.callbackNode=null,2}function Zf(e,t){if(Ie!==0&&Ie!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(di()&&e.callbackNode!==n)return null;var l=Ne;return l=vs(e,e===Ue?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Mf(e,l,t),Qf(e,lt()),e.callbackNode!=null&&e.callbackNode===n?Zf.bind(null,e):null)}function Kf(e,t){if(di())return null;Mf(e,t,!0)}function fp(){kp(function(){(Me&6)!==0?pe(ma,dp):Vf()})}function Ac(){if(Xn===0){var e=Gl;e===0&&(e=hs,hs<<=1,(hs&261888)===0&&(hs=256)),Xn=e}return Xn}function Jf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:js(""+e)}function Ff(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function mp(e,t,n,l,s){if(t==="submit"&&n&&n.stateNode===s){var r=Jf((s[ht]||null).action),f=l.submitter;f&&(t=(t=f[ht]||null)?Jf(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var x=new _s("action","action",null,l,s);e.push({event:x,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Xn!==0){var b=f?Ff(s,f):new FormData(s);Fr(n,{pending:!0,data:b,method:s.method,action:r},null,b)}}else typeof r=="function"&&(x.preventDefault(),b=f?Ff(s,f):new FormData(s),Fr(n,{pending:!0,data:b,method:s.method,action:r},r,b))},currentTarget:s}]})}}for(var Cc=0;Cc<mr.length;Cc++){var zc=mr[Cc],hp=zc.toLowerCase(),xp=zc[0].toUpperCase()+zc.slice(1);Xt(hp,"on"+xp)}Xt(Eu,"onAnimationEnd"),Xt(Tu,"onAnimationIteration"),Xt(Mu,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(Cx,"onTransitionRun"),Xt(zx,"onTransitionStart"),Xt(Dx,"onTransitionCancel"),Xt(wu,"onTransitionEnd"),Ml("onMouseEnter",["mouseout","mouseover"]),Ml("onMouseLeave",["mouseout","mouseover"]),Ml("onPointerEnter",["pointerout","pointerover"]),Ml("onPointerLeave",["pointerout","pointerover"]),tl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),tl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),tl("onBeforeInput",["compositionend","keypress","textInput","paste"]),tl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),tl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),tl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ia="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(" "),pp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ia));function If(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],s=l.event;l=l.listeners;e:{var r=void 0;if(t)for(var f=l.length-1;0<=f;f--){var x=l[f],b=x.instance,C=x.currentTarget;if(x=x.listener,b!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=C;try{r(s)}catch(B){Ms(B)}s.currentTarget=null,r=b}else for(f=0;f<l.length;f++){if(x=l[f],b=x.instance,C=x.currentTarget,x=x.listener,b!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=C;try{r(s)}catch(B){Ms(B)}s.currentTarget=null,r=b}}}}function je(e,t){var n=t[Vi];n===void 0&&(n=t[Vi]=new Set);var l=e+"__bubble";n.has(l)||(Wf(t,e,2,!1),n.add(l))}function Dc(e,t,n){var l=0;t&&(l|=4),Wf(n,e,l,t)}var hi="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[hi]){e[hi]=!0,Xo.forEach(function(n){n!=="selectionchange"&&(pp.has(n)||Dc(n,!1,e),Dc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hi]||(t[hi]=!0,Dc("selectionchange",!1,t))}}function Wf(e,t,n,l){switch(Tm(t)){case 2:var s=Xp;break;case 8:s=Vp;break;default:s=Jc}n=s.bind(null,t,n,e),s=void 0,!er||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Oc(e,t,n,l,s){var r=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var f=l.tag;if(f===3||f===4){var x=l.stateNode.containerInfo;if(x===s)break;if(f===4)for(f=l.return;f!==null;){var b=f.tag;if((b===3||b===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;x!==null;){if(f=_l(x),f===null)return;if(b=f.tag,b===5||b===6||b===26||b===27){l=r=f;continue e}x=x.parentNode}}l=l.return}nu(function(){var C=r,B=Wi(n),G=[];e:{var D=Au.get(e);if(D!==void 0){var O=_s,ie=e;switch(e){case"keypress":if(Ss(n)===0)break e;case"keydown":case"keyup":O=ox;break;case"focusin":ie="focus",O=ar;break;case"focusout":ie="blur",O=ar;break;case"beforeblur":case"afterblur":O=ar;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=su;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Ih;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=fx;break;case Eu:case Tu:case Mu:O=ex;break;case wu:O=hx;break;case"scroll":case"scrollend":O=Jh;break;case"wheel":O=px;break;case"copy":case"cut":case"paste":O=nx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=ru;break;case"toggle":case"beforetoggle":O=gx}var me=(t&4)!==0,Oe=!me&&(e==="scroll"||e==="scrollend"),_=me?D!==null?D+"Capture":null:D;me=[];for(var N=C,A;N!==null;){var H=N;if(A=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||A===null||_===null||(H=ya(N,_),H!=null&&me.push(Wa(N,H,A))),Oe)break;N=N.return}0<me.length&&(D=new O(D,ie,null,n,B),G.push({event:D,listeners:me}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",D&&n!==Ii&&(ie=n.relatedTarget||n.fromElement)&&(_l(ie)||ie[kl]))break e;if((O||D)&&(D=B.window===B?B:(D=B.ownerDocument)?D.defaultView||D.parentWindow:window,O?(ie=n.relatedTarget||n.toElement,O=C,ie=ie?_l(ie):null,ie!==null&&(Oe=m(ie),me=ie.tag,ie!==Oe||me!==5&&me!==27&&me!==6)&&(ie=null)):(O=null,ie=C),O!==ie)){if(me=su,H="onMouseLeave",_="onMouseEnter",N="mouse",(e==="pointerout"||e==="pointerover")&&(me=ru,H="onPointerLeave",_="onPointerEnter",N="pointer"),Oe=O==null?D:ga(O),A=ie==null?D:ga(ie),D=new me(H,N+"leave",O,n,B),D.target=Oe,D.relatedTarget=A,H=null,_l(B)===C&&(me=new me(_,N+"enter",ie,n,B),me.target=A,me.relatedTarget=Oe,H=me),Oe=H,O&&ie)t:{for(me=vp,_=O,N=ie,A=0,H=_;H;H=me(H))A++;H=0;for(var ue=N;ue;ue=me(ue))H++;for(;0<A-H;)_=me(_),A--;for(;0<H-A;)N=me(N),H--;for(;A--;){if(_===N||N!==null&&_===N.alternate){me=_;break t}_=me(_),N=me(N)}me=null}else me=null;O!==null&&Pf(G,D,O,me,!1),ie!==null&&Oe!==null&&Pf(G,Oe,ie,me,!0)}}e:{if(D=C?ga(C):window,O=D.nodeName&&D.nodeName.toLowerCase(),O==="select"||O==="input"&&D.type==="file")var _e=xu;else if(mu(D))if(pu)_e=Mx;else{_e=Ex;var re=_x}else O=D.nodeName,!O||O.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?C&&Fi(C.elementType)&&(_e=xu):_e=Tx;if(_e&&(_e=_e(e,C))){hu(G,_e,n,B);break e}re&&re(e,D,C),e==="focusout"&&C&&D.type==="number"&&C.memoizedProps.value!=null&&Ji(D,"number",D.value)}switch(re=C?ga(C):window,e){case"focusin":(mu(re)||re.contentEditable==="true")&&(Rl=re,ur=C,Ta=null);break;case"focusout":Ta=ur=Rl=null;break;case"mousedown":dr=!0;break;case"contextmenu":case"mouseup":case"dragend":dr=!1,ku(G,n,B);break;case"selectionchange":if(Ax)break;case"keydown":case"keyup":ku(G,n,B)}var ge;if(ir)e:{switch(e){case"compositionstart":var Se="onCompositionStart";break e;case"compositionend":Se="onCompositionEnd";break e;case"compositionupdate":Se="onCompositionUpdate";break e}Se=void 0}else Dl?du(e,n)&&(Se="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Se="onCompositionStart");Se&&(cu&&n.locale!=="ko"&&(Dl||Se!=="onCompositionStart"?Se==="onCompositionEnd"&&Dl&&(ge=lu()):(Mn=B,tr="value"in Mn?Mn.value:Mn.textContent,Dl=!0)),re=xi(C,Se),0<re.length&&(Se=new iu(Se,e,null,n,B),G.push({event:Se,listeners:re}),ge?Se.data=ge:(ge=fu(n),ge!==null&&(Se.data=ge)))),(ge=bx?jx(e,n):Nx(e,n))&&(Se=xi(C,"onBeforeInput"),0<Se.length&&(re=new iu("onBeforeInput","beforeinput",null,n,B),G.push({event:re,listeners:Se}),re.data=ge)),mp(G,e,C,n,B)}If(G,t)})}function Wa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xi(e,t){for(var n=t+"Capture",l=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=ya(e,n),s!=null&&l.unshift(Wa(e,s,r)),s=ya(e,t),s!=null&&l.push(Wa(e,s,r))),e.tag===3)return l;e=e.return}return[]}function vp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pf(e,t,n,l,s){for(var r=t._reactName,f=[];n!==null&&n!==l;){var x=n,b=x.alternate,C=x.stateNode;if(x=x.tag,b!==null&&b===l)break;x!==5&&x!==26&&x!==27||C===null||(b=C,s?(C=ya(n,r),C!=null&&f.unshift(Wa(n,C,b))):s||(C=ya(n,r),C!=null&&f.push(Wa(n,C,b)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var gp=/\r\n?/g,yp=/\u0000|\uFFFD/g;function em(e){return(typeof e=="string"?e:""+e).replace(gp,`
|
|
49
|
+
`).replace(yp,"")}function tm(e,t){return t=em(t),em(e)===t}function Re(e,t,n,l,s,r){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Al(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Al(e,""+l);break;case"className":ys(e,"class",l);break;case"tabIndex":ys(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ys(e,n,l);break;case"style":eu(e,l,r);break;case"data":if(t!=="object"){ys(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=js(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 r=="function"&&(n==="formAction"?(t!=="input"&&Re(e,t,"name",s.name,s,null),Re(e,t,"formEncType",s.formEncType,s,null),Re(e,t,"formMethod",s.formMethod,s,null),Re(e,t,"formTarget",s.formTarget,s,null)):(Re(e,t,"encType",s.encType,s,null),Re(e,t,"method",s.method,s,null),Re(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=js(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=an);break;case"onScroll":l!=null&&je("scroll",e);break;case"onScrollEnd":l!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=js(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":je("beforetoggle",e),je("toggle",e),gs(e,"popover",l);break;case"xlinkActuate":ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ln(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ln(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ln(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ln(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":gs(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Zh.get(n)||n,gs(e,n,l))}}function Uc(e,t,n,l,s,r){switch(n){case"style":eu(e,l,r);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Al(e,l):(typeof l=="number"||typeof l=="bigint")&&Al(e,""+l);break;case"onScroll":l!=null&&je("scroll",e);break;case"onScrollEnd":l!=null&&je("scrollend",e);break;case"onClick":l!=null&&(e.onclick=an);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vo.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),r=e[ht]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof l=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,s);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):gs(e,n,l)}}}function ct(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var l=!1,s=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Re(e,t,r,f,n,null)}}s&&Re(e,t,"srcSet",n.srcSet,n,null),l&&Re(e,t,"src",n.src,n,null);return;case"input":je("invalid",e);var x=r=f=s=null,b=null,C=null;for(l in n)if(n.hasOwnProperty(l)){var B=n[l];if(B!=null)switch(l){case"name":s=B;break;case"type":f=B;break;case"checked":b=B;break;case"defaultChecked":C=B;break;case"value":r=B;break;case"defaultValue":x=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,t));break;default:Re(e,t,l,B,n,null)}}Fo(e,r,x,b,C,f,s,!1);return;case"select":je("invalid",e),l=f=r=null;for(s in n)if(n.hasOwnProperty(s)&&(x=n[s],x!=null))switch(s){case"value":r=x;break;case"defaultValue":f=x;break;case"multiple":l=x;default:Re(e,t,s,x,n,null)}t=r,n=f,e.multiple=!!l,t!=null?wl(e,!!l,t,!1):n!=null&&wl(e,!!l,n,!0);return;case"textarea":je("invalid",e),r=s=l=null;for(f in n)if(n.hasOwnProperty(f)&&(x=n[f],x!=null))switch(f){case"value":l=x;break;case"defaultValue":s=x;break;case"children":r=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(o(91));break;default:Re(e,t,f,x,n,null)}Wo(e,l,s,r);return;case"option":for(b in n)if(n.hasOwnProperty(b)&&(l=n[b],l!=null))switch(b){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Re(e,t,b,l,n,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(l=0;l<Ia.length;l++)je(Ia[l],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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(C in n)if(n.hasOwnProperty(C)&&(l=n[C],l!=null))switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Re(e,t,C,l,n,null)}return;default:if(Fi(t)){for(B in n)n.hasOwnProperty(B)&&(l=n[B],l!==void 0&&Uc(e,t,B,l,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(l=n[x],l!=null&&Re(e,t,x,l,n,null))}function bp(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,f=null,x=null,b=null,C=null,B=null;for(O in n){var G=n[O];if(n.hasOwnProperty(O)&&G!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":b=G;default:l.hasOwnProperty(O)||Re(e,t,O,null,l,G)}}for(var D in l){var O=l[D];if(G=n[D],l.hasOwnProperty(D)&&(O!=null||G!=null))switch(D){case"type":r=O;break;case"name":s=O;break;case"checked":C=O;break;case"defaultChecked":B=O;break;case"value":f=O;break;case"defaultValue":x=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(137,t));break;default:O!==G&&Re(e,t,D,O,l,G)}}Ki(e,f,x,b,C,B,r,s);return;case"select":O=f=x=D=null;for(r in n)if(b=n[r],n.hasOwnProperty(r)&&b!=null)switch(r){case"value":break;case"multiple":O=b;default:l.hasOwnProperty(r)||Re(e,t,r,null,l,b)}for(s in l)if(r=l[s],b=n[s],l.hasOwnProperty(s)&&(r!=null||b!=null))switch(s){case"value":D=r;break;case"defaultValue":x=r;break;case"multiple":f=r;default:r!==b&&Re(e,t,s,r,l,b)}t=x,n=f,l=O,D!=null?wl(e,!!n,D,!1):!!l!=!!n&&(t!=null?wl(e,!!n,t,!0):wl(e,!!n,n?[]:"",!1));return;case"textarea":O=D=null;for(x in n)if(s=n[x],n.hasOwnProperty(x)&&s!=null&&!l.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:Re(e,t,x,null,l,s)}for(f in l)if(s=l[f],r=n[f],l.hasOwnProperty(f)&&(s!=null||r!=null))switch(f){case"value":D=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(o(91));break;default:s!==r&&Re(e,t,f,s,l,r)}Io(e,D,O);return;case"option":for(var ie in n)if(D=n[ie],n.hasOwnProperty(ie)&&D!=null&&!l.hasOwnProperty(ie))switch(ie){case"selected":e.selected=!1;break;default:Re(e,t,ie,null,l,D)}for(b in l)if(D=l[b],O=n[b],l.hasOwnProperty(b)&&D!==O&&(D!=null||O!=null))switch(b){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Re(e,t,b,D,l,O)}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 me in n)D=n[me],n.hasOwnProperty(me)&&D!=null&&!l.hasOwnProperty(me)&&Re(e,t,me,null,l,D);for(C in l)if(D=l[C],O=n[C],l.hasOwnProperty(C)&&D!==O&&(D!=null||O!=null))switch(C){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(o(137,t));break;default:Re(e,t,C,D,l,O)}return;default:if(Fi(t)){for(var Oe in n)D=n[Oe],n.hasOwnProperty(Oe)&&D!==void 0&&!l.hasOwnProperty(Oe)&&Uc(e,t,Oe,void 0,l,D);for(B in l)D=l[B],O=n[B],!l.hasOwnProperty(B)||D===O||D===void 0&&O===void 0||Uc(e,t,B,D,l,O);return}}for(var _ in n)D=n[_],n.hasOwnProperty(_)&&D!=null&&!l.hasOwnProperty(_)&&Re(e,t,_,null,l,D);for(G in l)D=l[G],O=n[G],!l.hasOwnProperty(G)||D===O||D==null&&O==null||Re(e,t,G,D,l,O)}function nm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var s=n[l],r=s.transferSize,f=s.initiatorType,x=s.duration;if(r&&x&&nm(f)){for(f=0,x=s.responseEnd,l+=1;l<n.length;l++){var b=n[l],C=b.startTime;if(C>x)break;var B=b.transferSize,G=b.initiatorType;B&&nm(G)&&(b=b.responseEnd,f+=B*(b<x?1:(x-C)/(b-C)))}if(--l,t+=8*(r+f)/(s.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,Bc=null;function pi(e){return e.nodeType===9?e:e.ownerDocument}function lm(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 am(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 Lc(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 Hc=null;function Np(){var e=window.event;return e&&e.type==="popstate"?e===Hc?!1:(Hc=e,!0):(Hc=null,!1)}var sm=typeof setTimeout=="function"?setTimeout:void 0,Sp=typeof clearTimeout=="function"?clearTimeout:void 0,im=typeof Promise=="function"?Promise:void 0,kp=typeof queueMicrotask=="function"?queueMicrotask:typeof im<"u"?function(e){return im.resolve(null).then(e).catch(_p)}:sm;function _p(e){setTimeout(function(){throw e})}function Vn(e){return e==="head"}function rm(e,t){var n=t,l=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(s),ra(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Pa(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Pa(n);for(var r=n.firstChild;r;){var f=r.nextSibling,x=r.nodeName;r[va]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=f}}else n==="body"&&Pa(e.ownerDocument.body);n=s}while(n);ra(t)}function cm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function $c(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":$c(n),Qi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Ep(e,t,n,l){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Ht(e.nextSibling),e===null)break}return null}function Tp(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ht(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function Gc(e){return e.data==="$?"||e.data==="$~"}function Yc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Mp(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Ht(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 Xc=null;function um(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ht(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function dm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function fm(e,t,n){switch(t=pi(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Pa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qi(e)}var $t=new Map,mm=new Set;function vi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jn=L.d;L.d={f:wp,r:Ap,D:Cp,C:zp,L:Dp,m:Rp,X:Up,S:Op,M:qp};function wp(){var e=jn.f(),t=ci();return e||t}function Ap(e){var t=El(e);t!==null&&t.tag===5&&t.type==="form"?wd(t):jn.r(e)}var aa=typeof document>"u"?null:document;function hm(e,t,n){var l=aa;if(l&&typeof t=="string"&&t){var s=Dt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),mm.has(s)||(mm.add(s),e={rel:e,crossOrigin:n,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),ct(t,"link",e),et(t),l.head.appendChild(t)))}}function Cp(e){jn.D(e),hm("dns-prefetch",e,null)}function zp(e,t){jn.C(e,t),hm("preconnect",e,t)}function Dp(e,t,n){jn.L(e,t,n);var l=aa;if(l&&e&&t){var s='link[rel="preload"][as="'+Dt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+Dt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+Dt(n.imageSizes)+'"]')):s+='[href="'+Dt(e)+'"]';var r=s;switch(t){case"style":r=sa(e);break;case"script":r=ia(e)}$t.has(r)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),$t.set(r,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(es(r))||t==="script"&&l.querySelector(ts(r))||(t=l.createElement("link"),ct(t,"link",e),et(t),l.head.appendChild(t)))}}function Rp(e,t){jn.m(e,t);var n=aa;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Dt(l)+'"][href="'+Dt(e)+'"]',r=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ia(e)}if(!$t.has(r)&&(e=S({rel:"modulepreload",href:e},t),$t.set(r,e),n.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ts(r)))return}l=n.createElement("link"),ct(l,"link",e),et(l),n.head.appendChild(l)}}}function Op(e,t,n){jn.S(e,t,n);var l=aa;if(l&&e){var s=Tl(l).hoistableStyles,r=sa(e);t=t||"default";var f=s.get(r);if(!f){var x={loading:0,preload:null};if(f=l.querySelector(es(r)))x.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=$t.get(r))&&Vc(e,n);var b=f=l.createElement("link");et(b),ct(b,"link",e),b._p=new Promise(function(C,B){b.onload=C,b.onerror=B}),b.addEventListener("load",function(){x.loading|=1}),b.addEventListener("error",function(){x.loading|=2}),x.loading|=4,gi(f,t,l)}f={type:"stylesheet",instance:f,count:1,state:x},s.set(r,f)}}}function Up(e,t){jn.X(e,t);var n=aa;if(n&&e){var l=Tl(n).hoistableScripts,s=ia(e),r=l.get(s);r||(r=n.querySelector(ts(s)),r||(e=S({src:e,async:!0},t),(t=$t.get(s))&&Qc(e,t),r=n.createElement("script"),et(r),ct(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(s,r))}}function qp(e,t){jn.M(e,t);var n=aa;if(n&&e){var l=Tl(n).hoistableScripts,s=ia(e),r=l.get(s);r||(r=n.querySelector(ts(s)),r||(e=S({src:e,async:!0,type:"module"},t),(t=$t.get(s))&&Qc(e,t),r=n.createElement("script"),et(r),ct(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},l.set(s,r))}}function xm(e,t,n,l){var s=(s=se.current)?vi(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=sa(n.href),n=Tl(s).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=sa(n.href);var r=Tl(s).hoistableStyles,f=r.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=s.querySelector(es(e)))&&!r._p&&(f.instance=r,f.state.loading=5),$t.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},$t.set(e,n),r||Bp(s,e,n,f.state))),t&&l===null)throw Error(o(528,""));return f}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ia(n),n=Tl(s).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function sa(e){return'href="'+Dt(e)+'"'}function es(e){return'link[rel="stylesheet"]['+e+"]"}function pm(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function Bp(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ct(t,"link",n),et(t),e.head.appendChild(t))}function ia(e){return'[src="'+Dt(e)+'"]'}function ts(e){return"script[async]"+e}function vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Dt(n.href)+'"]');if(l)return t.instance=l,et(l),l;var s=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),et(l),ct(l,"style",s),gi(l,n.precedence,e),t.instance=l;case"stylesheet":s=sa(n.href);var r=e.querySelector(es(s));if(r)return t.state.loading|=4,t.instance=r,et(r),r;l=pm(n),(s=$t.get(s))&&Vc(l,s),r=(e.ownerDocument||e).createElement("link"),et(r);var f=r;return f._p=new Promise(function(x,b){f.onload=x,f.onerror=b}),ct(r,"link",l),t.state.loading|=4,gi(r,n.precedence,e),t.instance=r;case"script":return r=ia(n.src),(s=e.querySelector(ts(r)))?(t.instance=s,et(s),s):(l=n,(s=$t.get(r))&&(l=S({},n),Qc(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),et(s),ct(s,"link",l),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,gi(l,n.precedence,e));return t.instance}function gi(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,r=s,f=0;f<l.length;f++){var x=l[f];if(x.dataset.precedence===t)r=x;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var yi=null;function gm(e,t,n){if(yi===null){var l=new Map,s=yi=new Map;s.set(n,l)}else s=yi,l=s.get(n),l||(l=new Map,s.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var r=n[s];if(!(r[va]||r[at]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var x=l.get(f);x?x.push(r):l.set(f,[r])}}return l}function ym(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Lp(e,t,n){if(n===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 bm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Hp(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=sa(l.href),r=t.querySelector(es(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,et(r);return}r=t.ownerDocument||t,l=pm(l),(s=$t.get(s))&&Vc(l,s),r=r.createElement("link"),et(r);var f=r;f._p=new Promise(function(x,b){f.onload=x,f.onerror=b}),ct(r,"link",l),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=bi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Zc=0;function $p(e,t){return e.stylesheets&&e.count===0&&Ni(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Ni(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Zc===0&&(Zc=62500*jp());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ni(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Zc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function bi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ni(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ji=null;function Ni(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ji=new Map,t.forEach(Gp,e),ji=null,bi.call(e))}function Gp(e,t){if(!(t.state.loading&4)){var n=ji.get(e);if(n)var l=n.get(null);else{n=new Map,ji.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var f=s[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),l=f)}l&&n.set(null,l)}s=t.instance,f=s.getAttribute("data-precedence"),r=n.get(f)||l,r===l&&n.set(null,s),n.set(f,s),this.count++,l=bi.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var ns={$$typeof:ne,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function Yp(e,t,n,l,s,r,f,x,b){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=l,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function jm(e,t,n,l,s,r,f,x,b,C,B,G){return e=new Yp(e,t,n,f,b,C,B,G,x),t=1,r===!0&&(t|=24),r=_t(3,null,null,t),e.current=r,r.stateNode=e,t=Er(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:l,isDehydrated:n,cache:t},Ar(r),e}function Nm(e){return e?(e=ql,e):ql}function Sm(e,t,n,l,s,r){s=Nm(s),l.context===null?l.context=s:l.pendingContext=s,l=Rn(t),l.payload={element:n},r=r===void 0?null:r,r!==null&&(l.callback=r),n=On(e,l,t),n!==null&&(bt(n,e,t),Ra(n,e,t))}function km(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Kc(e,t){km(e,t),(e=e.alternate)&&km(e,t)}function _m(e){if(e.tag===13||e.tag===31){var t=sl(e,67108864);t!==null&&bt(t,e,67108864),Kc(e,67108864)}}function Em(e){if(e.tag===13||e.tag===31){var t=At();t=Yi(t);var n=sl(e,t);n!==null&&bt(n,e,t),Kc(e,t)}}var Si=!0;function Xp(e,t,n,l){var s=E.T;E.T=null;var r=L.p;try{L.p=2,Jc(e,t,n,l)}finally{L.p=r,E.T=s}}function Vp(e,t,n,l){var s=E.T;E.T=null;var r=L.p;try{L.p=8,Jc(e,t,n,l)}finally{L.p=r,E.T=s}}function Jc(e,t,n,l){if(Si){var s=Fc(l);if(s===null)Oc(e,t,l,ki,n),Mm(e,l);else if(Zp(s,e,t,n,l))l.stopPropagation();else if(Mm(e,l),t&4&&-1<Qp.indexOf(e)){for(;s!==null;){var r=El(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=el(r.pendingLanes);if(f!==0){var x=r;for(x.pendingLanes|=2,x.entangledLanes|=2;f;){var b=1<<31-St(f);x.entanglements[1]|=b,f&=~b}It(r),(Me&6)===0&&(ii=lt()+500,Fa(0))}}break;case 31:case 13:x=sl(r,2),x!==null&&bt(x,r,2),ci(),Kc(r,2)}if(r=Fc(l),r===null&&Oc(e,t,l,ki,n),r===s)break;s=r}s!==null&&l.stopPropagation()}else Oc(e,t,l,null,n)}}function Fc(e){return e=Wi(e),Ic(e)}var ki=null;function Ic(e){if(ki=null,e=_l(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=h(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ki=e,null}function Tm(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(ut()){case ma:return 2;case Pn:return 8;case ms:case zh:return 32;case Uo:return 268435456;default:return 32}default:return 32}}var Wc=!1,Qn=null,Zn=null,Kn=null,ls=new Map,as=new Map,Jn=[],Qp="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 Mm(e,t){switch(e){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":Zn=null;break;case"mouseover":case"mouseout":Kn=null;break;case"pointerover":case"pointerout":ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":as.delete(t.pointerId)}}function ss(e,t,n,l,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:r,targetContainers:[s]},t!==null&&(t=El(t),t!==null&&_m(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Zp(e,t,n,l,s){switch(t){case"focusin":return Qn=ss(Qn,e,t,n,l,s),!0;case"dragenter":return Zn=ss(Zn,e,t,n,l,s),!0;case"mouseover":return Kn=ss(Kn,e,t,n,l,s),!0;case"pointerover":var r=s.pointerId;return ls.set(r,ss(ls.get(r)||null,e,t,n,l,s)),!0;case"gotpointercapture":return r=s.pointerId,as.set(r,ss(as.get(r)||null,e,t,n,l,s)),!0}return!1}function wm(e){var t=_l(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,Go(e.priority,function(){Em(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,Go(e.priority,function(){Em(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _i(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Fc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Ii=l,n.target.dispatchEvent(l),Ii=null}else return t=El(n),t!==null&&_m(t),e.blockedOn=n,!1;t.shift()}return!0}function Am(e,t,n){_i(e)&&n.delete(t)}function Kp(){Wc=!1,Qn!==null&&_i(Qn)&&(Qn=null),Zn!==null&&_i(Zn)&&(Zn=null),Kn!==null&&_i(Kn)&&(Kn=null),ls.forEach(Am),as.forEach(Am)}function Ei(e,t){e.blockedOn===t&&(e.blockedOn=null,Wc||(Wc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Kp)))}var Ti=null;function Cm(e){Ti!==e&&(Ti=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Ti===e&&(Ti=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(Ic(l||n)===null)continue;break}var r=El(n);r!==null&&(e.splice(t,3),t-=3,Fr(r,{pending:!0,data:s,method:n.method,action:l},l,s))}}))}function ra(e){function t(b){return Ei(b,e)}Qn!==null&&Ei(Qn,e),Zn!==null&&Ei(Zn,e),Kn!==null&&Ei(Kn,e),ls.forEach(t),as.forEach(t);for(var n=0;n<Jn.length;n++){var l=Jn[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Jn.length&&(n=Jn[0],n.blockedOn===null);)wm(n),n.blockedOn===null&&Jn.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var s=n[l],r=n[l+1],f=s[ht]||null;if(typeof r=="function")f||Cm(n);else if(f){var x=null;if(r&&r.hasAttribute("formAction")){if(s=r,f=r[ht]||null)x=f.formAction;else if(Ic(s)!==null)continue}else x=f.action;typeof x=="function"?n[l+1]=x:(n.splice(l,3),l-=3),Cm(n)}}}function zm(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Pc(e){this._internalRoot=e}Mi.prototype.render=Pc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=At();Sm(n,l,e,t,null,null)},Mi.prototype.unmount=Pc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sm(e.current,2,null,e,null,null),ci(),t[kl]=null}};function Mi(e){this._internalRoot=e}Mi.prototype.unstable_scheduleHydration=function(e){if(e){var t=$o();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jn.length&&t!==0&&t<Jn[n].priority;n++);Jn.splice(n,0,e),n===0&&wm(e)}};var Dm=c.version;if(Dm!=="19.2.6")throw Error(o(527,Dm,"19.2.6"));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Jp={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wi.isDisabled&&wi.supportsFiber)try{ha=wi.inject(Jp),Nt=wi}catch{}}return rs.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",s=Ld,r=Hd,f=$d;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=jm(e,1,!1,null,null,n,l,null,s,r,f,zm),e[kl]=t.current,Rc(e),new Pc(t)},rs.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,s="",r=Ld,f=Hd,x=$d,b=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(b=n.formState)),t=jm(e,1,!0,t,n??null,l,s,b,r,f,x,zm),t.context=Nm(null),n=t.current,l=At(),l=Yi(l),s=Rn(l),s.callback=null,On(n,s,l),n=l,t.current.lanes=n,pa(t,n),It(t),e[kl]=t.current,Rc(e),new Mi(t)},rs.version="19.2.6",rs}var Ym;function r0(){if(Ym)return no.exports;Ym=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),no.exports=i0(),no.exports}var c0=r0();const bl="/dashboard";function Xm(){const i=window.location.pathname;return i===bl||i===bl+"/"?"/":i.startsWith(bl+"/")?i.slice(bl.length):i||"/"}function Sn(i){return i==="/"||i===""?bl+"/":bl+(i.startsWith("/")?i:"/"+i)}function us(i){const c=Sn(i);c!==window.location.pathname+window.location.search&&window.history.pushState({},"",c),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",i=>{var o,d;if(i.defaultPrevented||i.button!==0||i.metaKey||i.ctrlKey||i.shiftKey||i.altKey)return;const c=(d=(o=i.target)==null?void 0:o.closest)==null?void 0:d.call(o,"a");if(!c)return;const u=c.getAttribute("href");u&&(c.hasAttribute("target")||c.hasAttribute("download")||u.startsWith(bl)&&(i.preventDefault(),u!==window.location.pathname+window.location.search&&window.history.pushState({},"",u),window.dispatchEvent(new Event("dashboard:navigate"))))}),window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("dashboard:navigate"))}));function hh(){const[i,c]=k.useState(Xm());return k.useEffect(()=>{const u=()=>c(Xm());return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),i}function o0(i){let c=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");c=c.replace(/```(\w*)\n?([\s\S]*?)```/g,(m,v,h)=>`<pre class="md-code-block"><code>${h.trimEnd()}</code></pre>`),c=c.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),c=c.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),c=c.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=c.split(`
|
|
50
|
+
`),o=[];let d=!1;for(let m=0;m<u.length;m++){const v=u[m],h=v.match(/^###\s+(.+)$/),p=v.match(/^##\s+(.+)$/),g=v.match(/^#\s+(.+)$/);if(h){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${h[1]}</h3>`);continue}if(p){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${p[1]}</h2>`);continue}if(g){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const y=v.match(/^(\s*)[*-]\s+(.+)$/);if(y){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${y[2]}</li>`);continue}if(v.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(v)}return d&&o.push("</ul>"),o.join(`
|
|
51
|
+
`)}function Li(i){let c=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");c=c.replace(/^\[(FINDING|SUGGESTION|INSIGHT)\]\s*/i,""),c=c.replace(/<agent_finding[^&]*>/g,""),c=c.replace(/<\/agent_finding>/g,""),c=c.replace(/<cite\s+tag="file">([^&]+)<\/cite>/g,'<code class="cite-file">$1</code>'),c=c.replace(/<cite\s+tag="fn">([^&]+)<\/cite>/g,'<code class="cite-fn">$1</code>'),c=c.replace(/<fn>([^&]+)<\/fn>/g,'<code class="cite-fn">$1</code>'),c=c.replace(/```(\w*)\n?([\s\S]*?)```/g,'<pre class="md-code-block"><code>$2</code></pre>'),c=c.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),c=c.replace(/\*\*([^*\n]+)\*\*/g,'<strong class="font-semibold text-foreground">$1</strong>'),c=c.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=c.split(`
|
|
52
|
+
`),o=[];let d=!1;for(const m of u){const v=m.match(/^###\s+(.+)$/),h=m.match(/^##\s+(.+)$/),p=m.match(/^#\s+(.+)$/);if(v){d&&(o.push("</ul>"),d=!1),o.push(`<h3 class="md-h3">${v[1]}</h3>`);continue}if(h){d&&(o.push("</ul>"),d=!1),o.push(`<h2 class="md-h2">${h[1]}</h2>`);continue}if(p){d&&(o.push("</ul>"),d=!1),o.push(`<h1 class="md-h1">${p[1]}</h1>`);continue}const g=m.match(/^(\s*)[*-]\s+(.+)$/);if(g){d||(o.push('<ul class="md-list">'),d=!0),o.push(`<li>${g[2]}</li>`);continue}if(m.trim()===""){d&&(o.push("</ul>"),d=!1),o.push("");continue}d&&(o.push("</ul>"),d=!1),o.push(m)}return d&&o.push("</ul>"),o.join(`
|
|
53
|
+
`)}function Pe(i){const c=Date.now(),u=typeof i=="string"?new Date(i).getTime():i,o=Math.max(0,Math.floor((c-u)/1e3));return o<60?"just now":o<3600?Math.floor(o/60)+"m ago":o<86400?Math.floor(o/3600)+"h ago":Math.floor(o/86400)+"d ago"}function u0(i){if(!i)return"—";const c=Math.round(i/1e3);return c<60?c+"s":Math.floor(c/60)+"m "+c%60+"s"}function yo(i){const c=i.split("-").filter(Boolean);return c.length>=2?(c[0][0]+c[1][0]).toUpperCase():(c[0]||i).slice(0,2).toUpperCase()}const Vm=["#3F8B86","#8C5E97","#B47A2A","#2F7D5B","#A53A4A","#6B6862","#C8A45A"],Qm={"sonnet-reviewer":"#8C5E97","sonnet-designer":"#C8A45A","sonnet-implementer":"#A53A4A","opus-implementer":"#C97056","gemini-reviewer":"#3F8B86","gemini-tester":"#2F7D5B","haiku-researcher":"#6B7A85"};function en(i){if(Qm[i])return Qm[i];let c=0;for(let u=0;u<i.length;u++)c=c*31+i.charCodeAt(u)>>>0;return Vm[c%Vm.length]}function fa({title:i,hint:c,compact:u=!1}){return a.jsxs("div",{className:`text-center ${u?"py-3":"py-6"}`,children:[a.jsx("div",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:i}),c&&a.jsx("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:c})]})}function d0(i){return i==null||i<=0?"—":i<1e3?`${i}ms`:i<6e4?`${(i/1e3).toFixed(1)}s`:`${(i/6e4).toFixed(1)}m`}function gl({value:i,unit:c,label:u,valueClass:o="",valueColor:d,pulse:m,tooltip:v}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":v,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[m&&a.jsxs("span",{className:"relative mr-1 inline-flex h-2 w-2",children:[a.jsx("span",{className:"absolute inline-flex h-2 w-2 animate-ping rounded-full bg-unverified/60"}),a.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-unverified"})]}),a.jsx("span",{className:`font-mono text-2xl font-medium leading-none tracking-[-0.025em] ${o}`,style:d?{color:d}:void 0,children:i}),c&&a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--ink-3)"},children:c})]}),a.jsx("div",{className:"h-section mt-1.5",style:{color:"var(--ink-3)",fontSize:"10px"},children:u})]})}function f0({overview:i,activeTasks:c,mode:u="dense",showActivity:o}){const d=i.relayCount+i.nativeCount,m=i.tasksCompleted+i.tasksFailed>0?Math.round(i.tasksCompleted/(i.tasksCompleted+i.tasksFailed)*100):null,v=i.totalFindings>0?Math.round(i.confirmedFindings/i.totalFindings*100):0,h=u==="calm",p=o??!h,g=h&&d===0;return a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-3",children:[a.jsx("div",{className:"h-section",children:"System Pulse"}),a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[10px] text-confirmed",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-confirmed"}),"LIVE"]})]}),g?a.jsx(fa,{title:"No agents registered yet",hint:"Run `gossip_setup` or see docs/ to get started."}):h?a.jsxs("div",{className:"grid grid-cols-3 border-b border-border",children:[a.jsx("div",{className:"border-r border-border",children:a.jsx(gl,{value:i.agentsOnline,label:"Agents Working",valueColor:i.agentsOnline>0?"var(--ok)":"var(--text)"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(gl,{value:c,label:"Active Tasks",valueClass:c>0?"text-unverified":"",valueColor:c>0?void 0:"var(--ink-3)",pulse:c>0})}),a.jsx(gl,{value:`${v}%`,label:"Confirmed",valueClass:v>=50?"text-confirmed":v>0?"text-unverified":"",valueColor:v===0?"var(--ink-3)":void 0})]}):a.jsxs("div",{className:"border-b border-border",children:[a.jsxs("div",{className:"relative grid grid-cols-2",children:[a.jsx("span",{className:"pointer-events-none absolute left-0 right-0 top-1/2 h-px bg-border"}),a.jsx("span",{className:"pointer-events-none absolute bottom-0 left-1/2 top-0 w-px bg-border"}),a.jsxs("div",{className:"flex flex-col items-stretch justify-center gap-1.5 px-4 py-3",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Agents currently executing a task",children:"Dispatched"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:i.agentsOnline>0?"var(--ok)":"var(--text)"},children:i.agentsOnline})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Relay agents with an active WebSocket connection",children:"Connected"}),a.jsx("span",{className:`font-mono text-base font-bold leading-none ${i.relayConnected>0?"text-confirmed":""}`,style:i.relayConnected>0?void 0:{color:"var(--ink-3)"},children:i.relayConnected})]}),a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsx("span",{className:"h-section",style:{color:"var(--ink-3)",fontSize:"10px"},"data-tooltip":"Total agents in gossipcat config",children:"Registered"}),a.jsx("span",{className:"font-mono text-base font-bold leading-none",style:{color:"var(--ink-3)"},children:d})]})]}),a.jsx(gl,{value:c,label:"Active Tasks",valueClass:c>0?"text-unverified":"",valueColor:c>0?void 0:"var(--ink-3)",pulse:c>0}),a.jsx(gl,{value:i.consensusRuns,label:"Consensus",valueColor:"var(--text)"}),a.jsx(gl,{value:`${v}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:Sn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"block cursor-pointer border-t border-border transition-colors hover:bg-accent/10","aria-label":"View actionable findings on Signals page",children:a.jsx(gl,{value:i.actionableFindings,label:"Actionable",valueClass:i.actionableFindings>0?"text-unverified":"",tooltip:"Findings still open and need operator review (disagreements + hallucinations + new findings)"})})]}),!h&&a.jsxs("div",{className:"px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks completed"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:i.tasksCompleted})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"signals total"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:i.totalSignals})]}),i.tasksFailed>0&&a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"tasks failed"}),a.jsx("span",{className:"font-semibold text-bad tabular-nums",children:i.tasksFailed})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"avg duration"}),a.jsx("span",{className:"font-semibold tabular-nums",style:{color:"var(--text)"},children:d0(i.avgDurationMs)})]}),a.jsxs("div",{className:"flex items-center justify-between py-1 font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--ink-3)"},children:"success rate"}),a.jsx("span",{className:`font-semibold tabular-nums ${m!==null&&m>=95?"text-confirmed":m!==null&&m>=80?"text-unverified":m!==null?"text-bad":""}`,style:m===null?{color:"var(--ink-3)"}:void 0,children:m===null?"—":`${m}%`})]})]}),p&&a.jsx(m0,{hourly:i.hourlyActivity||[]}),i.lastConsensusTimestamp&&a.jsxs("div",{className:"border-t border-border px-3.5 py-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)"},children:["last consensus ",Pe(i.lastConsensusTimestamp)]})]})}function m0({hourly:i}){const c=i.length===12?i:new Array(12).fill(0),u=Math.max(1,...c);return a.jsxs("div",{className:"border-t border-border px-3.5 py-3",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:[a.jsx("div",{className:"h-section mb-2",style:{color:"color-mix(in oklch, var(--ink-3) 60%, transparent)",fontSize:"11px"},children:"Activity Last 12h"}),a.jsx("div",{className:"flex h-6 items-end gap-0.5",children:c.map((o,d)=>{const m=11-d,v=o/u*100,h=d===11,p=m===0?"last hour":`${m}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${o===0?"opacity-0":h?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:o===0?"0%":`${Math.max(8,v)}%`},"data-tooltip":`${p}
|
|
54
|
+
${o} task${o===1?"":"s"}`,"data-tooltip-pos":"bottom"},d)})}),a.jsxs("div",{className:"mt-1 flex justify-between font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--ink-3) 40%, transparent)"},children:[a.jsx("span",{children:"12h ago"}),a.jsx("span",{children:"now"})]})]})}const tn=24;function h0(i,c){const u=new Map;for(const o of c)u.set(o.id,new Array(tn).fill(0));for(const o of(i==null?void 0:i.agents)??[]){const d=u.get(o.id);if(!d)continue;const m=o.buckets??[];for(let v=0;v<tn;v++)d[v]=m[v]??0}return u}function x0(i,c){if(c<=0||i<=0)return 0;const u=i/c;return u<.18?1:u<.4?2:u<.68?3:4}const p0={0:.18,1:.35,2:.55,3:.78,4:1};function v0({agents:i,activity:c,loading:u=!1,error:o=null}){const d=k.useMemo(()=>h0(c,i),[c,i]),m=k.useMemo(()=>{const h=new Map;for(const[p,g]of d)h.set(p,g.reduce((y,S)=>y+S,0));return h},[d]),v=k.useMemo(()=>{let h=0;for(const p of m.values())h+=p;return h},[m]);if(u&&i.length===0)return a.jsx(Ai,{error:null,fleetTotal:null,children:Array.from({length:4}).map((h,p)=>a.jsx(g0,{},p))});if(i.length===0)return a.jsx(Ai,{error:o,fleetTotal:null,children:a.jsxs("div",{className:"px-5 py-6 font-mono text-xs",style:{color:"var(--ink-3)"},children:["No agents registered yet — run ",a.jsx("code",{className:"rounded bg-[var(--surface-sunk)] px-1.5 py-0.5",children:"gossip_setup"})," to spin up the fleet."]})});if(v===0){const h=c==null?"Activity data unavailable — relay may be disconnected. Showing idle rows from the agent registry.":"No active dispatches — fleet idle.";return a.jsxs(Ai,{error:o,fleetTotal:0,children:[i.map(p=>a.jsx(y0,{agent:p},p.id)),a.jsx("div",{className:"px-5 py-3 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:h})]})}return a.jsx(Ai,{error:o,fleetTotal:v,children:i.map(h=>{const p=d.get(h.id)??new Array(tn).fill(0),g=Math.max(0,...p),y=m.get(h.id)??0,S=v>0?Math.round(y/v*100):0,R=en(h.id);return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[12px]",style:{color:"var(--ink)"},children:[a.jsx("span",{className:"inline-block h-2 w-2 flex-shrink-0 rounded-full",style:{background:R}}),a.jsx("span",{className:"truncate",children:h.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${tn}, 1fr)`},role:"img","aria-label":`${h.id} 24h activity — ${y} signals`,children:p.map((J,$)=>{const Y=x0(J,g);return a.jsx("div",{className:"rounded-sm",title:`hour ${$}: ${J} signal${J===1?"":"s"}`,style:{background:Y===0?"var(--surface-sunk)":R,opacity:p0[Y]}},$)})}),a.jsxs("div",{className:"text-right font-mono text-[12px] tabular-nums",style:{color:"var(--ink)"},children:[y,a.jsxs("span",{className:"ml-1.5 text-[11px]",style:{color:"var(--ink-3)"},children:[S,"%"]})]})]},h.id)})})}function Ai({children:i,error:c,fleetTotal:u}){return a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[a.jsxs("div",{className:"grid items-end gap-3 border-b border-border px-5 py-3",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsx("div",{className:"h-section",children:"Agent · 24h activity"}),a.jsx("div",{className:"grid font-mono text-[9px]",style:{gridTemplateColumns:`repeat(${tn}, 1fr)`,color:"var(--ink-3)"},children:Array.from({length:tn}).map((o,d)=>a.jsx("span",{className:"text-center",children:d%2===0?String(d).padStart(2,"0"):""},d))}),a.jsx("div",{className:"flex items-center justify-end gap-2",children:c?a.jsx("span",{className:"rounded-sm border px-2 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--danger)",background:"color-mix(in oklch, var(--danger) 12%, transparent)",color:"var(--danger)"},children:c}):u!==null?a.jsxs("div",{className:"h-section",style:{color:"var(--ink-3)"},children:["Signals · 24h ",a.jsx("span",{className:"ml-1.5 tabular-nums",style:{color:"var(--ink)"},children:u})]}):null})]}),i]})}function g0(){return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsx("div",{className:"h-3 w-32 rounded",style:{background:"var(--border)",opacity:.4}}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${tn}, 1fr)`},children:Array.from({length:tn}).map((i,c)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--border)",opacity:.4}},c))}),a.jsx("div",{className:"ml-auto h-3 w-12 rounded",style:{background:"var(--border)",opacity:.4}})]})}function y0({agent:i}){const c=en(i.id);return a.jsxs("div",{className:"grid items-center gap-3 border-b border-border px-5 py-2 last:border-b-0",style:{gridTemplateColumns:"160px 1fr 110px"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[12px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{className:"inline-block h-2 w-2 flex-shrink-0 rounded-full",style:{background:c,opacity:.5}}),a.jsx("span",{className:"truncate",children:i.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${tn}, 1fr)`},children:Array.from({length:tn}).map((u,o)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--surface-sunk)",opacity:.4}},o))}),a.jsx("div",{className:"text-right font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"—"})]})}const Ao="/dashboard/api",xh="unauthorized";function b0(i){return i instanceof Error&&i.message.includes(xh)}const qi=3e4;function ph(i){return`timeout after ${i/1e3}s`}function Co(i){if(typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function")return{signal:AbortSignal.timeout(i),cleanup:()=>{}};const c=new AbortController,u=setTimeout(()=>c.abort(new Error(ph(i))),i);return{signal:c.signal,cleanup:()=>clearTimeout(u)}}async function We(i,c){const{signal:u,cleanup:o}=Co(qi);try{const d=await fetch(`${Ao}/${i}`,{credentials:"include",...c,signal:u});if(d.status===401)throw new Error(xh);if(!d.ok)throw new Error(`API error: ${d.status}`);return d.json()}catch(d){throw d instanceof Error&&(d.name==="AbortError"||d.name==="TimeoutError")?new Error(ph(qi)):d}finally{o()}}async function j0(i){const{signal:c,cleanup:u}=Co(qi);try{const o=await fetch(`${Ao}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:i}),signal:c});return o.ok?await bo()?{ok:!0}:{ok:!1,kind:"no_cookie"}:o.status===401||o.status===403?{ok:!1,kind:"bad_key"}:{ok:!1,kind:"network"}}catch{return{ok:!1,kind:"network"}}finally{u()}}async function bo(){const{signal:i,cleanup:c}=Co(qi);try{return(await fetch(`${Ao}/auth/check`,{credentials:"include",signal:i})).ok}catch{return!1}finally{c()}}const N0=7200*1e3;function S0(i){const c=Date.now()-new Date(i).getTime();return c<0?"0s":c<6e4?`${Math.floor(c/1e3)}s`:c<36e5?`${Math.floor(c/6e4)}m ${Math.floor(c%6e4/1e3)}s`:`${Math.floor(c/36e5)}h ${Math.floor(c%36e5/6e4)}m`}function k0({onCountChange:i}){const[c,u]=k.useState([]),[,o]=k.useState(0);k.useEffect(()=>{let h=!1;const p=async()=>{var y;try{const S=await We("active-tasks");h||(u(S.tasks||[]),i==null||i(((y=S.tasks)==null?void 0:y.length)||0))}catch{}};p();const g=setInterval(p,5e3);return()=>{h=!0,clearInterval(g)}},[i]),k.useEffect(()=>{if(c.length===0)return;const h=setInterval(()=>o(p=>p+1),1e3);return()=>clearInterval(h)},[c.length]);const d=Date.now(),m=c.filter(h=>d-new Date(h.startedAt).getTime()<N0),v=c.length-m.length;return m.length===0?v===0?null:a.jsx("div",{className:"rounded-lg border border-border px-4 py-2.5",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:a.jsxs("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:[v," stale task",v===1?"":"s"," — likely orphaned (>2h since last update)"]})}):a.jsxs("div",{className:"rounded-lg border border-border px-4 py-2.5",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed"}),a.jsx("span",{className:"h-section",children:"Live"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--text-dim)"},children:[m.length," active"]}),v>0&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["· ",v," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:m.map(h=>a.jsxs("div",{className:"grid items-center gap-3",style:{gridTemplateColumns:"minmax(120px, auto) 1fr auto"},children:[a.jsx("span",{className:"font-mono text-[11px] font-semibold truncate",style:{color:"var(--text)"},children:h.agentId}),a.jsx("span",{className:"min-w-0 truncate text-[11px]",style:{color:"var(--text-dim)"},children:h.task}),a.jsx("span",{className:"font-mono text-[11px] whitespace-nowrap tabular-nums",style:{color:"var(--text-dim)"},children:S0(h.startedAt)})]},h.taskId))})]})}function _0(i,c,u,o){const d=Math.max(0,Math.min(.9999,o)),m=-Math.PI/2,v=m+d*2*Math.PI,h=i+u*Math.cos(m),p=c+u*Math.sin(m),g=i+u*Math.cos(v),y=c+u*Math.sin(v),S=d>.5?1:0;return`M ${h.toFixed(2)} ${p.toFixed(2)} A ${u} ${u} 0 ${S} 1 ${g.toFixed(2)} ${y.toFixed(2)}`}function E0(i,c,u){return`M ${i} ${c-u} A ${u} ${u} 0 1 1 ${i} ${c+u} A ${u} ${u} 0 1 1 ${i} ${c-u}`}function T0({accuracy:i,size:c=90,color:u="var(--ink)"}){const o=Number.isFinite(i)?Math.max(0,Math.min(1,i)):0,d=c/2,m=c/2,v=c*.089,h=(c-v)/2-2,p=Math.round(o*100),g=Math.round(c*.22);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[a.jsxs("svg",{width:c,height:c,viewBox:`0 0 ${c} ${c}`,role:"img","aria-label":`Accuracy ${p}%`,children:[a.jsx("path",{d:E0(d,m,h),fill:"none",stroke:"var(--ink)",strokeOpacity:.08,strokeWidth:v,strokeLinecap:"round"}),o>0&&a.jsx("path",{d:_0(d,m,h,o),fill:"none",stroke:u,strokeWidth:v,strokeLinecap:"round"}),a.jsxs("text",{x:d,y:m,textAnchor:"middle",dominantBaseline:"middle",dy:"0.08em",fill:"var(--ink)",style:{fontSize:g,fontFamily:"'Fraunces', serif",fontVariantNumeric:"tabular-nums",fontWeight:700},children:[p,"%"]})]}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"accuracy"})]})}const Zm={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--idle)"},Km=["critical","high","medium","low"];function M0({counts:i,height:c=10}){const u=i??{critical:0,high:0,medium:0,low:0},o=u.critical+u.high+u.medium+u.low,d=`critical: ${u.critical}, high: ${u.high}, medium: ${u.medium}, low: ${u.low}`;return o===0?a.jsx("div",{role:"img","aria-label":`Severity distribution: no findings yet (${d})`,title:`${d} (no findings yet)`,style:{display:"flex",height:c,borderRadius:c/2,overflow:"hidden",gap:2,border:"1px solid color-mix(in oklch, var(--border) 60%, transparent)",width:"100%"},children:Km.map(m=>a.jsx("div",{style:{flex:1,background:Zm[m],opacity:.4}},m))}):a.jsx("div",{role:"img","aria-label":`Severity distribution — ${d}`,title:d,style:{display:"flex",height:c,borderRadius:c/2,overflow:"hidden",width:"100%"},children:Km.map(m=>{const v=u[m];if(v===0)return null;const h=v/o*100;return a.jsx("div",{style:{width:`${h.toFixed(2)}%`,background:Zm[m],flexShrink:0}},m)})})}function w0(i){return i.map(c=>c.signals)}function A0(i,c,u){if(i.length===0)return{line:`M 0 ${u} L ${c} ${u}`,area:""};if(i.length===1){const p=u/2;return{line:`M 0 ${p} L ${c} ${p}`,area:`M 0 ${u} L 0 ${p} L ${c} ${p} L ${c} ${u} Z`}}const o=Math.max(...i,1),d=c/(i.length-1),m=i.map((p,g)=>{const y=(g*d).toFixed(2),S=(u-p/o*u).toFixed(2);return`${y},${S}`}),v=`M ${m.join(" L ")}`,h=`M 0,${u} L ${m.join(" L ")} L ${((i.length-1)*d).toFixed(2)},${u} Z`;return{line:v,area:h}}const C0=5,jo=999;function z0(i){if(i.length<2)return null;const c=Math.floor(i.length/2),u=i.slice(0,c),o=i.slice(i.length-c),d=y=>y.reduce((S,R)=>S+R.signals,0),m=d(u),v=d(o);if(m<C0)return null;const h=m/u.length,p=v/o.length,g=Math.round((p-h)/h*100);return Math.max(-jo,Math.min(jo,g))}function D0({points:i,width:c=80,height:u=20,reducedMotion:o=!1,color:d="var(--c1)"}){const m=k.useMemo(()=>w0(i),[i]),{line:v,area:h}=k.useMemo(()=>A0(m,c,u),[m,c,u]),p=k.useMemo(()=>z0(i),[i]),g=m.length===0||m.every(y=>y===0);return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[a.jsxs("svg",{width:"100%",height:u,viewBox:`0 0 ${c} ${u}`,preserveAspectRatio:"none","aria-hidden":"true",style:{overflow:"visible",flex:1,minWidth:0},children:[!o&&!g&&h&&a.jsx("path",{d:h,fill:d,fillOpacity:.3}),a.jsx("path",{d:v,fill:"none",stroke:g?"var(--idle)":d,strokeOpacity:g?.3:1,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),p!==null&&!g&&a.jsxs("span",{title:"7d dispatch volume change — neutral indicator, not a quality metric",style:{fontSize:10,fontFamily:"Geist, Inter, sans-serif",fontVariantNumeric:"tabular-nums",fontWeight:600,color:"var(--ink-3)",flexShrink:0},children:[p>=0?"+":"",p,"%",Math.abs(p)>=jo?"+":""]})]})}function zo(i){var c,u;return((c=i.bench)==null?void 0:c.state)==="benched"?"benched":i.circuitOpen?"struggling":((u=i.bench)==null?void 0:u.state)==="kept-for-coverage"?"kept-for-coverage":null}function R0(i){var c;return((c=i.scores.bench)==null?void 0:c.state)==="benched"||i.scores.circuitOpen}function No(i){return`${Math.round(i*100)}%`}function O0(i){var c,u,o;return i.accuracy>=.7&&((c=i.bench)==null?void 0:c.state)==="none"?{label:"healthy",dotColor:"var(--ok)",tooltip:`Accuracy ${Math.round(i.accuracy*100)}% — above 70% baseline.`}:{label:"needs skills",dotColor:"var(--warn)",tooltip:((u=i.bench)==null?void 0:u.state)!=="none"?`Benched (${((o=i.bench)==null?void 0:o.reason)??"auto"})`:`Accuracy ${Math.round(i.accuracy*100)}% — below 70% baseline.`}}function Jm({label:i,value:c,color:u,tooltip:o}){const d=Number.isFinite(c)?Math.max(0,Math.min(1,c)):0;return a.jsxs("div",{className:"grid items-center gap-2",style:{gridTemplateColumns:"56px 1fr 32px"},children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":o,children:i}),a.jsx("div",{className:"h-2 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--ink) 8%, transparent)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.round(d*100)}%`,background:u}})}),a.jsx("span",{className:"text-right tabular-nums",style:{fontFamily:"Geist, Inter, sans-serif",fontSize:11,color:"var(--ink-2)"},children:No(d)})]})}function U0({agent:i,severityCounts:c,trendPoints:u}){var h;const o=i.scores,d=(h=i.lastTask)!=null&&h.timestamp?Pe(i.lastTask.timestamp):"",m=en(i.id),v=O0(o);return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(i.id)}`,className:"group relative block rounded-lg border border-border p-3 transition-all hover:-translate-y-0.5 hover:border-[color-mix(in_oklch,var(--ink)_30%,transparent)]",style:{background:"var(--surface-elev)"},children:[a.jsx("div",{style:{position:"absolute",top:10,right:12,zIndex:1},children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-sm border border-border/60 px-2 py-0.5",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)",color:"var(--ink-2)",fontFamily:"Geist, Inter, sans-serif",fontSize:11,fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":v.tooltip,"data-tooltip-pos":"bottom",children:[a.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:v.dotColor,flexShrink:0}}),v.label]})}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"100px 1fr",gap:12,alignItems:"stretch"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",gap:8,paddingBottom:2},children:[a.jsx(T0,{accuracy:o.accuracy,size:90,color:m}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[a.jsx(M0,{counts:c}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"severity mix"})]})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[a.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:a.jsx("div",{style:{minWidth:0,flex:1},children:a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,flexWrap:"wrap"},children:[a.jsx("span",{className:"truncate",style:{fontFamily:"Geist, Inter, sans-serif",fontSize:14,fontWeight:600,color:"var(--ink)",minWidth:0,flex:1},children:i.id}),(()=>{const p=zo(o);return p==="benched"?a.jsx("span",{className:"shrink-0 rounded-sm bg-bad/10 px-1 py-0.5 font-mono text-[8px] font-bold text-bad","aria-label":`Benched (${o.bench.reason??"auto"}). Excluded from dispatch until recovery.`,"data-tooltip":`Benched (${o.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):p==="struggling"?a.jsx("span",{className:"shrink-0 rounded-sm bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":"Struggling: consecutive failures tripped the circuit breaker.","data-tooltip":"Struggling: consecutive failures tripped the circuit breaker.",children:"STRUGGLING"}):p==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded-sm border border-unverified/40 bg-unverified/10 px-1 py-0.5 font-mono text-[8px] font-bold text-unverified","aria-label":`Would bench (${o.bench.reason??"rule"}), but kept as sole provider of a category.`,"data-tooltip":`Would bench (${o.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"KEPT"}):null})()]})})}),a.jsxs("div",{className:"rounded-md border border-border/30 px-2 py-2 space-y-1.5",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)"},children:[a.jsx(Jm,{label:"unique",value:o.uniqueness,color:m,tooltip:`Uniqueness ${No(o.uniqueness)}
|
|
55
|
+
Findings others missed.`}),a.jsx(Jm,{label:"impact",value:o.impactScore,color:m,tooltip:`Impact ${No(o.impactScore)}
|
|
56
|
+
Severity-weighted findings.`})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[u&&u.length>0&&a.jsx("div",{style:{width:"100%"},children:a.jsx(D0,{points:u,width:240,height:28,color:m})}),a.jsxs("div",{style:{fontFamily:"Geist, Inter, sans-serif",fontSize:11,color:"var(--ink-3)",display:"flex",alignItems:"center",gap:4},children:[a.jsxs("span",{className:"tabular-nums",children:[o.signals," signals"]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{children:d})]})]})]})]})]})]})}function q0({agents:i,highlightedAgentId:c,severityMap:u,trendByAgent:o}){const d=[...i].sort((h,p)=>{var J,$,Y,w;const g=((J=h.lastTask)==null?void 0:J.timestamp)??"",y=(($=p.lastTask)==null?void 0:$.timestamp)??"";if(g!==y)return y.localeCompare(g);const S=((Y=h.scores)==null?void 0:Y.signals)||0,R=((w=p.scores)==null?void 0:w.signals)||0;return S!==R?R-S:h.id.localeCompare(p.id)}),m=d.slice(0,4),v=d.length>4;return a.jsxs("section",{children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Team ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.length})]}),v&&a.jsx("a",{href:"/dashboard/team",className:"text-xs transition hover:[color:var(--accent)]",style:{color:"var(--text-dim)"},children:"view all"})]}),a.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:m.map(h=>{const p=h.id===c;return a.jsx("div",{style:{borderRadius:"0.5rem",outline:p?"2px solid var(--border-strong)":void 0,transition:"outline-color 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(U0,{agent:h,severityCounts:u==null?void 0:u.get(h.id),trendPoints:o==null?void 0:o.get(h.id)})},h.id)})})]})}const B0=8;function L0(i){const c=i.toLowerCase();return c==="completed"||c==="done"||c==="success"||c==="succeeded"?"completed":c==="running"||c==="active"||c==="in_progress"||c==="pending"?"running":c==="failed"||c==="error"||c==="errored"||c==="timeout"||c==="timed_out"?"failed":c==="cancelled"||c==="canceled"||c==="queued"||c==="waiting"?"cancelled":"unknown"}const H0={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-destructive/10 border-destructive/30",text:"text-destructive",pulse:!1},cancelled:{label:"Cancelled",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1},unknown:{label:"Unknown",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1}},$0={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function G0(i){return i.length>8?i.slice(0,8):i}function Y0(i){return i.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:i.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:i.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:i.endsWith("-researcher")?{label:"RESEARCH",cls:"",clsStyle:{color:"var(--text-dim)"}}:i.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function X0({tasks:i,limit:c=B0}){const u=i.items.slice(0,c),o=i.items.length>c;return a.jsxs("section",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Tasks ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.total})]}),o&&a.jsx("a",{href:"/dashboard/tasks",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),a.jsx("div",{className:"flex-1 rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:u.length===0?a.jsx(fa,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):u.map((d,m)=>{const v=L0(d.status),h=H0[v],p=Y0(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${m>0?"border-t border-border/20":""}`,children:[a.jsx("span",{className:`mt-0.5 flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-full border ${h.iconBox} ${h.text} ${h.pulse?"animate-pulse":""}`,style:h.textStyle,"aria-label":`Status: ${h.label}`,"data-tooltip":h.label,children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:$0[v]})}),a.jsx("span",{className:"mt-0.5 shrink-0 rounded border border-border/40 px-1.5 py-0.5 font-mono text-[10px] font-semibold",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)",color:"var(--text-dim)"},"data-tooltip":d.taskId,children:G0(d.taskId)}),p&&a.jsx("span",{className:`shrink-0 rounded-sm border border-border/40 px-1 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider ${p.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...p.clsStyle},"data-tooltip":d.agentId,children:p.label}),a.jsx("span",{className:"min-w-0 flex-1 line-clamp-2 font-inter text-[11px] leading-snug",style:{color:"var(--text)"},children:d.task}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] font-normal",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:d.agentId}),a.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:Pe(d.timestamp)})]},d.taskId)})})]})}function Do({message:i,className:c}){return a.jsxs("span",{role:"alert",className:`inline-flex items-center gap-1 rounded-sm px-2 py-0.5 font-mono text-[10px] ${c??""}`,style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 12%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:[a.jsx("span",{"aria-hidden":!0,style:{fontWeight:700},children:"!"}),a.jsxs("span",{children:["error · ",i]})]})}const V0={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"},Q0={agreement:"var(--ok)",consensus_verified:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",unique_confirmed:"var(--unique)",unique_unconfirmed:"var(--warn)",new_finding:"var(--unique)",unverified:"var(--info)"},Z0={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"};function K0(i,c){return i?i.length>c?i.slice(0,c-1)+"…":i:""}function J0(i){return i.split(/(`[^`]+`)/g).map((u,o)=>u.startsWith("`")&&u.endsWith("`")&&u.length>2?a.jsx("code",{style:{background:"color-mix(in oklch, var(--ink) 6%, transparent)",padding:"0 4px",borderRadius:3,fontFamily:"var(--font-mono)",fontSize:12,color:"var(--ink)"},children:u.slice(1,-1)},o):a.jsx("span",{children:u},o))}function F0(){const[i,c]=k.useState(null),[u,o]=k.useState(null);k.useEffect(()=>{We("signals?limit=7").then(m=>c(m.items??[])).catch(m=>o(String((m==null?void 0:m.message)??m)))},[]);const d=i?i.filter(m=>Date.now()-Date.parse(m.timestamp)<36e5).length:0;return a.jsxs("section",{children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h3",{className:"h-section",children:"Signal stream"}),a.jsxs("span",{className:"font-mono text-[11px]",style:{color:"var(--info)",visibility:d===0?"hidden":"visible"},children:["+",d," in last hour"]})]}),a.jsx("button",{type:"button",onClick:()=>us("/signals"),className:"font-mono text-[11px] hover:underline",style:{color:"var(--text-dim)"},children:"all signals →"}),u&&a.jsx(Do,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[!u&&i===null&&a.jsx("div",{"aria-busy":"true",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"py-2 pl-4 pr-3",style:{width:80},children:a.jsx("div",{className:"h-2 w-8 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:160},children:a.jsx("div",{className:"h-2 w-12 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-3",style:{width:180},children:a.jsx("div",{className:"h-2 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("th",{className:"py-2 pr-4",children:a.jsx("div",{className:"h-2 w-14 rounded",style:{background:"var(--border)",opacity:.4}})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((m,v)=>a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3",children:a.jsx("div",{className:"h-2.5 w-10 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{style:{width:3,height:14,background:"var(--border)",opacity:.4,borderRadius:1,flexShrink:0}}),a.jsx("div",{className:"h-2.5 w-14 rounded",style:{background:"var(--border)",opacity:.4}})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("div",{className:"h-2.5 w-24 rounded",style:{background:"var(--border)",opacity:.4}})}),a.jsx("td",{className:"py-2.5 pr-4",children:a.jsx("div",{className:"h-2.5 rounded",style:{background:"var(--border)",opacity:.4,width:"75%"}})})]},v))})]})}),!u&&i&&i.length===0&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no signals recorded"}),u&&(!i||i.length===0)&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no cached signals to display"}),i&&i.length>0&&a.jsxs("table",{className:"w-full",style:u?{opacity:.5}:void 0,children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",children:[a.jsx("th",{className:"h-section py-2 pl-4 pr-3 text-left",style:{fontSize:10,width:80},children:"time"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:160},children:"verdict"}),a.jsx("th",{className:"h-section py-2 pr-3 text-left",style:{fontSize:10,width:180},children:"agent"}),a.jsx("th",{className:"h-section py-2 pr-4 text-left",style:{fontSize:10},children:"finding"})]})}),a.jsx("tbody",{children:i.map((m,v)=>{const h=m.severity?Z0[m.severity]:"transparent",p=Q0[m.signal]??"var(--ink-2)",g=V0[m.signal]??m.signal;return a.jsxs("tr",{className:"border-b border-border/40 last:border-b-0",children:[a.jsx("td",{className:"py-2.5 pl-4 pr-3 align-middle font-mono text-[12px] tabular-nums",style:{color:"var(--text-dim)"},children:Pe(m.timestamp)}),a.jsx("td",{className:"py-2.5 pr-3 align-middle",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{role:"img","aria-label":m.severity?`severity: ${m.severity}`:"severity: unspecified",style:{display:"inline-block",width:3,height:14,background:h,borderRadius:1,flexShrink:0},title:m.severity??""}),a.jsx("span",{className:"h-section truncate",style:{color:p,fontSize:11},title:g,children:g})]})}),a.jsx("td",{className:"py-2.5 pr-3 align-middle font-mono text-[12px]",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"truncate",children:m.agentId})}),a.jsx("td",{className:"py-2.5 pr-4 align-middle text-[12px]",style:{color:"var(--text)",lineHeight:1.45},children:J0(K0(m.evidence??"",120))})]},`${m.timestamp}-${v}`)})})]})]})]})}const io=[{key:"passed",label:"passed",color:"var(--ok)"},{key:"pending",label:"pending",color:"var(--info)"},{key:"insufficient_evidence",label:"insufficient",color:"var(--idle)"},{key:"inconclusive",label:"inconclusive",color:"var(--warn)"},{key:"silent_skill",label:"silent",color:"var(--ink-3)"},{key:"failed",label:"failed",color:"var(--bad)"}];function I0({overview:i}){const c=i==null?void 0:i.skillVerdictSummary,u=c?io.reduce((o,d)=>o+(c[d.key]??0),0):0;return a.jsxs("section",{className:"rounded-lg border border-border p-4",style:{background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-3 flex items-baseline justify-between",children:[a.jsx("h3",{className:"h-section",children:"Skill Verdicts"}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[u," total"]})]}),!c||u===0?a.jsx("p",{className:"font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"no skill verdicts yet"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mb-3 flex h-2 w-full gap-px overflow-hidden rounded-sm",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:io.map(o=>{const d=c[o.key]??0;if(d===0)return null;const m=d/u*100;return a.jsx("div",{style:{width:`${m}%`,background:o.color},title:`${o.label}: ${d}`},o.key)})}),a.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:io.map(o=>{const d=c[o.key]??0,m=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${m?"opacity-40":""}`,children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:o.color}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:o.label}),a.jsx("span",{className:"ml-auto tabular-nums",style:m?{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}:{color:o.color},children:d})]},o.key)})})]})]})}const yl=1,os=2,W0=5;function P0({curve:i,threshold:c,stroke:u,width:o=140,height:d=30}){const m=k.useMemo(()=>tv(i),[i]),v=m.reduce((R,J)=>R+J.length,0);if(i.length===0||v<W0)return a.jsx(ev,{width:o,height:d,threshold:c});const h=o-yl*2,p=d-os*2,g=os+(1-So(c))*p,y=R=>i.length<=1?yl+h/2:yl+R/(i.length-1)*h,S=R=>os+(1-So(R))*p;return a.jsxs("svg",{width:o,height:d,viewBox:`0 0 ${o} ${d}`,"aria-hidden":!0,style:{display:"block"},children:[a.jsx("line",{x1:yl,x2:o-yl,y1:g,y2:g,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.7}),m.map((R,J)=>{if(R.length===1){const{idx:Y,value:w}=R[0];return a.jsx("circle",{className:"skill-spark-curve",cx:y(Y),cy:S(w),r:1.4,fill:u},J)}const $=R.map((Y,w)=>`${w===0?"M":"L"} ${y(Y.idx).toFixed(2)} ${S(Y.value).toFixed(2)}`).join(" ");return a.jsx("path",{className:"skill-spark-curve",d:$,fill:"none",stroke:u,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},J)})]})}function ev({width:i,height:c,threshold:u}){const o=c-os*2,d=u!==void 0?os+(1-So(u))*o:c/2;return a.jsx("svg",{width:i,height:c,viewBox:`0 0 ${i} ${c}`,"aria-hidden":!0,style:{display:"block"},children:a.jsx("line",{x1:yl,x2:i-yl,y1:d,y2:d,stroke:"var(--ok)",strokeWidth:1,strokeDasharray:"2 2",opacity:.4})})}function tv(i){const c=[];let u=[];for(let o=0;o<i.length;o++){const d=i[o].value;if(d==null||!Number.isFinite(d)){u.length>0&&(c.push(u),u=[]);continue}u.push({idx:o,value:d})}return u.length>0&&c.push(u),c}function So(i){return!Number.isFinite(i)||i<0?0:i>1?1:i}const vh={passed:"var(--ok)",pending:"var(--info)",insufficient_evidence:"var(--idle)",inconclusive:"var(--warn)",silent_skill:"var(--ink-3)",failed:"var(--bad)",flagged_for_manual_review:"var(--warn)"},nv={passed:"passed",pending:"pending",insufficient_evidence:"insufficient",inconclusive:"inconclusive",silent_skill:"silent",failed:"failed",flagged_for_manual_review:"flagged"},Fm={failed:0,flagged_for_manual_review:1,inconclusive:2,insufficient_evidence:3,passed:4,pending:5,silent_skill:6},lv="var(--ink-3)";function Oi(i){return i!=null&&i in vh}function av({skills:i,loading:c,error:u}){const{known:o,unknown:d,total:m,transitions:v}=k.useMemo(()=>sv(i==null?void 0:i.effectiveness),[i]);return a.jsxs("section",{className:"space-y-2",children:[a.jsxs("header",{className:"flex items-baseline justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("h3",{className:"h-section",children:"skill graduation"}),a.jsx("span",{className:"font-mono text-[11px] tabular-nums font-medium",style:{color:"var(--ink)",fontFamily:"'JetBrains Mono', monospace"},children:m}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["skills · ",v," transitions /24h"]})]}),a.jsx("a",{href:Sn("/"),className:"text-[11px] transition hover:underline",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"skill detail →"}),u&&a.jsx(Do,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border p-4",style:{background:"var(--surface-sunk)",borderColor:"var(--border)"},children:[a.jsx("p",{className:"mb-3 text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"Top: frozen verdict + stored basis. Bottom: live 7d activity. Dashed line = graduation threshold."}),c&&!i&&a.jsx(rv,{}),!c&&m===0&&!u&&a.jsx("p",{className:"text-[12px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"No skills bound yet — agents need at least one dispatch with a skill match."}),m>0&&a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6",style:u?{opacity:.5}:void 0,children:o.map(h=>a.jsx(Wm,{entry:h},Im(h)))}),d.length>0&&a.jsxs("details",{className:"mt-4 group",children:[a.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 select-none",style:{color:"var(--ink-3)"},children:[a.jsx("span",{"aria-hidden":!0,className:"chevron inline-block transition-transform",style:{fontSize:"10px",lineHeight:1},children:"▶"}),a.jsxs("span",{className:"text-[11px]",style:{fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)",fontWeight:600},children:[d.length," unknown"]})]}),a.jsx("ul",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6",children:d.map(h=>a.jsx(Wm,{entry:h},Im(h)))}),a.jsx("style",{children:`
|
|
57
|
+
details[open] > summary > .chevron { transform: rotate(90deg); }
|
|
58
|
+
`})]})]})]})}function Im(i){return`${i.agentId}::${i.skill}`}function sv(i){if(!i)return{known:[],unknown:[],total:0,transitions:0};const c=[],u=[];let o=0;for(const d of i)if(Oi(d.status)?c.push(d):u.push(d),d.curve.length>=2){const m=d.curve.slice(-2),v=m.filter(p=>p.value!=null&&p.value>=d.threshold).length,h=m.filter(p=>p.value!=null&&p.value<d.threshold).length;v>=1&&h>=1&&o++}return c.sort((d,m)=>{const v=Oi(d.status)?Fm[d.status]:99,h=Oi(m.status)?Fm[m.status]:99;return v!==h?v-h:d.skill.localeCompare(m.skill)}),u.sort((d,m)=>d.skill.localeCompare(m.skill)),{known:c,unknown:u,total:c.length+u.length,transitions:o}}function Wm({entry:i}){const c=Oi(i.status)?i.status:null,u=c?vh[c]:lv,o=c?nv[c]:i.status??"unknown",d=typeof i.storedEffectiveness=="number"?i.storedEffectiveness:null,m=d!==null?Math.round(d*100):null,v=i.verdictAt?iv(i.verdictAt):null,h=i.liveRecovered===!0;return a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},title:`${i.agentId} · ${i.skill} · ${o} · N=${i.n}`,children:[a.jsxs("div",{className:"flex flex-col gap-1.5 rounded-t-lg px-2.5 pt-2.5 pb-2",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("div",{className:"truncate text-[12px] font-medium leading-tight",style:{color:"var(--ink)",fontFamily:"Geist, var(--font-sans)"},children:i.skill}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{"aria-hidden":!0,className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:en(i.agentId)}}),a.jsx("span",{className:"truncate text-[10px]",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},children:i.agentId})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[a.jsx("span",{className:"inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold",style:{color:u,background:`color-mix(in oklch, ${u} 12%, transparent)`,border:`1px solid color-mix(in oklch, ${u} 25%, transparent)`,fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)"},children:o}),h&&a.jsx("span",{className:"inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{color:"var(--ok)",background:"var(--ok-soft)",border:"1px solid color-mix(in oklch, var(--ok) 25%, transparent)",fontFamily:"Geist, var(--font-sans)",letterSpacing:"0.02em"},title:"Live 7d signals show recovery above threshold — but the stored verdict is frozen. Re-test to graduate.",children:"recovered · re-test pending"})]}),(m!==null||v)&&a.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[m!==null&&a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:m<0&&(c==="failed"||c==="flagged_for_manual_review")?"var(--bad)":m>0?"var(--ok)":"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Stored effectiveness delta: ${m>0?"+":""}${m}pp (basis for this verdict)`,children:[m>0?"+":"",m,"pp"]}),m!==null&&a.jsxs("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["vs ",i.threshold.toFixed(2)]}),v&&a.jsx("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Verdict as of: ${i.verdictAt}`,children:v})]})]}),a.jsxs("div",{className:"flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em",fontFamily:"Geist, var(--font-sans)",fontWeight:600},children:"live 7d"}),a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:"Total post-bind signals in the 7d window",children:["N=",a.jsx("span",{style:{color:"var(--ink)"},children:i.n})]})]}),a.jsx(P0,{curve:i.curve,threshold:i.threshold,stroke:en(i.agentId),width:120,height:28})]})]})}function iv(i){try{const c=new Date(i);if(!Number.isFinite(c.getTime()))return null;const u=new Date,o=c.getFullYear()===u.getFullYear(),d=c.toLocaleString("en-US",{month:"short"}),m=c.getDate();return o?`${d} ${m}`:`${d} ${m} '${String(c.getFullYear()).slice(-2)}`}catch{return null}}function rv(){return a.jsx("ul",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6","aria-hidden":!0,children:Array.from({length:6}).map((i,c)=>a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{borderColor:"var(--border)",background:"var(--surface-elev)",minHeight:"120px"},children:[a.jsxs("div",{className:"flex flex-col gap-1.5 px-2.5 pt-2.5 pb-2",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("span",{className:"h-3 w-3/4 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-2 w-1/3 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-2.5 w-1/2 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-5 w-16 rounded-full",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}})]}),a.jsxs("div",{className:"flex flex-col gap-1 px-2.5 pt-1.5 pb-2.5",children:[a.jsx("span",{className:"h-2.5 w-10 rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}}),a.jsx("span",{className:"h-7 w-full rounded-sm",style:{background:"color-mix(in oklch, var(--border) 40%, transparent)"}})]})]},c))})}function cv(i){let c=0;for(let u=0;u<i.length;u++)c=(c<<5)-c+i.charCodeAt(u)|0;return Math.abs(c)}class ov{constructor(c){nt(this,"s");this.s=c}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(c,u){return c+this.next()*(u-c)}}function ft(i,c){const u=parseInt(i.slice(1,3),16),o=parseInt(i.slice(3,5),16),d=parseInt(i.slice(5,7),16);return`rgba(${u},${o},${d},${Math.max(0,Math.min(1,c))})`}function uv(i){const c=Math.max(0,i);return Math.min(1.4,Math.pow(c/2e3,.55))}class dv{constructor(c,u,o,d,m,v,h=.5){nt(this,"ctx");nt(this,"size");nt(this,"accuracy");nt(this,"uniqueness");nt(this,"impact");nt(this,"colorHex");nt(this,"time",0);nt(this,"variant");nt(this,"scale");nt(this,"exp");nt(this,"particles",[]);nt(this,"baseRotation");nt(this,"armSeeds");nt(this,"binaryCenters");nt(this,"jetAxis");nt(this,"tailAngle");const p=c.getContext("2d");if(!p)throw new Error("Canvas 2D context unavailable");this.ctx=p,this.size=c.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,m)),this.impact=Math.max(0,Math.min(1,h)),this.colorHex=v;const g=cv(u);this.variant=g%12;const y=new ov(g),S=uv(o);this.exp=S,this.scale=.2+S*.95;const R=Math.max(3,Math.round(4+S*180));this._buildVariant(y,R),this.baseRotation=y.next()*Math.PI*2}_buildVariant(c,u){const o=this.variant;if(o===0){this.armSeeds=[];for(let m=0;m<2;m++)this.armSeeds.push(c.next()*Math.PI*2);for(let m=0;m<u;m++){const v=m%2,h=c.next(),p=this.armSeeds[v]+h*Math.PI*2.4,g=c.range(-.04,.04)*Math.PI*2,y=p+g,S=(.08+h*.38)*this.size*this.scale;this.particles.push(this._mkParticle(c,S,y,1,1))}}else if(o===1)for(let d=0;d<u;d++){const m=c.range(.34,.42)*this.size*this.scale,v=c.next()*Math.PI*2;this.particles.push(this._mkParticle(c,m,v,1,1))}else if(o===2){const d=[.16,.28,.42];for(let m=0;m<u;m++){const v=m%3,h=(d[v]+c.range(-.015,.015))*this.size*this.scale,p=c.next()*Math.PI*2;this.particles.push(this._mkParticle(c,h,p,1,1))}}else if(o===3){const d=.18*this.size*this.scale;this.binaryCenters=[{x:-d,y:0},{x:d,y:0}];for(let m=0;m<u;m++){const v=m%2,h=c.range(.04,.22)*this.size*this.scale,p=c.next()*Math.PI*2,g=this._mkParticle(c,h,p,1,1);g.binaryCore=v,g.angularVelocity*=v===0?1:-1,this.particles.push(g)}}else if(o===4)for(let d=0;d<u;d++){const m=c.range(.05,.32)*this.size*this.scale,v=c.next()*Math.PI*2,h=c.range(.7,1.3),p=c.range(.7,1.3),g=this._mkParticle(c,m,v,h,p);g.orbitTilt=c.range(0,Math.PI),this.particles.push(g)}else if(o===5){this.jetAxis=c.next()*Math.PI*2;const d=Math.floor(u*.7),m=u-d;for(let v=0;v<d;v++){const h=v%2===0?1:-1,p=c.next(),g=c.range(-.18,.18),y=this._mkParticle(c,p*.44*this.size*this.scale,0,1,1);y.jetSide=h,y.jetProgress=p,y.jetSpread=g,y.jetSpeed=c.range(.15,.35)*.001,y.size=c.range(.6,1.4),this.particles.push(y)}for(let v=0;v<m;v++){const h=c.range(.35,.42)*this.size*this.scale,p=c.next()*Math.PI*2,g=this._mkParticle(c,h,p,1,1);g.isDisk=!0,g.brightness*=.35,this.particles.push(g)}}else if(o===6)for(let d=0;d<u;d++){const m=c.next()*Math.PI*2,v=c.range(.05,.45)*this.size*this.scale,h=this._mkParticle(c,v,m,1,1);h.isNebula=!0,h.driftAngle=c.next()*Math.PI*2,h.driftSpeed=c.range(6e-4,.0014),h.driftPhase=c.next()*Math.PI*2,h.size=c.range(.8,2.2),h.brightness*=.6,this.particles.push(h)}else if(o===7){this.tailAngle=c.next()*Math.PI*2;const d=.1*this.size*this.scale,m=Math.floor(u*.3);for(let h=0;h<m;h++){const p=c.range(0,d),g=c.next()*Math.PI*2,y=this._mkParticle(c,p,g,1,1);y.size=c.range(.8,1.8),this.particles.push(y)}const v=u-m;for(let h=0;h<v;h++){const p=c.next(),g=d+p*.26*this.size*this.scale,y=(1-p*.5)*c.range(-.05,.05)*this.size*this.scale,S=this._mkParticle(c,0,0,1,1);S.isComet=!0,S.cometTailDist=g,S.cometPerp=y,S.cometT=p,S.brightness*=1-p*.6,S.size=(1-p*.5)*c.range(.6,1.2),this.particles.push(S)}}else if(o===8)for(let d=0;d<u;d++){const m=d%3,v=c.range(.3,.42)*this.size*this.scale,h=c.next()*Math.PI*2,p=this._mkParticle(c,v,h,1,1);p.gyroPlane=m,p.gyroAxis=m===0?"z":m===1?"x":"y",this.particles.push(p)}else if(o===9)for(let d=0;d<u;d++){const m=c.range(.06,.42)*this.size*this.scale,h=m/(.42*this.size*this.scale)*4*Math.PI+c.range(-.2,.2),p=this._mkParticle(c,m,h,1,1);p.isMaelstrom=!0,this.particles.push(p)}else if(o===10)for(let d=0;d<u;d++){const m=d/u,v=c.range(.35,.4)*this.size*this.scale,h=m*Math.PI*2+c.range(-.03,.03),p=this._mkParticle(c,v,h,1,1);p.ouroT=m,this.particles.push(p)}else for(let d=0;d<u;d++){const m=d%2,v=c.next(),h=this._mkParticle(c,0,0,1,1);h.isHelix=!0,h.helixStrand=m,h.helixT=v,h.helixSpeed=c.range(.3,.6)*.001,this.particles.push(h)}}_mkParticle(c,u,o,d,m){const v=8e-4+(.42*this.size-u)*4e-5,h=c.next()*Math.PI*2,p=c.range(.05,.3)*this.size;return{baseRadius:u,angle:o,angularVelocity:v*(c.next()>.5?1:.85),size:c.range(.5,1.8),brightness:c.range(.4,1),wobblePhase:c.next()*Math.PI*2,wobbleSpeed:c.range(.5,1.2),ellipX:d,ellipY:m,orbitTilt:0,binaryCore:0,chaosX:Math.cos(h)*p,chaosY:Math.sin(h)*p,chaosDriftPhase:c.next()*Math.PI*2,chaosDriftSpeed:c.range(3e-4,8e-4)}}update(c){this.time+=c}draw(){const{ctx:c,size:u,time:o,accuracy:d,uniqueness:m,impact:v,colorHex:h,variant:p}=this,g=u/2,y=u/2;c.clearRect(0,0,u,u);const S=.4+this.exp*.6,R=d*S,J=m*S,$=v*S,Y=.2+R*.8,w=.3+$*1.9,W=J,Q=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),ne=1-Q,V=c.createRadialGradient(g,y,0,g,y,u*.45);if(V.addColorStop(0,ft(h,.05*Y)),V.addColorStop(.4,ft(h,.015)),V.addColorStop(1,"transparent"),c.fillStyle=V,c.fillRect(0,0,u,u),p===0&&this.armSeeds){const T=o*5e-4*w;for(const Z of this.armSeeds){const z=Z+T;c.beginPath();for(let K=0;K<1;K+=.02){const le=z+K*Math.PI*2.4,F=(.08+K*.38)*u*this.scale,de=g+Math.cos(le)*F,ee=y+Math.sin(le)*F;K===0?c.moveTo(de,ee):c.lineTo(de,ee)}c.strokeStyle=ft(h,.12*Y),c.lineWidth=1,c.stroke()}}for(const T of this.particles){const Z=Math.sin(o*T.wobbleSpeed*.001+T.wobblePhase)*1.2,z=T.baseRadius+Z,K=T.angle+o*T.angularVelocity*w;let le,F;if(p===3&&this.binaryCenters){const ee=this.binaryCenters[T.binaryCore];le=g+ee.x+Math.cos(K)*z,F=y+ee.y+Math.sin(K)*z}else if(p===4){const ee=Math.cos(T.orbitTilt),ae=Math.sin(T.orbitTilt),he=Math.cos(K)*z*T.ellipX,M=Math.sin(K)*z*T.ellipY;le=g+he*ee-M*ae,F=y+he*ae+M*ee}else if(p===5&&T.jetSide!==void 0&&!T.isDisk&&this.jetAxis!==void 0){const ee=(T.jetProgress+o*T.jetSpeed*w)%1,ae=ee*.44*u*this.scale,he=this.jetAxis+Math.PI/2;le=g+Math.cos(this.jetAxis)*ae*T.jetSide+Math.cos(he)*T.jetSpread*ae,F=y+Math.sin(this.jetAxis)*ae*T.jetSide+Math.sin(he)*T.jetSpread*ae,T._fadeMul=Math.sin(ee*Math.PI)*.9+.1}else if(p===6&&T.isNebula){const ee=o*T.driftSpeed*w,ae=Math.sin(ee+T.driftPhase)*2;le=g+Math.cos(T.angle+ee*.3)*z+Math.cos(T.driftAngle)*ae,F=y+Math.sin(T.angle+ee*.3)*z+Math.sin(T.driftAngle)*ae}else if(p===7&&T.isComet&&this.tailAngle!==void 0){const ee=(T.cometT+o*3e-4*w)%1,ae=T.cometTailDist+ee*.06*u*this.scale,he=this.tailAngle+Math.PI/2;le=g+Math.cos(this.tailAngle)*ae+Math.cos(he)*T.cometPerp,F=y+Math.sin(this.tailAngle)*ae+Math.sin(he)*T.cometPerp}else if(p===8&&T.gyroAxis){const ee=o*1e-4*w;T.gyroAxis==="z"?(le=g+Math.cos(K)*z,F=y+Math.sin(K)*z*.3):T.gyroAxis==="x"?(le=g+Math.cos(K)*z*.3+Math.sin(ee)*z*.1,F=y+Math.sin(K)*z):(le=g+Math.sin(K+ee)*z*.6,F=y+Math.cos(K+ee)*z*.8)}else if(p===9){const ee=(o*5e-4*w+T.wobblePhase)%1,ae=z*(1-ee*.85);le=g+Math.cos(K)*ae,F=y+Math.sin(K)*ae,T._fadeMul=1-ee}else if(p===10&&T.ouroT!==void 0){const ee=(T.ouroT+o*3e-4*w)%1,ae=ee*Math.PI*2;le=g+Math.cos(ae)*z,F=y+Math.sin(ae)*z;const he=Math.cos(ee*Math.PI*2)*.5+.5;T._fadeMul=.3+he*.9}else if(p===11&&T.helixT!==void 0){const ee=(T.helixT+o*T.helixSpeed*w)%1,ae=(ee-.5)*.65*u*this.scale,he=T.helixStrand===0?0:Math.PI,M=.15*u*this.scale,E=Math.sin(ee*Math.PI*3+he)*M;le=g+E,F=y+ae,T._fadeMul=.4+(Math.cos(ee*Math.PI*3+he)+1)/2*.6}else le=g+Math.cos(K)*z*T.ellipX,F=y+Math.sin(K)*z*T.ellipY;if(ne>.01){const ee=o*T.chaosDriftSpeed,ae=Math.cos(ee+T.chaosDriftPhase)*2,he=Math.sin(ee*1.13+T.chaosDriftPhase)*2,M=g+T.chaosX+ae,E=y+T.chaosY+he;le=M*ne+le*Q,F=E*ne+F*Q}const de=T._fadeMul!==void 0?T._fadeMul:1;if(p<=4&&Q>.5){const ee=2+Math.floor(v*3);for(let ae=0;ae<ee;ae++){const he=T.angularVelocity*w*(ae+1)*80,M=K-he;let E,L;if(p===3&&this.binaryCenters){const ce=this.binaryCenters[T.binaryCore];E=g+ce.x+Math.cos(M)*z,L=y+ce.y+Math.sin(M)*z}else if(p===4){const ce=Math.cos(T.orbitTilt),fe=Math.sin(T.orbitTilt),j=Math.cos(M)*z*T.ellipX,q=Math.sin(M)*z*T.ellipY;E=g+j*ce-q*fe,L=y+j*fe+q*ce}else E=g+Math.cos(M)*z*T.ellipX,L=y+Math.sin(M)*z*T.ellipY;const te=(1-ae/ee)*.3*T.brightness*Y*Q;c.beginPath(),c.arc(E,L,T.size*(1-ae*.25),0,Math.PI*2),c.fillStyle=ft(h,te),c.fill()}}else if(p===6&&T.isNebula){const ee=T.size*3,ae=c.createRadialGradient(le,F,0,le,F,ee);ae.addColorStop(0,ft(h,T.brightness*Y*.4)),ae.addColorStop(1,"transparent"),c.fillStyle=ae,c.beginPath(),c.arc(le,F,ee,0,Math.PI*2),c.fill()}c.beginPath(),c.arc(le,F,T.size,0,Math.PI*2),c.fillStyle=ft(h,T.brightness*Y*de),c.fill()}if(W>.05)for(let Z=0;Z<3;Z++){const z=(o*7e-4*W+Z*.33)%1;if(z>.5)continue;const K=(Z*1.618*Math.PI+o*1e-4)%(Math.PI*2),le=u*.5*(1-z*1.6);if(le<3)continue;const F=g+Math.cos(K)*le,de=y+Math.sin(K)*le,ee=z<.2?z/.2:1-(z-.2)/.3,ae=5+(1-z)*4,he=c.createRadialGradient(F,de,0,F,de,ae);he.addColorStop(0,ft("#ffffff",ee*.95)),he.addColorStop(.3,ft(h,ee*.7)),he.addColorStop(1,"transparent"),c.fillStyle=he,c.beginPath(),c.arc(F,de,ae,0,Math.PI*2),c.fill()}if(p!==3){const T=.9+.1*Math.sin(o*.003),Z=(1+this.exp*9+d*2)*this.scale,z=Math.min(Z*(3+v*2),u*.4),K=c.createRadialGradient(g,y,0,g,y,z);K.addColorStop(0,ft("#ffffff",.95*T*Y)),K.addColorStop(.2,ft(h,.75*T*Y)),K.addColorStop(.5,ft(h,.2*Y)),K.addColorStop(1,"transparent"),c.fillStyle=K,c.beginPath(),c.arc(g,y,z,0,Math.PI*2),c.fill(),c.beginPath(),c.arc(g,y,Z*T,0,Math.PI*2),c.fillStyle=ft("#ffffff",.95),c.fill()}else if(this.binaryCenters)for(const T of this.binaryCenters){const Z=g+T.x,z=y+T.y,K=(.8+this.exp*5+d*1.5)*this.scale,le=Math.min(K*3.5,u*.22),F=c.createRadialGradient(Z,z,0,Z,z,le);F.addColorStop(0,ft("#ffffff",.9*Y)),F.addColorStop(.3,ft(h,.6*Y)),F.addColorStop(1,"transparent"),c.fillStyle=F,c.beginPath(),c.arc(Z,z,le,0,Math.PI*2),c.fill(),c.beginPath(),c.arc(Z,z,K,0,Math.PI*2),c.fillStyle=ft("#ffffff",.9),c.fill()}}}const Sl=globalThis,ca=new Set;let Nl=0,oa=0;const fv=100;function gh(i){const c=oa===0?16:Math.min(fv,Math.max(0,i-oa));oa=i;for(const u of ca)try{u(c)}catch(o){console.error("[AnimationScheduler] subscriber threw, continuing",o)}ca.size>0?Nl=Sl.requestAnimationFrame(gh):(Nl=0,oa=0)}function mv(){Nl===0&&(oa=0,Nl=Sl.requestAnimationFrame(gh))}function hv(){Nl!==0&&(Sl.cancelAnimationFrame&&Sl.cancelAnimationFrame(Nl),Nl=0,oa=0)}function xv(){return Sl.matchMedia?Sl.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}function yh(i){if(!Sl.requestAnimationFrame)return()=>{};if(xv())return()=>{};ca.add(i),ca.size===1&&mv();let c=!1;return function(){c||(c=!0,ca.delete(i),ca.size===0&&hv())}}function fs({agentId:i,size:c=64,animate:u=!0,signals:o=0,accuracy:d=.5,uniqueness:m=.5,impact:v=.5}){const h=k.useRef(null),p=k.useRef(null),g=k.useRef(!0),y=k.useRef(u);return y.current=u,k.useEffect(()=>{const S=h.current;if(!S)return;S.width=c*2,S.height=c*2;const R=S.getContext("2d");if(!R)return;R.scale(2,2);const J=en(i),$=new dv(S,i,o,d,m,J,v);p.current=$,$.draw();const Y=yh(w=>{g.current&&y.current&&($.update(w),$.draw())});return()=>{Y(),p.current=null}},[i,c,o,d,m,v]),k.useEffect(()=>{const S=h.current;if(!S)return;const R=new IntersectionObserver(([J])=>{g.current=J.isIntersecting},{threshold:.1});return R.observe(S),()=>R.disconnect()},[]),a.jsx("canvas",{ref:h,"aria-hidden":"true",className:"shrink-0",style:{width:c,height:c,borderRadius:"50%"}})}function pv(i){return i.hallucinationsCaught>0?"catch":i.disputed>0?"mixed":i.confirmed>0?"trust":null}function vv(i){return Math.max(1,Math.min(2.5,1+i*.15))}function ds(i,c){return i<=c?`${i}::${c}`:`${c}::${i}`}const gv=new Set(["agreement","unique_confirmed","impl_peer_approved"]),yv=new Set(["disagreement","impl_peer_rejected"]),bv=new Set(["hallucination_caught"]);function jv(i){const c=new Map,u=new Map;for(const o of i)if(!o.retracted)for(const d of o.signals){if(!d.counterpartId||!d.agentId)continue;const m=gv.has(d.signal),v=yv.has(d.signal),h=bv.has(d.signal);if(!m&&!v&&!h)continue;const p=ds(d.agentId,d.counterpartId);let g=c.get(p);g||(g={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:o.timestamp},c.set(p,g)),m&&(g.confirmed+=1),v&&(g.disputed+=1),h&&(g.hallucinationsCaught+=1);let y=u.get(p);y||(y=new Set,u.set(p,y)),y.has(o.taskId)||(y.add(o.taskId),g.rounds+=1),o.timestamp>g.lastInteraction&&(g.lastInteraction=o.timestamp)}return c}function Ui(i){return i>=2e3?84:i>=800?72:i>=200?60:48}function Nv(i,c,u){var y;const o={x:c/2,y:u/2},m=Math.max(80,Math.min(c,u)/2-24),v=new Map;if(i.length===0)return v;const h=[...i].sort((S,R)=>{var Y,w;const J=((Y=R.scores)==null?void 0:Y.accuracy)??0,$=((w=S.scores)==null?void 0:w.accuracy)??0;return J!==$?$-J:S.id.localeCompare(R.id)}),p=h.length,g=Math.PI*(3-Math.sqrt(5));for(let S=0;S<p;S++){const R=h[S],J=Sv(((y=R.scores)==null?void 0:y.accuracy)??0,0,1),$=Math.max(m*.22,(1-J)*m),Y=-Math.PI/2+S*g;v.set(R.id,{x:o.x+$*Math.cos(Y),y:o.y+$*Math.sin(Y),role:"fleet",angle:Y})}return v}function Sv(i,c,u){return Math.min(Math.max(i,c),u)}function Pm(i){let c=i>>>0;return()=>{c=c+1831565813>>>0;let u=c;return u=Math.imul(u^u>>>15,u|1),u^=u+Math.imul(u^u>>>7,u|61),((u^u>>>14)>>>0)/4294967296}}function kv({width:i,height:c,agentPositions:u}){const o=k.useRef(null),d=k.useRef([]),m=k.useRef([]);k.useEffect(()=>{if(i<=0||c<=0)return;const h=Pm(7311),p=170;d.current=Array.from({length:p},()=>{const g=h();let y,S;return g<.07?(y=2+h()*.6,S=.75+h()*.25):g<.32?(y=1.2+h()*.4,S=.45+h()*.35):(y=.5+h()*.4,S=.25+h()*.3),{x:h()*i,y:h()*c,baseR:y,r:y,baseO:S,o:S,consumed:null,phase:h()*Math.PI*2,twinkleHz:.25+h()*1.4}})},[i,c]),k.useEffect(()=>{if(i<=0||c<=0)return;const h=Pm(919),p=60,g=90,y=1.5,S=1.8;let R=0;const $=yh(Y=>{const w=Y/1e3;R+=w;const W=d.current,Q=m.current;for(let ne=0;ne<W.length;ne++){const V=W[ne];if(V.consumed===null)for(let Z=0;Z<u.length;Z++){const z=u[Z].x-V.x,K=u[Z].y-V.y;if(z*z+K*K<p*p){V.consumed=Z;break}}if(V.consumed===null){const Z=.8+.35*Math.sin(R*V.twinkleHz*Math.PI*2+V.phase);V.o=Math.min(1,V.baseO*Z)}if(V.consumed!==null){const Z=u[V.consumed];if(Z){const z=Z.x-V.x,K=Z.y-V.y,le=Math.sqrt(z*z+K*K)||1,F=Math.min(le,g*w);V.x+=z/le*F,V.y+=K/le*F,V.o=Math.max(0,V.o-y*w),V.r=Math.max(0,V.r-S*w)}if(V.o<=.01||V.r<=.1){let z=0,K=0,le=!1;for(let F=0;F<8;F++){z=h()*i,K=h()*c,le=!0;for(const de of u){const ee=de.x-z,ae=de.y-K;if(ee*ee+ae*ae<p*p*1.5){le=!1;break}}if(le)break}V.x=z,V.y=K,V.r=V.baseR,V.o=V.baseO,V.consumed=null}}const T=Q[ne];T&&(T.setAttribute("cx",String(V.x)),T.setAttribute("cy",String(V.y)),T.setAttribute("r",String(V.r)),T.setAttribute("opacity",String(V.o)))}});return()=>$()},[i,c,u]);const v=d.current;return a.jsx("svg",{ref:o,width:"100%",height:c,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:v.map((h,p)=>a.jsx("circle",{ref:g=>{m.current[p]=g},cx:h.x,cy:h.y,r:h.r,fill:"#F2EDE3",opacity:h.o},p))})}function _v({variant:i}){const c=(()=>{switch(i){case 1:return a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M 19 24 L 25 24",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("path",{d:"M 20 31 Q 28 36 36 31",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})]});case 2:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"23",r:"1.6",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"23",r:"1.6",fill:"#F2EDE3"}),a.jsx("path",{d:"M 19 30 Q 28 38 37 30 Q 28 33 19 30 Z",fill:"#F2EDE3",opacity:"0.92"})]});case 3:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"24",r:"1.4",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.4",fill:"#F2EDE3"}),a.jsx("path",{d:"M 22 30 Q 26 33 28 30 Q 30 33 34 30",stroke:"#F2EDE3",strokeWidth:"1.4",strokeLinecap:"round",fill:"none"})]});default:return a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"22",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("circle",{cx:"34",cy:"24",r:"1.5",fill:"#F2EDE3"}),a.jsx("path",{d:"M 20 31 Q 28 36 36 31",stroke:"#F2EDE3",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"})]})}})();return a.jsx("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{position:"absolute",top:0,left:0,animation:"orch-smile-pop 900ms ease-out forwards",pointerEvents:"none"},"aria-hidden":!0,children:c})}function Ev(){return a.jsx("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{position:"absolute",top:0,left:0,animation:"orch-ripple 700ms ease-out forwards",pointerEvents:"none"},"aria-hidden":!0,children:a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"none",stroke:"var(--accent)",strokeWidth:"1.2"})})}function Tv({width:i,height:c,hideLabels:u=!1}){const o=i/2,d=c/2,v=Math.max(80,Math.min(i,c)/2-40),h=[{r:v,accLabel:"0%"},{r:v*.75,accLabel:"25%"},{r:v*.5,accLabel:"50%"},{r:v*.25,accLabel:"75%"}];return a.jsx("svg",{width:"100%",height:c,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:h.map(({r:p,accLabel:g})=>a.jsxs("g",{children:[a.jsx("circle",{cx:o,cy:d,r:p,fill:"none",stroke:"var(--border-strong)",strokeDasharray:"2 4",opacity:.5}),!u&&a.jsx("text",{x:o+6,y:d-p-4,fontFamily:"var(--font-mono)",fontSize:"9",fill:"var(--ink-3)",letterSpacing:"0.06em",children:g})]},g))})}function Mv(i,c,u,o,d){const m={x:o/2,y:d/2},v=new Map;v.set(i,{x:m.x,y:m.y,role:"center"});const h=[];for(const J of c){if(J===i)continue;const $=u.get(ds(i,J));$&&h.push({id:J,rel:$})}const p=Math.max(1,...h.map(J=>J.rel.rounds)),g=Math.max(120,Math.min(o,d)*.2),y=Math.min(o,d)*.42,S=h.slice().sort((J,$)=>J.id.localeCompare($.id)),R=S.length;for(let J=0;J<R;J++){const{id:$,rel:Y}=S[J],w=J/Math.max(1,R)*Math.PI*2-Math.PI/2,W=Y.rounds/p,Q=y-W*(y-g);v.set($,{x:m.x+Q*Math.cos(w),y:m.y+Q*Math.sin(w),role:"peer"})}for(const J of c)v.has(J)||v.set(J,{x:m.x,y:m.y,role:"hidden"});return v}function wv({agents:i,peerRelationships:c,selectedAgentId:u,onSelectAgent:o,height:d=420}){if(i.length===0)return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)",color:"var(--stage-text-dim)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-2 h-section",children:"No agents configured"}),a.jsxs("div",{className:"font-mono text-xs",children:["Run ",a.jsx("code",{children:"gossip_setup"})," to spin up the fleet."]})]})});if(i.length===1){const m=i[0];return a.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border",style:{height:d,background:"var(--stage-bg)",borderColor:"var(--border)"},children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-block",children:a.jsx(fs,{agentId:m.id,signals:m.scores.signals,accuracy:m.scores.accuracy,uniqueness:m.scores.uniqueness,impact:m.scores.impactScore,size:Ui(m.scores.signals)})}),a.jsx("div",{className:"mt-3 font-mono text-xs",style:{color:"var(--stage-text-dim)"},children:"Dispatch a task to see the network form."})]})})}return a.jsx(Av,{agents:i,peerRelationships:c,selectedAgentId:u,onSelectAgent:o,height:d})}function Av({agents:i,peerRelationships:c,selectedAgentId:u,onSelectAgent:o,height:d=420}){const m=k.useRef(null),[v,h]=k.useState(800),[p,g]=k.useState(d),[y,S]=k.useState(0);k.useEffect(()=>{const w=m.current;if(!w)return;const W=new ResizeObserver(([Q])=>{const ne=Q.contentRect.width,V=Q.contentRect.height;ne>0&&h(ne),V>0&&g(V)});return W.observe(w),()=>W.disconnect()},[]);const R=k.useMemo(()=>{const w=i.map(W=>W.id);return u&&w.includes(u)?Mv(u,w,c,v,p):Nv(i,v,p)},[i,c,u,v,p]),J=k.useMemo(()=>{if(!u)return[];const w=R.get(u);if(!w)return[];const W=[];for(const ne of i){if(ne.id===u)continue;const V=R.get(ne.id);if(!V||V.role!=="peer")continue;const T=c.get(ds(u,ne.id));if(!T)continue;const Z=pv(T);Z&&W.push({peerId:ne.id,x1:w.x,y1:w.y,x2:V.x,y2:V.y,cls:Z,width:vv(T.rounds),rounds:T.rounds})}const Q={mixed:0,trust:1,catch:2};return W.sort((ne,V)=>Q[ne.cls]-Q[V.cls]),W},[i,c,u,R]),$=u?J.length:0,Y=k.useMemo(()=>{const w=[];for(const W of i){const Q=R.get(W.id);Q&&w.push({x:Q.x,y:Q.y})}return w},[i,R]);return a.jsxs("div",{ref:m,className:"relative overflow-hidden rounded-lg border",style:{minHeight:d,height:"100%",background:"#14120F",borderColor:"#2B2823","--stage-bg":"#14120F","--stage-text-dim":"#B8B0A1","--stage-grid":"rgba(255,255,255,0.03)"},onClick:()=>o(null),children:[a.jsx(kv,{width:v,height:p,agentPositions:Y}),a.jsx(Tv,{width:v,height:p,hideLabels:!!u}),a.jsx("div",{className:"absolute z-10 flex items-center gap-2 h-section",style:{top:10,left:12,pointerEvents:"none",color:"var(--stage-text-dim)",background:"color-mix(in oklch, var(--stage-bg) 70%, transparent)",padding:"2px 6px",borderRadius:"3px"},children:u?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Focus"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:u}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:$}),a.jsxs("span",{style:{opacity:.7},children:["peer",$===1?"":"s"]})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"Fleet"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{color:"#F2EDE3"},children:i.length}),a.jsx("span",{style:{opacity:.7},children:"agents"}),a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{style:{opacity:.7},children:"click an avatar to focus"})]})}),!u&&a.jsx("div",{className:"absolute z-10 h-section",style:{bottom:12,right:12,fontSize:"10px",color:"var(--stage-text-dim)",background:"color-mix(in oklch, var(--stage-bg) 70%, transparent)",padding:"2px 6px",borderRadius:"3px",pointerEvents:"none"},children:"closer to center = higher accuracy"}),a.jsx("svg",{width:"100%",height:p,style:{position:"absolute",inset:0,pointerEvents:"none"},children:J.map(w=>{const W=i.find(E=>E.id===u),Q=i.find(E=>E.id===w.peerId);if(!W||!Q)return null;const ne=Ui(W.scores.signals)/2,V=Ui(Q.scores.signals)/2,T=w.x2-w.x1,Z=w.y2-w.y1,z=Math.max(1,Math.hypot(T,Z)),K=T/z,le=Z/z,F=w.x1+K*ne,de=w.y1+le*ne,ee=w.x2-K*V,ae=w.y2-le*V,he=w.cls==="trust"?"var(--success)":w.cls==="mixed"?"var(--warn)":"var(--danger)",M=w.cls==="mixed"?"8,2":void 0;return a.jsx("line",{x1:F,y1:de,x2:ee,y2:ae,stroke:he,strokeWidth:w.width,strokeDasharray:M,strokeLinecap:"round",style:{opacity:.55,transition:"opacity 200ms cubic-bezier(0.4,0,0.2,1)"}},w.peerId)})}),u&&a.jsxs("div",{className:"absolute z-10 flex flex-col gap-1 rounded font-mono text-[10px]",style:{bottom:10,left:12,color:"var(--stage-text-dim)",pointerEvents:"none"},children:[a.jsx(ro,{stroke:"var(--success)",label:"Trust"}),a.jsx(ro,{stroke:"var(--warn)",label:"Mixed",dash:"8,2"}),a.jsx(ro,{stroke:"var(--danger)",label:"Caught"})]}),!u&&p>0&&a.jsxs("div",{className:"absolute z-[1] -translate-x-1/2 -translate-y-1/2",style:{left:v/2,top:p/2,cursor:"pointer"},onClick:w=>{w.stopPropagation(),S(W=>W+1)},title:y>=10?"♥":y>=5?"ok ok":"orchestrator",children:[a.jsxs("svg",{width:"56",height:"56",viewBox:"0 0 56 56",style:{display:"block",pointerEvents:"none"},"aria-hidden":!0,children:[a.jsx("circle",{cx:"28",cy:"28",r:"26",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.6",opacity:"0.35"}),a.jsx("circle",{cx:"28",cy:"28",r:"22",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.4",opacity:"0.25"}),a.jsx("circle",{cx:"28",cy:"28",r:"12",fill:"none",stroke:"#F2EDE3",strokeWidth:"1.1",opacity:"0.75"}),a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"#000"}),a.jsx("circle",{cx:"28",cy:"28",r:"9",fill:"none",stroke:"var(--border-strong)",strokeWidth:"0.5",opacity:"0.6"})]}),y>0&&a.jsx(_v,{variant:(y-1)%4},y),y>0&&a.jsx(Ev,{},`ripple-${y}`),a.jsx("div",{className:"font-mono",style:{position:"absolute",top:"calc(100% + 4px)",left:"50%",transform:"translateX(-50%)",fontSize:"9px",letterSpacing:"0.18em",textTransform:"uppercase",color:y>=10?"var(--accent)":"var(--stage-text-dim)",whiteSpace:"nowrap",opacity:.7,pointerEvents:"none",transition:"color 400ms ease-out"},children:y>=10?"♥ orchestrator ♥":"orchestrator"})]}),i.map(w=>{const W=R.get(w.id);if(!W)return null;const Q=Ui(w.scores.signals),ne=W.role==="center",V=W.role==="hidden",T=W.role==="peer",Z=V?0:1,z=ne?"#F2EDE3":"var(--stage-text-dim)",K=W.angle??Math.PI/2,le=Q/2+14,F=Math.cos(K)*le,de=Math.sin(K)*le,ee=Math.abs(Math.cos(K))>.7?Math.cos(K)>0?"left":"right":"center";return a.jsxs("button",{type:"button",onClick:ae=>{ae.stopPropagation(),o(w.id)},className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:W.x,top:W.y,opacity:Z,pointerEvents:V?"none":"auto",border:"none",background:"transparent",padding:0,cursor:"pointer",transition:"left 320ms cubic-bezier(0.4,0,0.2,1), top 320ms cubic-bezier(0.4,0,0.2,1), opacity 200ms cubic-bezier(0.4,0,0.2,1)"},"aria-label":`Select agent ${w.id}`,title:w.id,children:[a.jsx("div",{className:"rounded-full",style:{width:Q,height:Q,boxShadow:ne?"0 0 0 1.5px rgba(242, 237, 227, 0.45), 0 0 0 6px color-mix(in oklch, var(--border-strong) 18%, transparent), 0 0 28px -4px color-mix(in oklch, var(--border-strong) 35%, transparent)":void 0,transition:"box-shadow 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(fs,{agentId:w.id,signals:w.scores.signals,accuracy:w.scores.accuracy,uniqueness:w.scores.uniqueness,impact:w.scores.impactScore,size:Q})}),a.jsx("div",{className:"absolute font-mono text-[10px] font-bold tracking-wider",style:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${F}px), calc(-50% + ${de}px))${ee==="left"?" translateX(calc(50% + 4px))":ee==="right"?" translateX(calc(-50% - 4px))":""}`,color:z,textAlign:ee==="right"?"right":ee==="left"?"left":"center",whiteSpace:"nowrap",pointerEvents:"none",transition:"color 200ms cubic-bezier(0.4,0,0.2,1), transform 320ms cubic-bezier(0.4,0,0.2,1)"},children:w.id}),T&&a.jsx("div",{className:"font-mono text-[9px]",style:{color:"var(--stage-text-dim)",textAlign:"center",whiteSpace:"nowrap",marginTop:2},children:(()=>{const ae=c.get(ds(u??"",w.id));return ae?`${ae.rounds} round${ae.rounds===1?"":"s"}`:""})()})]},w.id)})]})}function ro({stroke:i,label:c,dash:u}){return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("svg",{width:"22",height:"6",style:{display:"block"},children:a.jsx("line",{x1:"0",y1:"3",x2:"22",y2:"3",stroke:i,strokeWidth:"1.5",strokeDasharray:u})}),a.jsx("span",{children:c})]})}function eh(i){const c=new URLSearchParams(i).get("agent");return c&&c.length>0?c:null}function Cv(i,c,u){const o=new URLSearchParams(c);u===null?o.delete("agent"):o.set("agent",u);const d=o.toString();return d.length>0?`${i}?${d}`:i}function bh(i){const c=globalThis;if(typeof c.window>"u")return;const u=c.window,o=Cv(u.location.pathname,u.location.search,i);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function zv({selectedAgent:i,agents:c,peerRelationships:u,height:o=420}){return a.jsx("aside",{className:"flex-shrink-0 overflow-y-auto rounded-lg border",style:{width:320,minHeight:o,background:"var(--surface-elev)",borderColor:"var(--border)"},"aria-label":i?`Agent detail: ${i.id}`:"Fleet summary",children:i?a.jsx(Ov,{agent:i,peerRelationships:u,agents:c}):a.jsx(Dv,{agents:c,peerRelationships:u})})}function Dv({agents:i,peerRelationships:c}){const u=[...i].filter(m=>m.scores.signals>0).sort((m,v)=>v.scores.accuracy-m.scores.accuracy).slice(0,3),o=[];for(const[m,v]of c.entries())if(v.hallucinationsCaught>0){const[h,p]=m.split("::");o.push({pair:[h,p],catches:v.hallucinationsCaught,ts:v.lastInteraction})}o.sort((m,v)=>new Date(v.ts).getTime()-new Date(m.ts).getTime());const d=o.slice(0,5);return a.jsxs("div",{className:"flex h-full flex-col p-4",children:[a.jsx("div",{className:"mb-2 h-section",children:"Fleet at a glance"}),a.jsx("p",{className:"mb-4 font-mono text-[12px]",style:{color:"var(--ink-4)"},children:"Click a node to see detail."}),a.jsx(th,{label:"Top performers",tone:"success",children:u.length===0?a.jsx(ko,{text:"No agent has logged a signal yet."}):u.map(m=>a.jsxs("button",{type:"button",onClick:()=>bh(m.id),className:"group flex w-full items-center gap-2 rounded px-2 py-2 text-left transition hover:[background:color-mix(in_oklch,var(--accent)_8%,transparent)]",style:{cursor:"pointer"},children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[12px] font-semibold",style:{color:"var(--text)"},children:m.id}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[Math.round(m.scores.accuracy*100),"% accuracy · ",m.scores.signals," signals"]})]}),a.jsx("span",{className:"opacity-0 transition group-hover:opacity-100 font-mono text-[11px]",style:{color:"var(--accent)"},children:"→"})]},m.id))}),a.jsx(th,{label:"Recent hallucination catches",tone:"danger",children:d.length===0?a.jsx(ko,{text:"No catches in the active window."}):d.map(m=>a.jsxs("div",{className:"rounded px-2 py-2",children:[a.jsxs("div",{className:"font-mono text-[12px]",style:{color:"var(--text)"},children:[a.jsx("span",{style:{color:"var(--danger)"},children:"◆"})," ",m.pair[0]," ↔ ",m.pair[1]]}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[m.catches," caught · ",Rv(m.ts)]})]},`${m.pair[0]}::${m.pair[1]}`))})]})}function th({label:i,tone:c,children:u}){const o=c==="success"?"var(--success)":c==="danger"?"var(--danger)":"var(--ink-4)";return a.jsxs("section",{className:"mb-4",children:[a.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5 h-section",children:[a.jsx("span",{style:{width:4,height:4,borderRadius:"50%",background:o,display:"inline-block",flexShrink:0}}),i]}),a.jsx("div",{className:"space-y-1",children:u})]})}function ko({text:i}){return a.jsx("div",{className:"px-2 py-1.5 font-mono text-[11px]",style:{color:"var(--ink-4)"},children:i})}function Rv(i){const c=new Date(i).getTime(),u=Date.now(),o=Math.max(0,Math.floor((u-c)/1e3));return o<60?`${o}s ago`:o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:`${Math.floor(o/86400)}d ago`}function Ov({agent:i,peerRelationships:c,agents:u}){const o=i.scores.bench.state==="benched"?{label:"BENCHED",color:"var(--danger)"}:i.native?{label:"READY",color:"var(--success)"}:i.online?{label:"ONLINE",color:"var(--success)"}:{label:"OFFLINE",color:"var(--ink-3)"},d=[];for(const v of u){if(v.id===i.id)continue;const h=c.get(ds(i.id,v.id));if(!h)continue;const p=h.confirmed+h.disputed+h.hallucinationsCaught;d.push({other:v.id,rel:h,total:p})}d.sort((v,h)=>h.total-v.total);const m=d.slice(0,3);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 h-section",style:{color:o.color,borderBottom:"1px solid var(--border)",background:`color-mix(in oklch, ${o.color} 6%, transparent)`},children:[a.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:o.color,display:"inline-block"}}),o.label]}),a.jsxs("div",{className:"flex items-center gap-3 px-4 pt-4",children:[a.jsx(fs,{agentId:i.id,signals:i.scores.signals,accuracy:i.scores.accuracy,uniqueness:i.scores.uniqueness,impact:i.scores.impactScore,size:48}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-[14px] font-semibold",style:{color:"var(--ink)"},children:i.id}),a.jsx("div",{className:"truncate font-mono text-[11px]",style:{color:"var(--ink-3)"},children:i.model})]})]}),a.jsxs("div",{className:"mx-4 mt-4 grid grid-cols-2 gap-2",children:[a.jsx(Ci,{label:"Accuracy",value:`${Math.round(i.scores.accuracy*100)}%`}),a.jsx(Ci,{label:"Reliability",value:i.scores.taskCompletionRate==null?"—":`${Math.round(i.scores.taskCompletionRate*100)}%`}),a.jsx(Ci,{label:"Signals",value:i.scores.signals.toLocaleString()}),a.jsx(Ci,{label:"Impact",value:`${Math.round(i.scores.impactScore*100)}%`})]}),a.jsxs("div",{className:"mt-4 px-4",children:[a.jsx("div",{className:"mb-1.5 h-section",children:"Top peers"}),m.length===0?a.jsx(ko,{text:"No cross-review history yet."}):a.jsx("div",{className:"space-y-1",children:m.map(({other:v,rel:h})=>a.jsxs("div",{className:"rounded px-2 py-1.5",style:{background:"color-mix(in oklch, var(--surface) 50%, transparent)"},children:[a.jsx("div",{className:"truncate font-mono text-[12px]",style:{color:"var(--ink)"},children:v}),a.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[h.confirmed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--success)"},children:"✓"})," ",h.confirmed]}),h.disputed>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--warn)"},children:"≠"})," ",h.disputed]}),h.hallucinationsCaught>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--danger)"},children:"◆"})," ",h.hallucinationsCaught]}),a.jsxs("span",{style:{opacity:.6},children:["· ",h.rounds," rounds"]})]})]},v))})]}),i.skills.length>0&&a.jsxs("div",{className:"mt-4 px-4",children:[a.jsxs("div",{className:"mb-1.5 h-section",children:["Skills ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.skills.length})]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:i.skills.slice(0,6).map(v=>a.jsx("span",{className:"rounded-sm border px-1.5 py-0.5 font-mono text-[11px]",style:{borderColor:"var(--border)",color:"var(--ink-3)"},children:v},v))})]}),a.jsxs("div",{className:"mt-auto flex flex-col gap-1.5 border-t p-3",style:{borderColor:"var(--border)"},children:[a.jsx(co,{label:"Open dispatch log",kbd:"⏎",href:`/agent/${encodeURIComponent(i.id)}`}),a.jsx(co,{label:"View skill graph",kbd:"G",href:`/agent/${encodeURIComponent(i.id)}#skills`,disabled:i.skills.length===0}),a.jsx(co,{label:"Dispatch consensus",kbd:"⌘D",href:"#",disabled:!0})]})]})}function Ci({label:i,value:c}){return a.jsxs("div",{className:"rounded px-2 py-1.5",style:{background:"color-mix(in oklch, var(--surface) 50%, transparent)"},children:[a.jsx("div",{className:"h-section",children:i}),a.jsx("div",{className:"mt-0.5 font-mono text-[16px] font-medium tabular-nums",style:{color:"var(--text)"},children:c})]})}function co({label:i,kbd:c,href:u,disabled:o}){return a.jsxs("a",{href:o?void 0:`/dashboard${u}`,"aria-disabled":o,tabIndex:o?-1:void 0,className:"flex items-center justify-between rounded px-2 py-2 font-mono text-[12px] transition",style:{background:o?"transparent":"color-mix(in oklch, var(--surface) 50%, transparent)",color:o?"var(--ink-4)":"var(--text)",pointerEvents:o?"none":"auto",opacity:o?.5:1},children:[a.jsx("span",{children:i}),a.jsx("kbd",{className:"rounded border px-1 py-0.5 font-mono text-[10px]",style:{borderColor:"var(--border)",background:"var(--surface-sunk)",color:"var(--ink-3)"},children:c})]})}let Gt=null,zi=3e3,oo=null;const _o=new Set;function jh(){if((Gt==null?void 0:Gt.readyState)===WebSocket.OPEN||(Gt==null?void 0:Gt.readyState)===WebSocket.CONNECTING)return;const i=location.protocol==="https:"?"wss:":"ws:";Gt=new WebSocket(`${i}//${location.host}/dashboard/ws`),Gt.onopen=()=>{zi=3e3},Gt.onmessage=c=>{try{const u=JSON.parse(c.data);_o.forEach(o=>o(u))}catch{}},Gt.onclose=()=>{Gt=null,oo&&clearTimeout(oo),oo=setTimeout(()=>{zi=Math.min(zi*1.5,3e4),jh()},zi)},Gt.onerror=()=>{}}function Nh(i){return _o.add(i),()=>_o.delete(i)}function Sh(i){const c=k.useRef(i);c.current=i,k.useEffect(()=>(jh(),Nh(u=>c.current(u))),[])}const Uv=6e4;function qv(){const[i,c]=k.useState(null),[u,o]=k.useState(null),d=k.useRef(null),m=()=>{c(null),o(null),d.current!=null&&(window.clearTimeout(d.current),d.current=null)};if(Sh(h=>{if(h.type==="task_dispatched"){c(h.taskId),o(h.agentId),d.current!=null&&window.clearTimeout(d.current),d.current=window.setTimeout(m,Uv);return}if(h.type==="consensus_complete"||h.type==="task_completed"||h.type==="task_failed"){if(h.taskId!==i)return;m()}}),k.useEffect(()=>()=>m(),[]),i===null)return null;const v=i.slice(0,8);return a.jsxs("div",{role:"status","aria-live":"polite",className:"flex items-center gap-3 rounded-md border px-3 py-2 font-mono text-[11px]",style:{background:"color-mix(in oklch, var(--info) 8%, transparent)",borderColor:"color-mix(in oklch, var(--info) 30%, transparent)",color:"var(--text)",animation:"beat-pulse-narrative calc(var(--beat) * 2) ease-in-out infinite"},children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:"var(--info)",boxShadow:"0 0 6px var(--info)"}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"Round in flight"}),a.jsx("span",{className:"font-bold",style:{color:"var(--info)"},children:v}),u&&a.jsxs("span",{style:{color:"var(--text-dim)"},children:["→ ",a.jsx("span",{style:{color:"var(--text)"},children:u})]}),a.jsx("button",{type:"button",onClick:()=>{const h=document.getElementById("consensus-rounds-section");h&&h.scrollIntoView({behavior:"smooth",block:"start"})},className:"ml-auto rounded px-1.5 py-0.5 font-mono text-[10px] transition hover:[background:color-mix(in_oklch,var(--info)_12%,transparent)]",style:{color:"var(--ink-3)",cursor:"pointer"},children:"watch ↓"})]})}const jl=24,Bv={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function kh(i){return Bv[i]}function Lv(i,c,u){const o=kh(c),d=o/jl,m=u-o,v=new Array(jl).fill(0);for(const h of i){const p=new Date(h).getTime();if(!Number.isFinite(p)||p<m||p>u)continue;const g=p-m;let y=Math.floor(g/d);y>=jl&&(y=jl-1),v[y]+=1}return v}const Hv=["1h","24h","7d","30d"],$v={"1h":"1h ago","24h":"24h ago","7d":"7d ago","30d":"30d ago"};function Gv({runs:i,range:c,onRangeChange:u,height:o=52}){const[d,m]=k.useState(()=>Date.now());k.useEffect(()=>{const p=kh(c)/jl,g=window.setInterval(()=>m(Date.now()),p);return()=>window.clearInterval(g)},[c]);const v=k.useMemo(()=>{var g;const p=[];for(const y of i){const S=((g=y.signals)==null?void 0:g.length)??0;for(let R=0;R<S;R++)p.push(y.timestamp)}return Lv(p,c,d)},[i,c,d]),h=Math.max(1,...v);return a.jsxs("div",{className:"rounded-md border px-3 py-2",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsx("div",{className:"h-section",children:"Signal volume"}),a.jsx("div",{className:"flex gap-1",children:Hv.map(p=>{const g=p===c;return a.jsx("button",{type:"button",onClick:()=>u(p),"aria-pressed":g,className:"rounded px-2 py-0.5 font-mono text-[10px] transition",style:{background:g?"var(--surface-sunk)":"transparent",color:g?"var(--text)":"var(--text-dim)",border:"1px solid",borderColor:g?"var(--border-strong)":"transparent"},children:p},p)})})]}),a.jsxs("svg",{viewBox:`0 0 ${jl} 1`,preserveAspectRatio:"none",style:{width:"100%",height:o,color:"var(--c1)",display:"block"},children:[a.jsx("rect",{x:0,y:.985,width:jl,height:.015,fill:"var(--ink)",opacity:.08}),v.map((p,g)=>{const y=p===0?0:p/h,S=1-y;return a.jsx("rect",{x:g+.15,y:S,width:.7,height:Math.max(y,p>0?.04:0),rx:.06,ry:.06,fill:"currentColor",opacity:p===0?0:.9},g)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between font-mono text-[10px] tabular-nums",style:{color:"var(--ink-3)"},children:[a.jsx("span",{children:$v[c]}),a.jsx("span",{children:"now"})]})]})}function Yv(i){const c=[];for(const[u,o]of i.entries())c.push(`${u}:${o.rounds}:${o.confirmed}:${o.disputed}:${o.hallucinationsCaught}`);return c.sort(),c.join("|")}function Xv(i){const c=k.useRef(""),u=k.useRef(new Map);return k.useMemo(()=>{const o=jv(i??[]),d=Yv(o);return d===c.current?u.current:(c.current=d,u.current=o,o)},[i])}function Vv(i){const c=[];for(const[u,o]of i.entries())c.push(`${u}:${o.critical}:${o.high}:${o.medium}:${o.low}`);return c.sort(),c.join("|")}function _h(i){const c=k.useRef(""),u=k.useRef(new Map);return k.useMemo(()=>{const o=new Map;if(i)for(const m of i){const v=[...m.confirmed??[],...m.disputed??[],...m.unique??[],...m.unverified??[]];for(const h of v){const p=h.originalAgentId;if(!p)continue;const g=o.get(p)??{critical:0,high:0,medium:0,low:0},y=h.severity??"low";y==="critical"?g.critical+=1:y==="high"?g.high+=1:y==="medium"?g.medium+=1:g.low+=1,o.set(p,g)}}const d=Vv(o);return d===c.current?u.current:(c.current=d,u.current=o,o)},[i])}function Qv(){const[i,c]=k.useState(()=>typeof window>"u"?null:eh(window.location.search));return k.useEffect(()=>{const u=()=>{const o=typeof window>"u"?null:eh(window.location.search);c(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),[i,bh]}const Zv=["1h","24h","7d","30d"];function Kv(i){return typeof i=="string"&&Zv.includes(i)}function uo(i){const c=new URLSearchParams(i).get("range");return Kv(c)?c:null}function Jv(i,c,u){const o=new URLSearchParams(c);u===null?o.delete("range"):o.set("range",u);const d=o.toString();return d.length>0?`${i}?${d}`:i}function nh(i){const c=globalThis;if(!c.window)return;const u=c.window,o=Jv(u.location.pathname,u.location.search,i);o!==u.location.pathname+u.location.search&&(u.history.pushState({},"",o),u.dispatchEvent(new Event("dashboard:navigate")))}function Fv(){const[i,c]=k.useState(()=>typeof window>"u"?"7d":uo(window.location.search)??"7d");return k.useEffect(()=>{typeof window<"u"&&uo(window.location.search)===null&&nh(i);const u=()=>{const o=typeof window>"u"?"7d":uo(window.location.search)??"7d";c(d=>d===o?d:o)};return window.addEventListener("dashboard:navigate",u),()=>window.removeEventListener("dashboard:navigate",u)},[]),[i,nh]}const Iv=new Set(["textbox","combobox","listbox","spinbutton","searchbox"]);function Wv(i){if(!(i instanceof Element))return!1;const c=i.tagName;if(c==="INPUT"||c==="TEXTAREA"||c==="SELECT"||i.isContentEditable===!0)return!0;const u=i.getAttribute("role");return u!==null&&Iv.has(u)}function Pv(i){k.useEffect(()=>{if(!i)return;function c(u){Wv(u.target)||(u.metaKey||u.ctrlKey)&&(u.key==="d"||u.key==="D")||u.metaKey||u.ctrlKey||u.altKey||(u.key==="Enter"?(u.preventDefault(),us("/agent/"+encodeURIComponent(i))):(u.key==="g"||u.key==="G")&&(u.preventDefault(),us("/agent/"+encodeURIComponent(i)+"#skills")))}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[i])}function eg(i){const c=globalThis.window,u=c!=null?c.location.search:"";return new URLSearchParams(u).get("graph")==="0"}function tg({overview:i,agents:c,tasks:u,consensus:o,consensusReports:d,fleetTrend:m,signalActivity:v,skills:h,activeTaskCount:p,setActiveTaskCount:g}){const y=i.actionableFindings,S=eg(),R=Xv(o==null?void 0:o.runs),J=_h(d==null?void 0:d.reports),$=k.useMemo(()=>{const z=new Map;if(m){for(const K of m.points){const le=z.get(K.agentId)??[];le.push(K),z.set(K.agentId,le)}for(const K of z.values())K.sort((le,F)=>le.day.localeCompare(F.day))}return z},[m]),[Y,w]=Qv(),[W,Q]=Fv();Pv(Y);const ne=c&&Y?c.find(z=>z.id===Y)??null:null,[V,T]=k.useState(!S);function Z(){const z=!V;T(z);const K=new URL(window.location.href);z?K.searchParams.delete("graph"):K.searchParams.set("graph","0"),window.history.replaceState(null,"",K.toString())}return a.jsxs("div",{className:"mx-auto max-w-6xl space-y-6",children:[a.jsxs("header",{children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[a.jsx("h1",{className:"h-route h-route--lg",children:"Overview"}),a.jsxs("div",{className:"flex items-baseline gap-4",children:[y>0&&a.jsxs("a",{href:Sn("/signals?signal=disagreement&signal=hallucination_caught&signal=new_finding"),className:"font-mono text-[11px] transition hover:underline",style:{color:"var(--warn)"},"data-tooltip":"Findings open for operator review",children:[y," actionable →"]}),c&&a.jsx("button",{type:"button",onClick:Z,className:"font-mono text-[10px] transition hover:underline",style:{color:"var(--text-dim)"},children:V?"[hide graph]":"[show graph]"})]})]}),a.jsx("p",{className:"mt-1 font-mono text-[13px]",style:{color:"var(--text-dim)"},children:"What your agents are doing right now."})]}),V&&c&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(qv,{}),a.jsxs("div",{className:"flex items-stretch gap-3",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(wv,{agents:c,peerRelationships:R,selectedAgentId:Y,onSelectAgent:w})}),a.jsx(zv,{selectedAgent:ne,agents:c,peerRelationships:R})]}),o&&a.jsx(Gv,{runs:o.runs,range:W,onRangeChange:Q})]}),a.jsx(f0,{overview:i,activeTasks:p,mode:"calm"}),a.jsx(k0,{onCountChange:g}),c&&a.jsx(v0,{agents:c,activity:v}),a.jsx(F0,{}),u&&a.jsx(X0,{tasks:u,limit:3}),c&&a.jsx(q0,{agents:c,highlightedAgentId:V?Y:null,severityMap:J,trendByAgent:$}),a.jsx(I0,{overview:i}),a.jsx(av,{skills:h??null})]})}const da={confirmed:"var(--ok)",disputed:"var(--bad)",unverified:"var(--info)",unique:"var(--ink-3)"},Hi={confirmed:"confirmed",disputed:"disputed",unverified:"unverified",unique:"unique"},Ro={sonnet:"Sonnet",gemini:"Gemini",opus:"Opus",haiku:"Haiku",other:"Other"},ua=["confirmed","disputed","unverified","unique"],ng=.01;function lg({consensusId:i,data:c,onError:u}){const[o,d]=k.useState(c?{kind:"full",data:c}:i?{kind:"loading"}:{kind:"empty"});return k.useEffect(()=>{if(c)return;let m=!1;return d(v=>v.kind==="error"?v:{kind:"loading"}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(i)}`).then(async v=>{const h=await v.json().catch(()=>({}));if(!v.ok){const p=typeof(h==null?void 0:h.error)=="string"?h.error:`HTTP ${v.status}`;throw new Error(p)}return h}).then(v=>{m||d({kind:"full",data:v})}).catch(v=>{m||(d(h=>({kind:"error",error:v.message,stale:h.kind==="full"?h.data:void 0})),u==null||u(v))}),()=>{m=!0}},[i,c,u]),o.kind==="loading"?a.jsx(og,{}):o.kind==="empty"?a.jsx(ug,{}):o.kind==="error"?a.jsx(dg,{error:o.error,stale:o.stale}):a.jsx(Eh,{data:o.data})}function Eh({data:i}){return a.jsxs("div",{className:"rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsxs("header",{className:"mb-4 flex items-start justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"h-section",style:{color:"var(--ink)"},children:"Consensus flow"}),a.jsxs("p",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[i.summary.totalFindings," findings across ",i.agentCount," agents"]})]}),i.coverageDegraded&&a.jsx(ag,{degraded:i.coverageDegraded})]}),a.jsx("div",{className:"hidden lg:block",children:a.jsx(sg,{data:i})}),a.jsx("div",{className:"block lg:hidden",children:a.jsx(rg,{data:i})}),a.jsx(cg,{data:i})]})}function ag({degraded:i}){return a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--warn-soft)",color:"var(--warn)",border:"1px solid var(--warn)"},"data-tooltip":`Coverage degraded: expected ${i.expected}, received ${i.received}. Dropped: ${i.droppedAgents.join(", ")||"none"}`,children:"coverage degraded"})}const Oo=720,Bi=320,Nn=120,Eo=0,To=(Oo-Nn)/2,lh=Oo-Nn,fo=8;function sg({data:i}){const c=k.useMemo(()=>ig(i),[i]),u=k.useMemo(()=>c.edges,[c.edges]),o=fg();return a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("svg",{viewBox:`0 0 ${Oo} ${Bi}`,width:"100%",height:Bi,role:"img","aria-label":`Consensus flow: ${i.summary.confirmed} confirmed, ${i.summary.disputed} disputed, ${i.summary.unverified} unverified, ${i.summary.unique} unique of ${i.summary.totalFindings} findings across ${i.agentCount} agents`,style:{display:"block"},children:[a.jsx("g",{children:u.map((d,m)=>a.jsx("path",{d:d.path,fill:d.color,fillOpacity:.55,stroke:"none",style:o?void 0:{animation:`consensus-flow-ribbon-in 480ms ease-out ${m*40}ms both`},children:a.jsx("title",{children:d.tooltip})},`${d.fromFamily}-${d.toVerdict}`))}),a.jsx("g",{children:c.left.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:Eo,y:d.y,width:Nn,height:d.h,fill:"var(--ink-4)",fillOpacity:.18}),a.jsxs("text",{x:Eo+Nn-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[Ro[d.family]," · ",d.agentCount]})]},d.family))}),a.jsx("g",{children:c.right.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:To,y:d.y,width:Nn,height:d.h,fill:da[d.verdict],fillOpacity:.16}),a.jsxs("text",{x:To+Nn/2,y:d.y+d.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:[Hi[d.verdict]," · ",d.count]})]},d.verdict))}),a.jsx("g",{children:c.right.map(d=>{const m=i.summary.totalFindings>0?Math.round(d.count/i.summary.totalFindings*100):0;return a.jsxs("g",{children:[a.jsx("rect",{x:lh,y:d.y,width:Nn,height:d.h,fill:da[d.verdict],fillOpacity:.32}),a.jsxs("text",{x:lh+Nn-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[d.count," · ",m,"%"]})]},d.verdict)})})]}),a.jsx("style",{children:`
|
|
59
|
+
@keyframes consensus-flow-ribbon-in {
|
|
60
|
+
from { opacity: 0; }
|
|
61
|
+
to { opacity: 1; }
|
|
62
|
+
}
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
svg * { animation: none !important; }
|
|
65
|
+
}
|
|
66
|
+
`})]})}function ig(i){const c=i.summary.totalFindings,u=Bi-fo*2,o=new Map;for(const $ of i.familyToOutcome)o.set($.from.family,(o.get($.from.family)??0)+$.to.count);const d=i.modelFamilyToFindings.reduce(($,Y)=>$+(o.get(Y.family)??0),0)||1;let m=fo;const v=i.modelFamilyToFindings.map($=>{const Y=o.get($.family)??0,w=Math.max(20,Y/d*u),W={family:$.family,y:m,h:w,agentCount:$.agentCount};return m+=w,W}),h=24;let p=fo;const g=ua.map($=>{const Y=i.summary[$],w=c>0?Y/c:0,W=Math.max(h,w*u),Q={verdict:$,y:p,h:W,count:Y};return p+=W,Q}),y=new Map,S=new Map,R=[],J=[...i.familyToOutcome].sort(($,Y)=>$.from.family!==Y.from.family?$.from.family.localeCompare(Y.from.family):ua.indexOf($.to.verdict)-ua.indexOf(Y.to.verdict));for(const $ of J){const Y=v.find(te=>te.family===$.from.family),w=g.find(te=>te.verdict===$.to.verdict);if(!Y||!w)continue;const W=o.get($.from.family)??0,Q=W>0?$.to.count/W*Y.h:0,ne=w.count||1,V=$.to.count/ne*w.h,T=y.get($.from.family)??0,Z=S.get($.to.verdict)??0;if(y.set($.from.family,T+Q),S.set($.to.verdict,Z+V),$.weight<ng)continue;const z=Y.y+T,K=z+Q,le=w.y+Z,F=le+V,de=Eo+Nn,ee=To,ae=de+(ee-de)*.5,he=ee-(ee-de)*.5,M=`M ${de} ${z} C ${ae} ${z}, ${he} ${le}, ${ee} ${le} L ${ee} ${F} C ${he} ${F}, ${ae} ${K}, ${de} ${K} Z`,E=i.modelFamilyToFindings.find(te=>te.family===$.from.family),L=(E==null?void 0:E.agentCount)??0;R.push({path:M,color:da[$.to.verdict],tooltip:`${L} ${Ro[$.from.family]} agent${L===1?"":"s"} → ${$.to.count} ${Hi[$.to.verdict]} finding${$.to.count===1?"":"s"} (${Math.round($.weight*100)}%)`,fromFamily:$.from.family,toVerdict:$.to.verdict})}return{left:v,right:g,edges:R}}function rg({data:i}){const c=i.summary.totalFindings||1;return a.jsxs("div",{className:"space-y-4",children:[a.jsx(mo,{label:"Model families",items:i.modelFamilyToFindings.map(u=>({key:u.family,label:`${Ro[u.family]} (${u.agentCount})`,value:u.agentCount,color:"var(--ink-4)"}))}),a.jsx(mo,{label:"Findings reviewed",items:ua.map(u=>({key:u,label:`${Hi[u]} (${i.summary[u]})`,value:i.summary[u],color:da[u]}))}),a.jsx(mo,{label:"Outcome verdicts",items:ua.map(u=>({key:u,label:`${i.summary[u]} · ${Math.round(i.summary[u]/c*100)}%`,value:i.summary[u],color:da[u]}))})]})}function mo({label:i,items:c}){const u=c.reduce((o,d)=>o+d.value,0)||1;return a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[10px]",style:{color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:i}),a.jsx("div",{className:"flex h-6 overflow-hidden rounded-sm border",style:{borderColor:"var(--border)"},children:c.map(o=>{const d=o.value/u*100;return d<.5?null:a.jsx("div",{title:o.label,style:{width:`${d}%`,background:o.color,opacity:.7,color:"var(--surface)",fontFamily:"var(--font-mono)",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",overflow:"hidden"},children:d>12?o.label:""},o.key)})})]})}function cg({data:i}){return a.jsxs("div",{className:"mt-4 flex flex-wrap gap-x-4 gap-y-1 border-t pt-3 font-mono text-[10px]",style:{borderColor:"var(--border)",color:"var(--ink-3)"},children:[ua.map(c=>a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-sm",style:{background:da[c]}}),Hi[c]," · ",i.summary[c]]},c)),i.summary.newFindings>0&&a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-sm",style:{background:"var(--warn)"}}),"new · ",i.summary.newFindings]})]})}function og(){return a.jsxs("div",{className:"rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},"aria-busy":"true","aria-label":"Loading consensus flow",children:[a.jsxs("div",{className:"mb-4 space-y-2",children:[a.jsx("div",{className:"h-3 w-32 animate-pulse rounded-sm",style:{background:"var(--border)"}}),a.jsx("div",{className:"h-2 w-48 animate-pulse rounded-sm",style:{background:"var(--border)"}})]}),a.jsx("div",{className:"grid grid-cols-3 gap-3",style:{height:Bi},children:[0,1,2].map(i=>a.jsx("div",{className:"flex flex-col gap-2",children:[0,1,2,3].map(c=>a.jsx("div",{className:"flex-1 animate-pulse rounded-sm",style:{background:"var(--border)",opacity:.6}},c))},i))}),a.jsx("style",{children:`
|
|
67
|
+
@media (prefers-reduced-motion: reduce) {
|
|
68
|
+
.animate-pulse { animation: none !important; }
|
|
69
|
+
}
|
|
70
|
+
`})]})}function ug(){return a.jsx("div",{className:"rounded-md border p-10 text-center",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:a.jsx("p",{className:"font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"No consensus rounds yet — dispatch your first review to see the consensus flow."})})}function dg({error:i,stale:c}){return a.jsxs("div",{className:"relative rounded-md border p-5",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsx("div",{className:"absolute right-3 top-3",children:a.jsxs("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--bad-soft)",color:"var(--bad)",border:"1px solid var(--bad)"},title:i,children:["error · ",i]})}),c?a.jsx("div",{style:{opacity:.5,pointerEvents:"none"},children:a.jsx(Eh,{data:c})}):a.jsx("p",{className:"py-10 text-center font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"Failed to load consensus flow."})]})}function fg(){const[i,c]=k.useState(!1);return k.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)");c(u.matches);const o=d=>c(d.matches);return u.addEventListener("change",o),()=>u.removeEventListener("change",o)},[]),i}function mg({consensusId:i}){return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("nav",{className:"mb-2 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},"aria-label":"Breadcrumb",children:[a.jsx("a",{href:Sn("/"),className:"hover:underline",style:{color:"var(--ink-3)"},children:"Overview"}),a.jsx("span",{"aria-hidden":"true",children:"›"}),a.jsx("span",{style:{color:"var(--ink)"},children:i})]}),a.jsx("h1",{className:"h-route",children:"Consensus flow"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"Model families on the left, findings reviewed in the middle, verdicts on the right."})]}),a.jsx(lg,{consensusId:i})]})}function hg({onLogin:i,error:c}){const[u,o]=k.useState(""),[d,m]=k.useState(!1),v=async p=>{if(p.preventDefault(),!(!u.trim()||d)){m(!0);try{await i(u.trim())}finally{m(!1)}}},h=c==="bad_key"?"Invalid key. Check your terminal for the correct key.":c==="network"?"Connection error — relay may be offline.":c==="no_cookie"?"Your browser did not store the session cookie. Disable private/incognito mode or allow cookies for this site, then try again.":null;return a.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{background:"var(--surface)"},children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border [border-color:var(--border)] p-8 text-center",style:{background:"var(--surface-elev)"},children:[a.jsx("div",{className:"crt-logo mx-auto mb-4",style:{width:"fit-content"},children:a.jsx("img",{src:"/dashboard/assets/gossip-mini.png",alt:"gossipcat",className:"crt-logo-img h-56 w-56 object-contain",style:{filter:"drop-shadow(0 0 28px var(--accent))"}})}),a.jsx("p",{className:"mb-1 font-semibold",style:{fontFamily:"'Geist', var(--font-sans)",fontSize:26,lineHeight:1.1,letterSpacing:"-0.02em",color:"var(--ink)",textShadow:"0 0 24px var(--accent)"},children:"Gossipcat"}),a.jsx("p",{className:"mb-6 text-[13px]",style:{color:"var(--ink-3)"},children:"Authenticate to access the dashboard"}),a.jsxs("form",{onSubmit:v,children:[a.jsx("input",{type:"password",value:u,onChange:p=>o(p.target.value),placeholder:"Dashboard key",autoFocus:!0,disabled:d,className:"w-full rounded-lg border [border-color:var(--border)] px-4 py-3 font-mono text-sm outline-none focus:[border-color:var(--ink-3)] focus:ring-2 focus:[--tw-ring-color:color-mix(in_oklch,var(--ink-3)_20%,transparent)] disabled:opacity-50",style:{background:"var(--surface)",color:"var(--ink)"}}),a.jsx("button",{type:"submit",disabled:d,className:"mt-4 w-full rounded-lg px-4 py-3 text-sm font-semibold transition hover:opacity-90 disabled:opacity-60",style:{background:"var(--accent)",color:"#fff"},children:d?"Unlocking…":"Unlock"})]}),h&&a.jsx("p",{className:"mt-3 text-sm",style:{color:"var(--bad)"},children:h})]})})}const Th="dashboard:theme",xg=["light","dark"];function pg(i){return i==="light"||i==="dark"?i:i==="editorial"?"light":i==="default"?"dark":null}function vg(i,c){const u=pg(i);return u!==null?u:c?"dark":"light"}function gg(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function yg(){if(typeof window>"u")return"light";let i=null;try{i=window.localStorage.getItem(Th)}catch{}return vg(i,gg())}function bg(){const[i,c]=k.useState(yg);k.useEffect(()=>{typeof document>"u"||(i==="light"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=i)},[i]);function u(d){if(xg.includes(d)&&(c(d),typeof window<"u"))try{window.localStorage.setItem(Th,d)}catch{}}return{theme:i,setTheme:u,toggle:()=>{u(i==="light"?"dark":"light")}}}const jg=[{term:"Consensus Round",definition:"A structured multi-agent review session. Each agent independently reviews the target code or output, then all agents cross-review each other's findings. The result is a set of findings tagged by how many agents agreed. The /debates URL in the dashboard lists all past consensus rounds.",seeAlso:"Finding, Signal"},{term:"Finding",definition:"A verifiable claim about a specific line of code, always cited with a file path and line number. Agents emit findings during a consensus round. A finding that cannot be located in the code is a hallucination.",seeAlso:"Insight, Hallucination"},{term:"Insight",definition:"An observation that does not point to a specific code location. Insights are informational — they cannot be confirmed or disputed by other agents and are excluded from accuracy scoring.",seeAlso:"Finding"},{term:"Signal",definition:"A scored event recorded against an agent, such as agreement, hallucination_caught, or unique_confirmed. Each signal adjusts the agent's accuracy and dispatch weight over time. Signals are the primary feedback mechanism that drives agent improvement.",seeAlso:"Accuracy (Adjusted), Dispatch Weight"},{term:"Hallucination",definition:"A fabricated finding: the cited file and line exist, but the code does not support the claim the agent made. Caught during cross-review by a peer agent. Each hallucination lowers the emitting agent's accuracy score.",seeAlso:"Finding, Signal"},{term:"Confirmed / Disputed / Unverified / Unique",definition:"The four statuses assigned to a finding after cross-review. Confirmed = two or more agents independently verified it. Disputed = at least one agent found contradictory evidence. Unverified = peer agents could not check it (no code anchor, out of scope). Unique = only one agent surfaced it; not yet confirmed or denied.",seeAlso:"Consensus Round"},{term:"Dispatch Weight",definition:"How likely an agent is to be selected for the next task. Ranges from 0.3 (rarely dispatched) to 2.0 (strongly preferred). Updated after every task based on accuracy and uniqueness signals. Visible on the Team page.",seeAlso:"Accuracy (Adjusted), Uniqueness"},{term:"Accuracy (Adjusted)",definition:"The fraction of an agent's findings that survived cross-review, with a penalty applied for hallucinations. Category Competency on the agent page shows the raw per-category ratio without the penalty; the Metrics section shows the penalized aggregate used for dispatch decisions.",seeAlso:"Hallucination, Dispatch Weight"},{term:"Uniqueness",definition:"How often this agent surfaces findings that no other agent in the same round found. High uniqueness with low accuracy is a useful combination: always include such agents in a consensus round, but never send them solo.",seeAlso:"Accuracy (Adjusted), Consensus Round"},{term:"Reliability",definition:"Task completion rate — the fraction of dispatched tasks that finished without a pipeline error or timeout. Distinct from accuracy, which measures finding correctness.",seeAlso:"Accuracy (Adjusted)"},{term:"Impact",definition:"A severity-weighted score for an agent's findings. Critical and high findings contribute more than medium or low ones. Impact reflects not just how many findings an agent produces, but how serious those findings tend to be.",seeAlso:"Finding"},{term:"Benched / Struggling / Kept for coverage",definition:"Circuit-breaker states that limit dispatch when an agent underperforms. Benched = fully excluded from dispatch (chronic = sustained low accuracy; burst = recent failure streak). Struggling = consecutive failures tripped the breaker; agent is deprioritized until it recovers. Kept for coverage = the agent would be benched, but it is the only agent with a required skill category, so it stays in the pool.",seeAlso:"Dispatch Weight, Skill"},{term:"Skill",definition:"A markdown file injected into an agent's prompt for a specific task category (e.g. input_validation, trust_boundaries). Skills are generated from an agent's actual failure history and override generic defaults. A skill graduates from pending to passed or failed after 120 post-bind signals.",seeAlso:"bound_at"},{term:"bound_at",definition:"The timestamp when a skill was attached to an agent. This anchors the effectiveness window: only signals recorded after bound_at count toward the skill's graduation verdict.",seeAlso:"Skill"},{term:"Invalid Output Types",definition:"Agent finding tags with a type= attribute outside the allowed set (finding, suggestion, insight). The pipeline silently rejects these — they never reach the consensus round or the dashboard. The count is tracked so skill development can address systematic format drift.",seeAlso:"Finding"},{term:"Process Violation",definition:"A guardrail breach detected outside normal code review. Examples: an agent pushed a commit directly to master bypassing the PR process, or an agent wrote to a file outside its declared scope. Process violations are logged separately from code findings."}],Ng={background:"var(--surface-elev)",borderRadius:"16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function Sg({open:i,onClose:c}){const u=k.useRef(null);return k.useEffect(()=>{if(!i)return;const o=requestAnimationFrame(()=>{var m;(m=u.current)==null||m.focus()}),d=m=>{m.key==="Escape"&&c()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(o),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[i,c]),i?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-6 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},onClick:c,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden",style:Ng,role:"dialog","aria-modal":"true","aria-labelledby":"glossary-title",onClick:o=>o.stopPropagation(),children:[a.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border/60 px-5 py-3.5",children:[a.jsx("h2",{id:"glossary-title",className:"font-mono text-sm font-semibold",style:{color:"var(--text)"},children:"Gossipcat Glossary"}),a.jsx("button",{ref:u,onClick:c,"aria-label":"Close glossary",className:"flex min-h-[44px] min-w-[44px] shrink-0 items-center justify-center rounded border border-border/40 font-mono text-xs transition hover:[color:var(--text)] hover:[background:var(--surface-sunk)]",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},children:"×"})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:a.jsx("dl",{className:"space-y-5",children:jg.map(({term:o,definition:d,seeAlso:m})=>a.jsxs("div",{className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)"},children:[a.jsx("dt",{className:"h-section",children:o}),a.jsx("dd",{className:"mt-1.5 font-mono text-xs leading-relaxed",style:{color:"color-mix(in oklch, var(--text) 80%, transparent)"},children:d}),m&&a.jsxs("dd",{className:"mt-1.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:["See also: ",m]})]},o))})}),a.jsx("div",{className:"shrink-0 border-t border-border/60 px-5 py-3",children:a.jsx("a",{href:"https://github.com/gossipcat-ai/gossipcat-ai/blob/master/docs/HANDBOOK.md",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs transition hover:underline",style:{color:"var(--accent)"},children:"Read the full HANDBOOK →"})})]})}):null}const kg=[{to:"/",label:"Dashboard",match:i=>i==="/"||i==="/overview"},{to:"/team",label:"Team",match:i=>i==="/team"||i.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:i=>i==="/debates"},{to:"/tasks",label:"Tasks",match:i=>i==="/tasks"},{to:"/signals",label:"Signals",match:i=>i==="/signals"},{to:"/logs",label:"Logs",match:i=>i==="/logs"}];function ho(){const[i,c]=k.useState(!1),u=hh(),{theme:o,toggle:d}=bg();return a.jsxs("nav",{className:"relative flex items-center justify-between border-b border-border px-6 py-3.5",children:[a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("a",{href:Sn("/"),className:"flex items-center gap-3 leading-none",children:[a.jsx("img",{src:"/dashboard/assets/gossip-mini.png",alt:"",className:"h-10 w-10 object-contain"}),a.jsx("span",{className:"text-[17px] font-bold",style:{color:"var(--accent)"},children:"gossipcat"})]}),a.jsx("div",{className:"flex gap-1",children:kg.map(m=>{const v=m.match(u);return a.jsx("a",{href:Sn(m.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${v?"font-semibold":"hover:bg-accent/10"}`,style:v?{background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"var(--accent)"}:{color:"var(--ink-3)"},children:m.label},m.to)})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{"aria-hidden":"true",title:"Search — coming soon",style:{display:"inline-flex",alignItems:"center",gap:"8px",height:"32px",padding:"0 12px",minWidth:"220px",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink-3)",fontFamily:"var(--font-sans)",fontSize:"13px",cursor:"default"},children:[a.jsx("span",{style:{opacity:.7},children:"Search…"}),a.jsx("kbd",{style:{marginLeft:"auto",padding:"1px 6px",borderRadius:"4px",background:"var(--surface-sunk)",border:"1px solid var(--border)",fontFamily:"var(--font-mono)",fontSize:"11px",color:"var(--ink-3)"},children:"⌘K"})]}),a.jsx("button",{type:"button",onClick:d,title:`Switch to ${o==="light"?"dark":"light"} theme`,"aria-label":`Switch to ${o==="light"?"dark":"light"} theme`,style:{width:"32px",height:"32px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink)",cursor:"pointer",fontSize:"16px",lineHeight:1},children:o==="light"?"◐":"◑"}),a.jsx("button",{type:"button",onClick:()=>c(!0),"aria-label":"Open glossary",title:"Glossary",style:{width:"32px",height:"32px",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--surface-elev)",border:"1px solid var(--border)",borderRadius:"8px",color:"var(--ink)",cursor:"pointer",lineHeight:1},children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),a.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"})]})})]}),a.jsx(Sg,{open:i,onClose:()=>c(!1)})]})}const _g={completed:{label:"COMPLETED",cls:"text-confirmed bg-confirmed/10"},failed:{label:"FAILED",cls:"text-destructive bg-destructive/10"},cancelled:{label:"CANCELLED",cls:"",clsStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"}},running:{label:"RUNNING",cls:"text-unverified bg-unverified/10 animate-pulse"}};function Mh({task:i,onClose:c}){if(k.useEffect(()=>{if(!i)return;const d=m=>{m.key==="Escape"&&c()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[i,c]),!i)return null;const u=_g[i.status],o=(i.inputTokens||0)+(i.outputTokens||0);return a.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-6 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},onClick:c,children:a.jsxs("div",{className:"relative mt-12 w-full max-w-3xl rounded-lg border border-border",style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-overlay)"},onClick:d=>d.stopPropagation(),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border/60 px-5 py-4",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${u.cls}`,style:u.clsStyle,children:u.label}),a.jsx("span",{className:"warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",children:i.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(i.agentId)}`,className:"truncate font-mono text-xs transition",style:{color:"var(--text-dim)"},children:i.agentId})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-3 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("span",{children:Pe(i.timestamp)}),i.duration!=null&&a.jsxs("span",{children:["· ",u0(i.duration)]}),o>0&&a.jsxs("span",{children:["· ",o.toLocaleString()," tokens (",(i.inputTokens||0).toLocaleString()," in / ",(i.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:c,className:"shrink-0 rounded-md border border-border/40 px-2 py-1 font-mono text-xs transition hover:bg-accent/10",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},"aria-label":"Close",children:"✕"})]}),a.jsxs("div",{className:"max-h-[calc(100vh-220px)] space-y-5 overflow-y-auto px-5 py-4",children:[a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Task"}),a.jsx("div",{className:"task-md rounded-md border border-border/40 p-3 text-xs leading-relaxed overflow-x-auto",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"color-mix(in oklch, var(--text) 90%, transparent)"},dangerouslySetInnerHTML:{__html:o0(i.task)}})]}),i.result?a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Result"}),a.jsx("div",{className:"finding-md rounded-md border border-border/40 p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:text-[var(--cite-fn)] [&_.inline-code]:rounded [&_.inline-code]:bg-[color-mix(in_oklch,var(--surface-sunk)_40%,transparent)] [&_.inline-code]:px-1 [&_.inline-code-block]:my-2 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:bg-[color-mix(in_oklch,var(--surface-sunk)_30%,transparent)] [&_.inline-code-block]:p-2",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"color-mix(in oklch, var(--text) 90%, transparent)"},dangerouslySetInnerHTML:{__html:Li(i.result)}})]}):a.jsxs("section",{children:[a.jsx("h3",{className:"mb-2 h-section",children:"Result"}),a.jsx("div",{className:"rounded-md border border-border/40 p-3 text-center font-mono text-xs",style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",color:"var(--text-dim)"},children:i.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}function Mo(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const xo=5,po={agreement:{label:"CONFIRMED",filter:"confirmed",cls:"text-confirmed bg-confirmed/10"},consensus_verified:{label:"CONFIRMED",filter:"confirmed",cls:"text-confirmed bg-confirmed/10"},disagreement:{label:"DISPUTED",filter:"disputed",cls:"text-disputed bg-disputed/10"},hallucination_caught:{label:"DISPUTED",filter:"disputed",cls:"text-disputed bg-disputed/10"},unverified:{label:"UNVERIFIED",filter:"unverified",cls:"text-unverified bg-unverified/10"},unique_confirmed:{label:"UNIQUE",filter:"unique",cls:"text-unique bg-unique/10"},unique_unconfirmed:{label:"UNIQUE?",filter:"unique",cls:"text-unverified bg-unverified/10"},new_finding:{label:"NEW",filter:"unique",cls:"text-unique bg-unique/10"}},ah=[{key:"all",label:"All",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text)",background:"var(--surface-sunk)"},inactiveStyle:{color:"var(--text-dim)"}},{key:"confirmed",label:"Confirmed",cls:"text-confirmed/50 border-confirmed/20 hover:border-confirmed/40",activeCls:"text-confirmed bg-confirmed/10 border-confirmed/40"},{key:"unique",label:"Unique",cls:"text-unique/50 border-unique/20 hover:border-unique/40",activeCls:"text-unique bg-unique/10 border-unique/40"},{key:"disputed",label:"Disputed",cls:"text-disputed/50 border-disputed/20 hover:border-disputed/40",activeCls:"text-disputed bg-disputed/10 border-disputed/40"},{key:"unverified",label:"Unverified",cls:"text-unverified/50 border-unverified/20 hover:border-unverified/40",activeCls:"text-unverified bg-unverified/10 border-unverified/40"},{key:"insight",label:"Insight",cls:"text-insight/60 border-insight/20 hover:border-insight/40",activeCls:"text-insight bg-insight/10 border-insight/40",tooltip:"Observations without a specific file:line anchor. Not scored — cannot be confirmed or disputed by peers."}],Eg=[{key:"all",label:"All",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text)",background:"var(--surface-sunk)"},inactiveStyle:{color:"var(--text-dim)"}},{key:"critical",label:"Critical",cls:"text-bad/50 border-bad/20 hover:border-bad/40",activeCls:"text-bad bg-bad/10 border-bad/40"},{key:"high",label:"High",cls:"text-severity-high/50 border-severity-high/20 hover:border-severity-high/40",activeCls:"text-severity-high bg-severity-high/10 border-severity-high/40"},{key:"medium",label:"Medium",cls:"text-severity-medium/50 border-severity-medium/20 hover:border-severity-medium/40",activeCls:"text-severity-medium bg-severity-medium/10 border-severity-medium/40"},{key:"low",label:"Low",cls:"border-border/40 hover:border-border/60",activeCls:"border-border",activeStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},inactiveStyle:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}}],Tg={critical:"text-bad bg-bad/10",high:"text-severity-high bg-severity-high/10",medium:"text-severity-medium bg-severity-medium/10",low:""},Mg={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},wg="[&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)] [&_.inline-code]:rounded [&_.inline-code]:[background:var(--surface-sunk)] [&_.inline-code]:px-1 [&_.inline-code]:py-0.5 [&_.inline-code]:font-mono [&_.inline-code]:text-[11px] [&_.inline-code]:[color:color-mix(in_oklch,var(--text)_80%,transparent)] [&_.inline-code-block]:my-1.5 [&_.inline-code-block]:block [&_.inline-code-block]:rounded [&_.inline-code-block]:[background:color-mix(in_oklch,var(--surface-sunk)_70%,transparent)] [&_.inline-code-block]:p-2 [&_.inline-code-block]:font-mono [&_.inline-code-block]:text-[11px] [&_.inline-code-block]:[color:color-mix(in_oklch,var(--text)_70%,transparent)] [&_.inline-code-block]:overflow-x-auto",Ag={HTML_ENTITY_ENCODED_TAGS:"HTML-entity-encoded <agent_finding> tags — parser saw 0 tags",HTML_ENTITY_MIXED_PAYLOAD:"Mixed raw + HTML-entity-encoded tags — some findings dropped",SCHEMA_DRIFT_PHASE2_VERDICT_TOKENS:"Schema drift — Phase-2 consensus verdict types emitted (confirmed/disputed/unique/verdict)",SCHEMA_DRIFT_INVENTED_TYPE_TOKENS:"Schema drift — invented <agent_finding> type names (valid: finding | suggestion | insight)",SCHEMA_DRIFT_NESTED_SUBTAGS:'Schema drift — nested <type>...</type> subtags instead of type="..." attribute'};function Cg({f:i,reviewInfo:c,diagnostics:u}){const o=i.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":i.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":i.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=i.severity&&Tg[i.severity]||"",m=i.severity==="low"?Mg:void 0,v=i.findingType==="suggestion"?"SUGGESTION":i.findingType==="insight"?"INSIGHT":null,h=i.findingType==="suggestion"?"text-info bg-info/10":i.findingType==="insight"?"text-text-dim bg-text-dim/10":"",p=i.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=p?p[1]:null;return a.jsxs("div",{className:"rounded-md border border-border/40 hover:border-border/60 transition-colors px-4 py-3.5",style:{background:"color-mix(in oklch, var(--surface-elev) 30%, transparent)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${o}`,children:i.tag.toUpperCase()}),i.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,style:m,children:i.severity.toUpperCase()}),v&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${h}`,children:v}),g&&a.jsx("span",{className:"bg-info/10 px-2 py-1 font-mono text-[10px] text-info border border-info/15 rounded",children:g}),a.jsx("span",{className:"ml-auto font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:i.originalAgentId}),i.confirmedBy&&i.confirmedBy.length>0&&(()=>{const y=[...new Set(i.confirmedBy)];return a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-confirmed/50 transition hover:bg-confirmed/10","data-tooltip":`Verified by:
|
|
71
|
+
${y.join(", ")}`,"data-tooltip-pos":"left",children:["+",y.length," ✓"]})})(),i.disputedBy&&i.disputedBy.length>0&&a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-disputed/50 transition hover:bg-disputed/10","data-tooltip":`Disputed by:
|
|
72
|
+
${i.disputedBy.map(y=>y.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[i.disputedBy.length," ⚡"]}),i.unverifiedBy&&i.unverifiedBy.length>0&&a.jsxs("span",{className:"cursor-help rounded px-1 py-0.5 font-mono text-[10px] text-unverified/50 transition hover:bg-unverified/10","data-tooltip":`Unverified by:
|
|
73
|
+
${i.unverifiedBy.map(y=>y.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[i.unverifiedBy.length," ◇"]})]}),u&&u.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:u.map((y,S)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":y.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",y.code]}),a.jsx("div",{className:"mt-0.5 text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},dangerouslySetInnerHTML:{__html:Mo(Ag[y.code])+" — "+Mo(y.message)}})]},S))}),i.disputedBy&&i.disputedBy.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 rounded border border-disputed/10 bg-disputed/5 px-2.5 py-1.5",children:i.disputedBy.map((y,S)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:y.agentId}),a.jsxs("span",{style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[" — ",y.reason||y.evidence||"No reason given"]})]},S))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed ${wg}`,style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:Li(i.finding)}}),c&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[c.reviewers.map(y=>a.jsx("span",{title:y,className:"inline-flex h-5 w-5 items-center justify-center rounded-full font-mono text-[8px] font-bold text-background opacity-70",style:{backgroundColor:en(y)},children:yo(y)},y)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${c.assigned>=c.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[c.assigned>=c.targetK?"✓":"⚠"," ",c.assigned,"/",c.targetK]})]})]})}function zg({consensus:i,reports:c,showAll:u=!1,hideHeader:o=!1,filteredRuns:d}){const m=d??i.runs,v=u?m:m.slice(0,xo);!u&&m.length>xo;const[h,p]=k.useState(null),[g,y]=k.useState("all"),[S,R]=k.useState("all"),[J,$]=k.useState(1),[Y,w]=k.useState([]),[W,Q]=k.useState(0),[ne,V]=k.useState(!1),[T,Z]=k.useState({});k.useEffect(()=>{if(!u&&(c!=null&&c.reports)&&(w(c.reports),Q(c.totalReports??c.reports.length),$(1)),c!=null&&c.roundRetractions){const M={};for(const E of c.roundRetractions)M[E.consensus_id]={reason:E.reason,retracted_at:E.retracted_at};Z(M)}},[c,u]),k.useEffect(()=>{if(!u)return;let M=!1;return(async()=>{var E;try{const L=await We("consensus-reports?page=1&pageSize=200");if(M)return;if(w(L.reports||[]),Q(L.totalReports??(((E=L.reports)==null?void 0:E.length)||0)),$(1),L.roundRetractions){const te={};for(const ce of L.roundRetractions)te[ce.consensus_id]={reason:ce.reason,retracted_at:ce.retracted_at};Z(te)}}catch{}})(),()=>{M=!0}},[u]);const z=Y.slice().sort((M,E)=>E.timestamp.localeCompare(M.timestamp)),K=10,[le,F]=k.useState(0),de=Math.max(1,Math.ceil(z.length/K)),ee=Math.min(le,de-1),ae=u?z.slice(ee*K,(ee+1)*K):z.slice(0,xo),he=M=>{const E=new Date,L=new Date(M),te=fe=>new Date(fe.getFullYear(),fe.getMonth(),fe.getDate()).getTime(),ce=Math.round((te(E)-te(L))/864e5);return ce<=0?"Today":ce===1?"Yesterday":ce<7?`${ce} days ago`:ce<30?`${Math.floor(ce/7)} weeks ago`:L.toISOString().slice(0,10)};return a.jsxs("section",{children:[!o&&a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Consensus Rounds ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:i.totalRuns??i.runs.length})]}),!u&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),ae.length>0?a.jsxs("div",{className:"space-y-2",children:[ae.map((M,E)=>{const L=E>0?ae[E-1]:null,te=u?he(M.timestamp):null,ce=u&&L?he(L.timestamp):null,fe=u&&te!==ce,j={};if(M.crossReviewAssignments||M.crossReviewCoverage){const I={};if(M.crossReviewAssignments)for(const[pe,Te]of Object.entries(M.crossReviewAssignments))for(const Fe of Te)(I[Fe]??(I[Fe]=[])).push(pe);if(M.crossReviewCoverage)for(const pe of M.crossReviewCoverage)j[pe.findingId]={reviewers:I[pe.findingId]||[],assigned:pe.assigned,targetK:pe.targetK};else for(const[pe,Te]of Object.entries(I))j[pe]={reviewers:Te,assigned:Te.length,targetK:Te.length}}const q=[...M.confirmed,...M.disputed,...M.unverified,...M.unique,...M.insights||[]],P=g==="all"?q:g==="insight"?q.filter(I=>I.findingType==="insight"||I.findingType==="suggestion"):q.filter(I=>I.tag===g),X=S==="all"?P:P.filter(I=>I.severity===S),U=h===M.id,se=(()=>{const I=new Set;return pe=>{var Yt;const Te=(Yt=M.authorDiagnostics)==null?void 0:Yt[pe.originalAgentId];if(!Te||Te.length===0)return;const Fe=Te.filter(lt=>{const ut=`${pe.originalAgentId}:${lt.code}`;return I.has(ut)?!1:(I.add(ut),!0)});return Fe.length>0?Fe:void 0}})(),oe=q.length||1,we=M.confirmed.length,ye=M.disputed.length,Je=M.unverified.length,Ct=M.unique.length,mt=(M.insights||[]).length,kn=(()=>{if(oe===0)return"border-l-border/40";const I=we/oe,pe=ye/oe;return I>=.5?"border-l-confirmed/60":pe>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),jt=[{count:we,textCls:"text-confirmed",label:"confirmed"},{count:ye,textCls:"text-disputed",label:"disputed"},{count:Je,textCls:"text-unverified",label:"unverified"},{count:Ct,textCls:"text-unique",label:"unique"},{count:mt,textCls:"text-zinc-400",label:"insights"}].filter(I=>I.count>0),Ae=[...new Set(q.map(I=>I.originalAgentId).filter(Boolean))],nn=Ae.slice(0,5),Zt=T[M.id],_n=!!Zt;return a.jsxs("div",{children:[fe&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${E>0?"mt-4":""}`,children:[a.jsx("span",{className:"h-section",children:te}),a.jsx("div",{className:"h-px flex-1 bg-border/30"})]}),a.jsxs("div",{className:`group rounded-md border-l-2 border border-border/40 transition-all duration-150
|
|
74
|
+
${kn}
|
|
75
|
+
${_n?"opacity-60 line-through decoration-disputed/40":""}
|
|
76
|
+
${U?"border-r-border/60 border-t-border/60 border-b-border/60":"hover:border-r-border/60 hover:border-t-border/60 hover:border-b-border/60 hover:-translate-y-px"}`,style:{background:U?"var(--surface-elev)":"color-mix(in oklch, var(--surface-elev) 50%, transparent)"},"data-retracted":_n?"true":void 0,children:[_n&&a.jsxs("div",{className:"no-underline rounded-t-md border-b border-disputed/30 bg-disputed/10 px-3 py-2 font-mono text-[11px] text-disputed",style:{textDecoration:"none"},children:[a.jsx("span",{className:"font-bold",children:"⚠ RETRACTED"}),Zt.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",Zt.retracted_at.slice(0,10)]}),Zt.reason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",Zt.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":U,onClick:()=>{const I=!U;p(I?M.id:null),I&&(y("all"),R("all"))},children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-sm font-bold",style:{color:"var(--text)"},children:q.length}),a.jsx("span",{className:"text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:"findings"}),a.jsx("span",{className:"text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 30%, transparent)"},children:"·"}),a.jsxs("span",{className:"text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[M.rounds,"r"]}),nn.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[nn.map(I=>a.jsx("span",{title:I,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:en(I)},children:yo(I)},I)),Ae.length>5&&a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["+",Ae.length-5]})]}),a.jsx("span",{className:"shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[10px] font-semibold",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)",color:"var(--text-dim)"},title:M.id,children:M.id.slice(0,8)}),M.zeroTagAgents&&M.zeroTagAgents.length>0&&(()=>{const I=M.zeroTagAgents,pe=M.zeroTagOverflow??0,Te=I.length+pe,Fe=pe>0?`${I.join(", ")} (+${pe} more)`:I.join(", ");return a.jsxs("span",{className:"shrink-0 rounded border border-unverified/20 bg-unverified/5 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-unverified",title:`Zero-tag agents — emitted no parseable <agent_finding> tags (likely paraphrased relay or HTML-entity encoding). See HANDBOOK invariant #12. Agents: ${Fe}`,children:[Te," zero-tag"]})})(),M.droppedFindingsByType&&Object.keys(M.droppedFindingsByType).length>0&&(()=>{const I=Object.entries(M.droppedFindingsByType),pe=I.reduce((Fe,[,Yt])=>Fe+Yt,0),Te=I.map(([Fe,Yt])=>`${Fe}:${Yt}`).join(", ");return a.jsxs("span",{className:"shrink-0 rounded border border-unverified/20 bg-unverified/5 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-unverified",title:`Silently dropped <agent_finding> tags with invalid type=: ${Te}. These never reach the dashboard, scores, or signals.`,children:[pe," dropped"]})})(),M.warnings&&M.warnings.length>0&&(()=>{const I=new Map;for(const pe of M.warnings){const Te=I.get(pe.code)??[];Te.push(pe.agentId?`${pe.agentId}: ${pe.message}`:pe.message),I.set(pe.code,Te)}return Array.from(I.entries()).map(([pe,Te])=>a.jsxs("span",{className:"shrink-0 rounded border border-warn/30 bg-warn/10 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-warn",title:Te.join(`
|
|
77
|
+
`),children:[pe,Te.length>1?` ×${Te.length}`:""]},pe))})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] shrink-0",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:Pe(M.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:jt.map(I=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${I.textCls}`,children:[I.count," ",I.label]},I.label))}),M.topic&&a.jsxs("div",{className:"mt-1.5 flex items-start gap-2",children:[a.jsx("span",{className:"shrink-0 rounded border border-border/30 px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase tracking-wider",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Topic"}),a.jsx("span",{className:"font-inter text-[11px] leading-relaxed",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:M.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] transition-transform duration-150 ${U?"rotate-90":""}`,style:{color:U?"color-mix(in oklch, var(--ink) 60%, transparent)":"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"▸"})]}),U&&a.jsxs("div",{className:"border-t border-border/20 px-4 pb-4 pt-3",children:[a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Type:"}),ah.map(I=>a.jsx("button",{onClick:()=>y(I.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${g===I.key?I.activeCls:I.cls}`,style:g===I.key?I.activeStyle:I.inactiveStyle,...I.tooltip?{"data-tooltip":I.tooltip}:{},children:I.label},I.key))]}),a.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Severity:"}),Eg.map(I=>a.jsx("button",{onClick:()=>R(I.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${S===I.key?I.activeCls:I.cls}`,style:S===I.key?I.activeStyle:I.inactiveStyle,children:I.label},I.key))]}),(M.warnings??[]).filter(I=>I.code==="coverage_degraded").map((I,pe)=>a.jsx("div",{className:"mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2",children:a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-warn",children:["⚠ ",I.message]})},`cd-${pe}`)),M.zeroTagAgents&&M.zeroTagAgents.length>0&&a.jsxs("div",{className:"mb-3 rounded-md border border-unverified/20 bg-unverified/8 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-unverified",children:["⚠ Zero-tag agents — ",M.zeroTagAgents.length+(M.zeroTagOverflow??0)," agent",M.zeroTagAgents.length+(M.zeroTagOverflow??0)===1?"":"s"," emitted no parseable <agent_finding> tags"]}),a.jsxs("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[M.zeroTagAgents.join(", "),M.zeroTagOverflow&&M.zeroTagOverflow>0?` (+${M.zeroTagOverflow} more)`:""]}),a.jsx("p",{className:"mt-1 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Likely a paraphrased relay or HTML-entity-encoded tags. See HANDBOOK invariant #12."})]}),(()=>{const I=(M.warnings??[]).filter(Te=>Te.code==="cross_review_skipped");if(I.length===0)return null;const pe=I.map(Te=>Te.agentId).filter(Boolean);return a.jsxs("div",{className:"mb-3 rounded-md border border-warn/30 bg-warn/10 px-3 py-2",children:[a.jsxs("p",{className:"font-mono text-[10px] font-semibold text-warn",children:["⚠ Cross-review skipped: ",I.length," relay agent",I.length===1?"":"s"," failed Phase 2"]}),pe.length>0&&a.jsx("p",{className:"mt-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:pe.join(", ")})]})})(),(M.crossReviewAssignments||M.crossReviewCoverage)&&(()=>{const I=M.crossReviewAssignments||{},pe=Object.entries(I),Te=M.crossReviewCoverage||[],Fe=Te.length,Yt=Te.filter(ut=>ut.assigned<ut.targetK),lt=(M.warnings??[]).some(ut=>ut.code==="partial_review");return a.jsxs("details",{className:"mb-3 rounded-md border border-border/30",style:{background:"color-mix(in oklch, var(--surface-elev) 30%, transparent)"},children:[a.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 px-3 py-2 h-section select-none",children:["Cross-Review Assignments",lt&&a.jsx("span",{className:"rounded border border-warn/20 bg-warn/10 px-1.5 py-0.5 font-mono text-[9px] font-bold normal-case tracking-normal text-warn",children:"partial"}),a.jsxs("span",{className:"ml-auto font-mono text-[9px] font-normal normal-case tracking-normal",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[pe.length," reviewers · ",Fe," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[pe.map(([ut,ma])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:ut,className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:en(ut)},children:yo(ut)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:ut}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["(",ma.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:ma.map(Pn=>a.jsx("span",{className:"rounded px-1.5 py-0.5 font-mono text-[9px]",style:{background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)",color:"var(--text-dim)"},children:Pn.length>12?Pn.slice(0,12)+"…":Pn},Pn))})]},ut)),Fe>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Yt.length>0?a.jsxs("span",{className:"rounded border border-unverified/15 bg-unverified/5 px-2 py-1 font-mono text-[10px] font-semibold text-unverified",children:["⚠ ",Yt.length," of ",Fe," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",Fe," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:X.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):X.map((I,pe)=>a.jsx(Cg,{f:I,reviewInfo:I.id?j[I.id]:void 0,diagnostics:se(I)},pe))})]})]})]},M.id)}),u&&de>1&&a.jsxs("div",{className:"flex items-center justify-center gap-3 pt-4 font-mono text-[11px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>F(M=>Math.max(0,M-1)),disabled:ee===0,className:"rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:["Page ",ee+1," of ",de]}),a.jsx("button",{onClick:()=>F(M=>Math.min(de-1,M+1)),disabled:ee>=de-1,className:"rounded-sm border border-border/40 px-3 py-1 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}):v.length===0?a.jsx(fa,{title:"No consensus runs yet",hint:"Dispatch a consensus round with gossip_dispatch to populate this view."}):a.jsx("div",{className:"space-y-2",children:v.map((M,E)=>{const L=M.counts,te=(L.agreement||0)+(L.disagreement||0)+(L.hallucination||0)+(L.unverified||0)+(L.unique||0)+(L.new||0),ce=te||1,fe=h===M.taskId,j=[{key:"confirmed",count:L.agreement||0,color:"bg-confirmed",text:"text-confirmed",label:"confirmed"},{key:"disputed",count:(L.disagreement||0)+(L.hallucination||0),color:"bg-disputed",text:"text-disputed",label:"disputed"},{key:"unverified",count:L.unverified||0,color:"bg-unverified",text:"text-unverified",label:"unverified"},{key:"unique",count:(L.unique||0)+(L.new||0),color:"bg-unique",text:"text-unique",label:"unique"}],q=M.signals.filter(X=>{if(X.signal==="signal_retracted")return!1;if(g==="all")return!!po[X.signal];const U=po[X.signal];return U&&U.filter===g}),P=!!M.retracted;return a.jsxs("div",{className:`rounded-md border transition ${fe?"border-primary/25":"border-border"} ${P?"opacity-60":""}`,style:{background:"var(--surface-elev)"},"data-retracted":P?"true":void 0,title:P&&M.retractionReason?`Retracted: ${M.retractionReason}`:void 0,children:[P&&a.jsxs("div",{className:"rounded-t-md border-b border-disputed/30 bg-disputed/10 px-3 py-1.5 font-mono text-[10px] text-disputed",style:{textDecoration:"none"},children:[a.jsx("span",{className:"font-bold uppercase tracking-wider",children:"⚠ Retracted"}),M.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",M.retractedAt.slice(0,10)]}),M.retractionReason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",M.retractionReason]})]}),a.jsxs("button",{"aria-expanded":fe,onClick:()=>{const X=!fe;p(X?M.taskId:null),X&&(y("all"),R("all"))},className:"flex w-full items-center p-3 text-left transition hover:bg-accent/10",children:[a.jsx("span",{className:"mr-3 font-mono text-xs transition",style:{color:fe?"var(--ink)":"var(--text-dim)",fontWeight:fe?600:400},children:fe?"▾":"▸"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:M.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold ${P?"line-through decoration-disputed/40":""}`,style:{color:"var(--text)"},children:[te," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[M.agents.slice(0,4).map(X=>a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[10px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:X.split("-").map(U=>U[0]).join("").toUpperCase().slice(0,2)},X)),M.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["+",M.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:Pe(M.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:j.map(X=>X.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${X.text} ${P?"line-through decoration-disputed/40":""}`,children:[X.count," ",X.label]},X.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:j.map(X=>X.count>0&&a.jsx("div",{className:`${X.color} transition-all`,style:{width:`${X.count/ce*100}%`}},X.key))})]})]}),fe&&a.jsxs("div",{className:"border-t border-border px-4 pb-3 pt-3",children:[a.jsx("div",{className:"mb-3 flex gap-1.5",children:ah.map(X=>a.jsx("button",{onClick:()=>y(X.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${g===X.key?X.activeCls:X.cls} hover:opacity-80`,style:g===X.key?X.activeStyle:X.inactiveStyle,...X.tooltip?{"data-tooltip":X.tooltip}:{},children:X.label},X.key))}),q.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):a.jsx("div",{className:"space-y-2",children:q.map((X,U)=>{const se=po[X.signal];return se?a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${se.cls}`,children:se.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]",style:{color:"var(--text-dim)"},children:a.jsx("span",{className:"finding-md",dangerouslySetInnerHTML:{__html:Li(X.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[X.agentId,X.counterpartId?` + ${X.counterpartId}`:""]})]})]},U):null})})]})]},M.taskId+E)})})]})}const Di=25;function Dg({commits:i}){const[c,u]=k.useState(!1);if(i.length===0)return a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"—"});const o=i[0],d=o.includes(" ")?o.slice(o.indexOf(" ")+1):o,m=i.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--text)"},children:d}),m>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":c,onClick:()=>u(v=>!v),className:"font-mono text-[10px] underline",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:c?"(collapse)":`(+${m} more)`}),c&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:i.slice(1).map((v,h)=>{const p=v.includes(" ")?v.slice(v.indexOf(" ")+1):v;return a.jsx("li",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:p},h)})})]})]})}function Rg({row:i}){const c=i.preSha.slice(0,8),u=i.postSha.slice(0,8);return a.jsxs("tr",{className:"border-t border-border/20 align-top transition-colors hover:bg-accent/20",children:[a.jsx("td",{className:"whitespace-nowrap py-3 pl-4 pr-4 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:Pe(i.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(i.agentId)}`,className:"font-mono text-[11px] hover:underline",style:{color:"var(--text)"},onMouseEnter:o=>o.currentTarget.style.color="var(--accent)",onMouseLeave:o=>o.currentTarget.style.color="var(--text)",children:i.agentId})}),a.jsxs("td",{className:"whitespace-nowrap py-3 pr-4 font-mono text-[10px]",children:[a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:c}),a.jsx("span",{className:"mx-1",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"→"}),a.jsx("span",{style:{color:"var(--text)"},children:u})]}),a.jsx("td",{className:"py-3 pr-4",children:a.jsx(Dg,{commits:i.commits})})]})}function Og(){const[i,c]=k.useState([]),[u,o]=k.useState(0),[d,m]=k.useState(1),[v,h]=k.useState(!1),[p,g]=k.useState(null);k.useEffect(()=>{let S=!1;return h(!0),g(null),We(`violations?page=${d}&pageSize=${Di}`).then(R=>{S||(c(R.items??[]),o(R.total??0))}).catch(R=>{S||g(String((R==null?void 0:R.message)??R))}).finally(()=>{S||h(!1)}),()=>{S=!0}},[d]);const y=Math.max(1,Math.ceil(u/Di));return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Process Violations"}),u>0&&a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:u})]}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:"Direct master pushes detected by the ref-allowlist enforcer"})]}),a.jsxs("div",{className:"overflow-hidden rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[p&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:p}),!p&&a.jsxs("table",{className:"w-full table-fixed text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border/40 font-mono text-[10px] uppercase tracking-wider",style:{background:"color-mix(in oklch, var(--surface-sunk) 20%, transparent)",color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:[a.jsx("th",{className:"py-2.5 pl-4 pr-4",children:"When"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Commit Range"}),a.jsx("th",{className:"py-2.5 pr-4",children:"Commits"})]})}),a.jsxs("tbody",{children:[!v&&i.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"No violations recorded"})}),v&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"Loading…"})}),!v&&i.map(S=>a.jsx(Rg,{row:S},`${S.taskId}-${S.detectedAt}`))]})]}),a.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:v?"loading…":u===0?"no violations":`${(d-1)*Di+1}–${Math.min(d*Di,u)} of ${u}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] ${y<=1?"invisible":""}`,style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>m(S=>Math.max(1,S-1)),disabled:d===1||v,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[d," / ",y]}),a.jsx("button",{type:"button",onClick:()=>m(S=>Math.min(y,S+1)),disabled:d>=y||v,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]})]})]})}function Ug({categoryAccuracy:i,categoryCorrect:c,categoryHallucinated:u}){const o=Object.keys(i??{});if(o.length===0)return a.jsx(fa,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=o.map(m=>{const v=Math.max(0,Math.min(1,i[m]??0)),h=(c==null?void 0:c[m])??0,p=(u==null?void 0:u[m])??0;return{key:m,acc:v,c:h,h:p,n:h+p}}).sort((m,v)=>v.acc-m.acc);return a.jsx("div",{className:"space-y-2",children:d.map(m=>{const v=m.acc>=.7?"bg-confirmed":m.acc>=.4?"bg-unverified":"bg-disputed",h=m.n>0?`${m.c} correct / ${m.h} hallucinated / ${m.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${m.n>0&&m.n<10?"opacity-50":""}`,title:m.n>0&&m.n<10?`${h} — low sample (n<10)`:h,children:[a.jsx("span",{className:"truncate font-mono text-[11px]",style:{color:"var(--text-dim)"},children:m.key.replace(/_/g," ")}),a.jsx("div",{className:"h-2 overflow-hidden rounded-sm",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:a.jsx("div",{className:`h-full rounded-sm transition-all ${v}`,style:{width:`${m.acc*100}%`}})}),a.jsx("span",{className:"shrink-0 text-right font-mono text-[10px] tabular-nums w-16",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:m.n>0?a.jsxs(a.Fragment,{children:[m.c,"/",m.n,m.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",m.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(m.acc*100),"%"]})]},m.key)})})}const qg=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function Bg(i,c,u){return(!i||!qg.has(i))&&c!==void 0&&u!==void 0&&u>0}const Lg={silent_skill:"No signals recorded after bind — skill may not be injecting correctly",insufficient_evidence:"Fewer than 80 post-bind signals — verdict pending more data",inconclusive:"Mixed signals — needs further evaluation",passed:"Skill verified effective",failed:"Skill verified ineffective",pending:"Awaiting evidence",flagged_for_manual_review:"Manual review required"},Hg={pending:"border-border/50",passed:"border-confirmed/40 bg-confirmed/10 text-confirmed",failed:"border-disputed/40 bg-disputed/10 text-disputed",silent_skill:"border-unverified/40 bg-unverified/10 text-unverified",insufficient_evidence:"border-unverified/40 bg-unverified/10 text-unverified",inconclusive:"border-[color:var(--warn)]/40 bg-[color:var(--warn)]/10 text-[color:var(--warn)]",flagged_for_manual_review:"border-disputed/40 bg-disputed/10 text-disputed"};function $g(i){const c=Math.round(i*100),u=c>0?"+":"";return c>0?{text:`${u}${c}pp`,cls:"text-confirmed"}:c<0?{text:`${u}${c}pp`,cls:"text-disputed"}:{text:`${u}${c}pp`,cls:"",clsStyle:{color:"var(--text-dim)"}}}function Gg({slot:i}){const c=i.status,u=c?Hg[c]:"border-border/50",o=!c||c==="pending"?{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"}:void 0,d=c==="inconclusive"&&(i.inconclusiveStrikes??0)>0,m=i.forcedDevelops??[],v=m.length>0?m[m.length-1]:null,h=typeof i.effectiveness=="number"?$g(i.effectiveness):null,p=Bg(c,i.postBindSignals,i.minEvidence);return a.jsxs("div",{className:`rounded-md border p-3 ${i.enabled?"border-border/50":"border-border/30 opacity-60"}`,style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsxs("span",{className:`font-mono text-xs font-semibold ${i.enabled?"":"line-through"}`,style:{color:i.enabled?"var(--text)":"var(--text-dim)"},children:[i.mode==="contextual"&&"⚡ ",i.name]}),a.jsx("span",{className:"rounded-sm px-1.5 py-0.5 font-mono text-[9px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:i.source}),i.mode==="contextual"&&a.jsx("span",{className:"warn-badge rounded-sm px-1.5 py-0.5 font-mono text-[9px]",children:"contextual"})]}),a.jsxs("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:["bound ",Pe(i.boundAt)]}),p&&(()=>{const g=i.postBindSignals,y=i.minEvidence,S=Math.round(g/y*100),R=Math.min(g/y,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${y} post-bind signals (${S}%)`,children:[a.jsxs("div",{className:"mb-0.5 font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["post-bind: ",g," / ",y]}),a.jsx("div",{className:"relative h-1 w-full overflow-hidden rounded-full border border-border/40",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:a.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full border-r border-confirmed/40 bg-confirmed/20",style:{width:`${R}%`}})})]})})()]}),c&&a.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${u}`,style:o,title:Lg[c],children:c.replace(/_/g," ")})]}),a.jsxs("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px]",children:[h&&a.jsx("span",{className:h.cls,style:h.clsStyle,title:"Effectiveness: change in hallucination rate pre/post",children:h.text}),d&&a.jsxs("span",{className:"text-unique",title:i.inconclusiveAt?`last strike ${Pe(i.inconclusiveAt)}`:void 0,children:[i.inconclusiveStrikes," strike",i.inconclusiveStrikes===1?"":"s"]})]}),m.length>0&&a.jsxs("div",{className:"mt-2 border-t border-border/40 pt-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},title:v!=null&&v.reason?`latest: ${v.reason}`:void 0,children:["forced ",m.length," time",m.length===1?"":"s",v&&` · last ${Pe(v.timestamp)}`]})]})}function Yg({open:i,onOpenChange:c,children:u}){return k.useEffect(()=>{if(!i)return;const o=m=>{m.key==="Escape"&&c(!1)};document.addEventListener("keydown",o);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=d}},[i,c]),i?a.jsxs("div",{className:"fixed inset-0 z-50",children:[a.jsx("div",{className:"absolute inset-0 backdrop-blur-sm",style:{background:"color-mix(in oklch, var(--surface) 70%, transparent)"},onClick:()=>c(!1)}),a.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:a.jsx("div",{onClick:o=>o.stopPropagation(),className:"contents",children:u})})]}):null}function Xg({side:i="right",className:c="",children:u,style:o,...d}){return a.jsx("div",{className:`h-full p-6 ${c}`,style:{background:"var(--surface-elev)",...o},...d,children:u})}function Vg({className:i="",...c}){return a.jsx("div",{className:`mb-2 ${i}`,...c})}function Qg({className:i="",...c}){return a.jsx("h2",{className:`font-semibold ${i}`,...c})}function Zg({citation:i}){const c=i.snippet.split(`
|
|
78
|
+
`);return a.jsxs("div",{className:"rounded-md border border-border/40 overflow-hidden",style:{background:"color-mix(in oklch, var(--surface-elev) 60%, transparent)"},children:[a.jsx("div",{className:"flex items-center justify-between px-3 py-1 border-b border-border/40",style:{background:"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"},children:a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[i.file,":",i.line]})}),a.jsx("pre",{className:"overflow-x-auto",style:{background:"var(--surface-sunk)",borderLeft:"3px solid var(--border-strong)",padding:"12px 16px",borderRadius:"6px",fontFamily:"var(--font-mono)",fontSize:"12px",color:"var(--text)"},children:c.map((u,o)=>a.jsx("div",{className:"whitespace-pre",children:u||" "},o))})]})}const sh={critical:"text-red-400 bg-red-500/10",high:"text-severity-high bg-severity-high/10",medium:"text-yellow-400 bg-yellow-500/10",low:""},Kg={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},ih={confirmed:"text-confirmed bg-confirmed/10 border border-confirmed/20",disputed:"text-disputed bg-disputed/10 border border-disputed/20",unverified:"text-unverified bg-unverified/10 border border-unverified/20",unique:"text-unique bg-unique/10 border border-unique/20",insight:"text-insight bg-insight/10 border border-insight/20",newFinding:"text-unique bg-unique/10 border border-unique/20"},Jg={background:"var(--surface-elev)",borderRadius:"16px 0 0 16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function Fg(){const i=(c,u)=>a.jsx("div",{className:`${c} ${u} rounded`,style:{background:"var(--border)",opacity:.4}});return a.jsxs("div",{className:"mt-4 space-y-4","aria-busy":"true",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[i("h-3.5","w-12"),i("h-3.5","w-14"),i("h-3.5","w-16")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-full"),i("h-2","w-[92%]"),i("h-2","w-[70%]")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-16"),i("h-12","w-full")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-16"),i("h-2","w-[60%]"),i("h-2","w-[45%]")]}),a.jsxs("div",{className:"space-y-2",children:[i("h-2","w-20"),i("h-2","w-full"),i("h-2","w-[80%]")]})]})}function $i({open:i,onOpenChange:c,consensusId:u,findingId:o}){const[d,m]=k.useState(null),[v,h]=k.useState(null);return k.useEffect(()=>{if(!i||!u||!o){m(null),h(null);return}m(null),h(null),We(`finding/${encodeURIComponent(u)}/${encodeURIComponent(o)}`).then(m).catch(p=>h(p.message||"failed to load finding"))},[i,u,o]),a.jsx(Yg,{open:i,onOpenChange:c,children:a.jsxs(Xg,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",style:Jg,children:[a.jsx(Vg,{children:a.jsx(Qg,{className:"font-mono text-sm",style:{color:"var(--text)"},children:"Finding detail"})}),v&&a.jsx("div",{className:"mt-4",children:a.jsx(Do,{message:v})}),!v&&!d&&a.jsx(Fg,{}),d&&a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${ih[d.finding.tag]||""}`,style:ih[d.finding.tag]?void 0:{background:"var(--surface-sunk)"},children:d.finding.tag}),d.finding.severity&&a.jsx("span",{className:`font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded ${sh[d.finding.severity]||""}`,style:d.finding.severity==="low"?Kg:sh[d.finding.severity]?void 0:{background:"var(--surface-sunk)"},children:d.finding.severity}),a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"var(--text-dim)"},children:["by ",d.finding.originalAgentId]}),d.retracted&&a.jsx("span",{className:"font-mono text-[9px] uppercase tracking-wider px-2 py-0.5 rounded bg-disputed/50",children:"retracted"})]}),a.jsx("div",{className:"font-mono text-[12px] leading-relaxed whitespace-pre-wrap",children:d.finding.finding.replace(/<cite tag="file">[^<]+<\/cite>/g,"").trim()}),d.citations.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Citations"}),d.citations.map((p,g)=>a.jsx(Zg,{citation:p},g))]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:"Coverage"}),d.finding.confirmedBy.length>0&&a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-confirmed",children:"✓"})," confirmed by ",d.finding.confirmedBy.join(", ")]}),d.finding.disputedBy.map((p,g)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",p.agentId,": ",a.jsx("span",{style:{color:"var(--text-dim)"},children:p.reason})]},g)),d.finding.confirmedBy.length===0&&d.finding.disputedBy.length===0&&a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-dim)"},children:"No peer review"})]}),d.signals.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"font-mono text-[10px] uppercase tracking-wider",style:{color:"var(--text-dim)"},children:["Signals (",d.signals.length,")"]}),a.jsx("div",{className:"space-y-1",children:d.signals.map((p,g)=>a.jsxs("div",{className:"text-[11px] border-l-2 border-border/40 pl-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono font-semibold",children:p.signal}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"·"}),a.jsx("span",{children:p.agentId}),p.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--text-dim)"},children:"→"}),a.jsx("span",{children:p.counterpartId})]}),a.jsx("span",{className:"ml-auto",style:{color:"var(--text-dim)"},children:Pe(p.timestamp)})]}),p.evidence&&a.jsx("div",{className:"mt-0.5",style:{color:"var(--text-dim)"},children:p.evidence.slice(0,200)})]},g))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:Sn(`/consensus/${d.consensusId}`),className:"font-mono text-[10px] hover:underline",style:{color:"var(--accent)"},children:["→ consensus round ",d.consensusId]})})]})]})})}const Ig={agreement:"text-confirmed bg-confirmed/10",consensus_verified:"text-confirmed bg-confirmed/10",unique_confirmed:"text-unique bg-unique/10",unique_unconfirmed:"text-unique bg-unique/10",new_finding:"text-unique bg-unique/10",disagreement:"text-disputed bg-disputed/10",hallucination_caught:"text-disputed bg-disputed/10",unverified:"text-unverified bg-unverified/10"};function Wg({agentId:i}){const[c,u]=k.useState([]),[o,d]=k.useState(!0),[m,v]=k.useState("all"),[h,p]=k.useState(null);k.useEffect(()=>{let R=!1;return d(!0),We(`signals?agent=${encodeURIComponent(i)}&limit=100`).then(J=>{R||(u(J.items||[]),d(!1))}).catch(()=>{R||(u([]),d(!1))}),()=>{R=!0}},[i]);const g=[...c].sort((R,J)=>(J.timestamp||"").localeCompare(R.timestamp||"")),y=m==="all"||m==="signals"?g:[],S=({k:R,label:J,enabled:$})=>a.jsx("button",{type:"button",onClick:()=>$&&v(R),disabled:!$,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${$?"":"opacity-40 cursor-not-allowed"}`,style:m===R?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:J});return a.jsxs("div",{className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("span",{className:"h-section",children:"Activity"}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(S,{k:"all",label:"All",enabled:!0}),a.jsx(S,{k:"signals",label:"Signals",enabled:!0}),a.jsx(S,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(S,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),o?a.jsx("div",{className:"py-6 text-center text-xs",style:{color:"var(--text-dim)"},children:"Loading…"}):y.length===0?a.jsx(fa,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:y.map((R,J)=>{const $=Ig[R.signal]||"text-text-dim",Y=!!(R.consensusId&&R.findingId),w=a.jsxs("div",{className:"flex items-start gap-2 py-1.5",children:[a.jsx("span",{className:"shrink-0 font-mono text-[9px] tabular-nums w-16",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:Pe(R.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${$}`,children:R.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px]",style:{color:"var(--text-dim)"},children:[R.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:["→ ",R.counterpartId," · "]}),R.evidence&&a.jsx("span",{children:R.evidence.length>160?R.evidence.slice(0,160)+"…":R.evidence})]})]});return Y?a.jsx("button",{type:"button",onClick:()=>p({consensusId:R.consensusId,findingId:R.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/10",children:w},J):a.jsx("div",{children:w},J)})}),a.jsx($i,{open:!!h,onOpenChange:R=>{R||p(null)},consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function Pg(){const i=k.useRef(null),[c,u]=k.useState(0);return k.useEffect(()=>{const o=i.current;if(!o||typeof ResizeObserver>"u")return;const d=new ResizeObserver(m=>{for(const v of m)u(v.contentRect.width)});return d.observe(o),()=>d.disconnect()},[]),[i,c]}const rh={agreement:"bg-confirmed",consensus_verified:"bg-confirmed",unique_confirmed:"bg-unique",unique_unconfirmed:"bg-unique/50",disagreement:"bg-disputed/70",hallucination_caught:"bg-disputed",new_finding:"bg-unique",unverified:"bg-unverified",citation_fabricated:"bg-amber-500",boundary_escape:"bg-destructive"},ey={agreement:"Confirmed",consensus_verified:"Confirmed",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique (unconfirmed)",disagreement:"Disputed",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified",citation_fabricated:"Fabricated citation",boundary_escape:"Process violation"},ty=6,ny=500,wh=100,ly=150;function ay(i){if(i<=0)return wh;const c=Math.floor(i/ty);return Math.max(1,Math.min(c,ny))}function sy({agentId:i}){const[c,u]=k.useState([]),[o,d]=k.useState(0),[m,v]=k.useState(!1),[h,p]=k.useState(null),[g,y]=Pg(),[S,R]=k.useState(wh),J=k.useRef(null);k.useEffect(()=>{if(y<=0)return;const Q=ay(y);return J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{R(ne=>ne===Q?ne:Q)},ly),()=>{J.current&&clearTimeout(J.current)}},[y]),k.useEffect(()=>{We(`signals?agent=${encodeURIComponent(i)}&limit=${S}`).then(Q=>{u(Q.items||[]),d(Q.total||0)}).catch(()=>{})},[i,S]);const $=k.useMemo(()=>[...c].reverse(),[c]),Y={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const Q of c)Q.signal==="agreement"||Q.signal==="consensus_verified"?Y.confirmed++:Q.signal==="disagreement"||Q.signal==="hallucination_caught"?Y.disputed++:Q.signal==="unique_confirmed"||Q.signal==="unique_unconfirmed"||Q.signal==="new_finding"?Y.unique++:Q.signal==="unverified"?Y.unverified++:Q.signal==="citation_fabricated"&&Y.fabricated++;const w=c.length,W=o>w;return c.length===0?a.jsx("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:a.jsx(fa,{title:"No signal history yet",hint:"Signals are recorded during consensus rounds.",compact:!0})}):a.jsxs("div",{ref:g,className:"rounded-md border border-border/40 px-4 py-3",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("span",{className:"h-section",children:"Signal Timeline"}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:W?`last ${w} of ${o}`:`${o} total`})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[a.jsxs("span",{className:"text-confirmed",children:[Y.confirmed," confirmed"]}),Y.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[Y.disputed," disputed"]}),Y.unique>0&&a.jsxs("span",{className:"text-unique",children:[Y.unique," unique"]}),Y.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[Y.unverified," unverified"]}),Y.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[Y.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:$.map((Q,ne)=>{const V=!!(Q.consensusId&&Q.findingId);return a.jsx("button",{type:"button",disabled:!V,onClick:()=>{Q.consensusId&&Q.findingId&&(p({consensusId:Q.consensusId,findingId:Q.findingId}),v(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${rh[Q.signal]||""} ${V?"cursor-pointer":"cursor-default"}`,style:rh[Q.signal]?void 0:{background:"var(--surface-sunk)"},title:`${ey[Q.signal]||Q.signal} — ${Pe(Q.timestamp)}${V?" (click for detail)":""}`},ne)})}),a.jsx("div",{className:"mt-2 flex flex-wrap gap-3",children:[{color:"bg-confirmed",label:"Confirmed"},{color:"bg-disputed",label:"Disputed"},{color:"bg-unique",label:"Unique (confirmed)"},{color:"bg-unique/50",label:"Unique (unconfirmed)"},{color:"bg-unverified",label:"Unverified"},{color:"bg-amber-500",label:"Fabricated citation"}].map(Q=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${Q.color}`}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:Q.label})]},Q.label))}),a.jsx($i,{open:m,onOpenChange:v,consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function iy(i){const c=i.toLowerCase();return c==="completed"||c==="done"||c==="success"||c==="succeeded"?"completed":c==="running"||c==="active"||c==="in_progress"||c==="pending"?"running":c==="failed"||c==="error"||c==="errored"||c==="timeout"||c==="timed_out"?"failed":c==="cancelled"||c==="canceled"||c==="queued"||c==="waiting"?"cancelled":"unknown"}const ry={completed:{label:"Done",iconBox:"bg-confirmed/10 border-confirmed/30",text:"text-confirmed",pulse:!1},running:{label:"Running",iconBox:"bg-unverified/10 border-unverified/30",text:"text-unverified",pulse:!0},failed:{label:"Failed",iconBox:"bg-bad/10 border-bad/30",text:"text-bad",pulse:!1},cancelled:{label:"Cancelled",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1},unknown:{label:"Unknown",iconBox:"border-muted-foreground/25",text:"",textStyle:{color:"var(--text-dim)",background:"color-mix(in oklch, var(--text-dim) 10%, transparent)"},pulse:!1}},cy={completed:a.jsx("polyline",{points:"5 12 10 17 19 7"}),running:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"3",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.45"})]}),failed:a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]}),cancelled:a.jsx("line",{x1:"6",y1:"12",x2:"18",y2:"12"}),unknown:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.8.4-1 .9-1 1.7"}),a.jsx("line",{x1:"12",y1:"16.5",x2:"12",y2:"16.5"})]})};function oy(i){if(!i)return"—";if(i<1e3)return"< 1s";if(i<6e4)return Math.floor(i/1e3)+"s";if(i<36e5){const o=Math.floor(i/6e4),d=Math.floor(i%6e4/1e3);return d>0?`${o}m ${d}s`:`${o}m`}const c=Math.floor(i/36e5),u=Math.floor(i%36e5/6e4);return u>0?`${c}h ${u}m`:`${c}h`}function Ah({task:i,onClick:c}){const u=iy(i.status),o=ry[u];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/10 transition-colors ${c?"cursor-pointer":""}`,onClick:c?d=>{d.target.closest("a")||c(i)}:void 0,children:[a.jsx("td",{className:"py-2.5 pl-4 pr-2",children:a.jsxs("span",{className:"inline-flex items-center gap-2","aria-label":`Status: ${o.label}`,children:[a.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${o.iconBox} ${o.text} ${o.pulse?"animate-pulse":""}`,style:o.textStyle,"aria-hidden":!0,children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:cy[u]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${o.text}`,style:o.textStyle,children:o.label})]})}),a.jsx("td",{className:"py-2.5 pr-3",children:a.jsx("span",{className:"warn-badge rounded px-2 py-1 font-mono text-[10px] font-semibold",title:i.taskId,children:i.taskId.slice(0,8)})}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs",style:{color:"var(--text-dim)"},children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(i.agentId)}`,className:"inline-flex items-center gap-1.5 transition",children:[a.jsx("span",{className:"inline-block h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:en(i.agentId)}}),i.agentId]})}),a.jsx("td",{className:"py-2.5 pr-3 text-xs leading-snug",style:{color:"color-mix(in oklch, var(--text) 80%, transparent)"},children:(()=>{const d=i.task.replace(/\n.*/s,"");return d.length>100?d.slice(0,100)+"…":d})()}),a.jsx("td",{className:"py-2.5 pr-3 font-mono text-xs",style:{color:"var(--text-dim)"},children:u==="running"?"running":oy(i.duration)}),a.jsx("td",{className:"py-2.5 pr-4 text-right font-mono text-xs",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:Pe(i.timestamp)})]})}function Xe({className:i="",style:c}){return a.jsx("div",{className:`rounded ${i}`,style:{background:"color-mix(in oklch, var(--border) 40%, transparent)",...c}})}function uy(){return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 px-6 py-6",children:[a.jsx(Xe,{className:"h-48 w-full"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsx(Xe,{className:"h-36"}),a.jsx(Xe,{className:"h-36"}),a.jsx(Xe,{className:"h-36"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsx(Xe,{className:"h-48"}),a.jsx(Xe,{className:"h-48"})]})]})}function dy(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Xe,{className:"mb-2 h-7 w-32"}),a.jsx(Xe,{className:"h-3 w-48"})]}),a.jsx("div",{className:"grid grid-cols-2 gap-px sm:grid-cols-4",children:Array.from({length:4}).map((i,c)=>a.jsx(Xe,{className:"h-16"},c))}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:6}).map((i,c)=>a.jsx(Xe,{className:"h-12"},c))})]})}function fy(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Xe,{className:"mb-2 h-7 w-24"}),a.jsx(Xe,{className:"h-3 w-32"})]}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:8}).map((i,c)=>a.jsx(Xe,{className:"h-11"},c))})]})}function my(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Xe,{className:"mb-2 h-7 w-48"}),a.jsx(Xe,{className:"h-3 w-64"})]}),a.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((i,c)=>a.jsxs("div",{className:"overflow-hidden rounded-md",children:[a.jsx(Xe,{className:"h-14"}),a.jsx("div",{className:"mt-px space-y-px",children:Array.from({length:3}).map((u,o)=>a.jsx(Xe,{className:"h-10"},o))})]},c))})]})}function hy(){return a.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((i,c)=>a.jsxs("div",{className:"flex items-start gap-3 py-2",children:[a.jsx(Xe,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-sm"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(Xe,{className:"h-3 w-3/4"}),a.jsx(Xe,{className:"h-3 w-1/2"})]})]},c))})}function xy(){return a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:5}).map((i,c)=>a.jsx(Xe,{className:"h-10"},c))})}const py=3,vy=720*60*60*1e3;function gy({agentId:i,agents:c,tasks:u,consensus:o}){const d=c.find(U=>U.id===i),[m,v]=k.useState([]),[h,p]=k.useState(!0),[g,y]=k.useState([]),[S,R]=k.useState(!0),[J,$]=k.useState(null),[Y,w]=k.useState(null),[W,Q]=k.useState(null),[ne,V]=k.useState(0),[T,Z]=k.useState(0),[z,K]=k.useState(null);k.useEffect(()=>{p(!0),We(`memory/${i}`).then(U=>{v(U.knowledge||[])}).catch(()=>v([])).finally(()=>p(!1))},[i]),k.useEffect(()=>{let U=!1;return R(!0),We("consensus-reports?page=1&pageSize=200").then(se=>{U||y(se.reports||[])}).catch(()=>{U||y([])}).finally(()=>{U||R(!1)}),()=>{U=!0}},[]);const le=k.useMemo(()=>{var we;const U=Date.now(),se=new Map;for(const ye of g){const Je=Date.parse(ye.timestamp);if(Number.isNaN(Je)||U-Je>vy)continue;const Ct=(we=ye.authorDiagnostics)==null?void 0:we[i];if(Ct)for(const mt of Ct)se.set(mt.code,(se.get(mt.code)??0)+1)}const oe=[];for(const[ye,Je]of se)Je>=py&&oe.push({code:ye,count:Je});return oe},[g,i]);if(!d)return a.jsxs("div",{className:"py-20 text-center",style:{color:"var(--text-dim)"},children:["Agent not found: ",i]});const F=d.scores,de=(u==null?void 0:u.items.filter(U=>U.agentId===i))||[],ee=(o==null?void 0:o.runs.filter(U=>U.agents.includes(i)))||[],ae=[{label:"accuracy",value:F.accuracy,fill:F.accuracy>=.7?"bg-confirmed":F.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"unique",value:F.uniqueness,fill:"bg-unique"},{label:"impact",value:F.impactScore,fill:"bg-[var(--c8)]"}],he=F.unverifiedsEmitted??0,M=F.unverifiedsReceived??0,E=he+M,L=[{label:"Signals",value:String(F.signals),color:"",colorStyle:{color:"var(--text)"}},{label:"Agreements",value:String(F.agreements),color:"text-confirmed",colorStyle:void 0},{label:"Disagreements",value:String(F.disagreements),color:"text-disputed",colorStyle:void 0},{label:"Hallucinations",value:String(F.hallucinations),color:F.hallucinations>0?"text-disputed":"",colorStyle:F.hallucinations>0?void 0:{color:"var(--text-dim)"}},{label:"Unverified",value:E>0?`${he}↑ ${M}↓`:"0",color:E>0?"text-unverified":"",colorStyle:E>0?void 0:{color:"var(--text-dim)"},title:E>0?`${he} emitted (as reviewer) · ${M} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"",colorStyle:{color:"var(--text)"}}],te=10,ce=Math.max(1,Math.ceil(de.length/te)),fe=Math.min(ne,ce-1),j=de.slice(fe*te,(fe+1)*te),q=k.useMemo(()=>{const U=new Map;for(const se of m){const oe=se.filename.match(/^(\d{4}-\d{2}-\d{2})/),we=oe?oe[1]:"undated",ye=U.get(we)||[];ye.push(se),U.set(we,ye)}return Array.from(U.entries()).sort(([se],[oe])=>se==="undated"?1:oe==="undated"?-1:oe.localeCompare(se)).map(([se,oe])=>({day:se,items:oe}))},[m]),P=Math.min(T,Math.max(0,q.length-1)),X=q[P];return a.jsxs(a.Fragment,{children:[(()=>{const U=zo(F);return U==="benched"?a.jsx("div",{className:"mb-6 rounded-lg border border-destructive/30 bg-destructive/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-destructive",children:"BENCHED"}),a.jsxs("span",{className:"text-xs text-destructive/70",children:["Auto-bench rule fired (",F.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):U==="struggling"?a.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"STRUGGLING"}),a.jsxs("span",{className:"text-xs text-unverified/70",children:[F.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):U==="kept-for-coverage"?a.jsx("div",{className:"mb-6 rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"KEPT FOR COVERAGE"}),a.jsxs("span",{className:"text-xs text-unverified/70",children:["Would be benched (",F.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),le.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:le.map(({code:U,count:se})=>a.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":U,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs font-bold text-unverified",children:"PARSE DIAGNOSTIC"}),a.jsx("span",{className:"font-mono text-[11px] text-unverified/80",dangerouslySetInnerHTML:{__html:Mo(U)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",se," fires in 30d"]})]}),a.jsxs("div",{className:"mt-1 text-xs",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["This agent's raw output has repeatedly tripped ",a.jsx("span",{className:"font-mono",children:U}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},U))}),a.jsx("div",{"data-theme":"dark",className:"relative mb-6 rounded-xl border border-border p-5",style:{background:"var(--surface-elev)",color:"var(--text)"},children:a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsx("div",{className:"relative shrink-0","data-tooltip":`Accuracy ${Math.round(F.accuracy*100)}% · Uniqueness ${Math.round(F.uniqueness*100)}% · Impact ${Math.round(F.impactScore*100)}%`,children:a.jsx(fs,{agentId:d.id,size:120,signals:F.signals,accuracy:F.accuracy,uniqueness:F.uniqueness,impact:F.impactScore})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h1",{className:"truncate font-mono text-2xl font-bold",style:{color:"var(--text)"},children:d.id}),a.jsxs("p",{className:"mt-1 text-sm",style:{color:"var(--text-dim)"},children:[d.provider,"/",d.model]}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold ${d.native?"":"text-confirmed bg-confirmed/10"}`,style:d.native?{color:"var(--idle)",background:"color-mix(in oklch, var(--idle) 10%, transparent)"}:void 0,children:d.native?"NATIVE":"RELAY"}),d.preset&&a.jsx("span",{className:"rounded-sm px-2 py-0.5 font-mono text-[10px]",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:d.preset}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[F.signals," signals",d.lastTask?` · ${Pe(d.lastTask.timestamp)}`:""]})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col items-end rounded-md border border-border px-3 py-2",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},"data-tooltip":`Dispatch weight ${F.dispatchWeight.toFixed(2)}
|
|
79
|
+
Scale 0.3 → 2.0`,"data-tooltip-pos":"left",children:[a.jsx("span",{className:"font-mono text-2xl font-bold tabular-nums leading-none",style:{color:"var(--text)"},children:F.dispatchWeight.toFixed(2)}),a.jsx("span",{className:"mt-1 font-mono text-[9px] uppercase",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"weight"})]})]})}),a.jsx("section",{className:"mb-6",children:a.jsx(sy,{agentId:i})}),a.jsxs("section",{className:"mb-8 grid grid-cols-1 gap-6 lg:grid-cols-2",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"mb-3 h-section",children:"Metrics"}),a.jsxs("div",{className:"rounded-lg border border-border/40 p-4",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsx("div",{className:"space-y-2.5",children:ae.map(U=>a.jsxs("div",{className:"grid grid-cols-[72px_1fr_44px] items-center gap-3",children:[a.jsx("span",{className:"h-section",style:{color:"var(--text-dim)",fontSize:"10px"},children:U.label}),a.jsx("div",{className:"h-1.5 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--surface) 80%, transparent)"},children:a.jsx("div",{className:`h-full rounded-full transition-all ${U.fill}`,style:{width:`${Math.max(0,Math.min(100,U.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(U.value*100),"%"]})]},U.label))}),a.jsx("div",{className:"mt-4 grid grid-cols-6 gap-px overflow-hidden rounded-md border border-border/30 bg-border/30",children:L.map(U=>a.jsxs("div",{className:"px-2 py-2 text-center",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},title:U.title,children:[a.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${U.color}`,style:U.colorStyle,children:U.value}),a.jsx("div",{className:"mt-0.5 font-mono text-[9px] uppercase tracking-wider",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:U.label})]},U.label))})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"mb-1 h-section",children:"Category Competency"}),a.jsx("p",{className:"mb-3 mt-0.5 font-mono text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:"◆ Raw per-category ratio — unweighted. Overall accuracy in Metrics applies a hallucination penalty."}),a.jsx(Ug,{categoryAccuracy:F.categoryAccuracy,categoryCorrect:F.categoryCorrect,categoryHallucinated:F.categoryHallucinated})]})]}),(d.skillSlots.length>0||d.skills.length>0)&&a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 h-section",children:["Skills ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:d.skillSlots.length||d.skills.length})]}),d.skillSlots.length>0?a.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:d.skillSlots.map(U=>a.jsx(Gg,{slot:U},U.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(U=>a.jsx("span",{className:"rounded-sm border border-border px-2.5 py-1 font-mono text-xs",style:{background:"var(--surface-elev)",color:"var(--text-dim)"},children:U},U))})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Tasks ",a.jsx("span",{style:{color:"var(--ink)",fontWeight:700},children:de.length})]}),ce>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>V(U=>Math.max(0,U-1)),disabled:fe===0,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:[fe+1," / ",ce]}),a.jsx("button",{onClick:()=>V(U=>Math.min(ce-1,U+1)),disabled:fe>=ce-1,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}),de.length>0?a.jsx("div",{className:"overflow-hidden rounded-md border border-border/40",children:a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border",style:{background:"var(--surface-elev)"},children:[a.jsx("th",{className:"py-2 pl-4 pr-2 text-xs font-medium",style:{width:32,color:"var(--text-dim)"}}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"ID"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"Agent"}),a.jsx("th",{className:"py-2 pr-3 text-xs font-medium",style:{color:"var(--text-dim)"},children:"Description"}),a.jsx("th",{className:"py-2 pr-3 font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"Duration"}),a.jsx("th",{className:"py-2 pr-4 text-right font-mono text-xs font-medium",style:{color:"var(--text-dim)"},children:"When"})]})}),a.jsx("tbody",{children:j.map(U=>a.jsx(Ah,{task:U,onClick:K},U.taskId))})]})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No tasks recorded."})]}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("h2",{className:"mb-3 h-section",children:["Consensus Runs",!S&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",ee.length]})]}),S?a.jsx(xy,{}):ee.length>0?a.jsx("div",{className:"space-y-2",children:ee.slice(0,20).map((U,se)=>{const oe=U.counts,we=(oe.agreement||0)+(oe.disagreement||0)+(oe.hallucination||0)+(oe.unverified||0)+(oe.unique||0)+(oe.new||0),ye=we||1,Je=[{key:"confirmed",count:oe.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(oe.disagreement||0)+(oe.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:oe.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(oe.unique||0)+(oe.new||0),color:"bg-unique",text:"text-unique"}],Ct={agreement:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},consensus_verified:{label:"CONFIRMED",cls:"text-confirmed bg-confirmed/10"},disagreement:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},hallucination_caught:{label:"DISPUTED",cls:"text-disputed bg-disputed/10"},unverified:{label:"UNVERIFIED",cls:"text-unverified bg-unverified/10"},unique_confirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},unique_unconfirmed:{label:"UNIQUE",cls:"text-unique bg-unique/10"},new_finding:{label:"NEW",cls:"text-unique bg-unique/10"}},mt=U.signals.filter(Ae=>Ae.signal!=="signal_retracted"&&Ct[Ae.signal]),kn=U.taskId+":"+se,jt=Y===kn;return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"var(--surface-elev)"},children:[a.jsx("button",{type:"button",onClick:()=>w(jt?null:kn),disabled:mt.length===0,className:`flex w-full items-center p-3 text-left transition ${mt.length>0?"hover:bg-accent/20":"cursor-default"}`,children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"font-mono text-sm font-semibold",style:{color:"var(--text)"},children:[mt.length>0&&a.jsx("span",{className:"mr-1.5 inline-block",style:{color:"var(--text-dim)"},children:jt?"▾":"▸"}),we," findings"]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:Pe(U.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:Je.map(Ae=>Ae.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Ae.text}`,children:[Ae.count," ",Ae.key]},Ae.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:Je.map(Ae=>Ae.count>0&&a.jsx("div",{className:Ae.color,style:{width:`${Ae.count/ye*100}%`}},Ae.key))})]})}),jt&&mt.length>0&&a.jsx("div",{className:"border-t border-border/30 px-3 pb-2 pt-2",children:a.jsx("div",{className:"space-y-1",children:mt.map((Ae,nn)=>{const Zt=Ct[Ae.signal],_n=!!(Ae.findingId&&U.taskId),I=a.jsxs("div",{className:"flex items-start gap-2 py-1",children:[a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${Zt.cls}`,children:Zt.label}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"finding-md text-xs [&_.cite-file]:rounded [&_.cite-file]:bg-[color-mix(in_oklch,var(--cite-file)_10%,transparent)] [&_.cite-file]:px-1 [&_.cite-file]:font-mono [&_.cite-file]:text-[var(--cite-file)] [&_.cite-fn]:rounded [&_.cite-fn]:bg-[color-mix(in_oklch,var(--cite-fn)_10%,transparent)] [&_.cite-fn]:px-1 [&_.cite-fn]:font-mono [&_.cite-fn]:text-[var(--cite-fn)]",style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:Li(Ae.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Ae.agentId,Ae.counterpartId?` + ${Ae.counterpartId}`:""]})]})]});return _n?a.jsx("button",{type:"button",onClick:()=>Q({consensusId:U.taskId,findingId:Ae.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/10",children:I},nn):a.jsx("div",{children:I},nn)})})})]},kn)})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No consensus participation recorded."})]}),a.jsx("section",{className:"mb-8",children:a.jsx(Wg,{agentId:i})}),a.jsx($i,{open:!!W,onOpenChange:U=>{U||Q(null)},consensusId:(W==null?void 0:W.consensusId)??null,findingId:(W==null?void 0:W.findingId)??null}),a.jsx(Mh,{task:z,onClose:()=>K(null)}),a.jsxs("section",{className:"mb-8",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsxs("h2",{className:"h-section",children:["Memory",!h&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",m.length," files"]}),!h&&X&&a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["· ",X.day," (",X.items.length,")"]})]}),!h&&q.length>1&&a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{onClick:()=>Z(U=>Math.max(0,U-1)),disabled:P===0,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Newer"}),a.jsxs("span",{children:[P+1," / ",q.length]}),a.jsx("button",{onClick:()=>Z(U=>Math.min(q.length-1,U+1)),disabled:P>=q.length-1,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Older ▸"})]})]}),h?a.jsx(hy,{}):X&&X.items.length>0?a.jsx("div",{className:"space-y-1.5",children:X.items.map(U=>{var ye,Je;const se=J===U.filename,oe=((ye=U.frontmatter)==null?void 0:ye.type)||"memory",we=((Je=U.frontmatter)==null?void 0:Je.name)||U.filename.replace(/\.md$/,"");return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:[a.jsxs("button",{onClick:()=>$(se?null:U.filename),className:"flex w-full items-center gap-2 p-3 text-left transition hover:bg-accent/10",children:[a.jsx("span",{className:"font-mono text-xs",style:{color:se?"var(--text)":"var(--text-dim)"},children:se?"▾":"▸"}),a.jsx("span",{className:"shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase",style:{background:"var(--surface-sunk)",color:"var(--text-dim)"},children:oe}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold",style:{color:"var(--text)"},children:we}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:U.filename})]}),se&&a.jsx("div",{className:"border-t border-border px-4 py-3",children:a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-xs leading-relaxed",style:{color:"var(--text-dim)"},children:U.content})})]},U.filename)})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No memory files."})]})]})}const ch={dispatch:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},consensus:{color:"color-mix(in oklch, var(--info) 80%, transparent)"},error:{},timeout:{},worker:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},gemini:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},skill:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},boot:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},relay:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},gossip:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},utility:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},memory:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},persist:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},toolserver:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},other:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"}},yy={error:"text-disputed",timeout:"text-unverified"},by=[[/^\[gossipcat\]\s*\[worker:/,"worker"],[/^\[gossipcat\]\s*\[Gemini\]/,"gemini"],[/^\[gossipcat\]\s*\[ToolServer\]/,"toolserver"],[/^\[gossipcat\]\s*dispatch\b/,"dispatch"],[/^\[gossipcat\]\s*relay\b/,"relay"],[/^\[gossipcat\]\s*Cross-review\b/,"consensus"],[/^\[gossipcat\]\s*Consensus\b/,"consensus"],[/^\[gossipcat\]\s*Skill\b/,"skill"],[/^\[gossipcat\]\s*Bootstrap\b/,"boot"],[/^\[gossipcat\]\s*Booted:/,"boot"],[/^\[gossipcat\]\s*Dashboard:/,"boot"],[/^\[gossipcat\]\s*Adaptive\b/,"boot"],[/^\[gossipcat\]\s*Gossip\b/,"gossip"],[/^\[gossipcat\]\s*utility\b/,"utility"],[/^\[gossipcat\]\s*Compacted\b/,"memory"],[/native agent/,"boot"],[/persist|Persist/,"persist"],[/timeout|Timeout|timed.out/,"timeout"],[/^\[gossipcat\].*(?:Error|error|failed|Failed)/,"error"]];function jy(i){for(const[c,u]of by)if(c.test(i))return u;return"other"}const Ny=[{key:"all",label:"All"},{key:"dispatch",label:"Dispatch"},{key:"consensus",label:"Consensus"},{key:"error",label:"Errors"},{key:"timeout",label:"Timeouts"},{key:"worker",label:"Workers"},{key:"skill",label:"Skills"},{key:"relay",label:"Relay"},{key:"boot",label:"Boot"}],oh=1e3;function Sy(){const[i,c]=k.useState([]),[u,o]=k.useState(0),[d,m]=k.useState(0),[v,h]=k.useState("all"),[p,g]=k.useState(!0),[y,S]=k.useState(!0),R=k.useRef(null),J=k.useRef(0);k.useEffect(()=>{let w=!1;return(async()=>{try{const Q=await We("logs?tail=500");if(w)return;c(Q.entries),o(Q.totalLines),m(Q.fileSize),J.current=Q.totalLines+1}catch{}})(),()=>{w=!0}},[]),k.useEffect(()=>{if(y)return Nh(w=>{var Q;if(w.type!=="log_lines")return;const W=(Q=w.data)==null?void 0:Q.lines;W!=null&&W.length&&c(ne=>{const V=W.map((Z,z)=>({line:J.current+z,text:Z,category:jy(Z)}));J.current+=W.length,o(Z=>Z+W.length);const T=[...ne,...V];return T.length>oh?T.slice(-oh):T})})},[y]),k.useEffect(()=>{p&&R.current&&R.current.scrollIntoView({behavior:"smooth"})},[i,p]);const $=v==="all"?i:i.filter(w=>w.category===v),Y=k.useCallback(w=>w<1024?`${w} B`:w<1048576?`${(w/1024).toFixed(1)} KB`:`${(w/1048576).toFixed(1)} MB`,[]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-4 flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"MCP Log"}),a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:[u," lines"]}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:Y(d)}),y&&a.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-confirmed",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-confirmed"}),"live"]})]}),a.jsxs("div",{className:"mb-3 flex items-center gap-1.5",children:[Ny.map(w=>a.jsx("button",{onClick:()=>h(w.key),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:v===w.key?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:w.label},w.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>S(!y),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${y?"bg-confirmed/10 text-confirmed":""}`,style:y?void 0:{color:"var(--text-dim)"},children:y?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>g(!p),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:p?{color:"var(--ok)",background:"color-mix(in oklch, var(--ok) 10%, transparent)"}:{color:"var(--text-dim)"},children:p?"⤓ Auto":"⤓ Scroll"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md border border-border",style:{background:"var(--surface-elev)"},children:a.jsxs("div",{className:"max-h-[70vh] overflow-y-auto p-3 font-mono text-xs leading-relaxed",children:[$.map(w=>a.jsxs("div",{className:"flex gap-2 hover:bg-accent/10",children:[a.jsx("span",{className:"w-10 shrink-0 select-none text-right",style:{color:"color-mix(in oklch, var(--text-dim) 30%, transparent)"},children:w.line}),a.jsx("span",{className:yy[w.category]??"",style:ch[w.category]??ch.other,children:w.text})]},w.line)),$.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs",style:{color:"var(--text-dim)"},children:i.length===0?"Loading...":v==="all"?"No log entries in current tail.":`No ${v} entries in current tail.`}),a.jsx("div",{ref:R})]})})]})}const ky=["critical","high","medium","low"],_y=["manual","impl","meta","auto-provisional"];function uh(i,c){return i.includes(c)?i.filter(u=>u!==c):[...i,c]}const Wt="mb-1 block h-section",Pt={},In="w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none",Wn={background:"var(--surface)",color:"var(--text)"};function Ey({filters:i,onChange:c,agents:u,signalTypes:o}){const d=m=>v=>{const h=v.target.value;c({[m]:h===""?void 0:h})};return a.jsxs("aside",{className:"space-y-3 rounded-md border border-border/60 p-3",style:{background:"color-mix(in oklch, var(--surface-elev) 70%, transparent)"},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"h-section",children:"Filters"}),a.jsx("button",{type:"button",className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},onClick:()=>c({agents:[],counterpart:void 0,signals:[],category:void 0,severity:void 0,since:void 0,until:void 0,consensusId:void 0,findingId:void 0,source:void 0}),children:"clear"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Wt,style:Pt,children:["Agents (",i.agents.length," selected)"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[u.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no agents"}),u.map(m=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20",style:{color:"var(--text)"},children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:i.agents.includes(m),onChange:()=>c({agents:uh(i.agents,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Counterpart"}),a.jsxs("select",{className:In,style:Wn,value:i.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),u.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:Wt,style:Pt,children:["Signal types (",i.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[o.length===0&&a.jsx("div",{className:"px-1 py-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no signals"}),o.map(m=>a.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 px-1 py-0.5 font-mono text-[10px] hover:bg-accent/20",style:{color:"var(--text)"},children:[a.jsx("input",{type:"checkbox",className:"h-3 w-3",checked:i.signals.includes(m),onChange:()=>c({signals:uh(i.signals,m)})}),a.jsx("span",{children:m})]},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Severity"}),a.jsxs("select",{className:In,style:Wn,value:i.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),ky.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:In,style:Wn,value:i.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),_y.map(m=>a.jsx("option",{value:m,children:m},m))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Category"}),a.jsx("input",{type:"text",className:In,style:Wn,value:i.category??"",onChange:d("category"),placeholder:"e.g. trust_boundaries"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Since"}),a.jsx("input",{type:"datetime-local",className:In,style:Wn,value:i.since?i.since.slice(0,16):"",onChange:m=>c({since:m.target.value?new Date(m.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Until"}),a.jsx("input",{type:"datetime-local",className:In,style:Wn,value:i.until?i.until.slice(0,16):"",onChange:m=>c({until:m.target.value?new Date(m.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:In,style:Wn,value:i.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Wt,style:Pt,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:In,style:Wn,value:i.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const dh={agents:[],signals:[]},Ty=["agreement","consensus_verified","unique_confirmed","unique_unconfirmed","disagreement","hallucination_caught","new_finding","unverified","impl_test_pass","impl_test_fail","impl_typecheck_pass","impl_typecheck_fail","task_completed","tool_turns","format_compliance"],My={agreement:"Agreement",consensus_verified:"Consensus verified",unique_confirmed:"Unique (confirmed)",unique_unconfirmed:"Unique (unconfirmed)",disagreement:"Disagreement",hallucination_caught:"Hallucination",new_finding:"New finding",unverified:"Unverified",impl_test_pass:"Test pass",impl_test_fail:"Test fail",impl_typecheck_pass:"Typecheck pass",impl_typecheck_fail:"Typecheck fail",impl_peer_approved:"Peer approved",impl_peer_rejected:"Peer rejected",boundary_escape:"Boundary escape"},wy={agreement:"var(--ok)",consensus_verified:"var(--ok)",impl_test_pass:"var(--ok)",impl_typecheck_pass:"var(--ok)",impl_peer_approved:"var(--ok)",disagreement:"var(--bad)",hallucination_caught:"var(--bad)",impl_test_fail:"var(--bad)",impl_typecheck_fail:"var(--bad)",impl_peer_rejected:"var(--bad)",boundary_escape:"var(--bad)",unique_confirmed:"var(--unique)",unique_unconfirmed:"var(--unique)",new_finding:"var(--unique)",unverified:"var(--info)"},Ay={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"},cs=100;function Cy(){if(typeof window>"u")return{filters:dh,hadAny:!1};const i=new URLSearchParams(window.location.search),c=i.getAll("signal").filter(Boolean),u=i.get("agent"),o=i.get("counterpart")??void 0,d=i.get("category")??void 0,m=i.get("severity"),v=m==="critical"||m==="high"||m==="medium"||m==="low"?m:void 0,h=i.get("since")??void 0,p=i.get("until")??void 0,g=i.get("consensus_id")??void 0,y=i.get("finding_id")??void 0,S=i.get("source"),R=S==="manual"||S==="impl"||S==="meta"||S==="auto-provisional"?S:void 0;return c.length>0||u||o||d||v||h||p||g||y||R?{filters:{agents:u?[u]:[],signals:c,counterpart:o,category:d,severity:v,since:h,until:p,consensusId:g,findingId:y,source:R},hadAny:!0}:{filters:dh,hadAny:!1}}function zy(i,c,u=cs){const o=new URLSearchParams;o.set("limit",String(u)),o.set("offset",String(c)),i.agents.length===1&&o.set("agent",i.agents[0]),i.counterpart&&o.set("counterpart",i.counterpart);for(const d of i.signals)o.append("signal",d);return i.category&&o.set("category",i.category),i.severity&&o.set("severity",i.severity),i.since&&o.set("since",i.since),i.until&&o.set("until",i.until),i.consensusId&&o.set("consensus_id",i.consensusId),i.findingId&&o.set("finding_id",i.findingId),i.source&&o.set("source",i.source),o}function vo(i,c){return i?i.length>c?i.slice(0,c)+"…":i:""}function Dy(){const[{filters:i,hadAny:c}]=k.useState(Cy),[u,o]=k.useState(i),[d,m]=k.useState([]),[v,h]=k.useState(0),[p,g]=k.useState(0),[y,S]=k.useState(!1),[R,J]=k.useState(null),[$,Y]=k.useState([]),[w,W]=k.useState(!1),[Q,ne]=k.useState(null),[V,T]=k.useState(null),Z=k.useRef(null),z=k.useRef(0),K=k.useCallback(async(M,E)=>{const L=++z.current;S(!0),J(null);try{const te=zy(M,E*cs),ce=await We(`signals?${te.toString()}`);if(L!==z.current)return;m(ce.items??[]),g(ce.total??0)}catch(te){if(L!==z.current)return;J(te instanceof Error?te.message:"fetch failed")}finally{L===z.current&&S(!1)}},[]);k.useEffect(()=>{We("agents").then(M=>{const E=(M??[]).map(L=>L.id).filter(Boolean).sort();E.length>0&&Y(E)}).catch(()=>{})},[]),k.useEffect(()=>{h(0)},[u]),k.useEffect(()=>(Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>{K(u,v)},250),()=>{Z.current&&clearTimeout(Z.current)}),[u,v,K]);const le=k.useCallback(M=>{o(E=>({...E,...M}))},[]),F=Math.max(1,Math.ceil(p/cs)),de=Math.min(v,F-1),ee=p>0||c||y,ae=(M,E)=>{!M||!E||(ne(M),T(E),W(!0))},he=k.useMemo(()=>{const M=[];return u.agents.length&&M.push(`${u.agents.length} agents`),u.signals.length&&M.push(`${u.signals.length} signals`),u.severity&&M.push(u.severity),u.source&&M.push(u.source),(u.since||u.until)&&M.push("time window"),M.length?M.join(" · "):"all signals"},[u]);return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-baseline justify-between",children:a.jsxs("div",{children:[a.jsx("h1",{className:"h-route",children:"Signals"}),a.jsx("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:"Scored events emitted by agents during consensus review."}),a.jsxs("p",{className:"mt-0.5 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:[he," — showing ",d.length," of ",p]})]})}),c&&a.jsxs("div",{className:"rounded-md border border-border/40 px-3 py-2 font-mono text-[10px]",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"},children:["Filtered view — ",u.signals.length," signal type",u.signals.length!==1?"s":"",u.agents.length>0?` · ${u.agents.length} agent${u.agents.length!==1?"s":""}`:"",u.severity?` · severity: ${u.severity}`:"",u.source?` · source: ${u.source}`:"",". ",a.jsx("a",{href:Sn("/signals"),style:{color:"var(--accent)"},children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${ee?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[ee&&a.jsx("div",{className:c?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx(Ey,{filters:u,onChange:le,agents:$,signalTypes:Ty})}),a.jsxs("section",{className:"min-w-0 overflow-hidden rounded-md border border-border/60",style:{background:"color-mix(in oklch, var(--surface-elev) 70%, transparent)"},children:[R&&a.jsx("div",{className:"border-b border-border/60 px-3 py-2 font-mono text-[10px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)"},children:R}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full border-collapse text-[10px]",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"h-section border-b border-border/60 text-left",style:{color:"color-mix(in oklch, var(--ink-2) 80%, transparent)"},children:[a.jsx("th",{className:"w-[6px] p-0","aria-label":"severity"}),a.jsx("th",{className:"px-2 py-1.5",children:"time"}),a.jsx("th",{className:"px-2 py-1.5",children:"agent"}),a.jsx("th",{className:"px-2 py-1.5",children:"verdict"}),a.jsx("th",{className:"px-2 py-1.5",children:"finding"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"The other agent in this signal — e.g. the peer who agreed or disputed",children:"counterpart"}),a.jsx("th",{className:"px-2 py-1.5","data-tooltip":"Finding ID — click row to open finding detail",children:"id"}),a.jsx("th",{className:"px-2 py-1.5",children:"consensus"})]})}),a.jsxs("tbody",{children:[d.length===0&&!y&&a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-2 py-8 text-center font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"no signals match these filters"})}),d.map((M,E)=>{const L=!!(M.consensusId&&M.findingId),te=M.severity?Ay[M.severity]:"transparent",ce=wy[M.signal]??"var(--ink-2)",fe=My[M.signal]??M.signal;return a.jsxs("tr",{className:`border-b border-border/30 ${L?"cursor-pointer transition-colors":""}`,style:L?{"--row-hover-bg":"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"}:void 0,role:L?"button":void 0,tabIndex:L?0:void 0,"aria-label":L?`View finding ${M.findingId??""}`:void 0,onMouseEnter:j=>{L&&(j.currentTarget.style.background="color-mix(in oklch, var(--surface-sunk) 40%, transparent)")},onMouseLeave:j=>{L&&(j.currentTarget.style.background="")},onClick:()=>L&&ae(M.consensusId,M.findingId),onKeyDown:j=>{L&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),ae(M.consensusId,M.findingId))},children:[a.jsx("td",{className:"p-0",style:{background:te,width:6},title:M.severity??"no severity"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono tabular-nums",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},title:M.timestamp,children:Pe(M.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"var(--text)"},children:M.agentId}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:a.jsx("span",{className:"h-section",style:{color:ce,fontSize:11},children:fe})}),a.jsx("td",{className:"max-w-[320px] truncate px-2 py-1",style:{fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.45,color:"var(--text)"},title:M.evidence,children:vo(M.evidence,80)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:M.counterpartId??"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},title:M.findingId,children:M.findingId?vo(M.findingId,24):"—"}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},title:M.consensusId,children:M.consensusId?vo(M.consensusId,16):"—"})]},`${M.timestamp}-${M.agentId}-${E}`)})]})]})}),a.jsxs("div",{className:"flex items-center justify-between border-t border-border/60 px-3 py-2",children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:y?"loading…":`${de*cs+1}–${de*cs+d.length} of ${p}`}),a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>h(M=>Math.max(0,M-1)),disabled:de===0||y,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{className:"tabular-nums",children:[de+1," / ",F]}),a.jsx("button",{type:"button",onClick:()=>h(M=>Math.min(F-1,M+1)),disabled:de>=F-1||y,className:"rounded-sm border border-border/40 px-2 py-0.5 transition hover:bg-[color-mix(in_oklch,var(--surface-sunk)_50%,transparent)] disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]})]})]}),a.jsx($i,{open:w,onOpenChange:W,consensusId:Q,findingId:V})]})}function Ry(){if(typeof window>"u")return null;const i=new URLSearchParams(window.location.search),c=i.get("key");if(c===null)return null;i.delete("key");const u=i.toString(),o=window.location.pathname+(u?`?${u}`:"")+window.location.hash;return window.history.replaceState(null,"",o),c.trim()||null}function Oy(){const[i,c]=k.useState(null),[u,o]=k.useState(null),d=k.useRef(!1),m=k.useCallback(async h=>{o(null);const p=await j0(h);p.ok?c(!0):(o(p.kind),c(!1))},[]),v=k.useCallback(async()=>{if(d.current)return i===!0;d.current=!0;try{const h=await bo();return c(h),h}finally{d.current=!1}},[i]);return k.useEffect(()=>{let h=!1;const p=Ry();return d.current=!0,(async()=>{try{if(await bo()){h||c(!0);return}if(p){h||await m(p);return}h||c(!1)}finally{d.current=!1}})(),()=>{h=!0}},[m]),{authed:i,login:m,error:u,recheck:v}}function Uy(i,c){const u=c.match(/^API error: (\d+)$/),o=u?`HTTP ${u[1]}`:c;return`${i}: ${o}`}const qy=5e3;async function Ri(i,c){try{return await We(c)}catch(u){const o=u instanceof Error?u.message:String(u);throw new Error(Uy(i,o))}}function By(i){const[c,u]=k.useState({overview:null,agents:null,tasks:null,consensus:null,consensusReports:null,fleetTrend:null,signalActivity:null,skills:null,nativeMemories:null,gossipMemories:null,memories:null,loading:!0,error:null}),o=k.useRef(!1),d=k.useRef(i);d.current=i;const m=k.useCallback(async()=>{var v;if(!o.current){o.current=!0;try{const[h,p,g,y,S,R,J,$,Y,w]=await Promise.all([Ri("overview","overview"),Ri("agents","agents"),Ri("tasks","tasks?limit=2000"),Ri("consensus","consensus?pageSize=500"),We("consensus-reports?page=1&pageSize=200").catch(()=>({reports:[]})),We("fleet-trend?days=7").catch(()=>({days:7,points:[]})),We("signal-activity").catch(()=>({agents:[],total:0,generatedAt:""})),We("skills").catch(()=>({index:{},suggestions:[],effectiveness:[]})),We("native-memory").catch(()=>({knowledge:[]})),We("gossip-memory").catch(()=>({knowledge:[]}))]),W=[...Y.knowledge||[]].map(ne=>({...ne,origin:"native"})).sort((ne,V)=>V.filename>ne.filename?1:-1),Q=[...w.knowledge||[]].map(ne=>({...ne,origin:"gossip"})).sort((ne,V)=>V.filename>ne.filename?1:-1);u({overview:h,agents:p,tasks:g,consensus:y,consensusReports:S,fleetTrend:R,signalActivity:J,skills:$,nativeMemories:W,gossipMemories:Q,memories:W,loading:!1,error:null})}catch(h){b0(h)?((v=d.current)==null||v.call(d),u(p=>({...p,loading:!1}))):u(p=>({...p,loading:!1,error:h.message}))}finally{o.current=!1}}},[]);return k.useEffect(()=>{m()},[m]),k.useEffect(()=>{const v=setInterval(()=>{m()},qy);return()=>clearInterval(v)},[m]),{...c,refresh:m}}const Ch="dashboard:lastEventId";function Ly(){if(typeof window>"u")return 0;const i=window.localStorage.getItem(Ch);if(!i)return 0;const c=parseInt(i,10);return Number.isFinite(c)?c:0}function Hy(i){typeof window>"u"||window.localStorage.setItem(Ch,String(i))}const fh=1e3,$y=5e3;function Gy(i){k.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let c=null,u=null,o=fh,d=!1;function m(){if(d)return;const v=Ly();c=new window.EventSource(`/dashboard/api/events?last_id=${v}`),c.onmessage=h=>{try{const p=JSON.parse(h.data);i(p),Hy(p.id),o=fh}catch{}},c.onerror=()=>{c&&(c.close(),c=null),!d&&(u=setTimeout(()=>{m()},o),o=Math.min(o*2,$y))}}return m(),()=>{d=!0,u!==null&&clearTimeout(u),c&&(c.close(),c=null)}},[])}const mh=5,Yy=6e3;function Xy({toast:i,onDismiss:c}){const u=k.useRef(null),o=k.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),d=k.useCallback(()=>{o(),u.current=setTimeout(()=>c(i.id),Yy)},[i.id,c,o]);k.useEffect(()=>(d(),o),[d,o]);const{type:m,payload:v}=i.event,h=m==="task.completed"?a.jsx("span",{style:{color:"var(--text-dim)"},children:"✓"}):v.confirmed>v.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let p;if(m==="task.completed"){const y=String(v.agentId??"agent"),S=typeof v.durationMs=="number"?v.durationMs:null,R=S!==null?`${(S/1e3).toFixed(1)}s`:"—";p=`${y} finished in ${R}`}else{const y=Number(v.confirmed??0),S=Number(v.disputed??0);p=`Consensus done — ${y} confirmed · ${S} disputed`}const g=()=>{o(),m==="task.completed"&&v.taskId?us("/tasks"):m==="consensus.completed"&&v.consensusId&&us("/debates"),c(i.id)};return a.jsx("div",{className:["pointer-events-auto border rounded px-4 py-3 max-w-sm cursor-pointer","transition-all duration-200","motion-reduce:transition-none motion-reduce:transform-none","hover:border-border",i.exiting?"opacity-0 scale-95 opacity-0 translate-y-2":"opacity-100 scale-100 translate-x-0"].join(" "),style:{background:"var(--surface-elev)",boxShadow:"var(--shadow-card)"},onClick:g,onMouseEnter:o,onMouseLeave:d,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"shrink-0 text-sm font-bold",children:h}),a.jsx("span",{title:p,className:"font-mono text-[11px] min-w-0 truncate",style:{color:"var(--text)"},children:p}),a.jsx("button",{className:"ml-auto shrink-0 hover:[color:var(--text-dim)] text-xs leading-none",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},onClick:y=>{y.stopPropagation(),o(),c(i.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function Vy(){const[i,c]=k.useState([]),u=k.useCallback(d=>{c(m=>m.map(v=>v.id===d?{...v,exiting:!0}:v)),setTimeout(()=>{c(m=>m.filter(v=>v.id!==d))},250)},[]),o=k.useCallback(d=>{c(m=>{const v={id:d.id,event:d,exiting:!1},h=[...m,v];if(h.length>mh){const p=h.length-mh;return h.slice(p)}return h})},[]);return Gy(o),a.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col-reverse gap-2 pointer-events-none",role:"region","aria-label":"Notifications","aria-live":"polite","aria-atomic":"false",children:i.map(d=>a.jsx(Xy,{toast:d,onDismiss:u},d.id))})}function Qy({agents:i,tasks:c,consensusReports:u,fleetTrend:o}){const[d,m]=k.useState("weight"),[v,h]=k.useState("desc"),[p,g]=k.useState(""),y=k.useMemo(()=>{const T=new Map;if(c)for(const Z of c.items){const z=T.get(Z.agentId);(!z||Z.timestamp>z.timestamp)&&T.set(Z.agentId,Z)}return T},[c]);_h(u==null?void 0:u.reports),k.useMemo(()=>{const T=new Map;if(o){for(const Z of o.points){const z=T.get(Z.agentId)??[];z.push(Z),T.set(Z.agentId,z)}for(const Z of T.values())Z.sort((z,K)=>z.day.localeCompare(K.day))}return T},[o]);const S=i.filter(R0).length,R=i.filter(T=>T.scores.accuracy>=.5).length,J=i.reduce((T,Z)=>T+Z.scores.signals,0),$=i.reduce((T,Z)=>T+Z.totalTokens,0),Y=p.trim().toLowerCase(),w=Y?i.filter(T=>T.id.toLowerCase().includes(Y)||T.provider.toLowerCase().includes(Y)||T.model.toLowerCase().includes(Y)):i,W=T=>{const Z=T.scores;switch(d){case"weight":return Z.dispatchWeight;case"accuracy":return Z.accuracy;case"uniqueness":return Z.uniqueness;case"impact":return Z.impactScore;case"signals":return Z.signals;case"agreements":return Z.agreements;case"hallucinations":return Z.hallucinations;case"lastTask":{const z=y.get(T.id);return z?new Date(z.timestamp).getTime():0}}},Q=[...w].sort((T,Z)=>{const z=W(T),K=W(Z);return v==="desc"?K-z:z-K}),ne=T=>{d===T?h(Z=>Z==="desc"?"asc":"desc"):(m(T),h("desc"))},V=T=>d===T?v==="desc"?"▾":"▴":"";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Team"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:i.length})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Per-agent accuracy, signal counts, and dispatch weights."}),a.jsx("div",{className:"mt-2 grid grid-cols-2 gap-px overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border [background:color-mix(in_oklch,var(--border)_30%,transparent)] sm:grid-cols-4",children:[{label:"Healthy",value:R,varColor:"var(--ok)"},{label:"Benched",value:S,varColor:S>0?"var(--bad)":"var(--ink-3)"},{label:"Total Signals",value:J.toLocaleString(),varColor:"var(--ink)"},{label:"Tokens Used",value:$.toLocaleString(),varColor:"var(--ink)"}].map(T=>a.jsxs("div",{style:{background:"var(--surface-elev)"},className:"px-4 py-3",children:[a.jsx("div",{className:"font-mono text-lg font-bold tabular-nums",style:{color:T.varColor},children:T.value}),a.jsx("div",{className:"h-section mt-0.5",children:T.label})]},T.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:p,onChange:T=>g(T.target.value),placeholder:"Search agents by id, provider, or model...",className:"w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:var(--ink-3)] focus:outline-none",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)",color:"var(--ink)"}})}),a.jsx("div",{className:"overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:a.jsxs("table",{className:"w-full text-left",children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:44}}),a.jsx("col",{}),a.jsx("col",{style:{width:80}}),a.jsx("col",{style:{width:260}}),a.jsx("col",{style:{width:80}}),a.jsx("col",{style:{width:60}}),a.jsx("col",{})]}),a.jsx("thead",{children:a.jsxs("tr",{className:"border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]",style:{background:"color-mix(in oklch, var(--surface-sunk) 20%, transparent)"},children:[a.jsx("th",{className:"h-section py-2.5 pl-5 pr-2 text-center",children:"#"}),a.jsx("th",{className:"h-section py-2.5 pr-3 text-left",children:"Agent"}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ne("weight"),children:["Weight ",V("weight")]}),a.jsx("th",{className:"h-section py-2.5 pr-4 text-left align-top",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>ne("accuracy"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Accuracy — fraction of findings confirmed by cross-review (with hallucination penalty)",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-confirmed"}),"Acc",V("accuracy")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>ne("uniqueness"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Uniqueness — findings this agent surfaced that no peer found",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-unique"}),"Unq",V("uniqueness")]}),a.jsx("span",{style:{color:"color-mix(in oklch, var(--ink-3) 30%, transparent)"},children:"·"}),a.jsxs("button",{onClick:()=>ne("impact"),className:"flex items-center gap-1 hover:[color:var(--ink)]","data-tooltip":"Impact — severity-weighted finding score",children:[a.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[var(--c8)]"}),"Imp",V("impact")]})]})}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ne("signals"),children:["Signals ",V("signals")]}),a.jsxs("th",{className:"h-section py-2.5 pr-4 text-right cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ne("hallucinations"),"data-tooltip":"Hallucinations — fabricated findings caught by cross-review",children:["Halluc ",V("hallucinations")]}),a.jsxs("th",{className:"h-section py-2.5 pr-5 text-left cursor-pointer select-none hover:[color:var(--ink)]",onClick:()=>ne("lastTask"),children:["Last Task ",V("lastTask")]})]})}),a.jsx("tbody",{children:Q.map((T,Z)=>{const z=T.scores,K=y.get(T.id),le=z.dispatchWeight>=1.2?"var(--ok)":z.dispatchWeight>=.8?"var(--ink)":"var(--bad)",F=Z+1;return a.jsxs("tr",{className:"group border-t [border-color:color-mix(in_oklch,var(--border)_20%,transparent)] align-top transition-colors hover:bg-accent/20",children:[a.jsx("td",{className:"py-3 pl-5 pr-2 text-center align-top",children:a.jsx("span",{className:"font-mono text-[11px] tabular-nums",style:{color:F===1?"var(--ink)":F===2||F===3?"color-mix(in oklch, var(--ink-2) 80%, transparent)":"var(--ink-3)",fontWeight:F===1?"bold":F<=3?600:void 0},children:F})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(T.id)}`,className:"flex items-center gap-3",children:[a.jsx(fs,{agentId:T.id,size:32,signals:z.signals,accuracy:z.accuracy,uniqueness:z.uniqueness,impact:z.impactScore}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"truncate font-mono text-xs font-semibold group-hover:[color:var(--accent)]",style:{color:"var(--ink)"},children:T.id}),(()=>{const de=zo(z);return de==="benched"?a.jsx("span",{className:"shrink-0 rounded px-1 text-[8px] font-bold",style:{background:"color-mix(in oklch, var(--bad) 15%, transparent)",color:"var(--bad)",fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":`Benched (${z.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):de==="struggling"?a.jsx("span",{className:"shrink-0 rounded bg-unverified/15 px-1 text-[8px] font-bold text-unverified",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":"Struggling: consecutive failures tripped the circuit breaker. Deprioritized until new clean signals recover the score.",children:"struggling"}):de==="kept-for-coverage"?a.jsx("span",{className:"shrink-0 rounded border border-unverified/40 px-1 text-[8px] font-bold text-unverified",style:{fontVariant:"small-caps",letterSpacing:"0.04em"},"data-tooltip":`Would bench (${z.bench.reason??"rule"}), but kept as sole provider of a category.`,children:"kept for coverage"}):null})()]}),a.jsxs("div",{className:"truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:[T.provider,"/",T.model]})]})]})}),a.jsx("td",{className:"py-3 pr-4 text-right align-top",children:a.jsx("span",{className:"font-mono text-sm font-bold tabular-nums",style:{color:le},children:z.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(go,{label:"A",value:z.accuracy,fillClass:z.accuracy>=.7?"bg-confirmed":z.accuracy>=.4?"bg-unverified":"bg-disputed",tooltip:"Adjusted accuracy = raw signal ratio × 1/(1 + weighted hallucinations × 0.3). The penalty is recoverable via skill-gated multiplier in the same category."}),a.jsx(go,{label:"U",value:z.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(go,{label:"I",value:z.impactScore,fillClass:"bg-[var(--c8)]",tooltip:"Impact — severity-weighted finding score; critical and high findings count more"})]})}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",style:{color:"var(--ink)"},children:z.signals.toLocaleString()}),a.jsx("td",{className:"py-3 pr-4 text-right align-top font-mono text-xs tabular-nums",children:a.jsx("span",{style:{color:z.hallucinations>0?"var(--bad)":"var(--ink-3)",fontWeight:z.hallucinations>10?"bold":void 0},"data-tooltip":`Agreements ${z.agreements} · Disagreements ${z.disagreements} · Hallucinations ${z.hallucinations}`,children:z.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:K?a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"warn-badge shrink-0 rounded px-1.5 py-0.5 font-mono text-[9px] font-semibold",children:K.taskId.slice(0,8)}),a.jsx("span",{className:"truncate text-[11px]",style:{maxWidth:260,color:"var(--ink-2)"},children:K.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:Pe(K.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"no tasks"})})]},T.id)})})]})})]})}function go({label:i,value:c,fillClass:u,tooltip:o}){return a.jsxs("div",{className:"flex items-center gap-2","data-tooltip":o,"data-tooltip-pos":"top",children:[a.jsx("span",{className:"w-6 text-[10px]",style:{color:"var(--ink-3)",fontVariant:"small-caps",letterSpacing:"0.04em"},children:i}),a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},children:a.jsx("div",{className:`h-full rounded-full ${u}`,style:{width:`${Math.max(0,Math.min(100,c*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums",style:{color:"var(--ink-2)"},children:[Math.round(c*100),"%"]})]})}function Zy({tasks:i}){const[c,u]=k.useState(""),[o,d]=k.useState(0),[m,v]=k.useState(null),h=100,p=i.items.filter(w=>w.status==="completed").length,g=i.items.filter(w=>w.status==="failed").length,y=i.items.filter(w=>w.status==="running").length,S=c.trim().toLowerCase(),R=S?i.items.filter(w=>{var W,Q,ne,V;return((W=w.task)==null?void 0:W.toLowerCase().includes(S))||((Q=w.agentId)==null?void 0:Q.toLowerCase().includes(S))||((ne=w.taskId)==null?void 0:ne.toLowerCase().includes(S))||((V=w.status)==null?void 0:V.toLowerCase().includes(S))}):i.items,J=Math.max(1,Math.ceil(R.length/h)),$=Math.min(o,J-1),Y=R.slice($*h,($+1)*h);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Tasks"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:i.total})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Live dispatched tasks and their relay status."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ok)"},children:p})," completed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:g})," failed"]}),y>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:y})," running"]}),a.jsxs("span",{children:["showing ",Y.length," of ",R.length,S&&` (filtered from ${i.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:c,onChange:w=>{u(w.target.value),d(0)},placeholder:"Search tasks by description, agent, id, status...",className:"w-full max-w-md rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-3 py-1.5 font-mono text-xs focus:[border-color:color-mix(in_oklch,var(--accent)_40%,transparent)] focus:outline-none",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)",color:"var(--ink)"}}),a.jsxs("div",{className:`flex shrink-0 items-center gap-2 font-mono text-[11px] ${J<=1?"invisible":""}`,style:{color:"var(--ink-3)"},children:[a.jsx("button",{onClick:()=>d(w=>Math.max(0,w-1)),disabled:$===0,className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"◂ Prev"}),a.jsxs("span",{children:[$+1," / ",J]}),a.jsx("button",{onClick:()=>d(w=>Math.min(J-1,w+1)),disabled:$>=J-1,className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 transition hover:bg-accent/10 disabled:opacity-30",style:{background:"var(--surface-elev)"},children:"Next ▸"})]})]}),a.jsx("div",{className:"overflow-hidden rounded-md [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border",style:{background:"color-mix(in oklch, var(--surface-elev) 80%, transparent)"},children:Y.length===0?a.jsx("div",{className:"py-12 text-center text-sm",style:{color:"var(--ink-3)"},children:S?"No tasks match your search.":"No tasks yet."}):a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b [border-color:color-mix(in_oklch,var(--border)_40%,transparent)]",style:{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)"},children:[a.jsx("th",{className:"py-2.5 pl-4 pr-2 h-section",style:{width:32}}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"ID"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Agent"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Description"}),a.jsx("th",{className:"py-2.5 pr-3 h-section",children:"Duration"}),a.jsx("th",{className:"py-2.5 pr-4 text-right h-section",children:"When"})]})}),a.jsx("tbody",{children:Y.map(w=>a.jsx(Ah,{task:w,onClick:v},w.taskId))})]})}),a.jsx(Mh,{task:m,onClose:()=>v(null)})]})}function Ky({consensus:i,consensusReports:c}){const[u,o]=k.useState(!1),d=u?i.runs:i.runs.filter(g=>!g.retracted),m=i.runs.filter(g=>g.retracted).length,v=d.reduce((g,y)=>g+(y.counts.agreement||0),0),h=d.reduce((g,y)=>g+((y.counts.disagreement||0)+(y.counts.hallucination||0)),0),p=d.reduce((g,y)=>g+(y.counts.unverified||0),0);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("h1",{className:"h-route",children:"Consensus Rounds"}),a.jsx("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:d.length}),!u&&m>0&&a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:["/ ",i.totalRuns??i.runs.length," total"]})]}),a.jsx("p",{className:"mt-0.5 text-[13px]",style:{color:"var(--ink-3)"},children:"Multi-agent review rounds — findings confirmed when ≥2 agents agree."}),a.jsxs("div",{className:"mt-2 flex gap-4 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--ok)"},children:v})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:h})," disputed"]}),p>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:p})," unverified"]}),a.jsxs("span",{children:[i.totalSignals," total signals"]})]}),m>0&&a.jsxs("div",{className:"mt-2 flex items-center gap-2 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{children:u?`${m} retracted run${m===1?"":"s"} shown`:`${m} retracted run${m===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>o(g=>!g),className:"rounded-sm [border-color:color-mix(in_oklch,var(--border)_40%,transparent)] border px-2 py-0.5 text-[10px] transition hover:bg-accent/10 hover:[color:var(--ink)]",style:{background:"var(--surface-elev)"},children:u?"hide":"show"})]})]}),a.jsx(zg,{consensus:i,filteredRuns:d,reports:c,showAll:!0,hideHeader:!0})]})}function Jy({onUnauthorized:i}){const c=hh(),{overview:u,agents:o,tasks:d,consensus:m,consensusReports:v,fleetTrend:h,signalActivity:p,skills:g,loading:y,error:S,refresh:R}=By(i),[J,$]=k.useState(0),Y=k.useCallback(T=>{T.type!=="log_lines"&&R()},[R]);if(Sh(Y),!y&&S&&(!u||!m))return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(ho,{}),a.jsx("div",{className:"flex items-center justify-center py-20",children:a.jsxs("div",{className:"w-full max-w-sm rounded-xl border p-8 text-center",style:{borderColor:"var(--border)",background:"var(--surface-elev)"},children:[a.jsx("p",{className:"mb-2 text-sm font-semibold",style:{color:"var(--bad)"},children:"Dashboard fetch failed"}),a.jsx("p",{className:"mb-4 font-mono text-xs",style:{color:"var(--bad)"},children:S}),a.jsx("p",{className:"text-xs",style:{color:"var(--ink-3)"},children:"Relay may be restarting — retrying every 5s. Check the relay terminal if this persists."})]})})]});if(y||!u||!m)return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(ho,{}),a.jsx(uy,{})]});let w;const W=c.match(/^\/agent\/(.+)$/),Q=c.match(/^\/consensus\/(.+)$/);if(W&&o){const T=decodeURIComponent(W[1]);w=a.jsx(gy,{agentId:T,agents:o,tasks:d,consensus:m})}else if(Q){const T=decodeURIComponent(Q[1]);w=a.jsx(mg,{consensusId:T})}else c==="/team"?w=o?a.jsx(Qy,{agents:o,tasks:d,consensusReports:v,fleetTrend:h}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(dy,{})}):c==="/tasks"?w=d?a.jsx(Zy,{tasks:d}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(fy,{})}):c==="/debates"?w=m?a.jsx(Ky,{consensus:m,consensusReports:v}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(my,{})}):c==="/logs"?w=a.jsx(Sy,{}):c==="/signals"?w=a.jsx(Dy,{}):c==="/violations"?w=a.jsx(Og,{}):w=a.jsx(tg,{overview:u,agents:o,tasks:d,consensus:m,consensusReports:v,fleetTrend:h,signalActivity:p,skills:g,activeTaskCount:J,setActiveTaskCount:$});const V=c==="/"||c==="/overview"||!/^\/(agent\/|consensus\/|team|tasks|debates|logs|signals|violations)/.test(c)?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6";return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(ho,{}),a.jsx("main",{className:V,children:w})]})}function Fy(){const{authed:i,login:c,error:u,recheck:o}=Oy();return i===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center",style:{color:"var(--ink-3)"},children:"Loading..."}):i?a.jsxs(a.Fragment,{children:[a.jsx(Jy,{onUnauthorized:o}),a.jsx(Vy,{})]}):a.jsx(hg,{onLogin:c,error:u})}c0.createRoot(document.getElementById("root")).render(a.jsx(k.StrictMode,{children:a.jsx(Fy,{})}));
|