@grackle-ai/web 0.101.0 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{KnowledgePage-BL57rgfZ.js → KnowledgePage-xY8zG7iT.js} +1 -1
- package/dist/assets/{grpc-BHqklXZ4.js → grpc-DY0rnrKC.js} +2 -2
- package/dist/assets/{index-CWzm-AyB.css → index-BdqlM_1D.css} +1 -1
- package/dist/assets/index-CuLSnAZi.js +720 -0
- package/dist/index.html +3 -3
- package/package.json +3 -3
- package/dist/assets/index-Bst5rjwI.js +0 -715
|
@@ -1,715 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-BL57rgfZ.js","assets/dagview-tHPW3Rz3.js","assets/grpc-BHqklXZ4.js","assets/markdown-Yr3vTPLR.js","assets/KnowledgePage-BmY14aDt.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as cT,a as dT,b as y,j as i,d as ey,H as ty,P as ny,i as uT,B as fT,c as pT,C as mT,M as hT,e as gT}from"./dagview-tHPW3Rz3.js";import{c as vT,a as vd,G as yT,b as bT,d as xT,e as _T,f as kT,M as ST,A as mx,D as hx,W as TT,O as wT,g as jT,C as ji,h as gx,i as vx,w as NT,t as CT,p as Ec,j as ET,R as Mr,S as sy}from"./grpc-BHqklXZ4.js";import{v as AT,r as DT,t as Ac,i as RT,f as MT,M as yd,a as bd}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 Hf={exports:{}},Ir={},Vf={exports:{}},qf={};/**
|
|
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 ay;function IT(){return ay||(ay=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,Ne=L[fe],Fe=fe+1,me=L[Fe];if(0>c(Ne,J))Fe<X&&0>c(me,Ne)?(L[ce]=me,L[Fe]=J,ce=Fe):(L[ce]=Ne,L[fe]=J,ce=fe);else if(Fe<X&&0>c(me,J))L[ce]=me,L[Fe]=J,ce=Fe;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}}}})(qf)),qf}var iy;function OT(){return iy||(iy=1,Vf.exports=IT()),Vf.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 oy;function BT(){if(oy)return Ir;oy=1;var t=OT(),s=cT(),o=dT();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 Ne(e,n){X++,ce[X]=e.current,e.current=n}var Fe=ge(null),me=ge(null),_e=ge(null),ve=ge(null);function Be(e,n){switch(Ne(_e,n),Ne(me,e),Ne(Fe,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?S0(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=S0(n),e=T0(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}fe(Fe),Ne(Fe,e)}function Mt(){fe(Fe),fe(me),fe(_e)}function wn(e){e.memoizedState!==null&&Ne(ve,e);var n=Fe.current,a=T0(n,e.type);n!==a&&(Ne(me,e),Ne(Fe,a))}function oe(e){me.current===e&&(fe(Fe),fe(me)),ve.current===e&&(fe(ve),Er._currentValue=J)}var He,qt;function te(e){if(He===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);He=n&&n[1]||"",qt=-1<a.stack.indexOf(`
|
|
19
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
-
`+He+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 ms=Object.prototype.hasOwnProperty,ia=t.unstable_scheduleCallback,ts=t.unstable_cancelCallback,Za=t.unstable_shouldYield,oa=t.unstable_requestPaint,Yt=t.unstable_now,Ii=t.unstable_getCurrentPriorityLevel,ra=t.unstable_ImmediatePriority,Ka=t.unstable_UserBlockingPriority,hs=t.unstable_NormalPriority,Oi=t.unstable_LowPriority,jn=t.unstable_IdlePriority,De=t.log,Ye=t.unstable_setDisableYieldValue,Jt=null,St=null;function fn(e){if(typeof De=="function"&&Ye(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Jt,e)}catch{}}var Wt=Math.clz32?Math.clz32:zi,Bi=Math.log,Li=Math.LN2;function zi(e){return e>>>=0,e===0?32:31-(Bi(e)/Li|0)|0}var Ya=256,Ja=262144,Wa=4194304;function gs(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 Xa(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=gs(l):(_&=j,_!==0?f=gs(_):a||(a=j&~e,a!==0&&(f=gs(a))))):(j=l&~h,j!==0?f=gs(j):_!==0?f=gs(_):a||(a=l&~e,a!==0&&(f=gs(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 Qa(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=Wa;return Wa<<=1,(Wa&62914560)===0&&(Wa=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&&Je(e,l,0),h!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=h&~(_&~n))}function Je(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 Me(e,n){var a=n&-n;return a=(a&42)!==0?1:Ze(a),(a&(e.suspendedLanes|n))!==0?0:a}function Ze(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:Z0(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),$e="__reactFiber$"+jt,It="__reactProps$"+jt,vn="__reactContainer$"+jt,ei="__reactEvents$"+jt,X1="__reactListeners$"+jt,Q1="__reactHandles$"+jt,dh="__reactResources$"+jt,qo="__reactMarker$"+jt;function Md(e){delete e[$e],delete e[It],delete e[ei],delete e[X1],delete e[Q1]}function $i(e){var n=e[$e];if(n)return n;for(var a=e.parentNode;a;){if(n=a[vn]||a[$e]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=D0(e);e!==null;){if(a=e[$e])return a;e=D0(e)}return n}e=a,a=e.parentNode}return null}function Ui(e){if(e=e[$e]||e[vn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Go(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(r(33))}function Pi(e){var n=e[dh];return n||(n=e[dh]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Qt(e){e[qo]=!0}var uh=new Set,fh={};function ti(e,n){Hi(e,n),Hi(e+"Capture",n)}function Hi(e,n){for(fh[e]=n,e=0;e<n.length;e++)uh.add(n[e])}var ek=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]*$"),ph={},mh={};function tk(e){return ms.call(mh,e)?!0:ms.call(ph,e)?!1:ek.test(e)?mh[e]=!0:(ph[e]=!0,!1)}function vl(e,n,a){if(tk(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 yl(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 Es(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 $n(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hh(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function nk(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 Id(e){if(!e._valueTracker){var n=hh(e)?"checked":"value";e._valueTracker=nk(e,n,""+e[n])}}function gh(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),l="";return e&&(l=hh(e)?e.checked?"true":"false":e.value),e=l,e!==a?(n.setValue(e),!0):!1}function bl(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 sk=/[\n"\\]/g;function Un(e){return e.replace(sk,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Od(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=""+$n(n)):e.value!==""+$n(n)&&(e.value=""+$n(n)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),n!=null?Bd(e,_,$n(n)):a!=null?Bd(e,_,$n(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=""+$n(j):e.removeAttribute("name")}function vh(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)){Id(e);return}a=a!=null?""+$n(a):"",n=n!=null?""+$n(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=_),Id(e)}function Bd(e,n,a){n==="number"&&bl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Vi(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=""+$n(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 yh(e,n,a){if(n!=null&&(n=""+$n(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+$n(a):""}function bh(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=$n(n),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Id(e)}function qi(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var ak=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 xh(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||ak.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function _h(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&&xh(e,f,l)}else for(var h in n)n.hasOwnProperty(h)&&xh(e,h,n[h])}function Ld(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 ik=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"]]),ok=/^[\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 xl(e){return ok.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function As(){}var zd=null;function $d(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gi=null,Fi=null;function kh(e){var n=Ui(e);if(n&&(e=n.stateNode)){var a=e[It]||null;e:switch(e=n.stateNode,n.type){case"input":if(Od(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="'+Un(""+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));Od(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&&gh(l)}break e;case"textarea":yh(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Vi(e,!!a.multiple,n,!1)}}}var Ud=!1;function Sh(e,n,a){if(Ud)return e(n,a);Ud=!0;try{var l=e(n);return l}finally{if(Ud=!1,(Gi!==null||Fi!==null)&&(rc(),Gi&&(n=Gi,e=Fi,Fi=Gi=null,kh(n),e)))for(n=0;n<e.length;n++)kh(e[n])}}function Fo(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 Ds=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pd=!1;if(Ds)try{var Zo={};Object.defineProperty(Zo,"passive",{get:function(){Pd=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{Pd=!1}var la=null,Hd=null,_l=null;function Th(){if(_l)return _l;var e,n=Hd,a=n.length,l,f="value"in la?la.value:la.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 _l=f.slice(e,1<l?1-l:void 0)}function kl(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 Sl(){return!0}function wh(){return!1}function yn(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)?Sl:wh,this.isPropagationStopped=wh,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=Sl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Sl)},persist:function(){},isPersistent:Sl}),n}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tl=yn(ni),Ko=b({},ni,{view:0,detail:0}),rk=yn(Ko),Vd,qd,Yo,wl=b({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fd,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!==Yo&&(Yo&&e.type==="mousemove"?(Vd=e.screenX-Yo.screenX,qd=e.screenY-Yo.screenY):qd=Vd=0,Yo=e),Vd)},movementY:function(e){return"movementY"in e?e.movementY:qd}}),jh=yn(wl),lk=b({},wl,{dataTransfer:0}),ck=yn(lk),dk=b({},Ko,{relatedTarget:0}),Gd=yn(dk),uk=b({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),fk=yn(uk),pk=b({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mk=yn(pk),hk=b({},ni,{data:0}),Nh=yn(hk),gk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vk={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"},yk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bk(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=yk[e])?!!n[e]:!1}function Fd(){return bk}var xk=b({},Ko,{key:function(e){if(e.key){var n=gk[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=kl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vk[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fd,charCode:function(e){return e.type==="keypress"?kl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?kl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_k=yn(xk),kk=b({},wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ch=yn(kk),Sk=b({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fd}),Tk=yn(Sk),wk=b({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),jk=yn(wk),Nk=b({},wl,{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}),Ck=yn(Nk),Ek=b({},ni,{newState:0,oldState:0}),Ak=yn(Ek),Dk=[9,13,27,32],Zd=Ds&&"CompositionEvent"in window,Jo=null;Ds&&"documentMode"in document&&(Jo=document.documentMode);var Rk=Ds&&"TextEvent"in window&&!Jo,Eh=Ds&&(!Zd||Jo&&8<Jo&&11>=Jo),Ah=" ",Dh=!1;function Rh(e,n){switch(e){case"keyup":return Dk.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zi=!1;function Mk(e,n){switch(e){case"compositionend":return Mh(n);case"keypress":return n.which!==32?null:(Dh=!0,Ah);case"textInput":return e=n.data,e===Ah&&Dh?null:e;default:return null}}function Ik(e,n){if(Zi)return e==="compositionend"||!Zd&&Rh(e,n)?(e=Th(),_l=Hd=la=null,Zi=!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 Eh&&n.locale!=="ko"?null:n.data;default:return null}}var Ok={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 Ih(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Ok[e.type]:n==="textarea"}function Oh(e,n,a,l){Gi?Fi?Fi.push(l):Fi=[l]:Gi=l,n=mc(n,"onChange"),0<n.length&&(a=new Tl("onChange","change",null,a,l),e.push({event:a,listeners:n}))}var Wo=null,Xo=null;function Bk(e){v0(e,0)}function jl(e){var n=Go(e);if(gh(n))return e}function Bh(e,n){if(e==="change")return n}var Lh=!1;if(Ds){var Kd;if(Ds){var Yd="oninput"in document;if(!Yd){var zh=document.createElement("div");zh.setAttribute("oninput","return;"),Yd=typeof zh.oninput=="function"}Kd=Yd}else Kd=!1;Lh=Kd&&(!document.documentMode||9<document.documentMode)}function $h(){Wo&&(Wo.detachEvent("onpropertychange",Uh),Xo=Wo=null)}function Uh(e){if(e.propertyName==="value"&&jl(Xo)){var n=[];Oh(n,Xo,e,$d(e)),Sh(Bk,n)}}function Lk(e,n,a){e==="focusin"?($h(),Wo=n,Xo=a,Wo.attachEvent("onpropertychange",Uh)):e==="focusout"&&$h()}function zk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jl(Xo)}function $k(e,n){if(e==="click")return jl(n)}function Uk(e,n){if(e==="input"||e==="change")return jl(n)}function Pk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Nn=typeof Object.is=="function"?Object.is:Pk;function Qo(e,n){if(Nn(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(!ms.call(n,f)||!Nn(e[f],n[f]))return!1}return!0}function Ph(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hh(e,n){var a=Ph(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=Ph(a)}}function Vh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Vh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function qh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=bl(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=bl(e.document)}return n}function Jd(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 Hk=Ds&&"documentMode"in document&&11>=document.documentMode,Ki=null,Wd=null,er=null,Xd=!1;function Gh(e,n,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Xd||Ki==null||Ki!==bl(l)||(l=Ki,"selectionStart"in l&&Jd(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}),er&&Qo(er,l)||(er=l,l=mc(Wd,"onSelect"),0<l.length&&(n=new Tl("onSelect","select",null,n,a),e.push({event:n,listeners:l}),n.target=Ki)))}function si(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var Yi={animationend:si("Animation","AnimationEnd"),animationiteration:si("Animation","AnimationIteration"),animationstart:si("Animation","AnimationStart"),transitionrun:si("Transition","TransitionRun"),transitionstart:si("Transition","TransitionStart"),transitioncancel:si("Transition","TransitionCancel"),transitionend:si("Transition","TransitionEnd")},Qd={},Fh={};Ds&&(Fh=document.createElement("div").style,"AnimationEvent"in window||(delete Yi.animationend.animation,delete Yi.animationiteration.animation,delete Yi.animationstart.animation),"TransitionEvent"in window||delete Yi.transitionend.transition);function ai(e){if(Qd[e])return Qd[e];if(!Yi[e])return e;var n=Yi[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in Fh)return Qd[e]=n[a];return e}var Zh=ai("animationend"),Kh=ai("animationiteration"),Yh=ai("animationstart"),Vk=ai("transitionrun"),qk=ai("transitionstart"),Gk=ai("transitioncancel"),Jh=ai("transitionend"),Wh=new Map,eu="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(" ");eu.push("scrollEnd");function ns(e,n){Wh.set(e,n),ti(n,[e])}var Nl=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)},Pn=[],Ji=0,tu=0;function Cl(){for(var e=Ji,n=tu=Ji=0;n<e;){var a=Pn[n];Pn[n++]=null;var l=Pn[n];Pn[n++]=null;var f=Pn[n];Pn[n++]=null;var h=Pn[n];if(Pn[n++]=null,l!==null&&f!==null){var _=l.pending;_===null?f.next=f:(f.next=_.next,_.next=f),l.pending=f}h!==0&&Xh(a,f,h)}}function El(e,n,a,l){Pn[Ji++]=e,Pn[Ji++]=n,Pn[Ji++]=a,Pn[Ji++]=l,tu|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function nu(e,n,a,l){return El(e,n,a,l),Al(e)}function ii(e,n){return El(e,null,null,n),Al(e)}function Xh(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 Al(e){if(50<kr)throw kr=0,ff=null,Error(r(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Wi={};function Fk(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 Cn(e,n,a,l){return new Fk(e,n,a,l)}function su(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rs(e,n){var a=e.alternate;return a===null?(a=Cn(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 Qh(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 Dl(e,n,a,l,f,h){var _=0;if(l=e,typeof e=="function")su(e)&&(_=1);else if(typeof e=="string")_=WS(e,a,Fe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case U:return e=Cn(31,a,n,f),e.elementType=U,e.lanes=h,e;case w:return oi(a.children,f,h,n);case N:_=8,f|=24;break;case T:return e=Cn(12,a,n,f|2),e.elementType=T,e.lanes=h,e;case E:return e=Cn(13,a,n,f),e.elementType=E,e.lanes=h,e;case A:return e=Cn(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=Cn(_,a,n,f),n.elementType=e,n.type=l,n.lanes=h,n}function oi(e,n,a,l){return e=Cn(7,e,l,n),e.lanes=a,e}function au(e,n,a){return e=Cn(6,e,null,n),e.lanes=a,e}function eg(e){var n=Cn(18,null,null,0);return n.stateNode=e,n}function iu(e,n,a){return n=Cn(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var tg=new WeakMap;function Hn(e,n){if(typeof e=="object"&&e!==null){var a=tg.get(e);return a!==void 0?a:(n={value:e,source:n,stack:gt(n)},tg.set(e,n),n)}return{value:e,source:n,stack:gt(n)}}var Xi=[],Qi=0,Rl=null,tr=0,Vn=[],qn=0,ca=null,vs=1,ys="";function Ms(e,n){Xi[Qi++]=tr,Xi[Qi++]=Rl,Rl=e,tr=n}function ng(e,n,a){Vn[qn++]=vs,Vn[qn++]=ys,Vn[qn++]=ca,ca=e;var l=vs;e=ys;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-=_,vs=1<<32-Wt(n)+f|a<<f|l,ys=h+e}else vs=1<<h|a<<f|l,ys=e}function ou(e){e.return!==null&&(Ms(e,1),ng(e,1,0))}function ru(e){for(;e===Rl;)Rl=Xi[--Qi],Xi[Qi]=null,tr=Xi[--Qi],Xi[Qi]=null;for(;e===ca;)ca=Vn[--qn],Vn[qn]=null,ys=Vn[--qn],Vn[qn]=null,vs=Vn[--qn],Vn[qn]=null}function sg(e,n){Vn[qn++]=vs,Vn[qn++]=ys,Vn[qn++]=ca,vs=n.id,ys=n.overflow,ca=e}var nn=null,vt=null,Ve=!1,da=null,Gn=!1,lu=Error(r(519));function ua(e){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nr(Hn(n,e)),lu}function ag(e){var n=e.stateNode,a=e.type,l=e.memoizedProps;switch(n[$e]=e,n[It]=l,a){case"dialog":ze("cancel",n),ze("close",n);break;case"iframe":case"object":case"embed":ze("load",n);break;case"video":case"audio":for(a=0;a<Tr.length;a++)ze(Tr[a],n);break;case"source":ze("error",n);break;case"img":case"image":case"link":ze("error",n),ze("load",n);break;case"details":ze("toggle",n);break;case"input":ze("invalid",n),vh(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ze("invalid",n);break;case"textarea":ze("invalid",n),bh(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||_0(n.textContent,a)?(l.popover!=null&&(ze("beforetoggle",n),ze("toggle",n)),l.onScroll!=null&&ze("scroll",n),l.onScrollEnd!=null&&ze("scrollend",n),l.onClick!=null&&(n.onclick=As),n=!0):n=!1,n||ua(e,!0)}function ig(e){for(nn=e.return;nn;)switch(nn.tag){case 5:case 31:case 13:Gn=!1;return;case 27:case 3:Gn=!0;return;default:nn=nn.return}}function eo(e){if(e!==nn)return!1;if(!Ve)return ig(e),Ve=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Nf(e.type,e.memoizedProps)),a=!a),a&&vt&&ua(e),ig(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));vt=A0(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));vt=A0(e)}else n===27?(n=vt,wa(e.type)?(e=Rf,Rf=null,vt=e):vt=n):vt=nn?Zn(e.stateNode.nextSibling):null;return!0}function ri(){vt=nn=null,Ve=!1}function cu(){var e=da;return e!==null&&(kn===null?kn=e:kn.push.apply(kn,e),da=null),e}function nr(e){da===null?da=[e]:da.push(e)}var du=ge(null),li=null,Is=null;function fa(e,n,a){Ne(du,n._currentValue),n._currentValue=a}function Os(e){e._currentValue=du.current,fe(du)}function uu(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 fu(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),uu(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),uu(_,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 to(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;Nn(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(Er):e=[Er])}f=f.return}e!==null&&fu(n,e,a,l),n.flags|=262144}function Ml(e){for(e=e.firstContext;e!==null;){if(!Nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ci(e){li=e,Is=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function sn(e){return og(li,e)}function Il(e,n){return li===null&&ci(e),og(e,n)}function og(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Is===null){if(e===null)throw Error(r(308));Is=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Is=Is.next=n;return a}var Zk=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()})}},Kk=t.unstable_scheduleCallback,Yk=t.unstable_NormalPriority,Ut={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pu(){return{controller:new Zk,data:new Map,refCount:0}}function sr(e){e.refCount--,e.refCount===0&&Kk(Yk,function(){e.controller.abort()})}var ar=null,mu=0,no=0,so=null;function Jk(e,n){if(ar===null){var a=ar=[];mu=0,no=yf(),so={status:"pending",value:void 0,then:function(l){a.push(l)}}}return mu++,n.then(rg,rg),n}function rg(){if(--mu===0&&ar!==null){so!==null&&(so.status="fulfilled");var e=ar;ar=null,no=0,so=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Wk(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 lg=L.S;L.S=function(e,n){Gv=Yt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Jk(e,n),lg!==null&&lg(e,n)};var di=ge(null);function hu(){var e=di.current;return e!==null?e:pt.pooledCache}function Ol(e,n){n===null?Ne(di,di.current):Ne(di,n.pool)}function cg(){var e=hu();return e===null?null:{parent:Ut._currentValue,pool:e}}var ao=Error(r(460)),gu=Error(r(474)),Bl=Error(r(542)),Ll={then:function(){}};function dg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ug(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(As,As),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,pg(e),e;default:if(typeof n.status=="string")n.then(As,As);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,pg(e),e}throw fi=n,ao}}function ui(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(fi=a,ao):a}}var fi=null;function fg(){if(fi===null)throw Error(r(459));var e=fi;return fi=null,e}function pg(e){if(e===ao||e===Bl)throw Error(r(483))}var io=null,ir=0;function zl(e){var n=ir;return ir+=1,io===null&&(io=[]),ug(io,e,n)}function or(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function $l(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 mg(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=Rs(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=au(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&&ui(je)===O.type)?(O=f(O,q.props),or(O,q),O.return=z,O):(O=Dl(q.type,q.key,q.props,null,z.mode,ne),or(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=iu(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=oi(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=au(""+O,z.mode,q),O.return=z,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case S:return q=Dl(O.type,O.key,O.props,null,z.mode,q),or(q,O),q.return=z,q;case k:return O=iu(O,z.mode,q),O.return=z,O;case I:return O=ui(O),se(z,O,q)}if(ie(O)||W(O))return O=oi(O,z.mode,q,null),O.return=z,O;if(typeof O.then=="function")return se(z,zl(O),q);if(O.$$typeof===D)return se(z,Il(z,O),q);$l(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=ui(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,zl(q),ne);if(q.$$typeof===D)return F(z,O,Il(z,q),ne);$l(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=ui(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,zl(ne),je);if(ne.$$typeof===D)return K(z,O,q,Il(O,ne),je);$l(O,ne)}return null}function xe(z,O,q,ne){for(var je=null,Qe=null,ke=O,Oe=O=0,Pe=null;ke!==null&&Oe<q.length;Oe++){ke.index>Oe?(Pe=ke,ke=null):Pe=ke.sibling;var et=F(z,ke,q[Oe],ne);if(et===null){ke===null&&(ke=Pe);break}e&&ke&&et.alternate===null&&n(z,ke),O=h(et,O,Oe),Qe===null?je=et:Qe.sibling=et,Qe=et,ke=Pe}if(Oe===q.length)return a(z,ke),Ve&&Ms(z,Oe),je;if(ke===null){for(;Oe<q.length;Oe++)ke=se(z,q[Oe],ne),ke!==null&&(O=h(ke,O,Oe),Qe===null?je=ke:Qe.sibling=ke,Qe=ke);return Ve&&Ms(z,Oe),je}for(ke=l(ke);Oe<q.length;Oe++)Pe=K(ke,z,Oe,q[Oe],ne),Pe!==null&&(e&&Pe.alternate!==null&&ke.delete(Pe.key===null?Oe:Pe.key),O=h(Pe,O,Oe),Qe===null?je=Pe:Qe.sibling=Pe,Qe=Pe);return e&&ke.forEach(function(Aa){return n(z,Aa)}),Ve&&Ms(z,Oe),je}function Ce(z,O,q,ne){if(q==null)throw Error(r(151));for(var je=null,Qe=null,ke=O,Oe=O=0,Pe=null,et=q.next();ke!==null&&!et.done;Oe++,et=q.next()){ke.index>Oe?(Pe=ke,ke=null):Pe=ke.sibling;var Aa=F(z,ke,et.value,ne);if(Aa===null){ke===null&&(ke=Pe);break}e&&ke&&Aa.alternate===null&&n(z,ke),O=h(Aa,O,Oe),Qe===null?je=Aa:Qe.sibling=Aa,Qe=Aa,ke=Pe}if(et.done)return a(z,ke),Ve&&Ms(z,Oe),je;if(ke===null){for(;!et.done;Oe++,et=q.next())et=se(z,et.value,ne),et!==null&&(O=h(et,O,Oe),Qe===null?je=et:Qe.sibling=et,Qe=et);return Ve&&Ms(z,Oe),je}for(ke=l(ke);!et.done;Oe++,et=q.next())et=K(ke,z,Oe,et.value,ne),et!==null&&(e&&et.alternate!==null&&ke.delete(et.key===null?Oe:et.key),O=h(et,O,Oe),Qe===null?je=et:Qe.sibling=et,Qe=et);return e&&ke.forEach(function(lT){return n(z,lT)}),Ve&&Ms(z,Oe),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&&ui(je)===O.type){a(z,O.sibling),ne=f(O,q.props),or(ne,q),ne.return=z,z=ne;break e}a(z,O);break}else n(z,O);O=O.sibling}q.type===w?(ne=oi(q.props.children,z.mode,ne,q.key),ne.return=z,z=ne):(ne=Dl(q.type,q.key,q.props,null,z.mode,ne),or(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=iu(q,z.mode,ne),ne.return=z,z=ne}return _(z);case I:return q=ui(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),Ce(z,O,q,ne)}if(typeof q.then=="function")return ft(z,O,zl(q),ne);if(q.$$typeof===D)return ft(z,O,Il(z,q),ne);$l(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=au(q,z.mode,ne),ne.return=z,z=ne),_(z)):a(z,O)}return function(z,O,q,ne){try{ir=0;var je=ft(z,O,q,ne);return io=null,je}catch(ke){if(ke===ao||ke===Bl)throw ke;var Qe=Cn(29,ke,null,z.mode);return Qe.lanes=ne,Qe.return=z,Qe}finally{}}}var pi=mg(!0),hg=mg(!1),pa=!1;function vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yu(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 ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ha(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=Al(e),Xh(e,null,a),n}return El(e,l,n,a),Al(e)}function rr(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 bu(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 xu=!1;function lr(){if(xu){var e=so;if(e!==null)throw e}}function cr(e,n,a,l){xu=!1;var f=e.updateQueue;pa=!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?(Ue&F)===F:(l&F)===F){F!==0&&F===no&&(xu=!0),ee!==null&&(ee=ee.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var xe=e,Ce=j;F=n;var ft=a;switch(Ce.tag){case 1:if(xe=Ce.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=Ce.payload,F=typeof xe=="function"?xe.call(ft,se,F):xe,F==null)break e;se=b({},se,F);break e;case 2:pa=!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),xa|=_,e.lanes=_,e.memoizedState=se}}function gg(e,n){if(typeof e!="function")throw Error(r(191,e));e.call(n)}function vg(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)gg(a[e],n)}var oo=ge(null),Ul=ge(0);function yg(e,n){e=qs,Ne(Ul,e),Ne(oo,n),qs=e|n.baseLanes}function _u(){Ne(Ul,qs),Ne(oo,oo.current)}function ku(){qs=Ul.current,fe(oo),fe(Ul)}var En=ge(null),Fn=null;function ga(e){var n=e.alternate;Ne(Ot,Ot.current&1),Ne(En,e),Fn===null&&(n===null||oo.current!==null||n.memoizedState!==null)&&(Fn=e)}function Su(e){Ne(Ot,Ot.current),Ne(En,e),Fn===null&&(Fn=e)}function bg(e){e.tag===22?(Ne(Ot,Ot.current),Ne(En,e),Fn===null&&(Fn=e)):va()}function va(){Ne(Ot,Ot.current),Ne(En,En.current)}function An(e){fe(En),Fn===e&&(Fn=null),fe(Ot)}var Ot=ge(0);function Pl(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Af(a)||Df(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 Bs=0,Ie=null,dt=null,Pt=null,Hl=!1,ro=!1,mi=!1,Vl=0,dr=0,lo=null,Xk=0;function Ct(){throw Error(r(321))}function Tu(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!Nn(e[a],n[a]))return!1;return!0}function wu(e,n,a,l,f,h){return Bs=h,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,L.H=e===null||e.memoizedState===null?nv:Uu,mi=!1,h=a(l,f),mi=!1,ro&&(h=_g(n,a,l,f)),xg(e),h}function xg(e){L.H=pr;var n=dt!==null&&dt.next!==null;if(Bs=0,Pt=dt=Ie=null,Hl=!1,dr=0,lo=null,n)throw Error(r(300));e===null||Ht||(e=e.dependencies,e!==null&&Ml(e)&&(Ht=!0))}function _g(e,n,a,l){Ie=e;var f=0;do{if(ro&&(lo=null),dr=0,ro=!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=sv,h=n(a,l)}while(ro);return h}function Qk(){var e=L.H,n=e.useState()[0];return n=typeof n.then=="function"?ur(n):n,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Ie.flags|=1024),n}function ju(){var e=Vl!==0;return Vl=0,e}function Nu(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function Cu(e){if(Hl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Hl=!1}Bs=0,Pt=dt=Ie=null,ro=!1,dr=Vl=0,lo=null}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?Ie.memoizedState=Pt=e:Pt=Pt.next=e,Pt}function Bt(){if(dt===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var n=Pt===null?Ie.memoizedState:Pt.next;if(n!==null)Pt=n,dt=e;else{if(e===null)throw Ie.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?Ie.memoizedState=Pt=e:Pt=Pt.next=e}return Pt}function ql(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ur(e){var n=dr;return dr+=1,lo===null&&(lo=[]),e=ug(lo,e,n),n=Ie,(Pt===null?n.memoizedState:Pt.next)===null&&(n=n.alternate,L.H=n===null||n.memoizedState===null?nv:Uu),e}function Gl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ur(e);if(e.$$typeof===D)return sn(e)}throw Error(r(438,String(e)))}function Eu(e){var n=null,a=Ie.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var l=Ie.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=ql(),Ie.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 Ls(e,n){return typeof n=="function"?n(e):n}function Fl(e){var n=Bt();return Au(n,dt,e)}function Au(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?(Ue&se)===se:(Bs&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===no&&(ee=!0);else if((Bs&F)===F){G=G.next,F===no&&(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,Ie.lanes|=F,xa|=F;se=G.action,mi&&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,Ie.lanes|=se,xa|=se;G=G.next}while(G!==null&&G!==n);if(R===null?_=h:R.next=j,!Nn(h,e.memoizedState)&&(Ht=!0,ee&&(a=so,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 Du(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);Nn(h,n.memoizedState)||(Ht=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,l]}function kg(e,n,a){var l=Ie,f=Bt(),h=Ve;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var _=!Nn((dt||f).memoizedState,a);if(_&&(f.memoizedState=a,Ht=!0),f=f.queue,Iu(wg.bind(null,l,f,e),[e]),f.getSnapshot!==n||_||Pt!==null&&Pt.memoizedState.tag&1){if(l.flags|=2048,co(9,{destroy:void 0},Tg.bind(null,l,f,a,n),null),pt===null)throw Error(r(349));h||(Bs&127)!==0||Sg(l,n,a)}return a}function Sg(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Ie.updateQueue,n===null?(n=ql(),Ie.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function Tg(e,n,a,l){n.value=a,n.getSnapshot=l,jg(n)&&Ng(e)}function wg(e,n,a){return a(function(){jg(n)&&Ng(e)})}function jg(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!Nn(e,a)}catch{return!0}}function Ng(e){var n=ii(e,2);n!==null&&Sn(n,e,2)}function Ru(e){var n=pn();if(typeof e=="function"){var a=e;if(e=a(),mi){fn(!0);try{a()}finally{fn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:e},n}function Cg(e,n,a,l){return e.baseState=a,Au(e,dt,typeof l=="function"?l:Ls)}function eS(e,n,a,l,f){if(Yl(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,Eg(n,h)):(h.next=a.next,n.pending=a.next=h)}}function Eg(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),Ag(e,n,j)}catch(G){Mu(e,n,G)}finally{h!==null&&_.types!==null&&(h.types=_.types),L.T=h}}else try{h=a(f,l),Ag(e,n,h)}catch(G){Mu(e,n,G)}}function Ag(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Dg(e,n,l)},function(l){return Mu(e,n,l)}):Dg(e,n,a)}function Dg(e,n,a){n.status="fulfilled",n.value=a,Rg(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,Eg(e,a)))}function Mu(e,n,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=a,Rg(n),n=n.next;while(n!==l)}e.action=null}function Rg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Mg(e,n){return n}function Ig(e,n){if(Ve){var a=pt.formState;if(a!==null){e:{var l=Ie;if(Ve){if(vt){t:{for(var f=vt,h=Gn;f.nodeType!==8;){if(!h){f=null;break t}if(f=Zn(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){vt=Zn(f.nextSibling),l=f.data==="F!";break e}}ua(l)}l=!1}l&&(n=a[0])}}return a=pn(),a.memoizedState=a.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mg,lastRenderedState:n},a.queue=l,a=Qg.bind(null,Ie,l),l.dispatch=a,l=Ru(!1),h=$u.bind(null,Ie,!1,l.queue),l=pn(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,a=eS.bind(null,Ie,f,h,a),f.dispatch=a,l.memoizedState=e,[n,a,!1]}function Og(e){var n=Bt();return Bg(n,dt,e)}function Bg(e,n,a){if(n=Au(e,n,Mg)[0],e=Fl(Ls)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=ur(n)}catch(_){throw _===ao?Bl:_}else l=n;n=Bt();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(Ie.flags|=2048,co(9,{destroy:void 0},tS.bind(null,f,a),null)),[l,h,e]}function tS(e,n){e.action=n}function Lg(e){var n=Bt(),a=dt;if(a!==null)return Bg(n,a,e);Bt(),n=n.memoizedState,a=Bt();var l=a.queue.dispatch;return a.memoizedState=e,[n,l,!1]}function co(e,n,a,l){return e={tag:e,create:a,deps:l,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=ql(),Ie.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 zg(){return Bt().memoizedState}function Zl(e,n,a,l){var f=pn();Ie.flags|=e,f.memoizedState=co(1|n,{destroy:void 0},a,l===void 0?null:l)}function Kl(e,n,a,l){var f=Bt();l=l===void 0?null:l;var h=f.memoizedState.inst;dt!==null&&l!==null&&Tu(l,dt.memoizedState.deps)?f.memoizedState=co(n,h,a,l):(Ie.flags|=e,f.memoizedState=co(1|n,h,a,l))}function $g(e,n){Zl(8390656,8,e,n)}function Iu(e,n){Kl(2048,8,e,n)}function nS(e){Ie.flags|=4;var n=Ie.updateQueue;if(n===null)n=ql(),Ie.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function Ug(e){var n=Bt().memoizedState;return nS({ref:n,nextImpl:e}),function(){if((st&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Pg(e,n){return Kl(4,2,e,n)}function Hg(e,n){return Kl(4,4,e,n)}function Vg(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 qg(e,n,a){a=a!=null?a.concat([e]):null,Kl(4,4,Vg.bind(null,n,e),a)}function Ou(){}function Gg(e,n){var a=Bt();n=n===void 0?null:n;var l=a.memoizedState;return n!==null&&Tu(n,l[1])?l[0]:(a.memoizedState=[e,n],e)}function Fg(e,n){var a=Bt();n=n===void 0?null:n;var l=a.memoizedState;if(n!==null&&Tu(n,l[1]))return l[0];if(l=e(),mi){fn(!0);try{e()}finally{fn(!1)}}return a.memoizedState=[l,n],l}function Bu(e,n,a){return a===void 0||(Bs&1073741824)!==0&&(Ue&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Zv(),Ie.lanes|=e,xa|=e,a)}function Zg(e,n,a,l){return Nn(a,n)?a:oo.current!==null?(e=Bu(e,a,l),Nn(e,n)||(Ht=!0),e):(Bs&42)===0||(Bs&1073741824)!==0&&(Ue&261930)===0?(Ht=!0,e.memoizedState=a):(e=Zv(),Ie.lanes|=e,xa|=e,n)}function Kg(e,n,a,l,f){var h=Z.p;Z.p=h!==0&&8>h?h:8;var _=L.T,j={};L.T=j,$u(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=Wk(R,l);fr(e,n,ee,Mn(e))}else fr(e,n,l,Mn(e))}catch(se){fr(e,n,{then:function(){},status:"rejected",reason:se},Mn())}finally{Z.p=h,_!==null&&j.types!==null&&(_.types=j.types),L.T=_}}function sS(){}function Lu(e,n,a,l){if(e.tag!==5)throw Error(r(476));var f=Yg(e).queue;Kg(e,f,n,J,a===null?sS:function(){return Jg(e),a(l)})}function Yg(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:Ls,lastRenderedState:J},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Jg(e){var n=Yg(e);n.next===null&&(n=e.alternate.memoizedState),fr(e,n.next.queue,{},Mn())}function zu(){return sn(Er)}function Wg(){return Bt().memoizedState}function Xg(){return Bt().memoizedState}function aS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=Mn();e=ma(a);var l=ha(n,e,a);l!==null&&(Sn(l,n,a),rr(l,n,a)),n={cache:pu()},e.payload=n;return}n=n.return}}function iS(e,n,a){var l=Mn();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Yl(e)?ev(n,a):(a=nu(e,n,a,l),a!==null&&(Sn(a,e,l),tv(a,n,l)))}function Qg(e,n,a){var l=Mn();fr(e,n,a,l)}function fr(e,n,a,l){var f={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Yl(e))ev(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,Nn(j,_))return El(e,n,f,0),pt===null&&Cl(),!1}catch{}finally{}if(a=nu(e,n,f,l),a!==null)return Sn(a,e,l),tv(a,n,l),!0}return!1}function $u(e,n,a,l){if(l={lane:2,revertLane:yf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Yl(e)){if(n)throw Error(r(479))}else n=nu(e,a,l,2),n!==null&&Sn(n,e,2)}function Yl(e){var n=e.alternate;return e===Ie||n!==null&&n===Ie}function ev(e,n){ro=Hl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function tv(e,n,a){if((a&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,a|=l,n.lanes=a,Te(e,a)}}var pr={readContext:sn,use:Gl,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};pr.useEffectEvent=Ct;var nv={readContext:sn,use:Gl,useCallback:function(e,n){return pn().memoizedState=[e,n===void 0?null:n],e},useContext:sn,useEffect:$g,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Zl(4194308,4,Vg.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Zl(4194308,4,e,n)},useInsertionEffect:function(e,n){Zl(4,2,e,n)},useMemo:function(e,n){var a=pn();n=n===void 0?null:n;var l=e();if(mi){fn(!0);try{e()}finally{fn(!1)}}return a.memoizedState=[l,n],l},useReducer:function(e,n,a){var l=pn();if(a!==void 0){var f=a(n);if(mi){fn(!0);try{a(n)}finally{fn(!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=iS.bind(null,Ie,e),[l.memoizedState,e]},useRef:function(e){var n=pn();return e={current:e},n.memoizedState=e},useState:function(e){e=Ru(e);var n=e.queue,a=Qg.bind(null,Ie,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Ou,useDeferredValue:function(e,n){var a=pn();return Bu(a,e,n)},useTransition:function(){var e=Ru(!1);return e=Kg.bind(null,Ie,e.queue,!0,!1),pn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var l=Ie,f=pn();if(Ve){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),pt===null)throw Error(r(349));(Ue&127)!==0||Sg(l,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,$g(wg.bind(null,l,h,e),[e]),l.flags|=2048,co(9,{destroy:void 0},Tg.bind(null,l,h,a,n),null),a},useId:function(){var e=pn(),n=pt.identifierPrefix;if(Ve){var a=ys,l=vs;a=(l&~(1<<32-Wt(l)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Vl++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=Xk++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:zu,useFormState:Ig,useActionState:Ig,useOptimistic:function(e){var n=pn();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=$u.bind(null,Ie,!0,a),a.dispatch=n,[e,n]},useMemoCache:Eu,useCacheRefresh:function(){return pn().memoizedState=aS.bind(null,Ie)},useEffectEvent:function(e){var n=pn(),a={impl:e};return n.memoizedState=a,function(){if((st&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Uu={readContext:sn,use:Gl,useCallback:Gg,useContext:sn,useEffect:Iu,useImperativeHandle:qg,useInsertionEffect:Pg,useLayoutEffect:Hg,useMemo:Fg,useReducer:Fl,useRef:zg,useState:function(){return Fl(Ls)},useDebugValue:Ou,useDeferredValue:function(e,n){var a=Bt();return Zg(a,dt.memoizedState,e,n)},useTransition:function(){var e=Fl(Ls)[0],n=Bt().memoizedState;return[typeof e=="boolean"?e:ur(e),n]},useSyncExternalStore:kg,useId:Wg,useHostTransitionStatus:zu,useFormState:Og,useActionState:Og,useOptimistic:function(e,n){var a=Bt();return Cg(a,dt,e,n)},useMemoCache:Eu,useCacheRefresh:Xg};Uu.useEffectEvent=Ug;var sv={readContext:sn,use:Gl,useCallback:Gg,useContext:sn,useEffect:Iu,useImperativeHandle:qg,useInsertionEffect:Pg,useLayoutEffect:Hg,useMemo:Fg,useReducer:Du,useRef:zg,useState:function(){return Du(Ls)},useDebugValue:Ou,useDeferredValue:function(e,n){var a=Bt();return dt===null?Bu(a,e,n):Zg(a,dt.memoizedState,e,n)},useTransition:function(){var e=Du(Ls)[0],n=Bt().memoizedState;return[typeof e=="boolean"?e:ur(e),n]},useSyncExternalStore:kg,useId:Wg,useHostTransitionStatus:zu,useFormState:Lg,useActionState:Lg,useOptimistic:function(e,n){var a=Bt();return dt!==null?Cg(a,dt,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Eu,useCacheRefresh:Xg};sv.useEffectEvent=Ug;function Pu(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 Hu={enqueueSetState:function(e,n,a){e=e._reactInternals;var l=Mn(),f=ma(l);f.payload=n,a!=null&&(f.callback=a),n=ha(e,f,l),n!==null&&(Sn(n,e,l),rr(n,e,l))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var l=Mn(),f=ma(l);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ha(e,f,l),n!==null&&(Sn(n,e,l),rr(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=Mn(),l=ma(a);l.tag=2,n!=null&&(l.callback=n),n=ha(e,l,a),n!==null&&(Sn(n,e,a),rr(n,e,a))}};function av(e,n,a,l,f,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,_):n.prototype&&n.prototype.isPureReactComponent?!Qo(a,l)||!Qo(f,h):!0}function iv(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&&Hu.enqueueReplaceState(n,n.state,null)}function hi(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 ov(e){Nl(e)}function rv(e){console.error(e)}function lv(e){Nl(e)}function Jl(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function cv(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 Vu(e,n,a){return a=ma(a),a.tag=3,a.payload={element:null},a.callback=function(){Jl(e,n)},a}function dv(e){return e=ma(e),e.tag=3,e}function uv(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(){cv(n,a,l)}}var _=a.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){cv(n,a,l),typeof f!="function"&&(_a===null?_a=new Set([this]):_a.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function oS(e,n,a,l,f){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=a.alternate,n!==null&&to(n,a,f,!0),a=En.current,a!==null){switch(a.tag){case 31:case 13:return Fn===null?lc():a.alternate===null&&Et===0&&(Et=3),a.flags&=-257,a.flags|=65536,a.lanes=f,l===Ll?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([l]):n.add(l),hf(e,l,f)),!1;case 22:return a.flags|=65536,l===Ll?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)),hf(e,l,f)),!1}throw Error(r(435,a.tag))}return hf(e,l,f),lc(),!1}if(Ve)return n=En.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==lu&&(e=Error(r(422),{cause:l}),nr(Hn(e,a)))):(l!==lu&&(n=Error(r(423),{cause:l}),nr(Hn(n,a))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=Hn(l,a),f=Vu(e.stateNode,l,f),bu(e,f),Et!==4&&(Et=2)),!1;var h=Error(r(520),{cause:l});if(h=Hn(h,a),_r===null?_r=[h]:_r.push(h),Et!==4&&(Et=2),n===null)return!0;l=Hn(l,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=f&-f,a.lanes|=e,e=Vu(a.stateNode,l,e),bu(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"&&(_a===null||!_a.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=dv(f),uv(f,e,a,l),bu(a,f),!1}a=a.return}while(a!==null);return!1}var qu=Error(r(461)),Ht=!1;function an(e,n,a,l){n.child=e===null?hg(n,null,a,l):pi(n,e.child,a,l)}function fv(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 ci(n),l=wu(e,n,a,_,h,f),j=ju(),e!==null&&!Ht?(Nu(e,n,f),zs(e,n,f)):(Ve&&j&&ou(n),n.flags|=1,an(e,n,l,f),n.child)}function pv(e,n,a,l,f){if(e===null){var h=a.type;return typeof h=="function"&&!su(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,mv(e,n,h,l,f)):(e=Dl(a.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!Xu(e,f)){var _=h.memoizedProps;if(a=a.compare,a=a!==null?a:Qo,a(_,l)&&e.ref===n.ref)return zs(e,n,f)}return n.flags|=1,e=Rs(h,l),e.ref=n.ref,e.return=n,n.child=e}function mv(e,n,a,l,f){if(e!==null){var h=e.memoizedProps;if(Qo(h,l)&&e.ref===n.ref)if(Ht=!1,n.pendingProps=l=h,Xu(e,f))(e.flags&131072)!==0&&(Ht=!0);else return n.lanes=e.lanes,zs(e,n,f)}return Gu(e,n,a,l,f)}function hv(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 gv(e,n,h,a,l)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ol(n,h!==null?h.cachePool:null),h!==null?yg(n,h):_u(),bg(n);else return l=n.lanes=536870912,gv(e,n,h!==null?h.baseLanes|a:a,a,l)}else h!==null?(Ol(n,h.cachePool),yg(n,h),va(),n.memoizedState=null):(e!==null&&Ol(n,null),_u(),va());return an(e,n,f,a),n.child}function mr(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function gv(e,n,a,l,f){var h=hu();return h=h===null?null:{parent:Ut._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},e!==null&&Ol(n,null),_u(),bg(n),e!==null&&to(e,n,l,!0),n.childLanes=f,null}function Wl(e,n){return n=Ql({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function vv(e,n,a){return pi(n,e.child,null,a),e=Wl(n,n.pendingProps),e.flags|=2,An(n),n.memoizedState=null,e}function rS(e,n,a){var l=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ve){if(l.mode==="hidden")return e=Wl(n,l),n.lanes=536870912,mr(null,e);if(Su(n),(e=vt)?(e=E0(e,Gn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ca!==null?{id:vs,overflow:ys}:null,retryLane:536870912,hydrationErrors:null},a=eg(e),a.return=n,n.child=a,nn=n,vt=null)):e=null,e===null)throw ua(n);return n.lanes=536870912,null}return Wl(n,l)}var h=e.memoizedState;if(h!==null){var _=h.dehydrated;if(Su(n),f)if(n.flags&256)n.flags&=-257,n=vv(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||to(e,n,a,!1),f=(a&e.childLanes)!==0,Ht||f){if(l=pt,l!==null&&(_=Me(l,a),_!==0&&_!==h.retryLane))throw h.retryLane=_,ii(e,_),Sn(l,e,_),qu;lc(),n=vv(e,n,a)}else e=h.treeContext,vt=Zn(_.nextSibling),nn=n,Ve=!0,da=null,Gn=!1,e!==null&&sg(n,e),n=Wl(n,l),n.flags|=4096;return n}return e=Rs(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Xl(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 Gu(e,n,a,l,f){return ci(n),a=wu(e,n,a,l,void 0,f),l=ju(),e!==null&&!Ht?(Nu(e,n,f),zs(e,n,f)):(Ve&&l&&ou(n),n.flags|=1,an(e,n,a,f),n.child)}function yv(e,n,a,l,f,h){return ci(n),n.updateQueue=null,a=_g(n,l,a,f),xg(e),l=ju(),e!==null&&!Ht?(Nu(e,n,h),zs(e,n,h)):(Ve&&l&&ou(n),n.flags|=1,an(e,n,a,h),n.child)}function bv(e,n,a,l,f){if(ci(n),n.stateNode===null){var h=Wi,_=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=Hu,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=l,h.state=n.memoizedState,h.refs={},vu(n),_=a.contextType,h.context=typeof _=="object"&&_!==null?sn(_):Wi,h.state=n.memoizedState,_=a.getDerivedStateFromProps,typeof _=="function"&&(Pu(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&&Hu.enqueueReplaceState(h,h.state,null),cr(n,l,h,f),lr(),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=hi(a,j);h.props=R;var G=h.context,ee=a.contextType;_=Wi,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!==_)&&iv(n,h,l,_),pa=!1;var F=n.memoizedState;h.state=F,cr(n,l,h,f),lr(),G=n.memoizedState,j||F!==G||pa?(typeof se=="function"&&(Pu(n,a,se,l),G=n.memoizedState),(R=pa||av(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,yu(e,n),_=n.memoizedProps,ee=hi(a,_),h.props=ee,se=n.pendingProps,F=h.context,G=a.contextType,R=Wi,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)&&iv(n,h,l,R),pa=!1,F=n.memoizedState,h.state=F,cr(n,l,h,f),lr();var K=n.memoizedState;_!==se||F!==K||pa||e!==null&&e.dependencies!==null&&Ml(e.dependencies)?(typeof j=="function"&&(Pu(n,a,j,l),K=n.memoizedState),(ee=pa||av(n,a,ee,l,F,K,R)||e!==null&&e.dependencies!==null&&Ml(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,Xl(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=pi(n,e.child,null,f),n.child=pi(n,null,a,f)):an(e,n,a,f),n.memoizedState=h.state,e=n.child):e=zs(e,n,f),e}function xv(e,n,a,l){return ri(),n.flags|=256,an(e,n,a,l),n.child}var Fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zu(e){return{baseLanes:e,cachePool:cg()}}function Ku(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=Rn),e}function _v(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(Ve){if(f?ga(n):va(),(e=vt)?(e=E0(e,Gn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ca!==null?{id:vs,overflow:ys}:null,retryLane:536870912,hydrationErrors:null},a=eg(e),a.return=n,n.child=a,nn=n,vt=null)):e=null,e===null)throw ua(n);return Df(e)?n.lanes=32:n.lanes=536870912,null}var j=l.children;return l=l.fallback,f?(va(),f=n.mode,j=Ql({mode:"hidden",children:j},f),l=oi(l,f,a,null),j.return=n,l.return=n,j.sibling=l,n.child=j,l=n.child,l.memoizedState=Zu(a),l.childLanes=Ku(e,_,a),n.memoizedState=Fu,mr(null,l)):(ga(n),Yu(n,j))}var R=e.memoizedState;if(R!==null&&(j=R.dehydrated,j!==null)){if(h)n.flags&256?(ga(n),n.flags&=-257,n=Ju(e,n,a)):n.memoizedState!==null?(va(),n.child=e.child,n.flags|=128,n=null):(va(),j=l.fallback,f=n.mode,l=Ql({mode:"visible",children:l.children},f),j=oi(j,f,a,null),j.flags|=2,l.return=n,j.return=n,l.sibling=j,n.child=l,pi(n,e.child,null,a),l=n.child,l.memoizedState=Zu(a),l.childLanes=Ku(e,_,a),n.memoizedState=Fu,n=mr(null,l));else if(ga(n),Df(j)){if(_=j.nextSibling&&j.nextSibling.dataset,_)var G=_.dgst;_=G,l=Error(r(419)),l.stack="",l.digest=_,nr({value:l,source:null,stack:null}),n=Ju(e,n,a)}else if(Ht||to(e,n,a,!1),_=(a&e.childLanes)!==0,Ht||_){if(_=pt,_!==null&&(l=Me(_,a),l!==0&&l!==R.retryLane))throw R.retryLane=l,ii(e,l),Sn(_,e,l),qu;Af(j)||lc(),n=Ju(e,n,a)}else Af(j)?(n.flags|=192,n.child=e.child,n=null):(e=R.treeContext,vt=Zn(j.nextSibling),nn=n,Ve=!0,da=null,Gn=!1,e!==null&&sg(n,e),n=Yu(n,l.children),n.flags|=4096);return n}return f?(va(),j=l.fallback,f=n.mode,R=e.child,G=R.sibling,l=Rs(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,G!==null?j=Rs(G,j):(j=oi(j,f,a,null),j.flags|=2),j.return=n,l.return=n,l.sibling=j,n.child=l,mr(null,l),l=n.child,j=e.child.memoizedState,j===null?j=Zu(a):(f=j.cachePool,f!==null?(R=Ut._currentValue,f=f.parent!==R?{parent:R,pool:R}:f):f=cg(),j={baseLanes:j.baseLanes|a,cachePool:f}),l.memoizedState=j,l.childLanes=Ku(e,_,a),n.memoizedState=Fu,mr(e.child,l)):(ga(n),a=e.child,e=a.sibling,a=Rs(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 Yu(e,n){return n=Ql({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Ql(e,n){return e=Cn(22,e,null,n),e.lanes=0,e}function Ju(e,n,a){return pi(n,e.child,null,a),e=Yu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function kv(e,n,a){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),uu(e.return,n,a)}function Wu(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 Sv(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,Ne(Ot,_),an(e,n,l,a),l=Ve?tr:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kv(e,a,n);else if(e.tag===19)kv(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&&Pl(e)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),Wu(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&&Pl(e)===null){n.child=f;break}e=f.sibling,f.sibling=a,a=f,f=e}Wu(n,!0,a,null,h,l);break;case"together":Wu(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function zs(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),xa|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(to(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=Rs(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Rs(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Xu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Ml(e)))}function lS(e,n,a){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),fa(n,Ut,e.memoizedState.cache),ri();break;case 27:case 5:wn(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:fa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Su(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(ga(n),n.flags|=128,null):(a&n.child.childLanes)!==0?_v(e,n,a):(ga(n),e=zs(e,n,a),e!==null?e.sibling:null);ga(n);break;case 19:var f=(e.flags&128)!==0;if(l=(a&n.childLanes)!==0,l||(to(e,n,a,!1),l=(a&n.childLanes)!==0),f){if(l)return Sv(e,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ne(Ot,Ot.current),l)break;return null;case 22:return n.lanes=0,hv(e,n,a,n.pendingProps);case 24:fa(n,Ut,e.memoizedState.cache)}return zs(e,n,a)}function Tv(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)Ht=!0;else{if(!Xu(e,a)&&(n.flags&128)===0)return Ht=!1,lS(e,n,a);Ht=(e.flags&131072)!==0}else Ht=!1,Ve&&(n.flags&1048576)!==0&&ng(n,tr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=ui(n.elementType),n.type=e,typeof e=="function")su(e)?(l=hi(e,l),n.tag=1,n=bv(null,n,e,l,a)):(n.tag=0,n=Gu(null,n,e,l,a));else{if(e!=null){var f=e.$$typeof;if(f===B){n.tag=11,n=fv(null,n,e,l,a);break e}else if(f===P){n.tag=14,n=pv(null,n,e,l,a);break e}}throw n=H(e)||e,Error(r(306,n,""))}}return n;case 0:return Gu(e,n,n.type,n.pendingProps,a);case 1:return l=n.type,f=hi(l,n.pendingProps),bv(e,n,l,f,a);case 3:e:{if(Be(n,n.stateNode.containerInfo),e===null)throw Error(r(387));l=n.pendingProps;var h=n.memoizedState;f=h.element,yu(e,n),cr(n,l,null,a);var _=n.memoizedState;if(l=_.cache,fa(n,Ut,l),l!==h.cache&&fu(n,[Ut],a,!0),lr(),l=_.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:_.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=xv(e,n,l,a);break e}else if(l!==f){f=Hn(Error(r(424)),n),nr(f),n=xv(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=Zn(e.firstChild),nn=n,Ve=!0,da=null,Gn=!0,a=hg(n,null,l,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(ri(),l===f){n=zs(e,n,a);break e}an(e,n,l,a)}n=n.child}return n;case 26:return Xl(e,n),e===null?(a=O0(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ve||(a=n.type,e=n.pendingProps,l=hc(_e.current).createElement(a),l[$e]=n,l[It]=e,on(l,a,e),Qt(l),n.stateNode=l):n.memoizedState=O0(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return wn(n),e===null&&Ve&&(l=n.stateNode=R0(n.type,n.pendingProps,_e.current),nn=n,Gn=!0,f=vt,wa(n.type)?(Rf=f,vt=Zn(l.firstChild)):vt=f),an(e,n,n.pendingProps.children,a),Xl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ve&&((f=l=vt)&&(l=zS(l,n.type,n.pendingProps,Gn),l!==null?(n.stateNode=l,nn=n,vt=Zn(l.firstChild),Gn=!1,f=!0):f=!1),f||ua(n)),wn(n),f=n.type,h=n.pendingProps,_=e!==null?e.memoizedProps:null,l=h.children,Nf(f,h)?l=null:_!==null&&Nf(f,_)&&(n.flags|=32),n.memoizedState!==null&&(f=wu(e,n,Qk,null,null,a),Er._currentValue=f),Xl(e,n),an(e,n,l,a),n.child;case 6:return e===null&&Ve&&((e=a=vt)&&(a=$S(a,n.pendingProps,Gn),a!==null?(n.stateNode=a,nn=n,vt=null,e=!0):e=!1),e||ua(n)),null;case 13:return _v(e,n,a);case 4:return Be(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=pi(n,null,l,a):an(e,n,l,a),n.child;case 11:return fv(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,fa(n,n.type,l.value),an(e,n,l.children,a),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,ci(n),f=sn(f),l=l(f),n.flags|=1,an(e,n,l,a),n.child;case 14:return pv(e,n,n.type,n.pendingProps,a);case 15:return mv(e,n,n.type,n.pendingProps,a);case 19:return Sv(e,n,a);case 31:return rS(e,n,a);case 22:return hv(e,n,a,n.pendingProps);case 24:return ci(n),l=sn(Ut),e===null?(f=hu(),f===null&&(f=pt,h=pu(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:l,cache:f},vu(n),fa(n,Ut,f)):((e.lanes&a)!==0&&(yu(e,n),cr(n,null,null,a),lr()),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),fa(n,Ut,l)):(l=h.cache,fa(n,Ut,l),l!==f.cache&&fu(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 $s(e){e.flags|=4}function Qu(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(Wv())e.flags|=8192;else throw fi=Ll,gu}else e.flags&=-16777217}function wv(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!U0(n))if(Wv())e.flags|=8192;else throw fi=Ll,gu}function ec(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?ae():536870912,e.lanes|=n,mo|=n)}function hr(e,n){if(!Ve)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 cS(e,n,a){var l=n.pendingProps;switch(ru(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),Os(Ut),Mt(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(eo(n)?$s(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,cu())),yt(n),null;case 26:var f=n.type,h=n.memoizedState;return e===null?($s(n),h!==null?(yt(n),wv(n,h)):(yt(n),Qu(n,f,null,l,a))):h?h!==e.memoizedState?($s(n),yt(n),wv(n,h)):(yt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&$s(n),yt(n),Qu(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&&$s(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return yt(n),null}e=Fe.current,eo(n)?ag(n):(e=R0(f,l,a),n.stateNode=e,$s(n))}return yt(n),null;case 5:if(oe(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&$s(n);else{if(!l){if(n.stateNode===null)throw Error(r(166));return yt(n),null}if(h=Fe.current,eo(n))ag(n);else{var _=hc(_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[$e]=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&&$s(n)}}return yt(n),Qu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&$s(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(r(166));if(e=_e.current,eo(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[$e]=n,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||_0(e.nodeValue,a)),e||ua(n,!0)}else e=hc(e).createTextNode(l),e[$e]=n,n.stateNode=e}return yt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(l=eo(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[$e]=n}else ri(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;yt(n),e=!1}else a=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(An(n),n):(An(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=eo(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[$e]=n}else ri(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;yt(n),f=!1}else f=cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(An(n),n):(An(n),null)}return An(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),ec(n,n.updateQueue),yt(n),null);case 4:return Mt(),e===null&&kf(n.stateNode.containerInfo),yt(n),null;case 10:return Os(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)hr(l,!1);else{if(Et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Pl(e),h!==null){for(n.flags|=128,hr(l,!1),e=h.updateQueue,n.updateQueue=e,ec(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Qh(a,e),a=a.sibling;return Ne(Ot,Ot.current&1|2),Ve&&Ms(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&Yt()>ic&&(n.flags|=128,f=!0,hr(l,!1),n.lanes=4194304)}else{if(!f)if(e=Pl(h),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,ec(n,e),hr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!h.alternate&&!Ve)return yt(n),null}else 2*Yt()-l.renderingStartTime>ic&&a!==536870912&&(n.flags|=128,f=!0,hr(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,Ne(Ot,f?a&1|2:a&1),Ve&&Ms(n,l.treeForkCount),e):(yt(n),null);case 22:case 23:return An(n),ku(),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&&ec(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(di),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Os(Ut),yt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function dS(e,n){switch(ru(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Os(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(An(n),n.alternate===null)throw Error(r(340));ri()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(An(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ri()}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 Os(n.type),null;case 22:case 23:return An(n),ku(),e!==null&&fe(di),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Os(Ut),null;case 25:return null;default:return null}}function jv(e,n){switch(ru(n),n.tag){case 3:Os(Ut),Mt();break;case 26:case 27:case 5:oe(n);break;case 4:Mt();break;case 31:n.memoizedState!==null&&An(n);break;case 13:An(n);break;case 19:fe(Ot);break;case 10:Os(n.type);break;case 22:case 23:An(n),ku(),e!==null&&fe(di);break;case 24:Os(Ut)}}function gr(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 ya(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 Nv(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{vg(n,a)}catch(l){rt(e,e.return,l)}}}function Cv(e,n,a){a.props=hi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){rt(e,n,l)}}function vr(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 bs(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 Ev(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 ef(e,n,a){try{var l=e.stateNode;RS(l,e.type,a,n),l[It]=n}catch(f){rt(e,e.return,f)}}function Av(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wa(e.type)||e.tag===4}function tf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Av(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&&wa(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 nf(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=As));else if(l!==4&&(l===27&&wa(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(nf(e,n,a),e=e.sibling;e!==null;)nf(e,n,a),e=e.sibling}function tc(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&&wa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(tc(e,n,a),e=e.sibling;e!==null;)tc(e,n,a),e=e.sibling}function Dv(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[$e]=e,n[It]=a}catch(h){rt(e,e.return,h)}}var Us=!1,Vt=!1,sf=!1,Rv=typeof WeakSet=="function"?WeakSet:Set,en=null;function uS(e,n){if(e=e.containerInfo,wf=kc,e=qh(e),Jd(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(jf={focusedElem:e,selectionRange:a},kc=!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=hi(a.type,f);e=l.getSnapshotBeforeUpdate(xe,h),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){rt(a,a.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)Ef(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ef(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 Mv(e,n,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Hs(e,a),l&4&&gr(5,a);break;case 1:if(Hs(e,a),l&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(_){rt(a,a.return,_)}else{var f=hi(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(_){rt(a,a.return,_)}}l&64&&Nv(a),l&512&&vr(a,a.return);break;case 3:if(Hs(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{vg(e,n)}catch(_){rt(a,a.return,_)}}break;case 27:n===null&&l&4&&Dv(a);case 26:case 5:Hs(e,a),n===null&&l&4&&Ev(a),l&512&&vr(a,a.return);break;case 12:Hs(e,a);break;case 31:Hs(e,a),l&4&&Bv(e,a);break;case 13:Hs(e,a),l&4&&Lv(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=xS.bind(null,a),US(e,a))));break;case 22:if(l=a.memoizedState!==null||Us,!l){n=n!==null&&n.memoizedState!==null||Vt,f=Us;var h=Vt;Us=l,(Vt=n)&&!h?Vs(e,a,(a.subtreeFlags&8772)!==0):Hs(e,a),Us=f,Vt=h}break;case 30:break;default:Hs(e,a)}}function Iv(e){var n=e.alternate;n!==null&&(e.alternate=null,Iv(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Md(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,bn=!1;function Ps(e,n,a){for(a=a.child;a!==null;)Ov(e,n,a),a=a.sibling}function Ov(e,n,a){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Jt,a)}catch{}switch(a.tag){case 26:Vt||bs(a,n),Ps(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Vt||bs(a,n);var l=Tt,f=bn;wa(a.type)&&(Tt=a.stateNode,bn=!1),Ps(e,n,a),jr(a.stateNode),Tt=l,bn=f;break;case 5:Vt||bs(a,n);case 6:if(l=Tt,f=bn,Tt=null,Ps(e,n,a),Tt=l,bn=f,Tt!==null)if(bn)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&&(bn?(e=Tt,N0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),ko(e)):N0(Tt,a.stateNode));break;case 4:l=Tt,f=bn,Tt=a.stateNode.containerInfo,bn=!0,Ps(e,n,a),Tt=l,bn=f;break;case 0:case 11:case 14:case 15:ya(2,a,n),Vt||ya(4,a,n),Ps(e,n,a);break;case 1:Vt||(bs(a,n),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Cv(a,n,l)),Ps(e,n,a);break;case 21:Ps(e,n,a);break;case 22:Vt=(l=Vt)||a.memoizedState!==null,Ps(e,n,a),Vt=l;break;default:Ps(e,n,a)}}function Bv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ko(e)}catch(a){rt(n,n.return,a)}}}function Lv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ko(e)}catch(a){rt(n,n.return,a)}}function fS(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Rv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Rv),n;default:throw Error(r(435,e.tag))}}function nc(e,n){var a=fS(e);n.forEach(function(l){if(!a.has(l)){a.add(l);var f=_S.bind(null,e,l);l.then(f,f)}})}function xn(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(wa(j.type)){Tt=j.stateNode,bn=!1;break e}break;case 5:Tt=j.stateNode,bn=!1;break e;case 3:case 4:Tt=j.stateNode.containerInfo,bn=!0;break e}j=j.return}if(Tt===null)throw Error(r(160));Ov(h,_,f),Tt=null,bn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)zv(n,e),n=n.sibling}var ss=null;function zv(e,n){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xn(n,e),_n(e),l&4&&(ya(3,e,e.return),gr(3,e),ya(5,e,e.return));break;case 1:xn(n,e),_n(e),l&512&&(Vt||a===null||bs(a,a.return)),l&64&&Us&&(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=ss;if(xn(n,e),_n(e),l&512&&(Vt||a===null||bs(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[qo]||h[$e]||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[$e]=e,Qt(h),l=h;break e;case"link":var _=z0("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(_=z0("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[$e]=e,Qt(h),l=h}e.stateNode=l}else $0(f,e.type,e.stateNode);else e.stateNode=L0(f,l,e.memoizedProps);else h!==l?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,l===null?$0(f,e.type,e.stateNode):L0(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ef(e,e.memoizedProps,a.memoizedProps)}break;case 27:xn(n,e),_n(e),l&512&&(Vt||a===null||bs(a,a.return)),a!==null&&l&4&&ef(e,e.memoizedProps,a.memoizedProps);break;case 5:if(xn(n,e),_n(e),l&512&&(Vt||a===null||bs(a,a.return)),e.flags&32){f=e.stateNode;try{qi(f,"")}catch(xe){rt(e,e.return,xe)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,ef(e,f,a!==null?a.memoizedProps:f)),l&1024&&(sf=!0);break;case 6:if(xn(n,e),_n(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(yc=null,f=ss,ss=gc(n.containerInfo),xn(n,e),ss=f,_n(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ko(n.containerInfo)}catch(xe){rt(e,e.return,xe)}sf&&(sf=!1,$v(e));break;case 4:l=ss,ss=gc(e.stateNode.containerInfo),xn(n,e),_n(e),ss=l;break;case 12:xn(n,e),_n(e);break;case 31:xn(n,e),_n(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,nc(e,l)));break;case 13:xn(n,e),_n(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ac=Yt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,nc(e,l)));break;case 22:f=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,G=Us,ee=Vt;if(Us=G||f,Vt=ee||R,xn(n,e),Vt=ee,Us=G,_n(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||R||Us||Vt||gi(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?C0(K,!0):C0(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,nc(e,a))));break;case 19:xn(n,e),_n(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,nc(e,l)));break;case 30:break;case 21:break;default:xn(n,e),_n(e)}}function _n(e){var n=e.flags;if(n&2){try{for(var a,l=e.return;l!==null;){if(Av(l)){a=l;break}l=l.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=tf(e);tc(e,h,f);break;case 5:var _=a.stateNode;a.flags&32&&(qi(_,""),a.flags&=-33);var j=tf(e);tc(e,j,_);break;case 3:case 4:var R=a.stateNode.containerInfo,G=tf(e);nf(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 $v(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;$v(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Hs(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Mv(e,n.alternate,n),n=n.sibling}function gi(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ya(4,n,n.return),gi(n);break;case 1:bs(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Cv(n,n.return,a),gi(n);break;case 27:jr(n.stateNode);case 26:case 5:bs(n,n.return),gi(n);break;case 22:n.memoizedState===null&&gi(n);break;case 30:gi(n);break;default:gi(n)}e=e.sibling}}function Vs(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:Vs(f,h,a),gr(4,h);break;case 1:if(Vs(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++)gg(R[f],j)}catch(G){rt(l,l.return,G)}}a&&_&64&&Nv(h),vr(h,h.return);break;case 27:Dv(h);case 26:case 5:Vs(f,h,a),a&&l===null&&_&4&&Ev(h),vr(h,h.return);break;case 12:Vs(f,h,a);break;case 31:Vs(f,h,a),a&&_&4&&Bv(f,h);break;case 13:Vs(f,h,a),a&&_&4&&Lv(f,h);break;case 22:h.memoizedState===null&&Vs(f,h,a),vr(h,h.return);break;case 30:break;default:Vs(f,h,a)}n=n.sibling}}function af(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&&sr(a))}function of(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&sr(e))}function as(e,n,a,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Uv(e,n,a,l),n=n.sibling}function Uv(e,n,a,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:as(e,n,a,l),f&2048&&gr(9,n);break;case 1:as(e,n,a,l);break;case 3:as(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&&sr(e)));break;case 12:if(f&2048){as(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 as(e,n,a,l);break;case 31:as(e,n,a,l);break;case 13:as(e,n,a,l);break;case 23:break;case 22:h=n.stateNode,_=n.alternate,n.memoizedState!==null?h._visibility&2?as(e,n,a,l):yr(e,n):h._visibility&2?as(e,n,a,l):(h._visibility|=2,uo(e,n,a,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&af(_,n);break;case 24:as(e,n,a,l),f&2048&&of(n.alternate,n);break;default:as(e,n,a,l)}}function uo(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:uo(h,_,j,R,f),gr(8,_);break;case 23:break;case 22:var ee=_.stateNode;_.memoizedState!==null?ee._visibility&2?uo(h,_,j,R,f):yr(h,_):(ee._visibility|=2,uo(h,_,j,R,f)),f&&G&2048&&af(_.alternate,_);break;case 24:uo(h,_,j,R,f),f&&G&2048&&of(_.alternate,_);break;default:uo(h,_,j,R,f)}n=n.sibling}}function yr(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:yr(a,l),f&2048&&af(l.alternate,l);break;case 24:yr(a,l),f&2048&&of(l.alternate,l);break;default:yr(a,l)}n=n.sibling}}var br=8192;function fo(e,n,a){if(e.subtreeFlags&br)for(e=e.child;e!==null;)Pv(e,n,a),e=e.sibling}function Pv(e,n,a){switch(e.tag){case 26:fo(e,n,a),e.flags&br&&e.memoizedState!==null&&XS(a,ss,e.memoizedState,e.memoizedProps);break;case 5:fo(e,n,a);break;case 3:case 4:var l=ss;ss=gc(e.stateNode.containerInfo),fo(e,n,a),ss=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=br,br=16777216,fo(e,n,a),br=l):fo(e,n,a));break;default:fo(e,n,a)}}function Hv(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 xr(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,qv(l,e)}Hv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vv(e),e=e.sibling}function Vv(e){switch(e.tag){case 0:case 11:case 15:xr(e),e.flags&2048&&ya(9,e,e.return);break;case 3:xr(e);break;case 12:xr(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,sc(e)):xr(e);break;default:xr(e)}}function sc(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,qv(l,e)}Hv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ya(8,n,n.return),sc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,sc(n));break;default:sc(n)}e=e.sibling}}function qv(e,n){for(;en!==null;){var a=en;switch(a.tag){case 0:case 11:case 15:ya(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:sr(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(Iv(l),l===a){en=null;break e}if(f!==null){f.return=h,en=f;break e}en=h}}}var pS={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}},mS=typeof WeakMap=="function"?WeakMap:Map,st=0,pt=null,Le=null,Ue=0,ot=0,Dn=null,ba=!1,po=!1,rf=!1,qs=0,Et=0,xa=0,vi=0,lf=0,Rn=0,mo=0,_r=null,kn=null,cf=!1,ac=0,Gv=0,ic=1/0,oc=null,_a=null,Gt=0,ka=null,ho=null,Gs=0,df=0,uf=null,Fv=null,kr=0,ff=null;function Mn(){return(st&2)!==0&&Ue!==0?Ue&-Ue:L.T!==null?yf():Xe()}function Zv(){if(Rn===0)if((Ue&536870912)===0||Ve){var e=Ja;Ja<<=1,(Ja&3932160)===0&&(Ja=262144),Rn=e}else Rn=536870912;return e=En.current,e!==null&&(e.flags|=32),Rn}function Sn(e,n,a){(e===pt&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&(go(e,0),Sa(e,Ue,Rn,!1)),de(e,a),((st&2)===0||e!==pt)&&(e===pt&&((st&2)===0&&(vi|=a),Et===4&&Sa(e,Ue,Rn,!1)),xs(e))}function Kv(e,n,a){if((st&6)!==0)throw Error(r(327));var l=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Qa(e,n),f=l?vS(e,n):mf(e,n,!0),h=l;do{if(f===0){po&&!l&&Sa(e,n,0,!1);break}else{if(a=e.current.alternate,h&&!hS(a)){f=mf(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=_r;var R=j.current.memoizedState.isDehydrated;if(R&&(go(j,_).flags|=256),_=mf(j,_,!1),_!==2){if(rf&&!R){j.errorRecoveryDisabledLanes|=h,vi|=h,f=4;break e}h=kn,kn=f,h!==null&&(kn===null?kn=h:kn.push.apply(kn,h))}f=_}if(h=!1,f!==2)continue}}if(f===1){go(e,0),Sa(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:Sa(l,n,Rn,!ba);break e;case 2:kn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=ac+300-Yt(),10<f)){if(Sa(l,n,Rn,!ba),Xa(l,0,!0)!==0)break e;Gs=n,l.timeoutHandle=w0(Yv.bind(null,l,a,kn,oc,cf,n,Rn,vi,mo,ba,h,"Throttled",-0,0),f);break e}Yv(l,a,kn,oc,cf,n,Rn,vi,mo,ba,h,null,-0,0)}}break}while(!0);xs(e)}function Yv(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:As},Pv(n,h,se);var xe=(h&62914560)===h?ac-Yt():(h&4194048)===h?Gv-Yt():0;if(xe=QS(se,xe),xe!==null){Gs=h,e.cancelPendingCommit=xe(s0.bind(null,e,n,h,a,l,f,_,j,R,ee,se,null,F,K)),Sa(e,h,_,!G);return}}s0(e,n,h,a,l,f,_,j,R)}function hS(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(!Nn(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 Sa(e,n,a,l){n&=~lf,n&=~vi,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&&Je(e,a,n)}function rc(){return(st&6)===0?(Sr(0),!1):!0}function pf(){if(Le!==null){if(ot===0)var e=Le.return;else e=Le,Is=li=null,Cu(e),io=null,ir=0,e=Le;for(;e!==null;)jv(e.alternate,e),e=e.return;Le=null}}function go(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,OS(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Gs=0,pf(),pt=e,Le=a=Rs(e.current,null),Ue=n,ot=0,Dn=null,ba=!1,po=Qa(e,n),rf=!1,mo=Rn=lf=vi=xa=Et=0,kn=_r=null,cf=!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 qs=n,Cl(),a}function Jv(e,n){Ie=null,L.H=pr,n===ao||n===Bl?(n=fg(),ot=3):n===gu?(n=fg(),ot=4):ot=n===qu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Dn=n,Le===null&&(Et=1,Jl(e,Hn(n,e.current)))}function Wv(){var e=En.current;return e===null?!0:(Ue&4194048)===Ue?Fn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?e===Fn:!1}function Xv(){var e=L.H;return L.H=pr,e===null?pr:e}function Qv(){var e=L.A;return L.A=pS,e}function lc(){Et=4,ba||(Ue&4194048)!==Ue&&En.current!==null||(po=!0),(xa&134217727)===0&&(vi&134217727)===0||pt===null||Sa(pt,Ue,Rn,!1)}function mf(e,n,a){var l=st;st|=2;var f=Xv(),h=Qv();(pt!==e||Ue!==n)&&(oc=null,go(e,n)),n=!1;var _=Et;e:do try{if(ot!==0&&Le!==null){var j=Le,R=Dn;switch(ot){case 8:pf(),_=6;break e;case 3:case 2:case 9:case 6:En.current===null&&(n=!0);var G=ot;if(ot=0,Dn=null,vo(e,j,R,G),a&&po){_=0;break e}break;default:G=ot,ot=0,Dn=null,vo(e,j,R,G)}}gS(),_=Et;break}catch(ee){Jv(e,ee)}while(!0);return n&&e.shellSuspendCounter++,Is=li=null,st=l,L.H=f,L.A=h,Le===null&&(pt=null,Ue=0,Cl()),_}function gS(){for(;Le!==null;)e0(Le)}function vS(e,n){var a=st;st|=2;var l=Xv(),f=Qv();pt!==e||Ue!==n?(oc=null,ic=Yt()+500,go(e,n)):po=Qa(e,n);e:do try{if(ot!==0&&Le!==null){n=Le;var h=Dn;t:switch(ot){case 1:ot=0,Dn=null,vo(e,n,h,1);break;case 2:case 9:if(dg(h)){ot=0,Dn=null,t0(n);break}n=function(){ot!==2&&ot!==9||pt!==e||(ot=7),xs(e)},h.then(n,n);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:dg(h)?(ot=0,Dn=null,t0(n)):(ot=0,Dn=null,vo(e,n,h,7));break;case 5:var _=null;switch(Le.tag){case 26:_=Le.memoizedState;case 5:case 27:var j=Le;if(_?U0(_):j.stateNode.complete){ot=0,Dn=null;var R=j.sibling;if(R!==null)Le=R;else{var G=j.return;G!==null?(Le=G,cc(G)):Le=null}break t}}ot=0,Dn=null,vo(e,n,h,5);break;case 6:ot=0,Dn=null,vo(e,n,h,6);break;case 8:pf(),Et=6;break e;default:throw Error(r(462))}}yS();break}catch(ee){Jv(e,ee)}while(!0);return Is=li=null,L.H=l,L.A=f,st=a,Le!==null?0:(pt=null,Ue=0,Cl(),Et)}function yS(){for(;Le!==null&&!Za();)e0(Le)}function e0(e){var n=Tv(e.alternate,e,qs);e.memoizedProps=e.pendingProps,n===null?cc(e):Le=n}function t0(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=yv(a,n,n.pendingProps,n.type,void 0,Ue);break;case 11:n=yv(a,n,n.pendingProps,n.type.render,n.ref,Ue);break;case 5:Cu(n);default:jv(a,n),n=Le=Qh(n,qs),n=Tv(a,n,qs)}e.memoizedProps=e.pendingProps,n===null?cc(e):Le=n}function vo(e,n,a,l){Is=li=null,Cu(n),io=null,ir=0;var f=n.return;try{if(oS(e,f,n,a,Ue)){Et=1,Jl(e,Hn(a,e.current)),Le=null;return}}catch(h){if(f!==null)throw Le=f,h;Et=1,Jl(e,Hn(a,e.current)),Le=null;return}n.flags&32768?(Ve||l===1?e=!0:po||(Ue&536870912)!==0?e=!1:(ba=e=!0,(l===2||l===9||l===3||l===6)&&(l=En.current,l!==null&&l.tag===13&&(l.flags|=16384))),n0(n,e)):cc(n)}function cc(e){var n=e;do{if((n.flags&32768)!==0){n0(n,ba);return}e=n.return;var a=cS(n.alternate,n,qs);if(a!==null){Le=a;return}if(n=n.sibling,n!==null){Le=n;return}Le=n=e}while(n!==null);Et===0&&(Et=5)}function n0(e,n){do{var a=dS(e.alternate,e);if(a!==null){a.flags&=32767,Le=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){Le=e;return}Le=e=a}while(e!==null);Et=6,Le=null}function s0(e,n,a,l,f,h,_,j,R){e.cancelPendingCommit=null;do dc();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|=tu,ye(e,a,h,_,j,R),e===pt&&(Le=pt=null,Ue=0),ho=n,ka=e,Gs=a,df=h,uf=f,Fv=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,kS(hs,function(){return l0(),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{uS(e,n,a)}finally{st=_,Z.p=f,L.T=l}}Gt=1,a0(),i0(),o0()}}function a0(){if(Gt===1){Gt=0;var e=ka,n=ho,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{zv(n,e);var h=jf,_=qh(e.containerInfo),j=h.focusedElem,R=h.selectionRange;if(_!==j&&j&&j.ownerDocument&&Vh(j.ownerDocument.documentElement,j)){if(R!==null&&Jd(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,Ce=Math.min(R.start,xe),ft=R.end===void 0?Ce:Math.min(R.end,xe);!K.extend&&Ce>ft&&(_=ft,ft=Ce,Ce=_);var z=Hh(j,Ce),O=Hh(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(),Ce>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}}kc=!!wf,jf=wf=null}finally{st=f,Z.p=l,L.T=a}}e.current=n,Gt=2}}function i0(){if(Gt===2){Gt=0;var e=ka,n=ho,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{Mv(e,n.alternate,n)}finally{st=f,Z.p=l,L.T=a}}Gt=3}}function o0(){if(Gt===4||Gt===3){Gt=0,oa();var e=ka,n=ho,a=Gs,l=Fv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Gt=5:(Gt=0,ho=ka=null,r0(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(_a=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}}(Gs&3)!==0&&dc(),xs(e),f=e.pendingLanes,(a&261930)!==0&&(f&42)!==0?e===ff?kr++:(kr=0,ff=e):kr=0,Sr(0)}}function r0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,sr(n)))}function dc(){return a0(),i0(),o0(),l0()}function l0(){if(Gt!==5)return!1;var e=ka,n=df;df=0;var a=ct(Gs),l=L.T,f=Z.p;try{Z.p=32>a?32:a,L.T=null,a=uf,uf=null;var h=ka,_=Gs;if(Gt=0,ho=ka=null,Gs=0,(st&6)!==0)throw Error(r(331));var j=st;if(st|=4,Vv(h.current),Uv(h,h.current,_,a),st=j,Sr(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Jt,h)}catch{}return!0}finally{Z.p=f,L.T=l,r0(e,n)}}function c0(e,n,a){n=Hn(a,n),n=Vu(e.stateNode,n,2),e=ha(e,n,2),e!==null&&(de(e,2),xs(e))}function rt(e,n,a){if(e.tag===3)c0(e,e,a);else for(;n!==null;){if(n.tag===3){c0(n,e,a);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(_a===null||!_a.has(l))){e=Hn(a,e),a=dv(2),l=ha(n,a,2),l!==null&&(uv(a,l,n,e),de(l,2),xs(l));break}}n=n.return}}function hf(e,n,a){var l=e.pingCache;if(l===null){l=e.pingCache=new mS;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)||(rf=!0,f.add(a),e=bS.bind(null,e,n,a),n.then(e,e))}function bS(e,n,a){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,pt===e&&(Ue&a)===a&&(Et===4||Et===3&&(Ue&62914560)===Ue&&300>Yt()-ac?(st&2)===0&&go(e,0):lf|=a,mo===Ue&&(mo=0)),xs(e)}function d0(e,n){n===0&&(n=ae()),e=ii(e,n),e!==null&&(de(e,n),xs(e))}function xS(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),d0(e,a)}function _S(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),d0(e,a)}function kS(e,n){return ia(e,n)}var uc=null,yo=null,gf=!1,fc=!1,vf=!1,Ta=0;function xs(e){e!==yo&&e.next===null&&(yo===null?uc=yo=e:yo=yo.next=e),fc=!0,gf||(gf=!0,TS())}function Sr(e,n){if(!vf&&fc){vf=!0;do for(var a=!1,l=uc;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,m0(l,h))}else h=Ue,h=Xa(l,l===pt?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||Qa(l,h)||(a=!0,m0(l,h));l=l.next}while(a);vf=!1}}function SS(){u0()}function u0(){fc=gf=!1;var e=0;Ta!==0&&IS()&&(e=Ta);for(var n=Yt(),a=null,l=uc;l!==null;){var f=l.next,h=f0(l,n);h===0?(l.next=null,a===null?uc=f:a.next=f,f===null&&(yo=a)):(a=l,(e!==0||(h&3)!==0)&&(fc=!0)),l=f}Gt!==0&&Gt!==5||Sr(e),Ta!==0&&(Ta=0)}function f0(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=Ue,a=Xa(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&&ts(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Qa(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(l!==null&&ts(l),ct(a)){case 2:case 8:a=Ka;break;case 32:a=hs;break;case 268435456:a=jn;break;default:a=hs}return l=p0.bind(null,e),a=ia(a,l),e.callbackPriority=n,e.callbackNode=a,n}return l!==null&&l!==null&&ts(l),e.callbackPriority=2,e.callbackNode=null,2}function p0(e,n){if(Gt!==0&&Gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(dc()&&e.callbackNode!==a)return null;var l=Ue;return l=Xa(e,e===pt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Kv(e,l,n),f0(e,Yt()),e.callbackNode!=null&&e.callbackNode===a?p0.bind(null,e):null)}function m0(e,n){if(dc())return null;Kv(e,n,!0)}function TS(){BS(function(){(st&6)!==0?ia(ra,SS):u0()})}function yf(){if(Ta===0){var e=no;e===0&&(e=Ya,Ya<<=1,(Ya&261888)===0&&(Ya=256)),Ta=e}return Ta}function h0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:xl(""+e)}function g0(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 wS(e,n,a,l,f){if(n==="submit"&&a&&a.stateNode===f){var h=h0((f[It]||null).action),_=l.submitter;_&&(n=(n=_[It]||null)?h0(n.formAction):_.getAttribute("formAction"),n!==null&&(h=n,_=null));var j=new Tl("action","action",null,l,f);e.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ta!==0){var R=_?g0(f,_):new FormData(f);Lu(a,{pending:!0,data:R,method:f.method,action:h},null,R)}}else typeof h=="function"&&(j.preventDefault(),R=_?g0(f,_):new FormData(f),Lu(a,{pending:!0,data:R,method:f.method,action:h},h,R))},currentTarget:f}]})}}for(var bf=0;bf<eu.length;bf++){var xf=eu[bf],jS=xf.toLowerCase(),NS=xf[0].toUpperCase()+xf.slice(1);ns(jS,"on"+NS)}ns(Zh,"onAnimationEnd"),ns(Kh,"onAnimationIteration"),ns(Yh,"onAnimationStart"),ns("dblclick","onDoubleClick"),ns("focusin","onFocus"),ns("focusout","onBlur"),ns(Vk,"onTransitionRun"),ns(qk,"onTransitionStart"),ns(Gk,"onTransitionCancel"),ns(Jh,"onTransitionEnd"),Hi("onMouseEnter",["mouseout","mouseover"]),Hi("onMouseLeave",["mouseout","mouseover"]),Hi("onPointerEnter",["pointerout","pointerover"]),Hi("onPointerLeave",["pointerout","pointerover"]),ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ti("onBeforeInput",["compositionend","keypress","textInput","paste"]),ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tr="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(" "),CS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tr));function v0(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){Nl(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){Nl(ee)}f.currentTarget=null,h=R}}}}function ze(e,n){var a=n[ei];a===void 0&&(a=n[ei]=new Set);var l=e+"__bubble";a.has(l)||(y0(n,e,2,!1),a.add(l))}function _f(e,n,a){var l=0;n&&(l|=4),y0(a,e,l,n)}var pc="_reactListening"+Math.random().toString(36).slice(2);function kf(e){if(!e[pc]){e[pc]=!0,uh.forEach(function(a){a!=="selectionchange"&&(CS.has(a)||_f(a,!1,e),_f(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[pc]||(n[pc]=!0,_f("selectionchange",!1,n))}}function y0(e,n,a,l){switch(Z0(n)){case 2:var f=nT;break;case 8:f=sT;break;default:f=Lf}a=f.bind(null,n,a,e),f=void 0,!Pd||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 Sf(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(_=$i(j),_===null)return;if(R=_.tag,R===5||R===6||R===26||R===27){l=h=_;continue e}j=j.parentNode}}l=l.return}Sh(function(){var G=h,ee=$d(a),se=[];e:{var F=Wh.get(e);if(F!==void 0){var K=Tl,xe=e;switch(e){case"keypress":if(kl(a)===0)break e;case"keydown":case"keyup":K=_k;break;case"focusin":xe="focus",K=Gd;break;case"focusout":xe="blur",K=Gd;break;case"beforeblur":case"afterblur":K=Gd;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=jh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=ck;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=Tk;break;case Zh:case Kh:case Yh:K=fk;break;case Jh:K=jk;break;case"scroll":case"scrollend":K=rk;break;case"wheel":K=Ck;break;case"copy":case"cut":case"paste":K=mk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Ch;break;case"toggle":case"beforetoggle":K=Ak}var Ce=(n&4)!==0,ft=!Ce&&(e==="scroll"||e==="scrollend"),z=Ce?F!==null?F+"Capture":null:F;Ce=[];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=Fo(O,z),ne!=null&&Ce.push(wr(O,ne,q))),ft)break;O=O.return}0<Ce.length&&(F=new K(F,xe,null,a,ee),se.push({event:F,listeners:Ce}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",F&&a!==zd&&(xe=a.relatedTarget||a.fromElement)&&($i(xe)||xe[vn]))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?$i(xe):null,xe!==null&&(ft=d(xe),Ce=xe.tag,xe!==ft||Ce!==5&&Ce!==27&&Ce!==6)&&(xe=null)):(K=null,xe=G),K!==xe)){if(Ce=jh,ne="onMouseLeave",z="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Ch,ne="onPointerLeave",z="onPointerEnter",O="pointer"),ft=K==null?F:Go(K),q=xe==null?F:Go(xe),F=new Ce(ne,O+"leave",K,a,ee),F.target=ft,F.relatedTarget=q,ne=null,$i(ee)===G&&(Ce=new Ce(z,O+"enter",xe,a,ee),Ce.target=q,Ce.relatedTarget=ft,ne=Ce),ft=ne,K&&xe)t:{for(Ce=ES,z=K,O=xe,q=0,ne=z;ne;ne=Ce(ne))q++;ne=0;for(var je=O;je;je=Ce(je))ne++;for(;0<q-ne;)z=Ce(z),q--;for(;0<ne-q;)O=Ce(O),ne--;for(;q--;){if(z===O||O!==null&&z===O.alternate){Ce=z;break t}z=Ce(z),O=Ce(O)}Ce=null}else Ce=null;K!==null&&b0(se,F,K,Ce,!1),xe!==null&&ft!==null&&b0(se,ft,xe,Ce,!0)}}e:{if(F=G?Go(G):window,K=F.nodeName&&F.nodeName.toLowerCase(),K==="select"||K==="input"&&F.type==="file")var Qe=Bh;else if(Ih(F))if(Lh)Qe=Uk;else{Qe=zk;var ke=Lk}else K=F.nodeName,!K||K.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?G&&Ld(G.elementType)&&(Qe=Bh):Qe=$k;if(Qe&&(Qe=Qe(e,G))){Oh(se,Qe,a,ee);break e}ke&&ke(e,F,G),e==="focusout"&&G&&F.type==="number"&&G.memoizedProps.value!=null&&Bd(F,"number",F.value)}switch(ke=G?Go(G):window,e){case"focusin":(Ih(ke)||ke.contentEditable==="true")&&(Ki=ke,Wd=G,er=null);break;case"focusout":er=Wd=Ki=null;break;case"mousedown":Xd=!0;break;case"contextmenu":case"mouseup":case"dragend":Xd=!1,Gh(se,a,ee);break;case"selectionchange":if(Hk)break;case"keydown":case"keyup":Gh(se,a,ee)}var Oe;if(Zd)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else Zi?Rh(e,a)&&(Pe="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Pe="onCompositionStart");Pe&&(Eh&&a.locale!=="ko"&&(Zi||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&Zi&&(Oe=Th()):(la=ee,Hd="value"in la?la.value:la.textContent,Zi=!0)),ke=mc(G,Pe),0<ke.length&&(Pe=new Nh(Pe,e,null,a,ee),se.push({event:Pe,listeners:ke}),Oe?Pe.data=Oe:(Oe=Mh(a),Oe!==null&&(Pe.data=Oe)))),(Oe=Rk?Mk(e,a):Ik(e,a))&&(Pe=mc(G,"onBeforeInput"),0<Pe.length&&(ke=new Nh("onBeforeInput","beforeinput",null,a,ee),se.push({event:ke,listeners:Pe}),ke.data=Oe)),wS(se,e,G,a,ee)}v0(se,n)})}function wr(e,n,a){return{instance:e,listener:n,currentTarget:a}}function mc(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=Fo(e,a),f!=null&&l.unshift(wr(e,f,h)),f=Fo(e,n),f!=null&&l.push(wr(e,f,h))),e.tag===3)return l;e=e.return}return[]}function ES(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function b0(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=Fo(a,h),G!=null&&_.unshift(wr(a,G,R))):f||(G=Fo(a,h),G!=null&&_.push(wr(a,G,R)))),a=a.return}_.length!==0&&e.push({event:n,listeners:_})}var AS=/\r\n?/g,DS=/\u0000|\uFFFD/g;function x0(e){return(typeof e=="string"?e:""+e).replace(AS,`
|
|
26
|
-
`).replace(DS,"")}function _0(e,n){return n=x0(n),x0(e)===n}function ut(e,n,a,l,f,h){switch(a){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||qi(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&qi(e,""+l);break;case"className":yl(e,"class",l);break;case"tabIndex":yl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":yl(e,a,l);break;case"style":_h(e,l,h);break;case"data":if(n!=="object"){yl(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=xl(""+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=xl(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=As);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(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=xl(""+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":ze("beforetoggle",e),ze("toggle",e),vl(e,"popover",l);break;case"xlinkActuate":Es(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Es(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Es(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Es(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Es(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Es(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Es(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Es(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Es(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":vl(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=ik.get(a)||a,vl(e,a,l))}}function Tf(e,n,a,l,f,h){switch(a){case"style":_h(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"?qi(e,l):(typeof l=="number"||typeof l=="bigint")&&qi(e,""+l);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=As);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fh.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,""):vl(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":ze("error",e),ze("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":ze("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)}}vh(e,h,j,R,G,_,f,!1);return;case"select":ze("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?Vi(e,!!l,n,!1):a!=null&&Vi(e,!!l,a,!0);return;case"textarea":ze("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)}bh(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":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(l=0;l<Tr.length;l++)ze(Tr[l],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(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(Ld(n)){for(ee in a)a.hasOwnProperty(ee)&&(l=a[ee],l!==void 0&&Tf(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 RS(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)}}Od(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?Vi(e,!!a,F,!1):!!l!=!!a&&(n!=null?Vi(e,!!a,n,!0):Vi(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)}yh(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 Ce in a)F=a[Ce],a.hasOwnProperty(Ce)&&F!=null&&!l.hasOwnProperty(Ce)&&ut(e,n,Ce,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(Ld(n)){for(var ft in a)F=a[ft],a.hasOwnProperty(ft)&&F!==void 0&&!l.hasOwnProperty(ft)&&Tf(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||Tf(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 k0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function MS(){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&&k0(_)){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&&k0(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 wf=null,jf=null;function hc(e){return e.nodeType===9?e:e.ownerDocument}function S0(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 T0(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 Nf(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 Cf=null;function IS(){var e=window.event;return e&&e.type==="popstate"?e===Cf?!1:(Cf=e,!0):(Cf=null,!1)}var w0=typeof setTimeout=="function"?setTimeout:void 0,OS=typeof clearTimeout=="function"?clearTimeout:void 0,j0=typeof Promise=="function"?Promise:void 0,BS=typeof queueMicrotask=="function"?queueMicrotask:typeof j0<"u"?function(e){return j0.resolve(null).then(e).catch(LS)}:w0;function LS(e){setTimeout(function(){throw e})}function wa(e){return e==="head"}function N0(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),ko(n);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")jr(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,jr(a);for(var h=a.firstChild;h;){var _=h.nextSibling,j=h.nodeName;h[qo]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=_}}else a==="body"&&jr(e.ownerDocument.body);a=f}while(a);ko(n)}function C0(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 Ef(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":Ef(a),Md(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function zS(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[qo])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=Zn(e.nextSibling),e===null)break}return null}function $S(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Zn(e.nextSibling),e===null))return null;return e}function E0(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zn(e.nextSibling),e===null))return null;return e}function Af(e){return e.data==="$?"||e.data==="$~"}function Df(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function US(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 Zn(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 Rf=null;function A0(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return Zn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function D0(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 R0(e,n,a){switch(n=hc(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 jr(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Md(e)}var Kn=new Map,M0=new Set;function gc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Fs=Z.d;Z.d={f:PS,r:HS,D:VS,C:qS,L:GS,m:FS,X:KS,S:ZS,M:YS};function PS(){var e=Fs.f(),n=rc();return e||n}function HS(e){var n=Ui(e);n!==null&&n.tag===5&&n.type==="form"?Jg(n):Fs.r(e)}var bo=typeof document>"u"?null:document;function I0(e,n,a){var l=bo;if(l&&typeof n=="string"&&n){var f=Un(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),M0.has(f)||(M0.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 VS(e){Fs.D(e),I0("dns-prefetch",e,null)}function qS(e,n){Fs.C(e,n),I0("preconnect",e,n)}function GS(e,n,a){Fs.L(e,n,a);var l=bo;if(l&&e&&n){var f='link[rel="preload"][as="'+Un(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Un(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Un(a.imageSizes)+'"]')):f+='[href="'+Un(e)+'"]';var h=f;switch(n){case"style":h=xo(e);break;case"script":h=_o(e)}Kn.has(h)||(e=b({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),Kn.set(h,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(Nr(h))||n==="script"&&l.querySelector(Cr(h))||(n=l.createElement("link"),on(n,"link",e),Qt(n),l.head.appendChild(n)))}}function FS(e,n){Fs.m(e,n);var a=bo;if(a&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Un(l)+'"][href="'+Un(e)+'"]',h=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=_o(e)}if(!Kn.has(h)&&(e=b({rel:"modulepreload",href:e},n),Kn.set(h,e),a.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Cr(h)))return}l=a.createElement("link"),on(l,"link",e),Qt(l),a.head.appendChild(l)}}}function ZS(e,n,a){Fs.S(e,n,a);var l=bo;if(l&&e){var f=Pi(l).hoistableStyles,h=xo(e);n=n||"default";var _=f.get(h);if(!_){var j={loading:0,preload:null};if(_=l.querySelector(Nr(h)))j.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":n},a),(a=Kn.get(h))&&Mf(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,vc(_,n,l)}_={type:"stylesheet",instance:_,count:1,state:j},f.set(h,_)}}}function KS(e,n){Fs.X(e,n);var a=bo;if(a&&e){var l=Pi(a).hoistableScripts,f=_o(e),h=l.get(f);h||(h=a.querySelector(Cr(f)),h||(e=b({src:e,async:!0},n),(n=Kn.get(f))&&If(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 YS(e,n){Fs.M(e,n);var a=bo;if(a&&e){var l=Pi(a).hoistableScripts,f=_o(e),h=l.get(f);h||(h=a.querySelector(Cr(f)),h||(e=b({src:e,async:!0,type:"module"},n),(n=Kn.get(f))&&If(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 O0(e,n,a,l){var f=(f=_e.current)?gc(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=xo(a.href),a=Pi(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=xo(a.href);var h=Pi(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(Nr(e)))&&!h._p&&(_.instance=h,_.state.loading=5),Kn.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},Kn.set(e,a),h||JS(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=_o(a),a=Pi(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 xo(e){return'href="'+Un(e)+'"'}function Nr(e){return'link[rel="stylesheet"]['+e+"]"}function B0(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function JS(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 _o(e){return'[src="'+Un(e)+'"]'}function Cr(e){return"script[async]"+e}function L0(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+Un(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),vc(l,a.precedence,e),n.instance=l;case"stylesheet":f=xo(a.href);var h=e.querySelector(Nr(f));if(h)return n.state.loading|=4,n.instance=h,Qt(h),h;l=B0(a),(f=Kn.get(f))&&Mf(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,vc(h,a.precedence,e),n.instance=h;case"script":return h=_o(a.src),(f=e.querySelector(Cr(h)))?(n.instance=f,Qt(f),f):(l=a,(f=Kn.get(h))&&(l=b({},a),If(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,vc(l,a.precedence,e));return n.instance}function vc(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 Mf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function If(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var yc=null;function z0(e,n,a){if(yc===null){var l=new Map,f=yc=new Map;f.set(a,l)}else f=yc,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[qo]||h[$e]||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 $0(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function WS(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 U0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function XS(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=xo(l.href),h=n.querySelector(Nr(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=bc.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=h,Qt(h);return}h=n.ownerDocument||n,l=B0(l),(f=Kn.get(f))&&Mf(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=bc.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Of=0;function QS(e,n){return e.stylesheets&&e.count===0&&_c(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&_c(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Of===0&&(Of=62500*MS());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&_c(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Of?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_c(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var xc=null;function _c(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xc=new Map,n.forEach(eT,e),xc=null,bc.call(e))}function eT(e,n){if(!(n.state.loading&4)){var a=xc.get(e);if(a)var l=a.get(null);else{a=new Map,xc.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=bc.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 Er={$$typeof:D,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function tT(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 P0(e,n,a,l,f,h,_,j,R,G,ee,se){return e=new tT(e,n,a,_,R,G,ee,se,j),n=1,h===!0&&(n|=24),h=Cn(3,null,null,n),e.current=h,h.stateNode=e,n=pu(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:l,isDehydrated:a,cache:n},vu(h),e}function H0(e){return e?(e=Wi,e):Wi}function V0(e,n,a,l,f,h){f=H0(f),l.context===null?l.context=f:l.pendingContext=f,l=ma(n),l.payload={element:a},h=h===void 0?null:h,h!==null&&(l.callback=h),a=ha(e,l,n),a!==null&&(Sn(a,e,n),rr(a,e,n))}function q0(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Bf(e,n){q0(e,n),(e=e.alternate)&&q0(e,n)}function G0(e){if(e.tag===13||e.tag===31){var n=ii(e,67108864);n!==null&&Sn(n,e,67108864),Bf(e,67108864)}}function F0(e){if(e.tag===13||e.tag===31){var n=Mn();n=Ze(n);var a=ii(e,n);a!==null&&Sn(a,e,n),Bf(e,n)}}var kc=!0;function nT(e,n,a,l){var f=L.T;L.T=null;var h=Z.p;try{Z.p=2,Lf(e,n,a,l)}finally{Z.p=h,L.T=f}}function sT(e,n,a,l){var f=L.T;L.T=null;var h=Z.p;try{Z.p=8,Lf(e,n,a,l)}finally{Z.p=h,L.T=f}}function Lf(e,n,a,l){if(kc){var f=zf(l);if(f===null)Sf(e,n,l,Sc,a),K0(e,l);else if(iT(f,e,n,a,l))l.stopPropagation();else if(K0(e,l),n&4&&-1<aT.indexOf(e)){for(;f!==null;){var h=Ui(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var _=gs(h.pendingLanes);if(_!==0){var j=h;for(j.pendingLanes|=2,j.entangledLanes|=2;_;){var R=1<<31-Wt(_);j.entanglements[1]|=R,_&=~R}xs(h),(st&6)===0&&(ic=Yt()+500,Sr(0))}}break;case 31:case 13:j=ii(h,2),j!==null&&Sn(j,h,2),rc(),Bf(h,2)}if(h=zf(l),h===null&&Sf(e,n,l,Sc,a),h===f)break;f=h}f!==null&&l.stopPropagation()}else Sf(e,n,l,null,a)}}function zf(e){return e=$d(e),$f(e)}var Sc=null;function $f(e){if(Sc=null,e=$i(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 Sc=e,null}function Z0(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(Ii()){case ra:return 2;case Ka:return 8;case hs:case Oi:return 32;case jn:return 268435456;default:return 32}default:return 32}}var Uf=!1,ja=null,Na=null,Ca=null,Ar=new Map,Dr=new Map,Ea=[],aT="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 K0(e,n){switch(e){case"focusin":case"focusout":ja=null;break;case"dragenter":case"dragleave":Na=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":Ar.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dr.delete(n.pointerId)}}function Rr(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=Ui(n),n!==null&&G0(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function iT(e,n,a,l,f){switch(n){case"focusin":return ja=Rr(ja,e,n,a,l,f),!0;case"dragenter":return Na=Rr(Na,e,n,a,l,f),!0;case"mouseover":return Ca=Rr(Ca,e,n,a,l,f),!0;case"pointerover":var h=f.pointerId;return Ar.set(h,Rr(Ar.get(h)||null,e,n,a,l,f)),!0;case"gotpointercapture":return h=f.pointerId,Dr.set(h,Rr(Dr.get(h)||null,e,n,a,l,f)),!0}return!1}function Y0(e){var n=$i(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(){F0(a)});return}}else if(n===31){if(n=p(a),n!==null){e.blockedOn=n,Xt(e.priority,function(){F0(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 Tc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=zf(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);zd=l,a.target.dispatchEvent(l),zd=null}else return n=Ui(a),n!==null&&G0(n),e.blockedOn=a,!1;n.shift()}return!0}function J0(e,n,a){Tc(e)&&a.delete(n)}function oT(){Uf=!1,ja!==null&&Tc(ja)&&(ja=null),Na!==null&&Tc(Na)&&(Na=null),Ca!==null&&Tc(Ca)&&(Ca=null),Ar.forEach(J0),Dr.forEach(J0)}function wc(e,n){e.blockedOn===n&&(e.blockedOn=null,Uf||(Uf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,oT)))}var jc=null;function W0(e){jc!==e&&(jc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jc===e&&(jc=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($f(l||a)===null)continue;break}var h=Ui(a);h!==null&&(e.splice(n,3),n-=3,Lu(h,{pending:!0,data:f,method:a.method,action:l},l,f))}}))}function ko(e){function n(R){return wc(R,e)}ja!==null&&wc(ja,e),Na!==null&&wc(Na,e),Ca!==null&&wc(Ca,e),Ar.forEach(n),Dr.forEach(n);for(var a=0;a<Ea.length;a++){var l=Ea[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ea.length&&(a=Ea[0],a.blockedOn===null);)Y0(a),a.blockedOn===null&&Ea.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")_||W0(a);else if(_){var j=null;if(h&&h.hasAttribute("formAction")){if(f=h,_=h[It]||null)j=_.formAction;else if($f(f)!==null)continue}else j=_.action;typeof j=="function"?a[l+1]=j:(a.splice(l,3),l-=3),W0(a)}}}function X0(){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 Pf(e){this._internalRoot=e}Nc.prototype.render=Pf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,l=Mn();V0(a,l,e,n,null,null)},Nc.prototype.unmount=Pf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;V0(e.current,2,null,e,null,null),rc(),n[vn]=null}};function Nc(e){this._internalRoot=e}Nc.prototype.unstable_scheduleHydration=function(e){if(e){var n=Xe();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Ea.length&&n!==0&&n<Ea[a].priority;a++);Ea.splice(a,0,e),a===0&&Y0(e)}};var Q0=s.version;if(Q0!=="19.2.4")throw Error(r(527,Q0,"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 rT={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cc.isDisabled&&Cc.supportsFiber)try{Jt=Cc.inject(rT),St=Cc}catch{}}return Ir.createRoot=function(e,n){if(!c(e))throw Error(r(299));var a=!1,l="",f=ov,h=rv,_=lv;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=P0(e,1,!1,null,null,a,l,null,f,h,_,X0),e[vn]=n.current,kf(e),new Pf(n)},Ir.hydrateRoot=function(e,n,a){if(!c(e))throw Error(r(299));var l=!1,f="",h=ov,_=rv,j=lv,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=P0(e,1,!0,n,a??null,l,f,R,h,_,j,X0),n.context=H0(null),a=n.current,l=Mn(),l=Ze(l),f=ma(l),f.callback=null,ha(a,f,l),a=l,n.current.lanes=a,de(n,a),xs(n),e[vn]=n.current,kf(e),new Nc(n)},Ir.version="19.2.4",Ir}var ry;function LT(){if(ry)return Hf.exports;ry=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(),Hf.exports=BT(),Hf.exports}var zT=LT();const $T="modulepreload",UT=function(t){return"/"+t},ly={},PT=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=UT(g),g in ly)return;ly[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":$T,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)})},HT=new Proxy(globalThis.fetch,{apply(t,s,o){return Reflect.apply(globalThis.fetch,s,o)}}),xd=vT({baseUrl:"/",fetch:HT}),We=vd(yT,xd),cn=vd(bT,xd);vd(xT,xd);const Dc=vd(_T,xd),VT="_bar_1xhb4_1",qT="_input_1xhb4_32",GT="_select_1xhb4_67",FT="_btnPrimary_1xhb4_103",ZT="_btnGhost_1xhb4_173",KT="_badge_1xhb4_195",YT="_disconnectHint_1xhb4_205",In={bar:VT,input:qT,select:GT,btnPrimary:FT,btnGhost:ZT,badge:KT,disconnectHint:YT};function JT(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 WT({environmentId:t,onReconnect:s}){return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:In.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),i.jsx("button",{type:"button",onClick:()=>s(t),className:In.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function el({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=JT(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:In.bar,children:[i.jsx("span",{className:In.badge,children:"new chat"}),i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:In.input,"aria-label":"Enter prompt"}),c&&i.jsxs("select",{value:k,onChange:C=>w(C.target.value),className:In.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:In.btnPrimary,children:"Go"})]}):t==="start"?i.jsxs("form",{onSubmit:T,className:In.bar,children:[i.jsx("input",{type:"text",value:x,onChange:C=>S(C.target.value),placeholder:"Type a message...",autoFocus:!0,className:In.input,"aria-label":"Type a message"}),i.jsx("button",{type:"submit",disabled:!x.trim(),className:In.btnPrimary,children:"Send"})]}):i.jsxs("form",{onSubmit:T,className:In.bar,children:[N&&o&&i.jsx(WT,{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:In.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:In.btnPrimary,children:"Send"})})]})}const cy=220,dy=70,XT=40,QT=60,e2="hierarchy",t2="dependency";function n2(t){return y.useMemo(()=>{if(t.length===0)return{nodes:[],edges:[]};const s=new ey.graphlib.Graph({multigraph:!0});s.setDefaultEdgeLabel(()=>({})),s.setGraph({rankdir:"TB",nodesep:XT,ranksep:QT});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:cy,height:dy});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:e2},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:t2},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return ey.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-cy/2,y:p.y-dy/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 s2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yx=(...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 a2={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 i2=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,...a2,width:s,height:s,stroke:t,strokeWidth:r?Number(o)*24/Number(s):o,className:yx("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 Ke=(t,s)=>{const o=y.forwardRef(({className:r,...c},d)=>y.createElement(i2,{ref:d,iconNode:s,className:yx(`lucide-${s2(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 o2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],uy=Ke("ArrowDown",o2);/**
|
|
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 r2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],fy=Ke("ArrowUp",r2);/**
|
|
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 l2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],c2=Ke("Ban",l2);/**
|
|
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 d2=[["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"}]],u2=Ke("Brain",d2);/**
|
|
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 f2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ai=Ke("Check",f2);/**
|
|
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 p2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bx=Ke("ChevronDown",p2);/**
|
|
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 m2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=Ke("ChevronRight",m2);/**
|
|
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 h2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],za=Ke("Circle",h2);/**
|
|
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 g2=[["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"}]],v2=Ke("ClipboardList",g2);/**
|
|
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 y2=[["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"}]],xx=Ke("Clipboard",y2);/**
|
|
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 b2=[["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"}]],x2=Ke("Cog",b2);/**
|
|
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 _2=[["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"}]],k2=Ke("Copy",_2);/**
|
|
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 S2=[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],T2=Ke("CornerDownRight",S2);/**
|
|
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 w2=[["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"}]],j2=Ke("FilePen",w2);/**
|
|
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 N2=[["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"}]],C2=Ke("FileText",N2);/**
|
|
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 E2=[["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"}]],A2=Ke("House",E2);/**
|
|
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 D2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cm=Ke("Info",D2);/**
|
|
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 R2=[["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"}]],M2=Ke("Key",R2);/**
|
|
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 I2=[["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"}]],O2=Ke("Keyboard",I2);/**
|
|
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 B2=[["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"}]],L2=Ke("ListChecks",B2);/**
|
|
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 z2=[["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"}]],$2=Ke("List",z2);/**
|
|
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 U2=[["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"}]],P2=Ke("Loader",U2);/**
|
|
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 H2=[["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"}]],V2=Ke("Menu",H2);/**
|
|
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 q2=[["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"}]],G2=Ke("MessageSquare",q2);/**
|
|
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 F2=[["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"}]],Z2=Ke("Monitor",F2);/**
|
|
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 K2=[["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"}]],Y2=Ke("Palette",K2);/**
|
|
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 J2=[["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"}]],W2=Ke("Pause",J2);/**
|
|
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 X2=[["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"}]],Q2=Ke("Pencil",X2);/**
|
|
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 ew=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],_x=Ke("Search",ew);/**
|
|
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 tw=[["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"}]],nw=Ke("Settings",tw);/**
|
|
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 sw=[["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"}]],aw=Ke("SquareCheckBig",sw);/**
|
|
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 iw=[["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"}]],dm=Ke("TriangleAlert",iw);/**
|
|
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 ow=[["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"}]],rw=Ke("User",ow);/**
|
|
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 lw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Va=Ke("X",lw),um=8,lt=12,tn=14,zt=16,Mp={not_started:{color:"var(--text-tertiary)",icon:i.jsx(za,{size:lt}),label:"Not Started"},working:{color:"var(--accent-green)",icon:i.jsx(za,{size:lt,fill:"currentColor"}),label:"Working"},paused:{color:"var(--accent-yellow)",icon:i.jsx(W2,{size:lt}),label:"Paused"},complete:{color:"var(--accent-green)",icon:i.jsx(Ai,{size:lt}),label:"Complete"},failed:{color:"var(--accent-red)",icon:i.jsx(Va,{size:lt}),label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:i.jsx(c2,{size:lt}),label:"Blocked"}};function $a(t){return t==="blocked"?Mp.blocked:Mp[cl(t)]}const cw={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function dw(t){return cw[cl(t)]??"statusPending"}const uw=["working","paused","failed","not_started","blocked","complete"],py=["not_started","working","paused","complete","failed"],fw={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function cl(t){return t in Mp&&t!=="blocked"?t:fw[t]??"not_started"}const pw={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"},mw="_dagContainer_js4w6_1",hw="_taskNode_js4w6_26",gw="_taskNodeBorder_js4w6_54",vw="_taskNodeContent_js4w6_60",yw="_taskNodeHeader_js4w6_70",bw="_taskNodeIcon_js4w6_77",xw="_taskNodeTitle_js4w6_82",_w="_taskNodeBadges_js4w6_90",kw="_childBadge_js4w6_95",Sw="_depBadge_js4w6_107",Tw="_handle_js4w6_119",ww="_emptyCta_js4w6_126",jw="_ctaDescription_js4w6_137",Nw="_ctaButton_js4w6_144",gn={dagContainer:mw,taskNode:hw,taskNodeBorder:gw,taskNodeContent:vw,taskNodeHeader:yw,taskNodeIcon:bw,taskNodeTitle:xw,taskNodeBadges:_w,childBadge:kw,depBadge:Sw,handle:Tw,emptyCta:ww,ctaDescription:jw,ctaButton:Nw};function Cw({data:t}){const{task:s,childCount:o,doneChildCount:r,hasDependencies:c}=t,d=$a(s.status);return i.jsxs("div",{className:gn.taskNode,"data-task-id":s.id,"data-task-title":s.title,children:[i.jsx(ty,{type:"target",position:ny.Top,className:gn.handle}),i.jsx("div",{className:gn.taskNodeBorder,style:{backgroundColor:d.color}}),i.jsxs("div",{className:gn.taskNodeContent,children:[i.jsxs("div",{className:gn.taskNodeHeader,children:[i.jsx("span",{className:gn.taskNodeIcon,style:{color:d.color},children:d.icon}),i.jsx("span",{className:gn.taskNodeTitle,children:s.title})]}),i.jsxs("div",{className:gn.taskNodeBadges,children:[o>0&&i.jsxs("span",{className:gn.childBadge,children:[r,"/",o]}),c&&i.jsx("span",{className:gn.depBadge,children:"dep"})]})]}),i.jsx(ty,{type:"source",position:ny.Bottom,className:gn.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 my="popstate";function hy(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function Ew(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 Ip("",{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:tl(c)}return Dw(s,o,null,t)}function xt(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function Qn(t,s){if(!t){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function Aw(){return Math.random().toString(36).substring(2,10)}function gy(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 Ip(t,s,o=null,r,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof s=="string"?$o(s):s,state:o,key:s&&s.key||r||Aw(),unstable_mask:c}}function tl({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 $o(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 Dw(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=hy(N)?N:Ip(w.location,N,T);g=v()+1;let D=gy(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=hy(N)?N:Ip(w.location,N,T);g=v();let D=gy(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 Rw(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(my,b),m=N,()=>{c.removeEventListener(my,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 Rw(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:tl(t);return r=r.replace(/ $/,"%20"),!s&&r.startsWith("//")&&(r=o+r),new URL(r,o)}function kx(t,s,o="/"){return Mw(t,s,o,!1)}function Mw(t,s,o,r){let c=typeof s=="string"?$o(s):s,d=ta(c.pathname||"/",o);if(d==null)return null;let u=Sx(t);Iw(u);let p=null;for(let m=0;p==null&&m<u.length;++m){let g=wx(d);p=Vw(u[m],g,r)}return p}function Sx(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=ws([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}".`),Sx(u.children,s,x,b,m)),!(u.path==null&&!u.index)&&s.push({path:b,score:Pw(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 Tx(u.path))d(u,p,!0,g)}),s}function Tx(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=Tx(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 Iw(t){t.sort((s,o)=>s.score!==o.score?o.score-s.score:Hw(s.routesMeta.map(r=>r.childrenIndex),o.routesMeta.map(r=>r.childrenIndex)))}var Ow=/^:[\w-]+$/,Bw=3,Lw=2,zw=1,$w=10,Uw=-2,vy=t=>t==="*";function Pw(t,s){let o=t.split("/"),r=o.length;return o.some(vy)&&(r+=Uw),s&&(r+=Lw),o.filter(c=>!vy(c)).reduce((c,d)=>c+(Ow.test(d)?Bw:d===""?zw:$w),r)}function Hw(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 Vw(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=nl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),x=m.route;if(!b&&g&&o&&!r[r.length-1].route.index&&(b=nl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(c,b.params),u.push({params:c,pathname:ws([d,b.pathname]),pathnameBase:Kw(ws([d,b.pathnameBase])),route:x}),b.pathnameBase!=="/"&&(d=ws([d,b.pathnameBase]))}return u}function nl(t,s){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[o,r]=qw(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 qw(t,s=!1,o=!0){Qn(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 wx(t){try{return t.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Qn(!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 ta(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 Gw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Fw(t,s="/"){let{pathname:o,search:r="",hash:c=""}=typeof t=="string"?$o(t):t,d;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?d=yy(o.substring(1),"/"):d=yy(o,s)):d=s,{pathname:d,search:Yw(r),hash:Jw(c)}}function yy(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 Gf(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 Zw(t){return t.filter((s,o)=>o===0||s.route.path&&s.route.path.length>0)}function fm(t){let s=Zw(t);return s.map((o,r)=>r===s.length-1?o.pathname:o.pathnameBase)}function _d(t,s,o,r=!1){let c;typeof t=="string"?c=$o(t):(c={...t},xt(!c.pathname||!c.pathname.includes("?"),Gf("?","pathname","search",c)),xt(!c.pathname||!c.pathname.includes("#"),Gf("#","pathname","hash",c)),xt(!c.search||!c.search.includes("#"),Gf("#","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=Fw(c,p),g=u&&u!=="/"&&u.endsWith("/"),v=(d||u===".")&&o.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}var ws=t=>t.join("/").replace(/\/\/+/g,"/"),Kw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Yw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Jw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Ww=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 Xw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Qw(t){return t.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var jx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nx(t,s){let o=t;if(typeof o!="string"||!Gw.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let r=o,c=!1;if(jx)try{let d=new URL(window.location.href),u=o.startsWith("//")?new URL(d.protocol+o):new URL(o),p=ta(u.pathname,s);u.origin===d.origin&&p!=null?o=p+u.search+u.hash:c=!0}catch{Qn(!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 Cx=["POST","PUT","PATCH","DELETE"];new Set(Cx);var ej=["GET",...Cx];new Set(ej);var Uo=y.createContext(null);Uo.displayName="DataRouter";var kd=y.createContext(null);kd.displayName="DataRouterState";var tj=y.createContext(!1),Ex=y.createContext({isTransitioning:!1});Ex.displayName="ViewTransition";var nj=y.createContext(new Map);nj.displayName="Fetchers";var sj=y.createContext(null);sj.displayName="Await";var zn=y.createContext(null);zn.displayName="Navigation";var dl=y.createContext(null);dl.displayName="Location";var es=y.createContext({outlet:null,matches:[],isDataRoute:!1});es.displayName="Route";var pm=y.createContext(null);pm.displayName="RouteError";var Ax="REACT_ROUTER_ERROR",aj="REDIRECT",ij="ROUTE_ERROR_RESPONSE";function oj(t){if(t.startsWith(`${Ax}:${aj}:{`))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 rj(t){if(t.startsWith(`${Ax}:${ij}:{`))try{let s=JSON.parse(t.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new Ww(s.status,s.statusText,s.data)}catch{}}function lj(t,{relative:s}={}){xt(Di(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:r}=y.useContext(zn),{hash:c,pathname:d,search:u}=ul(t,{relative:s}),p=d;return o!=="/"&&(p=d==="/"?o:ws([o,d])),r.createHref({pathname:p,search:u,hash:c})}function Di(){return y.useContext(dl)!=null}function Zt(){return xt(Di(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(dl).location}function At(t){xt(Di(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:s}=Zt();return y.useMemo(()=>nl(t,wx(s)),[s,t])}var Dx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rx(t){y.useContext(zn).static||y.useLayoutEffect(t)}function Sd(){let{isDataRoute:t}=y.useContext(es);return t?Sj():cj()}function cj(){xt(Di(),"useNavigate() may be used only in the context of a <Router> component.");let t=y.useContext(Uo),{basename:s,navigator:o}=y.useContext(zn),{matches:r}=y.useContext(es),{pathname:c}=Zt(),d=JSON.stringify(fm(r)),u=y.useRef(!1);return Rx(()=>{u.current=!0}),y.useCallback((m,g={})=>{if(Qn(u.current,Dx),!u.current)return;if(typeof m=="number"){o.go(m);return}let v=_d(m,JSON.parse(d),c,g.relative==="path");t==null&&s!=="/"&&(v.pathname=v.pathname==="/"?s:ws([s,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[s,o,d,c,t])}var dj=y.createContext(null);function uj(t){let s=y.useContext(es).outlet;return y.useMemo(()=>s&&y.createElement(dj.Provider,{value:t},s),[s,t])}function ps(){let{matches:t}=y.useContext(es),s=t[t.length-1];return s?s.params:{}}function ul(t,{relative:s}={}){let{matches:o}=y.useContext(es),{pathname:r}=Zt(),c=JSON.stringify(fm(o));return y.useMemo(()=>_d(t,JSON.parse(c),r,s==="path"),[t,c,r,s])}function fj(t,s){return Mx(t,s)}function Mx(t,s,o){var N;xt(Di(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=y.useContext(zn),{matches:c}=y.useContext(es),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||"";Ox(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"?$o(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=kx(t,{pathname:S});Qn(g||k!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Qn(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=vj(k&&k.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:ws([m,r.encodeLocation?r.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:ws([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(dl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},w):w}function pj(){let t=kj(),s=Xw(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 mj=y.createElement(pj,null),Ix=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=rj(t.digest);o&&(t=o)}let s=t!==void 0?y.createElement(es.Provider,{value:this.props.routeContext},y.createElement(pm.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?y.createElement(hj,{error:t},s):s}};Ix.contextType=tj;var Ff=new WeakMap;function hj({children:t,error:s}){let{basename:o}=y.useContext(zn);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let r=oj(s.digest);if(r){let c=Ff.get(s);if(c)throw c;let d=Nx(r.location,o);if(jx&&!Ff.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 Ff.set(s,u),u}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return t}function gj({routeContext:t,match:s,children:o}){let r=y.useContext(Uo);return r&&r.static&&r.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=s.route.id),y.createElement(es.Provider,{value:t},o)}function vj(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:Qw(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||mj,u&&(p<0&&x===0?(Ox("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(gj,{match:b,routeContext:{outlet:v,matches:T,isDataRoute:r!=null},children:D})};return r&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?y.createElement(Ix,{location:r.location,revalidation:r.revalidation,component:w,error:S,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:g}):C()},null)}function mm(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yj(t){let s=y.useContext(Uo);return xt(s,mm(t)),s}function bj(t){let s=y.useContext(kd);return xt(s,mm(t)),s}function xj(t){let s=y.useContext(es);return xt(s,mm(t)),s}function hm(t){let s=xj(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 _j(){return hm("useRouteId")}function kj(){var r;let t=y.useContext(pm),s=bj("useRouteError"),o=hm("useRouteError");return t!==void 0?t:(r=s.errors)==null?void 0:r[o]}function Sj(){let{router:t}=yj("useNavigate"),s=hm("useNavigate"),o=y.useRef(!1);return Rx(()=>{o.current=!0}),y.useCallback(async(c,d={})=>{Qn(o.current,Dx),o.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:s,...d}))},[t,s])}var by={};function Ox(t,s,o){!s&&!by[t]&&(by[t]=!0,Qn(!1,o))}y.memo(Tj);function Tj({routes:t,future:s,state:o,isStatic:r,onError:c}){return Mx(t,void 0,{state:o,isStatic:r,onError:c})}function us({to:t,replace:s,state:o,relative:r}){xt(Di(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(zn);Qn(!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(es),{pathname:u}=Zt(),p=Sd(),m=_d(t,fm(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 qa(t){return uj(t.context)}function Ee(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 wj({basename:t="/",children:s=null,location:o,navigationType:r="POP",navigator:c,static:d=!1,unstable_useTransitions:u}){xt(!Di(),"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=$o(o));let{pathname:g="/",search:v="",hash:b="",state:x=null,key:S="default",unstable_mask:k}=o,w=y.useMemo(()=>{let N=ta(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 Qn(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(zn.Provider,{value:m},y.createElement(dl.Provider,{children:s,value:w}))}function jj({children:t,location:s}){return fj(Op(t),s)}function Op(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,Op(r.props.children,d));return}xt(r.type===Ee,`[${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=Op(r.props.children,d)),o.push(u)}),o}var Zc="get",Kc="application/x-www-form-urlencoded";function Td(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Nj(t){return Td(t)&&t.tagName.toLowerCase()==="button"}function Cj(t){return Td(t)&&t.tagName.toLowerCase()==="form"}function Ej(t){return Td(t)&&t.tagName.toLowerCase()==="input"}function Aj(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Dj(t,s){return t.button===0&&(!s||s==="_self")&&!Aj(t)}function Bp(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 Rj(t,s){let o=Bp(t);return s&&s.forEach((r,c)=>{o.has(c)||s.getAll(c).forEach(d=>{o.append(c,d)})}),o}var Rc=null;function Mj(){if(Rc===null)try{new FormData(document.createElement("form"),0),Rc=!1}catch{Rc=!0}return Rc}var Ij=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zf(t){return t!=null&&!Ij.has(t)?(Qn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kc}"`),null):t}function Oj(t,s){let o,r,c,d,u;if(Cj(t)){let p=t.getAttribute("action");r=p?ta(p,s):null,o=t.getAttribute("method")||Zc,c=Zf(t.getAttribute("enctype"))||Kc,d=new FormData(t)}else if(Nj(t)||Ej(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?ta(m,s):null,o=t.getAttribute("formmethod")||p.getAttribute("method")||Zc,c=Zf(t.getAttribute("formenctype"))||Zf(p.getAttribute("enctype"))||Kc,d=new FormData(p,t),!Mj()){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(Td(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Zc,r=null,c=Kc,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 gm(t,s){if(t===!1||t===null||typeof t>"u")throw new Error(s)}function Bj(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&&ta(c.pathname,s)==="/"?c.pathname=`${s.replace(/\/$/,"")}/_root.${r}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${r}`,c}async function Lj(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 zj(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 $j(t,s,o){let r=await Promise.all(t.map(async c=>{let d=s.routes[c.route.id];if(d){let u=await Lj(d,o);return u.links?u.links():[]}return[]}));return Vj(r.flat(1).filter(zj).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function xy(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 Uj(t,s,{includeHydrateFallback:o}={}){return Pj(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 Pj(t){return[...new Set(t)]}function Hj(t){let s={},o=Object.keys(t).sort();for(let r of o)s[r]=t[r];return s}function Vj(t,s){let o=new Set;return new Set(s),t.reduce((r,c)=>{let d=JSON.stringify(Hj(c));return o.has(d)||(o.add(d),r.push({key:d,link:c})),r},[])}function Bx(){let t=y.useContext(Uo);return gm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function qj(){let t=y.useContext(kd);return gm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var vm=y.createContext(void 0);vm.displayName="FrameworkContext";function Lx(){let t=y.useContext(vm);return gm(t,"You must render this element inside a <HydratedRouter> element"),t}function Gj(t,s){let o=y.useContext(vm),[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:Or(p,S),onBlur:Or(m,k),onMouseEnter:Or(g,S),onMouseLeave:Or(v,k),onTouchStart:Or(b,S)}]:[!1,x,{}]}function Or(t,s){return o=>{t&&t(o),o.defaultPrevented||s(o)}}function Fj({page:t,...s}){let{router:o}=Bx(),r=y.useMemo(()=>kx(o.routes,t,o.basename),[o.routes,t,o.basename]);return r?y.createElement(Kj,{page:t,matches:r,...s}):null}function Zj(t){let{manifest:s,routeModules:o}=Lx(),[r,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return $j(t,s,o).then(u=>{d||c(u)}),()=>{d=!0}},[t,s,o]),r}function Kj({page:t,matches:s,...o}){let r=Zt(),{future:c,manifest:d,routeModules:u}=Lx(),{basename:p}=Bx(),{loaderData:m,matches:g}=qj(),v=y.useMemo(()=>xy(t,s,g,d,r,"data"),[t,s,g,d,r]),b=y.useMemo(()=>xy(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=Bj(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(()=>Uj(b,d),[b,d]),k=Zj(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 Yj(...t){return s=>{t.forEach(o=>{typeof o=="function"?o(s):o!=null&&(o.current=s)})}}var Jj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Jj&&(window.__reactRouterVersion="7.13.2")}catch{}function Wj({basename:t,children:s,unstable_useTransitions:o,window:r}){let c=y.useRef();c.current==null&&(c.current=Ew({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(wj,{basename:t,children:s,location:u.location,navigationType:u.action,navigator:d,unstable_useTransitions:o})}var zx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ym=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(zn),D=typeof v=="string"&&zx.test(v),B=Nx(v,N);v=B.to;let E=lj(v,{relative:c}),A=Zt(),P=null;if(p){let ie=_d(p,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);N!=="/"&&(ie.pathname=ie.pathname==="/"?N:ws([N,ie.pathname])),P=T.createHref(ie)}let[I,U,Q]=Gj(r,k),$=tN(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:Yj(w,U),target:g,"data-discover":!D&&o==="render"?"true":void 0});return I&&!D?y.createElement(y.Fragment,null,H,y.createElement(Fj,{page:E})):H});ym.displayName="Link";var Xj=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=ul(u,{relative:g.relative}),x=Zt(),S=y.useContext(kd),{navigator:k,basename:w}=y.useContext(zn),N=S!=null&&oN(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=ta(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(ym,{...g,"aria-current":I,className:U,ref:v,style:Q,to:u,viewTransition:p},typeof m=="function"?m(P):m)});Xj.displayName="NavLink";var Qj=y.forwardRef(({discover:t="render",fetcherKey:s,navigate:o,reloadDocument:r,replace:c,state:d,method:u=Zc,action:p,onSubmit:m,relative:g,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:x,...S},k)=>{let{unstable_useTransitions:w}=y.useContext(zn),N=aN(),T=iN(p,{relative:g}),C=u.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&zx.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})});Qj.displayName="Form";function eN(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $x(t){let s=y.useContext(Uo);return xt(s,eN(t)),s}function tN(t,{target:s,replace:o,unstable_mask:r,state:c,preventScrollReset:d,relative:u,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let v=Sd(),b=Zt(),x=ul(t,{relative:u});return y.useCallback(S=>{if(Dj(S,s)){S.preventDefault();let k=o!==void 0?o:tl(b)===tl(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 bm(t){Qn(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(Bp(t)),o=y.useRef(!1),r=Zt(),c=y.useMemo(()=>Rj(r.search,o.current?null:s.current),[r.search]),d=Sd(),u=y.useCallback((p,m)=>{const g=Bp(typeof p=="function"?p(new URLSearchParams(c)):p);o.current=!0,d("?"+g,m)},[d,c]);return[c,u]}var nN=0,sN=()=>`__${String(++nN)}__`;function aN(){let{router:t}=$x("useSubmit"),{basename:s}=y.useContext(zn),o=_j(),r=t.fetch,c=t.navigate;return y.useCallback(async(d,u={})=>{let{action:p,method:m,encType:g,formData:v,body:b}=Oj(d,s);if(u.navigate===!1){let x=u.fetcherKey||sN();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 iN(t,{relative:s}={}){let{basename:o}=y.useContext(zn),r=y.useContext(es);xt(r,"useFormAction must be used inside a RouteContext");let[c]=r.matches.slice(-1),d={...ul(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:ws([o,d.pathname])),tl(d)}function oN(t,{relative:s}={}){let o=y.useContext(Ex);xt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=$x("useViewTransitionState"),c=ul(t,{relative:s});if(!o.isTransitioning)return!1;let d=ta(o.currentLocation.pathname,r)||o.currentLocation.pathname,u=ta(o.nextLocation.pathname,r)||o.nextLocation.pathname;return nl(c.pathname,u)!=null||nl(c.pathname,d)!=null}function kt(){const t=Sd();return y.useCallback((s,o)=>{typeof s=="number"?t(s):t(s,o)},[t])}function xm(t){return`/sessions/${encodeURIComponent(t)}`}function Ua(t,s){return s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}`:`/workspaces/${encodeURIComponent(t)}`}function Bn(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 Ri(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 Ux(t){return`/sessions/new?${new URLSearchParams({env:t}).toString()}`}const Mo="/environments",rN="/environments/new";function Ni(t){return`/environments/${encodeURIComponent(t)}`}function lN(t){return`/environments/${encodeURIComponent(t)}/edit`}const Ro="/settings",cN="/settings/credentials",Kf="/settings/personas",dN="/settings/personas/new";function Px(t){return`/settings/personas/${encodeURIComponent(t)}`}const uN="/settings/shortcuts",fN="/pair",pN="/chat",Ci="/",mN="/tasks",Hx="/workspaces/new",Vx="/knowledge",wd="/findings";function hN(t,s){return t&&s?`/environments/${encodeURIComponent(s)}/workspaces/${encodeURIComponent(t)}/findings`:wd}function Lp(t,s,o){const r=encodeURIComponent(t);return s&&o?`/environments/${encodeURIComponent(o)}/workspaces/${encodeURIComponent(s)}/findings/${r}`:`/findings/${r}`}const gN=pw,vN={task:Cw};function yN({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}=n2(d),m=y.useMemo(()=>{const b=getComputedStyle(document.documentElement),x={};for(const[S,k]of Object.entries(gN))x[S]=b.getPropertyValue(k).trim()||"#6b7a8d";return x},[r]),g=y.useCallback((b,x)=>{c(Bn(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:gn.emptyCta,children:[i.jsx("button",{className:gn.ctaButton,onClick:()=>c(Ri(t,void 0,s)),children:"Create Task"}),i.jsx("div",{className:gn.ctaDescription,children:"Create tasks to see the dependency graph"})]}):i.jsx("div",{className:gn.dagContainer,children:i.jsxs(uT,{nodes:u,edges:p,nodeTypes:vN,onNodeClick:g,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[i.jsx(fT,{variant:pT.Dots,gap:24,size:1,color:"var(--text-disabled)"}),i.jsx(mT,{showInteractive:!1}),i.jsx(hT,{nodeColor:v,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}const bN="_breadcrumbs_17or2_1",xN="_list_17or2_11",_N="_item_17or2_21",kN="_separator_17or2_28",SN="_link_17or2_34",TN="_current_17or2_57",So={breadcrumbs:bN,list:xN,item:_N,separator:kN,link:SN,current:TN};function Cs({segments:t}){return i.jsx("nav",{className:So.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:i.jsx("ol",{className:So.list,children:t.map((s,o)=>{const r=o===t.length-1;return i.jsxs("li",{className:So.item,children:[o>0&&i.jsx("span",{className:So.separator,"aria-hidden":"true",children:i.jsx(aa,{size:lt})}),s.url&&!r?i.jsx(ym,{className:So.link,to:s.url,title:s.label,children:s.label}):i.jsx("span",{className:So.current,"aria-current":"page",title:s.label,children:s.label})]},o)})})})}const wN="_btn_dwk2o_1",jN="_sm_dwk2o_22",NN="_md_dwk2o_28",CN="_lg_dwk2o_34",EN="_primary_dwk2o_40",AN="_danger_dwk2o_55",DN="_outline_dwk2o_70",RN="_ghost_dwk2o_80",Yf={btn:wN,sm:jN,md:NN,lg:CN,primary:EN,danger:AN,outline:DN,ghost:RN},Ws=y.forwardRef(function({variant:s="primary",size:o="md",className:r,children:c,...d},u){const p=[Yf.btn,Yf[s],Yf[o],r].filter(Boolean).join(" ");return i.jsx("button",{ref:u,className:p,...d,children:c})}),MN="_copyButton_1bqk0_1",IN={copyButton:MN},ON=2e3;function BN({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},ON)}catch{}},[t]);return i.jsx("button",{type:"button",className:`${IN.copyButton} ${s??""}`,onClick:()=>{u().catch(()=>{})},"aria-label":r?"Copied":"Copy to clipboard","data-testid":o??"copy-button",children:r?i.jsx(Ai,{size:tn,"aria-hidden":"true"}):i.jsx(xx,{size:tn,"aria-hidden":"true"})})}const LN="_banner_bxqlh_1",zN="_label_bxqlh_15",$N="_text_bxqlh_25",UN="_link_bxqlh_29",Mc={banner:LN,label:zN,text:$N,link:UN};function PN(){return i.jsxs("div",{className:Mc.banner,"data-testid":"demo-banner",children:[i.jsx("span",{className:Mc.label,children:"DEMO"}),i.jsxs("span",{className:Mc.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:Mc.link,children:"Install Grackle"})," ","to use it for real."]})]})}const HN="_container_og0yp_1",VN="_chevronButton_og0yp_6",qN="_mainButton_og0yp_6",GN="_sm_og0yp_34",FN="_md_og0yp_34",ZN="_lg_og0yp_34",KN="_primary_og0yp_57",YN="_danger_og0yp_70",JN="_outline_og0yp_83",WN="_ghost_og0yp_92",XN="_dropdown_og0yp_100",QN="_option_og0yp_113",eC="_optionLabel_og0yp_130",tC="_optionDesc_og0yp_135",Zs={container:HN,chevronButton:VN,mainButton:qN,sm:GN,md:FN,lg:ZN,primary:KN,danger:YN,outline:JN,ghost:WN,dropdown:XN,option:QN,optionLabel:eC,optionDesc:tC};function qx({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=Zs[r]||"",v=Zs[c]||"",b=()=>{u&&p(!1),s()};return i.jsxs("div",{ref:m,className:Zs.container,"data-testid":d,children:[i.jsx("button",{type:"button",className:`${Zs.mainButton} ${g} ${v}`,onClick:b,"data-testid":d?`${d}-main`:void 0,children:t}),i.jsx("button",{type:"button",className:`${Zs.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(bx,{size:tn,"aria-hidden":"true"})}),u&&i.jsx("div",{className:Zs.dropdown,"data-testid":d?`${d}-menu`:void 0,children:o.map((x,S)=>i.jsxs("button",{type:"button",className:Zs.option,onClick:()=>{x.onClick(),p(!1)},children:[i.jsx("span",{className:Zs.optionLabel,children:x.label}),x.description&&i.jsx("span",{className:Zs.optionDesc,children:x.description})]},S))})]})}function zp(){zp=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)),nd(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&&nd(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)},zp.apply(this,arguments)}function nd(t,s){return nd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},nd(t,s)}function _y(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 Jf(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 _y(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)?_y(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 nC=(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){AT(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=Jf(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(Ac(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=Jf(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=RT(I);return function(Q){return U.includes(Q+1)}}return function(){return!1}})(m),N=(function(E){var A=zp(/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=MT(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-"))&&Ac(U).substring(0,1)==="-"?U.properties.className.push("deleted"):(b==="diff"||(A=b)!=null&&A.includes("diff-"))&&Ac(U).substring(0,1)==="+"&&U.properties.className.push("inserted")},B=Jf(T.entries());!(k=B()).done;)D();T.length>0&&Ac(T[T.length-1]).trim()===""&&T.pop(),r.children=T}}}})(DT);function Io(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 Ts(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 ky=new Set(["grackle"]);function Po(t){if(t.startsWith("mcp__")){const o=t.indexOf("__",5);if(o>5){const r=t.slice(5,o);if(ky.has(r))return t.slice(o+2)}}const s=t.indexOf("-");if(s>0){const o=t.slice(0,s);if(ky.has(o))return t.slice(s+1)}return t}const sC={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 aC(t){const s=Po(t);return sC[s.toLowerCase()]??"generic"}const iC="_card_qkm9i_2",oC="_cardBlue_qkm9i_20",rC="_cardOrange_qkm9i_24",lC="_cardGreen_qkm9i_28",cC="_cardPurple_qkm9i_32",dC="_cardNeutral_qkm9i_36",uC="_cardRed_qkm9i_40",fC="_cardTeal_qkm9i_44",pC="_header_qkm9i_48",mC="_icon_qkm9i_55",hC="_toolName_qkm9i_64",gC="_fileName_qkm9i_71",vC="_badge_qkm9i_80",yC="_spacer_qkm9i_87",bC="_bodyToggle_qkm9i_91",xC="_chevron_qkm9i_109",_C="_chevronExpanded_qkm9i_115",kC="_pre_qkm9i_119",SC="_diffAdd_qkm9i_143",TC="_diffRemove_qkm9i_155",wC="_diffContext_qkm9i_167",jC="_diffHeader_qkm9i_176",NC="_diffLine_qkm9i_182",CC="_exitOk_qkm9i_188",EC="_exitError_qkm9i_194",AC="_exitPending_qkm9i_200",DC="_inProgress_qkm9i_228",RC="_metadata_qkm9i_232",MC="_metadataPrefix_qkm9i_239",M={card:iC,cardBlue:oC,cardOrange:rC,cardGreen:lC,cardPurple:cC,cardNeutral:dC,cardRed:uC,cardTeal:fC,header:pC,icon:mC,toolName:hC,fileName:gC,badge:vC,spacer:yC,bodyToggle:bC,chevron:xC,chevronExpanded:_C,pre:kC,diffAdd:SC,diffRemove:TC,diffContext:wC,diffHeader:jC,diffLine:NC,exitOk:CC,exitError:EC,exitPending:AC,inProgress:DC,metadata:RC,metadataPrefix:MC};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){const s=t.split(/[/\\]/);return s[s.length-1]||t}const Wf=5;function Sy({tool:t,args:s,result:o,isError:r,writeVariant:c}){const[d,u]=y.useState(!1),p=IC(s),m=OC(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(j2,{size:tn}):i.jsx(C2,{size:tn}),S=c?"tool-card-file-write":"tool-card-file-read",k=(o==null?void 0:o.split(`
|
|
231
|
-
`))??[],w=k.length>Wf,N=d?k:k.slice(0,Wf);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(aa,{size:lt})}),d?"collapse":`${k.length-Wf} more lines`]})]})]})}function BC(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 LC(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 zC(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 $C(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 UC(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 PC(t){const s=t.split(/[/\\]/);return s[s.length-1]||t}function HC(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=BC(r);if(c.length>0)return c}}const o=UC(t);if(o)return LC(o.oldStr,o.newStr)}const Xf=5;function VC({tool:t,args:s,result:o,isError:r,detailedResult:c}){const[d,u]=y.useState(!1),p=$C(s),m=PC(p),g=o===void 0,v=HC(s,c),b=v?zC(v):null,x=((v==null?void 0:v.length)??0)>Xf,S=d?v:v==null?void 0:v.slice(0,Xf);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(Q2,{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(aa,{size:lt})}),d?"collapse":`${((v==null?void 0:v.length)??0)-Xf} more lines`]})]}),!r&&!v&&!g&&o&&i.jsx("pre",{className:M.pre,"data-testid":"tool-card-content",children:o})]})}const qC=/^\[exit (\d+)\]\s*/;function GC(t){const s=qC.exec(t);return s?{exitCode:Number(s[1]),output:t.slice(s[0].length)}:{exitCode:void 0,output:t}}function FC(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.command=="string"?s.command:""}function ZC(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 Qf=3;function KC({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=FC(s),p=ZC(u),m=o===void 0,g=o?GC(o):null,v=(g==null?void 0:g.output.split(`
|
|
235
|
-
`))??[],b=v.length>Qf,x=c?v:v.slice(0,Qf),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(Ai,{size:lt,"aria-hidden":"true"}):i.jsx(Va,{size:lt,"aria-hidden":"true"})," ","exit ",S]}),m&&i.jsx("span",{className:M.exitPending,"data-testid":"tool-card-pending",children:i.jsx(P2,{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(aa,{size:lt})}),c?"collapse":`${v.length-Qf} more lines`]})]})]})}function YC(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 ep=5;function JC({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{pattern:u,path:p}=YC(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
237
|
-
`).filter(x=>x.length>0))??[],v=g.length>ep,b=c?g:g.slice(0,ep);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(_x,{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(aa,{size:lt})}),c?"collapse":`${g.length-ep} more matches`]})]})]})}const WC="_progressBar_14f5c_1",XC="_progressFill_14f5c_9",QC="_activeTask_14f5c_16",eE="_activeIcon_14f5c_27",tE="_todoPulse_14f5c_1",nE="_activeText_14f5c_34",sE="_checklist_14f5c_48",aE="_item_14f5c_55",iE="_itemIcon_14f5c_65",oE="_itemText_14f5c_73",rE="_pending_14f5c_78",lE="_in_progress_14f5c_85",cE="_completed_14f5c_97",dE="_emptyMessage_14f5c_108",is={progressBar:WC,progressFill:XC,activeTask:QC,activeIcon:eE,todoPulse:tE,activeText:nE,checklist:sE,item:aE,itemIcon:iE,itemText:oE,pending:rE,in_progress:lE,completed:cE,emptyMessage:dE},uE=/^[-*]\s*\[([ xX~!/])\]\s*(.+)$/;function fE(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:Ty(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:Ty(o.status)})):typeof s.content=="string"?pE(s.content):[]}function Ty(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 pE(t){const s=t.split(`
|
|
239
|
-
`),o=[];for(const r of s){const c=uE.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 mE(t){switch(t){case"completed":return i.jsx(Ai,{size:lt});case"in_progress":return i.jsx(za,{size:lt,fill:"currentColor"});default:return i.jsx(za,{size:lt})}}function hE({args:t}){const s=fE(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(L2,{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:is.progressBar,"data-testid":"tool-card-todo-bar",children:i.jsx("div",{className:is.progressFill,style:{width:`${o/s.length*100}%`}})}),r&&i.jsxs("div",{className:is.activeTask,"data-testid":"tool-card-todo-active",children:[i.jsx("span",{className:is.activeIcon,children:i.jsx(za,{size:lt,fill:"currentColor"})}),i.jsx("span",{className:is.activeText,children:r.activeForm||r.content})]}),!c&&i.jsx("div",{className:is.checklist,"data-testid":"tool-card-todo-list",children:s.map((d,u)=>i.jsxs("div",{className:`${is.item} ${is[d.status]}`,"data-testid":"tool-card-todo-item",children:[i.jsx("span",{className:is.itemIcon,children:mE(d.status)}),i.jsx("span",{className:is.itemText,children:d.content})]},u))}),c&&i.jsx("div",{className:is.emptyMessage,children:"All items completed and cleared."})]})}function gE(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 vE({tool:t,args:s}){const o=gE(t,s);return i.jsxs("div",{className:M.metadata,"data-testid":"tool-card-metadata",children:[i.jsx("span",{className:M.metadataPrefix,children:i.jsx(T2,{size:lt})}),o]})}function yE(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 bE(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 tp=5,np=5;function xE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Po(t),p=yE(s),m=o===void 0,{single:g,list:v}=bE(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>np,N=c?g.content:k.slice(0,np).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-np} 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,tp)).map((k,w)=>`${k.category?`[${k.category}] `:""}${k.title??k.id??`Finding ${w+1}`}`).join(`
|
|
242
|
-
`)}),v.length>tp&&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-tp} more findings`]})]})]})}function _E(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 kE(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 wy(t){switch(t){case"complete":case"completed":return"✓";case"working":case"in_progress":return"●";case"paused":return"⏸";case"failed":return"✗";default:return"○"}}function SE(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 sp=5;function TE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Po(t),p=_E(s),m=o===void 0,{single:g,list:v,sessionId:b}=kE(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:SE(S)},"data-testid":"tool-card-task-status",children:[wy(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,sp)).map(k=>{const w=wy(k.status),N=k.title??k.id??"untitled";return`${w} ${N}`}).join(`
|
|
244
|
-
`)}),v.length>sp&&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-sp} more tasks`]})]})]})}function wE(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 jE(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 NE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Po(t),p=wE(s),m=o===void 0,g=jE(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 CE(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 EE(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 ap=5;function AE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Po(t),p=CE(s),m=o===void 0,g=EE(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,ap)).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>ap&&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-ap} 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 DE(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 RE(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 ME({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),u=Po(t),p=DE(s),m=o===void 0,g=RE(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 IE(t){if(t==null||typeof t!="object")return"";const s=t;return typeof s.query=="string"?s.query:""}const ip=8;function OE({args:t,result:s,isError:o}){const[r,c]=y.useState(!1),d=IE(t),u=s===void 0,p=(s==null?void 0:s.split(`
|
|
248
|
-
`))??[],m=p.length>ip,g=r?s:p.slice(0,ip).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-ip} more lines`]})]})]})}function BE(t){const s=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(t);return s?{display:`${s[1]} / ${s[2]}`,isMcp:!0}:{display:t,isMcp:!1}}function LE(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 op=5;function zE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),{display:u}=BE(t),p=LE(s),m=o===void 0,g=(o==null?void 0:o.split(`
|
|
250
|
-
`))??[],v=g.length>op,b=c?o:g.slice(0,op).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(x2,{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(aa,{size:lt})}),c?"collapse":`${g.length-op} more lines`]})]})]})}const $E="_badgePill_o7eqc_1",UE="_modelBadge_o7eqc_14",PE="_backgroundBadge_o7eqc_26",HE="_backgroundDot_o7eqc_36",VE="_backgroundDotPulsing_o7eqc_41",qE="_description_o7eqc_55",GE="_statusLine_o7eqc_62",FE="_statusCompleted_o7eqc_72",ZE="_statusRunning_o7eqc_77",KE="_statusError_o7eqc_83",YE="_promptToggle_o7eqc_88",os={badgePill:$E,modelBadge:UE,backgroundBadge:PE,backgroundDot:HE,backgroundDotPulsing:VE,description:qE,statusLine:GE,statusCompleted:FE,statusRunning:ZE,statusError:KE,promptToggle:YE};function JE(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 WE=/^Agent\s+(completed|running|failed|error)\.\s*agent_id:\s*(\S+),?\s*([^\n]*)(?:\n\n([\s\S]*))?$/i;function XE(t){const s=WE.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 rp=5;function QE({tool:t,args:s,result:o,isError:r}){const[c,d]=y.useState(!1),[u,p]=y.useState(!1),m=JE(t,s),g=o===void 0,v=m.isPoll&&o?XE(o):void 0,b=(v==null?void 0:v.content)??o,x=(b==null?void 0:b.split(`
|
|
252
|
-
`))??[],S=x.length>rp,k=c?b:x.slice(0,rp).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:os.badgePill,"data-testid":"tool-card-agent-type",children:m.agentType}),m.model&&i.jsx("span",{className:os.modelBadge,"data-testid":"tool-card-agent-model",children:m.model}),m.isBackground&&i.jsxs("span",{className:os.backgroundBadge,"data-testid":"tool-card-agent-background",children:[i.jsx("span",{className:g?os.backgroundDotPulsing:os.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:os.description,"data-testid":"tool-card-agent-description",children:m.isResume?`Resuming: ${m.description}`:m.description}),v&&i.jsxs("div",{className:os.statusLine,"data-testid":"tool-card-agent-status",children:[i.jsx("span",{className:v.status==="completed"?os.statusCompleted:v.status==="running"?os.statusRunning:os.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:os.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-rp} more lines`]})]})]})}function lp(t){switch(aC(t.tool)){case"file-read":return i.jsx(Sy,{...t});case"file-edit":return i.jsx(VC,{...t});case"file-write":return i.jsx(Sy,{...t,writeVariant:!0});case"shell":return i.jsx(KC,{...t});case"search":return i.jsx(JC,{...t});case"todo":return i.jsx(hE,{...t});case"metadata":return i.jsx(vE,{...t});case"finding":return i.jsx(xE,{...t});case"task":return i.jsx(TE,{...t});case"workpad":return i.jsx(NE,{...t});case"knowledge":return i.jsx(AE,{...t});case"ipc":return i.jsx(ME,{...t});case"tool-search":return i.jsx(OE,{...t});case"agent":return i.jsx(QE,{...t});default:return i.jsx(zE,{...t})}}const eA="_systemContextEvent_hmqlm_1",tA="_systemContextHeader_hmqlm_7",nA="_systemContextBadge_hmqlm_28",sA="_systemContextToggle_hmqlm_37",aA="_systemContextPre_hmqlm_43",iA="_systemContextEllipsis_hmqlm_54",oA="_systemEvent_hmqlm_58",rA="_systemTimestamp_hmqlm_65",lA="_textEvent_hmqlm_69",cA="_codeBlockWrapper_hmqlm_156",dA="_codeBlockCopyButton_hmqlm_159",uA="_errorEvent_hmqlm_163",fA="_statusEvent_hmqlm_171",pA="_userInputEvent_hmqlm_180",mA="_userInputContent_hmqlm_186",hA="_signalEvent_hmqlm_203",gA="_signalBadge_hmqlm_214",vA="_signalContent_hmqlm_223",yA="_usageEvent_hmqlm_228",bA="_usageBadge_hmqlm_235",xA="_defaultEvent_hmqlm_244",$t={systemContextEvent:eA,systemContextHeader:tA,systemContextBadge:nA,systemContextToggle:sA,systemContextPre:aA,systemContextEllipsis:iA,systemEvent:oA,systemTimestamp:rA,textEvent:lA,codeBlockWrapper:cA,codeBlockCopyButton:dA,errorEvent:uA,statusEvent:fA,userInputEvent:pA,userInputContent:mA,signalEvent:hA,signalBadge:gA,signalContent:vA,usageEvent:yA,usageBadge:bA,defaultEvent:xA},jy=3;function _A({content:t}){const[s,o]=y.useState(!1),r=t.split(`
|
|
254
|
-
`),c=r.length>jy,d=s?t:r.slice(0,jy).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(bx,{size:lt}):i.jsx(aa,{size:lt})})]}),i.jsxs("pre",{className:$t.systemContextPre,children:[d,!s&&c&&i.jsx("span",{className:$t.systemContextEllipsis,children:"…"})]})]})}function kA({time:t,content:s}){return i.jsxs("div",{className:$t.systemEvent,children:[i.jsxs("span",{className:$t.systemTimestamp,children:["[",t,"]"]})," ",s]})}function $p(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map($p).join(""):t!=null&&typeof t=="object"&&"props"in t?$p(t.props.children):""}function SA({children:t,node:s,...o}){const r=$p(t);return i.jsxs("div",{className:$t.codeBlockWrapper,children:[i.jsx("pre",{...o,children:t}),i.jsx(BN,{text:r,"data-testid":"copy-code-block",className:$t.codeBlockCopyButton})]})}const TA={pre:SA};function wA({content:t}){return i.jsx("div",{className:$t.textEvent,children:i.jsx(yd,{remarkPlugins:[bd],rehypePlugins:[nC],components:TA,children:t})})}function jA({content:t}){return i.jsxs("div",{className:$t.errorEvent,children:["Error: ",t]})}function NA({content:t}){return i.jsxs("div",{className:$t.statusEvent,children:["--- ",t," ---"]})}function CA({content:t}){return i.jsx("div",{className:$t.userInputEvent,children:i.jsx("span",{className:$t.userInputContent,children:t})})}function EA({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 AA({content:t}){let s=t;try{const o=JSON.parse(t),r=Number(o.input_tokens)||0,c=Number(o.output_tokens)||0,d=Io(r+c),u=Ts(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 DA({content:t}){return i.jsx("div",{className:$t.defaultEvent,children:t})}function RA({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(_A,{content:t.content})}catch{}return i.jsx(kA,{time:r,content:t.content})}case"text":case"output":return i.jsx(wA,{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(lp,{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(lp,{tool:s.tool,args:s.args,result:d,isError:c,detailedResult:s.detailedResult}):i.jsx(lp,{tool:"Tool output",args:void 0,result:d,isError:c})}case"error":return i.jsx(jA,{content:t.content});case"status":return i.jsx(NA,{content:t.content});case"user_input":return i.jsx(CA,{content:t.content});case"signal":return i.jsx(EA,{content:t.content});case"usage":return i.jsx(AA,{content:t.content});default:return i.jsx(DA,{content:t.content})}}const _m=y.createContext({});function km(t){const s=y.useRef(null);return s.current===null&&(s.current=t()),s.current}const jd=y.createContext(null),Sm=y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class MA 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 IA({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(Sm);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(MA,{isPresent:s,childRef:r,sizeRef:c,children:y.cloneElement(t,{ref:r})})}const OA=({children:t,initial:s,isPresent:o,onExitComplete:r,custom:c,presenceAffectsLayout:d,mode:u})=>{const p=km(BA),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(IA,{isPresent:o,children:t})),i.jsx(jd.Provider,{value:v,children:t})};function BA(){return new Map}function Gx(t=!0){const s=y.useContext(jd);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 Ic=t=>t.key||"";function Ny(t){const s=[];return y.Children.forEach(t,o=>{y.isValidElement(o)&&s.push(o)}),s}const Tm=typeof window<"u",Fx=Tm?y.useLayoutEffect:y.useEffect,fs=({children:t,custom:s,initial:o=!0,onExitComplete:r,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1})=>{const[p,m]=Gx(u),g=y.useMemo(()=>Ny(t),[t]),v=u&&!p?[]:g.map(Ic),b=y.useRef(!0),x=y.useRef(g),S=km(()=>new Map),[k,w]=y.useState(g),[N,T]=y.useState(g);Fx(()=>{b.current=!1,x.current=g;for(let B=0;B<N.length;B++){const E=Ic(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=Ic(A);v.includes(P)||(B.splice(E,0,A),C.push(A))}d==="wait"&&C.length&&(B=C),T(Ny(B)),w(g);return}const{forceRender:D}=y.useContext(_m);return i.jsx(i.Fragment,{children:N.map(B=>{const E=Ic(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(OA,{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)})})},On=t=>t;let Zx=On;const LA={useManualTiming:!1};function zA(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 Oc=["read","resolveKeyframes","update","preRender","render","postRender"],$A=40;function Kx(t,s){let o=!1,r=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=()=>o=!0,u=Oc.reduce((T,C)=>(T[C]=zA(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,$A),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:Oc.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<Oc.length;C++)u[Oc[C]].cancel(T)},state:c,steps:u}}const{schedule:_t,cancel:Pa,state:rn,steps:cp}=Kx(typeof requestAnimationFrame<"u"?requestAnimationFrame:On,!0),Yx=y.createContext({strict:!1}),Cy={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"]},Oo={};for(const t in Cy)Oo[t]={isEnabled:s=>Cy[t].some(o=>!!s[o])};function UA(t){for(const s in t)Oo[s]={...Oo[s],...t[s]}}const PA=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 sd(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||PA.has(t)}let Jx=t=>!sd(t);function HA(t){t&&(Jx=s=>s.startsWith("on")?!sd(s):t(s))}try{HA(require("@emotion/is-prop-valid").default)}catch{}function VA(t,s,o){const r={};for(const c in t)c==="values"&&typeof t.values=="object"||(Jx(c)||o===!0&&sd(c)||!s&&!sd(c)||t.draggable&&c.startsWith("onDrag"))&&(r[c]=t[c]);return r}function qA(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 Nd=y.createContext({});function sl(t){return typeof t=="string"||Array.isArray(t)}function Cd(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const wm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jm=["initial",...wm];function Ed(t){return Cd(t.animate)||jm.some(s=>sl(t[s]))}function Wx(t){return!!(Ed(t)||t.variants)}function GA(t,s){if(Ed(t)){const{initial:o,animate:r}=t;return{initial:o===!1||sl(o)?o:void 0,animate:sl(r)?r:void 0}}return t.inherit!==!1?s:{}}function FA(t){const{initial:s,animate:o}=GA(t,y.useContext(Nd));return y.useMemo(()=>({initial:s,animate:o}),[Ey(s),Ey(o)])}function Ey(t){return Array.isArray(t)?t.join(" "):t}const ZA=Symbol.for("motionComponentSymbol");function jo(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function KA(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):jo(o)&&(o.current=r))},[s])}const Nm=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),YA="framerAppearId",Xx="data-"+Nm(YA),{schedule:Cm}=Kx(queueMicrotask,!1),Qx=y.createContext({});function JA(t,s,o,r,c){var d,u;const{visualElement:p}=y.useContext(Nd),m=y.useContext(Yx),g=y.useContext(jd),v=y.useContext(Sm).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(Qx);x&&!x.projection&&c&&(x.type==="html"||x.type==="svg")&&WA(b.current,o,c,S);const k=y.useRef(!1);y.useInsertionEffect(()=>{x&&k.current&&x.update(o,g)});const w=o[Xx],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 Fx(()=>{x&&(k.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),Cm.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 WA(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:e_(t.parent)),t.projection.setOptions({layoutId:c,layout:d,alwaysMeasureLayout:!!u||p&&jo(p),visualElement:t,animationType:typeof d=="string"?d:"both",initialPromotionConfig:r,layoutScroll:m,layoutRoot:g})}function e_(t){if(t)return t.options.allowProjection!==!1?t.projection:e_(t.parent)}function XA({preloadedFeatures:t,createVisualElement:s,useRender:o,useVisualState:r,Component:c}){var d,u;t&&UA(t);function p(g,v){let b;const x={...y.useContext(Sm),...g,layoutId:QA(g)},{isStatic:S}=x,k=FA(g),w=r(g,S);if(!S&&Tm){eD();const N=tD(x);b=N.MeasureLayout,k.visualElement=JA(c,w,x,s,N.ProjectionNode)}return i.jsxs(Nd.Provider,{value:k,children:[b&&k.visualElement?i.jsx(b,{visualElement:k.visualElement,...x}):null,o(c,g,KA(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[ZA]=c,m}function QA({layoutId:t}){const s=y.useContext(_m).id;return s&&t!==void 0?s+"-"+t:t}function eD(t,s){y.useContext(Yx).strict}function tD(t){const{drag:s,layout:o}=Oo;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 nD=["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 Em(t){return typeof t!="string"||t.includes("-")?!1:!!(nD.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ay(t){const s=[{},{}];return t==null||t.values.forEach((o,r)=>{s[0][r]=o.get(),s[1][r]=o.getVelocity()}),s}function Am(t,s,o,r){if(typeof s=="function"){const[c,d]=Ay(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]=Ay(r);s=s(o!==void 0?o:t.custom,c,d)}return s}const Up=t=>Array.isArray(t),sD=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),aD=t=>Up(t)?t[t.length-1]||0:t,un=t=>!!(t&&t.getVelocity);function Yc(t){const s=un(t)?t.get():t;return sD(s)?s.toValue():s}function iD({scrapeMotionValuesFromProps:t,createRenderState:s,onUpdate:o},r,c,d){const u={latestValues:oD(r,c,d,t),renderState:s()};return o&&(u.onMount=p=>o({props:r,current:p,...u}),u.onUpdate=p=>o(p)),u}const t_=t=>(s,o)=>{const r=y.useContext(Nd),c=y.useContext(jd),d=()=>iD(t,s,r,c);return o?d():km(d)};function oD(t,s,o,r){const c={},d=r(t,{});for(const x in d)c[x]=Yc(d[x]);let{initial:u,animate:p}=t;const m=Ed(t),g=Wx(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"&&!Cd(b)){const x=Array.isArray(b)?b:[b];for(let S=0;S<x.length;S++){const k=Am(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 Ho=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Mi=new Set(Ho),n_=t=>s=>typeof s=="string"&&s.startsWith(t),s_=n_("--"),rD=n_("var(--"),Dm=t=>rD(t)?lD.test(t.split("/*")[0].trim()):!1,lD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,a_=(t,s)=>s&&typeof t=="number"?s.transform(t):t,na=(t,s,o)=>o>s?s:o<t?t:o,Vo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},al={...Vo,transform:t=>na(0,1,t)},Bc={...Vo,default:1},fl=t=>({test:s=>typeof s=="string"&&s.endsWith(t)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${t}`}),Ba=fl("deg"),js=fl("%"),Ae=fl("px"),cD=fl("vh"),dD=fl("vw"),Dy={...js,parse:t=>js.parse(t)/100,transform:t=>js.transform(t*100)},uD={borderWidth:Ae,borderTopWidth:Ae,borderRightWidth:Ae,borderBottomWidth:Ae,borderLeftWidth:Ae,borderRadius:Ae,radius:Ae,borderTopLeftRadius:Ae,borderTopRightRadius:Ae,borderBottomRightRadius:Ae,borderBottomLeftRadius:Ae,width:Ae,maxWidth:Ae,height:Ae,maxHeight:Ae,top:Ae,right:Ae,bottom:Ae,left:Ae,padding:Ae,paddingTop:Ae,paddingRight:Ae,paddingBottom:Ae,paddingLeft:Ae,margin:Ae,marginTop:Ae,marginRight:Ae,marginBottom:Ae,marginLeft:Ae,backgroundPositionX:Ae,backgroundPositionY:Ae},fD={rotate:Ba,rotateX:Ba,rotateY:Ba,rotateZ:Ba,scale:Bc,scaleX:Bc,scaleY:Bc,scaleZ:Bc,skew:Ba,skewX:Ba,skewY:Ba,distance:Ae,translateX:Ae,translateY:Ae,translateZ:Ae,x:Ae,y:Ae,z:Ae,perspective:Ae,transformPerspective:Ae,opacity:al,originX:Dy,originY:Dy,originZ:Ae},Ry={...Vo,transform:Math.round},Rm={...uD,...fD,zIndex:Ry,size:Ae,fillOpacity:al,strokeOpacity:al,numOctaves:Ry},pD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mD=Ho.length;function hD(t,s,o){let r="",c=!0;for(let d=0;d<mD;d++){const u=Ho[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=a_(p,Rm[u]);if(!m){c=!1;const v=pD[u]||u;r+=`${v}(${g}) `}o&&(s[u]=g)}}return r=r.trim(),o?r=o(s,c?"":r):c&&(r="none"),r}function Mm(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(Mi.has(m)){u=!0;continue}else if(s_(m)){c[m]=g;continue}else{const v=a_(g,Rm[m]);m.startsWith("origin")?(p=!0,d[m]=v):r[m]=v}}if(s.transform||(u||o?r.transform=hD(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 gD={offset:"stroke-dashoffset",array:"stroke-dasharray"},vD={offset:"strokeDashoffset",array:"strokeDasharray"};function yD(t,s,o=1,r=0,c=!0){t.pathLength=1;const d=c?gD:vD;t[d.offset]=Ae.transform(-r);const u=Ae.transform(s),p=Ae.transform(o);t[d.array]=`${u} ${p}`}function My(t,s,o){return typeof t=="string"?t:Ae.transform(s+o*t)}function bD(t,s,o){const r=My(s,t.x,t.width),c=My(o,t.y,t.height);return`${r} ${c}`}function Im(t,{attrX:s,attrY:o,attrScale:r,originX:c,originY:d,pathLength:u,pathSpacing:p=1,pathOffset:m=0,...g},v,b){if(Mm(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=bD(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&&yD(x,u,p,m,!1)}const Om=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),i_=()=>({...Om(),attrs:{}}),Bm=t=>typeof t=="string"&&t.toLowerCase()==="svg";function o_(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 r_=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 l_(t,s,o,r){o_(t,s,void 0,r);for(const c in s.attrs)t.setAttribute(r_.has(c)?c:Nm(c),s.attrs[c])}const ad={};function xD(t){Object.assign(ad,t)}function c_(t,{layout:s,layoutId:o}){return Mi.has(t)||t.startsWith("origin")||(s||o!==void 0)&&(!!ad[t]||t==="opacity")}function Lm(t,s,o){var r;const{style:c}=t,d={};for(const u in c)(un(c[u])||s.style&&un(s.style[u])||c_(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 d_(t,s,o){const r=Lm(t,s,o);for(const c in t)if(un(t[c])||un(s[c])){const d=Ho.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;r[d]=t[c]}return r}function _D(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 Iy=["x","y","width","height","cx","cy","r"],kD={useVisualState:t_({scrapeMotionValuesFromProps:d_,createRenderState:i_,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(Mi.has(p)){d=!0;break}}if(!d)return;let u=!s;if(s)for(let p=0;p<Iy.length;p++){const m=Iy[p];t[m]!==s[m]&&(u=!0)}u&&_t.read(()=>{_D(o,r),_t.render(()=>{Im(r,c,Bm(o.tagName),t.transformTemplate),l_(o,r)})})}})},SD={useVisualState:t_({scrapeMotionValuesFromProps:Lm,createRenderState:Om})};function u_(t,s,o){for(const r in s)!un(s[r])&&!c_(r,o)&&(t[r]=s[r])}function TD({transformTemplate:t},s){return y.useMemo(()=>{const o=Om();return Mm(o,s,t),Object.assign({},o.vars,o.style)},[s])}function wD(t,s){const o=t.style||{},r={};return u_(r,o,t),Object.assign(r,TD(t,s)),r}function jD(t,s){const o={},r=wD(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 ND(t,s,o,r){const c=y.useMemo(()=>{const d=i_();return Im(d,s,Bm(r),t.transformTemplate),{...d.attrs,style:{...d.style}}},[s]);if(t.style){const d={};u_(d,t.style,t),c.style={...d,...c.style}}return c}function CD(t=!1){return(o,r,c,{latestValues:d},u)=>{const m=(Em(o)?ND:jD)(r,d,u,o),g=VA(r,typeof o=="string",t),v=o!==y.Fragment?{...g,...m,ref:c}:{},{children:b}=r,x=y.useMemo(()=>un(b)?b.get():b,[b]);return y.createElement(o,{...v,children:x})}}function ED(t,s){return function(r,{forwardMotionProps:c}={forwardMotionProps:!1}){const u={...Em(r)?kD:SD,preloadedFeatures:t,useRender:CD(c),createVisualElement:s,Component:r};return XA(u)}}function f_(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 Ad(t,s,o){const r=t.getProps();return Am(r,s,o!==void 0?o:r.custom,t)}function zm(t,s){return t?t[s]||t.default||t:void 0}const p_=new Set(["width","height","top","left","right","bottom",...Ho]);let Jc;function AD(){Jc=void 0}const Ns={now:()=>(Jc===void 0&&Ns.set(rn.isProcessing||LA.useManualTiming?rn.timestamp:performance.now()),Jc),set:t=>{Jc=t,queueMicrotask(AD)}};function $m(t,s){t.indexOf(s)===-1&&t.push(s)}function Um(t,s){const o=t.indexOf(s);o>-1&&t.splice(o,1)}class Pm{constructor(){this.subscriptions=[]}add(s){return $m(this.subscriptions,s),()=>Um(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 m_(t,s){return s?t*(1e3/s):0}const Oy=30,DD=t=>!isNaN(parseFloat(t));class RD{constructor(s,o={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,c=!0)=>{const d=Ns.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=Ns.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=DD(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 Pm);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=Ns.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>Oy)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,Oy);return m_(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 il(t,s){return new RD(t,s)}function MD(t,s,o){t.hasValue(s)?t.getValue(s).set(o):t.addValue(s,il(o))}function ID(t,s){const o=Ad(t,s);let{transitionEnd:r={},transition:c={},...d}=o||{};d={...d,...r};for(const u in d){const p=aD(d[u]);MD(t,u,p)}}function OD(t){return!!(un(t)&&t.add)}function Pp(t,s){const o=t.getValue("willChange");if(OD(o))return o.add(s)}function h_(t){return t.props[Xx]}function Hm(t){let s;return()=>(s===void 0&&(s=t()),s)}const BD=Hm(()=>window.ScrollTimeline!==void 0);class LD{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(BD()&&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 zD extends LD{then(s,o){return Promise.all(this.animations).then(s).catch(o)}}const Xs=t=>t*1e3,Qs=t=>t/1e3;function Vm(t){return typeof t=="function"}function By(t,s){t.timeline=s,t.onfinish=null}const qm=t=>Array.isArray(t)&&typeof t[0]=="number",$D={linearEasing:void 0};function UD(t,s){const o=Hm(t);return()=>{var r;return(r=$D[s])!==null&&r!==void 0?r:o()}}const id=UD(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bo=(t,s,o)=>{const r=s-t;return r===0?1:(o-t)/r},g_=(t,s,o=10)=>{let r="";const c=Math.max(Math.round(s/o),2);for(let d=0;d<c;d++)r+=t(Bo(0,c-1,d))+", ";return`linear(${r.substring(0,r.length-2)})`};function v_(t){return!!(typeof t=="function"&&id()||!t||typeof t=="string"&&(t in Hp||id())||qm(t)||Array.isArray(t)&&t.every(v_))}const Vr=([t,s,o,r])=>`cubic-bezier(${t}, ${s}, ${o}, ${r})`,Hp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vr([0,.65,.55,1]),circOut:Vr([.55,0,1,.45]),backIn:Vr([.31,.01,.66,-.59]),backOut:Vr([.33,1.53,.69,.99])};function y_(t,s){if(t)return typeof t=="function"&&id()?g_(t,s):qm(t)?Vr(t):Array.isArray(t)?t.map(o=>y_(o,s)||Hp.easeOut):Hp[t]}const b_=(t,s,o)=>(((1-3*o+3*s)*t+(3*o-6*s))*t+3*s)*t,PD=1e-7,HD=12;function VD(t,s,o,r,c){let d,u,p=0;do u=s+(o-s)/2,d=b_(u,r,c)-t,d>0?o=u:s=u;while(Math.abs(d)>PD&&++p<HD);return u}function pl(t,s,o,r){if(t===s&&o===r)return On;const c=d=>VD(d,0,1,t,o);return d=>d===0||d===1?d:b_(c(d),s,r)}const x_=t=>s=>s<=.5?t(2*s)/2:(2-t(2*(1-s)))/2,__=t=>s=>1-t(1-s),k_=pl(.33,1.53,.69,.99),Gm=__(k_),S_=x_(Gm),T_=t=>(t*=2)<1?.5*Gm(t):.5*(2-Math.pow(2,-10*(t-1))),Fm=t=>1-Math.sin(Math.acos(t)),w_=__(Fm),j_=x_(Fm),N_=t=>/^0[^.\s]+$/u.test(t);function qD(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||N_(t):!0}const Kr=t=>Math.round(t*1e5)/1e5,Zm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GD(t){return t==null}const FD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Km=(t,s)=>o=>!!(typeof o=="string"&&FD.test(o)&&o.startsWith(t)||s&&!GD(o)&&Object.prototype.hasOwnProperty.call(o,s)),C_=(t,s,o)=>r=>{if(typeof r!="string")return r;const[c,d,u,p]=r.match(Zm);return{[t]:parseFloat(c),[s]:parseFloat(d),[o]:parseFloat(u),alpha:p!==void 0?parseFloat(p):1}},ZD=t=>na(0,255,t),dp={...Vo,transform:t=>Math.round(ZD(t))},Ti={test:Km("rgb","red"),parse:C_("red","green","blue"),transform:({red:t,green:s,blue:o,alpha:r=1})=>"rgba("+dp.transform(t)+", "+dp.transform(s)+", "+dp.transform(o)+", "+Kr(al.transform(r))+")"};function KD(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 Vp={test:Km("#"),parse:KD,transform:Ti.transform},No={test:Km("hsl","hue"),parse:C_("hue","saturation","lightness"),transform:({hue:t,saturation:s,lightness:o,alpha:r=1})=>"hsla("+Math.round(t)+", "+js.transform(Kr(s))+", "+js.transform(Kr(o))+", "+Kr(al.transform(r))+")"},dn={test:t=>Ti.test(t)||Vp.test(t)||No.test(t),parse:t=>Ti.test(t)?Ti.parse(t):No.test(t)?No.parse(t):Vp.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ti.transform(t):No.transform(t)},YD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function JD(t){var s,o;return isNaN(t)&&typeof t=="string"&&(((s=t.match(Zm))===null||s===void 0?void 0:s.length)||0)+(((o=t.match(YD))===null||o===void 0?void 0:o.length)||0)>0}const E_="number",A_="color",WD="var",XD="var(",Ly="${}",QD=/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 ol(t){const s=t.toString(),o=[],r={color:[],number:[],var:[]},c=[];let d=0;const p=s.replace(QD,m=>(dn.test(m)?(r.color.push(d),c.push(A_),o.push(dn.parse(m))):m.startsWith(XD)?(r.var.push(d),c.push(WD),o.push(m)):(r.number.push(d),c.push(E_),o.push(parseFloat(m))),++d,Ly)).split(Ly);return{values:o,split:p,indexes:r,types:c}}function D_(t){return ol(t).values}function R_(t){const{split:s,types:o}=ol(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===E_?d+=Kr(c[u]):p===A_?d+=dn.transform(c[u]):d+=c[u]}return d}}const eR=t=>typeof t=="number"?0:t;function tR(t){const s=D_(t);return R_(t)(s.map(eR))}const Ha={test:JD,parse:D_,createTransformer:R_,getAnimatableNone:tR},nR=new Set(["brightness","contrast","saturate","opacity"]);function sR(t){const[s,o]=t.slice(0,-1).split("(");if(s==="drop-shadow")return t;const[r]=o.match(Zm)||[];if(!r)return t;const c=o.replace(r,"");let d=nR.has(s)?1:0;return r!==o&&(d*=100),s+"("+d+c+")"}const aR=/\b([a-z-]*)\(.*?\)/gu,qp={...Ha,getAnimatableNone:t=>{const s=t.match(aR);return s?s.map(sR).join(" "):t}},iR={...Rm,color:dn,backgroundColor:dn,outlineColor:dn,fill:dn,stroke:dn,borderColor:dn,borderTopColor:dn,borderRightColor:dn,borderBottomColor:dn,borderLeftColor:dn,filter:qp,WebkitFilter:qp},Ym=t=>iR[t];function M_(t,s){let o=Ym(t);return o!==qp&&(o=Ha),o.getAnimatableNone?o.getAnimatableNone(s):void 0}const oR=new Set(["auto","none","0"]);function rR(t,s,o){let r=0,c;for(;r<t.length&&!c;){const d=t[r];typeof d=="string"&&!oR.has(d)&&ol(d).values.length&&(c=t[r]),r++}if(c&&o)for(const d of s)t[d]=M_(o,c)}const zy=t=>t===Vo||t===Ae,$y=(t,s)=>parseFloat(t.split(", ")[s]),Uy=(t,s)=>(o,{transform:r})=>{if(r==="none"||!r)return 0;const c=r.match(/^matrix3d\((.+)\)$/u);if(c)return $y(c[1],s);{const d=r.match(/^matrix\((.+)\)$/u);return d?$y(d[1],t):0}},lR=new Set(["x","y","z"]),cR=Ho.filter(t=>!lR.has(t));function dR(t){const s=[];return cR.forEach(o=>{const r=t.getValue(o);r!==void 0&&(s.push([o,r.get()]),r.set(o.startsWith("scale")?1:0))}),s}const Lo={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:Uy(4,13),y:Uy(5,14)};Lo.translateX=Lo.x;Lo.translateY=Lo.y;const wi=new Set;let Gp=!1,Fp=!1;function I_(){if(Fp){const t=Array.from(wi).filter(r=>r.needsMeasurement),s=new Set(t.map(r=>r.element)),o=new Map;s.forEach(r=>{const c=dR(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)})}Fp=!1,Gp=!1,wi.forEach(t=>t.complete()),wi.clear()}function O_(){wi.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fp=!0)})}function uR(){O_(),I_()}class Jm{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?(wi.add(this),Gp||(Gp=!0,_t.read(O_),_t.resolveKeyframes(I_))):(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),wi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,wi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const B_=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),fR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pR(t){const s=fR.exec(t);if(!s)return[,];const[,o,r,c]=s;return[`--${o??r}`,c]}function L_(t,s,o=1){const[r,c]=pR(t);if(!r)return;const d=window.getComputedStyle(s).getPropertyValue(r);if(d){const u=d.trim();return B_(u)?parseFloat(u):u}return Dm(c)?L_(c,s,o+1):c}const z_=t=>s=>s.test(t),mR={test:t=>t==="auto",parse:t=>t},$_=[Vo,Ae,js,Ba,dD,cD,mR],Py=t=>$_.find(z_(t));class U_ extends Jm{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(),Dm(g))){const v=L_(g,o.current);v!==void 0&&(s[m]=v),m===s.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!p_.has(r)||s.length!==2)return;const[c,d]=s,u=Py(c),p=Py(d);if(u!==p)if(zy(u)&&zy(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++)qD(s[c])&&r.push(c);r.length&&rR(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=Lo[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]=Lo[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 Hy=(t,s)=>s==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ha.test(t)||t==="0")&&!t.startsWith("url("));function hR(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 gR(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=Hy(c,s),p=Hy(d,s);return!u||!p?!1:hR(t)||(o==="spring"||Vm(o))&&r}const vR=t=>t!==null;function Dd(t,{repeat:s,repeatType:o="loop"},r){const c=t.filter(vR),d=s&&o!=="loop"&&s%2===1?0:c.length-1;return!d||r===void 0?c[d]:r}const yR=40;class P_{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=Ns.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>yR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&uR(),this._resolved}onKeyframesResolved(s,o){this.resolvedAt=Ns.now(),this.hasAttemptedResolve=!0;const{name:r,type:c,velocity:d,delay:u,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!gR(s,r,c,d))if(u)this.options.duration=0;else{m&&m(Dd(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 Zp=2e4;function H_(t){let s=0;const o=50;let r=t.next(s);for(;!r.done&&s<Zp;)s+=o,r=t.next(s);return s>=Zp?1/0:s}const Nt=(t,s,o)=>t+(s-t)*o;function up(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 bR({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=up(m,p,t+1/3),d=up(m,p,t),u=up(m,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(u*255),alpha:r}}function od(t,s){return o=>o>0?s:t}const fp=(t,s,o)=>{const r=t*t,c=o*(s*s-r)+r;return c<0?0:Math.sqrt(c)},xR=[Vp,Ti,No],_R=t=>xR.find(s=>s.test(t));function Vy(t){const s=_R(t);if(!s)return!1;let o=s.parse(t);return s===No&&(o=bR(o)),o}const qy=(t,s)=>{const o=Vy(t),r=Vy(s);if(!o||!r)return od(t,s);const c={...o};return d=>(c.red=fp(o.red,r.red,d),c.green=fp(o.green,r.green,d),c.blue=fp(o.blue,r.blue,d),c.alpha=Nt(o.alpha,r.alpha,d),Ti.transform(c))},kR=(t,s)=>o=>s(t(o)),ml=(...t)=>t.reduce(kR),Kp=new Set(["none","hidden"]);function SR(t,s){return Kp.has(t)?o=>o<=0?t:s:o=>o>=1?s:t}function TR(t,s){return o=>Nt(t,s,o)}function Wm(t){return typeof t=="number"?TR:typeof t=="string"?Dm(t)?od:dn.test(t)?qy:NR:Array.isArray(t)?V_:typeof t=="object"?dn.test(t)?qy:wR:od}function V_(t,s){const o=[...t],r=o.length,c=t.map((d,u)=>Wm(d)(d,s[u]));return d=>{for(let u=0;u<r;u++)o[u]=c[u](d);return o}}function wR(t,s){const o={...t,...s},r={};for(const c in o)t[c]!==void 0&&s[c]!==void 0&&(r[c]=Wm(t[c])(t[c],s[c]));return c=>{for(const d in r)o[d]=r[d](c);return o}}function jR(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 NR=(t,s)=>{const o=Ha.createTransformer(s),r=ol(t),c=ol(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?Kp.has(t)&&!c.values.length||Kp.has(s)&&!r.values.length?SR(t,s):ml(V_(jR(r,c),c.values),o):od(t,s)};function q_(t,s,o){return typeof t=="number"&&typeof s=="number"&&typeof o=="number"?Nt(t,s,o):Wm(t)(t,s)}const CR=5;function G_(t,s,o){const r=Math.max(s-CR,0);return m_(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},pp=.001;function ER({duration:t=Dt.duration,bounce:s=Dt.bounce,velocity:o=Dt.velocity,mass:r=Dt.mass}){let c,d,u=1-s;u=na(Dt.minDamping,Dt.maxDamping,u),t=na(Dt.minDuration,Dt.maxDuration,Qs(t)),u<1?(c=g=>{const v=g*u,b=v*t,x=v-o,S=Yp(g,u),k=Math.exp(-b);return pp-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=Yp(Math.pow(g,2),u);return(-c(g)+pp>0?-1:1)*((x-S)*k)/w}):(c=g=>{const v=Math.exp(-g*t),b=(g-o)*t+1;return-pp+v*b},d=g=>{const v=Math.exp(-g*t),b=(o-g)*(t*t);return v*b});const p=5/t,m=DR(c,d,p);if(t=Xs(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 AR=12;function DR(t,s,o){let r=o;for(let c=1;c<AR;c++)r=r-t(r)/s(r);return r}function Yp(t,s){return t*Math.sqrt(1-s*s)}const RR=["duration","bounce"],MR=["stiffness","damping","mass"];function Gy(t,s){return s.some(o=>t[o]!==void 0)}function IR(t){let s={velocity:Dt.velocity,stiffness:Dt.stiffness,damping:Dt.damping,mass:Dt.mass,isResolvedFromDuration:!1,...t};if(!Gy(t,MR)&&Gy(t,RR))if(t.visualDuration){const o=t.visualDuration,r=2*Math.PI/(o*1.2),c=r*r,d=2*na(.05,1,1-(t.bounce||0))*Math.sqrt(c);s={...s,mass:Dt.mass,stiffness:c,damping:d}}else{const o=ER(t);s={...s,...o,mass:Dt.mass},s.isResolvedFromDuration=!0}return s}function F_(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}=IR({...o,velocity:-Qs(o.velocity||0)}),k=x||0,w=g/(2*Math.sqrt(m*v)),N=u-d,T=Qs(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=Yp(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?Xs(k):G_(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(H_(B),Zp),A=g_(P=>B.next(E*P).value,E,30);return E+"ms "+A}};return B}function Fy({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=F_({keyframes:[x.value,k(x.value)],velocity:G_(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 OR=pl(.42,0,1,1),BR=pl(0,0,.58,1),Z_=pl(.42,0,.58,1),LR=t=>Array.isArray(t)&&typeof t[0]!="number",zR={linear:On,easeIn:OR,easeInOut:Z_,easeOut:BR,circIn:Fm,circInOut:j_,circOut:w_,backIn:Gm,backInOut:S_,backOut:k_,anticipate:T_},Zy=t=>{if(qm(t)){Zx(t.length===4);const[s,o,r,c]=t;return pl(s,o,r,c)}else if(typeof t=="string")return zR[t];return t};function $R(t,s,o){const r=[],c=o||q_,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]||On:s;p=ml(m,p)}r.push(p)}return r}function UR(t,s,{clamp:o=!0,ease:r,mixer:c}={}){const d=t.length;if(Zx(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=$R(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=Bo(t[b],t[b+1],v);return p[b](x)};return o?v=>g(na(t[0],t[d-1],v)):g}function PR(t,s){const o=t[t.length-1];for(let r=1;r<=s;r++){const c=Bo(0,s,r);t.push(Nt(o,1,c))}}function HR(t){const s=[0];return PR(s,t.length-1),s}function VR(t,s){return t.map(o=>o*s)}function qR(t,s){return t.map(()=>s||Z_).splice(0,t.length-1)}function rd({duration:t=300,keyframes:s,times:o,ease:r="easeInOut"}){const c=LR(r)?r.map(Zy):Zy(r),d={done:!1,value:s[0]},u=VR(o&&o.length===s.length?o:HR(s),t),p=UR(u,s,{ease:Array.isArray(c)?c:qR(s,c)});return{calculatedDuration:t,next:m=>(d.value=p(m),d.done=m>=t,d)}}const GR=t=>{const s=({timestamp:o})=>t(o);return{start:()=>_t.update(s,!0),stop:()=>Pa(s),now:()=>rn.isProcessing?rn.timestamp:Ns.now()}},FR={decay:Fy,inertia:Fy,tween:rd,keyframes:rd,spring:F_},ZR=t=>t/100;class Xm extends P_{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)||Jm,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=Vm(o)?o:FR[o]||rd;let m,g;p!==rd&&typeof s[0]!="number"&&(m=ml(ZR,q_(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=H_(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=na(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=Dd(m,this.options,c)),N&&N(E.value),P&&this.finish(),E}get duration(){const{resolved:s}=this;return s?Qs(s.calculatedDuration):0}get time(){return Qs(this.currentTime)}set time(s){s=Xs(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=Qs(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:s=GR,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 KR=new Set(["opacity","clipPath","filter","transform"]);function YR(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=y_(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 JR=Hm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ld=10,WR=2e4;function XR(t){return Vm(t.type)||t.type==="spring"||!v_(t.ease)}function QR(t,s){const o=new Xm({...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<WR;)r=o.sample(d),c.push(r.value),d+=ld;return{times:void 0,keyframes:c,duration:d-ld,ease:"linear"}}const K_={anticipate:T_,backInOut:S_,circInOut:j_};function eM(t){return t in K_}class Ky extends P_{constructor(s){super(s);const{name:o,motionValue:r,element:c,keyframes:d}=this.options;this.resolver=new U_(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"&&id()&&eM(d)&&(d=K_[d]),XR(this.options)){const{onComplete:b,onUpdate:x,motionValue:S,element:k,...w}=this.options,N=QR(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=YR(p.owner.current,m,s,{...this.options,duration:r,times:c,ease:d});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(By(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:b}=this.options;p.set(Dd(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 Qs(o)}get time(){const{resolved:s}=this;if(!s)return 0;const{animation:o}=s;return Qs(o.currentTime||0)}set time(s){const{resolved:o}=this;if(!o)return;const{animation:r}=o;r.currentTime=Xs(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 On;const{animation:r}=o;By(r,s)}return On}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 Xm({...S,keyframes:r,duration:c,type:d,ease:u,times:p,isGenerator:!0}),w=Xs(this.time);g.setWithVelocity(k.sample(w-ld).value,k.sample(w).value,ld)}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 JR()&&r&&KR.has(r)&&!m&&!g&&!c&&d!=="mirror"&&u!==0&&p!=="inertia"}}const tM={type:"spring",stiffness:500,damping:25,restSpeed:10},nM=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),sM={type:"keyframes",duration:.8},aM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},iM=(t,{keyframes:s})=>s.length>2?sM:Mi.has(t)?t.startsWith("scale")?nM(s[1]):tM:aM;function oM({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 Qm=(t,s,o,r={},c,d)=>u=>{const p=zm(r,t)||{},m=p.delay||r.delay||0;let{elapsed:g=0}=r;g=g-Xs(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};oM(p)||(v={...v,...iM(t,v)}),v.duration&&(v.duration=Xs(v.duration)),v.repeatDelay&&(v.repeatDelay=Xs(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=Dd(v.keyframes,p);if(x!==void 0)return _t.update(()=>{v.onUpdate(x),v.onComplete()}),new zD([])}return!d&&Ky.supports(v)?new Ky(v):new Xm(v)};function rM({protectedKeys:t,needsAnimating:s},o){const r=t.hasOwnProperty(o)&&s[o]!==!0;return s[o]=!1,r}function Y_(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&&rM(v,b))continue;const k={delay:o,...zm(u||{},b)};let w=!1;if(window.MotionHandoffAnimation){const T=h_(t);if(T){const C=window.MotionHandoffAnimation(T,b,_t);C!==null&&(k.startTime=C,w=!0)}}Pp(t,b),x.start(Qm(b,x,S,t.shouldReduceMotion&&p_.has(b)?{type:!1}:k,t,w));const N=x.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{_t.update(()=>{p&&ID(t,p)})}),g}function Jp(t,s,o={}){var r;const c=Ad(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(Y_(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:b,staggerDirection:x}=d;return lM(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 lM(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(cM).forEach((g,v)=>{g.notify("AnimationStart",s),u.push(Jp(g,s,{...d,delay:o+m(v)}).then(()=>g.notify("AnimationComplete",s)))}),Promise.all(u)}function cM(t,s){return t.sortNodePosition(s)}function dM(t,s,o={}){t.notify("AnimationStart",s);let r;if(Array.isArray(s)){const c=s.map(d=>Jp(t,d,o));r=Promise.all(c)}else if(typeof s=="string")r=Jp(t,s,o);else{const c=typeof s=="function"?Ad(t,s,o.custom):s;r=Promise.all(Y_(t,c,o))}return r.then(()=>{t.notify("AnimationComplete",s)})}const uM=jm.length;function J_(t){if(!t)return;if(!t.isControllingVariants){const o=t.parent?J_(t.parent)||{}:{};return t.props.initial!==void 0&&(o.initial=t.props.initial),o}const s={};for(let o=0;o<uM;o++){const r=jm[o],c=t.props[r];(sl(c)||c===!1)&&(s[r]=c)}return s}const fM=[...wm].reverse(),pM=wm.length;function mM(t){return s=>Promise.all(s.map(({animation:o,options:r})=>dM(t,o,r)))}function hM(t){let s=mM(t),o=Yy(),r=!0;const c=m=>(g,v)=>{var b;const x=Ad(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=J_(t.parent)||{},b=[],x=new Set;let S={},k=1/0;for(let N=0;N<pM;N++){const T=fM[N],C=o[T],D=g[T]!==void 0?g[T]:v[T],B=sl(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||Cd(D)||typeof D=="boolean")continue;const P=gM(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;Up(J)&&Up(ce)?X=!f_(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=Yy(),r=!0}}}function gM(t,s){return typeof s=="string"?s!==t:Array.isArray(s)?!f_(s,t):!1}function yi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Yy(){return{animate:yi(!0),whileInView:yi(),whileHover:yi(),whileTap:yi(),whileDrag:yi(),whileFocus:yi(),exit:yi()}}class Ga{constructor(s){this.isMounted=!1,this.node=s}update(){}}class vM extends Ga{constructor(s){super(s),s.animationState||(s.animationState=hM(s))}updateAnimationControlsSubscription(){const{animate:s}=this.node.getProps();Cd(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 yM=0;class bM extends Ga{constructor(){super(...arguments),this.id=yM++}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 xM={animation:{Feature:vM},exit:{Feature:bM}},ds={x:!1,y:!1};function W_(){return ds.x||ds.y}function _M(t){return t==="x"||t==="y"?ds[t]?null:(ds[t]=!0,()=>{ds[t]=!1}):ds.x||ds.y?null:(ds.x=ds.y=!0,()=>{ds.x=ds.y=!1})}const eh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function rl(t,s,o,r={passive:!0}){return t.addEventListener(s,o,r),()=>t.removeEventListener(s,o)}function hl(t){return{point:{x:t.pageX,y:t.pageY}}}const kM=t=>s=>eh(s)&&t(s,hl(s));function Yr(t,s,o,r){return rl(t,s,kM(o),r)}const Jy=(t,s)=>Math.abs(t-s);function SM(t,s){const o=Jy(t.x,s.x),r=Jy(t.y,s.y);return Math.sqrt(o**2+r**2)}class X_{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=hp(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,S=SM(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=mp(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=hp(b.type==="pointercancel"?this.lastMoveEventInfo:mp(x,this.transformPagePoint),this.history);this.startEvent&&S&&S(b,N),k&&k(b,N)},!eh(s))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=r,this.contextWindow=c||window;const u=hl(s),p=mp(u,this.transformPagePoint),{point:m}=p,{timestamp:g}=rn;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=o;v&&v(s,hp(p,this.history)),this.removeListeners=ml(Yr(this.contextWindow,"pointermove",this.handlePointerMove),Yr(this.contextWindow,"pointerup",this.handlePointerUp),Yr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(s){this.handlers=s}end(){this.removeListeners&&this.removeListeners(),Pa(this.updatePoint)}}function mp(t,s){return s?{point:s(t.point)}:t}function Wy(t,s){return{x:t.x-s.x,y:t.y-s.y}}function hp({point:t},s){return{point:t,delta:Wy(t,Q_(s)),offset:Wy(t,TM(s)),velocity:wM(s,.1)}}function TM(t){return t[0]}function Q_(t){return t[t.length-1]}function wM(t,s){if(t.length<2)return{x:0,y:0};let o=t.length-1,r=null;const c=Q_(t);for(;o>=0&&(r=t[o],!(c.timestamp-r.timestamp>Xs(s)));)o--;if(!r)return{x:0,y:0};const d=Qs(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 e1=1e-4,jM=1-e1,NM=1+e1,t1=.01,CM=0-t1,EM=0+t1;function Ln(t){return t.max-t.min}function AM(t,s,o){return Math.abs(t-s)<=o}function Xy(t,s,o,r=.5){t.origin=r,t.originPoint=Nt(s.min,s.max,t.origin),t.scale=Ln(o)/Ln(s),t.translate=Nt(o.min,o.max,t.origin)-t.originPoint,(t.scale>=jM&&t.scale<=NM||isNaN(t.scale))&&(t.scale=1),(t.translate>=CM&&t.translate<=EM||isNaN(t.translate))&&(t.translate=0)}function Jr(t,s,o,r){Xy(t.x,s.x,o.x,r?r.originX:void 0),Xy(t.y,s.y,o.y,r?r.originY:void 0)}function Qy(t,s,o){t.min=o.min+s.min,t.max=t.min+Ln(s)}function DM(t,s,o){Qy(t.x,s.x,o.x),Qy(t.y,s.y,o.y)}function eb(t,s,o){t.min=s.min-o.min,t.max=t.min+Ln(s)}function Wr(t,s,o){eb(t.x,s.x,o.x),eb(t.y,s.y,o.y)}function RM(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 tb(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 MM(t,{top:s,left:o,bottom:r,right:c}){return{x:tb(t.x,o,c),y:tb(t.y,s,r)}}function nb(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 IM(t,s){return{x:nb(t.x,s.x),y:nb(t.y,s.y)}}function OM(t,s){let o=.5;const r=Ln(t),c=Ln(s);return c>r?o=Bo(s.min,s.max-r,t.min):r>c&&(o=Bo(t.min,t.max-c,s.min)),na(0,1,o)}function BM(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 Wp=.35;function LM(t=Wp){return t===!1?t=0:t===!0&&(t=Wp),{x:sb(t,"left","right"),y:sb(t,"top","bottom")}}function sb(t,s,o){return{min:ab(t,s),max:ab(t,o)}}function ab(t,s){return typeof t=="number"?t:t[s]||0}const ib=()=>({translate:0,scale:1,origin:0,originPoint:0}),Co=()=>({x:ib(),y:ib()}),ob=()=>({min:0,max:0}),Lt=()=>({x:ob(),y:ob()});function Xn(t){return[t("x"),t("y")]}function n1({top:t,left:s,right:o,bottom:r}){return{x:{min:s,max:o},y:{min:t,max:r}}}function zM({x:t,y:s}){return{top:s.min,right:t.max,bottom:s.max,left:t.min}}function $M(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 gp(t){return t===void 0||t===1}function Xp({scale:t,scaleX:s,scaleY:o}){return!gp(t)||!gp(s)||!gp(o)}function ki(t){return Xp(t)||s1(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function s1(t){return rb(t.x)||rb(t.y)}function rb(t){return t&&t!=="0%"}function cd(t,s,o){const r=t-o,c=s*r;return o+c}function lb(t,s,o,r,c){return c!==void 0&&(t=cd(t,c,r)),cd(t,o,r)+s}function Qp(t,s=0,o=1,r,c){t.min=lb(t.min,s,o,r,c),t.max=lb(t.max,s,o,r,c)}function a1(t,{x:s,y:o}){Qp(t.x,s.translate,s.scale,s.originPoint),Qp(t.y,o.translate,o.scale,o.originPoint)}const cb=.999999999999,db=1.0000000000001;function UM(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&&Ao(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),u&&(s.x*=u.x.scale,s.y*=u.y.scale,a1(t,u)),r&&ki(d.latestValues)&&Ao(t,d.latestValues))}s.x<db&&s.x>cb&&(s.x=1),s.y<db&&s.y>cb&&(s.y=1)}function Eo(t,s){t.min=t.min+s,t.max=t.max+s}function ub(t,s,o,r,c=.5){const d=Nt(t.min,t.max,c);Qp(t,s,o,d,r)}function Ao(t,s){ub(t.x,s.x,s.scaleX,s.scale,s.originX),ub(t.y,s.y,s.scaleY,s.scale,s.originY)}function i1(t,s){return n1($M(t.getBoundingClientRect(),s))}function PM(t,s,o){const r=i1(t,o),{scroll:c}=s;return c&&(Eo(r.x,c.offset.x),Eo(r.y,c.offset.y)),r}const o1=({current:t})=>t?t.ownerDocument.defaultView:null,HM=new WeakMap;class VM{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(hl(v).point)},d=(v,b)=>{const{drag:x,dragPropagation:S,onDragStart:k}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_M(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),Xn(N=>{let T=this.getAxisMotionValue(N).get()||0;if(js.test(T)){const{projection:C}=this.visualElement;if(C&&C.layout){const D=C.layout.layoutBox[N];D&&(T=Ln(D)*(parseFloat(T)/100))}}this.originPoint[N]=T}),k&&_t.postRender(()=>k(v,b)),Pp(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=qM(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=()=>Xn(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 X_(s,{onSessionStart:c,onStart:d,onMove:u,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:o1(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||!Lc(s,c,this.currentDirection))return;const d=this.getAxisMotionValue(s);let u=this.originPoint[s]+r[s];this.constraints&&this.constraints[s]&&(u=RM(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&&jo(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=MM(c.layoutBox,o):this.constraints=!1,this.elastic=LM(r),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Xn(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=BM(c.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:s,onMeasureDragConstraints:o}=this.getProps();if(!s||!jo(s))return!1;const r=s.current,{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=PM(r,c.root,this.visualElement.getTransformPagePoint());let u=IM(c.layout.layoutBox,d);if(o){const p=o(zM(u));this.hasMutatedConstraints=!!p,p&&(u=n1(p))}return u}startAnimation(s){const{drag:o,dragMomentum:r,dragElastic:c,dragTransition:d,dragSnapToOrigin:u,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Xn(v=>{if(!Lc(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 Pp(this.visualElement,s),r.start(Qm(s,r,0,o,this.visualElement,!1))}stopAnimation(){Xn(s=>this.getAxisMotionValue(s).stop())}pauseAnimation(){Xn(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){Xn(o=>{const{drag:r}=this.getProps();if(!Lc(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(!jo(o)||!r||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};Xn(u=>{const p=this.getAxisMotionValue(u);if(p&&this.constraints!==!1){const m=p.get();c[u]=OM({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(),Xn(u=>{if(!Lc(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;HM.set(this.visualElement,this);const s=this.visualElement.current,o=Yr(s,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),r=()=>{const{dragConstraints:m}=this.getProps();jo(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=rl(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Xn(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=Wp,dragMomentum:p=!0}=s;return{...s,drag:o,dragDirectionLock:r,dragPropagation:c,dragConstraints:d,dragElastic:u,dragMomentum:p}}}function Lc(t,s,o){return(s===!0||s===t)&&(o===null||o===t)}function qM(t,s=10){let o=null;return Math.abs(t.y)>s?o="y":Math.abs(t.x)>s&&(o="x"),o}class GM extends Ga{constructor(s){super(s),this.removeGroupControls=On,this.removeListeners=On,this.controls=new VM(s)}mount(){const{dragControls:s}=this.node.getProps();s&&(this.removeGroupControls=s.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||On}unmount(){this.removeGroupControls(),this.removeListeners()}}const fb=t=>(s,o)=>{t&&_t.postRender(()=>t(s,o))};class FM extends Ga{constructor(){super(...arguments),this.removePointerDownListener=On}onPointerDown(s){this.session=new X_(s,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:o1(this.node)})}createPanHandlers(){const{onPanSessionStart:s,onPanStart:o,onPan:r,onPanEnd:c}=this.node.getProps();return{onSessionStart:fb(s),onStart:fb(o),onMove:r,onEnd:(d,u)=>{delete this.session,c&&_t.postRender(()=>c(d,u))}}}mount(){this.removePointerDownListener=Yr(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 Wc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pb(t,s){return s.max===s.min?0:t/(s.max-s.min)*100}const Br={correct:(t,s)=>{if(!s.target)return t;if(typeof t=="string")if(Ae.test(t))t=parseFloat(t);else return t;const o=pb(t,s.target.x),r=pb(t,s.target.y);return`${o}% ${r}%`}},ZM={correct:(t,{treeScale:s,projectionDelta:o})=>{const r=t,c=Ha.parse(t);if(c.length>5)return r;const d=Ha.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 KM extends y.Component{componentDidMount(){const{visualElement:s,layoutGroup:o,switchLayoutGroup:r,layoutId:c}=this.props,{projection:d}=s;xD(YM),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()})),Wc.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(),Cm.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 r1(t){const[s,o]=Gx(),r=y.useContext(_m);return i.jsx(KM,{...t,layoutGroup:r,switchLayoutGroup:y.useContext(Qx),isPresent:s,safeToRemove:o})}const YM={borderRadius:{...Br,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Br,borderTopRightRadius:Br,borderBottomLeftRadius:Br,borderBottomRightRadius:Br,boxShadow:ZM};function JM(t,s,o){const r=un(t)?t:il(t);return r.start(Qm("",r,s,o)),r.animation}function WM(t){return t instanceof SVGElement&&t.tagName!=="svg"}const XM=(t,s)=>t.depth-s.depth;class QM{constructor(){this.children=[],this.isDirty=!1}add(s){$m(this.children,s),this.isDirty=!0}remove(s){Um(this.children,s),this.isDirty=!0}forEach(s){this.isDirty&&this.children.sort(XM),this.isDirty=!1,this.children.forEach(s)}}function e4(t,s){const o=Ns.now(),r=({timestamp:c})=>{const d=c-o;d>=s&&(Pa(r),t(d-s))};return _t.read(r,!0),()=>Pa(r)}const l1=["TopLeft","TopRight","BottomLeft","BottomRight"],t4=l1.length,mb=t=>typeof t=="string"?parseFloat(t):t,hb=t=>typeof t=="number"||Ae.test(t);function n4(t,s,o,r,c,d){c?(t.opacity=Nt(0,o.opacity!==void 0?o.opacity:1,s4(r)),t.opacityExit=Nt(s.opacity!==void 0?s.opacity:1,0,a4(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<t4;u++){const p=`border${l1[u]}Radius`;let m=gb(s,p),g=gb(o,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||hb(m)===hb(g)?(t[p]=Math.max(Nt(mb(m),mb(g),r),0),(js.test(g)||js.test(m))&&(t[p]+="%")):t[p]=g}(s.rotate||o.rotate)&&(t.rotate=Nt(s.rotate||0,o.rotate||0,r))}function gb(t,s){return t[s]!==void 0?t[s]:t.borderRadius}const s4=c1(0,.5,w_),a4=c1(.5,.95,On);function c1(t,s,o){return r=>r<t?0:r>s?1:o(Bo(t,s,r))}function vb(t,s){t.min=s.min,t.max=s.max}function Yn(t,s){vb(t.x,s.x),vb(t.y,s.y)}function yb(t,s){t.translate=s.translate,t.scale=s.scale,t.originPoint=s.originPoint,t.origin=s.origin}function bb(t,s,o,r,c){return t-=s,t=cd(t,1/o,r),c!==void 0&&(t=cd(t,1/c,r)),t}function i4(t,s=0,o=1,r=.5,c,d=t,u=t){if(js.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=bb(t.min,s,o,p,c),t.max=bb(t.max,s,o,p,c)}function xb(t,s,[o,r,c],d,u){i4(t,s[o],s[r],s[c],s.scale,d,u)}const o4=["x","scaleX","originX"],r4=["y","scaleY","originY"];function _b(t,s,o,r){xb(t.x,s,o4,o?o.x:void 0,r?r.x:void 0),xb(t.y,s,r4,o?o.y:void 0,r?r.y:void 0)}function kb(t){return t.translate===0&&t.scale===1}function d1(t){return kb(t.x)&&kb(t.y)}function Sb(t,s){return t.min===s.min&&t.max===s.max}function l4(t,s){return Sb(t.x,s.x)&&Sb(t.y,s.y)}function Tb(t,s){return Math.round(t.min)===Math.round(s.min)&&Math.round(t.max)===Math.round(s.max)}function u1(t,s){return Tb(t.x,s.x)&&Tb(t.y,s.y)}function wb(t){return Ln(t.x)/Ln(t.y)}function jb(t,s){return t.translate===s.translate&&t.scale===s.scale&&t.originPoint===s.originPoint}class c4{constructor(){this.members=[]}add(s){$m(this.members,s),s.scheduleRender()}remove(s){if(Um(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 d4(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 Si={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},qr=typeof window<"u"&&window.MotionDebug!==void 0,vp=["","X","Y","Z"],u4={visibility:"hidden"},Nb=1e3;let f4=0;function yp(t,s,o,r){const{latestValues:c}=s;c[t]&&(o[t]=c[t],s.setStaticValue(t,0),r&&(r[t]=0))}function f1(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:s}=t.options;if(!s)return;const o=h_(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&&f1(r)}function p1({attachResizeListener:t,defaultParent:s,measureScroll:o,checkIsScrollRoot:r,resetTransform:c}){return class{constructor(u={},p=s==null?void 0:s()){this.id=f4++,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,qr&&(Si.totalNodes=Si.resolvedTargetDeltas=Si.recalculatedProjection=0),this.nodes.forEach(h4),this.nodes.forEach(x4),this.nodes.forEach(_4),this.nodes.forEach(g4),qr&&window.MotionDebug.record(Si)},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 QM)}addEventListener(u,p){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new Pm),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=WM(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=e4(x,250),Wc.hasAnimatedSinceResize&&(Wc.hasAnimatedSinceResize=!1,this.nodes.forEach(Eb))})}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()||j4,{onLayoutAnimationStart:N,onLayoutAnimationComplete:T}=v.getProps(),C=!this.targetLayout||!u1(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={...zm(w,"layout"),onPlay:N,onComplete:T};(v.shouldReduceMotion||this.options.layoutRoot)&&(B.delay=0,B.type=!1),this.startAnimation(B)}else x||Eb(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,Pa(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(k4),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&&f1(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(Cb);return}this.isUpdating||this.nodes.forEach(y4),this.isUpdating=!1,this.nodes.forEach(b4),this.nodes.forEach(p4),this.nodes.forEach(m4),this.clearAllSnapshots();const p=Ns.now();rn.delta=na(0,1e3/60,p-rn.timestamp),rn.timestamp=p,rn.isProcessing=!0,cp.update.process(rn),cp.preRender.process(rn),cp.render.process(rn),rn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Cm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(v4),this.sharedNodes.forEach(S4)}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&&!d1(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;u&&(p||ki(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)),N4(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(C4))){const{scroll:v}=this.root;v&&(Eo(m.x,v.offset.x),Eo(m.y,v.offset.y))}return m}removeElementScroll(u){var p;const m=Lt();if(Yn(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&&Yn(m,u),Eo(m.x,b.offset.x),Eo(m.y,b.offset.y))}return m}applyTransform(u,p=!1){const m=Lt();Yn(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&&Ao(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),ki(v.latestValues)&&Ao(m,v.latestValues)}return ki(this.latestValues)&&Ao(m,this.latestValues),m}removeTransform(u){const p=Lt();Yn(p,u);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!ki(g.latestValues))continue;Xp(g.latestValues)&&g.updateSnapshot();const v=Lt(),b=g.measurePageBox();Yn(v,b),_b(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return ki(this.latestValues)&&_b(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(),Wr(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Yn(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(),DM(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Yn(this.target,this.layout.layoutBox),a1(this.target,this.targetDelta)):Yn(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(),Wr(this.relativeTargetOrigin,this.target,S.target),Yn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}qr&&Si.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Xp(this.parent.latestValues)||s1(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;Yn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,S=this.treeScale.y;UM(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():(yb(this.prevProjectionDelta.x,this.projectionDelta.x),yb(this.prevProjectionDelta.y,this.projectionDelta.y)),Jr(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==S||!jb(this.projectionDelta.x,this.prevProjectionDelta.x)||!jb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),qr&&Si.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=Co(),this.projectionDelta=Co(),this.projectionDeltaWithTransform=Co()}setAnimationOrigin(u,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},b=Co();(!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(w4));this.animationProgress=0;let D;this.mixTargetDelta=B=>{const E=B/1e3;Ab(b.x,u.x,E),Ab(b.y,u.y,E),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Wr(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),T4(this.relativeTarget,this.relativeTargetOrigin,x,E),D&&l4(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=Lt()),Yn(D,this.relativeTarget)),w&&(this.animationValues=v,n4(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&&(Pa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_t.update(()=>{Wc.hasAnimatedSinceResize=!0,this.currentAnimation=JM(0,Nb,{...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(Nb),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&&m1(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Lt();const b=Ln(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+b;const x=Ln(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+x}Yn(p,m),Ao(p,v),Jr(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(u,p){this.sharedNodes.has(u)||this.sharedNodes.set(u,new c4),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&&yp("z",u,g,this.animationValues);for(let v=0;v<vp.length;v++)yp(`rotate${vp[v]}`,u,g,this.animationValues),yp(`skew${vp[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 u4;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Yc(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=Yc(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!ki(this.latestValues)&&(w.transform=v?v({},""):"none",this.hasProjected=!1),w}const x=b.animationValues||b.latestValues;this.applyTransformsToTarget(),g.transform=d4(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 ad){if(x[w]===void 0)continue;const{correct:N,applyTo:T}=ad[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?Yc(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(Cb),this.root.sharedNodes.clear()}}}function p4(t){t.updateLayout()}function m4(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"?Xn(b=>{const x=u?o.measuredBox[b]:o.layoutBox[b],S=Ln(x);x.min=r[b].min,x.max=x.min+S}):m1(d,o.layoutBox,r)&&Xn(b=>{const x=u?o.measuredBox[b]:o.layoutBox[b],S=Ln(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=Co();Jr(p,r,o.layoutBox);const m=Co();u?Jr(m,t.applyTransform(c,!0),o.measuredBox):Jr(m,r,o.layoutBox);const g=!d1(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();Wr(k,o.layoutBox,x.layoutBox);const w=Lt();Wr(w,r,S.layoutBox),u1(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 h4(t){qr&&Si.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 g4(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function v4(t){t.clearSnapshot()}function Cb(t){t.clearMeasurements()}function y4(t){t.isLayoutDirty=!1}function b4(t){const{visualElement:s}=t.options;s&&s.getProps().onBeforeLayoutMeasure&&s.notify("BeforeLayoutMeasure"),t.resetTransform()}function Eb(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function x4(t){t.resolveTargetDelta()}function _4(t){t.calcProjection()}function k4(t){t.resetSkewAndRotation()}function S4(t){t.removeLeadSnapshot()}function Ab(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 Db(t,s,o,r){t.min=Nt(s.min,o.min,r),t.max=Nt(s.max,o.max,r)}function T4(t,s,o,r){Db(t.x,s.x,o.x,r),Db(t.y,s.y,o.y,r)}function w4(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const j4={duration:.45,ease:[.4,0,.1,1]},Rb=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Mb=Rb("applewebkit/")&&!Rb("chrome/")?Math.round:On;function Ib(t){t.min=Mb(t.min),t.max=Mb(t.max)}function N4(t){Ib(t.x),Ib(t.y)}function m1(t,s,o){return t==="position"||t==="preserve-aspect"&&!AM(wb(s),wb(o),.2)}function C4(t){var s;return t!==t.root&&((s=t.scroll)===null||s===void 0?void 0:s.wasRoot)}const E4=p1({attachResizeListener:(t,s)=>rl(t,"resize",s),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bp={current:void 0},h1=p1({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!bp.current){const t=new E4({});t.mount(window),t.setOptions({layoutScroll:!0}),bp.current=t}return bp.current},resetTransform:(t,s)=>{t.style.transform=s!==void 0?s:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),A4={pan:{Feature:FM},drag:{Feature:GM,ProjectionNode:h1,MeasureLayout:r1}};function D4(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 g1(t,s){const o=D4(t),r=new AbortController,c={passive:!0,...s,signal:r.signal};return[o,c,()=>r.abort()]}function Ob(t){return s=>{s.pointerType==="touch"||W_()||t(s)}}function R4(t,s,o={}){const[r,c,d]=g1(t,o),u=Ob(p=>{const{target:m}=p,g=s(p);if(typeof g!="function"||!m)return;const v=Ob(b=>{g(b),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,c)});return r.forEach(p=>{p.addEventListener("pointerenter",u,c)}),d}function Bb(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,hl(s)))}class M4 extends Ga{mount(){const{current:s}=this.node;s&&(this.unmount=R4(s,o=>(Bb(this.node,o,"Start"),r=>Bb(this.node,r,"End"))))}unmount(){}}class I4 extends Ga{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=ml(rl(this.node.current,"focus",()=>this.onFocus()),rl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const v1=(t,s)=>s?t===s?!0:v1(t,s.parentElement):!1,O4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function B4(t){return O4.has(t.tagName)||t.tabIndex!==-1}const Gr=new WeakSet;function Lb(t){return s=>{s.key==="Enter"&&t(s)}}function xp(t,s){t.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const L4=(t,s)=>{const o=t.currentTarget;if(!o)return;const r=Lb(()=>{if(Gr.has(o))return;xp(o,"down");const c=Lb(()=>{xp(o,"up")}),d=()=>xp(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 zb(t){return eh(t)&&!W_()}function z4(t,s,o={}){const[r,c,d]=g1(t,o),u=p=>{const m=p.currentTarget;if(!zb(p)||Gr.has(m))return;Gr.add(m);const g=s(p),v=(S,k)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),!(!zb(S)||!Gr.has(m))&&(Gr.delete(m),typeof g=="function"&&g(S,{success:k}))},b=S=>{v(S,o.useGlobalTarget||v1(m,S.target))},x=S=>{v(S,!1)};window.addEventListener("pointerup",b,c),window.addEventListener("pointercancel",x,c)};return r.forEach(p=>{!B4(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(o.useGlobalTarget?window:p).addEventListener("pointerdown",u,c),p.addEventListener("focus",g=>L4(g,c),c)}),d}function $b(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,hl(s)))}class $4 extends Ga{mount(){const{current:s}=this.node;s&&(this.unmount=z4(s,o=>($b(this.node,o,"Start"),(r,{success:c})=>$b(this.node,r,c?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const em=new WeakMap,_p=new WeakMap,U4=t=>{const s=em.get(t.target);s&&s(t)},P4=t=>{t.forEach(U4)};function H4({root:t,...s}){const o=t||document;_p.has(o)||_p.set(o,{});const r=_p.get(o),c=JSON.stringify(s);return r[c]||(r[c]=new IntersectionObserver(P4,{root:t,...s})),r[c]}function V4(t,s,o){const r=H4(s);return em.set(t,o),r.observe(t),()=>{em.delete(t),r.unobserve(t)}}const q4={some:0,all:1};class G4 extends Ga{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:q4[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 V4(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(F4(s,o))&&this.startObserver()}unmount(){}}function F4({viewport:t={}},{viewport:s={}}={}){return o=>t[o]!==s[o]}const Z4={inView:{Feature:G4},tap:{Feature:$4},focus:{Feature:I4},hover:{Feature:M4}},K4={layout:{ProjectionNode:h1,MeasureLayout:r1}},dd={current:null},th={current:!1};function y1(){if(th.current=!0,!!Tm)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),s=()=>dd.current=t.matches;t.addListener(s),s()}else dd.current=!1}const Y4=[...$_,dn,Ha],J4=t=>Y4.find(z_(t)),Ub=new WeakMap;function W4(t,s,o){for(const r in s){const c=s[r],d=o[r];if(un(c))t.addValue(r,c);else if(un(d))t.addValue(r,il(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,il(u!==void 0?u:c,{owner:t}))}}for(const r in o)s[r]===void 0&&t.removeValue(r);return s}const Pb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class X4{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=Jm,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=Ns.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=Ed(o),this.isVariantNode=Wx(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&&un(k)&&k.set(m[S],!1)}}mount(s){this.current=s,Ub.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)),th.current||y1(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dd.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ub.delete(this.current),this.projection&&this.projection.unmount(),Pa(this.notifyUpdate),Pa(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=Mi.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 Oo){const o=Oo[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<Pb.length;r++){const c=Pb[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=W4(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=il(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"&&(B_(c)||N_(c))?c=parseFloat(c):!J4(c)&&Ha.test(o)&&(c=M_(s,o)),this.setBaseTarget(s,un(c)?c.get():c)),un(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=Am(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&&!un(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 Pm),this.events[s].add(o)}notify(s,...o){this.events[s]&&this.events[s].notify(...o)}}class b1 extends X4{constructor(){super(...arguments),this.KeyframeResolver=U_}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;un(s)&&(this.childSubscription=s.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}}function Q4(t){return window.getComputedStyle(t)}class e3 extends b1{constructor(){super(...arguments),this.type="html",this.renderInstance=o_}readValueFromInstance(s,o){if(Mi.has(o)){const r=Ym(o);return r&&r.default||0}else{const r=Q4(s),c=(s_(o)?r.getPropertyValue(o):r[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(s,{transformPagePoint:o}){return i1(s,o)}build(s,o,r){Mm(s,o,r.transformTemplate)}scrapeMotionValuesFromProps(s,o,r){return Lm(s,o,r)}}class t3 extends b1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Lt}getBaseTargetFromProps(s,o){return s[o]}readValueFromInstance(s,o){if(Mi.has(o)){const r=Ym(o);return r&&r.default||0}return o=r_.has(o)?o:Nm(o),s.getAttribute(o)}scrapeMotionValuesFromProps(s,o,r){return d_(s,o,r)}build(s,o,r){Im(s,o,this.isSVGTag,r.transformTemplate)}renderInstance(s,o,r,c){l_(s,o,r,c)}mount(s){this.isSVGTag=Bm(s.tagName),super.mount(s)}}const n3=(t,s)=>Em(t)?new t3(s):new e3(s,{allowProjection:t!==y.Fragment}),s3=ED({...xM,...Z4,...A4,...K4},n3),Rt=qA(s3);function a3(){!th.current&&y1();const[t]=y.useState(dd.current);return t}const i3="_overlay_cmicx_1",o3="_dialog_cmicx_11",r3="_title_cmicx_30",l3="_description_cmicx_38",c3="_actions_cmicx_45",d3="_cancelButton_cmicx_52",u3="_confirmButton_cmicx_79",bi={overlay:i3,dialog:o3,title:r3,description:l3,actions:c3,cancelButton:d3,confirmButton:u3};function Ei({isOpen:t,title:s,description:o,confirmLabel:r="Delete",onConfirm:c,onCancel:d}){const u=y.useId(),p=y.useId();return i.jsx(fs,{children:t&&i.jsx(Rt.div,{className:bi.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:bi.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:bi.title,children:s}),o&&i.jsx("p",{id:p,className:bi.description,children:o}),i.jsxs("div",{className:bi.actions,children:[i.jsx("button",{type:"button",className:bi.cancelButton,onClick:d,autoFocus:!0,children:"Cancel"}),i.jsx("button",{type:"button",className:bi.confirmButton,onClick:c,children:r})]})]})})})}const f3="_skeleton_1gqp4_9",p3="_circular_1gqp4_17",m3="_textContainer_1gqp4_26",h3="_card_1gqp4_31",ud={skeleton:f3,circular:p3,textContainer:m3,card:h3};function we({width:t="100%",height:s="1rem",borderRadius:o,variant:r="rectangular",className:c}){const d=[ud.skeleton,r==="circular"?ud.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 tm({lines:t=3,lastLineWidth:s="60%",lineHeight:o="0.75rem",gap:r="var(--space-sm)",className:c}){return i.jsx("div",{className:`${ud.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 fd({lines:t=2,className:s}){return i.jsxs("div",{className:`${ud.card} ${s??""}`,"aria-hidden":"true","data-testid":"skeleton-card",children:[i.jsx(we,{width:"40%",height:"1.25rem"}),i.jsx(tm,{lines:t})]})}const g3="_spinner_1uyt1_1",v3="_spin_1uyt1_1",y3="_sm_1uyt1_14",b3="_md_1uyt1_20",x3="_lg_1uyt1_26",_3="_xl_1uyt1_32",Hb={spinner:g3,spin:v3,sm:y3,md:b3,lg:x3,xl:_3};function x1({size:t="md",className:s,label:o="Loading",liveRegion:r=!1}){return i.jsx("span",{className:`${Hb.spinner} ${Hb[t]} ${s??""}`,role:r?"status":void 0,"aria-label":o,"aria-hidden":r?void 0:!0})}const k3="_splash_1bn1g_1",S3="_logo_1bn1g_11",Vb={splash:k3,logo:S3};function _1(){return i.jsxs("div",{className:Vb.splash,"data-testid":"splash-screen",children:[i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:Vb.logo}),i.jsx(x1,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}const T3="_wrapper_4e5yt_1",w3="_wrapperBlock_4e5yt_6",j3="_tooltip_4e5yt_11",N3="_visible_4e5yt_31",C3="_top_4e5yt_41",E3="_bottom_4e5yt_48",A3="_left_4e5yt_55",D3="_right_4e5yt_62",Lr={wrapper:T3,wrapperBlock:w3,tooltip:j3,visible:N3,top:C3,bottom:E3,left:A3,right:D3},R3=300,zc=6;function zo({text:t,placement:s="top",delayMs:o=R3,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-zc,W=U.left+U.width/2-Q.width/2;break;case"bottom":$=U.bottom+zc,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-zc;break;case"right":$=U.top+U.height/2-Q.height/2,W=U.right+zc;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?Lr.wrapper:Lr.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:`${Lr.tooltip} ${Lr[s]} ${p?Lr.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?gT.createPortal(I,document.body):null]})}const M3="_attemptSelector_ggigl_1",I3="_attemptLabel_ggigl_17",O3="_attemptButton_ggigl_21",B3="_attemptActive_ggigl_38",L3="_attemptStatus_ggigl_44",zr={attemptSelector:M3,attemptLabel:I3,attemptButton:O3,attemptActive:B3,attemptStatus:L3};function z3({taskSessions:t,selectedSessionId:s,onSelect:o}){if(!(t.length<2))return i.jsxs("div",{className:zr.attemptSelector,"data-testid":"attempt-selector",children:[i.jsx("span",{className:zr.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:`${zr.attemptButton} ${d?zr.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:zr.attemptStatus,children:u})]},r.id)})]})}const $3="_row_ldkru_1",U3="_hoverActions_ldkru_5",P3="_hoverButton_ldkru_31",H3="_selectingRow_ldkru_72",V3="_selected_ldkru_83",q3="_checkboxArea_ldkru_90",G3="_checkbox_ldkru_90",F3="_contentArea_ldkru_106",rs={row:$3,hoverActions:U3,hoverButton:P3,selectingRow:H3,selected:V3,checkboxArea:q3,checkbox:G3,contentArea:F3};function Z3({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:`${rs.row} ${rs.selectingRow} ${r?rs.selected:""}`,onClick:S,"data-testid":"event-selectable-row",children:[i.jsx("div",{className:rs.checkboxArea,children:i.jsx("input",{type:"checkbox",checked:r,onChange:k=>{u(k.nativeEvent.shiftKey)},onClick:k=>{k.stopPropagation()},className:rs.checkbox,"aria-label":c??"Select this event","data-testid":"event-select-checkbox"})}),i.jsx("div",{className:rs.contentArea,children:m})]}):i.jsxs("div",{className:rs.row,"data-testid":"event-hover-row",children:[i.jsxs("div",{className:rs.hoverActions,"data-testid":"event-hover-actions",children:[i.jsx("button",{type:"button",className:rs.hoverButton,onClick:()=>{x().catch(()=>{})},"aria-label":"Copy event content","data-testid":"event-hover-copy",children:g?i.jsx(Ai,{size:lt,"aria-hidden":"true"}):i.jsx(xx,{size:lt,"aria-hidden":"true"})}),i.jsx("button",{type:"button",className:rs.hoverButton,onClick:d,"aria-label":"Select this event","data-testid":"event-hover-select",children:i.jsx(aw,{size:lt,"aria-hidden":"true"})})]}),m]}):i.jsx("div",{className:rs.row,children:m})}const K3="_bar_1vah7_1",Y3="_left_1vah7_21",J3="_right_1vah7_27",W3="_count_1vah7_33",X3="_toggleButton_1vah7_40",Q3="_copyButton_1vah7_68",e6="_cancelButton_1vah7_108",xi={bar:K3,left:Y3,right:J3,count:W3,toggleButton:X3,copyButton:Q3,cancelButton:e6};function t6({selectedCount:t,totalSelectable:s,onSelectAll:o,onDeselectAll:r,onCopy:c,onCancel:d}){const u=t>0&&t>=s;return i.jsxs(Rt.div,{className:xi.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:xi.left,children:[i.jsxs("span",{className:xi.count,"data-testid":"floating-bar-count",children:[t," selected"]}),i.jsx("button",{type:"button",className:xi.toggleButton,onClick:u?r:o,"data-testid":"floating-bar-select-all",children:u?"Deselect all":"Select all"})]}),i.jsxs("div",{className:xi.right,children:[i.jsxs("button",{type:"button",className:xi.copyButton,onClick:c,disabled:t===0,"data-testid":"floating-bar-copy",children:[i.jsx(k2,{size:lt,"aria-hidden":"true"}),"Copy"]}),i.jsx("button",{type:"button",className:xi.cancelButton,onClick:d,"aria-label":"Cancel selection","data-testid":"floating-bar-cancel",children:i.jsx(Va,{size:lt,"aria-hidden":"true"})})]})]})}const k1=50;function n6(t,s,o,r,c=k1){return r?t<c:s-t-o<c}function s6(t,s){const o=s-t;return o>0?o:0}function a6({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=n6(v.scrollTop,v.scrollHeight,v.clientHeight,o,k1);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=s6(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 i6=new Set(["text","output","user_input","tool_use","tool_result","error"]);function ll(t){return i6.has(t.eventType)}function o6(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 qb(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 r6(t){var o;const s=[];for(const r of t){if(!ll(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=qb(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=qb(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 l6({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&&ll(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++)ll(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 c6="_wrapper_1cdza_1",d6="_scrollContainer_1cdza_9",u6="_selectingPadding_1cdza_16",f6="_toolbar_1cdza_20",p6="_directionToggle_1cdza_27",m6="_scrollToAnchor_1cdza_65",h6="_scrollToAnchorBottom_1cdza_89",g6="_scrollToAnchorTop_1cdza_93",v6="_eventOverflowWarning_1cdza_97",Js={wrapper:c6,scrollContainer:d6,selectingPadding:u6,toolbar:f6,directionToggle:p6,scrollToAnchor:m6,scrollToAnchorBottom:h6,scrollToAnchorTop:g6,eventOverflowWarning:v6};function y6(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 S1="grackle-stream-direction";function b6(){try{return localStorage.getItem(S1)==="reversed"}catch{return!1}}function x6({eventsDropped:t}){return t<=0?i.jsx(i.Fragment,{}):i.jsxs("div",{className:Js.eventOverflowWarning,role:"alert",children:[i.jsx(dm,{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 nh({events:t,eventsDropped:s,emptyState:o,onShowToast:r}){const c=y.useRef(null),[d,u]=y.useState(b6),p=a3(),m=l6({events:t,formatForClipboard:r6}),g=y.useMemo(()=>t.filter(ll).length,[t]),v=y.useMemo(()=>d?[...t].reverse():t,[t,d]),{isAtAnchor:b,scrollToAnchor:x}=a6({scrollRef:c,contentLength:t.length,isReversed:d,paused:m.isSelecting}),S=()=>{const T=!d;u(T);try{localStorage.setItem(S1,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:Js.wrapper,children:[i.jsx("div",{className:Js.toolbar,children:i.jsx(zo,{text:d?"Showing newest first":"Showing oldest first",children:i.jsx("button",{className:Js.directionToggle,onClick:S,"aria-label":d?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:d?i.jsx(uy,{size:tn,"aria-hidden":"true"}):i.jsx(fy,{size:tn,"aria-hidden":"true"})})})}),i.jsxs("div",{ref:c,className:`${Js.scrollContainer} ${m.isSelecting?Js.selectingPadding:""}`,"data-testid":"event-stream-scroll",children:[t.length===0&&o,i.jsx(x6,{eventsDropped:s}),i.jsx(fs,{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(Z3,{copyText:o6(T),isContentBearing:ll(T),isSelecting:m.isSelecting,isSelected:m.selectedIndices.has(D),checkboxLabel:y6(T),onSelect:()=>{m.enterSelectionMode(D)},onToggle:B=>{m.toggleEvent(D,B)},onCopied:()=>{r==null||r("Copied to clipboard","success")},children:i.jsx(RA,{event:T,toolUseCtx:T.toolUseCtx,settled:T.settled})})},`${T.sessionId}-${T.timestamp}-${D}`)})})]}),i.jsx(fs,{children:m.isSelecting&&i.jsx(t6,{selectedCount:m.selectedCount,totalSelectable:g,onSelectAll:m.selectAll,onDeselectAll:m.deselectAll,onCopy:()=>{k().catch(()=>{})},onCancel:m.cancelSelection})}),i.jsx(fs,{children:!b&&i.jsxs(Rt.button,{className:`${Js.scrollToAnchor} ${d?Js.scrollToAnchorTop:Js.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(fy,{size:tn,"aria-hidden":"true"}):i.jsx(uy,{size:tn,"aria-hidden":"true"})," New events"]})})]})}function sh(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 _6="_editFieldWrapper_yuzty_1",k6="_editInput_yuzty_10",S6="_editTextarea_yuzty_42",T6="_editSelect_yuzty_78",w6="_editError_yuzty_111",j6="_editInputInvalid_yuzty_118",N6="_editHint_yuzty_123",C6="_unsavedDot_yuzty_132",E6="_metaValueClickable_yuzty_140",A6="_editButton_yuzty_159",D6="_metaPlaceholder_yuzty_175",R6="_worktreeToggle_yuzty_180",nt={editFieldWrapper:_6,editInput:k6,editTextarea:S6,editSelect:T6,editError:w6,editInputInvalid:j6,editHint:N6,unsavedDot:C6,metaValueClickable:E6,editButton:A6,metaPlaceholder:D6,worktreeToggle:R6};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=sh({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 nm(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=sh({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 pd(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=sh({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 M6(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 I6="_envRow_1e1r5_1",O6="_envDot_1e1r5_7",B6="_envDotGreen_1e1r5_14",L6="_envDotYellow_1e1r5_18",z6="_envDotRed_1e1r5_22",$6="_envDotGray_1e1r5_26",Do={envRow:I6,envDot:O6,envDotGreen:B6,envDotYellow:L6,envDotRed:z6,envDotGray:$6};function U6(t){const s=t.toLowerCase();return s==="ready"||s==="running"||s==="available"||s==="connected"?Do.envDotGreen:s==="provisioning"||s==="starting"||s==="pending"||s==="connecting"?Do.envDotYellow:s==="error"||s==="failed"||s==="disconnected"?Do.envDotRed:Do.envDotGray}function P6(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:Do.envRow,children:[i.jsx("span",{className:`${Do.envDot} ${U6(b.status)}`}),b.displayName]})};return i.jsx(pd,{value:s,onSave:o,options:x,fieldId:d,activeFieldId:u,onActivate:p,renderDisplay:S,placeholder:m,ariaLabel:g,"data-testid":v})}const H6="_nav_1snmp_1",V6="_searchForm_1snmp_8",q6="_searchInput_1snmp_15",G6="_searchButton_1snmp_33",F6="_clearButton_1snmp_68",Z6="_workspaceSelect_1snmp_85",K6="_listHeader_1snmp_99",Y6="_nodeList_1snmp_108",J6="_nodeItem_1snmp_116",W6="_indicator_1snmp_129",X6="_label_1snmp_136",Q6="_badge_1snmp_145",Jn={nav:H6,searchForm:V6,searchInput:q6,searchButton:G6,clearButton:F6,workspaceSelect:Z6,listHeader:K6,nodeList:Y6,nodeItem:J6,indicator:W6,label:X6,badge:Q6};function e5({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:Jn.nav,"data-testid":"knowledge-nav",children:[i.jsxs("form",{className:Jn.searchForm,onSubmit:v,children:[i.jsx("input",{className:Jn.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:Jn.searchButton,disabled:o,children:"Go"})]}),r&&i.jsx("button",{type:"button",className:Jn.clearButton,onClick:b,children:"Clear search"}),i.jsxs("select",{className:Jn.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:Jn.listHeader,children:["Nodes (",t.length,")"]}),i.jsx("ul",{className:Jn.nodeList,children:t.map(k=>i.jsxs("li",{className:Jn.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:Jn.indicator,style:{backgroundColor:k.kind==="reference"?"#4A9EFF":k.category==="decision"?"#22C55E":k.category==="concept"?"#A855F7":k.category==="snippet"?"#6B7280":"#EAB308"}}),i.jsx("span",{className:Jn.label,children:k.label}),i.jsx("span",{className:Jn.badge,children:k.kind==="reference"?k.sourceType:k.category})]},k.id))})]})}const t5="_container_1mq5u_1",n5="_hamburger_1mq5u_33",s5="_brand_1mq5u_49",a5="_brandLogo_1mq5u_68",i5="_info_1mq5u_75",o5="_connectionLabel_1mq5u_90",r5="_connectionDot_1mq5u_103",l5="_connected_1mq5u_106",c5="_disconnected_1mq5u_110",Ks={container:t5,hamburger:n5,brand:s5,brandLogo:a5,info:i5,connectionLabel:o5,connectionDot:r5,connected:l5,disconnected:c5};function d5({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:Ks.container,children:[r&&i.jsx("button",{type:"button",className:Ks.hamburger,onClick:r,"aria-label":"Toggle sidebar","aria-expanded":c,children:i.jsx(V2,{size:zt,"aria-hidden":"true"})}),i.jsx(zo,{text:"Home",placement:"bottom",children:i.jsxs("button",{type:"button",className:Ks.brand,onClick:()=>d(Ci),"data-testid":"statusbar-brand",children:[i.jsx("img",{src:"/icon-192x192.png",alt:"",className:Ks.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]})}),i.jsxs("div",{className:Ks.info,children:[i.jsxs("span",{"aria-label":t?"Connected":"Disconnected",children:[i.jsx("span",{className:`${Ks.connectionDot} ${t?Ks.connected:Ks.disconnected}`,"aria-hidden":"true",children:i.jsx(za,{size:um,fill:"currentColor"})})," ",i.jsx("span",{className:Ks.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 u5="_nav_13gkc_1",f5="_tab_13gkc_35",p5="_tabIcon_13gkc_68",m5="_tabLabel_13gkc_79",h5="_tabActive_13gkc_84",$r={nav:u5,tab:f5,tabIcon:p5,tabLabel:m5,tabActive:h5},Xc=[{view:"dashboard",label:"Dashboard",icon:i.jsx(A2,{size:zt}),route:Ci,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:i.jsx(G2,{size:zt}),route:pN,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:i.jsx(v2,{size:zt}),route:mN,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:i.jsx(Z2,{size:zt}),route:Mo,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:i.jsx(u2,{size:zt}),route:Vx,testId:"sidebar-tab-knowledge"},{view:"findings",label:"Findings",icon:i.jsx(_x,{size:zt}),route:wd,testId:"sidebar-tab-findings"},{view:"settings",label:"Settings",icon:i.jsx(nw,{size:zt}),route:cN,testId:"sidebar-tab-settings"}];function g5(t){return t===Ci||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(Vx)?"knowledge":t.startsWith(wd)?"findings":t.startsWith(Ro)?"settings":"tasks"}function v5({tabs:t=Xc}){const s=Zt(),o=kt(),r=y.useRef(null),c=g5(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:$r.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(zo,{text:p.label,placement:"bottom",children:i.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${$r.tab} ${m?$r.tabActive:""}`,onClick:()=>d(p),"data-testid":p.testId,"aria-label":p.label,children:[i.jsx("span",{className:$r.tabIcon,"aria-hidden":"true",children:p.icon}),i.jsx("span",{className:$r.tabLabel,children:p.label})]})},p.view)})})}const y5="_container_pi6ii_1",b5="_content_pi6ii_66",Gb={container:y5,content:b5},x5=320,T1=220,w1=600,j1="grackle-sidebar-width";function _5(){try{const t=localStorage.getItem(j1);if(t!==null){const s=Number(t);if(Number.isFinite(s)&&s>=T1&&s<=w1)return s}}catch{}return x5}function k5(t){try{localStorage.setItem(j1,String(t))}catch{}}function S5({content:t}){const[s]=y.useState(_5),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>=T1&&m<=w1&&k5(m)}}});return c.observe(r),()=>{c.disconnect()}},[]),t!==void 0)return i.jsx("div",{className:Gb.container,ref:o,"data-testid":"sidebar",style:{width:s},children:i.jsx("div",{className:Gb.content,children:t})})}const T5="_bar_tnfsh_1",w5="_btnPrimary_tnfsh_32",j5="_statusText_tnfsh_85",N5="_statusCompleted_tnfsh_90",C5="_statusFailed_tnfsh_94",E5="_statusBlocked_tnfsh_98",A5="_hintText_tnfsh_103",wt={bar:T5,btnPrimary:w5,statusText:j5,statusCompleted:N5,statusFailed:C5,statusBlocked:E5,hintText:A5};function D5({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(Ri(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(Ux(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 R5="_nav_14i94_1",M5="_tab_14i94_24",I5="_tabActive_14i94_62",O5="_tabLabel_14i94_75",B5="_statusDot_14i94_81",L5="_pulse_14i94_87",z5="_addButton_14i94_99",$5="_empty_14i94_132",Da={nav:R5,tab:M5,tabActive:I5,tabLabel:O5,statusDot:B5,pulse:L5,addButton:z5,empty:$5},U5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function P5({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(Ni(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(Ni(t[N].id)),S[N].focus()},[m,t,s]),b=m??(t.length>0?t[0].id:void 0);return i.jsxs("div",{className:Da.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=U5[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:`${Da.tab} ${S?Da.tabActive:""}`,onClick:()=>g(x.id),"data-testid":"env-nav-item",children:[i.jsx("span",{className:`${Da.statusDot} ${N?Da.pulse:""}`,style:{color:w},"aria-hidden":"true",children:i.jsx(za,{size:um,fill:"currentColor"})}),i.jsx("span",{className:Da.tabLabel,title:x.displayName||x.id,children:x.displayName||x.id})]},x.id)})}),i.jsx("button",{type:"button",className:Da.addButton,onClick:()=>s(rN),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&i.jsx("div",{className:Da.empty,children:"No environments yet."})]})}function ah(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 Fb={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 md(t){return Fb[t]||Fb.general}const H5="_nav_dlm8m_1",V5="_categoryPills_dlm8m_24",q5="_categoryPill_dlm8m_24",G5="_tab_dlm8m_42",F5="_tabActive_dlm8m_80",Z5="_tabContent_dlm8m_93",K5="_tabLabel_dlm8m_100",Y5="_tabMeta_dlm8m_106",J5="_categoryDot_dlm8m_111",W5="_empty_dlm8m_118",_s={nav:H5,categoryPills:V5,categoryPill:q5,tab:G5,tabActive:F5,tabContent:Z5,tabLabel:K5,tabMeta:Y5,categoryDot:J5,empty:W5};function X5({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(Lp(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(Lp(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:_s.nav,"data-testid":"findings-nav",children:[m.length>1&&i.jsx("div",{className:_s.categoryPills,"data-testid":"findings-nav-categories",children:m.map(x=>i.jsx("span",{className:_s.categoryPill,style:{color:md(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:`${_s.tab} ${S?_s.tabActive:""}`,onClick:()=>g(x.id),"data-testid":"finding-nav-item",children:[i.jsx("span",{className:_s.categoryDot,style:{color:md(x.category).text},"aria-hidden":"true",children:i.jsx(za,{size:um,fill:"currentColor"})}),i.jsxs("span",{className:_s.tabContent,children:[i.jsx("span",{className:_s.tabLabel,title:x.title,children:x.title}),i.jsx("span",{className:_s.tabMeta,title:x.createdAt,children:ah(x.createdAt)})]})]},x.id)})}),t.length===0&&i.jsx("div",{className:_s.empty,children:"No findings yet. Agents will post discoveries here."})]})}function Q5(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 N1({text:t,indices:s,highlightClass:o}){if(!s||s.length===0)return i.jsx(i.Fragment,{children:t});const r=Q5(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 eI(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 tI(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 uw){c.add(d);const u=o.get(d);if(u&&u.length>0){u.sort((m,g)=>m.sortOrder-g.sortOrder);const p=$a(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=$a(d);r.push({status:d,label:p.label,style:p,tasks:u})}return r}const nI="_container_z4i38_1",sI="_header_z4i38_5",aI="_headerActions_z4i38_17",iI="_searchInput_z4i38_23",oI="_searchHighlight_z4i38_56",rI="_groupToggle_z4i38_62",lI="_groupToggleActive_z4i38_89",cI="_addButton_z4i38_93",dI="_taskRow_z4i38_120",uI="_selected_z4i38_140",fI="_expandArrow_z4i38_150",pI="_expanded_z4i38_157",mI="_leafSpacer_z4i38_161",hI="_taskStatusIcon_z4i38_166",gI="_taskTitle_z4i38_170",vI="_workspaceBadge_z4i38_177",yI="_childCountBadge_z4i38_195",bI="_dependencyBadge_z4i38_208",xI="_blockedBadge_z4i38_220",_I="_addChildButton_z4i38_225",kI="_emptyState_z4i38_268",SI="_statusGroupHeader_z4i38_275",TI="_statusGroupIcon_z4i38_294",wI="_statusGroupLabel_z4i38_298",jI="_statusGroupCount_z4i38_303",qe={container:nI,header:sI,headerActions:aI,searchInput:iI,searchHighlight:oI,groupToggle:rI,groupToggleActive:lI,addButton:cI,taskRow:dI,selected:uI,expandArrow:fI,expanded:pI,leafSpacer:mI,taskStatusIcon:hI,taskTitle:gI,workspaceBadge:vI,childCountBadge:yI,dependencyBadge:bI,blockedBadge:xI,addChildButton:_I,emptyState:kI,statusGroupHeader:SI,statusGroupIcon:TI,statusGroupLabel:wI,statusGroupCount:jI},NI=[{name:"title",weight:2},{name:"description",weight:1}],C1=16,CI=16,E1="grackle-task-group-by-status";function Zb(){try{return localStorage.getItem(E1)==="true"}catch{return!1}}function EI(t){try{localStorage.setItem(E1,String(t))}catch{}}function AI({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:qe.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:`${qe.expandArrow} ${s?qe.expanded:""}`,"aria-hidden":"true",children:i.jsx(aa,{size:lt})}),i.jsx("span",{className:qe.statusGroupIcon,style:{color:t.style.color},"aria-hidden":"true",children:t.style.icon}),i.jsx("span",{className:qe.statusGroupLabel,children:t.label}),i.jsx("span",{className:qe.statusGroupCount,children:t.tasks.length})]}),i.jsx(fs,{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=$a(p.status),g=r===p.id,v=p.parentTaskId||!p.workspaceId?void 0:u.get(p.workspaceId);return i.jsxs("div",{onClick:()=>c(Bn(p.id)),role:"button",tabIndex:0,"aria-label":p.title,onKeyDown:b=>{b.currentTarget===b.target&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),c(Bn(p.id)))},className:`${qe.taskRow} ${g?qe.selected:""}`,style:{"--task-indent":`${C1}px`},"data-task-id":p.id,children:[i.jsx("span",{className:qe.leafSpacer}),i.jsx("span",{className:qe.taskStatusIcon,style:{color:m.color},"aria-hidden":"true","data-testid":`task-status-${cl(p.status)}`,children:m.icon}),i.jsx("span",{className:qe.taskTitle,title:p.title,children:i.jsx(N1,{text:p.title,indices:d.get(p.id),highlightClass:qe.searchHighlight})}),v&&i.jsx("span",{className:qe.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function A1({node:t,depth:s,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m}){const g=$a(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=C1+s*CI,N=s===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return i.jsxs(i.Fragment,{children:[i.jsxs("div",{onClick:()=>d(Bn(t.id)),role:"button",tabIndex:0,"aria-label":t.title,onKeyDown:T=>{T.currentTarget===T.target&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),d(Bn(t.id)))},className:`${qe.taskRow} ${S?qe.selected:""}`,style:{"--task-indent":`${k}px`},"data-task-id":t.id,children:[x&&i.jsx("span",{className:`${qe.expandArrow} ${b?qe.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(aa,{size:lt,"aria-hidden":"true"})}),!x&&i.jsx("span",{className:qe.leafSpacer}),i.jsx("span",{className:qe.taskStatusIcon,style:{color:g.color},"aria-hidden":"true","data-testid":`task-status-${cl(t.status)}`,children:g.icon}),i.jsx("span",{className:qe.taskTitle,title:t.title,children:i.jsx(N1,{text:t.title,indices:p.get(t.id),highlightClass:qe.searchHighlight})}),N&&i.jsx("span",{className:qe.workspaceBadge,title:N,children:N}),x&&i.jsxs("span",{className:qe.childCountBadge,children:[t.children.filter(T=>T.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&i.jsx("span",{className:`${qe.dependencyBadge} ${v?qe.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),s<ST&&i.jsx(zo,{text:"Add child task",children:i.jsx("button",{onClick:T=>{T.stopPropagation(),d(Ri(t.workspaceId,t.id))},"aria-label":"Add child task",className:qe.addChildButton,children:"+"})})]}),i.jsx(fs,{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(A1,{node:T,depth:s+1,expandedTasks:o,toggleTask:r,selectedTaskId:c,navigate:d,taskStatusById:u,titleHighlights:p,workspaceNames:m},T.id))})})]})}function DI({workspaces:t,tasks:s}){const o=kt(),[r,c]=y.useState(new Set),[d,u]=y.useState(new Set),[p,m]=y.useState(Zb),[g,v]=y.useState(Zb),[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;EI(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=kT(s,E,NI),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?[]:eI(W);return i.jsxs("div",{className:qe.container,children:[i.jsxs("div",{className:qe.header,children:[i.jsx("span",{children:"Tasks"}),i.jsxs("div",{className:qe.headerActions,children:[i.jsx(zo,{text:p?"Switch to tree view":"Group tasks by status",children:i.jsx("button",{className:`${qe.groupToggle} ${p?qe.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($2,{size:tn})})}),i.jsx(zo,{text:"New task",children:i.jsx("button",{className:qe.addButton,onClick:()=>o(Ri()),"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:qe.searchInput,"data-testid":"sidebar-search"}),p?tI(W,w).map(H=>i.jsx(AI,{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(A1,{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:qe.emptyState,children:"No tasks yet. Click + to create one."}),W.length===0&&Q&&i.jsx("div",{className:qe.emptyState,children:"No matching tasks"})]})}const RI="_toast_ed2dk_1",MI="_success_ed2dk_18",II="_icon_ed2dk_22",OI="_error_ed2dk_25",BI="_warning_ed2dk_32",LI="_info_ed2dk_38",zI="_message_ed2dk_53",$I="_close_ed2dk_60",Ur={toast:RI,success:MI,icon:II,error:OI,warning:BI,info:LI,message:zI,close:$I},UI={success:i.jsx(Ai,{size:zt}),error:i.jsx(Va,{size:zt}),warning:i.jsx(dm,{size:zt}),info:i.jsx(cm,{size:zt})};function PI({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:`${Ur.toast} ${Ur[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:Ur.icon,"aria-hidden":"true",children:UI[t.variant]}),i.jsx("span",{className:Ur.message,children:t.message}),i.jsx("button",{type:"button",className:Ur.close,onClick:()=>s(t.id),"aria-label":"Dismiss notification",children:i.jsx(Va,{size:tn,"aria-hidden":"true"})})]})}const HI="_container_qqse2_1",VI={container:HI};function qI({toasts:t,onDismiss:s}){return i.jsx("div",{className:VI.container,"data-testid":"toast-container",children:i.jsx(fs,{children:t.map(o=>i.jsx(PI,{toast:o,onDismiss:s},o.id))})})}const GI="_callout_e5awm_1",FI="_success_e5awm_11",ZI="_icon_e5awm_15",KI="_error_e5awm_18",YI="_warning_e5awm_25",JI="_info_e5awm_32",WI="_content_e5awm_48",XI="_close_e5awm_53",Pr={callout:GI,success:FI,icon:ZI,error:KI,warning:YI,info:JI,content:WI,close:XI},QI={success:i.jsx(Ai,{size:zt}),error:i.jsx(Va,{size:zt}),warning:i.jsx(dm,{size:zt}),info:i.jsx(cm,{size:zt})};function eO({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:[Pr.callout,Pr[t],r].filter(Boolean).join(" "),role:t==="error"||t==="warning"?"alert":"status",children:[i.jsx("span",{className:Pr.icon,"aria-hidden":"true",children:QI[t]}),i.jsx("span",{className:Pr.content,children:s}),o&&i.jsx("button",{type:"button",className:Pr.close,onClick:()=>d(!0),"aria-label":"Dismiss",children:i.jsx(Va,{size:tn,"aria-hidden":"true"})})]})})}function tO({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(eO,{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 nO="_container_de44x_1",sO="_emptyState_de44x_8",aO="_card_de44x_14",iO="_cardClickable_de44x_34",oO="_cardHeader_de44x_42",rO="_categoryBadge_de44x_54",lO="_findingTitle_de44x_62",cO="_findingDate_de44x_68",dO="_findingContent_de44x_80",uO="_tags_de44x_86",fO="_tag_de44x_86",ls={container:nO,emptyState:sO,card:aO,cardClickable:iO,cardHeader:oO,categoryBadge:rO,findingTitle:lO,findingDate:cO,findingContent:dO,tags:uO,tag:fO};function D1({findings:t,onFindingClick:s}){return t.length===0?i.jsx("div",{className:ls.emptyState,children:"No findings yet. Agents will post discoveries here."}):i.jsx("div",{className:ls.container,children:t.map((o,r)=>{const c=md(o.category),d=s?Rt.button:Rt.div;return i.jsxs(d,{type:s?"button":void 0,className:`${ls.card} ${s?ls.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:ls.cardHeader,children:[i.jsx("span",{className:ls.categoryBadge,style:{background:c.bg,color:c.text},children:o.category}),i.jsx("span",{className:ls.findingTitle,children:o.title}),i.jsx("span",{className:ls.findingDate,title:o.createdAt,children:ah(o.createdAt)})]}),i.jsx("div",{className:ls.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&i.jsx("div",{className:ls.tags,children:o.tags.map(u=>i.jsx("span",{className:ls.tag,style:{color:c.text,textShadow:`0 0 8px ${c.text}`},children:u},u))})]},o.id)})})}const pO="_section_1ingb_14",mO="_sectionTitle_1ingb_26",hO="_sectionDescription_1ingb_35",gO="_tokenList_1ingb_48",vO="_tokenRow_1ingb_55",yO="_tokenBadge_1ingb_68",bO="_tokenName_1ingb_83",xO="_tokenTarget_1ingb_90",_O="_deleteButton_1ingb_99",kO="_addForm_1ingb_113",SO="_formRow_1ingb_119",TO="_input_1ingb_125",wO="_select_1ingb_155",jO="_addButton_1ingb_187",NO="_emptyStateInfo_1ingb_221",CO="_themeOptions_1ingb_229",EO="_themeOption_1ingb_229",AO="_themeOptionSelected_1ingb_254",DO="_themeOptionHeader_1ingb_259",RO="_themeOptionLabel_1ingb_266",MO="_themeOptionDesc_1ingb_273",IO="_variantToggle_1ingb_279",OO="_variantButton_1ingb_286",BO="_variantActive_1ingb_305",LO="_themeSwatches_1ingb_311",zO="_themeSwatch_1ingb_311",$O="_systemToggle_1ingb_325",UO="_systemToggleHint_1ingb_341",PO="_themeActive_1ingb_348",HO="_aboutGrid_1ingb_354",VO="_aboutItem_1ingb_360",qO="_aboutLabel_1ingb_373",GO="_aboutValue_1ingb_379",FO="_aboutDot_1ingb_387",ZO="_aboutDotConnected_1ingb_394",KO="_aboutDotDisconnected_1ingb_398",be={section:pO,sectionTitle:mO,sectionDescription:hO,tokenList:gO,tokenRow:vO,tokenBadge:yO,tokenName:bO,tokenTarget:xO,deleteButton:_O,addForm:kO,formRow:SO,input:TO,select:wO,addButton:jO,emptyStateInfo:NO,themeOptions:CO,themeOption:EO,themeOptionSelected:AO,themeOptionHeader:DO,themeOptionLabel:RO,themeOptionDesc:MO,variantToggle:IO,variantButton:OO,variantActive:BO,themeSwatches:LO,themeSwatch:zO,systemToggle:$O,systemToggleHint:UO,themeActive:PO,aboutGrid:HO,aboutItem:VO,aboutLabel:qO,aboutValue:GO,aboutDot:FO,aboutDotConnected:ZO,aboutDotDisconnected:KO},YO=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function JO({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(Ei,{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(Va,{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:YO.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 Rd=[{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"]}],R1=new Set(Rd.map(t=>t.id)),Kb="grackle";function sm(t){return Rd.find(s=>s.id===t)}function WO({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:Rd.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 XO({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.1"})]})]})]})}const QO="_container_cddyd_1",eB="_header_cddyd_8",tB="_headerTitle_cddyd_35",nB="_badge_cddyd_44",sB="_headerActions_cddyd_54",aB="_body_cddyd_61",iB="_formContent_cddyd_73",oB="_section_cddyd_85",rB="_label_cddyd_91",lB="_titleInput_cddyd_98",cB="_descriptionTextarea_cddyd_131",dB="_parentContext_cddyd_167",uB="_parentLabel_cddyd_175",fB="_parentName_cddyd_182",pB="_personaSelect_cddyd_186",mB="_depList_cddyd_220",hB="_depItem_cddyd_226",gB="_depItemSelected_cddyd_248",vB="_noDeps_cddyd_252",yB="_btnPrimary_cddyd_258",bB="_btnGhost_cddyd_289",tt={container:QO,header:eB,headerTitle:tB,badge:nB,headerActions:sB,body:aB,formContent:iB,section:oB,label:rB,titleInput:lB,descriptionTextarea:cB,parentContext:dB,parentLabel:uB,parentName:fB,personaSelect:pB,depList:mB,depItem:hB,depItemSelected:gB,noDeps:vB,btnPrimary:yB,btnGhost:bB};function M1({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,Ne=ve=>{pe(Be=>Be.includes(ve)?Be.filter(Mt=>Mt!==ve):[...Be,ve])},Fe=()=>{!fe||J||S&&k===void 0||(S&&s?(g(s,I.trim(),Q,W,H),b==null||b("Task updated","success"),v?v():x(Bn(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?Ua(o,B):"/tasks",{replace:!0})},ve=>{b==null||b(ve,"error"),ce(!1)})))},me=()=>{if(v){v();return}x(S&&s?Bn(s,void 0,C,B):o?Ua(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:Fe,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&&Fe()}})]}),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 Be=W.includes(ve.id);return i.jsxs("label",{className:`${tt.depItem} ${Be?tt.depItemSelected:""}`,"data-testid":`dep-option-${ve.id}`,children:[i.jsx("input",{type:"checkbox",checked:Be,onChange:()=>Ne(ve.id)}),ve.title,i.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",ve.status,")"]})]},ve.id)})})]})]})})]})}const xB="_actionButtons_1rjka_1",_B="_btnPrimary_1rjka_8",kB="_btnDanger_1rjka_39",SB="_btnGhost_1rjka_78",Ft={actionButtons:xB,btnPrimary:_B,btnDanger:kB,btnGhost:SB};function TB({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 wB="_workpadSection_y8nj9_1",jB="_workpadLabel_y8nj9_9",NB="_workpadStatus_y8nj9_17",CB="_workpadSummary_y8nj9_23",EB="_workpadExtra_y8nj9_29",Ra={workpadSection:wB,workpadLabel:jB,workpadStatus:NB,workpadSummary:CB,workpadExtra:EB};function AB({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:Ra.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:Ra.workpadLabel,children:"Workpad"}),i.jsx("div",{className:Ra.workpadExtra,children:t})]})}if(!(!s.status&&!s.summary&&!s.extra))return i.jsxs("div",{className:Ra.workpadSection,"data-testid":"workpad-panel",children:[i.jsx("div",{className:Ra.workpadLabel,children:"Workpad"}),s.status&&i.jsx("div",{className:Ra.workpadStatus,"data-testid":"workpad-status",children:s.status}),s.summary&&i.jsx("div",{className:Ra.workpadSummary,"data-testid":"workpad-summary",children:s.summary}),s.extra&&Object.keys(s.extra).length>0&&i.jsx("div",{className:Ra.workpadExtra,"data-testid":"workpad-extra",children:JSON.stringify(s.extra,null,2)})]})}const DB="_overviewDashboard_r05qm_1",RB="_overviewHero_r05qm_7",MB="_statusBadge_r05qm_14",IB="_statusPending_r05qm_26",OB="_statusAssigned_r05qm_31",BB="_statusInProgress_r05qm_36",LB="_statusReview_r05qm_41",zB="_statusDone_r05qm_46",$B="_statusFailed_r05qm_51",UB="_statusWaitingInput_r05qm_56",PB="_overviewBranchPill_r05qm_61",HB="_branchLink_r05qm_76",VB="_overviewSection_r05qm_87",qB="_overviewLabel_r05qm_93",GB="_overviewValue_r05qm_100",FB="_overviewMuted_r05qm_105",ZB="_overviewMarkdown_r05qm_111",KB="_envRow_r05qm_180",YB="_envDot_r05qm_186",JB="_envDotGreen_r05qm_193",WB="_envDotYellow_r05qm_197",XB="_envDotRed_r05qm_201",QB="_envDotGray_r05qm_205",eL="_depList_r05qm_209",tL="_depItem_r05qm_215",nL="_depBlocked_r05qm_222",sL="_depDone_r05qm_226",aL="_timeline_r05qm_230",iL="_timelineRow_r05qm_236",oL="_timelineKey_r05qm_243",rL="_timelineValue_r05qm_249",lL="_timelineDelta_r05qm_253",cL="_reviewNotes_r05qm_264",he={overviewDashboard:DB,overviewHero:RB,statusBadge:MB,statusPending:IB,statusAssigned:OB,statusInProgress:BB,statusReview:LB,statusDone:zB,statusFailed:$B,statusWaitingInput:UB,overviewBranchPill:PB,branchLink:HB,overviewSection:VB,overviewLabel:qB,overviewValue:GB,overviewMuted:FB,overviewMarkdown:ZB,envRow:KB,envDot:YB,envDotGreen:JB,envDotYellow:WB,envDotRed:XB,envDotGray:QB,depList:eL,depItem:tL,depBlocked:nL,depDone:sL,timeline:aL,timelineRow:iL,timelineKey:oL,timelineValue:rL,timelineDelta:lL,reviewNotes:cL};function $c(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 kp(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 Yb(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 dL({status:t}){const s=$a(t),o=dw(t);return i.jsx("span",{className:`${he.statusBadge} ${he[o]??he.statusPending}`,"data-testid":"task-overview-status-badge",children:s.label})}function uL({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(dL,{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(yd,{remarkPlugins:[bd],children:t.description})})]}),t.workpad&&i.jsx(AB,{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} ${Yb(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} ${Yb(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:$c(t.createdAt)})]}),t.assignedAt&&(()=>{const k=kp(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:$c(t.assignedAt)}),k!==void 0&&i.jsx("span",{className:he.timelineDelta,children:k})]})})(),t.startedAt&&(()=>{const k=kp(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:$c(t.startedAt)}),k!==void 0&&i.jsx("span",{className:he.timelineDelta,children:k})]})})(),t.completedAt&&(()=>{const k=kp(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:$c(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:Ts(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:Ts(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:[Io(((u==null?void 0:u.inputTokens)??0)+((u==null?void 0:u.outputTokens)??0))," / ",Io(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:[Ts((u==null?void 0:u.costMillicents)??0)," / ",Ts(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 fL="_container_legrg_1",pL="_header_legrg_8",mL="_headerTitle_legrg_35",hL="_badge_legrg_44",gL="_headerActions_legrg_54",vL="_body_legrg_61",yL="_formContent_legrg_73",bL="_section_legrg_85",xL="_label_legrg_91",_L="_nameInput_legrg_98",kL="_fieldInput_legrg_131",SL="_adapterSelect_legrg_164",TL="_readOnlyValue_legrg_198",wL="_codespaceSection_legrg_204",jL="_codespaceActions_legrg_210",NL="_creatingHint_legrg_216",CL="_errorHint_legrg_222",EL="_btnPrimary_legrg_235",AL="_btnGhost_legrg_266",re={container:fL,header:pL,headerTitle:mL,badge:hL,headerActions:gL,body:vL,formContent:yL,section:bL,label:xL,nameInput:_L,fieldInput:kL,adapterSelect:SL,readOnlyValue:TL,codespaceSection:wL,codespaceActions:jL,creatingHint:NL,errorHint:CL,btnPrimary:EL,btnGhost:AL},Qc=1,ed=65535;function Sp(t){if(!t.trim())return!0;const s=Number(t);return Number.isInteger(s)&&s>=Qc&&s<=ed}function Tp(t){try{const s=JSON.parse(t);if(typeof s=="object"&&s!==null&&!Array.isArray(s))return s}catch{}return{}}function DL({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 I1({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")&&!Sp(E)),ge=()=>{X()&&(r(w.trim(),T,ce()),b==null||b("Environment added successfully","success"),x(Mo,{replace:!0}))},fe=()=>{x(s?Ni(s):Mo)},Ne=y.useCallback((me,_e)=>{if(!k||!s)return;const ve=Tp(k.adapterConfig),Be=_e.trim();Be?ve[me]=Be:delete ve[me],c(s,{adapterConfig:ve})},[k,s,c]),Fe=y.useCallback((me,_e)=>{if(!k||!s)return;const ve=Tp(k.adapterConfig);if(_e.trim()){const Be=Number(_e);Number.isInteger(Be)&&Be>=Qc&&Be<=ed&&(ve[me]=Be)}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=Tp(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=>Ne("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=>Fe("port",_e),validate:_e=>Sp(_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=>Ne("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=>Ne("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=>Fe("sshPort",_e),validate:_e=>Sp(_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=>Ne("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=>Ne("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=>Ne("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=>Ne("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:Qc,max:ed,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:Qc,max:ed,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(DL,{codespaceName:ie,onCodespaceNameChange:L,envName:w,onEnvNameChange:N,codespaces:u,codespaceError:p,codespaceListError:m,codespaceCreating:g,onCreateCodespace:v})]})})]})}const RL="_group_1iprv_1",ML="_groupTitle_1iprv_8",IL="_shortcutList_1iprv_17",OL="_shortcutRow_1iprv_23",BL="_keys_1iprv_36",LL="_kbd_1iprv_43",zL="_description_1iprv_60",_i={group:RL,groupTitle:ML,shortcutList:IL,shortcutRow:OL,keys:BL,kbd:LL,description:zL},$L=[{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 UL(){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."}),$L.map(t=>i.jsxs("div",{className:_i.group,children:[i.jsx("h4",{className:_i.groupTitle,children:t.title}),i.jsx("div",{className:_i.shortcutList,children:t.shortcuts.map(s=>i.jsxs("div",{className:_i.shortcutRow,children:[i.jsx("span",{className:_i.keys,children:s.keys.map(o=>i.jsx("kbd",{className:_i.kbd,children:o},o))}),i.jsx("span",{className:_i.description,children:s.description})]},s.description))})]},t.title))]})}const PL=[{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 HL({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:PL.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 VL="_container_10efq_1",qL="_header_10efq_7",GL="_list_10efq_105",FL="_card_10efq_111",ZL="_cardHeader_10efq_125",KL="_cardTitle_10efq_135",YL="_defaultBadge_10efq_141",JL="_cardActions_10efq_155",WL="_description_10efq_160",XL="_meta_10efq_166",QL="_empty_10efq_212",e8="_typeBadge_10efq_362",Wn={container:VL,header:qL,list:GL,card:FL,cardHeader:ZL,cardTitle:KL,defaultBadge:YL,cardActions:JL,description:WL,meta:XL,empty:QL,typeBadge:e8};function t8({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:Wn.container,children:[i.jsxs("div",{className:Wn.header,children:[i.jsx("h2",{children:"Personas"}),i.jsx(Ws,{variant:"primary",size:"md",onClick:c,"data-testid":"persona-new-button",children:"+ New Persona"})]}),t.length===0?i.jsx("p",{className:Wn.empty,children:"No personas yet. Create one to get started."}):i.jsx("div",{className:Wn.list,children:t.map(v=>{const b=s===v.id,x=v.type==="script";return i.jsxs("div",{className:Wn.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:Wn.cardHeader,children:[i.jsxs("span",{className:Wn.cardTitle,children:[i.jsx("strong",{children:v.name}),i.jsx("span",{className:Wn.typeBadge,"data-testid":`persona-type-badge-${v.id}`,children:x?"Script":"Agent"}),b&&i.jsx("span",{className:Wn.defaultBadge,"data-testid":`persona-default-badge-${v.id}`,children:"App Default"})]}),i.jsxs("div",{className:Wn.cardActions,onClick:S=>S.stopPropagation(),children:[!b&&i.jsx(Ws,{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(Ws,{variant:"ghost",size:"sm",onClick:()=>d(v.id),children:"Edit"}),i.jsx(Ws,{variant:"ghost",size:"sm",onClick:()=>p(v.id),"data-testid":`persona-delete-${v.id}`,children:"Delete"})]})]}),v.description&&i.jsx("p",{className:Wn.description,children:v.description}),i.jsxs("div",{className:Wn.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(Ei,{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 n8="_container_uy08i_1",s8="_header_uy08i_7",a8="_count_uy08i_13",i8="_presets_uy08i_18",o8="_presetButton_uy08i_24",r8="_filterInput_uy08i_41",l8="_groups_uy08i_53",c8="_group_uy08i_53",d8="_groupHeader_uy08i_68",u8="_groupName_uy08i_77",f8="_groupCount_uy08i_81",p8="_toolList_uy08i_87",m8="_toolItem_uy08i_95",h8="_toolName_uy08i_103",mn={container:n8,header:s8,count:a8,presets:i8,presetButton:o8,filterInput:r8,groups:l8,group:c8,groupHeader:d8,groupName:u8,groupCount:f8,toolList:p8,toolItem:m8,toolName:h8},g8=(()=>{const t=new Map;for(const s of mx){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()}))})(),v8=[{name:"default",label:"Default",tools:hx},{name:"worker",label:"Worker",tools:TT},{name:"orchestrator",label:"Orchestrator",tools:wT},{name:"admin",label:"Admin",tools:jT}];function Jb({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:mn.container,"data-testid":"mcp-tool-selector",children:[i.jsx("div",{className:mn.header,children:i.jsx("span",{className:mn.count,children:t.length===0?`Using default (${hx.length} tools)`:`${t.length} of ${mx.size} tools selected`})}),i.jsxs("div",{className:mn.presets,"data-testid":"mcp-tool-presets",children:[v8.map(v=>i.jsx("button",{type:"button",className:mn.presetButton,disabled:o,onClick:()=>m(v.tools),"data-testid":`preset-${v.name}`,children:v.label},v.name)),i.jsx("button",{type:"button",className:mn.presetButton,disabled:o,onClick:()=>s([]),"data-testid":"preset-clear",children:"Clear"})]}),i.jsx("input",{type:"text",className:mn.filterInput,placeholder:"Filter tools...",value:r,onChange:v=>c(v.target.value),disabled:o,"data-testid":"mcp-tool-filter"}),i.jsx("div",{className:mn.groups,children:g8.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:mn.group,"data-testid":`tool-group-${v}`,children:[i.jsxs("label",{className:mn.groupHeader,children:[i.jsx("input",{type:"checkbox",checked:S,onChange:()=>p(x,S),disabled:o,"data-testid":`group-toggle-${v}`}),i.jsx("span",{className:mn.groupName,children:v}),i.jsxs("span",{className:mn.groupCount,children:["(",x.filter(k=>d.has(k)).length,"/",x.length,")"]})]}),i.jsx("div",{className:mn.toolList,children:x.map(k=>i.jsxs("label",{className:mn.toolItem,children:[i.jsx("input",{type:"checkbox",checked:d.has(k),onChange:()=>u(k),disabled:o,"data-testid":`tool-${k}`}),i.jsx("span",{className:mn.toolName,children:k})]},k))})]},v)})})]})}const y8="_nav_1bhou_1",b8="_tab_1bhou_24",x8="_tabIcon_1bhou_62",_8="_tabActive_1bhou_68",Uc={nav:y8,tab:b8,tabIcon:x8,tabActive:_8},Ys=[{path:"credentials",label:"Credentials",icon:i.jsx(M2,{size:zt})},{path:"personas",label:"Personas",icon:i.jsx(rw,{size:zt})},{path:"appearance",label:"Appearance",icon:i.jsx(Y2,{size:zt})},{path:"shortcuts",label:"Shortcuts",icon:i.jsx(O2,{size:zt})},{path:"about",label:"About",icon:i.jsx(cm,{size:zt})}];function k8(){var u;const t=Zt(),s=kt(),o=y.useRef(null),r=((u=Ys.find(p=>{const m=`${Ro}/${p.path}`;return t.pathname===m||t.pathname.startsWith(`${m}/`)}))==null?void 0:u.path)??Ys[0].path,c=y.useCallback(p=>{s(`${Ro}/${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:Ys.findIndex(w=>w.path===r);let b=v;if(p.key==="ArrowDown"||p.key==="j"||p.key==="J")p.preventDefault(),b=(v+1)%Ys.length;else if(p.key==="ArrowUp"||p.key==="k"||p.key==="K")p.preventDefault(),b=(v-1+Ys.length)%Ys.length;else if(p.key==="Home")p.preventDefault(),b=0;else if(p.key==="End")p.preventDefault(),b=Ys.length-1;else return;const x=Ys[b].path;s(`${Ro}/${x}`),(k=m[b])==null||k.focus()},[r,s]);return i.jsx("nav",{className:Uc.nav,ref:o,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:d,children:Ys.map(p=>{const m=p.path===r;return i.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Uc.tab} ${m?Uc.tabActive:""}`,onClick:()=>c(p.path),children:[i.jsx("span",{className:Uc.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}function S8({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(py.map(d=>[d,[]]));for(const d of t){const u=cl(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 py.map(d=>{const u=$a(d);return{status:d,label:u.label,style:u,tasks:c.get(d)??[]}})}const T8="_boardContainer_1c4y1_1",w8="_column_1c4y1_17",j8="_columnHeader_1c4y1_34",N8="_columnIcon_1c4y1_47",C8="_columnLabel_1c4y1_52",E8="_columnCount_1c4y1_57",A8="_cardList_1c4y1_67",D8="_emptyPlaceholder_1c4y1_76",R8="_card_1c4y1_67",M8="_cardHeader_1c4y1_107",I8="_cardStatusIcon_1c4y1_113",O8="_cardTitle_1c4y1_119",B8="_cardBadges_1c4y1_127",L8="_badge_1c4y1_134",z8="_blockedBadge_1c4y1_146",$8="_childBadge_1c4y1_151",U8="_depBadge_1c4y1_155",P8="_parentBadge_1c4y1_159",H8="_pausedSubBadge_1c4y1_166",V8="_personaBadge_1c4y1_170",q8="_envBadge_1c4y1_174",G8="_emptyCta_1c4y1_178",F8="_ctaButton_1c4y1_188",Z8="_ctaDescription_1c4y1_204",it={boardContainer:T8,column:w8,columnHeader:j8,columnIcon:N8,columnLabel:C8,columnCount:E8,cardList:A8,emptyPlaceholder:D8,card:R8,cardHeader:M8,cardStatusIcon:I8,cardTitle:O8,cardBadges:B8,badge:L8,blockedBadge:z8,childBadge:$8,depBadge:U8,parentBadge:P8,pausedSubBadge:H8,personaBadge:V8,envBadge:q8,emptyCta:G8,ctaButton:F8,ctaDescription:Z8};function K8({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(()=>S8({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(Ri(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(fs,{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(Y8,{boardTask:S,tasksById:g,personaName:v.personaNameByTaskId.get(S.task.id),envName:v.environmentNameByTaskId.get(S.task.id),onClick:()=>u(Bn(S.task.id,void 0,t,s))})},S.task.id))})})]},x.status))})}function Y8({boardTask:t,tasksById:s,personaName:o,envName:r,onClick:c}){const{task:d,isBlocked:u,childCount:p,doneChildCount:m,pausedSubBadge:g}=t,v=$a(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 J8="_formContent_ymnez_1",W8="_section_ymnez_13",X8="_label_ymnez_19",Q8="_titleInput_ymnez_26",e7="_descriptionTextarea_ymnez_58",t7="_selectField_ymnez_94",n7="_checkboxRow_ymnez_128",s7="_checkboxLabel_ymnez_141",a7="_fieldError_ymnez_146",bt={formContent:J8,section:W8,label:X8,titleInput:Q8,descriptionTextarea:e7,selectField:t7,checkboxRow:n7,checkboxLabel:s7,fieldError:a7};function i7(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 o7=100;function r7({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:o7,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 O1=y.createContext(void 0),l7=4e3;function c7({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=l7)=>{const g=`toast-${++r.current}`;o(v=>[...v,{id:g,message:u,variant:p,duration:m}])},[]);return i.jsx(O1.Provider,{value:{toasts:s,showToast:d,dismissToast:c},children:t})}function Tn(){const t=y.useContext(O1);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const am="grackle-theme",B1="grackle-prefer-system",L1="(prefers-color-scheme: dark)";let Fr=[],td;function wp(){td=void 0;for(const t of Fr)t()}function im(){return typeof window>"u"?!1:window.matchMedia(L1).matches}function Xr(){if(typeof localStorage>"u")return Kb;try{const t=localStorage.getItem(am);if(t!==null&&R1.has(t))return t}catch{}return Kb}function hd(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(B1)==="true"}catch{return!1}}function om(t){return Rd.find(s=>s.variantLightId===t||s.variantDarkId===t)}function z1(t,s){const o=sm(t);if(o!=null&&o.variantDarkId)return s&&o.variantLightId?im()?o.variantDarkId:o.variantLightId:o.variantDarkId;if(o!=null&&o.hidden&&s){const r=om(t);if(r!=null&&r.variantLightId&&r.variantDarkId)return im()?r.variantDarkId:r.variantLightId}return t}function wo(t,s,o=!1){o&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=z1(t,s),o&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&wo(Xr(),hd());function d7(){return td===void 0&&(td={themeId:Xr(),systemDark:im(),preferSystem:hd()}),td}function u7(t){return Fr=[...Fr,t],()=>{Fr=Fr.filter(s=>s!==t)}}function f7(){const t=y.useSyncExternalStore(u7,d7),{themeId:s,preferSystem:o}=t,r=z1(s,o),c=y.useCallback(u=>{if(R1.has(u)){try{localStorage.setItem(am,u)}catch{}wo(u,hd(),!0),wp()}},[]),d=y.useCallback(u=>{try{localStorage.setItem(B1,u?"true":"false")}catch{}if(u){const p=Xr(),m=sm(p);if(m!=null&&m.hidden){const g=om(p);if(g)try{localStorage.setItem(am,g.id)}catch{}}}wo(Xr(),u,!0),wp()},[]);return y.useEffect(()=>{wo(s,o)},[s,o]),y.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(L1),p=()=>{const m=Xr(),g=hd();if(g){const v=sm(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&wo(m,g),v!=null&&v.hidden){const b=om(m);b!=null&&b.variantDarkId&&b.variantLightId&&wo(m,g)}}wp()};return u.addEventListener("change",p),()=>{u.removeEventListener("change",p)}},[]),{themeId:s,setTheme:c,resolvedThemeId:r,preferSystem:o,setPreferSystem:d}}const $1=y.createContext(void 0);function p7({children:t}){const s=f7();return i.jsx($1.Provider,{value:s,children:t})}function U1(){const t=y.useContext($1);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const P1=y.createContext(void 0),H1=y.createContext(void 0);function m7({children:t}){const[s,o]=y.useState(void 0),r=y.useCallback(c=>{o(c)},[]);return i.jsx(H1.Provider,{value:r,children:i.jsx(P1.Provider,{value:s,children:t})})}function h7(){return y.useContext(P1)}function g7(){const t=y.useContext(H1);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const ih=y.createContext(void 0);function mt(){const t=y.useContext(ih);if(!t)throw new Error("useGrackle must be used within GrackleProvider");return t}function V1(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function q1(t,s){return console.warn(`[ws] Malformed "${t}" message: ${s}`),!1}function v7(t){return V1(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 y7=new Set(["off","subscription","api_key"]),Pc=new Set(["off","on"]);function b7(t){return V1(t)&&y7.has(t.claude)&&Pc.has(t.github)&&Pc.has(t.copilot)&&Pc.has(t.codex)&&Pc.has(t.goose)}function G1(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 F1(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 To=5e3;function x7(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 sa={label:"Home",url:Ci};function _7(t){return t?[sa,{label:"Settings",url:Ro},{label:t,url:void 0}]:[sa,{label:"Settings",url:void 0}]}const oh={label:"Environments",url:Mo};function k7(){return[sa,{label:"Environments",url:void 0}]}function S7(){return[sa,{label:"New Chat",url:void 0}]}function T7(t){return[sa,{label:`Session ${t.slice(0,8)}`,url:void 0}]}function w7(t,s,o,r){const c=o.find(u=>u.id===t),d=r.find(u=>u.id===s);return[sa,oh,{label:(d==null?void 0:d.displayName)??"Environment",url:Ni(s)},{label:(c==null?void 0:c.name)??"Workspace",url:void 0}]}function j7(t,s,o,r,c){const d=x7(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=[sa];v&&g&&(b.push(oh),b.push({label:v.displayName,url:Ni(g)})),m&&g&&b.push({label:m.name,url:Ua(m.id,g)});for(let S=0;S<d.length-1;S++)b.push({label:d[S].title,url:Bn(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 N7={label:"Findings",url:wd};function C7(){return[sa,{label:"Findings",url:void 0}]}function Z1(t,s,o,r,c){const d=[sa];if(s&&o){const u=r.find(m=>m.id===s),p=c.find(m=>m.id===o);d.push(oh),p&&d.push({label:p.displayName,url:Ni(o)}),u&&d.push({label:u.name,url:Ua(s,o)}),d.push({label:"Findings",url:hN(s,o)})}else d.push(N7);return d.push({label:t,url:void 0}),d}function rh(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 Hc(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 E7(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 lh(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?Hc(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?E7(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?Hc(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?Hc(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=Hc(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 A7(t,s,o){const r=t.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,c=K1(s),d=s.filter(m=>rm(m,c)).length,u=s.filter(m=>m.status==="paused"||m.status==="failed"||rm(m,c)).length,p=o.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:r,blockedTasks:d,attentionTasks:u,unhealthyEnvironments:p}}function K1(t){const s=new Map;for(const o of t)s.set(o.id,o.status);return s}function rm(t,s){return t.dependsOn.some(o=>s.get(o)!=="complete")}function D7(t,s){var u;const o=new Map;for(const p of s)o.set(p.id,p);const r=K1(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}):rm(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 R7(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 M7(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 Ss=[{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}],Ma=[{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"}],I7=new Map(Ss.map(t=>[t.id,t]));function jp(t){const s=I7.get(t);if(!s)throw new Error(`MOCK_KNOWLEDGE_NODES is missing node "${t}"`);return s}const Wb={"kn-auth-flow":{node:jp("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:jp("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:jp("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"}]}},O7=[{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}],B7=[{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}],L7=[{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"}],z7=[{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"}],$7=[{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}],Vc=[{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"}],U7=[{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:""}],P7=[{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:[]}],H7={"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 Re(t){return new Date(Date.now()+t).toISOString()}const Xb=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"I'll start by finding all API route files that need refactoring."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(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:Re(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:Re(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:Re(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:Re(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:Re(4500),content:JSON.stringify({input_tokens:28400,output_tokens:7200,cost_millicents:15e3})}},{delayMs:5e3,event:{eventType:"text",timestamp:Re(5e3),content:"All 22 tests pass. The route refactoring is complete."}},{delayMs:5500,event:{eventType:"status",timestamp:Re(5500),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:4,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"Scanning the current database schema to plan the migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(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:Re(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:Re(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:Re(0),content:"Proceeding with migration."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(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:Re(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:Re(2300),content:"All 3 migrations applied successfully. The `audit_log` table is ready."}},{delayMs:3200,event:{eventType:"status",timestamp:Re(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"I'll generate tests for `src/services/billing.ts`. Let me read the implementation first."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(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:Re(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:Re(2400),content:"The billing service imports from `./stripe-client.js`. Let me check if that module exists."}},{delayMs:2800,event:{eventType:"tool_use",timestamp:Re(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:Re(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:Re(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:Re(4e3),content:"failed"}}]},{label:"Fix Auth Bug",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Re(0),content:"running"}},{delayMs:600,event:{eventType:"text",timestamp:Re(600),content:"Let me investigate the authentication bug..."}},{delayMs:1200,event:{eventType:"tool_use",timestamp:Re(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:Re(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:Re(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:Re(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:Re(4e3),content:"File updated successfully",raw:JSON.stringify({tool_use_id:"tool-mock-002",is_error:!1})}},{delayMs:4600,event:{eventType:"tool_use",timestamp:Re(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:Re(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:Re(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:Re(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:Re(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:Re(8400),content:JSON.stringify({input_tokens:42600,output_tokens:1850,cost_millicents:12e3})}},{delayMs:8800,event:{eventType:"status",timestamp:Re(8800),content:"completed"}}]}],ks={onConnect:async()=>{},onDisconnect:()=>{},handleEvent:()=>!1},Qb=400;function V7({children:t}){const[s,o]=y.useState(O7),[r,c]=y.useState(B7),[d,u]=y.useState(L7),[p,m]=y.useState(void 0),[g,v]=y.useState(z7),[b,x]=y.useState(""),[S,k]=y.useState($7),[w,N]=y.useState(Vc),[T,C]=y.useState(void 0),D=!1,[B,E]=y.useState(U7),[A,P]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[I,U]=y.useState(P7),[Q]=y.useState(H7),[$,W]=y.useState(""),[pe,H]=y.useState(Ss),[ie,L]=y.useState(Ma),[Z,J]=y.useState(void 0),[ce,X]=y.useState(void 0),[ge,fe]=y.useState(""),Ne=y.useRef(void 0),Fe=y.useRef(0),me=y.useRef(0),_e=y.useRef(new Set),ve=y.useRef(new Map),Be=y.useRef(S);Be.current=S;const Mt=y.useRef(new Map),wn=y.useRef(new Map),oe=y.useCallback(V=>(Fe.current+=1,`mock-${V}-${String(Fe.current).padStart(3,"0")}`),[]),He=y.useCallback(()=>{const V=Xb[me.current%Xb.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 Je={sessionId:V,...de.event,timestamp:new Date().toISOString()};if(at(Je),de.event.eventType==="status"){const Te=G1(de.event.content),Me=F1(de.event.content);ht(V,Te,Me)}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"),Je={id:ye,environmentId:V,runtime:de||"claude-code",status:"running",prompt:ae,startedAt:new Date().toISOString()};c(Me=>[...Me,Je]),m(ye);const Te=He();if(console.log(`[MockGrackle] Playing scenario: ${Te.label}`),Te.pauseForInput){const Me=Te.pauseAfterStep??Te.steps.length-1,Ze=Te.steps.slice(0,Me+1),ct=Ze.length>0?Ze[Ze.length-1].delayMs:0;Kt(ye,Ze),qt(()=>{ht(ye,"idle"),at({sessionId:ye,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},ct+Qb,ye),Te.resumeSteps&&Mt.current.set(ye,Te.resumeSteps)}else Kt(ye,Te.steps)},[oe,He,Kt,qt,ht,at]),ms=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]),ia=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]),ts=y.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),Za=y.useCallback(async V=>{console.log("[MockGrackle] loadSessionEvents",V)},[]),oa=y.useCallback(()=>{console.log("[MockGrackle] clearEvents"),u([])},[]),Yt=y.useCallback(async(V,ae,le,de,ye,Je,Te,Me,Ze)=>{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:Je??!0,defaultPersonaId:ye||"",tokenBudget:0,costBudgetMillicents:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Xe=>[...Xe,ct]),Me&&Me()},[oe]),Ii=y.useCallback(async V=>{console.log("[MockGrackle] archiveWorkspace",V),v(ae=>ae.map(le=>le.id===V?{...le,status:"archived"}:le))},[]),ra=y.useCallback(async V=>{console.log("[MockGrackle] loadTasks",V)},[]),Ka=y.useCallback(async(V,ae,le,de,ye,Je,Te,Me,Ze)=>{console.log("[MockGrackle] createTask",{workspaceId:V,title:ae,parentTaskId:ye}),k(ct=>{const Xt=ct.filter(vn=>vn.workspaceId===V).reduce((vn,ei)=>Math.max(vn,ei.sortOrder),0),jt=ye?ct.find(vn=>vn.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 $e=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:$e,childTaskIds:[],canDecompose:Te??!ye,defaultPersonaId:Je||"",workpad:"",tokenBudget:0,costBudgetMillicents:0};return[...ct,It]}),Me&&Me()},[oe]),hs=y.useCallback(async(V,ae,le,de)=>{var ct;console.log("[MockGrackle] startTask",{taskId:V});const ye=Be.current.find(Xe=>Xe.id===V),Je=(ye==null?void 0:ye.title)??"",Te=oe("sess"),Me={id:Te,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Je||V,startedAt:new Date().toISOString()};c(Xe=>[...Xe,Me]),k(Xe=>Xe.map(Xt=>Xt.id===V?{...Xt,status:"working",latestSessionId:Te,branch:`mock/${V.slice(0,8)}`}:Xt));const Ze=He();if(console.log(`[MockGrackle] Playing task scenario: ${Ze.label}`),Ze.pauseForInput){const Xe=Ze.pauseAfterStep??Ze.steps.length-1,Xt=Ze.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+Qb,Te),Ze.resumeSteps){const $e=[...Ze.resumeSteps];Mt.current.set(Te,$e);const It=$e.reduce((vn,ei)=>Math.max(vn,ei.delayMs),0);wn.current.set(Te,{taskId:V,delayAfterResume:It+200})}}else{const Xe=Ze.steps.length>0?Ze.steps[Ze.steps.length-1].delayMs:0;Kt(Te,Ze.steps);const Xt=(ct=Ze.steps[Ze.steps.length-1])==null?void 0:ct.event.content;qt(()=>{Xt==="completed"?k(jt=>jt.map($e=>$e.id===V&&$e.status==="working"?{...$e,status:"paused"}:$e)):Xt==="failed"&&k(jt=>jt.map($e=>$e.id===V&&$e.status==="working"?{...$e,status:"failed"}:$e))},Xe+100,Te)}},[oe,He,Kt,qt,ht,at]),Oi=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=wn.current.get(V);de&&(wn.current.delete(V),qt(()=>{k(ye=>ye.map(Je=>Je.id===de.taskId&&Je.status==="working"?{...Je,status:"paused"}:Je))},de.delayAfterResume,V))},[at,ht,Kt,qt]),jn=y.useCallback(async V=>{console.log("[MockGrackle] completeTask",V),k(ae=>ae.map(le=>le.id===V?{...le,status:"complete"}:le))},[]),De=y.useCallback(async V=>{console.log("[MockGrackle] resumeTask",V)},[]),Ye=y.useCallback(async(V,ae,le,de,ye)=>{console.log("[MockGrackle] updateTask",{taskId:V,title:ae}),k(Je=>Je.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(Vc.filter(ae=>ae.workspaceId===V))},[]),fn=y.useCallback(async()=>{console.log("[MockGrackle] loadAllFindings"),N([...Vc])},[]),Wt=y.useCallback(async V=>{console.log("[MockGrackle] loadFinding",V);const ae=Vc.find(le=>le.id===V);C(ae)},[]),Bi=y.useCallback(async(V,ae,le,de,ye)=>{console.log("[MockGrackle] postFinding",{workspaceId:V,title:ae});const Je={id:oe("find"),workspaceId:V,taskId:"",sessionId:"",category:de||"general",title:ae,content:le,tags:ye||[],createdAt:new Date().toISOString()};N(Te=>[...Te,Je])},[oe]),Li=y.useCallback(async()=>{console.log("[MockGrackle] loadEnvironments")},[]),zi=y.useCallback(async(V,ae,le)=>{console.log("[MockGrackle] addEnvironment",{displayName:V,adapterType:ae,adapterConfig:le})},[]),Ya=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)}:{}}))},[]),Ja=y.useCallback(async()=>{console.log("[MockGrackle] loadTokens")},[]),Wa=y.useCallback(async(V,ae,le,de,ye)=>{console.log("[MockGrackle] setToken",{name:V,tokenType:le}),E(Je=>[...Je.filter(Me=>Me.name!==V),{name:V,tokenType:le,envVar:de,filePath:ye,expiresAt:""}])},[]),gs=y.useCallback(async V=>{console.log("[MockGrackle] deleteToken",V),E(ae=>ae.filter(le=>le.name!==V))},[]),Xa=y.useCallback(async V=>{console.log("[MockGrackle] updateCredentialProviders",V),P(V)},[]);y.useEffect(()=>()=>{_e.current.forEach(clearTimeout),_e.current.clear()},[]);const Qa=y.useMemo(()=>({connected:!0,environments:{environments:s,environmentsLoading:!1,provisionStatus:{},operationError:"",clearOperationError:()=>{},loadEnvironments:Li,addEnvironment:zi,updateEnvironment:Ya,provisionEnvironment:async(V,ae)=>{},stopEnvironment:async()=>{},removeEnvironment:async()=>{},domainHook:ks},sessions:{sessions:r,sessionsLoading:!1,events:d,eventsDropped:0,lastSpawnedId:p,taskSessions:Q,spawn:gt,sendInput:Oi,kill:ms,stopGraceful:ia,loadSessionEvents:Za,clearEvents:oa,loadTaskSessions:async V=>{console.log("[MockGrackle] loadTaskSessions",V)},domainHook:ks},workspaces:{workspaces:g,workspacesLoading:!1,workspaceCreating:!1,loadWorkspaces:async()=>{console.log("[MockGrackle] loadWorkspaces")},createWorkspace:Yt,archiveWorkspace:Ii,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:ks},tasks:{tasks:S,tasksLoading:!1,taskStartingId:void 0,loadTasks:ra,loadAllTasks:async()=>{console.log("[MockGrackle] loadAllTasks")},createTask:Ka,startTask:hs,stopTask:async V=>{console.log("[MockGrackle] stopTask",{taskId:V}),await jn(V)},completeTask:jn,resumeTask:De,updateTask:Ye,deleteTask:Jt,domainHook:ks},findings:{findings:w,selectedFinding:T,findingLoading:D,findingsLoading:!1,loadFindings:St,loadAllFindings:fn,loadFinding:Wt,postFinding:Bi,domainHook:ks},tokens:{tokens:B,tokensLoading:!1,loadTokens:Ja,setToken:Wa,deleteToken:gs,domainHook:ks},credentials:{credentialProviders:A,credentialsLoading:!1,updateCredentialProviders:Xa,domainHook:ks},codespaces:{codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:async()=>{},createCodespace:async()=>{},domainHook:ks},personas:{personas:I,personasLoading:!1,createPersona:async(V,ae,le,de,ye,Je,Te,Me,Ze)=>{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:Je||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Te||"agent",script:Me||"",allowedMcpTools:Ze||[]};return U(Xe=>[...Xe,ct]),ct},updatePersona:async(V,ae,le,de,ye,Je,Te,Me,Ze,ct)=>{console.log("[MockGrackle] updatePersona",{personaId:V,name:ae});const Xe=I.find($e=>$e.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}:{},...Je!==void 0?{model:Je}:{},...Te!==void 0?{maxTurns:Te}:{},...Me!==void 0?{type:Me}:{},...Ze!==void 0?{script:Ze}:{},...ct!==void 0?{allowedMcpTools:ct}:{},updatedAt:Xt};return U($e=>$e.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:ks},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=Ne.current,le=ae?Ss.filter(Te=>!Te.workspaceId||Te.workspaceId===ae):Ss,de=V.toLowerCase(),ye=le.filter(Te=>{var Me,Ze,ct;return Te.label.toLowerCase().includes(de)||((Me=Te.content)==null?void 0:Me.toLowerCase().includes(de))||((Ze=Te.tags)==null?void 0:Ze.some(Xe=>Xe.toLowerCase().includes(de)))||((ct=Te.category)==null?void 0:ct.toLowerCase().includes(de))});H(ye);const Je=new Set(ye.map(Te=>Te.id));L(Ma.filter(Te=>Je.has(Te.source)&&Je.has(Te.target))),X(void 0),J(void 0)},clearSearch:()=>{console.log("[MockGrackle] knowledge.clearSearch"),fe("");const V=Ne.current,ae=V?Ss.filter(de=>!de.workspaceId||de.workspaceId===V):Ss;H(ae);const le=new Set(ae.map(de=>de.id));L(Ma.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 Wb?Wb[V]:void 0;if(ae)J(ae);else{const le=Ss.find(de=>de.id===V);if(le){const de=Ma.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(Me=>Me.id)),de=Ma.filter(Me=>Me.source===V||Me.target===V),ye=new Set;for(const Me of de)le.has(Me.source)||ye.add(Me.source),le.has(Me.target)||ye.add(Me.target);if(ye.size===0)return ae;const Je=Ss.filter(Me=>ye.has(Me.id)),Te=new Set([...le,...ye]);return L(Me=>{const Ze=new Set(Me.map(Xe=>`${Xe.source}|${Xe.target}|${Xe.type}`)),ct=Ma.filter(Xe=>Te.has(Xe.source)&&Te.has(Xe.target)&&!Ze.has(`${Xe.source}|${Xe.target}|${Xe.type}`));return ct.length>0?[...Me,...ct]:Me}),[...ae,...Je]})},loadRecent:async V=>{if(console.log("[MockGrackle] knowledge.loadRecent",V),Ne.current=V,V){const ae=Ss.filter(de=>!de.workspaceId||de.workspaceId===V);H(ae);const le=new Set(ae.map(de=>de.id));L(Ma.filter(de=>le.has(de.source)&&le.has(de.target)))}else H(Ss),L(Ma);fe("")},handleEvent:()=>!1,domainHook:ks},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:ts}),[s,r,d,p,Q,g,b,S,w,T,B,A,I,$,pe,ie,Z,ce,ge,gt,Oi,ms,ia,Za,oa,Yt,Ii,ra,Ka,hs,jn,De,Ye,Jt,St,fn,Wt,Bi,Li,zi,Ya,Ja,Wa,gs,Xa,ts]);return i.jsx(ih.Provider,{value:Qa,children:t})}const q7=3e3;function G7(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=We.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 ji&&x.code===gx.Unauthenticated){window.location.href=fN;return}}p||(o(!1),(b=u.current)==null||b.call(u),m=setTimeout(()=>{g().catch(()=>{})},q7))}}return g().catch(()=>{}),()=>{p=!0,clearTimeout(m),o(!1)}},[]),{connected:s}}const lm=["core","orchestration"],Y1=y.createContext({pluginNames:[...lm],loading:!1,error:void 0});function F7({children:t}){const[s,o]=y.useState([...lm]),[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([...lm]),u(m instanceof Error?m:new Error(String(m))),c(!1))}),()=>{p=!0}},[]),i.jsx(Y1.Provider,{value:{pluginNames:s,loading:r,error:d},children:t})}function ch(){return y.useContext(Y1)}const Z7=new Set(["dashboard","chat","environments","settings"]),K7=new Set(["tasks","findings"]),Y7=new Set(["knowledge"]),J1={core:{navItems:Xc.filter(t=>Z7.has(t.view)),domainHookKeys:["environments","sessions","workspaces","tokens","credentials","codespaces"]},orchestration:{navItems:Xc.filter(t=>K7.has(t.view)),domainHookKeys:["tasks","findings","personas","notifications"]},knowledge:{navItems:Xc.filter(t=>Y7.has(t.view)),domainHookKeys:["knowledge"]}};function J7(t){return t.flatMap(s=>{var o;return((o=J1[s])==null?void 0:o.navItems)??[]})}function W7(t){return new Set(t.flatMap(s=>{var o;return((o=J1[s])==null?void 0:o.domainHookKeys)??[]}))}function X7(t){return{id:t.id,displayName:t.displayName,adapterType:t.adapterType,adapterConfig:t.adapterConfig||"{}",status:t.status,bootstrapped:t.bootstrapped}}function ex(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 Q7(t){return{sessionId:t.sessionId,eventType:vx(t.type),timestamp:t.timestamp,content:t.content,raw:t.raw||void 0}}function ez(t){return{id:t.id,name:t.name,description:t.description,repoUrl:t.repoUrl,environmentId:t.environmentId,linkedEnvironmentIds:[...t.linkedEnvironmentIds],status:NT(t.status),workingDirectory:t.workingDirectory,useWorktrees:t.useWorktrees,defaultPersonaId:t.defaultPersonaId,tokenBudget:t.tokenBudget,costBudgetMillicents:t.costBudgetMillicents,createdAt:t.createdAt,updatedAt:t.updatedAt}}function tx(t){return{id:t.id,workspaceId:t.workspaceId??void 0,title:t.title,description:t.description,status:CT(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 Np(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 tz(t){return{name:t.name,tokenType:t.type,envVar:t.envVar,filePath:t.filePath,expiresAt:t.expiresAt}}function nz(t){return{claude:ET(t.claude),github:Ec(t.github),copilot:Ec(t.copilot),codex:Ec(t.codex),goose:Ec(t.goose)}}function sz(t){return{name:t.name,repository:t.repository,state:t.state,gitStatus:t.gitStatus}}function Cp(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 az(t){return{inputTokens:t.inputTokens,outputTokens:t.outputTokens,costMillicents:t.costMillicents,sessionCount:t.sessionCount}}function qc(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 Ep(t){return{source:t.fromId,target:t.toId,type:t.type}}function Fa(){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 nx=5e3;function Hr(t){return t instanceof ji?t.message:"Operation failed"}function iz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[c,d]=y.useState({}),[u,p]=y.useState(""),m=y.useCallback(()=>{p("")},[]),g=y.useCallback(async()=>{try{const C=await r(We.listEnvironments({}));s(C.environments.map(X7))}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 q1("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})},nx)}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 We.addEnvironment({displayName:C,adapterType:D,adapterConfig:JSON.stringify(B??{})})}catch(E){p(Hr(E))}},[]),S=y.useCallback(async(C,D)=>{p("");try{await We.updateEnvironment({id:C,displayName:D.displayName,adapterConfig:D.adapterConfig?JSON.stringify(D.adapterConfig):void 0})}catch(B){p(Hr(B))}},[]),k=y.useCallback(async(C,D)=>{p("");try{const B=We.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})},nx)}catch(B){d(E=>{const A={...E};return delete A[C],A}),p(Hr(B))}},[]),w=y.useCallback(async C=>{p("");try{await We.stopEnvironment({id:C})}catch(D){p(Hr(D))}},[]),N=y.useCallback(async C=>{p("");try{await We.removeEnvironment({id:C})}catch(D){p(Hr(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 Ap=new Set(["pending","running","idle"]),oz=new Set(["completed","failed","interrupted","hibernating","suspended"]),sx=["pending","running","idle"];function rz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[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(We.listSessions({}))).sessions.map(ex);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:oz.has(H)&&Ap.has(W.status)?{...W,status:H,...pe.endReason!==void 0?{endReason:pe.endReason}:{}}:Ap.has(H)&&Ap.has(W.status)&&sx.indexOf(H)>sx.indexOf(W.status)?{...W,status:H}:W})})}catch{}},[r]),S=y.useCallback(I=>{if(I.type!=="session_event")return!1;if(!v7(I.payload))return q1("session_event","payload is not a valid SessionEvent"),!0;const U=I.payload;let Q=0;if(d($=>{const W=[...$,U];return W.length>To?(Q=W.length-To,W.slice(-To)):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 $=G1(U.content),W=F1(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 We.spawnAgent({environmentId:I,prompt:U,personaId:Q||"",workingDirectory:$||""});g(W.id),await x()}catch{}},[x]),T=y.useCallback(async(I,U)=>{try{await We.sendInput({sessionId:I,text:U})}catch{}},[]),C=y.useCallback(async I=>{try{await We.killAgent({id:I,graceful:!1})}catch{}},[]),D=y.useCallback(async I=>{try{await We.killAgent({id:I,graceful:!0})}catch{}},[]),B=y.useCallback(async I=>{try{const Q=(await We.getSessionEvents({id:I})).events.map(Q7);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>To?($=ie.length-To,ie.slice(-To)):ie}),$>0&&p(W=>W+$)}}catch{}},[]),E=y.useCallback(()=>{d([]),p(0)},[]),A=y.useCallback(async I=>{try{const Q=(await We.getTaskSessions({id:I})).sessions.map(ex);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 ax(t){return t instanceof ji?t.message:"Operation failed"}function lz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[c,d]=y.useState(!1),[u,p]=y.useState(""),m=y.useCallback(async()=>{try{const C=await r(We.listWorkspaces({}));s(C.workspaces.map(ez))}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 We.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 ji?$.message:"Failed to create workspace";Q==null||Q(W)}},[]),x=y.useCallback(async C=>{try{await We.archiveWorkspace({id:C})}catch{}},[]),S=y.useCallback(async(C,D)=>{try{await We.updateWorkspace({id:C,...D})}catch{}},[]),k=y.useCallback(()=>{p("")},[]),w=y.useCallback(async(C,D)=>{try{p(""),await We.linkEnvironment({workspaceId:C,environmentId:D}),await m().catch(()=>{})}catch(B){p(ax(B))}},[m]),N=y.useCallback(async(C,D)=>{try{p(""),await We.unlinkEnvironment({workspaceId:C,environmentId:D}),await m().catch(()=>{})}catch(B){p(ax(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 cz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),[c,d]=y.useState(void 0),u=y.useRef({}),p=y.useCallback(async E=>{try{const P=(await cn.listTasks({workspaceId:E})).tasks.map(tx);s(I=>[...I.filter(U=>U.workspaceId!==E),...P])}catch{}},[]),m=y.useCallback(async()=>{try{const A=(await r(cn.listTasks({}))).tasks.map(tx);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 cn.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 ji?H.message:"Failed to create task";pe==null||pe(ie)}},[]),k=y.useCallback(async(E,A,P,I)=>{d(E);try{await cn.startTask({taskId:E,personaId:A||"",environmentId:P||"",notes:I||""})}catch(U){if(U instanceof ji&&U.code===gx.ResourceExhausted)return;d(void 0)}},[]),w=y.useCallback(async E=>{try{await cn.stopTask({id:E})}catch{}},[]),N=y.useCallback(async E=>{try{await cn.completeTask({id:E})}catch{}},[]),T=y.useCallback(async E=>{try{await cn.resumeTask({id:E})}catch{}},[]),C=y.useCallback(async(E,A,P,I,U)=>{try{await cn.updateTask({id:E,title:A,description:P,dependsOn:I,...U!==void 0?{defaultPersonaId:U}:{}})}catch{}},[]),D=y.useCallback(async E=>{try{await cn.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 dz(){const[t,s]=y.useState([]),[o,r]=y.useState(void 0),[c,d]=y.useState(!1),{loading:u,track:p}=Fa(),m=y.useCallback(async k=>{try{const w=await p(cn.queryFindings({workspaceId:k}));s(w.findings.map(Np))}catch{}},[p]),g=y.useCallback(async()=>{try{const k=await p(cn.queryFindings({workspaceId:""}));s(k.findings.map(Np))}catch{}},[p]),v=y.useCallback(async k=>{r(void 0),d(!0);try{const w=await cn.getFinding({id:k});r(Np(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 cn.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 uz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),c=y.useCallback(async()=>{try{const g=await r(We.listTokens({}));s(g.tokens.map(tz))}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 We.setToken({name:g,value:v,type:b,envVar:x,filePath:S})}catch{}},[]),p=y.useCallback(async g=>{try{await We.deleteToken({name:g})}catch{}},[]);return{tokens:t,tokensLoading:o,loadTokens:c,setToken:u,deleteToken:p,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function fz(){const[t,s]=y.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),{loading:o,track:r}=Fa(),c=y.useCallback(async()=>{try{const m=await r(We.getCredentialProviders({}));s(nz(m))}catch{}},[r]),d=y.useCallback(m=>m.type==="credential.providers_changed"?(b7(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})=>We.setCredentialProvider({provider:v,value:b})))},[]);return{credentialProviders:t,credentialsLoading:o,loadCredentials:c,updateCredentialProviders:u,handleEvent:d,domainHook:{onConnect:()=>c(),onDisconnect:()=>{},handleEvent:d}}}function pz(){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 We.listCodespaces({});s(b.codespaces.map(sz)),d(b.error)}catch{}},[]),g=y.useCallback(async(b,x)=>{p(!0),r("");try{await We.createCodespace({repo:b,machine:x??""}),p(!1),await m()}catch(S){p(!1);const k=S instanceof ji?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 mz(){const[t,s]=y.useState([]),{loading:o,track:r}=Fa(),c=y.useCallback(async()=>{try{const v=await r(cn.listPersonas({}));s(v.personas.map(Cp))}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 cn.createPersona({name:v,description:b,systemPrompt:x,runtime:S||"",model:k||"",maxTurns:w||0,type:N||"agent",script:T||"",allowedMcpTools:C||[]}),B=Cp(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 cn.updatePersona(B),A=Cp(E);return s(P=>P.map(I=>I.id===A.id?A:I)),A},[]),m=y.useCallback(async v=>{await cn.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 hz(t){if(t)try{return JSON.parse(t)}catch{return}}function gz(){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 Dc.listRecentKnowledgeNodes({limit:30,workspaceId:A}),I=new Map,U=[];for(const Q of P.nodes)I.set(Q.id,qc(Q));for(const Q of P.edges)U.push(Ep(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 Dc.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,qc(U.node,U.edges.length));for(const Q of U.edges)I.push(Ep(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 Dc.getKnowledgeNode({id:E});if(!A.node){d(void 0);return}d({node:qc(A.node,A.edges.length),edges:A.edges.map(P=>({fromId:P.fromId,toId:P.toId,type:P.type,metadata:hz(P.metadataJson)}))})}catch{d(void 0)}},[]),T=y.useCallback(()=>{p(void 0),d(void 0)},[]),C=y.useCallback(async E=>{try{const A=await Dc.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,qc(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 $=Ep(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 vz(){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 yz(){const[t,s]=y.useState(""),[o,r]=y.useState(void 0),[c,d]=y.useState({}),{pluginNames:u}=ch(),p=W7(u),m=iz(),g=rz(),v=lz(),b=cz(),x=dz(),S=uz(),k=fz(),w=pz(),N=mz(),T=gz(),C=vz(),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}=G7({onSessionEvent:H=>{g.handleSessionEvent({sessionId:H.sessionId,eventType:vx(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 We.setSetting({key:E,value:H});s(ie.value)},[]),I=y.useCallback(async()=>{r(!0);try{await We.setSetting({key:A,value:"true"})}catch{}},[]),U=y.useCallback(async(H,ie)=>{try{const L=await We.getUsage({scope:H,id:ie}),Z=`${H}:${ie}`;d(J=>({...J,[Z]:az(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 We.getSetting({key:E});s(H.value)}catch{}try{const H=await We.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 bz({children:t}){const s=yz();return i.jsx(ih.Provider,{value:s,children:t})}function xz(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 _z(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 kz={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 Sz(t){return kz[t]}function Tz(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=Sz(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 wz(t,s){const o=y.useRef(void 0);y.useEffect(()=>{const r=o.current;o.current=t;const c=Tz(r,t);for(const d of c)s(d.message,d.variant)},[t,s])}const jz="_dashboard_16pzm_1",Nz="_kpiStrip_16pzm_11",Cz="_kpiCard_16pzm_23",Ez="_kpiValue_16pzm_68",Az="_kpiLabel_16pzm_76",Dz="_bodyGrid_16pzm_84",Rz="_section_16pzm_96",Mz="_sectionHeader_16pzm_109",Iz="_sectionIcon_16pzm_118",Oz="_sectionTitle_16pzm_123",Bz="_sectionCount_16pzm_131",Lz="_sectionBody_16pzm_138",zz="_emptyHint_16pzm_143",$z="_sessionRow_16pzm_150",Uz="_sessionPrompt_16pzm_177",Pz="_sessionEnv_16pzm_186",Hz="_sessionRuntime_16pzm_192",Vz="_sessionStatus_16pzm_198",qz="_statusDot_16pzm_207",Gz="_attentionRow_16pzm_233",Fz="_attentionTitle_16pzm_259",Zz="_attentionMeta_16pzm_267",Kz="_reasonBadge_16pzm_274",Yz="_bottomGrid_16pzm_301",Jz="_envRow_16pzm_312",Wz="_envName_16pzm_323",Xz="_envStatusBadge_16pzm_333",Qz="_workspaceRow_16pzm_369",e$="_workspaceTop_16pzm_395",t$="_workspaceName_16pzm_401",n$="_workspaceCounts_16pzm_407",s$="_progressBar_16pzm_415",a$="_progressFill_16pzm_422",ue={dashboard:jz,kpiStrip:Nz,kpiCard:Cz,kpiValue:Ez,kpiLabel:Az,bodyGrid:Dz,section:Rz,sectionHeader:Mz,sectionIcon:Iz,sectionTitle:Oz,sectionCount:Bz,sectionBody:Lz,emptyHint:zz,sessionRow:$z,sessionPrompt:Uz,sessionEnv:Pz,sessionRuntime:Hz,sessionStatus:Vz,statusDot:qz,attentionRow:Gz,attentionTitle:Fz,attentionMeta:Zz,reasonBadge:Kz,bottomGrid:Yz,envRow:Jz,envName:Wz,envStatusBadge:Xz,workspaceRow:Qz,workspaceTop:e$,workspaceName:t$,workspaceCounts:n$,progressBar:s$,progressFill:a$};function i$(){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 o$={hidden:{opacity:0,y:12},visible:t=>({opacity:1,y:0,transition:{delay:t*.06,duration:.3,ease:"easeOut"}})},Gc={hidden:{opacity:0,y:16},visible:t=>({opacity:1,y:0,transition:{delay:.15+t*.08,duration:.35,ease:"easeOut"}})};function r$(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 Fc({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:o$,initial:"hidden",animate:"visible",custom:r,children:[i.jsx("span",{className:ue.kpiValue,children:t}),i.jsx("span",{className:ue.kpiLabel,children:s})]})}function l$(){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(()=>A7(d,o,p),[d,o,p]),x=y.useMemo(()=>R7(d,p),[d,p]),S=y.useMemo(()=>D7(o,t),[o,t]),k=y.useMemo(()=>M7(t,o),[t,o,p]);return d.length===0&&o.length===0&&p.length===0&&t.length===0&&(u||r||m||s)?i.jsx(i$,{}):i.jsxs("div",{className:ue.dashboard,"data-testid":"dashboard",children:[i.jsxs("div",{className:ue.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[i.jsx(Fc,{value:b.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),i.jsx(Fc,{value:b.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),i.jsx(Fc,{value:b.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),i.jsx(Fc,{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:Gc,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(xm(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:Gc,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(Bn(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:Gc,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:Gc,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(Ua(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":r$(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 c$="_panelContainer_1udy7_1",d$="_emptyState_1udy7_8",u$="_workspaceSummary_1udy7_17",f$="_workspaceSummaryTitle_1udy7_28",p$="_workspaceSummarySubtitle_1udy7_32",m$="_header_1udy7_36",h$="_headerInfo_1udy7_71",g$="_headerTitle_1udy7_106",v$="_taskStatusBadge_1udy7_128",y$="_taskBranch_1udy7_137",b$="_taskBlockedBadge_1udy7_143",x$="_tabBar_1udy7_277",_$="_tab_1udy7_277",k$="_active_1udy7_303",S$="_eventScroll_1udy7_308",T$="_tabContent_1udy7_314",w$="_noContext_1udy7_319",j$="_overviewContent_1udy7_325",N$="_overviewDashboard_1udy7_334",C$="_overviewHero_1udy7_340",E$="_overviewSection_1udy7_347",A$="_overviewLabel_1udy7_353",D$="_envRow_1udy7_360",R$="_timeline_1udy7_366",M$="_timelineRow_1udy7_372",I$="_waitingMessage_1udy7_379",O$="_errorMessage_1udy7_383",B$="_emptyCta_1udy7_387",L$="_ctaTitle_1udy7_399",z$="_ctaDescription_1udy7_405",$$="_ctaButton_1udy7_412",U$="_workspaceHeader_1udy7_533",P$="_workspaceName_1udy7_558",H$="_workspaceMeta_1udy7_571",V$="_metaRow_1udy7_579",q$="_metaLabel_1udy7_592",G$="_metaValue_1udy7_607",F$="_archiveButton_1udy7_617",Z$="_repoLink_1udy7_647",K$="_metaToggle_1udy7_657",Y$="_metaToggleArrow_1udy7_678",J$="_metaToggleArrowOpen_1udy7_683",W$="_progressBarContainer_1udy7_687",X$="_progressBar_1udy7_687",Q$="_progressFill_1udy7_703",eU="_progressLabel_1udy7_710",tU="_metaTimestamps_1udy7_717",nU="_metaTimestamp_1udy7_717",sU="_metaPlaceholder_1udy7_739",aU="_linkedEnvList_1udy7_744",iU="_linkedEnvChip_1udy7_750",oU="_chipDismiss_1udy7_762",rU="_linkError_1udy7_777",lU="_linkEnvSelect_1udy7_782",Y={panelContainer:c$,emptyState:d$,workspaceSummary:u$,workspaceSummaryTitle:f$,workspaceSummarySubtitle:p$,header:m$,headerInfo:h$,headerTitle:g$,taskStatusBadge:v$,taskBranch:y$,taskBlockedBadge:b$,tabBar:x$,tab:_$,active:k$,eventScroll:S$,tabContent:T$,noContext:w$,overviewContent:j$,overviewDashboard:N$,overviewHero:C$,overviewSection:E$,overviewLabel:A$,envRow:D$,timeline:R$,timelineRow:M$,waitingMessage:I$,errorMessage:O$,emptyCta:B$,ctaTitle:L$,ctaDescription:z$,ctaButton:$$,workspaceHeader:U$,workspaceName:P$,workspaceMeta:H$,metaRow:V$,metaLabel:q$,metaValue:G$,archiveButton:F$,repoLink:Z$,metaToggle:K$,metaToggleArrow:Y$,metaToggleArrowOpen:J$,progressBarContainer:W$,progressBar:X$,progressFill:Q$,progressLabel:eU,metaTimestamps:tU,metaTimestamp:nU,metaPlaceholder:sU,linkedEnvList:aU,linkedEnvChip:iU,chipDismiss:oU,linkError:rU,linkEnvSelect:lU};function cU(){return i.jsx("div",{className:Y.emptyState,children:"Select a task or click + to create one"})}function dU(){return i.jsx("div",{className:Y.emptyState,children:"Select an environment to manage its workspaces, or add a new one."})}function uU(){const{workspaces:{workspaces:t},environments:{environments:s}}=mt(),o=kt(),r=s.length>0;return t.length>0?i.jsx(l$,{}):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(Hx),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 fU="_panelContainer_19poq_1",pU="_chatHeader_19poq_8",mU="_chatHeaderInfo_19poq_37",hU="_emptyState_19poq_43",gU="_emptyTitle_19poq_55",vU="_emptyDescription_19poq_61",yU="_emptyHint_19poq_67",La={panelContainer:fU,chatHeader:pU,chatHeaderInfo:mU,emptyState:hU,emptyTitle:gU,emptyDescription:vU,emptyHint:yU};function bU(){return i.jsx("div",{className:La.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 xU({hasLocalEnvironment:t}){return i.jsxs("div",{className:La.emptyState,"data-testid":"chat-empty-state",children:[i.jsx("div",{className:La.emptyTitle,children:"Welcome to Grackle"}),i.jsx("div",{className:La.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:La.emptyHint,children:"Go to Settings → Environments to add one."})]})}function _U(){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}=Tn(),C=y.useRef(void 0),[D,B]=y.useState(),E=t.find(W=>W.id===Mr),A=E!=null&&E.latestSessionId?r.find(W=>W.id===E.latestSessionId)??(p[Mr]??[]).find(W=>W.id===E.latestSessionId):void 0;y.useEffect(()=>{m(Mr).catch(()=>{})},[m]),y.useEffect(()=>{E!=null&&E.latestSessionId&&m(Mr).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 lh(rh(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(bU,{}):i.jsxs("div",{className:La.panelContainer,"data-testid":"chat-page",children:[U&&i.jsxs("div",{className:La.chatHeader,children:[i.jsxs("span",{className:La.chatHeaderInfo,children:["Session: ",A.id.slice(0,8)," | ",A.runtime," | ",A.status]}),i.jsx(qx,{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(nh,{events:P,eventsDropped:u,emptyState:i.jsx(xU,{hasLocalEnvironment:!!I}),onShowToast:T}),I&&U&&i.jsx(el,{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(el,{mode:"start",taskId:Mr,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 kU(){const t=S7(),[s]=bm(),o=s.get("env")??"",{sessions:{sendInput:r,spawn:c},tasks:{startTask:d},personas:{personas:u},environments:{environments:p,provisionEnvironment:m}}=mt(),{showToast:g}=Tn();return i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Cs,{segments:t}),i.jsx("div",{className:Y.emptyState,children:"Enter a prompt below to start a new session"}),i.jsx(el,{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 SU(){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 TU({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?` | ${Io((s.inputTokens??0)+(s.outputTokens??0))} tokens · ${Ts(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(qx,{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 wU({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 jU(){const{sessionId:t}=ps(),{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}=Tn(),w=y.useRef(void 0),N=T7(t),T=r.find(B=>B.id===t)??void 0,C=y.useMemo(()=>{const B=t?s.filter(E=>E.sessionId===t):[];return lh(rh(B))},[s,t]);if(y.useEffect(()=>{t&&t!==w.current&&(w.current=t,p(t).catch(()=>{}))},[t,p]),!T&&c)return i.jsx(SU,{});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(Cs,{segments:N}),i.jsx(TU,{sessionId:t,session:T,isActive:D,onStop:()=>{u(t).catch(()=>{})},onKill:()=>{d(t).catch(()=>{})}}),i.jsx(nh,{events:C,eventsDropped:o,emptyState:i.jsx(wU,{session:T}),onShowToast:k}),D&&i.jsx(el,{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 NU(t){if(!t)return!1;const s=t.tagName;return!!(s==="INPUT"||s==="TEXTAREA"||s==="SELECT"||t.isContentEditable)}function ea(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&&NU(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 CU(){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(fd,{lines:2},s))})]})}function ix(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 Dp=100;function EU(t){try{const s=new URL(t);return s.protocol!=="http:"&&s.protocol!=="https:"?void 0:s.toString()}catch{return}}function AU(){const{workspaceId:t,environmentId:s}=ps(),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}=U1(),[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=w7(t,W,d,c);ea({key:"1"},()=>D("graph")),ea({key:"2"},()=>D("board")),ea({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(CU,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Cs,{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>Dp)return`Max ${Dp} characters`},maxLength:Dp,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(nm,{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(yd,{remarkPlugins:[bd],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=EU(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(P6,{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(Ne=>Ne.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(pd,{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(M6,{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 ",ix($.createdAt)]}),$.updatedAt&&$.updatedAt!==$.createdAt&&i.jsxs("span",{className:Y.metaTimestamp,children:["· Updated ",ix($.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: ",Ts(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: ",Io(((ie==null?void 0:ie.inputTokens)??0)+((ie==null?void 0:ie.outputTokens)??0))," / ",Io($.tokenBudget)]}),$.tokenBudget>0&&$.costBudgetMillicents>0&&" | ",$.costBudgetMillicents>0&&i.jsxs(i.Fragment,{children:["Cost: ",Ts((ie==null?void 0:ie.costMillicents)??0)," / ",Ts($.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(Ri(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(K8,{workspaceId:t,environmentId:W,tasks:r,sessions:k,personas:S,environments:c}),C==="graph"&&i.jsx(yN,{workspaceId:t,environmentId:W,tasks:r,resolvedThemeId:T}),i.jsx(Ei,{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 DU="_container_3pgew_1",RU="_header_3pgew_8",MU="_headerTitle_3pgew_35",IU="_headerActions_3pgew_44",OU="_body_3pgew_51",BU="_btnPrimary_3pgew_63",LU="_btnGhost_3pgew_94",zU="_error_3pgew_116",Ia={container:DU,header:RU,headerTitle:MU,headerActions:IU,body:OU,btnPrimary:BU,btnGhost:LU,error:zU};function $U(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 UU=[{label:"Home",url:Ci},{label:"New Workspace",url:void 0}];function PU(){const[t]=bm(),s=t.get("environment")??void 0,{environments:{environments:o},personas:{personas:r},workspaces:{createWorkspace:c,workspaceCreating:d}}=mt(),{showToast:u}=Tn(),p=kt(),[m,g]=y.useState(()=>{var N;return i7(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=$U(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(Ci,{replace:!0})},T=>{S(T)}).catch(()=>{})},w=()=>{p(s?Ni(s):Ci,{replace:!0})};return i.jsxs("div",{className:Ia.container,children:[i.jsxs("div",{className:Ia.header,children:[i.jsx("div",{className:Ia.headerTitle,children:i.jsx(Cs,{segments:UU})}),i.jsxs("div",{className:Ia.headerActions,children:[i.jsx("button",{className:Ia.btnGhost,onClick:w,disabled:d,"data-testid":"workspace-create-cancel",children:"Cancel"}),i.jsx("button",{className:Ia.btnPrimary,onClick:k,disabled:d||!m.name.trim()||!m.environmentId,"data-testid":"workspace-create-save",children:d?i.jsx(x1,{size:"sm",label:"Creating"}):"Create Workspace"})]})]}),i.jsxs("div",{className:Ia.body,children:[i.jsx(r7,{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:Ia.error,"data-testid":"workspace-create-submit-error",children:x})]})]})}function ox(){const{workspaceId:t,environmentId:s}=ps(),[o]=bm(),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}=Tn();return i.jsx(M1,{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 HU(){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(tm,{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(tm,{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 Oa(){const{taskId:t,workspaceId:s,environmentId:o}=ps(),r=Zt(),c=kt(),{showToast:d}=Tn(),{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,Ne]=y.useState(X),[Fe,me]=y.useState(!1),[_e,ve]=y.useState(void 0),[Be,Mt]=y.useState(""),[wn,oe]=y.useState(ge),He=y.useRef(X),qt=y.useRef(ge),te=w.find(De=>De.id===t),ht=(te==null?void 0:te.workspaceId)||void 0,at=$.find(De=>De.id===ht);y.useEffect(()=>{X!==He.current&&(He.current=X,X!==fe&&Ne(X))},[X,fe]),y.useEffect(()=>{ge!==qt.current&&(qt.current=ge,ge!==wn&&oe(ge))},[ge,wn]),y.useEffect(()=>{if(Be===""){if(at!=null&&at.environmentId)Mt(at.environmentId);else if(P.length>0){const De=P.find(Ye=>Ye.status==="connected");Mt((De==null?void 0:De.id)??P[0].id)}}},[Be,at==null?void 0:at.environmentId,P]);const Kt=te?v[te.id]??[]:[];let gt;_e&&Kt.some(De=>De.id===_e)?gt=_e:gt=(te==null?void 0:te.latestSessionId)||void 0;const ms=()=>{me(!0)},ia=()=>{if(!te)return;B(te.id).catch(()=>{}),me(!1);const De=o??(at==null?void 0:at.environmentId);c(te.workspaceId&&De?Ua(te.workspaceId,De):"/",{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 De=te.id!==J.current,Ye=te.latestSessionId!==ce.current;(De||Ye)&&(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 De=Z.current===void 0;Z.current=te==null?void 0:te.status;const Ye=(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;Ye&&Ye!==fe&&!(De&&X!=="overview")&&Ne(Ye)}},[te==null?void 0:te.status,fe,X]);const ts=y.useMemo(()=>new Map(w.map(De=>[De.id,De])),[w]),Za=y.useMemo(()=>{const De=gt?u.filter(Ye=>Ye.sessionId===gt):[];return lh(rh(De))},[u,gt]),oa=te?te.dependsOn.some(De=>{const Ye=ts.get(De);return Ye!==void 0&&Ye.status!=="complete"}):!1,Yt=y.useMemo(()=>j7(t,o,$,P,ts),[t,o,$,P,ts]);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 Ii=Kt.reduce((De,Ye)=>De+(Ye.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,Ii]);const ra=te?`task:${te.id}`:"",Ka=ra in pe?pe[ra]:void 0,hs=te?`task_tree:${te.id}`:"",Oi=te&&te.childTaskIds.length>0&&hs in pe?pe[hs]:void 0,jn=De=>{Ne(De),c(Bn(t,De==="overview"?void 0:De,s,o))};return ea({key:"1"},()=>jn("overview")),ea({key:"2"},()=>jn("stream")),ea({key:"3"},()=>jn("findings")),!te&&N?i.jsx(HU,{}):i.jsxs("div",{className:Y.panelContainer,children:[i.jsx(Cs,{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}),oa&&i.jsx("span",{className:Y.taskBlockedBadge,children:"blocked"})]}),te&&i.jsx(TB,{task:te,sessionId:gt,isBlocked:oa,onStart:()=>{T(te.id,void 0,Be).catch(()=>{})},onResume:()=>{D(te.id).catch(()=>{})},onStop:()=>{C(te.id).catch(()=>{})},onPause:()=>{gt&&k(gt).catch(()=>{})},onDelete:ms,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:()=>jn("overview"),children:"Overview"}),i.jsx("button",{role:"tab","aria-selected":fe==="stream",className:`${Y.tab} ${fe==="stream"?Y.active:""}`,onClick:()=>jn("stream"),children:"Stream"}),i.jsx("button",{role:"tab","aria-selected":fe==="findings",className:`${Y.tab} ${fe==="findings"?Y.active:""}`,onClick:()=>jn("findings"),children:"Findings"})]}),i.jsxs(fs,{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:wn&&te?i.jsx(M1,{mode:"edit",taskId:te.id,workspaceId:ht,environmentId:o,tasks:w,workspaces:$,personas:W,onCreateTask:(De,Ye,Jt,St,fn,Wt,Bi,Li,zi)=>{E(De,Ye,Jt,St,fn,Wt,Bi,Li,zi).catch(()=>{})},onUpdateTask:(De,Ye,Jt,St,fn)=>{A(De,Ye,Jt,St,fn).catch(()=>{})},onEditDone:()=>{ge?c(Bn(te.id,void 0,s,o),{replace:!0}):oe(!1)},onShowToast:d}):te?i.jsx(uL,{task:te,tasksById:ts,environments:P,workspaces:$,taskSessions:Kt,selectedEnvId:Be,taskUsage:Ka,treeUsage:Oi}):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(z3,{taskSessions:Kt,selectedSessionId:gt,onSelect:De=>ve(De)}),i.jsx(nh,{events:Za,eventsDropped:p,emptyState:!gt&&te?oa?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,Be).catch(()=>{})},children:"Start Task"}),i.jsx("div",{className:Y.ctaDescription,children:"Click to begin agent execution"})]}):gt&&Za.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(D1,{findings:U.filter(De=>De.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 De=gt?m.find(Ye=>Ye.id===gt):void 0;if(!(!De||De.status==="stopped"))return i.jsx(el,{mode:"send",sessionId:De.id,environmentId:De.environmentId,personas:W,environments:P,onSendInput:(Ye,Jt)=>{x(Ye,Jt).catch(()=>{})},onSpawn:(Ye,Jt,St)=>{S(Ye,Jt,St).catch(()=>{})},onStartTask:(Ye,Jt,St)=>{T(Ye,Jt,St).catch(()=>{})},onProvisionEnvironment:Ye=>{I(Ye).catch(()=>{})},onShowToast:d})})(),te&&i.jsx(Ei,{isOpen:Fe,title:"Delete Task?",description:`"${te.title}" will be permanently removed.`,onConfirm:ia,onCancel:()=>me(!1)})]})}function VU(){const{environments:{environments:t,addEnvironment:s,updateEnvironment:o},codespaces:{codespaces:r,codespaceError:c,codespaceListError:d,codespaceCreating:u,listCodespaces:p,createCodespace:m}}=mt(),{showToast:g}=Tn();return i.jsx(I1,{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 qU(){const{environmentId:t}=ps(),{environments:{environments:s,addEnvironment:o,updateEnvironment:r},codespaces:{codespaces:c,codespaceError:d,codespaceListError:u,codespaceCreating:p,listCodespaces:m,createCodespace:g}}=mt(),{showToast:v}=Tn();return i.jsx(I1,{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 GU="_layout_11u79_1",FU="_content_11u79_8",ZU="_tabPanel_11u79_14",Qr={layout:GU,content:FU,tabPanel:ZU};function KU(){const t=k7();return i.jsxs("div",{className:Qr.layout,children:[i.jsx(Cs,{segments:t}),i.jsx("div",{className:Qr.content,children:i.jsx(qa,{})})]})}const YU="_container_144a4_1",JU="_envHeader_144a4_6",WU="_envTitleRow_144a4_10",XU="_statusDot_144a4_16",QU="_envName_144a4_21",eP="_statusBadge_144a4_27",tP="_envMeta_144a4_33",nP="_metaTag_144a4_39",sP="_actions_144a4_51",aP="_provisionMessage_144a4_59",iP="_errorMessage_144a4_64",oP="_section_144a4_69",rP="_sectionHeader_144a4_73",lP="_cardList_144a4_121",cP="_card_144a4_121",dP="_cardHeader_144a4_138",uP="_cardName_144a4_144",fP="_cardActions_144a4_149",pP="_cardDescription_144a4_154",mP="_cardMeta_144a4_160",hP="_repoLink_144a4_166",gP="_empty_144a4_174",vP="_errorHint_144a4_180",yP="_btnPrimary_144a4_186",bP="_btnOutline_144a4_220",xP="_btnSmall_144a4_247",_P="_btnDanger_144a4_273",Se={container:YU,envHeader:JU,envTitleRow:WU,statusDot:XU,envName:QU,statusBadge:eP,envMeta:tP,metaTag:nP,actions:sP,provisionMessage:aP,errorMessage:iP,section:oP,sectionHeader:rP,cardList:lP,card:cP,cardHeader:dP,cardName:uP,cardActions:fP,cardDescription:pP,cardMeta:mP,repoLink:hP,empty:gP,errorHint:vP,btnPrimary:yP,btnOutline:bP,btnSmall:xP,btnDanger:_P};function kP(){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(fd,{lines:2}),i.jsx(fd,{lines:2})]})]})]})}const SP={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function TP(){const{environmentId:t}=ps(),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(kP,{});if(!t||!E)return i.jsx(us,{to:Mo,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=SP[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(Mo,{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(Ei,{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(Ei,{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: ",Ts(U)]})]})]}),i.jsxs("div",{className:Se.actions,children:[$&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:Se.btnPrimary,onClick:()=>s(Ux(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(lN(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(`${Hx}?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(wP,{workspace:J,confirmArchiveId:D,onOpen:()=>s(Ua(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(Ua(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 wP({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 jP={credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About",shortcuts:"Shortcuts"};function NP(){const s=Zt().pathname.replace(/^\/settings\/?/,"").split("/")[0],o=jP[s],r=_7(o);return i.jsxs("div",{className:Qr.layout,children:[i.jsx(Cs,{segments:r}),i.jsx("div",{className:Qr.content,children:i.jsx("div",{className:Qr.tabPanel,children:i.jsx(qa,{})},s)})]})}function CP(){const{tokens:{tokens:t,setToken:s,deleteToken:o},credentials:{credentialProviders:r,updateCredentialProviders:c}}=mt(),{showToast:d}=Tn();return i.jsxs(i.Fragment,{children:[i.jsx(HL,{credentialProviders:r,onUpdateCredentialProviders:u=>{c(u).catch(()=>{})}}),i.jsx(JO,{tokens:t,onSetToken:(u,p,m,g,v)=>{s(u,p,m,g,v).catch(()=>{})},onDeleteToken:u=>{o(u).catch(()=>{})},onShowToast:d})]})}function EP(){const{personas:{personas:t,deletePersona:s},appDefaultPersonaId:o,setAppDefaultPersonaId:r}=mt(),{showToast:c}=Tn(),d=kt();return i.jsx(t8,{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(dN),onNavigateToPersona:u=>d(Px(u))})}const AP="_container_1ooin_1",DP="_form_1ooin_7",RP="_formActions_1ooin_75",MP="_editableSection_1ooin_82",IP="_defaultBadge_1ooin_93",OP="_typeToggle_1ooin_107",BP="_scriptEditor_1ooin_121",LP="_optional_1ooin_128",cs={container:AP,form:DP,formActions:RP,editableSection:MP,defaultBadge:IP,typeToggle:OP,scriptEditor:BP,optional:LP},rx=[{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)"}],lx=[{value:"genaiscript",label:"genaiscript"}],zP="0";function cx(){const{personaId:t}=ps(),s=kt(),{showToast:o}=Tn(),{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(us,{to:Kf,replace:!0});const b=[{label:"Settings",url:Ro},{label:"Personas",url:Kf},{label:g?"New Persona":(v==null?void 0:v.name)??"Persona",url:void 0}];return i.jsxs("div",{className:cs.container,children:[i.jsx(Cs,{segments:b}),i.jsx($P,{existing:v,isNew:g,appDefaultPersonaId:p,onCreatePersona:c,onUpdatePersona:d,onDeletePersona:u,onSetAppDefaultPersonaId:m,onDone:()=>{s(Kf)},showToast:o})]})}function $P({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),Ne=!s&&t&&!fe&&A==="agent"&&!!N&&!!C,Fe=(oe,He)=>{if(!oe.trim())return`${He} 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(He=>{m("Persona created","success"),g(Px(He.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,He,qt,te)=>oe().then(()=>{He(),m(qt,"success")},()=>{m(te,"error")}),Be=(oe,He)=>{if(!t)return;const qt=oe==="type"?String(He):A,te=oe==="runtime"?String(He):oe==="type"?String(He)==="script"?"genaiscript":N==="genaiscript"?"claude-code":N:N,ht=oe==="model"?String(He):C,at=oe==="maxTurns"?Number(He):B,Kt=oe==="systemPrompt"?String(He):k,gt=oe==="script"?String(He):I;ve(()=>c(t.id,oe==="name"?String(He):v,oe==="description"?String(He):x,Kt,te,ht,at,qt,gt),()=>{if(oe==="type"){const ms=String(He)==="script"?"script":"agent";P(ms),T(te)}oe==="runtime"&&T(String(He)),oe==="name"&&b(String(He)),oe==="description"&&S(String(He)),oe==="systemPrompt"&&w(String(He)),oe==="model"&&D(String(He)),oe==="maxTurns"&&E(Number(He)),oe==="script"&&U(String(He))},"Persona updated","Failed to update persona").catch(()=>{})},Mt=oe=>{me(oe)},wn=()=>{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:cs.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsx("p",{children:"Loading persona..."})]}):s?i.jsxs("form",{onSubmit:Mt,className:cs.form,children:[i.jsx("h3",{children:"Create Persona"}),i.jsxs("div",{className:cs.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"?lx:rx).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:cs.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:cs.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),A==="agent"&&i.jsxs("div",{children:[i.jsx("label",{children:"Allowed MCP Tools"}),i.jsx(Jb,{selectedTools:Q,onChange:$})]}),i.jsxs("div",{className:cs.formActions,children:[i.jsx(Ws,{type:"submit",variant:"primary",size:"md",disabled:!ge,"data-testid":"persona-detail-save",children:"Create"}),i.jsx(Ws,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Cancel"})]})]}):t?i.jsxs("div",{className:cs.form,children:[i.jsx("h3",{children:"Edit Persona"}),i.jsxs("div",{className:cs.formActions,children:[i.jsx(Ws,{type:"button",variant:"outline",size:"md",onClick:p,"data-testid":"persona-detail-cancel",children:"Back to Personas"}),Ne&&i.jsx(Ws,{type:"button",variant:"ghost",size:"md",onClick:wn,"data-testid":"persona-detail-set-default",children:"Set as App Default"}),fe&&i.jsx("span",{className:cs.defaultBadge,children:"App Default"}),i.jsx(Ws,{type:"button",variant:"danger",size:"md",onClick:()=>pe(!0),"data-testid":"persona-detail-delete",children:"Delete"})]}),i.jsxs("div",{className:cs.editableSection,children:[i.jsxs("label",{children:["Name",i.jsx(ln,{value:v,onSave:oe=>{Be("name",oe)},validate:oe=>Fe(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=>{Be("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(pd,{value:A,onSave:oe=>{Be("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(pd,{value:N,onSave:oe=>{Be("runtime",oe)},options:A==="script"?lx:rx,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=>{Be("model",oe)},validate:A==="agent"?oe=>Fe(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=>{Be("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:zP,ariaLabel:"Persona max turns","data-testid":"persona-detail-max-turns"})]}),i.jsxs("label",{children:["System Prompt",i.jsx(nm,{value:k,onSave:oe=>{Be("systemPrompt",oe)},validate:oe=>Fe(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(nm,{value:I,onSave:oe=>{Be("script",oe)},validate:oe=>Fe(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(Jb,{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(()=>{})}})]})]}),!Ne&&!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(Ei,{isOpen:W,title:"Delete Persona?",description:`"${t==null?void 0:t.name}" will be permanently removed.`,confirmLabel:"Delete",onConfirm:_e,onCancel:()=>pe(!1)})]})}function UP(){const{themeId:t,resolvedThemeId:s,setTheme:o,preferSystem:r,setPreferSystem:c}=U1();return i.jsx(WO,{themeId:t,resolvedThemeId:s,onSetTheme:o,preferSystem:r,onSetPreferSystem:c})}function PP(){const[t,s]=y.useState(void 0);return y.useEffect(()=>{let o=!1;return(async()=>{try{const c=await We.getVersionStatus({});o||s({currentVersion:c.currentVersion,latestVersion:c.latestVersion,updateAvailable:c.updateAvailable,isDocker:c.isDocker})}catch{}})().catch(()=>{}),()=>{o=!0}},[]),t}function HP(){const{connected:t,environments:{environments:s},sessions:{sessions:o}}=mt(),r=PP();return i.jsxs(i.Fragment,{children:[r&&i.jsx(tO,{currentVersion:r.currentVersion,latestVersion:r.latestVersion,updateAvailable:r.updateAvailable,isDocker:r.isDocker}),i.jsx(XO,{connected:t,environments:s,sessions:o})]})}function VP(){return i.jsx(UL,{})}const dx=Ri();function qP(){const t=kt();return ea({key:"?"},()=>{t(uN)}),ea({key:"n"},()=>{t(dx)}),ea({key:"N"},()=>{t(dx)}),i.jsx(i.Fragment,{})}function gl(t){const s=g7();y.useLayoutEffect(()=>(s(t),()=>{s(void 0)}),[t,s])}function GP(){const{workspaces:{workspaces:t},tasks:{tasks:s}}=mt(),o=y.useMemo(()=>i.jsx(DI,{workspaces:t,tasks:s}),[t,s]);return gl(o),i.jsx(qa,{})}function FP(){const{environments:{environments:t}}=mt(),s=y.useMemo(()=>i.jsx(P5,{environments:t}),[t]);return gl(s),i.jsx(qa,{})}function ZP(){const t=y.useMemo(()=>i.jsx(k8,{}),[]);return gl(t),i.jsx(qa,{})}function KP(){const{findings:{findings:t,loadFindings:s,loadAllFindings:o}}=mt(),{workspaceId:r,environmentId:c}=ps();y.useEffect(()=>{r?s(r).catch(()=>{}):o().catch(()=>{})},[r,s,o]);const d=y.useMemo(()=>i.jsx(X5,{findings:t,workspaceId:r,environmentId:c}),[t,r,c]);return gl(d),i.jsx(qa,{})}function YP(){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(e5,{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 gl(u),i.jsx(qa,{})}const JP="_container_ce571_1",WP="_title_ce571_6",gd={container:JP,title:WP};function XP(){return i.jsxs("div",{className:gd.container,"aria-hidden":"true",children:[i.jsx("h1",{className:gd.title,children:"Findings"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-sm)"},children:Array.from({length:4},(t,s)=>i.jsx(fd,{lines:3},s))})]})}function ux(){const{environmentId:t,workspaceId:s}=ps(),{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(Lp(v,s,t))},[p,s,t]);if(r)return i.jsx(XP,{});const g=s&&t?Z1("Findings",s,t,d,u).slice(0,-1):C7();return i.jsxs("div",{className:gd.container,"data-testid":"findings-list-page",children:[i.jsx(Cs,{segments:g}),i.jsx("h1",{className:gd.title,children:"Findings"}),i.jsx(D1,{findings:o,onFindingClick:m})]})}const QP="_container_1wwpb_1",e9="_notFound_1wwpb_6",t9="_header_1wwpb_12",n9="_categoryBadge_1wwpb_19",s9="_title_1wwpb_28",a9="_content_1wwpb_35",i9="_tags_1wwpb_77",o9="_tag_1wwpb_77",r9="_meta_1wwpb_92",l9="_metaTimestamp_1wwpb_100",c9="_metaLink_1wwpb_105",hn={container:QP,notFound:e9,header:t9,categoryBadge:n9,title:s9,content:a9,tags:i9,tag:o9,meta:r9,metaTimestamp:l9,metaLink:c9};function fx(){const{findingId:t,environmentId:s,workspaceId:o}=ps(),{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:hn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:hn.notFound,children:"Loading..."})});if(!r)return i.jsx("div",{className:hn.container,"data-testid":"finding-detail-page",children:i.jsx("div",{className:hn.notFound,children:"Finding not found."})});const g=Z1(r.title,o,s,u,p),v=md(r.category);return i.jsxs("div",{className:hn.container,"data-testid":"finding-detail-page",children:[i.jsx(Cs,{segments:g}),i.jsxs("div",{className:hn.header,children:[i.jsx("span",{className:hn.categoryBadge,style:{background:v.bg,color:v.text},children:r.category}),i.jsx("h1",{className:hn.title,children:r.title})]}),r.content&&i.jsx("div",{className:hn.content,children:i.jsx(yd,{remarkPlugins:[bd],children:r.content})}),r.tags.length>0&&i.jsx("div",{className:hn.tags,children:r.tags.map(b=>i.jsx("span",{className:hn.tag,children:b},b))}),i.jsxs("div",{className:hn.meta,children:[i.jsx("span",{className:hn.metaTimestamp,title:r.createdAt,children:ah(r.createdAt)}),r.taskId&&i.jsx("button",{type:"button",className:hn.metaLink,onClick:()=>{m(Bn(r.taskId))},children:"View Task"}),r.sessionId&&i.jsx("button",{type:"button",className:hn.metaLink,onClick:()=>{m(xm(r.sessionId))},children:"View Session"})]})]})}const d9="_wizard_1260s_1",u9="_container_1260s_10",f9="_stepContent_1260s_19",p9="_logoArea_1260s_28",m9="_logoImage_1260s_32",h9="_heading_1260s_41",g9="_tagline_1260s_49",v9="_subtitle_1260s_56",y9="_featureList_1260s_64",b9="_runtimeGrid_1260s_89",x9="_runtimeCard_1260s_101",_9="_runtimeName_1260s_133",k9="_runtimeDescription_1260s_139",S9="_buttonRow_1260s_144",T9="_primaryButton_1260s_151",w9="_ghostButton_1260s_185",j9="_dots_1260s_213",N9="_dot_1260s_213",Ge={wizard:d9,container:u9,stepContent:f9,logoArea:p9,logoImage:m9,heading:h9,tagline:g9,subtitle:v9,featureList:y9,runtimeGrid:b9,runtimeCard:x9,runtimeName:_9,runtimeDescription:k9,buttonRow:S9,primaryButton:T9,ghostButton:w9,dots:j9,dot:N9};function C9({onNext:t}){return i.jsxs("div",{className:Ge.stepContent,"data-testid":"setup-welcome",children:[i.jsx("div",{className:Ge.logoArea,children:i.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:Ge.logoImage})}),i.jsx("h1",{className:Ge.heading,children:"Welcome to Grackle"}),i.jsx("p",{className:Ge.tagline,children:"Multi-agent orchestration for software teams"}),i.jsx("button",{type:"button",className:Ge.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function E9({onNext:t,onBack:s}){return i.jsxs("div",{className:Ge.stepContent,"data-testid":"setup-about",children:[i.jsx("h2",{className:Ge.heading,children:"What is Grackle?"}),i.jsxs("ul",{className:Ge.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:Ge.buttonRow,children:[i.jsx("button",{type:"button",className:Ge.ghostButton,onClick:s,children:"Back"}),i.jsx("button",{type:"button",className:Ge.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const A9=[{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 D9({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:Ge.stepContent,"data-testid":"setup-runtime",children:[i.jsx("h2",{className:Ge.heading,children:"Choose Your Runtime"}),i.jsx("p",{className:Ge.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),i.jsx("div",{className:Ge.runtimeGrid,children:A9.map(u=>i.jsxs("button",{type:"button",className:Ge.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:Ge.runtimeName,children:u.name}),i.jsx("span",{className:Ge.runtimeDescription,children:u.description})]},u.id))}),i.jsxs("div",{className:Ge.buttonRow,children:[i.jsx("button",{type:"button",className:Ge.ghostButton,onClick:o,children:"Back"}),i.jsx("button",{type:"button",className:Ge.primaryButton,onClick:()=>{s(c)},disabled:r,"data-testid":"setup-runtime-next",children:"Next"})]})]})}function R9(){return typeof Notification<"u"}function M9({onFinish:t,onBack:s,finishDisabled:o}){const r=R9(),c=r&&Notification.permission!=="default";function d(){r&&Notification.requestPermission().catch(()=>{}),t()}return i.jsxs("div",{className:Ge.stepContent,"data-testid":"setup-notifications",children:[i.jsx("h2",{className:Ge.heading,children:"Stay in the Loop"}),i.jsx("p",{className:Ge.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:Ge.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:Ge.buttonRow,children:[i.jsx("button",{type:"button",className:Ge.ghostButton,onClick:s,disabled:o,children:"Back"}),!c&&r?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:Ge.ghostButton,onClick:t,disabled:o,"data-testid":"setup-notifications-skip",children:"Skip"}),i.jsx("button",{type:"button",className:Ge.primaryButton,onClick:d,disabled:o,"data-testid":"setup-notifications-enable",children:"Enable Notifications"})]}):i.jsx("button",{type:"button",className:Ge.primaryButton,onClick:t,disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const I9=4,px={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function O9(){const{personas:{personas:t,updatePersona:s},completeOnboarding:o,onboardingCompleted:r}=mt(),{showToast:c}=Tn(),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=px[w]??"sonnet";N.push(s(x.id,void 0,void 0,void 0,w,C))}const T=t.find(C=>C.id===sy);if(T&&w!==T.runtime){const C=px[w]??"sonnet";N.push(s(sy,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(us,{to:"/",replace:!0}):i.jsx("div",{className:Ge.wizard,"data-testid":"setup-wizard",children:i.jsxs("div",{className:Ge.container,children:[i.jsx(fs,{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(C9,{onNext:()=>p(1)}),u===1&&i.jsx(E9,{onNext:()=>p(2),onBack:()=>p(0)}),u===2&&i.jsx(D9,{currentRuntime:m,onFinish:S,onBack:()=>p(1),finishDisabled:!x}),u===3&&i.jsx(M9,{onFinish:k,onBack:()=>p(2),finishDisabled:v})]},u)}),i.jsx("div",{className:Ge.dots,children:Array.from({length:I9},(w,N)=>i.jsx("span",{className:Ge.dot,"data-active":N===u},N))})]})})}const B9="_root_zndgp_1",L9="_body_zndgp_7",z9="_main_zndgp_19",$9="_sidebarWrapper_zndgp_26",U9="_overlay_zndgp_51",Zr={root:B9,body:L9,main:z9,sidebarWrapper:$9,overlay:U9},P9=y.lazy(()=>PT(()=>import("./KnowledgePage-BL57rgfZ.js"),__vite__mapDeps([0,1,2,3,4])).then(t=>({default:t.KnowledgePage}))),W1=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function H9({tabs:t}){const{connected:s,environments:{environments:o},sessions:{sessions:r},tasks:{tasks:c}}=mt(),{toasts:d,dismissToast:u}=Tn(),p=Zt(),m=h7(),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(d5,{connected:s,environments:o,sessions:r,onToggleSidebar:g?x:void 0,sidebarOpen:v}),i.jsx(v5,{tabs:t}),i.jsxs("div",{className:Zr.body,children:[g&&i.jsx("div",{className:Zr.sidebarWrapper,"data-sidebar-open":v,children:i.jsx(S5,{content:m})}),g&&v&&i.jsx("div",{className:Zr.overlay,"data-testid":"drawer-overlay",onClick:()=>b(!1)}),i.jsxs("div",{className:Zr.main,children:[i.jsx(qa,{}),i.jsx(D5,{sessions:r,tasks:c,environments:o})]})]}),i.jsx(qI,{toasts:d,onDismiss:u}),i.jsx(qP,{})]})}function V9(){const{sessions:{lastSpawnedId:t},environments:{environments:s,operationError:o,clearOperationError:r},tasks:{tasks:c},connected:d,onboardingCompleted:u}=mt(),{pluginNames:p}=ch(),{showToast:m}=Tn();xz(s,m),wz(c,m),_z(o,r,m);const g=kt(),v=Zt();if(y.useEffect(()=>{t&&!v.pathname.includes("/tasks/")&&g(xm(t),{replace:!0})},[t,g,v.pathname]),d&&u===!1)return i.jsx(us,{to:"/setup",replace:!0});const b=J7(p);return i.jsx(m7,{children:i.jsxs("div",{className:Zr.root,children:[W1&&i.jsx(PN,{}),i.jsx(H9,{tabs:b})]})})}function Rp(){const{workspaceId:t}=ps(),{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(us,{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(us,{to:p,replace:!0})}function q9(){const{pluginNames:t}=ch(),s=t.includes("orchestration"),o=t.includes("knowledge");return i.jsxs(jj,{children:[i.jsx(Ee,{path:"setup",element:i.jsx(O9,{})}),i.jsxs(Ee,{element:i.jsx(V9,{}),children:[i.jsx(Ee,{index:!0,element:i.jsx(uU,{})}),i.jsx(Ee,{path:"chat",element:i.jsx(_U,{})}),i.jsx(Ee,{path:"sessions/new",element:i.jsx(kU,{})}),i.jsx(Ee,{path:"sessions/:sessionId",element:i.jsx(jU,{})}),o&&i.jsx(Ee,{element:i.jsx(YP,{}),children:i.jsx(Ee,{path:"knowledge",element:i.jsx(y.Suspense,{fallback:i.jsx(_1,{}),children:i.jsx(P9,{})})})}),s&&i.jsxs(Ee,{element:i.jsx(GP,{}),children:[i.jsx(Ee,{path:"tasks",element:i.jsx(cU,{})}),i.jsx(Ee,{path:"tasks/new",element:i.jsx(ox,{})}),i.jsx(Ee,{path:"tasks/:taskId",element:i.jsx(Oa,{})}),i.jsx(Ee,{path:"tasks/:taskId/edit",element:i.jsx(Oa,{})}),i.jsx(Ee,{path:"tasks/:taskId/stream",element:i.jsx(Oa,{})}),i.jsx(Ee,{path:"tasks/:taskId/findings",element:i.jsx(Oa,{})})]}),s&&i.jsxs(Ee,{element:i.jsx(KP,{}),children:[i.jsx(Ee,{path:"findings",element:i.jsx(ux,{})}),i.jsx(Ee,{path:"findings/:findingId",element:i.jsx(fx,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId/findings",element:i.jsx(ux,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId/findings/:findingId",element:i.jsx(fx,{})})]}),i.jsxs(Ee,{element:i.jsx(FP,{}),children:[i.jsx(Ee,{path:"workspaces",element:i.jsx(us,{to:"/environments",replace:!0})}),i.jsx(Ee,{path:"workspaces/new",element:i.jsx(PU,{})}),i.jsx(Ee,{path:"workspaces/:workspaceId",element:i.jsx(Rp,{})}),i.jsx(Ee,{path:"workspaces/:workspaceId/tasks/:taskId",element:i.jsx(Rp,{})}),i.jsx(Ee,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:i.jsx(Rp,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId",element:i.jsx(AU,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:i.jsx(ox,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:i.jsx(Oa,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:i.jsx(Oa,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:i.jsx(Oa,{})}),i.jsx(Ee,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:i.jsx(Oa,{})}),i.jsxs(Ee,{path:"environments",element:i.jsx(KU,{}),children:[i.jsx(Ee,{index:!0,element:i.jsx(dU,{})}),i.jsx(Ee,{path:"new",element:i.jsx(VU,{})}),i.jsx(Ee,{path:":environmentId",element:i.jsx(TP,{})}),i.jsx(Ee,{path:":environmentId/edit",element:i.jsx(qU,{})})]})]}),i.jsx(Ee,{element:i.jsx(ZP,{}),children:i.jsxs(Ee,{path:"settings",element:i.jsx(NP,{}),children:[i.jsx(Ee,{index:!0,element:i.jsx(us,{to:"credentials",replace:!0})}),i.jsx(Ee,{path:"environments",element:i.jsx(us,{to:"/environments",replace:!0})}),i.jsx(Ee,{path:"credentials",element:i.jsx(CP,{})}),i.jsx(Ee,{path:"tokens",element:i.jsx(us,{to:"../credentials",replace:!0})}),i.jsx(Ee,{path:"personas",element:i.jsx(EP,{})}),i.jsx(Ee,{path:"personas/new",element:i.jsx(cx,{})}),i.jsx(Ee,{path:"personas/:personaId",element:i.jsx(cx,{})}),i.jsx(Ee,{path:"appearance",element:i.jsx(UP,{})}),i.jsx(Ee,{path:"shortcuts",element:i.jsx(VP,{})}),i.jsx(Ee,{path:"about",element:i.jsx(HP,{})})]})}),i.jsx(Ee,{path:"*",element:i.jsx(us,{to:"/",replace:!0})})]})]})}const G9=1e4;function F9(){const{onboardingCompleted:t}=mt(),[s,o]=y.useState(!1);y.useEffect(()=>{if(t!==void 0)return;const c=setTimeout(()=>o(!0),G9);return()=>clearTimeout(c)},[t]);const r=t===void 0&&!s;return i.jsx(fs,{mode:"wait",children:r?i.jsx(Rt.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:i.jsx(_1,{})},"splash"):i.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:i.jsx(Wj,{basename:"/".replace(/\/$/,""),children:i.jsx(q9,{})})},"app")})}function Z9(){const t=W1?V7:bz;return i.jsx(F7,{children:i.jsx(p7,{children:i.jsx(c7,{children:i.jsx(t,{children:i.jsx(F9,{})})})})})}zT.createRoot(document.getElementById("root")).render(i.jsx(y.StrictMode,{children:i.jsx(Z9,{})}));export{Cs as B,Vx as K,mt as a,Lp as f,xm as s,Bn as t,kt as u};
|