gossipcat 0.6.4 → 0.6.5
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-BEKs0u32.js +81 -0
- package/dist-dashboard/assets/index-CxBsFpD6.css +1 -0
- package/dist-dashboard/index.html +2 -2
- package/dist-mcp/mcp-server.js +404 -35
- package/package.json +2 -2
- package/dist-dashboard/assets/index-BRxsq5sV.js +0 -81
- package/dist-dashboard/assets/index-CSLO2_PP.css +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var Dg=Object.defineProperty;var zg=(s,r,u)=>r in s?Dg(s,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):s[r]=u;var Mt=(s,r,u)=>zg(s,typeof r!="symbol"?r+"":r,u);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&c(p)}).observe(document,{childList:!0,subtree:!0});function u(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=u(d);fetch(d.href,f)}})();function Lg(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Xc={exports:{}},ei={};/**
|
|
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 rh;function Bg(){if(rh)return ei;rh=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function u(c,d,f){var p=null;if(f!==void 0&&(p=""+f),d.key!==void 0&&(p=""+d.key),"key"in d){f={};for(var h in d)h!=="key"&&(f[h]=d[h])}else f=d;return d=f.ref,{$$typeof:s,type:c,key:p,ref:d!==void 0?d:null,props:f}}return ei.Fragment=r,ei.jsx=u,ei.jsxs=u,ei}var oh;function Ug(){return oh||(oh=1,Xc.exports=Bg()),Xc.exports}var a=Ug(),Kc={exports:{}},Te={};/**
|
|
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 ch;function $g(){if(ch)return Te;ch=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),A=Symbol.iterator;function K(S){return S===null||typeof S!="object"?null:(S=A&&S[A]||S["@@iterator"],typeof S=="function"?S:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,j={};function L(S,U,se){this.props=S,this.context=U,this.refs=j,this.updater=se||O}L.prototype.isReactComponent={},L.prototype.setState=function(S,U){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,U,"setState")},L.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function B(){}B.prototype=L.prototype;function P(S,U,se){this.props=S,this.context=U,this.refs=j,this.updater=se||O}var V=P.prototype=new B;V.constructor=P,T(V,L.prototype),V.isPureReactComponent=!0;var M=Array.isArray;function R(){}var _={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function F(S,U,se){var ee=se.ref;return{$$typeof:s,type:S,key:U,ref:ee!==void 0?ee:null,props:se}}function G(S,U){return F(S.type,U,S.props)}function ue(S){return typeof S=="object"&&S!==null&&S.$$typeof===s}function ae(S){var U={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(se){return U[se]})}var oe=/\/+/g;function pe(S,U){return typeof S=="object"&&S!==null&&S.key!=null?ae(""+S.key):U.toString(36)}function D(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(R,R):(S.status="pending",S.then(function(U){S.status==="pending"&&(S.status="fulfilled",S.value=U)},function(U){S.status==="pending"&&(S.status="rejected",S.reason=U)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function w(S,U,se,ee,Y){var me=typeof S;(me==="undefined"||me==="boolean")&&(S=null);var ge=!1;if(S===null)ge=!0;else switch(me){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(S.$$typeof){case s:case r:ge=!0;break;case v:return ge=S._init,w(ge(S._payload),U,se,ee,Y)}}if(ge)return Y=Y(S),ge=ee===""?"."+pe(S,0):ee,M(Y)?(se="",ge!=null&&(se=ge.replace(oe,"$&/")+"/"),w(Y,U,se,"",function(it){return it})):Y!=null&&(ue(Y)&&(Y=G(Y,se+(Y.key==null||S&&S.key===Y.key?"":(""+Y.key).replace(oe,"$&/")+"/")+ge)),U.push(Y)),1;ge=0;var Ge=ee===""?".":ee+":";if(M(S))for(var Re=0;Re<S.length;Re++)ee=S[Re],me=Ge+pe(ee,Re),ge+=w(ee,U,se,me,Y);else if(Re=K(S),typeof Re=="function")for(S=Re.call(S),Re=0;!(ee=S.next()).done;)ee=ee.value,me=Ge+pe(ee,Re++),ge+=w(ee,U,se,me,Y);else if(me==="object"){if(typeof S.then=="function")return w(D(S),U,se,ee,Y);throw U=String(S),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ge}function I(S,U,se){if(S==null)return S;var ee=[],Y=0;return w(S,ee,"","",function(me){return U.call(se,me,Y++)}),ee}function ne(S){if(S._status===-1){var U=S._result;U=U(),U.then(function(se){(S._status===0||S._status===-1)&&(S._status=1,S._result=se)},function(se){(S._status===0||S._status===-1)&&(S._status=2,S._result=se)}),S._status===-1&&(S._status=0,S._result=U)}if(S._status===1)return S._result.default;throw S._result}var le=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},de={map:I,forEach:function(S,U,se){I(S,function(){U.apply(this,arguments)},se)},count:function(S){var U=0;return I(S,function(){U++}),U},toArray:function(S){return I(S,function(U){return U})||[]},only:function(S){if(!ue(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Te.Activity=N,Te.Children=de,Te.Component=L,Te.Fragment=u,Te.Profiler=d,Te.PureComponent=P,Te.StrictMode=c,Te.Suspense=x,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Te.__COMPILER_RUNTIME={__proto__:null,c:function(S){return _.H.useMemoCache(S)}},Te.cache=function(S){return function(){return S.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(S,U,se){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var ee=T({},S.props),Y=S.key;if(U!=null)for(me in U.key!==void 0&&(Y=""+U.key),U)!Q.call(U,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&U.ref===void 0||(ee[me]=U[me]);var me=arguments.length-2;if(me===1)ee.children=se;else if(1<me){for(var ge=Array(me),Ge=0;Ge<me;Ge++)ge[Ge]=arguments[Ge+2];ee.children=ge}return F(S.type,Y,ee)},Te.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},Te.createElement=function(S,U,se){var ee,Y={},me=null;if(U!=null)for(ee in U.key!==void 0&&(me=""+U.key),U)Q.call(U,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(Y[ee]=U[ee]);var ge=arguments.length-2;if(ge===1)Y.children=se;else if(1<ge){for(var Ge=Array(ge),Re=0;Re<ge;Re++)Ge[Re]=arguments[Re+2];Y.children=Ge}if(S&&S.defaultProps)for(ee in ge=S.defaultProps,ge)Y[ee]===void 0&&(Y[ee]=ge[ee]);return F(S,me,Y)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(S){return{$$typeof:h,render:S}},Te.isValidElement=ue,Te.lazy=function(S){return{$$typeof:v,_payload:{_status:-1,_result:S},_init:ne}},Te.memo=function(S,U){return{$$typeof:g,type:S,compare:U===void 0?null:U}},Te.startTransition=function(S){var U=_.T,se={};_.T=se;try{var ee=S(),Y=_.S;Y!==null&&Y(se,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(R,le)}catch(me){le(me)}finally{U!==null&&se.types!==null&&(U.types=se.types),_.T=U}},Te.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Te.use=function(S){return _.H.use(S)},Te.useActionState=function(S,U,se){return _.H.useActionState(S,U,se)},Te.useCallback=function(S,U){return _.H.useCallback(S,U)},Te.useContext=function(S){return _.H.useContext(S)},Te.useDebugValue=function(){},Te.useDeferredValue=function(S,U){return _.H.useDeferredValue(S,U)},Te.useEffect=function(S,U){return _.H.useEffect(S,U)},Te.useEffectEvent=function(S){return _.H.useEffectEvent(S)},Te.useId=function(){return _.H.useId()},Te.useImperativeHandle=function(S,U,se){return _.H.useImperativeHandle(S,U,se)},Te.useInsertionEffect=function(S,U){return _.H.useInsertionEffect(S,U)},Te.useLayoutEffect=function(S,U){return _.H.useLayoutEffect(S,U)},Te.useMemo=function(S,U){return _.H.useMemo(S,U)},Te.useOptimistic=function(S,U){return _.H.useOptimistic(S,U)},Te.useReducer=function(S,U,se){return _.H.useReducer(S,U,se)},Te.useRef=function(S){return _.H.useRef(S)},Te.useState=function(S){return _.H.useState(S)},Te.useSyncExternalStore=function(S,U,se){return _.H.useSyncExternalStore(S,U,se)},Te.useTransition=function(){return _.H.useTransition()},Te.version="19.2.6",Te}var uh;function Su(){return uh||(uh=1,Kc.exports=$g()),Kc.exports}var y=Su(),Vc={exports:{}},ti={},Qc={exports:{}},Zc={};/**
|
|
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 dh;function qg(){return dh||(dh=1,(function(s){function r(w,I){var ne=w.length;w.push(I);e:for(;0<ne;){var le=ne-1>>>1,de=w[le];if(0<d(de,I))w[le]=I,w[ne]=de,ne=le;else break e}}function u(w){return w.length===0?null:w[0]}function c(w){if(w.length===0)return null;var I=w[0],ne=w.pop();if(ne!==I){w[0]=ne;e:for(var le=0,de=w.length,S=de>>>1;le<S;){var U=2*(le+1)-1,se=w[U],ee=U+1,Y=w[ee];if(0>d(se,ne))ee<de&&0>d(Y,se)?(w[le]=Y,w[ee]=ne,le=ee):(w[le]=se,w[U]=ne,le=U);else if(ee<de&&0>d(Y,ne))w[le]=Y,w[ee]=ne,le=ee;else break e}}return I}function d(w,I){var ne=w.sortIndex-I.sortIndex;return ne!==0?ne:w.id-I.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var p=Date,h=p.now();s.unstable_now=function(){return p.now()-h}}var x=[],g=[],v=1,N=null,A=3,K=!1,O=!1,T=!1,j=!1,L=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function V(w){for(var I=u(g);I!==null;){if(I.callback===null)c(g);else if(I.startTime<=w)c(g),I.sortIndex=I.expirationTime,r(x,I);else break;I=u(g)}}function M(w){if(T=!1,V(w),!O)if(u(x)!==null)O=!0,R||(R=!0,ae());else{var I=u(g);I!==null&&D(M,I.startTime-w)}}var R=!1,_=-1,Q=5,F=-1;function G(){return j?!0:!(s.unstable_now()-F<Q)}function ue(){if(j=!1,R){var w=s.unstable_now();F=w;var I=!0;try{e:{O=!1,T&&(T=!1,B(_),_=-1),K=!0;var ne=A;try{t:{for(V(w),N=u(x);N!==null&&!(N.expirationTime>w&&G());){var le=N.callback;if(typeof le=="function"){N.callback=null,A=N.priorityLevel;var de=le(N.expirationTime<=w);if(w=s.unstable_now(),typeof de=="function"){N.callback=de,V(w),I=!0;break t}N===u(x)&&c(x),V(w)}else c(x);N=u(x)}if(N!==null)I=!0;else{var S=u(g);S!==null&&D(M,S.startTime-w),I=!1}}break e}finally{N=null,A=ne,K=!1}I=void 0}}finally{I?ae():R=!1}}}var ae;if(typeof P=="function")ae=function(){P(ue)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,pe=oe.port2;oe.port1.onmessage=ue,ae=function(){pe.postMessage(null)}}else ae=function(){L(ue,0)};function D(w,I){_=L(function(){w(s.unstable_now())},I)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(w){w.callback=null},s.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<w?Math.floor(1e3/w):5},s.unstable_getCurrentPriorityLevel=function(){return A},s.unstable_next=function(w){switch(A){case 1:case 2:case 3:var I=3;break;default:I=A}var ne=A;A=I;try{return w()}finally{A=ne}},s.unstable_requestPaint=function(){j=!0},s.unstable_runWithPriority=function(w,I){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var ne=A;A=w;try{return I()}finally{A=ne}},s.unstable_scheduleCallback=function(w,I,ne){var le=s.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?le+ne:le):ne=le,w){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=ne+de,w={id:v++,callback:I,priorityLevel:w,startTime:ne,expirationTime:de,sortIndex:-1},ne>le?(w.sortIndex=ne,r(g,w),u(x)===null&&w===u(g)&&(T?(B(_),_=-1):T=!0,D(M,ne-le))):(w.sortIndex=de,r(x,w),O||K||(O=!0,R||(R=!0,ae()))),w},s.unstable_shouldYield=G,s.unstable_wrapCallback=function(w){var I=A;return function(){var ne=A;A=I;try{return w.apply(this,arguments)}finally{A=ne}}}})(Zc)),Zc}var fh;function Hg(){return fh||(fh=1,Qc.exports=qg()),Qc.exports}var Fc={exports:{}},qt={};/**
|
|
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 mh;function Ig(){if(mh)return qt;mh=1;var s=Su();function r(x){var g="https://react.dev/errors/"+x;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+x+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(r(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 f(x,g,v){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:N==null?null:""+N,children:x,containerInfo:g,implementation:v}}var p=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(x,g){if(x==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,qt.createPortal=function(x,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return f(x,g,null,v)},qt.flushSync=function(x){var g=p.T,v=c.p;try{if(p.T=null,c.p=2,x)return x()}finally{p.T=g,c.p=v,c.d.f()}},qt.preconnect=function(x,g){typeof x=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,c.d.C(x,g))},qt.prefetchDNS=function(x){typeof x=="string"&&c.d.D(x)},qt.preinit=function(x,g){if(typeof x=="string"&&g&&typeof g.as=="string"){var v=g.as,N=h(v,g.crossOrigin),A=typeof g.integrity=="string"?g.integrity:void 0,K=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?c.d.S(x,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:N,integrity:A,fetchPriority:K}):v==="script"&&c.d.X(x,{crossOrigin:N,integrity:A,fetchPriority:K,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},qt.preinitModule=function(x,g){if(typeof x=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=h(g.as,g.crossOrigin);c.d.M(x,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&c.d.M(x)},qt.preload=function(x,g){if(typeof x=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,N=h(v,g.crossOrigin);c.d.L(x,v,{crossOrigin:N,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})}},qt.preloadModule=function(x,g){if(typeof x=="string")if(g){var v=h(g.as,g.crossOrigin);c.d.m(x,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else c.d.m(x)},qt.requestFormReset=function(x){c.d.r(x)},qt.unstable_batchedUpdates=function(x,g){return x(g)},qt.useFormState=function(x,g,v){return p.H.useFormState(x,g,v)},qt.useFormStatus=function(){return p.H.useHostTransitionStatus()},qt.version="19.2.6",qt}var hh;function Gg(){if(hh)return Fc.exports;hh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Fc.exports=Ig(),Fc.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 ph;function Yg(){if(ph)return ti;ph=1;var s=Hg(),r=Su(),u=Gg();function c(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 f(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 p(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 x(e){if(f(e)!==e)throw Error(c(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return x(i),e;if(o===l)return x(i),t;o=o.sibling}throw Error(c(188))}if(n.return!==l.return)n=i,l=o;else{for(var m=!1,b=i.child;b;){if(b===n){m=!0,n=i,l=o;break}if(b===l){m=!0,l=i,n=o;break}b=b.sibling}if(!m){for(b=o.child;b;){if(b===n){m=!0,n=o,l=i;break}if(b===l){m=!0,l=o,n=i;break}b=b.sibling}if(!m)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,A=Symbol.for("react.element"),K=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),P=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=ue&&e[ue]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function pe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case L:return"Profiler";case j:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case P:return e.displayName||"Context";case B: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 _:return t=e.displayName||null,t!==null?t:pe(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var D=Array.isArray,w=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},le=[],de=-1;function S(e){return{current:e}}function U(e){0>de||(e.current=le[de],le[de]=null,de--)}function se(e,t){de++,le[de]=e.current,e.current=t}var ee=S(null),Y=S(null),me=S(null),ge=S(null);function Ge(e,t){switch(se(me,t),se(Y,e),se(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Mm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Mm(t),e=Cm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(ee),se(ee,e)}function Re(){U(ee),U(Y),U(me)}function it(e){e.memoizedState!==null&&se(ge,e);var t=ee.current,n=Cm(t,e.type);t!==n&&(se(Y,e),se(ee,n))}function Kt(e){Y.current===e&&(U(ee),U(Y)),ge.current===e&&(U(ge),Fs._currentValue=ne)}var Lt,Rn;function Ht(e){if(Lt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Lt=t&&t[1]||"",Rn=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Lt+e+Rn}var Ye=!1;function wn(e,t){if(!e||Ye)return"";Ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(X){var H=X}Reflect.construct(e,[],te)}else{try{te.call()}catch(X){H=X}e.call(te.prototype)}}else{try{throw Error()}catch(X){H=X}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(X){if(X&&H&&typeof X.stack=="string")return[X.stack,H.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),m=o[0],b=o[1];if(m&&b){var k=m.split(`
|
|
44
|
+
`),q=b.split(`
|
|
45
|
+
`);for(i=l=0;l<k.length&&!k[l].includes("DetermineComponentFrameRoot");)l++;for(;i<q.length&&!q[i].includes("DetermineComponentFrameRoot");)i++;if(l===k.length||i===q.length)for(l=k.length-1,i=q.length-1;1<=l&&0<=i&&k[l]!==q[i];)i--;for(;1<=l&&0<=i;l--,i--)if(k[l]!==q[i]){if(l!==1||i!==1)do if(l--,i--,0>i||k[l]!==q[i]){var Z=`
|
|
46
|
+
`+k[l].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=l&&0<=i);break}}}finally{Ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ht(n):""}function hn(e,t){switch(e.tag){case 26:case 27:case 5:return Ht(e.type);case 16:return Ht("Lazy");case 13:return e.child!==t&&t!==null?Ht("Suspense Fallback"):Ht("Suspense");case 19:return Ht("SuspenseList");case 0:case 15:return wn(e.type,!1);case 11:return wn(e.type.render,!1);case 1:return wn(e.type,!0);case 31:return Ht("Activity");default:return""}}function On(e){try{var t="",n=null;do t+=hn(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var re=Object.prototype.hasOwnProperty,we=s.unstable_scheduleCallback,qe=s.unstable_cancelCallback,mt=s.unstable_shouldYield,Vt=s.unstable_requestPaint,nt=s.unstable_now,Tt=s.unstable_getCurrentPriorityLevel,pn=s.unstable_ImmediatePriority,xn=s.unstable_UserBlockingPriority,Ha=s.unstable_NormalPriority,$r=s.unstable_LowPriority,oi=s.unstable_IdlePriority,qr=s.log,Hr=s.unstable_setDisableYieldValue,Ia=null,Bt=null;function Dn(e){if(typeof qr=="function"&&Hr(e),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(Ia,e)}catch{}}var It=Math.clz32?Math.clz32:ci,Ir=Math.log,is=Math.LN2;function ci(e){return e>>>=0,e===0?32:31-(Ir(e)/is|0)|0}var Ga=256,xl=262144,Ya=4194304;function Qt(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 E(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,o=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var b=l&134217727;return b!==0?(l=b&~o,l!==0?i=Qt(l):(m&=b,m!==0?i=Qt(m):n||(n=b&~e,n!==0&&(i=Qt(n))))):(b=l&~o,b!==0?i=Qt(b):m!==0?i=Qt(m):n||(n=l&~e,n!==0&&(i=Qt(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function J(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function fe(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 Ee(){var e=Ya;return Ya<<=1,(Ya&62914560)===0&&(Ya=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Pe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function be(e,t,n,l,i,o){var m=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 b=e.entanglements,k=e.expirationTimes,q=e.hiddenUpdates;for(n=m&~n;0<n;){var Z=31-It(n),te=1<<Z;b[Z]=0,k[Z]=-1;var H=q[Z];if(H!==null)for(q[Z]=null,Z=0;Z<H.length;Z++){var X=H[Z];X!==null&&(X.lane&=-536870913)}n&=~te}l!==0&&he(e,l,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(m&~t))}function he(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-It(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function _e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-It(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=(n&42)!==0?1:rt(n),(n&(e.suspendedLanes|t))!==0?0:n}function rt(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 Gn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gl(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:eh(e.type))}function bl(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var zn=Math.random().toString(36).slice(2),pt="__reactFiber$"+zn,Ut="__reactProps$"+zn,da="__reactContainer$"+zn,rs="__reactEvents$"+zn,ui="__reactListeners$"+zn,vl="__reactHandles$"+zn,di="__reactResources$"+zn,Xa="__reactMarker$"+zn;function os(e){delete e[pt],delete e[Ut],delete e[rs],delete e[ui],delete e[vl]}function Gt(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[da]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Um(e);e!==null;){if(n=e[pt])return n;e=Um(e)}return t}e=n,n=e.parentNode}return null}function Yn(e){if(e=e[pt]||e[da]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function fa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ma(e){var t=e[di];return t||(t=e[di]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Xa]=!0}var fi=new Set,Ka={};function Xn(e,t){ie(e,t),ie(e+"Capture",t)}function ie(e,t){for(Ka[e]=t,e=0;e<t.length;e++)fi.add(t[e])}var Ne=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]*$"),Oe={},Ke={};function xt(e){return re.call(Ke,e)?!0:re.call(Oe,e)?!1:Ne.test(e)?Ke[e]=!0:(Oe[e]=!0,!1)}function $t(e,t,n){if(xt(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 an(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 Zt(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 tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ln(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mi(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 i=l.get,o=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(m){n=""+m,o.call(this,m)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){if(!e._valueTracker){var t=ln(e)?"checked":"value";e._valueTracker=mi(e,t,""+e[t])}}function cs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=ln(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Nl(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 Gr=/[\n"\\]/g;function Ft(e){return e.replace(Gr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function us(e,t,n,l,i,o,m,b){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+tt(t)):e.value!==""+tt(t)&&(e.value=""+tt(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?jl(e,m,tt(t)):n!=null?jl(e,m,tt(n)):l!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+tt(b):e.removeAttribute("name")}function Va(e,t,n,l,i,o,m,b){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){yl(e);return}n=n!=null?""+tt(n):"",t=t!=null?""+tt(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=b?e.checked:!!l,e.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),yl(e)}function jl(e,t,n){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ct(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function hi(e,t,n){if(t!=null&&(t=""+tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+tt(n):""}function Sl(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(D(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=tt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),yl(e)}function ke(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pi=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 Nt(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||pi.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ve(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(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 i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&Nt(e,i,l)}else for(var o in t)t.hasOwnProperty(o)&&Nt(e,o,t[o])}function ha(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 Kn=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"]]),ds=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function pa(e){return ds.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ce(){}var ve=null;function Ae(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Le=null,ut=null;function gn(e){var t=Yn(e);if(t&&(e=t.stateNode)){var n=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(us(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="'+Ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Ut]||null;if(!i)throw Error(c(90));us(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&cs(l)}break e;case"textarea":hi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ct(e,!!n.multiple,t,!1)}}}var fs=!1;function xi(e,t,n){if(fs)return e(t,n);fs=!0;try{var l=e(t);return l}finally{if(fs=!1,(Le!==null||ut!==null)&&(ar(),Le&&(t=Le,e=ut,ut=Le=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function ms(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Ut]||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(c(231,t,typeof n));return n}var Vn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yr=!1;if(Vn)try{var hs={};Object.defineProperty(hs,"passive",{get:function(){Yr=!0}}),window.addEventListener("test",hs,hs),window.removeEventListener("test",hs,hs)}catch{Yr=!1}var xa=null,Xr=null,gi=null;function Mu(){if(gi)return gi;var e,t=Xr,n=t.length,l,i="value"in xa?xa.value:xa.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var m=n-e;for(l=1;l<=m&&t[n-l]===i[o-l];l++);return gi=i.slice(e,1<l?1-l:void 0)}function bi(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 vi(){return!0}function Cu(){return!1}function Jt(e){function t(n,l,i,o,m){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=o,this.target=m,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(o):o[b]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?vi:Cu,this.isPropagationStopped=Cu,this}return N(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=vi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vi)},persist:function(){},isPersistent:vi}),t}var Qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yi=Jt(Qa),ps=N({},Qa,{view:0,detail:0}),Rp=Jt(ps),Kr,Vr,xs,Ni=N({},ps,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zr,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!==xs&&(xs&&e.type==="mousemove"?(Kr=e.screenX-xs.screenX,Vr=e.screenY-xs.screenY):Vr=Kr=0,xs=e),Kr)},movementY:function(e){return"movementY"in e?e.movementY:Vr}}),Ru=Jt(Ni),Op=N({},Ni,{dataTransfer:0}),Dp=Jt(Op),zp=N({},ps,{relatedTarget:0}),Qr=Jt(zp),Lp=N({},Qa,{animationName:0,elapsedTime:0,pseudoElement:0}),Bp=Jt(Lp),Up=N({},Qa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$p=Jt(Up),qp=N({},Qa,{data:0}),Ou=Jt(qp),Hp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ip={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"},Gp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gp[e])?!!t[e]:!1}function Zr(){return Yp}var Xp=N({},ps,{key:function(e){if(e.key){var t=Hp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ip[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zr,charCode:function(e){return e.type==="keypress"?bi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Kp=Jt(Xp),Vp=N({},Ni,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Du=Jt(Vp),Qp=N({},ps,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zr}),Zp=Jt(Qp),Fp=N({},Qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Jp=Jt(Fp),Wp=N({},Ni,{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}),Pp=Jt(Wp),ex=N({},Qa,{newState:0,oldState:0}),tx=Jt(ex),nx=[9,13,27,32],Fr=Vn&&"CompositionEvent"in window,gs=null;Vn&&"documentMode"in document&&(gs=document.documentMode);var ax=Vn&&"TextEvent"in window&&!gs,zu=Vn&&(!Fr||gs&&8<gs&&11>=gs),Lu=" ",Bu=!1;function Uu(e,t){switch(e){case"keyup":return nx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $u(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kl=!1;function lx(e,t){switch(e){case"compositionend":return $u(t);case"keypress":return t.which!==32?null:(Bu=!0,Lu);case"textInput":return e=t.data,e===Lu&&Bu?null:e;default:return null}}function sx(e,t){if(kl)return e==="compositionend"||!Fr&&Uu(e,t)?(e=Mu(),gi=Xr=xa=null,kl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zu&&t.locale!=="ko"?null:t.data;default:return null}}var ix={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 qu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ix[e.type]:t==="textarea"}function Hu(e,t,n,l){Le?ut?ut.push(l):ut=[l]:Le=l,t=ur(t,"onChange"),0<t.length&&(n=new yi("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var bs=null,vs=null;function rx(e){km(e,0)}function ji(e){var t=fa(e);if(cs(t))return e}function Iu(e,t){if(e==="change")return t}var Gu=!1;if(Vn){var Jr;if(Vn){var Wr="oninput"in document;if(!Wr){var Yu=document.createElement("div");Yu.setAttribute("oninput","return;"),Wr=typeof Yu.oninput=="function"}Jr=Wr}else Jr=!1;Gu=Jr&&(!document.documentMode||9<document.documentMode)}function Xu(){bs&&(bs.detachEvent("onpropertychange",Ku),vs=bs=null)}function Ku(e){if(e.propertyName==="value"&&ji(vs)){var t=[];Hu(t,vs,e,Ae(e)),xi(rx,t)}}function ox(e,t,n){e==="focusin"?(Xu(),bs=t,vs=n,bs.attachEvent("onpropertychange",Ku)):e==="focusout"&&Xu()}function cx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ji(vs)}function ux(e,t){if(e==="click")return ji(t)}function dx(e,t){if(e==="input"||e==="change")return ji(t)}function fx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sn=typeof Object.is=="function"?Object.is:fx;function ys(e,t){if(sn(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 i=n[l];if(!re.call(t,i)||!sn(e[i],t[i]))return!1}return!0}function Vu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qu(e,t){var n=Vu(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=Vu(n)}}function Zu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(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=Nl(e.document)}return t}function Pr(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 mx=Vn&&"documentMode"in document&&11>=document.documentMode,_l=null,eo=null,Ns=null,to=!1;function Ju(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;to||_l==null||_l!==Nl(l)||(l=_l,"selectionStart"in l&&Pr(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}),Ns&&ys(Ns,l)||(Ns=l,l=ur(eo,"onSelect"),0<l.length&&(t=new yi("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=_l)))}function Za(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var El={animationend:Za("Animation","AnimationEnd"),animationiteration:Za("Animation","AnimationIteration"),animationstart:Za("Animation","AnimationStart"),transitionrun:Za("Transition","TransitionRun"),transitionstart:Za("Transition","TransitionStart"),transitioncancel:Za("Transition","TransitionCancel"),transitionend:Za("Transition","TransitionEnd")},no={},Wu={};Vn&&(Wu=document.createElement("div").style,"AnimationEvent"in window||(delete El.animationend.animation,delete El.animationiteration.animation,delete El.animationstart.animation),"TransitionEvent"in window||delete El.transitionend.transition);function Fa(e){if(no[e])return no[e];if(!El[e])return e;var t=El[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wu)return no[e]=t[n];return e}var Pu=Fa("animationend"),ed=Fa("animationiteration"),td=Fa("animationstart"),hx=Fa("transitionrun"),px=Fa("transitionstart"),xx=Fa("transitioncancel"),nd=Fa("transitionend"),ad=new Map,ao="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(" ");ao.push("scrollEnd");function Tn(e,t){ad.set(e,t),Xn(t,[e])}var Si=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)},bn=[],wl=0,lo=0;function ki(){for(var e=wl,t=lo=wl=0;t<e;){var n=bn[t];bn[t++]=null;var l=bn[t];bn[t++]=null;var i=bn[t];bn[t++]=null;var o=bn[t];if(bn[t++]=null,l!==null&&i!==null){var m=l.pending;m===null?i.next=i:(i.next=m.next,m.next=i),l.pending=i}o!==0&&ld(n,i,o)}}function _i(e,t,n,l){bn[wl++]=e,bn[wl++]=t,bn[wl++]=n,bn[wl++]=l,lo|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function so(e,t,n,l){return _i(e,t,n,l),Ei(e)}function Ja(e,t){return _i(e,null,null,t),Ei(e)}function ld(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,o=e.return;o!==null;)o.childLanes|=n,l=o.alternate,l!==null&&(l.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(i=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,i&&t!==null&&(i=31-It(n),e=o.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),o):null}function Ei(e){if(50<Gs)throw Gs=0,pc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Tl={};function gx(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 rn(e,t,n,l){return new gx(e,t,n,l)}function io(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qn(e,t){var n=e.alternate;return n===null?(n=rn(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 sd(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 wi(e,t,n,l,i,o){var m=0;if(l=e,typeof e=="function")io(e)&&(m=1);else if(typeof e=="string")m=jg(e,n,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=rn(31,n,t,i),e.elementType=F,e.lanes=o,e;case T:return Wa(n.children,i,o,t);case j:m=8,i|=24;break;case L:return e=rn(12,n,t,i|2),e.elementType=L,e.lanes=o,e;case M:return e=rn(13,n,t,i),e.elementType=M,e.lanes=o,e;case R:return e=rn(19,n,t,i),e.elementType=R,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:m=10;break e;case B:m=9;break e;case V:m=11;break e;case _:m=14;break e;case Q:m=16,l=null;break e}m=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=rn(m,n,t,i),t.elementType=e,t.type=l,t.lanes=o,t}function Wa(e,t,n,l){return e=rn(7,e,l,t),e.lanes=n,e}function ro(e,t,n){return e=rn(6,e,null,t),e.lanes=n,e}function id(e){var t=rn(18,null,null,0);return t.stateNode=e,t}function oo(e,t,n){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var rd=new WeakMap;function vn(e,t){if(typeof e=="object"&&e!==null){var n=rd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:On(t)},rd.set(e,t),t)}return{value:e,source:t,stack:On(t)}}var Al=[],Ml=0,Ti=null,js=0,yn=[],Nn=0,ga=null,Ln=1,Bn="";function Zn(e,t){Al[Ml++]=js,Al[Ml++]=Ti,Ti=e,js=t}function od(e,t,n){yn[Nn++]=Ln,yn[Nn++]=Bn,yn[Nn++]=ga,ga=e;var l=Ln;e=Bn;var i=32-It(l)-1;l&=~(1<<i),n+=1;var o=32-It(t)+i;if(30<o){var m=i-i%5;o=(l&(1<<m)-1).toString(32),l>>=m,i-=m,Ln=1<<32-It(t)+i|n<<i|l,Bn=o+e}else Ln=1<<o|n<<i|l,Bn=e}function co(e){e.return!==null&&(Zn(e,1),od(e,1,0))}function uo(e){for(;e===Ti;)Ti=Al[--Ml],Al[Ml]=null,js=Al[--Ml],Al[Ml]=null;for(;e===ga;)ga=yn[--Nn],yn[Nn]=null,Bn=yn[--Nn],yn[Nn]=null,Ln=yn[--Nn],yn[Nn]=null}function cd(e,t){yn[Nn++]=Ln,yn[Nn++]=Bn,yn[Nn++]=ga,Ln=t.id,Bn=t.overflow,ga=e}var Rt=null,lt=null,$e=!1,ba=null,jn=!1,fo=Error(c(519));function va(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ss(vn(t,e)),fo}function ud(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[pt]=e,t[Ut]=l,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<Xs.length;n++)ze(Xs[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Va(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Sl(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&&(ze("beforetoggle",t),ze("toggle",t)),l.onScroll!=null&&ze("scroll",t),l.onScrollEnd!=null&&ze("scrollend",t),l.onClick!=null&&(t.onclick=ce),t=!0):t=!1,t||va(e,!0)}function dd(e){for(Rt=e.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:jn=!1;return;case 27:case 3:jn=!0;return;default:Rt=Rt.return}}function Cl(e){if(e!==Rt)return!1;if(!$e)return dd(e),$e=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Mc(e.type,e.memoizedProps)),n=!n),n&<&&va(e),dd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));lt=Bm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));lt=Bm(e)}else t===27?(t=lt,Oa(e.type)?(e=zc,zc=null,lt=e):lt=t):lt=Rt?kn(e.stateNode.nextSibling):null;return!0}function Pa(){lt=Rt=null,$e=!1}function mo(){var e=ba;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),ba=null),e}function Ss(e){ba===null?ba=[e]:ba.push(e)}var ho=S(null),el=null,Fn=null;function ya(e,t,n){se(ho,t._currentValue),t._currentValue=n}function Jn(e){e._currentValue=ho.current,U(ho)}function po(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 xo(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var m=i.child;o=o.firstContext;e:for(;o!==null;){var b=o;o=i;for(var k=0;k<t.length;k++)if(b.context===t[k]){o.lanes|=n,b=o.alternate,b!==null&&(b.lanes|=n),po(o.return,n,e),l||(m=null);break e}o=b.next}}else if(i.tag===18){if(m=i.return,m===null)throw Error(c(341));m.lanes|=n,o=m.alternate,o!==null&&(o.lanes|=n),po(m,n,e),m=null}else m=i.child;if(m!==null)m.return=i;else for(m=i;m!==null;){if(m===e){m=null;break}if(i=m.sibling,i!==null){i.return=m.return,m=i;break}m=m.return}i=m}}function Rl(e,t,n,l){e=null;for(var i=t,o=!1;i!==null;){if(!o){if((i.flags&524288)!==0)o=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var m=i.alternate;if(m===null)throw Error(c(387));if(m=m.memoizedProps,m!==null){var b=i.type;sn(i.pendingProps.value,m.value)||(e!==null?e.push(b):e=[b])}}else if(i===ge.current){if(m=i.alternate,m===null)throw Error(c(387));m.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Fs):e=[Fs])}i=i.return}e!==null&&xo(t,e,n,l),t.flags|=262144}function Ai(e){for(e=e.firstContext;e!==null;){if(!sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function tl(e){el=e,Fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ot(e){return fd(el,e)}function Mi(e,t){return el===null&&tl(e),fd(e,t)}function fd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Fn===null){if(e===null)throw Error(c(308));Fn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fn=Fn.next=t;return n}var bx=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()})}},vx=s.unstable_scheduleCallback,yx=s.unstable_NormalPriority,jt={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function go(){return{controller:new bx,data:new Map,refCount:0}}function ks(e){e.refCount--,e.refCount===0&&vx(yx,function(){e.controller.abort()})}var _s=null,bo=0,Ol=0,Dl=null;function Nx(e,t){if(_s===null){var n=_s=[];bo=0,Ol=Nc(),Dl={status:"pending",value:void 0,then:function(l){n.push(l)}}}return bo++,t.then(md,md),t}function md(){if(--bo===0&&_s!==null){Dl!==null&&(Dl.status="fulfilled");var e=_s;_s=null,Ol=0,Dl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function jx(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var hd=w.S;w.S=function(e,t){Wf=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Nx(e,t),hd!==null&&hd(e,t)};var nl=S(null);function vo(){var e=nl.current;return e!==null?e:et.pooledCache}function Ci(e,t){t===null?se(nl,nl.current):se(nl,t.pool)}function pd(){var e=vo();return e===null?null:{parent:jt._currentValue,pool:e}}var zl=Error(c(460)),yo=Error(c(474)),Ri=Error(c(542)),Oi={then:function(){}};function xd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function gd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(ce,ce),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vd(e),e;default:if(typeof t.status=="string")t.then(ce,ce);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vd(e),e}throw ll=t,zl}}function al(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ll=n,zl):n}}var ll=null;function bd(){if(ll===null)throw Error(c(459));var e=ll;return ll=null,e}function vd(e){if(e===zl||e===Ri)throw Error(c(483))}var Ll=null,Es=0;function Di(e){var t=Es;return Es+=1,Ll===null&&(Ll=[]),gd(Ll,e,t)}function ws(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function zi(e,t){throw t.$$typeof===A?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yd(e){function t(z,C){if(e){var $=z.deletions;$===null?(z.deletions=[C],z.flags|=16):$.push(C)}}function n(z,C){if(!e)return null;for(;C!==null;)t(z,C),C=C.sibling;return null}function l(z){for(var C=new Map;z!==null;)z.key!==null?C.set(z.key,z):C.set(z.index,z),z=z.sibling;return C}function i(z,C){return z=Qn(z,C),z.index=0,z.sibling=null,z}function o(z,C,$){return z.index=$,e?($=z.alternate,$!==null?($=$.index,$<C?(z.flags|=67108866,C):$):(z.flags|=67108866,C)):(z.flags|=1048576,C)}function m(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function b(z,C,$,W){return C===null||C.tag!==6?(C=ro($,z.mode,W),C.return=z,C):(C=i(C,$),C.return=z,C)}function k(z,C,$,W){var je=$.type;return je===T?Z(z,C,$.props.children,W,$.key):C!==null&&(C.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===Q&&al(je)===C.type)?(C=i(C,$.props),ws(C,$),C.return=z,C):(C=wi($.type,$.key,$.props,null,z.mode,W),ws(C,$),C.return=z,C)}function q(z,C,$,W){return C===null||C.tag!==4||C.stateNode.containerInfo!==$.containerInfo||C.stateNode.implementation!==$.implementation?(C=oo($,z.mode,W),C.return=z,C):(C=i(C,$.children||[]),C.return=z,C)}function Z(z,C,$,W,je){return C===null||C.tag!==7?(C=Wa($,z.mode,W,je),C.return=z,C):(C=i(C,$),C.return=z,C)}function te(z,C,$){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=ro(""+C,z.mode,$),C.return=z,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case K:return $=wi(C.type,C.key,C.props,null,z.mode,$),ws($,C),$.return=z,$;case O:return C=oo(C,z.mode,$),C.return=z,C;case Q:return C=al(C),te(z,C,$)}if(D(C)||ae(C))return C=Wa(C,z.mode,$,null),C.return=z,C;if(typeof C.then=="function")return te(z,Di(C),$);if(C.$$typeof===P)return te(z,Mi(z,C),$);zi(z,C)}return null}function H(z,C,$,W){var je=C!==null?C.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return je!==null?null:b(z,C,""+$,W);if(typeof $=="object"&&$!==null){switch($.$$typeof){case K:return $.key===je?k(z,C,$,W):null;case O:return $.key===je?q(z,C,$,W):null;case Q:return $=al($),H(z,C,$,W)}if(D($)||ae($))return je!==null?null:Z(z,C,$,W,null);if(typeof $.then=="function")return H(z,C,Di($),W);if($.$$typeof===P)return H(z,C,Mi(z,$),W);zi(z,$)}return null}function X(z,C,$,W,je){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return z=z.get($)||null,b(C,z,""+W,je);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case K:return z=z.get(W.key===null?$:W.key)||null,k(C,z,W,je);case O:return z=z.get(W.key===null?$:W.key)||null,q(C,z,W,je);case Q:return W=al(W),X(z,C,$,W,je)}if(D(W)||ae(W))return z=z.get($)||null,Z(C,z,W,je,null);if(typeof W.then=="function")return X(z,C,$,Di(W),je);if(W.$$typeof===P)return X(z,C,$,Mi(C,W),je);zi(C,W)}return null}function xe(z,C,$,W){for(var je=null,He=null,ye=C,Ce=C=0,Ue=null;ye!==null&&Ce<$.length;Ce++){ye.index>Ce?(Ue=ye,ye=null):Ue=ye.sibling;var Ie=H(z,ye,$[Ce],W);if(Ie===null){ye===null&&(ye=Ue);break}e&&ye&&Ie.alternate===null&&t(z,ye),C=o(Ie,C,Ce),He===null?je=Ie:He.sibling=Ie,He=Ie,ye=Ue}if(Ce===$.length)return n(z,ye),$e&&Zn(z,Ce),je;if(ye===null){for(;Ce<$.length;Ce++)ye=te(z,$[Ce],W),ye!==null&&(C=o(ye,C,Ce),He===null?je=ye:He.sibling=ye,He=ye);return $e&&Zn(z,Ce),je}for(ye=l(ye);Ce<$.length;Ce++)Ue=X(ye,z,Ce,$[Ce],W),Ue!==null&&(e&&Ue.alternate!==null&&ye.delete(Ue.key===null?Ce:Ue.key),C=o(Ue,C,Ce),He===null?je=Ue:He.sibling=Ue,He=Ue);return e&&ye.forEach(function(Ua){return t(z,Ua)}),$e&&Zn(z,Ce),je}function Se(z,C,$,W){if($==null)throw Error(c(151));for(var je=null,He=null,ye=C,Ce=C=0,Ue=null,Ie=$.next();ye!==null&&!Ie.done;Ce++,Ie=$.next()){ye.index>Ce?(Ue=ye,ye=null):Ue=ye.sibling;var Ua=H(z,ye,Ie.value,W);if(Ua===null){ye===null&&(ye=Ue);break}e&&ye&&Ua.alternate===null&&t(z,ye),C=o(Ua,C,Ce),He===null?je=Ua:He.sibling=Ua,He=Ua,ye=Ue}if(Ie.done)return n(z,ye),$e&&Zn(z,Ce),je;if(ye===null){for(;!Ie.done;Ce++,Ie=$.next())Ie=te(z,Ie.value,W),Ie!==null&&(C=o(Ie,C,Ce),He===null?je=Ie:He.sibling=Ie,He=Ie);return $e&&Zn(z,Ce),je}for(ye=l(ye);!Ie.done;Ce++,Ie=$.next())Ie=X(ye,z,Ce,Ie.value,W),Ie!==null&&(e&&Ie.alternate!==null&&ye.delete(Ie.key===null?Ce:Ie.key),C=o(Ie,C,Ce),He===null?je=Ie:He.sibling=Ie,He=Ie);return e&&ye.forEach(function(Og){return t(z,Og)}),$e&&Zn(z,Ce),je}function We(z,C,$,W){if(typeof $=="object"&&$!==null&&$.type===T&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case K:e:{for(var je=$.key;C!==null;){if(C.key===je){if(je=$.type,je===T){if(C.tag===7){n(z,C.sibling),W=i(C,$.props.children),W.return=z,z=W;break e}}else if(C.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===Q&&al(je)===C.type){n(z,C.sibling),W=i(C,$.props),ws(W,$),W.return=z,z=W;break e}n(z,C);break}else t(z,C);C=C.sibling}$.type===T?(W=Wa($.props.children,z.mode,W,$.key),W.return=z,z=W):(W=wi($.type,$.key,$.props,null,z.mode,W),ws(W,$),W.return=z,z=W)}return m(z);case O:e:{for(je=$.key;C!==null;){if(C.key===je)if(C.tag===4&&C.stateNode.containerInfo===$.containerInfo&&C.stateNode.implementation===$.implementation){n(z,C.sibling),W=i(C,$.children||[]),W.return=z,z=W;break e}else{n(z,C);break}else t(z,C);C=C.sibling}W=oo($,z.mode,W),W.return=z,z=W}return m(z);case Q:return $=al($),We(z,C,$,W)}if(D($))return xe(z,C,$,W);if(ae($)){if(je=ae($),typeof je!="function")throw Error(c(150));return $=je.call($),Se(z,C,$,W)}if(typeof $.then=="function")return We(z,C,Di($),W);if($.$$typeof===P)return We(z,C,Mi(z,$),W);zi(z,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,C!==null&&C.tag===6?(n(z,C.sibling),W=i(C,$),W.return=z,z=W):(n(z,C),W=ro($,z.mode,W),W.return=z,z=W),m(z)):n(z,C)}return function(z,C,$,W){try{Es=0;var je=We(z,C,$,W);return Ll=null,je}catch(ye){if(ye===zl||ye===Ri)throw ye;var He=rn(29,ye,null,z.mode);return He.lanes=W,He.return=z,He}finally{}}}var sl=yd(!0),Nd=yd(!1),Na=!1;function No(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jo(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 ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Xe&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Ei(e),ld(e,null,n),t}return _i(e,l,t,n),Ei(e)}function Ts(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,_e(e,n)}}function So(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=m:o=o.next=m,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:o,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 ko=!1;function As(){if(ko){var e=Dl;if(e!==null)throw e}}function Ms(e,t,n,l){ko=!1;var i=e.updateQueue;Na=!1;var o=i.firstBaseUpdate,m=i.lastBaseUpdate,b=i.shared.pending;if(b!==null){i.shared.pending=null;var k=b,q=k.next;k.next=null,m===null?o=q:m.next=q,m=k;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,b=Z.lastBaseUpdate,b!==m&&(b===null?Z.firstBaseUpdate=q:b.next=q,Z.lastBaseUpdate=k))}if(o!==null){var te=i.baseState;m=0,Z=q=k=null,b=o;do{var H=b.lane&-536870913,X=H!==b.lane;if(X?(Be&H)===H:(l&H)===H){H!==0&&H===Ol&&(ko=!0),Z!==null&&(Z=Z.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var xe=e,Se=b;H=t;var We=n;switch(Se.tag){case 1:if(xe=Se.payload,typeof xe=="function"){te=xe.call(We,te,H);break e}te=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Se.payload,H=typeof xe=="function"?xe.call(We,te,H):xe,H==null)break e;te=N({},te,H);break e;case 2:Na=!0}}H=b.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=i.callbacks,X===null?i.callbacks=[H]:X.push(H))}else X={lane:H,tag:b.tag,payload:b.payload,callback:b.callback,next:null},Z===null?(q=Z=X,k=te):Z=Z.next=X,m|=H;if(b=b.next,b===null){if(b=i.shared.pending,b===null)break;X=b,b=X.next,X.next=null,i.lastBaseUpdate=X,i.shared.pending=null}}while(!0);Z===null&&(k=te),i.baseState=k,i.firstBaseUpdate=q,i.lastBaseUpdate=Z,o===null&&(i.shared.lanes=0),Ta|=m,e.lanes=m,e.memoizedState=te}}function jd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Sd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jd(n[e],t)}var Bl=S(null),Li=S(0);function kd(e,t){e=ia,se(Li,e),se(Bl,t),ia=e|t.baseLanes}function _o(){se(Li,ia),se(Bl,Bl.current)}function Eo(){ia=Li.current,U(Bl),U(Li)}var on=S(null),Sn=null;function ka(e){var t=e.alternate;se(gt,gt.current&1),se(on,e),Sn===null&&(t===null||Bl.current!==null||t.memoizedState!==null)&&(Sn=e)}function wo(e){se(gt,gt.current),se(on,e),Sn===null&&(Sn=e)}function _d(e){e.tag===22?(se(gt,gt.current),se(on,e),Sn===null&&(Sn=e)):_a()}function _a(){se(gt,gt.current),se(on,on.current)}function cn(e){U(on),Sn===e&&(Sn=null),U(gt)}var gt=S(0);function Bi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Oc(n)||Dc(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 Wn=0,Me=null,Fe=null,St=null,Ui=!1,Ul=!1,il=!1,$i=0,Cs=0,$l=null,Sx=0;function dt(){throw Error(c(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sn(e[n],t[n]))return!1;return!0}function Ao(e,t,n,l,i,o){return Wn=o,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?cf:Yo,il=!1,o=n(l,i),il=!1,Ul&&(o=wd(t,n,l,i)),Ed(e),o}function Ed(e){w.H=Ds;var t=Fe!==null&&Fe.next!==null;if(Wn=0,St=Fe=Me=null,Ui=!1,Cs=0,$l=null,t)throw Error(c(300));e===null||kt||(e=e.dependencies,e!==null&&Ai(e)&&(kt=!0))}function wd(e,t,n,l){Me=e;var i=0;do{if(Ul&&($l=null),Cs=0,Ul=!1,25<=i)throw Error(c(301));if(i+=1,St=Fe=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}w.H=uf,o=t(n,l)}while(Ul);return o}function kx(){var e=w.H,t=e.useState()[0];return t=typeof t.then=="function"?Rs(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(Me.flags|=1024),t}function Mo(){var e=$i!==0;return $i=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ro(e){if(Ui){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ui=!1}Wn=0,St=Fe=Me=null,Ul=!1,Cs=$i=0,$l=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Me.memoizedState=St=e:St=St.next=e,St}function bt(){if(Fe===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=St===null?Me.memoizedState:St.next;if(t!==null)St=t,Fe=e;else{if(e===null)throw Me.alternate===null?Error(c(467)):Error(c(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},St===null?Me.memoizedState=St=e:St=St.next=e}return St}function qi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rs(e){var t=Cs;return Cs+=1,$l===null&&($l=[]),e=gd($l,e,t),t=Me,(St===null?t.memoizedState:St.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?cf:Yo),e}function Hi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Rs(e);if(e.$$typeof===P)return Ot(e)}throw Error(c(438,String(e)))}function Oo(e){var t=null,n=Me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Me.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=qi(),Me.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]=G;return t.index++,n}function Pn(e,t){return typeof t=="function"?t(e):t}function Ii(e){var t=bt();return Do(t,Fe,e)}function Do(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var i=e.baseQueue,o=l.pending;if(o!==null){if(i!==null){var m=i.next;i.next=o.next,o.next=m}t.baseQueue=i=o,l.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var b=m=null,k=null,q=t,Z=!1;do{var te=q.lane&-536870913;if(te!==q.lane?(Be&te)===te:(Wn&te)===te){var H=q.revertLane;if(H===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),te===Ol&&(Z=!0);else if((Wn&H)===H){q=q.next,H===Ol&&(Z=!0);continue}else te={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},k===null?(b=k=te,m=o):k=k.next=te,Me.lanes|=H,Ta|=H;te=q.action,il&&n(o,te),o=q.hasEagerState?q.eagerState:n(o,te)}else H={lane:te,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},k===null?(b=k=H,m=o):k=k.next=H,Me.lanes|=te,Ta|=te;q=q.next}while(q!==null&&q!==t);if(k===null?m=o:k.next=b,!sn(o,e.memoizedState)&&(kt=!0,Z&&(n=Dl,n!==null)))throw n;e.memoizedState=o,e.baseState=m,e.baseQueue=k,l.lastRenderedState=o}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function zo(e){var t=bt(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var m=i=i.next;do o=e(o,m.action),m=m.next;while(m!==i);sn(o,t.memoizedState)||(kt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,l]}function Td(e,t,n){var l=Me,i=bt(),o=$e;if(o){if(n===void 0)throw Error(c(407));n=n()}else n=t();var m=!sn((Fe||i).memoizedState,n);if(m&&(i.memoizedState=n,kt=!0),i=i.queue,Uo(Cd.bind(null,l,i,e),[e]),i.getSnapshot!==t||m||St!==null&&St.memoizedState.tag&1){if(l.flags|=2048,ql(9,{destroy:void 0},Md.bind(null,l,i,n,t),null),et===null)throw Error(c(349));o||(Wn&127)!==0||Ad(l,t,n)}return n}function Ad(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Me.updateQueue,t===null?(t=qi(),Me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Md(e,t,n,l){t.value=n,t.getSnapshot=l,Rd(t)&&Od(e)}function Cd(e,t,n){return n(function(){Rd(t)&&Od(e)})}function Rd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sn(e,n)}catch{return!0}}function Od(e){var t=Ja(e,2);t!==null&&nn(t,e,2)}function Lo(e){var t=Yt();if(typeof e=="function"){var n=e;if(e=n(),il){Dn(!0);try{n()}finally{Dn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:e},t}function Dd(e,t,n,l){return e.baseState=n,Do(e,Fe,typeof l=="function"?l:Pn)}function _x(e,t,n,l,i){if(Xi(e))throw Error(c(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){o.listeners.push(m)}};w.T!==null?n(!0):o.isTransition=!1,l(o),n=t.pending,n===null?(o.next=t.pending=o,zd(t,o)):(o.next=n.next,t.pending=n.next=o)}}function zd(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var o=w.T,m={};w.T=m;try{var b=n(i,l),k=w.S;k!==null&&k(m,b),Ld(e,t,b)}catch(q){Bo(e,t,q)}finally{o!==null&&m.types!==null&&(o.types=m.types),w.T=o}}else try{o=n(i,l),Ld(e,t,o)}catch(q){Bo(e,t,q)}}function Ld(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Bd(e,t,l)},function(l){return Bo(e,t,l)}):Bd(e,t,n)}function Bd(e,t,n){t.status="fulfilled",t.value=n,Ud(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,zd(e,n)))}function Bo(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Ud(t),t=t.next;while(t!==l)}e.action=null}function Ud(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $d(e,t){return t}function qd(e,t){if($e){var n=et.formState;if(n!==null){e:{var l=Me;if($e){if(lt){t:{for(var i=lt,o=jn;i.nodeType!==8;){if(!o){i=null;break t}if(i=kn(i.nextSibling),i===null){i=null;break t}}o=i.data,i=o==="F!"||o==="F"?i:null}if(i){lt=kn(i.nextSibling),l=i.data==="F!";break e}}va(l)}l=!1}l&&(t=n[0])}}return n=Yt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$d,lastRenderedState:t},n.queue=l,n=sf.bind(null,Me,l),l.dispatch=n,l=Lo(!1),o=Go.bind(null,Me,!1,l.queue),l=Yt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=_x.bind(null,Me,i,o,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Hd(e){var t=bt();return Id(t,Fe,e)}function Id(e,t,n){if(t=Do(e,t,$d)[0],e=Ii(Pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Rs(t)}catch(m){throw m===zl?Ri:m}else l=t;t=bt();var i=t.queue,o=i.dispatch;return n!==t.memoizedState&&(Me.flags|=2048,ql(9,{destroy:void 0},Ex.bind(null,i,n),null)),[l,o,e]}function Ex(e,t){e.action=t}function Gd(e){var t=bt(),n=Fe;if(n!==null)return Id(t,n,e);bt(),t=t.memoizedState,n=bt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function ql(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Me.updateQueue,t===null&&(t=qi(),Me.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 Yd(){return bt().memoizedState}function Gi(e,t,n,l){var i=Yt();Me.flags|=e,i.memoizedState=ql(1|t,{destroy:void 0},n,l===void 0?null:l)}function Yi(e,t,n,l){var i=bt();l=l===void 0?null:l;var o=i.memoizedState.inst;Fe!==null&&l!==null&&To(l,Fe.memoizedState.deps)?i.memoizedState=ql(t,o,n,l):(Me.flags|=e,i.memoizedState=ql(1|t,o,n,l))}function Xd(e,t){Gi(8390656,8,e,t)}function Uo(e,t){Yi(2048,8,e,t)}function wx(e){Me.flags|=4;var t=Me.updateQueue;if(t===null)t=qi(),Me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Kd(e){var t=bt().memoizedState;return wx({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Vd(e,t){return Yi(4,2,e,t)}function Qd(e,t){return Yi(4,4,e,t)}function Zd(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 Fd(e,t,n){n=n!=null?n.concat([e]):null,Yi(4,4,Zd.bind(null,t,e),n)}function $o(){}function Jd(e,t){var n=bt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&To(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Wd(e,t){var n=bt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&To(t,l[1]))return l[0];if(l=e(),il){Dn(!0);try{e()}finally{Dn(!1)}}return n.memoizedState=[l,t],l}function qo(e,t,n){return n===void 0||(Wn&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=em(),Me.lanes|=e,Ta|=e,n)}function Pd(e,t,n,l){return sn(n,t)?n:Bl.current!==null?(e=qo(e,n,l),sn(e,t)||(kt=!0),e):(Wn&42)===0||(Wn&1073741824)!==0&&(Be&261930)===0?(kt=!0,e.memoizedState=n):(e=em(),Me.lanes|=e,Ta|=e,t)}function ef(e,t,n,l,i){var o=I.p;I.p=o!==0&&8>o?o:8;var m=w.T,b={};w.T=b,Go(e,!1,t,n);try{var k=i(),q=w.S;if(q!==null&&q(b,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var Z=jx(k,l);Os(e,t,Z,fn(e))}else Os(e,t,l,fn(e))}catch(te){Os(e,t,{then:function(){},status:"rejected",reason:te},fn())}finally{I.p=o,m!==null&&b.types!==null&&(m.types=b.types),w.T=m}}function Tx(){}function Ho(e,t,n,l){if(e.tag!==5)throw Error(c(476));var i=tf(e).queue;ef(e,i,t,ne,n===null?Tx:function(){return nf(e),n(l)})}function tf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nf(e){var t=tf(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},fn())}function Io(){return Ot(Fs)}function af(){return bt().memoizedState}function lf(){return bt().memoizedState}function Ax(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fn();e=ja(n);var l=Sa(t,e,n);l!==null&&(nn(l,t,n),Ts(l,t,n)),t={cache:go()},e.payload=t;return}t=t.return}}function Mx(e,t,n){var l=fn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Xi(e)?rf(t,n):(n=so(e,t,n,l),n!==null&&(nn(n,e,l),of(n,t,l)))}function sf(e,t,n){var l=fn();Os(e,t,n,l)}function Os(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xi(e))rf(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var m=t.lastRenderedState,b=o(m,n);if(i.hasEagerState=!0,i.eagerState=b,sn(b,m))return _i(e,t,i,0),et===null&&ki(),!1}catch{}finally{}if(n=so(e,t,i,l),n!==null)return nn(n,e,l),of(n,t,l),!0}return!1}function Go(e,t,n,l){if(l={lane:2,revertLane:Nc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Xi(e)){if(t)throw Error(c(479))}else t=so(e,n,l,2),t!==null&&nn(t,e,2)}function Xi(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function rf(e,t){Ul=Ui=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function of(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_e(e,n)}}var Ds={readContext:Ot,use:Hi,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};Ds.useEffectEvent=dt;var cf={readContext:Ot,use:Hi,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Ot,useEffect:Xd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Gi(4194308,4,Zd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gi(4194308,4,e,t)},useInsertionEffect:function(e,t){Gi(4,2,e,t)},useMemo:function(e,t){var n=Yt();t=t===void 0?null:t;var l=e();if(il){Dn(!0);try{e()}finally{Dn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Yt();if(n!==void 0){var i=n(t);if(il){Dn(!0);try{n(t)}finally{Dn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Mx.bind(null,Me,e),[l.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=Lo(e);var t=e.queue,n=sf.bind(null,Me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$o,useDeferredValue:function(e,t){var n=Yt();return qo(n,e,t)},useTransition:function(){var e=Lo(!1);return e=ef.bind(null,Me,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Me,i=Yt();if($e){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),et===null)throw Error(c(349));(Be&127)!==0||Ad(l,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Xd(Cd.bind(null,l,o,e),[e]),l.flags|=2048,ql(9,{destroy:void 0},Md.bind(null,l,o,n,t),null),n},useId:function(){var e=Yt(),t=et.identifierPrefix;if($e){var n=Bn,l=Ln;n=(l&~(1<<32-It(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=$i++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Sx++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Io,useFormState:qd,useActionState:qd,useOptimistic:function(e){var t=Yt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Go.bind(null,Me,!0,n),n.dispatch=t,[e,t]},useMemoCache:Oo,useCacheRefresh:function(){return Yt().memoizedState=Ax.bind(null,Me)},useEffectEvent:function(e){var t=Yt(),n={impl:e};return t.memoizedState=n,function(){if((Xe&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Yo={readContext:Ot,use:Hi,useCallback:Jd,useContext:Ot,useEffect:Uo,useImperativeHandle:Fd,useInsertionEffect:Vd,useLayoutEffect:Qd,useMemo:Wd,useReducer:Ii,useRef:Yd,useState:function(){return Ii(Pn)},useDebugValue:$o,useDeferredValue:function(e,t){var n=bt();return Pd(n,Fe.memoizedState,e,t)},useTransition:function(){var e=Ii(Pn)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:Rs(e),t]},useSyncExternalStore:Td,useId:af,useHostTransitionStatus:Io,useFormState:Hd,useActionState:Hd,useOptimistic:function(e,t){var n=bt();return Dd(n,Fe,e,t)},useMemoCache:Oo,useCacheRefresh:lf};Yo.useEffectEvent=Kd;var uf={readContext:Ot,use:Hi,useCallback:Jd,useContext:Ot,useEffect:Uo,useImperativeHandle:Fd,useInsertionEffect:Vd,useLayoutEffect:Qd,useMemo:Wd,useReducer:zo,useRef:Yd,useState:function(){return zo(Pn)},useDebugValue:$o,useDeferredValue:function(e,t){var n=bt();return Fe===null?qo(n,e,t):Pd(n,Fe.memoizedState,e,t)},useTransition:function(){var e=zo(Pn)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:Rs(e),t]},useSyncExternalStore:Td,useId:af,useHostTransitionStatus:Io,useFormState:Gd,useActionState:Gd,useOptimistic:function(e,t){var n=bt();return Fe!==null?Dd(n,Fe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Oo,useCacheRefresh:lf};uf.useEffectEvent=Kd;function Xo(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:N({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ko={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=fn(),i=ja(l);i.payload=t,n!=null&&(i.callback=n),t=Sa(e,i,l),t!==null&&(nn(t,e,l),Ts(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=fn(),i=ja(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Sa(e,i,l),t!==null&&(nn(t,e,l),Ts(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fn(),l=ja(n);l.tag=2,t!=null&&(l.callback=t),t=Sa(e,l,n),t!==null&&(nn(t,e,n),Ts(t,e,n))}};function df(e,t,n,l,i,o,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,m):t.prototype&&t.prototype.isPureReactComponent?!ys(n,l)||!ys(i,o):!0}function ff(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&&Ko.enqueueReplaceState(t,t.state,null)}function rl(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=N({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function mf(e){Si(e)}function hf(e){console.error(e)}function pf(e){Si(e)}function Ki(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function xf(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Vo(e,t,n){return n=ja(n),n.tag=3,n.payload={element:null},n.callback=function(){Ki(e,t)},n}function gf(e){return e=ja(e),e.tag=3,e}function bf(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var o=l.value;e.payload=function(){return i(o)},e.callback=function(){xf(t,n,l)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){xf(t,n,l),typeof i!="function"&&(Aa===null?Aa=new Set([this]):Aa.add(this));var b=l.stack;this.componentDidCatch(l.value,{componentStack:b!==null?b:""})})}function Cx(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Rl(t,n,i,!0),n=on.current,n!==null){switch(n.tag){case 31:case 13:return Sn===null?lr():n.alternate===null&&ft===0&&(ft=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===Oi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),bc(e,l,i)),!1;case 22:return n.flags|=65536,l===Oi?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)),bc(e,l,i)),!1}throw Error(c(435,n.tag))}return bc(e,l,i),lr(),!1}if($e)return t=on.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==fo&&(e=Error(c(422),{cause:l}),Ss(vn(e,n)))):(l!==fo&&(t=Error(c(423),{cause:l}),Ss(vn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=vn(l,n),i=Vo(e.stateNode,l,i),So(e,i),ft!==4&&(ft=2)),!1;var o=Error(c(520),{cause:l});if(o=vn(o,n),Is===null?Is=[o]:Is.push(o),ft!==4&&(ft=2),t===null)return!0;l=vn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Vo(n.stateNode,l,e),So(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Aa===null||!Aa.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=gf(i),bf(i,e,n,l),So(n,i),!1}n=n.return}while(n!==null);return!1}var Qo=Error(c(461)),kt=!1;function Dt(e,t,n,l){t.child=e===null?Nd(t,null,n,l):sl(t,e.child,n,l)}function vf(e,t,n,l,i){n=n.render;var o=t.ref;if("ref"in l){var m={};for(var b in l)b!=="ref"&&(m[b]=l[b])}else m=l;return tl(t),l=Ao(e,t,n,m,o,i),b=Mo(),e!==null&&!kt?(Co(e,t,i),ea(e,t,i)):($e&&b&&co(t),t.flags|=1,Dt(e,t,l,i),t.child)}function yf(e,t,n,l,i){if(e===null){var o=n.type;return typeof o=="function"&&!io(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,Nf(e,t,o,l,i)):(e=wi(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!nc(e,i)){var m=o.memoizedProps;if(n=n.compare,n=n!==null?n:ys,n(m,l)&&e.ref===t.ref)return ea(e,t,i)}return t.flags|=1,e=Qn(o,l),e.ref=t.ref,e.return=t,t.child=e}function Nf(e,t,n,l,i){if(e!==null){var o=e.memoizedProps;if(ys(o,l)&&e.ref===t.ref)if(kt=!1,t.pendingProps=l=o,nc(e,i))(e.flags&131072)!==0&&(kt=!0);else return t.lanes=e.lanes,ea(e,t,i)}return Zo(e,t,n,l,i)}function jf(e,t,n,l){var i=l.children,o=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(o=o!==null?o.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~o}else l=0,t.child=null;return Sf(e,t,o,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ci(t,o!==null?o.cachePool:null),o!==null?kd(t,o):_o(),_d(t);else return l=t.lanes=536870912,Sf(e,t,o!==null?o.baseLanes|n:n,n,l)}else o!==null?(Ci(t,o.cachePool),kd(t,o),_a(),t.memoizedState=null):(e!==null&&Ci(t,null),_o(),_a());return Dt(e,t,i,n),t.child}function zs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sf(e,t,n,l,i){var o=vo();return o=o===null?null:{parent:jt._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&Ci(t,null),_o(),_d(t),e!==null&&Rl(e,t,l,!0),t.childLanes=i,null}function Vi(e,t){return t=Zi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function kf(e,t,n){return sl(t,e.child,null,n),e=Vi(t,t.pendingProps),e.flags|=2,cn(t),t.memoizedState=null,e}function Rx(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if($e){if(l.mode==="hidden")return e=Vi(t,l),t.lanes=536870912,zs(null,e);if(wo(t),(e=lt)?(e=Lm(e,jn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ga!==null?{id:Ln,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},n=id(e),n.return=t,t.child=n,Rt=t,lt=null)):e=null,e===null)throw va(t);return t.lanes=536870912,null}return Vi(t,l)}var o=e.memoizedState;if(o!==null){var m=o.dehydrated;if(wo(t),i)if(t.flags&256)t.flags&=-257,t=kf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(kt||Rl(e,t,n,!1),i=(n&e.childLanes)!==0,kt||i){if(l=et,l!==null&&(m=ht(l,n),m!==0&&m!==o.retryLane))throw o.retryLane=m,Ja(e,m),nn(l,e,m),Qo;lr(),t=kf(e,t,n)}else e=o.treeContext,lt=kn(m.nextSibling),Rt=t,$e=!0,ba=null,jn=!1,e!==null&&cd(t,e),t=Vi(t,l),t.flags|=4096;return t}return e=Qn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qi(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(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Zo(e,t,n,l,i){return tl(t),n=Ao(e,t,n,l,void 0,i),l=Mo(),e!==null&&!kt?(Co(e,t,i),ea(e,t,i)):($e&&l&&co(t),t.flags|=1,Dt(e,t,n,i),t.child)}function _f(e,t,n,l,i,o){return tl(t),t.updateQueue=null,n=wd(t,l,n,i),Ed(e),l=Mo(),e!==null&&!kt?(Co(e,t,o),ea(e,t,o)):($e&&l&&co(t),t.flags|=1,Dt(e,t,n,o),t.child)}function Ef(e,t,n,l,i){if(tl(t),t.stateNode===null){var o=Tl,m=n.contextType;typeof m=="object"&&m!==null&&(o=Ot(m)),o=new n(l,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ko,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=l,o.state=t.memoizedState,o.refs={},No(t),m=n.contextType,o.context=typeof m=="object"&&m!==null?Ot(m):Tl,o.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(Xo(t,n,m,l),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(m=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),m!==o.state&&Ko.enqueueReplaceState(o,o.state,null),Ms(t,l,o,i),As(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){o=t.stateNode;var b=t.memoizedProps,k=rl(n,b);o.props=k;var q=o.context,Z=n.contextType;m=Tl,typeof Z=="object"&&Z!==null&&(m=Ot(Z));var te=n.getDerivedStateFromProps;Z=typeof te=="function"||typeof o.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,Z||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(b||q!==m)&&ff(t,o,l,m),Na=!1;var H=t.memoizedState;o.state=H,Ms(t,l,o,i),As(),q=t.memoizedState,b||H!==q||Na?(typeof te=="function"&&(Xo(t,n,te,l),q=t.memoizedState),(k=Na||df(t,n,k,l,H,q,m))?(Z||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=q),o.props=l,o.state=q,o.context=m,l=k):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{o=t.stateNode,jo(e,t),m=t.memoizedProps,Z=rl(n,m),o.props=Z,te=t.pendingProps,H=o.context,q=n.contextType,k=Tl,typeof q=="object"&&q!==null&&(k=Ot(q)),b=n.getDerivedStateFromProps,(q=typeof b=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m!==te||H!==k)&&ff(t,o,l,k),Na=!1,H=t.memoizedState,o.state=H,Ms(t,l,o,i),As();var X=t.memoizedState;m!==te||H!==X||Na||e!==null&&e.dependencies!==null&&Ai(e.dependencies)?(typeof b=="function"&&(Xo(t,n,b,l),X=t.memoizedState),(Z=Na||df(t,n,Z,l,H,X,k)||e!==null&&e.dependencies!==null&&Ai(e.dependencies))?(q||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(l,X,k),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(l,X,k)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=X),o.props=l,o.state=X,o.context=k,l=Z):(typeof o.componentDidUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return o=l,Qi(e,t),l=(t.flags&128)!==0,o||l?(o=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&l?(t.child=sl(t,e.child,null,i),t.child=sl(t,null,n,i)):Dt(e,t,n,i),t.memoizedState=o.state,e=t.child):e=ea(e,t,i),e}function wf(e,t,n,l){return Pa(),t.flags|=256,Dt(e,t,n,l),t.child}var Fo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jo(e){return{baseLanes:e,cachePool:pd()}}function Wo(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=dn),e}function Tf(e,t,n){var l=t.pendingProps,i=!1,o=(t.flags&128)!==0,m;if((m=o)||(m=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),m&&(i=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if($e){if(i?ka(t):_a(),(e=lt)?(e=Lm(e,jn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ga!==null?{id:Ln,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},n=id(e),n.return=t,t.child=n,Rt=t,lt=null)):e=null,e===null)throw va(t);return Dc(e)?t.lanes=32:t.lanes=536870912,null}var b=l.children;return l=l.fallback,i?(_a(),i=t.mode,b=Zi({mode:"hidden",children:b},i),l=Wa(l,i,n,null),b.return=t,l.return=t,b.sibling=l,t.child=b,l=t.child,l.memoizedState=Jo(n),l.childLanes=Wo(e,m,n),t.memoizedState=Fo,zs(null,l)):(ka(t),Po(t,b))}var k=e.memoizedState;if(k!==null&&(b=k.dehydrated,b!==null)){if(o)t.flags&256?(ka(t),t.flags&=-257,t=ec(e,t,n)):t.memoizedState!==null?(_a(),t.child=e.child,t.flags|=128,t=null):(_a(),b=l.fallback,i=t.mode,l=Zi({mode:"visible",children:l.children},i),b=Wa(b,i,n,null),b.flags|=2,l.return=t,b.return=t,l.sibling=b,t.child=l,sl(t,e.child,null,n),l=t.child,l.memoizedState=Jo(n),l.childLanes=Wo(e,m,n),t.memoizedState=Fo,t=zs(null,l));else if(ka(t),Dc(b)){if(m=b.nextSibling&&b.nextSibling.dataset,m)var q=m.dgst;m=q,l=Error(c(419)),l.stack="",l.digest=m,Ss({value:l,source:null,stack:null}),t=ec(e,t,n)}else if(kt||Rl(e,t,n,!1),m=(n&e.childLanes)!==0,kt||m){if(m=et,m!==null&&(l=ht(m,n),l!==0&&l!==k.retryLane))throw k.retryLane=l,Ja(e,l),nn(m,e,l),Qo;Oc(b)||lr(),t=ec(e,t,n)}else Oc(b)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,lt=kn(b.nextSibling),Rt=t,$e=!0,ba=null,jn=!1,e!==null&&cd(t,e),t=Po(t,l.children),t.flags|=4096);return t}return i?(_a(),b=l.fallback,i=t.mode,k=e.child,q=k.sibling,l=Qn(k,{mode:"hidden",children:l.children}),l.subtreeFlags=k.subtreeFlags&65011712,q!==null?b=Qn(q,b):(b=Wa(b,i,n,null),b.flags|=2),b.return=t,l.return=t,l.sibling=b,t.child=l,zs(null,l),l=t.child,b=e.child.memoizedState,b===null?b=Jo(n):(i=b.cachePool,i!==null?(k=jt._currentValue,i=i.parent!==k?{parent:k,pool:k}:i):i=pd(),b={baseLanes:b.baseLanes|n,cachePool:i}),l.memoizedState=b,l.childLanes=Wo(e,m,n),t.memoizedState=Fo,zs(e.child,l)):(ka(t),n=e.child,e=n.sibling,n=Qn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function Po(e,t){return t=Zi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Zi(e,t){return e=rn(22,e,null,t),e.lanes=0,e}function ec(e,t,n){return sl(t,e.child,null,n),e=Po(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Af(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),po(e.return,t,n)}function tc(e,t,n,l,i,o){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:o}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=n,m.tailMode=i,m.treeForkCount=o)}function Mf(e,t,n){var l=t.pendingProps,i=l.revealOrder,o=l.tail;l=l.children;var m=gt.current,b=(m&2)!==0;if(b?(m=m&1|2,t.flags|=128):m&=1,se(gt,m),Dt(e,t,l,n),l=$e?js:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Af(e,n,t);else if(e.tag===19)Af(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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Bi(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tc(t,!1,i,n,o,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bi(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tc(t,!0,n,null,o,l);break;case"together":tc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ea(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ta|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Rl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Qn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function nc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ai(e)))}function Ox(e,t,n){switch(t.tag){case 3:Ge(t,t.stateNode.containerInfo),ya(t,jt,e.memoizedState.cache),Pa();break;case 27:case 5:it(t);break;case 4:Ge(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wo(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ka(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Tf(e,t,n):(ka(t),e=ea(e,t,n),e!==null?e.sibling:null);ka(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Rl(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return Mf(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),se(gt,gt.current),l)break;return null;case 22:return t.lanes=0,jf(e,t,n,t.pendingProps);case 24:ya(t,jt,e.memoizedState.cache)}return ea(e,t,n)}function Cf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)kt=!0;else{if(!nc(e,n)&&(t.flags&128)===0)return kt=!1,Ox(e,t,n);kt=(e.flags&131072)!==0}else kt=!1,$e&&(t.flags&1048576)!==0&&od(t,js,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=al(t.elementType),t.type=e,typeof e=="function")io(e)?(l=rl(e,l),t.tag=1,t=Ef(null,t,e,l,n)):(t.tag=0,t=Zo(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===V){t.tag=11,t=vf(null,t,e,l,n);break e}else if(i===_){t.tag=14,t=yf(null,t,e,l,n);break e}}throw t=pe(e)||e,Error(c(306,t,""))}}return t;case 0:return Zo(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=rl(l,t.pendingProps),Ef(e,t,l,i,n);case 3:e:{if(Ge(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var o=t.memoizedState;i=o.element,jo(e,t),Ms(t,l,null,n);var m=t.memoizedState;if(l=m.cache,ya(t,jt,l),l!==o.cache&&xo(t,[jt],n,!0),As(),l=m.element,o.isDehydrated)if(o={element:l,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=wf(e,t,l,n);break e}else if(l!==i){i=vn(Error(c(424)),t),Ss(i),t=wf(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(lt=kn(e.firstChild),Rt=t,$e=!0,ba=null,jn=!0,n=Nd(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pa(),l===i){t=ea(e,t,n);break e}Dt(e,t,l,n)}t=t.child}return t;case 26:return Qi(e,t),e===null?(n=Im(t.type,null,t.pendingProps,null))?t.memoizedState=n:$e||(n=t.type,e=t.pendingProps,l=dr(me.current).createElement(n),l[pt]=t,l[Ut]=e,zt(l,n,e),yt(l),t.stateNode=l):t.memoizedState=Im(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return it(t),e===null&&$e&&(l=t.stateNode=$m(t.type,t.pendingProps,me.current),Rt=t,jn=!0,i=lt,Oa(t.type)?(zc=i,lt=kn(l.firstChild)):lt=i),Dt(e,t,t.pendingProps.children,n),Qi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$e&&((i=l=lt)&&(l=cg(l,t.type,t.pendingProps,jn),l!==null?(t.stateNode=l,Rt=t,lt=kn(l.firstChild),jn=!1,i=!0):i=!1),i||va(t)),it(t),i=t.type,o=t.pendingProps,m=e!==null?e.memoizedProps:null,l=o.children,Mc(i,o)?l=null:m!==null&&Mc(i,m)&&(t.flags|=32),t.memoizedState!==null&&(i=Ao(e,t,kx,null,null,n),Fs._currentValue=i),Qi(e,t),Dt(e,t,l,n),t.child;case 6:return e===null&&$e&&((e=n=lt)&&(n=ug(n,t.pendingProps,jn),n!==null?(t.stateNode=n,Rt=t,lt=null,e=!0):e=!1),e||va(t)),null;case 13:return Tf(e,t,n);case 4:return Ge(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=sl(t,null,l,n):Dt(e,t,l,n),t.child;case 11:return vf(e,t,t.type,t.pendingProps,n);case 7:return Dt(e,t,t.pendingProps,n),t.child;case 8:return Dt(e,t,t.pendingProps.children,n),t.child;case 12:return Dt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,ya(t,t.type,l.value),Dt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,tl(t),i=Ot(i),l=l(i),t.flags|=1,Dt(e,t,l,n),t.child;case 14:return yf(e,t,t.type,t.pendingProps,n);case 15:return Nf(e,t,t.type,t.pendingProps,n);case 19:return Mf(e,t,n);case 31:return Rx(e,t,n);case 22:return jf(e,t,n,t.pendingProps);case 24:return tl(t),l=Ot(jt),e===null?(i=vo(),i===null&&(i=et,o=go(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:l,cache:i},No(t),ya(t,jt,i)):((e.lanes&n)!==0&&(jo(e,t),Ms(t,null,null,n),As()),i=e.memoizedState,o=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ya(t,jt,l)):(l=o.cache,ya(t,jt,l),l!==i.cache&&xo(t,[jt],n,!0))),Dt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ta(e){e.flags|=4}function ac(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(lm())e.flags|=8192;else throw ll=Oi,yo}else e.flags&=-16777217}function Rf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Vm(t))if(lm())e.flags|=8192;else throw ll=Oi,yo}function Fi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ee():536870912,e.lanes|=t,Yl|=t)}function Ls(e,t){if(!$e)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 st(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Dx(e,t,n){var l=t.pendingProps;switch(uo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Jn(jt),Re(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Cl(t)?ta(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,mo())),st(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(ta(t),o!==null?(st(t),Rf(t,o)):(st(t),ac(t,i,null,l,n))):o?o!==e.memoizedState?(ta(t),st(t),Rf(t,o)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&ta(t),st(t),ac(t,i,e,l,n)),null;case 27:if(Kt(t),n=me.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ta(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return st(t),null}e=ee.current,Cl(t)?ud(t):(e=$m(i,l,n),t.stateNode=e,ta(t))}return st(t),null;case 5:if(Kt(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&ta(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return st(t),null}if(o=ee.current,Cl(t))ud(t);else{var m=dr(me.current);switch(o){case 1:o=m.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:o=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":o=m.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":o=m.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":o=m.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?m.createElement(i,{is:l.is}):m.createElement(i)}}o[pt]=t,o[Ut]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=o;e:switch(zt(o,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ta(t)}}return st(t),ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&ta(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=me.current,Cl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=Rt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Tm(e.nodeValue,n)),e||va(t,!0)}else e=dr(e).createTextNode(l),e[pt]=t,t.stateNode=e}return st(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Cl(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[pt]=t}else Pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else n=mo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(cn(t),t):(cn(t),null);if((t.flags&128)!==0)throw Error(c(558))}return st(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Cl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[pt]=t}else Pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),i=!1}else i=mo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(cn(t),t):(cn(t),null)}return cn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fi(t,t.updateQueue),st(t),null);case 4:return Re(),e===null&&_c(t.stateNode.containerInfo),st(t),null;case 10:return Jn(t.type),st(t),null;case 19:if(U(gt),l=t.memoizedState,l===null)return st(t),null;if(i=(t.flags&128)!==0,o=l.rendering,o===null)if(i)Ls(l,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Bi(e),o!==null){for(t.flags|=128,Ls(l,!1),e=o.updateQueue,t.updateQueue=e,Fi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)sd(n,e),n=n.sibling;return se(gt,gt.current&1|2),$e&&Zn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&nt()>tr&&(t.flags|=128,i=!0,Ls(l,!1),t.lanes=4194304)}else{if(!i)if(e=Bi(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Fi(t,e),Ls(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!$e)return st(t),null}else 2*nt()-l.renderingStartTime>tr&&n!==536870912&&(t.flags|=128,i=!0,Ls(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(e=l.last,e!==null?e.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=nt(),e.sibling=null,n=gt.current,se(gt,i?n&1|2:n&1),$e&&Zn(t,l.treeForkCount),e):(st(t),null);case 22:case 23:return cn(t),Eo(),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&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),n=t.updateQueue,n!==null&&Fi(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&&U(nl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jn(jt),st(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function zx(e,t){switch(uo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(jt),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Kt(t),null;case 31:if(t.memoizedState!==null){if(cn(t),t.alternate===null)throw Error(c(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(cn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(gt),null;case 4:return Re(),null;case 10:return Jn(t.type),null;case 22:case 23:return cn(t),Eo(),e!==null&&U(nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jn(jt),null;case 25:return null;default:return null}}function Of(e,t){switch(uo(t),t.tag){case 3:Jn(jt),Re();break;case 26:case 27:case 5:Kt(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&cn(t);break;case 13:cn(t);break;case 19:U(gt);break;case 10:Jn(t.type);break;case 22:case 23:cn(t),Eo(),e!==null&&U(nl);break;case 24:Jn(jt)}}function Bs(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var o=n.create,m=n.inst;l=o(),m.destroy=l}n=n.next}while(n!==i)}}catch(b){Ze(t,t.return,b)}}function Ea(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){var m=l.inst,b=m.destroy;if(b!==void 0){m.destroy=void 0,i=t;var k=n,q=b;try{q()}catch(Z){Ze(i,k,Z)}}}l=l.next}while(l!==o)}}catch(Z){Ze(t,t.return,Z)}}function Df(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Sd(t,n)}catch(l){Ze(e,e.return,l)}}}function zf(e,t,n){n.props=rl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Ze(e,t,l)}}function Us(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(i){Ze(e,t,i)}}function Un(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Ze(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Ze(e,t,i)}else n.current=null}function Lf(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(i){Ze(e,e.return,i)}}function lc(e,t,n){try{var l=e.stateNode;ag(l,e.type,n,t),l[Ut]=t}catch(i){Ze(e,e.return,i)}}function Bf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function sc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bf(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&&Oa(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 ic(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=ce));else if(l!==4&&(l===27&&Oa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(ic(e,t,n),e=e.sibling;e!==null;)ic(e,t,n),e=e.sibling}function Ji(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&&Oa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ji(e,t,n),e=e.sibling;e!==null;)Ji(e,t,n),e=e.sibling}function Uf(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zt(t,l,n),t[pt]=e,t[Ut]=n}catch(o){Ze(e,e.return,o)}}var na=!1,_t=!1,rc=!1,$f=typeof WeakSet=="function"?WeakSet:Set,At=null;function Lx(e,t){if(e=e.containerInfo,Tc=br,e=Fu(e),Pr(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 i=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var m=0,b=-1,k=-1,q=0,Z=0,te=e,H=null;t:for(;;){for(var X;te!==n||i!==0&&te.nodeType!==3||(b=m+i),te!==o||l!==0&&te.nodeType!==3||(k=m+l),te.nodeType===3&&(m+=te.nodeValue.length),(X=te.firstChild)!==null;)H=te,te=X;for(;;){if(te===e)break t;if(H===n&&++q===i&&(b=m),H===o&&++Z===l&&(k=m),(X=te.nextSibling)!==null)break;te=H,H=te.parentNode}te=X}n=b===-1||k===-1?null:{start:b,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ac={focusedElem:e,selectionRange:n},br=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,o=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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,l=n.stateNode;try{var xe=rl(n.type,i);e=l.getSnapshotBeforeUpdate(xe,o),l.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Ze(n,n.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Rc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Rc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function qf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:la(e,n),l&4&&Bs(5,n);break;case 1:if(la(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){Ze(n,n.return,m)}else{var i=rl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ze(n,n.return,m)}}l&64&&Df(n),l&512&&Us(n,n.return);break;case 3:if(la(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{Sd(e,t)}catch(m){Ze(n,n.return,m)}}break;case 27:t===null&&l&4&&Uf(n);case 26:case 5:la(e,n),t===null&&l&4&&Lf(n),l&512&&Us(n,n.return);break;case 12:la(e,n);break;case 31:la(e,n),l&4&&Gf(e,n);break;case 13:la(e,n),l&4&&Yf(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xx.bind(null,n),dg(e,n))));break;case 22:if(l=n.memoizedState!==null||na,!l){t=t!==null&&t.memoizedState!==null||_t,i=na;var o=_t;na=l,(_t=t)&&!o?sa(e,n,(n.subtreeFlags&8772)!==0):la(e,n),na=i,_t=o}break;case 30:break;default:la(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&&os(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 ot=null,Wt=!1;function aa(e,t,n){for(n=n.child;n!==null;)If(e,t,n),n=n.sibling}function If(e,t,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Ia,n)}catch{}switch(n.tag){case 26:_t||Un(n,t),aa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:_t||Un(n,t);var l=ot,i=Wt;Oa(n.type)&&(ot=n.stateNode,Wt=!1),aa(e,t,n),Vs(n.stateNode),ot=l,Wt=i;break;case 5:_t||Un(n,t);case 6:if(l=ot,i=Wt,ot=null,aa(e,t,n),ot=l,Wt=i,ot!==null)if(Wt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(n.stateNode)}catch(o){Ze(n,t,o)}else try{ot.removeChild(n.stateNode)}catch(o){Ze(n,t,o)}break;case 18:ot!==null&&(Wt?(e=ot,Dm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wl(e)):Dm(ot,n.stateNode));break;case 4:l=ot,i=Wt,ot=n.stateNode.containerInfo,Wt=!0,aa(e,t,n),ot=l,Wt=i;break;case 0:case 11:case 14:case 15:Ea(2,n,t),_t||Ea(4,n,t),aa(e,t,n);break;case 1:_t||(Un(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&zf(n,t,l)),aa(e,t,n);break;case 21:aa(e,t,n);break;case 22:_t=(l=_t)||n.memoizedState!==null,aa(e,t,n),_t=l;break;default:aa(e,t,n)}}function Gf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wl(e)}catch(n){Ze(t,t.return,n)}}}function Yf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wl(e)}catch(n){Ze(t,t.return,n)}}function Bx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $f),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $f),t;default:throw Error(c(435,e.tag))}}function Wi(e,t){var n=Bx(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=Kx.bind(null,e,l);l.then(i,i)}})}function Pt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],o=e,m=t,b=m;e:for(;b!==null;){switch(b.tag){case 27:if(Oa(b.type)){ot=b.stateNode,Wt=!1;break e}break;case 5:ot=b.stateNode,Wt=!1;break e;case 3:case 4:ot=b.stateNode.containerInfo,Wt=!0;break e}b=b.return}if(ot===null)throw Error(c(160));If(o,m,i),ot=null,Wt=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Xf(t,e),t=t.sibling}var An=null;function Xf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pt(t,e),en(e),l&4&&(Ea(3,e,e.return),Bs(3,e),Ea(5,e,e.return));break;case 1:Pt(t,e),en(e),l&512&&(_t||n===null||Un(n,n.return)),l&64&&na&&(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 i=An;if(Pt(t,e),en(e),l&512&&(_t||n===null||Un(n,n.return)),l&4){var o=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,i=i.ownerDocument||i;t:switch(l){case"title":o=i.getElementsByTagName("title")[0],(!o||o[Xa]||o[pt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=i.createElement(l),i.head.insertBefore(o,i.querySelector("head > title"))),zt(o,l,n),o[pt]=e,yt(o),l=o;break e;case"link":var m=Xm("link","href",i).get(l+(n.href||""));if(m){for(var b=0;b<m.length;b++)if(o=m[b],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(b,1);break t}}o=i.createElement(l),zt(o,l,n),i.head.appendChild(o);break;case"meta":if(m=Xm("meta","content",i).get(l+(n.content||""))){for(b=0;b<m.length;b++)if(o=m[b],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(b,1);break t}}o=i.createElement(l),zt(o,l,n),i.head.appendChild(o);break;default:throw Error(c(468,l))}o[pt]=e,yt(o),l=o}e.stateNode=l}else Km(i,e.type,e.stateNode);else e.stateNode=Ym(i,l,e.memoizedProps);else o!==l?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,l===null?Km(i,e.type,e.stateNode):Ym(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&lc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Pt(t,e),en(e),l&512&&(_t||n===null||Un(n,n.return)),n!==null&&l&4&&lc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Pt(t,e),en(e),l&512&&(_t||n===null||Un(n,n.return)),e.flags&32){i=e.stateNode;try{ke(i,"")}catch(xe){Ze(e,e.return,xe)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,lc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(rc=!0);break;case 6:if(Pt(t,e),en(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(xe){Ze(e,e.return,xe)}}break;case 3:if(hr=null,i=An,An=fr(t.containerInfo),Pt(t,e),An=i,en(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(xe){Ze(e,e.return,xe)}rc&&(rc=!1,Kf(e));break;case 4:l=An,An=fr(e.stateNode.containerInfo),Pt(t,e),en(e),An=l;break;case 12:Pt(t,e),en(e);break;case 31:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Wi(e,l)));break;case 13:Pt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(er=nt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Wi(e,l)));break;case 22:i=e.memoizedState!==null;var k=n!==null&&n.memoizedState!==null,q=na,Z=_t;if(na=q||i,_t=Z||k,Pt(t,e),_t=Z,na=q,en(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||k||na||_t||ol(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){k=n=t;try{if(o=k.stateNode,i)m=o.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{b=k.stateNode;var te=k.memoizedProps.style,H=te!=null&&te.hasOwnProperty("display")?te.display:null;b.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(xe){Ze(k,k.return,xe)}}}else if(t.tag===6){if(n===null){k=t;try{k.stateNode.nodeValue=i?"":k.memoizedProps}catch(xe){Ze(k,k.return,xe)}}}else if(t.tag===18){if(n===null){k=t;try{var X=k.stateNode;i?zm(X,!0):zm(k.stateNode,!1)}catch(xe){Ze(k,k.return,xe)}}}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,Wi(e,n))));break;case 19:Pt(t,e),en(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Wi(e,l)));break;case 30:break;case 21:break;default:Pt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Bf(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var i=n.stateNode,o=sc(e);Ji(e,o,i);break;case 5:var m=n.stateNode;n.flags&32&&(ke(m,""),n.flags&=-33);var b=sc(e);Ji(e,b,m);break;case 3:case 4:var k=n.stateNode.containerInfo,q=sc(e);ic(e,q,k);break;default:throw Error(c(161))}}catch(Z){Ze(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Kf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)qf(e,t.alternate,t),t=t.sibling}function ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ea(4,t,t.return),ol(t);break;case 1:Un(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&zf(t,t.return,n),ol(t);break;case 27:Vs(t.stateNode);case 26:case 5:Un(t,t.return),ol(t);break;case 22:t.memoizedState===null&&ol(t);break;case 30:ol(t);break;default:ol(t)}e=e.sibling}}function sa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,o=t,m=o.flags;switch(o.tag){case 0:case 11:case 15:sa(i,o,n),Bs(4,o);break;case 1:if(sa(i,o,n),l=o,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(q){Ze(l,l.return,q)}if(l=o,i=l.updateQueue,i!==null){var b=l.stateNode;try{var k=i.shared.hiddenCallbacks;if(k!==null)for(i.shared.hiddenCallbacks=null,i=0;i<k.length;i++)jd(k[i],b)}catch(q){Ze(l,l.return,q)}}n&&m&64&&Df(o),Us(o,o.return);break;case 27:Uf(o);case 26:case 5:sa(i,o,n),n&&l===null&&m&4&&Lf(o),Us(o,o.return);break;case 12:sa(i,o,n);break;case 31:sa(i,o,n),n&&m&4&&Gf(i,o);break;case 13:sa(i,o,n),n&&m&4&&Yf(i,o);break;case 22:o.memoizedState===null&&sa(i,o,n),Us(o,o.return);break;case 30:break;default:sa(i,o,n)}t=t.sibling}}function oc(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&&ks(n))}function cc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ks(e))}function Mn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vf(e,t,n,l),t=t.sibling}function Vf(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Mn(e,t,n,l),i&2048&&Bs(9,t);break;case 1:Mn(e,t,n,l);break;case 3:Mn(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ks(e)));break;case 12:if(i&2048){Mn(e,t,n,l),e=t.stateNode;try{var o=t.memoizedProps,m=o.id,b=o.onPostCommit;typeof b=="function"&&b(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){Ze(t,t.return,k)}}else Mn(e,t,n,l);break;case 31:Mn(e,t,n,l);break;case 13:Mn(e,t,n,l);break;case 23:break;case 22:o=t.stateNode,m=t.alternate,t.memoizedState!==null?o._visibility&2?Mn(e,t,n,l):$s(e,t):o._visibility&2?Mn(e,t,n,l):(o._visibility|=2,Hl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&oc(m,t);break;case 24:Mn(e,t,n,l),i&2048&&cc(t.alternate,t);break;default:Mn(e,t,n,l)}}function Hl(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,m=t,b=n,k=l,q=m.flags;switch(m.tag){case 0:case 11:case 15:Hl(o,m,b,k,i),Bs(8,m);break;case 23:break;case 22:var Z=m.stateNode;m.memoizedState!==null?Z._visibility&2?Hl(o,m,b,k,i):$s(o,m):(Z._visibility|=2,Hl(o,m,b,k,i)),i&&q&2048&&oc(m.alternate,m);break;case 24:Hl(o,m,b,k,i),i&&q&2048&&cc(m.alternate,m);break;default:Hl(o,m,b,k,i)}t=t.sibling}}function $s(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:$s(n,l),i&2048&&oc(l.alternate,l);break;case 24:$s(n,l),i&2048&&cc(l.alternate,l);break;default:$s(n,l)}t=t.sibling}}var qs=8192;function Il(e,t,n){if(e.subtreeFlags&qs)for(e=e.child;e!==null;)Qf(e,t,n),e=e.sibling}function Qf(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&qs&&e.memoizedState!==null&&Sg(n,An,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var l=An;An=fr(e.stateNode.containerInfo),Il(e,t,n),An=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=qs,qs=16777216,Il(e,t,n),qs=l):Il(e,t,n));break;default:Il(e,t,n)}}function Zf(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 Hs(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];At=l,Jf(l,e)}Zf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ff(e),e=e.sibling}function Ff(e){switch(e.tag){case 0:case 11:case 15:Hs(e),e.flags&2048&&Ea(9,e,e.return);break;case 3:Hs(e);break;case 12:Hs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pi(e)):Hs(e);break;default:Hs(e)}}function Pi(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];At=l,Jf(l,e)}Zf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ea(8,t,t.return),Pi(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pi(t));break;default:Pi(t)}e=e.sibling}}function Jf(e,t){for(;At!==null;){var n=At;switch(n.tag){case 0:case 11:case 15:Ea(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:ks(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,At=l;else e:for(n=e;At!==null;){l=At;var i=l.sibling,o=l.return;if(Hf(l),l===n){At=null;break e}if(i!==null){i.return=o,At=i;break e}At=o}}}var Ux={getCacheForType:function(e){var t=Ot(jt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ot(jt).controller.signal}},$x=typeof WeakMap=="function"?WeakMap:Map,Xe=0,et=null,De=null,Be=0,Qe=0,un=null,wa=!1,Gl=!1,uc=!1,ia=0,ft=0,Ta=0,cl=0,dc=0,dn=0,Yl=0,Is=null,tn=null,fc=!1,er=0,Wf=0,tr=1/0,nr=null,Aa=null,Et=0,Ma=null,Xl=null,ra=0,mc=0,hc=null,Pf=null,Gs=0,pc=null;function fn(){return(Xe&2)!==0&&Be!==0?Be&-Be:w.T!==null?Nc():gl()}function em(){if(dn===0)if((Be&536870912)===0||$e){var e=xl;xl<<=1,(xl&3932160)===0&&(xl=262144),dn=e}else dn=536870912;return e=on.current,e!==null&&(e.flags|=32),dn}function nn(e,t,n){(e===et&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(Kl(e,0),Ca(e,Be,dn,!1)),Pe(e,n),((Xe&2)===0||e!==et)&&(e===et&&((Xe&2)===0&&(cl|=n),ft===4&&Ca(e,Be,dn,!1)),$n(e))}function tm(e,t,n){if((Xe&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||J(e,t),i=l?Ix(e,t):gc(e,t,!0),o=l;do{if(i===0){Gl&&!l&&Ca(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!qx(n)){i=gc(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var b=e;i=Is;var k=b.current.memoizedState.isDehydrated;if(k&&(Kl(b,m).flags|=256),m=gc(b,m,!1),m!==2){if(uc&&!k){b.errorRecoveryDisabledLanes|=o,cl|=o,i=4;break e}o=tn,tn=i,o!==null&&(tn===null?tn=o:tn.push.apply(tn,o))}i=m}if(o=!1,i!==2)continue}}if(i===1){Kl(e,0),Ca(e,t,0,!0);break}e:{switch(l=e,o=i,o){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ca(l,t,dn,!wa);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=er+300-nt(),10<i)){if(Ca(l,t,dn,!wa),E(l,0,!0)!==0)break e;ra=t,l.timeoutHandle=Rm(nm.bind(null,l,n,tn,nr,fc,t,dn,cl,Yl,wa,o,"Throttled",-0,0),i);break e}nm(l,n,tn,nr,fc,t,dn,cl,Yl,wa,o,null,-0,0)}}break}while(!0);$n(e)}function nm(e,t,n,l,i,o,m,b,k,q,Z,te,H,X){if(e.timeoutHandle=-1,te=t.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ce},Qf(t,o,te);var xe=(o&62914560)===o?er-nt():(o&4194048)===o?Wf-nt():0;if(xe=kg(te,xe),xe!==null){ra=o,e.cancelPendingCommit=xe(um.bind(null,e,t,o,n,l,i,m,b,k,Z,te,null,H,X)),Ca(e,o,m,!q);return}}um(e,t,o,n,l,i,m,b,k)}function qx(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 i=n[l],o=i.getSnapshot;i=i.value;try{if(!sn(o(),i))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 Ca(e,t,n,l){t&=~dc,t&=~cl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var o=31-It(i),m=1<<o;l[o]=-1,i&=~m}n!==0&&he(e,n,t)}function ar(){return(Xe&6)===0?(Ys(0),!1):!0}function xc(){if(De!==null){if(Qe===0)var e=De.return;else e=De,Fn=el=null,Ro(e),Ll=null,Es=0,e=De;for(;e!==null;)Of(e.alternate,e),e=e.return;De=null}}function Kl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ig(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ra=0,xc(),et=e,De=n=Qn(e.current,null),Be=t,Qe=0,un=null,wa=!1,Gl=J(e,t),uc=!1,Yl=dn=dc=cl=Ta=ft=0,tn=Is=null,fc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-It(l),o=1<<i;t|=e[i],l&=~o}return ia=t,ki(),n}function am(e,t){Me=null,w.H=Ds,t===zl||t===Ri?(t=bd(),Qe=3):t===yo?(t=bd(),Qe=4):Qe=t===Qo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,un=t,De===null&&(ft=1,Ki(e,vn(t,e.current)))}function lm(){var e=on.current;return e===null?!0:(Be&4194048)===Be?Sn===null:(Be&62914560)===Be||(Be&536870912)!==0?e===Sn:!1}function sm(){var e=w.H;return w.H=Ds,e===null?Ds:e}function im(){var e=w.A;return w.A=Ux,e}function lr(){ft=4,wa||(Be&4194048)!==Be&&on.current!==null||(Gl=!0),(Ta&134217727)===0&&(cl&134217727)===0||et===null||Ca(et,Be,dn,!1)}function gc(e,t,n){var l=Xe;Xe|=2;var i=sm(),o=im();(et!==e||Be!==t)&&(nr=null,Kl(e,t)),t=!1;var m=ft;e:do try{if(Qe!==0&&De!==null){var b=De,k=un;switch(Qe){case 8:xc(),m=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(t=!0);var q=Qe;if(Qe=0,un=null,Vl(e,b,k,q),n&&Gl){m=0;break e}break;default:q=Qe,Qe=0,un=null,Vl(e,b,k,q)}}Hx(),m=ft;break}catch(Z){am(e,Z)}while(!0);return t&&e.shellSuspendCounter++,Fn=el=null,Xe=l,w.H=i,w.A=o,De===null&&(et=null,Be=0,ki()),m}function Hx(){for(;De!==null;)rm(De)}function Ix(e,t){var n=Xe;Xe|=2;var l=sm(),i=im();et!==e||Be!==t?(nr=null,tr=nt()+500,Kl(e,t)):Gl=J(e,t);e:do try{if(Qe!==0&&De!==null){t=De;var o=un;t:switch(Qe){case 1:Qe=0,un=null,Vl(e,t,o,1);break;case 2:case 9:if(xd(o)){Qe=0,un=null,om(t);break}t=function(){Qe!==2&&Qe!==9||et!==e||(Qe=7),$n(e)},o.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:xd(o)?(Qe=0,un=null,om(t)):(Qe=0,un=null,Vl(e,t,o,7));break;case 5:var m=null;switch(De.tag){case 26:m=De.memoizedState;case 5:case 27:var b=De;if(m?Vm(m):b.stateNode.complete){Qe=0,un=null;var k=b.sibling;if(k!==null)De=k;else{var q=b.return;q!==null?(De=q,sr(q)):De=null}break t}}Qe=0,un=null,Vl(e,t,o,5);break;case 6:Qe=0,un=null,Vl(e,t,o,6);break;case 8:xc(),ft=6;break e;default:throw Error(c(462))}}Gx();break}catch(Z){am(e,Z)}while(!0);return Fn=el=null,w.H=l,w.A=i,Xe=n,De!==null?0:(et=null,Be=0,ki(),ft)}function Gx(){for(;De!==null&&!mt();)rm(De)}function rm(e){var t=Cf(e.alternate,e,ia);e.memoizedProps=e.pendingProps,t===null?sr(e):De=t}function om(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_f(n,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=_f(n,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:Ro(t);default:Of(n,t),t=De=sd(t,ia),t=Cf(n,t,ia)}e.memoizedProps=e.pendingProps,t===null?sr(e):De=t}function Vl(e,t,n,l){Fn=el=null,Ro(t),Ll=null,Es=0;var i=t.return;try{if(Cx(e,i,t,n,Be)){ft=1,Ki(e,vn(n,e.current)),De=null;return}}catch(o){if(i!==null)throw De=i,o;ft=1,Ki(e,vn(n,e.current)),De=null;return}t.flags&32768?($e||l===1?e=!0:Gl||(Be&536870912)!==0?e=!1:(wa=e=!0,(l===2||l===9||l===3||l===6)&&(l=on.current,l!==null&&l.tag===13&&(l.flags|=16384))),cm(t,e)):sr(t)}function sr(e){var t=e;do{if((t.flags&32768)!==0){cm(t,wa);return}e=t.return;var n=Dx(t.alternate,t,ia);if(n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);ft===0&&(ft=5)}function cm(e,t){do{var n=zx(e.alternate,e);if(n!==null){n.flags&=32767,De=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=n}while(e!==null);ft=6,De=null}function um(e,t,n,l,i,o,m,b,k){e.cancelPendingCommit=null;do ir();while(Et!==0);if((Xe&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(o=t.lanes|t.childLanes,o|=lo,be(e,n,o,m,b,k),e===et&&(De=et=null,Be=0),Xl=t,Ma=e,ra=n,mc=o,hc=i,Pf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Vx(Ha,function(){return pm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=w.T,w.T=null,i=I.p,I.p=2,m=Xe,Xe|=4;try{Lx(e,t,n)}finally{Xe=m,I.p=i,w.T=l}}Et=1,dm(),fm(),mm()}}function dm(){if(Et===1){Et=0;var e=Ma,t=Xl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=w.T,w.T=null;var l=I.p;I.p=2;var i=Xe;Xe|=4;try{Xf(t,e);var o=Ac,m=Fu(e.containerInfo),b=o.focusedElem,k=o.selectionRange;if(m!==b&&b&&b.ownerDocument&&Zu(b.ownerDocument.documentElement,b)){if(k!==null&&Pr(b)){var q=k.start,Z=k.end;if(Z===void 0&&(Z=q),"selectionStart"in b)b.selectionStart=q,b.selectionEnd=Math.min(Z,b.value.length);else{var te=b.ownerDocument||document,H=te&&te.defaultView||window;if(H.getSelection){var X=H.getSelection(),xe=b.textContent.length,Se=Math.min(k.start,xe),We=k.end===void 0?Se:Math.min(k.end,xe);!X.extend&&Se>We&&(m=We,We=Se,Se=m);var z=Qu(b,Se),C=Qu(b,We);if(z&&C&&(X.rangeCount!==1||X.anchorNode!==z.node||X.anchorOffset!==z.offset||X.focusNode!==C.node||X.focusOffset!==C.offset)){var $=te.createRange();$.setStart(z.node,z.offset),X.removeAllRanges(),Se>We?(X.addRange($),X.extend(C.node,C.offset)):($.setEnd(C.node,C.offset),X.addRange($))}}}}for(te=[],X=b;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<te.length;b++){var W=te[b];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}br=!!Tc,Ac=Tc=null}finally{Xe=i,I.p=l,w.T=n}}e.current=t,Et=2}}function fm(){if(Et===2){Et=0;var e=Ma,t=Xl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=w.T,w.T=null;var l=I.p;I.p=2;var i=Xe;Xe|=4;try{qf(e,t.alternate,t)}finally{Xe=i,I.p=l,w.T=n}}Et=3}}function mm(){if(Et===4||Et===3){Et=0,Vt();var e=Ma,t=Xl,n=ra,l=Pf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Et=5:(Et=0,Xl=Ma=null,hm(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Aa=null),Gn(n),t=t.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Ia,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=w.T,i=I.p,I.p=2,w.T=null;try{for(var o=e.onRecoverableError,m=0;m<l.length;m++){var b=l[m];o(b.value,{componentStack:b.stack})}}finally{w.T=t,I.p=i}}(ra&3)!==0&&ir(),$n(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===pc?Gs++:(Gs=0,pc=e):Gs=0,Ys(0)}}function hm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ks(t)))}function ir(){return dm(),fm(),mm(),pm()}function pm(){if(Et!==5)return!1;var e=Ma,t=mc;mc=0;var n=Gn(ra),l=w.T,i=I.p;try{I.p=32>n?32:n,w.T=null,n=hc,hc=null;var o=Ma,m=ra;if(Et=0,Xl=Ma=null,ra=0,(Xe&6)!==0)throw Error(c(331));var b=Xe;if(Xe|=4,Ff(o.current),Vf(o,o.current,m,n),Xe=b,Ys(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Ia,o)}catch{}return!0}finally{I.p=i,w.T=l,hm(e,t)}}function xm(e,t,n){t=vn(n,t),t=Vo(e.stateNode,t,2),e=Sa(e,t,2),e!==null&&(Pe(e,2),$n(e))}function Ze(e,t,n){if(e.tag===3)xm(e,e,n);else for(;t!==null;){if(t.tag===3){xm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Aa===null||!Aa.has(l))){e=vn(n,e),n=gf(2),l=Sa(t,n,2),l!==null&&(bf(n,l,t,e),Pe(l,2),$n(l));break}}t=t.return}}function bc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new $x;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(uc=!0,i.add(n),e=Yx.bind(null,e,t,n),t.then(e,e))}function Yx(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(Be&n)===n&&(ft===4||ft===3&&(Be&62914560)===Be&&300>nt()-er?(Xe&2)===0&&Kl(e,0):dc|=n,Yl===Be&&(Yl=0)),$n(e)}function gm(e,t){t===0&&(t=Ee()),e=Ja(e,t),e!==null&&(Pe(e,t),$n(e))}function Xx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gm(e,n)}function Kx(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),gm(e,n)}function Vx(e,t){return we(e,t)}var rr=null,Ql=null,vc=!1,or=!1,yc=!1,Ra=0;function $n(e){e!==Ql&&e.next===null&&(Ql===null?rr=Ql=e:Ql=Ql.next=e),or=!0,vc||(vc=!0,Zx())}function Ys(e,t){if(!yc&&or){yc=!0;do for(var n=!1,l=rr;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var o=0;else{var m=l.suspendedLanes,b=l.pingedLanes;o=(1<<31-It(42|e)+1)-1,o&=i&~(m&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,Nm(l,o))}else o=Be,o=E(l,l===et?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||J(l,o)||(n=!0,Nm(l,o));l=l.next}while(n);yc=!1}}function Qx(){bm()}function bm(){or=vc=!1;var e=0;Ra!==0&&sg()&&(e=Ra);for(var t=nt(),n=null,l=rr;l!==null;){var i=l.next,o=vm(l,t);o===0?(l.next=null,n===null?rr=i:n.next=i,i===null&&(Ql=n)):(n=l,(e!==0||(o&3)!==0)&&(or=!0)),l=i}Et!==0&&Et!==5||Ys(e),Ra!==0&&(Ra=0)}function vm(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var m=31-It(o),b=1<<m,k=i[m];k===-1?((b&n)===0||(b&l)!==0)&&(i[m]=fe(b,t)):k<=t&&(e.expiredLanes|=b),o&=~b}if(t=et,n=Be,n=E(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&qe(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||J(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&qe(l),Gn(n)){case 2:case 8:n=xn;break;case 32:n=Ha;break;case 268435456:n=oi;break;default:n=Ha}return l=ym.bind(null,e),n=we(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&qe(l),e.callbackPriority=2,e.callbackNode=null,2}function ym(e,t){if(Et!==0&&Et!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ir()&&e.callbackNode!==n)return null;var l=Be;return l=E(e,e===et?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(tm(e,l,t),vm(e,nt()),e.callbackNode!=null&&e.callbackNode===n?ym.bind(null,e):null)}function Nm(e,t){if(ir())return null;tm(e,t,!0)}function Zx(){rg(function(){(Xe&6)!==0?we(pn,Qx):bm()})}function Nc(){if(Ra===0){var e=Ol;e===0&&(e=Ga,Ga<<=1,(Ga&261888)===0&&(Ga=256)),Ra=e}return Ra}function jm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:pa(""+e)}function Sm(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 Fx(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var o=jm((i[Ut]||null).action),m=l.submitter;m&&(t=(t=m[Ut]||null)?jm(t.formAction):m.getAttribute("formAction"),t!==null&&(o=t,m=null));var b=new yi("action","action",null,l,i);e.push({event:b,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ra!==0){var k=m?Sm(i,m):new FormData(i);Ho(n,{pending:!0,data:k,method:i.method,action:o},null,k)}}else typeof o=="function"&&(b.preventDefault(),k=m?Sm(i,m):new FormData(i),Ho(n,{pending:!0,data:k,method:i.method,action:o},o,k))},currentTarget:i}]})}}for(var jc=0;jc<ao.length;jc++){var Sc=ao[jc],Jx=Sc.toLowerCase(),Wx=Sc[0].toUpperCase()+Sc.slice(1);Tn(Jx,"on"+Wx)}Tn(Pu,"onAnimationEnd"),Tn(ed,"onAnimationIteration"),Tn(td,"onAnimationStart"),Tn("dblclick","onDoubleClick"),Tn("focusin","onFocus"),Tn("focusout","onBlur"),Tn(hx,"onTransitionRun"),Tn(px,"onTransitionStart"),Tn(xx,"onTransitionCancel"),Tn(nd,"onTransitionEnd"),ie("onMouseEnter",["mouseout","mouseover"]),ie("onMouseLeave",["mouseout","mouseover"]),ie("onPointerEnter",["pointerout","pointerover"]),ie("onPointerLeave",["pointerout","pointerover"]),Xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xs="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(" "),Px=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xs));function km(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var m=l.length-1;0<=m;m--){var b=l[m],k=b.instance,q=b.currentTarget;if(b=b.listener,k!==o&&i.isPropagationStopped())break e;o=b,i.currentTarget=q;try{o(i)}catch(Z){Si(Z)}i.currentTarget=null,o=k}else for(m=0;m<l.length;m++){if(b=l[m],k=b.instance,q=b.currentTarget,b=b.listener,k!==o&&i.isPropagationStopped())break e;o=b,i.currentTarget=q;try{o(i)}catch(Z){Si(Z)}i.currentTarget=null,o=k}}}}function ze(e,t){var n=t[rs];n===void 0&&(n=t[rs]=new Set);var l=e+"__bubble";n.has(l)||(_m(t,e,2,!1),n.add(l))}function kc(e,t,n){var l=0;t&&(l|=4),_m(n,e,l,t)}var cr="_reactListening"+Math.random().toString(36).slice(2);function _c(e){if(!e[cr]){e[cr]=!0,fi.forEach(function(n){n!=="selectionchange"&&(Px.has(n)||kc(n,!1,e),kc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cr]||(t[cr]=!0,kc("selectionchange",!1,t))}}function _m(e,t,n,l){switch(eh(t)){case 2:var i=wg;break;case 8:i=Tg;break;default:i=qc}n=i.bind(null,t,n,e),i=void 0,!Yr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ec(e,t,n,l,i){var o=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var b=l.stateNode.containerInfo;if(b===i)break;if(m===4)for(m=l.return;m!==null;){var k=m.tag;if((k===3||k===4)&&m.stateNode.containerInfo===i)return;m=m.return}for(;b!==null;){if(m=Gt(b),m===null)return;if(k=m.tag,k===5||k===6||k===26||k===27){l=o=m;continue e}b=b.parentNode}}l=l.return}xi(function(){var q=o,Z=Ae(n),te=[];e:{var H=ad.get(e);if(H!==void 0){var X=yi,xe=e;switch(e){case"keypress":if(bi(n)===0)break e;case"keydown":case"keyup":X=Kp;break;case"focusin":xe="focus",X=Qr;break;case"focusout":xe="blur",X=Qr;break;case"beforeblur":case"afterblur":X=Qr;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":X=Ru;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Dp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=Zp;break;case Pu:case ed:case td:X=Bp;break;case nd:X=Jp;break;case"scroll":case"scrollend":X=Rp;break;case"wheel":X=Pp;break;case"copy":case"cut":case"paste":X=$p;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Du;break;case"toggle":case"beforetoggle":X=tx}var Se=(t&4)!==0,We=!Se&&(e==="scroll"||e==="scrollend"),z=Se?H!==null?H+"Capture":null:H;Se=[];for(var C=q,$;C!==null;){var W=C;if($=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||$===null||z===null||(W=ms(C,z),W!=null&&Se.push(Ks(C,W,$))),We)break;C=C.return}0<Se.length&&(H=new X(H,xe,null,n,Z),te.push({event:H,listeners:Se}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",H&&n!==ve&&(xe=n.relatedTarget||n.fromElement)&&(Gt(xe)||xe[da]))break e;if((X||H)&&(H=Z.window===Z?Z:(H=Z.ownerDocument)?H.defaultView||H.parentWindow:window,X?(xe=n.relatedTarget||n.toElement,X=q,xe=xe?Gt(xe):null,xe!==null&&(We=f(xe),Se=xe.tag,xe!==We||Se!==5&&Se!==27&&Se!==6)&&(xe=null)):(X=null,xe=q),X!==xe)){if(Se=Ru,W="onMouseLeave",z="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Du,W="onPointerLeave",z="onPointerEnter",C="pointer"),We=X==null?H:fa(X),$=xe==null?H:fa(xe),H=new Se(W,C+"leave",X,n,Z),H.target=We,H.relatedTarget=$,W=null,Gt(Z)===q&&(Se=new Se(z,C+"enter",xe,n,Z),Se.target=$,Se.relatedTarget=We,W=Se),We=W,X&&xe)t:{for(Se=eg,z=X,C=xe,$=0,W=z;W;W=Se(W))$++;W=0;for(var je=C;je;je=Se(je))W++;for(;0<$-W;)z=Se(z),$--;for(;0<W-$;)C=Se(C),W--;for(;$--;){if(z===C||C!==null&&z===C.alternate){Se=z;break t}z=Se(z),C=Se(C)}Se=null}else Se=null;X!==null&&Em(te,H,X,Se,!1),xe!==null&&We!==null&&Em(te,We,xe,Se,!0)}}e:{if(H=q?fa(q):window,X=H.nodeName&&H.nodeName.toLowerCase(),X==="select"||X==="input"&&H.type==="file")var He=Iu;else if(qu(H))if(Gu)He=dx;else{He=cx;var ye=ox}else X=H.nodeName,!X||X.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?q&&ha(q.elementType)&&(He=Iu):He=ux;if(He&&(He=He(e,q))){Hu(te,He,n,Z);break e}ye&&ye(e,H,q),e==="focusout"&&q&&H.type==="number"&&q.memoizedProps.value!=null&&jl(H,"number",H.value)}switch(ye=q?fa(q):window,e){case"focusin":(qu(ye)||ye.contentEditable==="true")&&(_l=ye,eo=q,Ns=null);break;case"focusout":Ns=eo=_l=null;break;case"mousedown":to=!0;break;case"contextmenu":case"mouseup":case"dragend":to=!1,Ju(te,n,Z);break;case"selectionchange":if(mx)break;case"keydown":case"keyup":Ju(te,n,Z)}var Ce;if(Fr)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else kl?Uu(e,n)&&(Ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(zu&&n.locale!=="ko"&&(kl||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&kl&&(Ce=Mu()):(xa=Z,Xr="value"in xa?xa.value:xa.textContent,kl=!0)),ye=ur(q,Ue),0<ye.length&&(Ue=new Ou(Ue,e,null,n,Z),te.push({event:Ue,listeners:ye}),Ce?Ue.data=Ce:(Ce=$u(n),Ce!==null&&(Ue.data=Ce)))),(Ce=ax?lx(e,n):sx(e,n))&&(Ue=ur(q,"onBeforeInput"),0<Ue.length&&(ye=new Ou("onBeforeInput","beforeinput",null,n,Z),te.push({event:ye,listeners:Ue}),ye.data=Ce)),Fx(te,e,q,n,Z)}km(te,t)})}function Ks(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ur(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,o=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||o===null||(i=ms(e,n),i!=null&&l.unshift(Ks(e,i,o)),i=ms(e,t),i!=null&&l.push(Ks(e,i,o))),e.tag===3)return l;e=e.return}return[]}function eg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Em(e,t,n,l,i){for(var o=t._reactName,m=[];n!==null&&n!==l;){var b=n,k=b.alternate,q=b.stateNode;if(b=b.tag,k!==null&&k===l)break;b!==5&&b!==26&&b!==27||q===null||(k=q,i?(q=ms(n,o),q!=null&&m.unshift(Ks(n,q,k))):i||(q=ms(n,o),q!=null&&m.push(Ks(n,q,k)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var tg=/\r\n?/g,ng=/\u0000|\uFFFD/g;function wm(e){return(typeof e=="string"?e:""+e).replace(tg,`
|
|
49
|
+
`).replace(ng,"")}function Tm(e,t){return t=wm(t),wm(e)===t}function Je(e,t,n,l,i,o){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ke(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ke(e,""+l);break;case"className":an(e,"class",l);break;case"tabIndex":an(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":an(e,n,l);break;case"style":Ve(e,l,o);break;case"data":if(t!=="object"){an(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=pa(""+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 o=="function"&&(n==="formAction"?(t!=="input"&&Je(e,t,"name",i.name,i,null),Je(e,t,"formEncType",i.formEncType,i,null),Je(e,t,"formMethod",i.formMethod,i,null),Je(e,t,"formTarget",i.formTarget,i,null)):(Je(e,t,"encType",i.encType,i,null),Je(e,t,"method",i.method,i,null),Je(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=pa(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=ce);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(c(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=pa(""+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":ze("beforetoggle",e),ze("toggle",e),$t(e,"popover",l);break;case"xlinkActuate":Zt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Zt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Zt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Zt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Zt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Zt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Zt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":$t(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=Kn.get(n)||n,$t(e,n,l))}}function wc(e,t,n,l,i,o){switch(n){case"style":Ve(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?ke(e,l):(typeof l=="number"||typeof l=="bigint")&&ke(e,""+l);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=ce);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ka.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),o=e[Ut]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,i),typeof l=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):$t(e,n,l)}}}function zt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var l=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var m=n[o];if(m!=null)switch(o){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Je(e,t,o,m,n,null)}}i&&Je(e,t,"srcSet",n.srcSet,n,null),l&&Je(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var b=o=m=i=null,k=null,q=null;for(l in n)if(n.hasOwnProperty(l)){var Z=n[l];if(Z!=null)switch(l){case"name":i=Z;break;case"type":m=Z;break;case"checked":k=Z;break;case"defaultChecked":q=Z;break;case"value":o=Z;break;case"defaultValue":b=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(c(137,t));break;default:Je(e,t,l,Z,n,null)}}Va(e,o,b,k,q,m,i,!1);return;case"select":ze("invalid",e),l=m=o=null;for(i in n)if(n.hasOwnProperty(i)&&(b=n[i],b!=null))switch(i){case"value":o=b;break;case"defaultValue":m=b;break;case"multiple":l=b;default:Je(e,t,i,b,n,null)}t=o,n=m,e.multiple=!!l,t!=null?Ct(e,!!l,t,!1):n!=null&&Ct(e,!!l,n,!0);return;case"textarea":ze("invalid",e),o=i=l=null;for(m in n)if(n.hasOwnProperty(m)&&(b=n[m],b!=null))switch(m){case"value":l=b;break;case"defaultValue":i=b;break;case"children":o=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(c(91));break;default:Je(e,t,m,b,n,null)}Sl(e,l,i,o);return;case"option":for(k in n)if(n.hasOwnProperty(k)&&(l=n[k],l!=null))switch(k){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Je(e,t,k,l,n,null)}return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(l=0;l<Xs.length;l++)ze(Xs[l],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(q in n)if(n.hasOwnProperty(q)&&(l=n[q],l!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Je(e,t,q,l,n,null)}return;default:if(ha(t)){for(Z in n)n.hasOwnProperty(Z)&&(l=n[Z],l!==void 0&&wc(e,t,Z,l,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(l=n[b],l!=null&&Je(e,t,b,l,n,null))}function ag(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 i=null,o=null,m=null,b=null,k=null,q=null,Z=null;for(X in n){var te=n[X];if(n.hasOwnProperty(X)&&te!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":k=te;default:l.hasOwnProperty(X)||Je(e,t,X,null,l,te)}}for(var H in l){var X=l[H];if(te=n[H],l.hasOwnProperty(H)&&(X!=null||te!=null))switch(H){case"type":o=X;break;case"name":i=X;break;case"checked":q=X;break;case"defaultChecked":Z=X;break;case"value":m=X;break;case"defaultValue":b=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(c(137,t));break;default:X!==te&&Je(e,t,H,X,l,te)}}us(e,m,b,k,q,Z,o,i);return;case"select":X=m=b=H=null;for(o in n)if(k=n[o],n.hasOwnProperty(o)&&k!=null)switch(o){case"value":break;case"multiple":X=k;default:l.hasOwnProperty(o)||Je(e,t,o,null,l,k)}for(i in l)if(o=l[i],k=n[i],l.hasOwnProperty(i)&&(o!=null||k!=null))switch(i){case"value":H=o;break;case"defaultValue":b=o;break;case"multiple":m=o;default:o!==k&&Je(e,t,i,o,l,k)}t=b,n=m,l=X,H!=null?Ct(e,!!n,H,!1):!!l!=!!n&&(t!=null?Ct(e,!!n,t,!0):Ct(e,!!n,n?[]:"",!1));return;case"textarea":X=H=null;for(b in n)if(i=n[b],n.hasOwnProperty(b)&&i!=null&&!l.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Je(e,t,b,null,l,i)}for(m in l)if(i=l[m],o=n[m],l.hasOwnProperty(m)&&(i!=null||o!=null))switch(m){case"value":H=i;break;case"defaultValue":X=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==o&&Je(e,t,m,i,l,o)}hi(e,H,X);return;case"option":for(var xe in n)if(H=n[xe],n.hasOwnProperty(xe)&&H!=null&&!l.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:Je(e,t,xe,null,l,H)}for(k in l)if(H=l[k],X=n[k],l.hasOwnProperty(k)&&H!==X&&(H!=null||X!=null))switch(k){case"selected":e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:Je(e,t,k,H,l,X)}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 Se in n)H=n[Se],n.hasOwnProperty(Se)&&H!=null&&!l.hasOwnProperty(Se)&&Je(e,t,Se,null,l,H);for(q in l)if(H=l[q],X=n[q],l.hasOwnProperty(q)&&H!==X&&(H!=null||X!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(c(137,t));break;default:Je(e,t,q,H,l,X)}return;default:if(ha(t)){for(var We in n)H=n[We],n.hasOwnProperty(We)&&H!==void 0&&!l.hasOwnProperty(We)&&wc(e,t,We,void 0,l,H);for(Z in l)H=l[Z],X=n[Z],!l.hasOwnProperty(Z)||H===X||H===void 0&&X===void 0||wc(e,t,Z,H,l,X);return}}for(var z in n)H=n[z],n.hasOwnProperty(z)&&H!=null&&!l.hasOwnProperty(z)&&Je(e,t,z,null,l,H);for(te in l)H=l[te],X=n[te],!l.hasOwnProperty(te)||H===X||H==null&&X==null||Je(e,t,te,H,l,X)}function Am(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],o=i.transferSize,m=i.initiatorType,b=i.duration;if(o&&b&&Am(m)){for(m=0,b=i.responseEnd,l+=1;l<n.length;l++){var k=n[l],q=k.startTime;if(q>b)break;var Z=k.transferSize,te=k.initiatorType;Z&&Am(te)&&(k=k.responseEnd,m+=Z*(k<b?1:(b-q)/(k-q)))}if(--l,t+=8*(o+m)/(i.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 Tc=null,Ac=null;function dr(e){return e.nodeType===9?e:e.ownerDocument}function Mm(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 Cm(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 Mc(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 Cc=null;function sg(){var e=window.event;return e&&e.type==="popstate"?e===Cc?!1:(Cc=e,!0):(Cc=null,!1)}var Rm=typeof setTimeout=="function"?setTimeout:void 0,ig=typeof clearTimeout=="function"?clearTimeout:void 0,Om=typeof Promise=="function"?Promise:void 0,rg=typeof queueMicrotask=="function"?queueMicrotask:typeof Om<"u"?function(e){return Om.resolve(null).then(e).catch(og)}:Rm;function og(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function Dm(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),Wl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Vs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Vs(n);for(var o=n.firstChild;o;){var m=o.nextSibling,b=o.nodeName;o[Xa]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=m}}else n==="body"&&Vs(e.ownerDocument.body);n=i}while(n);Wl(t)}function zm(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 Rc(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":Rc(n),os(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function cg(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Xa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function ug(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=kn(e.nextSibling),e===null))return null;return e}function Lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=kn(e.nextSibling),e===null))return null;return e}function Oc(e){return e.data==="$?"||e.data==="$~"}function Dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function dg(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 kn(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 zc=null;function Bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return kn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Um(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 $m(e,t,n){switch(t=dr(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Vs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);os(e)}var _n=new Map,qm=new Set;function fr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var oa=I.d;I.d={f:fg,r:mg,D:hg,C:pg,L:xg,m:gg,X:vg,S:bg,M:yg};function fg(){var e=oa.f(),t=ar();return e||t}function mg(e){var t=Yn(e);t!==null&&t.tag===5&&t.type==="form"?nf(t):oa.r(e)}var Zl=typeof document>"u"?null:document;function Hm(e,t,n){var l=Zl;if(l&&typeof t=="string"&&t){var i=Ft(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),qm.has(i)||(qm.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),zt(t,"link",e),yt(t),l.head.appendChild(t)))}}function hg(e){oa.D(e),Hm("dns-prefetch",e,null)}function pg(e,t){oa.C(e,t),Hm("preconnect",e,t)}function xg(e,t,n){oa.L(e,t,n);var l=Zl;if(l&&e&&t){var i='link[rel="preload"][as="'+Ft(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Ft(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Ft(n.imageSizes)+'"]')):i+='[href="'+Ft(e)+'"]';var o=i;switch(t){case"style":o=Fl(e);break;case"script":o=Jl(e)}_n.has(o)||(e=N({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),_n.set(o,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(Qs(o))||t==="script"&&l.querySelector(Zs(o))||(t=l.createElement("link"),zt(t,"link",e),yt(t),l.head.appendChild(t)))}}function gg(e,t){oa.m(e,t);var n=Zl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Ft(l)+'"][href="'+Ft(e)+'"]',o=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Jl(e)}if(!_n.has(o)&&(e=N({rel:"modulepreload",href:e},t),_n.set(o,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Zs(o)))return}l=n.createElement("link"),zt(l,"link",e),yt(l),n.head.appendChild(l)}}}function bg(e,t,n){oa.S(e,t,n);var l=Zl;if(l&&e){var i=ma(l).hoistableStyles,o=Fl(e);t=t||"default";var m=i.get(o);if(!m){var b={loading:0,preload:null};if(m=l.querySelector(Qs(o)))b.loading=5;else{e=N({rel:"stylesheet",href:e,"data-precedence":t},n),(n=_n.get(o))&&Lc(e,n);var k=m=l.createElement("link");yt(k),zt(k,"link",e),k._p=new Promise(function(q,Z){k.onload=q,k.onerror=Z}),k.addEventListener("load",function(){b.loading|=1}),k.addEventListener("error",function(){b.loading|=2}),b.loading|=4,mr(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:b},i.set(o,m)}}}function vg(e,t){oa.X(e,t);var n=Zl;if(n&&e){var l=ma(n).hoistableScripts,i=Jl(e),o=l.get(i);o||(o=n.querySelector(Zs(i)),o||(e=N({src:e,async:!0},t),(t=_n.get(i))&&Bc(e,t),o=n.createElement("script"),yt(o),zt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function yg(e,t){oa.M(e,t);var n=Zl;if(n&&e){var l=ma(n).hoistableScripts,i=Jl(e),o=l.get(i);o||(o=n.querySelector(Zs(i)),o||(e=N({src:e,async:!0,type:"module"},t),(t=_n.get(i))&&Bc(e,t),o=n.createElement("script"),yt(o),zt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function Im(e,t,n,l){var i=(i=me.current)?fr(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Fl(n.href),n=ma(i).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=Fl(n.href);var o=ma(i).hoistableStyles,m=o.get(e);if(m||(i=i.ownerDocument||i,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,m),(o=i.querySelector(Qs(e)))&&!o._p&&(m.instance=o,m.state.loading=5),_n.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},_n.set(e,n),o||Ng(i,e,n,m.state))),t&&l===null)throw Error(c(528,""));return m}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jl(n),n=ma(i).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(c(444,e))}}function Fl(e){return'href="'+Ft(e)+'"'}function Qs(e){return'link[rel="stylesheet"]['+e+"]"}function Gm(e){return N({},e,{"data-precedence":e.precedence,precedence:null})}function Ng(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}),zt(t,"link",n),yt(t),e.head.appendChild(t))}function Jl(e){return'[src="'+Ft(e)+'"]'}function Zs(e){return"script[async]"+e}function Ym(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Ft(n.href)+'"]');if(l)return t.instance=l,yt(l),l;var i=N({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),yt(l),zt(l,"style",i),mr(l,n.precedence,e),t.instance=l;case"stylesheet":i=Fl(n.href);var o=e.querySelector(Qs(i));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;l=Gm(n),(i=_n.get(i))&&Lc(l,i),o=(e.ownerDocument||e).createElement("link"),yt(o);var m=o;return m._p=new Promise(function(b,k){m.onload=b,m.onerror=k}),zt(o,"link",l),t.state.loading|=4,mr(o,n.precedence,e),t.instance=o;case"script":return o=Jl(n.src),(i=e.querySelector(Zs(o)))?(t.instance=i,yt(i),i):(l=n,(i=_n.get(o))&&(l=N({},n),Bc(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),yt(i),zt(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,mr(l,n.precedence,e));return t.instance}function mr(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,o=i,m=0;m<l.length;m++){var b=l[m];if(b.dataset.precedence===t)o=b;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Lc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Bc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var hr=null;function Xm(e,t,n){if(hr===null){var l=new Map,i=hr=new Map;i.set(n,l)}else i=hr,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[Xa]||o[pt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var m=o.getAttribute(t)||"";m=e+m;var b=l.get(m);b?b.push(o):l.set(m,[o])}}return l}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function jg(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 Vm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Sg(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 i=Fl(l.href),o=t.querySelector(Qs(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=pr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,yt(o);return}o=t.ownerDocument||t,l=Gm(l),(i=_n.get(i))&&Lc(l,i),o=o.createElement("link"),yt(o);var m=o;m._p=new Promise(function(b,k){m.onload=b,m.onerror=k}),zt(o,"link",l),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=pr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Uc=0;function kg(e,t){return e.stylesheets&&e.count===0&&gr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Uc===0&&(Uc=62500*lg());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gr(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Uc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function pr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xr=null;function gr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xr=new Map,t.forEach(_g,e),xr=null,pr.call(e))}function _g(e,t){if(!(t.state.loading&4)){var n=xr.get(e);if(n)var l=n.get(null);else{n=new Map,xr.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<i.length;o++){var m=i[o];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),l=m)}l&&n.set(null,l)}i=t.instance,m=i.getAttribute("data-precedence"),o=n.get(m)||l,o===l&&n.set(null,i),n.set(m,i),this.count++,l=pr.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),o?o.parentNode.insertBefore(i,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Fs={$$typeof:P,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Eg(e,t,n,l,i,o,m,b,k){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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function Qm(e,t,n,l,i,o,m,b,k,q,Z,te){return e=new Eg(e,t,n,m,k,q,Z,te,b),t=1,o===!0&&(t|=24),o=rn(3,null,null,t),e.current=o,o.stateNode=e,t=go(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:n,cache:t},No(o),e}function Zm(e){return e?(e=Tl,e):Tl}function Fm(e,t,n,l,i,o){i=Zm(i),l.context===null?l.context=i:l.pendingContext=i,l=ja(t),l.payload={element:n},o=o===void 0?null:o,o!==null&&(l.callback=o),n=Sa(e,l,t),n!==null&&(nn(n,e,t),Ts(n,e,t))}function Jm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function $c(e,t){Jm(e,t),(e=e.alternate)&&Jm(e,t)}function Wm(e){if(e.tag===13||e.tag===31){var t=Ja(e,67108864);t!==null&&nn(t,e,67108864),$c(e,67108864)}}function Pm(e){if(e.tag===13||e.tag===31){var t=fn();t=rt(t);var n=Ja(e,t);n!==null&&nn(n,e,t),$c(e,t)}}var br=!0;function wg(e,t,n,l){var i=w.T;w.T=null;var o=I.p;try{I.p=2,qc(e,t,n,l)}finally{I.p=o,w.T=i}}function Tg(e,t,n,l){var i=w.T;w.T=null;var o=I.p;try{I.p=8,qc(e,t,n,l)}finally{I.p=o,w.T=i}}function qc(e,t,n,l){if(br){var i=Hc(l);if(i===null)Ec(e,t,l,vr,n),th(e,l);else if(Mg(i,e,t,n,l))l.stopPropagation();else if(th(e,l),t&4&&-1<Ag.indexOf(e)){for(;i!==null;){var o=Yn(i);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var m=Qt(o.pendingLanes);if(m!==0){var b=o;for(b.pendingLanes|=2,b.entangledLanes|=2;m;){var k=1<<31-It(m);b.entanglements[1]|=k,m&=~k}$n(o),(Xe&6)===0&&(tr=nt()+500,Ys(0))}}break;case 31:case 13:b=Ja(o,2),b!==null&&nn(b,o,2),ar(),$c(o,2)}if(o=Hc(l),o===null&&Ec(e,t,l,vr,n),o===i)break;i=o}i!==null&&l.stopPropagation()}else Ec(e,t,l,null,n)}}function Hc(e){return e=Ae(e),Ic(e)}var vr=null;function Ic(e){if(vr=null,e=Gt(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(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 vr=e,null}function eh(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(Tt()){case pn:return 2;case xn:return 8;case Ha:case $r:return 32;case oi:return 268435456;default:return 32}default:return 32}}var Gc=!1,Da=null,za=null,La=null,Js=new Map,Ws=new Map,Ba=[],Ag="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 th(e,t){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":La=null;break;case"pointerover":case"pointerout":Js.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ws.delete(t.pointerId)}}function Ps(e,t,n,l,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Yn(t),t!==null&&Wm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Mg(e,t,n,l,i){switch(t){case"focusin":return Da=Ps(Da,e,t,n,l,i),!0;case"dragenter":return za=Ps(za,e,t,n,l,i),!0;case"mouseover":return La=Ps(La,e,t,n,l,i),!0;case"pointerover":var o=i.pointerId;return Js.set(o,Ps(Js.get(o)||null,e,t,n,l,i)),!0;case"gotpointercapture":return o=i.pointerId,Ws.set(o,Ps(Ws.get(o)||null,e,t,n,l,i)),!0}return!1}function nh(e){var t=Gt(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,bl(e.priority,function(){Pm(n)});return}}else if(t===31){if(t=h(n),t!==null){e.blockedOn=t,bl(e.priority,function(){Pm(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 yr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ve=l,n.target.dispatchEvent(l),ve=null}else return t=Yn(n),t!==null&&Wm(t),e.blockedOn=n,!1;t.shift()}return!0}function ah(e,t,n){yr(e)&&n.delete(t)}function Cg(){Gc=!1,Da!==null&&yr(Da)&&(Da=null),za!==null&&yr(za)&&(za=null),La!==null&&yr(La)&&(La=null),Js.forEach(ah),Ws.forEach(ah)}function Nr(e,t){e.blockedOn===t&&(e.blockedOn=null,Gc||(Gc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Cg)))}var jr=null;function lh(e){jr!==e&&(jr=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){jr===e&&(jr=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(Ic(l||n)===null)continue;break}var o=Yn(n);o!==null&&(e.splice(t,3),t-=3,Ho(o,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function Wl(e){function t(k){return Nr(k,e)}Da!==null&&Nr(Da,e),za!==null&&Nr(za,e),La!==null&&Nr(La,e),Js.forEach(t),Ws.forEach(t);for(var n=0;n<Ba.length;n++){var l=Ba[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ba.length&&(n=Ba[0],n.blockedOn===null);)nh(n),n.blockedOn===null&&Ba.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],o=n[l+1],m=i[Ut]||null;if(typeof o=="function")m||lh(n);else if(m){var b=null;if(o&&o.hasAttribute("formAction")){if(i=o,m=o[Ut]||null)b=m.formAction;else if(Ic(i)!==null)continue}else b=m.action;typeof b=="function"?n[l+1]=b:(n.splice(l,3),l-=3),lh(n)}}}function sh(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(m){return i=m})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=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),i!==null&&(i(),i=null)}}}function Yc(e){this._internalRoot=e}Sr.prototype.render=Yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=fn();Fm(n,l,e,t,null,null)},Sr.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fm(e.current,2,null,e,null,null),ar(),t[da]=null}};function Sr(e){this._internalRoot=e}Sr.prototype.unstable_scheduleHydration=function(e){if(e){var t=gl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ba.length&&t!==0&&t<Ba[n].priority;n++);Ba.splice(n,0,e),n===0&&nh(e)}};var ih=r.version;if(ih!=="19.2.6")throw Error(c(527,ih,"19.2.6"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=g(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Rg={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:w,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kr.isDisabled&&kr.supportsFiber)try{Ia=kr.inject(Rg),Bt=kr}catch{}}return ti.createRoot=function(e,t){if(!d(e))throw Error(c(299));var n=!1,l="",i=mf,o=hf,m=pf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Qm(e,1,!1,null,null,n,l,null,i,o,m,sh),e[da]=t.current,_c(e),new Yc(t)},ti.hydrateRoot=function(e,t,n){if(!d(e))throw Error(c(299));var l=!1,i="",o=mf,m=hf,b=pf,k=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(k=n.formState)),t=Qm(e,1,!0,t,n??null,l,i,k,o,m,b,sh),t.context=Zm(null),n=t.current,l=fn(),l=rt(l),i=ja(l),i.callback=null,Sa(n,i,l),n=l,t.current.lanes=n,Pe(t,n),$n(t),e[da]=t.current,_c(e),new Sr(t)},ti.version="19.2.6",ti}var xh;function Xg(){if(xh)return Vc.exports;xh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Vc.exports=Yg(),Vc.exports}var Kg=Xg();const fl="/dashboard";function gh(){const s=window.location.pathname;return s===fl||s===fl+"/"?"/":s.startsWith(fl+"/")?s.slice(fl.length):s||"/"}function ua(s){return s==="/"||s===""?fl+"/":fl+(s.startsWith("/")?s:"/"+s)}function as(s){const r=ua(s);r!==window.location.pathname+window.location.search&&window.history.pushState({},"",r),window.dispatchEvent(new Event("dashboard:navigate"))}typeof document<"u"&&!window.__dashboardRouterInstalled&&(window.__dashboardRouterInstalled=!0,document.addEventListener("click",s=>{var c,d;if(s.defaultPrevented||s.button!==0||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey)return;const r=(d=(c=s.target)==null?void 0:c.closest)==null?void 0:d.call(c,"a");if(!r)return;const u=r.getAttribute("href");u&&(r.hasAttribute("target")||r.hasAttribute("download")||u.startsWith(fl)&&(s.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 Fh(){const[s,r]=y.useState(gh());return y.useEffect(()=>{const u=()=>r(gh());return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),s}var Jc,bh;function Vg(){if(bh)return Jc;bh=1;function s(E){return E instanceof Map?E.clear=E.delete=E.set=function(){throw new Error("map is read-only")}:E instanceof Set&&(E.add=E.clear=E.delete=function(){throw new Error("set is read-only")}),Object.freeze(E),Object.getOwnPropertyNames(E).forEach(J=>{const fe=E[J],Ee=typeof fe;(Ee==="object"||Ee==="function")&&!Object.isFrozen(fe)&&s(fe)}),E}class r{constructor(J){J.data===void 0&&(J.data={}),this.data=J.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function u(E){return E.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function c(E,...J){const fe=Object.create(null);for(const Ee in E)fe[Ee]=E[Ee];return J.forEach(function(Ee){for(const at in Ee)fe[at]=Ee[at]}),fe}const d="</span>",f=E=>!!E.scope,p=(E,{prefix:J})=>{if(E.startsWith("language:"))return E.replace("language:","language-");if(E.includes(".")){const fe=E.split(".");return[`${J}${fe.shift()}`,...fe.map((Ee,at)=>`${Ee}${"_".repeat(at+1)}`)].join(" ")}return`${J}${E}`};class h{constructor(J,fe){this.buffer="",this.classPrefix=fe.classPrefix,J.walk(this)}addText(J){this.buffer+=u(J)}openNode(J){if(!f(J))return;const fe=p(J.scope,{prefix:this.classPrefix});this.span(fe)}closeNode(J){f(J)&&(this.buffer+=d)}value(){return this.buffer}span(J){this.buffer+=`<span class="${J}">`}}const x=(E={})=>{const J={children:[]};return Object.assign(J,E),J};class g{constructor(){this.rootNode=x(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(J){this.top.children.push(J)}openNode(J){const fe=x({scope:J});this.add(fe),this.stack.push(fe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(J){return this.constructor._walk(J,this.rootNode)}static _walk(J,fe){return typeof fe=="string"?J.addText(fe):fe.children&&(J.openNode(fe),fe.children.forEach(Ee=>this._walk(J,Ee)),J.closeNode(fe)),J}static _collapse(J){typeof J!="string"&&J.children&&(J.children.every(fe=>typeof fe=="string")?J.children=[J.children.join("")]:J.children.forEach(fe=>{g._collapse(fe)}))}}class v extends g{constructor(J){super(),this.options=J}addText(J){J!==""&&this.add(J)}startScope(J){this.openNode(J)}endScope(){this.closeNode()}__addSublanguage(J,fe){const Ee=J.root;fe&&(Ee.scope=`language:${fe}`),this.add(Ee)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function N(E){return E?typeof E=="string"?E:E.source:null}function A(E){return T("(?=",E,")")}function K(E){return T("(?:",E,")*")}function O(E){return T("(?:",E,")?")}function T(...E){return E.map(fe=>N(fe)).join("")}function j(E){const J=E[E.length-1];return typeof J=="object"&&J.constructor===Object?(E.splice(E.length-1,1),J):{}}function L(...E){return"("+(j(E).capture?"":"?:")+E.map(Ee=>N(Ee)).join("|")+")"}function B(E){return new RegExp(E.toString()+"|").exec("").length-1}function P(E,J){const fe=E&&E.exec(J);return fe&&fe.index===0}const V=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(E,{joinWith:J}){let fe=0;return E.map(Ee=>{fe+=1;const at=fe;let Pe=N(Ee),be="";for(;Pe.length>0;){const he=V.exec(Pe);if(!he){be+=Pe;break}be+=Pe.substring(0,he.index),Pe=Pe.substring(he.index+he[0].length),he[0][0]==="\\"&&he[1]?be+="\\"+String(Number(he[1])+at):(be+=he[0],he[0]==="("&&fe++)}return be}).map(Ee=>`(${Ee})`).join(J)}const R=/\b\B/,_="[a-zA-Z]\\w*",Q="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",G="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ue="\\b(0b[01]+)",ae="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",oe=(E={})=>{const J=/^#![ ]*\//;return E.binary&&(E.begin=T(J,/.*\b/,E.binary,/\b.*/)),c({scope:"meta",begin:J,end:/$/,relevance:0,"on:begin":(fe,Ee)=>{fe.index!==0&&Ee.ignoreMatch()}},E)},pe={begin:"\\\\[\\s\\S]",relevance:0},D={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[pe]},w={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[pe]},I={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ne=function(E,J,fe={}){const Ee=c({scope:"comment",begin:E,end:J,contains:[]},fe);Ee.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const at=L("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ee.contains.push({begin:T(/[ ]+/,"(",at,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ee},le=ne("//","$"),de=ne("/\\*","\\*/"),S=ne("#","$"),U={scope:"number",begin:F,relevance:0},se={scope:"number",begin:G,relevance:0},ee={scope:"number",begin:ue,relevance:0},Y={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[pe,{begin:/\[/,end:/\]/,relevance:0,contains:[pe]}]},me={scope:"title",begin:_,relevance:0},ge={scope:"title",begin:Q,relevance:0},Ge={begin:"\\.\\s*"+Q,relevance:0};var it=Object.freeze({__proto__:null,APOS_STRING_MODE:D,BACKSLASH_ESCAPE:pe,BINARY_NUMBER_MODE:ee,BINARY_NUMBER_RE:ue,COMMENT:ne,C_BLOCK_COMMENT_MODE:de,C_LINE_COMMENT_MODE:le,C_NUMBER_MODE:se,C_NUMBER_RE:G,END_SAME_AS_BEGIN:function(E){return Object.assign(E,{"on:begin":(J,fe)=>{fe.data._beginMatch=J[1]},"on:end":(J,fe)=>{fe.data._beginMatch!==J[1]&&fe.ignoreMatch()}})},HASH_COMMENT_MODE:S,IDENT_RE:_,MATCH_NOTHING_RE:R,METHOD_GUARD:Ge,NUMBER_MODE:U,NUMBER_RE:F,PHRASAL_WORDS_MODE:I,QUOTE_STRING_MODE:w,REGEXP_MODE:Y,RE_STARTERS_RE:ae,SHEBANG:oe,TITLE_MODE:me,UNDERSCORE_IDENT_RE:Q,UNDERSCORE_TITLE_MODE:ge});function Kt(E,J){E.input[E.index-1]==="."&&J.ignoreMatch()}function Lt(E,J){E.className!==void 0&&(E.scope=E.className,delete E.className)}function Rn(E,J){J&&E.beginKeywords&&(E.begin="\\b("+E.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",E.__beforeBegin=Kt,E.keywords=E.keywords||E.beginKeywords,delete E.beginKeywords,E.relevance===void 0&&(E.relevance=0))}function Ht(E,J){Array.isArray(E.illegal)&&(E.illegal=L(...E.illegal))}function Ye(E,J){if(E.match){if(E.begin||E.end)throw new Error("begin & end are not supported with match");E.begin=E.match,delete E.match}}function wn(E,J){E.relevance===void 0&&(E.relevance=1)}const hn=(E,J)=>{if(!E.beforeMatch)return;if(E.starts)throw new Error("beforeMatch cannot be used with starts");const fe=Object.assign({},E);Object.keys(E).forEach(Ee=>{delete E[Ee]}),E.keywords=fe.keywords,E.begin=T(fe.beforeMatch,A(fe.begin)),E.starts={relevance:0,contains:[Object.assign(fe,{endsParent:!0})]},E.relevance=0,delete fe.beforeMatch},On=["of","and","for","in","not","or","if","then","parent","list","value"],re="keyword";function we(E,J,fe=re){const Ee=Object.create(null);return typeof E=="string"?at(fe,E.split(" ")):Array.isArray(E)?at(fe,E):Object.keys(E).forEach(function(Pe){Object.assign(Ee,we(E[Pe],J,Pe))}),Ee;function at(Pe,be){J&&(be=be.map(he=>he.toLowerCase())),be.forEach(function(he){const _e=he.split("|");Ee[_e[0]]=[Pe,qe(_e[0],_e[1])]})}}function qe(E,J){return J?Number(J):mt(E)?0:1}function mt(E){return On.includes(E.toLowerCase())}const Vt={},nt=E=>{console.error(E)},Tt=(E,...J)=>{console.log(`WARN: ${E}`,...J)},pn=(E,J)=>{Vt[`${E}/${J}`]||(console.log(`Deprecated as of ${E}. ${J}`),Vt[`${E}/${J}`]=!0)},xn=new Error;function Ha(E,J,{key:fe}){let Ee=0;const at=E[fe],Pe={},be={};for(let he=1;he<=J.length;he++)be[he+Ee]=at[he],Pe[he+Ee]=!0,Ee+=B(J[he-1]);E[fe]=be,E[fe]._emit=Pe,E[fe]._multi=!0}function $r(E){if(Array.isArray(E.begin)){if(E.skip||E.excludeBegin||E.returnBegin)throw nt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),xn;if(typeof E.beginScope!="object"||E.beginScope===null)throw nt("beginScope must be object"),xn;Ha(E,E.begin,{key:"beginScope"}),E.begin=M(E.begin,{joinWith:""})}}function oi(E){if(Array.isArray(E.end)){if(E.skip||E.excludeEnd||E.returnEnd)throw nt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),xn;if(typeof E.endScope!="object"||E.endScope===null)throw nt("endScope must be object"),xn;Ha(E,E.end,{key:"endScope"}),E.end=M(E.end,{joinWith:""})}}function qr(E){E.scope&&typeof E.scope=="object"&&E.scope!==null&&(E.beginScope=E.scope,delete E.scope)}function Hr(E){qr(E),typeof E.beginScope=="string"&&(E.beginScope={_wrap:E.beginScope}),typeof E.endScope=="string"&&(E.endScope={_wrap:E.endScope}),$r(E),oi(E)}function Ia(E){function J(be,he){return new RegExp(N(be),"m"+(E.case_insensitive?"i":"")+(E.unicodeRegex?"u":"")+(he?"g":""))}class fe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(he,_e){_e.position=this.position++,this.matchIndexes[this.matchAt]=_e,this.regexes.push([_e,he]),this.matchAt+=B(he)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const he=this.regexes.map(_e=>_e[1]);this.matcherRe=J(M(he,{joinWith:"|"}),!0),this.lastIndex=0}exec(he){this.matcherRe.lastIndex=this.lastIndex;const _e=this.matcherRe.exec(he);if(!_e)return null;const ht=_e.findIndex((Gn,gl)=>gl>0&&Gn!==void 0),rt=this.matchIndexes[ht];return _e.splice(0,ht),Object.assign(_e,rt)}}class Ee{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(he){if(this.multiRegexes[he])return this.multiRegexes[he];const _e=new fe;return this.rules.slice(he).forEach(([ht,rt])=>_e.addRule(ht,rt)),_e.compile(),this.multiRegexes[he]=_e,_e}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(he,_e){this.rules.push([he,_e]),_e.type==="begin"&&this.count++}exec(he){const _e=this.getMatcher(this.regexIndex);_e.lastIndex=this.lastIndex;let ht=_e.exec(he);if(this.resumingScanAtSamePosition()&&!(ht&&ht.index===this.lastIndex)){const rt=this.getMatcher(0);rt.lastIndex=this.lastIndex+1,ht=rt.exec(he)}return ht&&(this.regexIndex+=ht.position+1,this.regexIndex===this.count&&this.considerAll()),ht}}function at(be){const he=new Ee;return be.contains.forEach(_e=>he.addRule(_e.begin,{rule:_e,type:"begin"})),be.terminatorEnd&&he.addRule(be.terminatorEnd,{type:"end"}),be.illegal&&he.addRule(be.illegal,{type:"illegal"}),he}function Pe(be,he){const _e=be;if(be.isCompiled)return _e;[Lt,Ye,Hr,hn].forEach(rt=>rt(be,he)),E.compilerExtensions.forEach(rt=>rt(be,he)),be.__beforeBegin=null,[Rn,Ht,wn].forEach(rt=>rt(be,he)),be.isCompiled=!0;let ht=null;return typeof be.keywords=="object"&&be.keywords.$pattern&&(be.keywords=Object.assign({},be.keywords),ht=be.keywords.$pattern,delete be.keywords.$pattern),ht=ht||/\w+/,be.keywords&&(be.keywords=we(be.keywords,E.case_insensitive)),_e.keywordPatternRe=J(ht,!0),he&&(be.begin||(be.begin=/\B|\b/),_e.beginRe=J(_e.begin),!be.end&&!be.endsWithParent&&(be.end=/\B|\b/),be.end&&(_e.endRe=J(_e.end)),_e.terminatorEnd=N(_e.end)||"",be.endsWithParent&&he.terminatorEnd&&(_e.terminatorEnd+=(be.end?"|":"")+he.terminatorEnd)),be.illegal&&(_e.illegalRe=J(be.illegal)),be.contains||(be.contains=[]),be.contains=[].concat(...be.contains.map(function(rt){return Dn(rt==="self"?be:rt)})),be.contains.forEach(function(rt){Pe(rt,_e)}),be.starts&&Pe(be.starts,he),_e.matcher=at(_e),_e}if(E.compilerExtensions||(E.compilerExtensions=[]),E.contains&&E.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return E.classNameAliases=c(E.classNameAliases||{}),Pe(E)}function Bt(E){return E?E.endsWithParent||Bt(E.starts):!1}function Dn(E){return E.variants&&!E.cachedVariants&&(E.cachedVariants=E.variants.map(function(J){return c(E,{variants:null},J)})),E.cachedVariants?E.cachedVariants:Bt(E)?c(E,{starts:E.starts?c(E.starts):null}):Object.isFrozen(E)?c(E):E}var It="11.11.1";class Ir extends Error{constructor(J,fe){super(J),this.name="HTMLInjectionError",this.html=fe}}const is=u,ci=c,Ga=Symbol("nomatch"),xl=7,Ya=function(E){const J=Object.create(null),fe=Object.create(null),Ee=[];let at=!0;const Pe="Could not find the language '{}', did you forget to load/include a language module?",be={disableAutodetect:!0,name:"Plain text",contains:[]};let he={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:v};function _e(ie){return he.noHighlightRe.test(ie)}function ht(ie){let Ne=ie.className+" ";Ne+=ie.parentNode?ie.parentNode.className:"";const Oe=he.languageDetectRe.exec(Ne);if(Oe){const Ke=Gt(Oe[1]);return Ke||(Tt(Pe.replace("{}",Oe[1])),Tt("Falling back to no-highlight mode for this block.",ie)),Ke?Oe[1]:"no-highlight"}return Ne.split(/\s+/).find(Ke=>_e(Ke)||Gt(Ke))}function rt(ie,Ne,Oe){let Ke="",xt="";typeof Ne=="object"?(Ke=ie,Oe=Ne.ignoreIllegals,xt=Ne.language):(pn("10.7.0","highlight(lang, code, ...args) has been deprecated."),pn("10.7.0",`Please use highlight(code, options) instead.
|
|
50
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),xt=ie,Ke=Ne),Oe===void 0&&(Oe=!0);const $t={code:Ke,language:xt};Ka("before:highlight",$t);const an=$t.result?$t.result:Gn($t.language,$t.code,Oe);return an.code=$t.code,Ka("after:highlight",an),an}function Gn(ie,Ne,Oe,Ke){const xt=Object.create(null);function $t(ce,ve){return ce.keywords[ve]}function an(){if(!ke.keywords){Nt.addText(Ve);return}let ce=0;ke.keywordPatternRe.lastIndex=0;let ve=ke.keywordPatternRe.exec(Ve),Ae="";for(;ve;){Ae+=Ve.substring(ce,ve.index);const Le=Ct.case_insensitive?ve[0].toLowerCase():ve[0],ut=$t(ke,Le);if(ut){const[gn,fs]=ut;if(Nt.addText(Ae),Ae="",xt[Le]=(xt[Le]||0)+1,xt[Le]<=xl&&(ha+=fs),gn.startsWith("_"))Ae+=ve[0];else{const xi=Ct.classNameAliases[gn]||gn;ln(ve[0],xi)}}else Ae+=ve[0];ce=ke.keywordPatternRe.lastIndex,ve=ke.keywordPatternRe.exec(Ve)}Ae+=Ve.substring(ce),Nt.addText(Ae)}function Zt(){if(Ve==="")return;let ce=null;if(typeof ke.subLanguage=="string"){if(!J[ke.subLanguage]){Nt.addText(Ve);return}ce=Gn(ke.subLanguage,Ve,!0,pi[ke.subLanguage]),pi[ke.subLanguage]=ce._top}else ce=bl(Ve,ke.subLanguage.length?ke.subLanguage:null);ke.relevance>0&&(ha+=ce.relevance),Nt.__addSublanguage(ce._emitter,ce.language)}function tt(){ke.subLanguage!=null?Zt():an(),Ve=""}function ln(ce,ve){ce!==""&&(Nt.startScope(ve),Nt.addText(ce),Nt.endScope())}function mi(ce,ve){let Ae=1;const Le=ve.length-1;for(;Ae<=Le;){if(!ce._emit[Ae]){Ae++;continue}const ut=Ct.classNameAliases[ce[Ae]]||ce[Ae],gn=ve[Ae];ut?ln(gn,ut):(Ve=gn,an(),Ve=""),Ae++}}function yl(ce,ve){return ce.scope&&typeof ce.scope=="string"&&Nt.openNode(Ct.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(ln(Ve,Ct.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),Ve=""):ce.beginScope._multi&&(mi(ce.beginScope,ve),Ve="")),ke=Object.create(ce,{parent:{value:ke}}),ke}function cs(ce,ve,Ae){let Le=P(ce.endRe,Ae);if(Le){if(ce["on:end"]){const ut=new r(ce);ce["on:end"](ve,ut),ut.isMatchIgnored&&(Le=!1)}if(Le){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return cs(ce.parent,ve,Ae)}function Nl(ce){return ke.matcher.regexIndex===0?(Ve+=ce[0],1):(pa=!0,0)}function Gr(ce){const ve=ce[0],Ae=ce.rule,Le=new r(Ae),ut=[Ae.__beforeBegin,Ae["on:begin"]];for(const gn of ut)if(gn&&(gn(ce,Le),Le.isMatchIgnored))return Nl(ve);return Ae.skip?Ve+=ve:(Ae.excludeBegin&&(Ve+=ve),tt(),!Ae.returnBegin&&!Ae.excludeBegin&&(Ve=ve)),yl(Ae,ce),Ae.returnBegin?0:ve.length}function Ft(ce){const ve=ce[0],Ae=Ne.substring(ce.index),Le=cs(ke,ce,Ae);if(!Le)return Ga;const ut=ke;ke.endScope&&ke.endScope._wrap?(tt(),ln(ve,ke.endScope._wrap)):ke.endScope&&ke.endScope._multi?(tt(),mi(ke.endScope,ce)):ut.skip?Ve+=ve:(ut.returnEnd||ut.excludeEnd||(Ve+=ve),tt(),ut.excludeEnd&&(Ve=ve));do ke.scope&&Nt.closeNode(),!ke.skip&&!ke.subLanguage&&(ha+=ke.relevance),ke=ke.parent;while(ke!==Le.parent);return Le.starts&&yl(Le.starts,ce),ut.returnEnd?0:ve.length}function us(){const ce=[];for(let ve=ke;ve!==Ct;ve=ve.parent)ve.scope&&ce.unshift(ve.scope);ce.forEach(ve=>Nt.openNode(ve))}let Va={};function jl(ce,ve){const Ae=ve&&ve[0];if(Ve+=ce,Ae==null)return tt(),0;if(Va.type==="begin"&&ve.type==="end"&&Va.index===ve.index&&Ae===""){if(Ve+=Ne.slice(ve.index,ve.index+1),!at){const Le=new Error(`0 width match regex (${ie})`);throw Le.languageName=ie,Le.badRule=Va.rule,Le}return 1}if(Va=ve,ve.type==="begin")return Gr(ve);if(ve.type==="illegal"&&!Oe){const Le=new Error('Illegal lexeme "'+Ae+'" for mode "'+(ke.scope||"<unnamed>")+'"');throw Le.mode=ke,Le}else if(ve.type==="end"){const Le=Ft(ve);if(Le!==Ga)return Le}if(ve.type==="illegal"&&Ae==="")return Ve+=`
|
|
51
|
+
`,1;if(ds>1e5&&ds>ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ve+=Ae,Ae.length}const Ct=Gt(ie);if(!Ct)throw nt(Pe.replace("{}",ie)),new Error('Unknown language: "'+ie+'"');const hi=Ia(Ct);let Sl="",ke=Ke||hi;const pi={},Nt=new he.__emitter(he);us();let Ve="",ha=0,Kn=0,ds=0,pa=!1;try{if(Ct.__emitTokens)Ct.__emitTokens(Ne,Nt);else{for(ke.matcher.considerAll();;){ds++,pa?pa=!1:ke.matcher.considerAll(),ke.matcher.lastIndex=Kn;const ce=ke.matcher.exec(Ne);if(!ce)break;const ve=Ne.substring(Kn,ce.index),Ae=jl(ve,ce);Kn=ce.index+Ae}jl(Ne.substring(Kn))}return Nt.finalize(),Sl=Nt.toHTML(),{language:ie,value:Sl,relevance:ha,illegal:!1,_emitter:Nt,_top:ke}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:ie,value:is(Ne),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Kn,context:Ne.slice(Kn-100,Kn+100),mode:ce.mode,resultSoFar:Sl},_emitter:Nt};if(at)return{language:ie,value:is(Ne),illegal:!1,relevance:0,errorRaised:ce,_emitter:Nt,_top:ke};throw ce}}function gl(ie){const Ne={value:is(ie),illegal:!1,relevance:0,_top:be,_emitter:new he.__emitter(he)};return Ne._emitter.addText(ie),Ne}function bl(ie,Ne){Ne=Ne||he.languages||Object.keys(J);const Oe=gl(ie),Ke=Ne.filter(Gt).filter(fa).map(tt=>Gn(tt,ie,!1));Ke.unshift(Oe);const xt=Ke.sort((tt,ln)=>{if(tt.relevance!==ln.relevance)return ln.relevance-tt.relevance;if(tt.language&&ln.language){if(Gt(tt.language).supersetOf===ln.language)return 1;if(Gt(ln.language).supersetOf===tt.language)return-1}return 0}),[$t,an]=xt,Zt=$t;return Zt.secondBest=an,Zt}function zn(ie,Ne,Oe){const Ke=Ne&&fe[Ne]||Oe;ie.classList.add("hljs"),ie.classList.add(`language-${Ke}`)}function pt(ie){let Ne=null;const Oe=ht(ie);if(_e(Oe))return;if(Ka("before:highlightElement",{el:ie,language:Oe}),ie.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ie);return}if(ie.children.length>0&&(he.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ie)),he.throwUnescapedHTML))throw new Ir("One of your code blocks includes unescaped HTML.",ie.innerHTML);Ne=ie;const Ke=Ne.textContent,xt=Oe?rt(Ke,{language:Oe,ignoreIllegals:!0}):bl(Ke);ie.innerHTML=xt.value,ie.dataset.highlighted="yes",zn(ie,Oe,xt.language),ie.result={language:xt.language,re:xt.relevance,relevance:xt.relevance},xt.secondBest&&(ie.secondBest={language:xt.secondBest.language,relevance:xt.secondBest.relevance}),Ka("after:highlightElement",{el:ie,result:xt,text:Ke})}function Ut(ie){he=ci(he,ie)}const da=()=>{vl(),pn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function rs(){vl(),pn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ui=!1;function vl(){function ie(){vl()}if(document.readyState==="loading"){ui||window.addEventListener("DOMContentLoaded",ie,!1),ui=!0;return}document.querySelectorAll(he.cssSelector).forEach(pt)}function di(ie,Ne){let Oe=null;try{Oe=Ne(E)}catch(Ke){if(nt("Language definition for '{}' could not be registered.".replace("{}",ie)),at)nt(Ke);else throw Ke;Oe=be}Oe.name||(Oe.name=ie),J[ie]=Oe,Oe.rawDefinition=Ne.bind(null,E),Oe.aliases&&Yn(Oe.aliases,{languageName:ie})}function Xa(ie){delete J[ie];for(const Ne of Object.keys(fe))fe[Ne]===ie&&delete fe[Ne]}function os(){return Object.keys(J)}function Gt(ie){return ie=(ie||"").toLowerCase(),J[ie]||J[fe[ie]]}function Yn(ie,{languageName:Ne}){typeof ie=="string"&&(ie=[ie]),ie.forEach(Oe=>{fe[Oe.toLowerCase()]=Ne})}function fa(ie){const Ne=Gt(ie);return Ne&&!Ne.disableAutodetect}function ma(ie){ie["before:highlightBlock"]&&!ie["before:highlightElement"]&&(ie["before:highlightElement"]=Ne=>{ie["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),ie["after:highlightBlock"]&&!ie["after:highlightElement"]&&(ie["after:highlightElement"]=Ne=>{ie["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function yt(ie){ma(ie),Ee.push(ie)}function fi(ie){const Ne=Ee.indexOf(ie);Ne!==-1&&Ee.splice(Ne,1)}function Ka(ie,Ne){const Oe=ie;Ee.forEach(function(Ke){Ke[Oe]&&Ke[Oe](Ne)})}function Xn(ie){return pn("10.7.0","highlightBlock will be removed entirely in v12.0"),pn("10.7.0","Please use highlightElement now."),pt(ie)}Object.assign(E,{highlight:rt,highlightAuto:bl,highlightAll:vl,highlightElement:pt,highlightBlock:Xn,configure:Ut,initHighlighting:da,initHighlightingOnLoad:rs,registerLanguage:di,unregisterLanguage:Xa,listLanguages:os,getLanguage:Gt,registerAliases:Yn,autoDetection:fa,inherit:ci,addPlugin:yt,removePlugin:fi}),E.debugMode=function(){at=!1},E.safeMode=function(){at=!0},E.versionString=It,E.regex={concat:T,lookahead:A,either:L,optional:O,anyNumberOfTimes:K};for(const ie in it)typeof it[ie]=="object"&&s(it[ie]);return Object.assign(E,it),E},Qt=Ya({});return Qt.newInstance=()=>Ya({}),Jc=Qt,Qt.HighlightJS=Qt,Qt.default=Qt,Jc}var Qg=Vg();const mn=Lg(Qg);function Zg(s){const r=s.regex,u={},c={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[u]}]};Object.assign(u,{className:"variable",variants:[{begin:r.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},c]});const d={className:"subst",begin:/\$\(/,end:/\)/,contains:[s.BACKSLASH_ESCAPE]},f=s.inherit(s.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),p={begin:/<<-?\s*(?=\w+)/,starts:{contains:[s.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},h={className:"string",begin:/"/,end:/"/,contains:[s.BACKSLASH_ESCAPE,u,d]};d.contains.push(h);const x={match:/\\"/},g={className:"string",begin:/'/,end:/'/},v={match:/\\'/},N={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},s.NUMBER_MODE,u]},A=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],K=s.SHEBANG({binary:`(${A.join("|")})`,relevance:10}),O={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[s.inherit(s.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},T=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],j=["true","false"],L={match:/(\/[a-z._-]+)+/},B=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],P=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],V=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:T,literal:j,built_in:[...B,...P,"set","shopt",...V,...M]},contains:[K,s.SHEBANG(),O,N,f,p,L,h,x,g,v,u]}}const Fg=s=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:s.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:s.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Jg=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Wg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Pg=[...Jg,...Wg],eb=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),tb=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),nb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ab=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function lb(s){const r=s.regex,u=Fg(s),c={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},d="and or not only",f=/@-?\w[\w]*(-\w+)*/,p="[a-zA-Z-][a-zA-Z0-9_-]*",h=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[u.BLOCK_COMMENT,c,u.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+p,relevance:0},u.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+tb.join("|")+")"},{begin:":(:)?("+nb.join("|")+")"}]},u.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ab.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[u.BLOCK_COMMENT,u.HEXCOLOR,u.IMPORTANT,u.CSS_NUMBER_MODE,...h,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...h,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},u.FUNCTION_DISPATCH]},{begin:r.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:d,attribute:eb.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...h,u.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Pg.join("|")+")\\b"}]}}function sb(s){const r=s.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:r.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:r.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function ib(s){const f={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:f,illegal:"</",contains:[s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE,{className:"string",variants:[s.QUOTE_STRING_MODE,s.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[s.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:f,illegal:/["']/}]}]}}const vh="[A-Za-z$_][0-9A-Za-z$_]*",rb=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ob=["true","false","null","undefined","NaN","Infinity"],Jh=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Wh=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ph=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],cb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ub=[].concat(Ph,Jh,Wh);function db(s){const r=s.regex,u=(ne,{after:le})=>{const de="</"+ne[0].slice(1);return ne.input.indexOf(de,le)!==-1},c=vh,d={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,le)=>{const de=ne[0].length+ne.index,S=ne.input[de];if(S==="<"||S===","){le.ignoreMatch();return}S===">"&&(u(ne,{after:de})||le.ignoreMatch());let U;const se=ne.input.substring(de);if(U=se.match(/^\s*=/)){le.ignoreMatch();return}if((U=se.match(/^\s+extends\s+/))&&U.index===0){le.ignoreMatch();return}}},h={$pattern:vh,keyword:rb,literal:ob,built_in:ub,"variable.language":cb},x="[0-9](_?[0-9])*",g=`\\.(${x})`,v="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",N={className:"number",variants:[{begin:`(\\b(${v})((${g})|\\.)?|(${g}))[eE][+-]?(${x})\\b`},{begin:`\\b(${v})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},K={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},O={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,A],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,A],subLanguage:"graphql"}},j={className:"string",begin:"`",end:"`",contains:[s.BACKSLASH_ESCAPE,A]},B={className:"comment",variants:[s.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),s.C_BLOCK_COMMENT_MODE,s.C_LINE_COMMENT_MODE]},P=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,K,O,T,j,{match:/\$\d+/},N];A.contains=P.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(P)});const V=[].concat(B,A.contains),M=V.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:["self"].concat(V)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:M},_={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Jh,...Wh]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},ue={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(ne){return r.concat("(?!",ne.join("|"),")")}const oe={match:r.concat(/\b/,ae([...Ph,"super","import"].map(ne=>`${ne}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},pe={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+s.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[s.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,K,O,T,j,B,{match:/\$\d+/},N,Q,{scope:"attr",match:c+r.lookahead(":"),relevance:0},I,{begin:"("+s.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[B,s.REGEXP_MODE,{className:"function",begin:w,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:s.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:d.begin,end:d.end},{match:f},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+s.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,s.inherit(s.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},pe,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},oe,ue,_,D,{match:/\$[(.]/}]}}function fb(s){const r={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},u={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],d={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:c},contains:[r,u,s.QUOTE_STRING_MODE,d,s.C_NUMBER_MODE,s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function mb(s){const r=s.regex,u=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),c=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],h={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:c,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},x={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:h,illegal:/#/},v={begin:/\{\{/,relevance:0},N={className:"string",contains:[s.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[s.BACKSLASH_ESCAPE,x],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[s.BACKSLASH_ESCAPE,x],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[s.BACKSLASH_ESCAPE,x,v,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[s.BACKSLASH_ESCAPE,x,v,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[s.BACKSLASH_ESCAPE,v,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[s.BACKSLASH_ESCAPE,v,g]},s.APOS_STRING_MODE,s.QUOTE_STRING_MODE]},A="[0-9](_?[0-9])*",K=`(\\b(${A}))?\\.(${A})|\\b(${A})\\.`,O=`\\b|${c.join("|")}`,T={className:"number",relevance:0,variants:[{begin:`(\\b(${A})|(${K}))[eE][+-]?(${A})[jJ]?(?=${O})`},{begin:`(${K})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${O})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${O})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${O})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${O})`},{begin:`\\b(${A})[jJ](?=${O})`}]},j={className:"comment",begin:r.lookahead(/# type:/),end:/$/,keywords:h,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},L={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:["self",x,T,N,s.HASH_COMMENT_MODE]}]};return g.contains=[N,T,x],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:h,illegal:/(<\/|\?)|=>/,contains:[x,T,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},N,j,s.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,u],scope:{1:"keyword",3:"title.function"},contains:[L]},{variants:[{match:[/\bclass/,/\s+/,u,/\s*/,/\(\s*/,u,/\s*\)/]},{match:[/\bclass/,/\s+/,u]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[T,L,N]}]}}function hb(s){const r=s.regex,u=s.COMMENT("--","$"),c={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},d={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],p=["double precision","large object","with timezone","without timezone"],h=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],x=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],v=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],N=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],A=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],K=v,O=[...g,...x].filter(M=>!v.includes(M)),T={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},j={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},L={match:r.concat(/\b/,r.either(...K),/\s*\(/),relevance:0,keywords:{built_in:K}};function B(M){return r.concat(/\b/,r.either(...M.map(R=>R.replace(/\s+/,"\\s+"))),/\b/)}const P={scope:"keyword",match:B(A),relevance:0};function V(M,{exceptions:R,when:_}={}){const Q=_;return R=R||[],M.map(F=>F.match(/\|\d+$/)||R.includes(F)?F:Q(F)?`${F}|0`:F)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:V(O,{when:M=>M.length<3}),literal:f,type:h,built_in:N},contains:[{scope:"type",match:B(p)},P,L,T,c,d,s.C_NUMBER_MODE,s.C_BLOCK_COMMENT_MODE,u,j]}}const Dr="[A-Za-z$_][0-9A-Za-z$_]*",ep=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tp=["true","false","null","undefined","NaN","Infinity"],np=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ap=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lp=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sp=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ip=[].concat(lp,np,ap);function pb(s){const r=s.regex,u=(ne,{after:le})=>{const de="</"+ne[0].slice(1);return ne.input.indexOf(de,le)!==-1},c=Dr,d={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,le)=>{const de=ne[0].length+ne.index,S=ne.input[de];if(S==="<"||S===","){le.ignoreMatch();return}S===">"&&(u(ne,{after:de})||le.ignoreMatch());let U;const se=ne.input.substring(de);if(U=se.match(/^\s*=/)){le.ignoreMatch();return}if((U=se.match(/^\s+extends\s+/))&&U.index===0){le.ignoreMatch();return}}},h={$pattern:Dr,keyword:ep,literal:tp,built_in:ip,"variable.language":sp},x="[0-9](_?[0-9])*",g=`\\.(${x})`,v="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",N={className:"number",variants:[{begin:`(\\b(${v})((${g})|\\.)?|(${g}))[eE][+-]?(${x})\\b`},{begin:`\\b(${v})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},K={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},O={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,A],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,A],subLanguage:"graphql"}},j={className:"string",begin:"`",end:"`",contains:[s.BACKSLASH_ESCAPE,A]},B={className:"comment",variants:[s.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:c+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),s.C_BLOCK_COMMENT_MODE,s.C_LINE_COMMENT_MODE]},P=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,K,O,T,j,{match:/\$\d+/},N];A.contains=P.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(P)});const V=[].concat(B,A.contains),M=V.concat([{begin:/(\s*)\(/,end:/\)/,keywords:h,contains:["self"].concat(V)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:M},_={variants:[{match:[/class/,/\s+/,c,/\s+/,/extends/,/\s+/,r.concat(c,"(",r.concat(/\./,c),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,c],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...np,...ap]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,c,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},ue={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(ne){return r.concat("(?!",ne.join("|"),")")}const oe={match:r.concat(/\b/,ae([...lp,"super","import"].map(ne=>`${ne}\\s*\\(`)),c,r.lookahead(/\s*\(/)),className:"title.function",relevance:0},pe={begin:r.concat(/\./,r.lookahead(r.concat(c,/(?![0-9A-Za-z$_(])/))),end:c,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,c,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+s.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,c,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:Q},illegal:/#(?![$_A-z])/,contains:[s.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,K,O,T,j,B,{match:/\$\d+/},N,Q,{scope:"attr",match:c+r.lookahead(":"),relevance:0},I,{begin:"("+s.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[B,s.REGEXP_MODE,{className:"function",begin:w,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:s.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:d.begin,end:d.end},{match:f},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+s.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,s.inherit(s.TITLE_MODE,{begin:c,className:"title.function"})]},{match:/\.\.\./,relevance:0},pe,{match:"\\$"+c,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},oe,ue,_,D,{match:/\$[(.]/}]}}function xb(s){const r=s.regex,u=pb(s),c=Dr,d=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,s.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},p={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:d},contains:[u.exports.CLASS_REFERENCE]},h={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},x=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:Dr,keyword:ep.concat(x),literal:tp,built_in:ip.concat(d),"variable.language":sp},v={className:"meta",begin:"@"+c},N=(T,j,L)=>{const B=T.contains.findIndex(P=>P.label===j);if(B===-1)throw new Error("can not find mode to replace");T.contains.splice(B,1,L)};Object.assign(u.keywords,g),u.exports.PARAMS_CONTAINS.push(v);const A=u.contains.find(T=>T.scope==="attr"),K=Object.assign({},A,{match:r.concat(c,r.lookahead(/\s*\?:/))});u.exports.PARAMS_CONTAINS.push([u.exports.CLASS_REFERENCE,A,K]),u.contains=u.contains.concat([v,f,p,K]),N(u,"shebang",s.SHEBANG()),N(u,"use_strict",h);const O=u.contains.find(T=>T.label==="func.def");return O.relevance=0,Object.assign(u,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),u}function gb(s){const r=s.regex,u=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),c=/[\p{L}0-9._:-]+/u,d={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},p=s.inherit(f,{begin:/\(/,end:/\)/}),h=s.inherit(s.APOS_STRING_MODE,{className:"string"}),x=s.inherit(s.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:c,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[d]},{begin:/'/,end:/'/,contains:[d]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[f,x,h,p,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,p,x,h]}]}]},s.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},d,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[x]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:r.concat(/</,r.lookahead(r.concat(u,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:u,relevance:0,starts:g}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(u,/>/))),contains:[{className:"name",begin:u,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function bb(s){const r="true false yes no null",u="[\\w#;/?:@&=+$,.~*'()[\\]]+",c={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},d={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},p={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[s.BACKSLASH_ESCAPE,d]},h=s.inherit(p,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),A={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},K={end:",",endsWithParent:!0,excludeEnd:!0,keywords:r,relevance:0},O={begin:/\{/,end:/\}/,contains:[K],illegal:"\\n",relevance:0},T={begin:"\\[",end:"\\]",contains:[K],illegal:"\\n",relevance:0},j=[c,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+u},{className:"type",begin:"!<"+u+">"},{className:"type",begin:"!"+u},{className:"type",begin:"!!"+u},{className:"meta",begin:"&"+s.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+s.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},s.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},A,{className:"number",begin:s.C_NUMBER_RE+"\\b",relevance:0},O,T,f,p],L=[...j];return L.pop(),L.push(h),K.contains=L,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:j}}mn.registerLanguage("typescript",xb);mn.registerLanguage("javascript",db);mn.registerLanguage("json",fb);mn.registerLanguage("bash",Zg);mn.registerLanguage("diff",sb);mn.registerLanguage("css",lb);mn.registerLanguage("xml",gb);mn.registerLanguage("python",mb);mn.registerLanguage("go",ib);mn.registerLanguage("yaml",bb);mn.registerLanguage("sql",hb);const vb={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",sh:"bash",shell:"bash",html:"xml",yml:"yaml"};function yh(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function rp(s){if(!s)return"";const r=s.toLowerCase().replace(/[^a-z0-9+-]/g,"");return vb[r]??r}function yb(s,r){const u=rp(r);if(u&&mn.getLanguage(u))try{return mn.highlight(s,{language:u,ignoreIllegals:!0}).value}catch{return yh(s)}return yh(s)}function Nb(s){let r=s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");r=r.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(f,p,h)=>`<pre class="md-code-block"><code>${h.trimEnd()}</code></pre>`),r=r.replace(/`([^`\n]+)`/g,'<code class="md-inline-code">$1</code>'),r=r.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),r=r.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>");const u=r.split(`
|
|
52
|
+
`),c=[];let d=!1;for(let f=0;f<u.length;f++){const p=u[f],h=p.match(/^###\s+(.+)$/),x=p.match(/^##\s+(.+)$/),g=p.match(/^#\s+(.+)$/);if(h){d&&(c.push("</ul>"),d=!1),c.push(`<h3 class="md-h3">${h[1]}</h3>`);continue}if(x){d&&(c.push("</ul>"),d=!1),c.push(`<h2 class="md-h2">${x[1]}</h2>`);continue}if(g){d&&(c.push("</ul>"),d=!1),c.push(`<h1 class="md-h1">${g[1]}</h1>`);continue}const v=p.match(/^(\s*)[*-]\s+(.+)$/);if(v){d||(c.push('<ul class="md-list">'),d=!0),c.push(`<li>${v[2]}</li>`);continue}if(p.trim()===""){d&&(c.push("</ul>"),d=!1),c.push("");continue}d&&(c.push("</ul>"),d=!1),c.push(p)}return d&&c.push("</ul>"),c.join(`
|
|
53
|
+
`)}const li="\0",jb=new RegExp(li,"g"),Sb=new RegExp(`${li}HLJS(\\d+)${li}`,"g");function ii(s){const r=[];let u=s.replace(jb,"");u=u.replace(/```(\w*)[^\n]*\n([\s\S]*?)^```/gm,(h,x,g)=>{const v=r.length;return r.push({lang:x,body:g}),`${li}HLJS${v}${li}`});let c=u.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(/`([^`\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 d=c.split(`
|
|
54
|
+
`),f=[];let p=!1;for(const h of d){const x=h.match(/^###\s+(.+)$/),g=h.match(/^##\s+(.+)$/),v=h.match(/^#\s+(.+)$/);if(x){p&&(f.push("</ul>"),p=!1),f.push(`<h3 class="md-h3">${x[1]}</h3>`);continue}if(g){p&&(f.push("</ul>"),p=!1),f.push(`<h2 class="md-h2">${g[1]}</h2>`);continue}if(v){p&&(f.push("</ul>"),p=!1),f.push(`<h1 class="md-h1">${v[1]}</h1>`);continue}const N=h.match(/^(\s*)[*-]\s+(.+)$/);if(N){p||(f.push('<ul class="md-list">'),p=!0),f.push(`<li>${N[2]}</li>`);continue}if(h.trim()===""){p&&(f.push("</ul>"),p=!1),f.push("");continue}p&&(f.push("</ul>"),p=!1),f.push(h)}return p&&f.push("</ul>"),c=f.join(`
|
|
55
|
+
`),c=c.replace(Sb,(h,x)=>{const g=r[Number(x)];if(!g)return"";const v=rp(g.lang),N=v?` language-${v}`:"",A=yb(g.body.replace(/\n$/,""),g.lang);return`<pre class="md-code-block"><code class="hljs${N}">${A}</code></pre>`}),c}function wt(s){const r=Date.now(),u=typeof s=="string"?new Date(s).getTime():s,c=Math.max(0,Math.floor((r-u)/1e3));return c<60?"just now":c<3600?Math.floor(c/60)+"m ago":c<86400?Math.floor(c/3600)+"h ago":Math.floor(c/86400)+"d ago"}function kb(s){if(!s)return"—";const r=Math.round(s/1e3);return r<60?r+"s":Math.floor(r/60)+"m "+r%60+"s"}function du(s){const r=s.split("-").filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(r[0]||s).slice(0,2).toUpperCase()}const Nh=["#3F8B86","#8C5E97","#B47A2A","#2F7D5B","#A53A4A","#6B6862","#C8A45A"],jh={"sonnet-reviewer":"#8C5E97","sonnet-designer":"#C8A45A","sonnet-implementer":"#A53A4A","opus-implementer":"#C97056","gemini-reviewer":"#3F8B86","gemini-tester":"#2F7D5B","haiku-researcher":"#6B7A85"};function Cn(s){if(jh[s])return jh[s];let r=0;for(let u=0;u<s.length;u++)r=r*31+s.charCodeAt(u)>>>0;return Nh[r%Nh.length]}function ss({title:s,hint:r,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:s}),r&&a.jsx("div",{className:"mt-1 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:r})]})}function _b(s){return s==null||s<=0?"—":s<1e3?`${s}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`}function ul({value:s,unit:r,label:u,valueClass:c="",valueColor:d,pulse:f,tooltip:p}){return a.jsxs("div",{className:"flex flex-col items-center py-4 px-3 text-center","data-tooltip":p,children:[a.jsxs("div",{className:"flex items-baseline gap-1",children:[f&&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] ${c}`,style:d?{color:d}:void 0,children:s}),r&&a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--ink-3)"},children:r})]}),a.jsx("div",{className:"h-section mt-1.5",style:{color:"var(--ink-3)",fontSize:"10px"},children:u})]})}function Eb({overview:s,activeTasks:r,mode:u="dense",showActivity:c}){const d=s.relayCount+s.nativeCount,f=s.tasksCompleted+s.tasksFailed>0?Math.round(s.tasksCompleted/(s.tasksCompleted+s.tasksFailed)*100):null,p=s.totalFindings>0?Math.round(s.confirmedFindings/s.totalFindings*100):0,h=u==="calm",x=c??!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(ss,{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(ul,{value:s.agentsOnline,label:"Agents Working",valueColor:s.agentsOnline>0?"var(--ok)":"var(--text)"})}),a.jsx("div",{className:"border-r border-border",children:a.jsx(ul,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0})}),a.jsx(ul,{value:`${p}%`,label:"Confirmed",valueClass:p>=50?"text-confirmed":p>0?"text-unverified":"",valueColor:p===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:s.agentsOnline>0?"var(--ok)":"var(--text)"},children:s.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 ${s.relayConnected>0?"text-confirmed":""}`,style:s.relayConnected>0?void 0:{color:"var(--ink-3)"},children:s.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(ul,{value:r,label:"Active Tasks",valueClass:r>0?"text-unverified":"",valueColor:r>0?void 0:"var(--ink-3)",pulse:r>0}),a.jsx(ul,{value:s.consensusRuns,label:"Consensus",valueColor:"var(--text)"}),a.jsx(ul,{value:`${p}%`,label:"Confirmed",valueClass:"text-confirmed"})]}),a.jsx("a",{href:ua("/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(ul,{value:s.actionableFindings,label:"Actionable",valueClass:s.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:s.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:s.totalSignals})]}),s.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:s.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:_b(s.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 ${f!==null&&f>=95?"text-confirmed":f!==null&&f>=80?"text-unverified":f!==null?"text-bad":""}`,style:f===null?{color:"var(--ink-3)"}:void 0,children:f===null?"—":`${f}%`})]})]}),x&&a.jsx(wb,{hourly:s.hourlyActivity||[]}),s.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 ",wt(s.lastConsensusTimestamp)]})]})}function wb({hourly:s}){const r=s.length===12?s:new Array(12).fill(0),u=Math.max(1,...r);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:r.map((c,d)=>{const f=11-d,p=c/u*100,h=d===11,x=f===0?"last hour":`${f}h ago`;return a.jsx("div",{className:`relative flex-1 cursor-pointer rounded-sm transition-opacity hover:opacity-100 ${c===0?"opacity-0":h?"bg-chart opacity-90":"bg-chart opacity-40"}`,style:{height:c===0?"0%":`${Math.max(8,p)}%`},"data-tooltip":`${x}
|
|
56
|
+
${c} task${c===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 In=24;function Tb(s,r){const u=new Map;for(const c of r)u.set(c.id,new Array(In).fill(0));for(const c of(s==null?void 0:s.agents)??[]){const d=u.get(c.id);if(!d)continue;const f=c.buckets??[];for(let p=0;p<In;p++)d[p]=f[p]??0}return u}function Ab(s,r){if(r<=0||s<=0)return 0;const u=s/r;return u<.18?1:u<.4?2:u<.68?3:4}const Mb={0:.18,1:.35,2:.55,3:.78,4:1};function Cb({agents:s,activity:r,loading:u=!1,error:c=null}){const d=y.useMemo(()=>Tb(r,s),[r,s]),f=y.useMemo(()=>{const h=new Map;for(const[x,g]of d)h.set(x,g.reduce((v,N)=>v+N,0));return h},[d]),p=y.useMemo(()=>{let h=0;for(const x of f.values())h+=x;return h},[f]);if(u&&s.length===0)return a.jsx(_r,{error:null,fleetTotal:null,children:Array.from({length:4}).map((h,x)=>a.jsx(Rb,{},x))});if(s.length===0)return a.jsx(_r,{error:c,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(p===0){const h=r==null?"Activity data unavailable — relay may be disconnected. Showing idle rows from the agent registry.":"No active dispatches — fleet idle.";return a.jsxs(_r,{error:c,fleetTotal:0,children:[s.map(x=>a.jsx(Ob,{agent:x},x.id)),a.jsx("div",{className:"px-5 py-3 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:h})]})}return a.jsx(_r,{error:c,fleetTotal:p,children:s.map(h=>{const x=d.get(h.id)??new Array(In).fill(0),g=Math.max(0,...x),v=f.get(h.id)??0,N=p>0?Math.round(v/p*100):0,A=Cn(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:A}}),a.jsx("span",{className:"truncate",children:h.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${In}, 1fr)`},role:"img","aria-label":`${h.id} 24h activity — ${v} signals`,children:x.map((K,O)=>{const T=Ab(K,g);return a.jsx("div",{className:"rounded-sm",title:`hour ${O}: ${K} signal${K===1?"":"s"}`,style:{background:T===0?"var(--surface-sunk)":A,opacity:Mb[T]}},O)})}),a.jsxs("div",{className:"text-right font-mono text-[12px] tabular-nums",style:{color:"var(--ink)"},children:[v,a.jsxs("span",{className:"ml-1.5 text-[11px]",style:{color:"var(--ink-3)"},children:[N,"%"]})]})]},h.id)})})}function _r({children:s,error:r,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(${In}, 1fr)`,color:"var(--ink-3)"},children:Array.from({length:In}).map((c,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:r?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:r}):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})]}),s]})}function Rb(){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(${In}, 1fr)`},children:Array.from({length:In}).map((s,r)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--border)",opacity:.4}},r))}),a.jsx("div",{className:"ml-auto h-3 w-12 rounded",style:{background:"var(--border)",opacity:.4}})]})}function Ob({agent:s}){const r=Cn(s.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:r,opacity:.5}}),a.jsx("span",{className:"truncate",children:s.id})]}),a.jsx("div",{className:"grid h-4 gap-px",style:{gridTemplateColumns:`repeat(${In}, 1fr)`},children:Array.from({length:In}).map((u,c)=>a.jsx("div",{className:"rounded-sm",style:{background:"var(--surface-sunk)",opacity:.4}},c))}),a.jsx("div",{className:"text-right font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"—"})]})}const ku="/dashboard/api",op="unauthorized";function Db(s){return s instanceof Error&&s.message.includes(op)}const zr=3e4;function cp(s){return`timeout after ${s/1e3}s`}function _u(s){if(typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function")return{signal:AbortSignal.timeout(s),cleanup:()=>{}};const r=new AbortController,u=setTimeout(()=>r.abort(new Error(cp(s))),s);return{signal:r.signal,cleanup:()=>clearTimeout(u)}}async function ct(s,r){const{signal:u,cleanup:c}=_u(zr);try{const d=await fetch(`${ku}/${s}`,{credentials:"include",...r,signal:u});if(d.status===401)throw new Error(op);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(cp(zr)):d}finally{c()}}async function zb(s){const{signal:r,cleanup:u}=_u(zr);try{const c=await fetch(`${ku}/auth`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:s}),signal:r});return c.ok?await fu()?{ok:!0}:{ok:!1,kind:"no_cookie"}:c.status===401||c.status===403?{ok:!1,kind:"bad_key"}:{ok:!1,kind:"network"}}catch{return{ok:!1,kind:"network"}}finally{u()}}async function fu(){const{signal:s,cleanup:r}=_u(zr);try{return(await fetch(`${ku}/auth/check`,{credentials:"include",signal:s})).ok}catch{return!1}finally{r()}}const Lb=7200*1e3;function Bb(s){const r=Date.now()-new Date(s).getTime();return r<0?"0s":r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}function Ub({onCountChange:s}){const[r,u]=y.useState([]),[,c]=y.useState(0);y.useEffect(()=>{let h=!1;const x=async()=>{var v;try{const N=await ct("active-tasks");h||(u(N.tasks||[]),s==null||s(((v=N.tasks)==null?void 0:v.length)||0))}catch{}};x();const g=setInterval(x,5e3);return()=>{h=!0,clearInterval(g)}},[s]),y.useEffect(()=>{if(r.length===0)return;const h=setInterval(()=>c(x=>x+1),1e3);return()=>clearInterval(h)},[r.length]);const d=Date.now(),f=r.filter(h=>d-new Date(h.startedAt).getTime()<Lb),p=r.length-f.length;return f.length===0?p===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:[p," stale task",p===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:[f.length," active"]}),p>0&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:["· ",p," stale"]})]}),a.jsx("div",{className:"max-h-40 space-y-1 overflow-y-auto",children:f.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:Bb(h.startedAt)})]},h.taskId))})]})}function $b(s,r,u,c){const d=Math.max(0,Math.min(.9999,c)),f=-Math.PI/2,p=f+d*2*Math.PI,h=s+u*Math.cos(f),x=r+u*Math.sin(f),g=s+u*Math.cos(p),v=r+u*Math.sin(p),N=d>.5?1:0;return`M ${h.toFixed(2)} ${x.toFixed(2)} A ${u} ${u} 0 ${N} 1 ${g.toFixed(2)} ${v.toFixed(2)}`}function qb(s,r,u){return`M ${s} ${r-u} A ${u} ${u} 0 1 1 ${s} ${r+u} A ${u} ${u} 0 1 1 ${s} ${r-u}`}function Hb({accuracy:s,size:r=90,color:u="var(--ink)"}){const c=Number.isFinite(s)?Math.max(0,Math.min(1,s)):0,d=r/2,f=r/2,p=r*.089,h=(r-p)/2-2,x=Math.round(c*100),g=Math.round(r*.22);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[a.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":`Accuracy ${x}%`,children:[a.jsx("path",{d:qb(d,f,h),fill:"none",stroke:"var(--ink)",strokeOpacity:.08,strokeWidth:p,strokeLinecap:"round"}),c>0&&a.jsx("path",{d:$b(d,f,h,c),fill:"none",stroke:u,strokeWidth:p,strokeLinecap:"round"}),a.jsxs("text",{x:d,y:f,textAnchor:"middle",dominantBaseline:"middle",dy:"0.08em",fill:"var(--ink)",style:{fontSize:g,fontFamily:"'Fraunces', serif",fontVariantNumeric:"tabular-nums",fontWeight:700},children:[x,"%"]})]}),a.jsx("span",{style:{fontSize:10,color:"var(--ink-3)",fontFamily:"Geist, Inter, sans-serif",fontVariant:"small-caps",letterSpacing:"0.04em"},children:"accuracy"})]})}const Sh={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--idle)"},kh=["critical","high","medium","low"];function Ib({counts:s,height:r=10}){const u=s??{critical:0,high:0,medium:0,low:0},c=u.critical+u.high+u.medium+u.low,d=`critical: ${u.critical}, high: ${u.high}, medium: ${u.medium}, low: ${u.low}`;return c===0?a.jsx("div",{role:"img","aria-label":`Severity distribution: no findings yet (${d})`,title:`${d} (no findings yet)`,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",gap:2,border:"1px solid color-mix(in oklch, var(--border) 60%, transparent)",width:"100%"},children:kh.map(f=>a.jsx("div",{style:{flex:1,background:Sh[f],opacity:.4}},f))}):a.jsx("div",{role:"img","aria-label":`Severity distribution — ${d}`,title:d,style:{display:"flex",height:r,borderRadius:r/2,overflow:"hidden",width:"100%"},children:kh.map(f=>{const p=u[f];if(p===0)return null;const h=p/c*100;return a.jsx("div",{style:{width:`${h.toFixed(2)}%`,background:Sh[f],flexShrink:0}},f)})})}function Gb(s){return s.map(r=>r.signals)}function Yb(s,r,u){if(s.length===0)return{line:`M 0 ${u} L ${r} ${u}`,area:""};if(s.length===1){const x=u/2;return{line:`M 0 ${x} L ${r} ${x}`,area:`M 0 ${u} L 0 ${x} L ${r} ${x} L ${r} ${u} Z`}}const c=Math.max(...s,1),d=r/(s.length-1),f=s.map((x,g)=>{const v=(g*d).toFixed(2),N=(u-x/c*u).toFixed(2);return`${v},${N}`}),p=`M ${f.join(" L ")}`,h=`M 0,${u} L ${f.join(" L ")} L ${((s.length-1)*d).toFixed(2)},${u} Z`;return{line:p,area:h}}const Xb=5,mu=999;function Kb(s){if(s.length<2)return null;const r=Math.floor(s.length/2),u=s.slice(0,r),c=s.slice(s.length-r),d=v=>v.reduce((N,A)=>N+A.signals,0),f=d(u),p=d(c);if(f<Xb)return null;const h=f/u.length,x=p/c.length,g=Math.round((x-h)/h*100);return Math.max(-mu,Math.min(mu,g))}function up({points:s,width:r=80,height:u=20,reducedMotion:c=!1,color:d="var(--c1)"}){const f=y.useMemo(()=>Gb(s),[s]),{line:p,area:h}=y.useMemo(()=>Yb(f,r,u),[f,r,u]),x=y.useMemo(()=>Kb(s),[s]),g=f.length===0||f.every(v=>v===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 ${r} ${u}`,preserveAspectRatio:"none","aria-hidden":"true",style:{overflow:"visible",flex:1,minWidth:0},children:[!c&&!g&&h&&a.jsx("path",{d:h,fill:d,fillOpacity:.3}),a.jsx("path",{d:p,fill:"none",stroke:g?"var(--idle)":d,strokeOpacity:g?.3:1,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),x!==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:[x>=0?"+":"",x,"%",Math.abs(x)>=mu?"+":""]})]})}function Eu(s){var r,u;return((r=s.bench)==null?void 0:r.state)==="benched"?"benched":s.circuitOpen?"struggling":((u=s.bench)==null?void 0:u.state)==="kept-for-coverage"?"kept-for-coverage":null}function Vb(s){var r;return((r=s.scores.bench)==null?void 0:r.state)==="benched"||s.scores.circuitOpen}function hu(s){return`${Math.round(s*100)}%`}function Qb(s){var r,u,c;return s.accuracy>=.7&&((r=s.bench)==null?void 0:r.state)==="none"?{label:"healthy",dotColor:"var(--ok)",tooltip:`Accuracy ${Math.round(s.accuracy*100)}% — above 70% baseline.`}:{label:"needs skills",dotColor:"var(--warn)",tooltip:((u=s.bench)==null?void 0:u.state)!=="none"?`Benched (${((c=s.bench)==null?void 0:c.reason)??"auto"})`:`Accuracy ${Math.round(s.accuracy*100)}% — below 70% baseline.`}}function _h({label:s,value:r,color:u,tooltip:c}){const d=Number.isFinite(r)?Math.max(0,Math.min(1,r)):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":c,children:s}),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:hu(d)})]})}function Zb({agent:s,severityCounts:r,trendPoints:u}){var h;const c=s.scores,d=(h=s.lastTask)!=null&&h.timestamp?wt(s.lastTask.timestamp):"",f=Cn(s.id),p=Qb(c);return a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(s.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":p.tooltip,"data-tooltip-pos":"bottom",children:[a.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:p.dotColor,flexShrink:0}}),p.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(Hb,{accuracy:c.accuracy,size:90,color:f}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[a.jsx(Ib,{counts:r}),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:s.id}),(()=>{const x=Eu(c);return x==="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 (${c.bench.reason??"auto"}). Excluded from dispatch until recovery.`,"data-tooltip":`Benched (${c.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"BENCHED"}):x==="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"}):x==="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 (${c.bench.reason??"rule"}), but kept as sole provider of a category.`,"data-tooltip":`Would bench (${c.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(_h,{label:"unique",value:c.uniqueness,color:f,tooltip:`Uniqueness ${hu(c.uniqueness)}
|
|
57
|
+
Findings others missed.`}),a.jsx(_h,{label:"impact",value:c.impactScore,color:f,tooltip:`Impact ${hu(c.impactScore)}
|
|
58
|
+
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(up,{points:u,width:240,height:28,color:f})}),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:[c.signals," signals"]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{opacity:.5},children:"·"}),a.jsx("span",{children:d})]})]})]})]})]})]})}function Fb({agents:s,highlightedAgentId:r,severityMap:u,trendByAgent:c}){const d=[...s].sort((h,x)=>{var K,O,T,j;const g=((K=h.lastTask)==null?void 0:K.timestamp)??"",v=((O=x.lastTask)==null?void 0:O.timestamp)??"";if(g!==v)return v.localeCompare(g);const N=((T=h.scores)==null?void 0:T.signals)||0,A=((j=x.scores)==null?void 0:j.signals)||0;return N!==A?A-N:h.id.localeCompare(x.id)}),f=d.slice(0,4),p=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:s.length})]}),p&&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:f.map(h=>{const x=h.id===r;return a.jsx("div",{style:{borderRadius:"0.5rem",outline:x?"2px solid var(--border-strong)":void 0,transition:"outline-color 200ms cubic-bezier(0.4,0,0.2,1)"},children:a.jsx(Zb,{agent:h,severityCounts:u==null?void 0:u.get(h.id),trendPoints:c==null?void 0:c.get(h.id)})},h.id)})})]})}const Jb=8;function Wb(s){const r=s.toLowerCase();return r==="completed"||r==="done"||r==="success"||r==="succeeded"?"completed":r==="running"||r==="active"||r==="in_progress"||r==="pending"?"running":r==="failed"||r==="error"||r==="errored"||r==="timeout"||r==="timed_out"?"failed":r==="cancelled"||r==="canceled"||r==="queued"||r==="waiting"?"cancelled":"unknown"}const Pb={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}},ev={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 tv(s){return s.length>8?s.slice(0,8):s}function nv(s){return s.endsWith("-implementer")?{label:"IMPL",cls:"text-unique"}:s.endsWith("-reviewer")?{label:"REVIEW",cls:"text-chart"}:s.endsWith("-tester")?{label:"TEST",cls:"text-unique"}:s.endsWith("-researcher")?{label:"RESEARCH",cls:"",clsStyle:{color:"var(--text-dim)"}}:s.endsWith("-designer")?{label:"DESIGN",cls:"text-chart"}:null}function av({tasks:s,limit:r=Jb}){const u=s.items.slice(0,r),c=s.items.length>r;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:s.total})]}),c&&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(ss,{title:"No tasks yet",hint:"Dispatch with gossip_run to populate this view."}):u.map((d,f)=>{const p=Wb(d.status),h=Pb[p],x=nv(d.agentId);return a.jsxs("div",{className:`flex items-start gap-3 px-3.5 py-2.5 hover:bg-accent/20 transition-colors ${f>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:ev[p]})}),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:tv(d.taskId)}),x&&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 ${x.cls}`,style:{background:"color-mix(in oklch, var(--surface) 40%, transparent)",...x.clsStyle},"data-tooltip":d.agentId,children:x.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:wt(d.timestamp)})]},d.taskId)})})]})}function wu({message:s,className:r}){return a.jsxs("span",{role:"alert",className:`inline-flex items-center gap-1 rounded-sm px-2 py-0.5 font-mono text-[10px] ${r??""}`,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 · ",s]})]})}const lv={agreement:"confirmed",consensus_verified:"confirmed",unique_confirmed:"unique",unique_unconfirmed:"unique?",disagreement:"disputed",hallucination_caught:"hallucination",new_finding:"new",unverified:"unverified"},sv={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)"},iv={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"};function rv(s,r){return s?s.length>r?s.slice(0,r-1)+"…":s:""}function ov(s){return s.split(/(`[^`]+`)/g).map((u,c)=>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)},c):a.jsx("span",{children:u},c))}function cv(){const[s,r]=y.useState(null),[u,c]=y.useState(null);y.useEffect(()=>{ct("signals?limit=7").then(f=>r(f.items??[])).catch(f=>c(String((f==null?void 0:f.message)??f)))},[]);const d=s?s.filter(f=>Date.now()-Date.parse(f.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:()=>as("/signals"),className:"font-mono text-[11px] hover:underline",style:{color:"var(--text-dim)"},children:"all signals →"}),u&&a.jsx(wu,{message:u,className:"ml-2"})]}),a.jsxs("div",{className:"rounded-lg border border-border",style:{background:"var(--surface-elev)"},children:[!u&&s===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((f,p)=>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%"}})})]},p))})]})}),!u&&s&&s.length===0&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no signals recorded"}),u&&(!s||s.length===0)&&a.jsx("p",{className:"px-4 py-3 text-xs",style:{color:"var(--text-dim)"},children:"no cached signals to display"}),s&&s.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:s.map((f,p)=>{const h=f.severity?iv[f.severity]:"transparent",x=sv[f.signal]??"var(--ink-2)",g=lv[f.signal]??f.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:wt(f.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":f.severity?`severity: ${f.severity}`:"severity: unspecified",style:{display:"inline-block",width:3,height:14,background:h,borderRadius:1,flexShrink:0},title:f.severity??""}),a.jsx("span",{className:"h-section truncate",style:{color:x,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:f.agentId})}),a.jsx("td",{className:"py-2.5 pr-4 align-middle text-[12px]",style:{color:"var(--text)",lineHeight:1.45},children:ov(rv(f.evidence??"",120))})]},`${f.timestamp}-${p}`)})})]})]})]})}const Wc=[{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 uv({overview:s}){const r=s==null?void 0:s.skillVerdictSummary,u=r?Wc.reduce((c,d)=>c+(r[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"]})]}),!r||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:Wc.map(c=>{const d=r[c.key]??0;if(d===0)return null;const f=d/u*100;return a.jsx("div",{style:{width:`${f}%`,background:c.color},title:`${c.label}: ${d}`},c.key)})}),a.jsx("ul",{className:"grid grid-cols-3 gap-x-4 gap-y-1.5 font-mono text-[11px]",children:Wc.map(c=>{const d=r[c.key]??0,f=d===0;return a.jsxs("li",{className:`flex items-center gap-1.5 ${f?"opacity-40":""}`,children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:c.color}}),a.jsx("span",{style:{color:"var(--text-dim)"},children:c.label}),a.jsx("span",{className:"ml-auto tabular-nums",style:f?{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"}:{color:c.color},children:d})]},c.key)})})]})]})}const dl=1,ai=2,dv=5;function fv({curve:s,threshold:r,stroke:u,width:c=140,height:d=30}){const f=y.useMemo(()=>hv(s),[s]),p=f.reduce((A,K)=>A+K.length,0);if(s.length===0||p<dv)return a.jsx(mv,{width:c,height:d,threshold:r});const h=c-dl*2,x=d-ai*2,g=ai+(1-pu(r))*x,v=A=>s.length<=1?dl+h/2:dl+A/(s.length-1)*h,N=A=>ai+(1-pu(A))*x;return a.jsxs("svg",{width:c,height:d,viewBox:`0 0 ${c} ${d}`,"aria-hidden":!0,style:{display:"block"},children:[a.jsx("line",{x1:dl,x2:c-dl,y1:g,y2:g,stroke:"var(--ink-4)",strokeWidth:1,strokeDasharray:"2 3",opacity:.7}),f.map((A,K)=>{if(A.length===1){const{idx:T,value:j}=A[0];return a.jsx("circle",{className:"skill-spark-curve",cx:v(T),cy:N(j),r:1.4,fill:u},K)}const O=A.map((T,j)=>`${j===0?"M":"L"} ${v(T.idx).toFixed(2)} ${N(T.value).toFixed(2)}`).join(" ");return a.jsx("path",{className:"skill-spark-curve",d:O,fill:"none",stroke:u,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},K)})]})}function mv({width:s,height:r,threshold:u}){const c=r-ai*2,d=u!==void 0?ai+(1-pu(u))*c:r/2;return a.jsx("svg",{width:s,height:r,viewBox:`0 0 ${s} ${r}`,"aria-hidden":!0,style:{display:"block"},children:a.jsx("line",{x1:dl,x2:s-dl,y1:d,y2:d,stroke:"var(--ok)",strokeWidth:1,strokeDasharray:"2 2",opacity:.4})})}function hv(s){const r=[];let u=[];for(let c=0;c<s.length;c++){const d=s[c].value;if(d==null||!Number.isFinite(d)){u.length>0&&(r.push(u),u=[]);continue}u.push({idx:c,value:d})}return u.length>0&&r.push(u),r}function pu(s){return!Number.isFinite(s)||s<0?0:s>1?1:s}const dp={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)"},pv={passed:"passed",pending:"pending",insufficient_evidence:"insufficient",inconclusive:"inconclusive",silent_skill:"silent",failed:"failed",flagged_for_manual_review:"flagged"},Eh={failed:0,flagged_for_manual_review:1,inconclusive:2,insufficient_evidence:3,passed:4,pending:5,silent_skill:6},xv="var(--ink-3)";function Cr(s){return s!=null&&s in dp}function gv({skills:s,loading:r,error:u}){const{known:c,unknown:d,total:f,transitions:p}=y.useMemo(()=>bv(s==null?void 0:s.effectiveness),[s]);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:f}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["skills · ",p," transitions /24h"]})]}),a.jsx("a",{href:ua("/"),className:"text-[11px] transition hover:underline",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:"skill detail →"}),u&&a.jsx(wu,{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."}),r&&!s&&a.jsx(yv,{}),!r&&f===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."}),f>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:c.map(h=>a.jsx(Th,{entry:h},wh(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(Th,{entry:h},wh(h)))}),a.jsx("style",{children:`
|
|
59
|
+
details[open] > summary > .chevron { transform: rotate(90deg); }
|
|
60
|
+
`})]})]})]})}function wh(s){return`${s.agentId}::${s.skill}`}function bv(s){if(!s)return{known:[],unknown:[],total:0,transitions:0};const r=[],u=[];let c=0;for(const d of s)if(Cr(d.status)?r.push(d):u.push(d),d.curve.length>=2){const f=d.curve.slice(-2),p=f.filter(x=>x.value!=null&&x.value>=d.threshold).length,h=f.filter(x=>x.value!=null&&x.value<d.threshold).length;p>=1&&h>=1&&c++}return r.sort((d,f)=>{const p=Cr(d.status)?Eh[d.status]:99,h=Cr(f.status)?Eh[f.status]:99;return p!==h?p-h:d.skill.localeCompare(f.skill)}),u.sort((d,f)=>d.skill.localeCompare(f.skill)),{known:r,unknown:u,total:r.length+u.length,transitions:c}}function Th({entry:s}){const r=Cr(s.status)?s.status:null,u=r?dp[r]:xv,c=r?pv[r]:s.status??"unknown",d=typeof s.storedEffectiveness=="number"?s.storedEffectiveness:null,f=d!==null?Math.round(d*100):null,p=s.verdictAt?vv(s.verdictAt):null,h=s.liveRecovered===!0;return a.jsxs("li",{className:"flex flex-col rounded-lg border",style:{background:"var(--surface-elev)",borderColor:"var(--border)"},title:`${s.agentId} · ${s.skill} · ${c} · N=${s.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:s.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:Cn(s.agentId)}}),a.jsx("span",{className:"truncate text-[10px]",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},children:s.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:c}),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"})]}),(f!==null||p)&&a.jsxs("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[f!==null&&a.jsxs("span",{className:"text-[10px] tabular-nums",style:{color:f<0&&(r==="failed"||r==="flagged_for_manual_review")?"var(--bad)":f>0?"var(--ok)":"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Stored effectiveness delta: ${f>0?"+":""}${f}pp (basis for this verdict)`,children:[f>0?"+":"",f,"pp"]}),f!==null&&a.jsxs("span",{className:"text-[10px]",style:{color:"var(--ink-3)",fontFamily:"Geist, var(--font-sans)"},children:["vs ",s.threshold.toFixed(2)]}),p&&a.jsx("span",{className:"text-[10px] tabular-nums",style:{color:"var(--ink-3)",fontFamily:"'JetBrains Mono', monospace"},title:`Verdict as of: ${s.verdictAt}`,children:p})]})]}),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:s.n})]})]}),a.jsx(fv,{curve:s.curve,threshold:s.threshold,stroke:Cn(s.agentId),width:120,height:28})]})]})}function vv(s){try{const r=new Date(s);if(!Number.isFinite(r.getTime()))return null;const u=new Date,c=r.getFullYear()===u.getFullYear(),d=r.toLocaleString("en-US",{month:"short"}),f=r.getDate();return c?`${d} ${f}`:`${d} ${f} '${String(r.getFullYear()).slice(-2)}`}catch{return null}}function yv(){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((s,r)=>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)"}})]})]},r))})}function Nv(s){let r=0;for(let u=0;u<s.length;u++)r=(r<<5)-r+s.charCodeAt(u)|0;return Math.abs(r)}class jv{constructor(r){Mt(this,"s");this.s=r}next(){return this.s=this.s*1103515245+12345&2147483647,this.s%1e4/1e4}range(r,u){return r+this.next()*(u-r)}}function Xt(s,r){const u=parseInt(s.slice(1,3),16),c=parseInt(s.slice(3,5),16),d=parseInt(s.slice(5,7),16);return`rgba(${u},${c},${d},${Math.max(0,Math.min(1,r))})`}function Sv(s){const r=Math.max(0,s);return Math.min(1.4,Math.pow(r/2e3,.55))}class kv{constructor(r,u,c,d,f,p,h=.5){Mt(this,"ctx");Mt(this,"size");Mt(this,"accuracy");Mt(this,"uniqueness");Mt(this,"impact");Mt(this,"colorHex");Mt(this,"time",0);Mt(this,"variant");Mt(this,"scale");Mt(this,"exp");Mt(this,"particles",[]);Mt(this,"baseRotation");Mt(this,"armSeeds");Mt(this,"binaryCenters");Mt(this,"jetAxis");Mt(this,"tailAngle");const x=r.getContext("2d");if(!x)throw new Error("Canvas 2D context unavailable");this.ctx=x,this.size=r.width/2,this.accuracy=Math.max(0,Math.min(1,d)),this.uniqueness=Math.max(0,Math.min(1,f)),this.impact=Math.max(0,Math.min(1,h)),this.colorHex=p;const g=Nv(u);this.variant=g%12;const v=new jv(g),N=Sv(c);this.exp=N,this.scale=.2+N*.95;const A=Math.max(3,Math.round(4+N*180));this._buildVariant(v,A),this.baseRotation=v.next()*Math.PI*2}_buildVariant(r,u){const c=this.variant;if(c===0){this.armSeeds=[];for(let f=0;f<2;f++)this.armSeeds.push(r.next()*Math.PI*2);for(let f=0;f<u;f++){const p=f%2,h=r.next(),x=this.armSeeds[p]+h*Math.PI*2.4,g=r.range(-.04,.04)*Math.PI*2,v=x+g,N=(.08+h*.38)*this.size*this.scale;this.particles.push(this._mkParticle(r,N,v,1,1))}}else if(c===1)for(let d=0;d<u;d++){const f=r.range(.34,.42)*this.size*this.scale,p=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,f,p,1,1))}else if(c===2){const d=[.16,.28,.42];for(let f=0;f<u;f++){const p=f%3,h=(d[p]+r.range(-.015,.015))*this.size*this.scale,x=r.next()*Math.PI*2;this.particles.push(this._mkParticle(r,h,x,1,1))}}else if(c===3){const d=.18*this.size*this.scale;this.binaryCenters=[{x:-d,y:0},{x:d,y:0}];for(let f=0;f<u;f++){const p=f%2,h=r.range(.04,.22)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,h,x,1,1);g.binaryCore=p,g.angularVelocity*=p===0?1:-1,this.particles.push(g)}}else if(c===4)for(let d=0;d<u;d++){const f=r.range(.05,.32)*this.size*this.scale,p=r.next()*Math.PI*2,h=r.range(.7,1.3),x=r.range(.7,1.3),g=this._mkParticle(r,f,p,h,x);g.orbitTilt=r.range(0,Math.PI),this.particles.push(g)}else if(c===5){this.jetAxis=r.next()*Math.PI*2;const d=Math.floor(u*.7),f=u-d;for(let p=0;p<d;p++){const h=p%2===0?1:-1,x=r.next(),g=r.range(-.18,.18),v=this._mkParticle(r,x*.44*this.size*this.scale,0,1,1);v.jetSide=h,v.jetProgress=x,v.jetSpread=g,v.jetSpeed=r.range(.15,.35)*.001,v.size=r.range(.6,1.4),this.particles.push(v)}for(let p=0;p<f;p++){const h=r.range(.35,.42)*this.size*this.scale,x=r.next()*Math.PI*2,g=this._mkParticle(r,h,x,1,1);g.isDisk=!0,g.brightness*=.35,this.particles.push(g)}}else if(c===6)for(let d=0;d<u;d++){const f=r.next()*Math.PI*2,p=r.range(.05,.45)*this.size*this.scale,h=this._mkParticle(r,p,f,1,1);h.isNebula=!0,h.driftAngle=r.next()*Math.PI*2,h.driftSpeed=r.range(6e-4,.0014),h.driftPhase=r.next()*Math.PI*2,h.size=r.range(.8,2.2),h.brightness*=.6,this.particles.push(h)}else if(c===7){this.tailAngle=r.next()*Math.PI*2;const d=.1*this.size*this.scale,f=Math.floor(u*.3);for(let h=0;h<f;h++){const x=r.range(0,d),g=r.next()*Math.PI*2,v=this._mkParticle(r,x,g,1,1);v.size=r.range(.8,1.8),this.particles.push(v)}const p=u-f;for(let h=0;h<p;h++){const x=r.next(),g=d+x*.26*this.size*this.scale,v=(1-x*.5)*r.range(-.05,.05)*this.size*this.scale,N=this._mkParticle(r,0,0,1,1);N.isComet=!0,N.cometTailDist=g,N.cometPerp=v,N.cometT=x,N.brightness*=1-x*.6,N.size=(1-x*.5)*r.range(.6,1.2),this.particles.push(N)}}else if(c===8)for(let d=0;d<u;d++){const f=d%3,p=r.range(.3,.42)*this.size*this.scale,h=r.next()*Math.PI*2,x=this._mkParticle(r,p,h,1,1);x.gyroPlane=f,x.gyroAxis=f===0?"z":f===1?"x":"y",this.particles.push(x)}else if(c===9)for(let d=0;d<u;d++){const f=r.range(.06,.42)*this.size*this.scale,h=f/(.42*this.size*this.scale)*4*Math.PI+r.range(-.2,.2),x=this._mkParticle(r,f,h,1,1);x.isMaelstrom=!0,this.particles.push(x)}else if(c===10)for(let d=0;d<u;d++){const f=d/u,p=r.range(.35,.4)*this.size*this.scale,h=f*Math.PI*2+r.range(-.03,.03),x=this._mkParticle(r,p,h,1,1);x.ouroT=f,this.particles.push(x)}else for(let d=0;d<u;d++){const f=d%2,p=r.next(),h=this._mkParticle(r,0,0,1,1);h.isHelix=!0,h.helixStrand=f,h.helixT=p,h.helixSpeed=r.range(.3,.6)*.001,this.particles.push(h)}}_mkParticle(r,u,c,d,f){const p=8e-4+(.42*this.size-u)*4e-5,h=r.next()*Math.PI*2,x=r.range(.05,.3)*this.size;return{baseRadius:u,angle:c,angularVelocity:p*(r.next()>.5?1:.85),size:r.range(.5,1.8),brightness:r.range(.4,1),wobblePhase:r.next()*Math.PI*2,wobbleSpeed:r.range(.5,1.2),ellipX:d,ellipY:f,orbitTilt:0,binaryCore:0,chaosX:Math.cos(h)*x,chaosY:Math.sin(h)*x,chaosDriftPhase:r.next()*Math.PI*2,chaosDriftSpeed:r.range(3e-4,8e-4)}}update(r){this.time+=r}draw(){const{ctx:r,size:u,time:c,accuracy:d,uniqueness:f,impact:p,colorHex:h,variant:x}=this,g=u/2,v=u/2;r.clearRect(0,0,u,u);const N=.4+this.exp*.6,A=d*N,K=f*N,O=p*N,T=.2+A*.8,j=.3+O*1.9,L=K,B=Math.min(1,Math.max(0,(this.exp-.15)*1.8)),P=1-B,V=r.createRadialGradient(g,v,0,g,v,u*.45);if(V.addColorStop(0,Xt(h,.05*T)),V.addColorStop(.4,Xt(h,.015)),V.addColorStop(1,"transparent"),r.fillStyle=V,r.fillRect(0,0,u,u),x===0&&this.armSeeds){const M=c*5e-4*j;for(const R of this.armSeeds){const _=R+M;r.beginPath();for(let Q=0;Q<1;Q+=.02){const F=_+Q*Math.PI*2.4,G=(.08+Q*.38)*u*this.scale,ue=g+Math.cos(F)*G,ae=v+Math.sin(F)*G;Q===0?r.moveTo(ue,ae):r.lineTo(ue,ae)}r.strokeStyle=Xt(h,.12*T),r.lineWidth=1,r.stroke()}}for(const M of this.particles){const R=Math.sin(c*M.wobbleSpeed*.001+M.wobblePhase)*1.2,_=M.baseRadius+R,Q=M.angle+c*M.angularVelocity*j;let F,G;if(x===3&&this.binaryCenters){const ae=this.binaryCenters[M.binaryCore];F=g+ae.x+Math.cos(Q)*_,G=v+ae.y+Math.sin(Q)*_}else if(x===4){const ae=Math.cos(M.orbitTilt),oe=Math.sin(M.orbitTilt),pe=Math.cos(Q)*_*M.ellipX,D=Math.sin(Q)*_*M.ellipY;F=g+pe*ae-D*oe,G=v+pe*oe+D*ae}else if(x===5&&M.jetSide!==void 0&&!M.isDisk&&this.jetAxis!==void 0){const ae=(M.jetProgress+c*M.jetSpeed*j)%1,oe=ae*.44*u*this.scale,pe=this.jetAxis+Math.PI/2;F=g+Math.cos(this.jetAxis)*oe*M.jetSide+Math.cos(pe)*M.jetSpread*oe,G=v+Math.sin(this.jetAxis)*oe*M.jetSide+Math.sin(pe)*M.jetSpread*oe,M._fadeMul=Math.sin(ae*Math.PI)*.9+.1}else if(x===6&&M.isNebula){const ae=c*M.driftSpeed*j,oe=Math.sin(ae+M.driftPhase)*2;F=g+Math.cos(M.angle+ae*.3)*_+Math.cos(M.driftAngle)*oe,G=v+Math.sin(M.angle+ae*.3)*_+Math.sin(M.driftAngle)*oe}else if(x===7&&M.isComet&&this.tailAngle!==void 0){const ae=(M.cometT+c*3e-4*j)%1,oe=M.cometTailDist+ae*.06*u*this.scale,pe=this.tailAngle+Math.PI/2;F=g+Math.cos(this.tailAngle)*oe+Math.cos(pe)*M.cometPerp,G=v+Math.sin(this.tailAngle)*oe+Math.sin(pe)*M.cometPerp}else if(x===8&&M.gyroAxis){const ae=c*1e-4*j;M.gyroAxis==="z"?(F=g+Math.cos(Q)*_,G=v+Math.sin(Q)*_*.3):M.gyroAxis==="x"?(F=g+Math.cos(Q)*_*.3+Math.sin(ae)*_*.1,G=v+Math.sin(Q)*_):(F=g+Math.sin(Q+ae)*_*.6,G=v+Math.cos(Q+ae)*_*.8)}else if(x===9){const ae=(c*5e-4*j+M.wobblePhase)%1,oe=_*(1-ae*.85);F=g+Math.cos(Q)*oe,G=v+Math.sin(Q)*oe,M._fadeMul=1-ae}else if(x===10&&M.ouroT!==void 0){const ae=(M.ouroT+c*3e-4*j)%1,oe=ae*Math.PI*2;F=g+Math.cos(oe)*_,G=v+Math.sin(oe)*_;const pe=Math.cos(ae*Math.PI*2)*.5+.5;M._fadeMul=.3+pe*.9}else if(x===11&&M.helixT!==void 0){const ae=(M.helixT+c*M.helixSpeed*j)%1,oe=(ae-.5)*.65*u*this.scale,pe=M.helixStrand===0?0:Math.PI,D=.15*u*this.scale,w=Math.sin(ae*Math.PI*3+pe)*D;F=g+w,G=v+oe,M._fadeMul=.4+(Math.cos(ae*Math.PI*3+pe)+1)/2*.6}else F=g+Math.cos(Q)*_*M.ellipX,G=v+Math.sin(Q)*_*M.ellipY;if(P>.01){const ae=c*M.chaosDriftSpeed,oe=Math.cos(ae+M.chaosDriftPhase)*2,pe=Math.sin(ae*1.13+M.chaosDriftPhase)*2,D=g+M.chaosX+oe,w=v+M.chaosY+pe;F=D*P+F*B,G=w*P+G*B}const ue=M._fadeMul!==void 0?M._fadeMul:1;if(x<=4&&B>.5){const ae=2+Math.floor(p*3);for(let oe=0;oe<ae;oe++){const pe=M.angularVelocity*j*(oe+1)*80,D=Q-pe;let w,I;if(x===3&&this.binaryCenters){const le=this.binaryCenters[M.binaryCore];w=g+le.x+Math.cos(D)*_,I=v+le.y+Math.sin(D)*_}else if(x===4){const le=Math.cos(M.orbitTilt),de=Math.sin(M.orbitTilt),S=Math.cos(D)*_*M.ellipX,U=Math.sin(D)*_*M.ellipY;w=g+S*le-U*de,I=v+S*de+U*le}else w=g+Math.cos(D)*_*M.ellipX,I=v+Math.sin(D)*_*M.ellipY;const ne=(1-oe/ae)*.3*M.brightness*T*B;r.beginPath(),r.arc(w,I,M.size*(1-oe*.25),0,Math.PI*2),r.fillStyle=Xt(h,ne),r.fill()}}else if(x===6&&M.isNebula){const ae=M.size*3,oe=r.createRadialGradient(F,G,0,F,G,ae);oe.addColorStop(0,Xt(h,M.brightness*T*.4)),oe.addColorStop(1,"transparent"),r.fillStyle=oe,r.beginPath(),r.arc(F,G,ae,0,Math.PI*2),r.fill()}r.beginPath(),r.arc(F,G,M.size,0,Math.PI*2),r.fillStyle=Xt(h,M.brightness*T*ue),r.fill()}if(L>.05)for(let R=0;R<3;R++){const _=(c*7e-4*L+R*.33)%1;if(_>.5)continue;const Q=(R*1.618*Math.PI+c*1e-4)%(Math.PI*2),F=u*.5*(1-_*1.6);if(F<3)continue;const G=g+Math.cos(Q)*F,ue=v+Math.sin(Q)*F,ae=_<.2?_/.2:1-(_-.2)/.3,oe=5+(1-_)*4,pe=r.createRadialGradient(G,ue,0,G,ue,oe);pe.addColorStop(0,Xt("#ffffff",ae*.95)),pe.addColorStop(.3,Xt(h,ae*.7)),pe.addColorStop(1,"transparent"),r.fillStyle=pe,r.beginPath(),r.arc(G,ue,oe,0,Math.PI*2),r.fill()}if(x!==3){const M=.9+.1*Math.sin(c*.003),R=(1+this.exp*9+d*2)*this.scale,_=Math.min(R*(3+p*2),u*.4),Q=r.createRadialGradient(g,v,0,g,v,_);Q.addColorStop(0,Xt("#ffffff",.95*M*T)),Q.addColorStop(.2,Xt(h,.75*M*T)),Q.addColorStop(.5,Xt(h,.2*T)),Q.addColorStop(1,"transparent"),r.fillStyle=Q,r.beginPath(),r.arc(g,v,_,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(g,v,R*M,0,Math.PI*2),r.fillStyle=Xt("#ffffff",.95),r.fill()}else if(this.binaryCenters)for(const M of this.binaryCenters){const R=g+M.x,_=v+M.y,Q=(.8+this.exp*5+d*1.5)*this.scale,F=Math.min(Q*3.5,u*.22),G=r.createRadialGradient(R,_,0,R,_,F);G.addColorStop(0,Xt("#ffffff",.9*T)),G.addColorStop(.3,Xt(h,.6*T)),G.addColorStop(1,"transparent"),r.fillStyle=G,r.beginPath(),r.arc(R,_,F,0,Math.PI*2),r.fill(),r.beginPath(),r.arc(R,_,Q,0,Math.PI*2),r.fillStyle=Xt("#ffffff",.9),r.fill()}}}const pl=globalThis,es=new Set;let hl=0,ts=0;const _v=100;function fp(s){const r=ts===0?16:Math.min(_v,Math.max(0,s-ts));ts=s;for(const u of es)try{u(r)}catch(c){console.error("[AnimationScheduler] subscriber threw, continuing",c)}es.size>0?hl=pl.requestAnimationFrame(fp):(hl=0,ts=0)}function Ev(){hl===0&&(ts=0,hl=pl.requestAnimationFrame(fp))}function wv(){hl!==0&&(pl.cancelAnimationFrame&&pl.cancelAnimationFrame(hl),hl=0,ts=0)}function Tv(){return pl.matchMedia?pl.matchMedia("(prefers-reduced-motion: reduce)").matches:!1}function mp(s){if(!pl.requestAnimationFrame)return()=>{};if(Tv())return()=>{};es.add(s),es.size===1&&Ev();let r=!1;return function(){r||(r=!0,es.delete(s),es.size===0&&wv())}}function ri({agentId:s,size:r=64,animate:u=!0,signals:c=0,accuracy:d=.5,uniqueness:f=.5,impact:p=.5}){const h=y.useRef(null),x=y.useRef(null),g=y.useRef(!0),v=y.useRef(u);return v.current=u,y.useEffect(()=>{const N=h.current;if(!N)return;N.width=r*2,N.height=r*2;const A=N.getContext("2d");if(!A)return;A.scale(2,2);const K=Cn(s),O=new kv(N,s,c,d,f,K,p);x.current=O,O.draw();const T=mp(j=>{g.current&&v.current&&(O.update(j),O.draw())});return()=>{T(),x.current=null}},[s,r,c,d,f,p]),y.useEffect(()=>{const N=h.current;if(!N)return;const A=new IntersectionObserver(([K])=>{g.current=K.isIntersecting},{threshold:.1});return A.observe(N),()=>A.disconnect()},[]),a.jsx("canvas",{ref:h,"aria-hidden":"true",className:"shrink-0",style:{width:r,height:r,borderRadius:"50%"}})}function Av(s){return s.hallucinationsCaught>0?"catch":s.disputed>0?"mixed":s.confirmed>0?"trust":null}function Mv(s){return Math.max(1,Math.min(2.5,1+s*.15))}function si(s,r){return s<=r?`${s}::${r}`:`${r}::${s}`}const Cv=new Set(["agreement","unique_confirmed","impl_peer_approved"]),Rv=new Set(["disagreement","impl_peer_rejected"]),Ov=new Set(["hallucination_caught"]);function Dv(s){const r=new Map,u=new Map;for(const c of s)if(!c.retracted)for(const d of c.signals){if(!d.counterpartId||!d.agentId)continue;const f=Cv.has(d.signal),p=Rv.has(d.signal),h=Ov.has(d.signal);if(!f&&!p&&!h)continue;const x=si(d.agentId,d.counterpartId);let g=r.get(x);g||(g={rounds:0,confirmed:0,disputed:0,hallucinationsCaught:0,lastInteraction:c.timestamp},r.set(x,g)),f&&(g.confirmed+=1),p&&(g.disputed+=1),h&&(g.hallucinationsCaught+=1);let v=u.get(x);v||(v=new Set,u.set(x,v)),v.has(c.taskId)||(v.add(c.taskId),g.rounds+=1),c.timestamp>g.lastInteraction&&(g.lastInteraction=c.timestamp)}return r}function Rr(s){return s>=2e3?84:s>=800?72:s>=200?60:48}function zv(s,r,u){var v;const c={x:r/2,y:u/2},f=Math.max(80,Math.min(r,u)/2-24),p=new Map;if(s.length===0)return p;const h=[...s].sort((N,A)=>{var T,j;const K=((T=A.scores)==null?void 0:T.accuracy)??0,O=((j=N.scores)==null?void 0:j.accuracy)??0;return K!==O?O-K:N.id.localeCompare(A.id)}),x=h.length,g=Math.PI*(3-Math.sqrt(5));for(let N=0;N<x;N++){const A=h[N],K=Lv(((v=A.scores)==null?void 0:v.accuracy)??0,0,1),O=Math.max(f*.22,(1-K)*f),T=-Math.PI/2+N*g;p.set(A.id,{x:c.x+O*Math.cos(T),y:c.y+O*Math.sin(T),role:"fleet",angle:T})}return p}function Lv(s,r,u){return Math.min(Math.max(s,r),u)}function Ah(s){let r=s>>>0;return()=>{r=r+1831565813>>>0;let u=r;return u=Math.imul(u^u>>>15,u|1),u^=u+Math.imul(u^u>>>7,u|61),((u^u>>>14)>>>0)/4294967296}}function Bv({width:s,height:r,agentPositions:u}){const c=y.useRef(null),d=y.useRef([]),f=y.useRef([]);y.useEffect(()=>{if(s<=0||r<=0)return;const h=Ah(7311),x=170;d.current=Array.from({length:x},()=>{const g=h();let v,N;return g<.07?(v=2+h()*.6,N=.75+h()*.25):g<.32?(v=1.2+h()*.4,N=.45+h()*.35):(v=.5+h()*.4,N=.25+h()*.3),{x:h()*s,y:h()*r,baseR:v,r:v,baseO:N,o:N,consumed:null,phase:h()*Math.PI*2,twinkleHz:.25+h()*1.4}})},[s,r]),y.useEffect(()=>{if(s<=0||r<=0)return;const h=Ah(919),x=60,g=90,v=1.5,N=1.8;let A=0;const O=mp(T=>{const j=T/1e3;A+=j;const L=d.current,B=f.current;for(let P=0;P<L.length;P++){const V=L[P];if(V.consumed===null)for(let R=0;R<u.length;R++){const _=u[R].x-V.x,Q=u[R].y-V.y;if(_*_+Q*Q<x*x){V.consumed=R;break}}if(V.consumed===null){const R=.8+.35*Math.sin(A*V.twinkleHz*Math.PI*2+V.phase);V.o=Math.min(1,V.baseO*R)}if(V.consumed!==null){const R=u[V.consumed];if(R){const _=R.x-V.x,Q=R.y-V.y,F=Math.sqrt(_*_+Q*Q)||1,G=Math.min(F,g*j);V.x+=_/F*G,V.y+=Q/F*G,V.o=Math.max(0,V.o-v*j),V.r=Math.max(0,V.r-N*j)}if(V.o<=.01||V.r<=.1){let _=0,Q=0,F=!1;for(let G=0;G<8;G++){_=h()*s,Q=h()*r,F=!0;for(const ue of u){const ae=ue.x-_,oe=ue.y-Q;if(ae*ae+oe*oe<x*x*1.5){F=!1;break}}if(F)break}V.x=_,V.y=Q,V.r=V.baseR,V.o=V.baseO,V.consumed=null}}const M=B[P];M&&(M.setAttribute("cx",String(V.x)),M.setAttribute("cy",String(V.y)),M.setAttribute("r",String(V.r)),M.setAttribute("opacity",String(V.o)))}});return()=>O()},[s,r,u]);const p=d.current;return a.jsx("svg",{ref:c,width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:p.map((h,x)=>a.jsx("circle",{ref:g=>{f.current[x]=g},cx:h.x,cy:h.y,r:h.r,fill:"#F2EDE3",opacity:h.o},x))})}function Uv({variant:s}){const r=(()=>{switch(s){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:r})}function $v(){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 qv({width:s,height:r,hideLabels:u=!1}){const c=s/2,d=r/2,p=Math.max(80,Math.min(s,r)/2-40),h=[{r:p,accLabel:"0%"},{r:p*.75,accLabel:"25%"},{r:p*.5,accLabel:"50%"},{r:p*.25,accLabel:"75%"}];return a.jsx("svg",{width:"100%",height:r,style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":!0,children:h.map(({r:x,accLabel:g})=>a.jsxs("g",{children:[a.jsx("circle",{cx:c,cy:d,r:x,fill:"none",stroke:"var(--border-strong)",strokeDasharray:"2 4",opacity:.5}),!u&&a.jsx("text",{x:c+6,y:d-x-4,fontFamily:"var(--font-mono)",fontSize:"9",fill:"var(--ink-3)",letterSpacing:"0.06em",children:g})]},g))})}function Hv(s,r,u,c,d){const f={x:c/2,y:d/2},p=new Map;p.set(s,{x:f.x,y:f.y,role:"center"});const h=[];for(const K of r){if(K===s)continue;const O=u.get(si(s,K));O&&h.push({id:K,rel:O})}const x=Math.max(1,...h.map(K=>K.rel.rounds)),g=Math.max(120,Math.min(c,d)*.2),v=Math.min(c,d)*.42,N=h.slice().sort((K,O)=>K.id.localeCompare(O.id)),A=N.length;for(let K=0;K<A;K++){const{id:O,rel:T}=N[K],j=K/Math.max(1,A)*Math.PI*2-Math.PI/2,L=T.rounds/x,B=v-L*(v-g);p.set(O,{x:f.x+B*Math.cos(j),y:f.y+B*Math.sin(j),role:"peer"})}for(const K of r)p.has(K)||p.set(K,{x:f.x,y:f.y,role:"hidden"});return p}function Iv({agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:c,height:d=420}){if(s.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(s.length===1){const f=s[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(ri,{agentId:f.id,signals:f.scores.signals,accuracy:f.scores.accuracy,uniqueness:f.scores.uniqueness,impact:f.scores.impactScore,size:Rr(f.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(Gv,{agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:c,height:d})}function Gv({agents:s,peerRelationships:r,selectedAgentId:u,onSelectAgent:c,height:d=420}){const f=y.useRef(null),[p,h]=y.useState(800),[x,g]=y.useState(d),[v,N]=y.useState(0);y.useEffect(()=>{const j=f.current;if(!j)return;const L=new ResizeObserver(([B])=>{const P=B.contentRect.width,V=B.contentRect.height;P>0&&h(P),V>0&&g(V)});return L.observe(j),()=>L.disconnect()},[]);const A=y.useMemo(()=>{const j=s.map(L=>L.id);return u&&j.includes(u)?Hv(u,j,r,p,x):zv(s,p,x)},[s,r,u,p,x]),K=y.useMemo(()=>{if(!u)return[];const j=A.get(u);if(!j)return[];const L=[];for(const P of s){if(P.id===u)continue;const V=A.get(P.id);if(!V||V.role!=="peer")continue;const M=r.get(si(u,P.id));if(!M)continue;const R=Av(M);R&&L.push({peerId:P.id,x1:j.x,y1:j.y,x2:V.x,y2:V.y,cls:R,width:Mv(M.rounds),rounds:M.rounds})}const B={mixed:0,trust:1,catch:2};return L.sort((P,V)=>B[P.cls]-B[V.cls]),L},[s,r,u,A]),O=u?K.length:0,T=y.useMemo(()=>{const j=[];for(const L of s){const B=A.get(L.id);B&&j.push({x:B.x,y:B.y})}return j},[s,A]);return a.jsxs("div",{ref:f,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:()=>c(null),children:[a.jsx(Bv,{width:p,height:x,agentPositions:T}),a.jsx(qv,{width:p,height:x,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:O}),a.jsxs("span",{style:{opacity:.7},children:["peer",O===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:s.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:x,style:{position:"absolute",inset:0,pointerEvents:"none"},children:K.map(j=>{const L=s.find(w=>w.id===u),B=s.find(w=>w.id===j.peerId);if(!L||!B)return null;const P=Rr(L.scores.signals)/2,V=Rr(B.scores.signals)/2,M=j.x2-j.x1,R=j.y2-j.y1,_=Math.max(1,Math.hypot(M,R)),Q=M/_,F=R/_,G=j.x1+Q*P,ue=j.y1+F*P,ae=j.x2-Q*V,oe=j.y2-F*V,pe=j.cls==="trust"?"var(--success)":j.cls==="mixed"?"var(--warn)":"var(--danger)",D=j.cls==="mixed"?"8,2":void 0;return a.jsx("line",{x1:G,y1:ue,x2:ae,y2:oe,stroke:pe,strokeWidth:j.width,strokeDasharray:D,strokeLinecap:"round",style:{opacity:.55,transition:"opacity 200ms cubic-bezier(0.4,0,0.2,1)"}},j.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(Pc,{stroke:"var(--success)",label:"Trust"}),a.jsx(Pc,{stroke:"var(--warn)",label:"Mixed",dash:"8,2"}),a.jsx(Pc,{stroke:"var(--danger)",label:"Caught"})]}),!u&&x>0&&a.jsxs("div",{className:"absolute z-[1] -translate-x-1/2 -translate-y-1/2",style:{left:p/2,top:x/2,cursor:"pointer"},onClick:j=>{j.stopPropagation(),N(L=>L+1)},title:v>=10?"♥":v>=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"})]}),v>0&&a.jsx(Uv,{variant:(v-1)%4},v),v>0&&a.jsx($v,{},`ripple-${v}`),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:v>=10?"var(--accent)":"var(--stage-text-dim)",whiteSpace:"nowrap",opacity:.7,pointerEvents:"none",transition:"color 400ms ease-out"},children:v>=10?"♥ orchestrator ♥":"orchestrator"})]}),s.map(j=>{const L=A.get(j.id);if(!L)return null;const B=Rr(j.scores.signals),P=L.role==="center",V=L.role==="hidden",M=L.role==="peer",R=V?0:1,_=P?"#F2EDE3":"var(--stage-text-dim)",Q=L.angle??Math.PI/2,F=B/2+14,G=Math.cos(Q)*F,ue=Math.sin(Q)*F,ae=Math.abs(Math.cos(Q))>.7?Math.cos(Q)>0?"left":"right":"center";return a.jsxs("button",{type:"button",onClick:oe=>{oe.stopPropagation(),c(j.id)},className:"absolute -translate-x-1/2 -translate-y-1/2",style:{left:L.x,top:L.y,opacity:R,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 ${j.id}`,title:j.id,children:[a.jsx("div",{className:"rounded-full",style:{width:B,height:B,boxShadow:P?"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(ri,{agentId:j.id,signals:j.scores.signals,accuracy:j.scores.accuracy,uniqueness:j.scores.uniqueness,impact:j.scores.impactScore,size:B})}),a.jsx("div",{className:"absolute font-mono text-[10px] font-bold tracking-wider",style:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${G}px), calc(-50% + ${ue}px))${ae==="left"?" translateX(calc(50% + 4px))":ae==="right"?" translateX(calc(-50% - 4px))":""}`,color:_,textAlign:ae==="right"?"right":ae==="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:j.id}),M&&a.jsx("div",{className:"font-mono text-[9px]",style:{color:"var(--stage-text-dim)",textAlign:"center",whiteSpace:"nowrap",marginTop:2},children:(()=>{const oe=r.get(si(u??"",j.id));return oe?`${oe.rounds} round${oe.rounds===1?"":"s"}`:""})()})]},j.id)})]})}function Pc({stroke:s,label:r,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:s,strokeWidth:"1.5",strokeDasharray:u})}),a.jsx("span",{children:r})]})}function Mh(s){const r=new URLSearchParams(s).get("agent");return r&&r.length>0?r:null}function Yv(s,r,u){const c=new URLSearchParams(r);u===null?c.delete("agent"):c.set("agent",u);const d=c.toString();return d.length>0?`${s}?${d}`:s}function hp(s){const r=globalThis;if(typeof r.window>"u")return;const u=r.window,c=Yv(u.location.pathname,u.location.search,s);c!==u.location.pathname+u.location.search&&(u.history.pushState({},"",c),u.dispatchEvent(new Event("dashboard:navigate")))}function Xv({selectedAgent:s,agents:r,peerRelationships:u,height:c=420}){return a.jsx("aside",{className:"flex-shrink-0 overflow-y-auto rounded-lg border",style:{width:320,minHeight:c,background:"var(--surface-elev)",borderColor:"var(--border)"},"aria-label":s?`Agent detail: ${s.id}`:"Fleet summary",children:s?a.jsx(Qv,{agent:s,peerRelationships:u,agents:r}):a.jsx(Kv,{agents:r,peerRelationships:u})})}function Kv({agents:s,peerRelationships:r}){const u=[...s].filter(f=>f.scores.signals>0).sort((f,p)=>p.scores.accuracy-f.scores.accuracy).slice(0,3),c=[];for(const[f,p]of r.entries())if(p.hallucinationsCaught>0){const[h,x]=f.split("::");c.push({pair:[h,x],catches:p.hallucinationsCaught,ts:p.lastInteraction})}c.sort((f,p)=>new Date(p.ts).getTime()-new Date(f.ts).getTime());const d=c.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(Ch,{label:"Top performers",tone:"success",children:u.length===0?a.jsx(xu,{text:"No agent has logged a signal yet."}):u.map(f=>a.jsxs("button",{type:"button",onClick:()=>hp(f.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:f.id}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[Math.round(f.scores.accuracy*100),"% accuracy · ",f.scores.signals," signals"]})]}),a.jsx("span",{className:"opacity-0 transition group-hover:opacity-100 font-mono text-[11px]",style:{color:"var(--accent)"},children:"→"})]},f.id))}),a.jsx(Ch,{label:"Recent hallucination catches",tone:"danger",children:d.length===0?a.jsx(xu,{text:"No catches in the active window."}):d.map(f=>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:"◆"})," ",f.pair[0]," ↔ ",f.pair[1]]}),a.jsxs("div",{className:"mt-0.5 font-mono text-[11px]",style:{color:"var(--ink-3)"},children:[f.catches," caught · ",Vv(f.ts)]})]},`${f.pair[0]}::${f.pair[1]}`))})]})}function Ch({label:s,tone:r,children:u}){const c=r==="success"?"var(--success)":r==="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:c,display:"inline-block",flexShrink:0}}),s]}),a.jsx("div",{className:"space-y-1",children:u})]})}function xu({text:s}){return a.jsx("div",{className:"px-2 py-1.5 font-mono text-[11px]",style:{color:"var(--ink-4)"},children:s})}function Vv(s){const r=new Date(s).getTime(),u=Date.now(),c=Math.max(0,Math.floor((u-r)/1e3));return c<60?`${c}s ago`:c<3600?`${Math.floor(c/60)}m ago`:c<86400?`${Math.floor(c/3600)}h ago`:`${Math.floor(c/86400)}d ago`}function Qv({agent:s,peerRelationships:r,agents:u}){const c=s.scores.bench.state==="benched"?{label:"BENCHED",color:"var(--danger)"}:s.native?{label:"READY",color:"var(--success)"}:s.online?{label:"ONLINE",color:"var(--success)"}:{label:"OFFLINE",color:"var(--ink-3)"},d=[];for(const p of u){if(p.id===s.id)continue;const h=r.get(si(s.id,p.id));if(!h)continue;const x=h.confirmed+h.disputed+h.hallucinationsCaught;d.push({other:p.id,rel:h,total:x})}d.sort((p,h)=>h.total-p.total);const f=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:c.color,borderBottom:"1px solid var(--border)",background:`color-mix(in oklch, ${c.color} 6%, transparent)`},children:[a.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:c.color,display:"inline-block"}}),c.label]}),a.jsxs("div",{className:"flex items-center gap-3 px-4 pt-4",children:[a.jsx(ri,{agentId:s.id,signals:s.scores.signals,accuracy:s.scores.accuracy,uniqueness:s.scores.uniqueness,impact:s.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:s.id}),a.jsx("div",{className:"truncate font-mono text-[11px]",style:{color:"var(--ink-3)"},children:s.model})]})]}),a.jsxs("div",{className:"mx-4 mt-4 grid grid-cols-2 gap-2",children:[a.jsx(Er,{label:"Accuracy",value:`${Math.round(s.scores.accuracy*100)}%`}),a.jsx(Er,{label:"Reliability",value:s.scores.taskCompletionRate==null?"—":`${Math.round(s.scores.taskCompletionRate*100)}%`}),a.jsx(Er,{label:"Signals",value:s.scores.signals.toLocaleString()}),a.jsx(Er,{label:"Impact",value:`${Math.round(s.scores.impactScore*100)}%`})]}),a.jsxs("div",{className:"mt-4 px-4",children:[a.jsx("div",{className:"mb-1.5 h-section",children:"Top peers"}),f.length===0?a.jsx(xu,{text:"No cross-review history yet."}):a.jsx("div",{className:"space-y-1",children:f.map(({other:p,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:p}),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"]})]})]},p))})]}),s.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:s.skills.length})]}),a.jsx("div",{className:"flex flex-wrap gap-1",children:s.skills.slice(0,6).map(p=>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:p},p))})]}),a.jsxs("div",{className:"mt-auto flex flex-col gap-1.5 border-t p-3",style:{borderColor:"var(--border)"},children:[a.jsx(eu,{label:"Open dispatch log",kbd:"⏎",href:`/agent/${encodeURIComponent(s.id)}`}),a.jsx(eu,{label:"View skill graph",kbd:"G",href:`/agent/${encodeURIComponent(s.id)}#skills`,disabled:s.skills.length===0}),a.jsx(eu,{label:"Dispatch consensus",kbd:"⌘D",href:"#",disabled:!0})]})]})}function Er({label:s,value:r}){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:s}),a.jsx("div",{className:"mt-0.5 font-mono text-[16px] font-medium tabular-nums",style:{color:"var(--text)"},children:r})]})}function eu({label:s,kbd:r,href:u,disabled:c}){return a.jsxs("a",{href:c?void 0:`/dashboard${u}`,"aria-disabled":c,tabIndex:c?-1:void 0,className:"flex items-center justify-between rounded px-2 py-2 font-mono text-[12px] transition",style:{background:c?"transparent":"color-mix(in oklch, var(--surface) 50%, transparent)",color:c?"var(--ink-4)":"var(--text)",pointerEvents:c?"none":"auto",opacity:c?.5:1},children:[a.jsx("span",{children:s}),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:r})]})}let En=null,wr=3e3,tu=null;const gu=new Set;function pp(){if((En==null?void 0:En.readyState)===WebSocket.OPEN||(En==null?void 0:En.readyState)===WebSocket.CONNECTING)return;const s=location.protocol==="https:"?"wss:":"ws:";En=new WebSocket(`${s}//${location.host}/dashboard/ws`),En.onopen=()=>{wr=3e3},En.onmessage=r=>{try{const u=JSON.parse(r.data);gu.forEach(c=>c(u))}catch{}},En.onclose=()=>{En=null,tu&&clearTimeout(tu),tu=setTimeout(()=>{wr=Math.min(wr*1.5,3e4),pp()},wr)},En.onerror=()=>{}}function xp(s){return gu.add(s),()=>gu.delete(s)}function gp(s){const r=y.useRef(s);r.current=s,y.useEffect(()=>(pp(),xp(u=>r.current(u))),[])}const Zv=6e4;function Fv(){const[s,r]=y.useState(null),[u,c]=y.useState(null),d=y.useRef(null),f=()=>{r(null),c(null),d.current!=null&&(window.clearTimeout(d.current),d.current=null)};if(gp(h=>{if(h.type==="task_dispatched"){r(h.taskId),c(h.agentId),d.current!=null&&window.clearTimeout(d.current),d.current=window.setTimeout(f,Zv);return}if(h.type==="consensus_complete"||h.type==="task_completed"||h.type==="task_failed"){if(h.taskId!==s)return;f()}}),y.useEffect(()=>()=>f(),[]),s===null)return null;const p=s.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:p}),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 ml=24,Jv={"1h":36e5,"24h":24*36e5,"7d":168*36e5,"30d":720*36e5};function bp(s){return Jv[s]}function Wv(s,r,u){const c=bp(r),d=c/ml,f=u-c,p=new Array(ml).fill(0);for(const h of s){const x=new Date(h).getTime();if(!Number.isFinite(x)||x<f||x>u)continue;const g=x-f;let v=Math.floor(g/d);v>=ml&&(v=ml-1),p[v]+=1}return p}const Pv=["1h","24h","7d","30d"],ey={"1h":"1h ago","24h":"24h ago","7d":"7d ago","30d":"30d ago"};function ty({runs:s,range:r,onRangeChange:u,height:c=52}){const[d,f]=y.useState(()=>Date.now());y.useEffect(()=>{const x=bp(r)/ml,g=window.setInterval(()=>f(Date.now()),x);return()=>window.clearInterval(g)},[r]);const p=y.useMemo(()=>{var g;const x=[];for(const v of s){const N=((g=v.signals)==null?void 0:g.length)??0;for(let A=0;A<N;A++)x.push(v.timestamp)}return Wv(x,r,d)},[s,r,d]),h=Math.max(1,...p);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:Pv.map(x=>{const g=x===r;return a.jsx("button",{type:"button",onClick:()=>u(x),"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:x},x)})})]}),a.jsxs("svg",{viewBox:`0 0 ${ml} 1`,preserveAspectRatio:"none",style:{width:"100%",height:c,color:"var(--c1)",display:"block"},children:[a.jsx("rect",{x:0,y:.985,width:ml,height:.015,fill:"var(--ink)",opacity:.08}),p.map((x,g)=>{const v=x===0?0:x/h,N=1-v;return a.jsx("rect",{x:g+.15,y:N,width:.7,height:Math.max(v,x>0?.04:0),rx:.06,ry:.06,fill:"currentColor",opacity:x===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:ey[r]}),a.jsx("span",{children:"now"})]})]})}function ny(s){const r=[];for(const[u,c]of s.entries())r.push(`${u}:${c.rounds}:${c.confirmed}:${c.disputed}:${c.hallucinationsCaught}`);return r.sort(),r.join("|")}function ay(s){const r=y.useRef(""),u=y.useRef(new Map);return y.useMemo(()=>{const c=Dv(s??[]),d=ny(c);return d===r.current?u.current:(r.current=d,u.current=c,c)},[s])}function ly(s){const r=[];for(const[u,c]of s.entries())r.push(`${u}:${c.critical}:${c.high}:${c.medium}:${c.low}`);return r.sort(),r.join("|")}function vp(s){const r=y.useRef(""),u=y.useRef(new Map);return y.useMemo(()=>{const c=new Map;if(s)for(const f of s){const p=[...f.confirmed??[],...f.disputed??[],...f.unique??[],...f.unverified??[]];for(const h of p){const x=h.originalAgentId;if(!x)continue;const g=c.get(x)??{critical:0,high:0,medium:0,low:0},v=h.severity??"low";v==="critical"?g.critical+=1:v==="high"?g.high+=1:v==="medium"?g.medium+=1:g.low+=1,c.set(x,g)}}const d=ly(c);return d===r.current?u.current:(r.current=d,u.current=c,c)},[s])}function sy(){const[s,r]=y.useState(()=>typeof window>"u"?null:Mh(window.location.search));return y.useEffect(()=>{const u=()=>{const c=typeof window>"u"?null:Mh(window.location.search);r(d=>d===c?d:c)};return window.addEventListener("dashboard:navigate",u),()=>{window.removeEventListener("dashboard:navigate",u)}},[]),[s,hp]}const iy=["1h","24h","7d","30d"];function ry(s){return typeof s=="string"&&iy.includes(s)}function nu(s){const r=new URLSearchParams(s).get("range");return ry(r)?r:null}function oy(s,r,u){const c=new URLSearchParams(r);u===null?c.delete("range"):c.set("range",u);const d=c.toString();return d.length>0?`${s}?${d}`:s}function Rh(s){const r=globalThis;if(!r.window)return;const u=r.window,c=oy(u.location.pathname,u.location.search,s);c!==u.location.pathname+u.location.search&&(u.history.pushState({},"",c),u.dispatchEvent(new Event("dashboard:navigate")))}function cy(){const[s,r]=y.useState(()=>typeof window>"u"?"7d":nu(window.location.search)??"7d");return y.useEffect(()=>{typeof window<"u"&&nu(window.location.search)===null&&Rh(s);const u=()=>{const c=typeof window>"u"?"7d":nu(window.location.search)??"7d";r(d=>d===c?d:c)};return window.addEventListener("dashboard:navigate",u),()=>window.removeEventListener("dashboard:navigate",u)},[]),[s,Rh]}const uy=new Set(["textbox","combobox","listbox","spinbutton","searchbox"]);function dy(s){if(!(s instanceof Element))return!1;const r=s.tagName;if(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||s.isContentEditable===!0)return!0;const u=s.getAttribute("role");return u!==null&&uy.has(u)}function fy(s){y.useEffect(()=>{if(!s)return;function r(u){dy(u.target)||(u.metaKey||u.ctrlKey)&&(u.key==="d"||u.key==="D")||u.metaKey||u.ctrlKey||u.altKey||(u.key==="Enter"?(u.preventDefault(),as("/agent/"+encodeURIComponent(s))):(u.key==="g"||u.key==="G")&&(u.preventDefault(),as("/agent/"+encodeURIComponent(s)+"#skills")))}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[s])}function my(s){const r=globalThis.window,u=r!=null?r.location.search:"";return new URLSearchParams(u).get("graph")==="0"}function hy({overview:s,agents:r,tasks:u,consensus:c,consensusReports:d,fleetTrend:f,signalActivity:p,skills:h,activeTaskCount:x,setActiveTaskCount:g}){const v=s.actionableFindings,N=my(),A=ay(c==null?void 0:c.runs),K=vp(d==null?void 0:d.reports),O=y.useMemo(()=>{const _=new Map;if(f){for(const Q of f.points){const F=_.get(Q.agentId)??[];F.push(Q),_.set(Q.agentId,F)}for(const Q of _.values())Q.sort((F,G)=>F.day.localeCompare(G.day))}return _},[f]),[T,j]=sy(),[L,B]=cy();fy(T);const P=r&&T?r.find(_=>_.id===T)??null:null,[V,M]=y.useState(!N);function R(){const _=!V;M(_);const Q=new URL(window.location.href);_?Q.searchParams.delete("graph"):Q.searchParams.set("graph","0"),window.history.replaceState(null,"",Q.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:[v>0&&a.jsxs("a",{href:ua("/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:[v," actionable →"]}),r&&a.jsx("button",{type:"button",onClick:R,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&&r&&a.jsxs("div",{className:"space-y-3",children:[a.jsx(Fv,{}),a.jsxs("div",{className:"flex items-stretch gap-3",children:[a.jsx("div",{className:"min-w-0 flex-1",children:a.jsx(Iv,{agents:r,peerRelationships:A,selectedAgentId:T,onSelectAgent:j})}),a.jsx(Xv,{selectedAgent:P,agents:r,peerRelationships:A})]}),c&&a.jsx(ty,{runs:c.runs,range:L,onRangeChange:B})]}),a.jsx(Eb,{overview:s,activeTasks:x,mode:"calm"}),a.jsx(Ub,{onCountChange:g}),r&&a.jsx(Cb,{agents:r,activity:p}),a.jsx(cv,{}),u&&a.jsx(av,{tasks:u,limit:3}),r&&a.jsx(Fb,{agents:r,highlightedAgentId:V?T:null,severityMap:K,trendByAgent:O}),a.jsx(uv,{overview:s}),a.jsx(gv,{skills:h??null})]})}const ls={confirmed:"var(--ok)",disputed:"var(--bad)",unverified:"var(--info)",unique:"var(--ink-3)"},Br={confirmed:"confirmed",disputed:"disputed",unverified:"unverified",unique:"unique"},Tu={sonnet:"Sonnet",gemini:"Gemini",opus:"Opus",haiku:"Haiku",other:"Other"},ns=["confirmed","disputed","unverified","unique"],py=.01;function xy({consensusId:s,data:r,onError:u}){const[c,d]=y.useState(r?{kind:"full",data:r}:s?{kind:"loading"}:{kind:"empty"});return y.useEffect(()=>{if(r)return;let f=!1;return d(p=>p.kind==="error"?p:{kind:"loading"}),fetch(`/dashboard/api/consensus-flow?consensusId=${encodeURIComponent(s)}`).then(async p=>{const h=await p.json().catch(()=>({}));if(!p.ok){const x=typeof(h==null?void 0:h.error)=="string"?h.error:`HTTP ${p.status}`;throw new Error(x)}return h}).then(p=>{f||d({kind:"full",data:p})}).catch(p=>{f||(d(h=>({kind:"error",error:p.message,stale:h.kind==="full"?h.data:void 0})),u==null||u(p))}),()=>{f=!0}},[s,r,u]),c.kind==="loading"?a.jsx(jy,{}):c.kind==="empty"?a.jsx(Sy,{}):c.kind==="error"?a.jsx(ky,{error:c.error,stale:c.stale}):a.jsx(yp,{data:c.data})}function yp({data:s}){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:[s.summary.totalFindings," findings across ",s.agentCount," agents"]})]}),s.coverageDegraded&&a.jsx(gy,{degraded:s.coverageDegraded})]}),a.jsx("div",{className:"hidden lg:block",children:a.jsx(by,{data:s})}),a.jsx("div",{className:"block lg:hidden",children:a.jsx(yy,{data:s})}),a.jsx(Ny,{data:s})]})}function gy({degraded:s}){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 ${s.expected}, received ${s.received}. Dropped: ${s.droppedAgents.join(", ")||"none"}`,children:"coverage degraded"})}const Au=720,Lr=320,ca=120,bu=0,vu=(Au-ca)/2,Oh=Au-ca,au=8;function by({data:s}){const r=y.useMemo(()=>vy(s),[s]),u=y.useMemo(()=>r.edges,[r.edges]),c=_y();return a.jsxs("div",{className:"overflow-x-auto",children:[a.jsxs("svg",{viewBox:`0 0 ${Au} ${Lr}`,width:"100%",height:Lr,role:"img","aria-label":`Consensus flow: ${s.summary.confirmed} confirmed, ${s.summary.disputed} disputed, ${s.summary.unverified} unverified, ${s.summary.unique} unique of ${s.summary.totalFindings} findings across ${s.agentCount} agents`,style:{display:"block"},children:[a.jsx("g",{children:u.map((d,f)=>a.jsx("path",{d:d.path,fill:d.color,fillOpacity:.55,stroke:"none",style:c?void 0:{animation:`consensus-flow-ribbon-in 480ms ease-out ${f*40}ms both`},children:a.jsx("title",{children:d.tooltip})},`${d.fromFamily}-${d.toVerdict}`))}),a.jsx("g",{children:r.left.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:bu,y:d.y,width:ca,height:d.h,fill:"var(--ink-4)",fillOpacity:.18}),a.jsxs("text",{x:bu+ca-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[Tu[d.family]," · ",d.agentCount]})]},d.family))}),a.jsx("g",{children:r.right.map(d=>a.jsxs("g",{children:[a.jsx("rect",{x:vu,y:d.y,width:ca,height:d.h,fill:ls[d.verdict],fillOpacity:.16}),a.jsxs("text",{x:vu+ca/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:[Br[d.verdict]," · ",d.count]})]},d.verdict))}),a.jsx("g",{children:r.right.map(d=>{const f=s.summary.totalFindings>0?Math.round(d.count/s.summary.totalFindings*100):0;return a.jsxs("g",{children:[a.jsx("rect",{x:Oh,y:d.y,width:ca,height:d.h,fill:ls[d.verdict],fillOpacity:.32}),a.jsxs("text",{x:Oh+ca-6,y:d.y+d.h/2,textAnchor:"end",dominantBaseline:"middle",fontSize:11,fill:"var(--ink)",style:{fontFamily:"var(--font-mono)"},children:[d.count," · ",f,"%"]})]},d.verdict)})})]}),a.jsx("style",{children:`
|
|
61
|
+
@keyframes consensus-flow-ribbon-in {
|
|
62
|
+
from { opacity: 0; }
|
|
63
|
+
to { opacity: 1; }
|
|
64
|
+
}
|
|
65
|
+
@media (prefers-reduced-motion: reduce) {
|
|
66
|
+
svg * { animation: none !important; }
|
|
67
|
+
}
|
|
68
|
+
`})]})}function vy(s){const r=s.summary.totalFindings,u=Lr-au*2,c=new Map;for(const O of s.familyToOutcome)c.set(O.from.family,(c.get(O.from.family)??0)+O.to.count);const d=s.modelFamilyToFindings.reduce((O,T)=>O+(c.get(T.family)??0),0)||1;let f=au;const p=s.modelFamilyToFindings.map(O=>{const T=c.get(O.family)??0,j=Math.max(20,T/d*u),L={family:O.family,y:f,h:j,agentCount:O.agentCount};return f+=j,L}),h=24;let x=au;const g=ns.map(O=>{const T=s.summary[O],j=r>0?T/r:0,L=Math.max(h,j*u),B={verdict:O,y:x,h:L,count:T};return x+=L,B}),v=new Map,N=new Map,A=[],K=[...s.familyToOutcome].sort((O,T)=>O.from.family!==T.from.family?O.from.family.localeCompare(T.from.family):ns.indexOf(O.to.verdict)-ns.indexOf(T.to.verdict));for(const O of K){const T=p.find(ne=>ne.family===O.from.family),j=g.find(ne=>ne.verdict===O.to.verdict);if(!T||!j)continue;const L=c.get(O.from.family)??0,B=L>0?O.to.count/L*T.h:0,P=j.count||1,V=O.to.count/P*j.h,M=v.get(O.from.family)??0,R=N.get(O.to.verdict)??0;if(v.set(O.from.family,M+B),N.set(O.to.verdict,R+V),O.weight<py)continue;const _=T.y+M,Q=_+B,F=j.y+R,G=F+V,ue=bu+ca,ae=vu,oe=ue+(ae-ue)*.5,pe=ae-(ae-ue)*.5,D=`M ${ue} ${_} C ${oe} ${_}, ${pe} ${F}, ${ae} ${F} L ${ae} ${G} C ${pe} ${G}, ${oe} ${Q}, ${ue} ${Q} Z`,w=s.modelFamilyToFindings.find(ne=>ne.family===O.from.family),I=(w==null?void 0:w.agentCount)??0;A.push({path:D,color:ls[O.to.verdict],tooltip:`${I} ${Tu[O.from.family]} agent${I===1?"":"s"} → ${O.to.count} ${Br[O.to.verdict]} finding${O.to.count===1?"":"s"} (${Math.round(O.weight*100)}%)`,fromFamily:O.from.family,toVerdict:O.to.verdict})}return{left:p,right:g,edges:A}}function yy({data:s}){const r=s.summary.totalFindings||1;return a.jsxs("div",{className:"space-y-4",children:[a.jsx(lu,{label:"Model families",items:s.modelFamilyToFindings.map(u=>({key:u.family,label:`${Tu[u.family]} (${u.agentCount})`,value:u.agentCount,color:"var(--ink-4)"}))}),a.jsx(lu,{label:"Findings reviewed",items:ns.map(u=>({key:u,label:`${Br[u]} (${s.summary[u]})`,value:s.summary[u],color:ls[u]}))}),a.jsx(lu,{label:"Outcome verdicts",items:ns.map(u=>({key:u,label:`${s.summary[u]} · ${Math.round(s.summary[u]/r*100)}%`,value:s.summary[u],color:ls[u]}))})]})}function lu({label:s,items:r}){const u=r.reduce((c,d)=>c+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:s}),a.jsx("div",{className:"flex h-6 overflow-hidden rounded-sm border",style:{borderColor:"var(--border)"},children:r.map(c=>{const d=c.value/u*100;return d<.5?null:a.jsx("div",{title:c.label,style:{width:`${d}%`,background:c.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?c.label:""},c.key)})})]})}function Ny({data:s}){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:[ns.map(r=>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:ls[r]}}),Br[r]," · ",s.summary[r]]},r)),s.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 · ",s.summary.newFindings]})]})}function jy(){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:Lr},children:[0,1,2].map(s=>a.jsx("div",{className:"flex flex-col gap-2",children:[0,1,2,3].map(r=>a.jsx("div",{className:"flex-1 animate-pulse rounded-sm",style:{background:"var(--border)",opacity:.6}},r))},s))}),a.jsx("style",{children:`
|
|
69
|
+
@media (prefers-reduced-motion: reduce) {
|
|
70
|
+
.animate-pulse { animation: none !important; }
|
|
71
|
+
}
|
|
72
|
+
`})]})}function Sy(){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 ky({error:s,stale:r}){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:s,children:["error · ",s]})}),r?a.jsx("div",{style:{opacity:.5,pointerEvents:"none"},children:a.jsx(yp,{data:r})}):a.jsx("p",{className:"py-10 text-center font-mono text-[12px]",style:{color:"var(--ink-3)"},children:"Failed to load consensus flow."})]})}function _y(){const[s,r]=y.useState(!1);return y.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)");r(u.matches);const c=d=>r(d.matches);return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[]),s}function Ey({consensusId:s}){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:ua("/"),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:s})]}),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(xy,{consensusId:s})]})}function wy({onLogin:s,error:r}){const[u,c]=y.useState(""),[d,f]=y.useState(!1),p=async x=>{if(x.preventDefault(),!(!u.trim()||d)){f(!0);try{await s(u.trim())}finally{f(!1)}}},h=r==="bad_key"?"Invalid key. Check your terminal for the correct key.":r==="network"?"Connection error — relay may be offline.":r==="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:p,children:[a.jsx("input",{type:"password",value:u,onChange:x=>c(x.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 Np="dashboard:theme",Ty=["light","dark"];function Ay(s){return s==="light"||s==="dark"?s:s==="editorial"?"light":s==="default"?"dark":null}function My(s,r){const u=Ay(s);return u!==null?u:r?"dark":"light"}function Cy(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Ry(){if(typeof window>"u")return"light";let s=null;try{s=window.localStorage.getItem(Np)}catch{}return My(s,Cy())}function Oy(){const[s,r]=y.useState(Ry);y.useEffect(()=>{typeof document>"u"||(s==="light"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=s)},[s]);function u(d){if(Ty.includes(d)&&(r(d),typeof window<"u"))try{window.localStorage.setItem(Np,d)}catch{}}return{theme:s,setTheme:u,toggle:()=>{u(s==="light"?"dark":"light")}}}const Dy=[{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."}],zy={background:"var(--surface-elev)",borderRadius:"16px",boxShadow:"var(--shadow-overlay)",border:"1px solid var(--border)",color:"var(--text)",fontFamily:"var(--font-sans)"};function Ly({open:s,onClose:r}){const u=y.useRef(null);return y.useEffect(()=>{if(!s)return;const c=requestAnimationFrame(()=>{var f;(f=u.current)==null||f.focus()}),d=f=>{f.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{cancelAnimationFrame(c),document.removeEventListener("keydown",d),document.body.style.overflow=""}},[s,r]),s?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:r,role:"presentation",children:a.jsxs("div",{className:"relative flex max-h-[calc(100vh-48px)] w-full max-w-2xl flex-col overflow-hidden",style:zy,role:"dialog","aria-modal":"true","aria-labelledby":"glossary-title",onClick:c=>c.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:r,"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:Dy.map(({term:c,definition:d,seeAlso:f})=>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:c}),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}),f&&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: ",f]})]},c))})}),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 By=[{to:"/",label:"Dashboard",match:s=>s==="/"||s==="/overview"},{to:"/chat",label:"Chat",match:s=>s==="/chat"},{to:"/team",label:"Team",match:s=>s==="/team"||s.startsWith("/agent/")},{to:"/debates",label:"Consensus Rounds",match:s=>s==="/debates"},{to:"/tasks",label:"Tasks",match:s=>s==="/tasks"},{to:"/signals",label:"Signals",match:s=>s==="/signals"},{to:"/logs",label:"Logs",match:s=>s==="/logs"}];function su(){const[s,r]=y.useState(!1),u=Fh(),{theme:c,toggle:d}=Oy();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:ua("/"),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:By.map(f=>{const p=f.match(u);return a.jsx("a",{href:ua(f.to),className:`rounded-md px-3.5 py-1.5 font-mono text-[13px] transition ${p?"font-semibold":"hover:bg-accent/10"}`,style:p?{background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"var(--accent)"}:{color:"var(--ink-3)"},children:f.label},f.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 ${c==="light"?"dark":"light"} theme`,"aria-label":`Switch to ${c==="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:c==="light"?"◐":"◑"}),a.jsx("button",{type:"button",onClick:()=>r(!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(Ly,{open:s,onClose:()=>r(!1)})]})}const Uy={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 jp({task:s,onClose:r}){if(y.useEffect(()=>{if(!s)return;const d=f=>{f.key==="Escape"&&r()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[s,r]),!s)return null;const u=Uy[s.status],c=(s.inputTokens||0)+(s.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:r,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:s.taskId.slice(0,8)}),a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(s.agentId)}`,className:"truncate font-mono text-xs transition",style:{color:"var(--text-dim)"},children:s.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:wt(s.timestamp)}),s.duration!=null&&a.jsxs("span",{children:["· ",kb(s.duration)]}),c>0&&a.jsxs("span",{children:["· ",c.toLocaleString()," tokens (",(s.inputTokens||0).toLocaleString()," in / ",(s.outputTokens||0).toLocaleString()," out)"]})]})]}),a.jsx("button",{onClick:r,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:Nb(s.task)}})]}),s.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:ii(s.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:s.status==="running"?"Task is still running...":"No result recorded."})]})]})]})})}function yu(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const iu=5,ru={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"}},Dh=[{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."}],$y=[{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)"}}],qy={critical:"text-bad bg-bad/10",high:"text-severity-high bg-severity-high/10",medium:"text-severity-medium bg-severity-medium/10",low:""},Hy={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Iy="[&_.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",Gy={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 Yy({f:s,reviewInfo:r,diagnostics:u}){const c=s.tag==="confirmed"?"text-confirmed bg-confirmed/10 border-confirmed/20":s.tag==="disputed"?"text-disputed bg-disputed/10 border-disputed/20":s.tag==="unverified"?"text-unverified bg-unverified/10 border-unverified/20":"text-unique bg-unique/10 border-unique/20",d=s.severity&&qy[s.severity]||"",f=s.severity==="low"?Hy:void 0,p=s.findingType==="suggestion"?"SUGGESTION":s.findingType==="insight"?"INSIGHT":null,h=s.findingType==="suggestion"?"text-info bg-info/10":s.findingType==="insight"?"text-text-dim bg-text-dim/10":"",x=s.finding.match(/<cite\s+tag="file">([^<]+)<\/cite>/),g=x?x[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 ${c}`,children:s.tag.toUpperCase()}),s.severity&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${d}`,style:f,children:s.severity.toUpperCase()}),p&&a.jsx("span",{className:`shrink-0 rounded border px-2 py-1 font-mono text-[10px] font-bold ${h}`,children:p}),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:s.originalAgentId}),s.confirmedBy&&s.confirmedBy.length>0&&(()=>{const v=[...new Set(s.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:
|
|
73
|
+
${v.join(", ")}`,"data-tooltip-pos":"left",children:["+",v.length," ✓"]})})(),s.disputedBy&&s.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:
|
|
74
|
+
${s.disputedBy.map(v=>v.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[s.disputedBy.length," ⚡"]}),s.unverifiedBy&&s.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:
|
|
75
|
+
${s.unverifiedBy.map(v=>v.agentId).join(", ")}`,"data-tooltip-pos":"left",children:[s.unverifiedBy.length," ◇"]})]}),u&&u.length>0&&a.jsx("div",{className:"mt-1.5 mb-1 space-y-1",children:u.map((v,N)=>a.jsxs("div",{className:"rounded border border-unverified/20 bg-unverified/5 px-2.5 py-1.5","data-diagnostic-code":v.code,children:[a.jsxs("div",{className:"font-mono text-[10px] font-bold uppercase tracking-wider text-unverified/80",children:["⚠ ",v.code]}),a.jsx("div",{className:"mt-0.5 text-[11px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},dangerouslySetInnerHTML:{__html:yu(Gy[v.code])+" — "+yu(v.message)}})]},N))}),s.disputedBy&&s.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:s.disputedBy.map((v,N)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"font-mono font-bold text-disputed/70",children:v.agentId}),a.jsxs("span",{style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:[" — ",v.reason||v.evidence||"No reason given"]})]},N))}),a.jsx("div",{className:`finding-md font-inter text-xs leading-relaxed ${Iy}`,style:{color:"var(--text-dim)"},dangerouslySetInnerHTML:{__html:ii(s.finding)}}),r&&a.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[r.reviewers.map(v=>a.jsx("span",{title:v,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:Cn(v)},children:du(v)},v)),a.jsxs("span",{className:`rounded px-1.5 py-0.5 font-mono text-[9px] font-bold ${r.assigned>=r.targetK?"text-confirmed/70 bg-confirmed/5":"text-unverified/70 bg-unverified/5"}`,children:[r.assigned>=r.targetK?"✓":"⚠"," ",r.assigned,"/",r.targetK]})]})]})}function Xy({consensus:s,reports:r,showAll:u=!1,hideHeader:c=!1,filteredRuns:d}){const f=d??s.runs,p=u?f:f.slice(0,iu);!u&&f.length>iu;const[h,x]=y.useState(null),[g,v]=y.useState("all"),[N,A]=y.useState("all"),[K,O]=y.useState(1),[T,j]=y.useState([]),[L,B]=y.useState(0),[P,V]=y.useState(!1),[M,R]=y.useState({});y.useEffect(()=>{if(!u&&(r!=null&&r.reports)&&(j(r.reports),B(r.totalReports??r.reports.length),O(1)),r!=null&&r.roundRetractions){const D={};for(const w of r.roundRetractions)D[w.consensus_id]={reason:w.reason,retracted_at:w.retracted_at};R(D)}},[r,u]),y.useEffect(()=>{if(!u)return;let D=!1;return(async()=>{var w;try{const I=await ct("consensus-reports?page=1&pageSize=200");if(D)return;if(j(I.reports||[]),B(I.totalReports??(((w=I.reports)==null?void 0:w.length)||0)),O(1),I.roundRetractions){const ne={};for(const le of I.roundRetractions)ne[le.consensus_id]={reason:le.reason,retracted_at:le.retracted_at};R(ne)}}catch{}})(),()=>{D=!0}},[u]);const _=T.slice().sort((D,w)=>w.timestamp.localeCompare(D.timestamp)),Q=10,[F,G]=y.useState(0),ue=Math.max(1,Math.ceil(_.length/Q)),ae=Math.min(F,ue-1),oe=u?_.slice(ae*Q,(ae+1)*Q):_.slice(0,iu),pe=D=>{const w=new Date,I=new Date(D),ne=de=>new Date(de.getFullYear(),de.getMonth(),de.getDate()).getTime(),le=Math.round((ne(w)-ne(I))/864e5);return le<=0?"Today":le===1?"Yesterday":le<7?`${le} days ago`:le<30?`${Math.floor(le/7)} weeks ago`:I.toISOString().slice(0,10)};return a.jsxs("section",{children:[!c&&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:s.totalRuns??s.runs.length})]}),!u&&a.jsx("a",{href:"/dashboard/debates",className:"font-mono text-xs transition",style:{color:"var(--text-dim)"},children:"view all"})]}),oe.length>0?a.jsxs("div",{className:"space-y-2",children:[oe.map((D,w)=>{const I=w>0?oe[w-1]:null,ne=u?pe(D.timestamp):null,le=u&&I?pe(I.timestamp):null,de=u&&ne!==le,S={};if(D.crossReviewAssignments||D.crossReviewCoverage){const re={};if(D.crossReviewAssignments)for(const[we,qe]of Object.entries(D.crossReviewAssignments))for(const mt of qe)(re[mt]??(re[mt]=[])).push(we);if(D.crossReviewCoverage)for(const we of D.crossReviewCoverage)S[we.findingId]={reviewers:re[we.findingId]||[],assigned:we.assigned,targetK:we.targetK};else for(const[we,qe]of Object.entries(re))S[we]={reviewers:qe,assigned:qe.length,targetK:qe.length}}const U=[...D.confirmed,...D.disputed,...D.unverified,...D.unique,...D.insights||[]],se=g==="all"?U:g==="insight"?U.filter(re=>re.findingType==="insight"||re.findingType==="suggestion"):U.filter(re=>re.tag===g),ee=N==="all"?se:se.filter(re=>re.severity===N),Y=h===D.id,me=(()=>{const re=new Set;return we=>{var Vt;const qe=(Vt=D.authorDiagnostics)==null?void 0:Vt[we.originalAgentId];if(!qe||qe.length===0)return;const mt=qe.filter(nt=>{const Tt=`${we.originalAgentId}:${nt.code}`;return re.has(Tt)?!1:(re.add(Tt),!0)});return mt.length>0?mt:void 0}})(),ge=U.length||1,Ge=D.confirmed.length,Re=D.disputed.length,it=D.unverified.length,Kt=D.unique.length,Lt=(D.insights||[]).length,Rn=(()=>{if(ge===0)return"border-l-border/40";const re=Ge/ge,we=Re/ge;return re>=.5?"border-l-confirmed/60":we>=.4?"border-l-disputed/60":"border-l-unverified/50"})(),Ht=[{count:Ge,textCls:"text-confirmed",label:"confirmed"},{count:Re,textCls:"text-disputed",label:"disputed"},{count:it,textCls:"text-unverified",label:"unverified"},{count:Kt,textCls:"text-unique",label:"unique"},{count:Lt,textCls:"text-zinc-400",label:"insights"}].filter(re=>re.count>0),Ye=[...new Set(U.map(re=>re.originalAgentId).filter(Boolean))],wn=Ye.slice(0,5),hn=M[D.id],On=!!hn;return a.jsxs("div",{children:[de&&a.jsxs("div",{className:`mb-2 flex items-center gap-3 ${w>0?"mt-4":""}`,children:[a.jsx("span",{className:"h-section",children:ne}),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
|
|
76
|
+
${Rn}
|
|
77
|
+
${On?"opacity-60 line-through decoration-disputed/40":""}
|
|
78
|
+
${Y?"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:Y?"var(--surface-elev)":"color-mix(in oklch, var(--surface-elev) 50%, transparent)"},"data-retracted":On?"true":void 0,children:[On&&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"}),hn.retracted_at&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",hn.retracted_at.slice(0,10)]}),hn.reason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",hn.reason]})]}),a.jsxs("button",{className:"flex w-full items-start gap-3 px-3 py-2.5 text-left","aria-expanded":Y,onClick:()=>{const re=!Y;x(re?D.id:null),re&&(v("all"),A("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:U.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:[D.rounds,"r"]}),wn.length>0&&a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[wn.map(re=>a.jsx("span",{title:re,className:"inline-flex h-4 w-4 items-center justify-center rounded-full font-mono text-[8px] font-bold",style:{color:"var(--surface)",backgroundColor:Cn(re)},children:du(re)},re)),Ye.length>5&&a.jsxs("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["+",Ye.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:D.id,children:D.id.slice(0,8)}),D.zeroTagAgents&&D.zeroTagAgents.length>0&&(()=>{const re=D.zeroTagAgents,we=D.zeroTagOverflow??0,qe=re.length+we,mt=we>0?`${re.join(", ")} (+${we} more)`:re.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: ${mt}`,children:[qe," zero-tag"]})})(),D.droppedFindingsByType&&Object.keys(D.droppedFindingsByType).length>0&&(()=>{const re=Object.entries(D.droppedFindingsByType),we=re.reduce((mt,[,Vt])=>mt+Vt,0),qe=re.map(([mt,Vt])=>`${mt}:${Vt}`).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=: ${qe}. These never reach the dashboard, scores, or signals.`,children:[we," dropped"]})})(),D.warnings&&D.warnings.length>0&&(()=>{const re=new Map;for(const we of D.warnings){const qe=re.get(we.code)??[];qe.push(we.agentId?`${we.agentId}: ${we.message}`:we.message),re.set(we.code,qe)}return Array.from(re.entries()).map(([we,qe])=>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:qe.join(`
|
|
79
|
+
`),children:[we,qe.length>1?` ×${qe.length}`:""]},we))})(),a.jsx("span",{className:"ml-auto font-mono text-[10px] shrink-0",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:wt(D.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex items-center gap-3",children:Ht.map(re=>a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${re.textCls}`,children:[re.count," ",re.label]},re.label))}),D.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:D.topic})]})]}),a.jsx("span",{className:`mt-1 shrink-0 font-mono text-[10px] transition-transform duration-150 ${Y?"rotate-90":""}`,style:{color:Y?"color-mix(in oklch, var(--ink) 60%, transparent)":"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:"▸"})]}),Y&&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:"}),Dh.map(re=>a.jsx("button",{onClick:()=>v(re.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${g===re.key?re.activeCls:re.cls}`,style:g===re.key?re.activeStyle:re.inactiveStyle,...re.tooltip?{"data-tooltip":re.tooltip}:{},children:re.label},re.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:"}),$y.map(re=>a.jsx("button",{onClick:()=>A(re.key),className:`rounded-md border px-3 py-1.5 font-mono text-[10px] font-medium transition ${N===re.key?re.activeCls:re.cls}`,style:N===re.key?re.activeStyle:re.inactiveStyle,children:re.label},re.key))]}),(D.warnings??[]).filter(re=>re.code==="coverage_degraded").map((re,we)=>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:["⚠ ",re.message]})},`cd-${we}`)),D.zeroTagAgents&&D.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 — ",D.zeroTagAgents.length+(D.zeroTagOverflow??0)," agent",D.zeroTagAgents.length+(D.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:[D.zeroTagAgents.join(", "),D.zeroTagOverflow&&D.zeroTagOverflow>0?` (+${D.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 re=(D.warnings??[]).filter(qe=>qe.code==="cross_review_skipped");if(re.length===0)return null;const we=re.map(qe=>qe.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: ",re.length," relay agent",re.length===1?"":"s"," failed Phase 2"]}),we.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:we.join(", ")})]})})(),(D.crossReviewAssignments||D.crossReviewCoverage)&&(()=>{const re=D.crossReviewAssignments||{},we=Object.entries(re),qe=D.crossReviewCoverage||[],mt=qe.length,Vt=qe.filter(Tt=>Tt.assigned<Tt.targetK),nt=(D.warnings??[]).some(Tt=>Tt.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",nt&&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:[we.length," reviewers · ",mt," findings"]})]}),a.jsxs("div",{className:"border-t border-border/20 px-3 pb-3 pt-2 space-y-2",children:[we.map(([Tt,pn])=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{title:Tt,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:Cn(Tt)},children:du(Tt)}),a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:Tt}),a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 40%, transparent)"},children:["(",pn.length,")"]}),a.jsx("div",{className:"flex flex-wrap gap-1 ml-1",children:pn.map(xn=>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:xn.length>12?xn.slice(0,12)+"…":xn},xn))})]},Tt)),mt>0&&a.jsx("div",{className:"mt-1 pt-1.5 border-t border-border/15",children:Vt.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:["⚠ ",Vt.length," of ",mt," findings under-reviewed"]}):a.jsxs("span",{className:"font-mono text-[10px] font-semibold text-confirmed/60",children:["✓ All ",mt," findings fully covered"]})})]})]})})(),a.jsx("div",{className:"space-y-3",children:ee.length===0?a.jsx("div",{className:"py-4 text-center text-xs",style:{color:"var(--text-dim)"},children:"No findings match this filter."}):ee.map((re,we)=>a.jsx(Yy,{f:re,reviewInfo:re.id?S[re.id]:void 0,diagnostics:me(re)},we))})]})]})]},D.id)}),u&&ue>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:()=>G(D=>Math.max(0,D-1)),disabled:ae===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 ",ae+1," of ",ue]}),a.jsx("button",{onClick:()=>G(D=>Math.min(ue-1,D+1)),disabled:ae>=ue-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 ▸"})]})]}):p.length===0?a.jsx(ss,{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:p.map((D,w)=>{const I=D.counts,ne=(I.agreement||0)+(I.disagreement||0)+(I.hallucination||0)+(I.unverified||0)+(I.unique||0)+(I.new||0),le=ne||1,de=h===D.taskId,S=[{key:"confirmed",count:I.agreement||0,color:"bg-confirmed",text:"text-confirmed",label:"confirmed"},{key:"disputed",count:(I.disagreement||0)+(I.hallucination||0),color:"bg-disputed",text:"text-disputed",label:"disputed"},{key:"unverified",count:I.unverified||0,color:"bg-unverified",text:"text-unverified",label:"unverified"},{key:"unique",count:(I.unique||0)+(I.new||0),color:"bg-unique",text:"text-unique",label:"unique"}],U=D.signals.filter(ee=>{if(ee.signal==="signal_retracted")return!1;if(g==="all")return!!ru[ee.signal];const Y=ru[ee.signal];return Y&&Y.filter===g}),se=!!D.retracted;return a.jsxs("div",{className:`rounded-md border transition ${de?"border-primary/25":"border-border"} ${se?"opacity-60":""}`,style:{background:"var(--surface-elev)"},"data-retracted":se?"true":void 0,title:se&&D.retractionReason?`Retracted: ${D.retractionReason}`:void 0,children:[se&&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"}),D.retractedAt&&a.jsxs("span",{className:"ml-2 text-disputed/70",children:["on ",D.retractedAt.slice(0,10)]}),D.retractionReason&&a.jsxs("span",{className:"ml-2",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:["— ",D.retractionReason]})]}),a.jsxs("button",{"aria-expanded":de,onClick:()=>{const ee=!de;x(ee?D.taskId:null),ee&&(v("all"),A("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:de?"var(--ink)":"var(--text-dim)",fontWeight:de?600:400},children:de?"▾":"▸"}),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:D.taskId}),a.jsxs("span",{className:`font-mono text-sm font-semibold ${se?"line-through decoration-disputed/40":""}`,style:{color:"var(--text)"},children:[ne," findings"]}),a.jsxs("div",{className:"flex gap-1.5",children:[D.agents.slice(0,4).map(ee=>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:ee.split("-").map(Y=>Y[0]).join("").toUpperCase().slice(0,2)},ee)),D.agents.length>4&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["+",D.agents.length-4]})]})]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:wt(D.timestamp)})]}),a.jsx("div",{className:"mt-2 flex gap-2",children:S.map(ee=>ee.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${ee.text} ${se?"line-through decoration-disputed/40":""}`,children:[ee.count," ",ee.label]},ee.key))}),a.jsx("div",{className:"mt-2 flex h-1.5 overflow-hidden rounded-sm",children:S.map(ee=>ee.count>0&&a.jsx("div",{className:`${ee.color} transition-all`,style:{width:`${ee.count/le*100}%`}},ee.key))})]})]}),de&&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:Dh.map(ee=>a.jsx("button",{onClick:()=>v(ee.key),className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${g===ee.key?ee.activeCls:ee.cls} hover:opacity-80`,style:g===ee.key?ee.activeStyle:ee.inactiveStyle,...ee.tooltip?{"data-tooltip":ee.tooltip}:{},children:ee.label},ee.key))}),U.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:U.map((ee,Y)=>{const me=ru[ee.signal];return me?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 ${me.cls}`,children:me.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:ii(ee.evidence||"")}})}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[ee.agentId,ee.counterpartId?` + ${ee.counterpartId}`:""]})]})]},Y):null})})]})]},D.taskId+w)})})]})}const Tr=25;function Ky({commits:s}){const[r,u]=y.useState(!1);if(s.length===0)return a.jsx("span",{style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:"—"});const c=s[0],d=c.includes(" ")?c.slice(c.indexOf(" ")+1):c,f=s.length-1;return a.jsxs("span",{className:"font-mono text-[11px]",children:[a.jsx("span",{style:{color:"var(--text)"},children:d}),f>0&&a.jsxs(a.Fragment,{children:[" ",a.jsx("button",{type:"button","aria-expanded":r,onClick:()=>u(p=>!p),className:"font-mono text-[10px] underline",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:r?"(collapse)":`(+${f} more)`}),r&&a.jsx("ul",{className:"mt-1 space-y-0.5 pl-2",children:s.slice(1).map((p,h)=>{const x=p.includes(" ")?p.slice(p.indexOf(" ")+1):p;return a.jsx("li",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 80%, transparent)"},children:x},h)})})]})]})}function Vy({row:s}){const r=s.preSha.slice(0,8),u=s.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:wt(s.detectedAt)}),a.jsx("td",{className:"max-w-[160px] truncate whitespace-nowrap py-3 pr-4",children:a.jsx("a",{href:`/dashboard/agent/${encodeURIComponent(s.agentId)}`,className:"font-mono text-[11px] hover:underline",style:{color:"var(--text)"},onMouseEnter:c=>c.currentTarget.style.color="var(--accent)",onMouseLeave:c=>c.currentTarget.style.color="var(--text)",children:s.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:r}),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(Ky,{commits:s.commits})})]})}function Qy(){const[s,r]=y.useState([]),[u,c]=y.useState(0),[d,f]=y.useState(1),[p,h]=y.useState(!1),[x,g]=y.useState(null);y.useEffect(()=>{let N=!1;return h(!0),g(null),ct(`violations?page=${d}&pageSize=${Tr}`).then(A=>{N||(r(A.items??[]),c(A.total??0))}).catch(A=>{N||g(String((A==null?void 0:A.message)??A))}).finally(()=>{N||h(!1)}),()=>{N=!0}},[d]);const v=Math.max(1,Math.ceil(u/Tr));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:[x&&a.jsx("div",{className:"border-b border-border/60 bg-disputed/10 px-3 py-2 font-mono text-[10px] text-disputed",children:x}),!x&&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:[!p&&s.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"})}),p&&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…"})}),!p&&s.map(N=>a.jsx(Vy,{row:N},`${N.taskId}-${N.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:p?"loading…":u===0?"no violations":`${(d-1)*Tr+1}–${Math.min(d*Tr,u)} of ${u}`}),a.jsxs("div",{className:`flex items-center gap-2 font-mono text-[10px] ${v<=1?"invisible":""}`,style:{color:"var(--text-dim)"},children:[a.jsx("button",{type:"button",onClick:()=>f(N=>Math.max(1,N-1)),disabled:d===1||p,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," / ",v]}),a.jsx("button",{type:"button",onClick:()=>f(N=>Math.min(v,N+1)),disabled:d>=v||p,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 Zy({categoryAccuracy:s,categoryCorrect:r,categoryHallucinated:u}){const c=Object.keys(s??{});if(c.length===0)return a.jsx(ss,{title:"No category data yet",hint:"Accuracy accrues after ≥5 signals per category.",compact:!0});const d=c.map(f=>{const p=Math.max(0,Math.min(1,s[f]??0)),h=(r==null?void 0:r[f])??0,x=(u==null?void 0:u[f])??0;return{key:f,acc:p,c:h,h:x,n:h+x}}).sort((f,p)=>p.acc-f.acc);return a.jsx("div",{className:"space-y-2",children:d.map(f=>{const p=f.acc>=.7?"bg-confirmed":f.acc>=.4?"bg-unverified":"bg-disputed",h=f.n>0?`${f.c} correct / ${f.h} hallucinated / ${f.n} total`:void 0;return a.jsxs("div",{className:`grid grid-cols-[128px_1fr_auto_44px] items-center gap-3 ${f.n>0&&f.n<10?"opacity-50":""}`,title:f.n>0&&f.n<10?`${h} — low sample (n<10)`:h,children:[a.jsx("span",{className:"truncate font-mono text-[11px]",style:{color:"var(--text-dim)"},children:f.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 ${p}`,style:{width:`${f.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:f.n>0?a.jsxs(a.Fragment,{children:[f.c,"/",f.n,f.h>0&&a.jsxs("span",{className:"ml-1 text-disputed/70",children:["·",f.h,"✗"]})]}):"—"}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(f.acc*100),"%"]})]},f.key)})})}const Fy=new Set(["passed","failed","silent_skill","insufficient_evidence","flagged_for_manual_review"]);function Jy(s,r,u){return(!s||!Fy.has(s))&&r!==void 0&&u!==void 0&&u>0}const Wy={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"},Py={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 e0(s){const r=Math.round(s*100),u=r>0?"+":"";return r>0?{text:`${u}${r}pp`,cls:"text-confirmed"}:r<0?{text:`${u}${r}pp`,cls:"text-disputed"}:{text:`${u}${r}pp`,cls:"",clsStyle:{color:"var(--text-dim)"}}}function t0({slot:s}){const r=s.status,u=r?Py[r]:"border-border/50",c=!r||r==="pending"?{background:"color-mix(in oklch, var(--surface-sunk) 30%, transparent)",color:"var(--text-dim)"}:void 0,d=r==="inconclusive"&&(s.inconclusiveStrikes??0)>0,f=s.forcedDevelops??[],p=f.length>0?f[f.length-1]:null,h=typeof s.effectiveness=="number"?e0(s.effectiveness):null,x=Jy(r,s.postBindSignals,s.minEvidence);return a.jsxs("div",{className:`rounded-md border p-3 ${s.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 ${s.enabled?"":"line-through"}`,style:{color:s.enabled?"var(--text)":"var(--text-dim)"},children:[s.mode==="contextual"&&"⚡ ",s.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:s.source}),s.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 ",wt(s.boundAt)]}),x&&(()=>{const g=s.postBindSignals,v=s.minEvidence,N=Math.round(g/v*100),A=Math.min(g/v,1)*100;return a.jsxs("div",{className:"mt-1.5",title:`MIN_EVIDENCE gate: ${g} of ${v} post-bind signals (${N}%)`,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," / ",v]}),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:`${A}%`}})})]})})()]}),r&&a.jsx("span",{className:`shrink-0 rounded-sm border px-1.5 py-0.5 font-mono text-[9px] font-bold uppercase ${u}`,style:c,title:Wy[r],children:r.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:s.inconclusiveAt?`last strike ${wt(s.inconclusiveAt)}`:void 0,children:[s.inconclusiveStrikes," strike",s.inconclusiveStrikes===1?"":"s"]})]}),f.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:p!=null&&p.reason?`latest: ${p.reason}`:void 0,children:["forced ",f.length," time",f.length===1?"":"s",p&&` · last ${wt(p.timestamp)}`]})]})}function n0({open:s,onOpenChange:r,children:u}){return y.useEffect(()=>{if(!s)return;const c=f=>{f.key==="Escape"&&r(!1)};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[s,r]),s?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:()=>r(!1)}),a.jsx("div",{className:"absolute inset-y-0 right-0 flex",children:a.jsx("div",{onClick:c=>c.stopPropagation(),className:"contents",children:u})})]}):null}function a0({side:s="right",className:r="",children:u,style:c,...d}){return a.jsx("div",{className:`h-full p-6 ${r}`,style:{background:"var(--surface-elev)",...c},...d,children:u})}function l0({className:s="",...r}){return a.jsx("div",{className:`mb-2 ${s}`,...r})}function s0({className:s="",...r}){return a.jsx("h2",{className:`font-semibold ${s}`,...r})}function i0({citation:s}){const r=s.snippet.split(`
|
|
80
|
+
`);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:[s.file,":",s.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:r.map((u,c)=>a.jsx("div",{className:"whitespace-pre",children:u||" "},c))})]})}const zh={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:""},r0={color:"var(--text-dim)",background:"color-mix(in oklch, var(--surface-sunk) 50%, transparent)"},Lh={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"},o0={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 c0(){const s=(r,u)=>a.jsx("div",{className:`${r} ${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:[s("h-3.5","w-12"),s("h-3.5","w-14"),s("h-3.5","w-16")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-full"),s("h-2","w-[92%]"),s("h-2","w-[70%]")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-16"),s("h-12","w-full")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-16"),s("h-2","w-[60%]"),s("h-2","w-[45%]")]}),a.jsxs("div",{className:"space-y-2",children:[s("h-2","w-20"),s("h-2","w-full"),s("h-2","w-[80%]")]})]})}function Ur({open:s,onOpenChange:r,consensusId:u,findingId:c}){const[d,f]=y.useState(null),[p,h]=y.useState(null);return y.useEffect(()=>{if(!s||!u||!c){f(null),h(null);return}f(null),h(null),ct(`finding/${encodeURIComponent(u)}/${encodeURIComponent(c)}`).then(f).catch(x=>h(x.message||"failed to load finding"))},[s,u,c]),a.jsx(n0,{open:s,onOpenChange:r,children:a.jsxs(a0,{side:"right",className:"w-[480px] sm:w-[480px] sm:max-w-[480px] overflow-y-auto",style:o0,children:[a.jsx(l0,{children:a.jsx(s0,{className:"font-mono text-sm",style:{color:"var(--text)"},children:"Finding detail"})}),p&&a.jsx("div",{className:"mt-4",children:a.jsx(wu,{message:p})}),!p&&!d&&a.jsx(c0,{}),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 ${Lh[d.finding.tag]||""}`,style:Lh[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 ${zh[d.finding.severity]||""}`,style:d.finding.severity==="low"?r0:zh[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((x,g)=>a.jsx(i0,{citation:x},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((x,g)=>a.jsxs("div",{className:"text-[11px]",children:[a.jsx("span",{className:"text-disputed",children:"✗"})," disputed by ",x.agentId,": ",a.jsx("span",{style:{color:"var(--text-dim)"},children:x.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((x,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:x.signal}),a.jsx("span",{style:{color:"var(--text-dim)"},children:"·"}),a.jsx("span",{children:x.agentId}),x.counterpartId&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--text-dim)"},children:"→"}),a.jsx("span",{children:x.counterpartId})]}),a.jsx("span",{className:"ml-auto",style:{color:"var(--text-dim)"},children:wt(x.timestamp)})]}),x.evidence&&a.jsx("div",{className:"mt-0.5",style:{color:"var(--text-dim)"},children:x.evidence.slice(0,200)})]},g))})]}),a.jsx("div",{className:"pt-2 border-t border-border/40",children:a.jsxs("a",{href:ua(`/consensus/${d.consensusId}`),className:"font-mono text-[10px] hover:underline",style:{color:"var(--accent)"},children:["→ consensus round ",d.consensusId]})})]})]})})}const u0={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 d0({agentId:s}){const[r,u]=y.useState([]),[c,d]=y.useState(!0),[f,p]=y.useState("all"),[h,x]=y.useState(null);y.useEffect(()=>{let A=!1;return d(!0),ct(`signals?agent=${encodeURIComponent(s)}&limit=100`).then(K=>{A||(u(K.items||[]),d(!1))}).catch(()=>{A||(u([]),d(!1))}),()=>{A=!0}},[s]);const g=[...r].sort((A,K)=>(K.timestamp||"").localeCompare(A.timestamp||"")),v=f==="all"||f==="signals"?g:[],N=({k:A,label:K,enabled:O})=>a.jsx("button",{type:"button",onClick:()=>O&&p(A),disabled:!O,className:`rounded-sm px-2 py-0.5 font-mono text-[10px] font-semibold transition ${O?"":"opacity-40 cursor-not-allowed"}`,style:f===A?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:K});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(N,{k:"all",label:"All",enabled:!0}),a.jsx(N,{k:"signals",label:"Signals",enabled:!0}),a.jsx(N,{k:"tasks",label:"Tasks (none yet)",enabled:!1}),a.jsx(N,{k:"skills",label:"Skills (none yet)",enabled:!1})]})]}),c?a.jsx("div",{className:"py-6 text-center text-xs",style:{color:"var(--text-dim)"},children:"Loading…"}):v.length===0?a.jsx(ss,{title:"No activity yet",hint:"Signals, task completions, and skill binds will appear here.",compact:!0}):a.jsx("div",{className:"space-y-1",children:v.map((A,K)=>{const O=u0[A.signal]||"text-text-dim",T=!!(A.consensusId&&A.findingId),j=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:wt(A.timestamp)}),a.jsx("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[9px] font-bold ${O}`,children:A.signal}),a.jsxs("div",{className:"min-w-0 flex-1 text-[11px]",style:{color:"var(--text-dim)"},children:[A.counterpartId&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 70%, transparent)"},children:["→ ",A.counterpartId," · "]}),A.evidence&&a.jsx("span",{children:A.evidence.length>160?A.evidence.slice(0,160)+"…":A.evidence})]})]});return T?a.jsx("button",{type:"button",onClick:()=>x({consensusId:A.consensusId,findingId:A.findingId}),className:"w-full rounded-sm text-left transition hover:bg-accent/10",children:j},K):a.jsx("div",{children:j},K)})}),a.jsx(Ur,{open:!!h,onOpenChange:A=>{A||x(null)},consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function f0(){const s=y.useRef(null),[r,u]=y.useState(0);return y.useEffect(()=>{const c=s.current;if(!c||typeof ResizeObserver>"u")return;const d=new ResizeObserver(f=>{for(const p of f)u(p.contentRect.width)});return d.observe(c),()=>d.disconnect()},[]),[s,r]}const Bh={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"},m0={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"},h0=6,p0=500,Sp=100,x0=150;function g0(s){if(s<=0)return Sp;const r=Math.floor(s/h0);return Math.max(1,Math.min(r,p0))}function b0({agentId:s}){const[r,u]=y.useState([]),[c,d]=y.useState(0),[f,p]=y.useState(!1),[h,x]=y.useState(null),[g,v]=f0(),[N,A]=y.useState(Sp),K=y.useRef(null);y.useEffect(()=>{if(v<=0)return;const B=g0(v);return K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{A(P=>P===B?P:B)},x0),()=>{K.current&&clearTimeout(K.current)}},[v]),y.useEffect(()=>{ct(`signals?agent=${encodeURIComponent(s)}&limit=${N}`).then(B=>{u(B.items||[]),d(B.total||0)}).catch(()=>{})},[s,N]);const O=y.useMemo(()=>[...r].reverse(),[r]),T={confirmed:0,disputed:0,unique:0,unverified:0,fabricated:0};for(const B of r)B.signal==="agreement"||B.signal==="consensus_verified"?T.confirmed++:B.signal==="disagreement"||B.signal==="hallucination_caught"?T.disputed++:B.signal==="unique_confirmed"||B.signal==="unique_unconfirmed"||B.signal==="new_finding"?T.unique++:B.signal==="unverified"?T.unverified++:B.signal==="citation_fabricated"&&T.fabricated++;const j=r.length,L=c>j;return r.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(ss,{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:L?`last ${j} of ${c}`:`${c} total`})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[10px]",children:[a.jsxs("span",{className:"text-confirmed",children:[T.confirmed," confirmed"]}),T.disputed>0&&a.jsxs("span",{className:"text-disputed",children:[T.disputed," disputed"]}),T.unique>0&&a.jsxs("span",{className:"text-unique",children:[T.unique," unique"]}),T.unverified>0&&a.jsxs("span",{className:"text-unverified",children:[T.unverified," unverified"]}),T.fabricated>0&&a.jsxs("span",{className:"text-amber-500",children:[T.fabricated," fabricated"]})]})]}),a.jsx("div",{className:"flex items-center gap-0.5",children:O.map((B,P)=>{const V=!!(B.consensusId&&B.findingId);return a.jsx("button",{type:"button",disabled:!V,onClick:()=>{B.consensusId&&B.findingId&&(x({consensusId:B.consensusId,findingId:B.findingId}),p(!0))},className:`h-4 min-w-[4px] flex-1 rounded-sm transition-opacity hover:opacity-80 ${Bh[B.signal]||""} ${V?"cursor-pointer":"cursor-default"}`,style:Bh[B.signal]?void 0:{background:"var(--surface-sunk)"},title:`${m0[B.signal]||B.signal} — ${wt(B.timestamp)}${V?" (click for detail)":""}`},P)})}),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(B=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:`h-2 w-2 rounded-sm ${B.color}`}),a.jsx("span",{className:"font-mono text-[9px]",style:{color:"color-mix(in oklch, var(--text-dim) 60%, transparent)"},children:B.label})]},B.label))}),a.jsx(Ur,{open:f,onOpenChange:p,consensusId:(h==null?void 0:h.consensusId)??null,findingId:(h==null?void 0:h.findingId)??null})]})}function v0(s){const r=s.toLowerCase();return r==="completed"||r==="done"||r==="success"||r==="succeeded"?"completed":r==="running"||r==="active"||r==="in_progress"||r==="pending"?"running":r==="failed"||r==="error"||r==="errored"||r==="timeout"||r==="timed_out"?"failed":r==="cancelled"||r==="canceled"||r==="queued"||r==="waiting"?"cancelled":"unknown"}const y0={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}},N0={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 j0(s){if(!s)return"—";if(s<1e3)return"< 1s";if(s<6e4)return Math.floor(s/1e3)+"s";if(s<36e5){const c=Math.floor(s/6e4),d=Math.floor(s%6e4/1e3);return d>0?`${c}m ${d}s`:`${c}m`}const r=Math.floor(s/36e5),u=Math.floor(s%36e5/6e4);return u>0?`${r}h ${u}m`:`${r}h`}function kp({task:s,onClick:r}){const u=v0(s.status),c=y0[u];return a.jsxs("tr",{className:`border-b border-border hover:bg-accent/10 transition-colors ${r?"cursor-pointer":""}`,onClick:r?d=>{d.target.closest("a")||r(s)}: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: ${c.label}`,children:[a.jsx("span",{className:`flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border ${c.iconBox} ${c.text} ${c.pulse?"animate-pulse":""}`,style:c.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:N0[u]})}),a.jsx("span",{className:`font-mono text-[10px] font-semibold uppercase tracking-wider ${c.text}`,style:c.textStyle,children:c.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:s.taskId,children:s.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(s.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:Cn(s.agentId)}}),s.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=s.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":j0(s.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:wt(s.timestamp)})]})}function vt({className:s="",style:r}){return a.jsx("div",{className:`rounded ${s}`,style:{background:"color-mix(in oklch, var(--border) 40%, transparent)",...r}})}function S0(){return a.jsxs("div",{className:"mx-auto max-w-5xl space-y-6 px-6 py-6",children:[a.jsx(vt,{className:"h-48 w-full"}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[a.jsx(vt,{className:"h-36"}),a.jsx(vt,{className:"h-36"}),a.jsx(vt,{className:"h-36"})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[a.jsx(vt,{className:"h-48"}),a.jsx(vt,{className:"h-48"})]})]})}function k0(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(vt,{className:"mb-2 h-7 w-32"}),a.jsx(vt,{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((s,r)=>a.jsx(vt,{className:"h-16"},r))}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:6}).map((s,r)=>a.jsx(vt,{className:"h-12"},r))})]})}function _0(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(vt,{className:"mb-2 h-7 w-24"}),a.jsx(vt,{className:"h-3 w-32"})]}),a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:8}).map((s,r)=>a.jsx(vt,{className:"h-11"},r))})]})}function E0(){return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(vt,{className:"mb-2 h-7 w-48"}),a.jsx(vt,{className:"h-3 w-64"})]}),a.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,r)=>a.jsxs("div",{className:"overflow-hidden rounded-md",children:[a.jsx(vt,{className:"h-14"}),a.jsx("div",{className:"mt-px space-y-px",children:Array.from({length:3}).map((u,c)=>a.jsx(vt,{className:"h-10"},c))})]},r))})]})}function w0(){return a.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((s,r)=>a.jsxs("div",{className:"flex items-start gap-3 py-2",children:[a.jsx(vt,{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(vt,{className:"h-3 w-3/4"}),a.jsx(vt,{className:"h-3 w-1/2"})]})]},r))})}function T0(){return a.jsx("div",{className:"space-y-px overflow-hidden rounded-md",children:Array.from({length:5}).map((s,r)=>a.jsx(vt,{className:"h-10"},r))})}const A0=3,M0=720*60*60*1e3;function C0({agentId:s,agents:r,tasks:u,consensus:c}){const d=r.find(Y=>Y.id===s),[f,p]=y.useState([]),[h,x]=y.useState(!0),[g,v]=y.useState([]),[N,A]=y.useState(!0),[K,O]=y.useState(null),[T,j]=y.useState(null),[L,B]=y.useState(null),[P,V]=y.useState(0),[M,R]=y.useState(0),[_,Q]=y.useState(null);y.useEffect(()=>{x(!0),ct(`memory/${s}`).then(Y=>{p(Y.knowledge||[])}).catch(()=>p([])).finally(()=>x(!1))},[s]),y.useEffect(()=>{let Y=!1;return A(!0),ct("consensus-reports?page=1&pageSize=200").then(me=>{Y||v(me.reports||[])}).catch(()=>{Y||v([])}).finally(()=>{Y||A(!1)}),()=>{Y=!0}},[]);const F=y.useMemo(()=>{var Ge;const Y=Date.now(),me=new Map;for(const Re of g){const it=Date.parse(Re.timestamp);if(Number.isNaN(it)||Y-it>M0)continue;const Kt=(Ge=Re.authorDiagnostics)==null?void 0:Ge[s];if(Kt)for(const Lt of Kt)me.set(Lt.code,(me.get(Lt.code)??0)+1)}const ge=[];for(const[Re,it]of me)it>=A0&&ge.push({code:Re,count:it});return ge},[g,s]);if(!d)return a.jsxs("div",{className:"py-20 text-center",style:{color:"var(--text-dim)"},children:["Agent not found: ",s]});const G=d.scores,ue=(u==null?void 0:u.items.filter(Y=>Y.agentId===s))||[],ae=(c==null?void 0:c.runs.filter(Y=>Y.agents.includes(s)))||[],oe=[{label:"accuracy",value:G.accuracy,fill:G.accuracy>=.7?"bg-confirmed":G.accuracy>=.4?"bg-unverified":"bg-disputed"},{label:"unique",value:G.uniqueness,fill:"bg-unique"},{label:"impact",value:G.impactScore,fill:"bg-[var(--c8)]"}],pe=G.unverifiedsEmitted??0,D=G.unverifiedsReceived??0,w=pe+D,I=[{label:"Signals",value:String(G.signals),color:"",colorStyle:{color:"var(--text)"}},{label:"Agreements",value:String(G.agreements),color:"text-confirmed",colorStyle:void 0},{label:"Disagreements",value:String(G.disagreements),color:"text-disputed",colorStyle:void 0},{label:"Hallucinations",value:String(G.hallucinations),color:G.hallucinations>0?"text-disputed":"",colorStyle:G.hallucinations>0?void 0:{color:"var(--text-dim)"}},{label:"Unverified",value:w>0?`${pe}↑ ${D}↓`:"0",color:w>0?"text-unverified":"",colorStyle:w>0?void 0:{color:"var(--text-dim)"},title:w>0?`${pe} emitted (as reviewer) · ${D} received (as author)`:void 0},{label:"Tokens",value:d.totalTokens.toLocaleString(),color:"",colorStyle:{color:"var(--text)"}}],ne=10,le=Math.max(1,Math.ceil(ue.length/ne)),de=Math.min(P,le-1),S=ue.slice(de*ne,(de+1)*ne),U=y.useMemo(()=>{const Y=new Map;for(const me of f){const ge=me.filename.match(/^(\d{4}-\d{2}-\d{2})/),Ge=ge?ge[1]:"undated",Re=Y.get(Ge)||[];Re.push(me),Y.set(Ge,Re)}return Array.from(Y.entries()).sort(([me],[ge])=>me==="undated"?1:ge==="undated"?-1:ge.localeCompare(me)).map(([me,ge])=>({day:me,items:ge}))},[f]),se=Math.min(M,Math.max(0,U.length-1)),ee=U[se];return a.jsxs(a.Fragment,{children:[(()=>{const Y=Eu(G);return Y==="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 (",G.bench.reason??"unknown","). Agent excluded from dispatch until scores recover."]})]})}):Y==="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:[G.consecutiveFailures,"+ consecutive failures. Deprioritized until clean signals recorded."]})]})}):Y==="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 (",G.bench.reason??"rule","), but is the sole provider of a category — kept to preserve coverage."]})]})}):null})(),F.length>0&&a.jsx("div",{className:"mb-6 space-y-2",children:F.map(({code:Y,count:me})=>a.jsxs("div",{className:"rounded-lg border border-unverified/30 bg-unverified/5 px-4 py-3","data-diagnostic-code":Y,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:yu(Y)}}),a.jsxs("span",{className:"font-mono text-[11px] text-unverified/60",children:["· ",me," 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:Y}),". Inspect recent consensus rounds on this page for the per-finding banner, or check upstream pipeline layers (sanitizer / renderer / relay encoding)."]})]},Y))}),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(G.accuracy*100)}% · Uniqueness ${Math.round(G.uniqueness*100)}% · Impact ${Math.round(G.impactScore*100)}%`,children:a.jsx(ri,{agentId:d.id,size:120,signals:G.signals,accuracy:G.accuracy,uniqueness:G.uniqueness,impact:G.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:[G.signals," signals",d.lastTask?` · ${wt(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 ${G.dispatchWeight.toFixed(2)}
|
|
81
|
+
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:G.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(b0,{agentId:s})}),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:oe.map(Y=>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:Y.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 ${Y.fill}`,style:{width:`${Math.max(0,Math.min(100,Y.value*100))}%`}})}),a.jsxs("span",{className:"text-right font-mono text-[11px] font-bold tabular-nums",style:{color:"var(--text)"},children:[Math.round(Y.value*100),"%"]})]},Y.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:I.map(Y=>a.jsxs("div",{className:"px-2 py-2 text-center",style:{background:"color-mix(in oklch, var(--surface) 60%, transparent)"},title:Y.title,children:[a.jsx("div",{className:`font-mono text-sm font-bold tabular-nums ${Y.color}`,style:Y.colorStyle,children:Y.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:Y.label})]},Y.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(Zy,{categoryAccuracy:G.categoryAccuracy,categoryCorrect:G.categoryCorrect,categoryHallucinated:G.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(Y=>a.jsx(t0,{slot:Y},Y.name))}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.skills.map(Y=>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:Y},Y))})]}),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:ue.length})]}),le>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(Y=>Math.max(0,Y-1)),disabled:de===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:[de+1," / ",le]}),a.jsx("button",{onClick:()=>V(Y=>Math.min(le-1,Y+1)),disabled:de>=le-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 ▸"})]})]}),ue.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:S.map(Y=>a.jsx(kp,{task:Y,onClick:Q},Y.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",!N&&a.jsxs("span",{style:{color:"var(--ink)",fontWeight:700},children:[" ",ae.length]})]}),N?a.jsx(T0,{}):ae.length>0?a.jsx("div",{className:"space-y-2",children:ae.slice(0,20).map((Y,me)=>{const ge=Y.counts,Ge=(ge.agreement||0)+(ge.disagreement||0)+(ge.hallucination||0)+(ge.unverified||0)+(ge.unique||0)+(ge.new||0),Re=Ge||1,it=[{key:"confirmed",count:ge.agreement||0,color:"bg-confirmed",text:"text-confirmed"},{key:"disputed",count:(ge.disagreement||0)+(ge.hallucination||0),color:"bg-disputed",text:"text-disputed"},{key:"unverified",count:ge.unverified||0,color:"bg-unverified",text:"text-unverified"},{key:"unique",count:(ge.unique||0)+(ge.new||0),color:"bg-unique",text:"text-unique"}],Kt={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"}},Lt=Y.signals.filter(Ye=>Ye.signal!=="signal_retracted"&&Kt[Ye.signal]),Rn=Y.taskId+":"+me,Ht=T===Rn;return a.jsxs("div",{className:"rounded-md border border-border/40",style:{background:"var(--surface-elev)"},children:[a.jsx("button",{type:"button",onClick:()=>j(Ht?null:Rn),disabled:Lt.length===0,className:`flex w-full items-center p-3 text-left transition ${Lt.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:[Lt.length>0&&a.jsx("span",{className:"mr-1.5 inline-block",style:{color:"var(--text-dim)"},children:Ht?"▾":"▸"}),Ge," findings"]}),a.jsx("span",{className:"font-mono text-xs",style:{color:"var(--text-dim)"},children:wt(Y.timestamp)})]}),a.jsx("div",{className:"mt-1.5 flex gap-2",children:it.map(Ye=>Ye.count>0&&a.jsxs("span",{className:`font-mono text-[10px] font-semibold ${Ye.text}`,children:[Ye.count," ",Ye.key]},Ye.key))}),a.jsx("div",{className:"mt-1.5 flex h-1.5 overflow-hidden rounded-sm",children:it.map(Ye=>Ye.count>0&&a.jsx("div",{className:Ye.color,style:{width:`${Ye.count/Re*100}%`}},Ye.key))})]})}),Ht&&Lt.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:Lt.map((Ye,wn)=>{const hn=Kt[Ye.signal],On=!!(Ye.findingId&&Y.taskId),re=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 ${hn.cls}`,children:hn.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:ii(Ye.evidence||"")}}),a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"color-mix(in oklch, var(--text-dim) 50%, transparent)"},children:[Ye.agentId,Ye.counterpartId?` + ${Ye.counterpartId}`:""]})]})]});return On?a.jsx("button",{type:"button",onClick:()=>B({consensusId:Y.taskId,findingId:Ye.findingId}),className:"block w-full rounded-sm text-left transition hover:bg-accent/10",children:re},wn):a.jsx("div",{children:re},wn)})})})]},Rn)})}):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(d0,{agentId:s})}),a.jsx(Ur,{open:!!L,onOpenChange:Y=>{Y||B(null)},consensusId:(L==null?void 0:L.consensusId)??null,findingId:(L==null?void 0:L.findingId)??null}),a.jsx(jp,{task:_,onClose:()=>Q(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:[" ",f.length," files"]}),!h&&ee&&a.jsxs("span",{className:"ml-2 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:["· ",ee.day," (",ee.items.length,")"]})]}),!h&&U.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:()=>R(Y=>Math.max(0,Y-1)),disabled:se===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:[se+1," / ",U.length]}),a.jsx("button",{onClick:()=>R(Y=>Math.min(U.length-1,Y+1)),disabled:se>=U.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(w0,{}):ee&&ee.items.length>0?a.jsx("div",{className:"space-y-1.5",children:ee.items.map(Y=>{var Re,it;const me=K===Y.filename,ge=((Re=Y.frontmatter)==null?void 0:Re.type)||"memory",Ge=((it=Y.frontmatter)==null?void 0:it.name)||Y.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:()=>O(me?null:Y.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:me?"var(--text)":"var(--text-dim)"},children:me?"▾":"▸"}),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:ge}),a.jsx("span",{className:"truncate font-mono text-xs font-semibold",style:{color:"var(--text)"},children:Ge}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--text-dim)"},children:Y.filename})]}),me&&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:Y.content})})]},Y.filename)})}):a.jsx("div",{className:"py-6 text-center text-sm",style:{color:"var(--text-dim)"},children:"No memory files."})]})]})}const Uh={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)"}},R0={error:"text-disputed",timeout:"text-unverified"},O0=[[/^\[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 D0(s){for(const[r,u]of O0)if(r.test(s))return u;return"other"}const z0=[{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"}],$h=1e3;function L0(){const[s,r]=y.useState([]),[u,c]=y.useState(0),[d,f]=y.useState(0),[p,h]=y.useState("all"),[x,g]=y.useState(!0),[v,N]=y.useState(!0),A=y.useRef(null),K=y.useRef(0);y.useEffect(()=>{let j=!1;return(async()=>{try{const B=await ct("logs?tail=500");if(j)return;r(B.entries),c(B.totalLines),f(B.fileSize),K.current=B.totalLines+1}catch{}})(),()=>{j=!0}},[]),y.useEffect(()=>{if(v)return xp(j=>{var B;if(j.type!=="log_lines")return;const L=(B=j.data)==null?void 0:B.lines;L!=null&&L.length&&r(P=>{const V=L.map((R,_)=>({line:K.current+_,text:R,category:D0(R)}));K.current+=L.length,c(R=>R+L.length);const M=[...P,...V];return M.length>$h?M.slice(-$h):M})})},[v]),y.useEffect(()=>{x&&A.current&&A.current.scrollIntoView({behavior:"smooth"})},[s,x]);const O=p==="all"?s:s.filter(j=>j.category===p),T=y.useCallback(j=>j<1024?`${j} B`:j<1048576?`${(j/1024).toFixed(1)} KB`:`${(j/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:T(d)}),v&&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:[z0.map(j=>a.jsx("button",{onClick:()=>h(j.key),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:p===j.key?{background:"var(--surface-sunk)",color:"var(--text)"}:{color:"var(--text-dim)"},children:j.label},j.key)),a.jsxs("div",{className:"ml-auto flex gap-1.5",children:[a.jsx("button",{onClick:()=>N(!v),className:`rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition ${v?"bg-confirmed/10 text-confirmed":""}`,style:v?void 0:{color:"var(--text-dim)"},children:v?"● Live":"○ Paused"}),a.jsx("button",{onClick:()=>g(!x),className:"rounded-sm px-2.5 py-1 font-mono text-[10px] font-semibold transition",style:x?{color:"var(--ok)",background:"color-mix(in oklch, var(--ok) 10%, transparent)"}:{color:"var(--text-dim)"},children:x?"⤓ 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:[O.map(j=>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:j.line}),a.jsx("span",{className:R0[j.category]??"",style:Uh[j.category]??Uh.other,children:j.text})]},j.line)),O.length===0&&a.jsx("div",{className:"py-8 text-center font-mono text-xs",style:{color:"var(--text-dim)"},children:s.length===0?"Loading...":p==="all"?"No log entries in current tail.":`No ${p} entries in current tail.`}),a.jsx("div",{ref:A})]})})]})}const B0=["critical","high","medium","low"],U0=["manual","impl","meta","auto-provisional"];function qh(s,r){return s.includes(r)?s.filter(u=>u!==r):[...s,r]}const qn="mb-1 block h-section",Hn={},$a="w-full rounded border border-border px-2 py-1 font-mono text-[10px] focus:border-primary focus:outline-none",qa={background:"var(--surface)",color:"var(--text)"};function $0({filters:s,onChange:r,agents:u,signalTypes:c}){const d=f=>p=>{const h=p.target.value;r({[f]: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:()=>r({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:qn,style:Hn,children:["Agents (",s.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(f=>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:s.agents.includes(f),onChange:()=>r({agents:qh(s.agents,f)})}),a.jsx("span",{children:f})]},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Counterpart"}),a.jsxs("select",{className:$a,style:qa,value:s.counterpart??"",onChange:d("counterpart"),children:[a.jsx("option",{value:"",children:"any"}),u.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:qn,style:Hn,children:["Signal types (",s.signals.length,")"]}),a.jsxs("div",{className:"max-h-32 overflow-y-auto rounded border border-border/60 p-1",style:{background:"var(--surface)"},children:[c.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"}),c.map(f=>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:s.signals.includes(f),onChange:()=>r({signals:qh(s.signals,f)})}),a.jsx("span",{children:f})]},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Severity"}),a.jsxs("select",{className:$a,style:qa,value:s.severity??"",onChange:d("severity"),children:[a.jsx("option",{value:"",children:"any"}),B0.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,"data-tooltip":"manual = operator-recorded · impl = implementer pipeline · meta = orchestrator self-telemetry · auto-provisional = unvalidated",children:"Source"}),a.jsxs("select",{className:$a,style:qa,value:s.source??"",onChange:d("source"),children:[a.jsx("option",{value:"",children:"any"}),U0.map(f=>a.jsx("option",{value:f,children:f},f))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Category"}),a.jsx("input",{type:"text",className:$a,style:qa,value:s.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:qn,style:Hn,children:"Since"}),a.jsx("input",{type:"datetime-local",className:$a,style:qa,value:s.since?s.since.slice(0,16):"",onChange:f=>r({since:f.target.value?new Date(f.target.value).toISOString():void 0})})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Until"}),a.jsx("input",{type:"datetime-local",className:$a,style:qa,value:s.until?s.until.slice(0,16):"",onChange:f=>r({until:f.target.value?new Date(f.target.value).toISOString():void 0})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Consensus ID (prefix)"}),a.jsx("input",{type:"text",className:$a,style:qa,value:s.consensusId??"",onChange:d("consensusId"),placeholder:"e.g. d07eac46"})]}),a.jsxs("div",{children:[a.jsx("label",{className:qn,style:Hn,children:"Finding ID (prefix)"}),a.jsx("input",{type:"text",className:$a,style:qa,value:s.findingId??"",onChange:d("findingId"),placeholder:"e.g. d07eac46-5f464e89:sonnet"})]})]})}const Hh={agents:[],signals:[]},q0=["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"],H0={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"},I0={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)"},G0={critical:"var(--bad)",high:"var(--warn)",medium:"var(--severity-medium)",low:"var(--ink-3)"},ni=100;function Y0(){if(typeof window>"u")return{filters:Hh,hadAny:!1};const s=new URLSearchParams(window.location.search),r=s.getAll("signal").filter(Boolean),u=s.get("agent"),c=s.get("counterpart")??void 0,d=s.get("category")??void 0,f=s.get("severity"),p=f==="critical"||f==="high"||f==="medium"||f==="low"?f:void 0,h=s.get("since")??void 0,x=s.get("until")??void 0,g=s.get("consensus_id")??void 0,v=s.get("finding_id")??void 0,N=s.get("source"),A=N==="manual"||N==="impl"||N==="meta"||N==="auto-provisional"?N:void 0;return r.length>0||u||c||d||p||h||x||g||v||A?{filters:{agents:u?[u]:[],signals:r,counterpart:c,category:d,severity:p,since:h,until:x,consensusId:g,findingId:v,source:A},hadAny:!0}:{filters:Hh,hadAny:!1}}function X0(s,r,u=ni){const c=new URLSearchParams;c.set("limit",String(u)),c.set("offset",String(r)),s.agents.length===1&&c.set("agent",s.agents[0]),s.counterpart&&c.set("counterpart",s.counterpart);for(const d of s.signals)c.append("signal",d);return s.category&&c.set("category",s.category),s.severity&&c.set("severity",s.severity),s.since&&c.set("since",s.since),s.until&&c.set("until",s.until),s.consensusId&&c.set("consensus_id",s.consensusId),s.findingId&&c.set("finding_id",s.findingId),s.source&&c.set("source",s.source),c}function ou(s,r){return s?s.length>r?s.slice(0,r)+"…":s:""}function K0(){const[{filters:s,hadAny:r}]=y.useState(Y0),[u,c]=y.useState(s),[d,f]=y.useState([]),[p,h]=y.useState(0),[x,g]=y.useState(0),[v,N]=y.useState(!1),[A,K]=y.useState(null),[O,T]=y.useState([]),[j,L]=y.useState(!1),[B,P]=y.useState(null),[V,M]=y.useState(null),R=y.useRef(null),_=y.useRef(0),Q=y.useCallback(async(D,w)=>{const I=++_.current;N(!0),K(null);try{const ne=X0(D,w*ni),le=await ct(`signals?${ne.toString()}`);if(I!==_.current)return;f(le.items??[]),g(le.total??0)}catch(ne){if(I!==_.current)return;K(ne instanceof Error?ne.message:"fetch failed")}finally{I===_.current&&N(!1)}},[]);y.useEffect(()=>{ct("agents").then(D=>{const w=(D??[]).map(I=>I.id).filter(Boolean).sort();w.length>0&&T(w)}).catch(()=>{})},[]),y.useEffect(()=>{h(0)},[u]),y.useEffect(()=>(R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{Q(u,p)},250),()=>{R.current&&clearTimeout(R.current)}),[u,p,Q]);const F=y.useCallback(D=>{c(w=>({...w,...D}))},[]),G=Math.max(1,Math.ceil(x/ni)),ue=Math.min(p,G-1),ae=x>0||r||v,oe=(D,w)=>{!D||!w||(P(D),M(w),L(!0))},pe=y.useMemo(()=>{const D=[];return u.agents.length&&D.push(`${u.agents.length} agents`),u.signals.length&&D.push(`${u.signals.length} signals`),u.severity&&D.push(u.severity),u.source&&D.push(u.source),(u.since||u.until)&&D.push("time window"),D.length?D.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:[pe," — showing ",d.length," of ",x]})]})}),r&&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:ua("/signals"),style:{color:"var(--accent)"},children:"Clear filters"})]}),a.jsxs("div",{className:`grid grid-cols-1 gap-4 ${ae?"lg:grid-cols-[260px_1fr]":""} lg:items-start`,children:[ae&&a.jsx("div",{className:r?"opacity-70 transition-opacity hover:opacity-100 focus-within:opacity-100":void 0,children:a.jsx($0,{filters:u,onChange:F,agents:O,signalTypes:q0})}),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:[A&&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:A}),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&&!v&&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((D,w)=>{const I=!!(D.consensusId&&D.findingId),ne=D.severity?G0[D.severity]:"transparent",le=I0[D.signal]??"var(--ink-2)",de=H0[D.signal]??D.signal;return a.jsxs("tr",{className:`border-b border-border/30 ${I?"cursor-pointer transition-colors":""}`,style:I?{"--row-hover-bg":"color-mix(in oklch, var(--surface-sunk) 40%, transparent)"}:void 0,role:I?"button":void 0,tabIndex:I?0:void 0,"aria-label":I?`View finding ${D.findingId??""}`:void 0,onMouseEnter:S=>{I&&(S.currentTarget.style.background="color-mix(in oklch, var(--surface-sunk) 40%, transparent)")},onMouseLeave:S=>{I&&(S.currentTarget.style.background="")},onClick:()=>I&&oe(D.consensusId,D.findingId),onKeyDown:S=>{I&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),oe(D.consensusId,D.findingId))},children:[a.jsx("td",{className:"p-0",style:{background:ne,width:6},title:D.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:D.timestamp,children:wt(D.timestamp)}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1 font-mono",style:{color:"var(--text)"},children:D.agentId}),a.jsx("td",{className:"whitespace-nowrap px-2 py-1",children:a.jsx("span",{className:"h-section",style:{color:le,fontSize:11},children:de})}),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:D.evidence,children:ou(D.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:D.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:D.findingId,children:D.findingId?ou(D.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:D.consensusId,children:D.consensusId?ou(D.consensusId,16):"—"})]},`${D.timestamp}-${D.agentId}-${w}`)})]})]})}),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…":`${ue*ni+1}–${ue*ni+d.length} of ${x}`}),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(D=>Math.max(0,D-1)),disabled:ue===0||v,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:[ue+1," / ",G]}),a.jsx("button",{type:"button",onClick:()=>h(D=>Math.min(G-1,D+1)),disabled:ue>=G-1||v,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(Ur,{open:j,onOpenChange:L,consensusId:B,findingId:V})]})}function V0(){if(typeof window>"u")return null;const s=new URLSearchParams(window.location.search),r=s.get("key");if(r===null)return null;s.delete("key");const u=s.toString(),c=window.location.pathname+(u?`?${u}`:"")+window.location.hash;return window.history.replaceState(null,"",c),r.trim()||null}function Q0(){const[s,r]=y.useState(null),[u,c]=y.useState(null),d=y.useRef(!1),f=y.useCallback(async h=>{c(null);const x=await zb(h);x.ok?r(!0):(c(x.kind),r(!1))},[]),p=y.useCallback(async()=>{if(d.current)return s===!0;d.current=!0;try{const h=await fu();return r(h),h}finally{d.current=!1}},[s]);return y.useEffect(()=>{let h=!1;const x=V0();return d.current=!0,(async()=>{try{if(await fu()){h||r(!0);return}if(x){h||await f(x);return}h||r(!1)}finally{d.current=!1}})(),()=>{h=!0}},[f]),{authed:s,login:f,error:u,recheck:p}}function Z0(s,r){const u=r.match(/^API error: (\d+)$/),c=u?`HTTP ${u[1]}`:r;return`${s}: ${c}`}const F0=5e3;async function Ar(s,r){try{return await ct(r)}catch(u){const c=u instanceof Error?u.message:String(u);throw new Error(Z0(s,c))}}function J0(s){const[r,u]=y.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}),c=y.useRef(!1),d=y.useRef(s);d.current=s;const f=y.useCallback(async()=>{var p;if(!c.current){c.current=!0;try{const[h,x,g,v,N,A,K,O,T,j]=await Promise.all([Ar("overview","overview"),Ar("agents","agents"),Ar("tasks","tasks?limit=2000"),Ar("consensus","consensus?pageSize=500"),ct("consensus-reports?page=1&pageSize=200").catch(()=>({reports:[]})),ct("fleet-trend?days=7").catch(()=>({days:7,points:[]})),ct("signal-activity").catch(()=>({agents:[],total:0,generatedAt:""})),ct("skills").catch(()=>({index:{},suggestions:[],effectiveness:[]})),ct("native-memory").catch(()=>({knowledge:[]})),ct("gossip-memory").catch(()=>({knowledge:[]}))]),L=[...T.knowledge||[]].map(P=>({...P,origin:"native"})).sort((P,V)=>V.filename>P.filename?1:-1),B=[...j.knowledge||[]].map(P=>({...P,origin:"gossip"})).sort((P,V)=>V.filename>P.filename?1:-1);u({overview:h,agents:x,tasks:g,consensus:v,consensusReports:N,fleetTrend:A,signalActivity:K,skills:O,nativeMemories:L,gossipMemories:B,memories:L,loading:!1,error:null})}catch(h){Db(h)?((p=d.current)==null||p.call(d),u(x=>({...x,loading:!1}))):u(x=>({...x,loading:!1,error:h.message}))}finally{c.current=!1}}},[]);return y.useEffect(()=>{f()},[f]),y.useEffect(()=>{const p=setInterval(()=>{f()},F0);return()=>clearInterval(p)},[f]),{...r,refresh:f}}const _p="dashboard:lastEventId";function W0(){if(typeof window>"u")return 0;const s=window.localStorage.getItem(_p);if(!s)return 0;const r=parseInt(s,10);return Number.isFinite(r)?r:0}function P0(s){typeof window>"u"||window.localStorage.setItem(_p,String(s))}const Ih=1e3,e1=5e3;function Ep(s){y.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let r=null,u=null,c=Ih,d=!1;function f(){if(d)return;const p=W0();r=new window.EventSource(`/dashboard/api/events?last_id=${p}`),r.onmessage=h=>{try{const x=JSON.parse(h.data);s(x),P0(x.id),c=Ih}catch{}},r.onerror=()=>{r&&(r.close(),r=null),!d&&(u=setTimeout(()=>{f()},c),c=Math.min(c*2,e1))}}return f(),()=>{d=!0,u!==null&&clearTimeout(u),r&&(r.close(),r=null)}},[])}const Gh=5,t1=6e3;function n1({toast:s,onDismiss:r}){const u=y.useRef(null),c=y.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),d=y.useCallback(()=>{c(),u.current=setTimeout(()=>r(s.id),t1)},[s.id,r,c]);y.useEffect(()=>(d(),c),[d,c]);const{type:f,payload:p}=s.event,h=f==="task.completed"?a.jsx("span",{style:{color:"var(--text-dim)"},children:"✓"}):p.confirmed>p.disputed?a.jsx("span",{className:"text-confirmed",children:"◎"}):a.jsx("span",{className:"text-disputed",children:"◎"});let x;if(f==="task.completed"){const v=String(p.agentId??"agent"),N=typeof p.durationMs=="number"?p.durationMs:null,A=N!==null?`${(N/1e3).toFixed(1)}s`:"—";x=`${v} finished in ${A}`}else{const v=Number(p.confirmed??0),N=Number(p.disputed??0);x=`Consensus done — ${v} confirmed · ${N} disputed`}const g=()=>{c(),f==="task.completed"&&p.taskId?as("/tasks"):f==="consensus.completed"&&p.consensusId&&as("/debates"),r(s.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",s.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:c,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:x,className:"font-mono text-[11px] min-w-0 truncate",style:{color:"var(--text)"},children:x}),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:v=>{v.stopPropagation(),c(),r(s.id)},"aria-label":"Dismiss notification",children:"×"})]})})}function a1(){const[s,r]=y.useState([]),u=y.useCallback(d=>{r(f=>f.map(p=>p.id===d?{...p,exiting:!0}:p)),setTimeout(()=>{r(f=>f.filter(p=>p.id!==d))},250)},[]),c=y.useCallback(d=>{r(f=>{const p={id:d.id,event:d,exiting:!1},h=[...f,p];if(h.length>Gh){const x=h.length-Gh;return h.slice(x)}return h})},[]);return Ep(c),a.jsx("div",{className:"fixed bottom-20 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:s.map(d=>a.jsx(n1,{toast:d,onDismiss:u},d.id))})}const cu=1e3,l1=5e3,s1="/dashboard/api/bridge/stream",i1=4,Yh="/dashboard/api/bridge",Xh=3e4;function Kh(s){switch(s){case 400:return"message rejected — invalid or empty";case 429:return"rate limited — slow down";case 503:return"no live Claude Code session — start `gossipcat code`";case 401:return"session expired — reload to re-authenticate";default:return`send failed — HTTP ${s}`}}let r1=1;function Pl(s,r,u,c){return{id:r1++,role:s,text:r,ts:u??new Date().toISOString(),serverId:c}}function Mr(s,r){const u=s[s.length-1];if(!u||r.ts>=u.ts)return[...s,r];const c=s.findIndex(d=>d.ts>r.ts);return c<0?[...s,r]:[...s.slice(0,c),r,...s.slice(c)]}function o1(s={}){const{initialChatId:r=null,active:u=!0}=s,[c,d]=y.useState([]),[f,p]=y.useState("connecting"),[h,x]=y.useState(!1),[g,v]=y.useState(r),[N,A]=y.useState(null),[K,O]=y.useState(0),[T,j]=y.useState(null),L=y.useRef(u);L.current=u;const B=y.useCallback(()=>O(0),[]),P=y.useCallback(()=>{L.current||O(G=>G+1)},[]),V=y.useRef(r),M=y.useCallback(G=>{var ae;const ue=V.current;V.current=G,v(G),ue!==G&&((ae=_.current)==null||ae.call(_))},[]),R=y.useRef(0),_=y.useRef(null);y.useEffect(()=>{if(typeof window>"u"||typeof window.EventSource>"u")return;let G=null,ue=null,ae=cu,oe=!1,pe=0;function D(){if(oe)return;p("connecting");const le=R.current,de=V.current?`&chat_id=${encodeURIComponent(V.current)}`:"";G=new window.EventSource(`${s1}?last_id=${le}${de}`),G.onopen=()=>{oe||(pe=0,p("open"),ae=cu)},G.onmessage=S=>{var ee;let U;try{U=JSON.parse(S.data)}catch{return}const se=V.current;!se||U.chat_id!==se||(U.type==="reply"?(x(!1),d(Y=>Mr(Y,Pl("assistant",U.text??"",U.ts))),P()):U.type==="ack"?d(Y=>Mr(Y,Pl("ack","received — working…",U.ts))):U.type==="error"?(x(!1),d(Y=>Mr(Y,Pl("error",U.text??"the live session reported an error",U.ts))),P()):U.type==="question"?I(U):U.type==="mirror"?w(U):U.type==="restart"&&(R.current=0,(ee=_.current)==null||ee.call(_)))},G.onerror=()=>{G&&(G.close(),G=null),!oe&&(pe+=1,pe>=i1?p("error"):p("connecting"),ue=setTimeout(()=>D(),ae),ae=Math.min(ae*2,l1))}}function w(le){const de=le.role;if(de!=="user"&&de!=="assistant"&&de!=="activity")return;typeof le.id=="number"&&le.id>R.current&&(R.current=le.id),de==="assistant"&&x(!1);const S=typeof le.text=="string"?le.text:"",U=typeof le.ts=="string"&&/^\d{4}-\d{2}-\d{2}T/.test(le.ts)?le.ts:void 0;d(se=>Mr(se,Pl(de,S,U,le.id))),P()}function I(le){if(typeof le.qid!="string"||le.qid.length===0||!Array.isArray(le.questions)||le.questions.length===0)return;for(const S of le.questions)if(!S||typeof S.questionId!="string"||typeof S.header!="string"||typeof S.question!="string"||!Array.isArray(S.options)||S.options.length===0||S.options.some(U=>!U||typeof U.label!="string"))return;const de=typeof le.ts=="string"&&/^\d{4}-\d{2}-\d{2}T/.test(le.ts)?le.ts:new Date().toISOString();j({qid:le.qid,questions:le.questions,ts:de}),P()}function ne(){oe||(ue!==null&&(clearTimeout(ue),ue=null),G&&(G.close(),G=null),ae=cu,D())}return _.current=ne,D(),()=>{oe=!0,_.current=null,p("closed"),ue!==null&&clearTimeout(ue),G&&(G.close(),G=null)}},[P]);const Q=y.useCallback(async G=>{const ue=G.trim();if(ue.length===0)return;A(null),d(w=>[...w,Pl("user",ue)]),x(!0);const ae=V.current,oe={message:ue};ae&&(oe.chat_id=ae);const pe=new AbortController,D=setTimeout(()=>pe.abort(),Xh);try{const w=await fetch(Yh,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(oe),signal:pe.signal});let I={};try{I=await w.json()}catch{}if(typeof I.chat_id=="string"&&I.chat_id.length>0&&!V.current&&M(I.chat_id),w.status===202)return;x(!1),A(I.error??Kh(w.status))}catch(w){x(!1);const I=w instanceof Error&&w.name==="AbortError";A(I?"send timed out — relay unreachable":"send failed — relay unreachable")}finally{clearTimeout(D)}},[M]),F=y.useCallback(async G=>{const ue=T,ae=V.current;if(!ue||!ae)return!1;A(null);const oe=G.map(w=>{const I=ue.questions.find(de=>de.questionId===w.questionId),ne=(I==null?void 0:I.header)??w.questionId,le=[];return w.selected.length>0&&le.push(w.selected.join(", ")),w.other&&w.other.trim().length>0&&le.push(`other: "${w.other.trim()}"`),`${ne}: ${le.join(" · ")}`}).join(" · ");d(w=>[...w,Pl("user",oe)]),x(!0),j(null);const pe=new AbortController,D=setTimeout(()=>pe.abort(),Xh);try{const w=await fetch(Yh,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({chat_id:ae,answer:{qid:ue.qid,responses:G}}),signal:pe.signal});if(w.status===202)return!0;let I={};try{I=await w.json()}catch{}return x(!1),A(I.error??Kh(w.status)),!1}catch(w){x(!1);const I=w instanceof Error&&w.name==="AbortError";return A(I?"answer timed out — relay unreachable":"answer failed — relay unreachable"),!1}finally{clearTimeout(D)}},[T]);return{messages:c,status:f,awaitingReply:h,chatId:g,unread:K,send:Q,sendError:N,markRead:B,pendingQuestion:T,submitAnswer:F}}const Nu="gossipcat_chat_tabs",ju=8,Vh=18,wp=y.createContext(null);let Qh=0;function Or(){return Qh+=1,`tab-${Date.now().toString(36)}-${Qh}`}function c1(s,r){const u=s.find(c=>c.role==="user"&&c.text.trim().length>0);if(u){const c=u.text.trim().replace(/\s+/g," ");return c.length>Vh?`${c.slice(0,Vh)}…`:c}return r&&r.length>0?r.slice(0,6):"new chat"}function u1(){try{if(typeof localStorage>"u")return null;const s=localStorage.getItem(Nu);if(!s||s.length>64e3)return null;const r=JSON.parse(s);if(!r||!Array.isArray(r.tabs))return null;const u=[];for(const d of r.tabs){if(!d||typeof d.chatId!="string"||d.chatId.length===0)continue;const f=typeof d.label=="string"&&d.label.length>0?d.label.slice(0,64):d.chatId.slice(0,6),p=typeof d.customLabel=="string"&&d.customLabel.trim().length>0?d.customLabel.slice(0,40):void 0;if(u.push({key:Or(),chatId:d.chatId,label:f,customLabel:p}),u.length>=ju)break}if(u.length===0)return null;const c=u.find(d=>d.chatId===r.activeChatId);return{tabs:u,activeKey:(c??u[0]).key}}catch{return null}}function d1(s,r){try{if(typeof localStorage>"u")return;const u=s.filter(f=>typeof f.chatId=="string"),c=s.find(f=>f.key===r),d={tabs:u.map(f=>({chatId:f.chatId,label:f.label,...f.customLabel?{customLabel:f.customLabel}:{}})),activeChatId:(c==null?void 0:c.chatId)??null};if(d.tabs.length===0){localStorage.removeItem(Nu);return}localStorage.setItem(Nu,JSON.stringify(d))}catch{}}function f1({meta:s,active:r,onState:u,onChatIdMinted:c,registerHandle:d}){const f=o1({initialChatId:s.chatId,active:r});y.useEffect(()=>(d(s.key,{send:f.send,markRead:f.markRead,submitAnswer:f.submitAnswer}),()=>d(s.key,null)),[s.key,f.send,f.markRead,f.submitAnswer,d]);const p=c1(f.messages,f.chatId),h=s.customLabel??p;y.useEffect(()=>{u({key:s.key,chatId:f.chatId,label:h,customLabel:s.customLabel,messages:f.messages,status:f.status,awaitingReply:f.awaitingReply,unread:f.unread,sendError:f.sendError,pendingQuestion:f.pendingQuestion})},[s.key,s.customLabel,f.chatId,h,f.messages,f.status,f.awaitingReply,f.unread,f.sendError,f.pendingQuestion,u]);const x=y.useRef(s.chatId);return y.useEffect(()=>{f.chatId&&f.chatId!==x.current&&(x.current=f.chatId,c(s.key,f.chatId,p))},[s.key,f.chatId,p,c]),null}function m1({children:s}){const r=y.useRef(void 0);if(r.current===void 0){const R=u1();r.current=R??(()=>{const _={key:Or(),chatId:null,label:"new chat"};return{tabs:[_],activeKey:_.key}})()}const[u,c]=y.useState(()=>r.current.tabs),[d,f]=y.useState(()=>r.current.activeKey);y.useEffect(()=>{!u.some(R=>R.key===d)&&u.length>0&&f(u[0].key)},[u,d]);const[p,h]=y.useState({}),x=y.useRef({}),g=y.useCallback((R,_)=>{_?x.current[R]=_:delete x.current[R]},[]),v=y.useCallback(R=>{h(_=>{const Q=_[R.key];return Q&&Q.chatId===R.chatId&&Q.label===R.label&&Q.messages===R.messages&&Q.status===R.status&&Q.awaitingReply===R.awaitingReply&&Q.unread===R.unread&&Q.sendError===R.sendError&&Q.pendingQuestion===R.pendingQuestion?_:{..._,[R.key]:R}})},[]),N=y.useCallback((R,_,Q)=>{c(F=>F.map(G=>G.key===R?{...G,chatId:_,label:Q}:G))},[]);y.useEffect(()=>{d1(u,d)},[u,d]);const A=y.useCallback(()=>{c(R=>{if(R.length>=ju)return R;const _=Or();return f(_),[...R,{key:_,chatId:null,label:"new chat"}]})},[]),K=y.useCallback(R=>{var _;f(R),(_=x.current[R])==null||_.markRead()},[]),O=y.useCallback((R,_)=>{const Q=_.trim().slice(0,40);c(F=>F.map(G=>G.key===R?{...G,customLabel:Q.length>0?Q:void 0}:G))},[]),T=y.useCallback(R=>{c(_=>{const Q=_.findIndex(G=>G.key===R);if(Q<0)return _;const F=_.filter(G=>G.key!==R);if(F.length===0){const G={key:Or(),chatId:null,label:"new chat"};return f(G.key),[G]}return f(G=>{var ae;if(G!==R)return G;const ue=F[Math.max(0,Q-1)]??F[0];return(ae=x.current[ue.key])==null||ae.markRead(),ue.key}),F}),h(_=>{if(!(R in _))return _;const{[R]:Q,...F}=_;return F})},[]),j=y.useCallback(R=>{const _=x.current[d];return _?_.send(R):Promise.resolve()},[d]),L=y.useCallback(R=>{const _=x.current[d];return _?_.submitAnswer(R):Promise.resolve(!1)},[d]),B=y.useMemo(()=>u.map(R=>p[R.key]??{key:R.key,chatId:R.chatId,label:R.label,messages:[],status:"connecting",awaitingReply:!1,unread:0,sendError:null,pendingQuestion:null}),[u,p]),P=B.find(R=>R.key===d)??B[0]??null,V=(P==null?void 0:P.sendError)??null,M=y.useMemo(()=>({conversations:B,activeId:d,active:P,sendError:V,send:j,submitAnswer:L,newConversation:A,closeConversation:T,switchConversation:K,renameConversation:O,canAddTab:u.length<ju}),[B,d,P,V,j,L,A,T,K,O,u.length]);return a.jsxs(wp.Provider,{value:M,children:[u.map(R=>a.jsx(f1,{meta:R,active:R.key===d,onState:v,onChatIdMinted:N,registerHandle:g},R.key)),s]})}function Tp(){const s=y.useContext(wp);if(s===null)throw new Error("useBridgeStore must be used inside <BridgeProvider>");return s}function h1(){const s=Tp(),r=s.active;return{messages:(r==null?void 0:r.messages)??[],status:(r==null?void 0:r.status)??"connecting",awaitingReply:(r==null?void 0:r.awaitingReply)??!1,chatId:(r==null?void 0:r.chatId)??null,sendError:s.sendError,send:s.send}}function Ap({status:s,compact:r=!1}){const u={open:{color:"var(--ok)",label:"live"},connecting:{color:"var(--warn)",label:"connecting"},closed:{color:"var(--idle)",label:"offline"},error:{color:"var(--bad)",label:"relay down"}},{color:c,label:d}=u[s]??u.closed,f=r?"h-1.5 w-1.5":"h-2 w-2",p=r?"font-mono text-[10px]":"font-mono text-[12px]";return a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:`inline-block ${f} rounded-full ${s==="connecting"?"animate-pulse motion-reduce:animate-none":""}`,style:{background:c},"aria-hidden":!0}),a.jsx("span",{className:p,style:{color:"var(--ink-3)"},children:d})]})}function Mp({compact:s=!1}){const r=s?"h-1.5 w-1.5":"h-2 w-2",u=s?"text-[10px]":"text-[12px]",c=s?"px-1 py-1":"px-1 py-2";return a.jsxs("div",{className:`flex items-center gap-2 ${c}`,children:[a.jsxs("span",{className:"inline-flex gap-1","aria-hidden":!0,children:[a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)"}}),a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)",animationDelay:"150ms"}}),a.jsx("span",{className:`${r} animate-pulse motion-reduce:animate-none rounded-full`,style:{background:"var(--ink-4)",animationDelay:"300ms"}})]}),a.jsx("span",{className:u,style:{color:"var(--ink-3)"},children:"working…"})]})}function p1({msg:s}){return a.jsxs("div",{className:"cx-turn user",children:[a.jsx("div",{className:"cx-gutter","aria-hidden":!0,children:"›"}),a.jsx("div",{className:"cx-body whitespace-pre-wrap break-words",children:s.text})]})}function x1({text:s}){return a.jsx("div",{className:"cx-prose finding-md",dangerouslySetInnerHTML:{__html:ii(s)}})}const g1=/^([\p{Emoji_Presentation}\p{Extended_Pictographic}🔧📡🗒]+)\s*/u;function b1(s){let r="",u=s.trim();const c=u.match(g1);c&&(r=c[1],u=u.slice(c[0].length).trim());const d=u.indexOf("→");if(d>=0){const p=u.slice(0,d+1).trim(),h=u.slice(d+1).trim();return{icon:r,label:p,agent:h}}const f=u.indexOf("·");if(f>=0){const p=u.slice(0,f+1).trim(),h=u.slice(f+1).trim();return{icon:r,label:p,cmd:h}}return{icon:r,label:"",cmd:u}}function v1({text:s}){const{icon:r,label:u,cmd:c,agent:d}=b1(s);return a.jsxs("div",{className:"cx-activity",children:[r&&a.jsx("span",{className:"cx-ic","aria-hidden":!0,children:r}),u&&a.jsx("span",{className:"cx-label",children:u}),d&&a.jsx("span",{className:"cx-agent",children:d}),c&&a.jsx("span",{className:!u&&!d?"cx-cmd cx-cmd-bare":"cx-cmd",children:c})]})}function y1({text:s}){return a.jsx("div",{className:"cx-activity",children:a.jsx("span",{className:"cx-cmd cx-cmd-bare",children:s})})}function N1({text:s}){return a.jsxs("div",{className:"cx-state err",role:"alert",children:[a.jsx("span",{className:"cx-chip-bad",children:"session error"}),a.jsx("span",{children:s})]})}function j1({pending:s,onSubmit:r,submitting:u=!1}){const[c,d]=y.useState(()=>{const O={};for(const T of s.questions)O[T.questionId]={selected:[],other:""};return O}),[f,p]=y.useState(!1),h=f||u,x=O=>c[O]??{selected:[],other:""},g=(O,T)=>{d(j=>({...j,[O]:{...x(O),selected:[T]}}))},v=(O,T)=>{d(j=>{const L=j[O]??{selected:[],other:""},P=L.selected.includes(T)?L.selected.filter(V=>V!==T):[...L.selected,T];return{...j,[O]:{...L,selected:P}}})},N=(O,T)=>{d(j=>({...j,[O]:{...x(O),other:T}}))},A=y.useMemo(()=>s.questions.every(O=>{const T=c[O.questionId]??{selected:[],other:""},j=O.allowOther===!0&&T.other.trim().length>0;return T.selected.length>0||j}),[s.questions,c]),K=async()=>{if(!A||h)return;const O=s.questions.map(T=>{const j=c[T.questionId]??{selected:[],other:""},L={questionId:T.questionId,selected:j.selected};return T.allowOther===!0&&j.other.trim().length>0&&(L.other=j.other.trim()),L});p(!0);try{await r(O)}finally{p(!1)}};return a.jsxs("div",{className:"cx-qcard",role:"group","aria-label":"Question from the live session",children:[s.questions.map(O=>{const T=x(O.questionId),j=O.multiSelect===!0,L=`q-${s.qid}-${O.questionId}`;return a.jsxs("fieldset",{className:"cx-qfield",children:[a.jsx("legend",{className:"cx-qlegend",children:O.header}),a.jsx("p",{className:"cx-qprompt",children:O.question}),a.jsx("div",{className:"cx-qoptions",role:j?"group":"radiogroup","aria-label":O.question,children:O.options.map(B=>{const P=T.selected.includes(B.label);return a.jsxs("label",{className:`cx-qopt${P?" is-selected":""}`,children:[a.jsx("input",{type:j?"checkbox":"radio",name:L,value:B.label,checked:P,disabled:h,onChange:()=>j?v(O.questionId,B.label):g(O.questionId,B.label),className:"cx-qinput"}),a.jsxs("span",{className:"cx-qopt-body",children:[a.jsx("span",{className:"cx-qopt-label",children:B.label}),B.description&&a.jsx("span",{className:"cx-qopt-desc",children:B.description})]})]},B.label)})}),O.allowOther===!0&&a.jsxs("label",{className:"cx-qother",children:[a.jsx("span",{className:"cx-qother-label",children:"Other"}),a.jsx("input",{type:"text",value:T.other,disabled:h,placeholder:"type a different answer…",onChange:B=>N(O.questionId,B.target.value),className:"cx-qother-input","aria-label":`Other answer for ${O.header}`})]})]},O.questionId)}),a.jsx("div",{className:"cx-qactions",children:a.jsx("button",{type:"button",className:"cx-qsubmit",onClick:K,disabled:!A||h,"aria-label":"Submit answer",children:h?"submitting…":"Submit answer"})})]})}function S1({msg:s}){switch(s.role){case"user":return a.jsx(p1,{msg:s});case"activity":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(v1,{text:s.text})})]})});case"ack":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(y1,{text:s.text})})]})});case"error":return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0}),a.jsx("div",{className:"cx-body",children:a.jsx(N1,{text:s.text})})]})});case"assistant":default:return a.jsx("div",{className:"cx-turn assistant",children:a.jsxs("div",{className:"cx-row",children:[a.jsx("div",{className:"cx-bullet","aria-hidden":!0,children:"●"}),a.jsx("div",{className:"cx-body",children:a.jsx(x1,{text:s.text})})]})})}}function k1(){return a.jsxs("div",{"aria-busy":"true","aria-label":"Loading transcript",children:[a.jsx("div",{className:"cx-skel",style:{width:"46%"}}),a.jsx("div",{className:"cx-skel",style:{width:"72%"}}),a.jsx("div",{className:"cx-skel",style:{width:"38%"}})]})}function _1(){return a.jsxs("div",{className:"cx-state",children:[a.jsx("span",{"aria-hidden":!0,children:"○"}),a.jsx("span",{children:"No activity yet — terminal session idle"})]})}function Cp({messages:s,status:r,pendingQuestion:u,onSubmitAnswer:c}){const d=s.length>0,f=u&&c?a.jsx(j1,{pending:u,onSubmit:c}):null;if(!d&&r==="connecting"&&!f)return a.jsx(k1,{});if(!d&&!f)return a.jsx(_1,{});const p=r==="error";return a.jsxs("div",{children:[p&&a.jsxs("div",{className:"cx-state err",role:"status",children:[a.jsx("span",{className:"cx-chip-bad",children:"relay disconnected"}),a.jsx("span",{className:"cx-dimmed",children:"showing last-known frames"})]}),a.jsx("div",{className:p?"cx-dimmed":void 0,children:s.map(h=>a.jsx(S1,{msg:h},h.id))}),f]})}function E1(){const[s,r]=y.useState(!1),[u,c]=y.useState(""),{messages:d,status:f,awaitingReply:p,chatId:h,send:x,sendError:g}=h1(),v=y.useRef(null),N=y.useRef(null);y.useEffect(()=>{if(!s)return;const T=v.current;T&&(T.scrollTop=T.scrollHeight)},[d,p,s]),y.useEffect(()=>{var T;s&&((T=N.current)==null||T.focus())},[s]);const A=()=>{const T=u.trim();T&&(x(T),c(""))},K=T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),A())},O=()=>{r(!1),as("/chat")};return s?a.jsxs("div",{className:"fixed bottom-5 right-5 z-50 flex w-[360px] max-w-[calc(100vw-2rem)] flex-col rounded-xl",style:{height:"min(560px, calc(100vh - 6rem))",background:"var(--surface-elev)",border:"1px solid var(--border)",boxShadow:"var(--shadow-card)"},role:"region","aria-label":"Live Claude Code session chat",children:[a.jsxs("div",{className:"flex items-center gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},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:"h-section",children:"live claude code"}),a.jsx(Ap,{status:f,compact:!0})]}),a.jsx("div",{className:"mt-0.5 truncate font-mono text-[10px]",style:{color:"var(--ink-3)"},children:h?`chat ${h.slice(0,8)}`:"same session as your terminal"})]}),a.jsx("button",{type:"button",onClick:O,className:"shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]",style:{color:"var(--ink-3)"},"aria-label":"Open full Chat page","data-tooltip":"Open full Chat page","data-tooltip-pos":"left",children:"⤢"}),a.jsx("button",{type:"button",onClick:()=>r(!1),className:"shrink-0 rounded px-2 py-1 text-sm leading-none transition-colors hover:[background:var(--surface-sunk)]",style:{color:"var(--ink-3)"},"aria-label":"Minimize chat","data-tooltip":"Minimize chat","data-tooltip-pos":"left",children:"–"})]}),a.jsxs("div",{ref:v,className:"chat-surface flex-1 overflow-y-auto px-3 py-3",children:[a.jsx(Cp,{messages:d,status:f}),p&&a.jsx(Mp,{compact:!0})]}),g&&a.jsx("div",{role:"alert",className:"mx-3 mb-1 rounded-sm px-2 py-1 font-mono text-[10px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:g}),a.jsxs("div",{className:"flex items-end gap-2 border-t px-3 py-3",style:{borderColor:"var(--border)"},children:[a.jsx("textarea",{ref:N,value:u,onChange:T=>c(T.target.value),onKeyDown:K,rows:1,placeholder:"Message the live session…",className:"max-h-28 min-h-[36px] flex-1 resize-none rounded-md border px-3 py-2 text-[13px] focus:outline-none",style:{background:"var(--surface)",color:"var(--text)",borderColor:"var(--border)"}}),a.jsx("button",{type:"button",onClick:A,disabled:u.trim().length===0,className:"shrink-0 rounded-md px-3 py-2 text-sm font-medium transition-opacity disabled:opacity-40",style:{background:"var(--accent)",color:"var(--accent-foreground, #fff)"},"aria-label":"Send message",children:"Send"})]})]}):a.jsxs("button",{type:"button",onClick:()=>r(!0),className:"fixed bottom-5 right-5 z-50 flex items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-colors",style:{position:"fixed",background:"var(--accent)",color:"var(--accent-foreground, #fff)"},"aria-label":"Open live Claude Code chat","data-tooltip":"Talk to the live Claude Code session","data-tooltip-pos":"left",children:[a.jsx("span",{"aria-hidden":!0,children:"◎"}),a.jsx("span",{children:"Live session"})]})}function w1(s){const r=new Map;for(const u of s)r.set(u.day,(r.get(u.day)??0)+u.signals);return Array.from(r.entries()).sort(([u],[c])=>u.localeCompare(c)).map(([u,c])=>({day:u,agentId:"_fleet",accuracy:0,signals:c}))}function T1(){const[s,r]=y.useState(null);return y.useEffect(()=>{const u=new AbortController;return ct("fleet-trend?days=7").then(c=>{u.signal.aborted||r(w1(c.points))}).catch(()=>{u.signal.aborted||r([])}),()=>u.abort()},[]),s===null?null:s.length<2?a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-4)"},"aria-label":"no trend data yet",children:"—"}):a.jsx("div",{style:{width:"100%",paddingTop:"4px",paddingBottom:"4px"},children:a.jsx(up,{points:s,width:240,height:28,color:"var(--c1)"})})}const A1=8;function M1({agents:s}){const r=s.map(c=>{const d=(c.scores.agreements??0)+(c.scores.uniqueFindings??0),f=(c.scores.hallucinations??0)+(c.scores.disagreements??0),p=d+f;return{id:c.id,pos:d,neg:f,total:p}}).filter(c=>c.total>0).sort((c,d)=>d.total-c.total).slice(0,A1);if(r.length===0)return null;const u=r[0].total;return a.jsxs("div",{style:{marginTop:"6px"},children:[a.jsx("span",{style:{display:"block",fontSize:"10px",fontVariant:"small-caps",letterSpacing:"0.04em",color:"var(--ink-4)",marginBottom:"6px"},children:"by agent"}),a.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"5px"},children:r.map(({id:c,pos:d,neg:f,total:p})=>{const h=u>0?p/u:0,x=p>0?d/p:0,g=p>0?f/p:0;return a.jsxs("li",{style:{display:"flex",flexDirection:"column",gap:"3px"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"6px",minWidth:0},children:[a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:"1 1 0",minWidth:0},title:c,children:c}),a.jsxs("span",{className:"font-mono text-[10px]",style:{flexShrink:0,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:[d>0&&a.jsxs("span",{style:{color:"var(--ok)"},children:["↑",d]}),d>0&&f>0&&a.jsx("span",{style:{color:"var(--ink-4)",margin:"0 2px"},children:" "}),f>0&&a.jsxs("span",{style:{color:"var(--bad)"},children:["↓",f]})]})]}),a.jsx("div",{style:{height:"3px",borderRadius:"1.5px",background:"var(--border)",overflow:"hidden"},"aria-hidden":!0,children:a.jsxs("div",{style:{height:"100%",width:`${Math.round(h*100)}%`,display:"flex",borderRadius:"1.5px",overflow:"hidden",transition:"width 200ms ease-out"},children:[d>0&&a.jsx("div",{style:{height:"100%",width:`${Math.round(x*100)}%`,background:"var(--ok)",flexShrink:0}}),f>0&&a.jsx("div",{style:{height:"100%",width:`${Math.round(g*100)}%`,background:"var(--bad)",flexShrink:0}})]})})]},c)})})]})}const Zh=20,C1=7200*1e3,R1={"task.completed":"✓","consensus.completed":"◈"};function O1(s){const{type:r,payload:u}=s;if(r==="task.completed"){const c=typeof u.agentId=="string"?u.agentId:"";return c?`task · ${c}`:"task completed"}if(r==="consensus.completed"){const c=typeof u.consensusId=="string"?u.consensusId.slice(0,8):"";return c?`consensus ${c}`:"consensus done"}return r}function D1(s){const r=new Date(s);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function z1(s){const r=Date.now()-new Date(s).getTime();return r<0?"0s":r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m`:`${Math.floor(r/36e5)}h`}function L1({tasks:s}){const r=Date.now(),u=s.filter(c=>r-new Date(c.startedAt).getTime()<C1);return a.jsxs("section",{children:[a.jsx("h2",{className:"h-section",style:{marginBottom:"8px",borderBottom:"1px solid var(--border)",paddingBottom:"6px"},children:"agents"}),u.length===0?a.jsx("p",{className:"text-[11px]",style:{color:"var(--ink-3)",margin:0,lineHeight:1.5},children:"No agents dispatched — fleet idle"}):a.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"6px"},children:u.map(c=>a.jsx(B1,{task:c},c.taskId))})]})}function B1({task:s}){const r=Cn(s.agentId);return a.jsxs("li",{className:"agent-working-row",style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 8px",borderRadius:"var(--r-md)",background:"color-mix(in srgb, var(--surface) 30%, transparent)",border:"1px solid var(--border)",transition:"background 100ms ease-out"},children:[a.jsx("span",{className:"agent-working-dot shrink-0 mt-[3px]",style:{"--dot-color":r},"aria-hidden":!0}),a.jsxs("div",{style:{flex:1,minWidth:0},children:[a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"6px"},children:[a.jsx("span",{className:"font-mono text-[11px] font-medium truncate",style:{color:"var(--ink-2)"},children:s.agentId}),a.jsx("span",{className:"font-mono text-[10px] shrink-0 tabular-nums",style:{color:"var(--ink-3)"},children:z1(s.startedAt)})]}),s.task&&a.jsx("span",{className:"text-[11px] block truncate",style:{color:"var(--ink-3)",marginTop:"1px",lineHeight:1.4},title:s.task,children:s.task})]})]})}function U1({events:s}){return a.jsxs("section",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:"8px"},children:[a.jsx("h2",{className:"h-section shrink-0",style:{borderBottom:"1px solid var(--border)",paddingBottom:"6px"},children:"activity"}),s.length===0&&a.jsx("p",{className:"text-[11px] shrink-0",style:{color:"var(--ink-3)",margin:"0 0 2px",lineHeight:1.5},children:"No recent activity — fleet idle"}),a.jsx("div",{className:"shrink-0",children:a.jsx(T1,{})}),s.length>0&&a.jsx("ul",{"aria-label":"Recent activity",style:{flex:1,minHeight:0,overflowY:"auto",listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:"2px"},children:s.map(r=>a.jsx($1,{event:r},r.id))})]})}function $1({event:s}){const r=R1[s.type]??"·",u=O1(s),c=D1(s.ts);return a.jsxs("li",{className:"activity-event-row",style:{display:"flex",alignItems:"center",gap:"6px",padding:"4px 6px",borderRadius:"var(--r-sm)",transition:"background 100ms ease-out"},children:[c&&a.jsx("span",{className:"font-mono text-[10px] shrink-0 tabular-nums",style:{color:"var(--ink-3)"},"aria-hidden":!0,children:c}),a.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--info)",minWidth:"10px",textAlign:"center"},"aria-hidden":!0,children:r}),a.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--ink-2)",lineHeight:1.4},children:u})]})}function q1({status:s,chatId:r}){const[u,c]=y.useState([]),[d,f]=y.useState({gitBranch:null,projectName:null,activeTasks:0}),[p,h]=y.useState(null),[x,g]=y.useState(null),[v,N]=y.useState([]),[,A]=y.useState(0);y.useEffect(()=>{const T=new AbortController;return ct("session").then(j=>{T.signal.aborted||f({gitBranch:j.gitBranch??null,projectName:j.projectName??null,activeTasks:typeof j.activeTasks=="number"?j.activeTasks:0})}).catch(()=>{}),()=>T.abort()},[]),y.useEffect(()=>{const T=new AbortController;return ct("signal-activity").then(j=>{T.signal.aborted||typeof j.total=="number"&&h(j.total)}).catch(()=>{}),()=>T.abort()},[]),y.useEffect(()=>{const T=new AbortController;return ct("agents").then(j=>{if(!T.signal.aborted&&Array.isArray(j)){const L=j.filter(B=>typeof B=="object"&&B!==null&&typeof B.id=="string"&&typeof B.scores=="object"&&B.scores!==null);g(L)}}).catch(()=>{}),()=>T.abort()},[]),y.useEffect(()=>{let T=!1;const j=async()=>{try{const B=await ct("active-tasks");T||N(B.tasks||[])}catch{}};j();const L=setInterval(()=>{j()},5e3);return()=>{T=!0,clearInterval(L)}},[]),y.useEffect(()=>{if(v.length===0)return;const T=setInterval(()=>A(j=>j+1),1e3);return()=>clearInterval(T)},[v.length]);const K=y.useCallback(T=>{c(j=>{const L=[T,...j];return L.length>Zh?L.slice(0,Zh):L})},[]);Ep(K);const O=typeof d.gitBranch=="string"&&d.gitBranch.length>0;return a.jsxs("aside",{className:"chat-surface",style:{width:"100%",minWidth:0,border:"1px solid var(--border)",borderRadius:"var(--r-lg)",padding:"14px 14px",display:"flex",flexDirection:"column",gap:"14px",alignSelf:"stretch",overflow:"hidden"},"aria-label":"Session info and live activity",children:[a.jsxs("section",{className:"shrink-0",children:[a.jsx("h2",{className:"h-section",style:{marginBottom:"8px",borderBottom:"1px solid var(--border)",paddingBottom:"6px"},children:"session"}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:[a.jsx(Ap,{status:s,compact:!0}),r&&a.jsx("span",{className:"font-mono text-[10px] truncate",style:{color:"var(--ink-3)"},title:r,children:r}),O&&a.jsxs("span",{className:"font-mono text-[10px] truncate",style:{color:"var(--ink-3)"},title:`${d.projectName} · ${d.gitBranch}`,children:[d.projectName," · ",d.gitBranch]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{style:{color:"var(--ink-2)",fontWeight:500},children:d.activeTasks})," ","tasks"]}),p!==null&&a.jsxs("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:[a.jsx("span",{style:{color:"var(--ink-2)",fontWeight:500},children:p})," ","signals · 24h"]})]}),x!==null&&x.length>0&&a.jsx(M1,{agents:x})]})]}),a.jsx("div",{className:"shrink-0",children:a.jsx(L1,{tasks:v})}),a.jsx(U1,{events:u})]})}function H1({conversations:s,activeId:r,canAddTab:u,onSwitch:c,onClose:d,onNew:f,onRename:p}){const h=y.useRef({}),[x,g]=y.useState(null),[v,N]=y.useState(""),A=(L,B)=>{var M;if(L.key==="F2"){L.preventDefault();const R=s[B];R&&K(R);return}if(L.key!=="ArrowLeft"&&L.key!=="ArrowRight")return;L.preventDefault();const P=L.key==="ArrowRight"?1:-1,V=s[(B+P+s.length)%s.length];V&&((M=h.current[V.key])==null||M.focus())},K=y.useCallback(L=>{g(L.key),N(L.customLabel??L.label)},[]),O=y.useCallback(L=>{p(L,v),g(null),requestAnimationFrame(()=>{var B;(B=h.current[L])==null||B.focus()})},[v,p]),T=y.useCallback(L=>{g(null),requestAnimationFrame(()=>{var B;(B=h.current[L])==null||B.focus()})},[]),j=y.useCallback((L,B)=>{L.key==="Enter"?(L.preventDefault(),O(B)):L.key==="Escape"&&(L.preventDefault(),T(B))},[O,T]);return a.jsxs("div",{className:"cx-tabstrip shrink-0",role:"tablist","aria-label":"Conversations",children:[a.jsx("div",{className:"cx-tabstrip-scroll",children:s.map((L,B)=>{const P=L.key===r,V=L.key===x,M=!L.customLabel&&!!L.chatId&&L.label===L.chatId.slice(0,6),R=!P&&L.unread>0;return a.jsxs("div",{className:`cx-tab ${P?"is-active":""}`,children:[V?a.jsx("input",{className:"cx-tab-rename-input",type:"text",value:v,maxLength:40,"aria-label":"Rename conversation",autoFocus:!0,onChange:_=>N(_.target.value),onKeyDown:_=>j(_,L.key),onBlur:()=>O(L.key),onClick:_=>_.stopPropagation()}):a.jsxs("button",{ref:_=>{h.current[L.key]=_},type:"button",role:"tab","aria-selected":P,tabIndex:P?0:-1,className:"cx-tab-btn",onClick:()=>c(L.key),onDoubleClick:_=>{_.preventDefault(),K(L)},onKeyDown:_=>A(_,B),title:L.chatId??"new conversation","aria-label":`${L.label}${R?`, ${L.unread} unread`:""}`,children:[R&&a.jsx("span",{className:"cx-tab-unread","aria-hidden":"true"}),a.jsx("span",{className:M?"cx-tab-label font-mono":"cx-tab-label",children:L.label})]}),a.jsx("button",{type:"button",className:"cx-tab-close",onClick:_=>{_.stopPropagation(),d(L.key)},"aria-label":`Close conversation ${L.label}`,title:"Close conversation",children:"×"})]},L.key)})}),a.jsx("button",{type:"button",className:"cx-tab-new shrink-0",onClick:f,disabled:!u,"aria-label":"New conversation",title:u?"New conversation":"Maximum conversations open",children:"+"})]})}function I1(){const{conversations:s,activeId:r,active:u,sendError:c,send:d,submitAnswer:f,newConversation:p,closeConversation:h,switchConversation:x,renameConversation:g,canAddTab:v}=Tp(),[N,A]=y.useState(""),K=(u==null?void 0:u.messages)??[],O=(u==null?void 0:u.status)??"connecting",T=(u==null?void 0:u.awaitingReply)??!1,j=(u==null?void 0:u.chatId)??null,L=(u==null?void 0:u.pendingQuestion)??null,B=y.useRef(null),P=y.useRef(null);y.useEffect(()=>{const F=B.current;F&&(F.scrollTop=F.scrollHeight)},[K,T,r,L]),y.useEffect(()=>{var F;(F=P.current)==null||F.focus()},[r]);const V=()=>{const F=N.trim();F&&(d(F),A(""))},M=F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),V())},R={open:{color:"var(--ok)",label:"live"},connecting:{color:"var(--warn)",label:"connecting"},closed:{color:"var(--idle)",label:"offline"},error:{color:"var(--bad)",label:"down"}},{color:_,label:Q}=R[O]??R.closed;return a.jsx("div",{className:"flex flex-col",style:{height:"100%",minHeight:0,overflow:"hidden",padding:"16px 24px",boxSizing:"border-box",gap:"0"},children:a.jsxs("div",{className:"flex flex-col gap-4 lg:grid",style:{flex:1,minHeight:0,gridTemplateColumns:"1fr 288px",alignItems:"stretch",height:"100%"},children:[a.jsxs("div",{className:"chat-surface flex flex-col",style:{minHeight:0,border:"1px solid var(--border)",borderRadius:"var(--r-lg)",overflow:"hidden"},children:[a.jsxs("div",{className:"chat-info-bar flex items-center gap-3 shrink-0",style:{padding:"10px 16px",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--surface) 80%, var(--bg))",minHeight:"44px",flexWrap:"wrap",rowGap:"4px"},children:[a.jsx("span",{className:"h-section h-section--lg shrink-0",children:"chat"}),a.jsx("span",{"aria-hidden":!0,style:{width:"1px",height:"20px",background:"var(--border)",flexShrink:0}}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 shrink-0",children:[a.jsx("span",{className:`inline-block h-2 w-2 rounded-full shrink-0 ${O==="connecting"?"animate-pulse motion-reduce:animate-none":""}`,style:{background:_},"aria-hidden":!0}),a.jsx("span",{className:"font-mono text-[11px]",style:{color:"var(--ink-3)"},"aria-label":`Bridge status: ${Q}`,children:Q})]}),j&&a.jsxs(a.Fragment,{children:[a.jsx("span",{"aria-hidden":!0,style:{width:"1px",height:"20px",background:"var(--border)",flexShrink:0}}),a.jsx("span",{className:"font-mono text-[11px] truncate",style:{color:"var(--ink-3)",maxWidth:"160px"},title:j,"aria-label":`Chat ID: ${j}`,children:j})]}),a.jsx("span",{style:{flex:1}}),a.jsx("span",{className:"font-mono text-[10px] shrink-0",style:{color:"var(--ink-3)",letterSpacing:"0.03em"},"aria-hidden":!0,children:"cc transcript"})]}),a.jsx(H1,{conversations:s,activeId:r,canAddTab:v,onSwitch:x,onClose:h,onNew:p,onRename:g}),a.jsxs("div",{ref:B,className:"flex-1 overflow-y-auto",style:{padding:"16px 16px 8px",minHeight:0},children:[a.jsx(Cp,{messages:K,status:O,pendingQuestion:L,onSubmitAnswer:f}),T&&a.jsx(Mp,{compact:!1})]}),c&&a.jsx("div",{role:"alert",className:"mx-4 mb-2 rounded px-3 py-1.5 font-mono text-[11px]",style:{color:"var(--bad)",background:"color-mix(in oklch, var(--bad) 10%, transparent)",border:"1px solid color-mix(in oklch, var(--bad) 30%, transparent)"},children:c}),a.jsxs("div",{className:"flex items-end gap-2.5 border-t shrink-0",style:{borderColor:"var(--border)",padding:"12px 16px",background:"color-mix(in srgb, var(--surface) 60%, var(--bg))"},children:[a.jsx("textarea",{ref:P,value:N,onChange:F=>A(F.target.value),onKeyDown:M,rows:2,placeholder:"Message the live session… (Enter to send)","aria-label":"Compose message",className:"flex-1 resize-none text-[13px] focus:outline-none",style:{background:"color-mix(in srgb, var(--surface) 50%, var(--bg))",color:"var(--ink)",border:"1px solid var(--border)",borderRadius:"var(--r-md)",padding:"10px 12px",minHeight:"60px",maxHeight:"140px",boxSizing:"border-box",outline:"none",transition:"border-color 100ms ease-out, box-shadow 100ms ease-out",fontFamily:"var(--font-sans)",lineHeight:"1.5"},onFocus:F=>{F.currentTarget.style.borderColor="color-mix(in srgb, var(--accent) 60%, var(--border))",F.currentTarget.style.boxShadow="0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent)"},onBlur:F=>{F.currentTarget.style.borderColor="var(--border)",F.currentTarget.style.boxShadow="none"}}),a.jsxs("button",{type:"button",onClick:V,disabled:N.trim().length===0,className:"chat-send-btn shrink-0 rounded-lg flex items-center gap-1.5 font-medium",style:{padding:"10px 14px",fontSize:"13px",minHeight:"40px"},"aria-label":"Send message",children:[a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]}),"Send"]})]})]}),a.jsx(q1,{status:O,chatId:j})]})})}function G1({agents:s,tasks:r,consensusReports:u,fleetTrend:c}){const[d,f]=y.useState("weight"),[p,h]=y.useState("desc"),[x,g]=y.useState(""),v=y.useMemo(()=>{const M=new Map;if(r)for(const R of r.items){const _=M.get(R.agentId);(!_||R.timestamp>_.timestamp)&&M.set(R.agentId,R)}return M},[r]);vp(u==null?void 0:u.reports),y.useMemo(()=>{const M=new Map;if(c){for(const R of c.points){const _=M.get(R.agentId)??[];_.push(R),M.set(R.agentId,_)}for(const R of M.values())R.sort((_,Q)=>_.day.localeCompare(Q.day))}return M},[c]);const N=s.filter(Vb).length,A=s.filter(M=>M.scores.accuracy>=.5).length,K=s.reduce((M,R)=>M+R.scores.signals,0),O=s.reduce((M,R)=>M+R.totalTokens,0),T=x.trim().toLowerCase(),j=T?s.filter(M=>M.id.toLowerCase().includes(T)||M.provider.toLowerCase().includes(T)||M.model.toLowerCase().includes(T)):s,L=M=>{const R=M.scores;switch(d){case"weight":return R.dispatchWeight;case"accuracy":return R.accuracy;case"uniqueness":return R.uniqueness;case"impact":return R.impactScore;case"signals":return R.signals;case"agreements":return R.agreements;case"hallucinations":return R.hallucinations;case"lastTask":{const _=v.get(M.id);return _?new Date(_.timestamp).getTime():0}}},B=[...j].sort((M,R)=>{const _=L(M),Q=L(R);return p==="desc"?Q-_:_-Q}),P=M=>{d===M?h(R=>R==="desc"?"asc":"desc"):(f(M),h("desc"))},V=M=>d===M?p==="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:s.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:A,varColor:"var(--ok)"},{label:"Benched",value:N,varColor:N>0?"var(--bad)":"var(--ink-3)"},{label:"Total Signals",value:K.toLocaleString(),varColor:"var(--ink)"},{label:"Tokens Used",value:O.toLocaleString(),varColor:"var(--ink)"}].map(M=>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:M.varColor},children:M.value}),a.jsx("div",{className:"h-section mt-0.5",children:M.label})]},M.label))})]}),a.jsx("div",{className:"mb-3",children:a.jsx("input",{type:"text",value:x,onChange:M=>g(M.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:()=>P("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:()=>P("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:()=>P("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:()=>P("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:()=>P("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:()=>P("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:()=>P("lastTask"),children:["Last Task ",V("lastTask")]})]})}),a.jsx("tbody",{children:B.map((M,R)=>{const _=M.scores,Q=v.get(M.id),F=_.dispatchWeight>=1.2?"var(--ok)":_.dispatchWeight>=.8?"var(--ink)":"var(--bad)",G=R+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:G===1?"var(--ink)":G===2||G===3?"color-mix(in oklch, var(--ink-2) 80%, transparent)":"var(--ink-3)",fontWeight:G===1?"bold":G<=3?600:void 0},children:G})}),a.jsx("td",{className:"py-2.5 pr-3 align-top",children:a.jsxs("a",{href:`/dashboard/agent/${encodeURIComponent(M.id)}`,className:"flex items-center gap-3",children:[a.jsx(ri,{agentId:M.id,size:32,signals:_.signals,accuracy:_.accuracy,uniqueness:_.uniqueness,impact:_.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:M.id}),(()=>{const ue=Eu(_);return ue==="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 (${_.bench.reason??"auto"}). Excluded from dispatch until recovery.`,children:"benched"}):ue==="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"}):ue==="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 (${_.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:[M.provider,"/",M.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:F},children:_.dispatchWeight.toFixed(2)})}),a.jsx("td",{className:"py-3 pr-4 align-top",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx(uu,{label:"A",value:_.accuracy,fillClass:_.accuracy>=.7?"bg-confirmed":_.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(uu,{label:"U",value:_.uniqueness,fillClass:"bg-unique",tooltip:"Uniqueness — findings this agent surfaced that no other agent found"}),a.jsx(uu,{label:"I",value:_.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:_.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:_.hallucinations>0?"var(--bad)":"var(--ink-3)",fontWeight:_.hallucinations>10?"bold":void 0},"data-tooltip":`Agreements ${_.agreements} · Disagreements ${_.disagreements} · Hallucinations ${_.hallucinations}`,children:_.hallucinations})}),a.jsx("td",{className:"py-3 pr-5 align-top",children:Q?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:Q.taskId.slice(0,8)}),a.jsx("span",{className:"truncate text-[11px]",style:{maxWidth:260,color:"var(--ink-2)"},children:Q.task}),a.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px]",style:{color:"var(--ink-3)"},children:wt(Q.timestamp)})]}):a.jsx("span",{className:"font-mono text-[10px]",style:{color:"var(--ink-3)"},children:"no tasks"})})]},M.id)})})]})})]})}function uu({label:s,value:r,fillClass:u,tooltip:c}){return a.jsxs("div",{className:"flex items-center gap-2","data-tooltip":c,"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:s}),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,r*100))}%`}})}),a.jsxs("span",{className:"w-8 text-right font-mono text-[10px] tabular-nums",style:{color:"var(--ink-2)"},children:[Math.round(r*100),"%"]})]})}function Y1({tasks:s}){const[r,u]=y.useState(""),[c,d]=y.useState(0),[f,p]=y.useState(null),h=100,x=s.items.filter(j=>j.status==="completed").length,g=s.items.filter(j=>j.status==="failed").length,v=s.items.filter(j=>j.status==="running").length,N=r.trim().toLowerCase(),A=N?s.items.filter(j=>{var L,B,P,V;return((L=j.task)==null?void 0:L.toLowerCase().includes(N))||((B=j.agentId)==null?void 0:B.toLowerCase().includes(N))||((P=j.taskId)==null?void 0:P.toLowerCase().includes(N))||((V=j.status)==null?void 0:V.toLowerCase().includes(N))}):s.items,K=Math.max(1,Math.ceil(A.length/h)),O=Math.min(c,K-1),T=A.slice(O*h,(O+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:s.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:x})," completed"]}),g>0&&a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:g})," failed"]}),v>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:v})," running"]}),a.jsxs("span",{children:["showing ",T.length," of ",A.length,N&&` (filtered from ${s.items.length})`]})]})]}),a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[a.jsx("input",{type:"text",value:r,onChange:j=>{u(j.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] ${K<=1?"invisible":""}`,style:{color:"var(--ink-3)"},children:[a.jsx("button",{onClick:()=>d(j=>Math.max(0,j-1)),disabled:O===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:[O+1," / ",K]}),a.jsx("button",{onClick:()=>d(j=>Math.min(K-1,j+1)),disabled:O>=K-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:T.length===0?a.jsx("div",{className:"py-12 text-center text-sm",style:{color:"var(--ink-3)"},children:N?"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:T.map(j=>a.jsx(kp,{task:j,onClick:p},j.taskId))})]})}),a.jsx(jp,{task:f,onClose:()=>p(null)})]})}function X1({consensus:s,consensusReports:r}){const[u,c]=y.useState(!1),d=u?s.runs:s.runs.filter(g=>!g.retracted),f=s.runs.filter(g=>g.retracted).length,p=d.reduce((g,v)=>g+(v.counts.agreement||0),0),h=d.reduce((g,v)=>g+((v.counts.disagreement||0)+(v.counts.hallucination||0)),0),x=d.reduce((g,v)=>g+(v.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&&f>0&&a.jsxs("span",{className:"font-mono text-sm tabular-nums",style:{color:"var(--ink-3)"},children:["/ ",s.totalRuns??s.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:p})," confirmed"]}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--bad)"},children:h})," disputed"]}),x>0&&a.jsxs("span",{children:[a.jsx("span",{className:"text-unverified",children:x})," unverified"]}),a.jsxs("span",{children:[s.totalSignals," total signals"]})]}),f>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?`${f} retracted run${f===1?"":"s"} shown`:`${f} retracted run${f===1?"":"s"} hidden`}),a.jsx("button",{type:"button",onClick:()=>c(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(Xy,{consensus:s,filteredRuns:d,reports:r,showAll:!0,hideHeader:!0})]})}function K1({onUnauthorized:s}){const r=Fh(),{overview:u,agents:c,tasks:d,consensus:f,consensusReports:p,fleetTrend:h,signalActivity:x,skills:g,loading:v,error:N,refresh:A}=J0(s),[K,O]=y.useState(0),T=y.useCallback(R=>{R.type!=="log_lines"&&A()},[A]);if(gp(T),!v&&N&&(!u||!f))return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(su,{}),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:N}),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(v||!u||!f)return a.jsxs("div",{className:"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(su,{}),a.jsx(S0,{})]});let j;const L=r.match(/^\/agent\/(.+)$/),B=r.match(/^\/consensus\/(.+)$/);if(L&&c){const R=decodeURIComponent(L[1]);j=a.jsx(C0,{agentId:R,agents:c,tasks:d,consensus:f})}else if(B){const R=decodeURIComponent(B[1]);j=a.jsx(Ey,{consensusId:R})}else r==="/team"?j=c?a.jsx(G1,{agents:c,tasks:d,consensusReports:p,fleetTrend:h}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(k0,{})}):r==="/tasks"?j=d?a.jsx(Y1,{tasks:d}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(_0,{})}):r==="/debates"?j=f?a.jsx(X1,{consensus:f,consensusReports:p}):a.jsx("div",{className:"mx-auto max-w-7xl space-y-6 px-6 py-6",children:a.jsx(E0,{})}):r==="/chat"?j=a.jsx(I1,{}):r==="/logs"?j=a.jsx(L0,{}):r==="/signals"?j=a.jsx(K0,{}):r==="/violations"?j=a.jsx(Qy,{}):j=a.jsx(hy,{overview:u,agents:c,tasks:d,consensus:f,consensusReports:p,fleetTrend:h,signalActivity:x,skills:g,activeTaskCount:K,setActiveTaskCount:O});const V=r==="/"||r==="/overview"||!/^\/(agent\/|consensus\/|team|tasks|debates|logs|signals|violations|chat)/.test(r)?"px-6 py-6":"mx-auto max-w-7xl space-y-6 px-6 py-6",M=r==="/chat";return a.jsxs("div",{className:M?"flex h-screen flex-col overflow-hidden":"min-h-screen",style:{background:"var(--surface)"},children:[a.jsx(su,{}),M?a.jsx("main",{className:"min-h-0 flex-1",children:j}):a.jsx("main",{className:V,children:j})]})}function V1(){const{authed:s,login:r,error:u,recheck:c}=Q0();return s===null?a.jsx("div",{className:"flex min-h-screen items-center justify-center",style:{color:"var(--ink-3)"},children:"Loading..."}):s?a.jsxs(m1,{children:[a.jsx(K1,{onUnauthorized:c}),a.jsx(a1,{}),a.jsx(E1,{})]}):a.jsx(wy,{onLogin:r,error:u})}Kg.createRoot(document.getElementById("root")).render(a.jsx(y.StrictMode,{children:a.jsx(V1,{})}));
|