@grackle-ai/web 0.99.0 → 0.100.1
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/assets/{KnowledgePage-C0hBDbKd.js → KnowledgePage-BLz5X1AT.js} +1 -1
- package/dist/assets/grpc-CsVN0-gD.js +2 -0
- package/dist/assets/index-ByBHj0Vx.js +715 -0
- package/dist/index.html +2 -2
- package/package.json +3 -3
- package/dist/assets/grpc-CkqXCGns.js +0 -2
- package/dist/assets/index-0eff3rFr.js +0 -715
|
@@ -0,0 +1,715 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-BLz5X1AT.js","assets/dagview-tHPW3Rz3.js","assets/grpc-CsVN0-gD.js","assets/markdown-Yr3vTPLR.js","assets/KnowledgePage-BmY14aDt.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as iT,a as oT,b as y,j as i,d as J0,H as W0,P as X0,i as rT,B as lT,c as cT,C as dT,M as uT,e as fT}from"./dagview-tHPW3Rz3.js";import{c as pT,a as mT,G as hT,f as gT,M as vT,A as dx,D as ux,W as yT,O as bT,b as xT,C as wi,d as fx,e as px,w as _T,t as kT,p as Cc,g as ST,R as Rr,S as Q0}from"./grpc-CsVN0-gD.js";import{v as TT,r as wT,t as Ec,i as jT,f as NT,M as hd,a as gd}from"./markdown-Yr3vTPLR.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))r(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function o(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();var zf={exports:{}},Mr={},$f={exports:{}},Uf={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* scheduler.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var ey;function CT(){return ey||(ey=1,(function(t){function s(L,Z){var J=L.length;L.push(Z);e:for(;0<J;){var ce=J-1>>>1,X=L[ce];if(0<c(X,Z))L[ce]=Z,L[J]=X,J=ce;else break e}}function o(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var Z=L[0],J=L.pop();if(J!==Z){L[0]=J;e:for(var ce=0,X=L.length,ge=X>>>1;ce<ge;){var fe=2*(ce+1)-1,Ce=L[fe],Ze=fe+1,me=L[Ze];if(0>c(Ce,J))Ze<X&&0>c(me,Ce)?(L[ce]=me,L[Ze]=J,ce=Ze):(L[ce]=Ce,L[fe]=J,ce=fe);else if(Ze<X&&0>c(me,J))L[ce]=me,L[Ze]=J,ce=Ze;else break e}}return Z}function c(L,Z){var J=L.sortIndex-Z.sortIndex;return J!==0?J:L.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;t.unstable_now=function(){return d.now()}}else{var u=Date,p=u.now();t.unstable_now=function(){return u.now()-p}}var m=[],g=[],v=1,b=null,x=3,S=!1,k=!1,w=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function B(L){for(var Z=o(g);Z!==null;){if(Z.callback===null)r(g);else if(Z.startTime<=L)r(g),Z.sortIndex=Z.expirationTime,s(m,Z);else break;Z=o(g)}}function E(L){if(w=!1,B(L),!k)if(o(m)!==null)k=!0,A||(A=!0,W());else{var Z=o(g);Z!==null&&ie(E,Z.startTime-L)}}var A=!1,P=-1,I=5,U=-1;function Q(){return N?!0:!(t.unstable_now()-U<I)}function $(){if(N=!1,A){var L=t.unstable_now();U=L;var Z=!0;try{e:{k=!1,w&&(w=!1,C(P),P=-1),S=!0;var J=x;try{t:{for(B(L),b=o(m);b!==null&&!(b.expirationTime>L&&Q());){var ce=b.callback;if(typeof ce=="function"){b.callback=null,x=b.priorityLevel;var X=ce(b.expirationTime<=L);if(L=t.unstable_now(),typeof X=="function"){b.callback=X,B(L),Z=!0;break t}b===o(m)&&r(m),B(L)}else r(m);b=o(m)}if(b!==null)Z=!0;else{var ge=o(g);ge!==null&&ie(E,ge.startTime-L),Z=!1}}break e}finally{b=null,x=J,S=!1}Z=void 0}}finally{Z?W():A=!1}}}var W;if(typeof D=="function")W=function(){D($)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,H=pe.port2;pe.port1.onmessage=$,W=function(){H.postMessage(null)}}else W=function(){T($,0)};function ie(L,Z){P=T(function(){L(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(L){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var J=x;x=Z;try{return L()}finally{x=J}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(L,Z){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var J=x;x=L;try{return Z()}finally{x=J}},t.unstable_scheduleCallback=function(L,Z,J){var ce=t.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ce+J:ce):J=ce,L){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=J+X,L={id:v++,callback:Z,priorityLevel:L,startTime:J,expirationTime:X,sortIndex:-1},J>ce?(L.sortIndex=J,s(g,L),o(m)===null&&L===o(g)&&(w?(C(P),P=-1):w=!0,ie(E,J-ce))):(L.sortIndex=X,s(m,L),k||S||(k=!0,A||(A=!0,W()))),L},t.unstable_shouldYield=Q,t.unstable_wrapCallback=function(L){var Z=x;return function(){var J=x;x=Z;try{return L.apply(this,arguments)}finally{x=J}}}})(Uf)),Uf}var ty;function ET(){return ty||(ty=1,$f.exports=CT()),$f.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-dom-client.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var ny;function AT(){if(ny)return Mr;ny=1;var t=ET(),s=iT(),o=oT();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function u(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(d(e)!==e)throw Error(r(188))}function g(e){var n=e.alternate;if(!n){if(n=d(e),n===null)throw Error(r(188));return n!==e?null:e}for(var a=e,l=n;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(l=f.return,l!==null){a=l;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return m(f),e;if(h===l)return m(f),n;h=h.sibling}throw Error(r(188))}if(a.return!==l.return)a=f,l=h;else{for(var _=!1,j=f.child;j;){if(j===a){_=!0,a=f,l=h;break}if(j===l){_=!0,l=f,a=h;break}j=j.sibling}if(!_){for(j=h.child;j;){if(j===a){_=!0,a=h,l=f;break}if(j===l){_=!0,l=h,a=f;break}j=j.sibling}if(!_)throw Error(r(189))}}if(a.alternate!==l)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),D=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function H(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case E:return"Suspense";case A:return"SuspenseList";case U:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case D:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case B:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return n=e.displayName||null,n!==null?n:H(e.type)||"Memo";case I:n=e._payload,e=e._init;try{return H(e(n))}catch{}}return null}var ie=Array.isArray,L=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},ce=[],X=-1;function ge(e){return{current:e}}function fe(e){0>X||(e.current=ce[X],ce[X]=null,X--)}function Ce(e,n){X++,ce[X]=e.current,e.current=n}var Ze=ge(null),me=ge(null),_e=ge(null),ve=ge(null);function Le(e,n){switch(Ce(_e,n),Ce(me,e),Ce(Ze,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?b0(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=b0(n),e=x0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}fe(Ze),Ce(Ze,e)}function Mt(){fe(Ze),fe(me),fe(_e)}function Tn(e){e.memoizedState!==null&&Ce(ve,e);var n=Ze.current,a=x0(n,e.type);n!==a&&(Ce(me,e),Ce(Ze,a))}function oe(e){me.current===e&&(fe(Ze),fe(me)),ve.current===e&&(fe(ve),Cr._currentValue=J)}var Ve,qt;function te(e){if(Ve===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Ve=n&&n[1]||"",qt=-1<a.stack.indexOf(`
|
|
19
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
+
`+Ve+e+qt}var ht=!1;function at(e,n){if(!e||ht)return"";ht=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(K){var F=K}Reflect.construct(e,[],se)}else{try{se.call()}catch(K){F=K}e.call(se.prototype)}}else{try{throw Error()}catch(K){F=K}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(K){if(K&&F&&typeof K.stack=="string")return[K.stack,F.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),_=h[0],j=h[1];if(_&&j){var R=_.split(`
|
|
21
|
+
`),G=j.split(`
|
|
22
|
+
`);for(f=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;f<G.length&&!G[f].includes("DetermineComponentFrameRoot");)f++;if(l===R.length||f===G.length)for(l=R.length-1,f=G.length-1;1<=l&&0<=f&&R[l]!==G[f];)f--;for(;1<=l&&0<=f;l--,f--)if(R[l]!==G[f]){if(l!==1||f!==1)do if(l--,f--,0>f||R[l]!==G[f]){var ee=`
|
|
23
|
+
`+R[l].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=l&&0<=f);break}}}finally{ht=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?te(a):""}function Kt(e,n){switch(e.tag){case 26:case 27:case 5:return te(e.type);case 16:return te("Lazy");case 13:return e.child!==n&&n!==null?te("Suspense Fallback"):te("Suspense");case 19:return te("SuspenseList");case 0:case 15:return at(e.type,!1);case 11:return at(e.type.render,!1);case 1:return at(e.type,!0);case 31:return te("Activity");default:return""}}function gt(e){try{var n="",a=null;do n+=Kt(e,a),a=e,e=e.return;while(e);return n}catch(l){return`
|
|
24
|
+
Error generating stack: `+l.message+`
|
|
25
|
+
`+l.stack}}var ps=Object.prototype.hasOwnProperty,aa=t.unstable_scheduleCallback,es=t.unstable_cancelCallback,Fa=t.unstable_shouldYield,ia=t.unstable_requestPaint,Yt=t.unstable_now,Mi=t.unstable_getCurrentPriorityLevel,oa=t.unstable_ImmediatePriority,Za=t.unstable_UserBlockingPriority,ms=t.unstable_NormalPriority,Ii=t.unstable_LowPriority,wn=t.unstable_IdlePriority,Re=t.log,Je=t.unstable_setDisableYieldValue,Jt=null,St=null;function un(e){if(typeof Re=="function"&&Je(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Jt,e)}catch{}}var Wt=Math.clz32?Math.clz32:Li,Oi=Math.log,Bi=Math.LN2;function Li(e){return e>>>=0,e===0?32:31-(Oi(e)/Bi|0)|0}var Ka=256,Ya=262144,Ja=4194304;function hs(e){var n=e&42;if(n!==0)return n;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 Wa(e,n,a){var l=e.pendingLanes;if(l===0)return 0;var f=0,h=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var j=l&134217727;return j!==0?(l=j&~h,l!==0?f=hs(l):(_&=j,_!==0?f=hs(_):a||(a=j&~e,a!==0&&(f=hs(a))))):(j=l&~h,j!==0?f=hs(j):_!==0?f=hs(_):a||(a=l&~e,a!==0&&(f=hs(a)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:f}function Xa(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function V(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 ae(){var e=Ja;return Ja<<=1,(Ja&62914560)===0&&(Ja=4194304),e}function le(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function de(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ye(e,n,a,l,f,h){var _=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var j=e.entanglements,R=e.expirationTimes,G=e.hiddenUpdates;for(a=_&~a;0<a;){var ee=31-Wt(a),se=1<<ee;j[ee]=0,R[ee]=-1;var F=G[ee];if(F!==null)for(G[ee]=null,ee=0;ee<F.length;ee++){var K=F[ee];K!==null&&(K.lane&=-536870913)}a&=~se}l!==0&&We(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~n))}function We(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Wt(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Te(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var l=31-Wt(a),f=1<<l;f&n|e[l]&n&&(e[l]|=n),a&=~f}}function Ie(e,n){var a=n&-n;return a=(a&42)!==0?1:Ke(a),(a&(e.suspendedLanes|n))!==0?0:a}function Ke(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 ct(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xe(){var e=Z.p;return e!==0?e:(e=window.event,e===void 0?32:V0(e.type))}function Xt(e,n){var a=Z.p;try{return Z.p=e,n()}finally{Z.p=a}}var jt=Math.random().toString(36).slice(2),Ue="__reactFiber$"+jt,It="__reactProps$"+jt,gn="__reactContainer$"+jt,Qa="__reactEvents$"+jt,K1="__reactListeners$"+jt,Y1="__reactHandles$"+jt,oh="__reactResources$"+jt,Vo="__reactMarker$"+jt;function Ed(e){delete e[Ue],delete e[It],delete e[Qa],delete e[K1],delete e[Y1]}function zi(e){var n=e[Ue];if(n)return n;for(var a=e.parentNode;a;){if(n=a[gn]||a[Ue]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=N0(e);e!==null;){if(a=e[Ue])return a;e=N0(e)}return n}e=a,a=e.parentNode}return null}function $i(e){if(e=e[Ue]||e[gn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function qo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function Ui(e){var n=e[oh];return n||(n=e[oh]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Qt(e){e[Vo]=!0}var rh=new Set,lh={};function ei(e,n){Pi(e,n),Pi(e+"Capture",n)}function Pi(e,n){for(lh[e]=n,e=0;e<n.length;e++)rh.add(n[e])}var J1=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]*$"),ch={},dh={};function W1(e){return ps.call(dh,e)?!0:ps.call(ch,e)?!1:J1.test(e)?dh[e]=!0:(ch[e]=!0,!1)}function gl(e,n,a){if(W1(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function vl(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function Cs(e,n,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+l)}}function zn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uh(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function X1(e,n,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,h=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(_){a=""+_,h.call(this,_)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(_){a=""+_},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ad(e){if(!e._valueTracker){var n=uh(e)?"checked":"value";e._valueTracker=X1(e,n,""+e[n])}}function fh(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),l="";return e&&(l=uh(e)?e.checked?"true":"false":e.value),e=l,e!==a?(n.setValue(e),!0):!1}function yl(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 Q1=/[\n"\\]/g;function $n(e){return e.replace(Q1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Dd(e,n,a,l,f,h,_,j){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),n!=null?_==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+zn(n)):e.value!==""+zn(n)&&(e.value=""+zn(n)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),n!=null?Rd(e,_,zn(n)):a!=null?Rd(e,_,zn(a)):l!=null&&e.removeAttribute("value"),f==null&&h!=null&&(e.defaultChecked=!!h),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+zn(j):e.removeAttribute("name")}function ph(e,n,a,l,f,h,_,j){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Ad(e);return}a=a!=null?""+zn(a):"",n=n!=null?""+zn(n):a,j||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=j?e.checked:!!l,e.defaultChecked=!!l,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Ad(e)}function Rd(e,n,a){n==="number"&&yl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Hi(e,n,a,l){if(e=e.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<e.length;a++)f=n.hasOwnProperty("$"+e[a].value),e[a].selected!==f&&(e[a].selected=f),f&&l&&(e[a].defaultSelected=!0)}else{for(a=""+zn(a),n=null,f=0;f<e.length;f++){if(e[f].value===a){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function mh(e,n,a){if(n!=null&&(n=""+zn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+zn(a):""}function hh(e,n,a,l){if(n==null){if(l!=null){if(a!=null)throw Error(r(92));if(ie(l)){if(1<l.length)throw Error(r(93));l=l[0]}a=l}a==null&&(a=""),n=a}a=zn(n),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Ad(e)}function Vi(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var ek=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 gh(e,n,a){var l=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,a):typeof a!="number"||a===0||ek.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function vh(e,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in n)l=n[f],n.hasOwnProperty(f)&&a[f]!==l&&gh(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&gh(e,h,n[h])}function Md(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 tk=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"]]),nk=/^[\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 bl(e){return nk.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Es(){}var Id=null;function Od(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qi=null,Gi=null;function yh(e){var n=$i(e);if(n&&(e=n.stateNode)){var a=e[It]||null;e:switch(e=n.stateNode,n.type){case"input":if(Dd(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$n(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var l=a[n];if(l!==e&&l.form===e.form){var f=l[It]||null;if(!f)throw Error(r(90));Dd(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)l=a[n],l.form===e.form&&fh(l)}break e;case"textarea":mh(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Hi(e,!!a.multiple,n,!1)}}}var Bd=!1;function bh(e,n,a){if(Bd)return e(n,a);Bd=!0;try{var l=e(n);return l}finally{if(Bd=!1,(qi!==null||Gi!==null)&&(oc(),qi&&(n=qi,e=Gi,Gi=qi=null,yh(n),e)))for(n=0;n<e.length;n++)yh(e[n])}}function Go(e,n){var a=e.stateNode;if(a===null)return null;var l=a[It]||null;if(l===null)return null;a=l[n];e:switch(n){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(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var As=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ld=!1;if(As)try{var Fo={};Object.defineProperty(Fo,"passive",{get:function(){Ld=!0}}),window.addEventListener("test",Fo,Fo),window.removeEventListener("test",Fo,Fo)}catch{Ld=!1}var ra=null,zd=null,xl=null;function xh(){if(xl)return xl;var e,n=zd,a=n.length,l,f="value"in ra?ra.value:ra.textContent,h=f.length;for(e=0;e<a&&n[e]===f[e];e++);var _=a-e;for(l=1;l<=_&&n[a-l]===f[h-l];l++);return xl=f.slice(e,1<l?1-l:void 0)}function _l(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function kl(){return!0}function _h(){return!1}function vn(e){function n(a,l,f,h,_){this._reactName=a,this._targetInst=f,this.type=l,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(a=e[j],this[j]=a?a(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?kl:_h,this.isPropagationStopped=_h,this}return b(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),n}var ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sl=vn(ti),Zo=b({},ti,{view:0,detail:0}),sk=vn(Zo),$d,Ud,Ko,Tl=b({},Zo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hd,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!==Ko&&(Ko&&e.type==="mousemove"?($d=e.screenX-Ko.screenX,Ud=e.screenY-Ko.screenY):Ud=$d=0,Ko=e),$d)},movementY:function(e){return"movementY"in e?e.movementY:Ud}}),kh=vn(Tl),ak=b({},Tl,{dataTransfer:0}),ik=vn(ak),ok=b({},Zo,{relatedTarget:0}),Pd=vn(ok),rk=b({},ti,{animationName:0,elapsedTime:0,pseudoElement:0}),lk=vn(rk),ck=b({},ti,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dk=vn(ck),uk=b({},ti,{data:0}),Sh=vn(uk),fk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pk={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"},mk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=mk[e])?!!n[e]:!1}function Hd(){return hk}var gk=b({},Zo,{key:function(e){if(e.key){var n=fk[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=_l(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?pk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hd,charCode:function(e){return e.type==="keypress"?_l(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_l(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vk=vn(gk),yk=b({},Tl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Th=vn(yk),bk=b({},Zo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hd}),xk=vn(bk),_k=b({},ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),kk=vn(_k),Sk=b({},Tl,{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}),Tk=vn(Sk),wk=b({},ti,{newState:0,oldState:0}),jk=vn(wk),Nk=[9,13,27,32],Vd=As&&"CompositionEvent"in window,Yo=null;As&&"documentMode"in document&&(Yo=document.documentMode);var Ck=As&&"TextEvent"in window&&!Yo,wh=As&&(!Vd||Yo&&8<Yo&&11>=Yo),jh=" ",Nh=!1;function Ch(e,n){switch(e){case"keyup":return Nk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fi=!1;function Ek(e,n){switch(e){case"compositionend":return Eh(n);case"keypress":return n.which!==32?null:(Nh=!0,jh);case"textInput":return e=n.data,e===jh&&Nh?null:e;default:return null}}function Ak(e,n){if(Fi)return e==="compositionend"||!Vd&&Ch(e,n)?(e=xh(),xl=zd=ra=null,Fi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return wh&&n.locale!=="ko"?null:n.data;default:return null}}var Dk={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 Ah(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Dk[e.type]:n==="textarea"}function Dh(e,n,a,l){qi?Gi?Gi.push(l):Gi=[l]:qi=l,n=pc(n,"onChange"),0<n.length&&(a=new Sl("onChange","change",null,a,l),e.push({event:a,listeners:n}))}var Jo=null,Wo=null;function Rk(e){p0(e,0)}function wl(e){var n=qo(e);if(fh(n))return e}function Rh(e,n){if(e==="change")return n}var Mh=!1;if(As){var qd;if(As){var Gd="oninput"in document;if(!Gd){var Ih=document.createElement("div");Ih.setAttribute("oninput","return;"),Gd=typeof Ih.oninput=="function"}qd=Gd}else qd=!1;Mh=qd&&(!document.documentMode||9<document.documentMode)}function Oh(){Jo&&(Jo.detachEvent("onpropertychange",Bh),Wo=Jo=null)}function Bh(e){if(e.propertyName==="value"&&wl(Wo)){var n=[];Dh(n,Wo,e,Od(e)),bh(Rk,n)}}function Mk(e,n,a){e==="focusin"?(Oh(),Jo=n,Wo=a,Jo.attachEvent("onpropertychange",Bh)):e==="focusout"&&Oh()}function Ik(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wl(Wo)}function Ok(e,n){if(e==="click")return wl(n)}function Bk(e,n){if(e==="input"||e==="change")return wl(n)}function Lk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var jn=typeof Object.is=="function"?Object.is:Lk;function Xo(e,n){if(jn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),l=Object.keys(n);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var f=a[l];if(!ps.call(n,f)||!jn(e[f],n[f]))return!1}return!0}function Lh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zh(e,n){var a=Lh(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=n&&l>=n)return{node:a,offset:n-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Lh(a)}}function $h(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?$h(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Uh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=yl(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=yl(e.document)}return n}function Fd(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var zk=As&&"documentMode"in document&&11>=document.documentMode,Zi=null,Zd=null,Qo=null,Kd=!1;function Ph(e,n,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Kd||Zi==null||Zi!==yl(l)||(l=Zi,"selectionStart"in l&&Fd(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}),Qo&&Xo(Qo,l)||(Qo=l,l=pc(Zd,"onSelect"),0<l.length&&(n=new Sl("onSelect","select",null,n,a),e.push({event:n,listeners:l}),n.target=Zi)))}function ni(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var Ki={animationend:ni("Animation","AnimationEnd"),animationiteration:ni("Animation","AnimationIteration"),animationstart:ni("Animation","AnimationStart"),transitionrun:ni("Transition","TransitionRun"),transitionstart:ni("Transition","TransitionStart"),transitioncancel:ni("Transition","TransitionCancel"),transitionend:ni("Transition","TransitionEnd")},Yd={},Hh={};As&&(Hh=document.createElement("div").style,"AnimationEvent"in window||(delete Ki.animationend.animation,delete Ki.animationiteration.animation,delete Ki.animationstart.animation),"TransitionEvent"in window||delete Ki.transitionend.transition);function si(e){if(Yd[e])return Yd[e];if(!Ki[e])return e;var n=Ki[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in Hh)return Yd[e]=n[a];return e}var Vh=si("animationend"),qh=si("animationiteration"),Gh=si("animationstart"),$k=si("transitionrun"),Uk=si("transitionstart"),Pk=si("transitioncancel"),Fh=si("transitionend"),Zh=new Map,Jd="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(" ");Jd.push("scrollEnd");function ts(e,n){Zh.set(e,n),ei(n,[e])}var jl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Un=[],Yi=0,Wd=0;function Nl(){for(var e=Yi,n=Wd=Yi=0;n<e;){var a=Un[n];Un[n++]=null;var l=Un[n];Un[n++]=null;var f=Un[n];Un[n++]=null;var h=Un[n];if(Un[n++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&Kh(a,f,h)}}function Cl(e,n,a,l){Un[Yi++]=e,Un[Yi++]=n,Un[Yi++]=a,Un[Yi++]=l,Wd|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Xd(e,n,a,l){return Cl(e,n,a,l),El(e)}function ai(e,n){return Cl(e,null,null,n),El(e)}function Kh(e,n,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var f=!1,h=e.return;h!==null;)h.childLanes|=a,l=h.alternate,l!==null&&(l.childLanes|=a),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(f=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,f&&n!==null&&(f=31-Wt(a),e=h.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=a|536870912),h):null}function El(e){if(50<_r)throw _r=0,lf=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ji={};function Hk(e,n,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,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 Nn(e,n,a,l){return new Hk(e,n,a,l)}function Qd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ds(e,n){var a=e.alternate;return a===null?(a=Nn(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Yh(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Al(e,n,a,l,f,h){var _=0;if(l=e,typeof e=="function")Qd(e)&&(_=1);else if(typeof e=="string")_=ZS(e,a,Ze.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case U:return e=Nn(31,a,n,f),e.elementType=U,e.lanes=h,e;case w:return ii(a.children,f,h,n);case N:_=8,f|=24;break;case T:return e=Nn(12,a,n,f|2),e.elementType=T,e.lanes=h,e;case E:return e=Nn(13,a,n,f),e.elementType=E,e.lanes=h,e;case A:return e=Nn(19,a,n,f),e.elementType=A,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:_=10;break e;case C:_=9;break e;case B:_=11;break e;case P:_=14;break e;case I:_=16,l=null;break e}_=29,a=Error(r(130,e===null?"null":typeof e,"")),l=null}return n=Nn(_,a,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function ii(e,n,a,l){return e=Nn(7,e,l,n),e.lanes=a,e}function eu(e,n,a){return e=Nn(6,e,null,n),e.lanes=a,e}function Jh(e){var n=Nn(18,null,null,0);return n.stateNode=e,n}function tu(e,n,a){return n=Nn(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Wh=new WeakMap;function Pn(e,n){if(typeof e=="object"&&e!==null){var a=Wh.get(e);return a!==void 0?a:(n={value:e,source:n,stack:gt(n)},Wh.set(e,n),n)}return{value:e,source:n,stack:gt(n)}}var Wi=[],Xi=0,Dl=null,er=0,Hn=[],Vn=0,la=null,gs=1,vs="";function Rs(e,n){Wi[Xi++]=er,Wi[Xi++]=Dl,Dl=e,er=n}function Xh(e,n,a){Hn[Vn++]=gs,Hn[Vn++]=vs,Hn[Vn++]=la,la=e;var l=gs;e=vs;var f=32-Wt(l)-1;l&=~(1<<f),a+=1;var h=32-Wt(n)+f;if(30<h){var _=f-f%5;h=(l&(1<<_)-1).toString(32),l>>=_,f-=_,gs=1<<32-Wt(n)+f|a<<f|l,vs=h+e}else gs=1<<h|a<<f|l,vs=e}function nu(e){e.return!==null&&(Rs(e,1),Xh(e,1,0))}function su(e){for(;e===Dl;)Dl=Wi[--Xi],Wi[Xi]=null,er=Wi[--Xi],Wi[Xi]=null;for(;e===la;)la=Hn[--Vn],Hn[Vn]=null,vs=Hn[--Vn],Hn[Vn]=null,gs=Hn[--Vn],Hn[Vn]=null}function Qh(e,n){Hn[Vn++]=gs,Hn[Vn++]=vs,Hn[Vn++]=la,gs=n.id,vs=n.overflow,la=e}var nn=null,vt=null,qe=!1,ca=null,qn=!1,au=Error(r(519));function da(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw tr(Pn(n,e)),au}function eg(e){var n=e.stateNode,a=e.type,l=e.memoizedProps;switch(n[Ue]=e,n[It]=l,a){case"dialog":$e("cancel",n),$e("close",n);break;case"iframe":case"object":case"embed":$e("load",n);break;case"video":case"audio":for(a=0;a<Sr.length;a++)$e(Sr[a],n);break;case"source":$e("error",n);break;case"img":case"image":case"link":$e("error",n),$e("load",n);break;case"details":$e("toggle",n);break;case"input":$e("invalid",n),ph(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":$e("invalid",n);break;case"textarea":$e("invalid",n),hh(n,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||l.suppressHydrationWarning===!0||v0(n.textContent,a)?(l.popover!=null&&($e("beforetoggle",n),$e("toggle",n)),l.onScroll!=null&&$e("scroll",n),l.onScrollEnd!=null&&$e("scrollend",n),l.onClick!=null&&(n.onclick=Es),n=!0):n=!1,n||da(e,!0)}function tg(e){for(nn=e.return;nn;)switch(nn.tag){case 5:case 31:case 13:qn=!1;return;case 27:case 3:qn=!0;return;default:nn=nn.return}}function Qi(e){if(e!==nn)return!1;if(!qe)return tg(e),qe=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Sf(e.type,e.memoizedProps)),a=!a),a&&vt&&da(e),tg(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));vt=j0(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));vt=j0(e)}else n===27?(n=vt,Ta(e.type)?(e=Cf,Cf=null,vt=e):vt=n):vt=nn?Fn(e.stateNode.nextSibling):null;return!0}function oi(){vt=nn=null,qe=!1}function iu(){var e=ca;return e!==null&&(_n===null?_n=e:_n.push.apply(_n,e),ca=null),e}function tr(e){ca===null?ca=[e]:ca.push(e)}var ou=ge(null),ri=null,Ms=null;function ua(e,n,a){Ce(ou,n._currentValue),n._currentValue=a}function Is(e){e._currentValue=ou.current,fe(ou)}function ru(e,n,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===a)break;e=e.return}}function lu(e,n,a,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var h=f.dependencies;if(h!==null){var _=f.child;h=h.firstContext;e:for(;h!==null;){var j=h;h=f;for(var R=0;R<n.length;R++)if(j.context===n[R]){h.lanes|=a,j=h.alternate,j!==null&&(j.lanes|=a),ru(h.return,a,e),l||(_=null);break e}h=j.next}}else if(f.tag===18){if(_=f.return,_===null)throw Error(r(341));_.lanes|=a,h=_.alternate,h!==null&&(h.lanes|=a),ru(_,a,e),_=null}else _=f.child;if(_!==null)_.return=f;else for(_=f;_!==null;){if(_===e){_=null;break}if(f=_.sibling,f!==null){f.return=_.return,_=f;break}_=_.return}f=_}}function eo(e,n,a,l){e=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var _=f.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var j=f.type;jn(f.pendingProps.value,_.value)||(e!==null?e.push(j):e=[j])}}else if(f===ve.current){if(_=f.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Cr):e=[Cr])}f=f.return}e!==null&&lu(n,e,a,l),n.flags|=262144}function Rl(e){for(e=e.firstContext;e!==null;){if(!jn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function li(e){ri=e,Ms=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function sn(e){return ng(ri,e)}function Ml(e,n){return ri===null&&li(e),ng(e,n)}function ng(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Ms===null){if(e===null)throw Error(r(308));Ms=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Ms=Ms.next=n;return a}var Vk=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},qk=t.unstable_scheduleCallback,Gk=t.unstable_NormalPriority,Ut={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cu(){return{controller:new Vk,data:new Map,refCount:0}}function nr(e){e.refCount--,e.refCount===0&&qk(Gk,function(){e.controller.abort()})}var sr=null,du=0,to=0,no=null;function Fk(e,n){if(sr===null){var a=sr=[];du=0,to=mf(),no={status:"pending",value:void 0,then:function(l){a.push(l)}}}return du++,n.then(sg,sg),n}function sg(){if(--du===0&&sr!==null){no!==null&&(no.status="fulfilled");var e=sr;sr=null,to=0,no=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Zk(e,n){var a=[],l={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),l}var ag=L.S;L.S=function(e,n){Pv=Yt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Fk(e,n),ag!==null&&ag(e,n)};var ci=ge(null);function uu(){var e=ci.current;return e!==null?e:pt.pooledCache}function Il(e,n){n===null?Ce(ci,ci.current):Ce(ci,n.pool)}function ig(){var e=uu();return e===null?null:{parent:Ut._currentValue,pool:e}}var so=Error(r(460)),fu=Error(r(474)),Ol=Error(r(542)),Bl={then:function(){}};function og(e){return e=e.status,e==="fulfilled"||e==="rejected"}function rg(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(Es,Es),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,cg(e),e;default:if(typeof n.status=="string")n.then(Es,Es);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=l}},function(l){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,cg(e),e}throw ui=n,so}}function di(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ui=a,so):a}}var ui=null;function lg(){if(ui===null)throw Error(r(459));var e=ui;return ui=null,e}function cg(e){if(e===so||e===Ol)throw Error(r(483))}var ao=null,ar=0;function Ll(e){var n=ar;return ar+=1,ao===null&&(ao=[]),rg(ao,e,n)}function ir(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function zl(e,n){throw n.$$typeof===x?Error(r(525)):(e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function dg(e){function n(z,O){if(e){var q=z.deletions;q===null?(z.deletions=[O],z.flags|=16):q.push(O)}}function a(z,O){if(!e)return null;for(;O!==null;)n(z,O),O=O.sibling;return null}function l(z){for(var O=new Map;z!==null;)z.key!==null?O.set(z.key,z):O.set(z.index,z),z=z.sibling;return O}function f(z,O){return z=Ds(z,O),z.index=0,z.sibling=null,z}function h(z,O,q){return z.index=q,e?(q=z.alternate,q!==null?(q=q.index,q<O?(z.flags|=67108866,O):q):(z.flags|=67108866,O)):(z.flags|=1048576,O)}function _(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function j(z,O,q,ne){return O===null||O.tag!==6?(O=eu(q,z.mode,ne),O.return=z,O):(O=f(O,q),O.return=z,O)}function R(z,O,q,ne){var je=q.type;return je===w?ee(z,O,q.props.children,ne,q.key):O!==null&&(O.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===I&&di(je)===O.type)?(O=f(O,q.props),ir(O,q),O.return=z,O):(O=Al(q.type,q.key,q.props,null,z.mode,ne),ir(O,q),O.return=z,O)}function G(z,O,q,ne){return O===null||O.tag!==4||O.stateNode.containerInfo!==q.containerInfo||O.stateNode.implementation!==q.implementation?(O=tu(q,z.mode,ne),O.return=z,O):(O=f(O,q.children||[]),O.return=z,O)}function ee(z,O,q,ne,je){return O===null||O.tag!==7?(O=ii(q,z.mode,ne,je),O.return=z,O):(O=f(O,q),O.return=z,O)}function se(z,O,q){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=eu(""+O,z.mode,q),O.return=z,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case S:return q=Al(O.type,O.key,O.props,null,z.mode,q),ir(q,O),q.return=z,q;case k:return O=tu(O,z.mode,q),O.return=z,O;case I:return O=di(O),se(z,O,q)}if(ie(O)||W(O))return O=ii(O,z.mode,q,null),O.return=z,O;if(typeof O.then=="function")return se(z,Ll(O),q);if(O.$$typeof===D)return se(z,Ml(z,O),q);zl(z,O)}return null}function F(z,O,q,ne){var je=O!==null?O.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return je!==null?null:j(z,O,""+q,ne);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case S:return q.key===je?R(z,O,q,ne):null;case k:return q.key===je?G(z,O,q,ne):null;case I:return q=di(q),F(z,O,q,ne)}if(ie(q)||W(q))return je!==null?null:ee(z,O,q,ne,null);if(typeof q.then=="function")return F(z,O,Ll(q),ne);if(q.$$typeof===D)return F(z,O,Ml(z,q),ne);zl(z,q)}return null}function K(z,O,q,ne,je){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return z=z.get(q)||null,j(O,z,""+ne,je);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return z=z.get(ne.key===null?q:ne.key)||null,R(O,z,ne,je);case k:return z=z.get(ne.key===null?q:ne.key)||null,G(O,z,ne,je);case I:return ne=di(ne),K(z,O,q,ne,je)}if(ie(ne)||W(ne))return z=z.get(q)||null,ee(O,z,ne,je,null);if(typeof ne.then=="function")return K(z,O,q,Ll(ne),je);if(ne.$$typeof===D)return K(z,O,q,Ml(O,ne),je);zl(O,ne)}return null}function xe(z,O,q,ne){for(var je=null,Qe=null,ke=O,Be=O=0,He=null;ke!==null&&Be<q.length;Be++){ke.index>Be?(He=ke,ke=null):He=ke.sibling;var et=F(z,ke,q[Be],ne);if(et===null){ke===null&&(ke=He);break}e&&ke&&et.alternate===null&&n(z,ke),O=h(et,O,Be),Qe===null?je=et:Qe.sibling=et,Qe=et,ke=He}if(Be===q.length)return a(z,ke),qe&&Rs(z,Be),je;if(ke===null){for(;Be<q.length;Be++)ke=se(z,q[Be],ne),ke!==null&&(O=h(ke,O,Be),Qe===null?je=ke:Qe.sibling=ke,Qe=ke);return qe&&Rs(z,Be),je}for(ke=l(ke);Be<q.length;Be++)He=K(ke,z,Be,q[Be],ne),He!==null&&(e&&He.alternate!==null&&ke.delete(He.key===null?Be:He.key),O=h(He,O,Be),Qe===null?je=He:Qe.sibling=He,Qe=He);return e&&ke.forEach(function(Ea){return n(z,Ea)}),qe&&Rs(z,Be),je}function Ee(z,O,q,ne){if(q==null)throw Error(r(151));for(var je=null,Qe=null,ke=O,Be=O=0,He=null,et=q.next();ke!==null&&!et.done;Be++,et=q.next()){ke.index>Be?(He=ke,ke=null):He=ke.sibling;var Ea=F(z,ke,et.value,ne);if(Ea===null){ke===null&&(ke=He);break}e&&ke&&Ea.alternate===null&&n(z,ke),O=h(Ea,O,Be),Qe===null?je=Ea:Qe.sibling=Ea,Qe=Ea,ke=He}if(et.done)return a(z,ke),qe&&Rs(z,Be),je;if(ke===null){for(;!et.done;Be++,et=q.next())et=se(z,et.value,ne),et!==null&&(O=h(et,O,Be),Qe===null?je=et:Qe.sibling=et,Qe=et);return qe&&Rs(z,Be),je}for(ke=l(ke);!et.done;Be++,et=q.next())et=K(ke,z,Be,et.value,ne),et!==null&&(e&&et.alternate!==null&&ke.delete(et.key===null?Be:et.key),O=h(et,O,Be),Qe===null?je=et:Qe.sibling=et,Qe=et);return e&&ke.forEach(function(aT){return n(z,aT)}),qe&&Rs(z,Be),je}function ft(z,O,q,ne){if(typeof q=="object"&&q!==null&&q.type===w&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case S:e:{for(var je=q.key;O!==null;){if(O.key===je){if(je=q.type,je===w){if(O.tag===7){a(z,O.sibling),ne=f(O,q.props.children),ne.return=z,z=ne;break e}}else if(O.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===I&&di(je)===O.type){a(z,O.sibling),ne=f(O,q.props),ir(ne,q),ne.return=z,z=ne;break e}a(z,O);break}else n(z,O);O=O.sibling}q.type===w?(ne=ii(q.props.children,z.mode,ne,q.key),ne.return=z,z=ne):(ne=Al(q.type,q.key,q.props,null,z.mode,ne),ir(ne,q),ne.return=z,z=ne)}return _(z);case k:e:{for(je=q.key;O!==null;){if(O.key===je)if(O.tag===4&&O.stateNode.containerInfo===q.containerInfo&&O.stateNode.implementation===q.implementation){a(z,O.sibling),ne=f(O,q.children||[]),ne.return=z,z=ne;break e}else{a(z,O);break}else n(z,O);O=O.sibling}ne=tu(q,z.mode,ne),ne.return=z,z=ne}return _(z);case I:return q=di(q),ft(z,O,q,ne)}if(ie(q))return xe(z,O,q,ne);if(W(q)){if(je=W(q),typeof je!="function")throw Error(r(150));return q=je.call(q),Ee(z,O,q,ne)}if(typeof q.then=="function")return ft(z,O,Ll(q),ne);if(q.$$typeof===D)return ft(z,O,Ml(z,q),ne);zl(z,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,O!==null&&O.tag===6?(a(z,O.sibling),ne=f(O,q),ne.return=z,z=ne):(a(z,O),ne=eu(q,z.mode,ne),ne.return=z,z=ne),_(z)):a(z,O)}return function(z,O,q,ne){try{ar=0;var je=ft(z,O,q,ne);return ao=null,je}catch(ke){if(ke===so||ke===Ol)throw ke;var Qe=Nn(29,ke,null,z.mode);return Qe.lanes=ne,Qe.return=z,Qe}finally{}}}var fi=dg(!0),ug=dg(!1),fa=!1;function pu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ma(e,n,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(st&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=El(e),Kh(e,null,a),n}return Cl(e,l,n,a),El(e)}function or(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,a|=l,n.lanes=a,Te(e,a)}}function hu(e,n){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var _={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=_:h=h.next=_,a=a.next}while(a!==null);h===null?f=h=n:h=h.next=n}else f=h=n;a={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var gu=!1;function rr(){if(gu){var e=no;if(e!==null)throw e}}function lr(e,n,a,l){gu=!1;var f=e.updateQueue;fa=!1;var h=f.firstBaseUpdate,_=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var R=j,G=R.next;R.next=null,_===null?h=G:_.next=G,_=R;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,j=ee.lastBaseUpdate,j!==_&&(j===null?ee.firstBaseUpdate=G:j.next=G,ee.lastBaseUpdate=R))}if(h!==null){var se=f.baseState;_=0,ee=G=R=null,j=h;do{var F=j.lane&-536870913,K=F!==j.lane;if(K?(Pe&F)===F:(l&F)===F){F!==0&&F===to&&(gu=!0),ee!==null&&(ee=ee.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var xe=e,Ee=j;F=n;var ft=a;switch(Ee.tag){case 1:if(xe=Ee.payload,typeof xe=="function"){se=xe.call(ft,se,F);break e}se=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Ee.payload,F=typeof xe=="function"?xe.call(ft,se,F):xe,F==null)break e;se=b({},se,F);break e;case 2:fa=!0}}F=j.callback,F!==null&&(e.flags|=64,K&&(e.flags|=8192),K=f.callbacks,K===null?f.callbacks=[F]:K.push(F))}else K={lane:F,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ee===null?(G=ee=K,R=se):ee=ee.next=K,_|=F;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;K=j,j=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);ee===null&&(R=se),f.baseState=R,f.firstBaseUpdate=G,f.lastBaseUpdate=ee,h===null&&(f.shared.lanes=0),ba|=_,e.lanes=_,e.memoizedState=se}}function fg(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function pg(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)fg(a[e],n)}var io=ge(null),$l=ge(0);function mg(e,n){e=Vs,Ce($l,e),Ce(io,n),Vs=e|n.baseLanes}function vu(){Ce($l,Vs),Ce(io,io.current)}function yu(){Vs=$l.current,fe(io),fe($l)}var Cn=ge(null),Gn=null;function ha(e){var n=e.alternate;Ce(Ot,Ot.current&1),Ce(Cn,e),Gn===null&&(n===null||io.current!==null||n.memoizedState!==null)&&(Gn=e)}function bu(e){Ce(Ot,Ot.current),Ce(Cn,e),Gn===null&&(Gn=e)}function hg(e){e.tag===22?(Ce(Ot,Ot.current),Ce(Cn,e),Gn===null&&(Gn=e)):ga()}function ga(){Ce(Ot,Ot.current),Ce(Cn,Cn.current)}function En(e){fe(Cn),Gn===e&&(Gn=null),fe(Ot)}var Ot=ge(0);function Ul(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||jf(a)||Nf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Os=0,Oe=null,dt=null,Pt=null,Pl=!1,oo=!1,pi=!1,Hl=0,cr=0,ro=null,Kk=0;function Ct(){throw Error(r(321))}function xu(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!jn(e[a],n[a]))return!1;return!0}function _u(e,n,a,l,f,h){return Os=h,Oe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,L.H=e===null||e.memoizedState===null?Xg:Bu,pi=!1,h=a(l,f),pi=!1,oo&&(h=vg(n,a,l,f)),gg(e),h}function gg(e){L.H=fr;var n=dt!==null&&dt.next!==null;if(Os=0,Pt=dt=Oe=null,Pl=!1,cr=0,ro=null,n)throw Error(r(300));e===null||Ht||(e=e.dependencies,e!==null&&Rl(e)&&(Ht=!0))}function vg(e,n,a,l){Oe=e;var f=0;do{if(oo&&(ro=null),cr=0,oo=!1,25<=f)throw Error(r(301));if(f+=1,Pt=dt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}L.H=Qg,h=n(a,l)}while(oo);return h}function Yk(){var e=L.H,n=e.useState()[0];return n=typeof n.then=="function"?dr(n):n,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Oe.flags|=1024),n}function ku(){var e=Hl!==0;return Hl=0,e}function Su(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function Tu(e){if(Pl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Pl=!1}Os=0,Pt=dt=Oe=null,oo=!1,cr=Hl=0,ro=null}function fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Oe.memoizedState=Pt=e:Pt=Pt.next=e,Pt}function Bt(){if(dt===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var n=Pt===null?Oe.memoizedState:Pt.next;if(n!==null)Pt=n,dt=e;else{if(e===null)throw Oe.alternate===null?Error(r(467)):Error(r(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Pt===null?Oe.memoizedState=Pt=e:Pt=Pt.next=e}return Pt}function Vl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function dr(e){var n=cr;return cr+=1,ro===null&&(ro=[]),e=rg(ro,e,n),n=Oe,(Pt===null?n.memoizedState:Pt.next)===null&&(n=n.alternate,L.H=n===null||n.memoizedState===null?Xg:Bu),e}function ql(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return dr(e);if(e.$$typeof===D)return sn(e)}throw Error(r(438,String(e)))}function wu(e){var n=null,a=Oe.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var l=Oe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Vl(),Oe.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),l=0;l<e;l++)a[l]=Q;return n.index++,a}function Bs(e,n){return typeof n=="function"?n(e):n}function Gl(e){var n=Bt();return ju(n,dt,e)}function ju(e,n,a){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=a;var f=e.baseQueue,h=l.pending;if(h!==null){if(f!==null){var _=f.next;f.next=h.next,h.next=_}n.baseQueue=f=h,l.pending=null}if(h=e.baseState,f===null)e.memoizedState=h;else{n=f.next;var j=_=null,R=null,G=n,ee=!1;do{var se=G.lane&-536870913;if(se!==G.lane?(Pe&se)===se:(Os&se)===se){var F=G.revertLane;if(F===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),se===to&&(ee=!0);else if((Os&F)===F){G=G.next,F===to&&(ee=!0);continue}else se={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(j=R=se,_=h):R=R.next=se,Oe.lanes|=F,ba|=F;se=G.action,pi&&a(h,se),h=G.hasEagerState?G.eagerState:a(h,se)}else F={lane:se,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},R===null?(j=R=F,_=h):R=R.next=F,Oe.lanes|=se,ba|=se;G=G.next}while(G!==null&&G!==n);if(R===null?_=h:R.next=j,!jn(h,e.memoizedState)&&(Ht=!0,ee&&(a=no,a!==null)))throw a;e.memoizedState=h,e.baseState=_,e.baseQueue=R,l.lastRenderedState=h}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Nu(e){var n=Bt(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=e;var l=a.dispatch,f=a.pending,h=n.memoizedState;if(f!==null){a.pending=null;var _=f=f.next;do h=e(h,_.action),_=_.next;while(_!==f);jn(h,n.memoizedState)||(Ht=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,l]}function yg(e,n,a){var l=Oe,f=Bt(),h=qe;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var _=!jn((dt||f).memoizedState,a);if(_&&(f.memoizedState=a,Ht=!0),f=f.queue,Au(_g.bind(null,l,f,e),[e]),f.getSnapshot!==n||_||Pt!==null&&Pt.memoizedState.tag&1){if(l.flags|=2048,lo(9,{destroy:void 0},xg.bind(null,l,f,a,n),null),pt===null)throw Error(r(349));h||(Os&127)!==0||bg(l,n,a)}return a}function bg(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Oe.updateQueue,n===null?(n=Vl(),Oe.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function xg(e,n,a,l){n.value=a,n.getSnapshot=l,kg(n)&&Sg(e)}function _g(e,n,a){return a(function(){kg(n)&&Sg(e)})}function kg(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!jn(e,a)}catch{return!0}}function Sg(e){var n=ai(e,2);n!==null&&kn(n,e,2)}function Cu(e){var n=fn();if(typeof e=="function"){var a=e;if(e=a(),pi){un(!0);try{a()}finally{un(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:e},n}function Tg(e,n,a,l){return e.baseState=a,ju(e,dt,typeof l=="function"?l:Bs)}function Jk(e,n,a,l,f){if(Kl(e))throw Error(r(485));if(e=n.action,e!==null){var h={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){h.listeners.push(_)}};L.T!==null?a(!0):h.isTransition=!1,l(h),a=n.pending,a===null?(h.next=n.pending=h,wg(n,h)):(h.next=a.next,n.pending=a.next=h)}}function wg(e,n){var a=n.action,l=n.payload,f=e.state;if(n.isTransition){var h=L.T,_={};L.T=_;try{var j=a(f,l),R=L.S;R!==null&&R(_,j),jg(e,n,j)}catch(G){Eu(e,n,G)}finally{h!==null&&_.types!==null&&(h.types=_.types),L.T=h}}else try{h=a(f,l),jg(e,n,h)}catch(G){Eu(e,n,G)}}function jg(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Ng(e,n,l)},function(l){return Eu(e,n,l)}):Ng(e,n,a)}function Ng(e,n,a){n.status="fulfilled",n.value=a,Cg(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,wg(e,a)))}function Eu(e,n,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=a,Cg(n),n=n.next;while(n!==l)}e.action=null}function Cg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Eg(e,n){return n}function Ag(e,n){if(qe){var a=pt.formState;if(a!==null){e:{var l=Oe;if(qe){if(vt){t:{for(var f=vt,h=qn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Fn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){vt=Fn(f.nextSibling),l=f.data==="F!";break e}}da(l)}l=!1}l&&(n=a[0])}}return a=fn(),a.memoizedState=a.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eg,lastRenderedState:n},a.queue=l,a=Yg.bind(null,Oe,l),l.dispatch=a,l=Cu(!1),h=Ou.bind(null,Oe,!1,l.queue),l=fn(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,a=Jk.bind(null,Oe,f,h,a),f.dispatch=a,l.memoizedState=e,[n,a,!1]}function Dg(e){var n=Bt();return Rg(n,dt,e)}function Rg(e,n,a){if(n=ju(e,n,Eg)[0],e=Gl(Bs)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=dr(n)}catch(_){throw _===so?Ol:_}else l=n;n=Bt();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(Oe.flags|=2048,lo(9,{destroy:void 0},Wk.bind(null,f,a),null)),[l,h,e]}function Wk(e,n){e.action=n}function Mg(e){var n=Bt(),a=dt;if(a!==null)return Rg(n,a,e);Bt(),n=n.memoizedState,a=Bt();var l=a.queue.dispatch;return a.memoizedState=e,[n,l,!1]}function lo(e,n,a,l){return e={tag:e,create:a,deps:l,inst:n,next:null},n=Oe.updateQueue,n===null&&(n=Vl(),Oe.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,n.lastEffect=e),e}function Ig(){return Bt().memoizedState}function Fl(e,n,a,l){var f=fn();Oe.flags|=e,f.memoizedState=lo(1|n,{destroy:void 0},a,l===void 0?null:l)}function Zl(e,n,a,l){var f=Bt();l=l===void 0?null:l;var h=f.memoizedState.inst;dt!==null&&l!==null&&xu(l,dt.memoizedState.deps)?f.memoizedState=lo(n,h,a,l):(Oe.flags|=e,f.memoizedState=lo(1|n,h,a,l))}function Og(e,n){Fl(8390656,8,e,n)}function Au(e,n){Zl(2048,8,e,n)}function Xk(e){Oe.flags|=4;var n=Oe.updateQueue;if(n===null)n=Vl(),Oe.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function Bg(e){var n=Bt().memoizedState;return Xk({ref:n,nextImpl:e}),function(){if((st&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Lg(e,n){return Zl(4,2,e,n)}function zg(e,n){return Zl(4,4,e,n)}function $g(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Ug(e,n,a){a=a!=null?a.concat([e]):null,Zl(4,4,$g.bind(null,n,e),a)}function Du(){}function Pg(e,n){var a=Bt();n=n===void 0?null:n;var l=a.memoizedState;return n!==null&&xu(n,l[1])?l[0]:(a.memoizedState=[e,n],e)}function Hg(e,n){var a=Bt();n=n===void 0?null:n;var l=a.memoizedState;if(n!==null&&xu(n,l[1]))return l[0];if(l=e(),pi){un(!0);try{e()}finally{un(!1)}}return a.memoizedState=[l,n],l}function Ru(e,n,a){return a===void 0||(Os&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Vv(),Oe.lanes|=e,ba|=e,a)}function Vg(e,n,a,l){return jn(a,n)?a:io.current!==null?(e=Ru(e,a,l),jn(e,n)||(Ht=!0),e):(Os&42)===0||(Os&1073741824)!==0&&(Pe&261930)===0?(Ht=!0,e.memoizedState=a):(e=Vv(),Oe.lanes|=e,ba|=e,n)}function qg(e,n,a,l,f){var h=Z.p;Z.p=h!==0&&8>h?h:8;var _=L.T,j={};L.T=j,Ou(e,!1,n,a);try{var R=f(),G=L.S;if(G!==null&&G(j,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ee=Zk(R,l);ur(e,n,ee,Rn(e))}else ur(e,n,l,Rn(e))}catch(se){ur(e,n,{then:function(){},status:"rejected",reason:se},Rn())}finally{Z.p=h,_!==null&&j.types!==null&&(_.types=j.types),L.T=_}}function Qk(){}function Mu(e,n,a,l){if(e.tag!==5)throw Error(r(476));var f=Gg(e).queue;qg(e,f,n,J,a===null?Qk:function(){return Fg(e),a(l)})}function Gg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:J},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Fg(e){var n=Gg(e);n.next===null&&(n=e.alternate.memoizedState),ur(e,n.next.queue,{},Rn())}function Iu(){return sn(Cr)}function Zg(){return Bt().memoizedState}function Kg(){return Bt().memoizedState}function eS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=Rn();e=pa(a);var l=ma(n,e,a);l!==null&&(kn(l,n,a),or(l,n,a)),n={cache:cu()},e.payload=n;return}n=n.return}}function tS(e,n,a){var l=Rn();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kl(e)?Jg(n,a):(a=Xd(e,n,a,l),a!==null&&(kn(a,e,l),Wg(a,n,l)))}function Yg(e,n,a){var l=Rn();ur(e,n,a,l)}function ur(e,n,a,l){var f={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Kl(e))Jg(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var _=n.lastRenderedState,j=h(_,a);if(f.hasEagerState=!0,f.eagerState=j,jn(j,_))return Cl(e,n,f,0),pt===null&&Nl(),!1}catch{}finally{}if(a=Xd(e,n,f,l),a!==null)return kn(a,e,l),Wg(a,n,l),!0}return!1}function Ou(e,n,a,l){if(l={lane:2,revertLane:mf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Kl(e)){if(n)throw Error(r(479))}else n=Xd(e,a,l,2),n!==null&&kn(n,e,2)}function Kl(e){var n=e.alternate;return e===Oe||n!==null&&n===Oe}function Jg(e,n){oo=Pl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Wg(e,n,a){if((a&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,a|=l,n.lanes=a,Te(e,a)}}var fr={readContext:sn,use:ql,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};fr.useEffectEvent=Ct;var Xg={readContext:sn,use:ql,useCallback:function(e,n){return fn().memoizedState=[e,n===void 0?null:n],e},useContext:sn,useEffect:Og,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Fl(4194308,4,$g.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Fl(4194308,4,e,n)},useInsertionEffect:function(e,n){Fl(4,2,e,n)},useMemo:function(e,n){var a=fn();n=n===void 0?null:n;var l=e();if(pi){un(!0);try{e()}finally{un(!1)}}return a.memoizedState=[l,n],l},useReducer:function(e,n,a){var l=fn();if(a!==void 0){var f=a(n);if(pi){un(!0);try{a(n)}finally{un(!1)}}}else f=n;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=tS.bind(null,Oe,e),[l.memoizedState,e]},useRef:function(e){var n=fn();return e={current:e},n.memoizedState=e},useState:function(e){e=Cu(e);var n=e.queue,a=Yg.bind(null,Oe,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Du,useDeferredValue:function(e,n){var a=fn();return Ru(a,e,n)},useTransition:function(){var e=Cu(!1);return e=qg.bind(null,Oe,e.queue,!0,!1),fn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var l=Oe,f=fn();if(qe){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),pt===null)throw Error(r(349));(Pe&127)!==0||bg(l,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,Og(_g.bind(null,l,h,e),[e]),l.flags|=2048,lo(9,{destroy:void 0},xg.bind(null,l,h,a,n),null),a},useId:function(){var e=fn(),n=pt.identifierPrefix;if(qe){var a=vs,l=gs;a=(l&~(1<<32-Wt(l)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Hl++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=Kk++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Iu,useFormState:Ag,useActionState:Ag,useOptimistic:function(e){var n=fn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Ou.bind(null,Oe,!0,a),a.dispatch=n,[e,n]},useMemoCache:wu,useCacheRefresh:function(){return fn().memoizedState=eS.bind(null,Oe)},useEffectEvent:function(e){var n=fn(),a={impl:e};return n.memoizedState=a,function(){if((st&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Bu={readContext:sn,use:ql,useCallback:Pg,useContext:sn,useEffect:Au,useImperativeHandle:Ug,useInsertionEffect:Lg,useLayoutEffect:zg,useMemo:Hg,useReducer:Gl,useRef:Ig,useState:function(){return Gl(Bs)},useDebugValue:Du,useDeferredValue:function(e,n){var a=Bt();return Vg(a,dt.memoizedState,e,n)},useTransition:function(){var e=Gl(Bs)[0],n=Bt().memoizedState;return[typeof e=="boolean"?e:dr(e),n]},useSyncExternalStore:yg,useId:Zg,useHostTransitionStatus:Iu,useFormState:Dg,useActionState:Dg,useOptimistic:function(e,n){var a=Bt();return Tg(a,dt,e,n)},useMemoCache:wu,useCacheRefresh:Kg};Bu.useEffectEvent=Bg;var Qg={readContext:sn,use:ql,useCallback:Pg,useContext:sn,useEffect:Au,useImperativeHandle:Ug,useInsertionEffect:Lg,useLayoutEffect:zg,useMemo:Hg,useReducer:Nu,useRef:Ig,useState:function(){return Nu(Bs)},useDebugValue:Du,useDeferredValue:function(e,n){var a=Bt();return dt===null?Ru(a,e,n):Vg(a,dt.memoizedState,e,n)},useTransition:function(){var e=Nu(Bs)[0],n=Bt().memoizedState;return[typeof e=="boolean"?e:dr(e),n]},useSyncExternalStore:yg,useId:Zg,useHostTransitionStatus:Iu,useFormState:Mg,useActionState:Mg,useOptimistic:function(e,n){var a=Bt();return dt!==null?Tg(a,dt,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:wu,useCacheRefresh:Kg};Qg.useEffectEvent=Bg;function Lu(e,n,a,l){n=e.memoizedState,a=a(l,n),a=a==null?n:b({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var zu={enqueueSetState:function(e,n,a){e=e._reactInternals;var l=Rn(),f=pa(l);f.payload=n,a!=null&&(f.callback=a),n=ma(e,f,l),n!==null&&(kn(n,e,l),or(n,e,l))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var l=Rn(),f=pa(l);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ma(e,f,l),n!==null&&(kn(n,e,l),or(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=Rn(),l=pa(a);l.tag=2,n!=null&&(l.callback=n),n=ma(e,l,a),n!==null&&(kn(n,e,a),or(n,e,a))}};function ev(e,n,a,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):n.prototype&&n.prototype.isPureReactComponent?!Xo(a,l)||!Xo(f,h):!0}function tv(e,n,a,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,l),n.state!==e&&zu.enqueueReplaceState(n,n.state,null)}function mi(e,n){var a=n;if("ref"in n){a={};for(var l in n)l!=="ref"&&(a[l]=n[l])}if(e=e.defaultProps){a===n&&(a=b({},a));for(var f in e)a[f]===void 0&&(a[f]=e[f])}return a}function nv(e){jl(e)}function sv(e){console.error(e)}function av(e){jl(e)}function Yl(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function iv(e,n,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function $u(e,n,a){return a=pa(a),a.tag=3,a.payload={element:null},a.callback=function(){Yl(e,n)},a}function ov(e){return e=pa(e),e.tag=3,e}function rv(e,n,a,l){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=l.value;e.payload=function(){return f(h)},e.callback=function(){iv(n,a,l)}}var _=a.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){iv(n,a,l),typeof f!="function"&&(xa===null?xa=new Set([this]):xa.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function nS(e,n,a,l,f){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=a.alternate,n!==null&&eo(n,a,f,!0),a=Cn.current,a!==null){switch(a.tag){case 31:case 13:return Gn===null?rc():a.alternate===null&&Et===0&&(Et=3),a.flags&=-257,a.flags|=65536,a.lanes=f,l===Bl?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([l]):n.add(l),uf(e,l,f)),!1;case 22:return a.flags|=65536,l===Bl?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([l]):a.add(l)),uf(e,l,f)),!1}throw Error(r(435,a.tag))}return uf(e,l,f),rc(),!1}if(qe)return n=Cn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==au&&(e=Error(r(422),{cause:l}),tr(Pn(e,a)))):(l!==au&&(n=Error(r(423),{cause:l}),tr(Pn(n,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=Pn(l,a),f=$u(e.stateNode,l,f),hu(e,f),Et!==4&&(Et=2)),!1;var h=Error(r(520),{cause:l});if(h=Pn(h,a),xr===null?xr=[h]:xr.push(h),Et!==4&&(Et=2),n===null)return!0;l=Pn(l,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=$u(a.stateNode,l,e),hu(a,e),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(xa===null||!xa.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=ov(f),rv(f,e,a,l),hu(a,f),!1}a=a.return}while(a!==null);return!1}var Uu=Error(r(461)),Ht=!1;function an(e,n,a,l){n.child=e===null?ug(n,null,a,l):fi(n,e.child,a,l)}function lv(e,n,a,l,f){a=a.render;var h=n.ref;if("ref"in l){var _={};for(var j in l)j!=="ref"&&(_[j]=l[j])}else _=l;return li(n),l=_u(e,n,a,_,h,f),j=ku(),e!==null&&!Ht?(Su(e,n,f),Ls(e,n,f)):(qe&&j&&nu(n),n.flags|=1,an(e,n,l,f),n.child)}function cv(e,n,a,l,f){if(e===null){var h=a.type;return typeof h=="function"&&!Qd(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,dv(e,n,h,l,f)):(e=Al(a.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!Ku(e,f)){var _=h.memoizedProps;if(a=a.compare,a=a!==null?a:Xo,a(_,l)&&e.ref===n.ref)return Ls(e,n,f)}return n.flags|=1,e=Ds(h,l),e.ref=n.ref,e.return=n,n.child=e}function dv(e,n,a,l,f){if(e!==null){var h=e.memoizedProps;if(Xo(h,l)&&e.ref===n.ref)if(Ht=!1,n.pendingProps=l=h,Ku(e,f))(e.flags&131072)!==0&&(Ht=!0);else return n.lanes=e.lanes,Ls(e,n,f)}return Pu(e,n,a,l,f)}function uv(e,n,a,l){var f=l.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|a:a,e!==null){for(l=n.child=e.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~h}else l=0,n.child=null;return fv(e,n,h,a,l)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Il(n,h!==null?h.cachePool:null),h!==null?mg(n,h):vu(),hg(n);else return l=n.lanes=536870912,fv(e,n,h!==null?h.baseLanes|a:a,a,l)}else h!==null?(Il(n,h.cachePool),mg(n,h),ga(),n.memoizedState=null):(e!==null&&Il(n,null),vu(),ga());return an(e,n,f,a),n.child}function pr(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function fv(e,n,a,l,f){var h=uu();return h=h===null?null:{parent:Ut._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},e!==null&&Il(n,null),vu(),hg(n),e!==null&&eo(e,n,l,!0),n.childLanes=f,null}function Jl(e,n){return n=Xl({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function pv(e,n,a){return fi(n,e.child,null,a),e=Jl(n,n.pendingProps),e.flags|=2,En(n),n.memoizedState=null,e}function sS(e,n,a){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(qe){if(l.mode==="hidden")return e=Jl(n,l),n.lanes=536870912,pr(null,e);if(bu(n),(e=vt)?(e=w0(e,qn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:la!==null?{id:gs,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},a=Jh(e),a.return=n,n.child=a,nn=n,vt=null)):e=null,e===null)throw da(n);return n.lanes=536870912,null}return Jl(n,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(bu(n),f)if(n.flags&256)n.flags&=-257,n=pv(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ht||eo(e,n,a,!1),f=(a&e.childLanes)!==0,Ht||f){if(l=pt,l!==null&&(_=Ie(l,a),_!==0&&_!==h.retryLane))throw h.retryLane=_,ai(e,_),kn(l,e,_),Uu;rc(),n=pv(e,n,a)}else e=h.treeContext,vt=Fn(_.nextSibling),nn=n,qe=!0,ca=null,qn=!1,e!==null&&Qh(n,e),n=Jl(n,l),n.flags|=4096;return n}return e=Ds(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Wl(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Pu(e,n,a,l,f){return li(n),a=_u(e,n,a,l,void 0,f),l=ku(),e!==null&&!Ht?(Su(e,n,f),Ls(e,n,f)):(qe&&l&&nu(n),n.flags|=1,an(e,n,a,f),n.child)}function mv(e,n,a,l,f,h){return li(n),n.updateQueue=null,a=vg(n,l,a,f),gg(e),l=ku(),e!==null&&!Ht?(Su(e,n,h),Ls(e,n,h)):(qe&&l&&nu(n),n.flags|=1,an(e,n,a,h),n.child)}function hv(e,n,a,l,f){if(li(n),n.stateNode===null){var h=Ji,_=a.contextType;typeof _=="object"&&_!==null&&(h=sn(_)),h=new a(l,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=zu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=l,h.state=n.memoizedState,h.refs={},pu(n),_=a.contextType,h.context=typeof _=="object"&&_!==null?sn(_):Ji,h.state=n.memoizedState,_=a.getDerivedStateFromProps,typeof _=="function"&&(Lu(n,a,_,l),h.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(_=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),_!==h.state&&zu.enqueueReplaceState(h,h.state,null),lr(n,l,h,f),rr(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){h=n.stateNode;var j=n.memoizedProps,R=mi(a,j);h.props=R;var G=h.context,ee=a.contextType;_=Ji,typeof ee=="object"&&ee!==null&&(_=sn(ee));var se=a.getDerivedStateFromProps;ee=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",j=n.pendingProps!==j,ee||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(j||G!==_)&&tv(n,h,l,_),fa=!1;var F=n.memoizedState;h.state=F,lr(n,l,h,f),rr(),G=n.memoizedState,j||F!==G||fa?(typeof se=="function"&&(Lu(n,a,se,l),G=n.memoizedState),(R=fa||ev(n,a,R,l,F,G,_))?(ee||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=G),h.props=l,h.state=G,h.context=_,l=R):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{h=n.stateNode,mu(e,n),_=n.memoizedProps,ee=mi(a,_),h.props=ee,se=n.pendingProps,F=h.context,G=a.contextType,R=Ji,typeof G=="object"&&G!==null&&(R=sn(G)),j=a.getDerivedStateFromProps,(G=typeof j=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(_!==se||F!==R)&&tv(n,h,l,R),fa=!1,F=n.memoizedState,h.state=F,lr(n,l,h,f),rr();var K=n.memoizedState;_!==se||F!==K||fa||e!==null&&e.dependencies!==null&&Rl(e.dependencies)?(typeof j=="function"&&(Lu(n,a,j,l),K=n.memoizedState),(ee=fa||ev(n,a,ee,l,F,K,R)||e!==null&&e.dependencies!==null&&Rl(e.dependencies))?(G||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,K,R),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,K,R)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=K),h.props=l,h.state=K,h.context=R,l=ee):(typeof h.componentDidUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),l=!1)}return h=l,Wl(e,n),l=(n.flags&128)!==0,h||l?(h=n.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&l?(n.child=fi(n,e.child,null,f),n.child=fi(n,null,a,f)):an(e,n,a,f),n.memoizedState=h.state,e=n.child):e=Ls(e,n,f),e}function gv(e,n,a,l){return oi(),n.flags|=256,an(e,n,a,l),n.child}var Hu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vu(e){return{baseLanes:e,cachePool:ig()}}function qu(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=Dn),e}function vv(e,n,a){var l=n.pendingProps,f=!1,h=(n.flags&128)!==0,_;if((_=h)||(_=e!==null&&e.memoizedState===null?!1:(Ot.current&2)!==0),_&&(f=!0,n.flags&=-129),_=(n.flags&32)!==0,n.flags&=-33,e===null){if(qe){if(f?ha(n):ga(),(e=vt)?(e=w0(e,qn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:la!==null?{id:gs,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},a=Jh(e),a.return=n,n.child=a,nn=n,vt=null)):e=null,e===null)throw da(n);return Nf(e)?n.lanes=32:n.lanes=536870912,null}var j=l.children;return l=l.fallback,f?(ga(),f=n.mode,j=Xl({mode:"hidden",children:j},f),l=ii(l,f,a,null),j.return=n,l.return=n,j.sibling=l,n.child=j,l=n.child,l.memoizedState=Vu(a),l.childLanes=qu(e,_,a),n.memoizedState=Hu,pr(null,l)):(ha(n),Gu(n,j))}var R=e.memoizedState;if(R!==null&&(j=R.dehydrated,j!==null)){if(h)n.flags&256?(ha(n),n.flags&=-257,n=Fu(e,n,a)):n.memoizedState!==null?(ga(),n.child=e.child,n.flags|=128,n=null):(ga(),j=l.fallback,f=n.mode,l=Xl({mode:"visible",children:l.children},f),j=ii(j,f,a,null),j.flags|=2,l.return=n,j.return=n,l.sibling=j,n.child=l,fi(n,e.child,null,a),l=n.child,l.memoizedState=Vu(a),l.childLanes=qu(e,_,a),n.memoizedState=Hu,n=pr(null,l));else if(ha(n),Nf(j)){if(_=j.nextSibling&&j.nextSibling.dataset,_)var G=_.dgst;_=G,l=Error(r(419)),l.stack="",l.digest=_,tr({value:l,source:null,stack:null}),n=Fu(e,n,a)}else if(Ht||eo(e,n,a,!1),_=(a&e.childLanes)!==0,Ht||_){if(_=pt,_!==null&&(l=Ie(_,a),l!==0&&l!==R.retryLane))throw R.retryLane=l,ai(e,l),kn(_,e,l),Uu;jf(j)||rc(),n=Fu(e,n,a)}else jf(j)?(n.flags|=192,n.child=e.child,n=null):(e=R.treeContext,vt=Fn(j.nextSibling),nn=n,qe=!0,ca=null,qn=!1,e!==null&&Qh(n,e),n=Gu(n,l.children),n.flags|=4096);return n}return f?(ga(),j=l.fallback,f=n.mode,R=e.child,G=R.sibling,l=Ds(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,G!==null?j=Ds(G,j):(j=ii(j,f,a,null),j.flags|=2),j.return=n,l.return=n,l.sibling=j,n.child=l,pr(null,l),l=n.child,j=e.child.memoizedState,j===null?j=Vu(a):(f=j.cachePool,f!==null?(R=Ut._currentValue,f=f.parent!==R?{parent:R,pool:R}:f):f=ig(),j={baseLanes:j.baseLanes|a,cachePool:f}),l.memoizedState=j,l.childLanes=qu(e,_,a),n.memoizedState=Hu,pr(e.child,l)):(ha(n),a=e.child,e=a.sibling,a=Ds(a,{mode:"visible",children:l.children}),a.return=n,a.sibling=null,e!==null&&(_=n.deletions,_===null?(n.deletions=[e],n.flags|=16):_.push(e)),n.child=a,n.memoizedState=null,a)}function Gu(e,n){return n=Xl({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Xl(e,n){return e=Nn(22,e,null,n),e.lanes=0,e}function Fu(e,n,a){return fi(n,e.child,null,a),e=Gu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function yv(e,n,a){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),ru(e.return,n,a)}function Zu(e,n,a,l,f,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:f,treeForkCount:h}:(_.isBackwards=n,_.rendering=null,_.renderingStartTime=0,_.last=l,_.tail=a,_.tailMode=f,_.treeForkCount=h)}function bv(e,n,a){var l=n.pendingProps,f=l.revealOrder,h=l.tail;l=l.children;var _=Ot.current,j=(_&2)!==0;if(j?(_=_&1|2,n.flags|=128):_&=1,Ce(Ot,_),an(e,n,l,a),l=qe?er:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yv(e,a,n);else if(e.tag===19)yv(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(a=n.child,f=null;a!==null;)e=a.alternate,e!==null&&Ul(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),Zu(n,!1,f,a,h,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Ul(e)===null){n.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}Zu(n,!0,a,null,h,l);break;case"together":Zu(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function Ls(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),ba|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(eo(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,a=Ds(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Ds(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Ku(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Rl(e)))}function aS(e,n,a){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),ua(n,Ut,e.memoizedState.cache),oi();break;case 27:case 5:Tn(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:ua(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,bu(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(ha(n),n.flags|=128,null):(a&n.child.childLanes)!==0?vv(e,n,a):(ha(n),e=Ls(e,n,a),e!==null?e.sibling:null);ha(n);break;case 19:var f=(e.flags&128)!==0;if(l=(a&n.childLanes)!==0,l||(eo(e,n,a,!1),l=(a&n.childLanes)!==0),f){if(l)return bv(e,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ce(Ot,Ot.current),l)break;return null;case 22:return n.lanes=0,uv(e,n,a,n.pendingProps);case 24:ua(n,Ut,e.memoizedState.cache)}return Ls(e,n,a)}function xv(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)Ht=!0;else{if(!Ku(e,a)&&(n.flags&128)===0)return Ht=!1,aS(e,n,a);Ht=(e.flags&131072)!==0}else Ht=!1,qe&&(n.flags&1048576)!==0&&Xh(n,er,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=di(n.elementType),n.type=e,typeof e=="function")Qd(e)?(l=mi(e,l),n.tag=1,n=hv(null,n,e,l,a)):(n.tag=0,n=Pu(null,n,e,l,a));else{if(e!=null){var f=e.$$typeof;if(f===B){n.tag=11,n=lv(null,n,e,l,a);break e}else if(f===P){n.tag=14,n=cv(null,n,e,l,a);break e}}throw n=H(e)||e,Error(r(306,n,""))}}return n;case 0:return Pu(e,n,n.type,n.pendingProps,a);case 1:return l=n.type,f=mi(l,n.pendingProps),hv(e,n,l,f,a);case 3:e:{if(Le(n,n.stateNode.containerInfo),e===null)throw Error(r(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,mu(e,n),lr(n,l,null,a);var _=n.memoizedState;if(l=_.cache,ua(n,Ut,l),l!==h.cache&&lu(n,[Ut],a,!0),rr(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=gv(e,n,l,a);break e}else if(l!==f){f=Pn(Error(r(424)),n),tr(f),n=gv(e,n,l,a);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(vt=Fn(e.firstChild),nn=n,qe=!0,ca=null,qn=!0,a=ug(n,null,l,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(oi(),l===f){n=Ls(e,n,a);break e}an(e,n,l,a)}n=n.child}return n;case 26:return Wl(e,n),e===null?(a=D0(n.type,null,n.pendingProps,null))?n.memoizedState=a:qe||(a=n.type,e=n.pendingProps,l=mc(_e.current).createElement(a),l[Ue]=n,l[It]=e,on(l,a,e),Qt(l),n.stateNode=l):n.memoizedState=D0(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Tn(n),e===null&&qe&&(l=n.stateNode=C0(n.type,n.pendingProps,_e.current),nn=n,qn=!0,f=vt,Ta(n.type)?(Cf=f,vt=Fn(l.firstChild)):vt=f),an(e,n,n.pendingProps.children,a),Wl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&qe&&((f=l=vt)&&(l=IS(l,n.type,n.pendingProps,qn),l!==null?(n.stateNode=l,nn=n,vt=Fn(l.firstChild),qn=!1,f=!0):f=!1),f||da(n)),Tn(n),f=n.type,h=n.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Sf(f,h)?l=null:_!==null&&Sf(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=_u(e,n,Yk,null,null,a),Cr._currentValue=f),Wl(e,n),an(e,n,l,a),n.child;case 6:return e===null&&qe&&((e=a=vt)&&(a=OS(a,n.pendingProps,qn),a!==null?(n.stateNode=a,nn=n,vt=null,e=!0):e=!1),e||da(n)),null;case 13:return vv(e,n,a);case 4:return Le(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=fi(n,null,l,a):an(e,n,l,a),n.child;case 11:return lv(e,n,n.type,n.pendingProps,a);case 7:return an(e,n,n.pendingProps,a),n.child;case 8:return an(e,n,n.pendingProps.children,a),n.child;case 12:return an(e,n,n.pendingProps.children,a),n.child;case 10:return l=n.pendingProps,ua(n,n.type,l.value),an(e,n,l.children,a),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,li(n),f=sn(f),l=l(f),n.flags|=1,an(e,n,l,a),n.child;case 14:return cv(e,n,n.type,n.pendingProps,a);case 15:return dv(e,n,n.type,n.pendingProps,a);case 19:return bv(e,n,a);case 31:return sS(e,n,a);case 22:return uv(e,n,a,n.pendingProps);case 24:return li(n),l=sn(Ut),e===null?(f=uu(),f===null&&(f=pt,h=cu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:l,cache:f},pu(n),ua(n,Ut,f)):((e.lanes&a)!==0&&(mu(e,n),lr(n,null,null,a),rr()),f=e.memoizedState,h=n.memoizedState,f.parent!==l?(f={parent:l,cache:l},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),ua(n,Ut,l)):(l=h.cache,ua(n,Ut,l),l!==f.cache&&lu(n,[Ut],a,!0))),an(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function zs(e){e.flags|=4}function Yu(e,n,a,l,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Zv())e.flags|=8192;else throw ui=Bl,fu}else e.flags&=-16777217}function _v(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!B0(n))if(Zv())e.flags|=8192;else throw ui=Bl,fu}function Ql(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?ae():536870912,e.lanes|=n,po|=n)}function mr(e,n){if(!qe)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function yt(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(n)for(var f=e.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=a,n}function iS(e,n,a){var l=n.pendingProps;switch(su(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(n),null;case 1:return yt(n),null;case 3:return a=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Is(Ut),Mt(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Qi(n)?zs(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,iu())),yt(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?(zs(n),h!==null?(yt(n),_v(n,h)):(yt(n),Yu(n,f,null,l,a))):h?h!==e.memoizedState?(zs(n),yt(n),_v(n,h)):(yt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&zs(n),yt(n),Yu(n,f,e,l,a)),null;case 27:if(oe(n),a=_e.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&zs(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return yt(n),null}e=Ze.current,Qi(n)?eg(n):(e=C0(f,l,a),n.stateNode=e,zs(n))}return yt(n),null;case 5:if(oe(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&zs(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return yt(n),null}if(h=Ze.current,Qi(n))eg(n);else{var _=mc(_e.current);switch(h){case 1:h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=_.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=_.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=_.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?_.createElement("select",{is:l.is}):_.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?_.createElement(f,{is:l.is}):_.createElement(f)}}h[Ue]=n,h[It]=l;e:for(_=n.child;_!==null;){if(_.tag===5||_.tag===6)h.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===n)break e;for(;_.sibling===null;){if(_.return===null||_.return===n)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}n.stateNode=h;e:switch(on(h,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&zs(n)}}return yt(n),Yu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&zs(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(r(166));if(e=_e.current,Qi(n)){if(e=n.stateNode,a=n.memoizedProps,l=null,f=nn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[Ue]=n,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||v0(e.nodeValue,a)),e||da(n,!0)}else e=mc(e).createTextNode(l),e[Ue]=n,n.stateNode=e}return yt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(l=Qi(n),a!==null){if(e===null){if(!l)throw Error(r(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Ue]=n}else oi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;yt(n),e=!1}else a=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(En(n),n):(En(n),null);if((n.flags&128)!==0)throw Error(r(558))}return yt(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Qi(n),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Ue]=n}else oi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;yt(n),f=!1}else f=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(En(n),n):(En(n),null)}return En(n),(n.flags&128)!==0?(n.lanes=a,n):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==f&&(l.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),Ql(n,n.updateQueue),yt(n),null);case 4:return Mt(),e===null&&yf(n.stateNode.containerInfo),yt(n),null;case 10:return Is(n.type),yt(n),null;case 19:if(fe(Ot),l=n.memoizedState,l===null)return yt(n),null;if(f=(n.flags&128)!==0,h=l.rendering,h===null)if(f)mr(l,!1);else{if(Et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Ul(e),h!==null){for(n.flags|=128,mr(l,!1),e=h.updateQueue,n.updateQueue=e,Ql(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Yh(a,e),a=a.sibling;return Ce(Ot,Ot.current&1|2),qe&&Rs(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&Yt()>ac&&(n.flags|=128,f=!0,mr(l,!1),n.lanes=4194304)}else{if(!f)if(e=Ul(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Ql(n,e),mr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!qe)return yt(n),null}else 2*Yt()-l.renderingStartTime>ac&&a!==536870912&&(n.flags|=128,f=!0,mr(l,!1),n.lanes=4194304);l.isBackwards?(h.sibling=n.child,n.child=h):(e=l.last,e!==null?e.sibling=h:n.child=h,l.last=h)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Yt(),e.sibling=null,a=Ot.current,Ce(Ot,f?a&1|2:a&1),qe&&Rs(n,l.treeForkCount),e):(yt(n),null);case 22:case 23:return En(n),yu(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(a&536870912)!==0&&(n.flags&128)===0&&(yt(n),n.subtreeFlags&6&&(n.flags|=8192)):yt(n),a=n.updateQueue,a!==null&&Ql(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==a&&(n.flags|=2048),e!==null&&fe(ci),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Is(Ut),yt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function oS(e,n){switch(su(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Is(Ut),Mt(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return oe(n),null;case 31:if(n.memoizedState!==null){if(En(n),n.alternate===null)throw Error(r(340));oi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(En(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));oi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return fe(Ot),null;case 4:return Mt(),null;case 10:return Is(n.type),null;case 22:case 23:return En(n),yu(),e!==null&&fe(ci),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Is(Ut),null;case 25:return null;default:return null}}function kv(e,n){switch(su(n),n.tag){case 3:Is(Ut),Mt();break;case 26:case 27:case 5:oe(n);break;case 4:Mt();break;case 31:n.memoizedState!==null&&En(n);break;case 13:En(n);break;case 19:fe(Ot);break;case 10:Is(n.type);break;case 22:case 23:En(n),yu(),e!==null&&fe(ci);break;case 24:Is(Ut)}}function hr(e,n){try{var a=n.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var f=l.next;a=f;do{if((a.tag&e)===e){l=void 0;var h=a.create,_=a.inst;l=h(),_.destroy=l}a=a.next}while(a!==f)}}catch(j){rt(n,n.return,j)}}function va(e,n,a){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var h=f.next;l=h;do{if((l.tag&e)===e){var _=l.inst,j=_.destroy;if(j!==void 0){_.destroy=void 0,f=n;var R=a,G=j;try{G()}catch(ee){rt(f,R,ee)}}}l=l.next}while(l!==h)}}catch(ee){rt(n,n.return,ee)}}function Sv(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{pg(n,a)}catch(l){rt(e,e.return,l)}}}function Tv(e,n,a){a.props=mi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){rt(e,n,l)}}function gr(e,n){try{var a=e.ref;if(a!==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 a=="function"?e.refCleanup=a(l):a.current=l}}catch(f){rt(e,n,f)}}function ys(e,n){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(f){rt(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){rt(e,n,f)}else a.current=null}function wv(e){var n=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(f){rt(e,e.return,f)}}function Ju(e,n,a){try{var l=e.stateNode;CS(l,e.type,a,n),l[It]=n}catch(f){rt(e,e.return,f)}}function jv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jv(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&&Ta(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 Xu(e,n,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Es));else if(l!==4&&(l===27&&Ta(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Xu(e,n,a),e=e.sibling;e!==null;)Xu(e,n,a),e=e.sibling}function ec(e,n,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(l!==4&&(l===27&&Ta(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ec(e,n,a),e=e.sibling;e!==null;)ec(e,n,a),e=e.sibling}function Nv(e){var n=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);on(n,l,a),n[Ue]=e,n[It]=a}catch(h){rt(e,e.return,h)}}var $s=!1,Vt=!1,Qu=!1,Cv=typeof WeakSet=="function"?WeakSet:Set,en=null;function rS(e,n){if(e=e.containerInfo,_f=_c,e=Uh(e),Fd(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var f=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var _=0,j=-1,R=-1,G=0,ee=0,se=e,F=null;t:for(;;){for(var K;se!==a||f!==0&&se.nodeType!==3||(j=_+f),se!==h||l!==0&&se.nodeType!==3||(R=_+l),se.nodeType===3&&(_+=se.nodeValue.length),(K=se.firstChild)!==null;)F=se,se=K;for(;;){if(se===e)break t;if(F===a&&++G===f&&(j=_),F===h&&++ee===l&&(R=_),(K=se.nextSibling)!==null)break;se=F,F=se.parentNode}se=K}a=j===-1||R===-1?null:{start:j,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(kf={focusedElem:e,selectionRange:a},_c=!1,en=n;en!==null;)if(n=en,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,en=e;else for(;en!==null;){switch(n=en,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)f=e[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,a=n,f=h.memoizedProps,h=h.memoizedState,l=a.stateNode;try{var xe=mi(a.type,f);e=l.getSnapshotBeforeUpdate(xe,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){rt(a,a.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)wf(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wf(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(r(163))}if(e=n.sibling,e!==null){e.return=n.return,en=e;break}en=n.return}}function Ev(e,n,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ps(e,a),l&4&&hr(5,a);break;case 1:if(Ps(e,a),l&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(_){rt(a,a.return,_)}else{var f=mi(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(_){rt(a,a.return,_)}}l&64&&Sv(a),l&512&&gr(a,a.return);break;case 3:if(Ps(e,a),l&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{pg(e,n)}catch(_){rt(a,a.return,_)}}break;case 27:n===null&&l&4&&Nv(a);case 26:case 5:Ps(e,a),n===null&&l&4&&wv(a),l&512&&gr(a,a.return);break;case 12:Ps(e,a);break;case 31:Ps(e,a),l&4&&Rv(e,a);break;case 13:Ps(e,a),l&4&&Mv(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=gS.bind(null,a),BS(e,a))));break;case 22:if(l=a.memoizedState!==null||$s,!l){n=n!==null&&n.memoizedState!==null||Vt,f=$s;var h=Vt;$s=l,(Vt=n)&&!h?Hs(e,a,(a.subtreeFlags&8772)!==0):Ps(e,a),$s=f,Vt=h}break;case 30:break;default:Ps(e,a)}}function Av(e){var n=e.alternate;n!==null&&(e.alternate=null,Av(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ed(n)),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 Tt=null,yn=!1;function Us(e,n,a){for(a=a.child;a!==null;)Dv(e,n,a),a=a.sibling}function Dv(e,n,a){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Jt,a)}catch{}switch(a.tag){case 26:Vt||ys(a,n),Us(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Vt||ys(a,n);var l=Tt,f=yn;Ta(a.type)&&(Tt=a.stateNode,yn=!1),Us(e,n,a),wr(a.stateNode),Tt=l,yn=f;break;case 5:Vt||ys(a,n);case 6:if(l=Tt,f=yn,Tt=null,Us(e,n,a),Tt=l,yn=f,Tt!==null)if(yn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(a.stateNode)}catch(h){rt(a,n,h)}else try{Tt.removeChild(a.stateNode)}catch(h){rt(a,n,h)}break;case 18:Tt!==null&&(yn?(e=Tt,S0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),_o(e)):S0(Tt,a.stateNode));break;case 4:l=Tt,f=yn,Tt=a.stateNode.containerInfo,yn=!0,Us(e,n,a),Tt=l,yn=f;break;case 0:case 11:case 14:case 15:va(2,a,n),Vt||va(4,a,n),Us(e,n,a);break;case 1:Vt||(ys(a,n),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Tv(a,n,l)),Us(e,n,a);break;case 21:Us(e,n,a);break;case 22:Vt=(l=Vt)||a.memoizedState!==null,Us(e,n,a),Vt=l;break;default:Us(e,n,a)}}function Rv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{_o(e)}catch(a){rt(n,n.return,a)}}}function Mv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{_o(e)}catch(a){rt(n,n.return,a)}}function lS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Cv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Cv),n;default:throw Error(r(435,e.tag))}}function tc(e,n){var a=lS(e);n.forEach(function(l){if(!a.has(l)){a.add(l);var f=vS.bind(null,e,l);l.then(f,f)}})}function bn(e,n){var a=n.deletions;if(a!==null)for(var l=0;l<a.length;l++){var f=a[l],h=e,_=n,j=_;e:for(;j!==null;){switch(j.tag){case 27:if(Ta(j.type)){Tt=j.stateNode,yn=!1;break e}break;case 5:Tt=j.stateNode,yn=!1;break e;case 3:case 4:Tt=j.stateNode.containerInfo,yn=!0;break e}j=j.return}if(Tt===null)throw Error(r(160));Dv(h,_,f),Tt=null,yn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Iv(n,e),n=n.sibling}var ns=null;function Iv(e,n){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bn(n,e),xn(e),l&4&&(va(3,e,e.return),hr(3,e),va(5,e,e.return));break;case 1:bn(n,e),xn(e),l&512&&(Vt||a===null||ys(a,a.return)),l&64&&$s&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var f=ns;if(bn(n,e),xn(e),l&512&&(Vt||a===null||ys(a,a.return)),l&4){var h=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Vo]||h[Ue]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(l),f.head.insertBefore(h,f.querySelector("head > title"))),on(h,l,a),h[Ue]=e,Qt(h),l=h;break e;case"link":var _=I0("link","href",f).get(l+(a.href||""));if(_){for(var j=0;j<_.length;j++)if(h=_[j],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){_.splice(j,1);break t}}h=f.createElement(l),on(h,l,a),f.head.appendChild(h);break;case"meta":if(_=I0("meta","content",f).get(l+(a.content||""))){for(j=0;j<_.length;j++)if(h=_[j],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){_.splice(j,1);break t}}h=f.createElement(l),on(h,l,a),f.head.appendChild(h);break;default:throw Error(r(468,l))}h[Ue]=e,Qt(h),l=h}e.stateNode=l}else O0(f,e.type,e.stateNode);else e.stateNode=M0(f,l,e.memoizedProps);else h!==l?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,l===null?O0(f,e.type,e.stateNode):M0(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Ju(e,e.memoizedProps,a.memoizedProps)}break;case 27:bn(n,e),xn(e),l&512&&(Vt||a===null||ys(a,a.return)),a!==null&&l&4&&Ju(e,e.memoizedProps,a.memoizedProps);break;case 5:if(bn(n,e),xn(e),l&512&&(Vt||a===null||ys(a,a.return)),e.flags&32){f=e.stateNode;try{Vi(f,"")}catch(xe){rt(e,e.return,xe)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,Ju(e,f,a!==null?a.memoizedProps:f)),l&1024&&(Qu=!0);break;case 6:if(bn(n,e),xn(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(xe){rt(e,e.return,xe)}}break;case 3:if(vc=null,f=ns,ns=hc(n.containerInfo),bn(n,e),ns=f,xn(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{_o(n.containerInfo)}catch(xe){rt(e,e.return,xe)}Qu&&(Qu=!1,Ov(e));break;case 4:l=ns,ns=hc(e.stateNode.containerInfo),bn(n,e),xn(e),ns=l;break;case 12:bn(n,e),xn(e);break;case 31:bn(n,e),xn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tc(e,l)));break;case 13:bn(n,e),xn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(sc=Yt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tc(e,l)));break;case 22:f=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,G=$s,ee=Vt;if($s=G||f,Vt=ee||R,bn(n,e),Vt=ee,$s=G,xn(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||R||$s||Vt||hi(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){R=a=n;try{if(h=R.stateNode,f)_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{j=R.stateNode;var se=R.memoizedProps.style,F=se!=null&&se.hasOwnProperty("display")?se.display:null;j.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(xe){rt(R,R.return,xe)}}}else if(n.tag===6){if(a===null){R=n;try{R.stateNode.nodeValue=f?"":R.memoizedProps}catch(xe){rt(R,R.return,xe)}}}else if(n.tag===18){if(a===null){R=n;try{var K=R.stateNode;f?T0(K,!0):T0(R.stateNode,!1)}catch(xe){rt(R,R.return,xe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,tc(e,a))));break;case 19:bn(n,e),xn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,tc(e,l)));break;case 30:break;case 21:break;default:bn(n,e),xn(e)}}function xn(e){var n=e.flags;if(n&2){try{for(var a,l=e.return;l!==null;){if(jv(l)){a=l;break}l=l.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=Wu(e);ec(e,h,f);break;case 5:var _=a.stateNode;a.flags&32&&(Vi(_,""),a.flags&=-33);var j=Wu(e);ec(e,j,_);break;case 3:case 4:var R=a.stateNode.containerInfo,G=Wu(e);Xu(e,G,R);break;default:throw Error(r(161))}}catch(ee){rt(e,e.return,ee)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Ov(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Ov(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Ps(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Ev(e,n.alternate,n),n=n.sibling}function hi(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:va(4,n,n.return),hi(n);break;case 1:ys(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Tv(n,n.return,a),hi(n);break;case 27:wr(n.stateNode);case 26:case 5:ys(n,n.return),hi(n);break;case 22:n.memoizedState===null&&hi(n);break;case 30:hi(n);break;default:hi(n)}e=e.sibling}}function Hs(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,f=e,h=n,_=h.flags;switch(h.tag){case 0:case 11:case 15:Hs(f,h,a),hr(4,h);break;case 1:if(Hs(f,h,a),l=h,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(G){rt(l,l.return,G)}if(l=h,f=l.updateQueue,f!==null){var j=l.stateNode;try{var R=f.shared.hiddenCallbacks;if(R!==null)for(f.shared.hiddenCallbacks=null,f=0;f<R.length;f++)fg(R[f],j)}catch(G){rt(l,l.return,G)}}a&&_&64&&Sv(h),gr(h,h.return);break;case 27:Nv(h);case 26:case 5:Hs(f,h,a),a&&l===null&&_&4&&wv(h),gr(h,h.return);break;case 12:Hs(f,h,a);break;case 31:Hs(f,h,a),a&&_&4&&Rv(f,h);break;case 13:Hs(f,h,a),a&&_&4&&Mv(f,h);break;case 22:h.memoizedState===null&&Hs(f,h,a),gr(h,h.return);break;case 30:break;default:Hs(f,h,a)}n=n.sibling}}function ef(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&nr(a))}function tf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&nr(e))}function ss(e,n,a,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Bv(e,n,a,l),n=n.sibling}function Bv(e,n,a,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ss(e,n,a,l),f&2048&&hr(9,n);break;case 1:ss(e,n,a,l);break;case 3:ss(e,n,a,l),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&nr(e)));break;case 12:if(f&2048){ss(e,n,a,l),e=n.stateNode;try{var h=n.memoizedProps,_=h.id,j=h.onPostCommit;typeof j=="function"&&j(_,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){rt(n,n.return,R)}}else ss(e,n,a,l);break;case 31:ss(e,n,a,l);break;case 13:ss(e,n,a,l);break;case 23:break;case 22:h=n.stateNode,_=n.alternate,n.memoizedState!==null?h._visibility&2?ss(e,n,a,l):vr(e,n):h._visibility&2?ss(e,n,a,l):(h._visibility|=2,co(e,n,a,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&ef(_,n);break;case 24:ss(e,n,a,l),f&2048&&tf(n.alternate,n);break;default:ss(e,n,a,l)}}function co(e,n,a,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,_=n,j=a,R=l,G=_.flags;switch(_.tag){case 0:case 11:case 15:co(h,_,j,R,f),hr(8,_);break;case 23:break;case 22:var ee=_.stateNode;_.memoizedState!==null?ee._visibility&2?co(h,_,j,R,f):vr(h,_):(ee._visibility|=2,co(h,_,j,R,f)),f&&G&2048&&ef(_.alternate,_);break;case 24:co(h,_,j,R,f),f&&G&2048&&tf(_.alternate,_);break;default:co(h,_,j,R,f)}n=n.sibling}}function vr(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,l=n,f=l.flags;switch(l.tag){case 22:vr(a,l),f&2048&&ef(l.alternate,l);break;case 24:vr(a,l),f&2048&&tf(l.alternate,l);break;default:vr(a,l)}n=n.sibling}}var yr=8192;function uo(e,n,a){if(e.subtreeFlags&yr)for(e=e.child;e!==null;)Lv(e,n,a),e=e.sibling}function Lv(e,n,a){switch(e.tag){case 26:uo(e,n,a),e.flags&yr&&e.memoizedState!==null&&KS(a,ns,e.memoizedState,e.memoizedProps);break;case 5:uo(e,n,a);break;case 3:case 4:var l=ns;ns=hc(e.stateNode.containerInfo),uo(e,n,a),ns=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=yr,yr=16777216,uo(e,n,a),yr=l):uo(e,n,a));break;default:uo(e,n,a)}}function zv(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function br(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];en=l,Uv(l,e)}zv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$v(e),e=e.sibling}function $v(e){switch(e.tag){case 0:case 11:case 15:br(e),e.flags&2048&&va(9,e,e.return);break;case 3:br(e);break;case 12:br(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,nc(e)):br(e);break;default:br(e)}}function nc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];en=l,Uv(l,e)}zv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:va(8,n,n.return),nc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,nc(n));break;default:nc(n)}e=e.sibling}}function Uv(e,n){for(;en!==null;){var a=en;switch(a.tag){case 0:case 11:case 15:va(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:nr(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,en=l;else e:for(a=e;en!==null;){l=en;var f=l.sibling,h=l.return;if(Av(l),l===a){en=null;break e}if(f!==null){f.return=h,en=f;break e}en=h}}}var cS={getCacheForType:function(e){var n=sn(Ut),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return sn(Ut).controller.signal}},dS=typeof WeakMap=="function"?WeakMap:Map,st=0,pt=null,ze=null,Pe=0,ot=0,An=null,ya=!1,fo=!1,nf=!1,Vs=0,Et=0,ba=0,gi=0,sf=0,Dn=0,po=0,xr=null,_n=null,af=!1,sc=0,Pv=0,ac=1/0,ic=null,xa=null,Gt=0,_a=null,mo=null,qs=0,of=0,rf=null,Hv=null,_r=0,lf=null;function Rn(){return(st&2)!==0&&Pe!==0?Pe&-Pe:L.T!==null?mf():Xe()}function Vv(){if(Dn===0)if((Pe&536870912)===0||qe){var e=Ya;Ya<<=1,(Ya&3932160)===0&&(Ya=262144),Dn=e}else Dn=536870912;return e=Cn.current,e!==null&&(e.flags|=32),Dn}function kn(e,n,a){(e===pt&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&(ho(e,0),ka(e,Pe,Dn,!1)),de(e,a),((st&2)===0||e!==pt)&&(e===pt&&((st&2)===0&&(gi|=a),Et===4&&ka(e,Pe,Dn,!1)),bs(e))}function qv(e,n,a){if((st&6)!==0)throw Error(r(327));var l=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Xa(e,n),f=l?pS(e,n):df(e,n,!0),h=l;do{if(f===0){fo&&!l&&ka(e,n,0,!1);break}else{if(a=e.current.alternate,h&&!uS(a)){f=df(e,n,!1),h=!1;continue}if(f===2){if(h=n,e.errorRecoveryDisabledLanes&h)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){n=_;e:{var j=e;f=xr;var R=j.current.memoizedState.isDehydrated;if(R&&(ho(j,_).flags|=256),_=df(j,_,!1),_!==2){if(nf&&!R){j.errorRecoveryDisabledLanes|=h,gi|=h,f=4;break e}h=_n,_n=f,h!==null&&(_n===null?_n=h:_n.push.apply(_n,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){ho(e,0),ka(e,n,0,!0);break}e:{switch(l=e,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:ka(l,n,Dn,!ya);break e;case 2:_n=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=sc+300-Yt(),10<f)){if(ka(l,n,Dn,!ya),Wa(l,0,!0)!==0)break e;qs=n,l.timeoutHandle=_0(Gv.bind(null,l,a,_n,ic,af,n,Dn,gi,po,ya,h,"Throttled",-0,0),f);break e}Gv(l,a,_n,ic,af,n,Dn,gi,po,ya,h,null,-0,0)}}break}while(!0);bs(e)}function Gv(e,n,a,l,f,h,_,j,R,G,ee,se,F,K){if(e.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Es},Lv(n,h,se);var xe=(h&62914560)===h?sc-Yt():(h&4194048)===h?Pv-Yt():0;if(xe=YS(se,xe),xe!==null){qs=h,e.cancelPendingCommit=xe(Qv.bind(null,e,n,h,a,l,f,_,j,R,ee,se,null,F,K)),ka(e,h,_,!G);return}}Qv(e,n,h,a,l,f,_,j,R)}function uS(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var f=a[l],h=f.getSnapshot;f=f.value;try{if(!jn(h(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ka(e,n,a,l){n&=~sf,n&=~gi,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var h=31-Wt(f),_=1<<h;l[h]=-1,f&=~_}a!==0&&We(e,a,n)}function oc(){return(st&6)===0?(kr(0),!1):!0}function cf(){if(ze!==null){if(ot===0)var e=ze.return;else e=ze,Ms=ri=null,Tu(e),ao=null,ar=0,e=ze;for(;e!==null;)kv(e.alternate,e),e=e.return;ze=null}}function ho(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,DS(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),qs=0,cf(),pt=e,ze=a=Ds(e.current,null),Pe=n,ot=0,An=null,ya=!1,fo=Xa(e,n),nf=!1,po=Dn=sf=gi=ba=Et=0,_n=xr=null,af=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var f=31-Wt(l),h=1<<f;n|=e[f],l&=~h}return Vs=n,Nl(),a}function Fv(e,n){Oe=null,L.H=fr,n===so||n===Ol?(n=lg(),ot=3):n===fu?(n=lg(),ot=4):ot=n===Uu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,An=n,ze===null&&(Et=1,Yl(e,Pn(n,e.current)))}function Zv(){var e=Cn.current;return e===null?!0:(Pe&4194048)===Pe?Gn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===Gn:!1}function Kv(){var e=L.H;return L.H=fr,e===null?fr:e}function Yv(){var e=L.A;return L.A=cS,e}function rc(){Et=4,ya||(Pe&4194048)!==Pe&&Cn.current!==null||(fo=!0),(ba&134217727)===0&&(gi&134217727)===0||pt===null||ka(pt,Pe,Dn,!1)}function df(e,n,a){var l=st;st|=2;var f=Kv(),h=Yv();(pt!==e||Pe!==n)&&(ic=null,ho(e,n)),n=!1;var _=Et;e:do try{if(ot!==0&&ze!==null){var j=ze,R=An;switch(ot){case 8:cf(),_=6;break e;case 3:case 2:case 9:case 6:Cn.current===null&&(n=!0);var G=ot;if(ot=0,An=null,go(e,j,R,G),a&&fo){_=0;break e}break;default:G=ot,ot=0,An=null,go(e,j,R,G)}}fS(),_=Et;break}catch(ee){Fv(e,ee)}while(!0);return n&&e.shellSuspendCounter++,Ms=ri=null,st=l,L.H=f,L.A=h,ze===null&&(pt=null,Pe=0,Nl()),_}function fS(){for(;ze!==null;)Jv(ze)}function pS(e,n){var a=st;st|=2;var l=Kv(),f=Yv();pt!==e||Pe!==n?(ic=null,ac=Yt()+500,ho(e,n)):fo=Xa(e,n);e:do try{if(ot!==0&&ze!==null){n=ze;var h=An;t:switch(ot){case 1:ot=0,An=null,go(e,n,h,1);break;case 2:case 9:if(og(h)){ot=0,An=null,Wv(n);break}n=function(){ot!==2&&ot!==9||pt!==e||(ot=7),bs(e)},h.then(n,n);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:og(h)?(ot=0,An=null,Wv(n)):(ot=0,An=null,go(e,n,h,7));break;case 5:var _=null;switch(ze.tag){case 26:_=ze.memoizedState;case 5:case 27:var j=ze;if(_?B0(_):j.stateNode.complete){ot=0,An=null;var R=j.sibling;if(R!==null)ze=R;else{var G=j.return;G!==null?(ze=G,lc(G)):ze=null}break t}}ot=0,An=null,go(e,n,h,5);break;case 6:ot=0,An=null,go(e,n,h,6);break;case 8:cf(),Et=6;break e;default:throw Error(r(462))}}mS();break}catch(ee){Fv(e,ee)}while(!0);return Ms=ri=null,L.H=l,L.A=f,st=a,ze!==null?0:(pt=null,Pe=0,Nl(),Et)}function mS(){for(;ze!==null&&!Fa();)Jv(ze)}function Jv(e){var n=xv(e.alternate,e,Vs);e.memoizedProps=e.pendingProps,n===null?lc(e):ze=n}function Wv(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=mv(a,n,n.pendingProps,n.type,void 0,Pe);break;case 11:n=mv(a,n,n.pendingProps,n.type.render,n.ref,Pe);break;case 5:Tu(n);default:kv(a,n),n=ze=Yh(n,Vs),n=xv(a,n,Vs)}e.memoizedProps=e.pendingProps,n===null?lc(e):ze=n}function go(e,n,a,l){Ms=ri=null,Tu(n),ao=null,ar=0;var f=n.return;try{if(nS(e,f,n,a,Pe)){Et=1,Yl(e,Pn(a,e.current)),ze=null;return}}catch(h){if(f!==null)throw ze=f,h;Et=1,Yl(e,Pn(a,e.current)),ze=null;return}n.flags&32768?(qe||l===1?e=!0:fo||(Pe&536870912)!==0?e=!1:(ya=e=!0,(l===2||l===9||l===3||l===6)&&(l=Cn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Xv(n,e)):lc(n)}function lc(e){var n=e;do{if((n.flags&32768)!==0){Xv(n,ya);return}e=n.return;var a=iS(n.alternate,n,Vs);if(a!==null){ze=a;return}if(n=n.sibling,n!==null){ze=n;return}ze=n=e}while(n!==null);Et===0&&(Et=5)}function Xv(e,n){do{var a=oS(e.alternate,e);if(a!==null){a.flags&=32767,ze=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){ze=e;return}ze=e=a}while(e!==null);Et=6,ze=null}function Qv(e,n,a,l,f,h,_,j,R){e.cancelPendingCommit=null;do cc();while(Gt!==0);if((st&6)!==0)throw Error(r(327));if(n!==null){if(n===e.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Wd,ye(e,a,h,_,j,R),e===pt&&(ze=pt=null,Pe=0),mo=n,_a=e,qs=a,of=h,rf=f,Hv=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,yS(ms,function(){return a0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=L.T,L.T=null,f=Z.p,Z.p=2,_=st,st|=4;try{rS(e,n,a)}finally{st=_,Z.p=f,L.T=l}}Gt=1,e0(),t0(),n0()}}function e0(){if(Gt===1){Gt=0;var e=_a,n=mo,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=L.T,L.T=null;var l=Z.p;Z.p=2;var f=st;st|=4;try{Iv(n,e);var h=kf,_=Uh(e.containerInfo),j=h.focusedElem,R=h.selectionRange;if(_!==j&&j&&j.ownerDocument&&$h(j.ownerDocument.documentElement,j)){if(R!==null&&Fd(j)){var G=R.start,ee=R.end;if(ee===void 0&&(ee=G),"selectionStart"in j)j.selectionStart=G,j.selectionEnd=Math.min(ee,j.value.length);else{var se=j.ownerDocument||document,F=se&&se.defaultView||window;if(F.getSelection){var K=F.getSelection(),xe=j.textContent.length,Ee=Math.min(R.start,xe),ft=R.end===void 0?Ee:Math.min(R.end,xe);!K.extend&&Ee>ft&&(_=ft,ft=Ee,Ee=_);var z=zh(j,Ee),O=zh(j,ft);if(z&&O&&(K.rangeCount!==1||K.anchorNode!==z.node||K.anchorOffset!==z.offset||K.focusNode!==O.node||K.focusOffset!==O.offset)){var q=se.createRange();q.setStart(z.node,z.offset),K.removeAllRanges(),Ee>ft?(K.addRange(q),K.extend(O.node,O.offset)):(q.setEnd(O.node,O.offset),K.addRange(q))}}}}for(se=[],K=j;K=K.parentNode;)K.nodeType===1&&se.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<se.length;j++){var ne=se[j];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}_c=!!_f,kf=_f=null}finally{st=f,Z.p=l,L.T=a}}e.current=n,Gt=2}}function t0(){if(Gt===2){Gt=0;var e=_a,n=mo,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=L.T,L.T=null;var l=Z.p;Z.p=2;var f=st;st|=4;try{Ev(e,n.alternate,n)}finally{st=f,Z.p=l,L.T=a}}Gt=3}}function n0(){if(Gt===4||Gt===3){Gt=0,ia();var e=_a,n=mo,a=qs,l=Hv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Gt=5:(Gt=0,mo=_a=null,s0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(xa=null),ct(a),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Jt,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=L.T,f=Z.p,Z.p=2,L.T=null;try{for(var h=e.onRecoverableError,_=0;_<l.length;_++){var j=l[_];h(j.value,{componentStack:j.stack})}}finally{L.T=n,Z.p=f}}(qs&3)!==0&&cc(),bs(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===lf?_r++:(_r=0,lf=e):_r=0,kr(0)}}function s0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,nr(n)))}function cc(){return e0(),t0(),n0(),a0()}function a0(){if(Gt!==5)return!1;var e=_a,n=of;of=0;var a=ct(qs),l=L.T,f=Z.p;try{Z.p=32>a?32:a,L.T=null,a=rf,rf=null;var h=_a,_=qs;if(Gt=0,mo=_a=null,qs=0,(st&6)!==0)throw Error(r(331));var j=st;if(st|=4,$v(h.current),Bv(h,h.current,_,a),st=j,kr(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Jt,h)}catch{}return!0}finally{Z.p=f,L.T=l,s0(e,n)}}function i0(e,n,a){n=Pn(a,n),n=$u(e.stateNode,n,2),e=ma(e,n,2),e!==null&&(de(e,2),bs(e))}function rt(e,n,a){if(e.tag===3)i0(e,e,a);else for(;n!==null;){if(n.tag===3){i0(n,e,a);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(xa===null||!xa.has(l))){e=Pn(a,e),a=ov(2),l=ma(n,a,2),l!==null&&(rv(a,l,n,e),de(l,2),bs(l));break}}n=n.return}}function uf(e,n,a){var l=e.pingCache;if(l===null){l=e.pingCache=new dS;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(a)||(nf=!0,f.add(a),e=hS.bind(null,e,n,a),n.then(e,e))}function hS(e,n,a){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,pt===e&&(Pe&a)===a&&(Et===4||Et===3&&(Pe&62914560)===Pe&&300>Yt()-sc?(st&2)===0&&ho(e,0):sf|=a,po===Pe&&(po=0)),bs(e)}function o0(e,n){n===0&&(n=ae()),e=ai(e,n),e!==null&&(de(e,n),bs(e))}function gS(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),o0(e,a)}function vS(e,n){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(a=f.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(n),o0(e,a)}function yS(e,n){return aa(e,n)}var dc=null,vo=null,ff=!1,uc=!1,pf=!1,Sa=0;function bs(e){e!==vo&&e.next===null&&(vo===null?dc=vo=e:vo=vo.next=e),uc=!0,ff||(ff=!0,xS())}function kr(e,n){if(!pf&&uc){pf=!0;do for(var a=!1,l=dc;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var h=0;else{var _=l.suspendedLanes,j=l.pingedLanes;h=(1<<31-Wt(42|e)+1)-1,h&=f&~(_&~j),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,d0(l,h))}else h=Pe,h=Wa(l,l===pt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Xa(l,h)||(a=!0,d0(l,h));l=l.next}while(a);pf=!1}}function bS(){r0()}function r0(){uc=ff=!1;var e=0;Sa!==0&&AS()&&(e=Sa);for(var n=Yt(),a=null,l=dc;l!==null;){var f=l.next,h=l0(l,n);h===0?(l.next=null,a===null?dc=f:a.next=f,f===null&&(vo=a)):(a=l,(e!==0||(h&3)!==0)&&(uc=!0)),l=f}Gt!==0&&Gt!==5||kr(e),Sa!==0&&(Sa=0)}function l0(e,n){for(var a=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var _=31-Wt(h),j=1<<_,R=f[_];R===-1?((j&a)===0||(j&l)!==0)&&(f[_]=V(j,n)):R<=n&&(e.expiredLanes|=j),h&=~j}if(n=pt,a=Pe,a=Wa(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===n&&(ot===2||ot===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&es(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Xa(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(l!==null&&es(l),ct(a)){case 2:case 8:a=Za;break;case 32:a=ms;break;case 268435456:a=wn;break;default:a=ms}return l=c0.bind(null,e),a=aa(a,l),e.callbackPriority=n,e.callbackNode=a,n}return l!==null&&l!==null&&es(l),e.callbackPriority=2,e.callbackNode=null,2}function c0(e,n){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(cc()&&e.callbackNode!==a)return null;var l=Pe;return l=Wa(e,e===pt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(qv(e,l,n),l0(e,Yt()),e.callbackNode!=null&&e.callbackNode===a?c0.bind(null,e):null)}function d0(e,n){if(cc())return null;qv(e,n,!0)}function xS(){RS(function(){(st&6)!==0?aa(oa,bS):r0()})}function mf(){if(Sa===0){var e=to;e===0&&(e=Ka,Ka<<=1,(Ka&261888)===0&&(Ka=256)),Sa=e}return Sa}function u0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:bl(""+e)}function f0(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function _S(e,n,a,l,f){if(n==="submit"&&a&&a.stateNode===f){var h=u0((f[It]||null).action),_=l.submitter;_&&(n=(n=_[It]||null)?u0(n.formAction):_.getAttribute("formAction"),n!==null&&(h=n,_=null));var j=new Sl("action","action",null,l,f);e.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Sa!==0){var R=_?f0(f,_):new FormData(f);Mu(a,{pending:!0,data:R,method:f.method,action:h},null,R)}}else typeof h=="function"&&(j.preventDefault(),R=_?f0(f,_):new FormData(f),Mu(a,{pending:!0,data:R,method:f.method,action:h},h,R))},currentTarget:f}]})}}for(var hf=0;hf<Jd.length;hf++){var gf=Jd[hf],kS=gf.toLowerCase(),SS=gf[0].toUpperCase()+gf.slice(1);ts(kS,"on"+SS)}ts(Vh,"onAnimationEnd"),ts(qh,"onAnimationIteration"),ts(Gh,"onAnimationStart"),ts("dblclick","onDoubleClick"),ts("focusin","onFocus"),ts("focusout","onBlur"),ts($k,"onTransitionRun"),ts(Uk,"onTransitionStart"),ts(Pk,"onTransitionCancel"),ts(Fh,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),ei("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ei("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ei("onBeforeInput",["compositionend","keypress","textInput","paste"]),ei("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ei("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ei("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sr="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(" "),TS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sr));function p0(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],f=l.event;l=l.listeners;e:{var h=void 0;if(n)for(var _=l.length-1;0<=_;_--){var j=l[_],R=j.instance,G=j.currentTarget;if(j=j.listener,R!==h&&f.isPropagationStopped())break e;h=j,f.currentTarget=G;try{h(f)}catch(ee){jl(ee)}f.currentTarget=null,h=R}else for(_=0;_<l.length;_++){if(j=l[_],R=j.instance,G=j.currentTarget,j=j.listener,R!==h&&f.isPropagationStopped())break e;h=j,f.currentTarget=G;try{h(f)}catch(ee){jl(ee)}f.currentTarget=null,h=R}}}}function $e(e,n){var a=n[Qa];a===void 0&&(a=n[Qa]=new Set);var l=e+"__bubble";a.has(l)||(m0(n,e,2,!1),a.add(l))}function vf(e,n,a){var l=0;n&&(l|=4),m0(a,e,l,n)}var fc="_reactListening"+Math.random().toString(36).slice(2);function yf(e){if(!e[fc]){e[fc]=!0,rh.forEach(function(a){a!=="selectionchange"&&(TS.has(a)||vf(a,!1,e),vf(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[fc]||(n[fc]=!0,vf("selectionchange",!1,n))}}function m0(e,n,a,l){switch(V0(n)){case 2:var f=XS;break;case 8:f=QS;break;default:f=Mf}a=f.bind(null,n,a,e),f=void 0,!Ld||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,a,{capture:!0,passive:f}):e.addEventListener(n,a,!0):f!==void 0?e.addEventListener(n,a,{passive:f}):e.addEventListener(n,a,!1)}function bf(e,n,a,l,f){var h=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var _=l.tag;if(_===3||_===4){var j=l.stateNode.containerInfo;if(j===f)break;if(_===4)for(_=l.return;_!==null;){var R=_.tag;if((R===3||R===4)&&_.stateNode.containerInfo===f)return;_=_.return}for(;j!==null;){if(_=zi(j),_===null)return;if(R=_.tag,R===5||R===6||R===26||R===27){l=h=_;continue e}j=j.parentNode}}l=l.return}bh(function(){var G=h,ee=Od(a),se=[];e:{var F=Zh.get(e);if(F!==void 0){var K=Sl,xe=e;switch(e){case"keypress":if(_l(a)===0)break e;case"keydown":case"keyup":K=vk;break;case"focusin":xe="focus",K=Pd;break;case"focusout":xe="blur",K=Pd;break;case"beforeblur":case"afterblur":K=Pd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=kh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=ik;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=xk;break;case Vh:case qh:case Gh:K=lk;break;case Fh:K=kk;break;case"scroll":case"scrollend":K=sk;break;case"wheel":K=Tk;break;case"copy":case"cut":case"paste":K=dk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Th;break;case"toggle":case"beforetoggle":K=jk}var Ee=(n&4)!==0,ft=!Ee&&(e==="scroll"||e==="scrollend"),z=Ee?F!==null?F+"Capture":null:F;Ee=[];for(var O=G,q;O!==null;){var ne=O;if(q=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||q===null||z===null||(ne=Go(O,z),ne!=null&&Ee.push(Tr(O,ne,q))),ft)break;O=O.return}0<Ee.length&&(F=new K(F,xe,null,a,ee),se.push({event:F,listeners:Ee}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",F&&a!==Id&&(xe=a.relatedTarget||a.fromElement)&&(zi(xe)||xe[gn]))break e;if((K||F)&&(F=ee.window===ee?ee:(F=ee.ownerDocument)?F.defaultView||F.parentWindow:window,K?(xe=a.relatedTarget||a.toElement,K=G,xe=xe?zi(xe):null,xe!==null&&(ft=d(xe),Ee=xe.tag,xe!==ft||Ee!==5&&Ee!==27&&Ee!==6)&&(xe=null)):(K=null,xe=G),K!==xe)){if(Ee=kh,ne="onMouseLeave",z="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=Th,ne="onPointerLeave",z="onPointerEnter",O="pointer"),ft=K==null?F:qo(K),q=xe==null?F:qo(xe),F=new Ee(ne,O+"leave",K,a,ee),F.target=ft,F.relatedTarget=q,ne=null,zi(ee)===G&&(Ee=new Ee(z,O+"enter",xe,a,ee),Ee.target=q,Ee.relatedTarget=ft,ne=Ee),ft=ne,K&&xe)t:{for(Ee=wS,z=K,O=xe,q=0,ne=z;ne;ne=Ee(ne))q++;ne=0;for(var je=O;je;je=Ee(je))ne++;for(;0<q-ne;)z=Ee(z),q--;for(;0<ne-q;)O=Ee(O),ne--;for(;q--;){if(z===O||O!==null&&z===O.alternate){Ee=z;break t}z=Ee(z),O=Ee(O)}Ee=null}else Ee=null;K!==null&&h0(se,F,K,Ee,!1),xe!==null&&ft!==null&&h0(se,ft,xe,Ee,!0)}}e:{if(F=G?qo(G):window,K=F.nodeName&&F.nodeName.toLowerCase(),K==="select"||K==="input"&&F.type==="file")var Qe=Rh;else if(Ah(F))if(Mh)Qe=Bk;else{Qe=Ik;var ke=Mk}else K=F.nodeName,!K||K.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?G&&Md(G.elementType)&&(Qe=Rh):Qe=Ok;if(Qe&&(Qe=Qe(e,G))){Dh(se,Qe,a,ee);break e}ke&&ke(e,F,G),e==="focusout"&&G&&F.type==="number"&&G.memoizedProps.value!=null&&Rd(F,"number",F.value)}switch(ke=G?qo(G):window,e){case"focusin":(Ah(ke)||ke.contentEditable==="true")&&(Zi=ke,Zd=G,Qo=null);break;case"focusout":Qo=Zd=Zi=null;break;case"mousedown":Kd=!0;break;case"contextmenu":case"mouseup":case"dragend":Kd=!1,Ph(se,a,ee);break;case"selectionchange":if(zk)break;case"keydown":case"keyup":Ph(se,a,ee)}var Be;if(Vd)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Fi?Ch(e,a)&&(He="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(He="onCompositionStart");He&&(wh&&a.locale!=="ko"&&(Fi||He!=="onCompositionStart"?He==="onCompositionEnd"&&Fi&&(Be=xh()):(ra=ee,zd="value"in ra?ra.value:ra.textContent,Fi=!0)),ke=pc(G,He),0<ke.length&&(He=new Sh(He,e,null,a,ee),se.push({event:He,listeners:ke}),Be?He.data=Be:(Be=Eh(a),Be!==null&&(He.data=Be)))),(Be=Ck?Ek(e,a):Ak(e,a))&&(He=pc(G,"onBeforeInput"),0<He.length&&(ke=new Sh("onBeforeInput","beforeinput",null,a,ee),se.push({event:ke,listeners:He}),ke.data=Be)),_S(se,e,G,a,ee)}p0(se,n)})}function Tr(e,n,a){return{instance:e,listener:n,currentTarget:a}}function pc(e,n){for(var a=n+"Capture",l=[];e!==null;){var f=e,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Go(e,a),f!=null&&l.unshift(Tr(e,f,h)),f=Go(e,n),f!=null&&l.push(Tr(e,f,h))),e.tag===3)return l;e=e.return}return[]}function wS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function h0(e,n,a,l,f){for(var h=n._reactName,_=[];a!==null&&a!==l;){var j=a,R=j.alternate,G=j.stateNode;if(j=j.tag,R!==null&&R===l)break;j!==5&&j!==26&&j!==27||G===null||(R=G,f?(G=Go(a,h),G!=null&&_.unshift(Tr(a,G,R))):f||(G=Go(a,h),G!=null&&_.push(Tr(a,G,R)))),a=a.return}_.length!==0&&e.push({event:n,listeners:_})}var jS=/\r\n?/g,NS=/\u0000|\uFFFD/g;function g0(e){return(typeof e=="string"?e:""+e).replace(jS,`
|
|
26
|
+
`).replace(NS,"")}function v0(e,n){return n=g0(n),g0(e)===n}function ut(e,n,a,l,f,h){switch(a){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Vi(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Vi(e,""+l);break;case"className":vl(e,"class",l);break;case"tabIndex":vl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":vl(e,a,l);break;case"style":vh(e,l,h);break;case"data":if(n!=="object"){vl(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=bl(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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 h=="function"&&(a==="formAction"?(n!=="input"&&ut(e,n,"name",f.name,f,null),ut(e,n,"formEncType",f.formEncType,f,null),ut(e,n,"formMethod",f.formMethod,f,null),ut(e,n,"formTarget",f.formTarget,f,null)):(ut(e,n,"encType",f.encType,f,null),ut(e,n,"method",f.method,f,null),ut(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=bl(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Es);break;case"onScroll":l!=null&&$e("scroll",e);break;case"onScrollEnd":l!=null&&$e("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=a}}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}a=bl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+l):e.removeAttribute(a);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(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":$e("beforetoggle",e),$e("toggle",e),gl(e,"popover",l);break;case"xlinkActuate":Cs(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Cs(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Cs(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Cs(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Cs(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Cs(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Cs(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Cs(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Cs(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":gl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=tk.get(a)||a,gl(e,a,l))}}function xf(e,n,a,l,f,h){switch(a){case"style":vh(e,l,h);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Vi(e,l):(typeof l=="number"||typeof l=="bigint")&&Vi(e,""+l);break;case"onScroll":l!=null&&$e("scroll",e);break;case"onScrollEnd":l!=null&&$e("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Es);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lh.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),h=e[It]||null,h=h!=null?h[a]:null,typeof h=="function"&&e.removeEventListener(n,h,f),typeof l=="function")){typeof h!="function"&&h!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,l,f);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):gl(e,a,l)}}}function on(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",e),$e("load",e);var l=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var _=a[h];if(_!=null)switch(h){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ut(e,n,h,_,a,null)}}f&&ut(e,n,"srcSet",a.srcSet,a,null),l&&ut(e,n,"src",a.src,a,null);return;case"input":$e("invalid",e);var j=h=_=f=null,R=null,G=null;for(l in a)if(a.hasOwnProperty(l)){var ee=a[l];if(ee!=null)switch(l){case"name":f=ee;break;case"type":_=ee;break;case"checked":R=ee;break;case"defaultChecked":G=ee;break;case"value":h=ee;break;case"defaultValue":j=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,n));break;default:ut(e,n,l,ee,a,null)}}ph(e,h,j,R,G,_,f,!1);return;case"select":$e("invalid",e),l=_=h=null;for(f in a)if(a.hasOwnProperty(f)&&(j=a[f],j!=null))switch(f){case"value":h=j;break;case"defaultValue":_=j;break;case"multiple":l=j;default:ut(e,n,f,j,a,null)}n=h,a=_,e.multiple=!!l,n!=null?Hi(e,!!l,n,!1):a!=null&&Hi(e,!!l,a,!0);return;case"textarea":$e("invalid",e),h=f=l=null;for(_ in a)if(a.hasOwnProperty(_)&&(j=a[_],j!=null))switch(_){case"value":l=j;break;case"defaultValue":f=j;break;case"children":h=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:ut(e,n,_,j,a,null)}hh(e,l,f,h);return;case"option":for(R in a)if(a.hasOwnProperty(R)&&(l=a[R],l!=null))switch(R){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ut(e,n,R,l,a,null)}return;case"dialog":$e("beforetoggle",e),$e("toggle",e),$e("cancel",e),$e("close",e);break;case"iframe":case"object":$e("load",e);break;case"video":case"audio":for(l=0;l<Sr.length;l++)$e(Sr[l],e);break;case"image":$e("error",e),$e("load",e);break;case"details":$e("toggle",e);break;case"embed":case"source":case"link":$e("error",e),$e("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(G in a)if(a.hasOwnProperty(G)&&(l=a[G],l!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ut(e,n,G,l,a,null)}return;default:if(Md(n)){for(ee in a)a.hasOwnProperty(ee)&&(l=a[ee],l!==void 0&&xf(e,n,ee,l,a,void 0));return}}for(j in a)a.hasOwnProperty(j)&&(l=a[j],l!=null&&ut(e,n,j,l,a,null))}function CS(e,n,a,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,_=null,j=null,R=null,G=null,ee=null;for(K in a){var se=a[K];if(a.hasOwnProperty(K)&&se!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":R=se;default:l.hasOwnProperty(K)||ut(e,n,K,null,l,se)}}for(var F in l){var K=l[F];if(se=a[F],l.hasOwnProperty(F)&&(K!=null||se!=null))switch(F){case"type":h=K;break;case"name":f=K;break;case"checked":G=K;break;case"defaultChecked":ee=K;break;case"value":_=K;break;case"defaultValue":j=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:K!==se&&ut(e,n,F,K,l,se)}}Dd(e,_,j,R,G,ee,h,f);return;case"select":K=_=j=F=null;for(h in a)if(R=a[h],a.hasOwnProperty(h)&&R!=null)switch(h){case"value":break;case"multiple":K=R;default:l.hasOwnProperty(h)||ut(e,n,h,null,l,R)}for(f in l)if(h=l[f],R=a[f],l.hasOwnProperty(f)&&(h!=null||R!=null))switch(f){case"value":F=h;break;case"defaultValue":j=h;break;case"multiple":_=h;default:h!==R&&ut(e,n,f,h,l,R)}n=j,a=_,l=K,F!=null?Hi(e,!!a,F,!1):!!l!=!!a&&(n!=null?Hi(e,!!a,n,!0):Hi(e,!!a,a?[]:"",!1));return;case"textarea":K=F=null;for(j in a)if(f=a[j],a.hasOwnProperty(j)&&f!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:ut(e,n,j,null,l,f)}for(_ in l)if(f=l[_],h=a[_],l.hasOwnProperty(_)&&(f!=null||h!=null))switch(_){case"value":F=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ut(e,n,_,f,l,h)}mh(e,F,K);return;case"option":for(var xe in a)if(F=a[xe],a.hasOwnProperty(xe)&&F!=null&&!l.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:ut(e,n,xe,null,l,F)}for(R in l)if(F=l[R],K=a[R],l.hasOwnProperty(R)&&F!==K&&(F!=null||K!=null))switch(R){case"selected":e.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ut(e,n,R,F,l,K)}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 Ee in a)F=a[Ee],a.hasOwnProperty(Ee)&&F!=null&&!l.hasOwnProperty(Ee)&&ut(e,n,Ee,null,l,F);for(G in l)if(F=l[G],K=a[G],l.hasOwnProperty(G)&&F!==K&&(F!=null||K!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,n));break;default:ut(e,n,G,F,l,K)}return;default:if(Md(n)){for(var ft in a)F=a[ft],a.hasOwnProperty(ft)&&F!==void 0&&!l.hasOwnProperty(ft)&&xf(e,n,ft,void 0,l,F);for(ee in l)F=l[ee],K=a[ee],!l.hasOwnProperty(ee)||F===K||F===void 0&&K===void 0||xf(e,n,ee,F,l,K);return}}for(var z in a)F=a[z],a.hasOwnProperty(z)&&F!=null&&!l.hasOwnProperty(z)&&ut(e,n,z,null,l,F);for(se in l)F=l[se],K=a[se],!l.hasOwnProperty(se)||F===K||F==null&&K==null||ut(e,n,se,F,l,K)}function y0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ES(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var f=a[l],h=f.transferSize,_=f.initiatorType,j=f.duration;if(h&&j&&y0(_)){for(_=0,j=f.responseEnd,l+=1;l<a.length;l++){var R=a[l],G=R.startTime;if(G>j)break;var ee=R.transferSize,se=R.initiatorType;ee&&y0(se)&&(R=R.responseEnd,_+=ee*(R<j?1:(j-G)/(R-G)))}if(--l,n+=8*(h+_)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var _f=null,kf=null;function mc(e){return e.nodeType===9?e:e.ownerDocument}function b0(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 x0(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Sf(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Tf=null;function AS(){var e=window.event;return e&&e.type==="popstate"?e===Tf?!1:(Tf=e,!0):(Tf=null,!1)}var _0=typeof setTimeout=="function"?setTimeout:void 0,DS=typeof clearTimeout=="function"?clearTimeout:void 0,k0=typeof Promise=="function"?Promise:void 0,RS=typeof queueMicrotask=="function"?queueMicrotask:typeof k0<"u"?function(e){return k0.resolve(null).then(e).catch(MS)}:_0;function MS(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function S0(e,n){var a=n,l=0;do{var f=a.nextSibling;if(e.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(f),_o(n);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")wr(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,wr(a);for(var h=a.firstChild;h;){var _=h.nextSibling,j=h.nodeName;h[Vo]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=_}}else a==="body"&&wr(e.ownerDocument.body);a=f}while(a);_o(n)}function T0(e,n){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function wf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":wf(a),Ed(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function IS(e,n,a,l){for(;e.nodeType===1;){var f=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Vo])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Fn(e.nextSibling),e===null)break}return null}function OS(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Fn(e.nextSibling),e===null))return null;return e}function w0(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Fn(e.nextSibling),e===null))return null;return e}function jf(e){return e.data==="$?"||e.data==="$~"}function Nf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function BS(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var l=function(){n(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Fn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Cf=null;function j0(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return Fn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function N0(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function C0(e,n,a){switch(n=mc(a),e){case"html":if(e=n.documentElement,!e)throw Error(r(452));return e;case"head":if(e=n.head,!e)throw Error(r(453));return e;case"body":if(e=n.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function wr(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ed(e)}var Zn=new Map,E0=new Set;function hc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Gs=Z.d;Z.d={f:LS,r:zS,D:$S,C:US,L:PS,m:HS,X:qS,S:VS,M:GS};function LS(){var e=Gs.f(),n=oc();return e||n}function zS(e){var n=$i(e);n!==null&&n.tag===5&&n.type==="form"?Fg(n):Gs.r(e)}var yo=typeof document>"u"?null:document;function A0(e,n,a){var l=yo;if(l&&typeof n=="string"&&n){var f=$n(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),E0.has(f)||(E0.add(f),e={rel:e,crossOrigin:a,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),on(n,"link",e),Qt(n),l.head.appendChild(n)))}}function $S(e){Gs.D(e),A0("dns-prefetch",e,null)}function US(e,n){Gs.C(e,n),A0("preconnect",e,n)}function PS(e,n,a){Gs.L(e,n,a);var l=yo;if(l&&e&&n){var f='link[rel="preload"][as="'+$n(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+$n(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+$n(a.imageSizes)+'"]')):f+='[href="'+$n(e)+'"]';var h=f;switch(n){case"style":h=bo(e);break;case"script":h=xo(e)}Zn.has(h)||(e=b({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),Zn.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(jr(h))||n==="script"&&l.querySelector(Nr(h))||(n=l.createElement("link"),on(n,"link",e),Qt(n),l.head.appendChild(n)))}}function HS(e,n){Gs.m(e,n);var a=yo;if(a&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+$n(l)+'"][href="'+$n(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=xo(e)}if(!Zn.has(h)&&(e=b({rel:"modulepreload",href:e},n),Zn.set(h,e),a.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Nr(h)))return}l=a.createElement("link"),on(l,"link",e),Qt(l),a.head.appendChild(l)}}}function VS(e,n,a){Gs.S(e,n,a);var l=yo;if(l&&e){var f=Ui(l).hoistableStyles,h=bo(e);n=n||"default";var _=f.get(h);if(!_){var j={loading:0,preload:null};if(_=l.querySelector(jr(h)))j.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},a),(a=Zn.get(h))&&Ef(e,a);var R=_=l.createElement("link");Qt(R),on(R,"link",e),R._p=new Promise(function(G,ee){R.onload=G,R.onerror=ee}),R.addEventListener("load",function(){j.loading|=1}),R.addEventListener("error",function(){j.loading|=2}),j.loading|=4,gc(_,n,l)}_={type:"stylesheet",instance:_,count:1,state:j},f.set(h,_)}}}function qS(e,n){Gs.X(e,n);var a=yo;if(a&&e){var l=Ui(a).hoistableScripts,f=xo(e),h=l.get(f);h||(h=a.querySelector(Nr(f)),h||(e=b({src:e,async:!0},n),(n=Zn.get(f))&&Af(e,n),h=a.createElement("script"),Qt(h),on(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function GS(e,n){Gs.M(e,n);var a=yo;if(a&&e){var l=Ui(a).hoistableScripts,f=xo(e),h=l.get(f);h||(h=a.querySelector(Nr(f)),h||(e=b({src:e,async:!0,type:"module"},n),(n=Zn.get(f))&&Af(e,n),h=a.createElement("script"),Qt(h),on(h,"link",e),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(f,h))}}function D0(e,n,a,l){var f=(f=_e.current)?hc(f):null;if(!f)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=bo(a.href),a=Ui(f).hoistableStyles,l=a.get(n),l||(l={type:"style",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=bo(a.href);var h=Ui(f).hoistableStyles,_=h.get(e);if(_||(f=f.ownerDocument||f,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,_),(h=f.querySelector(jr(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Zn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Zn.set(e,a),h||FS(f,e,a,_.state))),n&&l===null)throw Error(r(528,""));return _}if(n&&l!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=xo(a),a=Ui(f).hoistableScripts,l=a.get(n),l||(l={type:"script",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function bo(e){return'href="'+$n(e)+'"'}function jr(e){return'link[rel="stylesheet"]['+e+"]"}function R0(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function FS(e,n,a,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),on(n,"link",a),Qt(n),e.head.appendChild(n))}function xo(e){return'[src="'+$n(e)+'"]'}function Nr(e){return"script[async]"+e}function M0(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+$n(a.href)+'"]');if(l)return n.instance=l,Qt(l),l;var f=b({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Qt(l),on(l,"style",f),gc(l,a.precedence,e),n.instance=l;case"stylesheet":f=bo(a.href);var h=e.querySelector(jr(f));if(h)return n.state.loading|=4,n.instance=h,Qt(h),h;l=R0(a),(f=Zn.get(f))&&Ef(l,f),h=(e.ownerDocument||e).createElement("link"),Qt(h);var _=h;return _._p=new Promise(function(j,R){_.onload=j,_.onerror=R}),on(h,"link",l),n.state.loading|=4,gc(h,a.precedence,e),n.instance=h;case"script":return h=xo(a.src),(f=e.querySelector(Nr(h)))?(n.instance=f,Qt(f),f):(l=a,(f=Zn.get(h))&&(l=b({},a),Af(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),Qt(f),on(f,"link",l),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,gc(l,a.precedence,e));return n.instance}function gc(e,n,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,h=f,_=0;_<l.length;_++){var j=l[_];if(j.dataset.precedence===n)h=j;else if(h!==f)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function Ef(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Af(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var vc=null;function I0(e,n,a){if(vc===null){var l=new Map,f=vc=new Map;f.set(a,l)}else f=vc,l=f.get(a),l||(l=new Map,f.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),f=0;f<a.length;f++){var h=a[f];if(!(h[Vo]||h[Ue]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var _=h.getAttribute(n)||"";_=e+_;var j=l.get(_);j?j.push(h):l.set(_,[h])}}return l}function O0(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function ZS(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function B0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function KS(e,n,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=bo(l.href),h=n.querySelector(jr(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=yc.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=h,Qt(h);return}h=n.ownerDocument||n,l=R0(l),(f=Zn.get(f))&&Ef(l,f),h=h.createElement("link"),Qt(h);var _=h;_._p=new Promise(function(j,R){_.onload=j,_.onerror=R}),on(h,"link",l),a.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=yc.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Df=0;function YS(e,n){return e.stylesheets&&e.count===0&&xc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&xc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Df===0&&(Df=62500*ES());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Df?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function yc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bc=null;function xc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bc=new Map,n.forEach(JS,e),bc=null,yc.call(e))}function JS(e,n){if(!(n.state.loading&4)){var a=bc.get(e);if(a)var l=a.get(null);else{a=new Map,bc.set(e,a);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var _=f[h];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(a.set(_.dataset.precedence,_),l=_)}l&&a.set(null,l)}f=n.instance,_=f.getAttribute("data-precedence"),h=a.get(_)||l,h===l&&a.set(null,f),a.set(_,f),this.count++,l=yc.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),h?h.parentNode.insertBefore(f,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Cr={$$typeof:D,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function WS(e,n,a,l,f,h,_,j,R){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=le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=le(0),this.hiddenUpdates=le(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function L0(e,n,a,l,f,h,_,j,R,G,ee,se){return e=new WS(e,n,a,_,R,G,ee,se,j),n=1,h===!0&&(n|=24),h=Nn(3,null,null,n),e.current=h,h.stateNode=e,n=cu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:a,cache:n},pu(h),e}function z0(e){return e?(e=Ji,e):Ji}function $0(e,n,a,l,f,h){f=z0(f),l.context===null?l.context=f:l.pendingContext=f,l=pa(n),l.payload={element:a},h=h===void 0?null:h,h!==null&&(l.callback=h),a=ma(e,l,n),a!==null&&(kn(a,e,n),or(a,e,n))}function U0(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Rf(e,n){U0(e,n),(e=e.alternate)&&U0(e,n)}function P0(e){if(e.tag===13||e.tag===31){var n=ai(e,67108864);n!==null&&kn(n,e,67108864),Rf(e,67108864)}}function H0(e){if(e.tag===13||e.tag===31){var n=Rn();n=Ke(n);var a=ai(e,n);a!==null&&kn(a,e,n),Rf(e,n)}}var _c=!0;function XS(e,n,a,l){var f=L.T;L.T=null;var h=Z.p;try{Z.p=2,Mf(e,n,a,l)}finally{Z.p=h,L.T=f}}function QS(e,n,a,l){var f=L.T;L.T=null;var h=Z.p;try{Z.p=8,Mf(e,n,a,l)}finally{Z.p=h,L.T=f}}function Mf(e,n,a,l){if(_c){var f=If(l);if(f===null)bf(e,n,l,kc,a),q0(e,l);else if(tT(f,e,n,a,l))l.stopPropagation();else if(q0(e,l),n&4&&-1<eT.indexOf(e)){for(;f!==null;){var h=$i(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=hs(h.pendingLanes);if(_!==0){var j=h;for(j.pendingLanes|=2,j.entangledLanes|=2;_;){var R=1<<31-Wt(_);j.entanglements[1]|=R,_&=~R}bs(h),(st&6)===0&&(ac=Yt()+500,kr(0))}}break;case 31:case 13:j=ai(h,2),j!==null&&kn(j,h,2),oc(),Rf(h,2)}if(h=If(l),h===null&&bf(e,n,l,kc,a),h===f)break;f=h}f!==null&&l.stopPropagation()}else bf(e,n,l,null,a)}}function If(e){return e=Od(e),Of(e)}var kc=null;function Of(e){if(kc=null,e=zi(e),e!==null){var n=d(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=u(n),e!==null)return e;e=null}else if(a===31){if(e=p(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return kc=e,null}function V0(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(Mi()){case oa:return 2;case Za:return 8;case ms:case Ii:return 32;case wn:return 268435456;default:return 32}default:return 32}}var Bf=!1,wa=null,ja=null,Na=null,Er=new Map,Ar=new Map,Ca=[],eT="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 q0(e,n){switch(e){case"focusin":case"focusout":wa=null;break;case"dragenter":case"dragleave":ja=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":Er.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ar.delete(n.pointerId)}}function Dr(e,n,a,l,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:a,eventSystemFlags:l,nativeEvent:h,targetContainers:[f]},n!==null&&(n=$i(n),n!==null&&P0(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function tT(e,n,a,l,f){switch(n){case"focusin":return wa=Dr(wa,e,n,a,l,f),!0;case"dragenter":return ja=Dr(ja,e,n,a,l,f),!0;case"mouseover":return Na=Dr(Na,e,n,a,l,f),!0;case"pointerover":var h=f.pointerId;return Er.set(h,Dr(Er.get(h)||null,e,n,a,l,f)),!0;case"gotpointercapture":return h=f.pointerId,Ar.set(h,Dr(Ar.get(h)||null,e,n,a,l,f)),!0}return!1}function G0(e){var n=zi(e.target);if(n!==null){var a=d(n);if(a!==null){if(n=a.tag,n===13){if(n=u(a),n!==null){e.blockedOn=n,Xt(e.priority,function(){H0(a)});return}}else if(n===31){if(n=p(a),n!==null){e.blockedOn=n,Xt(e.priority,function(){H0(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=If(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Id=l,a.target.dispatchEvent(l),Id=null}else return n=$i(a),n!==null&&P0(n),e.blockedOn=a,!1;n.shift()}return!0}function F0(e,n,a){Sc(e)&&a.delete(n)}function nT(){Bf=!1,wa!==null&&Sc(wa)&&(wa=null),ja!==null&&Sc(ja)&&(ja=null),Na!==null&&Sc(Na)&&(Na=null),Er.forEach(F0),Ar.forEach(F0)}function Tc(e,n){e.blockedOn===n&&(e.blockedOn=null,Bf||(Bf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,nT)))}var wc=null;function Z0(e){wc!==e&&(wc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){wc===e&&(wc=null);for(var n=0;n<e.length;n+=3){var a=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(Of(l||a)===null)continue;break}var h=$i(a);h!==null&&(e.splice(n,3),n-=3,Mu(h,{pending:!0,data:f,method:a.method,action:l},l,f))}}))}function _o(e){function n(R){return Tc(R,e)}wa!==null&&Tc(wa,e),ja!==null&&Tc(ja,e),Na!==null&&Tc(Na,e),Er.forEach(n),Ar.forEach(n);for(var a=0;a<Ca.length;a++){var l=Ca[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ca.length&&(a=Ca[0],a.blockedOn===null);)G0(a),a.blockedOn===null&&Ca.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var f=a[l],h=a[l+1],_=f[It]||null;if(typeof h=="function")_||Z0(a);else if(_){var j=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[It]||null)j=_.formAction;else if(Of(f)!==null)continue}else j=_.action;typeof j=="function"?a[l+1]=j:(a.splice(l,3),l-=3),Z0(a)}}}function K0(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(_){return f=_})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Lf(e){this._internalRoot=e}jc.prototype.render=Lf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,l=Rn();$0(a,l,e,n,null,null)},jc.prototype.unmount=Lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;$0(e.current,2,null,e,null,null),oc(),n[gn]=null}};function jc(e){this._internalRoot=e}jc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Xe();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Ca.length&&n!==0&&n<Ca[a].priority;a++);Ca.splice(a,0,e),a===0&&G0(e)}};var Y0=s.version;if(Y0!=="19.2.4")throw Error(r(527,Y0,"19.2.4"));Z.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var sT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nc.isDisabled&&Nc.supportsFiber)try{Jt=Nc.inject(sT),St=Nc}catch{}}return Mr.createRoot=function(e,n){if(!c(e))throw Error(r(299));var a=!1,l="",f=nv,h=sv,_=av;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(_=n.onRecoverableError)),n=L0(e,1,!1,null,null,a,l,null,f,h,_,K0),e[gn]=n.current,yf(e),new Lf(n)},Mr.hydrateRoot=function(e,n,a){if(!c(e))throw Error(r(299));var l=!1,f="",h=nv,_=sv,j=av,R=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(_=a.onCaughtError),a.onRecoverableError!==void 0&&(j=a.onRecoverableError),a.formState!==void 0&&(R=a.formState)),n=L0(e,1,!0,n,a??null,l,f,R,h,_,j,K0),n.context=z0(null),a=n.current,l=Rn(),l=Ke(l),f=pa(l),f.callback=null,ma(a,f,l),a=l,n.current.lanes=a,de(n,a),bs(n),e[gn]=n.current,yf(e),new jc(n)},Mr.version="19.2.4",Mr}var sy;function DT(){if(sy)return zf.exports;sy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),zf.exports=AT(),zf.exports}var RT=DT();const MT="modulepreload",IT=function(t){return"/"+t},ay={},OT=function(s,o,r){let c=Promise.resolve();if(o&&o.length>0){let u=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),m=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));c=u(o.map(g=>{if(g=IT(g),g in ay)return;ay[g]=!0;const v=g.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${b}`))return;const x=document.createElement("link");if(x.rel=v?"stylesheet":MT,v||(x.as="script"),x.crossOrigin="",x.href=g,m&&x.setAttribute("nonce",m),document.head.appendChild(x),v)return new Promise((S,k)=>{x.addEventListener("load",S),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${g}`)))})}))}function d(u){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=u,window.dispatchEvent(p),!p.defaultPrevented)throw u}return c.then(u=>{for(const p of u||[])p.status==="rejected"&&d(p.reason);return s().catch(d)})},BT=new Proxy(globalThis.fetch,{apply(t,s,o){return Reflect.apply(globalThis.fetch,s,o)}}),LT=pT({baseUrl:"/",fetch:BT}),Ne=mT(hT,LT),zT="_bar_1xhb4_1",$T="_input_1xhb4_32",UT="_select_1xhb4_67",PT="_btnPrimary_1xhb4_103",HT="_btnGhost_1xhb4_173",VT="_badge_1xhb4_195",qT="_disconnectHint_1xhb4_205",Mn={bar:zT,input:$T,select:UT,btnPrimary:PT,btnGhost:HT,badge:VT,disconnectHint:qT};function GT(t,s){if(!t)return!1;const o=s.find(r=>r.id===t);return o!==void 0&&(o.status==="disconnected"||o.status==="error")}function FT({environmentId:t,onReconnect:s}){return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:Mn.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),i.jsx("button",{type:"button",onClick:()=>s(t),className:Mn.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function Qr({mode:t,sessionId:s,environmentId:o,taskId:r,showPersonaSelect:c,personas:d,environments:u,onSendInput:p,onSpawn:m,onStartTask:g,onProvisionEnvironment:v,onShowToast:b}){const[x,S]=y.useState(""),[k,w]=y.useState(""),N=GT(o,u),T=C=>{if(C.preventDefault(),!!x.trim())if(t==="send"){if(!s||N)return;p(s,x),S("")}else if(t==="spawn"){if(!o)return;m(o,x,k),b==null||b("Session started","success"),S(""),w("")}else{if(!r)return;g(r,void 0,o,x),S("")}};return t==="spawn"?i.jsxs("form",{onSubmit:T,className:Mn.bar,children:[i.jsx("span",{className:Mn.badge,children:"new chat"}),i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:Mn.input,"aria-label":"Enter prompt"}),c&&i.jsxs("select",{value:k,onChange:C=>w(C.target.value),className:Mn.select,"aria-label":"Select persona",children:[i.jsx("option",{value:"",children:"(Default)"}),d.map(C=>i.jsx("option",{value:C.id,children:C.name},C.id))]}),i.jsx("button",{type:"submit",disabled:!x.trim()||!o,className:Mn.btnPrimary,children:"Go"})]}):t==="start"?i.jsxs("form",{onSubmit:T,className:Mn.bar,children:[i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Type a message...",autoFocus:!0,className:Mn.input,"aria-label":"Type a message"}),i.jsx("button",{type:"submit",disabled:!x.trim(),className:Mn.btnPrimary,children:"Send"})]}):i.jsxs("form",{onSubmit:T,className:Mn.bar,children:[N&&o&&i.jsx(FT,{environmentId:o,onReconnect:v}),i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Type a message...",autoFocus:!N,disabled:N,className:Mn.input,"aria-label":"Type a message"}),i.jsx("span",{title:N?"Environment is unavailable — reconnect first":void 0,children:i.jsx("button",{type:"submit",disabled:!x.trim()||N,className:Mn.btnPrimary,children:"Send"})})]})}const iy=220,oy=70,ZT=40,KT=60,YT="hierarchy",JT="dependency";function WT(t){return y.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const s=new J0.graphlib.Graph({multigraph:!0});s.setDefaultEdgeLabel(()=>({})),s.setGraph({rankdir:"TB",nodesep:ZT,ranksep:KT});const o=new Map(t.map(u=>[u.id,u])),r=new Map;for(const u of t)if(u.parentTaskId&&o.has(u.parentTaskId)){const p=r.get(u.parentTaskId)||[];p.push(u),r.set(u.parentTaskId,p)}for(const u of t)s.setNode(u.id,{width:iy,height:oy});const c=[];for(const u of t){if(u.parentTaskId&&o.has(u.parentTaskId)){const p=`hierarchy-${u.parentTaskId}-${u.id}`;s.setEdge(u.parentTaskId,u.id,{},p),c.push({id:p,source:u.parentTaskId,target:u.id,type:"smoothstep",data:{edgeType:YT},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of u.dependsOn)if(o.has(p)){const m=`dependency-${p}-${u.id}`;s.setEdge(p,u.id,{},m),c.push({id:m,source:p,target:u.id,type:"smoothstep",data:{edgeType:JT},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return J0.layout(s),{nodes:t.map(u=>{const p=s.node(u.id),m=r.get(u.id)||[];return{id:u.id,type:"task",position:{x:p.x-iy/2,y:p.y-oy/2},data:{task:u,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:u.dependsOn.length>0}}}),edges:c}},[t])}/**
|
|
27
|
+
* @license lucide-react v0.474.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const XT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mx=(...t)=>t.filter((s,o,r)=>!!s&&s.trim()!==""&&r.indexOf(s)===o).join(" ").trim();/**
|
|
32
|
+
* @license lucide-react v0.474.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/var QT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
37
|
+
* @license lucide-react v0.474.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const e2=y.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:c="",children:d,iconNode:u,...p},m)=>y.createElement("svg",{ref:m,...QT,width:s,height:s,stroke:t,strokeWidth:r?Number(o)*24/Number(s):o,className:mx("lucide",c),...p},[...u.map(([g,v])=>y.createElement(g,v)),...Array.isArray(d)?d:[d]]));/**
|
|
42
|
+
* @license lucide-react v0.474.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Ye=(t,s)=>{const o=y.forwardRef(({className:r,...c},d)=>y.createElement(e2,{ref:d,iconNode:s,className:mx(`lucide-${XT(t)}`,r),...c}));return o.displayName=`${t}`,o};/**
|
|
47
|
+
* @license lucide-react v0.474.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const t2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ry=Ye("ArrowDown",t2);/**
|
|
52
|
+
* @license lucide-react v0.474.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const n2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ly=Ye("ArrowUp",n2);/**
|
|
57
|
+
* @license lucide-react v0.474.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const s2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],a2=Ye("Ban",s2);/**
|
|
62
|
+
* @license lucide-react v0.474.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const i2=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],o2=Ye("Brain",i2);/**
|
|
67
|
+
* @license lucide-react v0.474.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const r2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ei=Ye("Check",r2);/**
|
|
72
|
+
* @license lucide-react v0.474.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const l2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hx=Ye("ChevronDown",l2);/**
|
|
77
|
+
* @license lucide-react v0.474.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const c2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sa=Ye("ChevronRight",c2);/**
|
|
82
|
+
* @license lucide-react v0.474.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const d2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],La=Ye("Circle",d2);/**
|
|
87
|
+
* @license lucide-react v0.474.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const u2=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],f2=Ye("ClipboardList",u2);/**
|
|
92
|
+
* @license lucide-react v0.474.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const p2=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],gx=Ye("Clipboard",p2);/**
|
|
97
|
+
* @license lucide-react v0.474.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const m2=[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]],h2=Ye("Cog",m2);/**
|
|
102
|
+
* @license lucide-react v0.474.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const g2=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],v2=Ye("Copy",g2);/**
|
|
107
|
+
* @license lucide-react v0.474.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const y2=[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],b2=Ye("CornerDownRight",y2);/**
|
|
112
|
+
* @license lucide-react v0.474.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const x2=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],_2=Ye("FilePen",x2);/**
|
|
117
|
+
* @license lucide-react v0.474.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const k2=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],S2=Ye("FileText",k2);/**
|
|
122
|
+
* @license lucide-react v0.474.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const T2=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],w2=Ye("House",T2);/**
|
|
127
|
+
* @license lucide-react v0.474.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const j2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],im=Ye("Info",j2);/**
|
|
132
|
+
* @license lucide-react v0.474.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const N2=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],C2=Ye("Key",N2);/**
|
|
137
|
+
* @license lucide-react v0.474.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const E2=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],A2=Ye("Keyboard",E2);/**
|
|
142
|
+
* @license lucide-react v0.474.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const D2=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],R2=Ye("ListChecks",D2);/**
|
|
147
|
+
* @license lucide-react v0.474.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const M2=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],I2=Ye("List",M2);/**
|
|
152
|
+
* @license lucide-react v0.474.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const O2=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],B2=Ye("Loader",O2);/**
|
|
157
|
+
* @license lucide-react v0.474.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const L2=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],z2=Ye("Menu",L2);/**
|
|
162
|
+
* @license lucide-react v0.474.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const $2=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],U2=Ye("MessageSquare",$2);/**
|
|
167
|
+
* @license lucide-react v0.474.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const P2=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],H2=Ye("Monitor",P2);/**
|
|
172
|
+
* @license lucide-react v0.474.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const V2=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],q2=Ye("Palette",V2);/**
|
|
177
|
+
* @license lucide-react v0.474.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const G2=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],F2=Ye("Pause",G2);/**
|
|
182
|
+
* @license lucide-react v0.474.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const Z2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],K2=Ye("Pencil",Z2);/**
|
|
187
|
+
* @license lucide-react v0.474.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const Y2=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],vx=Ye("Search",Y2);/**
|
|
192
|
+
* @license lucide-react v0.474.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const J2=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],W2=Ye("Settings",J2);/**
|
|
197
|
+
* @license lucide-react v0.474.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const X2=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Q2=Ye("SquareCheckBig",X2);/**
|
|
202
|
+
* @license lucide-react v0.474.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const ew=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],om=Ye("TriangleAlert",ew);/**
|
|
207
|
+
* @license lucide-react v0.474.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const tw=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],nw=Ye("User",tw);/**
|
|
212
|
+
* @license lucide-react v0.474.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const sw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ha=Ye("X",sw),rm=8,lt=12,tn=14,zt=16,Ep={not_started:{color:"var(--text-tertiary)",icon:i.jsx(La,{size:lt}),label:"Not Started"},working:{color:"var(--accent-green)",icon:i.jsx(La,{size:lt,fill:"currentColor"}),label:"Working"},paused:{color:"var(--accent-yellow)",icon:i.jsx(F2,{size:lt}),label:"Paused"},complete:{color:"var(--accent-green)",icon:i.jsx(Ei,{size:lt}),label:"Complete"},failed:{color:"var(--accent-red)",icon:i.jsx(Ha,{size:lt}),label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:i.jsx(a2,{size:lt}),label:"Blocked"}};function za(t){return t==="blocked"?Ep.blocked:Ep[ll(t)]}const aw={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function iw(t){return aw[ll(t)]??"statusPending"}const ow=["working","paused","failed","not_started","blocked","complete"],cy=["not_started","working","paused","complete","failed"],rw={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function ll(t){return t in Ep&&t!=="blocked"?t:rw[t]??"not_started"}const lw={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"},cw="_dagContainer_js4w6_1",dw="_taskNode_js4w6_26",uw="_taskNodeBorder_js4w6_54",fw="_taskNodeContent_js4w6_60",pw="_taskNodeHeader_js4w6_70",mw="_taskNodeIcon_js4w6_77",hw="_taskNodeTitle_js4w6_82",gw="_taskNodeBadges_js4w6_90",vw="_childBadge_js4w6_95",yw="_depBadge_js4w6_107",bw="_handle_js4w6_119",xw="_emptyCta_js4w6_126",_w="_ctaDescription_js4w6_137",kw="_ctaButton_js4w6_144",hn={dagContainer:cw,taskNode:dw,taskNodeBorder:uw,taskNodeContent:fw,taskNodeHeader:pw,taskNodeIcon:mw,taskNodeTitle:hw,taskNodeBadges:gw,childBadge:vw,depBadge:yw,handle:bw,emptyCta:xw,ctaDescription:_w,ctaButton:kw};function Sw({data:t}){const{task:s,childCount:o,doneChildCount:r,hasDependencies:c}=t,d=za(s.status);return i.jsxs("div",{className:hn.taskNode,"data-task-id":s.id,"data-task-title":s.title,children:[i.jsx(W0,{type:"target",position:X0.Top,className:hn.handle}),i.jsx("div",{className:hn.taskNodeBorder,style:{backgroundColor:d.color}}),i.jsxs("div",{className:hn.taskNodeContent,children:[i.jsxs("div",{className:hn.taskNodeHeader,children:[i.jsx("span",{className:hn.taskNodeIcon,style:{color:d.color},children:d.icon}),i.jsx("span",{className:hn.taskNodeTitle,children:s.title})]}),i.jsxs("div",{className:hn.taskNodeBadges,children:[o>0&&i.jsxs("span",{className:hn.childBadge,children:[r,"/",o]}),c&&i.jsx("span",{className:hn.depBadge,children:"dep"})]})]}),i.jsx(W0,{type:"source",position:X0.Bottom,className:hn.handle})]})}/**
|
|
217
|
+
* react-router v7.13.2
|
|
218
|
+
*
|
|
219
|
+
* Copyright (c) Remix Software Inc.
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the MIT license found in the
|
|
222
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
223
|
+
*
|
|
224
|
+
* @license MIT
|
|
225
|
+
*/var dy="popstate";function uy(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function Tw(t={}){function s(r,c){var g;let d=(g=c.state)==null?void 0:g.masked,{pathname:u,search:p,hash:m}=d||r.location;return Ap("",{pathname:u,search:p,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function o(r,c){return typeof c=="string"?c:el(c)}return jw(s,o,null,t)}function xt(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function Xn(t,s){if(!t){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function ww(){return Math.random().toString(36).substring(2,10)}function fy(t,s){return{usr:t.state,key:t.key,idx:s,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Ap(t,s,o=null,r,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof s=="string"?zo(s):s,state:o,key:s&&s.key||r||ww(),unstable_mask:c}}function el({pathname:t="/",search:s="",hash:o=""}){return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function zo(t){let s={};if(t){let o=t.indexOf("#");o>=0&&(s.hash=t.substring(o),t=t.substring(0,o));let r=t.indexOf("?");r>=0&&(s.search=t.substring(r),t=t.substring(0,r)),t&&(s.pathname=t)}return s}function jw(t,s,o,r={}){let{window:c=document.defaultView,v5Compat:d=!1}=r,u=c.history,p="POP",m=null,g=v();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function v(){return(u.state||{idx:null}).idx}function b(){p="POP";let N=v(),T=N==null?null:N-g;g=N,m&&m({action:p,location:w.location,delta:T})}function x(N,T){p="PUSH";let C=uy(N)?N:Ap(w.location,N,T);g=v()+1;let D=fy(C,g),B=w.createHref(C.unstable_mask||C);try{u.pushState(D,"",B)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;c.location.assign(B)}d&&m&&m({action:p,location:w.location,delta:1})}function S(N,T){p="REPLACE";let C=uy(N)?N:Ap(w.location,N,T);g=v();let D=fy(C,g),B=w.createHref(C.unstable_mask||C);u.replaceState(D,"",B),d&&m&&m({action:p,location:w.location,delta:0})}function k(N){return Nw(N)}let w={get action(){return p},get location(){return t(c,u)},listen(N){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(dy,b),m=N,()=>{c.removeEventListener(dy,b),m=null}},createHref(N){return s(c,N)},createURL:k,encodeLocation(N){let T=k(N);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:x,replace:S,go(N){return u.go(N)}};return w}function Nw(t,s=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),xt(o,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:el(t);return r=r.replace(/ $/,"%20"),!s&&r.startsWith("//")&&(r=o+r),new URL(r,o)}function yx(t,s,o="/"){return Cw(t,s,o,!1)}function Cw(t,s,o,r){let c=typeof s=="string"?zo(s):s,d=ea(c.pathname||"/",o);if(d==null)return null;let u=bx(t);Ew(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=_x(d);p=zw(u[m],g,r)}return p}function bx(t,s=[],o=[],r="",c=!1){let d=(u,p,m=c,g)=>{let v={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:p,route:u};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(r)&&m)return;xt(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length)}let b=Ts([r,v.relativePath]),x=o.concat(v);u.children&&u.children.length>0&&(xt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),bx(u.children,s,x,b,m)),!(u.path==null&&!u.index)&&s.push({path:b,score:Bw(b,u.index),routesMeta:x})};return t.forEach((u,p)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))d(u,p);else for(let g of xx(u.path))d(u,p,!0,g)}),s}function xx(t){let s=t.split("/");if(s.length===0)return[];let[o,...r]=s,c=o.endsWith("?"),d=o.replace(/\?$/,"");if(r.length===0)return c?[d,""]:[d];let u=xx(r.join("/")),p=[];return p.push(...u.map(m=>m===""?d:[d,m].join("/"))),c&&p.push(...u),p.map(m=>t.startsWith("/")&&m===""?"/":m)}function Ew(t){t.sort((s,o)=>s.score!==o.score?o.score-s.score:Lw(s.routesMeta.map(r=>r.childrenIndex),o.routesMeta.map(r=>r.childrenIndex)))}var Aw=/^:[\w-]+$/,Dw=3,Rw=2,Mw=1,Iw=10,Ow=-2,py=t=>t==="*";function Bw(t,s){let o=t.split("/"),r=o.length;return o.some(py)&&(r+=Ow),s&&(r+=Rw),o.filter(c=>!py(c)).reduce((c,d)=>c+(Aw.test(d)?Dw:d===""?Mw:Iw),r)}function Lw(t,s){return t.length===s.length&&t.slice(0,-1).every((r,c)=>r===s[c])?t[t.length-1]-s[s.length-1]:0}function zw(t,s,o=!1){let{routesMeta:r}=t,c={},d="/",u=[];for(let p=0;p<r.length;++p){let m=r[p],g=p===r.length-1,v=d==="/"?s:s.slice(d.length)||"/",b=tl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),x=m.route;if(!b&&g&&o&&!r[r.length-1].route.index&&(b=tl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(c,b.params),u.push({params:c,pathname:Ts([d,b.pathname]),pathnameBase:Vw(Ts([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=Ts([d,b.pathnameBase]))}return u}function tl(t,s){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[o,r]=$w(t.path,t.caseSensitive,t.end),c=s.match(o);if(!c)return null;let d=c[0],u=d.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:r.reduce((g,{paramName:v,isOptional:b},x)=>{if(v==="*"){let k=p[x]||"";u=d.slice(0,d.length-k.length).replace(/(.)\/+$/,"$1")}const S=p[x];return b&&!S?g[v]=void 0:g[v]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:u,pattern:t}}function $w(t,s=!1,o=!0){Xn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],c="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,m,g,v)=>{if(r.push({paramName:p,isOptional:m!=null}),m){let b=v.charAt(g+u.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),c+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?c+="\\/*$":t!==""&&t!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,s?void 0:"i"),r]}function _x(t){try{return t.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Xn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),t}}function ea(t,s){if(s==="/")return t;if(!t.toLowerCase().startsWith(s.toLowerCase()))return null;let o=s.endsWith("/")?s.length-1:s.length,r=t.charAt(o);return r&&r!=="/"?null:t.slice(o)||"/"}var Uw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Pw(t,s="/"){let{pathname:o,search:r="",hash:c=""}=typeof t=="string"?zo(t):t,d;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?d=my(o.substring(1),"/"):d=my(o,s)):d=s,{pathname:d,search:qw(r),hash:Gw(c)}}function my(t,s){let o=s.replace(/\/+$/,"").split("/");return t.split("/").forEach(c=>{c===".."?o.length>1&&o.pop():c!=="."&&o.push(c)}),o.length>1?o.join("/"):"/"}function Pf(t,s,o,r){return`Cannot include a '${t}' character in a manually specified \`to.${s}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Hw(t){return t.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function lm(t){let s=Hw(t);return s.map((o,r)=>r===s.length-1?o.pathname:o.pathnameBase)}function vd(t,s,o,r=!1){let c;typeof t=="string"?c=zo(t):(c={...t},xt(!c.pathname||!c.pathname.includes("?"),Pf("?","pathname","search",c)),xt(!c.pathname||!c.pathname.includes("#"),Pf("#","pathname","hash",c)),xt(!c.search||!c.search.includes("#"),Pf("#","search","hash",c)));let d=t===""||c.pathname==="",u=d?"/":c.pathname,p;if(u==null)p=o;else{let b=s.length-1;if(!r&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),b-=1;c.pathname=x.join("/")}p=b>=0?s[b]:"/"}let m=Pw(c,p),g=u&&u!=="/"&&u.endsWith("/"),v=(d||u===".")&&o.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var Ts=t=>t.join("/").replace(/\/\/+/g,"/"),Vw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Gw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Fw=class{constructor(t,s,o,r=!1){this.status=t,this.statusText=s||"",this.internal=r,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Zw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Kw(t){return t.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Sx(t,s){let o=t;if(typeof o!="string"||!Uw.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let r=o,c=!1;if(kx)try{let d=new URL(window.location.href),u=o.startsWith("//")?new URL(d.protocol+o):new URL(o),p=ea(u.pathname,s);u.origin===d.origin&&p!=null?o=p+u.search+u.hash:c=!0}catch{Xn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:c,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Tx=["POST","PUT","PATCH","DELETE"];new Set(Tx);var Yw=["GET",...Tx];new Set(Yw);var $o=y.createContext(null);$o.displayName="DataRouter";var yd=y.createContext(null);yd.displayName="DataRouterState";var Jw=y.createContext(!1),wx=y.createContext({isTransitioning:!1});wx.displayName="ViewTransition";var Ww=y.createContext(new Map);Ww.displayName="Fetchers";var Xw=y.createContext(null);Xw.displayName="Await";var Ln=y.createContext(null);Ln.displayName="Navigation";var cl=y.createContext(null);cl.displayName="Location";var Qn=y.createContext({outlet:null,matches:[],isDataRoute:!1});Qn.displayName="Route";var cm=y.createContext(null);cm.displayName="RouteError";var jx="REACT_ROUTER_ERROR",Qw="REDIRECT",ej="ROUTE_ERROR_RESPONSE";function tj(t){if(t.startsWith(`${jx}:${Qw}:{`))try{let s=JSON.parse(t.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function nj(t){if(t.startsWith(`${jx}:${ej}:{`))try{let s=JSON.parse(t.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new Fw(s.status,s.statusText,s.data)}catch{}}function sj(t,{relative:s}={}){xt(Ai(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:r}=y.useContext(Ln),{hash:c,pathname:d,search:u}=dl(t,{relative:s}),p=d;return o!=="/"&&(p=d==="/"?o:Ts([o,d])),r.createHref({pathname:p,search:u,hash:c})}function Ai(){return y.useContext(cl)!=null}function Zt(){return xt(Ai(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(cl).location}function At(t){xt(Ai(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:s}=Zt();return y.useMemo(()=>tl(t,_x(s)),[s,t])}var Nx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cx(t){y.useContext(Ln).static||y.useLayoutEffect(t)}function bd(){let{isDataRoute:t}=y.useContext(Qn);return t?yj():aj()}function aj(){xt(Ai(),"useNavigate() may be used only in the context of a <Router> component.");let t=y.useContext($o),{basename:s,navigator:o}=y.useContext(Ln),{matches:r}=y.useContext(Qn),{pathname:c}=Zt(),d=JSON.stringify(lm(r)),u=y.useRef(!1);return Cx(()=>{u.current=!0}),y.useCallback((m,g={})=>{if(Xn(u.current,Nx),!u.current)return;if(typeof m=="number"){o.go(m);return}let v=vd(m,JSON.parse(d),c,g.relative==="path");t==null&&s!=="/"&&(v.pathname=v.pathname==="/"?s:Ts([s,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[s,o,d,c,t])}var ij=y.createContext(null);function oj(t){let s=y.useContext(Qn).outlet;return y.useMemo(()=>s&&y.createElement(ij.Provider,{value:t},s),[s,t])}function fs(){let{matches:t}=y.useContext(Qn),s=t[t.length-1];return s?s.params:{}}function dl(t,{relative:s}={}){let{matches:o}=y.useContext(Qn),{pathname:r}=Zt(),c=JSON.stringify(lm(o));return y.useMemo(()=>vd(t,JSON.parse(c),r,s==="path"),[t,c,r,s])}function rj(t,s){return Ex(t,s)}function Ex(t,s,o){var N;xt(Ai(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(Ln),{matches:c}=y.useContext(Qn),d=c[c.length-1],u=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let T=g&&g.path||"";Dx(p,!g||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
226
|
+
|
|
227
|
+
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=Zt(),b;if(s){let T=typeof s=="string"?zo(s):s;xt(m==="/"||((N=T.pathname)==null?void 0:N.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${T.pathname}" was given in the \`location\` prop.`),b=T}else b=v;let x=b.pathname||"/",S=x;if(m!=="/"){let T=m.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(T.length).join("/")}let k=yx(t,{pathname:S});Xn(g||k!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Xn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=fj(k&&k.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:Ts([m,r.encodeLocation?r.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:Ts([m,r.encodeLocation?r.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,o);return s&&w?y.createElement(cl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},w):w}function lj(){let t=vj(),s=Zw(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),o=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:r},d={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",t),u=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},s),o?y.createElement("pre",{style:c},o):null,u)}var cj=y.createElement(lj,null),Ax=class extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){this.props.onError?this.props.onError(t,s):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const o=nj(t.digest);o&&(t=o)}let s=t!==void 0?y.createElement(Qn.Provider,{value:this.props.routeContext},y.createElement(cm.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?y.createElement(dj,{error:t},s):s}};Ax.contextType=Jw;var Hf=new WeakMap;function dj({children:t,error:s}){let{basename:o}=y.useContext(Ln);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let r=tj(s.digest);if(r){let c=Hf.get(s);if(c)throw c;let d=Sx(r.location,o);if(kx&&!Hf.get(s))if(d.isExternal||r.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:r.replace}));throw Hf.set(s,u),u}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return t}function uj({routeContext:t,match:s,children:o}){let r=y.useContext($o);return r&&r.static&&r.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=s.route.id),y.createElement(Qn.Provider,{value:t},o)}function fj(t,s=[],o){let r=o==null?void 0:o.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(s.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let c=t,d=r==null?void 0:r.errors;if(d!=null){let v=c.findIndex(b=>b.route.id&&(d==null?void 0:d[b.route.id])!==void 0);xt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,v+1))}let u=!1,p=-1;if(o&&r){u=r.renderFallback;for(let v=0;v<c.length;v++){let b=c[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(p=v),b.route.id){let{loaderData:x,errors:S}=r,k=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||k){o.isStatic&&(u=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let m=o==null?void 0:o.onError,g=r&&m?(v,b)=>{var x,S;m(v,{location:r.location,params:((S=(x=r.matches)==null?void 0:x[0])==null?void 0:S.params)??{},unstable_pattern:Kw(r.matches),errorInfo:b})}:void 0;return c.reduceRight((v,b,x)=>{let S,k=!1,w=null,N=null;r&&(S=d&&b.route.id?d[b.route.id]:void 0,w=b.route.errorElement||cj,u&&(p<0&&x===0?(Dx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):p===x&&(k=!0,N=b.route.hydrateFallbackElement||null)));let T=s.concat(c.slice(0,x+1)),C=()=>{let D;return S?D=w:k?D=N:b.route.Component?D=y.createElement(b.route.Component,null):b.route.element?D=b.route.element:D=v,y.createElement(uj,{match:b,routeContext:{outlet:v,matches:T,isDataRoute:r!=null},children:D})};return r&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?y.createElement(Ax,{location:r.location,revalidation:r.revalidation,component:w,error:S,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:g}):C()},null)}function dm(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pj(t){let s=y.useContext($o);return xt(s,dm(t)),s}function mj(t){let s=y.useContext(yd);return xt(s,dm(t)),s}function hj(t){let s=y.useContext(Qn);return xt(s,dm(t)),s}function um(t){let s=hj(t),o=s.matches[s.matches.length-1];return xt(o.route.id,`${t} can only be used on routes that contain a unique "id"`),o.route.id}function gj(){return um("useRouteId")}function vj(){var r;let t=y.useContext(cm),s=mj("useRouteError"),o=um("useRouteError");return t!==void 0?t:(r=s.errors)==null?void 0:r[o]}function yj(){let{router:t}=pj("useNavigate"),s=um("useNavigate"),o=y.useRef(!1);return Cx(()=>{o.current=!0}),y.useCallback(async(c,d={})=>{Xn(o.current,Nx),o.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:s,...d}))},[t,s])}var hy={};function Dx(t,s,o){!s&&!hy[t]&&(hy[t]=!0,Xn(!1,o))}y.memo(bj);function bj({routes:t,future:s,state:o,isStatic:r,onError:c}){return Ex(t,void 0,{state:o,isStatic:r,onError:c})}function ds({to:t,replace:s,state:o,relative:r}){xt(Ai(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(Ln);Xn(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=y.useContext(Qn),{pathname:u}=Zt(),p=bd(),m=vd(t,lm(d),u,r==="path"),g=JSON.stringify(m);return y.useEffect(()=>{p(JSON.parse(g),{replace:s,state:o,relative:r})},[p,g,r,s,o]),null}function Va(t){return oj(t.context)}function Ae(t){xt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xj({basename:t="/",children:s=null,location:o,navigationType:r="POP",navigator:c,static:d=!1,unstable_useTransitions:u}){xt(!Ai(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=t.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:p,navigator:c,static:d,unstable_useTransitions:u,future:{}}),[p,c,d,u]);typeof o=="string"&&(o=zo(o));let{pathname:g="/",search:v="",hash:b="",state:x=null,key:S="default",unstable_mask:k}=o,w=y.useMemo(()=>{let N=ea(g,p);return N==null?null:{location:{pathname:N,search:v,hash:b,state:x,key:S,unstable_mask:k},navigationType:r}},[p,g,v,b,x,S,r,k]);return Xn(w!=null,`<Router basename="${p}"> is not able to match the URL "${g}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(Ln.Provider,{value:m},y.createElement(cl.Provider,{children:s,value:w}))}function _j({children:t,location:s}){return rj(Dp(t),s)}function Dp(t,s=[]){let o=[];return y.Children.forEach(t,(r,c)=>{if(!y.isValidElement(r))return;let d=[...s,c];if(r.type===y.Fragment){o.push.apply(o,Dp(r.props.children,d));return}xt(r.type===Ae,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),xt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||d.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=Dp(r.props.children,d)),o.push(u)}),o}var Gc="get",Fc="application/x-www-form-urlencoded";function xd(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function kj(t){return xd(t)&&t.tagName.toLowerCase()==="button"}function Sj(t){return xd(t)&&t.tagName.toLowerCase()==="form"}function Tj(t){return xd(t)&&t.tagName.toLowerCase()==="input"}function wj(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function jj(t,s){return t.button===0&&(!s||s==="_self")&&!wj(t)}function Rp(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((s,o)=>{let r=t[o];return s.concat(Array.isArray(r)?r.map(c=>[o,c]):[[o,r]])},[]))}function Nj(t,s){let o=Rp(t);return s&&s.forEach((r,c)=>{o.has(c)||s.getAll(c).forEach(d=>{o.append(c,d)})}),o}var Ac=null;function Cj(){if(Ac===null)try{new FormData(document.createElement("form"),0),Ac=!1}catch{Ac=!0}return Ac}var Ej=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Vf(t){return t!=null&&!Ej.has(t)?(Xn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fc}"`),null):t}function Aj(t,s){let o,r,c,d,u;if(Sj(t)){let p=t.getAttribute("action");r=p?ea(p,s):null,o=t.getAttribute("method")||Gc,c=Vf(t.getAttribute("enctype"))||Fc,d=new FormData(t)}else if(kj(t)||Tj(t)&&(t.type==="submit"||t.type==="image")){let p=t.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||p.getAttribute("action");if(r=m?ea(m,s):null,o=t.getAttribute("formmethod")||p.getAttribute("method")||Gc,c=Vf(t.getAttribute("formenctype"))||Vf(p.getAttribute("enctype"))||Fc,d=new FormData(p,t),!Cj()){let{name:g,type:v,value:b}=t;if(v==="image"){let x=g?`${g}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else g&&d.append(g,b)}}else{if(xd(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Gc,r=null,c=Fc,u=t}return d&&c==="text/plain"&&(u=d,d=void 0),{action:r,method:o.toLowerCase(),encType:c,formData:d,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fm(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function Dj(t,s,o,r){let c=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return o?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${r}`:c.pathname=`${c.pathname}.${r}`:c.pathname==="/"?c.pathname=`_root.${r}`:s&&ea(c.pathname,s)==="/"?c.pathname=`${s.replace(/\/$/,"")}/_root.${r}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${r}`,c}async function Rj(t,s){if(t.id in s)return s[t.id];try{let o=await import(t.module);return s[t.id]=o,o}catch(o){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Mj(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function Ij(t,s,o){let r=await Promise.all(t.map(async c=>{let d=s.routes[c.route.id];if(d){let u=await Rj(d,o);return u.links?u.links():[]}return[]}));return zj(r.flat(1).filter(Mj).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function gy(t,s,o,r,c,d){let u=(m,g)=>o[g]?m.route.id!==o[g].route.id:!0,p=(m,g)=>{var v;return o[g].pathname!==m.pathname||((v=o[g].route.path)==null?void 0:v.endsWith("*"))&&o[g].params["*"]!==m.params["*"]};return d==="assets"?s.filter((m,g)=>u(m,g)||p(m,g)):d==="data"?s.filter((m,g)=>{var b;let v=r.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(u(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((b=o[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Oj(t,s,{includeHydrateFallback:o}={}){return Bj(t.map(r=>{let c=s.routes[r.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),o&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function Bj(t){return[...new Set(t)]}function Lj(t){let s={},o=Object.keys(t).sort();for(let r of o)s[r]=t[r];return s}function zj(t,s){let o=new Set;return new Set(s),t.reduce((r,c)=>{let d=JSON.stringify(Lj(c));return o.has(d)||(o.add(d),r.push({key:d,link:c})),r},[])}function Rx(){let t=y.useContext($o);return fm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function $j(){let t=y.useContext(yd);return fm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var pm=y.createContext(void 0);pm.displayName="FrameworkContext";function Mx(){let t=y.useContext(pm);return fm(t,"You must render this element inside a <HydratedRouter> element"),t}function Uj(t,s){let o=y.useContext(pm),[r,c]=y.useState(!1),[d,u]=y.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:v,onTouchStart:b}=s,x=y.useRef(null);y.useEffect(()=>{if(t==="render"&&u(!0),t==="viewport"){let w=T=>{T.forEach(C=>{u(C.isIntersecting)})},N=new IntersectionObserver(w,{threshold:.5});return x.current&&N.observe(x.current),()=>{N.disconnect()}}},[t]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(w)}}},[r]);let S=()=>{c(!0)},k=()=>{c(!1),u(!1)};return o?t!=="intent"?[d,x,{}]:[d,x,{onFocus:Ir(p,S),onBlur:Ir(m,k),onMouseEnter:Ir(g,S),onMouseLeave:Ir(v,k),onTouchStart:Ir(b,S)}]:[!1,x,{}]}function Ir(t,s){return o=>{t&&t(o),o.defaultPrevented||s(o)}}function Pj({page:t,...s}){let{router:o}=Rx(),r=y.useMemo(()=>yx(o.routes,t,o.basename),[o.routes,t,o.basename]);return r?y.createElement(Vj,{page:t,matches:r,...s}):null}function Hj(t){let{manifest:s,routeModules:o}=Mx(),[r,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return Ij(t,s,o).then(u=>{d||c(u)}),()=>{d=!0}},[t,s,o]),r}function Vj({page:t,matches:s,...o}){let r=Zt(),{future:c,manifest:d,routeModules:u}=Mx(),{basename:p}=Rx(),{loaderData:m,matches:g}=$j(),v=y.useMemo(()=>gy(t,s,g,d,r,"data"),[t,s,g,d,r]),b=y.useMemo(()=>gy(t,s,g,d,r,"assets"),[t,s,g,d,r]),x=y.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let w=new Set,N=!1;if(s.forEach(C=>{var B;let D=d.routes[C.route.id];!D||!D.hasLoader||(!v.some(E=>E.route.id===C.route.id)&&C.route.id in m&&((B=u[C.route.id])!=null&&B.shouldRevalidate)||D.hasClientLoader?N=!0:w.add(C.route.id))}),w.size===0)return[];let T=Dj(t,p,c.unstable_trailingSlashAwareDataRequests,"data");return N&&w.size>0&&T.searchParams.set("_routes",s.filter(C=>w.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[p,c.unstable_trailingSlashAwareDataRequests,m,r,d,v,s,t,u]),S=y.useMemo(()=>Oj(b,d),[b,d]),k=Hj(b);return y.createElement(y.Fragment,null,x.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...o})),S.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...o})),k.map(({key:w,link:N})=>y.createElement("link",{key:w,nonce:o.nonce,...N,crossOrigin:N.crossOrigin??o.crossOrigin})))}function qj(...t){return s=>{t.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var Gj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Gj&&(window.__reactRouterVersion="7.13.2")}catch{}function Fj({basename:t,children:s,unstable_useTransitions:o,window:r}){let c=y.useRef();c.current==null&&(c.current=Tw({window:r,v5Compat:!0}));let d=c.current,[u,p]=y.useState({action:d.action,location:d.location}),m=y.useCallback(g=>{o===!1?p(g):y.startTransition(()=>p(g))},[o]);return y.useLayoutEffect(()=>d.listen(m),[d,m]),y.createElement(xj,{basename:t,children:s,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:o})}var Ix=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mm=y.forwardRef(function({onClick:s,discover:o="render",prefetch:r="none",relative:c,reloadDocument:d,replace:u,unstable_mask:p,state:m,target:g,to:v,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:S,...k},w){let{basename:N,navigator:T,unstable_useTransitions:C}=y.useContext(Ln),D=typeof v=="string"&&Ix.test(v),B=Sx(v,N);v=B.to;let E=sj(v,{relative:c}),A=Zt(),P=null;if(p){let ie=vd(p,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);N!=="/"&&(ie.pathname=ie.pathname==="/"?N:Ts([N,ie.pathname])),P=T.createHref(ie)}let[I,U,Q]=Uj(r,k),$=Jj(v,{replace:u,unstable_mask:p,state:m,target:g,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:C});function W(ie){s&&s(ie),ie.defaultPrevented||$(ie)}let pe=!(B.isExternal||d),H=y.createElement("a",{...k,...Q,href:(pe?P:void 0)||B.absoluteURL||E,onClick:pe?W:s,ref:qj(w,U),target:g,"data-discover":!D&&o==="render"?"true":void 0});return I&&!D?y.createElement(y.Fragment,null,H,y.createElement(Pj,{page:E})):H});mm.displayName="Link";var Zj=y.forwardRef(function({"aria-current":s="page",caseSensitive:o=!1,className:r="",end:c=!1,style:d,to:u,viewTransition:p,children:m,...g},v){let b=dl(u,{relative:g.relative}),x=Zt(),S=y.useContext(yd),{navigator:k,basename:w}=y.useContext(Ln),N=S!=null&&tN(b)&&p===!0,T=k.encodeLocation?k.encodeLocation(b).pathname:b.pathname,C=x.pathname,D=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;o||(C=C.toLowerCase(),D=D?D.toLowerCase():null,T=T.toLowerCase()),D&&w&&(D=ea(D,w)||D);const B=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let E=C===T||!c&&C.startsWith(T)&&C.charAt(B)==="/",A=D!=null&&(D===T||!c&&D.startsWith(T)&&D.charAt(T.length)==="/"),P={isActive:E,isPending:A,isTransitioning:N},I=E?s:void 0,U;typeof r=="function"?U=r(P):U=[r,E?"active":null,A?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let Q=typeof d=="function"?d(P):d;return y.createElement(mm,{...g,"aria-current":I,className:U,ref:v,style:Q,to:u,viewTransition:p},typeof m=="function"?m(P):m)});Zj.displayName="NavLink";var Kj=y.forwardRef(({discover:t="render",fetcherKey:s,navigate:o,reloadDocument:r,replace:c,state:d,method:u=Gc,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:x,...S},k)=>{let{unstable_useTransitions:w}=y.useContext(Ln),N=Qj(),T=eN(p,{relative:g}),C=u.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&Ix.test(p),B=E=>{if(m&&m(E),E.defaultPrevented)return;E.preventDefault();let A=E.nativeEvent.submitter,P=(A==null?void 0:A.getAttribute("formmethod"))||u,I=()=>N(A||E.currentTarget,{fetcherKey:s,method:P,navigate:o,replace:c,state:d,relative:g,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:x});w&&o!==!1?y.startTransition(()=>I()):I()};return y.createElement("form",{ref:k,method:C,action:T,onSubmit:r?m:B,...S,"data-discover":!D&&t==="render"?"true":void 0})});Kj.displayName="Form";function Yj(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ox(t){let s=y.useContext($o);return xt(s,Yj(t)),s}function Jj(t,{target:s,replace:o,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=bd(),b=Zt(),x=dl(t,{relative:u});return y.useCallback(S=>{if(jj(S,s)){S.preventDefault();let k=o!==void 0?o:el(b)===el(x),w=()=>v(t,{replace:k,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m});g?y.startTransition(()=>w()):w()}},[b,v,x,o,r,c,s,t,d,u,p,m,g])}function hm(t){Xn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let s=y.useRef(Rp(t)),o=y.useRef(!1),r=Zt(),c=y.useMemo(()=>Nj(r.search,o.current?null:s.current),[r.search]),d=bd(),u=y.useCallback((p,m)=>{const g=Rp(typeof p=="function"?p(new URLSearchParams(c)):p);o.current=!0,d("?"+g,m)},[d,c]);return[c,u]}var Wj=0,Xj=()=>`__${String(++Wj)}__`;function Qj(){let{router:t}=Ox("useSubmit"),{basename:s}=y.useContext(Ln),o=gj(),r=t.fetch,c=t.navigate;return y.useCallback(async(d,u={})=>{let{action:p,method:m,encType:g,formData:v,body:b}=Aj(d,s);if(u.navigate===!1){let x=u.fetcherKey||Xj();await r(x,o,u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:b,formMethod:u.method||m,formEncType:u.encType||g,flushSync:u.flushSync})}else await c(u.action||p,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:b,formMethod:u.method||m,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:o,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,c,s,o])}function eN(t,{relative:s}={}){let{basename:o}=y.useContext(Ln),r=y.useContext(Qn);xt(r,"useFormAction must be used inside a RouteContext");let[c]=r.matches.slice(-1),d={...dl(t||".",{relative:s})},u=Zt();if(t==null){d.search=u.search;let p=new URLSearchParams(d.search),m=p.getAll("index");if(m.some(v=>v==="")){p.delete("index"),m.filter(b=>b).forEach(b=>p.append("index",b));let v=p.toString();d.search=v?`?${v}`:""}}return(!t||t===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:Ts([o,d.pathname])),el(d)}function tN(t,{relative:s}={}){let o=y.useContext(wx);xt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ox("useViewTransitionState"),c=dl(t,{relative:s});if(!o.isTransitioning)return!1;let d=ea(o.currentLocation.pathname,r)||o.currentLocation.pathname,u=ea(o.nextLocation.pathname,r)||o.nextLocation.pathname;return tl(c.pathname,u)!=null||tl(c.pathname,d)!=null}function kt(){const t=bd();return y.useCallback((s,o)=>{typeof s=="number"?t(s):t(s,o)},[t])}function gm(t){return`/sessions/${encodeURIComponent(t)}`}function $a(t,s){return s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function On(t,s,o,r){const c=encodeURIComponent(t);let d;return o&&r?d=`/environments/${encodeURIComponent(r)}/workspaces/${encodeURIComponent(o)}/tasks/${c}`:o?d=`/workspaces/${encodeURIComponent(o)}/tasks/${c}`:d=`/tasks/${c}`,s?`${d}/${s}`:d}function Di(t,s,o){const r=new URLSearchParams;t&&r.set("workspace",t),s&&r.set("parent",s);const c=r.toString();if(t&&o){const d=`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(t)}/tasks/new`;return s?`${d}?parent=${encodeURIComponent(s)}`:d}return c?`/tasks/new?${c}`:"/tasks/new"}function Bx(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Ro="/environments",nN="/environments/new";function ji(t){return`/environments/${encodeURIComponent(t)}`}function sN(t){return`/environments/${encodeURIComponent(t)}/edit`}const Do="/settings",aN="/settings/credentials",qf="/settings/personas",iN="/settings/personas/new";function Lx(t){return`/settings/personas/${encodeURIComponent(t)}`}const oN="/settings/shortcuts",rN="/pair",lN="/chat",Ni="/",cN="/tasks",zx="/workspaces/new",$x="/knowledge",_d="/findings";function dN(t,s){return t&&s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}/findings`:_d}function Mp(t,s,o){const r=encodeURIComponent(t);return s&&o?`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(s)}/findings/${r}`:`/findings/${r}`}const uN=lw,fN={task:Sw};function pN({workspaceId:t,environmentId:s,tasks:o,resolvedThemeId:r}){const c=kt(),d=y.useMemo(()=>o.filter(b=>b.workspaceId===t),[o,t]),{nodes:u,edges:p}=WT(d),m=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),x={};for(const[S,k]of Object.entries(uN))x[S]=b.getPropertyValue(k).trim()||"#6b7a8d";return x},[r]),g=y.useCallback((b,x)=>{c(On(x.id,void 0,t,s))},[c,t,s]),v=y.useCallback(b=>{const x=b.data;return m[x.task.status]||m.pending},[m]);return d.length===0?i.jsxs("div",{className:hn.emptyCta,children:[i.jsx("button",{className:hn.ctaButton,onClick:()=>c(Di(t,void 0,s)),children:"Create Task"}),i.jsx("div",{className:hn.ctaDescription,children:"Create tasks to see the dependency graph"})]}):i.jsx("div",{className:hn.dagContainer,children:i.jsxs(rT,{nodes:u,edges:p,nodeTypes:fN,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[i.jsx(lT,{variant:cT.Dots,gap:24,size:1,color:"var(--text-disabled)"}),i.jsx(dT,{showInteractive:!1}),i.jsx(uT,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}const mN="_breadcrumbs_17or2_1",hN="_list_17or2_11",gN="_item_17or2_21",vN="_separator_17or2_28",yN="_link_17or2_34",bN="_current_17or2_57",ko={breadcrumbs:mN,list:hN,item:gN,separator:vN,link:yN,current:bN};function Ns({segments:t}){return i.jsx("nav",{className:ko.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:i.jsx("ol",{className:ko.list,children:t.map((s,o)=>{const r=o===t.length-1;return i.jsxs("li",{className:ko.item,children:[o>0&&i.jsx("span",{className:ko.separator,"aria-hidden":"true",children:i.jsx(sa,{size:lt})}),s.url&&!r?i.jsx(mm,{className:ko.link,to:s.url,title:s.label,children:s.label}):i.jsx("span",{className:ko.current,"aria-current":"page",title:s.label,children:s.label})]},o)})})})}const xN="_btn_dwk2o_1",_N="_sm_dwk2o_22",kN="_md_dwk2o_28",SN="_lg_dwk2o_34",TN="_primary_dwk2o_40",wN="_danger_dwk2o_55",jN="_outline_dwk2o_70",NN="_ghost_dwk2o_80",Gf={btn:xN,sm:_N,md:kN,lg:SN,primary:TN,danger:wN,outline:jN,ghost:NN},Js=y.forwardRef(function({variant:s="primary",size:o="md",className:r,children:c,...d},u){const p=[Gf.btn,Gf[s],Gf[o],r].filter(Boolean).join(" ");return i.jsx("button",{ref:u,className:p,...d,children:c})}),CN="_copyButton_1bqk0_1",EN={copyButton:CN},AN=2e3;function DN({text:t,className:s,"data-testid":o}){const[r,c]=y.useState(!1),d=y.useRef(void 0);y.useEffect(()=>()=>{d.current!==void 0&&clearTimeout(d.current)},[]);const u=y.useCallback(async()=>{try{await navigator.clipboard.writeText(t),c(!0),d.current!==void 0&&clearTimeout(d.current),d.current=setTimeout(()=>{c(!1),d.current=void 0},AN)}catch{}},[t]);return i.jsx("button",{type:"button",className:`${EN.copyButton} ${s??""}`,onClick:()=>{u().catch(()=>{})},"aria-label":r?"Copied":"Copy to clipboard","data-testid":o??"copy-button",children:r?i.jsx(Ei,{size:tn,"aria-hidden":"true"}):i.jsx(gx,{size:tn,"aria-hidden":"true"})})}const RN="_banner_bxqlh_1",MN="_label_bxqlh_15",IN="_text_bxqlh_25",ON="_link_bxqlh_29",Dc={banner:RN,label:MN,text:IN,link:ON};function BN(){return i.jsxs("div",{className:Dc.banner,"data-testid":"demo-banner",children:[i.jsx("span",{className:Dc.label,children:"DEMO"}),i.jsxs("span",{className:Dc.text,children:["This is an interactive demo with mock data."," ",i.jsx("a",{href:"https://github.com/nick-pape/grackle",target:"_blank",rel:"noopener noreferrer",className:Dc.link,children:"Install Grackle"})," ","to use it for real."]})]})}const LN="_container_og0yp_1",zN="_chevronButton_og0yp_6",$N="_mainButton_og0yp_6",UN="_sm_og0yp_34",PN="_md_og0yp_34",HN="_lg_og0yp_34",VN="_primary_og0yp_57",qN="_danger_og0yp_70",GN="_outline_og0yp_83",FN="_ghost_og0yp_92",ZN="_dropdown_og0yp_100",KN="_option_og0yp_113",YN="_optionLabel_og0yp_130",JN="_optionDesc_og0yp_135",Fs={container:LN,chevronButton:zN,mainButton:$N,sm:UN,md:PN,lg:HN,primary:VN,danger:qN,outline:GN,ghost:FN,dropdown:ZN,option:KN,optionLabel:YN,optionDesc:JN};function Ux({label:t,onClick:s,options:o,variant:r="primary",size:c="md","data-testid":d}){const[u,p]=y.useState(!1),m=y.useRef(null);y.useEffect(()=>{if(!u)return;function x(S){m.current&&S.target instanceof Node&&!m.current.contains(S.target)&&p(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[u]),y.useEffect(()=>{if(!u)return;function x(S){S.key==="Escape"&&p(!1)}return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[u]);const g=Fs[r]||"",v=Fs[c]||"",b=()=>{u&&p(!1),s()};return i.jsxs("div",{ref:m,className:Fs.container,"data-testid":d,children:[i.jsx("button",{type:"button",className:`${Fs.mainButton} ${g} ${v}`,onClick:b,"data-testid":d?`${d}-main`:void 0,children:t}),i.jsx("button",{type:"button",className:`${Fs.chevronButton} ${g} ${v}`,onClick:()=>p(x=>!x),"aria-label":`More options for ${t}`,"aria-haspopup":"menu","aria-expanded":u,"data-testid":d?`${d}-chevron`:void 0,children:i.jsx(hx,{size:tn,"aria-hidden":"true"})}),u&&i.jsx("div",{className:Fs.dropdown,"data-testid":d?`${d}-menu`:void 0,children:o.map((x,S)=>i.jsxs("button",{type:"button",className:Fs.option,onClick:()=>{x.onClick(),p(!1)},children:[i.jsx("span",{className:Fs.optionLabel,children:x.label}),x.description&&i.jsx("span",{className:Fs.optionDesc,children:x.description})]},S))})]})}function Ip(){Ip=function(c,d){return new o(c,void 0,d)};var t=RegExp.prototype,s=new WeakMap;function o(c,d,u){var p=new RegExp(c,d);return s.set(p,u||s.get(c)),ed(p,o.prototype)}function r(c,d){var u=s.get(d);return Object.keys(u).reduce(function(p,m){var g=u[m];if(typeof g=="number")p[m]=c[g];else{for(var v=0;c[g[v]]===void 0&&v+1<g.length;)v++;p[m]=c[g[v]]}return p},Object.create(null))}return(function(c,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(d&&d.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),d&&ed(c,d)})(o,RegExp),o.prototype.exec=function(c){var d=t.exec.call(this,c);if(d){d.groups=r(d,this);var u=d.indices;u&&(u.groups=r(u,this))}return d},o.prototype[Symbol.replace]=function(c,d){if(typeof d=="string"){var u=s.get(this);return t[Symbol.replace].call(this,c,d.replace(/\$<([^>]+)>/g,function(m,g){var v=u[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof d=="function"){var p=this;return t[Symbol.replace].call(this,c,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(r(m,p)),d.apply(this,m)})}return t[Symbol.replace].call(this,c,d)},Ip.apply(this,arguments)}function ed(t,s){return ed=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ed(t,s)}function vy(t,s){(s==null||s>t.length)&&(s=t.length);for(var o=0,r=new Array(s);o<s;o++)r[o]=t[o];return r}function Ff(t,s){var o=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o)return(o=o.call(t)).next.bind(o);if(Array.isArray(t)||(o=(function(c,d){if(c){if(typeof c=="string")return vy(c,d);var u=Object.prototype.toString.call(c).slice(8,-1);return u==="Object"&&c.constructor&&(u=c.constructor.name),u==="Map"||u==="Set"?Array.from(c):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?vy(c,d):void 0}})(t))||s){o&&(t=o);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
228
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var WN=(function(t){return function(s){return s===void 0&&(s={}),(function(r,c){if(c&&!r.registered(c))throw new Error('The default language "'+c+'" is not registered with refractor.')})(t,s.defaultLanguage),function(r){TT(r,"element",o)};function o(r,c,d){var u,p;if(d&&d.tagName==="pre"&&r.tagName==="code"){var m=(r==null||(u=r.data)==null?void 0:u.meta)||(r==null||(p=r.properties)==null?void 0:p.metastring)||"";r.properties.className?typeof r.properties.className=="boolean"?r.properties.className=[]:Array.isArray(r.properties.className)||(r.properties.className=[r.properties.className]):r.properties.className=[];var g,v,b=(function(E){for(var A,P=Ff(E.properties.className);!(A=P()).done;){var I=A.value;if(I.slice(0,9)==="language-")return I.slice(9).toLowerCase()}return null})(r);if(!b&&s.defaultLanguage&&r.properties.className.push("language-"+(b=s.defaultLanguage)),r.properties.className.push("code-highlight"),b)try{var x,S;S=(x=b)!=null&&x.includes("diff-")?b.split("-")[1]:b,g=t.highlight(Ec(r),S),d.properties.className=(d.properties.className||[]).concat("language-"+S)}catch(E){if(!s.ignoreMissing||!/Unknown language/.test(E.message))throw E;g=r}else g=r;g.children=(v=1,function E(A){return A.reduce(function(P,I){if(I.type==="text"){var U=I.value,Q=(U.match(/\n/g)||"").length;if(Q===0)I.position={start:{line:v,column:1},end:{line:v,column:1}},P.push(I);else for(var $,W=U.split(`
|
|
229
|
+
`),pe=Ff(W.entries());!($=pe()).done;){var H=$.value,ie=H[0],L=H[1];P.push({type:"text",value:ie===W.length-1?L:L+`
|
|
230
|
+
`,position:{start:{line:v+ie,column:1},end:{line:v+ie,column:1}}})}return v+=Q,P}if(Object.prototype.hasOwnProperty.call(I,"children")){var Z=v;return I.children=E(I.children),P.push(I),I.position={start:{line:Z,column:1},end:{line:v,column:1}},P}return P.push(I),P},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var k,w=(function(E){var A=/{([\d,-]+)}/,P=E.split(",").map(function(Q){return Q.trim()}).join();if(A.test(P)){var I=A.exec(P)[1],U=jT(I);return function(Q){return U.includes(Q+1)}}return function(){return!1}})(m),N=(function(E){var A=Ip(/showLineNumbers=(\d+)/i,{lines:1});if(A.test(E)){var P=A.exec(E);return Number(P.groups.lines)}return 1})(m),T=(function(E){for(var A=new Array(E),P=0;P<E;P++)A[P]={type:"element",tagName:"span",properties:{className:[]},children:[]};return A})(g.position.end.line),C=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],D=function(){var E,A,P=k.value,I=P[0],U=P[1];U.properties.className=["code-line"];var Q=NT(g,function($){return $.position.start.line<=I+1&&$.position.end.line>=I+1});U.children=Q.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||s.showLineNumbers===!0||typeof s.showLineNumbers=="object"&&s.showLineNumbers.includes(b))&&!C.some(function($){return m.toLowerCase().includes($)})&&(U.properties.line=[(I+N).toString()],U.properties.className.push("line-number")),w(I)&&U.properties.className.push("highlight-line"),(b==="diff"||(E=b)!=null&&E.includes("diff-"))&&Ec(U).substring(0,1)==="-"?U.properties.className.push("deleted"):(b==="diff"||(A=b)!=null&&A.includes("diff-"))&&Ec(U).substring(0,1)==="+"&&U.properties.className.push("inserted")},B=Ff(T.entries());!(k=B()).done;)D();T.length>0&&Ec(T[T.length-1]).trim()===""&&T.pop(),r.children=T}}}})(wT);function Mo(t){if(t>=1e6)return`${(t/1e6).toFixed(1)}M`;if(t>=1e3){const s=Number((t/1e3).toFixed(1));return s>=1e3?`${(t/1e6).toFixed(1)}M`:`${s.toFixed(1)}k`}return String(t)}function Ss(t){if(t===0)return"-";const s=t/1e5;if(s<.01){const o=t<5?5:4;return`$${s.toFixed(o)}`}return`$${s.toFixed(2)}`}const yy=new Set(["grackle"]);function Uo(t){if(t.startsWith("mcp__")){const o=t.indexOf("__",5);if(o>5){const r=t.slice(5,o);if(yy.has(r))return t.slice(o+2)}}const s=t.indexOf("-");if(s>0){const o=t.slice(0,s);if(yy.has(o))return t.slice(s+1)}return t}const XN={read:"file-read",view:"file-read",edit:"file-edit",file_change:"file-edit",write:"file-write",bash:"shell",powershell:"shell",command_execution:"shell",grep:"search",glob:"search",todowrite:"todo",update_plan:"todo",todo_write:"todo",report_intent:"metadata",finding_post:"finding",finding_list:"finding",task_list:"task",task_create:"task",task_show:"task",task_update:"task",task_start:"task",task_complete:"task",task_resume:"task",task_delete:"task",workpad_write:"workpad",workpad_read:"workpad",knowledge_search:"knowledge",knowledge_get_node:"knowledge",knowledge_create_node:"knowledge",ipc_spawn:"ipc",ipc_write:"ipc",ipc_close:"ipc",ipc_list_fds:"ipc",ipc_terminate:"ipc",ipc_create_stream:"ipc",ipc_attach:"ipc",toolsearch:"tool-search",agent:"agent",task:"agent",read_agent:"agent"};function QN(t){const s=Uo(t);return XN[s.toLowerCase()]??"generic"}const eC="_card_qkm9i_2",tC="_cardBlue_qkm9i_20",nC="_cardOrange_qkm9i_24",sC="_cardGreen_qkm9i_28",aC="_cardPurple_qkm9i_32",iC="_cardNeutral_qkm9i_36",oC="_cardRed_qkm9i_40",rC="_cardTeal_qkm9i_44",lC="_header_qkm9i_48",cC="_icon_qkm9i_55",dC="_toolName_qkm9i_64",uC="_fileName_qkm9i_71",fC="_badge_qkm9i_80",pC="_spacer_qkm9i_87",mC="_bodyToggle_qkm9i_91",hC="_chevron_qkm9i_109",gC="_chevronExpanded_qkm9i_115",vC="_pre_qkm9i_119",yC="_diffAdd_qkm9i_143",bC="_diffRemove_qkm9i_155",xC="_diffContext_qkm9i_167",_C="_diffHeader_qkm9i_176",kC="_diffLine_qkm9i_182",SC="_exitOk_qkm9i_188",TC="_exitError_qkm9i_194",wC="_exitPending_qkm9i_200",jC="_inProgress_qkm9i_228",NC="_metadata_qkm9i_232",CC="_metadataPrefix_qkm9i_239",M={card:eC,cardBlue:tC,cardOrange:nC,cardGreen:sC,cardPurple:aC,cardNeutral:iC,cardRed:oC,cardTeal:rC,header:lC,icon:cC,toolName:dC,fileName:uC,badge:fC,spacer:pC,bodyToggle:mC,chevron:hC,chevronExpanded:gC,pre:vC,diffAdd:yC,diffRemove:bC,diffContext:xC,diffHeader:_C,diffLine:kC,exitOk:SC,exitError:TC,exitPending:wC,inProgress:jC,metadata:NC,metadataPrefix:CC};function EC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.file_path=="string"?s.file_path:typeof s.path=="string"?s.path:""}function AC(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}const Zf=5;function by({tool:t,args:s,result:o,isError:r,writeVariant:c}){const[d,u]=y.useState(!1),p=EC(s),m=AC(p),g=o===void 0,v=r?M.cardRed:c?M.cardGreen:M.cardBlue,b=c?"var(--accent-green)":"var(--accent-blue)",x=c?i.jsx(_2,{size:tn}):i.jsx(S2,{size:tn}),S=c?"tool-card-file-write":"tool-card-file-read",k=(o==null?void 0:o.split(`
|
|
231
|
+
`))??[],w=k.length>Zf,N=d?k:k.slice(0,Zf);return i.jsxs("div",{className:`${M.card} ${v} ${g?M.inProgress:""}`,"data-testid":S,children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,children:x}),i.jsx("span",{className:M.toolName,style:{color:b},children:t}),m&&i.jsx("span",{className:M.fileName,title:p,children:m}),!g&&k.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,children:[k.length," lines"]})]})]}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&k.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-content",children:N.map((T,C)=>i.jsxs("span",{className:M.diffLine,children:[i.jsx("span",{style:{color:"var(--text-tertiary)",userSelect:"none",marginRight:"var(--space-sm)",display:"inline-block",width:"3ch",textAlign:"right"},children:C+1}),T]},C))}),w&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{u(T=>!T)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${d?M.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(sa,{size:lt})}),d?"collapse":`${k.length-Zf} more lines`]})]})]})}function DC(t){const s=t.split(`
|
|
232
|
+
`),o=[];for(const r of s)r.startsWith("diff --git")||r.startsWith("index ")||(r.startsWith("--- ")||r.startsWith("+++ "))&&!r.startsWith("---- ")&&!r.startsWith("++++ ")||(r.startsWith("@@")?o.push({type:"header",content:r}):r.startsWith("+")?o.push({type:"add",content:r.slice(1)}):r.startsWith("-")?o.push({type:"remove",content:r.slice(1)}):r.startsWith(" ")?o.push({type:"context",content:r.slice(1)}):r===""&&o.push({type:"context",content:""}));return o}function RC(t,s){const o=t.split(`
|
|
233
|
+
`),r=s.split(`
|
|
234
|
+
`),c=[];for(const d of o)c.push({type:"remove",content:d});for(const d of r)c.push({type:"add",content:d});return c}function MC(t){let s=0,o=0;for(const r of t)r.type==="add"&&s++,r.type==="remove"&&o++;return{added:s,removed:o}}function IC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.file_path=="string"&&s.file_path||typeof s.path=="string"&&s.path||""}function OC(t){if(t===void 0||typeof t!="object"||t===null)return;const s=t,o=(typeof s.old_string=="string"?s.old_string:void 0)??(typeof s.old_str=="string"?s.old_str:void 0),r=(typeof s.new_string=="string"?s.new_string:void 0)??(typeof s.new_str=="string"?s.new_str:void 0);if(o!==void 0&&r!==void 0)return{oldStr:o,newStr:r}}function BC(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}function LC(t,s){if(s){let r=s;if(s.trimStart().startsWith("{"))try{const c=JSON.parse(s);typeof c.detailedContent=="string"&&(r=c.detailedContent)}catch{}if(r.includes("@@")||r.startsWith("diff ")){const c=DC(r);if(c.length>0)return c}}const o=OC(t);if(o)return RC(o.oldStr,o.newStr)}const Kf=5;function zC({tool:t,args:s,result:o,isError:r,detailedResult:c}){const[d,u]=y.useState(!1),p=IC(s),m=BC(p),g=o===void 0,v=LC(s,c),b=v?MC(v):null,x=((v==null?void 0:v.length)??0)>Kf,S=d?v:v==null?void 0:v.slice(0,Kf);return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardOrange} ${g?M.inProgress:""}`,"data-testid":"tool-card-file-edit",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,children:i.jsx(K2,{size:tn})}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-yellow)"},children:t}),m&&i.jsx("span",{className:M.fileName,title:p,children:m}),b&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-diff-stats",children:[i.jsxs("span",{style:{color:"var(--accent-green)"},children:["+",b.added]})," ",i.jsxs("span",{style:{color:"var(--accent-red)"},children:["−",b.removed]})]})]})]}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&S&&S.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-diff",children:S.map((k,w)=>{let N=M.diffContext;return k.type==="add"&&(N=M.diffAdd),k.type==="remove"&&(N=M.diffRemove),k.type==="header"&&(N=M.diffHeader),i.jsx("span",{className:`${M.diffLine} ${N}`,children:k.content},w)})}),x&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{u(k=>!k)},"aria-expanded":d,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${d?M.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(sa,{size:lt})}),d?"collapse":`${((v==null?void 0:v.length)??0)-Kf} more lines`]})]}),!r&&!v&&!g&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-content",children:o})]})}const $C=/^\[exit (\d+)\]\s*/;function UC(t){const s=$C.exec(t);return s?{exitCode:Number(s[1]),output:t.slice(s[0].length)}:{exitCode:void 0,output:t}}function PC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.command=="string"?s.command:""}function HC(t){const s=/pwsh(?:\.exe)?["']?\s+-Command\s+'([^']*)'\s*$/i.exec(t);if(s)return s[1];const o=/pwsh(?:\.exe)?["']?\s+-Command\s+"([^"]*)"\s*$/i.exec(t);return o?o[1]:t}const Yf=3;function VC({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=PC(s),p=HC(u),m=o===void 0,g=o?UC(o):null,v=(g==null?void 0:g.output.split(`
|
|
235
|
+
`))??[],b=v.length>Yf,x=c?v:v.slice(0,Yf),S=g==null?void 0:g.exitCode,k=r||S!==void 0&&S!==0;return i.jsxs("div",{className:`${M.card} ${k?M.cardRed:M.cardNeutral}`,"data-testid":"tool-card-shell",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,style:{color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontWeight:"bold"},children:"$"}),i.jsx("span",{className:M.fileName,style:{flex:1,color:"var(--text-primary)"},title:u!==p?u:void 0,"data-testid":"tool-card-command",children:p}),S!==void 0&&i.jsxs("span",{className:S===0?M.exitOk:M.exitError,"data-testid":"tool-card-exit-code",children:[S===0?i.jsx(Ei,{size:lt,"aria-hidden":"true"}):i.jsx(Ha,{size:lt,"aria-hidden":"true"})," ","exit ",S]}),m&&i.jsx("span",{className:M.exitPending,"data-testid":"tool-card-pending",children:i.jsx(B2,{size:lt,"aria-hidden":"true"})})]}),!m&&g&&g.output.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-output",children:x.join(`
|
|
236
|
+
`)}),b&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(w=>!w)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(sa,{size:lt})}),c?"collapse":`${v.length-Yf} more lines`]})]})]})}function qC(t){if(t==null||typeof t!="object")return{pattern:"",path:""};const s=t,o=typeof s.pattern=="string"?s.pattern:"",r=typeof s.path=="string"?s.path:"";return{pattern:o,path:r}}const Jf=5;function GC({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{pattern:u,path:p}=qC(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
237
|
+
`).filter(x=>x.length>0))??[],v=g.length>Jf,b=c?g:g.slice(0,Jf);return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardPurple} ${m?M.inProgress:""}`,"data-testid":"tool-card-search",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,children:i.jsx(vx,{size:tn})}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:t}),u&&i.jsxs("span",{className:M.fileName,"data-testid":"tool-card-pattern",children:['"',u,'"']}),p&&i.jsxs("span",{className:M.fileName,style:{flexShrink:1},"data-testid":"tool-card-search-path",children:["in ",p]}),!m&&!r&&g.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-match-count",children:[g.length," ",g.length===1?"match":"matches"]})]})]}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&b.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-results",children:b.join(`
|
|
238
|
+
`)}),v&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(sa,{size:lt})}),c?"collapse":`${g.length-Jf} more matches`]})]})]})}const FC="_progressBar_14f5c_1",ZC="_progressFill_14f5c_9",KC="_activeTask_14f5c_16",YC="_activeIcon_14f5c_27",JC="_todoPulse_14f5c_1",WC="_activeText_14f5c_34",XC="_checklist_14f5c_48",QC="_item_14f5c_55",eE="_itemIcon_14f5c_65",tE="_itemText_14f5c_73",nE="_pending_14f5c_78",sE="_in_progress_14f5c_85",aE="_completed_14f5c_97",iE="_emptyMessage_14f5c_108",as={progressBar:FC,progressFill:ZC,activeTask:KC,activeIcon:YC,todoPulse:JC,activeText:WC,checklist:XC,item:QC,itemIcon:eE,itemText:tE,pending:nE,in_progress:sE,completed:aE,emptyMessage:iE},oE=/^[-*]\s*\[([ xX~!/])\]\s*(.+)$/;function rE(t){if(t===void 0||typeof t!="object"||t===null)return[];const s=t;return Array.isArray(s.todos)?s.todos.filter(o=>typeof o=="object"&&o!==null&&typeof o.content=="string"&&typeof o.status=="string").map(o=>({content:o.content,activeForm:typeof o.activeForm=="string"?o.activeForm:void 0,status:xy(o.status)})):Array.isArray(s.plan)?s.plan.filter(o=>typeof o=="object"&&o!==null&&typeof o.step=="string"&&typeof o.status=="string").map(o=>({content:o.step,status:xy(o.status)})):typeof s.content=="string"?lE(s.content):[]}function xy(t){switch(t.toLowerCase()){case"completed":case"done":case"complete":return"completed";case"in_progress":case"in-progress":case"working":case"active":return"in_progress";default:return"pending"}}function lE(t){const s=t.split(`
|
|
239
|
+
`),o=[];for(const r of s){const c=oE.exec(r.trim());if(c){const d=c[1],u=c[2].trim();let p="pending";d==="x"||d==="X"?p="completed":(d==="~"||d==="/"||d==="!")&&(p="in_progress"),o.push({content:u,status:p})}}return o}function cE(t){switch(t){case"completed":return i.jsx(Ei,{size:lt});case"in_progress":return i.jsx(La,{size:lt,fill:"currentColor"});default:return i.jsx(La,{size:lt})}}function dE({args:t}){const s=rE(t),o=s.filter(d=>d.status==="completed").length,r=s.find(d=>d.status==="in_progress"),c=s.length===0;return i.jsxs("div",{className:`${M.card} ${M.cardBlue}`,"data-testid":"tool-card-todo",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,children:i.jsx(R2,{size:tn})}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-blue)"},children:c?"Todos cleared":"Todos"}),!c&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-todo-progress",children:[o,"/",s.length]})]})]}),!c&&i.jsx("div",{className:as.progressBar,"data-testid":"tool-card-todo-bar",children:i.jsx("div",{className:as.progressFill,style:{width:`${o/s.length*100}%`}})}),r&&i.jsxs("div",{className:as.activeTask,"data-testid":"tool-card-todo-active",children:[i.jsx("span",{className:as.activeIcon,children:i.jsx(La,{size:lt,fill:"currentColor"})}),i.jsx("span",{className:as.activeText,children:r.activeForm||r.content})]}),!c&&i.jsx("div",{className:as.checklist,"data-testid":"tool-card-todo-list",children:s.map((d,u)=>i.jsxs("div",{className:`${as.item} ${as[d.status]}`,"data-testid":"tool-card-todo-item",children:[i.jsx("span",{className:as.itemIcon,children:cE(d.status)}),i.jsx("span",{className:as.itemText,children:d.content})]},u))}),c&&i.jsx("div",{className:as.emptyMessage,children:"All items completed and cleared."})]})}function uE(t,s){if(s==null||typeof s!="object")return"";const o=s;if(typeof o.intent=="string")return o.intent;for(const r of Object.values(o))if(typeof r=="string")return r;return t}function fE({tool:t,args:s}){const o=uE(t,s);return i.jsxs("div",{className:M.metadata,"data-testid":"tool-card-metadata",children:[i.jsx("span",{className:M.metadataPrefix,children:i.jsx(b2,{size:lt})}),o]})}function pE(t){if(t==null||typeof t!="object")return{};const s=t;return{title:typeof s.title=="string"?s.title:void 0,category:typeof s.category=="string"?s.category:void 0,tags:Array.isArray(s.tags)?s.tags:void 0}}function mE(t){if(!t)return{};try{const s=JSON.parse(t);if(Array.isArray(s))return{list:s.filter(o=>o!==null&&typeof o=="object")};if(typeof s=="object"&&s!==null)return{single:s}}catch{}return{}}const Wf=5,Xf=5;function hE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=pE(s),m=o===void 0,{single:g,list:v}=mE(o),b=(g==null?void 0:g.title)??p.title,x=v?void 0:(g==null?void 0:g.category)??p.category,S=v?void 0:(g==null?void 0:g.tags)??p.tags;return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardPurple} ${m?M.inProgress:""}`,"data-testid":"tool-card-finding",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,"aria-hidden":"true",children:"💡"}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),b&&i.jsxs("span",{className:M.fileName,"data-testid":"tool-card-finding-title",children:['"',b,'"']}),x&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsx("span",{className:M.badge,"data-testid":"tool-card-finding-category",children:x})]}),v&&!x&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-finding-count",children:[v.length," ",v.length===1?"finding":"findings"]})]})]}),S&&S.length>0&&i.jsx("div",{className:M.pre,style:{padding:"4px 8px",whiteSpace:"normal"},"data-testid":"tool-card-finding-tags",children:S.map((k,w)=>i.jsxs("span",{style:{display:"inline-block",marginRight:"6px",opacity:.7,fontSize:"0.85em"},children:["#",k]},w))}),m&&!b&&s!==null&&s!==void 0&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&(g==null?void 0:g.content)&&i.jsx(i.Fragment,{children:(()=>{const k=g.content.split(`
|
|
240
|
+
`),w=k.length>Xf,N=c?g.content:k.slice(0,Xf).join(`
|
|
241
|
+
`);return i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-finding-content",children:N}),w&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(T=>!T)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${k.length-Xf} more lines`]})]})})()}),!r&&v&&v.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-finding-list",children:(c?v:v.slice(0,Wf)).map((k,w)=>`${k.category?`[${k.category}] `:""}${k.title??k.id??`Finding ${w+1}`}`).join(`
|
|
242
|
+
`)}),v.length>Wf&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(k=>!k)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-Wf} more findings`]})]})]})}function gE(t){if(t==null||typeof t!="object")return{};const s=t;return{taskId:typeof s.taskId=="string"?s.taskId:void 0,title:typeof s.title=="string"?s.title:void 0,status:typeof s.status=="string"?s.status:void 0}}function vE(t){if(!t)return{};try{const s=JSON.parse(t);if(Array.isArray(s))return{list:s.filter(o=>o!==null&&typeof o=="object")};if(typeof s=="object"&&s!==null){const o=s;return typeof o.sessionId=="string"?{sessionId:o.sessionId,single:o}:{single:o}}}catch{}return{}}function _y(t){switch(t){case"complete":case"completed":return"✓";case"working":case"in_progress":return"●";case"paused":return"⏸";case"failed":return"✗";default:return"○"}}function yE(t){switch(t){case"complete":case"completed":return"var(--accent-green, #4ade80)";case"working":case"in_progress":return"var(--accent-blue, #60a5fa)";case"failed":return"var(--accent-red, #f87171)";case"paused":return"var(--text-tertiary, #888)";default:return"var(--text-secondary, #aaa)"}}const Qf=5;function bE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=gE(s),m=o===void 0,{single:g,list:v,sessionId:b}=vE(o),x=(g==null?void 0:g.title)??p.title,S=(g==null?void 0:g.status)??p.status;return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardBlue} ${m?M.inProgress:""}`,"data-testid":"tool-card-task",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,"aria-hidden":"true",children:"📋"}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-blue)"},children:u}),x&&i.jsxs("span",{className:M.fileName,"data-testid":"tool-card-task-title",children:['"',x,'"']}),!x&&p.taskId&&i.jsx("span",{className:M.fileName,"data-testid":"tool-card-task-id",children:p.taskId}),S&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,style:{color:yE(S)},"data-testid":"tool-card-task-status",children:[_y(S)," ",S]})]}),v&&!S&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-task-count",children:[v.length," ",v.length===1?"task":"tasks"]})]})]}),m&&!x&&!p.taskId&&s!==null&&s!==void 0&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&b&&i.jsxs("div",{className:M.pre,style:{padding:"4px 8px",fontSize:"0.85em"},"data-testid":"tool-card-task-session",children:["session: ",b]}),!r&&g&&!v&&!b&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-task-detail",children:[g.id?`id: ${g.id}`:null,g.status?`status: ${g.status}`:null,g.branch?`branch: ${g.branch}`:null,g.latestSessionId?`session: ${g.latestSessionId}`:null].filter(Boolean).join(`
|
|
243
|
+
`)}),!r&&v&&v.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-task-list",children:(c?v:v.slice(0,Qf)).map(k=>{const w=_y(k.status),N=k.title??k.id??"untitled";return`${w} ${N}`}).join(`
|
|
244
|
+
`)}),v.length>Qf&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(k=>!k)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${v.length-Qf} more tasks`]})]})]})}function xE(t){if(t==null||typeof t!="object")return{};const s=t;return{status:typeof s.status=="string"?s.status:void 0,summary:typeof s.summary=="string"?s.summary:void 0}}function _E(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s,r=typeof o.workpad=="object"&&o.workpad!==null?o.workpad:o;return{status:typeof r.status=="string"?r.status:void 0,summary:typeof r.summary=="string"?r.summary:void 0,extra:typeof r.extra=="object"&&r.extra!==null?r.extra:void 0}}catch{}return{}}function kE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=xE(s),m=o===void 0,g=_E(o),v=g.status??p.status,b=g.summary??p.summary;return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardGreen} ${m?M.inProgress:""}`,"data-testid":"tool-card-workpad",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,"aria-hidden":"true",children:"📓"}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-green, #4ade80)"},children:u}),v&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsx("span",{className:M.badge,"data-testid":"tool-card-workpad-status",children:v})]})]}),b&&i.jsx("pre",{className:M.pre,style:{whiteSpace:"pre-wrap"},"data-testid":"tool-card-workpad-summary",children:b}),m&&!b&&s!==null&&s!==void 0&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&!b&&!v&&!g.extra&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-result",children:o}),!r&&g.extra&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,children:"▸"}),c?"collapse":"extra data"]}),c&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-workpad-extra",children:JSON.stringify(g.extra,null,2)})]})]})}function SE(t){if(t==null||typeof t!="object")return{};const s=t;return{query:typeof s.query=="string"?s.query:void 0,id:typeof s.id=="string"?s.id:void 0}}function TE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s;if(Array.isArray(o.results))return{results:o.results.filter(r=>r!==null&&typeof r=="object")};if(typeof o.node=="object"&&o.node!==null){const r=Array.isArray(o.edges)?o.edges.length:0;return{node:o.node,edgeCount:r}}if(typeof o.id=="string")return{node:o}}catch{}return{}}const ep=5;function wE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=SE(s),m=o===void 0,g=TE(o);return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardPurple} ${m?M.inProgress:""}`,"data-testid":"tool-card-knowledge",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,"aria-hidden":"true",children:"🧠"}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-purple, #a78bfa)"},children:u}),p.query&&i.jsxs("span",{className:M.fileName,"data-testid":"tool-card-knowledge-query",children:['"',p.query,'"']}),p.id&&!p.query&&i.jsx("span",{className:M.fileName,"data-testid":"tool-card-knowledge-id",children:p.id}),g.results&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-knowledge-count",children:[g.results.length," ",g.results.length===1?"result":"results"]})]}),g.node&&g.edgeCount!==void 0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-knowledge-edges",children:[g.edgeCount," ",g.edgeCount===1?"edge":"edges"]})]})]}),m&&s!==null&&s!==void 0&&!p.query&&!p.id&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&g.results&&g.results.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-knowledge-results",children:(c?g.results:g.results.slice(0,ep)).map(v=>{var S,k,w;const b=((S=v.node)==null?void 0:S.title)??((k=v.node)==null?void 0:k.label)??((w=v.node)==null?void 0:w.id)??"node",x=v.score!==void 0?` (${(v.score*100).toFixed(0)}%)`:"";return`${b}${x}`}).join(`
|
|
245
|
+
`)}),g.results.length>ep&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(v=>!v)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.results.length-ep} more results`]})]}),!r&&g.node&&!g.results&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-knowledge-node",children:[g.node.id?`id: ${g.node.id}`:null,g.node.title?`title: ${g.node.title}`:null,g.node.category?`category: ${g.node.category}`:null,g.node.kind?`kind: ${g.node.kind}`:null,g.node.content?`content: ${g.node.content.length>100?g.node.content.slice(0,100)+"...":g.node.content}`:null].filter(Boolean).join(`
|
|
246
|
+
`)})]})}function jE(t){if(t==null||typeof t!="object")return{};const s=t;return{fd:typeof s.fd=="number"?s.fd:void 0,pipe:typeof s.pipe=="string"?s.pipe:void 0,prompt:typeof s.prompt=="string"?s.prompt:void 0,name:typeof s.name=="string"?s.name:void 0,message:typeof s.message=="string"?s.message:void 0}}function NE(t){if(!t)return{};try{const s=JSON.parse(t);if(typeof s!="object"||s===null)return{};const o=s;return{sessionId:typeof o.sessionId=="string"?o.sessionId:void 0,fd:typeof o.fd=="number"?o.fd:void 0,fds:Array.isArray(o.fds)?o.fds.filter(r=>r!==null&&typeof r=="object"):void 0,success:typeof o.success=="boolean"?o.success:void 0,output:typeof o.output=="string"?o.output:void 0}}catch{}return{}}function CE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Uo(t),p=jE(s),m=o===void 0,g=NE(o);let v="";p.pipe?v=`[${p.pipe}]`:p.fd!==void 0?v=`fd:${p.fd}`:p.name&&(v=`"${p.name}"`);const b=p.prompt?p.prompt.length>60?`${p.prompt.slice(0,60)}...`:p.prompt:void 0;return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardOrange} ${m?M.inProgress:""}`,"data-testid":"tool-card-ipc",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,"aria-hidden":"true",children:"🔀"}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-yellow, #fbbf24)"},children:u}),v&&i.jsx("span",{className:M.fileName,"data-testid":"tool-card-ipc-info",children:v}),b&&i.jsx("span",{className:M.fileName,title:p.prompt,"data-testid":"tool-card-ipc-prompt",children:b}),g.fds&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-ipc-fd-count",children:[g.fds.length," ",g.fds.length===1?"fd":"fds"]})]}),g.success!==void 0&&!g.fds&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsx("span",{className:M.badge,style:{color:g.success?"var(--accent-green, #4ade80)":"var(--accent-red, #f87171)"},"data-testid":"tool-card-ipc-success",children:g.success?"✓ ok":"✗ failed"})]})]}),m&&!b&&!v&&s!==null&&s!==void 0&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-args",children:JSON.stringify(s,null,2)}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&g.sessionId&&i.jsxs("div",{className:M.pre,style:{padding:"4px 8px",fontSize:"0.85em"},"data-testid":"tool-card-ipc-session",children:["session: ",g.sessionId,g.fd!==void 0&&` | fd: ${g.fd}`]}),!r&&g.output&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-ipc-output",children:g.output}),!r&&g.fds&&g.fds.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-ipc-fds",children:(c?g.fds:g.fds.slice(0,5)).map(x=>{const S=[`fd:${x.fd??"?"}`,x.permission??"",x.deliveryMode??""];return x.streamName&&S.push(x.streamName),x.owned&&S.push("(owned)"),S.filter(Boolean).join(" ")}).join(`
|
|
247
|
+
`)}),g.fds.length>5&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(x=>!x)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${g.fds.length-5} more fds`]})]})]})}function EE(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.query=="string"?s.query:""}const tp=8;function AE({args:t,result:s,isError:o}){const[r,c]=y.useState(!1),d=EE(t),u=s===void 0,p=(s==null?void 0:s.split(`
|
|
248
|
+
`))??[],m=p.length>tp,g=r?s:p.slice(0,tp).join(`
|
|
249
|
+
`);return i.jsxs("div",{className:`${M.card} ${o?M.cardRed:M.cardNeutral} ${u?M.inProgress:""}`,"data-testid":"tool-card-tool-search",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,"aria-hidden":"true",children:"🔧"}),i.jsx("span",{className:M.toolName,children:"ToolSearch"}),d&&i.jsxs("span",{className:M.fileName,"data-testid":"tool-card-tool-search-query",children:['"',d,'"']}),!u&&!o&&s&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:M.spacer}),i.jsxs("span",{className:M.badge,"data-testid":"tool-card-tool-search-count",children:[p.length," lines"]})]})]}),u&&!d&&t!==null&&t!==void 0&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-args",children:JSON.stringify(t,null,2)}),o&&s&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:s}),!o&&!u&&s&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-tool-search-result",children:g}),m&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{c(v=>!v)},"aria-expanded":r,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${r?M.chevronExpanded:""}`,children:"▸"}),r?"collapse":`${p.length-tp} more lines`]})]})]})}function DE(t){const s=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(t);return s?{display:`${s[1]} / ${s[2]}`,isMcp:!0}:{display:t,isMcp:!1}}function RE(t){if(t==null)return"";if(typeof t!="object")return String(t);const s=t;if(typeof s.command=="string")return s.command;if(typeof s.file_path=="string")return s.file_path;if(typeof s.path=="string")return s.path;if(typeof s.query=="string")return s.query;if(typeof s.url=="string")return s.url;try{const o=JSON.stringify(t);return o.length>120?`${o.slice(0,120)}…`:o}catch{return""}}const np=5;function ME({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{display:u}=DE(t),p=RE(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
250
|
+
`))??[],v=g.length>np,b=c?o:g.slice(0,np).join(`
|
|
251
|
+
`);let x="";if(s!=null)try{x=JSON.stringify(s,null,2)}catch{x=String(s)}return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardBlue} ${m?M.inProgress:""}`,"data-testid":"tool-card-generic",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,children:i.jsx(h2,{size:tn,"aria-hidden":"true"})}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-blue)"},children:u}),p&&i.jsx("span",{className:M.fileName,children:p})]}),m&&x&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-args",children:x}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&!m&&o&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-result",children:b}),v&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(S=>!S)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,"aria-hidden":"true",children:i.jsx(sa,{size:lt})}),c?"collapse":`${g.length-np} more lines`]})]})]})}const IE="_badgePill_o7eqc_1",OE="_modelBadge_o7eqc_14",BE="_backgroundBadge_o7eqc_26",LE="_backgroundDot_o7eqc_36",zE="_backgroundDotPulsing_o7eqc_41",$E="_description_o7eqc_55",UE="_statusLine_o7eqc_62",PE="_statusCompleted_o7eqc_72",HE="_statusRunning_o7eqc_77",VE="_statusError_o7eqc_83",qE="_promptToggle_o7eqc_88",is={badgePill:IE,modelBadge:OE,backgroundBadge:BE,backgroundDot:LE,backgroundDotPulsing:zE,description:$E,statusLine:UE,statusCompleted:PE,statusRunning:HE,statusError:VE,promptToggle:qE};function GE(t,s){if(s==null||typeof s!="object")return{};const o=s;return t.toLowerCase()==="read_agent"?{agentId:typeof o.agent_id=="string"?o.agent_id:void 0,isPoll:!0}:typeof o.agent_type=="string"||typeof o.name=="string"?{agentType:typeof o.agent_type=="string"?o.agent_type:void 0,description:typeof o.description=="string"?o.description:void 0,prompt:typeof o.prompt=="string"?o.prompt:void 0,isBackground:o.mode==="background",agentName:typeof o.name=="string"?o.name:void 0}:{agentType:typeof o.subagent_type=="string"?o.subagent_type:void 0,description:typeof o.description=="string"?o.description:void 0,prompt:typeof o.prompt=="string"?o.prompt:void 0,isBackground:o.run_in_background===!0,model:typeof o.model=="string"?o.model:void 0,isResume:typeof o.resume=="string"&&o.resume.length>0}}const FE=/^Agent\s+(completed|running|failed|error)\.\s*agent_id:\s*(\S+),?\s*([^\n]*)(?:\n\n([\s\S]*))?$/i;function ZE(t){const s=FE.exec(t);if(!s)return;const o=s[4];return{status:s[1].toLowerCase(),agentId:s[2].replace(/,$/,""),metadata:s[3].trim(),content:o?o.trim():void 0}}const sp=5;function KE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),[u,p]=y.useState(!1),m=GE(t,s),g=o===void 0,v=m.isPoll&&o?ZE(o):void 0,b=(v==null?void 0:v.content)??o,x=(b==null?void 0:b.split(`
|
|
252
|
+
`))??[],S=x.length>sp,k=c?b:x.slice(0,sp).join(`
|
|
253
|
+
`),w=m.isPoll?"Subagent":"Agent";return i.jsxs("div",{className:`${M.card} ${r?M.cardRed:M.cardTeal} ${g?M.inProgress:""}`,"data-testid":"tool-card-agent",children:[i.jsxs("div",{className:M.header,children:[i.jsx("span",{className:M.icon,style:{color:"var(--accent-teal, #2dd4bf)"},children:"▶"}),i.jsx("span",{className:M.toolName,style:{color:"var(--accent-teal, #2dd4bf)"},children:w}),m.agentType&&i.jsx("span",{className:is.badgePill,"data-testid":"tool-card-agent-type",children:m.agentType}),m.model&&i.jsx("span",{className:is.modelBadge,"data-testid":"tool-card-agent-model",children:m.model}),m.isBackground&&i.jsxs("span",{className:is.backgroundBadge,"data-testid":"tool-card-agent-background",children:[i.jsx("span",{className:g?is.backgroundDotPulsing:is.backgroundDot,children:"●"}),"BG"]}),m.agentName&&i.jsx("span",{className:M.fileName,"data-testid":"tool-card-agent-name",children:m.agentName}),m.agentId&&i.jsx("span",{className:M.fileName,"data-testid":"tool-card-agent-id",children:m.agentId}),i.jsx("span",{className:M.spacer}),g&&!m.isBackground&&i.jsx("span",{className:M.exitPending,"data-testid":"tool-card-pending",children:"●"})]}),m.description&&i.jsx("div",{className:is.description,"data-testid":"tool-card-agent-description",children:m.isResume?`Resuming: ${m.description}`:m.description}),v&&i.jsxs("div",{className:is.statusLine,"data-testid":"tool-card-agent-status",children:[i.jsx("span",{className:v.status==="completed"?is.statusCompleted:v.status==="running"?is.statusRunning:is.statusError,children:v.status}),v.metadata&&i.jsx("span",{children:v.metadata})]}),m.prompt&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:is.promptToggle,onClick:()=>{p(N=>!N)},"aria-expanded":u,"data-testid":"tool-card-prompt-toggle",children:[i.jsx("span",{className:`${M.chevron} ${u?M.chevronExpanded:""}`,children:"▸"}),"prompt"]}),u&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-prompt",children:m.prompt})]}),r&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-error",children:o}),!r&&!g&&b&&i.jsxs(i.Fragment,{children:[i.jsx("pre",{className:M.pre,"data-testid":"tool-card-result",children:k}),S&&i.jsxs("button",{type:"button",className:M.bodyToggle,onClick:()=>{d(N=>!N)},"aria-expanded":c,"data-testid":"tool-card-toggle",children:[i.jsx("span",{className:`${M.chevron} ${c?M.chevronExpanded:""}`,children:"▸"}),c?"collapse":`${x.length-sp} more lines`]})]})]})}function ap(t){switch(QN(t.tool)){case"file-read":return i.jsx(by,{...t});case"file-edit":return i.jsx(zC,{...t});case"file-write":return i.jsx(by,{...t,writeVariant:!0});case"shell":return i.jsx(VC,{...t});case"search":return i.jsx(GC,{...t});case"todo":return i.jsx(dE,{...t});case"metadata":return i.jsx(fE,{...t});case"finding":return i.jsx(hE,{...t});case"task":return i.jsx(bE,{...t});case"workpad":return i.jsx(kE,{...t});case"knowledge":return i.jsx(wE,{...t});case"ipc":return i.jsx(CE,{...t});case"tool-search":return i.jsx(AE,{...t});case"agent":return i.jsx(KE,{...t});default:return i.jsx(ME,{...t})}}const YE="_systemContextEvent_hmqlm_1",JE="_systemContextHeader_hmqlm_7",WE="_systemContextBadge_hmqlm_28",XE="_systemContextToggle_hmqlm_37",QE="_systemContextPre_hmqlm_43",eA="_systemContextEllipsis_hmqlm_54",tA="_systemEvent_hmqlm_58",nA="_systemTimestamp_hmqlm_65",sA="_textEvent_hmqlm_69",aA="_codeBlockWrapper_hmqlm_156",iA="_codeBlockCopyButton_hmqlm_159",oA="_errorEvent_hmqlm_163",rA="_statusEvent_hmqlm_171",lA="_userInputEvent_hmqlm_180",cA="_userInputContent_hmqlm_186",dA="_signalEvent_hmqlm_203",uA="_signalBadge_hmqlm_214",fA="_signalContent_hmqlm_223",pA="_usageEvent_hmqlm_228",mA="_usageBadge_hmqlm_235",hA="_defaultEvent_hmqlm_244",$t={systemContextEvent:YE,systemContextHeader:JE,systemContextBadge:WE,systemContextToggle:XE,systemContextPre:QE,systemContextEllipsis:eA,systemEvent:tA,systemTimestamp:nA,textEvent:sA,codeBlockWrapper:aA,codeBlockCopyButton:iA,errorEvent:oA,statusEvent:rA,userInputEvent:lA,userInputContent:cA,signalEvent:dA,signalBadge:uA,signalContent:fA,usageEvent:pA,usageBadge:mA,defaultEvent:hA},ky=3;function gA({content:t}){const[s,o]=y.useState(!1),r=t.split(`
|
|
254
|
+
`),c=r.length>ky,d=s?t:r.slice(0,ky).join(`
|
|
255
|
+
`);return i.jsxs("div",{className:$t.systemContextEvent,"data-testid":"system-context-event",children:[i.jsxs("button",{type:"button",className:$t.systemContextHeader,onClick:()=>{o(u=>!u)},"aria-expanded":s,children:[i.jsx("span",{className:$t.systemContextBadge,children:"SYSTEM PROMPT"}),c&&i.jsx("span",{className:$t.systemContextToggle,"aria-hidden":"true",children:s?i.jsx(hx,{size:lt}):i.jsx(sa,{size:lt})})]}),i.jsxs("pre",{className:$t.systemContextPre,children:[d,!s&&c&&i.jsx("span",{className:$t.systemContextEllipsis,children:"…"})]})]})}function vA({time:t,content:s}){return i.jsxs("div",{className:$t.systemEvent,children:[i.jsxs("span",{className:$t.systemTimestamp,children:["[",t,"]"]})," ",s]})}function Op(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map(Op).join(""):t!=null&&typeof t=="object"&&"props"in t?Op(t.props.children):""}function yA({children:t,node:s,...o}){const r=Op(t);return i.jsxs("div",{className:$t.codeBlockWrapper,children:[i.jsx("pre",{...o,children:t}),i.jsx(DN,{text:r,"data-testid":"copy-code-block",className:$t.codeBlockCopyButton})]})}const bA={pre:yA};function xA({content:t}){return i.jsx("div",{className:$t.textEvent,children:i.jsx(hd,{remarkPlugins:[gd],rehypePlugins:[WN],components:bA,children:t})})}function _A({content:t}){return i.jsxs("div",{className:$t.errorEvent,children:["Error: ",t]})}function kA({content:t}){return i.jsxs("div",{className:$t.statusEvent,children:["--- ",t," ---"]})}function SA({content:t}){return i.jsx("div",{className:$t.userInputEvent,children:i.jsx("span",{className:$t.userInputContent,children:t})})}function TA({content:t}){return i.jsxs("div",{className:$t.signalEvent,"data-testid":"signal-event",children:[i.jsx("span",{className:$t.signalBadge,children:"SIGNAL"}),i.jsx("span",{className:$t.signalContent,children:t})]})}function wA({content:t}){let s=t;try{const o=JSON.parse(t),r=Number(o.input_tokens)||0,c=Number(o.output_tokens)||0,d=Mo(r+c),u=Ss(Number(o.cost_millicents)||0);s=`${d} tokens · ${u}`}catch{}return i.jsx("div",{className:$t.usageEvent,"data-testid":"usage-event",children:i.jsx("span",{className:$t.usageBadge,children:s})})}function jA({content:t}){return i.jsx("div",{className:$t.defaultEvent,children:t})}function NA({event:t,toolUseCtx:s,settled:o}){const r=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"system":{if(t.raw)try{if(JSON.parse(t.raw).systemContext===!0)return i.jsx(gA,{content:t.content})}catch{}return i.jsx(vA,{time:r,content:t.content})}case"text":case"output":return i.jsx(xA,{content:t.content});case"tool_use":{let c="",d={};try{const u=JSON.parse(t.content);c=u.tool||"",d=u.args}catch{}return i.jsx(ap,{tool:c,args:d,result:o?"":void 0})}case"tool_result":{let c=!1;if(t.raw)try{c=JSON.parse(t.raw).is_error===!0}catch{}let d=t.content;if(t.content.trimStart().startsWith("{"))try{const u=JSON.parse(t.content);typeof u.content=="string"&&(d=u.content)}catch{}return s?i.jsx(ap,{tool:s.tool,args:s.args,result:d,isError:c,detailedResult:s.detailedResult}):i.jsx(ap,{tool:"Tool output",args:void 0,result:d,isError:c})}case"error":return i.jsx(_A,{content:t.content});case"status":return i.jsx(kA,{content:t.content});case"user_input":return i.jsx(SA,{content:t.content});case"signal":return i.jsx(TA,{content:t.content});case"usage":return i.jsx(wA,{content:t.content});default:return i.jsx(jA,{content:t.content})}}const vm=y.createContext({});function ym(t){const s=y.useRef(null);return s.current===null&&(s.current=t()),s.current}const kd=y.createContext(null),bm=y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class CA extends y.Component{getSnapshotBeforeUpdate(s){const o=this.props.childRef.current;if(o&&s.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=o.offsetHeight||0,r.width=o.offsetWidth||0,r.top=o.offsetTop,r.left=o.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function EA({children:t,isPresent:s}){const o=y.useId(),r=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0}),{nonce:d}=y.useContext(bm);return y.useInsertionEffect(()=>{const{width:u,height:p,top:m,left:g}=c.current;if(s||!r.current||!u||!p)return;r.current.dataset.motionPopId=o;const v=document.createElement("style");return d&&(v.nonce=d),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
|
|
256
|
+
[data-motion-pop-id="${o}"] {
|
|
257
|
+
position: absolute !important;
|
|
258
|
+
width: ${u}px !important;
|
|
259
|
+
height: ${p}px !important;
|
|
260
|
+
top: ${m}px !important;
|
|
261
|
+
left: ${g}px !important;
|
|
262
|
+
}
|
|
263
|
+
`),()=>{document.head.removeChild(v)}},[s]),i.jsx(CA,{isPresent:s,childRef:r,sizeRef:c,children:y.cloneElement(t,{ref:r})})}const AA=({children:t,initial:s,isPresent:o,onExitComplete:r,custom:c,presenceAffectsLayout:d,mode:u})=>{const p=ym(DA),m=y.useId(),g=y.useCallback(b=>{p.set(b,!0);for(const x of p.values())if(!x)return;r&&r()},[p,r]),v=y.useMemo(()=>({id:m,initial:s,isPresent:o,custom:c,onExitComplete:g,register:b=>(p.set(b,!1),()=>p.delete(b))}),d?[Math.random(),g]:[o,g]);return y.useMemo(()=>{p.forEach((b,x)=>p.set(x,!1))},[o]),y.useEffect(()=>{!o&&!p.size&&r&&r()},[o]),u==="popLayout"&&(t=i.jsx(EA,{isPresent:o,children:t})),i.jsx(kd.Provider,{value:v,children:t})};function DA(){return new Map}function Px(t=!0){const s=y.useContext(kd);if(s===null)return[!0,null];const{isPresent:o,onExitComplete:r,register:c}=s,d=y.useId();y.useEffect(()=>{t&&c(d)},[t]);const u=y.useCallback(()=>t&&r&&r(d),[d,r,t]);return!o&&r?[!1,u]:[!0]}const Rc=t=>t.key||"";function Sy(t){const s=[];return y.Children.forEach(t,o=>{y.isValidElement(o)&&s.push(o)}),s}const xm=typeof window<"u",Hx=xm?y.useLayoutEffect:y.useEffect,us=({children:t,custom:s,initial:o=!0,onExitComplete:r,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1})=>{const[p,m]=Px(u),g=y.useMemo(()=>Sy(t),[t]),v=u&&!p?[]:g.map(Rc),b=y.useRef(!0),x=y.useRef(g),S=ym(()=>new Map),[k,w]=y.useState(g),[N,T]=y.useState(g);Hx(()=>{b.current=!1,x.current=g;for(let B=0;B<N.length;B++){const E=Rc(N[B]);v.includes(E)?S.delete(E):S.get(E)!==!0&&S.set(E,!1)}},[N,v.length,v.join("-")]);const C=[];if(g!==k){let B=[...g];for(let E=0;E<N.length;E++){const A=N[E],P=Rc(A);v.includes(P)||(B.splice(E,0,A),C.push(A))}d==="wait"&&C.length&&(B=C),T(Sy(B)),w(g);return}const{forceRender:D}=y.useContext(vm);return i.jsx(i.Fragment,{children:N.map(B=>{const E=Rc(B),A=u&&!p?!1:g===N||v.includes(E),P=()=>{if(S.has(E))S.set(E,!0);else return;let I=!0;S.forEach(U=>{U||(I=!1)}),I&&(D==null||D(),T(x.current),u&&(m==null||m()),r&&r())};return i.jsx(AA,{isPresent:A,initial:!b.current||o?void 0:!1,custom:A?void 0:s,presenceAffectsLayout:c,mode:d,onExitComplete:A?void 0:P,children:B},E)})})},In=t=>t;let Vx=In;const RA={useManualTiming:!1};function MA(t){let s=new Set,o=new Set,r=!1,c=!1;const d=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function p(g){d.has(g)&&(m.schedule(g),t()),g(u)}const m={schedule:(g,v=!1,b=!1)=>{const S=b&&r?s:o;return v&&d.add(g),S.has(g)||S.add(g),g},cancel:g=>{o.delete(g),d.delete(g)},process:g=>{if(u=g,r){c=!0;return}r=!0,[s,o]=[o,s],s.forEach(p),s.clear(),r=!1,c&&(c=!1,m.process(g))}};return m}const Mc=["read","resolveKeyframes","update","preRender","render","postRender"],IA=40;function qx(t,s){let o=!1,r=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>o=!0,u=Mc.reduce((T,C)=>(T[C]=MA(d),T),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:b,postRender:x}=u,S=()=>{const T=performance.now();o=!1,c.delta=r?1e3/60:Math.max(Math.min(T-c.timestamp,IA),1),c.timestamp=T,c.isProcessing=!0,p.process(c),m.process(c),g.process(c),v.process(c),b.process(c),x.process(c),c.isProcessing=!1,o&&s&&(r=!1,t(S))},k=()=>{o=!0,r=!0,c.isProcessing||t(S)};return{schedule:Mc.reduce((T,C)=>{const D=u[C];return T[C]=(B,E=!1,A=!1)=>(o||k(),D.schedule(B,E,A)),T},{}),cancel:T=>{for(let C=0;C<Mc.length;C++)u[Mc[C]].cancel(T)},state:c,steps:u}}const{schedule:_t,cancel:Ua,state:rn,steps:ip}=qx(typeof requestAnimationFrame<"u"?requestAnimationFrame:In,!0),Gx=y.createContext({strict:!1}),Ty={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Io={};for(const t in Ty)Io[t]={isEnabled:s=>Ty[t].some(o=>!!s[o])};function OA(t){for(const s in t)Io[s]={...Io[s],...t[s]}}const BA=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function td(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||BA.has(t)}let Fx=t=>!td(t);function LA(t){t&&(Fx=s=>s.startsWith("on")?!td(s):t(s))}try{LA(require("@emotion/is-prop-valid").default)}catch{}function zA(t,s,o){const r={};for(const c in t)c==="values"&&typeof t.values=="object"||(Fx(c)||o===!0&&td(c)||!s&&!td(c)||t.draggable&&c.startsWith("onDrag"))&&(r[c]=t[c]);return r}function $A(t){if(typeof Proxy>"u")return t;const s=new Map,o=(...r)=>t(...r);return new Proxy(o,{get:(r,c)=>c==="create"?t:(s.has(c)||s.set(c,t(c)),s.get(c))})}const Sd=y.createContext({});function nl(t){return typeof t=="string"||Array.isArray(t)}function Td(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const _m=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],km=["initial",..._m];function wd(t){return Td(t.animate)||km.some(s=>nl(t[s]))}function Zx(t){return!!(wd(t)||t.variants)}function UA(t,s){if(wd(t)){const{initial:o,animate:r}=t;return{initial:o===!1||nl(o)?o:void 0,animate:nl(r)?r:void 0}}return t.inherit!==!1?s:{}}function PA(t){const{initial:s,animate:o}=UA(t,y.useContext(Sd));return y.useMemo(()=>({initial:s,animate:o}),[wy(s),wy(o)])}function wy(t){return Array.isArray(t)?t.join(" "):t}const HA=Symbol.for("motionComponentSymbol");function wo(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function VA(t,s,o){return y.useCallback(r=>{r&&t.onMount&&t.onMount(r),s&&(r?s.mount(r):s.unmount()),o&&(typeof o=="function"?o(r):wo(o)&&(o.current=r))},[s])}const Sm=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),qA="framerAppearId",Kx="data-"+Sm(qA),{schedule:Tm}=qx(queueMicrotask,!1),Yx=y.createContext({});function GA(t,s,o,r,c){var d,u;const{visualElement:p}=y.useContext(Sd),m=y.useContext(Gx),g=y.useContext(kd),v=y.useContext(bm).reducedMotion,b=y.useRef(null);r=r||m.renderer,!b.current&&r&&(b.current=r(t,{visualState:s,parent:p,props:o,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const x=b.current,S=y.useContext(Yx);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&FA(b.current,o,c,S);const k=y.useRef(!1);y.useInsertionEffect(()=>{x&&k.current&&x.update(o,g)});const w=o[Kx],N=y.useRef(!!w&&!(!((d=window.MotionHandoffIsComplete)===null||d===void 0)&&d.call(window,w))&&((u=window.MotionHasOptimisedAnimation)===null||u===void 0?void 0:u.call(window,w)));return Hx(()=>{x&&(k.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),Tm.render(x.render),N.current&&x.animationState&&x.animationState.animateChanges())}),y.useEffect(()=>{x&&(!N.current&&x.animationState&&x.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)===null||T===void 0||T.call(window,w)}),N.current=!1))}),x}function FA(t,s,o,r){const{layoutId:c,layout:d,drag:u,dragConstraints:p,layoutScroll:m,layoutRoot:g}=s;t.projection=new o(t.latestValues,s["data-framer-portal-id"]?void 0:Jx(t.parent)),t.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!u||p&&wo(p),visualElement:t,animationType:typeof d=="string"?d:"both",initialPromotionConfig:r,layoutScroll:m,layoutRoot:g})}function Jx(t){if(t)return t.options.allowProjection!==!1?t.projection:Jx(t.parent)}function ZA({preloadedFeatures:t,createVisualElement:s,useRender:o,useVisualState:r,Component:c}){var d,u;t&&OA(t);function p(g,v){let b;const x={...y.useContext(bm),...g,layoutId:KA(g)},{isStatic:S}=x,k=PA(g),w=r(g,S);if(!S&&xm){YA();const N=JA(x);b=N.MeasureLayout,k.visualElement=GA(c,w,x,s,N.ProjectionNode)}return i.jsxs(Sd.Provider,{value:k,children:[b&&k.visualElement?i.jsx(b,{visualElement:k.visualElement,...x}):null,o(c,g,VA(w,k.visualElement,v),w,S,k.visualElement)]})}p.displayName=`motion.${typeof c=="string"?c:`create(${(u=(d=c.displayName)!==null&&d!==void 0?d:c.name)!==null&&u!==void 0?u:""})`}`;const m=y.forwardRef(p);return m[HA]=c,m}function KA({layoutId:t}){const s=y.useContext(vm).id;return s&&t!==void 0?s+"-"+t:t}function YA(t,s){y.useContext(Gx).strict}function JA(t){const{drag:s,layout:o}=Io;if(!s&&!o)return{};const r={...s,...o};return{MeasureLayout:s!=null&&s.isEnabled(t)||o!=null&&o.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const WA=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function wm(t){return typeof t!="string"||t.includes("-")?!1:!!(WA.indexOf(t)>-1||/[A-Z]/u.test(t))}function jy(t){const s=[{},{}];return t==null||t.values.forEach((o,r)=>{s[0][r]=o.get(),s[1][r]=o.getVelocity()}),s}function jm(t,s,o,r){if(typeof s=="function"){const[c,d]=jy(r);s=s(o!==void 0?o:t.custom,c,d)}if(typeof s=="string"&&(s=t.variants&&t.variants[s]),typeof s=="function"){const[c,d]=jy(r);s=s(o!==void 0?o:t.custom,c,d)}return s}const Bp=t=>Array.isArray(t),XA=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),QA=t=>Bp(t)?t[t.length-1]||0:t,dn=t=>!!(t&&t.getVelocity);function Zc(t){const s=dn(t)?t.get():t;return XA(s)?s.toValue():s}function eD({scrapeMotionValuesFromProps:t,createRenderState:s,onUpdate:o},r,c,d){const u={latestValues:tD(r,c,d,t),renderState:s()};return o&&(u.onMount=p=>o({props:r,current:p,...u}),u.onUpdate=p=>o(p)),u}const Wx=t=>(s,o)=>{const r=y.useContext(Sd),c=y.useContext(kd),d=()=>eD(t,s,r,c);return o?d():ym(d)};function tD(t,s,o,r){const c={},d=r(t,{});for(const x in d)c[x]=Zc(d[x]);let{initial:u,animate:p}=t;const m=wd(t),g=Zx(t);s&&g&&!m&&t.inherit!==!1&&(u===void 0&&(u=s.initial),p===void 0&&(p=s.animate));let v=o?o.initial===!1:!1;v=v||u===!1;const b=v?p:u;if(b&&typeof b!="boolean"&&!Td(b)){const x=Array.isArray(b)?b:[b];for(let S=0;S<x.length;S++){const k=jm(t,x[S]);if(k){const{transitionEnd:w,transition:N,...T}=k;for(const C in T){let D=T[C];if(Array.isArray(D)){const B=v?D.length-1:0;D=D[B]}D!==null&&(c[C]=D)}for(const C in w)c[C]=w[C]}}}return c}const Po=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ri=new Set(Po),Xx=t=>s=>typeof s=="string"&&s.startsWith(t),Qx=Xx("--"),nD=Xx("var(--"),Nm=t=>nD(t)?sD.test(t.split("/*")[0].trim()):!1,sD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,e_=(t,s)=>s&&typeof t=="number"?s.transform(t):t,ta=(t,s,o)=>o>s?s:o<t?t:o,Ho={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},sl={...Ho,transform:t=>ta(0,1,t)},Ic={...Ho,default:1},ul=t=>({test:s=>typeof s=="string"&&s.endsWith(t)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${t}`}),Oa=ul("deg"),ws=ul("%"),De=ul("px"),aD=ul("vh"),iD=ul("vw"),Ny={...ws,parse:t=>ws.parse(t)/100,transform:t=>ws.transform(t*100)},oD={borderWidth:De,borderTopWidth:De,borderRightWidth:De,borderBottomWidth:De,borderLeftWidth:De,borderRadius:De,radius:De,borderTopLeftRadius:De,borderTopRightRadius:De,borderBottomRightRadius:De,borderBottomLeftRadius:De,width:De,maxWidth:De,height:De,maxHeight:De,top:De,right:De,bottom:De,left:De,padding:De,paddingTop:De,paddingRight:De,paddingBottom:De,paddingLeft:De,margin:De,marginTop:De,marginRight:De,marginBottom:De,marginLeft:De,backgroundPositionX:De,backgroundPositionY:De},rD={rotate:Oa,rotateX:Oa,rotateY:Oa,rotateZ:Oa,scale:Ic,scaleX:Ic,scaleY:Ic,scaleZ:Ic,skew:Oa,skewX:Oa,skewY:Oa,distance:De,translateX:De,translateY:De,translateZ:De,x:De,y:De,z:De,perspective:De,transformPerspective:De,opacity:sl,originX:Ny,originY:Ny,originZ:De},Cy={...Ho,transform:Math.round},Cm={...oD,...rD,zIndex:Cy,size:De,fillOpacity:sl,strokeOpacity:sl,numOctaves:Cy},lD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},cD=Po.length;function dD(t,s,o){let r="",c=!0;for(let d=0;d<cD;d++){const u=Po[d],p=t[u];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(u.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||o){const g=e_(p,Cm[u]);if(!m){c=!1;const v=lD[u]||u;r+=`${v}(${g}) `}o&&(s[u]=g)}}return r=r.trim(),o?r=o(s,c?"":r):c&&(r="none"),r}function Em(t,s,o){const{style:r,vars:c,transformOrigin:d}=t;let u=!1,p=!1;for(const m in s){const g=s[m];if(Ri.has(m)){u=!0;continue}else if(Qx(m)){c[m]=g;continue}else{const v=e_(g,Cm[m]);m.startsWith("origin")?(p=!0,d[m]=v):r[m]=v}}if(s.transform||(u||o?r.transform=dD(s,t.transform,o):r.transform&&(r.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=d;r.transformOrigin=`${m} ${g} ${v}`}}const uD={offset:"stroke-dashoffset",array:"stroke-dasharray"},fD={offset:"strokeDashoffset",array:"strokeDasharray"};function pD(t,s,o=1,r=0,c=!0){t.pathLength=1;const d=c?uD:fD;t[d.offset]=De.transform(-r);const u=De.transform(s),p=De.transform(o);t[d.array]=`${u} ${p}`}function Ey(t,s,o){return typeof t=="string"?t:De.transform(s+o*t)}function mD(t,s,o){const r=Ey(s,t.x,t.width),c=Ey(o,t.y,t.height);return`${r} ${c}`}function Am(t,{attrX:s,attrY:o,attrScale:r,originX:c,originY:d,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},v,b){if(Em(t,g,b),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:x,style:S,dimensions:k}=t;x.transform&&(k&&(S.transform=x.transform),delete x.transform),k&&(c!==void 0||d!==void 0||S.transform)&&(S.transformOrigin=mD(k,c!==void 0?c:.5,d!==void 0?d:.5)),s!==void 0&&(x.x=s),o!==void 0&&(x.y=o),r!==void 0&&(x.scale=r),u!==void 0&&pD(x,u,p,m,!1)}const Dm=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),t_=()=>({...Dm(),attrs:{}}),Rm=t=>typeof t=="string"&&t.toLowerCase()==="svg";function n_(t,{style:s,vars:o},r,c){Object.assign(t.style,s,c&&c.getProjectionStyles(r));for(const d in o)t.style.setProperty(d,o[d])}const s_=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function a_(t,s,o,r){n_(t,s,void 0,r);for(const c in s.attrs)t.setAttribute(s_.has(c)?c:Sm(c),s.attrs[c])}const nd={};function hD(t){Object.assign(nd,t)}function i_(t,{layout:s,layoutId:o}){return Ri.has(t)||t.startsWith("origin")||(s||o!==void 0)&&(!!nd[t]||t==="opacity")}function Mm(t,s,o){var r;const{style:c}=t,d={};for(const u in c)(dn(c[u])||s.style&&dn(s.style[u])||i_(u,t)||((r=o==null?void 0:o.getValue(u))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(d[u]=c[u]);return d}function o_(t,s,o){const r=Mm(t,s,o);for(const c in t)if(dn(t[c])||dn(s[c])){const d=Po.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;r[d]=t[c]}return r}function gD(t,s){try{s.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{s.dimensions={x:0,y:0,width:0,height:0}}}const Ay=["x","y","width","height","cx","cy","r"],vD={useVisualState:Wx({scrapeMotionValuesFromProps:o_,createRenderState:t_,onUpdate:({props:t,prevProps:s,current:o,renderState:r,latestValues:c})=>{if(!o)return;let d=!!t.drag;if(!d){for(const p in c)if(Ri.has(p)){d=!0;break}}if(!d)return;let u=!s;if(s)for(let p=0;p<Ay.length;p++){const m=Ay[p];t[m]!==s[m]&&(u=!0)}u&&_t.read(()=>{gD(o,r),_t.render(()=>{Am(r,c,Rm(o.tagName),t.transformTemplate),a_(o,r)})})}})},yD={useVisualState:Wx({scrapeMotionValuesFromProps:Mm,createRenderState:Dm})};function r_(t,s,o){for(const r in s)!dn(s[r])&&!i_(r,o)&&(t[r]=s[r])}function bD({transformTemplate:t},s){return y.useMemo(()=>{const o=Dm();return Em(o,s,t),Object.assign({},o.vars,o.style)},[s])}function xD(t,s){const o=t.style||{},r={};return r_(r,o,t),Object.assign(r,bD(t,s)),r}function _D(t,s){const o={},r=xD(t,s);return t.drag&&t.dragListener!==!1&&(o.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(o.tabIndex=0),o.style=r,o}function kD(t,s,o,r){const c=y.useMemo(()=>{const d=t_();return Am(d,s,Rm(r),t.transformTemplate),{...d.attrs,style:{...d.style}}},[s]);if(t.style){const d={};r_(d,t.style,t),c.style={...d,...c.style}}return c}function SD(t=!1){return(o,r,c,{latestValues:d},u)=>{const m=(wm(o)?kD:_D)(r,d,u,o),g=zA(r,typeof o=="string",t),v=o!==y.Fragment?{...g,...m,ref:c}:{},{children:b}=r,x=y.useMemo(()=>dn(b)?b.get():b,[b]);return y.createElement(o,{...v,children:x})}}function TD(t,s){return function(r,{forwardMotionProps:c}={forwardMotionProps:!1}){const u={...wm(r)?vD:yD,preloadedFeatures:t,useRender:SD(c),createVisualElement:s,Component:r};return ZA(u)}}function l_(t,s){if(!Array.isArray(s))return!1;const o=s.length;if(o!==t.length)return!1;for(let r=0;r<o;r++)if(s[r]!==t[r])return!1;return!0}function jd(t,s,o){const r=t.getProps();return jm(r,s,o!==void 0?o:r.custom,t)}function Im(t,s){return t?t[s]||t.default||t:void 0}const c_=new Set(["width","height","top","left","right","bottom",...Po]);let Kc;function wD(){Kc=void 0}const js={now:()=>(Kc===void 0&&js.set(rn.isProcessing||RA.useManualTiming?rn.timestamp:performance.now()),Kc),set:t=>{Kc=t,queueMicrotask(wD)}};function Om(t,s){t.indexOf(s)===-1&&t.push(s)}function Bm(t,s){const o=t.indexOf(s);o>-1&&t.splice(o,1)}class Lm{constructor(){this.subscriptions=[]}add(s){return Om(this.subscriptions,s),()=>Bm(this.subscriptions,s)}notify(s,o,r){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](s,o,r);else for(let d=0;d<c;d++){const u=this.subscriptions[d];u&&u(s,o,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function d_(t,s){return s?t*(1e3/s):0}const Dy=30,jD=t=>!isNaN(parseFloat(t));class ND{constructor(s,o={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,c=!0)=>{const d=js.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(s),this.owner=o.owner}setCurrent(s){this.current=s,this.updatedAt=js.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=jD(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return this.on("change",s)}on(s,o){this.events[s]||(this.events[s]=new Lm);const r=this.events[s].add(o);return s==="change"?()=>{r(),_t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,o){this.passiveEffect=s,this.stopPassiveEffect=o}set(s,o=!0){!o||!this.passiveEffect?this.updateAndNotify(s,o):this.passiveEffect(s,this.updateAndNotify)}setWithVelocity(s,o,r){this.set(o),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-r}jump(s,o=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=js.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>Dy)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,Dy);return d_(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(s){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=s(o),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function al(t,s){return new ND(t,s)}function CD(t,s,o){t.hasValue(s)?t.getValue(s).set(o):t.addValue(s,al(o))}function ED(t,s){const o=jd(t,s);let{transitionEnd:r={},transition:c={},...d}=o||{};d={...d,...r};for(const u in d){const p=QA(d[u]);CD(t,u,p)}}function AD(t){return!!(dn(t)&&t.add)}function Lp(t,s){const o=t.getValue("willChange");if(AD(o))return o.add(s)}function u_(t){return t.props[Kx]}function zm(t){let s;return()=>(s===void 0&&(s=t()),s)}const DD=zm(()=>window.ScrollTimeline!==void 0);class RD{constructor(s){this.stop=()=>this.runAll("stop"),this.animations=s.filter(Boolean)}get finished(){return Promise.all(this.animations.map(s=>"finished"in s?s.finished:s))}getAll(s){return this.animations[0][s]}setAll(s,o){for(let r=0;r<this.animations.length;r++)this.animations[r][s]=o}attachTimeline(s,o){const r=this.animations.map(c=>{if(DD()&&c.attachTimeline)return c.attachTimeline(s);if(typeof o=="function")return o(c)});return()=>{r.forEach((c,d)=>{c&&c(),this.animations[d].stop()})}}get time(){return this.getAll("time")}set time(s){this.setAll("time",s)}get speed(){return this.getAll("speed")}set speed(s){this.setAll("speed",s)}get startTime(){return this.getAll("startTime")}get duration(){let s=0;for(let o=0;o<this.animations.length;o++)s=Math.max(s,this.animations[o].duration);return s}runAll(s){this.animations.forEach(o=>o[s]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class MD extends RD{then(s,o){return Promise.all(this.animations).then(s).catch(o)}}const Ws=t=>t*1e3,Xs=t=>t/1e3;function $m(t){return typeof t=="function"}function Ry(t,s){t.timeline=s,t.onfinish=null}const Um=t=>Array.isArray(t)&&typeof t[0]=="number",ID={linearEasing:void 0};function OD(t,s){const o=zm(t);return()=>{var r;return(r=ID[s])!==null&&r!==void 0?r:o()}}const sd=OD(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Oo=(t,s,o)=>{const r=s-t;return r===0?1:(o-t)/r},f_=(t,s,o=10)=>{let r="";const c=Math.max(Math.round(s/o),2);for(let d=0;d<c;d++)r+=t(Oo(0,c-1,d))+", ";return`linear(${r.substring(0,r.length-2)})`};function p_(t){return!!(typeof t=="function"&&sd()||!t||typeof t=="string"&&(t in zp||sd())||Um(t)||Array.isArray(t)&&t.every(p_))}const Hr=([t,s,o,r])=>`cubic-bezier(${t}, ${s}, ${o}, ${r})`,zp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hr([0,.65,.55,1]),circOut:Hr([.55,0,1,.45]),backIn:Hr([.31,.01,.66,-.59]),backOut:Hr([.33,1.53,.69,.99])};function m_(t,s){if(t)return typeof t=="function"&&sd()?f_(t,s):Um(t)?Hr(t):Array.isArray(t)?t.map(o=>m_(o,s)||zp.easeOut):zp[t]}const h_=(t,s,o)=>(((1-3*o+3*s)*t+(3*o-6*s))*t+3*s)*t,BD=1e-7,LD=12;function zD(t,s,o,r,c){let d,u,p=0;do u=s+(o-s)/2,d=h_(u,r,c)-t,d>0?o=u:s=u;while(Math.abs(d)>BD&&++p<LD);return u}function fl(t,s,o,r){if(t===s&&o===r)return In;const c=d=>zD(d,0,1,t,o);return d=>d===0||d===1?d:h_(c(d),s,r)}const g_=t=>s=>s<=.5?t(2*s)/2:(2-t(2*(1-s)))/2,v_=t=>s=>1-t(1-s),y_=fl(.33,1.53,.69,.99),Pm=v_(y_),b_=g_(Pm),x_=t=>(t*=2)<1?.5*Pm(t):.5*(2-Math.pow(2,-10*(t-1))),Hm=t=>1-Math.sin(Math.acos(t)),__=v_(Hm),k_=g_(Hm),S_=t=>/^0[^.\s]+$/u.test(t);function $D(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||S_(t):!0}const Zr=t=>Math.round(t*1e5)/1e5,Vm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function UD(t){return t==null}const PD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qm=(t,s)=>o=>!!(typeof o=="string"&&PD.test(o)&&o.startsWith(t)||s&&!UD(o)&&Object.prototype.hasOwnProperty.call(o,s)),T_=(t,s,o)=>r=>{if(typeof r!="string")return r;const[c,d,u,p]=r.match(Vm);return{[t]:parseFloat(c),[s]:parseFloat(d),[o]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},HD=t=>ta(0,255,t),op={...Ho,transform:t=>Math.round(HD(t))},Si={test:qm("rgb","red"),parse:T_("red","green","blue"),transform:({red:t,green:s,blue:o,alpha:r=1})=>"rgba("+op.transform(t)+", "+op.transform(s)+", "+op.transform(o)+", "+Zr(sl.transform(r))+")"};function VD(t){let s="",o="",r="",c="";return t.length>5?(s=t.substring(1,3),o=t.substring(3,5),r=t.substring(5,7),c=t.substring(7,9)):(s=t.substring(1,2),o=t.substring(2,3),r=t.substring(3,4),c=t.substring(4,5),s+=s,o+=o,r+=r,c+=c),{red:parseInt(s,16),green:parseInt(o,16),blue:parseInt(r,16),alpha:c?parseInt(c,16)/255:1}}const $p={test:qm("#"),parse:VD,transform:Si.transform},jo={test:qm("hsl","hue"),parse:T_("hue","saturation","lightness"),transform:({hue:t,saturation:s,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+ws.transform(Zr(s))+", "+ws.transform(Zr(o))+", "+Zr(sl.transform(r))+")"},cn={test:t=>Si.test(t)||$p.test(t)||jo.test(t),parse:t=>Si.test(t)?Si.parse(t):jo.test(t)?jo.parse(t):$p.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Si.transform(t):jo.transform(t)},qD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function GD(t){var s,o;return isNaN(t)&&typeof t=="string"&&(((s=t.match(Vm))===null||s===void 0?void 0:s.length)||0)+(((o=t.match(qD))===null||o===void 0?void 0:o.length)||0)>0}const w_="number",j_="color",FD="var",ZD="var(",My="${}",KD=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function il(t){const s=t.toString(),o=[],r={color:[],number:[],var:[]},c=[];let d=0;const p=s.replace(KD,m=>(cn.test(m)?(r.color.push(d),c.push(j_),o.push(cn.parse(m))):m.startsWith(ZD)?(r.var.push(d),c.push(FD),o.push(m)):(r.number.push(d),c.push(w_),o.push(parseFloat(m))),++d,My)).split(My);return{values:o,split:p,indexes:r,types:c}}function N_(t){return il(t).values}function C_(t){const{split:s,types:o}=il(t),r=s.length;return c=>{let d="";for(let u=0;u<r;u++)if(d+=s[u],c[u]!==void 0){const p=o[u];p===w_?d+=Zr(c[u]):p===j_?d+=cn.transform(c[u]):d+=c[u]}return d}}const YD=t=>typeof t=="number"?0:t;function JD(t){const s=N_(t);return C_(t)(s.map(YD))}const Pa={test:GD,parse:N_,createTransformer:C_,getAnimatableNone:JD},WD=new Set(["brightness","contrast","saturate","opacity"]);function XD(t){const[s,o]=t.slice(0,-1).split("(");if(s==="drop-shadow")return t;const[r]=o.match(Vm)||[];if(!r)return t;const c=o.replace(r,"");let d=WD.has(s)?1:0;return r!==o&&(d*=100),s+"("+d+c+")"}const QD=/\b([a-z-]*)\(.*?\)/gu,Up={...Pa,getAnimatableNone:t=>{const s=t.match(QD);return s?s.map(XD).join(" "):t}},eR={...Cm,color:cn,backgroundColor:cn,outlineColor:cn,fill:cn,stroke:cn,borderColor:cn,borderTopColor:cn,borderRightColor:cn,borderBottomColor:cn,borderLeftColor:cn,filter:Up,WebkitFilter:Up},Gm=t=>eR[t];function E_(t,s){let o=Gm(t);return o!==Up&&(o=Pa),o.getAnimatableNone?o.getAnimatableNone(s):void 0}const tR=new Set(["auto","none","0"]);function nR(t,s,o){let r=0,c;for(;r<t.length&&!c;){const d=t[r];typeof d=="string"&&!tR.has(d)&&il(d).values.length&&(c=t[r]),r++}if(c&&o)for(const d of s)t[d]=E_(o,c)}const Iy=t=>t===Ho||t===De,Oy=(t,s)=>parseFloat(t.split(", ")[s]),By=(t,s)=>(o,{transform:r})=>{if(r==="none"||!r)return 0;const c=r.match(/^matrix3d\((.+)\)$/u);if(c)return Oy(c[1],s);{const d=r.match(/^matrix\((.+)\)$/u);return d?Oy(d[1],t):0}},sR=new Set(["x","y","z"]),aR=Po.filter(t=>!sR.has(t));function iR(t){const s=[];return aR.forEach(o=>{const r=t.getValue(o);r!==void 0&&(s.push([o,r.get()]),r.set(o.startsWith("scale")?1:0))}),s}const Bo={width:({x:t},{paddingLeft:s="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(s)-parseFloat(o),height:({y:t},{paddingTop:s="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(s)-parseFloat(o),top:(t,{top:s})=>parseFloat(s),left:(t,{left:s})=>parseFloat(s),bottom:({y:t},{top:s})=>parseFloat(s)+(t.max-t.min),right:({x:t},{left:s})=>parseFloat(s)+(t.max-t.min),x:By(4,13),y:By(5,14)};Bo.translateX=Bo.x;Bo.translateY=Bo.y;const Ti=new Set;let Pp=!1,Hp=!1;function A_(){if(Hp){const t=Array.from(Ti).filter(r=>r.needsMeasurement),s=new Set(t.map(r=>r.element)),o=new Map;s.forEach(r=>{const c=iR(r);c.length&&(o.set(r,c),r.render())}),t.forEach(r=>r.measureInitialState()),s.forEach(r=>{r.render();const c=o.get(r);c&&c.forEach(([d,u])=>{var p;(p=r.getValue(d))===null||p===void 0||p.set(u)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Hp=!1,Pp=!1,Ti.forEach(t=>t.complete()),Ti.clear()}function D_(){Ti.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Hp=!0)})}function oR(){D_(),A_()}class Fm{constructor(s,o,r,c,d,u=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...s],this.onComplete=o,this.name=r,this.motionValue=c,this.element=d,this.isAsync=u}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ti.add(this),Pp||(Pp=!0,_t.read(D_),_t.resolveKeyframes(A_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:o,element:r,motionValue:c}=this;for(let d=0;d<s.length;d++)if(s[d]===null)if(d===0){const u=c==null?void 0:c.get(),p=s[s.length-1];if(u!==void 0)s[0]=u;else if(r&&o){const m=r.readValue(o,p);m!=null&&(s[0]=m)}s[0]===void 0&&(s[0]=p),c&&u===void 0&&c.set(s[0])}else s[d]=s[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ti.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ti.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const R_=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),rR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function lR(t){const s=rR.exec(t);if(!s)return[,];const[,o,r,c]=s;return[`--${o??r}`,c]}function M_(t,s,o=1){const[r,c]=lR(t);if(!r)return;const d=window.getComputedStyle(s).getPropertyValue(r);if(d){const u=d.trim();return R_(u)?parseFloat(u):u}return Nm(c)?M_(c,s,o+1):c}const I_=t=>s=>s.test(t),cR={test:t=>t==="auto",parse:t=>t},O_=[Ho,De,ws,Oa,iD,aD,cR],Ly=t=>O_.find(I_(t));class B_ extends Fm{constructor(s,o,r,c,d){super(s,o,r,c,d,!0)}readKeyframes(){const{unresolvedKeyframes:s,element:o,name:r}=this;if(!o||!o.current)return;super.readKeyframes();for(let m=0;m<s.length;m++){let g=s[m];if(typeof g=="string"&&(g=g.trim(),Nm(g))){const v=M_(g,o.current);v!==void 0&&(s[m]=v),m===s.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!c_.has(r)||s.length!==2)return;const[c,d]=s,u=Ly(c),p=Ly(d);if(u!==p)if(Iy(u)&&Iy(p))for(let m=0;m<s.length;m++){const g=s[m];typeof g=="string"&&(s[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:s,name:o}=this,r=[];for(let c=0;c<s.length;c++)$D(s[c])&&r.push(c);r.length&&nR(s,r,o)}measureInitialState(){const{element:s,unresolvedKeyframes:o,name:r}=this;if(!s||!s.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Bo[r](s.measureViewportBox(),window.getComputedStyle(s.current)),o[0]=this.measuredOrigin;const c=o[o.length-1];c!==void 0&&s.getValue(r,c).jump(c,!1)}measureEndState(){var s;const{element:o,name:r,unresolvedKeyframes:c}=this;if(!o||!o.current)return;const d=o.getValue(r);d&&d.jump(this.measuredOrigin,!1);const u=c.length-1,p=c[u];c[u]=Bo[r](o.measureViewportBox(),window.getComputedStyle(o.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((s=this.removedTransforms)===null||s===void 0)&&s.length&&this.removedTransforms.forEach(([m,g])=>{o.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const zy=(t,s)=>s==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Pa.test(t)||t==="0")&&!t.startsWith("url("));function dR(t){const s=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==s)return!0}function uR(t,s,o,r){const c=t[0];if(c===null)return!1;if(s==="display"||s==="visibility")return!0;const d=t[t.length-1],u=zy(c,s),p=zy(d,s);return!u||!p?!1:dR(t)||(o==="spring"||$m(o))&&r}const fR=t=>t!==null;function Nd(t,{repeat:s,repeatType:o="loop"},r){const c=t.filter(fR),d=s&&o!=="loop"&&s%2===1?0:c.length-1;return!d||r===void 0?c[d]:r}const pR=40;class L_{constructor({autoplay:s=!0,delay:o=0,type:r="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:u="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=js.now(),this.options={autoplay:s,delay:o,type:r,repeat:c,repeatDelay:d,repeatType:u,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>pR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&oR(),this._resolved}onKeyframesResolved(s,o){this.resolvedAt=js.now(),this.hasAttemptedResolve=!0;const{name:r,type:c,velocity:d,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!uR(s,r,c,d))if(u)this.options.duration=0;else{m&&m(Nd(s,this.options,o)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(s,o);v!==!1&&(this._resolved={keyframes:s,finalKeyframe:o,...v},this.onPostResolved())}onPostResolved(){}then(s,o){return this.currentFinishedPromise.then(s,o)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(s=>{this.resolveFinishedPromise=s})}}const Vp=2e4;function z_(t){let s=0;const o=50;let r=t.next(s);for(;!r.done&&s<Vp;)s+=o,r=t.next(s);return s>=Vp?1/0:s}const Nt=(t,s,o)=>t+(s-t)*o;function rp(t,s,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(s-t)*6*o:o<1/2?s:o<2/3?t+(s-t)*(2/3-o)*6:t}function mR({hue:t,saturation:s,lightness:o,alpha:r}){t/=360,s/=100,o/=100;let c=0,d=0,u=0;if(!s)c=d=u=o;else{const p=o<.5?o*(1+s):o+s-o*s,m=2*o-p;c=rp(m,p,t+1/3),d=rp(m,p,t),u=rp(m,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(u*255),alpha:r}}function ad(t,s){return o=>o>0?s:t}const lp=(t,s,o)=>{const r=t*t,c=o*(s*s-r)+r;return c<0?0:Math.sqrt(c)},hR=[$p,Si,jo],gR=t=>hR.find(s=>s.test(t));function $y(t){const s=gR(t);if(!s)return!1;let o=s.parse(t);return s===jo&&(o=mR(o)),o}const Uy=(t,s)=>{const o=$y(t),r=$y(s);if(!o||!r)return ad(t,s);const c={...o};return d=>(c.red=lp(o.red,r.red,d),c.green=lp(o.green,r.green,d),c.blue=lp(o.blue,r.blue,d),c.alpha=Nt(o.alpha,r.alpha,d),Si.transform(c))},vR=(t,s)=>o=>s(t(o)),pl=(...t)=>t.reduce(vR),qp=new Set(["none","hidden"]);function yR(t,s){return qp.has(t)?o=>o<=0?t:s:o=>o>=1?s:t}function bR(t,s){return o=>Nt(t,s,o)}function Zm(t){return typeof t=="number"?bR:typeof t=="string"?Nm(t)?ad:cn.test(t)?Uy:kR:Array.isArray(t)?$_:typeof t=="object"?cn.test(t)?Uy:xR:ad}function $_(t,s){const o=[...t],r=o.length,c=t.map((d,u)=>Zm(d)(d,s[u]));return d=>{for(let u=0;u<r;u++)o[u]=c[u](d);return o}}function xR(t,s){const o={...t,...s},r={};for(const c in o)t[c]!==void 0&&s[c]!==void 0&&(r[c]=Zm(t[c])(t[c],s[c]));return c=>{for(const d in r)o[d]=r[d](c);return o}}function _R(t,s){var o;const r=[],c={color:0,var:0,number:0};for(let d=0;d<s.values.length;d++){const u=s.types[d],p=t.indexes[u][c[u]],m=(o=t.values[p])!==null&&o!==void 0?o:0;r[d]=m,c[u]++}return r}const kR=(t,s)=>{const o=Pa.createTransformer(s),r=il(t),c=il(s);return r.indexes.var.length===c.indexes.var.length&&r.indexes.color.length===c.indexes.color.length&&r.indexes.number.length>=c.indexes.number.length?qp.has(t)&&!c.values.length||qp.has(s)&&!r.values.length?yR(t,s):pl($_(_R(r,c),c.values),o):ad(t,s)};function U_(t,s,o){return typeof t=="number"&&typeof s=="number"&&typeof o=="number"?Nt(t,s,o):Zm(t)(t,s)}const SR=5;function P_(t,s,o){const r=Math.max(s-SR,0);return d_(o-t(r),s-r)}const Dt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},cp=.001;function TR({duration:t=Dt.duration,bounce:s=Dt.bounce,velocity:o=Dt.velocity,mass:r=Dt.mass}){let c,d,u=1-s;u=ta(Dt.minDamping,Dt.maxDamping,u),t=ta(Dt.minDuration,Dt.maxDuration,Xs(t)),u<1?(c=g=>{const v=g*u,b=v*t,x=v-o,S=Gp(g,u),k=Math.exp(-b);return cp-x/S*k},d=g=>{const b=g*u*t,x=b*o+o,S=Math.pow(u,2)*Math.pow(g,2)*t,k=Math.exp(-b),w=Gp(Math.pow(g,2),u);return(-c(g)+cp>0?-1:1)*((x-S)*k)/w}):(c=g=>{const v=Math.exp(-g*t),b=(g-o)*t+1;return-cp+v*b},d=g=>{const v=Math.exp(-g*t),b=(o-g)*(t*t);return v*b});const p=5/t,m=jR(c,d,p);if(t=Ws(t),isNaN(m))return{stiffness:Dt.stiffness,damping:Dt.damping,duration:t};{const g=Math.pow(m,2)*r;return{stiffness:g,damping:u*2*Math.sqrt(r*g),duration:t}}}const wR=12;function jR(t,s,o){let r=o;for(let c=1;c<wR;c++)r=r-t(r)/s(r);return r}function Gp(t,s){return t*Math.sqrt(1-s*s)}const NR=["duration","bounce"],CR=["stiffness","damping","mass"];function Py(t,s){return s.some(o=>t[o]!==void 0)}function ER(t){let s={velocity:Dt.velocity,stiffness:Dt.stiffness,damping:Dt.damping,mass:Dt.mass,isResolvedFromDuration:!1,...t};if(!Py(t,CR)&&Py(t,NR))if(t.visualDuration){const o=t.visualDuration,r=2*Math.PI/(o*1.2),c=r*r,d=2*ta(.05,1,1-(t.bounce||0))*Math.sqrt(c);s={...s,mass:Dt.mass,stiffness:c,damping:d}}else{const o=TR(t);s={...s,...o,mass:Dt.mass},s.isResolvedFromDuration=!0}return s}function H_(t=Dt.visualDuration,s=Dt.bounce){const o=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:s}:t;let{restSpeed:r,restDelta:c}=o;const d=o.keyframes[0],u=o.keyframes[o.keyframes.length-1],p={done:!1,value:d},{stiffness:m,damping:g,mass:v,duration:b,velocity:x,isResolvedFromDuration:S}=ER({...o,velocity:-Xs(o.velocity||0)}),k=x||0,w=g/(2*Math.sqrt(m*v)),N=u-d,T=Xs(Math.sqrt(m/v)),C=Math.abs(N)<5;r||(r=C?Dt.restSpeed.granular:Dt.restSpeed.default),c||(c=C?Dt.restDelta.granular:Dt.restDelta.default);let D;if(w<1){const E=Gp(T,w);D=A=>{const P=Math.exp(-w*T*A);return u-P*((k+w*T*N)/E*Math.sin(E*A)+N*Math.cos(E*A))}}else if(w===1)D=E=>u-Math.exp(-T*E)*(N+(k+T*N)*E);else{const E=T*Math.sqrt(w*w-1);D=A=>{const P=Math.exp(-w*T*A),I=Math.min(E*A,300);return u-P*((k+w*T*N)*Math.sinh(I)+E*N*Math.cosh(I))/E}}const B={calculatedDuration:S&&b||null,next:E=>{const A=D(E);if(S)p.done=E>=b;else{let P=0;w<1&&(P=E===0?Ws(k):P_(D,E,A));const I=Math.abs(P)<=r,U=Math.abs(u-A)<=c;p.done=I&&U}return p.value=p.done?u:A,p},toString:()=>{const E=Math.min(z_(B),Vp),A=f_(P=>B.next(E*P).value,E,30);return E+"ms "+A}};return B}function Hy({keyframes:t,velocity:s=0,power:o=.8,timeConstant:r=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:u,min:p,max:m,restDelta:g=.5,restSpeed:v}){const b=t[0],x={done:!1,value:b},S=I=>p!==void 0&&I<p||m!==void 0&&I>m,k=I=>p===void 0?m:m===void 0||Math.abs(p-I)<Math.abs(m-I)?p:m;let w=o*s;const N=b+w,T=u===void 0?N:u(N);T!==N&&(w=T-b);const C=I=>-w*Math.exp(-I/r),D=I=>T+C(I),B=I=>{const U=C(I),Q=D(I);x.done=Math.abs(U)<=g,x.value=x.done?T:Q};let E,A;const P=I=>{S(x.value)&&(E=I,A=H_({keyframes:[x.value,k(x.value)],velocity:P_(D,I,x.value),damping:c,stiffness:d,restDelta:g,restSpeed:v}))};return P(0),{calculatedDuration:null,next:I=>{let U=!1;return!A&&E===void 0&&(U=!0,B(I),P(I)),E!==void 0&&I>=E?A.next(I-E):(!U&&B(I),x)}}}const AR=fl(.42,0,1,1),DR=fl(0,0,.58,1),V_=fl(.42,0,.58,1),RR=t=>Array.isArray(t)&&typeof t[0]!="number",MR={linear:In,easeIn:AR,easeInOut:V_,easeOut:DR,circIn:Hm,circInOut:k_,circOut:__,backIn:Pm,backInOut:b_,backOut:y_,anticipate:x_},Vy=t=>{if(Um(t)){Vx(t.length===4);const[s,o,r,c]=t;return fl(s,o,r,c)}else if(typeof t=="string")return MR[t];return t};function IR(t,s,o){const r=[],c=o||U_,d=t.length-1;for(let u=0;u<d;u++){let p=c(t[u],t[u+1]);if(s){const m=Array.isArray(s)?s[u]||In:s;p=pl(m,p)}r.push(p)}return r}function OR(t,s,{clamp:o=!0,ease:r,mixer:c}={}){const d=t.length;if(Vx(d===s.length),d===1)return()=>s[0];if(d===2&&s[0]===s[1])return()=>s[1];const u=t[0]===t[1];t[0]>t[d-1]&&(t=[...t].reverse(),s=[...s].reverse());const p=IR(s,r,c),m=p.length,g=v=>{if(u&&v<t[0])return s[0];let b=0;if(m>1)for(;b<t.length-2&&!(v<t[b+1]);b++);const x=Oo(t[b],t[b+1],v);return p[b](x)};return o?v=>g(ta(t[0],t[d-1],v)):g}function BR(t,s){const o=t[t.length-1];for(let r=1;r<=s;r++){const c=Oo(0,s,r);t.push(Nt(o,1,c))}}function LR(t){const s=[0];return BR(s,t.length-1),s}function zR(t,s){return t.map(o=>o*s)}function $R(t,s){return t.map(()=>s||V_).splice(0,t.length-1)}function id({duration:t=300,keyframes:s,times:o,ease:r="easeInOut"}){const c=RR(r)?r.map(Vy):Vy(r),d={done:!1,value:s[0]},u=zR(o&&o.length===s.length?o:LR(s),t),p=OR(u,s,{ease:Array.isArray(c)?c:$R(s,c)});return{calculatedDuration:t,next:m=>(d.value=p(m),d.done=m>=t,d)}}const UR=t=>{const s=({timestamp:o})=>t(o);return{start:()=>_t.update(s,!0),stop:()=>Ua(s),now:()=>rn.isProcessing?rn.timestamp:js.now()}},PR={decay:Hy,inertia:Hy,tween:id,keyframes:id,spring:H_},HR=t=>t/100;class Km extends L_{constructor(s){super(s),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:o,motionValue:r,element:c,keyframes:d}=this.options,u=(c==null?void 0:c.KeyframeResolver)||Fm,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new u(d,p,o,r,c),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(s){const{type:o="keyframes",repeat:r=0,repeatDelay:c=0,repeatType:d,velocity:u=0}=this.options,p=$m(o)?o:PR[o]||id;let m,g;p!==id&&typeof s[0]!="number"&&(m=pl(HR,U_(s[0],s[1])),s=[0,100]);const v=p({...this.options,keyframes:s});d==="mirror"&&(g=p({...this.options,keyframes:[...s].reverse(),velocity:-u})),v.calculatedDuration===null&&(v.calculatedDuration=z_(v));const{calculatedDuration:b}=v,x=b+c,S=x*(r+1)-c;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:b,resolvedDuration:x,totalDuration:S}}onPostResolved(){const{autoplay:s=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!s?this.pause():this.state=this.pendingPlayState}tick(s,o=!1){const{resolved:r}=this;if(!r){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:u,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:b}=r;if(this.startTime===null)return d.next(0);const{delay:x,repeat:S,repeatType:k,repeatDelay:w,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-v/this.speed,this.startTime)),o?this.currentTime=s:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(s-this.startTime)*this.speed;const T=this.currentTime-x*(this.speed>=0?1:-1),C=this.speed>=0?T<0:T>v;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let D=this.currentTime,B=d;if(S){const I=Math.min(this.currentTime,v)/b;let U=Math.floor(I),Q=I%1;!Q&&I>=1&&(Q=1),Q===1&&U--,U=Math.min(U,S+1),!!(U%2)&&(k==="reverse"?(Q=1-Q,w&&(Q-=w/b)):k==="mirror"&&(B=u)),D=ta(0,1,Q)*b}const E=C?{done:!1,value:m[0]}:B.next(D);p&&(E.value=p(E.value));let{done:A}=E;!C&&g!==null&&(A=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return P&&c!==void 0&&(E.value=Nd(m,this.options,c)),N&&N(E.value),P&&this.finish(),E}get duration(){const{resolved:s}=this;return s?Xs(s.calculatedDuration):0}get time(){return Xs(this.currentTime)}set time(s){s=Ws(s),this.currentTime=s,this.holdTime!==null||this.speed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.speed)}get speed(){return this.playbackSpeed}set speed(s){const o=this.playbackSpeed!==s;this.playbackSpeed=s,o&&(this.time=Xs(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:s=UR,onPlay:o,startTime:r}=this.options;this.driver||(this.driver=s(d=>this.tick(d))),o&&o();const c=this.driver.now();this.holdTime!==null?this.startTime=c-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=c):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var s;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(s=this.currentTime)!==null&&s!==void 0?s:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:s}=this.options;s&&s()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(s){return this.startTime=0,this.tick(s,!0)}}const VR=new Set(["opacity","clipPath","filter","transform"]);function qR(t,s,o,{delay:r=0,duration:c=300,repeat:d=0,repeatType:u="loop",ease:p="easeInOut",times:m}={}){const g={[s]:o};m&&(g.offset=m);const v=m_(p,c);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:r,duration:c,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:d+1,direction:u==="reverse"?"alternate":"normal"})}const GR=zm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),od=10,FR=2e4;function ZR(t){return $m(t.type)||t.type==="spring"||!p_(t.ease)}function KR(t,s){const o=new Km({...s,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const c=[];let d=0;for(;!r.done&&d<FR;)r=o.sample(d),c.push(r.value),d+=od;return{times:void 0,keyframes:c,duration:d-od,ease:"linear"}}const q_={anticipate:x_,backInOut:b_,circInOut:k_};function YR(t){return t in q_}class qy extends L_{constructor(s){super(s);const{name:o,motionValue:r,element:c,keyframes:d}=this.options;this.resolver=new B_(d,(u,p)=>this.onKeyframesResolved(u,p),o,r,c),this.resolver.scheduleResolve()}initPlayback(s,o){let{duration:r=300,times:c,ease:d,type:u,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof d=="string"&&sd()&&YR(d)&&(d=q_[d]),ZR(this.options)){const{onComplete:b,onUpdate:x,motionValue:S,element:k,...w}=this.options,N=KR(s,w);s=N.keyframes,s.length===1&&(s[1]=s[0]),r=N.duration,c=N.times,d=N.ease,u="keyframes"}const v=qR(p.owner.current,m,s,{...this.options,duration:r,times:c,ease:d});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(Ry(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:b}=this.options;p.set(Nd(s,this.options,o)),b&&b(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:r,times:c,type:u,ease:d,keyframes:s}}get duration(){const{resolved:s}=this;if(!s)return 0;const{duration:o}=s;return Xs(o)}get time(){const{resolved:s}=this;if(!s)return 0;const{animation:o}=s;return Xs(o.currentTime||0)}set time(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.currentTime=Ws(s)}get speed(){const{resolved:s}=this;if(!s)return 1;const{animation:o}=s;return o.playbackRate}set speed(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.playbackRate=s}get state(){const{resolved:s}=this;if(!s)return"idle";const{animation:o}=s;return o.playState}get startTime(){const{resolved:s}=this;if(!s)return null;const{animation:o}=s;return o.startTime}attachTimeline(s){if(!this._resolved)this.pendingTimeline=s;else{const{resolved:o}=this;if(!o)return In;const{animation:r}=o;Ry(r,s)}return In}play(){if(this.isStopped)return;const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:s}=this;if(!s)return;const{animation:o}=s;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:s}=this;if(!s)return;const{animation:o,keyframes:r,duration:c,type:d,ease:u,times:p}=s;if(o.playState==="idle"||o.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:b,element:x,...S}=this.options,k=new Km({...S,keyframes:r,duration:c,type:d,ease:u,times:p,isGenerator:!0}),w=Ws(this.time);g.setWithVelocity(k.sample(w-od).value,k.sample(w).value,od)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:s}=this;s&&s.animation.finish()}cancel(){const{resolved:s}=this;s&&s.animation.cancel()}static supports(s){const{motionValue:o,name:r,repeatDelay:c,repeatType:d,damping:u,type:p}=s;if(!o||!o.owner||!(o.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=o.owner.getProps();return GR()&&r&&VR.has(r)&&!m&&!g&&!c&&d!=="mirror"&&u!==0&&p!=="inertia"}}const JR={type:"spring",stiffness:500,damping:25,restSpeed:10},WR=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),XR={type:"keyframes",duration:.8},QR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},eM=(t,{keyframes:s})=>s.length>2?XR:Ri.has(t)?t.startsWith("scale")?WR(s[1]):JR:QR;function tM({when:t,delay:s,delayChildren:o,staggerChildren:r,staggerDirection:c,repeat:d,repeatType:u,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const Ym=(t,s,o,r={},c,d)=>u=>{const p=Im(r,t)||{},m=p.delay||r.delay||0;let{elapsed:g=0}=r;g=g-Ws(m);let v={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:s.getVelocity(),...p,delay:-g,onUpdate:x=>{s.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{u(),p.onComplete&&p.onComplete()},name:t,motionValue:s,element:d?void 0:c};tM(p)||(v={...v,...eM(t,v)}),v.duration&&(v.duration=Ws(v.duration)),v.repeatDelay&&(v.repeatDelay=Ws(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let b=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(b=!0)),b&&!d&&s.get()!==void 0){const x=Nd(v.keyframes,p);if(x!==void 0)return _t.update(()=>{v.onUpdate(x),v.onComplete()}),new MD([])}return!d&&qy.supports(v)?new qy(v):new Km(v)};function nM({protectedKeys:t,needsAnimating:s},o){const r=t.hasOwnProperty(o)&&s[o]!==!0;return s[o]=!1,r}function G_(t,s,{delay:o=0,transitionOverride:r,type:c}={}){var d;let{transition:u=t.getDefaultTransition(),transitionEnd:p,...m}=s;r&&(u=r);const g=[],v=c&&t.animationState&&t.animationState.getState()[c];for(const b in m){const x=t.getValue(b,(d=t.latestValues[b])!==null&&d!==void 0?d:null),S=m[b];if(S===void 0||v&&nM(v,b))continue;const k={delay:o,...Im(u||{},b)};let w=!1;if(window.MotionHandoffAnimation){const T=u_(t);if(T){const C=window.MotionHandoffAnimation(T,b,_t);C!==null&&(k.startTime=C,w=!0)}}Lp(t,b),x.start(Ym(b,x,S,t.shouldReduceMotion&&c_.has(b)?{type:!1}:k,t,w));const N=x.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{_t.update(()=>{p&&ED(t,p)})}),g}function Fp(t,s,o={}){var r;const c=jd(t,s,o.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=c||{};o.transitionOverride&&(d=o.transitionOverride);const u=c?()=>Promise.all(G_(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:b,staggerDirection:x}=d;return sM(t,s,v+g,b,x,o)}:()=>Promise.resolve(),{when:m}=d;if(m){const[g,v]=m==="beforeChildren"?[u,p]:[p,u];return g().then(()=>v())}else return Promise.all([u(),p(o.delay)])}function sM(t,s,o=0,r=0,c=1,d){const u=[],p=(t.variantChildren.size-1)*r,m=c===1?(g=0)=>g*r:(g=0)=>p-g*r;return Array.from(t.variantChildren).sort(aM).forEach((g,v)=>{g.notify("AnimationStart",s),u.push(Fp(g,s,{...d,delay:o+m(v)}).then(()=>g.notify("AnimationComplete",s)))}),Promise.all(u)}function aM(t,s){return t.sortNodePosition(s)}function iM(t,s,o={}){t.notify("AnimationStart",s);let r;if(Array.isArray(s)){const c=s.map(d=>Fp(t,d,o));r=Promise.all(c)}else if(typeof s=="string")r=Fp(t,s,o);else{const c=typeof s=="function"?jd(t,s,o.custom):s;r=Promise.all(G_(t,c,o))}return r.then(()=>{t.notify("AnimationComplete",s)})}const oM=km.length;function F_(t){if(!t)return;if(!t.isControllingVariants){const o=t.parent?F_(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}const s={};for(let o=0;o<oM;o++){const r=km[o],c=t.props[r];(nl(c)||c===!1)&&(s[r]=c)}return s}const rM=[..._m].reverse(),lM=_m.length;function cM(t){return s=>Promise.all(s.map(({animation:o,options:r})=>iM(t,o,r)))}function dM(t){let s=cM(t),o=Gy(),r=!0;const c=m=>(g,v)=>{var b;const x=jd(t,v,m==="exit"?(b=t.presenceContext)===null||b===void 0?void 0:b.custom:void 0);if(x){const{transition:S,transitionEnd:k,...w}=x;g={...g,...w,...k}}return g};function d(m){s=m(t)}function u(m){const{props:g}=t,v=F_(t.parent)||{},b=[],x=new Set;let S={},k=1/0;for(let N=0;N<lM;N++){const T=rM[N],C=o[T],D=g[T]!==void 0?g[T]:v[T],B=nl(D),E=T===m?C.isActive:null;E===!1&&(k=N);let A=D===v[T]&&D!==g[T]&&B;if(A&&r&&t.manuallyAnimateOnMount&&(A=!1),C.protectedKeys={...S},!C.isActive&&E===null||!D&&!C.prevProp||Td(D)||typeof D=="boolean")continue;const P=uM(C.prevProp,D);let I=P||T===m&&C.isActive&&!A&&B||N>k&&B,U=!1;const Q=Array.isArray(D)?D:[D];let $=Q.reduce(c(T),{});E===!1&&($={});const{prevResolvedValues:W={}}=C,pe={...W,...$},H=Z=>{I=!0,x.has(Z)&&(U=!0,x.delete(Z)),C.needsAnimating[Z]=!0;const J=t.getValue(Z);J&&(J.liveStyle=!1)};for(const Z in pe){const J=$[Z],ce=W[Z];if(S.hasOwnProperty(Z))continue;let X=!1;Bp(J)&&Bp(ce)?X=!l_(J,ce):X=J!==ce,X?J!=null?H(Z):x.add(Z):J!==void 0&&x.has(Z)?H(Z):C.protectedKeys[Z]=!0}C.prevProp=D,C.prevResolvedValues=$,C.isActive&&(S={...S,...$}),r&&t.blockInitialAnimation&&(I=!1),I&&(!(A&&P)||U)&&b.push(...Q.map(Z=>({animation:Z,options:{type:T}})))}if(x.size){const N={};x.forEach(T=>{const C=t.getBaseTarget(T),D=t.getValue(T);D&&(D.liveStyle=!0),N[T]=C??null}),b.push({animation:N})}let w=!!b.length;return r&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,w?s(b):Promise.resolve()}function p(m,g){var v;if(o[m].isActive===g)return Promise.resolve();(v=t.variantChildren)===null||v===void 0||v.forEach(x=>{var S;return(S=x.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),o[m].isActive=g;const b=u(m);for(const x in o)o[x].protectedKeys={};return b}return{animateChanges:u,setActive:p,setAnimateFunction:d,getState:()=>o,reset:()=>{o=Gy(),r=!0}}}function uM(t,s){return typeof s=="string"?s!==t:Array.isArray(s)?!l_(s,t):!1}function vi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Gy(){return{animate:vi(!0),whileInView:vi(),whileHover:vi(),whileTap:vi(),whileDrag:vi(),whileFocus:vi(),exit:vi()}}class qa{constructor(s){this.isMounted=!1,this.node=s}update(){}}class fM extends qa{constructor(s){super(s),s.animationState||(s.animationState=dM(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();Td(s)&&(this.unmountControls=s.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:s}=this.node.getProps(),{animate:o}=this.node.prevProps||{};s!==o&&this.updateAnimationControlsSubscription()}unmount(){var s;this.node.animationState.reset(),(s=this.unmountControls)===null||s===void 0||s.call(this)}}let pM=0;class mM extends qa{constructor(){super(...arguments),this.id=pM++}update(){if(!this.node.presenceContext)return;const{isPresent:s,onExitComplete:o}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||s===r)return;const c=this.node.animationState.setActive("exit",!s);o&&!s&&c.then(()=>o(this.id))}mount(){const{register:s}=this.node.presenceContext||{};s&&(this.unmount=s(this.id))}unmount(){}}const hM={animation:{Feature:fM},exit:{Feature:mM}},cs={x:!1,y:!1};function Z_(){return cs.x||cs.y}function gM(t){return t==="x"||t==="y"?cs[t]?null:(cs[t]=!0,()=>{cs[t]=!1}):cs.x||cs.y?null:(cs.x=cs.y=!0,()=>{cs.x=cs.y=!1})}const Jm=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function ol(t,s,o,r={passive:!0}){return t.addEventListener(s,o,r),()=>t.removeEventListener(s,o)}function ml(t){return{point:{x:t.pageX,y:t.pageY}}}const vM=t=>s=>Jm(s)&&t(s,ml(s));function Kr(t,s,o,r){return ol(t,s,vM(o),r)}const Fy=(t,s)=>Math.abs(t-s);function yM(t,s){const o=Fy(t.x,s.x),r=Fy(t.y,s.y);return Math.sqrt(o**2+r**2)}class K_{constructor(s,o,{transformPagePoint:r,contextWindow:c,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=up(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=yM(b.offset,{x:0,y:0})>=3;if(!x&&!S)return;const{point:k}=b,{timestamp:w}=rn;this.history.push({...k,timestamp:w});const{onStart:N,onMove:T}=this.handlers;x||(N&&N(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=dp(x,this.transformPagePoint),_t.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:S,onSessionEnd:k,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=up(b.type==="pointercancel"?this.lastMoveEventInfo:dp(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(b,N),k&&k(b,N)},!Jm(s))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=r,this.contextWindow=c||window;const u=ml(s),p=dp(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=rn;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=o;v&&v(s,up(p,this.history)),this.removeListeners=pl(Kr(this.contextWindow,"pointermove",this.handlePointerMove),Kr(this.contextWindow,"pointerup",this.handlePointerUp),Kr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),Ua(this.updatePoint)}}function dp(t,s){return s?{point:s(t.point)}:t}function Zy(t,s){return{x:t.x-s.x,y:t.y-s.y}}function up({point:t},s){return{point:t,delta:Zy(t,Y_(s)),offset:Zy(t,bM(s)),velocity:xM(s,.1)}}function bM(t){return t[0]}function Y_(t){return t[t.length-1]}function xM(t,s){if(t.length<2)return{x:0,y:0};let o=t.length-1,r=null;const c=Y_(t);for(;o>=0&&(r=t[o],!(c.timestamp-r.timestamp>Ws(s)));)o--;if(!r)return{x:0,y:0};const d=Xs(c.timestamp-r.timestamp);if(d===0)return{x:0,y:0};const u={x:(c.x-r.x)/d,y:(c.y-r.y)/d};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}const J_=1e-4,_M=1-J_,kM=1+J_,W_=.01,SM=0-W_,TM=0+W_;function Bn(t){return t.max-t.min}function wM(t,s,o){return Math.abs(t-s)<=o}function Ky(t,s,o,r=.5){t.origin=r,t.originPoint=Nt(s.min,s.max,t.origin),t.scale=Bn(o)/Bn(s),t.translate=Nt(o.min,o.max,t.origin)-t.originPoint,(t.scale>=_M&&t.scale<=kM||isNaN(t.scale))&&(t.scale=1),(t.translate>=SM&&t.translate<=TM||isNaN(t.translate))&&(t.translate=0)}function Yr(t,s,o,r){Ky(t.x,s.x,o.x,r?r.originX:void 0),Ky(t.y,s.y,o.y,r?r.originY:void 0)}function Yy(t,s,o){t.min=o.min+s.min,t.max=t.min+Bn(s)}function jM(t,s,o){Yy(t.x,s.x,o.x),Yy(t.y,s.y,o.y)}function Jy(t,s,o){t.min=s.min-o.min,t.max=t.min+Bn(s)}function Jr(t,s,o){Jy(t.x,s.x,o.x),Jy(t.y,s.y,o.y)}function NM(t,{min:s,max:o},r){return s!==void 0&&t<s?t=r?Nt(s,t,r.min):Math.max(t,s):o!==void 0&&t>o&&(t=r?Nt(o,t,r.max):Math.min(t,o)),t}function Wy(t,s,o){return{min:s!==void 0?t.min+s:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function CM(t,{top:s,left:o,bottom:r,right:c}){return{x:Wy(t.x,o,c),y:Wy(t.y,s,r)}}function Xy(t,s){let o=s.min-t.min,r=s.max-t.max;return s.max-s.min<t.max-t.min&&([o,r]=[r,o]),{min:o,max:r}}function EM(t,s){return{x:Xy(t.x,s.x),y:Xy(t.y,s.y)}}function AM(t,s){let o=.5;const r=Bn(t),c=Bn(s);return c>r?o=Oo(s.min,s.max-r,t.min):r>c&&(o=Oo(t.min,t.max-c,s.min)),ta(0,1,o)}function DM(t,s){const o={};return s.min!==void 0&&(o.min=s.min-t.min),s.max!==void 0&&(o.max=s.max-t.min),o}const Zp=.35;function RM(t=Zp){return t===!1?t=0:t===!0&&(t=Zp),{x:Qy(t,"left","right"),y:Qy(t,"top","bottom")}}function Qy(t,s,o){return{min:eb(t,s),max:eb(t,o)}}function eb(t,s){return typeof t=="number"?t:t[s]||0}const tb=()=>({translate:0,scale:1,origin:0,originPoint:0}),No=()=>({x:tb(),y:tb()}),nb=()=>({min:0,max:0}),Lt=()=>({x:nb(),y:nb()});function Wn(t){return[t("x"),t("y")]}function X_({top:t,left:s,right:o,bottom:r}){return{x:{min:s,max:o},y:{min:t,max:r}}}function MM({x:t,y:s}){return{top:s.min,right:t.max,bottom:s.max,left:t.min}}function IM(t,s){if(!s)return t;const o=s({x:t.left,y:t.top}),r=s({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:r.y,right:r.x}}function fp(t){return t===void 0||t===1}function Kp({scale:t,scaleX:s,scaleY:o}){return!fp(t)||!fp(s)||!fp(o)}function _i(t){return Kp(t)||Q_(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Q_(t){return sb(t.x)||sb(t.y)}function sb(t){return t&&t!=="0%"}function rd(t,s,o){const r=t-o,c=s*r;return o+c}function ab(t,s,o,r,c){return c!==void 0&&(t=rd(t,c,r)),rd(t,o,r)+s}function Yp(t,s=0,o=1,r,c){t.min=ab(t.min,s,o,r,c),t.max=ab(t.max,s,o,r,c)}function e1(t,{x:s,y:o}){Yp(t.x,s.translate,s.scale,s.originPoint),Yp(t.y,o.translate,o.scale,o.originPoint)}const ib=.999999999999,ob=1.0000000000001;function OM(t,s,o,r=!1){const c=o.length;if(!c)return;s.x=s.y=1;let d,u;for(let p=0;p<c;p++){d=o[p],u=d.projectionDelta;const{visualElement:m}=d.options;m&&m.props.style&&m.props.style.display==="contents"||(r&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Eo(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),u&&(s.x*=u.x.scale,s.y*=u.y.scale,e1(t,u)),r&&_i(d.latestValues)&&Eo(t,d.latestValues))}s.x<ob&&s.x>ib&&(s.x=1),s.y<ob&&s.y>ib&&(s.y=1)}function Co(t,s){t.min=t.min+s,t.max=t.max+s}function rb(t,s,o,r,c=.5){const d=Nt(t.min,t.max,c);Yp(t,s,o,d,r)}function Eo(t,s){rb(t.x,s.x,s.scaleX,s.scale,s.originX),rb(t.y,s.y,s.scaleY,s.scale,s.originY)}function t1(t,s){return X_(IM(t.getBoundingClientRect(),s))}function BM(t,s,o){const r=t1(t,o),{scroll:c}=s;return c&&(Co(r.x,c.offset.x),Co(r.y,c.offset.y)),r}const n1=({current:t})=>t?t.ownerDocument.defaultView:null,LM=new WeakMap;class zM{constructor(s){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Lt(),this.visualElement=s}start(s,{snapToCursor:o=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=v=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(ml(v).point)},d=(v,b)=>{const{drag:x,dragPropagation:S,onDragStart:k}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=gM(x),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Wn(N=>{let T=this.getAxisMotionValue(N).get()||0;if(ws.test(T)){const{projection:C}=this.visualElement;if(C&&C.layout){const D=C.layout.layoutBox[N];D&&(T=Bn(D)*(parseFloat(T)/100))}}this.originPoint[N]=T}),k&&_t.postRender(()=>k(v,b)),Lp(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},u=(v,b)=>{const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:k,onDrag:w}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:N}=b;if(S&&this.currentDirection===null){this.currentDirection=$M(N),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",b.point,N),this.updateAxis("y",b.point,N),this.visualElement.render(),w&&w(v,b)},p=(v,b)=>this.stop(v,b),m=()=>Wn(v=>{var b;return this.getAnimationState(v)==="paused"&&((b=this.getAxisMotionValue(v).animation)===null||b===void 0?void 0:b.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new K_(s,{onSessionStart:c,onStart:d,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:n1(this.visualElement)})}stop(s,o){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&_t.postRender(()=>d(s,o))}cancel(){this.isDragging=!1;const{projection:s,animationState:o}=this.visualElement;s&&(s.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(s,o,r){const{drag:c}=this.getProps();if(!r||!Oc(s,c,this.currentDirection))return;const d=this.getAxisMotionValue(s);let u=this.originPoint[s]+r[s];this.constraints&&this.constraints[s]&&(u=NM(u,this.constraints[s],this.elastic[s])),d.set(u)}resolveConstraints(){var s;const{dragConstraints:o,dragElastic:r}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)===null||s===void 0?void 0:s.layout,d=this.constraints;o&&wo(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=CM(c.layoutBox,o):this.constraints=!1,this.elastic=RM(r),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Wn(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=DM(c.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:o}=this.getProps();if(!s||!wo(s))return!1;const r=s.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=BM(r,c.root,this.visualElement.getTransformPagePoint());let u=EM(c.layout.layoutBox,d);if(o){const p=o(MM(u));this.hasMutatedConstraints=!!p,p&&(u=X_(p))}return u}startAnimation(s){const{drag:o,dragMomentum:r,dragElastic:c,dragTransition:d,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Wn(v=>{if(!Oc(v,o,this.currentDirection))return;let b=m&&m[v]||{};u&&(b={min:0,max:0});const x=c?200:1e6,S=c?40:1e7,k={type:"inertia",velocity:r?s[v]:0,bounceStiffness:x,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...d,...b};return this.startAxisValueAnimation(v,k)});return Promise.all(g).then(p)}startAxisValueAnimation(s,o){const r=this.getAxisMotionValue(s);return Lp(this.visualElement,s),r.start(Ym(s,r,0,o,this.visualElement,!1))}stopAnimation(){Wn(s=>this.getAxisMotionValue(s).stop())}pauseAnimation(){Wn(s=>{var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(s){var o;return(o=this.getAxisMotionValue(s).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(s){const o=`_drag${s.toUpperCase()}`,r=this.visualElement.getProps(),c=r[o];return c||this.visualElement.getValue(s,(r.initial?r.initial[s]:void 0)||0)}snapToCursor(s){Wn(o=>{const{drag:r}=this.getProps();if(!Oc(o,r,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(o);if(c&&c.layout){const{min:u,max:p}=c.layout.layoutBox[o];d.set(s[o]-Nt(u,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:s,dragConstraints:o}=this.getProps(),{projection:r}=this.visualElement;if(!wo(o)||!r||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};Wn(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();c[u]=AM({min:m,max:m},this.constraints[u])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Wn(u=>{if(!Oc(u,s,null))return;const p=this.getAxisMotionValue(u),{min:m,max:g}=this.constraints[u];p.set(Nt(m,g,c[u]))})}addListeners(){if(!this.visualElement.current)return;LM.set(this.visualElement,this);const s=this.visualElement.current,o=Kr(s,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),r=()=>{const{dragConstraints:m}=this.getProps();wo(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",r);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),_t.read(r);const u=ol(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Wn(v=>{const b=this.getAxisMotionValue(v);b&&(this.originPoint[v]+=m[v].translate,b.set(b.get()+m[v].translate))}),this.visualElement.render())}));return()=>{u(),o(),d(),p&&p()}}getProps(){const s=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:r=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:u=Zp,dragMomentum:p=!0}=s;return{...s,drag:o,dragDirectionLock:r,dragPropagation:c,dragConstraints:d,dragElastic:u,dragMomentum:p}}}function Oc(t,s,o){return(s===!0||s===t)&&(o===null||o===t)}function $M(t,s=10){let o=null;return Math.abs(t.y)>s?o="y":Math.abs(t.x)>s&&(o="x"),o}class UM extends qa{constructor(s){super(s),this.removeGroupControls=In,this.removeListeners=In,this.controls=new zM(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||In}unmount(){this.removeGroupControls(),this.removeListeners()}}const lb=t=>(s,o)=>{t&&_t.postRender(()=>t(s,o))};class PM extends qa{constructor(){super(...arguments),this.removePointerDownListener=In}onPointerDown(s){this.session=new K_(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:n1(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:o,onPan:r,onPanEnd:c}=this.node.getProps();return{onSessionStart:lb(s),onStart:lb(o),onMove:r,onEnd:(d,u)=>{delete this.session,c&&_t.postRender(()=>c(d,u))}}}mount(){this.removePointerDownListener=Kr(this.node.current,"pointerdown",s=>this.onPointerDown(s))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Yc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function cb(t,s){return s.max===s.min?0:t/(s.max-s.min)*100}const Or={correct:(t,s)=>{if(!s.target)return t;if(typeof t=="string")if(De.test(t))t=parseFloat(t);else return t;const o=cb(t,s.target.x),r=cb(t,s.target.y);return`${o}% ${r}%`}},HM={correct:(t,{treeScale:s,projectionDelta:o})=>{const r=t,c=Pa.parse(t);if(c.length>5)return r;const d=Pa.createTransformer(t),u=typeof c[0]!="number"?1:0,p=o.x.scale*s.x,m=o.y.scale*s.y;c[0+u]/=p,c[1+u]/=m;const g=Nt(p,m,.5);return typeof c[2+u]=="number"&&(c[2+u]/=g),typeof c[3+u]=="number"&&(c[3+u]/=g),d(c)}};class VM extends y.Component{componentDidMount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r,layoutId:c}=this.props,{projection:d}=s;hD(qM),d&&(o.group&&o.group.add(d),r&&r.register&&c&&r.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),Yc.hasEverUpdated=!0}getSnapshotBeforeUpdate(s){const{layoutDependency:o,visualElement:r,drag:c,isPresent:d}=this.props,u=r.projection;return u&&(u.isPresent=d,c||s.layoutDependency!==o||o===void 0?u.willUpdate():this.safeToRemove(),s.isPresent!==d&&(d?u.promote():u.relegate()||_t.postRender(()=>{const p=u.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:s}=this.props.visualElement;s&&(s.root.didUpdate(),Tm.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r}=this.props,{projection:c}=s;c&&(c.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(c),r&&r.deregister&&r.deregister(c))}safeToRemove(){const{safeToRemove:s}=this.props;s&&s()}render(){return null}}function s1(t){const[s,o]=Px(),r=y.useContext(vm);return i.jsx(VM,{...t,layoutGroup:r,switchLayoutGroup:y.useContext(Yx),isPresent:s,safeToRemove:o})}const qM={borderRadius:{...Or,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Or,borderTopRightRadius:Or,borderBottomLeftRadius:Or,borderBottomRightRadius:Or,boxShadow:HM};function GM(t,s,o){const r=dn(t)?t:al(t);return r.start(Ym("",r,s,o)),r.animation}function FM(t){return t instanceof SVGElement&&t.tagName!=="svg"}const ZM=(t,s)=>t.depth-s.depth;class KM{constructor(){this.children=[],this.isDirty=!1}add(s){Om(this.children,s),this.isDirty=!0}remove(s){Bm(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(ZM),this.isDirty=!1,this.children.forEach(s)}}function YM(t,s){const o=js.now(),r=({timestamp:c})=>{const d=c-o;d>=s&&(Ua(r),t(d-s))};return _t.read(r,!0),()=>Ua(r)}const a1=["TopLeft","TopRight","BottomLeft","BottomRight"],JM=a1.length,db=t=>typeof t=="string"?parseFloat(t):t,ub=t=>typeof t=="number"||De.test(t);function WM(t,s,o,r,c,d){c?(t.opacity=Nt(0,o.opacity!==void 0?o.opacity:1,XM(r)),t.opacityExit=Nt(s.opacity!==void 0?s.opacity:1,0,QM(r))):d&&(t.opacity=Nt(s.opacity!==void 0?s.opacity:1,o.opacity!==void 0?o.opacity:1,r));for(let u=0;u<JM;u++){const p=`border${a1[u]}Radius`;let m=fb(s,p),g=fb(o,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||ub(m)===ub(g)?(t[p]=Math.max(Nt(db(m),db(g),r),0),(ws.test(g)||ws.test(m))&&(t[p]+="%")):t[p]=g}(s.rotate||o.rotate)&&(t.rotate=Nt(s.rotate||0,o.rotate||0,r))}function fb(t,s){return t[s]!==void 0?t[s]:t.borderRadius}const XM=i1(0,.5,__),QM=i1(.5,.95,In);function i1(t,s,o){return r=>r<t?0:r>s?1:o(Oo(t,s,r))}function pb(t,s){t.min=s.min,t.max=s.max}function Kn(t,s){pb(t.x,s.x),pb(t.y,s.y)}function mb(t,s){t.translate=s.translate,t.scale=s.scale,t.originPoint=s.originPoint,t.origin=s.origin}function hb(t,s,o,r,c){return t-=s,t=rd(t,1/o,r),c!==void 0&&(t=rd(t,1/c,r)),t}function e4(t,s=0,o=1,r=.5,c,d=t,u=t){if(ws.test(s)&&(s=parseFloat(s),s=Nt(u.min,u.max,s/100)-u.min),typeof s!="number")return;let p=Nt(d.min,d.max,r);t===d&&(p-=s),t.min=hb(t.min,s,o,p,c),t.max=hb(t.max,s,o,p,c)}function gb(t,s,[o,r,c],d,u){e4(t,s[o],s[r],s[c],s.scale,d,u)}const t4=["x","scaleX","originX"],n4=["y","scaleY","originY"];function vb(t,s,o,r){gb(t.x,s,t4,o?o.x:void 0,r?r.x:void 0),gb(t.y,s,n4,o?o.y:void 0,r?r.y:void 0)}function yb(t){return t.translate===0&&t.scale===1}function o1(t){return yb(t.x)&&yb(t.y)}function bb(t,s){return t.min===s.min&&t.max===s.max}function s4(t,s){return bb(t.x,s.x)&&bb(t.y,s.y)}function xb(t,s){return Math.round(t.min)===Math.round(s.min)&&Math.round(t.max)===Math.round(s.max)}function r1(t,s){return xb(t.x,s.x)&&xb(t.y,s.y)}function _b(t){return Bn(t.x)/Bn(t.y)}function kb(t,s){return t.translate===s.translate&&t.scale===s.scale&&t.originPoint===s.originPoint}class a4{constructor(){this.members=[]}add(s){Om(this.members,s),s.scheduleRender()}remove(s){if(Bm(this.members,s),s===this.prevLead&&(this.prevLead=void 0),s===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(s){const o=this.members.findIndex(c=>s===c);if(o===0)return!1;let r;for(let c=o;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){r=d;break}}return r?(this.promote(r),!0):!1}promote(s,o){const r=this.lead;if(s!==r&&(this.prevLead=r,this.lead=s,s.show(),r)){r.instance&&r.scheduleRender(),s.scheduleRender(),s.resumeFrom=r,o&&(s.resumeFrom.preserveOpacity=!0),r.snapshot&&(s.snapshot=r.snapshot,s.snapshot.latestValues=r.animationValues||r.latestValues),s.root&&s.root.isUpdating&&(s.isLayoutDirty=!0);const{crossfade:c}=s.options;c===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(s=>{const{options:o,resumingFrom:r}=s;o.onExitComplete&&o.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(s=>{s.instance&&s.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function i4(t,s,o){let r="";const c=t.x.translate/s.x,d=t.y.translate/s.y,u=(o==null?void 0:o.z)||0;if((c||d||u)&&(r=`translate3d(${c}px, ${d}px, ${u}px) `),(s.x!==1||s.y!==1)&&(r+=`scale(${1/s.x}, ${1/s.y}) `),o){const{transformPerspective:g,rotate:v,rotateX:b,rotateY:x,skewX:S,skewY:k}=o;g&&(r=`perspective(${g}px) ${r}`),v&&(r+=`rotate(${v}deg) `),b&&(r+=`rotateX(${b}deg) `),x&&(r+=`rotateY(${x}deg) `),S&&(r+=`skewX(${S}deg) `),k&&(r+=`skewY(${k}deg) `)}const p=t.x.scale*s.x,m=t.y.scale*s.y;return(p!==1||m!==1)&&(r+=`scale(${p}, ${m})`),r||"none"}const ki={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Vr=typeof window<"u"&&window.MotionDebug!==void 0,pp=["","X","Y","Z"],o4={visibility:"hidden"},Sb=1e3;let r4=0;function mp(t,s,o,r){const{latestValues:c}=s;c[t]&&(o[t]=c[t],s.setStaticValue(t,0),r&&(r[t]=0))}function l1(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:s}=t.options;if(!s)return;const o=u_(s);if(window.MotionHasOptimisedAnimation(o,"transform")){const{layout:c,layoutId:d}=t.options;window.MotionCancelOptimisedAnimation(o,"transform",_t,!(c||d))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&l1(r)}function c1({attachResizeListener:t,defaultParent:s,measureScroll:o,checkIsScrollRoot:r,resetTransform:c}){return class{constructor(u={},p=s==null?void 0:s()){this.id=r4++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Vr&&(ki.totalNodes=ki.resolvedTargetDeltas=ki.recalculatedProjection=0),this.nodes.forEach(d4),this.nodes.forEach(h4),this.nodes.forEach(g4),this.nodes.forEach(u4),Vr&&window.MotionDebug.record(ki)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new KM)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new Lm),this.eventHandlers.get(u).add(p)}notifyListeners(u,...p){const m=this.eventHandlers.get(u);m&&m.notify(...p)}hasListeners(u){return this.eventHandlers.has(u)}mount(u,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=FM(u),this.instance=u;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let b;const x=()=>this.root.updateBlockedByResize=!1;t(u,()=>{this.root.updateBlockedByResize=!0,b&&b(),b=YM(x,250),Yc.hasAnimatedSinceResize&&(Yc.hasAnimatedSinceResize=!1,this.nodes.forEach(wb))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:b,hasLayoutChanged:x,hasRelativeTargetChanged:S,layout:k})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||v.getDefaultTransition()||_4,{onLayoutAnimationStart:N,onLayoutAnimationComplete:T}=v.getProps(),C=!this.targetLayout||!r1(this.targetLayout,k)||S,D=!x&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||D||x&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(b,D);const B={...Im(w,"layout"),onPlay:N,onComplete:T};(v.shouldReduceMotion||this.options.layoutRoot)&&(B.delay=0,B.type=!1),this.startAnimation(B)}else x||wb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ua(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(v4),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&l1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const b=this.path[v];b.shouldResetTransform=!0,b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),u&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Tb);return}this.isUpdating||this.nodes.forEach(p4),this.isUpdating=!1,this.nodes.forEach(m4),this.nodes.forEach(l4),this.nodes.forEach(c4),this.clearAllSnapshots();const p=js.now();rn.delta=ta(0,1e3/60,p-rn.timestamp),rn.timestamp=p,rn.isProcessing=!0,ip.update.process(rn),ip.preRender.process(rn),ip.render.process(rn),rn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Tm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(f4),this.sharedNodes.forEach(y4)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_t.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_t.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const u=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Lt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(p=!1),p){const m=r(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:o(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!c)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!o1(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;u&&(p||_i(this.latestValues)||v)&&(c(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return u&&(m=this.removeTransform(m)),k4(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:p}=this.options;if(!p)return Lt();const m=p.measureViewportBox();if(!(((u=this.scroll)===null||u===void 0?void 0:u.wasRoot)||this.path.some(S4))){const{scroll:v}=this.root;v&&(Co(m.x,v.offset.x),Co(m.y,v.offset.y))}return m}removeElementScroll(u){var p;const m=Lt();if(Kn(m,u),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:b,options:x}=v;v!==this.root&&b&&x.layoutScroll&&(b.wasRoot&&Kn(m,u),Co(m.x,b.offset.x),Co(m.y,b.offset.y))}return m}applyTransform(u,p=!1){const m=Lt();Kn(m,u);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&Eo(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),_i(v.latestValues)&&Eo(m,v.latestValues)}return _i(this.latestValues)&&Eo(m,this.latestValues),m}removeTransform(u){const p=Lt();Kn(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!_i(g.latestValues))continue;Kp(g.latestValues)&&g.updateSnapshot();const v=Lt(),b=g.measurePageBox();Kn(v,b),vb(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return _i(this.latestValues)&&vb(p,this.latestValues),p}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==rn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(u||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:b,layoutId:x}=this.options;if(!(!this.layout||!(b||x))){if(this.resolvedRelativeTargetAt=rn.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Lt(),this.relativeTargetOrigin=Lt(),Jr(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Kn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Lt(),this.targetWithTransforms=Lt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),jM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Kn(this.target,this.layout.layoutBox),e1(this.target,this.targetDelta)):Kn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Lt(),this.relativeTargetOrigin=Lt(),Jr(this.relativeTargetOrigin,this.target,S.target),Kn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Vr&&ki.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Kp(this.parent.latestValues)||Q_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var u;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===rn.timestamp&&(g=!1),g)return;const{layout:v,layoutId:b}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||b))return;Kn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;OM(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=Lt());const{target:k}=p;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(mb(this.prevProjectionDelta.x,this.projectionDelta.x),mb(this.prevProjectionDelta.y,this.projectionDelta.y)),Yr(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!kb(this.projectionDelta.x,this.prevProjectionDelta.x)||!kb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),Vr&&ki.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),u){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=No(),this.projectionDelta=No(),this.projectionDeltaWithTransform=No()}setAnimationOrigin(u,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},b=No();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=Lt(),S=m?m.source:void 0,k=this.layout?this.layout.source:void 0,w=S!==k,N=this.getStack(),T=!N||N.members.length<=1,C=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some(x4));this.animationProgress=0;let D;this.mixTargetDelta=B=>{const E=B/1e3;jb(b.x,u.x,E),jb(b.y,u.y,E),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jr(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b4(this.relativeTarget,this.relativeTargetOrigin,x,E),D&&s4(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=Lt()),Kn(D,this.relativeTarget)),w&&(this.animationValues=v,WM(v,g,this.latestValues,E,C,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ua(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_t.update(()=>{Yc.hasAnimatedSinceResize=!0,this.currentAnimation=GM(0,Sb,{...u,onUpdate:p=>{this.mixTargetDelta(p),u.onUpdate&&u.onUpdate(p)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Sb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=u;if(!(!p||!m||!g)){if(this!==u&&this.layout&&g&&d1(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Lt();const b=Bn(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+b;const x=Bn(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+x}Kn(p,m),Eo(p,v),Yr(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new a4),this.sharedNodes.get(u).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){var u;const{layoutId:p}=this.options;return p?((u=this.getStack())===null||u===void 0?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:p}=this.options;return p?(u=this.getStack())===null||u===void 0?void 0:u.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let p=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&mp("z",u,g,this.animationValues);for(let v=0;v<pp.length;v++)mp(`rotate${pp[v]}`,u,g,this.animationValues),mp(`skew${pp[v]}`,u,g,this.animationValues);u.render();for(const v in g)u.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);u.scheduleRender()}getProjectionStyles(u){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return o4;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Zc(u==null?void 0:u.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const b=this.getLead();if(!this.projectionDelta||!this.layout||!b.target){const w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=Zc(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!_i(this.latestValues)&&(w.transform=v?v({},""):"none",this.hasProjected=!1),w}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),g.transform=i4(this.projectionDeltaWithTransform,this.treeScale,x),v&&(g.transform=v(x,g.transform));const{x:S,y:k}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${k.origin*100}% 0`,b.animationValues?g.opacity=b===this?(m=(p=x.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:g.opacity=b===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const w in nd){if(x[w]===void 0)continue;const{correct:N,applyTo:T}=nd[w],C=g.transform==="none"?x[w]:N(x[w],b);if(T){const D=T.length;for(let B=0;B<D;B++)g[T[B]]=C}else g[w]=C}return this.options.layoutId&&(g.pointerEvents=b===this?Zc(u==null?void 0:u.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>{var p;return(p=u.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(Tb),this.root.sharedNodes.clear()}}}function l4(t){t.updateLayout()}function c4(t){var s;const o=((s=t.resumeFrom)===null||s===void 0?void 0:s.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:c}=t.layout,{animationType:d}=t.options,u=o.source!==t.layout.source;d==="size"?Wn(b=>{const x=u?o.measuredBox[b]:o.layoutBox[b],S=Bn(x);x.min=r[b].min,x.max=x.min+S}):d1(d,o.layoutBox,r)&&Wn(b=>{const x=u?o.measuredBox[b]:o.layoutBox[b],S=Bn(r[b]);x.max=x.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[b].max=t.relativeTarget[b].min+S)});const p=No();Yr(p,r,o.layoutBox);const m=No();u?Yr(m,t.applyTransform(c,!0),o.measuredBox):Yr(m,r,o.layoutBox);const g=!o1(p);let v=!1;if(!t.resumeFrom){const b=t.getClosestProjectingParent();if(b&&!b.resumeFrom){const{snapshot:x,layout:S}=b;if(x&&S){const k=Lt();Jr(k,o.layoutBox,x.layoutBox);const w=Lt();Jr(w,r,S.layoutBox),r1(k,w)||(v=!0),b.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=k,t.relativeParent=b)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:o,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function d4(t){Vr&&ki.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function u4(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function f4(t){t.clearSnapshot()}function Tb(t){t.clearMeasurements()}function p4(t){t.isLayoutDirty=!1}function m4(t){const{visualElement:s}=t.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),t.resetTransform()}function wb(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function h4(t){t.resolveTargetDelta()}function g4(t){t.calcProjection()}function v4(t){t.resetSkewAndRotation()}function y4(t){t.removeLeadSnapshot()}function jb(t,s,o){t.translate=Nt(s.translate,0,o),t.scale=Nt(s.scale,1,o),t.origin=s.origin,t.originPoint=s.originPoint}function Nb(t,s,o,r){t.min=Nt(s.min,o.min,r),t.max=Nt(s.max,o.max,r)}function b4(t,s,o,r){Nb(t.x,s.x,o.x,r),Nb(t.y,s.y,o.y,r)}function x4(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const _4={duration:.45,ease:[.4,0,.1,1]},Cb=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Eb=Cb("applewebkit/")&&!Cb("chrome/")?Math.round:In;function Ab(t){t.min=Eb(t.min),t.max=Eb(t.max)}function k4(t){Ab(t.x),Ab(t.y)}function d1(t,s,o){return t==="position"||t==="preserve-aspect"&&!wM(_b(s),_b(o),.2)}function S4(t){var s;return t!==t.root&&((s=t.scroll)===null||s===void 0?void 0:s.wasRoot)}const T4=c1({attachResizeListener:(t,s)=>ol(t,"resize",s),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hp={current:void 0},u1=c1({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!hp.current){const t=new T4({});t.mount(window),t.setOptions({layoutScroll:!0}),hp.current=t}return hp.current},resetTransform:(t,s)=>{t.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),w4={pan:{Feature:PM},drag:{Feature:UM,ProjectionNode:u1,MeasureLayout:s1}};function j4(t,s,o){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let c=document;const d=(r=void 0)!==null&&r!==void 0?r:c.querySelectorAll(t);return d?Array.from(d):[]}return Array.from(t)}function f1(t,s){const o=j4(t),r=new AbortController,c={passive:!0,...s,signal:r.signal};return[o,c,()=>r.abort()]}function Db(t){return s=>{s.pointerType==="touch"||Z_()||t(s)}}function N4(t,s,o={}){const[r,c,d]=f1(t,o),u=Db(p=>{const{target:m}=p,g=s(p);if(typeof g!="function"||!m)return;const v=Db(b=>{g(b),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,c)});return r.forEach(p=>{p.addEventListener("pointerenter",u,c)}),d}function Rb(t,s,o){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",o==="Start");const c="onHover"+o,d=r[c];d&&_t.postRender(()=>d(s,ml(s)))}class C4 extends qa{mount(){const{current:s}=this.node;s&&(this.unmount=N4(s,o=>(Rb(this.node,o,"Start"),r=>Rb(this.node,r,"End"))))}unmount(){}}class E4 extends qa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let s=!1;try{s=this.node.current.matches(":focus-visible")}catch{s=!0}!s||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pl(ol(this.node.current,"focus",()=>this.onFocus()),ol(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const p1=(t,s)=>s?t===s?!0:p1(t,s.parentElement):!1,A4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function D4(t){return A4.has(t.tagName)||t.tabIndex!==-1}const qr=new WeakSet;function Mb(t){return s=>{s.key==="Enter"&&t(s)}}function gp(t,s){t.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const R4=(t,s)=>{const o=t.currentTarget;if(!o)return;const r=Mb(()=>{if(qr.has(o))return;gp(o,"down");const c=Mb(()=>{gp(o,"up")}),d=()=>gp(o,"cancel");o.addEventListener("keyup",c,s),o.addEventListener("blur",d,s)});o.addEventListener("keydown",r,s),o.addEventListener("blur",()=>o.removeEventListener("keydown",r),s)};function Ib(t){return Jm(t)&&!Z_()}function M4(t,s,o={}){const[r,c,d]=f1(t,o),u=p=>{const m=p.currentTarget;if(!Ib(p)||qr.has(m))return;qr.add(m);const g=s(p),v=(S,k)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!Ib(S)||!qr.has(m))&&(qr.delete(m),typeof g=="function"&&g(S,{success:k}))},b=S=>{v(S,o.useGlobalTarget||p1(m,S.target))},x=S=>{v(S,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",x,c)};return r.forEach(p=>{!D4(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(o.useGlobalTarget?window:p).addEventListener("pointerdown",u,c),p.addEventListener("focus",g=>R4(g,c),c)}),d}function Ob(t,s,o){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",o==="Start");const c="onTap"+(o==="End"?"":o),d=r[c];d&&_t.postRender(()=>d(s,ml(s)))}class I4 extends qa{mount(){const{current:s}=this.node;s&&(this.unmount=M4(s,o=>(Ob(this.node,o,"Start"),(r,{success:c})=>Ob(this.node,r,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Jp=new WeakMap,vp=new WeakMap,O4=t=>{const s=Jp.get(t.target);s&&s(t)},B4=t=>{t.forEach(O4)};function L4({root:t,...s}){const o=t||document;vp.has(o)||vp.set(o,{});const r=vp.get(o),c=JSON.stringify(s);return r[c]||(r[c]=new IntersectionObserver(B4,{root:t,...s})),r[c]}function z4(t,s,o){const r=L4(s);return Jp.set(t,o),r.observe(t),()=>{Jp.delete(t),r.unobserve(t)}}const $4={some:0,all:1};class U4 extends qa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:s={}}=this.node.getProps(),{root:o,margin:r,amount:c="some",once:d}=s,u={root:o?o.current:void 0,rootMargin:r,threshold:typeof c=="number"?c:$4[c]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,d&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:b}=this.node.getProps(),x=g?v:b;x&&x(m)};return z4(this.node.current,u,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:s,prevProps:o}=this.node;["amount","margin","root"].some(P4(s,o))&&this.startObserver()}unmount(){}}function P4({viewport:t={}},{viewport:s={}}={}){return o=>t[o]!==s[o]}const H4={inView:{Feature:U4},tap:{Feature:I4},focus:{Feature:E4},hover:{Feature:C4}},V4={layout:{ProjectionNode:u1,MeasureLayout:s1}},ld={current:null},Wm={current:!1};function m1(){if(Wm.current=!0,!!xm)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),s=()=>ld.current=t.matches;t.addListener(s),s()}else ld.current=!1}const q4=[...O_,cn,Pa],G4=t=>q4.find(I_(t)),Bb=new WeakMap;function F4(t,s,o){for(const r in s){const c=s[r],d=o[r];if(dn(c))t.addValue(r,c);else if(dn(d))t.addValue(r,al(c,{owner:t}));else if(d!==c)if(t.hasValue(r)){const u=t.getValue(r);u.liveStyle===!0?u.jump(c):u.hasAnimated||u.set(c)}else{const u=t.getStaticValue(r);t.addValue(r,al(u!==void 0?u:c,{owner:t}))}}for(const r in o)s[r]===void 0&&t.removeValue(r);return s}const Lb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Z4{scrapeMotionValuesFromProps(s,o,r){return{}}constructor({parent:s,props:o,presenceContext:r,reducedMotionConfig:c,blockInitialAnimation:d,visualState:u},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=js.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,_t.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=u;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=o.initial?{...m}:{},this.renderState=g,this.parent=s,this.props=o,this.presenceContext=r,this.depth=s?s.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=wd(o),this.isVariantNode=Zx(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(s&&s.current);const{willChange:b,...x}=this.scrapeMotionValuesFromProps(o,{},this);for(const S in x){const k=x[S];m[S]!==void 0&&dn(k)&&k.set(m[S],!1)}}mount(s){this.current=s,Bb.set(s,this),this.projection&&!this.projection.instance&&this.projection.mount(s),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,r)=>this.bindToMotionValue(r,o)),Wm.current||m1(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ld.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Bb.delete(this.current),this.projection&&this.projection.unmount(),Ua(this.notifyUpdate),Ua(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const o=this.features[s];o&&(o.unmount(),o.isMounted=!1)}this.current=null}bindToMotionValue(s,o){this.valueSubscriptions.has(s)&&this.valueSubscriptions.get(s)();const r=Ri.has(s),c=o.on("change",p=>{this.latestValues[s]=p,this.props.onUpdate&&_t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),d=o.on("renderRequest",this.scheduleRender);let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,s,o)),this.valueSubscriptions.set(s,()=>{c(),d(),u&&u(),o.owner&&o.stop()})}sortNodePosition(s){return!this.current||!this.sortInstanceNodePosition||this.type!==s.type?0:this.sortInstanceNodePosition(this.current,s.current)}updateFeatures(){let s="animation";for(s in Io){const o=Io[s];if(!o)continue;const{isEnabled:r,Feature:c}=o;if(!this.features[s]&&c&&r(this.props)&&(this.features[s]=new c(this)),this.features[s]){const d=this.features[s];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Lt()}getStaticValue(s){return this.latestValues[s]}setStaticValue(s,o){this.latestValues[s]=o}update(s,o){(s.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=s,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let r=0;r<Lb.length;r++){const c=Lb[r];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d="on"+c,u=s[d];u&&(this.propEventSubscriptions[c]=this.on(c,u))}this.prevMotionValues=F4(this,this.scrapeMotionValuesFromProps(s,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(s){return this.props.variants?this.props.variants[s]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(s){const o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(s),()=>o.variantChildren.delete(s)}addValue(s,o){const r=this.values.get(s);o!==r&&(r&&this.removeValue(s),this.bindToMotionValue(s,o),this.values.set(s,o),this.latestValues[s]=o.get())}removeValue(s){this.values.delete(s);const o=this.valueSubscriptions.get(s);o&&(o(),this.valueSubscriptions.delete(s)),delete this.latestValues[s],this.removeValueFromRenderState(s,this.renderState)}hasValue(s){return this.values.has(s)}getValue(s,o){if(this.props.values&&this.props.values[s])return this.props.values[s];let r=this.values.get(s);return r===void 0&&o!==void 0&&(r=al(o===null?void 0:o,{owner:this}),this.addValue(s,r)),r}readValue(s,o){var r;let c=this.latestValues[s]!==void 0||!this.current?this.latestValues[s]:(r=this.getBaseTargetFromProps(this.props,s))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,s,this.options);return c!=null&&(typeof c=="string"&&(R_(c)||S_(c))?c=parseFloat(c):!G4(c)&&Pa.test(o)&&(c=E_(s,o)),this.setBaseTarget(s,dn(c)?c.get():c)),dn(c)?c.get():c}setBaseTarget(s,o){this.baseTarget[s]=o}getBaseTarget(s){var o;const{initial:r}=this.props;let c;if(typeof r=="string"||typeof r=="object"){const u=jm(this.props,r,(o=this.presenceContext)===null||o===void 0?void 0:o.custom);u&&(c=u[s])}if(r&&c!==void 0)return c;const d=this.getBaseTargetFromProps(this.props,s);return d!==void 0&&!dn(d)?d:this.initialValues[s]!==void 0&&c===void 0?void 0:this.baseTarget[s]}on(s,o){return this.events[s]||(this.events[s]=new Lm),this.events[s].add(o)}notify(s,...o){this.events[s]&&this.events[s].notify(...o)}}class h1 extends Z4{constructor(){super(...arguments),this.KeyframeResolver=B_}sortInstanceNodePosition(s,o){return s.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(s,o){return s.style?s.style[o]:void 0}removeValueFromRenderState(s,{vars:o,style:r}){delete o[s],delete r[s]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:s}=this.props;dn(s)&&(this.childSubscription=s.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}}function K4(t){return window.getComputedStyle(t)}class Y4 extends h1{constructor(){super(...arguments),this.type="html",this.renderInstance=n_}readValueFromInstance(s,o){if(Ri.has(o)){const r=Gm(o);return r&&r.default||0}else{const r=K4(s),c=(Qx(o)?r.getPropertyValue(o):r[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(s,{transformPagePoint:o}){return t1(s,o)}build(s,o,r){Em(s,o,r.transformTemplate)}scrapeMotionValuesFromProps(s,o,r){return Mm(s,o,r)}}class J4 extends h1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Lt}getBaseTargetFromProps(s,o){return s[o]}readValueFromInstance(s,o){if(Ri.has(o)){const r=Gm(o);return r&&r.default||0}return o=s_.has(o)?o:Sm(o),s.getAttribute(o)}scrapeMotionValuesFromProps(s,o,r){return o_(s,o,r)}build(s,o,r){Am(s,o,this.isSVGTag,r.transformTemplate)}renderInstance(s,o,r,c){a_(s,o,r,c)}mount(s){this.isSVGTag=Rm(s.tagName),super.mount(s)}}const W4=(t,s)=>wm(t)?new J4(s):new Y4(s,{allowProjection:t!==y.Fragment}),X4=TD({...hM,...H4,...w4,...V4},W4),Rt=$A(X4);function Q4(){!Wm.current&&m1();const[t]=y.useState(ld.current);return t}const e3="_overlay_cmicx_1",t3="_dialog_cmicx_11",n3="_title_cmicx_30",s3="_description_cmicx_38",a3="_actions_cmicx_45",i3="_cancelButton_cmicx_52",o3="_confirmButton_cmicx_79",yi={overlay:e3,dialog:t3,title:n3,description:s3,actions:a3,cancelButton:i3,confirmButton:o3};function Ci({isOpen:t,title:s,description:o,confirmLabel:r="Delete",onConfirm:c,onCancel:d}){const u=y.useId(),p=y.useId();return i.jsx(us,{children:t&&i.jsx(Rt.div,{className:yi.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:d,onKeyDown:m=>{m.key==="Escape"&&d()},role:"dialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":o?p:void 0,children:i.jsxs(Rt.div,{className:yi.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:m=>m.stopPropagation(),children:[i.jsx("h3",{id:u,className:yi.title,children:s}),o&&i.jsx("p",{id:p,className:yi.description,children:o}),i.jsxs("div",{className:yi.actions,children:[i.jsx("button",{type:"button",className:yi.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),i.jsx("button",{type:"button",className:yi.confirmButton,onClick:c,children:r})]})]})})})}const r3="_skeleton_1gqp4_9",l3="_circular_1gqp4_17",c3="_textContainer_1gqp4_26",d3="_card_1gqp4_31",cd={skeleton:r3,circular:l3,textContainer:c3,card:d3};function we({width:t="100%",height:s="1rem",borderRadius:o,variant:r="rectangular",className:c}){const d=[cd.skeleton,r==="circular"?cd.circular:"",c??""].filter(Boolean).join(" ");return i.jsx("div",{className:d,style:{width:t,height:s,...o&&r!=="circular"?{borderRadius:o}:{}},"aria-hidden":"true","data-testid":"skeleton"})}function Wp({lines:t=3,lastLineWidth:s="60%",lineHeight:o="0.75rem",gap:r="var(--space-sm)",className:c}){return i.jsx("div",{className:`${cd.textContainer} ${c??""}`,style:{gap:r},"aria-hidden":"true","data-testid":"skeleton-text",children:Array.from({length:t},(d,u)=>i.jsx(we,{width:u===t-1&&t>1?s:"100%",height:o},u))})}function dd({lines:t=2,className:s}){return i.jsxs("div",{className:`${cd.card} ${s??""}`,"aria-hidden":"true","data-testid":"skeleton-card",children:[i.jsx(we,{width:"40%",height:"1.25rem"}),i.jsx(Wp,{lines:t})]})}const u3="_spinner_1uyt1_1",f3="_spin_1uyt1_1",p3="_sm_1uyt1_14",m3="_md_1uyt1_20",h3="_lg_1uyt1_26",g3="_xl_1uyt1_32",zb={spinner:u3,spin:f3,sm:p3,md:m3,lg:h3,xl:g3};function g1({size:t="md",className:s,label:o="Loading",liveRegion:r=!1}){return i.jsx("span",{className:`${zb.spinner} ${zb[t]} ${s??""}`,role:r?"status":void 0,"aria-label":o,"aria-hidden":r?void 0:!0})}const v3="_splash_1bn1g_1",y3="_logo_1bn1g_11",$b={splash:v3,logo:y3};function v1(){return i.jsxs("div",{className:$b.splash,"data-testid":"splash-screen",children:[i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:$b.logo}),i.jsx(g1,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}const b3="_wrapper_4e5yt_1",x3="_wrapperBlock_4e5yt_6",_3="_tooltip_4e5yt_11",k3="_visible_4e5yt_31",S3="_top_4e5yt_41",T3="_bottom_4e5yt_48",w3="_left_4e5yt_55",j3="_right_4e5yt_62",Br={wrapper:b3,wrapperBlock:x3,tooltip:_3,visible:k3,top:S3,bottom:T3,left:w3,right:j3},N3=300,Bc=6;function Lo({text:t,placement:s="top",delayMs:o=N3,inline:r=!0,children:c,className:d,"data-testid":u}){const[p,m]=y.useState(!1),[g,v]=y.useState({top:0,left:0}),b=y.useRef(null),x=y.useRef(null),S=y.useRef(void 0),k=y.useId(),w=typeof document<"u",N=y.useCallback(()=>{if(!b.current||!x.current)return;const U=b.current.getBoundingClientRect(),Q=x.current.getBoundingClientRect();let $=0,W=0;switch(s){case"top":$=U.top-Q.height-Bc,W=U.left+U.width/2-Q.width/2;break;case"bottom":$=U.bottom+Bc,W=U.left+U.width/2-Q.width/2;break;case"left":$=U.top+U.height/2-Q.height/2,W=U.left-Q.width-Bc;break;case"right":$=U.top+U.height/2-Q.height/2,W=U.right+Bc;break}v({top:$,left:W})},[s]),T=y.useCallback(U=>{S.current!==void 0&&clearTimeout(S.current),S.current=setTimeout(()=>{N(),m(!0),S.current=void 0},U)},[N]),C=y.useCallback(()=>{T(o)},[o,T]),D=y.useCallback(()=>{T(0)},[T]),B=y.useCallback(()=>{S.current!==void 0&&(clearTimeout(S.current),S.current=void 0),m(!1)},[]);y.useEffect(()=>{if(!p)return;const U=Q=>{Q.key==="Escape"&&B()};return document.addEventListener("keydown",U),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{document.removeEventListener("keydown",U),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[p,B,N]),y.useEffect(()=>()=>{S.current!==void 0&&clearTimeout(S.current)},[]);const E=r?"span":"div",A=[r?Br.wrapper:Br.wrapperBlock,d].filter(Boolean).join(" ");let P=c;if(y.isValidElement(c)){const U=c,Q=U.props["aria-describedby"],$=p?Q?`${Q} ${k}`:k:Q;P=y.cloneElement(U,{"aria-describedby":$})}const I=i.jsx("div",{ref:x,id:k,role:"tooltip",className:`${Br.tooltip} ${Br[s]} ${p?Br.visible:""}`,style:{top:g.top,left:g.left},"data-testid":u??"tooltip",children:t});return i.jsxs(E,{ref:b,className:A,onMouseEnter:C,onMouseLeave:B,onFocus:D,onBlur:B,children:[P,w?fT.createPortal(I,document.body):null]})}const C3="_attemptSelector_ggigl_1",E3="_attemptLabel_ggigl_17",A3="_attemptButton_ggigl_21",D3="_attemptActive_ggigl_38",R3="_attemptStatus_ggigl_44",Lr={attemptSelector:C3,attemptLabel:E3,attemptButton:A3,attemptActive:D3,attemptStatus:R3};function M3({taskSessions:t,selectedSessionId:s,onSelect:o}){if(!(t.length<2))return i.jsxs("div",{className:Lr.attemptSelector,"data-testid":"attempt-selector",children:[i.jsx("span",{className:Lr.attemptLabel,children:"Attempts:"}),t.map((r,c)=>{const d=r.id===s,u=r.status==="stopped"&&r.endReason==="completed"?"✓":r.status==="stopped"?"✗":r.status==="running"||r.status==="idle"?"●":"";return i.jsxs("button",{className:`${Lr.attemptButton} ${d?Lr.attemptActive:""}`,onClick:()=>o(r.id),title:`Attempt #${c+1} — ${r.status}`,"aria-label":`Attempt #${c+1}, ${r.status}`,"aria-pressed":d,"data-testid":`attempt-${c+1}`,children:["#",c+1,u&&i.jsx("span",{className:Lr.attemptStatus,children:u})]},r.id)})]})}const I3="_row_ldkru_1",O3="_hoverActions_ldkru_5",B3="_hoverButton_ldkru_31",L3="_selectingRow_ldkru_72",z3="_selected_ldkru_83",$3="_checkboxArea_ldkru_90",U3="_checkbox_ldkru_90",P3="_contentArea_ldkru_106",os={row:I3,hoverActions:O3,hoverButton:B3,selectingRow:L3,selected:z3,checkboxArea:$3,checkbox:U3,contentArea:P3};function H3({copyText:t,isContentBearing:s,isSelecting:o,isSelected:r,checkboxLabel:c,onSelect:d,onToggle:u,onCopied:p,children:m}){const[g,v]=y.useState(!1),b=y.useRef(void 0);y.useEffect(()=>()=>{b.current!==void 0&&clearTimeout(b.current)},[]);const x=y.useCallback(async()=>{try{await navigator.clipboard.writeText(t),v(!0),p==null||p(),b.current!==void 0&&clearTimeout(b.current),b.current=setTimeout(()=>{v(!1)},2e3)}catch{}},[t,p]),S=y.useCallback(k=>{!o||k.target.closest("a, button, input, textarea, select, [role=button]")||(k.preventDefault(),u(k.shiftKey))},[o,u]);return s?o?i.jsxs("div",{className:`${os.row} ${os.selectingRow} ${r?os.selected:""}`,onClick:S,"data-testid":"event-selectable-row",children:[i.jsx("div",{className:os.checkboxArea,children:i.jsx("input",{type:"checkbox",checked:r,onChange:k=>{u(k.nativeEvent.shiftKey)},onClick:k=>{k.stopPropagation()},className:os.checkbox,"aria-label":c??"Select this event","data-testid":"event-select-checkbox"})}),i.jsx("div",{className:os.contentArea,children:m})]}):i.jsxs("div",{className:os.row,"data-testid":"event-hover-row",children:[i.jsxs("div",{className:os.hoverActions,"data-testid":"event-hover-actions",children:[i.jsx("button",{type:"button",className:os.hoverButton,onClick:()=>{x().catch(()=>{})},"aria-label":"Copy event content","data-testid":"event-hover-copy",children:g?i.jsx(Ei,{size:lt,"aria-hidden":"true"}):i.jsx(gx,{size:lt,"aria-hidden":"true"})}),i.jsx("button",{type:"button",className:os.hoverButton,onClick:d,"aria-label":"Select this event","data-testid":"event-hover-select",children:i.jsx(Q2,{size:lt,"aria-hidden":"true"})})]}),m]}):i.jsx("div",{className:os.row,children:m})}const V3="_bar_1vah7_1",q3="_left_1vah7_21",G3="_right_1vah7_27",F3="_count_1vah7_33",Z3="_toggleButton_1vah7_40",K3="_copyButton_1vah7_68",Y3="_cancelButton_1vah7_108",bi={bar:V3,left:q3,right:G3,count:F3,toggleButton:Z3,copyButton:K3,cancelButton:Y3};function J3({selectedCount:t,totalSelectable:s,onSelectAll:o,onDeselectAll:r,onCopy:c,onCancel:d}){const u=t>0&&t>=s;return i.jsxs(Rt.div,{className:bi.bar,initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:12},transition:{duration:.15},"data-testid":"floating-action-bar",children:[i.jsxs("div",{className:bi.left,children:[i.jsxs("span",{className:bi.count,"data-testid":"floating-bar-count",children:[t," selected"]}),i.jsx("button",{type:"button",className:bi.toggleButton,onClick:u?r:o,"data-testid":"floating-bar-select-all",children:u?"Deselect all":"Select all"})]}),i.jsxs("div",{className:bi.right,children:[i.jsxs("button",{type:"button",className:bi.copyButton,onClick:c,disabled:t===0,"data-testid":"floating-bar-copy",children:[i.jsx(v2,{size:lt,"aria-hidden":"true"}),"Copy"]}),i.jsx("button",{type:"button",className:bi.cancelButton,onClick:d,"aria-label":"Cancel selection","data-testid":"floating-bar-cancel",children:i.jsx(Ha,{size:lt,"aria-hidden":"true"})})]})]})}const y1=50;function W3(t,s,o,r,c=y1){return r?t<c:s-t-o<c}function X3(t,s){const o=s-t;return o>0?o:0}function Q3({scrollRef:t,contentLength:s,isReversed:o,paused:r}){const[c,d]=y.useState(!0),u=y.useRef(0),p=y.useRef(!1),m=y.useRef(0);y.useEffect(()=>{const v=t.current;if(!v)return;let b=!0;const x=()=>{m.current||(m.current=requestAnimationFrame(()=>{m.current=0;const S=W3(v.scrollTop,v.scrollHeight,v.clientHeight,o,y1);S!==b&&(b=S,d(S))}))};return v.addEventListener("scroll",x,{passive:!0}),()=>{v.removeEventListener("scroll",x),m.current&&(cancelAnimationFrame(m.current),m.current=0)}},[t,o]),y.useLayoutEffect(()=>{const v=t.current;!v||p.current||(p.current=!0,o?v.scrollTop=0:v.scrollTop=v.scrollHeight,d(!0))},[t,o]),y.useLayoutEffect(()=>{const v=t.current;if(v){if(r){u.current=v.scrollHeight;return}if(o&&!c){const b=X3(u.current,v.scrollHeight);b>0&&(v.scrollTop+=b)}c&&(o?v.scrollTo({top:0,behavior:"smooth"}):v.scrollTo({top:v.scrollHeight,behavior:"smooth"})),u.current=v.scrollHeight}},[s,c,o,r,t]);const g=y.useCallback(()=>{const v=t.current;if(!v)return;const b=o?0:v.scrollHeight;v.scrollTo({top:b,behavior:"smooth"}),d(!0)},[t,o]);return{isAtAnchor:c,scrollToAnchor:g}}const e6=new Set(["text","output","user_input","tool_use","tool_result","error"]);function rl(t){return e6.has(t.eventType)}function t6(t){var s;switch(t.eventType){case"tool_result":{if((s=t.toolUseCtx)!=null&&s.detailedResult)return t.toolUseCtx.detailedResult;let o=t.content;if(t.content.trimStart().startsWith("{"))try{const r=JSON.parse(t.content);typeof r.content=="string"&&(o=r.content)}catch{}return o}case"tool_use":try{const o=JSON.parse(t.content),r=o.tool??"tool",c=o.args!==void 0?JSON.stringify(o.args,void 0,2):"";return`${r}
|
|
264
|
+
${c}`}catch{return t.content}default:return t.content}}function Ub(t){if(t==null)return"";if(typeof t!="object")return String(t);const s=t;return typeof s.command=="string"?`\`${s.command}\``:typeof s.file_path=="string"||typeof s.filePath=="string"?`\`${s.file_path??s.filePath}\``:typeof s.path=="string"?`\`${s.path}\``:typeof s.query=="string"?`\`${s.query}\``:typeof s.pattern=="string"?`\`${s.pattern}\``:""}function n6(t){var o;const s=[];for(const r of t){if(!rl(r))continue;const c=new Date(r.timestamp).toLocaleTimeString();switch(r.eventType){case"text":case"output":{s.push(`**Assistant** (${c}):
|
|
265
|
+
${r.content}`);break}case"user_input":{s.push(`**User** (${c}):
|
|
266
|
+
${r.content}`);break}case"tool_result":{let d=((o=r.toolUseCtx)==null?void 0:o.detailedResult)??void 0;if(!d&&(d=r.content,r.content.trimStart().startsWith("{")))try{const u=JSON.parse(r.content);typeof u.content=="string"&&(d=u.content)}catch{}if(r.toolUseCtx){const u=Ub(r.toolUseCtx.args),p=u?`**Tool: ${r.toolUseCtx.tool}** ${u}`:`**Tool: ${r.toolUseCtx.tool}**`;s.push(`${p} (${c}):
|
|
267
|
+
${d}`)}else s.push(`**Tool output** (${c}):
|
|
268
|
+
${d}`);break}case"tool_use":{let d="tool",u;try{const g=JSON.parse(r.content);d=g.tool??"tool",u=g.args}catch{}const p=Ub(u),m=p?`**Tool: ${d}** ${p}`:`**Tool: ${d}**`;u!==void 0?s.push(`${m} (${c}):
|
|
269
|
+
\`\`\`json
|
|
270
|
+
${JSON.stringify(u,void 0,2)}
|
|
271
|
+
\`\`\``):s.push(`${m} (${c}):`);break}case"error":{s.push(`**Error** (${c}):
|
|
272
|
+
${r.content}`);break}}}return s.join(`
|
|
273
|
+
|
|
274
|
+
`)}function s6({events:t,formatForClipboard:s}){const[o,r]=y.useState(!1),[c,d]=y.useState(new Set),u=y.useRef(void 0),p=y.useMemo(()=>c.size,[c]),m=y.useCallback(k=>{r(!0),k!==void 0?(d(new Set([k])),u.current=k):(d(new Set),u.current=void 0)},[]),g=y.useCallback(()=>{r(!1),d(new Set),u.current=void 0},[]),v=y.useCallback((k,w)=>{if(w&&u.current!==void 0){const N=Math.min(u.current,k),T=Math.max(u.current,k);d(C=>{const D=new Set(C);for(let B=N;B<=T;B++)B<t.length&&rl(t[B])&&D.add(B);return D})}else d(N=>{const T=new Set(N);return T.has(k)?T.delete(k):T.add(k),T.size===0?(r(!1),u.current=void 0):u.current=k,T})},[t]),b=y.useCallback(()=>{const k=new Set;for(let w=0;w<t.length;w++)rl(t[w])&&k.add(w);d(k)},[t]),x=y.useCallback(()=>{d(new Set)},[]),S=y.useCallback(async()=>{const w=[...c].sort((T,C)=>T-C).filter(T=>T<t.length).map(T=>t[T]);if(w.length===0)return!1;const N=s(w);try{return await navigator.clipboard.writeText(N),!0}catch{return!1}},[c,t,s]);return{isSelecting:o,selectedIndices:c,selectedCount:p,enterSelectionMode:m,cancelSelection:g,toggleEvent:v,selectAll:b,deselectAll:x,copySelected:S}}const a6="_wrapper_1cdza_1",i6="_scrollContainer_1cdza_9",o6="_selectingPadding_1cdza_16",r6="_toolbar_1cdza_20",l6="_directionToggle_1cdza_27",c6="_scrollToAnchor_1cdza_65",d6="_scrollToAnchorBottom_1cdza_89",u6="_scrollToAnchorTop_1cdza_93",f6="_eventOverflowWarning_1cdza_97",Ys={wrapper:a6,scrollContainer:i6,selectingPadding:o6,toolbar:r6,directionToggle:l6,scrollToAnchor:c6,scrollToAnchorBottom:d6,scrollToAnchorTop:u6,eventOverflowWarning:f6};function p6(t){const s=new Date(t.timestamp).toLocaleTimeString();switch(t.eventType){case"text":case"output":return`Select message from assistant at ${s}`;case"user_input":return`Select message from user at ${s}`;case"tool_result":case"tool_use":return`Select tool event at ${s}`;case"error":return`Select error at ${s}`;default:return`Select event at ${s}`}}const b1="grackle-stream-direction";function m6(){try{return localStorage.getItem(b1)==="reversed"}catch{return!1}}function h6({eventsDropped:t}){return t<=0?i.jsx(i.Fragment,{}):i.jsxs("div",{className:Ys.eventOverflowWarning,role:"alert",children:[i.jsx(om,{size:tn,"aria-hidden":"true"})," ",t.toLocaleString()," older event",t===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function Xm({events:t,eventsDropped:s,emptyState:o,onShowToast:r}){const c=y.useRef(null),[d,u]=y.useState(m6),p=Q4(),m=s6({events:t,formatForClipboard:n6}),g=y.useMemo(()=>t.filter(rl).length,[t]),v=y.useMemo(()=>d?[...t].reverse():t,[t,d]),{isAtAnchor:b,scrollToAnchor:x}=Q3({scrollRef:c,contentLength:t.length,isReversed:d,paused:m.isSelecting}),S=()=>{const T=!d;u(T);try{localStorage.setItem(b1,T?"reversed":"default")}catch{}};y.useEffect(()=>{if(!m.isSelecting)return;const T=C=>{C.key==="Escape"&&m.cancelSelection()};return window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}},[m.isSelecting,m.cancelSelection]);const k=y.useCallback(async()=>{await m.copySelected()&&(r==null||r(`Copied ${m.selectedCount} message${m.selectedCount===1?"":"s"} to clipboard`,"success"))},[m,r]),w=p?0:.2,N=d?-8:8;return i.jsxs("div",{className:Ys.wrapper,children:[i.jsx("div",{className:Ys.toolbar,children:i.jsx(Lo,{text:d?"Showing newest first":"Showing oldest first",children:i.jsx("button",{className:Ys.directionToggle,onClick:S,"aria-label":d?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:d?i.jsx(ry,{size:tn,"aria-hidden":"true"}):i.jsx(ly,{size:tn,"aria-hidden":"true"})})})}),i.jsxs("div",{ref:c,className:`${Ys.scrollContainer} ${m.isSelecting?Ys.selectingPadding:""}`,"data-testid":"event-stream-scroll",children:[t.length===0&&o,i.jsx(h6,{eventsDropped:s}),i.jsx(us,{initial:!1,children:v.map((T,C)=>{const D=d?t.length-1-C:C;return i.jsx(Rt.div,{initial:{opacity:0,y:N},animate:{opacity:1,y:0},transition:{duration:w,ease:"easeOut"},children:i.jsx(H3,{copyText:t6(T),isContentBearing:rl(T),isSelecting:m.isSelecting,isSelected:m.selectedIndices.has(D),checkboxLabel:p6(T),onSelect:()=>{m.enterSelectionMode(D)},onToggle:B=>{m.toggleEvent(D,B)},onCopied:()=>{r==null||r("Copied to clipboard","success")},children:i.jsx(NA,{event:T,toolUseCtx:T.toolUseCtx,settled:T.settled})})},`${T.sessionId}-${T.timestamp}-${D}`)})})]}),i.jsx(us,{children:m.isSelecting&&i.jsx(J3,{selectedCount:m.selectedCount,totalSelectable:g,onSelectAll:m.selectAll,onDeselectAll:m.deselectAll,onCopy:()=>{k().catch(()=>{})},onCancel:m.cancelSelection})}),i.jsx(us,{children:!b&&i.jsxs(Rt.button,{className:`${Ys.scrollToAnchor} ${d?Ys.scrollToAnchorTop:Ys.scrollToAnchorBottom}`,onClick:x,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[d?i.jsx(ly,{size:tn,"aria-hidden":"true"}):i.jsx(ry,{size:tn,"aria-hidden":"true"})," New events"]})})]})}function Qm(t){const{value:s,onSave:o,validate:r,fieldId:c,activeFieldId:d,onActivate:u,enterToSave:p=!0,trimOnSave:m=!0}=t,[g,v]=y.useState(""),[b,x]=y.useState(""),S=y.useRef(!1),k=d===c,w=y.useCallback(P=>{v(P),x("")},[]),N=y.useCallback(()=>{x("")},[]),T=y.useCallback(()=>{S.current=!1,u==null||u(null),v(""),x("")},[u]),C=y.useCallback(()=>{const P=m?g.trim():g;if(r){const U=r(g);if(U){x(U);return}}const I=m?s.trim():s;if(P===I){T();return}o(P),T()},[g,s,m,r,o,T]),D=y.useCallback(()=>{S.current=!0,u==null||u(c),v(s),x("")},[c,s,u]),B=y.useCallback(P=>{if(S.current){S.current=!1;return}P.relatedTarget instanceof HTMLElement&&P.relatedTarget.dataset.editAction===c||C()},[c,C]),E=y.useCallback(P=>{P.key==="Escape"?T():P.key==="Enter"&&p&&C()},[T,p,C]),A=(()=>{if(!k)return!1;const P=m?s.trim():s;return(m?g.trim():g)!==P})();return y.useEffect(()=>{!k&&(g!==""||b!=="")&&(v(""),x(""))},[k,g,b]),{isEditing:k,draft:g,error:b,isDirty:A,startEdit:D,cancelEdit:T,save:C,setDraft:w,clearError:N,handleBlur:B,handleKeyDown:E,ignoreInitialBlurRef:S}}const g6="_editFieldWrapper_yuzty_1",v6="_editInput_yuzty_10",y6="_editTextarea_yuzty_42",b6="_editSelect_yuzty_78",x6="_editError_yuzty_111",_6="_editInputInvalid_yuzty_118",k6="_editHint_yuzty_123",S6="_unsavedDot_yuzty_132",T6="_metaValueClickable_yuzty_140",w6="_editButton_yuzty_159",j6="_metaPlaceholder_yuzty_175",N6="_worktreeToggle_yuzty_180",nt={editFieldWrapper:g6,editInput:v6,editTextarea:y6,editSelect:b6,editError:x6,editInputInvalid:_6,editHint:k6,unsavedDot:S6,metaValueClickable:T6,editButton:w6,metaPlaceholder:j6,worktreeToggle:N6};function ln(t){const{value:s,onSave:o,validate:r,mode:c="edit",fieldId:d="text",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,maxLength:b,ariaLabel:x,"data-testid":S}=t,k=y.useRef(null),w=Qm({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!0,trimOnSave:!0});if(y.useEffect(()=>{if(w.isEditing){const T=window.setTimeout(()=>{var C;(C=k.current)==null||C.focus()},0);return()=>window.clearTimeout(T)}},[w.isEditing]),c==="create"){const T=D=>{m==null||m(D.target.value)},C=r==null?void 0:r(s);return i.jsxs("div",{className:nt.editFieldWrapper,children:[i.jsx("input",{className:`${nt.editInput} ${C?nt.editInputInvalid:""}`,value:s,onChange:T,maxLength:b,placeholder:v,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),C&&i.jsx("span",{className:nt.editError,"data-testid":"edit-error",children:C})]})}if(w.isEditing)return i.jsxs("div",{className:nt.editFieldWrapper,children:[i.jsx("input",{ref:k,className:`${nt.editInput} ${w.error?nt.editInputInvalid:""}`,value:w.draft,onChange:T=>w.setDraft(T.target.value),onBlur:w.handleBlur,onKeyDown:w.handleKeyDown,maxLength:b,placeholder:v,"aria-label":x,"data-testid":S?`${S}-input`:void 0}),w.isDirty&&i.jsx("span",{className:nt.unsavedDot,title:"Unsaved changes"}),w.error&&i.jsx("span",{className:nt.editError,"data-testid":"edit-error",children:w.error}),i.jsx("span",{className:nt.editHint,children:"Enter to save · Esc to cancel"})]});const N=g==null?void 0:g(s);return i.jsxs("span",{role:"button",tabIndex:0,className:nt.metaValueClickable,onClick:()=>w.startEdit(),onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),w.startEdit())},title:"Click to edit","aria-label":x,"data-testid":S?`${S}-button`:void 0,children:[N!==void 0?N:s?i.jsx("span",{children:s}):i.jsx("span",{className:nt.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:nt.editButton,"aria-hidden":"true",children:"✏️"})]})}function Xp(t){const{value:s,onSave:o,validate:r,mode:c="edit",fieldId:d="textarea",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:b,"data-testid":x}=t,S=y.useRef(null),k=Qm({value:s,onSave:o,validate:r,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});if(y.useEffect(()=>{if(k.isEditing){const N=window.setTimeout(()=>{var T;(T=S.current)==null||T.focus()},0);return()=>window.clearTimeout(N)}},[k.isEditing]),c==="create"){const N=C=>{m==null||m(C.target.value)},T=r==null?void 0:r(s);return i.jsxs("div",{className:nt.editFieldWrapper,children:[i.jsx("textarea",{className:`${nt.editTextarea} ${T?nt.editInputInvalid:""}`,value:s,onChange:N,placeholder:v,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),T&&i.jsx("span",{className:nt.editError,"data-testid":"edit-error",children:T})]})}if(k.isEditing)return i.jsxs("div",{className:nt.editFieldWrapper,children:[i.jsx("textarea",{ref:S,className:`${nt.editTextarea} ${k.error?nt.editInputInvalid:""}`,value:k.draft,onChange:N=>k.setDraft(N.target.value),onBlur:k.handleBlur,onKeyDown:k.handleKeyDown,title:b,"aria-label":b,"data-testid":x?`${x}-input`:void 0}),k.isDirty&&i.jsx("span",{className:nt.unsavedDot,title:"Unsaved changes"}),k.error&&i.jsx("span",{className:nt.editError,"data-testid":"edit-error",children:k.error}),i.jsx("span",{className:nt.editHint,children:"Tab to save · Esc to cancel"})]});const w=g==null?void 0:g(s);return i.jsxs("span",{role:"button",tabIndex:0,className:nt.metaValueClickable,onClick:()=>k.startEdit(),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),k.startEdit())},title:"Click to edit","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[w!==void 0?w:s?i.jsx("span",{children:s}):i.jsx("span",{className:nt.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:nt.editButton,"aria-hidden":"true",children:"✏️"})]})}function ud(t){var D;const{value:s,onSave:o,mode:r="edit",options:c,fieldId:d="select",activeFieldId:u,onActivate:p,onChange:m,renderDisplay:g,placeholder:v,ariaLabel:b,"data-testid":x}=t,S=y.useRef(null),k=Qm({value:s,onSave:o,fieldId:d,activeFieldId:u,onActivate:p,enterToSave:!1,trimOnSave:!1});y.useEffect(()=>{if(k.isEditing){const B=window.setTimeout(()=>{var E;(E=S.current)==null||E.focus()},0);return()=>window.clearTimeout(B)}},[k.isEditing]);const w=y.useCallback(B=>{const E=B.target.value;k.ignoreInitialBlurRef.current=!1,E!==s&&o(E),k.cancelEdit()},[s,o,k]),N=y.useCallback(B=>{if(k.ignoreInitialBlurRef.current){k.ignoreInitialBlurRef.current=!1;return}B.relatedTarget instanceof HTMLElement&&B.relatedTarget.dataset.editAction===d||k.cancelEdit()},[d,k]);if(r==="create")return i.jsx("select",{className:nt.editSelect,value:s,onChange:B=>m==null?void 0:m(B.target.value),"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(B=>i.jsx("option",{value:B.value,children:B.label},B.value))});if(k.isEditing)return i.jsx("select",{ref:S,className:nt.editSelect,value:k.draft,onChange:w,onBlur:N,title:b,"aria-label":b,"data-testid":x?`${x}-select`:void 0,children:c.map(B=>i.jsx("option",{value:B.value,children:B.label},B.value))});const T=g==null?void 0:g(s),C=(D=c.find(B=>B.value===s))==null?void 0:D.label;return i.jsxs("button",{type:"button",className:nt.metaValueClickable,onClick:()=>k.startEdit(),title:"Click to change","aria-label":b,"data-testid":x?`${x}-button`:void 0,children:[T!==void 0?T:C?i.jsx("span",{children:C}):i.jsx("span",{className:nt.metaPlaceholder,children:v||"None"}),i.jsx("span",{className:nt.editButton,"aria-hidden":"true",children:"✏️"})]})}function C6(t){const{checked:s,onChange:o,label:r,ariaLabel:c,"data-testid":d}=t;return i.jsxs("label",{className:nt.worktreeToggle,"data-testid":d,children:[i.jsx("input",{type:"checkbox",checked:s,onChange:u=>o(u.target.checked),"aria-label":c}),i.jsx("span",{children:r})]})}const E6="_envRow_1e1r5_1",A6="_envDot_1e1r5_7",D6="_envDotGreen_1e1r5_14",R6="_envDotYellow_1e1r5_18",M6="_envDotRed_1e1r5_22",I6="_envDotGray_1e1r5_26",Ao={envRow:E6,envDot:A6,envDotGreen:D6,envDotYellow:R6,envDotRed:M6,envDotGray:I6};function O6(t){const s=t.toLowerCase();return s==="ready"||s==="running"||s==="available"||s==="connected"?Ao.envDotGreen:s==="provisioning"||s==="starting"||s==="pending"||s==="connecting"?Ao.envDotYellow:s==="error"||s==="failed"||s==="disconnected"?Ao.envDotRed:Ao.envDotGray}function B6(t){const{value:s,onSave:o,environments:r,allowNone:c=!1,fieldId:d="environment",activeFieldId:u,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":v}=t,b=r.find(k=>k.id===s),x=[...c?[{value:"",label:"None"}]:[],...r.map(k=>({value:k.id,label:k.displayName}))],S=()=>{if(b)return i.jsxs("span",{className:Ao.envRow,children:[i.jsx("span",{className:`${Ao.envDot} ${O6(b.status)}`}),b.displayName]})};return i.jsx(ud,{value:s,onSave:o,options:x,fieldId:d,activeFieldId:u,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":v})}const L6="_nav_1snmp_1",z6="_searchForm_1snmp_8",$6="_searchInput_1snmp_15",U6="_searchButton_1snmp_33",P6="_clearButton_1snmp_68",H6="_workspaceSelect_1snmp_85",V6="_listHeader_1snmp_99",q6="_nodeList_1snmp_108",G6="_nodeItem_1snmp_116",F6="_indicator_1snmp_129",Z6="_label_1snmp_136",K6="_badge_1snmp_145",Yn={nav:L6,searchForm:z6,searchInput:$6,searchButton:U6,clearButton:P6,workspaceSelect:H6,listHeader:V6,nodeList:q6,nodeItem:G6,indicator:F6,label:Z6,badge:K6};function Y6({nodes:t,workspaces:s,loading:o,searchQuery:r,onSearch:c,onClearSearch:d,onSelectNode:u,onWorkspaceChange:p}){const[m,g]=y.useState(""),v=y.useCallback(k=>{k.preventDefault(),m.trim()&&c(m.trim())},[m,c]),b=y.useCallback(()=>{g(""),d()},[d]),x=y.useCallback(k=>{u(k)},[u]),S=y.useCallback(k=>{g(""),p(k)},[p]);return i.jsxs("div",{className:Yn.nav,"data-testid":"knowledge-nav",children:[i.jsxs("form",{className:Yn.searchForm,onSubmit:v,children:[i.jsx("input",{className:Yn.searchInput,type:"text",placeholder:"Search...",value:m,onChange:k=>{g(k.target.value)},"data-testid":"knowledge-search-input","aria-label":"Search knowledge nodes"}),i.jsx("button",{type:"submit",className:Yn.searchButton,disabled:o,children:"Go"})]}),r&&i.jsx("button",{type:"button",className:Yn.clearButton,onClick:b,children:"Clear search"}),i.jsxs("select",{className:Yn.workspaceSelect,onChange:k=>{S(k.target.value)},"data-testid":"knowledge-workspace-filter","aria-label":"Filter by workspace",children:[i.jsx("option",{value:"",children:"All workspaces"}),s.map(k=>i.jsx("option",{value:k.id,children:k.name},k.id))]}),i.jsxs("div",{className:Yn.listHeader,children:["Nodes (",t.length,")"]}),i.jsx("ul",{className:Yn.nodeList,children:t.map(k=>i.jsxs("li",{className:Yn.nodeItem,onClick:()=>{x(k.id)},onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),x(k.id))},role:"button",tabIndex:0,children:[i.jsx("span",{className:Yn.indicator,style:{backgroundColor:k.kind==="reference"?"#4A9EFF":k.category==="decision"?"#22C55E":k.category==="concept"?"#A855F7":k.category==="snippet"?"#6B7280":"#EAB308"}}),i.jsx("span",{className:Yn.label,children:k.label}),i.jsx("span",{className:Yn.badge,children:k.kind==="reference"?k.sourceType:k.category})]},k.id))})]})}const J6="_container_1mq5u_1",W6="_hamburger_1mq5u_33",X6="_brand_1mq5u_49",Q6="_brandLogo_1mq5u_68",e5="_info_1mq5u_75",t5="_connectionLabel_1mq5u_90",n5="_connectionDot_1mq5u_103",s5="_connected_1mq5u_106",a5="_disconnected_1mq5u_110",Zs={container:J6,hamburger:W6,brand:X6,brandLogo:Q6,info:e5,connectionLabel:t5,connectionDot:n5,connected:s5,disconnected:a5};function i5({connected:t,environments:s,sessions:o,onToggleSidebar:r,sidebarOpen:c}){const d=kt(),u=s.length,p=s.filter(g=>g.status==="connected").length,m=o.filter(g=>["running","idle"].includes(g.status)).length;return i.jsxs("div",{className:Zs.container,children:[r&&i.jsx("button",{type:"button",className:Zs.hamburger,onClick:r,"aria-label":"Toggle sidebar","aria-expanded":c,children:i.jsx(z2,{size:zt,"aria-hidden":"true"})}),i.jsx(Lo,{text:"Home",placement:"bottom",children:i.jsxs("button",{type:"button",className:Zs.brand,onClick:()=>d(Ni),"data-testid":"statusbar-brand",children:[i.jsx("img",{src:"/icon-192x192.png",alt:"",className:Zs.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]})}),i.jsxs("div",{className:Zs.info,children:[i.jsxs("span",{"aria-label":t?"Connected":"Disconnected",children:[i.jsx("span",{className:`${Zs.connectionDot} ${t?Zs.connected:Zs.disconnected}`,"aria-hidden":"true",children:i.jsx(La,{size:rm,fill:"currentColor"})})," ",i.jsx("span",{className:Zs.connectionLabel,"aria-hidden":"true",children:t?"Connected":"Disconnected"})]}),i.jsxs("span",{children:[p,"/",u," env",u!==1?"s":""]}),i.jsxs("span",{children:[m," active"]})]})]})}const o5="_nav_13gkc_1",r5="_tab_13gkc_35",l5="_tabIcon_13gkc_68",c5="_tabLabel_13gkc_79",d5="_tabActive_13gkc_84",zr={nav:o5,tab:r5,tabIcon:l5,tabLabel:c5,tabActive:d5},Jc=[{view:"dashboard",label:"Dashboard",icon:i.jsx(w2,{size:zt}),route:Ni,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:i.jsx(U2,{size:zt}),route:lN,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:i.jsx(f2,{size:zt}),route:cN,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:i.jsx(H2,{size:zt}),route:Ro,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:i.jsx(o2,{size:zt}),route:$x,testId:"sidebar-tab-knowledge"},{view:"findings",label:"Findings",icon:i.jsx(vx,{size:zt}),route:_d,testId:"sidebar-tab-findings"},{view:"settings",label:"Settings",icon:i.jsx(W2,{size:zt}),route:aN,testId:"sidebar-tab-settings"}];function u5(t){return t===Ni||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith($x)?"knowledge":t.startsWith(_d)?"findings":t.startsWith(Do)?"settings":"tasks"}function f5({tabs:t=Jc}){const s=Zt(),o=kt(),r=y.useRef(null),c=u5(s.pathname),d=y.useCallback(p=>{o(p.route)},[o]),u=y.useCallback(p=>{var x,S;const m=(x=r.current)==null?void 0:x.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(k=>k===document.activeElement),v=g>=0?g:t.findIndex(k=>k.view===c);let b=v;if(p.key==="ArrowRight"||p.key==="j"||p.key==="J")p.preventDefault(),b=(v+1)%t.length;else if(p.key==="ArrowLeft"||p.key==="k"||p.key==="K")p.preventDefault(),b=(v-1+t.length)%t.length;else if(p.key==="Home")p.preventDefault(),b=0;else if(p.key==="End")p.preventDefault(),b=t.length-1;else return;o(t[b].route),(S=m[b])==null||S.focus()},[c,o,t]);return i.jsx("nav",{className:zr.nav,ref:r,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:t.map(p=>{const m=p.view===c;return i.jsx(Lo,{text:p.label,placement:"bottom",children:i.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${zr.tab} ${m?zr.tabActive:""}`,onClick:()=>d(p),"data-testid":p.testId,"aria-label":p.label,children:[i.jsx("span",{className:zr.tabIcon,"aria-hidden":"true",children:p.icon}),i.jsx("span",{className:zr.tabLabel,children:p.label})]})},p.view)})})}const p5="_container_pi6ii_1",m5="_content_pi6ii_66",Pb={container:p5,content:m5},h5=320,x1=220,_1=600,k1="grackle-sidebar-width";function g5(){try{const t=localStorage.getItem(k1);if(t!==null){const s=Number(t);if(Number.isFinite(s)&&s>=x1&&s<=_1)return s}}catch{}return h5}function v5(t){try{localStorage.setItem(k1,String(t))}catch{}}function y5({content:t}){const[s]=y.useState(g5),o=y.useRef(null);if(y.useEffect(()=>{const r=o.current;if(!r)return;const c=new ResizeObserver(d=>{for(const u of d){const p=u.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=x1&&m<=_1&&v5(m)}}});return c.observe(r),()=>{c.disconnect()}},[]),t!==void 0)return i.jsx("div",{className:Pb.container,ref:o,"data-testid":"sidebar",style:{width:s},children:i.jsx("div",{className:Pb.content,children:t})})}const b5="_bar_tnfsh_1",x5="_btnPrimary_tnfsh_32",_5="_statusText_tnfsh_85",k5="_statusCompleted_tnfsh_90",S5="_statusFailed_tnfsh_94",T5="_statusBlocked_tnfsh_98",w5="_hintText_tnfsh_103",wt={bar:b5,btnPrimary:x5,statusText:_5,statusCompleted:k5,statusFailed:S5,statusBlocked:T5,hintText:w5};function j5({sessions:t,tasks:s,environments:o}){const r=kt(),c=Zt(),d=At("/sessions/:sessionId"),u=At("/tasks/:taskId"),p=At("/tasks/:taskId/stream"),m=At("/tasks/:taskId/findings"),g=At("/tasks/:taskId/edit"),v=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),b=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),x=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=At("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),k=At("/sessions/new"),w=At("/environments/:environmentId/workspaces/:workspaceId"),N=At("/tasks/new"),T=At("/chat"),C=At("/"),D=At("/settings/*"),B=d==null?void 0:d.params.sessionId,E=(u==null?void 0:u.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(b==null?void 0:b.params.taskId)??(x==null?void 0:x.params.taskId)??(S==null?void 0:S.params.taskId),A=v??b??x??S,P=(A==null?void 0:A.params.environmentId)??(w==null?void 0:w.params.environmentId),I=c.pathname.startsWith("/environments")&&!w&&!A,U=!!T,Q=!!k,$=!!w&&!v&&!b&&!x&&!S,W=!!N;if(!!C&&!Q&&!$&&!W||!!D||(!!g||!!S)||W||I||Q)return i.jsx(i.Fragment,{});if(U)return o.find(Z=>Z.adapterType==="local"&&Z.status==="connected")?i.jsx(i.Fragment,{}):i.jsx("div",{className:wt.bar,children:i.jsx("span",{className:wt.hintText,children:"Add a local environment to start chatting"})});if($)return i.jsx("div",{className:wt.bar,children:i.jsx("span",{className:wt.hintText,children:"Select a task or click + to create one"})});if(E){const L=s.find(ce=>ce.id===E);if(!L)return i.jsx("div",{className:wt.bar,children:i.jsx("span",{className:wt.hintText,children:"Loading..."})});const Z=new Map(s.map(ce=>[ce.id,ce])),J=L.dependsOn.some(ce=>{const X=Z.get(ce);return X!==void 0&&X.status!=="complete"});if(L.status==="not_started"){const ce=J?L.dependsOn.map(X=>Z.get(X)).filter(X=>X&&X.status!=="complete").map(X=>X.title):[];return i.jsx("div",{className:wt.bar,children:J?i.jsxs("span",{className:wt.statusBlocked,children:["Blocked by: ",ce.join(", ")]}):i.jsx("span",{className:wt.hintText,children:"Use the buttons above to start or manage this task"})})}if(L.status==="working"||L.status==="paused"){const ce=L.latestSessionId||void 0,X=ce?t.find(fe=>fe.id===ce):void 0;return X&&X.status!=="stopped"?i.jsx(i.Fragment,{}):i.jsx("div",{className:wt.bar,children:i.jsx("span",{className:wt.hintText,children:"Waiting for agent..."})})}if(L.status==="complete")return i.jsxs("div",{className:wt.bar,children:[i.jsx("span",{className:`${wt.statusText} ${wt.statusCompleted}`,children:"Task completed"}),i.jsx("button",{onClick:()=>r(Di(L.workspaceId,void 0,P)),className:wt.btnPrimary,children:"+ New Task"})]});if(L.status==="failed")return i.jsx("div",{className:wt.bar,children:i.jsx("span",{className:`${wt.statusText} ${wt.statusFailed}`,children:"Task failed"})})}if(B){const L=t.find(ce=>ce.id===B),Z=(L==null?void 0:L.status)==="stopped";if(L!==void 0&&!Z)return i.jsx(i.Fragment,{});if(Z)return i.jsxs("div",{className:wt.bar,children:[i.jsxs("span",{className:`${wt.statusText} ${wt.hintText}`,children:["Session ",L.endReason||L.status]}),i.jsx("button",{onClick:()=>r(Bx(L.environmentId)),className:wt.btnPrimary,children:"+ New Chat"})]})}return i.jsx("div",{className:wt.bar,children:i.jsx("span",{className:wt.hintText,children:"Loading..."})})}const N5="_nav_14i94_1",C5="_tab_14i94_24",E5="_tabActive_14i94_62",A5="_tabLabel_14i94_75",D5="_statusDot_14i94_81",R5="_pulse_14i94_87",M5="_addButton_14i94_99",I5="_empty_14i94_132",Aa={nav:N5,tab:C5,tabActive:E5,tabLabel:A5,statusDot:D5,pulse:R5,addButton:M5,empty:I5},O5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function B5({environments:t}){const s=kt(),o=y.useRef(null),r=At("/environments/:environmentId"),c=At("/environments/:environmentId/edit"),d=At("/environments/:environmentId/workspaces/:workspaceId"),u=At("/environments/:environmentId/workspaces/:workspaceId/*"),p=(r==null?void 0:r.params.environmentId)??(c==null?void 0:c.params.environmentId)??(d==null?void 0:d.params.environmentId)??(u==null?void 0:u.params.environmentId),m=p==="new"?void 0:p,g=y.useCallback(x=>{s(ji(x))},[s]),v=y.useCallback(x=>{var T;const S=(T=o.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const k=Array.from(S).findIndex(C=>C===document.activeElement),w=k>=0?k:t.findIndex(C=>C.id===m);let N=w;if(x.key==="ArrowDown"||x.key==="j"||x.key==="J")x.preventDefault(),N=(w+1)%S.length;else if(x.key==="ArrowUp"||x.key==="k"||x.key==="K")x.preventDefault(),N=(w-1+S.length)%S.length;else if(x.key==="Home")x.preventDefault(),N=0;else if(x.key==="End")x.preventDefault(),N=S.length-1;else return;N<t.length&&s(ji(t[N].id)),S[N].focus()},[m,t,s]),b=m??(t.length>0?t[0].id:void 0);return i.jsxs("div",{className:Aa.nav,"data-testid":"environment-nav",children:[i.jsx("nav",{ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(x=>{const S=x.id===m,k=x.id===b,w=O5[x.status]||"var(--text-tertiary)",N=x.status==="connected";return i.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:k?0:-1,className:`${Aa.tab} ${S?Aa.tabActive:""}`,onClick:()=>g(x.id),"data-testid":"env-nav-item",children:[i.jsx("span",{className:`${Aa.statusDot} ${N?Aa.pulse:""}`,style:{color:w},"aria-hidden":"true",children:i.jsx(La,{size:rm,fill:"currentColor"})}),i.jsx("span",{className:Aa.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),i.jsx("button",{type:"button",className:Aa.addButton,onClick:()=>s(nN),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&i.jsx("div",{className:Aa.empty,children:"No environments yet."})]})}function eh(t){const s=new Date(t),o=new Date,r=o.getTime()-s.getTime(),c=Math.floor(r/1e3),d=Math.floor(c/60),u=Math.floor(d/60),p=Math.floor(u/24);if(c<60)return"just now";if(d<60)return`${d}m ago`;if(u<24)return`${u}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=s.getFullYear()===o.getFullYear(),g=s.toLocaleString("en-US",{month:"short"}),v=s.getDate();return m?`${g} ${v}`:`${g} ${v} ${s.getFullYear()}`}const Hb={architecture:{text:"var(--accent-blue)",bg:"var(--accent-blue-dim)"},api:{text:"var(--accent-green)",bg:"var(--accent-green-dim)"},bug:{text:"var(--accent-red)",bg:"var(--accent-red-dim)"},decision:{text:"var(--accent-yellow)",bg:"var(--accent-yellow-dim)"},dependency:{text:"var(--accent-purple)",bg:"var(--accent-purple-dim)"},pattern:{text:"var(--accent-cyan)",bg:"var(--accent-cyan-dim)"},general:{text:"var(--text-secondary)",bg:"var(--bg-elevated)"}};function fd(t){return Hb[t]||Hb.general}const L5="_nav_dlm8m_1",z5="_categoryPills_dlm8m_24",$5="_categoryPill_dlm8m_24",U5="_tab_dlm8m_42",P5="_tabActive_dlm8m_80",H5="_tabContent_dlm8m_93",V5="_tabLabel_dlm8m_100",q5="_tabMeta_dlm8m_106",G5="_categoryDot_dlm8m_111",F5="_empty_dlm8m_118",xs={nav:L5,categoryPills:z5,categoryPill:$5,tab:U5,tabActive:P5,tabContent:H5,tabLabel:V5,tabMeta:q5,categoryDot:G5,empty:F5};function Z5({findings:t,workspaceId:s,environmentId:o}){const r=kt(),c=y.useRef(null),d=At("/findings/:findingId"),u=At("/environments/:environmentId/workspaces/:workspaceId/findings/:findingId"),p=(d==null?void 0:d.params.findingId)??(u==null?void 0:u.params.findingId),m=y.useMemo(()=>{const x=new Set(t.map(S=>S.category).filter(Boolean));return Array.from(x).sort()},[t]),g=y.useCallback(x=>{r(Mp(x,s,o))},[r,s,o]),v=y.useCallback(x=>{var T;const S=(T=c.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const k=Array.from(S).findIndex(C=>C===document.activeElement),w=k>=0?k:t.findIndex(C=>C.id===p);let N=w;if(x.key==="ArrowDown"||x.key==="j"||x.key==="J")x.preventDefault(),N=(w+1)%S.length;else if(x.key==="ArrowUp"||x.key==="k"||x.key==="K")x.preventDefault(),N=(w-1+S.length)%S.length;else if(x.key==="Home")x.preventDefault(),N=0;else if(x.key==="End")x.preventDefault(),N=S.length-1;else return;N<t.length&&r(Mp(t[N].id,s,o)),S[N].focus()},[p,t,r,s,o]),b=p??(t.length>0?t[0].id:void 0);return i.jsxs("div",{className:xs.nav,"data-testid":"findings-nav",children:[m.length>1&&i.jsx("div",{className:xs.categoryPills,"data-testid":"findings-nav-categories",children:m.map(x=>i.jsx("span",{className:xs.categoryPill,style:{color:fd(x).text},children:x},x))}),i.jsx("nav",{ref:c,role:"tablist","aria-orientation":"vertical","aria-label":"Findings",onKeyDown:v,children:t.map(x=>{const S=x.id===p,k=x.id===b;return i.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:k?0:-1,className:`${xs.tab} ${S?xs.tabActive:""}`,onClick:()=>g(x.id),"data-testid":"finding-nav-item",children:[i.jsx("span",{className:xs.categoryDot,style:{color:fd(x.category).text},"aria-hidden":"true",children:i.jsx(La,{size:rm,fill:"currentColor"})}),i.jsxs("span",{className:xs.tabContent,children:[i.jsx("span",{className:xs.tabLabel,title:x.title,children:x.title}),i.jsx("span",{className:xs.tabMeta,title:x.createdAt,children:eh(x.createdAt)})]})]},x.id)})}),t.length===0&&i.jsx("div",{className:xs.empty,children:"No findings yet. Agents will post discoveries here."})]})}function K5(t){if(t.length===0)return[];const s=[...t].sort((r,c)=>r[0]-c[0]),o=[[s[0][0],s[0][1]]];for(let r=1;r<s.length;r++){const c=o[o.length-1],[d,u]=s[r];d<=c[1]+1?c[1]=Math.max(c[1],u):o.push([d,u])}return o}function S1({text:t,indices:s,highlightClass:o}){if(!s||s.length===0)return i.jsx(i.Fragment,{children:t});const r=K5(s),c=[];let d=0;for(const[u,p]of r)u>d&&c.push(i.jsx("span",{children:t.slice(d,u)},`p${d}`)),c.push(i.jsx("mark",{className:o,children:t.slice(u,p+1)},`m${u}`)),d=p+1;return d<t.length&&c.push(i.jsx("span",{children:t.slice(d)},`p${d}`)),i.jsx(i.Fragment,{children:c})}function Y5(t){const s=new Map(t.map(r=>[r.id,{...r,children:[]}])),o=[];for(const r of s.values())r.parentTaskId&&s.has(r.parentTaskId)?s.get(r.parentTaskId).children.push(r):o.push(r);for(const r of s.values())r.children.sort((c,d)=>c.sortOrder-d.sortOrder);return o.sort((r,c)=>r.sortOrder-c.sortOrder)}function J5(t,s){const o=new Map;for(const d of t){const p=d.dependsOn.length>0&&d.dependsOn.some(g=>s.get(g)!=="complete")?"blocked":d.status,m=o.get(p);m?m.push(d):o.set(p,[d])}const r=[],c=new Set;for(const d of ow){c.add(d);const u=o.get(d);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=za(d);r.push({status:d,label:p.label,style:p,tasks:u})}}for(const[d,u]of o)if(!c.has(d)&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=za(d);r.push({status:d,label:p.label,style:p,tasks:u})}return r}const W5="_container_z4i38_1",X5="_header_z4i38_5",Q5="_headerActions_z4i38_17",eI="_searchInput_z4i38_23",tI="_searchHighlight_z4i38_56",nI="_groupToggle_z4i38_62",sI="_groupToggleActive_z4i38_89",aI="_addButton_z4i38_93",iI="_taskRow_z4i38_120",oI="_selected_z4i38_140",rI="_expandArrow_z4i38_150",lI="_expanded_z4i38_157",cI="_leafSpacer_z4i38_161",dI="_taskStatusIcon_z4i38_166",uI="_taskTitle_z4i38_170",fI="_workspaceBadge_z4i38_177",pI="_childCountBadge_z4i38_195",mI="_dependencyBadge_z4i38_208",hI="_blockedBadge_z4i38_220",gI="_addChildButton_z4i38_225",vI="_emptyState_z4i38_268",yI="_statusGroupHeader_z4i38_275",bI="_statusGroupIcon_z4i38_294",xI="_statusGroupLabel_z4i38_298",_I="_statusGroupCount_z4i38_303",Ge={container:W5,header:X5,headerActions:Q5,searchInput:eI,searchHighlight:tI,groupToggle:nI,groupToggleActive:sI,addButton:aI,taskRow:iI,selected:oI,expandArrow:rI,expanded:lI,leafSpacer:cI,taskStatusIcon:dI,taskTitle:uI,workspaceBadge:fI,childCountBadge:pI,dependencyBadge:mI,blockedBadge:hI,addChildButton:gI,emptyState:vI,statusGroupHeader:yI,statusGroupIcon:bI,statusGroupLabel:xI,statusGroupCount:_I},kI=[{name:"title",weight:2},{name:"description",weight:1}],T1=16,SI=16,w1="grackle-task-group-by-status";function Vb(){try{return localStorage.getItem(w1)==="true"}catch{return!1}}function TI(t){try{localStorage.setItem(w1,String(t))}catch{}}function wI({group:t,isExpanded:s,onToggle:o,selectedTaskId:r,navigate:c,titleHighlights:d,workspaceNames:u}){return i.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[i.jsxs("div",{className:Ge.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":s,onClick:o,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o())},children:[i.jsx("span",{className:`${Ge.expandArrow} ${s?Ge.expanded:""}`,"aria-hidden":"true",children:i.jsx(sa,{size:lt})}),i.jsx("span",{className:Ge.statusGroupIcon,style:{color:t.style.color},"aria-hidden":"true",children:t.style.icon}),i.jsx("span",{className:Ge.statusGroupLabel,children:t.label}),i.jsx("span",{className:Ge.statusGroupCount,children:t.tasks.length})]}),i.jsx(us,{children:s&&i.jsx(Rt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.tasks.map(p=>{const m=za(p.status),g=r===p.id,v=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return i.jsxs("div",{onClick:()=>c(On(p.id)),role:"button",tabIndex:0,"aria-label":p.title,onKeyDown:b=>{b.currentTarget===b.target&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),c(On(p.id)))},className:`${Ge.taskRow} ${g?Ge.selected:""}`,style:{"--task-indent":`${T1}px`},"data-task-id":p.id,children:[i.jsx("span",{className:Ge.leafSpacer}),i.jsx("span",{className:Ge.taskStatusIcon,style:{color:m.color},"aria-hidden":"true","data-testid":`task-status-${ll(p.status)}`,children:m.icon}),i.jsx("span",{className:Ge.taskTitle,title:p.title,children:i.jsx(S1,{text:p.title,indices:d.get(p.id),highlightClass:Ge.searchHighlight})}),v&&i.jsx("span",{className:Ge.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function j1({node:t,depth:s,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=za(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(T=>u.get(T)!=="complete"),b=o.has(t.id),x=t.children.length>0,S=c===t.id,k=T1+s*SI,N=s===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{onClick:()=>d(On(t.id)),role:"button",tabIndex:0,"aria-label":t.title,onKeyDown:T=>{T.currentTarget===T.target&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),d(On(t.id)))},className:`${Ge.taskRow} ${S?Ge.selected:""}`,style:{"--task-indent":`${k}px`},"data-task-id":t.id,children:[x&&i.jsx("span",{className:`${Ge.expandArrow} ${b?Ge.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:T=>{T.stopPropagation(),r(t.id)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),T.stopPropagation(),r(t.id))},children:i.jsx(sa,{size:lt,"aria-hidden":"true"})}),!x&&i.jsx("span",{className:Ge.leafSpacer}),i.jsx("span",{className:Ge.taskStatusIcon,style:{color:g.color},"aria-hidden":"true","data-testid":`task-status-${ll(t.status)}`,children:g.icon}),i.jsx("span",{className:Ge.taskTitle,title:t.title,children:i.jsx(S1,{text:t.title,indices:p.get(t.id),highlightClass:Ge.searchHighlight})}),N&&i.jsx("span",{className:Ge.workspaceBadge,title:N,children:N}),x&&i.jsxs("span",{className:Ge.childCountBadge,children:[t.children.filter(T=>T.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&i.jsx("span",{className:`${Ge.dependencyBadge} ${v?Ge.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),s<vT&&i.jsx(Lo,{text:"Add child task",children:i.jsx("button",{onClick:T=>{T.stopPropagation(),d(Di(t.workspaceId,t.id))},"aria-label":"Add child task",className:Ge.addChildButton,children:"+"})})]}),i.jsx(us,{children:x&&b&&i.jsx(Rt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:t.children.map(T=>i.jsx(j1,{node:T,depth:s+1,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m},T.id))})})]})}function jI({workspaces:t,tasks:s}){const o=kt(),[r,c]=y.useState(new Set),[d,u]=y.useState(new Set),[p,m]=y.useState(Vb),[g,v]=y.useState(Vb),[b,x]=y.useState(new Map),S=At("/tasks/:taskId/*"),k=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,w=y.useMemo(()=>new Map(s.map(H=>[H.id,H.status])),[s]),N=y.useMemo(()=>new Map(t.map(H=>[H.id,H.name])),[t]),T=()=>{const H=!p;TI(H),m(H),H&&(v(!0),x(new Map))},C=H=>{x(ie=>{const L=new Map(ie),Z=L.has(H)?L.get(H):g;return L.set(H,!Z),L})},D=H=>b.has(H)?b.get(H):g,B=H=>{c(ie=>{const L=new Set(ie);return L.has(H)?(L.delete(H),u(Z=>new Set(Z).add(H))):(L.add(H),u(Z=>{const J=new Set(Z);return J.delete(H),J})),L})};y.useEffect(()=>{const H=new Set(s.filter(ie=>ie.parentTaskId).map(ie=>ie.parentTaskId));H.size>0&&c(ie=>{const L=new Set(ie);for(const Z of H)d.has(Z)||L.add(Z);return L})},[s,d]);const[E,A]=y.useState(""),{directMatchTaskIds:P,treeMatchTaskIds:I,titleHighlights:U}=y.useMemo(()=>{if(!E.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const H=gT(s,E,kI),ie=new Set(H.map(ce=>ce.item.id)),L=new Map;for(const ce of H){const X=ce.matches.find(ge=>ge.key==="title");X&&L.set(ce.item.id,X.indices)}const Z=new Set(ie),J=new Map(s.map(ce=>[ce.id,ce]));for(const ce of[...ie]){let X=J.get(ce);for(;X!=null&&X.parentTaskId;)Z.add(X.parentTaskId),X=J.get(X.parentTaskId)}return{directMatchTaskIds:ie,treeMatchTaskIds:Z,titleHighlights:L}},[E,s]),Q=P!==null,$=Q?p?P:I:null,W=$?s.filter(H=>$.has(H.id)):s,pe=p?[]:Y5(W);return i.jsxs("div",{className:Ge.container,children:[i.jsxs("div",{className:Ge.header,children:[i.jsx("span",{children:"Tasks"}),i.jsxs("div",{className:Ge.headerActions,children:[i.jsx(Lo,{text:p?"Switch to tree view":"Group tasks by status",children:i.jsx("button",{className:`${Ge.groupToggle} ${p?Ge.groupToggleActive:""}`,onClick:T,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,"data-testid":"task-group-by-status-toggle",children:i.jsx(I2,{size:tn})})}),i.jsx(Lo,{text:"New task",children:i.jsx("button",{className:Ge.addButton,onClick:()=>o(Di()),"aria-label":"New task","data-testid":"new-task-button",children:"+"})})]})]}),s.length>0&&i.jsx("input",{type:"text",value:E,onChange:H=>A(H.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Ge.searchInput,"data-testid":"sidebar-search"}),p?J5(W,w).map(H=>i.jsx(wI,{group:H,isExpanded:D(H.status),onToggle:()=>C(H.status),selectedTaskId:k,navigate:o,titleHighlights:U,workspaceNames:N},H.status)):pe.map(H=>i.jsx(j1,{node:H,depth:0,expandedTasks:r,toggleTask:B,selectedTaskId:k,navigate:o,taskStatusById:w,titleHighlights:U,workspaceNames:N},H.id)),W.length===0&&!Q&&i.jsx("div",{className:Ge.emptyState,children:"No tasks yet. Click + to create one."}),W.length===0&&Q&&i.jsx("div",{className:Ge.emptyState,children:"No matching tasks"})]})}const NI="_toast_ed2dk_1",CI="_success_ed2dk_18",EI="_icon_ed2dk_22",AI="_error_ed2dk_25",DI="_warning_ed2dk_32",RI="_info_ed2dk_38",MI="_message_ed2dk_53",II="_close_ed2dk_60",$r={toast:NI,success:CI,icon:EI,error:AI,warning:DI,info:RI,message:MI,close:II},OI={success:i.jsx(Ei,{size:zt}),error:i.jsx(Ha,{size:zt}),warning:i.jsx(om,{size:zt}),info:i.jsx(im,{size:zt})};function BI({toast:t,onDismiss:s}){return y.useEffect(()=>{const o=setTimeout(()=>s(t.id),t.duration);return()=>clearTimeout(o)},[t.id,t.duration,s]),i.jsxs(Rt.div,{className:`${$r.toast} ${$r[t.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[i.jsx("span",{className:$r.icon,"aria-hidden":"true",children:OI[t.variant]}),i.jsx("span",{className:$r.message,children:t.message}),i.jsx("button",{type:"button",className:$r.close,onClick:()=>s(t.id),"aria-label":"Dismiss notification",children:i.jsx(Ha,{size:tn,"aria-hidden":"true"})})]})}const LI="_container_qqse2_1",zI={container:LI};function $I({toasts:t,onDismiss:s}){return i.jsx("div",{className:zI.container,"data-testid":"toast-container",children:i.jsx(us,{children:t.map(o=>i.jsx(BI,{toast:o,onDismiss:s},o.id))})})}const UI="_callout_e5awm_1",PI="_success_e5awm_11",HI="_icon_e5awm_15",VI="_error_e5awm_18",qI="_warning_e5awm_25",GI="_info_e5awm_32",FI="_content_e5awm_48",ZI="_close_e5awm_53",Ur={callout:UI,success:PI,icon:HI,error:VI,warning:qI,info:GI,content:FI,close:ZI},KI={success:i.jsx(Ei,{size:zt}),error:i.jsx(Ha,{size:zt}),warning:i.jsx(om,{size:zt}),info:i.jsx(im,{size:zt})};function YI({variant:t="info",children:s,dismissible:o=!1,className:r}){const[c,d]=y.useState(!1);return i.jsx(i.Fragment,{children:!c&&i.jsxs("div",{className:[Ur.callout,Ur[t],r].filter(Boolean).join(" "),role:t==="error"||t==="warning"?"alert":"status",children:[i.jsx("span",{className:Ur.icon,"aria-hidden":"true",children:KI[t]}),i.jsx("span",{className:Ur.content,children:s}),o&&i.jsx("button",{type:"button",className:Ur.close,onClick:()=>d(!0),"aria-label":"Dismiss",children:i.jsx(Ha,{size:tn,"aria-hidden":"true"})})]})})}function JI({currentVersion:t,latestVersion:s,updateAvailable:o,isDocker:r}){if(!o)return i.jsx(i.Fragment,{});const c=r?"docker pull ghcr.io/nick-pape/grackle:latest && docker restart grackle":`npm install -g @grackle-ai/cli@${s}`;return i.jsx("div",{"data-testid":"update-banner",children:i.jsxs(YI,{variant:"info",dismissible:!0,children:[i.jsxs("strong",{children:["Grackle v",s]})," is available (you have v",t,")."," ","Run: ",i.jsx("code",{children:c})]})})}const WI="_container_de44x_1",XI="_emptyState_de44x_8",QI="_card_de44x_14",eO="_cardClickable_de44x_34",tO="_cardHeader_de44x_42",nO="_categoryBadge_de44x_54",sO="_findingTitle_de44x_62",aO="_findingDate_de44x_68",iO="_findingContent_de44x_80",oO="_tags_de44x_86",rO="_tag_de44x_86",rs={container:WI,emptyState:XI,card:QI,cardClickable:eO,cardHeader:tO,categoryBadge:nO,findingTitle:sO,findingDate:aO,findingContent:iO,tags:oO,tag:rO};function N1({findings:t,onFindingClick:s}){return t.length===0?i.jsx("div",{className:rs.emptyState,children:"No findings yet. Agents will post discoveries here."}):i.jsx("div",{className:rs.container,children:t.map((o,r)=>{const c=fd(o.category),d=s?Rt.button:Rt.div;return i.jsxs(d,{type:s?"button":void 0,className:`${rs.card} ${s?rs.cardClickable:""}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},onClick:s?()=>{s(o.id)}:void 0,children:[i.jsxs("div",{className:rs.cardHeader,children:[i.jsx("span",{className:rs.categoryBadge,style:{background:c.bg,color:c.text},children:o.category}),i.jsx("span",{className:rs.findingTitle,children:o.title}),i.jsx("span",{className:rs.findingDate,title:o.createdAt,children:eh(o.createdAt)})]}),i.jsx("div",{className:rs.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&i.jsx("div",{className:rs.tags,children:o.tags.map(u=>i.jsx("span",{className:rs.tag,style:{color:c.text,textShadow:`0 0 8px ${c.text}`},children:u},u))})]},o.id)})})}const lO="_section_1ingb_14",cO="_sectionTitle_1ingb_26",dO="_sectionDescription_1ingb_35",uO="_tokenList_1ingb_48",fO="_tokenRow_1ingb_55",pO="_tokenBadge_1ingb_68",mO="_tokenName_1ingb_83",hO="_tokenTarget_1ingb_90",gO="_deleteButton_1ingb_99",vO="_addForm_1ingb_113",yO="_formRow_1ingb_119",bO="_input_1ingb_125",xO="_select_1ingb_155",_O="_addButton_1ingb_187",kO="_emptyStateInfo_1ingb_221",SO="_themeOptions_1ingb_229",TO="_themeOption_1ingb_229",wO="_themeOptionSelected_1ingb_254",jO="_themeOptionHeader_1ingb_259",NO="_themeOptionLabel_1ingb_266",CO="_themeOptionDesc_1ingb_273",EO="_variantToggle_1ingb_279",AO="_variantButton_1ingb_286",DO="_variantActive_1ingb_305",RO="_themeSwatches_1ingb_311",MO="_themeSwatch_1ingb_311",IO="_systemToggle_1ingb_325",OO="_systemToggleHint_1ingb_341",BO="_themeActive_1ingb_348",LO="_aboutGrid_1ingb_354",zO="_aboutItem_1ingb_360",$O="_aboutLabel_1ingb_373",UO="_aboutValue_1ingb_379",PO="_aboutDot_1ingb_387",HO="_aboutDotConnected_1ingb_394",VO="_aboutDotDisconnected_1ingb_398",be={section:lO,sectionTitle:cO,sectionDescription:dO,tokenList:uO,tokenRow:fO,tokenBadge:pO,tokenName:mO,tokenTarget:hO,deleteButton:gO,addForm:vO,formRow:yO,input:bO,select:xO,addButton:_O,emptyStateInfo:kO,themeOptions:SO,themeOption:TO,themeOptionSelected:wO,themeOptionHeader:jO,themeOptionLabel:NO,themeOptionDesc:CO,variantToggle:EO,variantButton:AO,variantActive:DO,themeSwatches:RO,themeSwatch:MO,systemToggle:IO,systemToggleHint:OO,themeActive:BO,aboutGrid:LO,aboutItem:zO,aboutLabel:$O,aboutValue:UO,aboutDot:PO,aboutDotConnected:HO,aboutDotDisconnected:VO},qO=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function GO({tokens:t,onSetToken:s,onDeleteToken:o,onShowToast:r}){const[c,d]=y.useState(""),[u,p]=y.useState(""),[m,g]=y.useState("env_var"),[v,b]=y.useState(""),[x,S]=y.useState(null),k=T=>{if(T.preventDefault(),!c||!u)return;const C=m==="env_var"?v||c.toUpperCase()+"_TOKEN":"";s(c,u,m,C,m==="file"?v:""),r==null||r("Token saved successfully","success"),d(""),p(""),b("")},w=T=>{S(T)},N=()=>{x&&(o(x),r==null||r("Token deleted","info")),S(null)};return i.jsxs(i.Fragment,{children:[i.jsx(Ci,{isOpen:x!==null,title:"Delete Token?",description:x?`"${x}" will be permanently removed.`:void 0,onConfirm:N,onCancel:()=>S(null)}),i.jsxs("section",{className:be.section,children:[i.jsx("h3",{className:be.sectionTitle,children:"Tokens"}),i.jsx("p",{className:be.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),t.length===0?i.jsx("div",{className:be.emptyStateInfo,children:"Add your first API token to enable service integrations."}):i.jsx("div",{className:be.tokenList,children:t.map(T=>i.jsxs("div",{className:be.tokenRow,children:[i.jsx("span",{className:be.tokenBadge,children:T.tokenType}),i.jsx("span",{className:be.tokenName,children:T.name}),i.jsx("span",{className:be.tokenTarget,children:T.tokenType==="env_var"?T.envVar:T.filePath}),i.jsx("button",{className:be.deleteButton,onClick:()=>w(T.name),title:`Delete ${T.name}`,"aria-label":`Delete ${T.name}`,children:i.jsx(Ha,{size:tn,"aria-hidden":"true"})})]},T.name))}),i.jsxs("form",{className:be.addForm,onSubmit:k,children:[i.jsxs("div",{className:be.formRow,children:[i.jsx("input",{className:be.input,type:"text",placeholder:"Token name",value:c,onChange:T=>d(T.target.value)}),i.jsx("input",{className:be.input,type:"password",placeholder:"Value",value:u,onChange:T=>p(T.target.value)})]}),i.jsxs("div",{className:be.formRow,children:[i.jsx("select",{className:be.select,value:m,onChange:T=>g(T.target.value),children:qO.map(T=>i.jsx("option",{value:T.value,children:T.label},T.value))}),i.jsx("input",{className:be.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:v,onChange:T=>b(T.target.value)}),i.jsx("button",{className:be.addButton,type:"submit",children:"Add Token"})]})]})]})]})}const Cd=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],C1=new Set(Cd.map(t=>t.id)),qb="grackle";function Qp(t){return Cd.find(s=>s.id===t)}function FO({themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c}){return i.jsxs("section",{className:be.section,children:[i.jsx("h3",{className:be.sectionTitle,children:"Appearance"}),i.jsx("p",{className:be.sectionDescription,children:"Choose how Grackle looks across the app."}),i.jsx("div",{className:be.themeOptions,children:Cd.filter(d=>!d.hidden).map(d=>{const u=!!(d.variantLightId&&d.variantDarkId),p=u?t===d.id||t===d.variantLightId||t===d.variantDarkId:t===d.id,m=u&&s===d.variantLightId;return i.jsxs("button",{type:"button",className:`${be.themeOption} ${p?be.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>o(d.id),children:[i.jsxs("span",{className:be.themeOptionHeader,children:[i.jsxs("span",{children:[i.jsx("span",{className:be.themeOptionLabel,children:d.label}),i.jsx("span",{className:be.themeOptionDesc,children:d.description})]}),u&&i.jsxs("span",{className:be.variantToggle,children:[i.jsx("span",{role:"button",tabIndex:0,className:`${be.variantButton} ${p&&m?be.variantActive:""}`,onClick:g=>{g.stopPropagation(),c(!1),o(d.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),c(!1),o(d.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),i.jsx("span",{role:"button",tabIndex:0,className:`${be.variantButton} ${p&&!m?be.variantActive:""}`,onClick:g=>{g.stopPropagation(),c(!1),o(d.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),c(!1),o(d.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),d.swatches&&i.jsx("span",{className:be.themeSwatches,children:d.swatches.map((g,v)=>i.jsx("span",{className:be.themeSwatch,style:{background:g}},v))})]},d.id)})}),i.jsxs("label",{className:be.systemToggle,children:[i.jsx("input",{type:"checkbox",checked:r,onChange:d=>c(d.target.checked)}),i.jsx("span",{children:"Match system light/dark preference"})]}),i.jsx("p",{className:be.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),i.jsxs("p",{className:be.themeActive,children:["Active theme: ",i.jsx("strong",{children:s})]})]})}function ZO({connected:t,environments:s,sessions:o}){const r=s.filter(u=>u.status==="connected").length,c=s.length,d=o.filter(u=>["running","idle"].includes(u.status)).length;return i.jsxs("section",{className:be.section,"data-testid":"about-panel",children:[i.jsx("h3",{className:be.sectionTitle,children:"About"}),i.jsx("p",{className:be.sectionDescription,children:"Connection status and application information."}),i.jsxs("div",{className:be.aboutGrid,children:[i.jsxs("div",{className:be.aboutItem,children:[i.jsx("span",{className:be.aboutLabel,children:"Connection"}),i.jsxs("span",{className:be.aboutValue,children:[i.jsx("span",{className:`${be.aboutDot} ${t?be.aboutDotConnected:be.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),i.jsxs("div",{className:be.aboutItem,children:[i.jsx("span",{className:be.aboutLabel,children:"Environments"}),i.jsxs("span",{className:be.aboutValue,children:[r,"/",c," connected"]})]}),i.jsxs("div",{className:be.aboutItem,children:[i.jsx("span",{className:be.aboutLabel,children:"Active Sessions"}),i.jsx("span",{className:be.aboutValue,children:d})]}),i.jsxs("div",{className:be.aboutItem,children:[i.jsx("span",{className:be.aboutLabel,children:"Version"}),i.jsx("span",{className:be.aboutValue,children:"0.100.0"})]})]})]})}const KO="_container_cddyd_1",YO="_header_cddyd_8",JO="_headerTitle_cddyd_35",WO="_badge_cddyd_44",XO="_headerActions_cddyd_54",QO="_body_cddyd_61",eB="_formContent_cddyd_73",tB="_section_cddyd_85",nB="_label_cddyd_91",sB="_titleInput_cddyd_98",aB="_descriptionTextarea_cddyd_131",iB="_parentContext_cddyd_167",oB="_parentLabel_cddyd_175",rB="_parentName_cddyd_182",lB="_personaSelect_cddyd_186",cB="_depList_cddyd_220",dB="_depItem_cddyd_226",uB="_depItemSelected_cddyd_248",fB="_noDeps_cddyd_252",pB="_btnPrimary_cddyd_258",mB="_btnGhost_cddyd_289",tt={container:KO,header:YO,headerTitle:JO,badge:WO,headerActions:XO,body:QO,formContent:eB,section:tB,label:nB,titleInput:sB,descriptionTextarea:aB,parentContext:iB,parentLabel:oB,parentName:rB,personaSelect:lB,depList:cB,depItem:dB,depItemSelected:uB,noDeps:fB,btnPrimary:pB,btnGhost:mB};function E1({mode:t,taskId:s,workspaceId:o,parentTaskId:r,environmentId:c,tasks:d,workspaces:u,personas:p,onCreateTask:m,onUpdateTask:g,onEditDone:v,onShowToast:b}){const x=kt(),S=t==="edit",k=S&&s?d.find(ve=>ve.id===s):void 0,w=S?(k==null?void 0:k.workspaceId)??"":o??"",[N,T]=y.useState(w),C=w||N,D=u.find(ve=>ve.id===C),B=c??(D==null?void 0:D.environmentId),E=!S&&!o,A=S?(k==null?void 0:k.parentTaskId)??"":r??"",P=A?d.find(ve=>ve.id===A):void 0,[I,U]=y.useState((k==null?void 0:k.title)??""),[Q,$]=y.useState((k==null?void 0:k.description)??""),[W,pe]=y.useState((k==null?void 0:k.dependsOn)??[]),[H,ie]=y.useState((k==null?void 0:k.defaultPersonaId)??""),[L,Z]=y.useState((k==null?void 0:k.canDecompose)??!1),[J,ce]=y.useState(!1),X=y.useRef(!1);y.useEffect(()=>{S&&k&&!X.current&&(X.current=!0,U(k.title),$(k.description),pe(k.dependsOn),ie(k.defaultPersonaId),Z(k.canDecompose))},[S,k]);const ge=d.filter(ve=>ve.workspaceId===C&&(!S||ve.id!==s)&&ve.id!==A),fe=I.trim().length>0&&(!S||k!==void 0)&&C.length>0,Ce=ve=>{pe(Le=>Le.includes(ve)?Le.filter(Mt=>Mt!==ve):[...Le,ve])},Ze=()=>{!fe||J||S&&k===void 0||(S&&s?(g(s,I.trim(),Q,W,H),b==null||b("Task updated","success"),v?v():x(On(s,void 0,C,B),{replace:!0})):(ce(!0),m(C,I.trim(),Q,W.length>0?W:void 0,A||void 0,H,L,()=>{b==null||b("Task created","success"),x(o?$a(o,B):"/tasks",{replace:!0})},ve=>{b==null||b(ve,"error"),ce(!1)})))},me=()=>{if(v){v();return}x(S&&s?On(s,void 0,C,B):o?$a(o,B):"/tasks")},_e=S?"edit task":A?"child task":"new task";return i.jsxs("div",{className:tt.container,children:[i.jsxs("div",{className:tt.header,children:[i.jsxs("div",{className:tt.headerTitle,children:[i.jsx("span",{className:tt.badge,children:_e}),P&&i.jsxs("span",{className:tt.parentContext,children:[i.jsx("span",{className:tt.parentLabel,children:"Child of"}),i.jsx("span",{className:tt.parentName,children:P.title})]})]}),i.jsxs("div",{className:tt.headerActions,children:[i.jsx("button",{onClick:Ze,disabled:!fe||J,className:tt.btnPrimary,"data-testid":"task-edit-save",children:J?"Creating…":S?"Save Changes":"Create"}),i.jsx("button",{onClick:me,className:tt.btnGhost,children:"Cancel"})]})]}),i.jsx("div",{className:tt.body,children:i.jsxs("div",{className:tt.formContent,children:[E&&i.jsxs("div",{className:tt.section,children:[i.jsx("label",{className:tt.label,htmlFor:"task-edit-workspace",children:"Workspace"}),i.jsxs("select",{id:"task-edit-workspace",value:N,onChange:ve=>T(ve.target.value),className:tt.personaSelect,"data-testid":"task-edit-workspace",children:[i.jsx("option",{value:"",children:"Select a workspace..."}),u.map(ve=>i.jsx("option",{value:ve.id,children:ve.name},ve.id))]})]}),i.jsxs("div",{className:tt.section,children:[i.jsx("label",{className:tt.label,htmlFor:"task-edit-title",children:"Title"}),i.jsx("input",{id:"task-edit-title",type:"text",value:I,onChange:ve=>U(ve.target.value),placeholder:"Task title...",autoFocus:!0,className:tt.titleInput,"data-testid":"task-edit-title",onKeyDown:ve=>{ve.key==="Enter"&&fe&&Ze()}})]}),i.jsxs("div",{className:tt.section,children:[i.jsx("label",{className:tt.label,htmlFor:"task-edit-description",children:"Description"}),i.jsx("textarea",{id:"task-edit-description",value:Q,onChange:ve=>$(ve.target.value),placeholder:"Describe the task... (markdown supported)",className:tt.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),i.jsxs("div",{className:tt.section,children:[i.jsx("label",{className:tt.label,htmlFor:"task-edit-persona",children:"Default Persona"}),i.jsxs("select",{id:"task-edit-persona",value:H,onChange:ve=>ie(ve.target.value),className:tt.personaSelect,"data-testid":"task-edit-persona",children:[i.jsx("option",{value:"",children:"(Inherit)"}),p.map(ve=>i.jsx("option",{value:ve.id,children:ve.name},ve.id))]})]}),!S&&i.jsx("div",{className:tt.section,children:i.jsxs("label",{className:tt.depItem,"data-testid":"task-edit-can-decompose",children:[i.jsx("input",{type:"checkbox",checked:L,onChange:ve=>Z(ve.target.checked)}),"Can spawn subtasks"]})}),i.jsxs("div",{className:tt.section,children:[i.jsx("div",{className:tt.label,children:"Dependencies"}),ge.length===0?i.jsx("div",{className:tt.noDeps,children:"No other tasks in this workspace"}):i.jsx("div",{className:tt.depList,children:ge.map(ve=>{const Le=W.includes(ve.id);return i.jsxs("label",{className:`${tt.depItem} ${Le?tt.depItemSelected:""}`,"data-testid":`dep-option-${ve.id}`,children:[i.jsx("input",{type:"checkbox",checked:Le,onChange:()=>Ce(ve.id)}),ve.title,i.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",ve.status,")"]})]},ve.id)})})]})]})})]})}const hB="_actionButtons_1rjka_1",gB="_btnPrimary_1rjka_8",vB="_btnDanger_1rjka_39",yB="_btnGhost_1rjka_78",Ft={actionButtons:hB,btnPrimary:gB,btnDanger:vB,btnGhost:yB};function bB({task:t,sessionId:s,isBlocked:o,onStart:r,onResume:c,onStop:d,onPause:u,onDelete:p,onEdit:m}){if(t.status==="not_started")return o?i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:m,className:Ft.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]}):i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{"data-testid":"task-header-start",onClick:r,className:Ft.btnPrimary,children:"Start"}),i.jsx("button",{onClick:m,className:Ft.btnGhost,"data-testid":"task-action-edit",children:"Edit"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="working")return i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:d,className:Ft.btnDanger,"data-testid":"task-action-stop",children:"Stop"}),i.jsx("button",{onClick:u,disabled:!s,className:Ft.btnGhost,"data-testid":"task-action-pause",children:"Pause"})]});if(t.status==="paused")return i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:d,className:Ft.btnPrimary,"data-testid":"task-action-stop",children:"Stop"}),i.jsx("button",{onClick:c,className:Ft.btnGhost,"data-testid":"task-action-resume",children:"Resume"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]});if(t.status==="complete")return i.jsx("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})});if(t.status==="failed")return i.jsxs("div",{className:Ft.actionButtons,"data-testid":"task-action-buttons",children:[i.jsx("button",{onClick:r,className:Ft.btnPrimary,"data-testid":"task-header-start",children:"Retry"}),i.jsx("button",{onClick:p,className:Ft.btnDanger,"data-testid":"task-action-delete",children:"Delete"})]})}const xB="_workpadSection_y8nj9_1",_B="_workpadLabel_y8nj9_9",kB="_workpadStatus_y8nj9_17",SB="_workpadSummary_y8nj9_23",TB="_workpadExtra_y8nj9_29",Da={workpadSection:xB,workpadLabel:_B,workpadStatus:kB,workpadSummary:SB,workpadExtra:TB};function wB({workpad:t}){if(!t)return;let s;try{const o=JSON.parse(t);if(o==null||typeof o!="object"||Array.isArray(o))return;s=o}catch{return i.jsxs("div",{className:Da.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:Da.workpadLabel,children:"Workpad"}),i.jsx("div",{className:Da.workpadExtra,children:t})]})}if(!(!s.status&&!s.summary&&!s.extra))return i.jsxs("div",{className:Da.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:Da.workpadLabel,children:"Workpad"}),s.status&&i.jsx("div",{className:Da.workpadStatus,"data-testid":"workpad-status",children:s.status}),s.summary&&i.jsx("div",{className:Da.workpadSummary,"data-testid":"workpad-summary",children:s.summary}),s.extra&&Object.keys(s.extra).length>0&&i.jsx("div",{className:Da.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(s.extra,null,2)})]})}const jB="_overviewDashboard_r05qm_1",NB="_overviewHero_r05qm_7",CB="_statusBadge_r05qm_14",EB="_statusPending_r05qm_26",AB="_statusAssigned_r05qm_31",DB="_statusInProgress_r05qm_36",RB="_statusReview_r05qm_41",MB="_statusDone_r05qm_46",IB="_statusFailed_r05qm_51",OB="_statusWaitingInput_r05qm_56",BB="_overviewBranchPill_r05qm_61",LB="_branchLink_r05qm_76",zB="_overviewSection_r05qm_87",$B="_overviewLabel_r05qm_93",UB="_overviewValue_r05qm_100",PB="_overviewMuted_r05qm_105",HB="_overviewMarkdown_r05qm_111",VB="_envRow_r05qm_180",qB="_envDot_r05qm_186",GB="_envDotGreen_r05qm_193",FB="_envDotYellow_r05qm_197",ZB="_envDotRed_r05qm_201",KB="_envDotGray_r05qm_205",YB="_depList_r05qm_209",JB="_depItem_r05qm_215",WB="_depBlocked_r05qm_222",XB="_depDone_r05qm_226",QB="_timeline_r05qm_230",eL="_timelineRow_r05qm_236",tL="_timelineKey_r05qm_243",nL="_timelineValue_r05qm_249",sL="_timelineDelta_r05qm_253",aL="_reviewNotes_r05qm_264",he={overviewDashboard:jB,overviewHero:NB,statusBadge:CB,statusPending:EB,statusAssigned:AB,statusInProgress:DB,statusReview:RB,statusDone:MB,statusFailed:IB,statusWaitingInput:OB,overviewBranchPill:BB,branchLink:LB,overviewSection:zB,overviewLabel:$B,overviewValue:UB,overviewMuted:PB,overviewMarkdown:HB,envRow:VB,envDot:qB,envDotGreen:GB,envDotYellow:FB,envDotRed:ZB,envDotGray:KB,depList:YB,depItem:JB,depBlocked:WB,depDone:XB,timeline:QB,timelineRow:eL,timelineKey:tL,timelineValue:nL,timelineDelta:sL,reviewNotes:aL};function Lc(t){if(!t)return"—";const s=new Date(t);return isNaN(s.getTime())?"—":s.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function yp(t,s){if(!t||!s)return;const o=new Date(s).getTime()-new Date(t).getTime();if(isNaN(o)||o<0)return;const r=Math.floor(o/6e4),c=Math.floor(o%6e4/1e3);if(r===0)return`${c}s`;const d=Math.floor(r/60),u=r%60;return d===0?`${r}m ${c}s`:`${d}h ${u}m`}function Gb(t){const s=t.toLowerCase();return s==="ready"||s==="running"||s==="available"||s==="connected"?he.envDotGreen:s==="provisioning"||s==="starting"||s==="pending"||s==="connecting"?he.envDotYellow:s==="error"||s==="failed"||s==="disconnected"?he.envDotRed:he.envDotGray}function iL({status:t}){const s=za(t),o=iw(t);return i.jsx("span",{className:`${he.statusBadge} ${he[o]??he.statusPending}`,"data-testid":"task-overview-status-badge",children:s.label})}function oL({task:t,tasksById:s,environments:o,workspaces:r,taskSessions:c,selectedEnvId:d,taskUsage:u,treeUsage:p}){const m=c.length>0?c[c.length-1]:void 0,g=(m==null?void 0:m.environmentId)??"",v=g?o.find(k=>k.id===g):void 0,b=r.find(k=>k.id===t.workspaceId),x=o.find(k=>k.id===d),S=t.branch&&(b!=null&&b.repoUrl)?`${b.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(t.branch)}`:void 0;return i.jsxs("div",{className:he.overviewDashboard,"data-testid":"task-overview-panel",children:[i.jsxs("div",{className:he.overviewHero,children:[i.jsx(iL,{status:t.status}),t.branch&&i.jsx("span",{className:he.overviewBranchPill,"data-testid":"task-overview-branch",children:S?i.jsxs("a",{href:S,target:"_blank",rel:"noreferrer noopener",className:he.branchLink,children:["🔗"," ",t.branch]}):i.jsxs("span",{children:["🔗"," ",t.branch]})})]}),typeof t.description=="string"&&t.description&&i.jsxs("div",{className:he.overviewSection,"data-testid":"task-overview-description",children:[i.jsx("div",{className:he.overviewLabel,children:"Description"}),i.jsx("div",{className:he.overviewMarkdown,children:i.jsx(hd,{remarkPlugins:[gd],children:t.description})})]}),t.workpad&&i.jsx(wB,{workpad:t.workpad}),i.jsxs("div",{className:he.overviewSection,children:[i.jsx("div",{className:he.overviewLabel,children:"Environment"}),g&&v?i.jsxs("div",{className:he.envRow,"data-testid":"task-overview-environment",children:[i.jsx("span",{className:`${he.envDot} ${Gb(v.status)}`,title:v.status,"aria-label":`Status: ${v.status}`,role:"img"}),i.jsx("span",{className:he.overviewValue,children:v.displayName})]}):x?i.jsxs("div",{className:he.envRow,"data-testid":"task-overview-environment",children:[i.jsx("span",{className:`${he.envDot} ${Gb(x.status)}`,title:x.status,"aria-label":`Status: ${x.status}`,role:"img"}),i.jsx("span",{className:he.overviewValue,children:x.displayName}),i.jsx("span",{className:he.overviewMuted,children:"(workspace default)"})]}):i.jsx("div",{className:he.overviewMuted,children:"Set in workspace settings"})]}),i.jsxs("div",{className:he.overviewSection,"data-testid":"task-overview-dependencies",children:[i.jsx("div",{className:he.overviewLabel,children:"Dependencies"}),t.dependsOn.length===0?i.jsx("div",{className:he.overviewMuted,children:"None"}):i.jsx("div",{className:he.depList,children:t.dependsOn.map(k=>{const w=s.get(k),N=(w==null?void 0:w.status)==="complete";return i.jsxs("div",{className:`${he.depItem} ${N?he.depDone:he.depBlocked}`,children:[i.jsx("span",{children:N?"✓":"○"}),i.jsx("span",{children:(w==null?void 0:w.title)??k})]},k)})})]}),i.jsxs("div",{className:he.overviewSection,"data-testid":"task-overview-timeline",children:[i.jsx("div",{className:he.overviewLabel,children:"Timeline"}),i.jsxs("div",{className:he.timeline,children:[t.createdAt&&i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Created"}),i.jsx("span",{className:he.timelineValue,children:Lc(t.createdAt)})]}),t.assignedAt&&(()=>{const k=yp(t.createdAt,t.assignedAt);return i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Assigned"}),i.jsx("span",{className:he.timelineValue,children:Lc(t.assignedAt)}),k!==void 0&&i.jsx("span",{className:he.timelineDelta,children:k})]})})(),t.startedAt&&(()=>{const k=yp(t.assignedAt??t.createdAt,t.startedAt);return i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Started"}),i.jsx("span",{className:he.timelineValue,children:Lc(t.startedAt)}),k!==void 0&&i.jsx("span",{className:he.timelineDelta,children:k})]})})(),t.completedAt&&(()=>{const k=yp(t.startedAt,t.completedAt);return i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Completed"}),i.jsx("span",{className:he.timelineValue,children:Lc(t.completedAt)}),k!==void 0&&i.jsx("span",{className:he.timelineDelta,children:k})]})})(),!t.createdAt&&!t.assignedAt&&!t.startedAt&&!t.completedAt&&i.jsx("div",{className:he.overviewMuted,children:"No timing data"})]})]}),u&&u.costMillicents>0&&i.jsxs("div",{className:he.overviewSection,"data-testid":"task-overview-usage",children:[i.jsx("div",{className:he.overviewLabel,children:"Usage"}),i.jsxs("div",{className:he.timeline,children:[i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Cost"}),i.jsx("span",{className:he.timelineValue,children:Ss(u.costMillicents)}),i.jsxs("span",{className:he.timelineDelta,children:[u.sessionCount," session",u.sessionCount!==1?"s":""]})]}),p&&p.costMillicents>u.costMillicents&&i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Total (incl. subtasks)"}),i.jsx("span",{className:he.timelineValue,children:Ss(p.costMillicents)}),i.jsxs("span",{className:he.timelineDelta,children:[p.sessionCount," session",p.sessionCount!==1?"s":""]})]})]})]}),(t.tokenBudget>0||t.costBudgetMillicents>0)&&i.jsxs("div",{className:he.overviewSection,"data-testid":"task-overview-budget",children:[i.jsx("div",{className:he.overviewLabel,children:"Budget"}),i.jsxs("div",{className:he.timeline,children:[t.tokenBudget>0&&i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Tokens"}),i.jsxs("span",{className:he.timelineValue,children:[Mo(((u==null?void 0:u.inputTokens)??0)+((u==null?void 0:u.outputTokens)??0))," / ",Mo(t.tokenBudget)]})]}),t.costBudgetMillicents>0&&i.jsxs("div",{className:he.timelineRow,children:[i.jsx("span",{className:he.timelineKey,children:"Cost"}),i.jsxs("span",{className:he.timelineValue,children:[Ss((u==null?void 0:u.costMillicents)??0)," / ",Ss(t.costBudgetMillicents)]})]})]})]}),t.reviewNotes&&i.jsxs("div",{className:he.overviewSection,"data-testid":"task-overview-review-notes",children:[i.jsx("div",{className:he.overviewLabel,children:"Review Notes"}),i.jsx("div",{className:he.reviewNotes,children:t.reviewNotes})]})]})}const rL="_container_legrg_1",lL="_header_legrg_8",cL="_headerTitle_legrg_35",dL="_badge_legrg_44",uL="_headerActions_legrg_54",fL="_body_legrg_61",pL="_formContent_legrg_73",mL="_section_legrg_85",hL="_label_legrg_91",gL="_nameInput_legrg_98",vL="_fieldInput_legrg_131",yL="_adapterSelect_legrg_164",bL="_readOnlyValue_legrg_198",xL="_codespaceSection_legrg_204",_L="_codespaceActions_legrg_210",kL="_creatingHint_legrg_216",SL="_errorHint_legrg_222",TL="_btnPrimary_legrg_235",wL="_btnGhost_legrg_266",re={container:rL,header:lL,headerTitle:cL,badge:dL,headerActions:uL,body:fL,formContent:pL,section:mL,label:hL,nameInput:gL,fieldInput:vL,adapterSelect:yL,readOnlyValue:bL,codespaceSection:xL,codespaceActions:_L,creatingHint:kL,errorHint:SL,btnPrimary:TL,btnGhost:wL},Wc=1,Xc=65535;function bp(t){if(!t.trim())return!0;const s=Number(t);return Number.isInteger(s)&&s>=Wc&&s<=Xc}function xp(t){try{const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}catch{}return{}}function jL({codespaceName:t,onCodespaceNameChange:s,envName:o,onEnvNameChange:r,codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:m}){const[g,v]=y.useState("pick"),[b,x]=y.useState(""),[S,k]=y.useState("");return g==="create"?i.jsxs("div",{className:re.codespaceSection,children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Repository"}),i.jsx("input",{type:"text",value:b,onChange:w=>x(w.target.value),placeholder:"owner/repo",className:re.fieldInput,"data-testid":"env-codespace-repo"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Machine Type"}),i.jsx("input",{type:"text",value:S,onChange:w=>k(w.target.value),placeholder:"Machine type (optional)...",className:re.fieldInput,"data-testid":"env-codespace-machine"})]}),i.jsxs("div",{className:re.codespaceActions,children:[i.jsx("button",{onClick:()=>{b.trim()&&(m(b.trim(),S.trim()||void 0),v("pick"),x(""),k(""))},disabled:!b.trim(),className:re.btnPrimary,children:"Create"}),i.jsx("button",{onClick:()=>{v("pick"),x(""),k("")},className:re.btnGhost,children:"Cancel"})]})]}):i.jsx("div",{className:re.codespaceSection,children:i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Codespace"}),!u&&i.jsxs("select",{value:t,onChange:w=>{w.target.value==="__create__"?(v("create"),s("")):(s(w.target.value),w.target.value&&!o.trim()&&r(w.target.value))},disabled:p,className:re.adapterSelect,"data-testid":"env-codespace-select",children:[i.jsx("option",{value:"",children:"Select a codespace..."}),c.map(w=>i.jsxs("option",{value:w.name,children:[w.name," (",w.repository,") — ",w.state]},w.name)),i.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),p&&i.jsx("span",{className:re.creatingHint,children:"Creating codespace..."}),u&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:re.errorHint,children:u}),i.jsx("input",{type:"text",value:t,onChange:w=>s(w.target.value),placeholder:"Or enter codespace name manually...",className:re.fieldInput,"data-testid":"env-codespace-manual"})]}),d&&!u&&i.jsx("span",{className:re.errorHint,children:d})]})})}function A1({mode:t,environmentId:s,environments:o,onAddEnvironment:r,onUpdateEnvironment:c,onListCodespaces:d,codespaces:u,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v,onShowToast:b}){const x=kt(),S=t==="edit",k=S&&s?o.find(me=>me.id===s):void 0,[w,N]=y.useState(""),[T,C]=y.useState("local"),[D,B]=y.useState(""),[E,A]=y.useState(""),[P,I]=y.useState(""),[U,Q]=y.useState(""),[$,W]=y.useState(""),[pe,H]=y.useState(""),[ie,L]=y.useState(""),[Z,J]=y.useState(null),ce=y.useCallback(()=>{const me={};if(T==="local"){if(D.trim()&&(me.host=D.trim()),E.trim()){const _e=Number(E);Number.isInteger(_e)&&(me.port=_e)}}else if(T==="ssh"){if(me.host=D.trim(),P.trim()&&(me.user=P.trim()),E.trim()){const _e=Number(E);Number.isInteger(_e)&&(me.sshPort=_e)}U.trim()&&(me.identityFile=U.trim())}else T==="docker"?($.trim()&&(me.image=$.trim()),pe.trim()&&(me.repo=pe.trim())):T==="codespace"&&(me.codespaceName=ie.trim());return me},[T,D,E,P,U,$,pe,ie]),X=()=>!(!w.trim()||T==="ssh"&&!D.trim()||T==="codespace"&&!ie.trim()||(T==="local"||T==="ssh")&&!bp(E)),ge=()=>{X()&&(r(w.trim(),T,ce()),b==null||b("Environment added successfully","success"),x(Ro,{replace:!0}))},fe=()=>{x(s?ji(s):Ro)},Ce=y.useCallback((me,_e)=>{if(!k||!s)return;const ve=xp(k.adapterConfig),Le=_e.trim();Le?ve[me]=Le:delete ve[me],c(s,{adapterConfig:ve})},[k,s,c]),Ze=y.useCallback((me,_e)=>{if(!k||!s)return;const ve=xp(k.adapterConfig);if(_e.trim()){const Le=Number(_e);Number.isInteger(Le)&&Le>=Wc&&Le<=Xc&&(ve[me]=Le)}else delete ve[me];c(s,{adapterConfig:ve})},[k,s,c]);if(S){if(!k)return i.jsxs("div",{className:re.container,children:[i.jsxs("div",{className:re.header,children:[i.jsx("div",{className:re.headerTitle,children:i.jsx("span",{className:re.badge,children:"edit environment"})}),i.jsx("div",{className:re.headerActions,children:i.jsx("button",{onClick:fe,className:re.btnGhost,children:"Back"})})]}),i.jsx("div",{className:re.body,children:i.jsx("div",{className:re.formContent,children:i.jsx("span",{className:re.readOnlyValue,children:"Environment not found"})})})]});const me=xp(k.adapterConfig);return i.jsxs("div",{className:re.container,"data-testid":"env-edit-panel",children:[i.jsxs("div",{className:re.header,children:[i.jsx("div",{className:re.headerTitle,children:i.jsx("span",{className:re.badge,children:"edit environment"})}),i.jsx("div",{className:re.headerActions,children:i.jsx("button",{onClick:fe,className:re.btnGhost,"data-testid":"env-edit-back",children:"Back"})})]}),i.jsx("div",{className:re.body,children:i.jsxs("div",{className:re.formContent,children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Name"}),i.jsx(ln,{value:k.displayName,onSave:_e=>{s&&c(s,{displayName:_e})},validate:_e=>_e.trim()===""?"Name cannot be empty":void 0,mode:"edit",fieldId:"name",activeFieldId:Z,onActivate:J,placeholder:"Environment name",ariaLabel:"Environment name","data-testid":"env-edit-name"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Adapter Type"}),i.jsx("span",{className:re.readOnlyValue,"data-testid":"env-edit-adapter-type",children:k.adapterType})]}),k.adapterType==="local"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Host"}),i.jsx(ln,{value:String(me.host??""),onSave:_e=>Ce("host",_e),mode:"edit",fieldId:"host",activeFieldId:Z,onActivate:J,placeholder:"(default)",ariaLabel:"Host","data-testid":"env-edit-host"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Port"}),i.jsx(ln,{value:String(me.port??""),onSave:_e=>Ze("port",_e),validate:_e=>bp(_e)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"port",activeFieldId:Z,onActivate:J,placeholder:"(default)",ariaLabel:"Port","data-testid":"env-edit-port"})]})]}),k.adapterType==="ssh"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Host"}),i.jsx(ln,{value:String(me.host??""),onSave:_e=>Ce("host",_e),validate:_e=>_e.trim()===""?"Host is required":void 0,mode:"edit",fieldId:"host",activeFieldId:Z,onActivate:J,placeholder:"hostname or IP",ariaLabel:"Host","data-testid":"env-edit-host"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"User"}),i.jsx(ln,{value:String(me.user??""),onSave:_e=>Ce("user",_e),mode:"edit",fieldId:"user",activeFieldId:Z,onActivate:J,placeholder:"(default)",ariaLabel:"User","data-testid":"env-edit-user"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"SSH Port"}),i.jsx(ln,{value:String(me.sshPort??""),onSave:_e=>Ze("sshPort",_e),validate:_e=>bp(_e)?void 0:"Port must be 1-65535",mode:"edit",fieldId:"sshPort",activeFieldId:Z,onActivate:J,placeholder:"22",ariaLabel:"SSH Port","data-testid":"env-edit-ssh-port"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Identity File"}),i.jsx(ln,{value:String(me.identityFile??""),onSave:_e=>Ce("identityFile",_e),mode:"edit",fieldId:"identityFile",activeFieldId:Z,onActivate:J,placeholder:"~/.ssh/id_rsa",ariaLabel:"Identity File","data-testid":"env-edit-identity-file"})]})]}),k.adapterType==="docker"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Image"}),i.jsx(ln,{value:String(me.image??""),onSave:_e=>Ce("image",_e),mode:"edit",fieldId:"image",activeFieldId:Z,onActivate:J,placeholder:"(default)",ariaLabel:"Image","data-testid":"env-edit-image"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Repo"}),i.jsx(ln,{value:String(me.repo??""),onSave:_e=>Ce("repo",_e),mode:"edit",fieldId:"repo",activeFieldId:Z,onActivate:J,placeholder:"(none)",ariaLabel:"Repo","data-testid":"env-edit-repo"})]})]}),k.adapterType==="codespace"&&i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,children:"Codespace Name"}),i.jsx(ln,{value:String(me.codespaceName??""),onSave:_e=>Ce("codespaceName",_e),validate:_e=>_e.trim()===""?"Codespace name is required":void 0,mode:"edit",fieldId:"codespaceName",activeFieldId:Z,onActivate:J,placeholder:"codespace-name",ariaLabel:"Codespace Name","data-testid":"env-edit-codespace-name"})]})]})})]})}return i.jsxs("div",{className:re.container,"data-testid":"env-create-panel",children:[i.jsxs("div",{className:re.header,children:[i.jsx("div",{className:re.headerTitle,children:i.jsx("span",{className:re.badge,children:"new environment"})}),i.jsxs("div",{className:re.headerActions,children:[i.jsx("button",{onClick:ge,disabled:!X(),className:re.btnPrimary,"data-testid":"env-create-submit",children:"Create"}),i.jsx("button",{onClick:fe,className:re.btnGhost,children:"Cancel"})]})]}),i.jsx("div",{className:re.body,children:i.jsxs("div",{className:re.formContent,children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-name",children:"Name"}),i.jsx("input",{id:"env-create-name",type:"text",value:w,onChange:me=>N(me.target.value),placeholder:"Environment name...",autoFocus:!0,className:re.nameInput,"data-testid":"env-create-name",onKeyDown:me=>{me.key==="Enter"&&X()&&ge()}})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-adapter",children:"Adapter Type"}),i.jsxs("select",{id:"env-create-adapter",value:T,onChange:me=>{C(me.target.value),me.target.value==="codespace"&&d()},className:re.adapterSelect,"data-testid":"env-create-adapter",children:[i.jsx("option",{value:"local",children:"local"}),i.jsx("option",{value:"ssh",children:"ssh"}),i.jsx("option",{value:"docker",children:"docker"}),i.jsx("option",{value:"codespace",children:"codespace"})]})]}),T==="local"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-host",children:"Host"}),i.jsx("input",{id:"env-create-host",type:"text",value:D,onChange:me=>B(me.target.value),placeholder:"Host (optional)...",className:re.fieldInput,"data-testid":"env-create-host"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-port",children:"Port"}),i.jsx("input",{id:"env-create-port",type:"number",min:Wc,max:Xc,value:E,onChange:me=>A(me.target.value),placeholder:"Port (optional)...",className:re.fieldInput,"data-testid":"env-create-port"})]})]}),T==="ssh"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-host",children:"Host"}),i.jsx("input",{id:"env-create-host",type:"text",value:D,onChange:me=>B(me.target.value),placeholder:"Host (required)...",className:re.fieldInput,"data-testid":"env-create-host"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-user",children:"User"}),i.jsx("input",{id:"env-create-user",type:"text",value:P,onChange:me=>I(me.target.value),placeholder:"User (optional)...",className:re.fieldInput,"data-testid":"env-create-user"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-port",children:"SSH Port"}),i.jsx("input",{id:"env-create-port",type:"number",min:Wc,max:Xc,value:E,onChange:me=>A(me.target.value),placeholder:"SSH port (optional)...",className:re.fieldInput,"data-testid":"env-create-port"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-identity",children:"Identity File"}),i.jsx("input",{id:"env-create-identity",type:"text",value:U,onChange:me=>Q(me.target.value),placeholder:"Identity file (optional)...",className:re.fieldInput,"data-testid":"env-create-identity"})]})]}),T==="docker"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-image",children:"Image"}),i.jsx("input",{id:"env-create-image",type:"text",value:$,onChange:me=>W(me.target.value),placeholder:"Image (optional)...",className:re.fieldInput,"data-testid":"env-create-image"})]}),i.jsxs("div",{className:re.section,children:[i.jsx("label",{className:re.label,htmlFor:"env-create-repo",children:"Repo"}),i.jsx("input",{id:"env-create-repo",type:"text",value:pe,onChange:me=>H(me.target.value),placeholder:"Repo (optional)...",className:re.fieldInput,"data-testid":"env-create-repo"})]})]}),T==="codespace"&&i.jsx(jL,{codespaceName:ie,onCodespaceNameChange:L,envName:w,onEnvNameChange:N,codespaces:u,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v})]})})]})}const NL="_group_1iprv_1",CL="_groupTitle_1iprv_8",EL="_shortcutList_1iprv_17",AL="_shortcutRow_1iprv_23",DL="_keys_1iprv_36",RL="_kbd_1iprv_43",ML="_description_1iprv_60",xi={group:NL,groupTitle:CL,shortcutList:EL,shortcutRow:AL,keys:DL,kbd:RL,description:ML},IL=[{title:"Global",shortcuts:[{keys:["?"],description:"Open keyboard shortcuts reference"},{keys:["N"],description:"Create a new task"},{keys:["Escape"],description:"Close dialog or cancel editing"}]},{title:"Task Page",shortcuts:[{keys:["1"],description:"Switch to Overview tab"},{keys:["2"],description:"Switch to Stream tab"},{keys:["3"],description:"Switch to Findings tab"}]},{title:"Workspace Page",shortcuts:[{keys:["1"],description:"Switch to Graph view"},{keys:["2"],description:"Switch to Board view"},{keys:["3"],description:"Switch to Tasks view"}]},{title:"Navigation Lists",shortcuts:[{keys:["←"],description:"Previous tab (horizontal nav)"},{keys:["→"],description:"Next tab (horizontal nav)"},{keys:["↑"],description:"Previous item (vertical nav)"},{keys:["↓"],description:"Next item (vertical nav)"},{keys:["J"],description:"Next item (alias for arrow down/right)"},{keys:["K"],description:"Previous item (alias for arrow up/left)"},{keys:["Home"],description:"Jump to first item"},{keys:["End"],description:"Jump to last item"}]},{title:"Editing",shortcuts:[{keys:["Enter"],description:"Activate / save inline edit"},{keys:["Space"],description:"Activate button or start editing"},{keys:["Escape"],description:"Cancel edit and discard changes"}]},{title:"Chat",shortcuts:[{keys:["Enter"],description:"Send message (when input is focused)"}]}];function OL(){return i.jsxs("section",{className:be.section,"data-testid":"keyboard-shortcuts-panel",children:[i.jsx("h3",{className:be.sectionTitle,children:"Keyboard Shortcuts"}),i.jsx("p",{className:be.sectionDescription,children:"Keyboard shortcuts for navigating and interacting with Grackle. Global shortcuts are suppressed while typing in text fields."}),IL.map(t=>i.jsxs("div",{className:xi.group,children:[i.jsx("h4",{className:xi.groupTitle,children:t.title}),i.jsx("div",{className:xi.shortcutList,children:t.shortcuts.map(s=>i.jsxs("div",{className:xi.shortcutRow,children:[i.jsx("span",{className:xi.keys,children:s.keys.map(o=>i.jsx("kbd",{className:xi.kbd,children:o},o))}),i.jsx("span",{className:xi.description,children:s.description})]},s.description))})]},t.title))]})}const BL=[{key:"claude",label:"Claude",description:"Forward Claude credentials for AI agent access.",options:[{value:"off",label:"Off"},{value:"subscription",label:"Subscription"},{value:"api_key",label:"API Key"}]},{key:"github",label:"GitHub",description:"Forward GITHUB_TOKEN and GH_TOKEN for git operations.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"copilot",label:"Copilot",description:"Forward Copilot tokens (COPILOT_GITHUB_TOKEN, CLI config).",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"codex",label:"Codex",description:"Forward OPENAI_API_KEY for Codex/OpenAI access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"goose",label:"Goose",description:"Forward Goose config and API keys for Goose agent access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function LL({credentialProviders:t,onUpdateCredentialProviders:s}){const o=(r,c)=>{const d={...t};r==="claude"?d.claude=c:d[r]=c,s(d)};return i.jsxs("section",{className:be.section,children:[i.jsx("h3",{className:be.sectionTitle,children:"Credential Providers"}),i.jsx("p",{className:be.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),i.jsx("div",{className:be.tokenList,children:BL.map(r=>i.jsxs("div",{className:be.tokenRow,children:[i.jsx("span",{className:be.tokenName,children:r.label}),i.jsx("span",{className:be.tokenTarget,children:r.description}),i.jsx("select",{className:be.select,value:t[r.key],onChange:c=>o(r.key,c.target.value),children:r.options.map(c=>i.jsx("option",{value:c.value,children:c.label},c.value))})]},r.key))})]})}const zL="_container_10efq_1",$L="_header_10efq_7",UL="_list_10efq_105",PL="_card_10efq_111",HL="_cardHeader_10efq_125",VL="_cardTitle_10efq_135",qL="_defaultBadge_10efq_141",GL="_cardActions_10efq_155",FL="_description_10efq_160",ZL="_meta_10efq_166",KL="_empty_10efq_212",YL="_typeBadge_10efq_362",Jn={container:zL,header:$L,list:UL,card:PL,cardHeader:HL,cardTitle:VL,defaultBadge:qL,cardActions:GL,description:FL,meta:ZL,empty:KL,typeBadge:YL};function JL({personas:t,appDefaultPersonaId:s,onDeletePersona:o,onSetAppDefaultPersonaId:r,onNavigateToNew:c,onNavigateToPersona:d}){const[u,p]=y.useState(null),m=u?t.find(v=>v.id===u):void 0,g=async v=>{await o(v),p(null)};return i.jsxs("div",{className:Jn.container,children:[i.jsxs("div",{className:Jn.header,children:[i.jsx("h2",{children:"Personas"}),i.jsx(Js,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),t.length===0?i.jsx("p",{className:Jn.empty,children:"No personas yet. Create one to get started."}):i.jsx("div",{className:Jn.list,children:t.map(v=>{const b=s===v.id,x=v.type==="script";return i.jsxs("div",{className:Jn.card,"data-testid":`persona-card-${v.id}`,onClick:()=>d(v.id),role:"button",tabIndex:0,onKeyDown:S=>{S.currentTarget===S.target&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),d(v.id))},children:[i.jsxs("div",{className:Jn.cardHeader,children:[i.jsxs("span",{className:Jn.cardTitle,children:[i.jsx("strong",{children:v.name}),i.jsx("span",{className:Jn.typeBadge,"data-testid":`persona-type-badge-${v.id}`,children:x?"Script":"Agent"}),b&&i.jsx("span",{className:Jn.defaultBadge,"data-testid":`persona-default-badge-${v.id}`,children:"App Default"})]}),i.jsxs("div",{className:Jn.cardActions,onClick:S=>S.stopPropagation(),children:[!b&&i.jsx(Js,{variant:"ghost",size:"sm",onClick:()=>{r(v.id).catch(()=>{})},"data-testid":`persona-set-default-${v.id}`,title:"Set as app default persona",children:"Set Default"}),i.jsx(Js,{variant:"ghost",size:"sm",onClick:()=>d(v.id),children:"Edit"}),i.jsx(Js,{variant:"ghost",size:"sm",onClick:()=>p(v.id),"data-testid":`persona-delete-${v.id}`,children:"Delete"})]})]}),v.description&&i.jsx("p",{className:Jn.description,children:v.description}),i.jsxs("div",{className:Jn.meta,children:[v.runtime&&i.jsxs("span",{children:["Runtime: ",v.runtime]}),v.model&&i.jsxs("span",{children:["Model: ",v.model]}),v.maxTurns>0&&i.jsxs("span",{children:["Max turns: ",v.maxTurns]})]})]},v.id)})}),i.jsx(Ci,{isOpen:u!==null,title:"Delete Persona?",description:`"${(m==null?void 0:m.name)??""}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:()=>{u&&g(u).catch(()=>{})},onCancel:()=>p(null)})]})}const WL="_container_uy08i_1",XL="_header_uy08i_7",QL="_count_uy08i_13",e8="_presets_uy08i_18",t8="_presetButton_uy08i_24",n8="_filterInput_uy08i_41",s8="_groups_uy08i_53",a8="_group_uy08i_53",i8="_groupHeader_uy08i_68",o8="_groupName_uy08i_77",r8="_groupCount_uy08i_81",l8="_toolList_uy08i_87",c8="_toolItem_uy08i_95",d8="_toolName_uy08i_103",pn={container:WL,header:XL,count:QL,presets:e8,presetButton:t8,filterInput:n8,groups:s8,group:a8,groupHeader:i8,groupName:o8,groupCount:r8,toolList:l8,toolItem:c8,toolName:d8},u8=(()=>{const t=new Map;for(const s of dx){const o=s==="get_version_status"?"version":s.split("_")[0];t.has(o)||t.set(o,[]),t.get(o).push(s)}return[...t.entries()].sort(([s],[o])=>s.localeCompare(o)).map(([s,o])=>({group:s,tools:o.sort()}))})(),f8=[{name:"default",label:"Default",tools:ux},{name:"worker",label:"Worker",tools:yT},{name:"orchestrator",label:"Orchestrator",tools:bT},{name:"admin",label:"Admin",tools:xT}];function Fb({selectedTools:t,onChange:s,disabled:o}){const[r,c]=y.useState(""),d=y.useMemo(()=>new Set(t),[t]),u=y.useCallback(v=>{if(o)return;const b=new Set(d);b.has(v)?b.delete(v):b.add(v),s([...b].sort())},[d,s,o]),p=y.useCallback((v,b)=>{if(o)return;const x=new Set(d);for(const S of v)b?x.delete(S):x.add(S);s([...x].sort())},[d,s,o]),m=y.useCallback(v=>{o||s([...v].sort())},[s,o]),g=r.toLowerCase();return i.jsxs("div",{className:pn.container,"data-testid":"mcp-tool-selector",children:[i.jsx("div",{className:pn.header,children:i.jsx("span",{className:pn.count,children:t.length===0?`Using default (${ux.length} tools)`:`${t.length} of ${dx.size} tools selected`})}),i.jsxs("div",{className:pn.presets,"data-testid":"mcp-tool-presets",children:[f8.map(v=>i.jsx("button",{type:"button",className:pn.presetButton,disabled:o,onClick:()=>m(v.tools),"data-testid":`preset-${v.name}`,children:v.label},v.name)),i.jsx("button",{type:"button",className:pn.presetButton,disabled:o,onClick:()=>s([]),"data-testid":"preset-clear",children:"Clear"})]}),i.jsx("input",{type:"text",className:pn.filterInput,placeholder:"Filter tools...",value:r,onChange:v=>c(v.target.value),disabled:o,"data-testid":"mcp-tool-filter"}),i.jsx("div",{className:pn.groups,children:u8.map(({group:v,tools:b})=>{const x=g?b.filter(k=>k.toLowerCase().includes(g)):b;if(x.length===0)return null;const S=x.every(k=>d.has(k));return i.jsxs("div",{className:pn.group,"data-testid":`tool-group-${v}`,children:[i.jsxs("label",{className:pn.groupHeader,children:[i.jsx("input",{type:"checkbox",checked:S,onChange:()=>p(x,S),disabled:o,"data-testid":`group-toggle-${v}`}),i.jsx("span",{className:pn.groupName,children:v}),i.jsxs("span",{className:pn.groupCount,children:["(",x.filter(k=>d.has(k)).length,"/",x.length,")"]})]}),i.jsx("div",{className:pn.toolList,children:x.map(k=>i.jsxs("label",{className:pn.toolItem,children:[i.jsx("input",{type:"checkbox",checked:d.has(k),onChange:()=>u(k),disabled:o,"data-testid":`tool-${k}`}),i.jsx("span",{className:pn.toolName,children:k})]},k))})]},v)})})]})}const p8="_nav_1bhou_1",m8="_tab_1bhou_24",h8="_tabIcon_1bhou_62",g8="_tabActive_1bhou_68",zc={nav:p8,tab:m8,tabIcon:h8,tabActive:g8},Ks=[{path:"credentials",label:"Credentials",icon:i.jsx(C2,{size:zt})},{path:"personas",label:"Personas",icon:i.jsx(nw,{size:zt})},{path:"appearance",label:"Appearance",icon:i.jsx(q2,{size:zt})},{path:"shortcuts",label:"Shortcuts",icon:i.jsx(A2,{size:zt})},{path:"about",label:"About",icon:i.jsx(im,{size:zt})}];function v8(){var u;const t=Zt(),s=kt(),o=y.useRef(null),r=((u=Ks.find(p=>{const m=`${Do}/${p.path}`;return t.pathname===m||t.pathname.startsWith(`${m}/`)}))==null?void 0:u.path)??Ks[0].path,c=y.useCallback(p=>{s(`${Do}/${p}`)},[s]),d=y.useCallback(p=>{var S,k;const m=(S=o.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(w=>w===document.activeElement),v=g>=0?g:Ks.findIndex(w=>w.path===r);let b=v;if(p.key==="ArrowDown"||p.key==="j"||p.key==="J")p.preventDefault(),b=(v+1)%Ks.length;else if(p.key==="ArrowUp"||p.key==="k"||p.key==="K")p.preventDefault(),b=(v-1+Ks.length)%Ks.length;else if(p.key==="Home")p.preventDefault(),b=0;else if(p.key==="End")p.preventDefault(),b=Ks.length-1;else return;const x=Ks[b].path;s(`${Do}/${x}`),(k=m[b])==null||k.focus()},[r,s]);return i.jsx("nav",{className:zc.nav,ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:Ks.map(p=>{const m=p.path===r;return i.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${zc.tab} ${m?zc.tabActive:""}`,onClick:()=>c(p.path),children:[i.jsx("span",{className:zc.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}function y8({tasks:t,taskStatusById:s,sessionStatusByTaskId:o}){const r=new Map;for(const d of t)if(d.parentTaskId){const u=r.get(d.parentTaskId);u?u.push(d):r.set(d.parentTaskId,[d])}const c=new Map(cy.map(d=>[d,[]]));for(const d of t){const u=ll(d.status),p=d.dependsOn.length>0&&d.dependsOn.some(k=>s.get(k)!=="complete"),m=r.get(d.id)??[],g=m.length,v=m.filter(k=>k.status==="complete").length;let b;if(u==="paused"&&o){const k=o.get(d.id);k==="idle"?b="Needs input":k==="completed"&&(b="Ready to complete")}const x={task:d,isBlocked:p,childCount:g,doneChildCount:v,pausedSubBadge:b},S=c.get(u);S?S.push(x):c.get("not_started").push(x)}for(const d of c.values())d.sort((u,p)=>u.task.sortOrder-p.task.sortOrder);return cy.map(d=>{const u=za(d);return{status:d,label:u.label,style:u,tasks:c.get(d)??[]}})}const b8="_boardContainer_1c4y1_1",x8="_column_1c4y1_17",_8="_columnHeader_1c4y1_34",k8="_columnIcon_1c4y1_47",S8="_columnLabel_1c4y1_52",T8="_columnCount_1c4y1_57",w8="_cardList_1c4y1_67",j8="_emptyPlaceholder_1c4y1_76",N8="_card_1c4y1_67",C8="_cardHeader_1c4y1_107",E8="_cardStatusIcon_1c4y1_113",A8="_cardTitle_1c4y1_119",D8="_cardBadges_1c4y1_127",R8="_badge_1c4y1_134",M8="_blockedBadge_1c4y1_146",I8="_childBadge_1c4y1_151",O8="_depBadge_1c4y1_155",B8="_parentBadge_1c4y1_159",L8="_pausedSubBadge_1c4y1_166",z8="_personaBadge_1c4y1_170",$8="_envBadge_1c4y1_174",U8="_emptyCta_1c4y1_178",P8="_ctaButton_1c4y1_188",H8="_ctaDescription_1c4y1_204",it={boardContainer:b8,column:x8,columnHeader:_8,columnIcon:k8,columnLabel:S8,columnCount:T8,cardList:w8,emptyPlaceholder:j8,card:N8,cardHeader:C8,cardStatusIcon:E8,cardTitle:A8,cardBadges:D8,badge:R8,blockedBadge:M8,childBadge:I8,depBadge:O8,parentBadge:B8,pausedSubBadge:L8,personaBadge:z8,envBadge:$8,emptyCta:U8,ctaButton:P8,ctaDescription:H8};function V8({workspaceId:t,environmentId:s,tasks:o,sessions:r,personas:c,environments:d}){const u=kt(),p=y.useMemo(()=>o.filter(x=>x.workspaceId===t),[o,t]),m=y.useMemo(()=>new Map(o.map(x=>[x.id,x.status])),[o]),g=y.useMemo(()=>new Map(p.map(x=>[x.id,x])),[p]),v=y.useMemo(()=>{const x=new Map(r.map(C=>[C.id,C])),S=new Map(c.map(C=>[C.id,C])),k=new Map(d.map(C=>[C.id,C])),w=new Map,N=new Map,T=new Map;for(const C of p)if(C.latestSessionId){const D=x.get(C.latestSessionId);if(D){if(w.set(C.id,D.endReason||D.status),D.personaId){const B=S.get(D.personaId);B&&N.set(C.id,B.name)}if(D.environmentId){const B=k.get(D.environmentId);B&&T.set(C.id,B.displayName)}}}return{sessionStatusByTaskId:w,personaNameByTaskId:N,environmentNameByTaskId:T}},[p,r,c,d]),b=y.useMemo(()=>y8({tasks:p,taskStatusById:m,sessionStatusByTaskId:v.sessionStatusByTaskId}),[p,m,v]);return p.length===0?i.jsxs("div",{className:it.emptyCta,"data-testid":"board-empty-cta",children:[i.jsx("button",{className:it.ctaButton,onClick:()=>u(Di(t,void 0,s)),children:"Create Task"}),i.jsx("div",{className:it.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):i.jsx("div",{className:it.boardContainer,"data-testid":"board-container",children:b.map(x=>i.jsxs("section",{className:it.column,"data-testid":`board-column-${x.status}`,"aria-label":`${x.label}, ${x.tasks.length} ${x.tasks.length===1?"task":"tasks"}`,children:[i.jsxs("div",{className:it.columnHeader,children:[i.jsx("span",{className:it.columnIcon,style:{color:x.style.color},children:x.style.icon}),i.jsx("span",{className:it.columnLabel,children:x.label}),i.jsx("span",{className:it.columnCount,"data-testid":`board-count-${x.status}`,children:x.tasks.length})]}),i.jsx("div",{className:it.cardList,children:x.tasks.length===0?i.jsx("div",{className:it.emptyPlaceholder,children:"No tasks"}):i.jsx(us,{mode:"popLayout",children:x.tasks.map(S=>i.jsx(Rt.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:i.jsx(q8,{boardTask:S,tasksById:g,personaName:v.personaNameByTaskId.get(S.task.id),envName:v.environmentNameByTaskId.get(S.task.id),onClick:()=>u(On(S.task.id,void 0,t,s))})},S.task.id))})})]},x.status))})}function q8({boardTask:t,tasksById:s,personaName:o,envName:r,onClick:c}){const{task:d,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=za(d.status),b=d.parentTaskId?s.get(d.parentTaskId):void 0;return i.jsxs("div",{className:it.card,tabIndex:0,role:"button","data-testid":`board-card-${d.id}`,onClick:c,onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c())},children:[i.jsxs("div",{className:it.cardHeader,children:[i.jsx("span",{className:it.cardStatusIcon,style:{color:v.color},children:v.icon}),i.jsx("span",{className:it.cardTitle,children:d.title})]}),i.jsxs("div",{className:it.cardBadges,children:[b&&i.jsx("span",{className:`${it.badge} ${it.parentBadge}`,title:b.title,children:b.title}),p>0&&i.jsxs("span",{className:`${it.badge} ${it.childBadge}`,children:[m,"/",p]}),u&&i.jsx("span",{className:`${it.badge} ${it.blockedBadge}`,children:"blocked"}),d.dependsOn.length>0&&!u&&i.jsx("span",{className:`${it.badge} ${it.depBadge}`,children:"dep"}),g&&i.jsx("span",{className:`${it.badge} ${it.pausedSubBadge}`,children:g}),o&&i.jsx("span",{className:`${it.badge} ${it.personaBadge}`,children:o}),r&&i.jsx("span",{className:`${it.badge} ${it.envBadge}`,children:r})]})]})}const G8="_formContent_ymnez_1",F8="_section_ymnez_13",Z8="_label_ymnez_19",K8="_titleInput_ymnez_26",Y8="_descriptionTextarea_ymnez_58",J8="_selectField_ymnez_94",W8="_checkboxRow_ymnez_128",X8="_checkboxLabel_ymnez_141",Q8="_fieldError_ymnez_146",bt={formContent:G8,section:F8,label:Z8,titleInput:K8,descriptionTextarea:Y8,selectField:J8,checkboxRow:W8,checkboxLabel:X8,fieldError:Q8};function e7(t,s){return{name:(t==null?void 0:t.name)??"",description:(t==null?void 0:t.description)??"",repoUrl:(t==null?void 0:t.repoUrl)??"",environmentId:(t==null?void 0:t.environmentId)??s??"",defaultPersonaId:(t==null?void 0:t.defaultPersonaId)??"",useWorktrees:(t==null?void 0:t.useWorktrees)??!0,workingDirectory:(t==null?void 0:t.workingDirectory)??""}}const t7=100;function n7({values:t,onChange:s,environments:o,personas:r,errors:c,disabled:d,autoFocusName:u}){const p=(m,g)=>{s({...t,[m]:g})};return i.jsxs("div",{className:bt.formContent,children:[i.jsxs("div",{className:bt.section,children:[i.jsx("label",{className:bt.label,htmlFor:"ws-name",children:"Name"}),i.jsx("input",{id:"ws-name",className:bt.titleInput,type:"text",value:t.name,onChange:m=>p("name",m.target.value),placeholder:"Workspace name",maxLength:t7,autoFocus:u,disabled:d,"data-testid":"workspace-form-name"}),(c==null?void 0:c.name)&&i.jsx("span",{className:bt.fieldError,"data-testid":"workspace-form-error-name",children:c.name})]}),i.jsxs("div",{className:bt.section,children:[i.jsx("label",{className:bt.label,htmlFor:"ws-description",children:"Description"}),i.jsx("textarea",{id:"ws-description",className:bt.descriptionTextarea,value:t.description,onChange:m=>p("description",m.target.value),placeholder:"Optional description (Markdown supported)",disabled:d,"data-testid":"workspace-form-description"})]}),i.jsxs("div",{className:bt.section,children:[i.jsx("label",{className:bt.label,htmlFor:"ws-repo",children:"Repository URL"}),i.jsx("input",{id:"ws-repo",className:bt.titleInput,type:"text",value:t.repoUrl,onChange:m=>p("repoUrl",m.target.value),placeholder:"https://github.com/org/repo",disabled:d,"data-testid":"workspace-form-repo"}),(c==null?void 0:c.repoUrl)&&i.jsx("span",{className:bt.fieldError,"data-testid":"workspace-form-error-repoUrl",children:c.repoUrl})]}),i.jsxs("div",{className:bt.section,children:[i.jsx("label",{className:bt.label,htmlFor:"ws-environment",children:"Environment"}),i.jsxs("select",{id:"ws-environment",className:bt.selectField,value:t.environmentId,onChange:m=>p("environmentId",m.target.value),disabled:d,"data-testid":"workspace-form-environment",children:[i.jsx("option",{value:"",children:"Select environment…"}),o.map(m=>i.jsx("option",{value:m.id,children:m.displayName||m.id},m.id))]}),(c==null?void 0:c.environmentId)&&i.jsx("span",{className:bt.fieldError,"data-testid":"workspace-form-error-environmentId",children:c.environmentId})]}),i.jsxs("div",{className:bt.section,children:[i.jsx("label",{className:bt.label,htmlFor:"ws-persona",children:"Default Persona"}),i.jsxs("select",{id:"ws-persona",className:bt.selectField,value:t.defaultPersonaId,onChange:m=>p("defaultPersonaId",m.target.value),disabled:d,"data-testid":"workspace-form-persona",children:[i.jsx("option",{value:"",children:"(Inherit)"}),r.map(m=>i.jsx("option",{value:m.id,children:m.name},m.id))]})]}),i.jsx("div",{className:bt.section,children:i.jsxs("label",{className:bt.checkboxRow,children:[i.jsx("input",{type:"checkbox",checked:t.useWorktrees,onChange:m=>p("useWorktrees",m.target.checked),disabled:d,"data-testid":"workspace-form-worktrees"}),i.jsx("span",{className:bt.checkboxLabel,children:"Enable worktree isolation"})]})}),i.jsxs("div",{className:bt.section,children:[i.jsx("label",{className:bt.label,htmlFor:"ws-workdir",children:"Working Directory"}),i.jsx("input",{id:"ws-workdir",className:bt.titleInput,type:"text",value:t.workingDirectory,onChange:m=>p("workingDirectory",m.target.value),placeholder:"Default (server default)",disabled:d,"data-testid":"workspace-form-workdir"})]})]})}const D1=y.createContext(void 0),s7=4e3;function a7({children:t}){const[s,o]=y.useState([]),r=y.useRef(0),c=y.useCallback(u=>{o(p=>p.filter(m=>m.id!==u))},[]),d=y.useCallback((u,p="info",m=s7)=>{const g=`toast-${++r.current}`;o(v=>[...v,{id:g,message:u,variant:p,duration:m}])},[]);return i.jsx(D1.Provider,{value:{toasts:s,showToast:d,dismissToast:c},children:t})}function Sn(){const t=y.useContext(D1);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const em="grackle-theme",R1="grackle-prefer-system",M1="(prefers-color-scheme: dark)";let Gr=[],Qc;function _p(){Qc=void 0;for(const t of Gr)t()}function tm(){return typeof window>"u"?!1:window.matchMedia(M1).matches}function Wr(){if(typeof localStorage>"u")return qb;try{const t=localStorage.getItem(em);if(t!==null&&C1.has(t))return t}catch{}return qb}function pd(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(R1)==="true"}catch{return!1}}function nm(t){return Cd.find(s=>s.variantLightId===t||s.variantDarkId===t)}function I1(t,s){const o=Qp(t);if(o!=null&&o.variantDarkId)return s&&o.variantLightId?tm()?o.variantDarkId:o.variantLightId:o.variantDarkId;if(o!=null&&o.hidden&&s){const r=nm(t);if(r!=null&&r.variantLightId&&r.variantDarkId)return tm()?r.variantDarkId:r.variantLightId}return t}function To(t,s,o=!1){o&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=I1(t,s),o&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&To(Wr(),pd());function i7(){return Qc===void 0&&(Qc={themeId:Wr(),systemDark:tm(),preferSystem:pd()}),Qc}function o7(t){return Gr=[...Gr,t],()=>{Gr=Gr.filter(s=>s!==t)}}function r7(){const t=y.useSyncExternalStore(o7,i7),{themeId:s,preferSystem:o}=t,r=I1(s,o),c=y.useCallback(u=>{if(C1.has(u)){try{localStorage.setItem(em,u)}catch{}To(u,pd(),!0),_p()}},[]),d=y.useCallback(u=>{try{localStorage.setItem(R1,u?"true":"false")}catch{}if(u){const p=Wr(),m=Qp(p);if(m!=null&&m.hidden){const g=nm(p);if(g)try{localStorage.setItem(em,g.id)}catch{}}}To(Wr(),u,!0),_p()},[]);return y.useEffect(()=>{To(s,o)},[s,o]),y.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(M1),p=()=>{const m=Wr(),g=pd();if(g){const v=Qp(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&To(m,g),v!=null&&v.hidden){const b=nm(m);b!=null&&b.variantDarkId&&b.variantLightId&&To(m,g)}}_p()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:s,setTheme:c,resolvedThemeId:r,preferSystem:o,setPreferSystem:d}}const O1=y.createContext(void 0);function l7({children:t}){const s=r7();return i.jsx(O1.Provider,{value:s,children:t})}function B1(){const t=y.useContext(O1);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const L1=y.createContext(void 0),z1=y.createContext(void 0);function c7({children:t}){const[s,o]=y.useState(void 0),r=y.useCallback(c=>{o(c)},[]);return i.jsx(z1.Provider,{value:r,children:i.jsx(L1.Provider,{value:s,children:t})})}function d7(){return y.useContext(L1)}function u7(){const t=y.useContext(z1);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const th=y.createContext(void 0);function mt(){const t=y.useContext(th);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}function $1(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function U1(t,s){return console.warn(`[ws] Malformed "${t}" message: ${s}`),!1}function f7(t){return $1(t)&&typeof t.sessionId=="string"&&typeof t.eventType=="string"&&typeof t.timestamp=="string"&&typeof t.content=="string"&&(t.raw===void 0||typeof t.raw=="string")}const p7=new Set(["off","subscription","api_key"]),$c=new Set(["off","on"]);function m7(t){return $1(t)&&p7.has(t.claude)&&$c.has(t.github)&&$c.has(t.copilot)&&$c.has(t.codex)&&$c.has(t.goose)}function P1(t){switch(t){case"waiting_input":return"idle";case"completed":return"stopped";case"killed":return"stopped";case"failed":return"stopped";case"interrupted":return"stopped";case"terminated":return"stopped";default:return t}}function H1(t){switch(t){case"completed":return"completed";case"killed":return"killed";case"failed":return"interrupted";case"interrupted":return"interrupted";case"terminated":return"terminated";default:return}}const So=5e3;function h7(t,s){const o=[];let r=t;const c=new Set;for(;r&&s.has(r)&&!c.has(r);){c.add(r);const d=s.get(r);o.unshift(d),r=d.parentTaskId||void 0}return o}const na={label:"Home",url:Ni};function g7(t){return t?[na,{label:"Settings",url:Do},{label:t,url:void 0}]:[na,{label:"Settings",url:void 0}]}const nh={label:"Environments",url:Ro};function v7(){return[na,{label:"Environments",url:void 0}]}function y7(){return[na,{label:"New Chat",url:void 0}]}function b7(t){return[na,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function x7(t,s,o,r){const c=o.find(u=>u.id===t),d=r.find(u=>u.id===s);return[na,nh,{label:(d==null?void 0:d.displayName)??"Environment",url:ji(s)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function _7(t,s,o,r,c){const d=h7(t,c),u=c.get(t),p=u==null?void 0:u.workspaceId,m=p?o.find(S=>S.id===p):void 0,g=s??(m==null?void 0:m.environmentId),v=g?r.find(S=>S.id===g):void 0,b=[na];v&&g&&(b.push(nh),b.push({label:v.displayName,url:ji(g)})),m&&g&&b.push({label:m.name,url:$a(m.id,g)});for(let S=0;S<d.length-1;S++)b.push({label:d[S].title,url:On(d[S].id,void 0,p,g)});const x=d[d.length-1];return b.push({label:(x==null?void 0:x.title)??t,url:void 0}),b}const k7={label:"Findings",url:_d};function S7(){return[na,{label:"Findings",url:void 0}]}function V1(t,s,o,r,c){const d=[na];if(s&&o){const u=r.find(m=>m.id===s),p=c.find(m=>m.id===o);d.push(nh),p&&d.push({label:p.displayName,url:ji(o)}),u&&d.push({label:u.name,url:$a(s,o)}),d.push({label:"Findings",url:dN(s,o)})}else d.push(k7);return d.push({label:t,url:void 0}),d}function sh(t){const s=[];for(const o of t){const r=s[s.length-1];o.eventType==="text"&&(r==null?void 0:r.eventType)==="text"?s[s.length-1]={...r,content:r.content+o.content}:s.push(o)}return s}function Uc(t){if(typeof t.id=="string")return t.id;const s=t.data;if(s&&typeof s.toolCallId=="string")return s.toolCallId;const o=t.item;if(o&&typeof o.id=="string")return o.id}function T7(t){if(typeof t.tool_use_id=="string")return t.tool_use_id;const s=t.data;if(s&&typeof s.toolCallId=="string")return s.toolCallId;const o=t.item;if(o&&typeof o.id=="string")return o.id}function ah(t){const s=new Map;for(const v of t)if(v.raw)try{s.set(v,JSON.parse(v.raw))}catch{}const o=new Map;for(const v of t){if(v.eventType!=="tool_use")continue;const b=s.get(v),x=b?Uc(b):void 0;if(x)try{const S=JSON.parse(v.content);o.set(x,{tool:S.tool,args:S.args})}catch{}}const r=new Set,c=new Set,d=t.map((v,b)=>{if(v.eventType!=="tool_result")return v;const x=s.get(v),S=x?T7(x):void 0;if(!S)return v;const k=o.get(S);if(!k)return v;r.add(S),c.add(b);let w;const N=v.content.trim();if(N.startsWith("{"))try{const T=JSON.parse(N);typeof T.detailedContent=="string"&&(w=T.detailedContent)}catch{}return{...v,toolUseCtx:{...k,detailedResult:w}}}),u=[];for(let v=0;v<d.length;v++){if(d[v].eventType!=="tool_use")continue;const b=s.get(d[v]),x=b?Uc(b):void 0;x&&r.has(x)||u.push(v)}const p=[];for(let v=0;v<d.length;v++)d[v].eventType!=="tool_result"||c.has(v)||p.push(v);let m=0;for(const v of u){for(;m<p.length&&p[m]<v;)m++;if(m>=p.length)break;const b=p[m];if(b!==v+1)continue;const x=d[v],S=d[b];let k;try{const w=JSON.parse(x.content);k={tool:w.tool,args:w.args}}catch{}if(k){let w;const N=S.content.trim();if(N.startsWith("{"))try{const D=JSON.parse(N);typeof D.detailedContent=="string"&&(w=D.detailedContent)}catch{}d[b]={...S,toolUseCtx:{...k,detailedResult:w}},c.add(b);const T=s.get(x),C=T?Uc(T):void 0;C?r.add(C):(r.add(`__seq_${v}`),s.set(x,{...T??{},__seqId:`__seq_${v}`})),m++}}const g=d.filter(v=>{if(v.eventType!=="tool_use")return!0;const b=s.get(v);if(!b)return!0;const x=Uc(b);if(x&&r.has(x))return!1;const S=b.__seqId;return!(S&&r.has(S))});for(let v=0;v<g.length;v++){if(g[v].eventType!=="tool_use")continue;let b=!1;for(let x=v+1;x<g.length;x++)if(g[x].eventType!=="tool_use"){b=!0;break}b&&(g[v]={...g[v],settled:!0})}return g}function w7(t,s,o){const r=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,c=q1(s),d=s.filter(m=>sm(m,c)).length,u=s.filter(m=>m.status==="paused"||m.status==="failed"||sm(m,c)).length,p=o.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:r,blockedTasks:d,attentionTasks:u,unhealthyEnvironments:p}}function q1(t){const s=new Map;for(const o of t)s.set(o.id,o.status);return s}function sm(t,s){return t.dependsOn.some(o=>s.get(o)!=="complete")}function j7(t,s){var u;const o=new Map;for(const p of s)o.set(p.id,p);const r=q1(t),c=[];for(const p of t){const m=p.workspaceId?((u=o.get(p.workspaceId))==null?void 0:u.name)??"Unknown":"Unknown";p.status==="failed"?c.push({task:p,reason:"failed",workspaceName:m}):sm(p,r)?c.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&c.push({task:p,reason:"paused",workspaceName:m})}const d={failed:0,blocked:1,paused:2};return c.sort((p,m)=>(d[p.reason]??3)-(d[m.reason]??3)),c}function N7(t,s){const o=new Map;for(const r of s)o.set(r.id,r);return t.filter(r=>r.status==="running"||r.status==="idle"||r.status==="waiting").map(r=>{var c;return{session:r,environmentName:((c=o.get(r.environmentId))==null?void 0:c.displayName)??"Unknown"}})}function C7(t,s,o){const r=new Map;for(const c of s){if(!c.workspaceId)continue;let d=r.get(c.workspaceId);d||(d={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},r.set(c.workspaceId,d)),d.totalTasks+=1,c.status==="complete"?d.completedTasks+=1:c.status==="working"?d.workingTasks+=1:c.status==="failed"&&(d.failedTasks+=1)}return t.map(c=>{const d=r.get(c.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:c,totalTasks:d.totalTasks,completedTasks:d.completedTasks,workingTasks:d.workingTasks,failedTasks:d.failedTasks}})}const ks=[{id:"kn-auth-flow",label:"Authentication Flow",kind:"knowledge",category:"concept",content:"The application uses JWT Bearer tokens for stateless authentication. Access tokens expire after 24h. Refresh tokens are stored in the database and rotated on use. The auth middleware verifies tokens and attaches the decoded payload to req.user.",tags:["auth","jwt","security"],workspaceId:"proj-alpha",createdAt:"2026-02-25T10:30:00Z",updatedAt:"2026-02-27T08:15:00Z",val:5},{id:"kn-db-schema",label:"Database Schema",kind:"knowledge",category:"concept",content:"PostgreSQL database with tables: users, sessions, refresh_tokens, audit_log. Uses UUID primary keys, TIMESTAMPTZ for all timestamps, and JSONB for flexible metadata columns. Connection pooling via pg-pool with per-tenant isolation.",tags:["database","postgres","schema"],workspaceId:"proj-alpha",createdAt:"2026-02-23T11:00:00Z",updatedAt:"2026-02-26T22:45:00Z",val:4},{id:"kn-error-handling",label:"Error Response Pattern",kind:"knowledge",category:"concept",content:"All API errors follow the shape { error: string, code: string, details?: unknown }. HTTP status codes map to: 400 (validation), 401 (unauthenticated), 403 (forbidden), 404 (not found), 409 (conflict), 429 (rate limited), 500 (internal).",tags:["api","errors","patterns"],workspaceId:"proj-alpha",createdAt:"2026-02-27T08:17:00Z",updatedAt:"2026-02-27T08:17:00Z",val:3},{id:"kn-rate-limiting",label:"Rate Limiting Strategy",kind:"knowledge",category:"concept",content:"Token-bucket algorithm with in-memory state per client IP. Default rate: 100 requests/minute, burst: 20. Returns 429 with Retry-After header. Redis adapter available for multi-instance deployments.",tags:["api","rate-limiting","infrastructure"],workspaceId:"proj-alpha",createdAt:"2026-02-27T09:00:00Z",updatedAt:"2026-02-27T09:00:00Z",val:2},{id:"kn-etl-pipeline",label:"ETL Pipeline Architecture",kind:"knowledge",category:"concept",content:"Data pipelines follow an Extract-Transform-Load pattern with pluggable stages. Each stage reads from a source (Postgres, S3, API), transforms via configurable mappers, and loads into a target (Parquet, BigQuery, S3). Incremental loads use high-watermark tracking.",tags:["etl","pipeline","architecture"],workspaceId:"proj-beta",createdAt:"2026-02-26T08:00:00Z",updatedAt:"2026-02-27T09:05:00Z",val:4},{id:"kn-parquet-format",label:"Parquet Output Format",kind:"knowledge",category:"concept",content:"Parquet files are written with row-group buffering (configurable batch size, default 10000 rows). Supports Snappy, ZSTD, and GZIP compression. Schema is derived from the internal column type system using Arrow type mapping.",tags:["parquet","data-format","compression"],workspaceId:"proj-beta",createdAt:"2026-02-26T08:05:00Z",updatedAt:"2026-02-26T08:15:00Z",val:3},{id:"kn-jwt-over-session",label:"JWT over Session Auth",kind:"knowledge",category:"decision",content:"Chose JWT tokens over server-side sessions for stateless auth. Rationale: (1) no session store needed, (2) works across microservices without shared state, (3) supports mobile clients natively. Trade-off: tokens can't be revoked instantly (mitigated by short expiry + refresh rotation).",tags:["auth","decision","jwt"],workspaceId:"proj-alpha",createdAt:"2026-02-25T10:00:00Z",updatedAt:"2026-02-25T10:00:00Z",val:3},{id:"kn-pg-pool-decision",label:"pg-pool over Knex",kind:"knowledge",category:"decision",content:"Chose pg-pool over Knex for connection pooling. pg-pool gives direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool and adds query-building overhead we don't need since we write raw SQL with parameterized queries.",tags:["database","decision","postgres"],workspaceId:"proj-alpha",createdAt:"2026-02-23T11:30:00Z",updatedAt:"2026-02-23T11:30:00Z",val:2},{id:"kn-watermark-decision",label:"Local Watermark Storage",kind:"knowledge",category:"decision",content:"Currently using local SQLite for watermark storage. This works for single-worker pipelines but needs to move to a shared store (Redis or Postgres) for production multi-worker scenarios. Tracked as a follow-up task.",tags:["pipeline","decision","watermarks"],workspaceId:"proj-beta",createdAt:"2026-02-27T09:05:00Z",updatedAt:"2026-02-27T09:05:00Z",val:2},{id:"kn-jwt-middleware",label:"JWT Verify Middleware",kind:"knowledge",category:"snippet",content:`\`\`\`typescript
|
|
275
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
276
|
+
const header = req.headers.authorization;
|
|
277
|
+
if (!header?.startsWith("Bearer ")) {
|
|
278
|
+
res.status(401).json({ error: "Missing token" });
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
282
|
+
req.user = decoded;
|
|
283
|
+
next();
|
|
284
|
+
}
|
|
285
|
+
\`\`\``,tags:["auth","jwt","middleware","typescript"],workspaceId:"proj-alpha",createdAt:"2026-02-27T08:15:14Z",updatedAt:"2026-02-27T08:15:14Z",val:2},{id:"kn-audit-schema",label:"Audit Log Schema",kind:"knowledge",category:"snippet",content:`\`\`\`sql
|
|
286
|
+
CREATE TABLE audit_log (
|
|
287
|
+
id BIGSERIAL PRIMARY KEY,
|
|
288
|
+
user_id UUID REFERENCES users(id),
|
|
289
|
+
action TEXT NOT NULL,
|
|
290
|
+
entity_type TEXT NOT NULL,
|
|
291
|
+
entity_id TEXT NOT NULL,
|
|
292
|
+
old_value JSONB,
|
|
293
|
+
new_value JSONB,
|
|
294
|
+
ip_address INET,
|
|
295
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
296
|
+
);
|
|
297
|
+
\`\`\``,tags:["database","audit","schema","sql"],workspaceId:"proj-alpha",createdAt:"2026-02-26T22:45:15Z",updatedAt:"2026-02-26T22:45:15Z",val:2},{id:"kn-n1-query",label:"N+1 Query in User List",kind:"knowledge",category:"insight",content:"GET /api/users performs a separate query for each user's role metadata, resulting in N+1 queries. For 500 users this adds ~2 seconds of latency. Solution: use a JOIN or batch lookup to fetch all role data in a single query.",tags:["performance","database","n+1"],workspaceId:"proj-alpha",createdAt:"2026-02-22T09:30:00Z",updatedAt:"2026-02-22T09:30:00Z",val:2},{id:"kn-session-race",label:"Session Cleanup Race Condition",kind:"knowledge",category:"insight",content:"When two concurrent requests hit /api/logout, the second call throws a 500 because the session row has already been deleted. Fix: use DELETE ... RETURNING or add IF EXISTS guard to make the operation idempotent.",tags:["bug","concurrency","sessions"],workspaceId:"proj-alpha",createdAt:"2026-02-26T22:50:00Z",updatedAt:"2026-02-26T22:50:00Z",val:2},{id:"kn-ref-task-001",label:"JWT Auth Task",kind:"reference",sourceType:"task",sourceId:"task-001",content:"Implement JWT authentication across all protected routes, replacing session-based auth.",workspaceId:"proj-alpha",createdAt:"2026-02-25T10:00:00Z",updatedAt:"2026-02-27T08:15:00Z",val:3},{id:"kn-ref-task-006",label:"Parquet Export Task",kind:"reference",sourceType:"task",sourceId:"task-006",content:"Add Parquet export support for pipeline outputs, enabling downstream Spark consumption.",workspaceId:"proj-beta",createdAt:"2026-02-26T08:00:00Z",updatedAt:"2026-02-27T09:00:00Z",val:3},{id:"kn-ref-sess-001",label:"Auth Middleware Session",kind:"reference",sourceType:"session",sourceId:"sess-001",content:"Active session implementing JWT auth middleware, rewrote auth.ts, login.ts, and test suite.",workspaceId:"proj-alpha",createdAt:"2026-02-27T08:15:00Z",updatedAt:"2026-02-27T08:15:42Z",val:2}],Ra=[{source:"kn-auth-flow",target:"kn-jwt-over-session",type:"decided_by"},{source:"kn-auth-flow",target:"kn-jwt-middleware",type:"implemented_by"},{source:"kn-auth-flow",target:"kn-ref-task-001",type:"tracked_in"},{source:"kn-auth-flow",target:"kn-error-handling",type:"relates_to"},{source:"kn-jwt-over-session",target:"kn-ref-task-001",type:"motivated_by"},{source:"kn-db-schema",target:"kn-pg-pool-decision",type:"decided_by"},{source:"kn-db-schema",target:"kn-audit-schema",type:"contains"},{source:"kn-db-schema",target:"kn-n1-query",type:"affected_by"},{source:"kn-db-schema",target:"kn-session-race",type:"affected_by"},{source:"kn-rate-limiting",target:"kn-error-handling",type:"relates_to"},{source:"kn-rate-limiting",target:"kn-auth-flow",type:"depends_on"},{source:"kn-etl-pipeline",target:"kn-parquet-format",type:"outputs_to"},{source:"kn-etl-pipeline",target:"kn-watermark-decision",type:"decided_by"},{source:"kn-etl-pipeline",target:"kn-ref-task-006",type:"tracked_in"},{source:"kn-parquet-format",target:"kn-ref-task-006",type:"tracked_in"},{source:"kn-watermark-decision",target:"kn-etl-pipeline",type:"relates_to"},{source:"kn-ref-task-001",target:"kn-ref-sess-001",type:"has_session"},{source:"kn-jwt-middleware",target:"kn-ref-sess-001",type:"created_in"},{source:"kn-audit-schema",target:"kn-db-schema",type:"part_of"}],E7=new Map(ks.map(t=>[t.id,t]));function kp(t){const s=E7.get(t);if(!s)throw new Error(`MOCK_KNOWLEDGE_NODES is missing node "${t}"`);return s}const Zb={"kn-auth-flow":{node:kp("kn-auth-flow"),edges:[{fromId:"kn-auth-flow",toId:"kn-jwt-over-session",type:"decided_by"},{fromId:"kn-auth-flow",toId:"kn-jwt-middleware",type:"implemented_by"},{fromId:"kn-auth-flow",toId:"kn-ref-task-001",type:"tracked_in"},{fromId:"kn-auth-flow",toId:"kn-error-handling",type:"relates_to"},{fromId:"kn-rate-limiting",toId:"kn-auth-flow",type:"depends_on"}]},"kn-db-schema":{node:kp("kn-db-schema"),edges:[{fromId:"kn-db-schema",toId:"kn-pg-pool-decision",type:"decided_by"},{fromId:"kn-db-schema",toId:"kn-audit-schema",type:"contains"},{fromId:"kn-db-schema",toId:"kn-n1-query",type:"affected_by"},{fromId:"kn-db-schema",toId:"kn-session-race",type:"affected_by"},{fromId:"kn-audit-schema",toId:"kn-db-schema",type:"part_of"}]},"kn-etl-pipeline":{node:kp("kn-etl-pipeline"),edges:[{fromId:"kn-etl-pipeline",toId:"kn-parquet-format",type:"outputs_to"},{fromId:"kn-etl-pipeline",toId:"kn-watermark-decision",type:"decided_by"},{fromId:"kn-etl-pipeline",toId:"kn-ref-task-006",type:"tracked_in"},{fromId:"kn-watermark-decision",toId:"kn-etl-pipeline",type:"relates_to"}]}},A7=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",adapterConfig:'{"image":"node:20"}',status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",adapterConfig:'{"codespaceName":"my-codespace"}',status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",adapterConfig:'{"host":"192.168.1.10","user":"deploy","sshPort":22}',status:"disconnected",bootstrapped:!1},{id:"error-env",displayName:"Error Test",adapterType:"local",adapterConfig:"{}",status:"connected",bootstrapped:!0}],D7=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation",inputTokens:84200,outputTokens:12750,costMillicents:41e3},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z",inputTokens:42600,outputTokens:8100,costMillicents:22e3},{id:"sess-002",environmentId:"env-docker-01",runtime:"copilot",status:"stopped",endReason:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z",endedAt:"2026-02-27T07:33:00Z",inputTokens:31400,outputTokens:9800,costMillicents:18e3},{id:"sess-003",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z",endedAt:"2026-02-26T23:10:00Z",inputTokens:56300,outputTokens:14200,costMillicents:31e3},{id:"sess-004",environmentId:"env-docker-01",runtime:"codex",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z",inputTokens:18900,outputTokens:4500,costMillicents:1e4},{id:"sess-005",environmentId:"env-cs-01",runtime:"claude-code",status:"suspended",prompt:"Refactor database connection pooling for multi-tenant isolation",startedAt:"2026-02-27T06:00:00Z",inputTokens:67800,outputTokens:19300,costMillicents:38e3}],R7=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"system",timestamp:"2026-02-26T14:00:02Z",content:`You are a senior backend engineer. Focus on security best practices and thorough testing.
|
|
298
|
+
Project: acme/alpha — Node.js + Express REST API
|
|
299
|
+
Task: Implement auth middleware using JWT tokens`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:00:05Z",content:"I'll start by reading the current authentication middleware to understand what needs to change."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:00:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/middleware/auth.ts"}}),raw:JSON.stringify({id:"tu-prev-001",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:00:07Z",content:`import session from "express-session";
|
|
300
|
+
import type { Request, Response, NextFunction } from "express";
|
|
301
|
+
|
|
302
|
+
export function requireAuth(req: Request, res: Response, next: NextFunction): void {
|
|
303
|
+
if (!req.session?.userId) {
|
|
304
|
+
res.status(401).json({ error: "Not authenticated" });
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
next();
|
|
308
|
+
}`,raw:JSON.stringify({tool_use_id:"tu-prev-001"})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:00:10Z",content:"The current auth uses express-session with server-side session storage. Let me find all files that depend on this pattern."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:00:11Z",content:JSON.stringify({tool:"Grep",args:{pattern:"req\\.session",path:"src/"}}),raw:JSON.stringify({id:"tu-prev-002",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:00:12Z",content:`src/middleware/auth.ts:4: if (!req.session?.userId) {
|
|
309
|
+
src/routes/login.ts:18: req.session.userId = user.id;
|
|
310
|
+
src/routes/login.ts:19: req.session.role = user.role;
|
|
311
|
+
src/routes/protected.ts:7: const userId = req.session.userId;`,raw:JSON.stringify({tool_use_id:"tu-prev-002"})},{sessionId:"sess-001-prev",eventType:"usage",timestamp:"2026-02-26T14:30:00Z",content:JSON.stringify({input_tokens:42100,output_tokens:6350,cost_millicents:21e3})},{sessionId:"sess-001-prev",eventType:"text",timestamp:"2026-02-26T14:30:02Z",content:"Found 3 files using session-based auth. Now let me read the login route and the protected route to understand the full flow before making changes."},{sessionId:"sess-001-prev",eventType:"tool_use",timestamp:"2026-02-26T14:30:03Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/routes/login.ts"}}),raw:JSON.stringify({id:"tu-prev-003",type:"tool_use"})},{sessionId:"sess-001-prev",eventType:"tool_result",timestamp:"2026-02-26T14:30:04Z",content:`import { Router } from "express";
|
|
312
|
+
import bcrypt from "bcrypt";
|
|
313
|
+
import { db } from "../db.js";
|
|
314
|
+
|
|
315
|
+
const router = Router();
|
|
316
|
+
|
|
317
|
+
router.post("/login", async (req, res) => {
|
|
318
|
+
const { email, password } = req.body;
|
|
319
|
+
const user = await db.users.findByEmail(email);
|
|
320
|
+
if (!user || !await bcrypt.compare(password, user.passwordHash)) {
|
|
321
|
+
return res.status(401).json({ error: "Invalid credentials" });
|
|
322
|
+
}
|
|
323
|
+
req.session.userId = user.id;
|
|
324
|
+
req.session.role = user.role;
|
|
325
|
+
res.json({ ok: true });
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
export default router;`,raw:JSON.stringify({tool_use_id:"tu-prev-003"})},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T15:12:01Z",content:"interrupted"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"system",timestamp:"2026-02-27T08:15:02Z",content:`You are a senior backend engineer. Focus on security best practices and thorough testing.
|
|
329
|
+
Project: acme/alpha — Node.js + Express REST API
|
|
330
|
+
Task: Implement auth middleware using JWT tokens
|
|
331
|
+
|
|
332
|
+
Note: A previous session attempted this task but was interrupted. Pick up where it left off.`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:04Z",content:"I'll pick up the JWT auth migration. The previous session identified 3 files that need updating. Let me verify the current state and start implementing."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:04.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Install jsonwebtoken package",activeForm:"Installing jsonwebtoken",status:"pending"},{content:"Rewrite auth middleware for JWT",activeForm:"Rewriting auth middleware",status:"pending"},{content:"Update login route to issue tokens",activeForm:"Updating login route",status:"pending"},{content:"Update protected routes",activeForm:"Updating protected routes",status:"pending"},{content:"Fix and update tests",activeForm:"Fixing tests",status:"pending"},{content:"Run full test suite",activeForm:"Running tests",status:"pending"}]}})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:05Z",content:JSON.stringify({tool:"Grep",args:{pattern:"express-session|req\\.session",path:"src/",output_mode:"files_with_matches"}}),raw:JSON.stringify({id:"tu-001-01",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:06Z",content:`src/middleware/auth.ts
|
|
333
|
+
src/routes/login.ts
|
|
334
|
+
src/routes/protected.ts`,raw:JSON.stringify({tool_use_id:"tu-001-01"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:08Z",content:"Good, same 3 files. Let me install the JWT library first, then rewrite the middleware."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:09Z",content:JSON.stringify({tool:"Bash",args:{command:"npm install jsonwebtoken && npm install -D @types/jsonwebtoken"}}),raw:JSON.stringify({id:"tu-001-02",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:11Z",content:`added 12 packages in 3.2s
|
|
335
|
+
|
|
336
|
+
added 1 package in 0.8s`,raw:JSON.stringify({tool_use_id:"tu-001-02"})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:11.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Install jsonwebtoken package",activeForm:"Installing jsonwebtoken",status:"completed"},{content:"Rewrite auth middleware for JWT",activeForm:"Rewriting auth middleware",status:"in_progress"},{content:"Update login route to issue tokens",activeForm:"Updating login route",status:"pending"},{content:"Update protected routes",activeForm:"Updating protected routes",status:"pending"},{content:"Fix and update tests",activeForm:"Fixing tests",status:"pending"},{content:"Run full test suite",activeForm:"Running tests",status:"pending"}]}})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:12Z",content:"Now I'll rewrite the auth middleware to use JWT verification instead of session checks."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:13Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/auth.ts",content:`import jwt from "jsonwebtoken";
|
|
337
|
+
import type { Request, Response, NextFunction } from "express";
|
|
338
|
+
|
|
339
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
340
|
+
|
|
341
|
+
export interface JwtPayload {
|
|
342
|
+
userId: string;
|
|
343
|
+
role: string;
|
|
344
|
+
iat: number;
|
|
345
|
+
exp: number;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
349
|
+
const header = req.headers.authorization;
|
|
350
|
+
if (!header?.startsWith("Bearer ")) {
|
|
351
|
+
res.status(401).json({ error: "Missing or malformed token" });
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
try {
|
|
355
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET) as JwtPayload;
|
|
356
|
+
req.user = decoded;
|
|
357
|
+
next();
|
|
358
|
+
} catch (err) {
|
|
359
|
+
if (err instanceof jwt.TokenExpiredError) {
|
|
360
|
+
res.status(401).json({ error: "Token expired" });
|
|
361
|
+
} else {
|
|
362
|
+
res.status(403).json({ error: "Invalid token" });
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
`}}),raw:JSON.stringify({id:"tu-001-03",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:14Z",content:"File written: src/middleware/auth.ts (32 lines)",raw:JSON.stringify({tool_use_id:"tu-001-03"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:16Z",content:`Now I need to update the login route to issue JWT tokens instead of setting session data.
|
|
367
|
+
|
|
368
|
+
The new login flow will:
|
|
369
|
+
1. Validate credentials (unchanged)
|
|
370
|
+
2. Generate a JWT with \`userId\` and \`role\` claims
|
|
371
|
+
3. Return the token in the response body
|
|
372
|
+
4. Include a refresh token for long-lived sessions`},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:17Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/routes/login.ts",content:`import { Router } from "express";
|
|
373
|
+
import bcrypt from "bcrypt";
|
|
374
|
+
import jwt from "jsonwebtoken";
|
|
375
|
+
import crypto from "node:crypto";
|
|
376
|
+
import { db } from "../db.js";
|
|
377
|
+
|
|
378
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
379
|
+
const ACCESS_TOKEN_EXPIRY = "24h";
|
|
380
|
+
const REFRESH_TOKEN_BYTES = 48;
|
|
381
|
+
|
|
382
|
+
const router = Router();
|
|
383
|
+
|
|
384
|
+
router.post("/login", async (req, res) => {
|
|
385
|
+
const { email, password } = req.body;
|
|
386
|
+
const user = await db.users.findByEmail(email);
|
|
387
|
+
if (!user || !(await bcrypt.compare(password, user.passwordHash))) {
|
|
388
|
+
return res.status(401).json({ error: "Invalid credentials" });
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const accessToken = jwt.sign(
|
|
392
|
+
{ userId: user.id, role: user.role },
|
|
393
|
+
JWT_SECRET,
|
|
394
|
+
{ expiresIn: ACCESS_TOKEN_EXPIRY },
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
const refreshToken = crypto.randomBytes(REFRESH_TOKEN_BYTES).toString("hex");
|
|
398
|
+
await db.refreshTokens.create({ userId: user.id, token: refreshToken });
|
|
399
|
+
|
|
400
|
+
res.json({ accessToken, refreshToken, expiresIn: ACCESS_TOKEN_EXPIRY });
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
export default router;
|
|
404
|
+
`}}),raw:JSON.stringify({id:"tu-001-04",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:18Z",content:"File written: src/routes/login.ts (33 lines)",raw:JSON.stringify({tool_use_id:"tu-001-04"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:20Z",content:"Let me update the protected route to use the new `req.user` shape from the JWT payload."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:21Z",content:JSON.stringify({tool:"Edit",args:{file_path:"src/routes/protected.ts",old_string:"const userId = req.session.userId;",new_string:"const { userId } = req.user as JwtPayload;"}}),raw:JSON.stringify({id:"tu-001-05",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:22Z",content:"Updated src/routes/protected.ts",raw:JSON.stringify({tool_use_id:"tu-001-05"})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:24Z",content:"Now let me run the existing tests to make sure nothing is broken, then I'll add new JWT-specific tests."},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:25Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test"}}),raw:JSON.stringify({id:"tu-001-06",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:30Z",content:` PASS src/routes/__tests__/login.test.ts
|
|
405
|
+
PASS src/routes/__tests__/protected.test.ts
|
|
406
|
+
FAIL src/middleware/__tests__/auth.test.ts
|
|
407
|
+
x should reject missing session (12ms)
|
|
408
|
+
x should allow valid session (8ms)
|
|
409
|
+
|
|
410
|
+
2 failed, 12 passed, 14 total
|
|
411
|
+
|
|
412
|
+
Test Suites: 1 failed, 2 passed, 3 total`,raw:JSON.stringify({tool_use_id:"tu-001-06",is_error:!0})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:32Z",content:`Two tests failed because they still test the old session-based auth. I need to rewrite those tests for JWT.
|
|
413
|
+
|
|
414
|
+
Let me update the auth middleware tests:`},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:33Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/__tests__/auth.test.ts",content:`import { describe, it, expect } from "vitest";
|
|
415
|
+
import jwt from "jsonwebtoken";
|
|
416
|
+
import { verifyToken } from "../auth.js";
|
|
417
|
+
import { createMockReqRes } from "../../test-utils/mock-express.js";
|
|
418
|
+
|
|
419
|
+
const SECRET = "test-secret";
|
|
420
|
+
process.env.JWT_SECRET = SECRET;
|
|
421
|
+
|
|
422
|
+
describe("verifyToken", () => {
|
|
423
|
+
it("should reject requests without Authorization header", () => {
|
|
424
|
+
const { req, res, next } = createMockReqRes();
|
|
425
|
+
verifyToken(req, res, next);
|
|
426
|
+
expect(res.status).toHaveBeenCalledWith(401);
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
it("should reject expired tokens", () => {
|
|
430
|
+
const token = jwt.sign({ userId: "u1", role: "user" }, SECRET, { expiresIn: "-1h" });
|
|
431
|
+
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
432
|
+
verifyToken(req, res, next);
|
|
433
|
+
expect(res.status).toHaveBeenCalledWith(401);
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
it("should accept valid tokens and attach user to request", () => {
|
|
437
|
+
const token = jwt.sign({ userId: "u1", role: "admin" }, SECRET, { expiresIn: "1h" });
|
|
438
|
+
const { req, res, next } = createMockReqRes({ authorization: \`Bearer \${token}\` });
|
|
439
|
+
verifyToken(req, res, next);
|
|
440
|
+
expect(next).toHaveBeenCalled();
|
|
441
|
+
expect(req.user).toMatchObject({ userId: "u1", role: "admin" });
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
`}}),raw:JSON.stringify({id:"tu-001-07",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:34Z",content:"File written: src/middleware/__tests__/auth.test.ts (32 lines)",raw:JSON.stringify({tool_use_id:"tu-001-07"})},{sessionId:"sess-001",eventType:"tool_use",timestamp:"2026-02-27T08:15:35Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test"}}),raw:JSON.stringify({id:"tu-001-08",type:"tool_use"})},{sessionId:"sess-001",eventType:"tool_result",timestamp:"2026-02-27T08:15:40Z",content:` PASS src/routes/__tests__/login.test.ts
|
|
445
|
+
PASS src/routes/__tests__/protected.test.ts
|
|
446
|
+
PASS src/middleware/__tests__/auth.test.ts
|
|
447
|
+
|
|
448
|
+
Test Suites: 3 passed, 3 total
|
|
449
|
+
Tests: 14 passed, 14 total`,raw:JSON.stringify({tool_use_id:"tu-001-08"})},{sessionId:"sess-001",eventType:"usage",timestamp:"2026-02-27T08:15:41Z",content:JSON.stringify({input_tokens:42600,output_tokens:8100,cost_millicents:22e3})},{sessionId:"sess-001",eventType:"text",timestamp:"2026-02-27T08:15:42Z",content:`All 14 tests pass. Here's a summary of the changes:
|
|
450
|
+
|
|
451
|
+
### Changes made
|
|
452
|
+
|
|
453
|
+
| File | Action |
|
|
454
|
+
|------|--------|
|
|
455
|
+
| \`src/middleware/auth.ts\` | Rewrote to verify JWT Bearer tokens |
|
|
456
|
+
| \`src/routes/login.ts\` | Now issues JWT access + refresh tokens |
|
|
457
|
+
| \`src/routes/protected.ts\` | Updated to read \`req.user\` from JWT payload |
|
|
458
|
+
| \`src/middleware/__tests__/auth.test.ts\` | Updated tests for JWT verification |
|
|
459
|
+
|
|
460
|
+
### Key decisions
|
|
461
|
+
- **Access token expiry**: 24 hours (configurable via \`JWT_SECRET\` env var)
|
|
462
|
+
- **Refresh tokens**: 48-byte random hex, stored in DB
|
|
463
|
+
- **Error handling**: Distinguishes expired tokens (401) from invalid tokens (403)`},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"system",timestamp:"2026-02-27T07:30:02Z",content:`You are a QA engineer. Write comprehensive tests covering happy paths, edge cases, error scenarios, and security.
|
|
464
|
+
Project: acme/alpha — Node.js + Express REST API
|
|
465
|
+
Task: Write unit tests for the user registration endpoint`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:30:04Z",content:"I'll write thorough tests for `POST /api/register`. Let me first read the registration endpoint to understand its behavior."},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:30:05Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/routes/register.ts"}}),raw:JSON.stringify({id:"tu-002-01",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:30:06Z",content:`import { Router } from "express";
|
|
466
|
+
import bcrypt from "bcrypt";
|
|
467
|
+
import { db } from "../db.js";
|
|
468
|
+
import { validateEmail, validatePassword } from "../utils/validators.js";
|
|
469
|
+
|
|
470
|
+
const SALT_ROUNDS = 12;
|
|
471
|
+
const router = Router();
|
|
472
|
+
|
|
473
|
+
router.post("/register", async (req, res) => {
|
|
474
|
+
const { name, email, password } = req.body;
|
|
475
|
+
|
|
476
|
+
if (!name || !email || !password) {
|
|
477
|
+
return res.status(400).json({ error: "Missing required fields" });
|
|
478
|
+
}
|
|
479
|
+
if (!validateEmail(email)) {
|
|
480
|
+
return res.status(400).json({ error: "Invalid email format" });
|
|
481
|
+
}
|
|
482
|
+
if (!validatePassword(password)) {
|
|
483
|
+
return res.status(400).json({ error: "Password too weak" });
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
const existing = await db.users.findByEmail(email);
|
|
487
|
+
if (existing) {
|
|
488
|
+
return res.status(409).json({ error: "Email already registered" });
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const passwordHash = await bcrypt.hash(password, SALT_ROUNDS);
|
|
492
|
+
const user = await db.users.create({ name, email, passwordHash });
|
|
493
|
+
res.status(201).json({ id: user.id, name: user.name, email: user.email });
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
export default router;`,raw:JSON.stringify({tool_use_id:"tu-002-01"})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:30:10Z",content:`Good. The endpoint validates input, checks for duplicates, hashes the password, and creates the user. I'll write tests covering:
|
|
497
|
+
|
|
498
|
+
1. **Happy path** - valid registration
|
|
499
|
+
2. **Missing fields** - each required field missing
|
|
500
|
+
3. **Invalid email** - malformed email format
|
|
501
|
+
4. **Weak password** - password validation failure
|
|
502
|
+
5. **Duplicate email** - conflict with existing user
|
|
503
|
+
6. **SQL injection** - malicious email input
|
|
504
|
+
7. **XSS payload** - HTML in the name field
|
|
505
|
+
8. **Response shape** - correct status codes and body structure`},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:30:12Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/routes/__tests__/register.test.ts",content:"// [test content - 8 test cases as described above]"}}),raw:JSON.stringify({id:"tu-002-02",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:30:13Z",content:"File written: src/routes/__tests__/register.test.ts (142 lines)",raw:JSON.stringify({tool_use_id:"tu-002-02"})},{sessionId:"sess-002",eventType:"tool_use",timestamp:"2026-02-27T07:31:00Z",content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --testPathPattern=register"}}),raw:JSON.stringify({id:"tu-002-03",type:"tool_use"})},{sessionId:"sess-002",eventType:"tool_result",timestamp:"2026-02-27T07:31:30Z",content:` PASS src/routes/__tests__/register.test.ts
|
|
506
|
+
POST /api/register
|
|
507
|
+
✓ should register a valid user (28ms)
|
|
508
|
+
✓ should reject missing name (4ms)
|
|
509
|
+
✓ should reject missing email (3ms)
|
|
510
|
+
✓ should reject missing password (3ms)
|
|
511
|
+
✓ should reject invalid email format (5ms)
|
|
512
|
+
✓ should reject weak password (4ms)
|
|
513
|
+
✓ should reject duplicate email (12ms)
|
|
514
|
+
✓ should sanitize HTML in name field (6ms)
|
|
515
|
+
|
|
516
|
+
Tests: 8 passed, 8 total`,raw:JSON.stringify({tool_use_id:"tu-002-03"})},{sessionId:"sess-002",eventType:"usage",timestamp:"2026-02-27T07:32:00Z",content:JSON.stringify({input_tokens:31400,output_tokens:9800,cost_millicents:18e3})},{sessionId:"sess-002",eventType:"text",timestamp:"2026-02-27T07:32:30Z",content:"All 8 test cases pass. Created `src/routes/__tests__/register.test.ts` with comprehensive coverage for the registration endpoint including input validation, duplicate detection, and security edge cases."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"},{sessionId:"sess-003",eventType:"status",timestamp:"2026-02-26T22:45:01Z",content:"running"},{sessionId:"sess-003",eventType:"system",timestamp:"2026-02-26T22:45:02Z",content:`You are a database engineer. Focus on safe migrations, zero-downtime deployments, and data integrity.
|
|
517
|
+
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
518
|
+
Task: Add audit_log table and migrate schema`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:45:05Z",content:"I need to add an `audit_log` table for tracking all write operations. Let me review the current schema first."},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:45:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"migrations/001_initial.sql"}}),raw:JSON.stringify({id:"tu-003-01",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:45:07Z",content:`CREATE TABLE users (
|
|
519
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
520
|
+
name TEXT NOT NULL,
|
|
521
|
+
email TEXT UNIQUE NOT NULL,
|
|
522
|
+
password_hash TEXT NOT NULL,
|
|
523
|
+
role TEXT DEFAULT 'user',
|
|
524
|
+
created_at TIMESTAMPTZ DEFAULT now(),
|
|
525
|
+
updated_at TIMESTAMPTZ DEFAULT now()
|
|
526
|
+
);
|
|
527
|
+
|
|
528
|
+
CREATE TABLE sessions (
|
|
529
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
530
|
+
user_id UUID REFERENCES users(id),
|
|
531
|
+
expires_at TIMESTAMPTZ NOT NULL,
|
|
532
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
533
|
+
);`,raw:JSON.stringify({tool_use_id:"tu-003-01"})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:45:12Z",content:"I see the schema. I'll create a migration that:\n1. Adds a `last_login_at` column to `users`\n2. Adds an index on `sessions.expires_at` for efficient cleanup queries\n3. Creates the `audit_log` table\n\nLet me write the migration file:"},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:45:14Z",content:JSON.stringify({tool:"Write",args:{file_path:"migrations/002_audit_log.sql",content:`-- Migration: 002_audit_log
|
|
534
|
+
-- Add audit logging and user activity tracking
|
|
535
|
+
|
|
536
|
+
BEGIN;
|
|
537
|
+
|
|
538
|
+
-- 1. Add last_login_at to users
|
|
539
|
+
ALTER TABLE users ADD COLUMN last_login_at TIMESTAMPTZ;
|
|
540
|
+
|
|
541
|
+
-- 2. Index for session cleanup queries
|
|
542
|
+
CREATE INDEX CONCURRENTLY idx_sessions_expires_at ON sessions (expires_at);
|
|
543
|
+
|
|
544
|
+
-- 3. Audit log table
|
|
545
|
+
CREATE TABLE audit_log (
|
|
546
|
+
id BIGSERIAL PRIMARY KEY,
|
|
547
|
+
user_id UUID REFERENCES users(id),
|
|
548
|
+
action TEXT NOT NULL,
|
|
549
|
+
entity_type TEXT NOT NULL,
|
|
550
|
+
entity_id TEXT NOT NULL,
|
|
551
|
+
old_value JSONB,
|
|
552
|
+
new_value JSONB,
|
|
553
|
+
ip_address INET,
|
|
554
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
555
|
+
);
|
|
556
|
+
|
|
557
|
+
CREATE INDEX idx_audit_log_user ON audit_log (user_id);
|
|
558
|
+
CREATE INDEX idx_audit_log_entity ON audit_log (entity_type, entity_id);
|
|
559
|
+
CREATE INDEX idx_audit_log_created ON audit_log (created_at);
|
|
560
|
+
|
|
561
|
+
COMMIT;
|
|
562
|
+
`}}),raw:JSON.stringify({id:"tu-003-02",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:45:15Z",content:"File written: migrations/002_audit_log.sql (29 lines)",raw:JSON.stringify({tool_use_id:"tu-003-02"})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:46:00Z",content:"Now I need to implement the audit middleware that logs write operations. This will intercept POST, PUT, PATCH, and DELETE requests."},{sessionId:"sess-003",eventType:"tool_use",timestamp:"2026-02-26T22:46:02Z",content:JSON.stringify({tool:"Bash",args:{command:"npm run migrate -- --dry-run"}}),raw:JSON.stringify({id:"tu-003-03",type:"tool_use"})},{sessionId:"sess-003",eventType:"tool_result",timestamp:"2026-02-26T22:46:10Z",content:`Dry run: would apply 002_audit_log.sql
|
|
563
|
+
- ALTER TABLE users ADD COLUMN last_login_at
|
|
564
|
+
- CREATE INDEX CONCURRENTLY idx_sessions_expires_at
|
|
565
|
+
- CREATE TABLE audit_log
|
|
566
|
+
- 3 indexes on audit_log
|
|
567
|
+
|
|
568
|
+
WARNING: CREATE INDEX CONCURRENTLY cannot run inside a transaction block.
|
|
569
|
+
Please split this into a separate migration step.`,raw:JSON.stringify({tool_use_id:"tu-003-03",is_error:!0})},{sessionId:"sess-003",eventType:"text",timestamp:"2026-02-26T22:46:15Z",content:"Good catch from the dry run! `CREATE INDEX CONCURRENTLY` can't run inside a transaction. I need to split the migration into two files: one for the transactional DDL and another for the concurrent index creation."},{sessionId:"sess-003",eventType:"usage",timestamp:"2026-02-26T23:00:00Z",content:JSON.stringify({input_tokens:56300,output_tokens:14200,cost_millicents:31e3})},{sessionId:"sess-003",eventType:"status",timestamp:"2026-02-26T23:10:00Z",content:"interrupted"},{sessionId:"sess-004",eventType:"status",timestamp:"2026-02-27T09:00:01Z",content:"running"},{sessionId:"sess-004",eventType:"system",timestamp:"2026-02-27T09:00:02Z",content:`You are a backend engineer specializing in API infrastructure.
|
|
570
|
+
Project: acme/data-pipeline — ETL pipelines for analytics
|
|
571
|
+
Task: Implement rate limiting for the public API using a token-bucket algorithm`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:05Z",content:"I'll implement rate limiting using a token-bucket algorithm. Let me first survey the existing API infrastructure to find the right integration point."},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:05.5Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Survey middleware structure",activeForm:"Surveying middleware",status:"in_progress"},{content:"Implement token-bucket algorithm",activeForm:"Implementing token bucket",status:"pending"},{content:"Add rate limit middleware to app",activeForm:"Adding middleware",status:"pending"},{content:"Write tests for rate limiting",activeForm:"Writing tests",status:"pending"},{content:"Add Redis adapter for multi-instance",activeForm:"Adding Redis adapter",status:"pending"}]}})},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:06Z",content:JSON.stringify({tool:"Glob",args:{pattern:"src/middleware/**/*.ts"}}),raw:JSON.stringify({id:"tu-004-01",type:"tool_use"})},{sessionId:"sess-004",eventType:"tool_result",timestamp:"2026-02-27T09:00:07Z",content:`src/middleware/cors.ts
|
|
572
|
+
src/middleware/error-handler.ts
|
|
573
|
+
src/middleware/logger.ts
|
|
574
|
+
src/middleware/request-id.ts`,raw:JSON.stringify({tool_use_id:"tu-004-01"})},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:09Z",content:JSON.stringify({tool:"TodoWrite",args:{todos:[{content:"Survey middleware structure",activeForm:"Surveying middleware",status:"completed"},{content:"Implement token-bucket algorithm",activeForm:"Implementing token bucket",status:"in_progress"},{content:"Add rate limit middleware to app",activeForm:"Adding middleware",status:"pending"},{content:"Write tests for rate limiting",activeForm:"Writing tests",status:"pending"},{content:"Add Redis adapter for multi-instance",activeForm:"Adding Redis adapter",status:"pending"}]}})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:10Z",content:`Good middleware structure already in place. I'll add a \`rate-limiter.ts\` module that:
|
|
575
|
+
|
|
576
|
+
- Uses an **in-memory token bucket** per client IP
|
|
577
|
+
- Supports configurable rate (requests/second) and burst size
|
|
578
|
+
- Returns \`429 Too Many Requests\` with \`Retry-After\` header
|
|
579
|
+
- Has a Redis adapter option for multi-instance deployments
|
|
580
|
+
|
|
581
|
+
Let me implement it:`},{sessionId:"sess-004",eventType:"tool_use",timestamp:"2026-02-27T09:00:12Z",content:JSON.stringify({tool:"Write",args:{file_path:"src/middleware/rate-limiter.ts",content:"// Token bucket rate limiter implementation"}}),raw:JSON.stringify({id:"tu-004-02",type:"tool_use"})},{sessionId:"sess-004",eventType:"tool_result",timestamp:"2026-02-27T09:00:13Z",content:"File written: src/middleware/rate-limiter.ts (87 lines)",raw:JSON.stringify({tool_use_id:"tu-004-02"})},{sessionId:"sess-004",eventType:"text",timestamp:"2026-02-27T09:00:18Z",content:"Now I need to wire the rate limiter into the Express middleware stack. It should go after the request-ID middleware but before route handlers."},{sessionId:"sess-005",eventType:"status",timestamp:"2026-02-27T06:00:01Z",content:"running"},{sessionId:"sess-005",eventType:"system",timestamp:"2026-02-27T06:00:02Z",content:`You are a database specialist. Focus on connection management, performance, and multi-tenant isolation.
|
|
582
|
+
Project: acme/alpha — Node.js + Express + PostgreSQL
|
|
583
|
+
Task: Refactor database connection pooling for multi-tenant isolation`,raw:JSON.stringify({systemContext:!0})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:05Z",content:"I'll refactor the DB layer to support per-tenant connection pools. This is needed because the current single-pool design means one slow tenant can exhaust connections for everyone."},{sessionId:"sess-005",eventType:"tool_use",timestamp:"2026-02-27T06:00:06Z",content:JSON.stringify({tool:"Read",args:{file_path:"src/db/pool.ts"}}),raw:JSON.stringify({id:"tu-005-01",type:"tool_use"})},{sessionId:"sess-005",eventType:"tool_result",timestamp:"2026-02-27T06:00:07Z",content:`import pg from "pg";
|
|
584
|
+
|
|
585
|
+
const pool = new pg.Pool({
|
|
586
|
+
connectionString: process.env.DATABASE_URL,
|
|
587
|
+
max: 20,
|
|
588
|
+
idleTimeoutMillis: 30000,
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
export { pool };`,raw:JSON.stringify({tool_use_id:"tu-005-01"})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:12Z",content:`The current pool is a single shared instance with \`max: 20\`. For multi-tenant isolation, I need:
|
|
592
|
+
|
|
593
|
+
1. **A \`PoolManager\` class** that creates and caches per-tenant pools
|
|
594
|
+
2. **Configurable limits** per tenant (max connections, idle timeout)
|
|
595
|
+
3. **Health checks** with automatic pool eviction for unhealthy connections
|
|
596
|
+
4. **Graceful shutdown** that drains all pools`},{sessionId:"sess-005",eventType:"tool_use",timestamp:"2026-02-27T06:00:14Z",content:JSON.stringify({tool:"Grep",args:{pattern:"import.*pool|from.*pool",path:"src/",output_mode:"content"}}),raw:JSON.stringify({id:"tu-005-02",type:"tool_use"})},{sessionId:"sess-005",eventType:"tool_result",timestamp:"2026-02-27T06:00:15Z",content:`src/db/index.ts:1:import { pool } from "./pool.js";
|
|
597
|
+
src/routes/users.ts:2:import { pool } from "../db/pool.js";
|
|
598
|
+
src/routes/register.ts:3:import { pool } from "../db/pool.js";
|
|
599
|
+
src/routes/admin.ts:4:import { pool } from "../db/pool.js";
|
|
600
|
+
src/services/billing.ts:2:import { pool } from "../db/pool.js";
|
|
601
|
+
src/services/analytics.ts:1:import { pool } from "../db/pool.js";`,raw:JSON.stringify({tool_use_id:"tu-005-02"})},{sessionId:"sess-005",eventType:"text",timestamp:"2026-02-27T06:00:20Z",content:`Six files import the pool directly. I'll need to:
|
|
602
|
+
1. Create a new \`PoolManager\` abstraction
|
|
603
|
+
2. Update all consumers to use \`getPool(tenantId)\` instead of the global pool
|
|
604
|
+
3. Add middleware to extract tenant ID from the request
|
|
605
|
+
|
|
606
|
+
This is a significant refactor. Let me start with the PoolManager class.`},{sessionId:"sess-005",eventType:"usage",timestamp:"2026-02-27T06:30:00Z",content:JSON.stringify({input_tokens:67800,output_tokens:19300,cost_millicents:38e3})},{sessionId:"sess-005",eventType:"status",timestamp:"2026-02-27T06:30:01Z",content:"suspended"}],M7=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",linkedEnvironmentIds:["env-docker-01"],status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",environmentId:"env-docker-01",linkedEnvironmentIds:[],status:"active",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",environmentId:"env-local-01",linkedEnvironmentIds:[],status:"archived",workingDirectory:"",useWorktrees:!0,defaultPersonaId:"",tokenBudget:0,costBudgetMillicents:0,createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],I7=[{id:"task-001",workspaceId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0,defaultPersonaId:"",workpad:JSON.stringify({status:"in_progress",summary:"Design and implement JWT-based authentication with access/refresh tokens, replacing session-based auth.",extra:{approach:"Replace express-session with JWT Bearer tokens. Access tokens expire in 24h, refresh tokens stored in DB.",files_changed:["src/middleware/auth.ts","src/routes/login.ts","src/routes/protected.ts"],decisions:["Chose jsonwebtoken over jose for consistency with existing codebase","24h access token expiry — long enough for dev sessions, short enough for security","Refresh tokens are 48-byte random hex stored in DB with user association"],blockers:"Need to verify token rotation strategy with security team before merging"}}),tokenBudget:0,costBudgetMillicents:0},{id:"task-001a",workspaceId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-001b",workspaceId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-001c",workspaceId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-002",workspaceId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-003",workspaceId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-004",workspaceId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-005",workspaceId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-006",workspaceId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0,defaultPersonaId:"",workpad:JSON.stringify({status:"in_progress",summary:"Plan for adding Parquet export support, including compression options and performance benchmarks.",extra:{approach:"Use apache-arrow npm package for Parquet write support. Map internal column types to Arrow type system.",compression:{supported:["snappy","zstd","gzip"],default:"snappy"},benchmarks:{"1M rows snappy":"2.3s","1M rows zstd":"3.1s","1M rows gzip":"4.8s"}}}),tokenBudget:0,costBudgetMillicents:0},{id:"task-006a",workspaceId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-006b",workspaceId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-006c",workspaceId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-006d",workspaceId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-007",workspaceId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-007a",workspaceId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-007b",workspaceId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0},{id:"task-008",workspaceId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1,defaultPersonaId:"",workpad:"",tokenBudget:0,costBudgetMillicents:0}],Pc=[{id:"find-001",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"architecture",title:"Auth middleware is tightly coupled to Express",content:"The current auth middleware directly references Express Request/Response types. Consider extracting a framework-agnostic token verification layer so we can reuse it in the WebSocket auth path.",tags:["auth","decoupling","middleware"],createdAt:"2026-02-27T08:16:00Z"},{id:"find-002",workspaceId:"proj-alpha",taskId:"task-003",sessionId:"sess-002",category:"api",title:"Missing pagination on GET /api/users",content:"The users endpoint returns all rows without limit/offset. For datasets over 10k rows this will cause timeouts. Recommend cursor-based pagination with a default page size of 50.",tags:["api","pagination","performance"],createdAt:"2026-02-27T07:31:00Z"},{id:"find-003",workspaceId:"proj-alpha",taskId:"task-005",sessionId:"sess-003",category:"bug",title:"Race condition in session cleanup",content:"When two requests hit /api/logout concurrently, the second call throws a 500 because the session row has already been deleted. Needs an idempotent DELETE or a conditional check.",tags:["bug","concurrency","sessions"],createdAt:"2026-02-26T22:50:00Z"},{id:"find-004",workspaceId:"proj-alpha",taskId:"task-004",sessionId:"",category:"decision",title:"Chose pg-pool over knex connection pool",content:"pg-pool gives us direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool anyway and adds overhead we don't need since we write raw SQL.",tags:["database","decision","postgres"],createdAt:"2026-02-23T11:30:00Z"},{id:"find-005",workspaceId:"proj-alpha",taskId:"",sessionId:"",category:"dependency",title:"jsonwebtoken has 3 high-severity CVEs",content:"The jsonwebtoken package (v8.x) has known vulnerabilities. Consider migrating to jose which is maintained, supports ESM, and covers the same JWS/JWE surface area with zero dependencies.",tags:["security","dependency","jwt"],createdAt:"2026-02-27T08:20:00Z"},{id:"find-006",workspaceId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"pattern",title:"Consistent error response shape",content:"All error responses should follow the shape `{ error: string, code: string, details?: unknown }`. Currently some routes return `{ message: string }` and others return `{ error: string }`.",tags:["api","consistency","error-handling"],createdAt:"2026-02-27T08:17:00Z"},{id:"find-007",workspaceId:"proj-beta",taskId:"task-007",sessionId:"sess-004",category:"architecture",title:"Watermark storage should be pluggable",content:"The incremental load watermarks are currently stored in a local SQLite file. For production multi-worker scenarios, this needs to be backed by a shared store (Redis or Postgres).",tags:["architecture","pipeline","scalability"],createdAt:"2026-02-27T09:05:00Z"}],O7=[{name:"anthropic",tokenType:"env_var",envVar:"ANTHROPIC_API_KEY",filePath:"",expiresAt:""},{name:"github",tokenType:"env_var",envVar:"GITHUB_TOKEN",filePath:"",expiresAt:"2026-12-31T23:59:59Z"},{name:"gcp-service-account",tokenType:"file",envVar:"",filePath:"/home/user/.config/gcloud/credentials.json",expiresAt:""}],B7=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-6",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z",type:"agent",script:"",allowedMcpTools:["task_create","task_update","task_list","finding_post","finding_list","knowledge_search","knowledge_create_node","session_spawn"]},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-6",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z",type:"agent",script:"",allowedMcpTools:[]},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-6",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z",type:"agent",script:"",allowedMcpTools:["finding_post","finding_list","knowledge_search"]},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-6",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z",type:"agent",script:"",allowedMcpTools:[]},{id:"persona-lint",name:"Lint & Format",description:"Scripted persona — runs ESLint and Prettier on changed files, auto-fixes violations, and posts a findings summary.",systemPrompt:"",toolConfig:"{}",runtime:"genaiscript",model:"",maxTurns:1,mcpServers:"[]",createdAt:"2026-02-21T09:00:00Z",updatedAt:"2026-02-21T09:00:00Z",type:"script",script:`const files = env.files.filter(f => /\\.(ts|tsx|js)$/.test(f.filename));
|
|
607
|
+
for (const f of files) {
|
|
608
|
+
const eslintResult = await host.exec("npx", ["eslint", "--fix", f.filename]);
|
|
609
|
+
if (eslintResult.exitCode !== 0) {
|
|
610
|
+
env.findings.push({ category: "lint", title: \`Lint issues in \${f.filename}\`, content: eslintResult.stderr });
|
|
611
|
+
}
|
|
612
|
+
const prettierResult = await host.exec("npx", ["prettier", "--write", f.filename]);
|
|
613
|
+
if (prettierResult.exitCode !== 0) {
|
|
614
|
+
env.findings.push({ category: "format", title: \`Prettier issues in \${f.filename}\`, content: prettierResult.stderr });
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
env.findings.push({ category: "summary", title: "Lint & format pass complete", content: \`Ran ESLint and Prettier on \${files.length} files\` });`,allowedMcpTools:[]}],L7={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"stopped",endReason:"interrupted",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function Me(t){return new Date(Date.now()+t).toISOString()}const Kb=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Me(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Me(600),content:"I'll start by finding all API route files that need refactoring."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Me(1200),content:JSON.stringify({tool:"Glob",args:{pattern:"src/routes/**/*.ts"}}),raw:JSON.stringify({id:"stream-a-01",type:"tool_use"})}},{delayMs:1600,event:{eventType:"tool_result",timestamp:Me(1600),content:`src/routes/users.ts
|
|
618
|
+
src/routes/auth.ts
|
|
619
|
+
src/routes/billing.ts
|
|
620
|
+
src/routes/admin.ts
|
|
621
|
+
src/routes/health.ts`,raw:JSON.stringify({tool_use_id:"stream-a-01"})}},{delayMs:2200,event:{eventType:"text",timestamp:Me(2200),content:`Found 5 route files. Let me refactor users.ts to use Express Router with a middleware chain.
|
|
622
|
+
|
|
623
|
+
\`\`\`typescript
|
|
624
|
+
const router = Router();
|
|
625
|
+
router.use(authenticate);
|
|
626
|
+
router.use(validateBody);
|
|
627
|
+
|
|
628
|
+
router.get("/", listUsers);
|
|
629
|
+
router.post("/", createUser);
|
|
630
|
+
router.get("/:id", getUser);
|
|
631
|
+
router.put("/:id", updateUser);
|
|
632
|
+
router.delete("/:id", deleteUser);
|
|
633
|
+
\`\`\``}},{delayMs:3200,event:{eventType:"tool_use",timestamp:Me(3200),content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --testPathPattern=routes"}}),raw:JSON.stringify({id:"stream-a-02",type:"tool_use"})}},{delayMs:4e3,event:{eventType:"tool_result",timestamp:Me(4e3),content:` PASS src/routes/__tests__/users.test.ts
|
|
634
|
+
PASS src/routes/__tests__/auth.test.ts
|
|
635
|
+
PASS src/routes/__tests__/billing.test.ts
|
|
636
|
+
|
|
637
|
+
Test Suites: 3 passed, 3 total
|
|
638
|
+
Tests: 22 passed, 22 total`,raw:JSON.stringify({tool_use_id:"stream-a-02"})}},{delayMs:4500,event:{eventType:"usage",timestamp:Me(4500),content:JSON.stringify({input_tokens:28400,output_tokens:7200,cost_millicents:15e3})}},{delayMs:5e3,event:{eventType:"text",timestamp:Me(5e3),content:"All 22 tests pass. The route refactoring is complete."}},{delayMs:5500,event:{eventType:"status",timestamp:Me(5500),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:4,steps:[{delayMs:0,event:{eventType:"status",timestamp:Me(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Me(600),content:"Scanning the current database schema to plan the migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Me(1200),content:JSON.stringify({tool:"Read",args:{file_path:"migrations/001_initial.sql"}}),raw:JSON.stringify({id:"stream-b-01",type:"tool_use"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Me(1800),content:`CREATE TABLE users (
|
|
639
|
+
id UUID PRIMARY KEY,
|
|
640
|
+
name TEXT NOT NULL,
|
|
641
|
+
email TEXT UNIQUE NOT NULL,
|
|
642
|
+
created_at TIMESTAMPTZ DEFAULT now()
|
|
643
|
+
);
|
|
644
|
+
|
|
645
|
+
CREATE TABLE sessions (
|
|
646
|
+
id UUID PRIMARY KEY,
|
|
647
|
+
user_id UUID REFERENCES users(id),
|
|
648
|
+
expires_at TIMESTAMPTZ NOT NULL
|
|
649
|
+
);`,raw:JSON.stringify({tool_use_id:"stream-b-01"})}},{delayMs:2600,event:{eventType:"text",timestamp:Me(2600),content:`I found the tables to modify:
|
|
650
|
+
- **users**: add column \`last_login_at\`
|
|
651
|
+
- **sessions**: add index on \`expires_at\`
|
|
652
|
+
- **audit_log**: new table
|
|
653
|
+
|
|
654
|
+
This migration will add a NOT NULL column to the \`users\` table. The table has **50,000+ rows** which may lock the table briefly.
|
|
655
|
+
|
|
656
|
+
Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"text",timestamp:Me(0),content:"Proceeding with migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Me(700),content:JSON.stringify({tool:"Bash",args:{command:"npm run migrate"}}),raw:JSON.stringify({id:"stream-b-02",type:"tool_use"})}},{delayMs:2200,event:{eventType:"tool_result",timestamp:Me(1700),content:`Applying 002_add_last_login.sql... done
|
|
657
|
+
Applying 003_sessions_index.sql... done
|
|
658
|
+
Applying 004_audit_log.sql... done
|
|
659
|
+
|
|
660
|
+
3 migrations applied successfully.`,raw:JSON.stringify({tool_use_id:"stream-b-02"})}},{delayMs:2800,event:{eventType:"text",timestamp:Me(2300),content:"All 3 migrations applied successfully. The `audit_log` table is ready."}},{delayMs:3200,event:{eventType:"status",timestamp:Me(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Me(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Me(600),content:"I'll generate tests for `src/services/billing.ts`. Let me read the implementation first."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Me(1200),content:JSON.stringify({tool:"Read",args:{file_path:"src/services/billing.ts"}}),raw:JSON.stringify({id:"stream-c-01",type:"tool_use"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Me(1800),content:`import { StripeClient } from "./stripe-client.js";
|
|
661
|
+
import type { Invoice, LineItem } from "../types/billing.js";
|
|
662
|
+
|
|
663
|
+
export class BillingService {
|
|
664
|
+
constructor(private stripe: StripeClient) {}
|
|
665
|
+
|
|
666
|
+
async calculateMonthlyTotal(userId: string): Promise<number> {
|
|
667
|
+
const invoices = await this.stripe.listInvoices(userId);
|
|
668
|
+
return invoices.reduce((sum, inv) => sum + inv.total, 0);
|
|
669
|
+
}
|
|
670
|
+
}`,raw:JSON.stringify({tool_use_id:"stream-c-01"})}},{delayMs:2400,event:{eventType:"text",timestamp:Me(2400),content:"The billing service imports from `./stripe-client.js`. Let me check if that module exists."}},{delayMs:2800,event:{eventType:"tool_use",timestamp:Me(2800),content:JSON.stringify({tool:"Read",args:{file_path:"src/services/stripe-client.ts"}}),raw:JSON.stringify({id:"stream-c-02",type:"tool_use"})}},{delayMs:3200,event:{eventType:"tool_result",timestamp:Me(3200),content:"Error: ENOENT: no such file or directory, open 'src/services/stripe-client.ts'",raw:JSON.stringify({tool_use_id:"stream-c-02",is_error:!0})}},{delayMs:3600,event:{eventType:"error",timestamp:Me(3600),content:"Cannot resolve import 'src/services/stripe-client.ts' — module not found. The billing service depends on a Stripe client that doesn't exist in this environment."}},{delayMs:4e3,event:{eventType:"status",timestamp:Me(4e3),content:"failed"}}]},{label:"Fix Auth Bug",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Me(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Me(600),content:"Let me investigate the authentication bug..."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Me(1200),content:JSON.stringify({tool:"Read",args:{file_path:"/src/middleware/auth.ts"}}),raw:JSON.stringify({id:"tool-mock-001"})}},{delayMs:1800,event:{eventType:"tool_result",timestamp:Me(1800),content:`import jwt from "jsonwebtoken";
|
|
671
|
+
import type { Request, Response, NextFunction } from "express";
|
|
672
|
+
|
|
673
|
+
const JWT_SECRET = process.env.JWT_SECRET || "change-me";
|
|
674
|
+
|
|
675
|
+
export function verifyToken(req: Request, res: Response, next: NextFunction): void {
|
|
676
|
+
const header = req.headers.authorization;
|
|
677
|
+
if (!header?.startsWith("Bearer ")) {
|
|
678
|
+
res.status(401).json({ error: "Missing token" });
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
try {
|
|
682
|
+
const decoded = jwt.verify(header.slice(7), JWT_SECRET);
|
|
683
|
+
if (decoded.exp > Date.now() / 1000) {
|
|
684
|
+
res.status(403).json({ error: "Token expired" });
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
req.user = decoded;
|
|
688
|
+
next();
|
|
689
|
+
} catch {
|
|
690
|
+
res.status(403).json({ error: "Invalid token" });
|
|
691
|
+
}
|
|
692
|
+
}`,raw:JSON.stringify({tool_use_id:"tool-mock-001",is_error:!1})}},{delayMs:2600,event:{eventType:"text",timestamp:Me(2600),content:"Found the issue — the token expiry check on line 14 is using `>` instead of `<`. A token is expired when `exp < now`, but the code checks `exp > now` which means it rejects *valid* tokens and accepts *expired* ones. Let me fix it."}},{delayMs:3400,event:{eventType:"tool_use",timestamp:Me(3400),content:JSON.stringify({tool:"Edit",args:{file_path:"/src/middleware/auth.ts",old_string:" if (decoded.exp > Date.now() / 1000) {",new_string:" if (decoded.exp < Date.now() / 1000) {"}}),raw:JSON.stringify({id:"tool-mock-002"})}},{delayMs:4e3,event:{eventType:"tool_result",timestamp:Me(4e3),content:"File updated successfully",raw:JSON.stringify({tool_use_id:"tool-mock-002",is_error:!1})}},{delayMs:4600,event:{eventType:"tool_use",timestamp:Me(4600),content:JSON.stringify({tool:"Bash",args:{command:"npm test -- --grep auth"}}),raw:JSON.stringify({id:"tool-mock-003"})}},{delayMs:5800,event:{eventType:"tool_result",timestamp:Me(5800),content:`[exit 0] > jest --grep auth
|
|
693
|
+
|
|
694
|
+
PASS src/auth.test.ts
|
|
695
|
+
✓ validates JWT token (12ms)
|
|
696
|
+
✓ rejects expired token (3ms)
|
|
697
|
+
✓ handles missing header (1ms)
|
|
698
|
+
|
|
699
|
+
Tests: 3 passed, 3 total
|
|
700
|
+
Time: 1.234s`,raw:JSON.stringify({tool_use_id:"tool-mock-003",is_error:!1})}},{delayMs:6400,event:{eventType:"tool_use",timestamp:Me(6400),content:JSON.stringify({tool:"Grep",args:{pattern:"decoded\\.exp",path:"src/"}}),raw:JSON.stringify({id:"tool-mock-004"})}},{delayMs:7e3,event:{eventType:"tool_result",timestamp:Me(7e3),content:`src/middleware/auth.ts:14: if (decoded.exp < Date.now() / 1000) {
|
|
701
|
+
src/utils/token-refresh.ts:28: const remaining = decoded.exp - Date.now() / 1000;`,raw:JSON.stringify({tool_use_id:"tool-mock-004",is_error:!1})}},{delayMs:7800,event:{eventType:"text",timestamp:Me(7800),content:"Fixed. The token expiry comparison was inverted — `decoded.exp > Date.now()` should have been `<` (a token is expired when its `exp` is in the past). The other occurrence in `token-refresh.ts` uses subtraction (not comparison), so it was already correct. All 3 auth tests pass."}},{delayMs:8400,event:{eventType:"usage",timestamp:Me(8400),content:JSON.stringify({input_tokens:42600,output_tokens:1850,cost_millicents:12e3})}},{delayMs:8800,event:{eventType:"status",timestamp:Me(8800),content:"completed"}}]}],_s={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:()=>!1},Yb=400;function z7({children:t}){const[s,o]=y.useState(A7),[r,c]=y.useState(D7),[d,u]=y.useState(R7),[p,m]=y.useState(void 0),[g,v]=y.useState(M7),[b,x]=y.useState(""),[S,k]=y.useState(I7),[w,N]=y.useState(Pc),[T,C]=y.useState(void 0),D=!1,[B,E]=y.useState(O7),[A,P]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[I,U]=y.useState(B7),[Q]=y.useState(L7),[$,W]=y.useState(""),[pe,H]=y.useState(ks),[ie,L]=y.useState(Ra),[Z,J]=y.useState(void 0),[ce,X]=y.useState(void 0),[ge,fe]=y.useState(""),Ce=y.useRef(void 0),Ze=y.useRef(0),me=y.useRef(0),_e=y.useRef(new Set),ve=y.useRef(new Map),Le=y.useRef(S);Le.current=S;const Mt=y.useRef(new Map),Tn=y.useRef(new Map),oe=y.useCallback(V=>(Ze.current+=1,`mock-${V}-${String(Ze.current).padStart(3,"0")}`),[]),Ve=y.useCallback(()=>{const V=Kb[me.current%Kb.length];return me.current+=1,V},[]),qt=y.useCallback((V,ae,le)=>{const de=setTimeout(()=>{var ye;_e.current.delete(de),le&&((ye=ve.current.get(le))==null||ye.delete(de)),V()},ae);_e.current.add(de),le&&(ve.current.has(le)||ve.current.set(le,new Set),ve.current.get(le).add(de))},[]),te=y.useCallback(V=>{const ae=ve.current.get(V);ae&&(ae.forEach(le=>{clearTimeout(le),_e.current.delete(le)}),ve.current.delete(V))},[]),ht=y.useCallback((V,ae,le)=>{c(de=>de.map(ye=>ye.id===V?{...ye,status:ae,...le!==void 0?{endReason:le}:{}}:ye))},[]),at=y.useCallback(V=>{u(ae=>[...ae,V])},[]),Kt=y.useCallback((V,ae,le)=>{ae.forEach((de,ye)=>{qt(()=>{const We={sessionId:V,...de.event,timestamp:new Date().toISOString()};if(at(We),de.event.eventType==="status"){const Te=P1(de.event.content),Ie=H1(de.event.content);ht(V,Te,Ie)}ye===ae.length-1&&le&&le()},de.delayMs,V)})},[qt,at,ht]),gt=y.useCallback(async(V,ae,le,de)=>{console.log("[MockGrackle] spawn",{environmentId:V,prompt:ae,runtime:de});const ye=oe("sess"),We={id:ye,environmentId:V,runtime:de||"claude-code",status:"running",prompt:ae,startedAt:new Date().toISOString()};c(Ie=>[...Ie,We]),m(ye);const Te=Ve();if(console.log(`[MockGrackle] Playing scenario: ${Te.label}`),Te.pauseForInput){const Ie=Te.pauseAfterStep??Te.steps.length-1,Ke=Te.steps.slice(0,Ie+1),ct=Ke.length>0?Ke[Ke.length-1].delayMs:0;Kt(ye,Ke),qt(()=>{ht(ye,"idle"),at({sessionId:ye,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},ct+Yb,ye),Te.resumeSteps&&Mt.current.set(ye,Te.resumeSteps)}else Kt(ye,Te.steps)},[oe,Ve,Kt,qt,ht,at]),ps=y.useCallback(async V=>{console.log("[MockGrackle] kill",V),te(V),Mt.current.delete(V),ht(V,"stopped","killed"),at({sessionId:V,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),k(ae=>ae.map(le=>le.latestSessionId===V&&le.status==="working"?{...le,status:"not_started"}:le))},[te,ht,at]),aa=y.useCallback(async V=>{console.log("[MockGrackle] stopGraceful",V),te(V),Mt.current.delete(V),ht(V,"stopped","terminated"),at({sessionId:V,eventType:"status",timestamp:new Date().toISOString(),content:"terminated"}),k(ae=>ae.map(le=>le.latestSessionId===V&&le.status==="working"?{...le,status:"not_started"}:le))},[te,ht,at]),es=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),Fa=y.useCallback(async V=>{console.log("[MockGrackle] loadSessionEvents",V)},[]),ia=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),u([])},[]),Yt=y.useCallback(async(V,ae,le,de,ye,We,Te,Ie,Ke)=>{console.log("[MockGrackle] createWorkspace",{name:V,description:ae});const ct={id:oe("proj"),name:V,description:ae||"",repoUrl:le||"",environmentId:de||"",linkedEnvironmentIds:[],status:"active",workingDirectory:Te||"",useWorktrees:We??!0,defaultPersonaId:ye||"",tokenBudget:0,costBudgetMillicents:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Xe=>[...Xe,ct]),Ie&&Ie()},[oe]),Mi=y.useCallback(async V=>{console.log("[MockGrackle] archiveWorkspace",V),v(ae=>ae.map(le=>le.id===V?{...le,status:"archived"}:le))},[]),oa=y.useCallback(async V=>{console.log("[MockGrackle] loadTasks",V)},[]),Za=y.useCallback(async(V,ae,le,de,ye,We,Te,Ie,Ke)=>{console.log("[MockGrackle] createTask",{workspaceId:V,title:ae,parentTaskId:ye}),k(ct=>{const Xt=ct.filter(gn=>gn.workspaceId===V).reduce((gn,Qa)=>Math.max(gn,Qa.sortOrder),0),jt=ye?ct.find(gn=>gn.id===ye):void 0;if(ye&&!jt)return console.warn("[MockGrackle] Parent task not found:",ye),ct;if(jt&&!jt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ye),ct;const Ue=jt?jt.depth+1:0,It={id:oe("task"),workspaceId:V,title:ae,description:le||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:de||[],reviewNotes:void 0,sortOrder:Xt+1,createdAt:new Date().toISOString(),parentTaskId:ye||"",depth:Ue,childTaskIds:[],canDecompose:Te??!ye,defaultPersonaId:We||"",workpad:"",tokenBudget:0,costBudgetMillicents:0};return[...ct,It]}),Ie&&Ie()},[oe]),ms=y.useCallback(async(V,ae,le,de)=>{var ct;console.log("[MockGrackle] startTask",{taskId:V});const ye=Le.current.find(Xe=>Xe.id===V),We=(ye==null?void 0:ye.title)??"",Te=oe("sess"),Ie={id:Te,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:We||V,startedAt:new Date().toISOString()};c(Xe=>[...Xe,Ie]),k(Xe=>Xe.map(Xt=>Xt.id===V?{...Xt,status:"working",latestSessionId:Te,branch:`mock/${V.slice(0,8)}`}:Xt));const Ke=Ve();if(console.log(`[MockGrackle] Playing task scenario: ${Ke.label}`),Ke.pauseForInput){const Xe=Ke.pauseAfterStep??Ke.steps.length-1,Xt=Ke.steps.slice(0,Xe+1),jt=Xt.length>0?Xt[Xt.length-1].delayMs:0;if(Kt(Te,Xt),qt(()=>{ht(Te,"idle"),at({sessionId:Te,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},jt+Yb,Te),Ke.resumeSteps){const Ue=[...Ke.resumeSteps];Mt.current.set(Te,Ue);const It=Ue.reduce((gn,Qa)=>Math.max(gn,Qa.delayMs),0);Tn.current.set(Te,{taskId:V,delayAfterResume:It+200})}}else{const Xe=Ke.steps.length>0?Ke.steps[Ke.steps.length-1].delayMs:0;Kt(Te,Ke.steps);const Xt=(ct=Ke.steps[Ke.steps.length-1])==null?void 0:ct.event.content;qt(()=>{Xt==="completed"?k(jt=>jt.map(Ue=>Ue.id===V&&Ue.status==="working"?{...Ue,status:"paused"}:Ue)):Xt==="failed"&&k(jt=>jt.map(Ue=>Ue.id===V&&Ue.status==="working"?{...Ue,status:"failed"}:Ue))},Xe+100,Te)}},[oe,Ve,Kt,qt,ht,at]),Ii=y.useCallback(async(V,ae)=>{console.log("[MockGrackle] sendInput",{sessionId:V,text:ae}),at({sessionId:V,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${ae}`}),ht(V,"running"),at({sessionId:V,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const le=Mt.current.get(V);if(le)Mt.current.delete(V),Kt(V,le);else{const ye=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];Kt(V,ye)}const de=Tn.current.get(V);de&&(Tn.current.delete(V),qt(()=>{k(ye=>ye.map(We=>We.id===de.taskId&&We.status==="working"?{...We,status:"paused"}:We))},de.delayAfterResume,V))},[at,ht,Kt,qt]),wn=y.useCallback(async V=>{console.log("[MockGrackle] completeTask",V),k(ae=>ae.map(le=>le.id===V?{...le,status:"complete"}:le))},[]),Re=y.useCallback(async V=>{console.log("[MockGrackle] resumeTask",V)},[]),Je=y.useCallback(async(V,ae,le,de,ye)=>{console.log("[MockGrackle] updateTask",{taskId:V,title:ae}),k(We=>We.map(Te=>Te.id===V?{...Te,title:ae.trim()||Te.title,description:le,dependsOn:de,...ye!==void 0?{defaultPersonaId:ye}:{}}:Te))},[]),Jt=y.useCallback(async V=>{console.log("[MockGrackle] deleteTask",V),k(ae=>ae.filter(le=>le.id!==V))},[]),St=y.useCallback(async V=>{console.log("[MockGrackle] loadFindings",V),N(Pc.filter(ae=>ae.workspaceId===V))},[]),un=y.useCallback(async()=>{console.log("[MockGrackle] loadAllFindings"),N([...Pc])},[]),Wt=y.useCallback(async V=>{console.log("[MockGrackle] loadFinding",V);const ae=Pc.find(le=>le.id===V);C(ae)},[]),Oi=y.useCallback(async(V,ae,le,de,ye)=>{console.log("[MockGrackle] postFinding",{workspaceId:V,title:ae});const We={id:oe("find"),workspaceId:V,taskId:"",sessionId:"",category:de||"general",title:ae,content:le,tags:ye||[],createdAt:new Date().toISOString()};N(Te=>[...Te,We])},[oe]),Bi=y.useCallback(async()=>{console.log("[MockGrackle] loadEnvironments")},[]),Li=y.useCallback(async(V,ae,le)=>{console.log("[MockGrackle] addEnvironment",{displayName:V,adapterType:ae,adapterConfig:le})},[]),Ka=y.useCallback(async(V,ae)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:V,...ae}),o(le=>le.map(de=>de.id!==V?de:{...de,...ae.displayName!==void 0?{displayName:ae.displayName}:{},...ae.adapterConfig!==void 0?{adapterConfig:JSON.stringify(ae.adapterConfig)}:{}}))},[]),Ya=y.useCallback(async()=>{console.log("[MockGrackle] loadTokens")},[]),Ja=y.useCallback(async(V,ae,le,de,ye)=>{console.log("[MockGrackle] setToken",{name:V,tokenType:le}),E(We=>[...We.filter(Ie=>Ie.name!==V),{name:V,tokenType:le,envVar:de,filePath:ye,expiresAt:""}])},[]),hs=y.useCallback(async V=>{console.log("[MockGrackle] deleteToken",V),E(ae=>ae.filter(le=>le.name!==V))},[]),Wa=y.useCallback(async V=>{console.log("[MockGrackle] updateCredentialProviders",V),P(V)},[]);y.useEffect(()=>()=>{_e.current.forEach(clearTimeout),_e.current.clear()},[]);const Xa=y.useMemo(()=>({connected:!0,environments:{environments:s,environmentsLoading:!1,provisionStatus:{},operationError:"",clearOperationError:()=>{},loadEnvironments:Bi,addEnvironment:Li,updateEnvironment:Ka,provisionEnvironment:async(V,ae)=>{},stopEnvironment:async()=>{},removeEnvironment:async()=>{},domainHook:_s},sessions:{sessions:r,sessionsLoading:!1,events:d,eventsDropped:0,lastSpawnedId:p,taskSessions:Q,spawn:gt,sendInput:Ii,kill:ps,stopGraceful:aa,loadSessionEvents:Fa,clearEvents:ia,loadTaskSessions:async V=>{console.log("[MockGrackle] loadTaskSessions",V)},domainHook:_s},workspaces:{workspaces:g,workspacesLoading:!1,workspaceCreating:!1,loadWorkspaces:async()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:Yt,archiveWorkspace:Mi,updateWorkspace:async(V,ae)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:V,...ae}),v(le=>le.map(de=>de.id!==V?de:{...de,...ae.name!==void 0?{name:ae.name}:{},...ae.description!==void 0?{description:ae.description}:{},...ae.repoUrl!==void 0?{repoUrl:ae.repoUrl}:{},...ae.environmentId!==void 0?{environmentId:ae.environmentId}:{},...ae.workingDirectory!==void 0?{workingDirectory:ae.workingDirectory}:{},...ae.useWorktrees!==void 0?{useWorktrees:ae.useWorktrees}:{},...ae.defaultPersonaId!==void 0?{defaultPersonaId:ae.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},linkEnvironment:async(V,ae)=>{if(console.log("[MockGrackle] linkEnvironment",{workspaceId:V,environmentId:ae}),ae==="error-env"){x("Failed to link environment");return}x(""),v(le=>le.map(de=>de.id!==V||de.linkedEnvironmentIds.includes(ae)?de:{...de,linkedEnvironmentIds:[...de.linkedEnvironmentIds,ae]}))},unlinkEnvironment:async(V,ae)=>{if(console.log("[MockGrackle] unlinkEnvironment",{workspaceId:V,environmentId:ae}),ae==="error-env"){x("Failed to unlink environment");return}x(""),v(le=>le.map(de=>de.id!==V?de:{...de,linkedEnvironmentIds:de.linkedEnvironmentIds.filter(ye=>ye!==ae)}))},linkOperationError:b,clearLinkOperationError:()=>{x("")},domainHook:_s},tasks:{tasks:S,tasksLoading:!1,taskStartingId:void 0,loadTasks:oa,loadAllTasks:async()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Za,startTask:ms,stopTask:async V=>{console.log("[MockGrackle] stopTask",{taskId:V}),await wn(V)},completeTask:wn,resumeTask:Re,updateTask:Je,deleteTask:Jt,domainHook:_s},findings:{findings:w,selectedFinding:T,findingLoading:D,findingsLoading:!1,loadFindings:St,loadAllFindings:un,loadFinding:Wt,postFinding:Oi,domainHook:_s},tokens:{tokens:B,tokensLoading:!1,loadTokens:Ya,setToken:Ja,deleteToken:hs,domainHook:_s},credentials:{credentialProviders:A,credentialsLoading:!1,updateCredentialProviders:Wa,domainHook:_s},codespaces:{codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:async()=>{},createCodespace:async()=>{},domainHook:_s},personas:{personas:I,personasLoading:!1,createPersona:async(V,ae,le,de,ye,We,Te,Ie,Ke)=>{console.log("[MockGrackle] createPersona",{name:V});const ct={id:`mock-persona-${Date.now()}`,name:V,description:ae,systemPrompt:le,toolConfig:"{}",runtime:de??"claude-code",model:ye||"",maxTurns:We||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Te||"agent",script:Ie||"",allowedMcpTools:Ke||[]};return U(Xe=>[...Xe,ct]),ct},updatePersona:async(V,ae,le,de,ye,We,Te,Ie,Ke,ct)=>{console.log("[MockGrackle] updatePersona",{personaId:V,name:ae});const Xe=I.find(Ue=>Ue.id===V);if(!Xe)throw new Error(`Persona not found: ${V}`);const Xt=new Date().toISOString(),jt={...Xe,...ae!==void 0?{name:ae}:{},...le!==void 0?{description:le}:{},...de!==void 0?{systemPrompt:de}:{},...ye!==void 0?{runtime:ye}:{},...We!==void 0?{model:We}:{},...Te!==void 0?{maxTurns:Te}:{},...Ie!==void 0?{type:Ie}:{},...Ke!==void 0?{script:Ke}:{},...ct!==void 0?{allowedMcpTools:ct}:{},updatedAt:Xt};return U(Ue=>Ue.map(It=>It.id===V?jt:It)),jt},deletePersona:async V=>{console.log("[MockGrackle] deletePersona",V),U(ae=>ae.filter(le=>le.id!==V))},domainHook:_s},knowledge:{graphData:{nodes:pe,links:ie},selectedNode:Z,loading:!1,selectedId:ce,searchQuery:ge,search:async V=>{if(console.log("[MockGrackle] knowledge.search",V),!V.trim()){fe(V);return}fe(V);const ae=Ce.current,le=ae?ks.filter(Te=>!Te.workspaceId||Te.workspaceId===ae):ks,de=V.toLowerCase(),ye=le.filter(Te=>{var Ie,Ke,ct;return Te.label.toLowerCase().includes(de)||((Ie=Te.content)==null?void 0:Ie.toLowerCase().includes(de))||((Ke=Te.tags)==null?void 0:Ke.some(Xe=>Xe.toLowerCase().includes(de)))||((ct=Te.category)==null?void 0:ct.toLowerCase().includes(de))});H(ye);const We=new Set(ye.map(Te=>Te.id));L(Ra.filter(Te=>We.has(Te.source)&&We.has(Te.target))),X(void 0),J(void 0)},clearSearch:()=>{console.log("[MockGrackle] knowledge.clearSearch"),fe("");const V=Ce.current,ae=V?ks.filter(de=>!de.workspaceId||de.workspaceId===V):ks;H(ae);const le=new Set(ae.map(de=>de.id));L(Ra.filter(de=>le.has(de.source)&&le.has(de.target)))},selectNode:async V=>{console.log("[MockGrackle] knowledge.selectNode",V),X(V);const ae=V in Zb?Zb[V]:void 0;if(ae)J(ae);else{const le=ks.find(de=>de.id===V);if(le){const de=Ra.filter(ye=>ye.source===V||ye.target===V).map(ye=>({fromId:ye.source,toId:ye.target,type:ye.type}));J({node:le,edges:de})}}},clearSelection:()=>{console.log("[MockGrackle] knowledge.clearSelection"),X(void 0),J(void 0)},expandNode:async V=>{console.log("[MockGrackle] knowledge.expandNode",V),H(ae=>{const le=new Set(ae.map(Ie=>Ie.id)),de=Ra.filter(Ie=>Ie.source===V||Ie.target===V),ye=new Set;for(const Ie of de)le.has(Ie.source)||ye.add(Ie.source),le.has(Ie.target)||ye.add(Ie.target);if(ye.size===0)return ae;const We=ks.filter(Ie=>ye.has(Ie.id)),Te=new Set([...le,...ye]);return L(Ie=>{const Ke=new Set(Ie.map(Xe=>`${Xe.source}|${Xe.target}|${Xe.type}`)),ct=Ra.filter(Xe=>Te.has(Xe.source)&&Te.has(Xe.target)&&!Ke.has(`${Xe.source}|${Xe.target}|${Xe.type}`));return ct.length>0?[...Ie,...ct]:Ie}),[...ae,...We]})},loadRecent:async V=>{if(console.log("[MockGrackle] knowledge.loadRecent",V),Ce.current=V,V){const ae=ks.filter(de=>!de.workspaceId||de.workspaceId===V);H(ae);const le=new Set(ae.map(de=>de.id));L(Ra.filter(de=>le.has(de.source)&&le.has(de.target)))}else H(ks),L(Ra);fe("")},handleEvent:()=>!1,domainHook:_s},appDefaultPersonaId:$,setAppDefaultPersonaId:async V=>{console.log("[MockGrackle] setAppDefaultPersonaId",V),W(V)},onboardingCompleted:!0,completeOnboarding:async()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costMillicents:112e3,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costMillicents:48e3,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costMillicents:63e3,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costMillicents:1e4,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costMillicents:63e3,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costMillicents:1e4,sessionCount:1}},loadUsage:async(V,ae)=>{console.log(`[MockGrackle] loadUsage(${V}, ${ae})`)},refresh:es}),[s,r,d,p,Q,g,b,S,w,T,B,A,I,$,pe,ie,Z,ce,ge,gt,Ii,ps,aa,Fa,ia,Yt,Mi,oa,Za,ms,wn,Re,Je,Jt,St,un,Wt,Oi,Bi,Li,Ka,Ya,Ja,hs,Wa,es]);return i.jsx(th.Provider,{value:Xa,children:t})}const $7=3e3;function U7(t){const[s,o]=y.useState(!1),r=y.useRef(t.onSessionEvent);r.current=t.onSessionEvent;const c=y.useRef(t.onDomainEvent);c.current=t.onDomainEvent;const d=y.useRef(t.onConnect);d.current=t.onConnect;const u=y.useRef(t.onDisconnect);return u.current=t.onDisconnect,y.useEffect(()=>{let p=!1,m;async function g(){var v,b;if(!p){try{const x=Ne.streamEvents({});o(!0),Promise.resolve((v=d.current)==null?void 0:v.call(d)).catch(()=>{});for await(const S of x){if(p)break;const k=S.event;if(k.case==="sessionEvent"){const w=k.value;r.current({sessionId:w.sessionId,type:w.type,timestamp:w.timestamp,content:w.content,raw:w.raw})}else if(k.case==="domainEvent"){const w=k.value;c.current({id:w.id,type:w.type,timestamp:w.timestamp,payloadJson:w.payloadJson})}}}catch(x){if(x instanceof wi&&x.code===fx.Unauthenticated){window.location.href=rN;return}}p||(o(!1),(b=u.current)==null||b.call(u),m=setTimeout(()=>{g().catch(()=>{})},$7))}}return g().catch(()=>{}),()=>{p=!0,clearTimeout(m),o(!1)}},[]),{connected:s}}const am=["core","orchestration"],G1=y.createContext({pluginNames:[...am],loading:!1,error:void 0});function P7({children:t}){const[s,o]=y.useState([...am]),[r,c]=y.useState(!0),[d,u]=y.useState(void 0);return y.useEffect(()=>{let p=!1;return fetch("/api/manifest").then(async m=>{if(!m.ok)throw new Error(`Manifest fetch returned ${m.status}`);return m.json()}).then(m=>{p||(o(m.plugins.map(g=>g.name)),c(!1))}).catch(m=>{p||(o([...am]),u(m instanceof Error?m:new Error(String(m))),c(!1))}),()=>{p=!0}},[]),i.jsx(G1.Provider,{value:{pluginNames:s,loading:r,error:d},children:t})}function ih(){return y.useContext(G1)}const H7=new Set(["dashboard","chat","environments","settings"]),V7=new Set(["tasks","findings"]),q7=new Set(["knowledge"]),F1={core:{navItems:Jc.filter(t=>H7.has(t.view)),domainHookKeys:["environments","sessions","workspaces","tokens","credentials","codespaces"]},orchestration:{navItems:Jc.filter(t=>V7.has(t.view)),domainHookKeys:["tasks","findings","personas","notifications"]},knowledge:{navItems:Jc.filter(t=>q7.has(t.view)),domainHookKeys:["knowledge"]}};function G7(t){return t.flatMap(s=>{var o;return((o=F1[s])==null?void 0:o.navItems)??[]})}function F7(t){return new Set(t.flatMap(s=>{var o;return((o=F1[s])==null?void 0:o.domainHookKeys)??[]}))}function Z7(t){return{id:t.id,displayName:t.displayName,adapterType:t.adapterType,adapterConfig:t.adapterConfig||"{}",status:t.status,bootstrapped:t.bootstrapped}}function Jb(t){return{id:t.id,environmentId:t.environmentId,runtime:t.runtime,status:t.status,prompt:t.prompt,startedAt:t.startedAt,endedAt:t.endedAt||void 0,error:t.error||void 0,endReason:t.endReason||void 0,personaId:t.personaId||void 0,inputTokens:t.inputTokens,outputTokens:t.outputTokens,costMillicents:t.costMillicents}}function K7(t){return{sessionId:t.sessionId,eventType:px(t.type),timestamp:t.timestamp,content:t.content,raw:t.raw||void 0}}function Y7(t){return{id:t.id,name:t.name,description:t.description,repoUrl:t.repoUrl,environmentId:t.environmentId,linkedEnvironmentIds:[...t.linkedEnvironmentIds],status:_T(t.status),workingDirectory:t.workingDirectory,useWorktrees:t.useWorktrees,defaultPersonaId:t.defaultPersonaId,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents,createdAt:t.createdAt,updatedAt:t.updatedAt}}function Wb(t){return{id:t.id,workspaceId:t.workspaceId??void 0,title:t.title,description:t.description,status:kT(t.status),branch:t.branch,latestSessionId:t.latestSessionId,dependsOn:[...t.dependsOn],sortOrder:t.sortOrder,createdAt:t.createdAt,startedAt:t.startedAt||void 0,completedAt:t.completedAt||void 0,parentTaskId:t.parentTaskId,depth:t.depth,childTaskIds:[...t.childTaskIds],canDecompose:t.canDecompose,defaultPersonaId:t.defaultPersonaId,workpad:t.workpad,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents}}function Sp(t){return{id:t.id,workspaceId:t.workspaceId,taskId:t.taskId,sessionId:t.sessionId,category:t.category,title:t.title,content:t.content,tags:[...t.tags],createdAt:t.createdAt}}function J7(t){return{name:t.name,tokenType:t.type,envVar:t.envVar,filePath:t.filePath,expiresAt:t.expiresAt}}function W7(t){return{claude:ST(t.claude),github:Cc(t.github),copilot:Cc(t.copilot),codex:Cc(t.codex),goose:Cc(t.goose)}}function X7(t){return{name:t.name,repository:t.repository,state:t.state,gitStatus:t.gitStatus}}function Tp(t){return{id:t.id,name:t.name,description:t.description,systemPrompt:t.systemPrompt,toolConfig:t.toolConfig?JSON.stringify({allowedTools:[...t.toolConfig.allowedTools],disallowedTools:[...t.toolConfig.disallowedTools]}):"{}",runtime:t.runtime,model:t.model,maxTurns:t.maxTurns,mcpServers:JSON.stringify(t.mcpServers.map(s=>({name:s.name,command:s.command,args:[...s.args],tools:[...s.tools]}))),createdAt:t.createdAt,updatedAt:t.updatedAt,type:t.type||"agent",script:t.script,allowedMcpTools:[...t.allowedMcpTools]}}function Q7(t){return{inputTokens:t.inputTokens,outputTokens:t.outputTokens,costMillicents:t.costMillicents,sessionCount:t.sessionCount}}function Hc(t,s=0){return{id:t.id,label:t.title||t.label||t.id,kind:t.kind,category:t.category||void 0,sourceType:t.sourceType||void 0,sourceId:t.sourceId||void 0,content:t.content||void 0,tags:t.tags.length>0?[...t.tags]:void 0,workspaceId:t.workspaceId||void 0,createdAt:t.createdAt||void 0,updatedAt:t.updatedAt||void 0,val:s}}function wp(t){return{source:t.fromId,target:t.toId,type:t.type}}function Ga(){const[t,s]=y.useState(!1),o=y.useRef(0),r=y.useCallback(c=>(o.current++,o.current===1&&s(!0),c.finally(()=>{o.current--,o.current===0&&s(!1)})),[]);return{loading:t,track:r}}const Xb=5e3;function Pr(t){return t instanceof wi?t.message:"Operation failed"}function ez(){const[t,s]=y.useState([]),{loading:o,track:r}=Ga(),[c,d]=y.useState({}),[u,p]=y.useState(""),m=y.useCallback(()=>{p("")},[]),g=y.useCallback(async()=>{try{const C=await r(Ne.listEnvironments({}));s(C.environments.map(Z7))}catch{}},[r]),v=y.useCallback(C=>{switch(C.type){case"environment.added":return!0;case"environment.removed":{const D=C.payload.environmentId;return D&&(s(B=>B.filter(E=>E.id!==D)),d(B=>{const E={...B};return delete E[D],E})),!0}case"environment.changed":return g().catch(()=>{}),!0;case"environment.provision_progress":{const D=C.payload;if(typeof D.environmentId!="string"||typeof D.stage!="string"||typeof D.message!="string"||typeof D.progress!="number")return U1("environment.provision_progress","invalid payload"),!0;if(d(B=>({...B,[D.environmentId]:{stage:D.stage,message:D.message,progress:D.progress}})),D.stage==="ready"){const B=D.environmentId;setTimeout(()=>{d(E=>{const A={...E};return delete A[B],A})},Xb)}return!0}default:return!1}},[g]),b=y.useCallback(C=>{var D;if(C.type==="environments"){const B=Array.isArray((D=C.payload)==null?void 0:D.environments)?C.payload.environments:[];return s(B),!0}return!1},[]),x=y.useCallback(async(C,D,B)=>{p("");try{await Ne.addEnvironment({displayName:C,adapterType:D,adapterConfig:JSON.stringify(B??{})})}catch(E){p(Pr(E))}},[]),S=y.useCallback(async(C,D)=>{p("");try{await Ne.updateEnvironment({id:C,displayName:D.displayName,adapterConfig:D.adapterConfig?JSON.stringify(D.adapterConfig):void 0})}catch(B){p(Pr(B))}},[]),k=y.useCallback(async(C,D)=>{p("");try{const B=Ne.provisionEnvironment({id:C,force:D??!1});for await(const E of B)d(A=>({...A,[C]:{stage:E.stage,message:E.message,progress:E.progress}})),E.stage==="ready"&&setTimeout(()=>{d(A=>{const P={...A};return delete P[C],P})},Xb)}catch(B){d(E=>{const A={...E};return delete A[C],A}),p(Pr(B))}},[]),w=y.useCallback(async C=>{p("");try{await Ne.stopEnvironment({id:C})}catch(D){p(Pr(D))}},[]),N=y.useCallback(async C=>{p("");try{await Ne.removeEnvironment({id:C})}catch(D){p(Pr(D))}},[]);return{environments:t,environmentsLoading:o,provisionStatus:c,operationError:u,clearOperationError:m,loadEnvironments:g,addEnvironment:x,updateEnvironment:S,provisionEnvironment:k,stopEnvironment:w,removeEnvironment:N,handleEvent:v,handleLegacyMessage:b,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:v}}}const jp=new Set(["pending","running","idle"]),tz=new Set(["completed","failed","interrupted","hibernating","suspended"]),Qb=["pending","running","idle"];function nz(){const[t,s]=y.useState([]),{loading:o,track:r}=Ga(),[c,d]=y.useState([]),[u,p]=y.useState(0),[m,g]=y.useState(void 0),[v,b]=y.useState({}),x=y.useCallback(async()=>{try{const U=(await r(Ne.listSessions({}))).sessions.map(Jb);s(Q=>{const $=new Map(Q.map(W=>[W.id,W]));return U.map(W=>{const pe=$.get(W.id),H=pe==null?void 0:pe.status;return!H||H===W.status?W:tz.has(H)&&jp.has(W.status)?{...W,status:H,...pe.endReason!==void 0?{endReason:pe.endReason}:{}}:jp.has(H)&&jp.has(W.status)&&Qb.indexOf(H)>Qb.indexOf(W.status)?{...W,status:H}:W})})}catch{}},[r]),S=y.useCallback(I=>{if(I.type!=="session_event")return!1;if(!f7(I.payload))return U1("session_event","payload is not a valid SessionEvent"),!0;const U=I.payload;let Q=0;if(d($=>{const W=[...$,U];return W.length>So?(Q=W.length-So,W.slice(-So)):W}),Q>0&&p($=>$+Q),U.eventType==="usage")try{const $=JSON.parse(U.content),W=Number($.input_tokens)||0,pe=Number($.output_tokens)||0,H=Number($.cost_millicents)||0;(W>0||pe>0||H>0)&&s(ie=>ie.map(L=>L.id===U.sessionId?{...L,inputTokens:(L.inputTokens??0)+W,outputTokens:(L.outputTokens??0)+pe,costMillicents:(L.costMillicents??0)+H}:L))}catch{}if(U.eventType==="status"){const $=P1(U.content),W=H1(U.content);s(pe=>pe.some(ie=>ie.id===U.sessionId)?pe.map(ie=>ie.id===U.sessionId?{...ie,status:$,...W!==void 0?{endReason:W}:{}}:ie):[...pe,{id:U.sessionId,environmentId:"",runtime:"",status:$,prompt:"",startedAt:U.timestamp,...W!==void 0?{endReason:W}:{}}])}return!0},[]),k=y.useCallback(I=>{S({type:"session_event",payload:I})},[S]),w=y.useCallback(I=>{var U,Q,$,W,pe;switch(I.type){case"sessions":{const H=Array.isArray((U=I.payload)==null?void 0:U.sessions)?I.payload.sessions:[];return s(H),!0}case"spawned":{const H=(Q=I.payload)==null?void 0:Q.sessionId;return typeof H=="string"&&H&&g(H),x().catch(()=>{}),!0}case"session_events":{const H=Array.isArray(($=I.payload)==null?void 0:$.events)?I.payload.events:[];return H.length>0&&d(H),!0}case"task_sessions":{const H=(W=I.payload)==null?void 0:W.taskId;if(typeof H=="string"&&H){const ie=Array.isArray((pe=I.payload)==null?void 0:pe.sessions)?I.payload.sessions:[];b(L=>({...L,[H]:ie}))}return!0}default:return!1}},[x]),N=y.useCallback(async(I,U,Q,$)=>{try{const W=await Ne.spawnAgent({environmentId:I,prompt:U,personaId:Q||"",workingDirectory:$||""});g(W.id),await x()}catch{}},[x]),T=y.useCallback(async(I,U)=>{try{await Ne.sendInput({sessionId:I,text:U})}catch{}},[]),C=y.useCallback(async I=>{try{await Ne.killAgent({id:I,graceful:!1})}catch{}},[]),D=y.useCallback(async I=>{try{await Ne.killAgent({id:I,graceful:!0})}catch{}},[]),B=y.useCallback(async I=>{try{const Q=(await Ne.getSessionEvents({id:I})).events.map(K7);if(Q.length>0){let $=0;d(W=>{const pe=new Set;for(const L of W)L.sessionId===I&&pe.add(`${L.timestamp}|${L.eventType}`);const H=Q.filter(L=>!pe.has(`${L.timestamp}|${L.eventType}`)),ie=[...W,...H].sort((L,Z)=>L.sessionId!==Z.sessionId?0:L.timestamp.localeCompare(Z.timestamp));return ie.length>So?($=ie.length-So,ie.slice(-So)):ie}),$>0&&p(W=>W+$)}}catch{}},[]),E=y.useCallback(()=>{d([]),p(0)},[]),A=y.useCallback(async I=>{try{const Q=(await Ne.getTaskSessions({id:I})).sessions.map(Jb);b($=>({...$,[I]:Q}))}catch{}},[]);return{sessions:t,sessionsLoading:o,events:c,eventsDropped:u,lastSpawnedId:m,taskSessions:v,loadSessions:x,spawn:N,sendInput:T,kill:C,stopGraceful:D,loadSessionEvents:B,clearEvents:E,loadTaskSessions:A,handleMessage:S,handleSessionEvent:k,handleLegacyMessage:w,domainHook:{onConnect:()=>x(),onDisconnect:()=>{E()},handleEvent:()=>!1}}}function ex(t){return t instanceof wi?t.message:"Operation failed"}function sz(){const[t,s]=y.useState([]),{loading:o,track:r}=Ga(),[c,d]=y.useState(!1),[u,p]=y.useState(""),m=y.useCallback(async()=>{try{const C=await r(Ne.listWorkspaces({}));s(C.workspaces.map(Y7))}catch{}},[r]),g=y.useCallback(C=>{switch(C.type){case"workspace.created":return d(!1),m().catch(()=>{}),!0;case"workspace.archived":case"workspace.updated":return m().catch(()=>{}),!0;default:return!1}},[m]),v=y.useCallback(()=>{d(!1)},[]),b=y.useCallback(async(C,D,B,E,A,P,I,U,Q)=>{d(!0);try{await Ne.createWorkspace({name:C,description:D||"",repoUrl:B||"",environmentId:E||"",defaultPersonaId:A||void 0,useWorktrees:P??!0,workingDirectory:I||void 0}),d(!1),U==null||U()}catch($){d(!1);const W=$ instanceof wi?$.message:"Failed to create workspace";Q==null||Q(W)}},[]),x=y.useCallback(async C=>{try{await Ne.archiveWorkspace({id:C})}catch{}},[]),S=y.useCallback(async(C,D)=>{try{await Ne.updateWorkspace({id:C,...D})}catch{}},[]),k=y.useCallback(()=>{p("")},[]),w=y.useCallback(async(C,D)=>{try{p(""),await Ne.linkEnvironment({workspaceId:C,environmentId:D}),await m().catch(()=>{})}catch(B){p(ex(B))}},[m]),N=y.useCallback(async(C,D)=>{try{p(""),await Ne.unlinkEnvironment({workspaceId:C,environmentId:D}),await m().catch(()=>{})}catch(B){p(ex(B))}},[m]);return{workspaces:t,workspacesLoading:o,workspaceCreating:c,loadWorkspaces:m,createWorkspace:b,archiveWorkspace:x,updateWorkspace:S,linkEnvironment:w,unlinkEnvironment:N,linkOperationError:u,clearLinkOperationError:k,handleEvent:g,onDisconnect:v,domainHook:{onConnect:()=>m(),onDisconnect:v,handleEvent:g}}}function az(){const[t,s]=y.useState([]),{loading:o,track:r}=Ga(),[c,d]=y.useState(void 0),u=y.useRef({}),p=y.useCallback(async E=>{try{const P=(await Ne.listTasks({workspaceId:E})).tasks.map(Wb);s(I=>[...I.filter(U=>U.workspaceId!==E),...P])}catch{}},[]),m=y.useCallback(async()=>{try{const A=(await r(Ne.listTasks({}))).tasks.map(Wb);s(P=>{const I=new Set(A.map(U=>U.id));return[...P.filter(U=>!I.has(U.id)),...A]})}catch{}},[r]),g=y.useCallback((E,A)=>{const P=I=>{clearTimeout(u.current[I]),u.current[I]=setTimeout(()=>{delete u.current[I],p(I).catch(()=>{})},200)};E?P(E):A&&s(I=>{const U=I.find(Q=>Q.id===A);return U!=null&&U.workspaceId?P(U.workspaceId):m().catch(()=>{}),I})},[p,m]),v=y.useCallback(E=>{const A=E.payload;switch(E.type){case"task.created":{const P=typeof A.workspaceId=="string"?A.workspaceId:"";return P&&p(P).catch(()=>{}),!0}case"task.started":{const P=typeof A.taskId=="string"?A.taskId:"",I=typeof A.sessionId=="string"?A.sessionId:"",U=typeof A.workspaceId=="string"?A.workspaceId:"";return d(Q=>P&&Q===P?void 0:Q),I&&P&&s(Q=>Q.map($=>$.id===P?{...$,latestSessionId:I}:$)),g(U,P),!0}case"task.completed":case"task.deleted":case"task.reparented":case"task.updated":{const P=typeof A.workspaceId=="string"?A.workspaceId:"",I=typeof A.taskId=="string"?A.taskId:"";return d(U=>I&&U===I?void 0:U),g(P,I),!0}default:return!1}},[p,g]),b=y.useCallback(()=>{d(void 0)},[]),x=y.useCallback(E=>{var A,P;if(E.type==="tasks"){const I=Array.isArray((A=E.payload)==null?void 0:A.tasks)?E.payload.tasks:[],U=typeof((P=E.payload)==null?void 0:P.workspaceId)=="string"&&E.payload.workspaceId?E.payload.workspaceId:"";return s(U?Q=>[...Q.filter($=>$.workspaceId!==U),...I]:Q=>{const $=new Set(I.map(W=>W.id));return[...Q.filter(W=>!$.has(W.id)),...I]}),!0}return!1},[]),S=y.useCallback(async(E,A,P,I,U,Q,$,W,pe)=>{try{await Ne.createTask({workspaceId:E,title:A,description:P||"",dependsOn:I||[],parentTaskId:U||"",defaultPersonaId:Q||void 0,canDecompose:$??void 0}),W==null||W()}catch(H){const ie=H instanceof wi?H.message:"Failed to create task";pe==null||pe(ie)}},[]),k=y.useCallback(async(E,A,P,I)=>{d(E);try{await Ne.startTask({taskId:E,personaId:A||"",environmentId:P||"",notes:I||""})}catch(U){if(U instanceof wi&&U.code===fx.ResourceExhausted)return;d(void 0)}},[]),w=y.useCallback(async E=>{try{await Ne.stopTask({id:E})}catch{}},[]),N=y.useCallback(async E=>{try{await Ne.completeTask({id:E})}catch{}},[]),T=y.useCallback(async E=>{try{await Ne.resumeTask({id:E})}catch{}},[]),C=y.useCallback(async(E,A,P,I,U)=>{try{await Ne.updateTask({id:E,title:A,description:P,dependsOn:I,...U!==void 0?{defaultPersonaId:U}:{}})}catch{}},[]),D=y.useCallback(async E=>{try{await Ne.deleteTask({id:E})}catch{}},[]);return{tasks:t,tasksLoading:o,taskStartingId:c,loadTasks:p,loadAllTasks:m,createTask:S,startTask:k,stopTask:w,completeTask:N,resumeTask:T,updateTask:C,deleteTask:D,handleEvent:v,onDisconnect:b,handleLegacyMessage:x,domainHook:{onConnect:()=>m(),onDisconnect:b,handleEvent:v}}}function iz(){const[t,s]=y.useState([]),[o,r]=y.useState(void 0),[c,d]=y.useState(!1),{loading:u,track:p}=Ga(),m=y.useCallback(async k=>{try{const w=await p(Ne.queryFindings({workspaceId:k}));s(w.findings.map(Sp))}catch{}},[p]),g=y.useCallback(async()=>{try{const k=await p(Ne.queryFindings({workspaceId:""}));s(k.findings.map(Sp))}catch{}},[p]),v=y.useCallback(async k=>{r(void 0),d(!0);try{const w=await Ne.getFinding({id:k});r(Sp(w))}catch{r(void 0)}finally{d(!1)}},[]),b=y.useCallback(k=>{if(k.type==="finding.posted"){const w=typeof k.payload.workspaceId=="string"?k.payload.workspaceId:"";return w&&m(w).catch(()=>{}),!0}return!1},[m]),x=y.useCallback(async(k,w,N,T,C)=>{try{await Ne.postFinding({workspaceId:k,title:w,content:N,category:T??"general",tags:C??[]})}catch{}},[]);return{findings:t,selectedFinding:o,findingLoading:c,findingsLoading:u,loadFindings:m,loadAllFindings:g,loadFinding:v,postFinding:x,handleEvent:b,domainHook:{onConnect:()=>g(),onDisconnect:()=>{},handleEvent:b}}}function oz(){const[t,s]=y.useState([]),{loading:o,track:r}=Ga(),c=y.useCallback(async()=>{try{const g=await r(Ne.listTokens({}));s(g.tokens.map(J7))}catch{}},[r]),d=y.useCallback(g=>g.type==="token.changed"?(c().catch(()=>{}),!0):!1,[c]),u=y.useCallback(async(g,v,b,x,S)=>{try{await Ne.setToken({name:g,value:v,type:b,envVar:x,filePath:S})}catch{}},[]),p=y.useCallback(async g=>{try{await Ne.deleteToken({name:g})}catch{}},[]);return{tokens:t,tokensLoading:o,loadTokens:c,setToken:u,deleteToken:p,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function rz(){const[t,s]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),{loading:o,track:r}=Ga(),c=y.useCallback(async()=>{try{const m=await r(Ne.getCredentialProviders({}));s(W7(m))}catch{}},[r]),d=y.useCallback(m=>m.type==="credential.providers_changed"?(m7(m.payload)&&s(m.payload),!0):!1,[]),u=y.useCallback(async m=>{const g=[{provider:"claude",value:m.claude},{provider:"github",value:m.github},{provider:"copilot",value:m.copilot},{provider:"codex",value:m.codex},{provider:"goose",value:m.goose}];await Promise.allSettled(g.map(({provider:v,value:b})=>Ne.setCredentialProvider({provider:v,value:b})))},[]);return{credentialProviders:t,credentialsLoading:o,loadCredentials:c,updateCredentialProviders:u,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function lz(){const[t,s]=y.useState([]),[o,r]=y.useState(""),[c,d]=y.useState(""),[u,p]=y.useState(!1),m=y.useCallback(async()=>{try{const b=await Ne.listCodespaces({});s(b.codespaces.map(X7)),d(b.error)}catch{}},[]),g=y.useCallback(async(b,x)=>{p(!0),r("");try{await Ne.createCodespace({repo:b,machine:x??""}),p(!1),await m()}catch(S){p(!1);const k=S instanceof wi?S.message:"Failed to create codespace";r(k)}},[m]);return{codespaces:t,codespaceError:o,codespaceListError:c,codespaceCreating:u,listCodespaces:m,createCodespace:g,domainHook:{onConnect:()=>m(),onDisconnect:()=>{},handleEvent:()=>!1}}}function cz(){const[t,s]=y.useState([]),{loading:o,track:r}=Ga(),c=y.useCallback(async()=>{try{const v=await r(Ne.listPersonas({}));s(v.personas.map(Tp))}catch{}},[r]),d=y.useCallback(v=>{switch(v.type){case"persona.created":case"persona.updated":case"persona.deleted":return c().catch(()=>{}),!0;default:return!1}},[c]),u=y.useCallback(async(v,b,x,S,k,w,N,T,C)=>{const D=await Ne.createPersona({name:v,description:b,systemPrompt:x,runtime:S||"",model:k||"",maxTurns:w||0,type:N||"agent",script:T||"",allowedMcpTools:C||[]}),B=Tp(D);return s(E=>[...E.filter(A=>A.id!==B.id),B]),B},[]),p=y.useCallback(async(v,b,x,S,k,w,N,T,C,D)=>{const B={id:v};b!==void 0&&(B.name=b),x!==void 0&&(B.description=x),S!==void 0&&(B.systemPrompt=S),k!==void 0&&(B.runtime=k),w!==void 0&&(B.model=w),N!==void 0&&(B.maxTurns=N),T!==void 0&&(B.type=T),C!==void 0&&(B.script=C),D!==void 0&&(B.allowedMcpTools={tools:D});const E=await Ne.updatePersona(B),A=Tp(E);return s(P=>P.map(I=>I.id===A.id?A:I)),A},[]),m=y.useCallback(async v=>{await Ne.deletePersona({id:v}),s(b=>b.filter(x=>x.id!==v))},[]);return{personas:t,personasLoading:o,loadPersonas:c,createPersona:u,updatePersona:p,deletePersona:m,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function dz(t){if(t)try{return JSON.parse(t)}catch{return}}function uz(){const[t,s]=y.useState(new Map),[o,r]=y.useState([]),[c,d]=y.useState(void 0),[u,p]=y.useState(void 0),[m,g]=y.useState(!1),[v,b]=y.useState(""),x=y.useRef(""),S=y.useCallback(async E=>{const A=E??"";x.current=A,b(""),g(!0);try{const P=await Ne.listRecentKnowledgeNodes({limit:30,workspaceId:A}),I=new Map,U=[];for(const Q of P.nodes)I.set(Q.id,Hc(Q));for(const Q of P.edges)U.push(wp(Q));for(const Q of U){const $=I.get(Q.source);$&&($.val+=1);const W=I.get(Q.target);W&&(W.val+=1)}s(I),r(U)}catch{}finally{g(!1)}},[]),k=y.useCallback(async E=>{if(E.trim()){b(E),p(void 0),d(void 0),g(!0);try{const A=await Ne.searchKnowledge({query:E,limit:20,workspaceId:x.current}),P=new Map,I=[];for(const U of A.results){U.node&&P.set(U.node.id,Hc(U.node,U.edges.length));for(const Q of U.edges)I.push(wp(Q))}s(P),r(I)}catch{}finally{g(!1)}}},[]),w=y.useCallback(()=>{S(x.current).catch(()=>{})},[S]),N=y.useCallback(async E=>{p(E);try{const A=await Ne.getKnowledgeNode({id:E});if(!A.node){d(void 0);return}d({node:Hc(A.node,A.edges.length),edges:A.edges.map(P=>({fromId:P.fromId,toId:P.toId,type:P.type,metadata:dz(P.metadataJson)}))})}catch{d(void 0)}},[]),T=y.useCallback(()=>{p(void 0),d(void 0)},[]),C=y.useCallback(async E=>{try{const A=await Ne.expandKnowledgeNode({id:E,depth:1});s(P=>{const I=new Map(P);for(const U of A.nodes)I.has(U.id)||I.set(U.id,Hc(U));return I}),r(P=>{const I=new Set(P.map(Q=>`${Q.source}:${Q.target}:${Q.type}`)),U=[];for(const Q of A.edges){const $=wp(Q),W=`${$.source}:${$.target}:${$.type}`;I.has(W)||U.push($)}return[...P,...U]})}catch{}},[]),D=y.useCallback(E=>!1,[]),B={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:D};return{graphData:{nodes:[...t.values()],links:o},selectedNode:c,selectedId:u,loading:m,searchQuery:v,search:k,clearSearch:w,selectNode:N,clearSelection:T,expandNode:C,loadRecent:S,handleEvent:D,domainHook:B}}function fz(){const t=y.useRef("default");y.useEffect(()=>{typeof Notification>"u"||(t.current=Notification.permission)},[]);function s(r){if(r.type!=="notification.escalated")return!1;if(typeof Notification>"u")return!0;if(t.current==="default")return Notification.requestPermission().then(u=>{t.current=u}).catch(()=>{}),!0;if(t.current!=="granted")return!0;const c=r.payload,d=new Notification(c.title||"Agent needs input",{body:c.message||"An agent is waiting for your input.",tag:c.escalationId,icon:"/icon-192x192.png"});return d.onclick=()=>{window.focus(),c.taskUrl&&(window.location.href=c.taskUrl),d.close()},!0}return{handleEvent:s,domainHook:{onConnect:async()=>{},onDisconnect:()=>{},handleEvent:s}}}function pz(){const[t,s]=y.useState(""),[o,r]=y.useState(void 0),[c,d]=y.useState({}),{pluginNames:u}=ih(),p=F7(u),m=ez(),g=nz(),v=sz(),b=az(),x=iz(),S=oz(),k=rz(),w=lz(),N=cz(),T=uz(),C=fz(),D=[...p.has("environments")?[m.domainHook]:[],...p.has("sessions")?[g.domainHook]:[],...p.has("workspaces")?[v.domainHook]:[],...p.has("tasks")?[b.domainHook]:[],...p.has("findings")?[x.domainHook]:[],...p.has("tokens")?[S.domainHook]:[],...p.has("credentials")?[k.domainHook]:[],...p.has("codespaces")?[w.domainHook]:[],...p.has("personas")?[N.domainHook]:[],...p.has("knowledge")?[T.domainHook]:[],...p.has("notifications")?[C.domainHook]:[]],{connected:B}=U7({onSessionEvent:H=>{g.handleSessionEvent({sessionId:H.sessionId,eventType:px(H.type),timestamp:H.timestamp,content:H.content,raw:H.raw||void 0})},onDomainEvent:H=>{try{const ie=JSON.parse(H.payloadJson);Q({id:H.id,type:H.type,timestamp:H.timestamp,payload:ie})}catch{console.warn("[grackle] Failed to parse domain event payloadJson:",H.payloadJson)}},onConnect:$,onDisconnect:W}),E="default_persona_id",A="onboarding_completed",P=y.useCallback(async H=>{const ie=await Ne.setSetting({key:E,value:H});s(ie.value)},[]),I=y.useCallback(async()=>{r(!0);try{await Ne.setSetting({key:A,value:"true"})}catch{}},[]),U=y.useCallback(async(H,ie)=>{try{const L=await Ne.getUsage({scope:H,id:ie}),Z=`${H}:${ie}`;d(J=>({...J,[Z]:Q7(L)}))}catch{}},[]);function Q(H){const ie=H.payload.key,L=H.payload.value;if(H.type==="setting.changed"){ie===E&&s(L??""),ie===A&&r(L==="true");return}for(const Z of D)if(Z.handleEvent(H))break;(H.type==="environment.removed"||H.type==="environment.changed"||H.type==="task.started")&&g.loadSessions().catch(()=>{})}async function $(){for(const H of D)H.onConnect().catch(()=>{});try{const H=await Ne.getSetting({key:E});s(H.value)}catch{}try{const H=await Ne.getSetting({key:A});r(H.value==="true")}catch{}}function W(){D.forEach(H=>H.onDisconnect())}const pe=y.useCallback(()=>{m.loadEnvironments().catch(()=>{}),g.loadSessions().catch(()=>{}),v.loadWorkspaces().catch(()=>{}),S.loadTokens().catch(()=>{})},[m.loadEnvironments,g.loadSessions,v.loadWorkspaces,S.loadTokens]);return{connected:B,environments:{environments:m.environments,environmentsLoading:m.environmentsLoading,provisionStatus:m.provisionStatus,operationError:m.operationError,clearOperationError:m.clearOperationError,loadEnvironments:m.loadEnvironments,addEnvironment:m.addEnvironment,updateEnvironment:m.updateEnvironment,provisionEnvironment:m.provisionEnvironment,stopEnvironment:m.stopEnvironment,removeEnvironment:m.removeEnvironment,domainHook:m.domainHook},sessions:{sessions:g.sessions,sessionsLoading:g.sessionsLoading,events:g.events,eventsDropped:g.eventsDropped,lastSpawnedId:g.lastSpawnedId,taskSessions:g.taskSessions,spawn:g.spawn,sendInput:g.sendInput,kill:g.kill,stopGraceful:g.stopGraceful,loadSessionEvents:g.loadSessionEvents,clearEvents:g.clearEvents,loadTaskSessions:g.loadTaskSessions,domainHook:g.domainHook},workspaces:{workspaces:v.workspaces,workspacesLoading:v.workspacesLoading,workspaceCreating:v.workspaceCreating,loadWorkspaces:v.loadWorkspaces,createWorkspace:v.createWorkspace,archiveWorkspace:v.archiveWorkspace,updateWorkspace:v.updateWorkspace,linkEnvironment:v.linkEnvironment,unlinkEnvironment:v.unlinkEnvironment,linkOperationError:v.linkOperationError,clearLinkOperationError:v.clearLinkOperationError,domainHook:v.domainHook},tasks:{tasks:b.tasks,tasksLoading:b.tasksLoading,taskStartingId:b.taskStartingId,loadTasks:b.loadTasks,loadAllTasks:b.loadAllTasks,createTask:b.createTask,startTask:b.startTask,stopTask:b.stopTask,completeTask:b.completeTask,resumeTask:b.resumeTask,updateTask:b.updateTask,deleteTask:b.deleteTask,domainHook:b.domainHook},findings:{findings:x.findings,selectedFinding:x.selectedFinding,findingLoading:x.findingLoading,findingsLoading:x.findingsLoading,loadFindings:x.loadFindings,loadAllFindings:x.loadAllFindings,loadFinding:x.loadFinding,postFinding:x.postFinding,domainHook:x.domainHook},tokens:{tokens:S.tokens,tokensLoading:S.tokensLoading,loadTokens:S.loadTokens,setToken:S.setToken,deleteToken:S.deleteToken,domainHook:S.domainHook},credentials:{credentialProviders:k.credentialProviders,credentialsLoading:k.credentialsLoading,updateCredentialProviders:k.updateCredentialProviders,domainHook:k.domainHook},codespaces:{codespaces:w.codespaces,codespaceError:w.codespaceError,codespaceListError:w.codespaceListError,codespaceCreating:w.codespaceCreating,listCodespaces:w.listCodespaces,createCodespace:w.createCodespace,domainHook:w.domainHook},personas:{personas:N.personas,personasLoading:N.personasLoading,createPersona:N.createPersona,updatePersona:N.updatePersona,deletePersona:N.deletePersona,domainHook:N.domainHook},knowledge:T,appDefaultPersonaId:t,setAppDefaultPersonaId:P,onboardingCompleted:o,completeOnboarding:I,usageCache:c,loadUsage:U,refresh:pe}}function mz({children:t}){const s=pz();return i.jsx(th.Provider,{value:s,children:t})}function hz(t,s){const o=y.useRef(null);y.useEffect(()=>{const r=o.current;if(o.current=t,r===null)return;const c=new Map;for(const u of r)c.set(u.id,u);const d=new Set;for(const u of t){d.add(u.id);const p=c.get(u.id);if(p&&p.status!==u.status&&u.status!=="sleeping"){if(u.status==="connecting"){s("Provisioning environment…","info");continue}u.status==="connected"?s("Environment connected","success"):u.status==="error"?s("Environment provision failed","error"):u.status==="disconnected"&&(p.status==="connected"?s("Environment disconnected","warning"):s("Environment stopped","info"))}}for(const u of r)d.has(u.id)||s("Environment removed","info")},[t,s])}function gz(t,s,o){const r=y.useRef(t);y.useEffect(()=>{t&&t!==r.current&&(o(t,"error"),s()),r.current=t},[t,s,o])}const vz={working:{message:"Task is now running",variant:"info"},paused:{message:"Task paused",variant:"warning"},complete:{message:"Task complete",variant:"success"},failed:{message:"Task failed to complete",variant:"error"}};function yz(t){return vz[t]}function bz(t,s){if(t===void 0)return[];const o=[],r=new Map;for(const d of t)r.set(d.id,d);const c=new Set;for(const d of s){c.add(d.id);const u=r.get(d.id);if(!u||u.status===d.status)continue;const p=yz(d.status);p&&o.push(p)}for(const d of t)c.has(d.id)||o.push({message:"Task deleted",variant:"info"});return o}function xz(t,s){const o=y.useRef(void 0);y.useEffect(()=>{const r=o.current;o.current=t;const c=bz(r,t);for(const d of c)s(d.message,d.variant)},[t,s])}const _z="_dashboard_16pzm_1",kz="_kpiStrip_16pzm_11",Sz="_kpiCard_16pzm_23",Tz="_kpiValue_16pzm_68",wz="_kpiLabel_16pzm_76",jz="_bodyGrid_16pzm_84",Nz="_section_16pzm_96",Cz="_sectionHeader_16pzm_109",Ez="_sectionIcon_16pzm_118",Az="_sectionTitle_16pzm_123",Dz="_sectionCount_16pzm_131",Rz="_sectionBody_16pzm_138",Mz="_emptyHint_16pzm_143",Iz="_sessionRow_16pzm_150",Oz="_sessionPrompt_16pzm_177",Bz="_sessionEnv_16pzm_186",Lz="_sessionRuntime_16pzm_192",zz="_sessionStatus_16pzm_198",$z="_statusDot_16pzm_207",Uz="_attentionRow_16pzm_233",Pz="_attentionTitle_16pzm_259",Hz="_attentionMeta_16pzm_267",Vz="_reasonBadge_16pzm_274",qz="_bottomGrid_16pzm_301",Gz="_envRow_16pzm_312",Fz="_envName_16pzm_323",Zz="_envStatusBadge_16pzm_333",Kz="_workspaceRow_16pzm_369",Yz="_workspaceTop_16pzm_395",Jz="_workspaceName_16pzm_401",Wz="_workspaceCounts_16pzm_407",Xz="_progressBar_16pzm_415",Qz="_progressFill_16pzm_422",ue={dashboard:_z,kpiStrip:kz,kpiCard:Sz,kpiValue:Tz,kpiLabel:wz,bodyGrid:jz,section:Nz,sectionHeader:Cz,sectionIcon:Ez,sectionTitle:Az,sectionCount:Dz,sectionBody:Rz,emptyHint:Mz,sessionRow:Iz,sessionPrompt:Oz,sessionEnv:Bz,sessionRuntime:Lz,sessionStatus:zz,statusDot:$z,attentionRow:Uz,attentionTitle:Pz,attentionMeta:Hz,reasonBadge:Vz,bottomGrid:qz,envRow:Gz,envName:Fz,envStatusBadge:Zz,workspaceRow:Kz,workspaceTop:Yz,workspaceName:Jz,workspaceCounts:Wz,progressBar:Xz,progressFill:Qz};function e$(){return i.jsxs("div",{className:ue.dashboard,"aria-hidden":"true",children:[i.jsx("div",{className:ue.kpiStrip,children:Array.from({length:4},(t,s)=>i.jsxs("div",{className:ue.kpiCard,children:[i.jsx(we,{width:"3rem",height:"2rem"}),i.jsx(we,{width:"80%",height:"0.75rem"})]},s))}),i.jsxs("div",{className:ue.bodyGrid,children:[i.jsxs("div",{className:ue.section,children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(we,{width:"8rem",height:"0.75rem"}),i.jsx("span",{className:ue.sectionCount,children:i.jsx(we,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ue.sectionBody,children:Array.from({length:3},(t,s)=>i.jsxs("div",{className:ue.sessionRow,style:{cursor:"default"},children:[i.jsx(we,{width:"60%",height:"0.875rem"}),i.jsx(we,{width:"4rem",height:"0.75rem"}),i.jsx(we,{width:"3rem",height:"0.75rem"}),i.jsx(we,{width:"3rem",height:"0.75rem"})]},s))})]}),i.jsxs("div",{className:ue.section,children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(we,{width:"8rem",height:"0.75rem"}),i.jsx("span",{className:ue.sectionCount,children:i.jsx(we,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ue.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:ue.attentionRow,style:{cursor:"default"},children:[i.jsxs("div",{className:ue.attentionTitle,children:[i.jsx(we,{width:"3rem",height:"0.875rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"70%",height:"0.875rem"})]}),i.jsx("div",{className:ue.attentionMeta,children:i.jsx(we,{width:"5rem",height:"0.625rem"})})]},s))})]})]}),i.jsxs("div",{className:ue.bottomGrid,children:[i.jsxs("div",{className:ue.section,children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(we,{width:"9rem",height:"0.75rem"}),i.jsx("span",{className:ue.sectionCount,children:i.jsx(we,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ue.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:ue.envRow,children:[i.jsx(we,{width:"60%",height:"0.875rem"}),i.jsx(we,{width:"4rem",height:"0.875rem",borderRadius:"var(--radius-sm)"})]},s))})]}),i.jsxs("div",{className:ue.section,children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx(we,{width:"1rem",height:"1rem",variant:"circular"}),i.jsx(we,{width:"6rem",height:"0.75rem"}),i.jsx("span",{className:ue.sectionCount,children:i.jsx(we,{width:"1rem",height:"0.75rem"})})]}),i.jsx("div",{className:ue.sectionBody,children:Array.from({length:2},(t,s)=>i.jsxs("div",{className:ue.workspaceRow,style:{cursor:"default"},children:[i.jsxs("div",{className:ue.workspaceTop,children:[i.jsx(we,{width:"50%",height:"0.875rem"}),i.jsx(we,{width:"2rem",height:"0.75rem"})]}),i.jsx("div",{className:ue.progressBar,children:i.jsx("div",{className:ue.progressFill,style:{width:"0%"}})})]},s))})]})]})]})}const t$={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},Vc={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function n$(t,s,o,r){const c=[`${t} of ${s} tasks completed`];return o>0&&c.push(`${o} in progress`),r>0&&c.push(`${r} failed`),c.join(", ")}function qc({value:t,label:s,accent:o,index:r,testId:c}){return i.jsxs(Rt.div,{className:ue.kpiCard,"data-accent":o,"data-testid":c,variants:t$,initial:"hidden",animate:"visible",custom:r,children:[i.jsx("span",{className:ue.kpiValue,children:t}),i.jsx("span",{className:ue.kpiLabel,children:s})]})}function s$(){const{workspaces:{workspaces:t,workspacesLoading:s},tasks:{tasks:o,tasksLoading:r,loadTasks:c},sessions:{sessions:d,sessionsLoading:u},environments:{environments:p,environmentsLoading:m}}=mt(),g=kt(),v=y.useRef(new Set);y.useEffect(()=>{for(const N of t)v.current.has(N.id)||(v.current.add(N.id),c(N.id).catch(()=>{}))},[t,c]);const b=y.useMemo(()=>w7(d,o,p),[d,o,p]),x=y.useMemo(()=>N7(d,p),[d,p]),S=y.useMemo(()=>j7(o,t),[o,t]),k=y.useMemo(()=>C7(t,o),[t,o,p]);return d.length===0&&o.length===0&&p.length===0&&t.length===0&&(u||r||m||s)?i.jsx(e$,{}):i.jsxs("div",{className:ue.dashboard,"data-testid":"dashboard",children:[i.jsxs("div",{className:ue.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[i.jsx(qc,{value:b.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),i.jsx(qc,{value:b.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),i.jsx(qc,{value:b.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),i.jsx(qc,{value:b.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),i.jsxs("div",{className:ue.bodyGrid,children:[i.jsxs(Rt.div,{className:ue.section,variants:Vc,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx("span",{className:ue.sectionIcon,"aria-hidden":"true",children:"●"}),i.jsx("span",{className:ue.sectionTitle,children:"Active Sessions"}),i.jsx("span",{className:ue.sectionCount,children:x.length})]}),i.jsx("div",{className:ue.sectionBody,children:x.length===0?i.jsx("div",{className:ue.emptyHint,children:"No active sessions"}):x.map(({session:N,environmentName:T})=>i.jsxs("button",{type:"button",className:ue.sessionRow,onClick:()=>g(gm(N.id)),"data-testid":"session-row",children:[i.jsx("span",{className:ue.sessionPrompt,title:N.prompt,children:N.prompt||"—"}),i.jsx("span",{className:ue.sessionEnv,children:T}),i.jsx("span",{className:ue.sessionRuntime,children:N.runtime}),i.jsxs("span",{className:ue.sessionStatus,children:[i.jsx("span",{className:ue.statusDot,"data-status":N.status}),N.status]})]},N.id))})]}),i.jsxs(Rt.div,{className:ue.section,variants:Vc,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx("span",{className:ue.sectionIcon,"aria-hidden":"true",children:"⚑"}),i.jsx("span",{className:ue.sectionTitle,children:"Needs Attention"}),i.jsx("span",{className:ue.sectionCount,children:S.length})]}),i.jsx("div",{className:ue.sectionBody,children:S.length===0?i.jsx("div",{className:ue.emptyHint,children:"All clear"}):S.map(({task:N,reason:T,workspaceName:C})=>i.jsxs("button",{type:"button",className:ue.attentionRow,onClick:()=>g(On(N.id)),"data-testid":"attention-row",children:[i.jsxs("div",{className:ue.attentionTitle,children:[i.jsx("span",{className:ue.reasonBadge,"data-reason":T,children:T}),N.title]}),i.jsx("div",{className:ue.attentionMeta,children:i.jsx("span",{children:C})})]},N.id))})]})]}),i.jsxs("div",{className:ue.bottomGrid,children:[i.jsxs(Rt.div,{className:ue.section,variants:Vc,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx("span",{className:ue.sectionIcon,"aria-hidden":"true",children:"◈"}),i.jsx("span",{className:ue.sectionTitle,children:"Environment Health"}),i.jsx("span",{className:ue.sectionCount,children:p.length})]}),i.jsx("div",{className:ue.sectionBody,children:p.length===0?i.jsx("div",{className:ue.emptyHint,children:"No environments configured"}):p.map(N=>i.jsxs("div",{className:ue.envRow,"data-testid":"dashboard-env-row",children:[i.jsx("span",{className:ue.envName,children:N.displayName}),i.jsx("span",{className:ue.envStatusBadge,"data-status":N.status,children:N.status})]},N.id))})]}),i.jsxs(Rt.div,{className:ue.section,variants:Vc,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[i.jsxs("div",{className:ue.sectionHeader,children:[i.jsx("span",{className:ue.sectionIcon,"aria-hidden":"true",children:"▦"}),i.jsx("span",{className:ue.sectionTitle,children:"Workspaces"}),i.jsx("span",{className:ue.sectionCount,children:t.length})]}),i.jsx("div",{className:ue.sectionBody,children:k.length===0?i.jsx("div",{className:ue.emptyHint,children:"No workspaces yet"}):k.map(({workspace:N,totalTasks:T,completedTasks:C,workingTasks:D,failedTasks:B})=>{const E=T>0?Math.round(C/T*100):0;return i.jsxs("button",{type:"button",className:ue.workspaceRow,onClick:()=>g($a(N.id,N.environmentId)),"data-testid":"workspace-row",children:[i.jsxs("div",{className:ue.workspaceTop,children:[i.jsx("span",{className:ue.workspaceName,children:N.name}),i.jsxs("span",{className:ue.workspaceCounts,"aria-label":n$(C,T,D,B),children:[C,"/",T,D>0&&i.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",D]}),B>0&&i.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",B]})]})]}),T>0&&i.jsx("div",{className:ue.progressBar,children:i.jsx("div",{className:ue.progressFill,style:{width:`${E}%`}})})]},N.id)})})]})]})]})}const a$="_panelContainer_1udy7_1",i$="_emptyState_1udy7_8",o$="_workspaceSummary_1udy7_17",r$="_workspaceSummaryTitle_1udy7_28",l$="_workspaceSummarySubtitle_1udy7_32",c$="_header_1udy7_36",d$="_headerInfo_1udy7_71",u$="_headerTitle_1udy7_106",f$="_taskStatusBadge_1udy7_128",p$="_taskBranch_1udy7_137",m$="_taskBlockedBadge_1udy7_143",h$="_tabBar_1udy7_277",g$="_tab_1udy7_277",v$="_active_1udy7_303",y$="_eventScroll_1udy7_308",b$="_tabContent_1udy7_314",x$="_noContext_1udy7_319",_$="_overviewContent_1udy7_325",k$="_overviewDashboard_1udy7_334",S$="_overviewHero_1udy7_340",T$="_overviewSection_1udy7_347",w$="_overviewLabel_1udy7_353",j$="_envRow_1udy7_360",N$="_timeline_1udy7_366",C$="_timelineRow_1udy7_372",E$="_waitingMessage_1udy7_379",A$="_errorMessage_1udy7_383",D$="_emptyCta_1udy7_387",R$="_ctaTitle_1udy7_399",M$="_ctaDescription_1udy7_405",I$="_ctaButton_1udy7_412",O$="_workspaceHeader_1udy7_533",B$="_workspaceName_1udy7_558",L$="_workspaceMeta_1udy7_571",z$="_metaRow_1udy7_579",$$="_metaLabel_1udy7_592",U$="_metaValue_1udy7_607",P$="_archiveButton_1udy7_617",H$="_repoLink_1udy7_647",V$="_metaToggle_1udy7_657",q$="_metaToggleArrow_1udy7_678",G$="_metaToggleArrowOpen_1udy7_683",F$="_progressBarContainer_1udy7_687",Z$="_progressBar_1udy7_687",K$="_progressFill_1udy7_703",Y$="_progressLabel_1udy7_710",J$="_metaTimestamps_1udy7_717",W$="_metaTimestamp_1udy7_717",X$="_metaPlaceholder_1udy7_739",Q$="_linkedEnvList_1udy7_744",eU="_linkedEnvChip_1udy7_750",tU="_chipDismiss_1udy7_762",nU="_linkError_1udy7_777",sU="_linkEnvSelect_1udy7_782",Y={panelContainer:a$,emptyState:i$,workspaceSummary:o$,workspaceSummaryTitle:r$,workspaceSummarySubtitle:l$,header:c$,headerInfo:d$,headerTitle:u$,taskStatusBadge:f$,taskBranch:p$,taskBlockedBadge:m$,tabBar:h$,tab:g$,active:v$,eventScroll:y$,tabContent:b$,noContext:x$,overviewContent:_$,overviewDashboard:k$,overviewHero:S$,overviewSection:T$,overviewLabel:w$,envRow:j$,timeline:N$,timelineRow:C$,waitingMessage:E$,errorMessage:A$,emptyCta:D$,ctaTitle:R$,ctaDescription:M$,ctaButton:I$,workspaceHeader:O$,workspaceName:B$,workspaceMeta:L$,metaRow:z$,metaLabel:$$,metaValue:U$,archiveButton:P$,repoLink:H$,metaToggle:V$,metaToggleArrow:q$,metaToggleArrowOpen:G$,progressBarContainer:F$,progressBar:Z$,progressFill:K$,progressLabel:Y$,metaTimestamps:J$,metaTimestamp:W$,metaPlaceholder:X$,linkedEnvList:Q$,linkedEnvChip:eU,chipDismiss:tU,linkError:nU,linkEnvSelect:sU};function aU(){return i.jsx("div",{className:Y.emptyState,children:"Select a task or click + to create one"})}function iU(){return i.jsx("div",{className:Y.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function oU(){const{workspaces:{workspaces:t},environments:{environments:s}}=mt(),o=kt(),r=s.length>0;return t.length>0?i.jsx(s$,{}):i.jsxs("div",{className:Y.emptyCta,"data-testid":"welcome-cta",children:[i.jsx("div",{className:Y.ctaTitle,children:"Welcome to Grackle"}),i.jsx("div",{className:Y.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),i.jsx("button",{className:Y.ctaButton,onClick:()=>o(zx),disabled:!r,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!r&&i.jsx("div",{className:Y.ctaDescription,children:"Add an environment first before creating a workspace."})]})}const rU="_panelContainer_19poq_1",lU="_chatHeader_19poq_8",cU="_chatHeaderInfo_19poq_37",dU="_emptyState_19poq_43",uU="_emptyTitle_19poq_55",fU="_emptyDescription_19poq_61",pU="_emptyHint_19poq_67",Ba={panelContainer:rU,chatHeader:lU,chatHeaderInfo:cU,emptyState:dU,emptyTitle:uU,emptyDescription:fU,emptyHint:pU};function mU(){return i.jsx("div",{className:Ba.panelContainer,"aria-hidden":"true",children:i.jsxs("div",{style:{flex:1,overflow:"hidden",padding:"var(--space-md)",display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[i.jsx(we,{width:"65%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"85%",height:"4rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"45%",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"75%",height:"3rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"55%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})}function hU({hasLocalEnvironment:t}){return i.jsxs("div",{className:Ba.emptyState,"data-testid":"chat-empty-state",children:[i.jsx("div",{className:Ba.emptyTitle,children:"Welcome to Grackle"}),i.jsx("div",{className:Ba.emptyDescription,children:t?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!t&&i.jsx("div",{className:Ba.emptyHint,children:"Go to Settings → Environments to add one."})]})}function gU(){const{tasks:{tasks:t,tasksLoading:s,startTask:o},sessions:{sessions:r,sessionsLoading:c,events:d,eventsDropped:u,taskSessions:p,loadTaskSessions:m,loadSessionEvents:g,kill:v,stopGraceful:b,sendInput:x,spawn:S},environments:{environments:k,provisionEnvironment:w},personas:{personas:N}}=mt(),{showToast:T}=Sn(),C=y.useRef(void 0),[D,B]=y.useState(),E=t.find(W=>W.id===Rr),A=E!=null&&E.latestSessionId?r.find(W=>W.id===E.latestSessionId)??(p[Rr]??[]).find(W=>W.id===E.latestSessionId):void 0;y.useEffect(()=>{m(Rr).catch(()=>{})},[m]),y.useEffect(()=>{E!=null&&E.latestSessionId&&m(Rr).catch(()=>{})},[E==null?void 0:E.latestSessionId,m]),y.useEffect(()=>{A&&A.id!==C.current&&(C.current=A.id,g(A.id).catch(()=>{}))},[A==null?void 0:A.id,g]);const P=y.useMemo(()=>{if(!A)return[];const W=d.filter(pe=>pe.sessionId===A.id);return ah(sh(W))},[d,A==null?void 0:A.id]),I=k.find(W=>W.adapterType==="local"&&W.status==="connected"),U=A!==void 0&&A.status!=="stopped"&&A.status!=="suspended",Q=(A==null?void 0:A.status)==="idle";y.useEffect(()=>{D&&A&&Q&&(x(A.id,D).catch(()=>{}),B(void 0))},[D,Q,A==null?void 0:A.id,x]);const $=y.useCallback((W,pe,H,ie)=>{ie&&B(ie),o(W,pe,H).catch(()=>{})},[o]);return!E&&(c||s)?i.jsx(mU,{}):i.jsxs("div",{className:Ba.panelContainer,"data-testid":"chat-page",children:[U&&i.jsxs("div",{className:Ba.chatHeader,children:[i.jsxs("span",{className:Ba.chatHeaderInfo,children:["Session: ",A.id.slice(0,8)," | ",A.runtime," | ",A.status]}),i.jsx(Ux,{label:"Stop",onClick:()=>{b(A.id).catch(()=>{})},variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:()=>{b(A.id).catch(()=>{})}},{label:"Kill",description:"Force kill",onClick:()=>{v(A.id).catch(()=>{})}}]})]}),i.jsx(Xm,{events:P,eventsDropped:u,emptyState:i.jsx(hU,{hasLocalEnvironment:!!I}),onShowToast:T}),I&&U&&i.jsx(Qr,{mode:"send",sessionId:A.id,environmentId:A.environmentId,personas:N,environments:k,onSendInput:(W,pe)=>{x(W,pe).catch(()=>{})},onSpawn:(W,pe,H)=>{S(W,pe,H).catch(()=>{})},onStartTask:(W,pe,H)=>{o(W,pe,H).catch(()=>{})},onProvisionEnvironment:W=>{w(W).catch(()=>{})},onShowToast:T}),I&&!U&&i.jsx(Qr,{mode:"start",taskId:Rr,environmentId:I.id,personas:N,environments:k,onSendInput:(W,pe)=>{x(W,pe).catch(()=>{})},onSpawn:(W,pe,H)=>{S(W,pe,H).catch(()=>{})},onStartTask:$,onProvisionEnvironment:W=>{w(W).catch(()=>{})},onShowToast:T})]})}function vU(){const t=y7(),[s]=hm(),o=s.get("env")??"",{sessions:{sendInput:r,spawn:c},tasks:{startTask:d},personas:{personas:u},environments:{environments:p,provisionEnvironment:m}}=mt(),{showToast:g}=Sn();return i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:t}),i.jsx("div",{className:Y.emptyState,children:"Enter a prompt below to start a new session"}),i.jsx(Qr,{mode:"spawn",environmentId:o,showPersonaSelect:!0,personas:u,environments:p,onSendInput:(v,b)=>{r(v,b).catch(()=>{})},onSpawn:(v,b,x)=>{c(v,b,x).catch(()=>{})},onStartTask:(v,b,x)=>{d(v,b,x).catch(()=>{})},onProvisionEnvironment:v=>{m(v).catch(()=>{})},onShowToast:g})]})}function yU(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsxs("div",{className:Y.header,children:[i.jsx("span",{children:i.jsx(we,{width:"10rem",height:"0.875rem"})}),i.jsx("span",{className:Y.headerInfo,children:i.jsx(we,{width:"16rem",height:"0.875rem"})})]}),i.jsx("div",{className:Y.eventScroll,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-md)"},children:[i.jsx(we,{width:"70%",height:"2.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"90%",height:"4rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"50%",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"80%",height:"3.5rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"60%",height:"2.5rem",borderRadius:"var(--radius-sm)"})]})})]})}function bU({sessionId:t,session:s,isActive:o,onStop:r,onKill:c}){return i.jsxs("div",{className:Y.header,children:[i.jsxs("span",{children:["Session: ",t.slice(0,8),s&&` | ${s.runtime} | ${s.endReason||s.status}`,s!=null&&s.inputTokens||s!=null&&s.outputTokens||s!=null&&s.costMillicents?` | ${Mo((s.inputTokens??0)+(s.outputTokens??0))} tokens · ${Ss(s.costMillicents??0)}`:""]}),i.jsxs("span",{className:Y.headerInfo,children:[s&&i.jsx("span",{children:s.prompt.length>60?s.prompt.slice(0,60)+"...":s.prompt}),o&&i.jsx(Ux,{label:"Stop",onClick:r,variant:"danger",size:"sm","data-testid":"stop-split-button",options:[{label:"Stop",description:"Graceful shutdown",onClick:r},{label:"Kill",description:"Force kill",onClick:c}]})]})]})}function xU({session:t}){const s=t&&(t.status==="stopped"||t.status==="suspended"),o=s?`Session ${t.endReason||t.status} with no events recorded.`:"Waiting for events...";return i.jsx("div",{className:s?Y.errorMessage:Y.waitingMessage,children:o})}function _U(){const{sessionId:t}=fs(),{sessions:{events:s,eventsDropped:o,sessions:r,sessionsLoading:c,kill:d,stopGraceful:u,loadSessionEvents:p,sendInput:m,spawn:g},tasks:{startTask:v},personas:{personas:b},environments:{environments:x,provisionEnvironment:S}}=mt(),{showToast:k}=Sn(),w=y.useRef(void 0),N=b7(t),T=r.find(B=>B.id===t)??void 0,C=y.useMemo(()=>{const B=t?s.filter(E=>E.sessionId===t):[];return ah(sh(B))},[s,t]);if(y.useEffect(()=>{t&&t!==w.current&&(w.current=t,p(t).catch(()=>{}))},[t,p]),!T&&c)return i.jsx(yU,{});if(!t)return i.jsx("div",{className:Y.emptyState,children:"No session selected"});const D=(T==null?void 0:T.status)==="running"||(T==null?void 0:T.status)==="idle";return i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:N}),i.jsx(bU,{sessionId:t,session:T,isActive:D,onStop:()=>{u(t).catch(()=>{})},onKill:()=>{d(t).catch(()=>{})}}),i.jsx(Xm,{events:C,eventsDropped:o,emptyState:i.jsx(xU,{session:T}),onShowToast:k}),D&&i.jsx(Qr,{mode:"send",sessionId:t,environmentId:T.environmentId,personas:b,environments:x,onSendInput:(B,E)=>{m(B,E).catch(()=>{})},onSpawn:(B,E,A)=>{g(B,E,A).catch(()=>{})},onStartTask:(B,E,A)=>{v(B,E,A).catch(()=>{})},onProvisionEnvironment:B=>{S(B).catch(()=>{})},onShowToast:k})]})}function kU(t){if(!t)return!1;const s=t.tagName;return!!(s==="INPUT"||s==="TEXTAREA"||s==="SELECT"||t.isContentEditable)}function Qs(t,s){const o=y.useRef(s);o.current=s;const{key:r,ctrl:c=!1,shift:d=!1,suppressInInputs:u=!0,enabled:p=!0}=t;y.useEffect(()=>{if(!p)return;const m=g=>{if(u&&kU(document.activeElement??void 0))return;const v=g.ctrlKey||g.metaKey;c===v&&(d&&!g.shiftKey||g.key===r&&o.current())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[r,c,d,u,p])}function SU(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsx("div",{className:Y.workspaceHeader,children:i.jsx("span",{className:Y.workspaceName,children:i.jsx(we,{width:"12rem",height:"1.25rem"})})}),i.jsx("div",{className:Y.metaToggle,style:{cursor:"default"},children:i.jsx(we,{width:"4rem",height:"0.625rem"})}),i.jsxs("div",{className:Y.progressBarContainer,children:[i.jsx("div",{className:Y.progressBar,children:i.jsx("div",{className:Y.progressFill,style:{width:"0%"}})}),i.jsx(we,{width:"2rem",height:"0.625rem"})]}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Workspace view",children:[i.jsx("span",{className:`${Y.tab} ${Y.active}`,children:"Graph"}),i.jsx("span",{className:Y.tab,children:"Board"}),i.jsx("span",{className:Y.tab,children:"Tasks"})]}),i.jsx("div",{className:Y.overviewContent,children:Array.from({length:3},(t,s)=>i.jsx(dd,{lines:2},s))})]})}function tx(t){if(!t)return"";const s=new Date(t);if(isNaN(s.getTime()))return"";const r=Date.now()-s.getTime();if(r<0)return"just now";const c=Math.floor(r/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);if(d<24)return`${d}h ago`;const u=Math.floor(d/24);return u<30?`${u}d ago`:s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const Np=100;function TU(t){try{const s=new URL(t);return s.protocol!=="http:"&&s.protocol!=="https:"?void 0:s.toString()}catch{return}}function wU(){const{workspaceId:t,environmentId:s}=fs(),o=kt(),{tasks:{tasks:r},environments:{environments:c},workspaces:{workspaces:d,workspacesLoading:u,archiveWorkspace:p,updateWorkspace:m,linkEnvironment:g,unlinkEnvironment:v,linkOperationError:b,clearLinkOperationError:x},personas:{personas:S},sessions:{sessions:k},usageCache:w,loadUsage:N}=mt(),{resolvedThemeId:T}=B1(),[C,D]=y.useState("tasks"),[B,E]=y.useState(!1),[A,P]=y.useState(null),[I,U]=y.useState(!1),Q=y.useRef(void 0),$=d.find(X=>X.id===t),W=s??($==null?void 0:$.environmentId)??"",pe=x7(t,W,d,c);Qs({key:"1"},()=>D("graph")),Qs({key:"2"},()=>D("board")),Qs({key:"3"},()=>D("tasks")),y.useEffect(()=>{const X=Q.current;Q.current=t,!(X===void 0||X===t)&&A!==null&&P(null)},[t,A]);const H=k.reduce((X,ge)=>X+(ge.costMillicents??0),0);y.useEffect(()=>{t&&N("workspace",t).catch(()=>{})},[t,N,H]);const ie=t?w[`workspace:${t}`]:void 0,L=r.filter(X=>X.workspaceId===t),Z=L.filter(X=>X.status==="complete").length,J=L.length,ce=J>0?Math.round(Z/J*100):0;return!$&&u?i.jsx(SU,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:pe}),i.jsxs("div",{className:Y.workspaceHeader,children:[i.jsx("span",{className:Y.workspaceName,"data-testid":"workspace-name",children:i.jsx(ln,{value:($==null?void 0:$.name)||"",onSave:X=>{$&&m($.id,{name:X}).catch(()=>{})},validate:X=>{const ge=X.trim();if(!ge)return"Name is required";if(ge.length>Np)return`Max ${Np} characters`},maxLength:Np,fieldId:"name",activeFieldId:A,onActivate:P,ariaLabel:"Workspace name",renderDisplay:X=>X||t||void 0,"data-testid":"edit-name"})}),i.jsx("button",{className:Y.archiveButton,onClick:()=>E(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),i.jsxs("button",{className:Y.metaToggle,onClick:()=>U(!I),"aria-expanded":!I,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[i.jsx("span",{className:`${Y.metaToggleArrow} ${I?"":Y.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!I&&i.jsxs("div",{className:Y.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Description"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(Xp,{value:($==null?void 0:$.description)||"",onSave:X=>{$&&m($.id,{description:X}).catch(()=>{})},fieldId:"description",activeFieldId:A,onActivate:P,renderDisplay:X=>X?i.jsx("span",{className:Y.overviewMarkdown,children:i.jsx(hd,{remarkPlugins:[gd],children:X})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Repository"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(ln,{value:($==null?void 0:$.repoUrl)||"",onSave:X=>{$&&m($.id,{repoUrl:X}).catch(()=>{})},validate:X=>{const ge=X.trim();if(ge&&!/^https?:\/\/.+/.test(ge))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:A,onActivate:P,renderDisplay:X=>{const ge=TU(X);return ge?i.jsx("a",{className:Y.repoLink,href:ge,target:"_blank",rel:"noopener noreferrer",onClick:fe=>fe.stopPropagation(),children:X}):X?i.jsx("span",{children:X}):void 0},placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Environment"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(B6,{value:($==null?void 0:$.environmentId)||"",onSave:X=>{$&&X&&m($.id,{environmentId:X}).catch(()=>{})},environments:c,fieldId:"environmentId",activeFieldId:A,onActivate:P,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Linked Envs"}),i.jsx("div",{className:Y.metaValue,"data-testid":"linked-environments",children:$?i.jsxs("span",{className:Y.linkedEnvList,children:[(()=>{const X=[...new Set($.linkedEnvironmentIds.filter(ge=>ge!==$.environmentId))];return X.length===0?i.jsx("span",{className:Y.metaPlaceholder,children:"None"}):X.map(ge=>{const fe=c.find(Ce=>Ce.id===ge);return i.jsxs("span",{className:Y.linkedEnvChip,"data-testid":`linked-env-${ge}`,children:[(fe==null?void 0:fe.displayName)||ge,i.jsx("button",{className:Y.chipDismiss,onClick:()=>{v($.id,ge).catch(()=>{})},title:`Unlink ${(fe==null?void 0:fe.displayName)||ge}`,"aria-label":`Unlink ${(fe==null?void 0:fe.displayName)||ge}`,"data-testid":`unlink-env-${ge}`,children:"x"})]},ge)})})(),(()=>{const X=new Set($.linkedEnvironmentIds),ge=c.filter(fe=>fe.id!==$.environmentId&&!X.has(fe.id));return ge.length===0?null:i.jsxs("select",{className:Y.linkEnvSelect,value:"",onChange:fe=>{fe.target.value&&g($.id,fe.target.value).catch(()=>{})},"aria-label":"Link environment","data-testid":"link-env-select",children:[i.jsx("option",{value:"",children:"+ Link"}),ge.map(fe=>i.jsx("option",{value:fe.id,children:fe.displayName||fe.id},fe.id))]})})(),b&&i.jsxs("span",{className:Y.linkError,"data-testid":"link-operation-error",role:"alert",children:[b,i.jsx("button",{className:Y.chipDismiss,onClick:x,"aria-label":"Dismiss error","data-testid":"dismiss-link-error",children:"x"})]})]}):i.jsx("span",{className:Y.metaPlaceholder,children:"None"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Persona"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(ud,{value:($==null?void 0:$.defaultPersonaId)||"",onSave:X=>{$&&m($.id,{defaultPersonaId:X}).catch(()=>{})},options:[{value:"",label:"(Inherit)"},...S.map(X=>({value:X.id,label:X.name}))],fieldId:"defaultPersonaId",activeFieldId:A,onActivate:P,renderDisplay:X=>{const ge=S.find(fe=>fe.id===X);if(ge)return i.jsx("span",{children:ge.name})},placeholder:($==null?void 0:$.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Worktrees"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(C6,{checked:($==null?void 0:$.useWorktrees)??!0,onChange:X=>{$&&m($.id,{useWorktrees:X}).catch(()=>{})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),i.jsxs("div",{className:Y.metaRow,children:[i.jsx("span",{className:Y.metaLabel,children:"Working Dir"}),i.jsx("div",{className:Y.metaValue,children:i.jsx(ln,{value:($==null?void 0:$.workingDirectory)||"",onSave:X=>{$&&m($.id,{workingDirectory:X}).catch(()=>{})},fieldId:"workingDirectory",activeFieldId:A,onActivate:P,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-working-directory"})})]}),$&&i.jsxs("div",{className:Y.metaTimestamps,children:[i.jsxs("span",{className:Y.metaTimestamp,children:["Created ",tx($.createdAt)]}),$.updatedAt&&$.updatedAt!==$.createdAt&&i.jsxs("span",{className:Y.metaTimestamp,children:["· Updated ",tx($.updatedAt)]})]})]}),J>0&&i.jsxs("div",{className:Y.progressBarContainer,"data-testid":"progress-bar",children:[i.jsx("div",{className:Y.progressBar,children:i.jsx("div",{className:Y.progressFill,style:{width:`${ce}%`}})}),i.jsxs("span",{className:Y.progressLabel,children:[Z,"/",J]})]}),ie&&ie.costMillicents>0&&i.jsx("div",{className:Y.progressBarContainer,children:i.jsxs("span",{className:Y.progressLabel,children:["Usage: ",Ss(ie.costMillicents)," (",ie.sessionCount," session",ie.sessionCount!==1?"s":"",")"]})}),$&&($.tokenBudget>0||$.costBudgetMillicents>0)&&i.jsx("div",{className:Y.progressBarContainer,children:i.jsxs("span",{className:Y.progressLabel,children:["Budget:"," ",$.tokenBudget>0&&i.jsxs(i.Fragment,{children:["Tokens: ",Mo(((ie==null?void 0:ie.inputTokens)??0)+((ie==null?void 0:ie.outputTokens)??0))," / ",Mo($.tokenBudget)]}),$.tokenBudget>0&&$.costBudgetMillicents>0&&" | ",$.costBudgetMillicents>0&&i.jsxs(i.Fragment,{children:["Cost: ",Ss((ie==null?void 0:ie.costMillicents)??0)," / ",Ss($.costBudgetMillicents)]})]})}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Workspace view",children:[i.jsx("button",{role:"tab","aria-selected":C==="graph",className:`${Y.tab} ${C==="graph"?Y.active:""}`,onClick:()=>D("graph"),children:"Graph"}),i.jsx("button",{role:"tab","aria-selected":C==="board",className:`${Y.tab} ${C==="board"?Y.active:""}`,onClick:()=>D("board"),"data-testid":"board-tab",children:"Board"}),i.jsx("button",{role:"tab","aria-selected":C==="tasks",className:`${Y.tab} ${C==="tasks"?Y.active:""}`,onClick:()=>D("tasks"),children:"Tasks"})]}),C==="tasks"&&J>0&&i.jsxs("div",{className:Y.workspaceSummary,children:[i.jsx("span",{className:Y.workspaceSummaryTitle,children:`${Z}/${J} tasks complete`}),i.jsx("span",{className:Y.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),C==="tasks"&&J===0&&i.jsxs("div",{className:Y.emptyCta,children:[i.jsx("button",{className:Y.ctaButton,onClick:()=>o(Di(t,void 0,W)),children:"Create Task"}),i.jsx("div",{className:Y.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),C==="board"&&i.jsx(V8,{workspaceId:t,environmentId:W,tasks:r,sessions:k,personas:S,environments:c}),C==="graph"&&i.jsx(pN,{workspaceId:t,environmentId:W,tasks:r,resolvedThemeId:T}),i.jsx(Ci,{isOpen:B,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{$&&(p($.id).catch(()=>{}),o("/",{replace:!0})),E(!1)},onCancel:()=>E(!1)})]})}const jU="_container_3pgew_1",NU="_header_3pgew_8",CU="_headerTitle_3pgew_35",EU="_headerActions_3pgew_44",AU="_body_3pgew_51",DU="_btnPrimary_3pgew_63",RU="_btnGhost_3pgew_94",MU="_error_3pgew_116",Ma={container:jU,header:NU,headerTitle:CU,headerActions:EU,body:AU,btnPrimary:DU,btnGhost:RU,error:MU};function IU(t){const s={};return t.name.trim()||(s.name="Name is required"),t.repoUrl.trim()&&!/^https?:\/\/.+/i.test(t.repoUrl.trim())&&(s.repoUrl="Must be a valid http(s) URL"),t.environmentId||(s.environmentId="Environment is required"),Object.keys(s).length>0?s:void 0}const OU=[{label:"Home",url:Ni},{label:"New Workspace",url:void 0}];function BU(){const[t]=hm(),s=t.get("environment")??void 0,{environments:{environments:o},personas:{personas:r},workspaces:{createWorkspace:c,workspaceCreating:d}}=mt(),{showToast:u}=Sn(),p=kt(),[m,g]=y.useState(()=>{var N;return e7(void 0,s||((N=o[0])==null?void 0:N.id))}),[v,b]=y.useState(),[x,S]=y.useState();y.useEffect(()=>{s||m.environmentId||o.length===0||g(N=>{var T;return N.environmentId?N:{...N,environmentId:((T=o[0])==null?void 0:T.id)??""}})},[o,s,m.environmentId]);const k=()=>{const N=IU(m);if(N){b(N),S(void 0);return}b(void 0),S(void 0),c(m.name.trim(),m.description,m.repoUrl.trim(),m.environmentId,m.defaultPersonaId,m.useWorktrees,m.workingDirectory,()=>{u("Workspace created","success"),p(Ni,{replace:!0})},T=>{S(T)}).catch(()=>{})},w=()=>{p(s?ji(s):Ni,{replace:!0})};return i.jsxs("div",{className:Ma.container,children:[i.jsxs("div",{className:Ma.header,children:[i.jsx("div",{className:Ma.headerTitle,children:i.jsx(Ns,{segments:OU})}),i.jsxs("div",{className:Ma.headerActions,children:[i.jsx("button",{className:Ma.btnGhost,onClick:w,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),i.jsx("button",{className:Ma.btnPrimary,onClick:k,disabled:d||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:d?i.jsx(g1,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),i.jsxs("div",{className:Ma.body,children:[i.jsx(n7,{values:m,onChange:N=>{g(N),b(void 0),S(void 0)},environments:o,personas:r,errors:v,disabled:d,autoFocusName:!0}),x&&i.jsx("div",{className:Ma.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function nx(){const{workspaceId:t,environmentId:s}=fs(),[o]=hm(),r=t??o.get("workspace")??"",c=o.get("parent")??void 0,{tasks:{tasks:d,createTask:u,updateTask:p},workspaces:{workspaces:m},personas:{personas:g}}=mt(),{showToast:v}=Sn();return i.jsx(E1,{mode:"new",workspaceId:r,parentTaskId:c,environmentId:s,tasks:d,workspaces:m,personas:g,onCreateTask:(b,x,S,k,w,N,T,C,D)=>{u(b,x,S,k,w,N,T,C,D).catch(()=>{})},onUpdateTask:(b,x,S,k,w)=>{p(b,x,S,k,w).catch(()=>{})},onShowToast:v})}function LU(){return i.jsxs("div",{className:Y.panelContainer,"aria-hidden":"true",children:[i.jsx("div",{className:Y.header,children:i.jsxs("span",{className:Y.headerTitle,children:[i.jsx(we,{width:"12rem",height:"1rem"}),i.jsx(we,{width:"4rem",height:"1rem",borderRadius:"var(--radius-full)"})]})}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Task view",children:[i.jsx("span",{className:`${Y.tab} ${Y.active}`,children:"Overview"}),i.jsx("span",{className:Y.tab,children:"Stream"}),i.jsx("span",{className:Y.tab,children:"Findings"})]}),i.jsx("div",{className:Y.overviewContent,children:i.jsxs("div",{className:Y.overviewDashboard,children:[i.jsx("div",{className:Y.overviewHero,children:i.jsx(we,{width:"5rem",height:"1.5rem",borderRadius:"var(--radius-full)"})}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Description"}),i.jsx(Wp,{lines:2})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Environment"}),i.jsxs("div",{className:Y.envRow,children:[i.jsx(we,{width:"0.5rem",height:"0.5rem",variant:"circular"}),i.jsx(we,{width:"8rem",height:"0.875rem"})]})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Dependencies"}),i.jsx(Wp,{lines:2})]}),i.jsxs("div",{className:Y.overviewSection,children:[i.jsx("div",{className:Y.overviewLabel,children:"Timeline"}),i.jsx("div",{className:Y.timeline,children:Array.from({length:4},(t,s)=>i.jsxs("div",{className:Y.timelineRow,children:[i.jsx(we,{width:"4rem",height:"0.75rem"}),i.jsx(we,{width:"10rem",height:"0.75rem"})]},s))})]})]})})]})}function Ia(){const{taskId:t,workspaceId:s,environmentId:o}=fs(),r=Zt(),c=kt(),{showToast:d}=Sn(),{sessions:{events:u,eventsDropped:p,sessions:m,loadSessionEvents:g,taskSessions:v,loadTaskSessions:b,sendInput:x,spawn:S,kill:k},tasks:{tasks:w,tasksLoading:N,startTask:T,stopTask:C,resumeTask:D,deleteTask:B,createTask:E,updateTask:A},environments:{environments:P,provisionEnvironment:I},findings:{findings:U,loadFindings:Q},workspaces:{workspaces:$},personas:{personas:W},usageCache:pe,loadUsage:H}=mt(),ie=y.useRef(void 0),L=y.useRef(void 0),Z=y.useRef(void 0),J=y.useRef(void 0),ce=y.useRef(void 0),X=r.pathname.endsWith("/stream")?"stream":r.pathname.endsWith("/findings")?"findings":"overview",ge=r.pathname.endsWith("/edit"),[fe,Ce]=y.useState(X),[Ze,me]=y.useState(!1),[_e,ve]=y.useState(void 0),[Le,Mt]=y.useState(""),[Tn,oe]=y.useState(ge),Ve=y.useRef(X),qt=y.useRef(ge),te=w.find(Re=>Re.id===t),ht=(te==null?void 0:te.workspaceId)||void 0,at=$.find(Re=>Re.id===ht);y.useEffect(()=>{X!==Ve.current&&(Ve.current=X,X!==fe&&Ce(X))},[X,fe]),y.useEffect(()=>{ge!==qt.current&&(qt.current=ge,ge!==Tn&&oe(ge))},[ge,Tn]),y.useEffect(()=>{if(Le===""){if(at!=null&&at.environmentId)Mt(at.environmentId);else if(P.length>0){const Re=P.find(Je=>Je.status==="connected");Mt((Re==null?void 0:Re.id)??P[0].id)}}},[Le,at==null?void 0:at.environmentId,P]);const Kt=te?v[te.id]??[]:[];let gt;_e&&Kt.some(Re=>Re.id===_e)?gt=_e:gt=(te==null?void 0:te.latestSessionId)||void 0;const ps=()=>{me(!0)},aa=()=>{if(!te)return;B(te.id).catch(()=>{}),me(!1);const Re=o??(at==null?void 0:at.environmentId);c(te.workspaceId&&Re?$a(te.workspaceId,Re):"/",{replace:!0})};y.useEffect(()=>{(te==null?void 0:te.id)!==L.current&&(L.current=te==null?void 0:te.id,ve(void 0),Mt(""),oe(ge))},[te==null?void 0:te.id,ge]),y.useEffect(()=>{if(!(te!=null&&te.id))return;const Re=te.id!==J.current,Je=te.latestSessionId!==ce.current;(Re||Je)&&(J.current=te.id,ce.current=te.latestSessionId,b(te.id).catch(()=>{}))},[te==null?void 0:te.id,te==null?void 0:te.latestSessionId,b]),y.useEffect(()=>{if((te==null?void 0:te.status)!==Z.current){const Re=Z.current===void 0;Z.current=te==null?void 0:te.status;const Je=(te==null?void 0:te.status)==="not_started"?"overview":(te==null?void 0:te.status)==="working"||(te==null?void 0:te.status)==="paused"?"stream":(te==null?void 0:te.status)==="complete"?"findings":void 0;Je&&Je!==fe&&!(Re&&X!=="overview")&&Ce(Je)}},[te==null?void 0:te.status,fe,X]);const es=y.useMemo(()=>new Map(w.map(Re=>[Re.id,Re])),[w]),Fa=y.useMemo(()=>{const Re=gt?u.filter(Je=>Je.sessionId===gt):[];return ah(sh(Re))},[u,gt]),ia=te?te.dependsOn.some(Re=>{const Je=es.get(Re);return Je!==void 0&&Je.status!=="complete"}):!1,Yt=y.useMemo(()=>_7(t,o,$,P,es),[t,o,$,P,es]);y.useEffect(()=>{gt&>!==ie.current&&(ie.current=gt,g(gt).catch(()=>{}))},[gt,g]),y.useEffect(()=>{fe==="findings"&&ht&&Q(ht).catch(()=>{})},[fe,ht,Q]);const Mi=Kt.reduce((Re,Je)=>Re+(Je.costMillicents??0),0);y.useEffect(()=>{te&&(H("task",te.id).catch(()=>{}),te.childTaskIds.length>0&&H("task_tree",te.id).catch(()=>{}))},[te==null?void 0:te.id,te==null?void 0:te.childTaskIds.length,H,Mi]);const oa=te?`task:${te.id}`:"",Za=oa in pe?pe[oa]:void 0,ms=te?`task_tree:${te.id}`:"",Ii=te&&te.childTaskIds.length>0&&ms in pe?pe[ms]:void 0,wn=Re=>{Ce(Re),c(On(t,Re==="overview"?void 0:Re,s,o))};return Qs({key:"1"},()=>wn("overview")),Qs({key:"2"},()=>wn("stream")),Qs({key:"3"},()=>wn("findings")),!te&&N?i.jsx(LU,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Ns,{segments:Yt}),i.jsxs("div",{className:Y.header,children:[i.jsxs("span",{className:Y.headerTitle,children:[i.jsx("span",{"data-testid":"task-title",children:(te==null?void 0:te.title)||t}),te&&i.jsx("span",{className:Y.taskStatusBadge,"data-testid":"task-status",children:te.status}),(te==null?void 0:te.branch)&&i.jsx("span",{className:Y.taskBranch,children:te.branch}),ia&&i.jsx("span",{className:Y.taskBlockedBadge,children:"blocked"})]}),te&&i.jsx(bB,{task:te,sessionId:gt,isBlocked:ia,onStart:()=>{T(te.id,void 0,Le).catch(()=>{})},onResume:()=>{D(te.id).catch(()=>{})},onStop:()=>{C(te.id).catch(()=>{})},onPause:()=>{gt&&k(gt).catch(()=>{})},onDelete:ps,onEdit:()=>oe(!0)})]}),i.jsxs("div",{className:Y.tabBar,role:"tablist","aria-label":"Task view",children:[i.jsx("button",{role:"tab","aria-selected":fe==="overview",className:`${Y.tab} ${fe==="overview"?Y.active:""}`,onClick:()=>wn("overview"),children:"Overview"}),i.jsx("button",{role:"tab","aria-selected":fe==="stream",className:`${Y.tab} ${fe==="stream"?Y.active:""}`,onClick:()=>wn("stream"),children:"Stream"}),i.jsx("button",{role:"tab","aria-selected":fe==="findings",className:`${Y.tab} ${fe==="findings"?Y.active:""}`,onClick:()=>wn("findings"),children:"Findings"})]}),i.jsxs(us,{mode:"wait",children:[fe==="overview"&&i.jsx(Rt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:Y.overviewContent,"data-testid":"task-overview",children:Tn&&te?i.jsx(E1,{mode:"edit",taskId:te.id,workspaceId:ht,environmentId:o,tasks:w,workspaces:$,personas:W,onCreateTask:(Re,Je,Jt,St,un,Wt,Oi,Bi,Li)=>{E(Re,Je,Jt,St,un,Wt,Oi,Bi,Li).catch(()=>{})},onUpdateTask:(Re,Je,Jt,St,un)=>{A(Re,Je,Jt,St,un).catch(()=>{})},onEditDone:()=>{ge?c(On(te.id,void 0,s,o),{replace:!0}):oe(!1)},onShowToast:d}):te?i.jsx(oL,{task:te,tasksById:es,environments:P,workspaces:$,taskSessions:Kt,selectedEnvId:Le,taskUsage:Za,treeUsage:Ii}):i.jsx("div",{className:Y.waitingMessage,children:"No additional details"})},"overview"),fe==="stream"&&i.jsxs(Rt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[i.jsx(M3,{taskSessions:Kt,selectedSessionId:gt,onSelect:Re=>ve(Re)}),i.jsx(Xm,{events:Fa,eventsDropped:p,emptyState:!gt&&te?ia?i.jsx("div",{className:Y.emptyCta,"data-testid":"stream-blocked-message",children:i.jsx("div",{className:Y.ctaDescription,children:"This task is blocked by incomplete dependencies"})}):i.jsxs("div",{className:Y.emptyCta,children:[i.jsx("button",{"data-testid":"stream-start-cta",className:Y.ctaButton,onClick:()=>{T(te.id,void 0,Le).catch(()=>{})},children:"Start Task"}),i.jsx("div",{className:Y.ctaDescription,children:"Click to begin agent execution"})]}):gt&&Fa.length===0?i.jsx("div",{className:Y.waitingMessage,children:"Waiting for events..."}):void 0,onShowToast:d})]},"stream"),fe==="findings"&&i.jsx(Rt.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:Y.tabContent,children:ht?i.jsx(N1,{findings:U.filter(Re=>Re.workspaceId===ht)}):i.jsx("div",{className:Y.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),(()=>{if(!te||te.status!=="working"&&te.status!=="paused")return;const Re=gt?m.find(Je=>Je.id===gt):void 0;if(!(!Re||Re.status==="stopped"))return i.jsx(Qr,{mode:"send",sessionId:Re.id,environmentId:Re.environmentId,personas:W,environments:P,onSendInput:(Je,Jt)=>{x(Je,Jt).catch(()=>{})},onSpawn:(Je,Jt,St)=>{S(Je,Jt,St).catch(()=>{})},onStartTask:(Je,Jt,St)=>{T(Je,Jt,St).catch(()=>{})},onProvisionEnvironment:Je=>{I(Je).catch(()=>{})},onShowToast:d})})(),te&&i.jsx(Ci,{isOpen:Ze,title:"Delete Task?",description:`"${te.title}" will be permanently removed.`,onConfirm:aa,onCancel:()=>me(!1)})]})}function zU(){const{environments:{environments:t,addEnvironment:s,updateEnvironment:o},codespaces:{codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,listCodespaces:p,createCodespace:m}}=mt(),{showToast:g}=Sn();return i.jsx(A1,{mode:"new",environments:t,onAddEnvironment:(v,b,x)=>{s(v,b,x).catch(()=>{})},onUpdateEnvironment:(v,b)=>{o(v,b).catch(()=>{})},onListCodespaces:()=>{p().catch(()=>{})},codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,onCreateCodespace:(v,b)=>{m(v,b).catch(()=>{})},onShowToast:g})}function $U(){const{environmentId:t}=fs(),{environments:{environments:s,addEnvironment:o,updateEnvironment:r},codespaces:{codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,listCodespaces:m,createCodespace:g}}=mt(),{showToast:v}=Sn();return i.jsx(A1,{mode:"edit",environmentId:t,environments:s,onAddEnvironment:(b,x,S)=>{o(b,x,S).catch(()=>{})},onUpdateEnvironment:(b,x)=>{r(b,x).catch(()=>{})},onListCodespaces:()=>{m().catch(()=>{})},codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,onCreateCodespace:(b,x)=>{g(b,x).catch(()=>{})},onShowToast:v})}const UU="_layout_11u79_1",PU="_content_11u79_8",HU="_tabPanel_11u79_14",Xr={layout:UU,content:PU,tabPanel:HU};function VU(){const t=v7();return i.jsxs("div",{className:Xr.layout,children:[i.jsx(Ns,{segments:t}),i.jsx("div",{className:Xr.content,children:i.jsx(Va,{})})]})}const qU="_container_144a4_1",GU="_envHeader_144a4_6",FU="_envTitleRow_144a4_10",ZU="_statusDot_144a4_16",KU="_envName_144a4_21",YU="_statusBadge_144a4_27",JU="_envMeta_144a4_33",WU="_metaTag_144a4_39",XU="_actions_144a4_51",QU="_provisionMessage_144a4_59",eP="_errorMessage_144a4_64",tP="_section_144a4_69",nP="_sectionHeader_144a4_73",sP="_cardList_144a4_121",aP="_card_144a4_121",iP="_cardHeader_144a4_138",oP="_cardName_144a4_144",rP="_cardActions_144a4_149",lP="_cardDescription_144a4_154",cP="_cardMeta_144a4_160",dP="_repoLink_144a4_166",uP="_empty_144a4_174",fP="_errorHint_144a4_180",pP="_btnPrimary_144a4_186",mP="_btnOutline_144a4_220",hP="_btnSmall_144a4_247",gP="_btnDanger_144a4_273",Se={container:qU,envHeader:GU,envTitleRow:FU,statusDot:ZU,envName:KU,statusBadge:YU,envMeta:JU,metaTag:WU,actions:XU,provisionMessage:QU,errorMessage:eP,section:tP,sectionHeader:nP,cardList:sP,card:aP,cardHeader:iP,cardName:oP,cardActions:rP,cardDescription:lP,cardMeta:cP,repoLink:dP,empty:uP,errorHint:fP,btnPrimary:pP,btnOutline:mP,btnSmall:hP,btnDanger:gP};function vP(){return i.jsxs("div",{className:Se.container,"aria-hidden":"true",children:[i.jsxs("div",{className:Se.envHeader,children:[i.jsxs("div",{className:Se.envTitleRow,children:[i.jsx(we,{width:"0.875rem",height:"0.875rem",variant:"circular"}),i.jsx(we,{width:"12rem",height:"1.5rem"}),i.jsx(we,{width:"4rem",height:"0.875rem"})]}),i.jsxs("div",{className:Se.envMeta,children:[i.jsx(we,{width:"6rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"4.5rem",height:"1.25rem",borderRadius:"var(--radius-sm)"})]})]}),i.jsxs("div",{className:Se.actions,children:[i.jsx(we,{width:"5rem",height:"2rem",borderRadius:"var(--radius-sm)"}),i.jsx(we,{width:"4rem",height:"2rem",borderRadius:"var(--radius-sm)"})]}),i.jsxs("div",{className:Se.section,children:[i.jsx("div",{className:Se.sectionHeader,children:i.jsx("h3",{style:{margin:0},children:"Workspaces"})}),i.jsxs("div",{className:Se.cardList,children:[i.jsx(dd,{lines:2}),i.jsx(dd,{lines:2})]})]})]})}const yP={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function bP(){const{environmentId:t}=fs(),s=kt(),{environments:{environments:o,environmentsLoading:r,provisionStatus:c,provisionEnvironment:d,stopEnvironment:u,removeEnvironment:p},workspaces:{workspaces:m,archiveWorkspace:g,linkEnvironment:v,unlinkEnvironment:b,linkOperationError:x,clearLinkOperationError:S},sessions:{sessions:k}}=mt(),[w,N]=y.useState(!1),[T,C]=y.useState(!1),[D,B]=y.useState(void 0),E=o.find(J=>J.id===t);if(!E&&r)return i.jsx(vP,{});if(!t||!E)return i.jsx(ds,{to:Ro,replace:!0});const A=m.filter(J=>J.environmentId===E.id),P=m.filter(J=>J.linkedEnvironmentIds.includes(E.id)&&J.environmentId!==E.id).filter((J,ce,X)=>X.findIndex(ge=>ge.id===J.id)===ce),I=k.filter(J=>J.environmentId===E.id),U=I.reduce((J,ce)=>J+(ce.costMillicents??0),0),Q=yP[E.status]||"var(--text-tertiary)",$=E.status==="connected",W=E.status==="connecting",pe=E.status==="disconnected"||E.status==="error"||E.status==="sleeping",H=E.id in c?c[E.id]:void 0,ie=()=>{p(E.id).catch(()=>{}),N(!1),s(Ro,{replace:!0})},L=()=>{C(!1),d(E.id,!0).catch(()=>{})},Z=J=>{g(J).catch(()=>{}),B(void 0)};return i.jsxs("div",{className:Se.container,children:[i.jsx(Ci,{isOpen:w,title:"Delete Environment?",description:`"${E.displayName||E.id}" will be permanently removed along with all its data.`,onConfirm:ie,onCancel:()=>N(!1)}),i.jsx(Ci,{isOpen:T,title:"Reprovision Environment?",description:"This will kill any active session and force a fresh provision cycle. The environment will be temporarily disconnected.",confirmLabel:"Reprovision",onConfirm:L,onCancel:()=>C(!1)}),i.jsxs("div",{className:Se.envHeader,children:[i.jsxs("div",{className:Se.envTitleRow,children:[i.jsx("span",{className:Se.statusDot,style:{color:Q},children:"●"}),i.jsx("h2",{className:Se.envName,children:E.displayName||E.id}),i.jsx("span",{className:Se.statusBadge,style:{color:Q},children:E.status})]}),i.jsxs("div",{className:Se.envMeta,children:[i.jsxs("span",{className:Se.metaTag,children:["Adapter: ",E.adapterType]}),I.length>0&&i.jsxs("span",{className:Se.metaTag,children:[I.length," session",I.length!==1?"s":""]}),U>0&&i.jsxs("span",{className:Se.metaTag,children:["Cost: ",Ss(U)]})]})]}),i.jsxs("div",{className:Se.actions,children:[$&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:Se.btnPrimary,onClick:()=>s(Bx(E.id)),children:"New Chat"}),i.jsx("button",{className:Se.btnOutline,onClick:()=>{u(E.id).catch(()=>{})},children:"Stop"}),i.jsx("button",{className:Se.btnOutline,onClick:()=>C(!0),disabled:H!==void 0,"data-testid":"env-reprovision-btn",children:"Reprovision"})]}),pe&&i.jsx("button",{className:Se.btnPrimary,onClick:()=>{d(E.id).catch(()=>{})},children:E.status==="error"?"Retry":E.status==="sleeping"?"Wake":"Connect"}),W&&H!==void 0&&i.jsx("span",{className:Se.provisionMessage,children:H.message}),E.status==="error"&&(H==null?void 0:H.stage)==="error"&&i.jsx("span",{className:Se.errorMessage,children:H.message}),i.jsx("button",{className:Se.btnOutline,onClick:()=>s(sN(E.id)),"data-testid":"env-edit-btn",children:"Edit Config"}),i.jsx("button",{className:Se.btnDanger,onClick:()=>N(!0),children:"Delete"})]}),i.jsxs("div",{className:Se.section,children:[i.jsxs("div",{className:Se.sectionHeader,children:[i.jsx("h3",{children:"Workspaces"}),i.jsx("button",{className:Se.btnPrimary,onClick:()=>s(`${zx}?environment=${encodeURIComponent(E.id)}`),"data-testid":"workspace-create-button",children:"+ New Workspace"})]}),A.length===0&&i.jsx("p",{className:Se.empty,children:"No workspaces yet. Create one to get started."}),i.jsx("div",{className:Se.cardList,children:A.map(J=>i.jsx(xP,{workspace:J,confirmArchiveId:D,onOpen:()=>s($a(J.id,E.id)),onArchive:()=>B(J.id),onConfirmArchive:()=>Z(J.id),onCancelArchive:()=>B(void 0)},J.id))})]}),i.jsxs("div",{className:Se.section,children:[i.jsxs("div",{className:Se.sectionHeader,children:[i.jsx("h3",{children:"Linked Workspaces"}),(()=>{const J=m.filter(ce=>ce.environmentId!==E.id&&!ce.linkedEnvironmentIds.includes(E.id)&&ce.status==="active");return J.length===0?null:i.jsxs("select",{className:Se.btnPrimary,value:"",onChange:ce=>{ce.target.value&&v(ce.target.value,E.id).catch(()=>{})},"aria-label":"Link a workspace","data-testid":"link-workspace-select",children:[i.jsx("option",{value:"",children:"+ Link Workspace"}),J.map(ce=>i.jsx("option",{value:ce.id,children:ce.name},ce.id))]})})()]}),P.length===0&&i.jsx("p",{className:Se.empty,"data-testid":"linked-workspaces-empty",children:"No workspaces are linked to this environment."}),x&&i.jsxs("p",{className:Se.errorHint,"data-testid":"link-operation-error",role:"alert",children:[x,i.jsx("button",{className:Se.btnSmall,onClick:S,"aria-label":"Dismiss error","data-testid":"dismiss-link-error",children:"Dismiss"})]}),i.jsx("div",{className:Se.cardList,"data-testid":"linked-workspaces-list",children:P.map(J=>{var ce;return i.jsxs("div",{className:Se.card,"data-testid":`linked-workspace-card-${J.id}`,children:[i.jsxs("div",{className:Se.cardHeader,children:[i.jsx("strong",{className:Se.cardName,children:J.name}),i.jsxs("div",{className:Se.cardActions,children:[i.jsx("button",{className:Se.btnSmall,onClick:()=>s($a(J.id,J.environmentId)),children:"Open"}),i.jsx("button",{className:Se.btnSmall,onClick:()=>{b(J.id,E.id).catch(()=>{})},"data-testid":`unlink-workspace-${J.id}`,children:"Unlink"})]})]}),J.description&&i.jsx("p",{className:Se.cardDescription,children:J.description}),i.jsxs("div",{className:Se.cardMeta,children:["Primary: ",((ce=o.find(X=>X.id===J.environmentId))==null?void 0:ce.displayName)||J.environmentId]})]},J.id)})})]})]})}function xP({workspace:t,confirmArchiveId:s,onOpen:o,onArchive:r,onConfirmArchive:c,onCancelArchive:d}){const u=s===t.id,p=t.repoUrl&&/^https?:\/\//.test(t.repoUrl);return i.jsxs("div",{className:Se.card,"data-testid":"workspace-card",children:[i.jsxs("div",{className:Se.cardHeader,children:[i.jsx("strong",{className:Se.cardName,children:t.name}),i.jsxs("div",{className:Se.cardActions,children:[i.jsx("button",{className:Se.btnSmall,onClick:o,children:"Open"}),u?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:Se.btnDanger,onClick:c,children:"Confirm"}),i.jsx("button",{className:Se.btnSmall,onClick:d,children:"Cancel"})]}):i.jsx("button",{className:Se.btnSmall,onClick:r,children:"Archive"})]})]}),t.description&&i.jsx("p",{className:Se.cardDescription,children:t.description}),t.repoUrl&&i.jsx("div",{className:Se.cardMeta,children:p?i.jsx("a",{href:t.repoUrl,target:"_blank",rel:"noopener noreferrer",className:Se.repoLink,children:t.repoUrl}):i.jsx("span",{children:t.repoUrl})})]})}const _P={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function kP(){const s=Zt().pathname.replace(/^\/settings\/?/,"").split("/")[0],o=_P[s],r=g7(o);return i.jsxs("div",{className:Xr.layout,children:[i.jsx(Ns,{segments:r}),i.jsx("div",{className:Xr.content,children:i.jsx("div",{className:Xr.tabPanel,children:i.jsx(Va,{})},s)})]})}function SP(){const{tokens:{tokens:t,setToken:s,deleteToken:o},credentials:{credentialProviders:r,updateCredentialProviders:c}}=mt(),{showToast:d}=Sn();return i.jsxs(i.Fragment,{children:[i.jsx(LL,{credentialProviders:r,onUpdateCredentialProviders:u=>{c(u).catch(()=>{})}}),i.jsx(GO,{tokens:t,onSetToken:(u,p,m,g,v)=>{s(u,p,m,g,v).catch(()=>{})},onDeleteToken:u=>{o(u).catch(()=>{})},onShowToast:d})]})}function TP(){const{personas:{personas:t,deletePersona:s},appDefaultPersonaId:o,setAppDefaultPersonaId:r}=mt(),{showToast:c}=Sn(),d=kt();return i.jsx(JL,{personas:t,appDefaultPersonaId:o,onDeletePersona:async u=>{try{await s(u)}catch(p){throw console.error("Failed to delete persona",{personaId:u,error:p}),c("Failed to delete persona","error"),p}},onSetAppDefaultPersonaId:async u=>{try{await r(u)}catch(p){console.error("Failed to set app default persona ID",{personaId:u,error:p}),c("Failed to set app default persona","error")}},onNavigateToNew:()=>d(iN),onNavigateToPersona:u=>d(Lx(u))})}const wP="_container_1ooin_1",jP="_form_1ooin_7",NP="_formActions_1ooin_75",CP="_editableSection_1ooin_82",EP="_defaultBadge_1ooin_93",AP="_typeToggle_1ooin_107",DP="_scriptEditor_1ooin_121",RP="_optional_1ooin_128",ls={container:wP,form:jP,formActions:NP,editableSection:CP,defaultBadge:EP,typeToggle:AP,scriptEditor:DP,optional:RP},sx=[{value:"claude-code",label:"claude-code"},{value:"codex",label:"codex"},{value:"copilot",label:"copilot"},{value:"goose",label:"goose"},{value:"stub",label:"stub"},{value:"claude-code-acp",label:"claude-code-acp (experimental)"},{value:"codex-acp",label:"codex-acp (experimental)"},{value:"copilot-acp",label:"copilot-acp (experimental)"}],ax=[{value:"genaiscript",label:"genaiscript"}],MP="0";function ix(){const{personaId:t}=fs(),s=kt(),{showToast:o}=Sn(),{personas:{personas:r,createPersona:c,updatePersona:d,deletePersona:u},appDefaultPersonaId:p,setAppDefaultPersonaId:m}=mt(),g=t===void 0,v=g?void 0:r.find(x=>x.id===t);if(!g&&r.length>0&&!v)return i.jsx(ds,{to:qf,replace:!0});const b=[{label:"Settings",url:Do},{label:"Personas",url:qf},{label:g?"New Persona":(v==null?void 0:v.name)??"Persona",url:void 0}];return i.jsxs("div",{className:ls.container,children:[i.jsx(Ns,{segments:b}),i.jsx(IP,{existing:v,isNew:g,appDefaultPersonaId:p,onCreatePersona:c,onUpdatePersona:d,onDeletePersona:u,onSetAppDefaultPersonaId:m,onDone:()=>{s(qf)},showToast:o})]})}function IP({existing:t,isNew:s,appDefaultPersonaId:o,onCreatePersona:r,onUpdatePersona:c,onDeletePersona:d,onSetAppDefaultPersonaId:u,onDone:p,showToast:m}){const g=kt(),[v,b]=y.useState((t==null?void 0:t.name)??""),[x,S]=y.useState((t==null?void 0:t.description)??""),[k,w]=y.useState((t==null?void 0:t.systemPrompt)??""),[N,T]=y.useState((t==null?void 0:t.runtime)??"claude-code"),[C,D]=y.useState((t==null?void 0:t.model)??"sonnet"),[B,E]=y.useState((t==null?void 0:t.maxTurns)??0),[A,P]=y.useState((t==null?void 0:t.type)==="script"?"script":"agent"),[I,U]=y.useState((t==null?void 0:t.script)??""),[Q,$]=y.useState((t==null?void 0:t.allowedMcpTools)??[]),[W,pe]=y.useState(!1),[H,ie]=y.useState(null),[L,Z]=y.useState(!!s);y.useEffect(()=>{if(!s&&t&&!L){Z(!0),b(t.name),S(t.description),w(t.systemPrompt);const oe=t.type==="script"?"script":"agent";T(oe==="script"?t.runtime||"genaiscript":t.runtime),D(t.model),E(t.maxTurns),P(oe),U(t.script||""),$(t.allowedMcpTools)}},[s,t,L]);const J=oe=>{P(oe),oe==="script"?T("genaiscript"):N==="genaiscript"&&T("claude-code")},ce=!s&&t===void 0,X=v.trim().length>0&&!ce&&k.trim().length>0&&(A==="script"?I.trim().length>0:!!N&&!!C),ge=s&&X,fe=!s&&o===(t==null?void 0:t.id),Ce=!s&&t&&!fe&&A==="agent"&&!!N&&!!C,Ze=(oe,Ve)=>{if(!oe.trim())return`${Ve} is required`},me=oe=>{if(oe.preventDefault(),!(ce||!X)){if(t){c(t.id,v,x,k,N,C,B,A,I).then(()=>{m("Persona updated","success"),p()},()=>{m("Failed to save persona","error")});return}r(v,x,k,N,C,B,A,I,Q).then(Ve=>{m("Persona created","success"),g(Lx(Ve.id),{replace:!0})},()=>{m("Failed to save persona","error")})}},_e=()=>{t&&d(t.id).then(()=>{m("Persona deleted","success"),p()},()=>{m("Failed to delete persona","error")})},ve=async(oe,Ve,qt,te)=>oe().then(()=>{Ve(),m(qt,"success")},()=>{m(te,"error")}),Le=(oe,Ve)=>{if(!t)return;const qt=oe==="type"?String(Ve):A,te=oe==="runtime"?String(Ve):oe==="type"?String(Ve)==="script"?"genaiscript":N==="genaiscript"?"claude-code":N:N,ht=oe==="model"?String(Ve):C,at=oe==="maxTurns"?Number(Ve):B,Kt=oe==="systemPrompt"?String(Ve):k,gt=oe==="script"?String(Ve):I;ve(()=>c(t.id,oe==="name"?String(Ve):v,oe==="description"?String(Ve):x,Kt,te,ht,at,qt,gt),()=>{if(oe==="type"){const ps=String(Ve)==="script"?"script":"agent";P(ps),T(te)}oe==="runtime"&&T(String(Ve)),oe==="name"&&b(String(Ve)),oe==="description"&&S(String(Ve)),oe==="systemPrompt"&&w(String(Ve)),oe==="model"&&D(String(Ve)),oe==="maxTurns"&&E(Number(Ve)),oe==="script"&&U(String(Ve))},"Persona updated","Failed to update persona").catch(()=>{})},Mt=oe=>{me(oe)},Tn=()=>{t&&u(t.id).then(()=>{m("Set as app default","success")},()=>{m("Failed to set app default","error")})};return i.jsxs(i.Fragment,{children:[ce?i.jsxs("div",{className:ls.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsx("p",{children:"Loading persona..."})]}):s?i.jsxs("form",{onSubmit:Mt,className:ls.form,children:[i.jsx("h3",{children:"Create Persona"}),i.jsxs("div",{className:ls.typeToggle,"data-testid":"persona-type-toggle",children:[i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:A==="agent",onChange:()=>J("agent")}),"Agent"]}),i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"personaType",value:"script",checked:A==="script",onChange:()=>J("script")}),"Script"]})]}),i.jsxs("label",{children:["Name",i.jsx("input",{type:"text",value:v,onChange:oe=>b(oe.target.value),placeholder:A==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0,"data-testid":"persona-detail-name"})]}),i.jsxs("label",{children:["Description",i.jsx("input",{type:"text",value:x,onChange:oe=>S(oe.target.value),placeholder:"Brief description...","data-testid":"persona-detail-description"})]}),i.jsxs("label",{children:["Runtime",i.jsx("select",{value:N,onChange:oe=>T(oe.target.value),"data-testid":"persona-runtime-select",children:(A==="script"?ax:sx).map(oe=>i.jsx("option",{value:oe.value,children:oe.label},oe.value))})]}),A==="agent"&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{children:["Model",i.jsx("input",{type:"text",value:C,onChange:oe=>D(oe.target.value),placeholder:"e.g. sonnet","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["Max Turns",i.jsx("input",{type:"number",value:B,onChange:oe=>E(parseInt(oe.target.value,10)||0),min:0,"data-testid":"persona-detail-max-turns"})]}),i.jsxs("label",{children:["System Prompt",i.jsx("textarea",{value:k,onChange:oe=>w(oe.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0,"data-testid":"persona-detail-prompt"})]})]}),A==="script"&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{children:["Model ",i.jsx("span",{className:ls.optional,children:"(optional)"}),i.jsx("input",{type:"text",value:C,onChange:oe=>D(oe.target.value),placeholder:"e.g. sonnet (leave empty for script-only)","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["System Prompt",i.jsx("textarea",{value:k,onChange:oe=>w(oe.target.value),placeholder:"Context for the script...",rows:4,required:!0,"data-testid":"persona-detail-prompt"})]}),i.jsxs("label",{children:["Script",i.jsx("textarea",{value:I,onChange:oe=>U(oe.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
702
|
+
|
|
703
|
+
const grackle = await host.mcpServer({
|
|
704
|
+
id: "grackle",
|
|
705
|
+
url: env.vars.GRACKLE_MCP_URL,
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
$\`Summarize the current tasks.\`;`,rows:20,className:ls.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),A==="agent"&&i.jsxs("div",{children:[i.jsx("label",{children:"Allowed MCP Tools"}),i.jsx(Fb,{selectedTools:Q,onChange:$})]}),i.jsxs("div",{className:ls.formActions,children:[i.jsx(Js,{type:"submit",variant:"primary",size:"md",disabled:!ge,"data-testid":"persona-detail-save",children:"Create"}),i.jsx(Js,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):t?i.jsxs("div",{className:ls.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsxs("div",{className:ls.formActions,children:[i.jsx(Js,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Ce&&i.jsx(Js,{type:"button",variant:"ghost",size:"md",onClick:Tn,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),fe&&i.jsx("span",{className:ls.defaultBadge,children:"App Default"}),i.jsx(Js,{type:"button",variant:"danger",size:"md",onClick:()=>pe(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),i.jsxs("div",{className:ls.editableSection,children:[i.jsxs("label",{children:["Name",i.jsx(ln,{value:v,onSave:oe=>{Le("name",oe)},validate:oe=>Ze(oe,"Name"),fieldId:"persona-name",activeFieldId:H,onActivate:ie,ariaLabel:"Persona name","data-testid":"persona-detail-name"})]}),i.jsxs("label",{children:["Description",i.jsx(ln,{value:x,onSave:oe=>{Le("description",oe)},fieldId:"persona-description",activeFieldId:H,onActivate:ie,placeholder:"Brief description...",ariaLabel:"Persona description","data-testid":"persona-detail-description"})]}),i.jsxs("label",{children:["Type",i.jsx(ud,{value:A,onSave:oe=>{Le("type",oe)},options:[{value:"agent",label:"Agent"},{value:"script",label:"Script"}],fieldId:"persona-type",activeFieldId:H,onActivate:ie,ariaLabel:"Persona type","data-testid":"persona-type-toggle"})]}),i.jsxs("label",{children:["Runtime",i.jsx(ud,{value:N,onSave:oe=>{Le("runtime",oe)},options:A==="script"?ax:sx,fieldId:"persona-runtime",activeFieldId:H,onActivate:ie,ariaLabel:"Persona runtime","data-testid":"persona-runtime"})]}),i.jsxs("label",{children:["Model",A==="script"?" (optional)":"",i.jsx(ln,{value:C,onSave:oe=>{Le("model",oe)},validate:A==="agent"?oe=>Ze(oe,"Model"):void 0,fieldId:"persona-model",activeFieldId:H,onActivate:ie,placeholder:A==="script"?"e.g. sonnet (leave empty for script-only)":"e.g. sonnet",ariaLabel:"Persona model","data-testid":"persona-detail-model"})]}),i.jsxs("label",{children:["Max Turns",i.jsx(ln,{value:String(B),onSave:oe=>{Le("maxTurns",parseInt(oe,10)||0)},validate:oe=>/^\d+$/.test(oe.trim())?void 0:"Max Turns must be a non-negative integer",fieldId:"persona-max-turns",activeFieldId:H,onActivate:ie,placeholder:MP,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),i.jsxs("label",{children:["System Prompt",i.jsx(Xp,{value:k,onSave:oe=>{Le("systemPrompt",oe)},validate:oe=>Ze(oe,"System Prompt"),fieldId:"persona-system-prompt",activeFieldId:H,onActivate:ie,placeholder:A==="script"?"Context for the script...":"You are a senior frontend engineer...",ariaLabel:"Persona system prompt","data-testid":"persona-detail-prompt"})]}),A==="script"&&i.jsxs("label",{children:["Script",i.jsx(Xp,{value:I,onSave:oe=>{Le("script",oe)},validate:oe=>Ze(oe,"Script"),fieldId:"persona-script",activeFieldId:H,onActivate:ie,placeholder:`script({ model: "openai:gpt-4o" });
|
|
709
|
+
|
|
710
|
+
const grackle = await host.mcpServer({
|
|
711
|
+
id: "grackle",
|
|
712
|
+
url: env.vars.GRACKLE_MCP_URL,
|
|
713
|
+
});
|
|
714
|
+
|
|
715
|
+
$\`Summarize the current tasks.\`;`,ariaLabel:"Persona script","data-testid":"persona-script-editor"})]}),A==="agent"&&i.jsxs("div",{children:[i.jsx("label",{children:"Allowed MCP Tools"}),i.jsx(Fb,{selectedTools:Q,onChange:oe=>{$(oe),ve(()=>c(t.id,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,oe),()=>{},"MCP tools updated","Failed to update MCP tools").catch(()=>{})}})]})]}),!Ce&&!fe&&i.jsx("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--text-tertiary)",marginTop:"var(--space-xs)"},children:"Only agent personas with a runtime and model can be set as app default."})]}):null,i.jsx(Ci,{isOpen:W,title:"Delete Persona?",description:`"${t==null?void 0:t.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:_e,onCancel:()=>pe(!1)})]})}function OP(){const{themeId:t,resolvedThemeId:s,setTheme:o,preferSystem:r,setPreferSystem:c}=B1();return i.jsx(FO,{themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c})}function BP(){const[t,s]=y.useState(void 0);return y.useEffect(()=>{let o=!1;return(async()=>{try{const c=await Ne.getVersionStatus({});o||s({currentVersion:c.currentVersion,latestVersion:c.latestVersion,updateAvailable:c.updateAvailable,isDocker:c.isDocker})}catch{}})().catch(()=>{}),()=>{o=!0}},[]),t}function LP(){const{connected:t,environments:{environments:s},sessions:{sessions:o}}=mt(),r=BP();return i.jsxs(i.Fragment,{children:[r&&i.jsx(JI,{currentVersion:r.currentVersion,latestVersion:r.latestVersion,updateAvailable:r.updateAvailable,isDocker:r.isDocker}),i.jsx(ZO,{connected:t,environments:s,sessions:o})]})}function zP(){return i.jsx(OL,{})}const ox=Di();function $P(){const t=kt();return Qs({key:"?"},()=>{t(oN)}),Qs({key:"n"},()=>{t(ox)}),Qs({key:"N"},()=>{t(ox)}),i.jsx(i.Fragment,{})}function hl(t){const s=u7();y.useLayoutEffect(()=>(s(t),()=>{s(void 0)}),[t,s])}function UP(){const{workspaces:{workspaces:t},tasks:{tasks:s}}=mt(),o=y.useMemo(()=>i.jsx(jI,{workspaces:t,tasks:s}),[t,s]);return hl(o),i.jsx(Va,{})}function PP(){const{environments:{environments:t}}=mt(),s=y.useMemo(()=>i.jsx(B5,{environments:t}),[t]);return hl(s),i.jsx(Va,{})}function HP(){const t=y.useMemo(()=>i.jsx(v8,{}),[]);return hl(t),i.jsx(Va,{})}function VP(){const{findings:{findings:t,loadFindings:s,loadAllFindings:o}}=mt(),{workspaceId:r,environmentId:c}=fs();y.useEffect(()=>{r?s(r).catch(()=>{}):o().catch(()=>{})},[r,s,o]);const d=y.useMemo(()=>i.jsx(Z5,{findings:t,workspaceId:r,environmentId:c}),[t,r,c]);return hl(d),i.jsx(Va,{})}function qP(){const{knowledge:t,workspaces:{workspaces:s}}=mt(),o=y.useCallback(p=>{t.search(p).catch(()=>{})},[t]),r=y.useCallback(()=>{t.clearSearch()},[t]),c=y.useCallback(p=>{t.selectNode(p).catch(()=>{})},[t]),d=y.useCallback(p=>{t.loadRecent(p||void 0).catch(()=>{})},[t]),u=y.useMemo(()=>i.jsx(Y6,{nodes:t.graphData.nodes,workspaces:s,loading:t.loading,searchQuery:t.searchQuery,onSearch:o,onClearSearch:r,onSelectNode:c,onWorkspaceChange:d}),[t,s,o,r,c,d]);return hl(u),i.jsx(Va,{})}const GP="_container_ce571_1",FP="_title_ce571_6",md={container:GP,title:FP};function ZP(){return i.jsxs("div",{className:md.container,"aria-hidden":"true",children:[i.jsx("h1",{className:md.title,children:"Findings"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-sm)"},children:Array.from({length:4},(t,s)=>i.jsx(dd,{lines:3},s))})]})}function rx(){const{environmentId:t,workspaceId:s}=fs(),{findings:{findings:o,findingsLoading:r,loadFindings:c},workspaces:{workspaces:d},environments:{environments:u}}=mt(),p=kt();y.useEffect(()=>{s&&c(s).catch(()=>{})},[s,c]);const m=y.useCallback(v=>{p(Mp(v,s,t))},[p,s,t]);if(r)return i.jsx(ZP,{});const g=s&&t?V1("Findings",s,t,d,u).slice(0,-1):S7();return i.jsxs("div",{className:md.container,"data-testid":"findings-list-page",children:[i.jsx(Ns,{segments:g}),i.jsx("h1",{className:md.title,children:"Findings"}),i.jsx(N1,{findings:o,onFindingClick:m})]})}const KP="_container_1wwpb_1",YP="_notFound_1wwpb_6",JP="_header_1wwpb_12",WP="_categoryBadge_1wwpb_19",XP="_title_1wwpb_28",QP="_content_1wwpb_35",e9="_tags_1wwpb_77",t9="_tag_1wwpb_77",n9="_meta_1wwpb_92",s9="_metaTimestamp_1wwpb_100",a9="_metaLink_1wwpb_105",mn={container:KP,notFound:YP,header:JP,categoryBadge:WP,title:XP,content:QP,tags:e9,tag:t9,meta:n9,metaTimestamp:s9,metaLink:a9};function lx(){const{findingId:t,environmentId:s,workspaceId:o}=fs(),{findings:{selectedFinding:r,findingLoading:c,loadFinding:d},workspaces:{workspaces:u},environments:{environments:p}}=mt(),m=kt();if(y.useEffect(()=>{t&&d(t).catch(()=>{})},[t,d]),c)return i.jsx("div",{className:mn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:mn.notFound,children:"Loading..."})});if(!r)return i.jsx("div",{className:mn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:mn.notFound,children:"Finding not found."})});const g=V1(r.title,o,s,u,p),v=fd(r.category);return i.jsxs("div",{className:mn.container,"data-testid":"finding-detail-page",children:[i.jsx(Ns,{segments:g}),i.jsxs("div",{className:mn.header,children:[i.jsx("span",{className:mn.categoryBadge,style:{background:v.bg,color:v.text},children:r.category}),i.jsx("h1",{className:mn.title,children:r.title})]}),r.content&&i.jsx("div",{className:mn.content,children:i.jsx(hd,{remarkPlugins:[gd],children:r.content})}),r.tags.length>0&&i.jsx("div",{className:mn.tags,children:r.tags.map(b=>i.jsx("span",{className:mn.tag,children:b},b))}),i.jsxs("div",{className:mn.meta,children:[i.jsx("span",{className:mn.metaTimestamp,title:r.createdAt,children:eh(r.createdAt)}),r.taskId&&i.jsx("button",{type:"button",className:mn.metaLink,onClick:()=>{m(On(r.taskId))},children:"View Task"}),r.sessionId&&i.jsx("button",{type:"button",className:mn.metaLink,onClick:()=>{m(gm(r.sessionId))},children:"View Session"})]})]})}const i9="_wizard_1260s_1",o9="_container_1260s_10",r9="_stepContent_1260s_19",l9="_logoArea_1260s_28",c9="_logoImage_1260s_32",d9="_heading_1260s_41",u9="_tagline_1260s_49",f9="_subtitle_1260s_56",p9="_featureList_1260s_64",m9="_runtimeGrid_1260s_89",h9="_runtimeCard_1260s_101",g9="_runtimeName_1260s_133",v9="_runtimeDescription_1260s_139",y9="_buttonRow_1260s_144",b9="_primaryButton_1260s_151",x9="_ghostButton_1260s_185",_9="_dots_1260s_213",k9="_dot_1260s_213",Fe={wizard:i9,container:o9,stepContent:r9,logoArea:l9,logoImage:c9,heading:d9,tagline:u9,subtitle:f9,featureList:p9,runtimeGrid:m9,runtimeCard:h9,runtimeName:g9,runtimeDescription:v9,buttonRow:y9,primaryButton:b9,ghostButton:x9,dots:_9,dot:k9};function S9({onNext:t}){return i.jsxs("div",{className:Fe.stepContent,"data-testid":"setup-welcome",children:[i.jsx("div",{className:Fe.logoArea,children:i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:Fe.logoImage})}),i.jsx("h1",{className:Fe.heading,children:"Welcome to Grackle"}),i.jsx("p",{className:Fe.tagline,children:"Multi-agent orchestration for software teams"}),i.jsx("button",{type:"button",className:Fe.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function T9({onNext:t,onBack:s}){return i.jsxs("div",{className:Fe.stepContent,"data-testid":"setup-about",children:[i.jsx("h2",{className:Fe.heading,children:"What is Grackle?"}),i.jsxs("ul",{className:Fe.featureList,children:[i.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),i.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),i.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),i.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),i.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),i.jsxs("div",{className:Fe.buttonRow,children:[i.jsx("button",{type:"button",className:Fe.ghostButton,onClick:s,children:"Back"}),i.jsx("button",{type:"button",className:Fe.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const w9=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function j9({currentRuntime:t,onFinish:s,onBack:o,finishDisabled:r}){const[c,d]=y.useState(t||"claude-code");return y.useEffect(()=>{t&&d(t)},[t]),i.jsxs("div",{className:Fe.stepContent,"data-testid":"setup-runtime",children:[i.jsx("h2",{className:Fe.heading,children:"Choose Your Runtime"}),i.jsx("p",{className:Fe.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),i.jsx("div",{className:Fe.runtimeGrid,children:w9.map(u=>i.jsxs("button",{type:"button",className:Fe.runtimeCard,"data-selected":c===u.id,"aria-pressed":c===u.id,"data-testid":`runtime-card-${u.id}`,onClick:()=>d(u.id),children:[i.jsx("span",{className:Fe.runtimeName,children:u.name}),i.jsx("span",{className:Fe.runtimeDescription,children:u.description})]},u.id))}),i.jsxs("div",{className:Fe.buttonRow,children:[i.jsx("button",{type:"button",className:Fe.ghostButton,onClick:o,children:"Back"}),i.jsx("button",{type:"button",className:Fe.primaryButton,onClick:()=>{s(c)},disabled:r,"data-testid":"setup-runtime-next",children:"Next"})]})]})}function N9(){return typeof Notification<"u"}function C9({onFinish:t,onBack:s,finishDisabled:o}){const r=N9(),c=r&&Notification.permission!=="default";function d(){r&&Notification.requestPermission().catch(()=>{}),t()}return i.jsxs("div",{className:Fe.stepContent,"data-testid":"setup-notifications",children:[i.jsx("h2",{className:Fe.heading,children:"Stay in the Loop"}),i.jsx("p",{className:Fe.subtitle,children:"Grackle can send you a browser notification when an agent needs your input, so you never miss an important moment."}),c?i.jsx("p",{className:Fe.subtitle,children:Notification.permission==="granted"?"Notifications are already enabled.":"Notifications have been blocked. You can change this in your browser settings."}):null,i.jsxs("div",{className:Fe.buttonRow,children:[i.jsx("button",{type:"button",className:Fe.ghostButton,onClick:s,disabled:o,children:"Back"}),!c&&r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:Fe.ghostButton,onClick:t,disabled:o,"data-testid":"setup-notifications-skip",children:"Skip"}),i.jsx("button",{type:"button",className:Fe.primaryButton,onClick:d,disabled:o,"data-testid":"setup-notifications-enable",children:"Enable Notifications"})]}):i.jsx("button",{type:"button",className:Fe.primaryButton,onClick:t,disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const E9=4,cx={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function A9(){const{personas:{personas:t,updatePersona:s},completeOnboarding:o,onboardingCompleted:r}=mt(),{showToast:c}=Sn(),d=kt(),[u,p]=y.useState(0),[m,g]=y.useState("claude-code"),[v,b]=y.useState(!1),x=t.find(w=>w.id==="claude-code"),S=y.useCallback(w=>{g(w),p(3)},[]),k=y.useCallback(()=>{const w=m;b(!0);const N=[];if(x&&w!==x.runtime){const C=cx[w]??"sonnet";N.push(s(x.id,void 0,void 0,void 0,w,C))}const T=t.find(C=>C.id===Q0);if(T&&w!==T.runtime){const C=cx[w]??"sonnet";N.push(s(Q0,void 0,void 0,void 0,w,C))}Promise.all(N).then(()=>o()).then(()=>{d("/",{replace:!0})},()=>{c("Failed to update runtime -- please try again","error"),b(!1)})},[m,x,t,s,o,d,c]);return r===!0?i.jsx(ds,{to:"/",replace:!0}):i.jsx("div",{className:Fe.wizard,"data-testid":"setup-wizard",children:i.jsxs("div",{className:Fe.container,children:[i.jsx(us,{mode:"wait",children:i.jsxs(Rt.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&i.jsx(S9,{onNext:()=>p(1)}),u===1&&i.jsx(T9,{onNext:()=>p(2),onBack:()=>p(0)}),u===2&&i.jsx(j9,{currentRuntime:m,onFinish:S,onBack:()=>p(1),finishDisabled:!x}),u===3&&i.jsx(C9,{onFinish:k,onBack:()=>p(2),finishDisabled:v})]},u)}),i.jsx("div",{className:Fe.dots,children:Array.from({length:E9},(w,N)=>i.jsx("span",{className:Fe.dot,"data-active":N===u},N))})]})})}const D9="_root_zndgp_1",R9="_body_zndgp_7",M9="_main_zndgp_19",I9="_sidebarWrapper_zndgp_26",O9="_overlay_zndgp_51",Fr={root:D9,body:R9,main:M9,sidebarWrapper:I9,overlay:O9},B9=y.lazy(()=>OT(()=>import("./KnowledgePage-BLz5X1AT.js"),__vite__mapDeps([0,1,2,3,4])).then(t=>({default:t.KnowledgePage}))),Z1=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function L9({tabs:t}){const{connected:s,environments:{environments:o},sessions:{sessions:r},tasks:{tasks:c}}=mt(),{toasts:d,dismissToast:u}=Sn(),p=Zt(),m=d7(),g=m!==void 0,[v,b]=y.useState(!1),x=y.useCallback(()=>b(S=>!S),[]);return y.useEffect(()=>{b(!1)},[p.pathname]),y.useEffect(()=>{if(!v)return;const S=k=>{k.key==="Escape"&&b(!1)};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[v]),i.jsxs(i.Fragment,{children:[i.jsx(i5,{connected:s,environments:o,sessions:r,onToggleSidebar:g?x:void 0,sidebarOpen:v}),i.jsx(f5,{tabs:t}),i.jsxs("div",{className:Fr.body,children:[g&&i.jsx("div",{className:Fr.sidebarWrapper,"data-sidebar-open":v,children:i.jsx(y5,{content:m})}),g&&v&&i.jsx("div",{className:Fr.overlay,"data-testid":"drawer-overlay",onClick:()=>b(!1)}),i.jsxs("div",{className:Fr.main,children:[i.jsx(Va,{}),i.jsx(j5,{sessions:r,tasks:c,environments:o})]})]}),i.jsx($I,{toasts:d,onDismiss:u}),i.jsx($P,{})]})}function z9(){const{sessions:{lastSpawnedId:t},environments:{environments:s,operationError:o,clearOperationError:r},tasks:{tasks:c},connected:d,onboardingCompleted:u}=mt(),{pluginNames:p}=ih(),{showToast:m}=Sn();hz(s,m),xz(c,m),gz(o,r,m);const g=kt(),v=Zt();if(y.useEffect(()=>{t&&!v.pathname.includes("/tasks/")&&g(gm(t),{replace:!0})},[t,g,v.pathname]),d&&u===!1)return i.jsx(ds,{to:"/setup",replace:!0});const b=G7(p);return i.jsx(c7,{children:i.jsxs("div",{className:Fr.root,children:[Z1&&i.jsx(BN,{}),i.jsx(L9,{tabs:b})]})})}function Cp(){const{workspaceId:t}=fs(),{workspaces:{workspaces:s}}=mt(),o=Zt(),r=s.find(m=>m.id===t);if(!(r!=null&&r.environmentId))return s.length===0?void 0:i.jsx(ds,{to:"/environments",replace:!0});const c=encodeURIComponent(t),d=`/workspaces/${c}`,u=o.pathname.startsWith(d)?o.pathname.slice(d.length):"",p=`/environments/${encodeURIComponent(r.environmentId)}/workspaces/${c}${u}${o.search}${o.hash}`;return i.jsx(ds,{to:p,replace:!0})}function $9(){const{pluginNames:t}=ih(),s=t.includes("orchestration"),o=t.includes("knowledge");return i.jsxs(_j,{children:[i.jsx(Ae,{path:"setup",element:i.jsx(A9,{})}),i.jsxs(Ae,{element:i.jsx(z9,{}),children:[i.jsx(Ae,{index:!0,element:i.jsx(oU,{})}),i.jsx(Ae,{path:"chat",element:i.jsx(gU,{})}),i.jsx(Ae,{path:"sessions/new",element:i.jsx(vU,{})}),i.jsx(Ae,{path:"sessions/:sessionId",element:i.jsx(_U,{})}),o&&i.jsx(Ae,{element:i.jsx(qP,{}),children:i.jsx(Ae,{path:"knowledge",element:i.jsx(y.Suspense,{fallback:i.jsx(v1,{}),children:i.jsx(B9,{})})})}),s&&i.jsxs(Ae,{element:i.jsx(UP,{}),children:[i.jsx(Ae,{path:"tasks",element:i.jsx(aU,{})}),i.jsx(Ae,{path:"tasks/new",element:i.jsx(nx,{})}),i.jsx(Ae,{path:"tasks/:taskId",element:i.jsx(Ia,{})}),i.jsx(Ae,{path:"tasks/:taskId/edit",element:i.jsx(Ia,{})}),i.jsx(Ae,{path:"tasks/:taskId/stream",element:i.jsx(Ia,{})}),i.jsx(Ae,{path:"tasks/:taskId/findings",element:i.jsx(Ia,{})})]}),s&&i.jsxs(Ae,{element:i.jsx(VP,{}),children:[i.jsx(Ae,{path:"findings",element:i.jsx(rx,{})}),i.jsx(Ae,{path:"findings/:findingId",element:i.jsx(lx,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId/findings",element:i.jsx(rx,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId/findings/:findingId",element:i.jsx(lx,{})})]}),i.jsxs(Ae,{element:i.jsx(PP,{}),children:[i.jsx(Ae,{path:"workspaces",element:i.jsx(ds,{to:"/environments",replace:!0})}),i.jsx(Ae,{path:"workspaces/new",element:i.jsx(BU,{})}),i.jsx(Ae,{path:"workspaces/:workspaceId",element:i.jsx(Cp,{})}),i.jsx(Ae,{path:"workspaces/:workspaceId/tasks/:taskId",element:i.jsx(Cp,{})}),i.jsx(Ae,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:i.jsx(Cp,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId",element:i.jsx(wU,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:i.jsx(nx,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:i.jsx(Ia,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:i.jsx(Ia,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:i.jsx(Ia,{})}),i.jsx(Ae,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:i.jsx(Ia,{})}),i.jsxs(Ae,{path:"environments",element:i.jsx(VU,{}),children:[i.jsx(Ae,{index:!0,element:i.jsx(iU,{})}),i.jsx(Ae,{path:"new",element:i.jsx(zU,{})}),i.jsx(Ae,{path:":environmentId",element:i.jsx(bP,{})}),i.jsx(Ae,{path:":environmentId/edit",element:i.jsx($U,{})})]})]}),i.jsx(Ae,{element:i.jsx(HP,{}),children:i.jsxs(Ae,{path:"settings",element:i.jsx(kP,{}),children:[i.jsx(Ae,{index:!0,element:i.jsx(ds,{to:"credentials",replace:!0})}),i.jsx(Ae,{path:"environments",element:i.jsx(ds,{to:"/environments",replace:!0})}),i.jsx(Ae,{path:"credentials",element:i.jsx(SP,{})}),i.jsx(Ae,{path:"tokens",element:i.jsx(ds,{to:"../credentials",replace:!0})}),i.jsx(Ae,{path:"personas",element:i.jsx(TP,{})}),i.jsx(Ae,{path:"personas/new",element:i.jsx(ix,{})}),i.jsx(Ae,{path:"personas/:personaId",element:i.jsx(ix,{})}),i.jsx(Ae,{path:"appearance",element:i.jsx(OP,{})}),i.jsx(Ae,{path:"shortcuts",element:i.jsx(zP,{})}),i.jsx(Ae,{path:"about",element:i.jsx(LP,{})})]})}),i.jsx(Ae,{path:"*",element:i.jsx(ds,{to:"/",replace:!0})})]})]})}const U9=1e4;function P9(){const{onboardingCompleted:t}=mt(),[s,o]=y.useState(!1);y.useEffect(()=>{if(t!==void 0)return;const c=setTimeout(()=>o(!0),U9);return()=>clearTimeout(c)},[t]);const r=t===void 0&&!s;return i.jsx(us,{mode:"wait",children:r?i.jsx(Rt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:i.jsx(v1,{})},"splash"):i.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:i.jsx(Fj,{basename:"/".replace(/\/$/,""),children:i.jsx($9,{})})},"app")})}function H9(){const t=Z1?z7:mz;return i.jsx(P7,{children:i.jsx(l7,{children:i.jsx(a7,{children:i.jsx(t,{children:i.jsx(P9,{})})})})})}RT.createRoot(document.getElementById("root")).render(i.jsx(y.StrictMode,{children:i.jsx(H9,{})}));export{Ns as B,$x as K,mt as a,Mp as f,gm as s,On as t,kt as u};
|