groove-dev 0.26.22 → 0.26.24
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/node_modules/@groove-dev/cli/src/commands/start.js +2 -1
- package/node_modules/@groove-dev/gui/dist/assets/{index-DomJ4Dgb.css → index-D9JZfCf8.css} +1 -1
- package/node_modules/@groove-dev/gui/dist/assets/{index-DOejqkiH.js → index-OBctC7ty.js} +109 -109
- package/node_modules/@groove-dev/gui/dist/index.html +2 -2
- package/node_modules/@groove-dev/gui/src/components/agents/agent-node.jsx +4 -4
- package/node_modules/@groove-dev/gui/src/views/agents.jsx +3 -3
- package/package.json +1 -1
- package/packages/cli/src/commands/start.js +2 -1
- package/packages/gui/dist/assets/{index-DomJ4Dgb.css → index-D9JZfCf8.css} +1 -1
- package/packages/gui/dist/assets/{index-DOejqkiH.js → index-OBctC7ty.js} +109 -109
- package/packages/gui/dist/index.html +2 -2
- package/packages/gui/src/components/agents/agent-node.jsx +4 -4
- package/packages/gui/src/views/agents.jsx +3 -3
|
@@ -6,7 +6,7 @@ import{r as bj,c as vj,a as v,j as r,b as k0,A as Cf,m as Xf,R as Ga}from"./vend
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pg;function tw(){return Pg||(Pg=1,(function(t){function a(P,W){var E=P.length;P.push(W);e:for(;0<E;){var ce=E-1>>>1,ee=P[ce];if(0<o(ee,W))P[ce]=W,P[E]=ee,E=ce;else break e}}function s(P){return P.length===0?null:P[0]}function l(P){if(P.length===0)return null;var W=P[0],E=P.pop();if(E!==W){P[0]=E;e:for(var ce=0,ee=P.length,be=ee>>>1;ce<be;){var Se=2*(ce+1)-1,ye=P[Se],Re=Se+1,B=P[Re];if(0>o(ye,E))Re<ee&&0>o(B,ye)?(P[ce]=B,P[Re]=E,ce=Re):(P[ce]=ye,P[Se]=E,ce=Se);else if(Re<ee&&0>o(B,E))P[ce]=B,P[Re]=E,ce=Re;else break e}}return W}function o(P,W){var E=P.sortIndex-W.sortIndex;return E!==0?E:P.id-W.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,O=d.now();t.unstable_now=function(){return d.now()-O}}var h=[],p=[],x=1,g=null,b=3,y=!1,Q=!1,w=!1,$=!1,j=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function _(P){for(var W=s(p);W!==null;){if(W.callback===null)l(p);else if(W.startTime<=P)l(p),W.sortIndex=W.expirationTime,a(h,W);else break;W=s(p)}}function G(P){if(w=!1,_(P),!Q)if(s(h)!==null)Q=!0,R||(R=!0,F());else{var W=s(p);W!==null&&H(G,W.startTime-P)}}var R=!1,X=-1,T=5,V=-1;function M(){return $?!0:!(t.unstable_now()-V<T)}function ae(){if($=!1,R){var P=t.unstable_now();V=P;var W=!0;try{e:{Q=!1,w&&(w=!1,z(X),X=-1),y=!0;var E=b;try{t:{for(_(P),g=s(h);g!==null&&!(g.expirationTime>P&&M());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,b=g.priorityLevel;var ee=ce(g.expirationTime<=P);if(P=t.unstable_now(),typeof ee=="function"){g.callback=ee,_(P),W=!0;break t}g===s(h)&&l(h),_(P)}else l(h);g=s(h)}if(g!==null)W=!0;else{var be=s(p);be!==null&&H(G,be.startTime-P),W=!1}}break e}finally{g=null,b=E,y=!1}W=void 0}}finally{W?F():R=!1}}}var F;if(typeof N=="function")F=function(){N(ae)};else if(typeof MessageChannel<"u"){var
|
|
9
|
+
*/var Pg;function tw(){return Pg||(Pg=1,(function(t){function a(P,W){var E=P.length;P.push(W);e:for(;0<E;){var ce=E-1>>>1,ee=P[ce];if(0<o(ee,W))P[ce]=W,P[E]=ee,E=ce;else break e}}function s(P){return P.length===0?null:P[0]}function l(P){if(P.length===0)return null;var W=P[0],E=P.pop();if(E!==W){P[0]=E;e:for(var ce=0,ee=P.length,be=ee>>>1;ce<be;){var Se=2*(ce+1)-1,ye=P[Se],Re=Se+1,B=P[Re];if(0>o(ye,E))Re<ee&&0>o(B,ye)?(P[ce]=B,P[Re]=E,ce=Re):(P[ce]=ye,P[Se]=E,ce=Se);else if(Re<ee&&0>o(B,E))P[ce]=B,P[Re]=E,ce=Re;else break e}}return W}function o(P,W){var E=P.sortIndex-W.sortIndex;return E!==0?E:P.id-W.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var d=Date,O=d.now();t.unstable_now=function(){return d.now()-O}}var h=[],p=[],x=1,g=null,b=3,y=!1,Q=!1,w=!1,$=!1,j=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function _(P){for(var W=s(p);W!==null;){if(W.callback===null)l(p);else if(W.startTime<=P)l(p),W.sortIndex=W.expirationTime,a(h,W);else break;W=s(p)}}function G(P){if(w=!1,_(P),!Q)if(s(h)!==null)Q=!0,R||(R=!0,F());else{var W=s(p);W!==null&&H(G,W.startTime-P)}}var R=!1,X=-1,T=5,V=-1;function M(){return $?!0:!(t.unstable_now()-V<T)}function ae(){if($=!1,R){var P=t.unstable_now();V=P;var W=!0;try{e:{Q=!1,w&&(w=!1,z(X),X=-1),y=!0;var E=b;try{t:{for(_(P),g=s(h);g!==null&&!(g.expirationTime>P&&M());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,b=g.priorityLevel;var ee=ce(g.expirationTime<=P);if(P=t.unstable_now(),typeof ee=="function"){g.callback=ee,_(P),W=!0;break t}g===s(h)&&l(h),_(P)}else l(h);g=s(h)}if(g!==null)W=!0;else{var be=s(p);be!==null&&H(G,be.startTime-P),W=!1}}break e}finally{g=null,b=E,y=!1}W=void 0}}finally{W?F():R=!1}}}var F;if(typeof N=="function")F=function(){N(ae)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,oe=le.port2;le.port1.onmessage=ae,F=function(){oe.postMessage(null)}}else F=function(){j(ae,0)};function H(P,W){X=j(function(){P(t.unstable_now())},W)}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(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(P){switch(b){case 1:case 2:case 3:var W=3;break;default:W=b}var E=b;b=W;try{return P()}finally{b=E}},t.unstable_requestPaint=function(){$=!0},t.unstable_runWithPriority=function(P,W){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var E=b;b=P;try{return W()}finally{b=E}},t.unstable_scheduleCallback=function(P,W,E){var ce=t.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?ce+E:ce):E=ce,P){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=E+ee,P={id:x++,callback:W,priorityLevel:P,startTime:E,expirationTime:ee,sortIndex:-1},E>ce?(P.sortIndex=E,a(p,P),s(h)===null&&P===s(p)&&(w?(z(X),X=-1):w=!0,H(G,E-ce))):(P.sortIndex=ee,a(h,P),Q||y||(Q=!0,R||(R=!0,F()))),P},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(P){var W=b;return function(){var E=b;b=W;try{return P.apply(this,arguments)}finally{b=E}}}})(xO)),xO}var zg;function nw(){return zg||(zg=1,pO.exports=tw()),pO.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-dom-client.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ import{r as bj,c as vj,a as v,j as r,b as k0,A as Cf,m as Xf,R as Ga}from"./vend
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Rg;function aw(){if(Rg)return Vr;Rg=1;var t=nw(),a=bj(),s=yj();function l(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function d(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 O(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 h(e){if(u(e)!==e)throw Error(l(188))}function p(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(l(188));return n!==e?null:e}for(var i=e,c=n;;){var f=i.return;if(f===null)break;var m=f.alternate;if(m===null){if(c=f.return,c!==null){i=c;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===i)return h(f),e;if(m===c)return h(f),n;m=m.sibling}throw Error(l(188))}if(i.return!==c.return)i=f,c=m;else{for(var S=!1,k=f.child;k;){if(k===i){S=!0,i=f,c=m;break}if(k===c){S=!0,c=f,i=m;break}k=k.sibling}if(!S){for(k=m.child;k;){if(k===i){S=!0,i=m,c=f;break}if(k===c){S=!0,c=m,i=f;break}k=k.sibling}if(!S)throw Error(l(189))}}if(i.alternate!==c)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:n}function x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),Q=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),N=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var
|
|
17
|
+
*/var Rg;function aw(){if(Rg)return Vr;Rg=1;var t=nw(),a=bj(),s=yj();function l(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function d(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 O(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 h(e){if(u(e)!==e)throw Error(l(188))}function p(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(l(188));return n!==e?null:e}for(var i=e,c=n;;){var f=i.return;if(f===null)break;var m=f.alternate;if(m===null){if(c=f.return,c!==null){i=c;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===i)return h(f),e;if(m===c)return h(f),n;m=m.sibling}throw Error(l(188))}if(i.return!==c.return)i=f,c=m;else{for(var S=!1,k=f.child;k;){if(k===i){S=!0,i=f,c=m;break}if(k===c){S=!0,c=f,i=m;break}k=k.sibling}if(!S){for(k=m.child;k;){if(k===i){S=!0,i=m,c=f;break}if(k===c){S=!0,c=m,i=f;break}k=k.sibling}if(!S)throw Error(l(189))}}if(i.alternate!==c)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:n}function x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),Q=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),N=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=ae&&e[ae]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case j:return"Profiler";case $:return"StrictMode";case G:return"Suspense";case R:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Q:return"Portal";case N:return e.displayName||"Context";case z:return(e._context.displayName||"Context")+".Consumer";case _:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X:return n=e.displayName||null,n!==null?n:oe(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return oe(e(n))}catch{}}return null}var H=Array.isArray,P=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E={pending:!1,data:null,method:null,action:null},ce=[],ee=-1;function be(e){return{current:e}}function Se(e){0>ee||(e.current=ce[ee],ce[ee]=null,ee--)}function ye(e,n){ee++,ce[ee]=e.current,e.current=n}var Re=be(null),B=be(null),ue=be(null),Ce=be(null);function Ot(e,n){switch(ye(ue,n),ye(B,e),ye(Re,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Kx(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Kx(n),e=Jx(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Se(Re),ye(Re,e)}function Ae(){Se(Re),Se(B),Se(ue)}function He(e){e.memoizedState!==null&&ye(Ce,e);var n=Re.current,i=Jx(n,e.type);n!==i&&(ye(B,e),ye(Re,i))}function bt(e){B.current===e&&(Se(Re),Se(B)),Ce.current===e&&(Se(Ce),qr._currentValue=E)}var un,Bt;function yt(e){if(un===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);un=n&&n[1]||"",Bt=-1<i.stack.indexOf(`
|
|
18
18
|
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
19
|
`+un+e+Bt}var Hl=!1;function Il(e,n){if(!e||Hl)return"";Hl=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(I){var L=I}Reflect.construct(e,[],ne)}else{try{ne.call()}catch(I){L=I}e.call(ne.prototype)}}else{try{throw Error()}catch(I){L=I}(ne=e())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(I){if(I&&L&&typeof I.stack=="string")return[I.stack,L.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=c.DetermineComponentFrameRoot(),S=m[0],k=m[1];if(S&&k){var C=S.split(`
|
|
20
20
|
`),U=k.split(`
|
|
@@ -26,7 +26,7 @@ Error generating stack: `+c.message+`
|
|
|
26
26
|
`),g=p.data.filter(Q=>Q.type==="tool_use").map(Q=>{var w,$,j;return`${Q.name}: ${typeof Q.input=="string"?Q.input.slice(0,80):((w=Q.input)==null?void 0:w.command)||(($=Q.input)==null?void 0:$.path)||((j=Q.input)==null?void 0:j.pattern)||JSON.stringify(Q.input||"").slice(0,80)}`}).join(`
|
|
27
27
|
`)),p.contextUsage!==void 0||p.tokensUsed!==void 0){const Q=a().agents.map(w=>{if(w.id!==h)return w;const $={};return p.contextUsage!==void 0&&($.contextUsage=p.contextUsage),p.tokensUsed!==void 0&&($.tokensUsed=p.tokensUsed),{...w,...$}});t({agents:Q})}const b=p.subtype==="stream";if(x&&x.trim()&&!b&&(p.subtype==="assistant"||p.subtype==="text"||p.type==="result"||p.type==="activity"&&typeof p.data=="string")){a().thinkingAgents.has(h)&&t(_=>{const G=new Set(_.thinkingAgents);return G.delete(h),{thinkingAgents:G}});const Q=x.trim(),w={...a().chatHistory};w[h]||(w[h]=[]);const $=[...w[h]],j=$[$.length-1],z=j&&j.from==="agent"&&Date.now()-j.timestamp<8e3;if(!(z&&(j.text===Q||j.text.endsWith(Q)))){if(z){const _=p.subtype==="assistant"?`
|
|
28
28
|
|
|
29
|
-
`:" ";$[$.length-1]={...j,text:j.text+_+Q,timestamp:Date.now()}}else $.push({from:"agent",text:Q,timestamp:Date.now()});w[h]=$.slice(-100),t({chatHistory:w}),wl("groove:chatHistory",w)}}if(g&&g.trim()){const Q={...a().activityLog};Q[h]||(Q[h]=[]),Q[h]=[...Q[h].slice(-200),{timestamp:Date.now(),text:g.trim(),type:p.type,subtype:"tool"}],t({activityLog:Q}),wl("groove:activityLog",Q)}break}case"agent:exit":{const h=a().agents.find(y=>y.id===o.agentId),p=(h==null?void 0:h.name)||o.agentId,x=o.status==="killed"||o.code===143||o.code===137,g=o.status==="completed"?`${p} completed`:x?`${p} stopped`:`${p} crashed (exit ${o.code})`,b=o.status==="completed"?"success":x?"info":"warning";a().addToast(b,g,o.error?o.error.slice(0,200):void 0),o.error&&o.agentId&&a().addChatMessage(o.agentId,"system",`Crashed: ${o.error}`),(h==null?void 0:h.role)==="planner"&&o.status==="completed"&&setTimeout(()=>a().checkRecommendedTeam(),1e3);break}case"phase2:spawned":a().addToast("info",`QC agent ${o.name} auto-spawned`,"Auditing phase 1 work");break;case"phase2:failed":a().addToast("error","QC agent failed to spawn",o.error||"Unknown error");break;case"rotation:start":a().addToast("info",`Rotating ${o.agentName}...`);break;case"rotation:complete":{a().addToast("success",`Rotated ${o.agentName}`,`Saved ${o.tokensSaved} tokens`);const h=a().detailPanel;(h==null?void 0:h.type)==="agent"&&h.agentId===o.oldAgentId&&o.newAgentId&&t(p=>{var y,Q,w;const x={...p.chatHistory},g={...p.tokenTimeline},b={...p.activityLog};return(y=x[o.oldAgentId])!=null&&y.length&&(x[o.newAgentId]=[...x[o.oldAgentId]]),(Q=g[o.oldAgentId])!=null&&Q.length&&(g[o.newAgentId]=[...g[o.oldAgentId]]),(w=b[o.oldAgentId])!=null&&w.length&&(b[o.newAgentId]=[...b[o.oldAgentId]]),{chatHistory:x,tokenTimeline:g,activityLog:b,detailPanel:{type:"agent",agentId:o.newAgentId}}});break}case"rotation:failed":a().addToast("error","Rotation failed",o.error);break;case"file:changed":{const h=a().editorRecentSaves[o.path];if(h&&Date.now()-h<2e3)break;t(p=>({editorChangedFiles:{...p.editorChangedFiles,[o.path]:o.timestamp}}));break}case"team:created":case"team:deleted":case"team:updated":a().fetchTeams();break;case"approval:request":t(h=>({pendingApprovals:[...h.pendingApprovals,o.data]})),a().addToast("warning",`Approval needed: ${((u=o.data)==null?void 0:u.agentName)||"agent"}`,(O=(d=o.data)==null?void 0:d.action)==null?void 0:O.description);break;case"approval:resolved":{const h=o.data;t(p=>({pendingApprovals:p.pendingApprovals.filter(x=>x.id!==h.id),resolvedApprovals:[h,...p.resolvedApprovals].slice(0,200)}));break}case"conflict:detected":a().addToast("error",`Scope conflict: ${o.agentName||"agent"}`,o.filePath?`File: ${o.filePath}`:void 0);break;case"qc:activated":a().addToast("info","QC agent activated",`${o.agentCount||"4+"} agents running`);break;case"journalist:cycle":t({journalistStatus:o.data||null});break;case"schedule:execute":a().addToast("info",`Scheduled agent spawned: ${o.name||o.role||"agent"}`);break;case"gateway:status":t({gateways:o.data||[]});break}},s.onclose=()=>{t({connected:!1,hydrated:!1,ws:null,daemonHost:null,tunneled:!1}),setTimeout(()=>a().connect(),2e3)},s.onerror=()=>s.close()},setActiveView(s){t({activeView:s})},async fetchTeams(){try{const s=await J.get("/teams"),l=s.teams||[],o=s.defaultTeamId,{activeTeamId:u}=a(),O=l.map(h=>h.id).includes(u)?u:o;t({teams:l,activeTeamId:O}),O&&localStorage.setItem("groove:activeTeamId",O)}catch{}},switchTeam(s){t({activeTeamId:s,detailPanel:null}),localStorage.setItem("groove:activeTeamId",s)},async createTeam(s,l){try{const o={name:s};l&&(o.workingDir=l);const u=await J.post("/teams",o);return t({activeTeamId:u.id}),localStorage.setItem("groove:activeTeamId",u.id),a().addToast("success",`Team "${s}" created`),u}catch(o){throw a().addToast("error","Failed to create team",o.message),o}},async deleteTeam(s){const l=a().teams.find(o=>o.id===s);if(l!=null&&l.isDefault){a().addToast("warning","Cannot delete the default team");return}try{await J.delete(`/teams/${s}`),a().addToast("info",`Team "${l==null?void 0:l.name}" deleted`)}catch(o){a().addToast("error","Failed to delete team",o.message)}},async renameTeam(s,l){try{const o=await J.patch(`/teams/${s}`,{name:l});return t(u=>({teams:u.teams.map(d=>d.id===s?o:d)})),o}catch(o){throw a().addToast("error","Failed to rename team",o.message),o}},openDetail(s){t({detailPanel:s})},closeDetail(){t({detailPanel:null})},selectAgent(s){t({detailPanel:{type:"agent",agentId:s}})},clearSelection(){t({detailPanel:null})},toggleCommandPalette(){t(s=>({commandPaletteOpen:!s.commandPaletteOpen}))},setDetailPanelWidth(s){t({detailPanelWidth:s}),localStorage.setItem("groove:detailWidth",String(s))},setTerminalVisible(s){t({terminalVisible:s}),localStorage.setItem("groove:terminalVisible",String(s))},setTerminalHeight(s){t({terminalHeight:s}),localStorage.setItem("groove:terminalHeight",String(s))},setTerminalFullHeight(s){t({terminalFullHeight:s})},addToast(s,l,o){const u=++cw;t(d=>({toasts:[...d.toasts,{id:u,type:s,message:l,detail:o}]}))},removeToast(s){t(l=>({toasts:l.toasts.filter(o=>o.id!==s)}))},async checkMarketplaceAuth(){try{const s=await J.get("/auth/status");t({marketplaceAuthenticated:s.authenticated||!1,marketplaceUser:s.user||null})}catch{t({marketplaceAuthenticated:!1,marketplaceUser:null})}},async marketplaceLogin(){try{const s=await J.get("/auth/login-url");s.url&&window.open(s.url,"_blank");const l=setInterval(async()=>{var o,u;try{const d=await J.get("/auth/status");d.authenticated&&(clearInterval(l),t({marketplaceAuthenticated:!0,marketplaceUser:d.user}),a().addToast("success",`Signed in as ${((o=d.user)==null?void 0:o.displayName)||((u=d.user)==null?void 0:u.id)||"user"}`))}catch{}},2e3);setTimeout(()=>clearInterval(l),3e5)}catch(s){a().addToast("error","Login failed",s.message)}},async marketplaceLogout(){try{await J.post("/auth/logout"),t({marketplaceAuthenticated:!1,marketplaceUser:null}),a().addToast("info","Signed out of marketplace")}catch(s){a().addToast("error","Logout failed",s.message)}},async marketplaceCheckout(s){try{const l=await J.post("/auth/checkout",{skillId:s});return l.url&&window.open(l.url,"_blank"),l}catch(l){throw a().addToast("error","Checkout failed",l.message),l}},async fetchApprovals(){try{const s=await J.get("/approvals");t({pendingApprovals:s.pending||[],resolvedApprovals:s.resolved||[]})}catch{}},async approveRequest(s){try{await J.post(`/approvals/${s}/approve`),t(l=>({pendingApprovals:l.pendingApprovals.filter(o=>o.id!==s)})),a().addToast("success","Approved")}catch(l){a().addToast("error","Approve failed",l.message)}},async rejectRequest(s,l=""){try{await J.post(`/approvals/${s}/reject`,{reason:l}),t(o=>({pendingApprovals:o.pendingApprovals.filter(u=>u.id!==s)})),a().addToast("info","Rejected")}catch(o){a().addToast("error","Reject failed",o.message)}},async checkRecommendedTeam(){var s,l;try{const o=await J.get("/recommended-team");if(!o||!((s=o.agents)!=null&&s.length)){t({recommendedTeam:null});return}const d=a().agents.filter(h=>h.role==="planner").sort((h,p)=>(p.lastActivity||"").localeCompare(h.lastActivity||""))[0],O=d==null?void 0:d.teamId;if(O){const h=a().agents.filter(g=>g.teamId===O&&g.role!=="planner"),p=o.agents.filter(g=>!g.phase||g.phase===1).map(g=>g.role);if(p.every(g=>h.some(b=>b.role===g))&&p.length>0){t({recommendedTeam:null});const b=((l=(await J.post("/recommended-team/launch")).agents)==null?void 0:l.map(y=>y.name).join(", "))||"";a().addToast("success","Planner delegated work",b?`→ ${b}`:void 0),J.post("/cleanup").catch(()=>{});return}}t({recommendedTeam:o})}catch{t({recommendedTeam:null})}},async launchRecommendedTeam(s){try{t({recommendedTeam:null}),a().addToast("info","Launching team...");const l=s?{agents:s}:void 0,o=await J.post("/recommended-team/launch",l),u=[o.phase2Pending?`${o.phase2Pending} QC queued`:"",o.projectDir?`→ ${o.projectDir}/`:""].filter(Boolean).join(" · ");return a().addToast("success",`Launched ${o.launched} agents`,u||void 0),J.post("/cleanup").catch(()=>{}),o}catch(l){throw a().addToast("error","Launch failed",l.message),l}},async fetchJournalist(){try{const s=await J.get("/journalist");return t({journalistStatus:s}),s}catch{return null}},async triggerJournalistCycle(){try{const s=await J.post("/journalist/cycle");return a().addToast("success","Synthesis cycle triggered"),t({journalistStatus:s}),s}catch(s){throw a().addToast("error","Synthesis failed",s.message),s}},async spawnAgent(s){try{const l=a().activeTeamId,o=await J.post("/agents",{...s,teamId:l});return a().addToast("success",`Spawned ${o.name}`),o}catch(l){throw a().addToast("error","Spawn failed",l.message),l}},async killAgent(s,l=!1){try{await J.delete(`/agents/${s}?purge=${l}`)}catch(o){a().addToast("error","Kill failed",o.message)}},async rotateAgent(s){try{return await J.post(`/agents/${s}/rotate`)}catch(l){throw a().addToast("error","Rotation failed",l.message),l}},async fetchProviders(){return J.get("/providers")},addChatMessage(s,l,o,u=!1){t(d=>{const O={...d.chatHistory};return O[s]||(O[s]=[]),O[s]=[...O[s].slice(-100),{from:l,text:o,timestamp:Date.now(),isQuery:u}],wl("groove:chatHistory",O),{chatHistory:O}})},thinkingAgents:new Set,async instructAgent(s,l){var d,O;const o=a().agents.find(h=>h.id===s);if(o&&(o.status==="running"||o.status==="starting")){a().addChatMessage(s,"user",l,!1);try{const h=await J.post(`/agents/${s}/query`,{message:l});return h.status==="pending"||h.response==="Message sent to agent"?(t(p=>({thinkingAgents:new Set([...p.thinkingAgents,s])})),h):(a().addChatMessage(s,"agent",h.response),h)}catch(h){throw a().addChatMessage(s,"system",`failed: ${h.message}`),h}}a().addChatMessage(s,"user",l,!1),t(h=>({thinkingAgents:new Set([...h.thinkingAgents,s])}));try{const h=await J.post(`/agents/${s}/instruct`,{message:l});for(const p of["chatHistory","activityLog","tokenTimeline"]){const x=a()[p][s];x!=null&&x.length&&t(g=>({[p]:{...g[p],[h.id]:[...x]}}))}return t(p=>{const x=new Set(p.thinkingAgents);return x.delete(s),x.add(h.id),{thinkingAgents:x}}),(d=a().chatHistory[s])!=null&&d.length&&wl("groove:chatHistory",a().chatHistory),(O=a().activityLog[s])!=null&&O.length&&wl("groove:activityLog",a().activityLog),a().selectAgent(h.id),h}catch(h){throw t(p=>{const x=new Set(p.thinkingAgents);return x.delete(s),{thinkingAgents:x}}),a().addChatMessage(s,"system",`failed: ${h.message}`),h}},async queryAgent(s,l){a().addChatMessage(s,"user",l,!0);try{const o=await J.post(`/agents/${s}/query`,{message:l});return a().addChatMessage(s,"agent",o.response),o}catch(o){throw a().addChatMessage(s,"system",`query failed: ${o.message}`),o}},async openFile(s){var u;if(a().editorFiles[s]||a().editorOpenTabs.includes(s)){t(d=>({editorActiveFile:s,editorOpenTabs:d.editorOpenTabs.includes(s)?d.editorOpenTabs:[...d.editorOpenTabs,s]}));return}const l=(u=s.split(".").pop())==null?void 0:u.toLowerCase();if(["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif","mp4","webm","mov","avi","mkv","ogv"].includes(l)){t(d=>({editorActiveFile:s,editorOpenTabs:[...d.editorOpenTabs,s]}));return}try{const d=await J.get(`/files/read?path=${encodeURIComponent(s)}`);if(d.binary){a().addToast("warning","Binary file — cannot open");return}t(h=>({editorFiles:{...h.editorFiles,[s]:{content:d.content,originalContent:d.content,language:d.language,loadedAt:Date.now()}},editorActiveFile:s,editorOpenTabs:h.editorOpenTabs.includes(s)?h.editorOpenTabs:[...h.editorOpenTabs,s]}));const O=a().ws;(O==null?void 0:O.readyState)===1&&O.send(JSON.stringify({type:"editor:watch",path:s}))}catch(d){a().addToast("error","Failed to open file",d.message)}},closeFile(s){t(o=>{const u=o.editorOpenTabs.filter(p=>p!==s),d={...o.editorFiles};delete d[s];const O={...o.editorChangedFiles};delete O[s];let h=o.editorActiveFile;if(h===s){const p=o.editorOpenTabs.indexOf(s);h=u[Math.min(p,u.length-1)]||null}return{editorOpenTabs:u,editorFiles:d,editorChangedFiles:O,editorActiveFile:h}});const l=a().ws;(l==null?void 0:l.readyState)===1&&l.send(JSON.stringify({type:"editor:unwatch",path:s}))},setActiveFile(s){t({editorActiveFile:s})},updateFileContent(s,l){t(o=>({editorFiles:{...o.editorFiles,[s]:{...o.editorFiles[s],content:l}}}))},async saveFile(s){const l=a().editorFiles[s];if(l)try{await J.post("/files/write",{path:s,content:l.content}),t(o=>({editorFiles:{...o.editorFiles,[s]:{...o.editorFiles[s],originalContent:l.content}},editorChangedFiles:(()=>{const u={...o.editorChangedFiles};return delete u[s],u})(),editorRecentSaves:{...o.editorRecentSaves,[s]:Date.now()}})),a().addToast("success","File saved")}catch(o){a().addToast("error","Save failed",o.message)}},async reloadFile(s){try{const l=await J.get(`/files/read?path=${encodeURIComponent(s)}`);if(l.binary)return;t(o=>({editorFiles:{...o.editorFiles,[s]:{content:l.content,originalContent:l.content,language:l.language,loadedAt:Date.now()}},editorChangedFiles:(()=>{const u={...o.editorChangedFiles};return delete u[s],u})()}))}catch{}},dismissFileChange(s){t(l=>{const o={...l.editorChangedFiles};return delete o[s],{editorChangedFiles:o}})},async fetchTreeDir(s){try{const l=await J.get(`/files/tree?path=${encodeURIComponent(s)}`);t(o=>({editorTreeCache:{...o.editorTreeCache,[s]:l.entries}}))}catch{}},async createFile(s){try{await J.post("/files/create",{path:s});const l=s.includes("/")?s.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(l),a().addToast("success","File created"),!0}catch(l){return a().addToast("error","Create failed",l.message),!1}},async createDir(s){try{await J.post("/files/mkdir",{path:s});const l=s.includes("/")?s.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(l),a().addToast("success","Folder created"),!0}catch(l){return a().addToast("error","Create failed",l.message),!1}},async deleteFile(s){try{await J.delete(`/files/delete?path=${encodeURIComponent(s)}`),a().editorOpenTabs.includes(s)&&a().closeFile(s);const l=s.includes("/")?s.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(l),t(o=>{const u={...o.editorTreeCache};return delete u[s],{editorTreeCache:u}}),a().addToast("success","Deleted"),!0}catch(l){return a().addToast("error","Delete failed",l.message),!1}},async renameFile(s,l){try{await J.post("/files/rename",{oldPath:s,newPath:l}),t(d=>{const O=d.editorOpenTabs.map(x=>x===s?l:x),h={...d.editorFiles};h[s]&&(h[l]=h[s],delete h[s]);const p=d.editorActiveFile===s?l:d.editorActiveFile;return{editorOpenTabs:O,editorFiles:h,editorActiveFile:p}});const o=s.includes("/")?s.split("/").slice(0,-1).join("/"):"",u=l.includes("/")?l.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(o),u!==o&&await a().fetchTreeDir(u),a().addToast("success","Renamed"),!0}catch(o){return a().addToast("error","Rename failed",o.message),!1}}}));function uw(t){v.useEffect(()=>{function a(s){for(const l of t){const o=l.meta?s.metaKey||s.ctrlKey:!0,u=l.shift?s.shiftKey:!s.shiftKey;if(s.key.toLowerCase()===l.key.toLowerCase()&&o&&u){s.preventDefault(),l.handler();return}}}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t])}function qe(t,a,{checkForDefaultPrevented:s=!0}={}){return function(o){if(t==null||t(o),s===!1||!o.defaultPrevented)return a==null?void 0:a(o)}}function _g(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function _0(...t){return a=>{let s=!1;const l=t.map(o=>{const u=_g(o,a);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let o=0;o<l.length;o++){const u=l[o];typeof u=="function"?u():_g(t[o],null)}}}}function it(...t){return v.useCallback(_0(...t),t)}function dw(t,a){const s=v.createContext(a),l=u=>{const{children:d,...O}=u,h=v.useMemo(()=>O,Object.values(O));return r.jsx(s.Provider,{value:h,children:d})};l.displayName=t+"Provider";function o(u){const d=v.useContext(s);if(d)return d;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${t}\``)}return[l,o]}function Xs(t,a=[]){let s=[];function l(u,d){const O=v.createContext(d),h=s.length;s=[...s,d];const p=g=>{var j;const{scope:b,children:y,...Q}=g,w=((j=b==null?void 0:b[t])==null?void 0:j[h])||O,$=v.useMemo(()=>Q,Object.values(Q));return r.jsx(w.Provider,{value:$,children:y})};p.displayName=u+"Provider";function x(g,b){var w;const y=((w=b==null?void 0:b[t])==null?void 0:w[h])||O,Q=v.useContext(y);if(Q)return Q;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${u}\``)}return[p,x]}const o=()=>{const u=s.map(d=>v.createContext(d));return function(O){const h=(O==null?void 0:O[t])||u;return v.useMemo(()=>({[`__scope${t}`]:{...O,[t]:h}}),[O,h])}};return o.scopeName=t,[l,Ow(o,...a)]}function Ow(...t){const a=t[0];if(t.length===1)return a;const s=()=>{const l=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=l.reduce((O,{useScope:h,scopeName:p})=>{const g=h(u)[`__scope${p}`];return{...O,...g}},{});return v.useMemo(()=>({[`__scope${a.scopeName}`]:d}),[d])}};return s.scopeName=a.scopeName,s}function uc(t){const a=fw(t),s=v.forwardRef((l,o)=>{const{children:u,...d}=l,O=v.Children.toArray(u),h=O.find(mw);if(h){const p=h.props.children,x=O.map(g=>g===h?v.Children.count(p)>1?v.Children.only(null):v.isValidElement(p)?p.props.children:null:g);return r.jsx(a,{...d,ref:o,children:v.isValidElement(p)?v.cloneElement(p,void 0,x):null})}return r.jsx(a,{...d,ref:o,children:u})});return s.displayName=`${t}.Slot`,s}function fw(t){const a=v.forwardRef((s,l)=>{const{children:o,...u}=s;if(v.isValidElement(o)){const d=xw(o),O=pw(u,o.props);return o.type!==v.Fragment&&(O.ref=l?_0(l,d):d),v.cloneElement(o,O)}return v.Children.count(o)>1?v.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var Z0=Symbol("radix.slottable");function hw(t){const a=({children:s})=>r.jsx(r.Fragment,{children:s});return a.displayName=`${t}.Slottable`,a.__radixId=Z0,a}function mw(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Z0}function pw(t,a){const s={...a};for(const l in a){const o=t[l],u=a[l];/^on[A-Z]/.test(l)?o&&u?s[l]=(...O)=>{const h=u(...O);return o(...O),h}:o&&(s[l]=o):l==="style"?s[l]={...o,...u}:l==="className"&&(s[l]=[o,u].filter(Boolean).join(" "))}return{...t,...s}}function xw(t){var l,o;let a=(l=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:l.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?t.ref:(a=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?t.props.ref:t.props.ref||t.ref)}var gw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=gw.reduce((t,a)=>{const s=uc(`Primitive.${a}`),l=v.forwardRef((o,u)=>{const{asChild:d,...O}=o,h=d?s:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(h,{...O,ref:u})});return l.displayName=`Primitive.${a}`,{...t,[a]:l}},{});function bw(t,a){t&&$0.flushSync(()=>t.dispatchEvent(a))}function zt(t){const a=v.useRef(t);return v.useEffect(()=>{a.current=t}),v.useMemo(()=>(...s)=>{var l;return(l=a.current)==null?void 0:l.call(a,...s)},[])}function vw(t,a=globalThis==null?void 0:globalThis.document){const s=zt(t);v.useEffect(()=>{const l=o=>{o.key==="Escape"&&s(o)};return a.addEventListener("keydown",l,{capture:!0}),()=>a.removeEventListener("keydown",l,{capture:!0})},[s,a])}var yw="DismissableLayer",of="dismissableLayer.update",Sw="dismissableLayer.pointerDownOutside",Qw="dismissableLayer.focusOutside",Zg,A0=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Af=v.forwardRef((t,a)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:l,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:O,...h}=t,p=v.useContext(A0),[x,g]=v.useState(null),b=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),Q=it(a,X=>g(X)),w=Array.from(p.layers),[$]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf($),z=x?w.indexOf(x):-1,N=p.layersWithOutsidePointerEventsDisabled.size>0,_=z>=j,G=kw(X=>{const T=X.target,V=[...p.branches].some(M=>M.contains(T));!_||V||(o==null||o(X),d==null||d(X),X.defaultPrevented||O==null||O())},b),R=$w(X=>{const T=X.target;[...p.branches].some(M=>M.contains(T))||(u==null||u(X),d==null||d(X),X.defaultPrevented||O==null||O())},b);return vw(X=>{z===p.layers.size-1&&(l==null||l(X),!X.defaultPrevented&&O&&(X.preventDefault(),O()))},b),v.useEffect(()=>{if(x)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Zg=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(x)),p.layers.add(x),Ag(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Zg)}},[x,b,s,p]),v.useEffect(()=>()=>{x&&(p.layers.delete(x),p.layersWithOutsidePointerEventsDisabled.delete(x),Ag())},[x,p]),v.useEffect(()=>{const X=()=>y({});return document.addEventListener(of,X),()=>document.removeEventListener(of,X)},[]),r.jsx(Be.div,{...h,ref:Q,style:{pointerEvents:N?_?"auto":"none":void 0,...t.style},onFocusCapture:qe(t.onFocusCapture,R.onFocusCapture),onBlurCapture:qe(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:qe(t.onPointerDownCapture,G.onPointerDownCapture)})});Af.displayName=yw;var jw="DismissableLayerBranch",ww=v.forwardRef((t,a)=>{const s=v.useContext(A0),l=v.useRef(null),o=it(a,l);return v.useEffect(()=>{const u=l.current;if(u)return s.branches.add(u),()=>{s.branches.delete(u)}},[s.branches]),r.jsx(Be.div,{...t,ref:o})});ww.displayName=jw;function kw(t,a=globalThis==null?void 0:globalThis.document){const s=zt(t),l=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const u=O=>{if(O.target&&!l.current){let h=function(){E0(Sw,s,p,{discrete:!0})};const p={originalEvent:O};O.pointerType==="touch"?(a.removeEventListener("click",o.current),o.current=h,a.addEventListener("click",o.current,{once:!0})):h()}else a.removeEventListener("click",o.current);l.current=!1},d=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),a.removeEventListener("pointerdown",u),a.removeEventListener("click",o.current)}},[a,s]),{onPointerDownCapture:()=>l.current=!0}}function $w(t,a=globalThis==null?void 0:globalThis.document){const s=zt(t),l=v.useRef(!1);return v.useEffect(()=>{const o=u=>{u.target&&!l.current&&E0(Qw,s,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",o),()=>a.removeEventListener("focusin",o)},[a,s]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function Ag(){const t=new CustomEvent(of);document.dispatchEvent(t)}function E0(t,a,s,{discrete:l}){const o=s.originalEvent.target,u=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:s});a&&o.addEventListener(t,a,{once:!0}),l?bw(o,u):o.dispatchEvent(u)}var ra=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},Tw=k0[" useId ".trim().toString()]||(()=>{}),Nw=0;function Tl(t){const[a,s]=v.useState(Tw());return ra(()=>{s(l=>l??String(Nw++))},[t]),t||(a?`radix-${a}`:"")}const Pw=["top","right","bottom","left"],Ia=Math.min,Lt=Math.max,dc=Math.round,Mo=Math.floor,Tn=t=>({x:t,y:t}),zw={left:"right",right:"left",bottom:"top",top:"bottom"};function cf(t,a,s){return Lt(t,Ia(a,s))}function ia(t,a){return typeof t=="function"?t(a):t}function oa(t){return t.split("-")[0]}function Vl(t){return t.split("-")[1]}function Ef(t){return t==="x"?"y":"x"}function qf(t){return t==="y"?"height":"width"}function $n(t){const a=t[0];return a==="t"||a==="b"?"y":"x"}function Mf(t){return Ef($n(t))}function Rw(t,a,s){s===void 0&&(s=!1);const l=Vl(t),o=Mf(t),u=qf(o);let d=o==="x"?l===(s?"end":"start")?"right":"left":l==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(d=Oc(d)),[d,Oc(d)]}function Cw(t){const a=Oc(t);return[uf(t),a,uf(a)]}function uf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Eg=["left","right"],qg=["right","left"],Xw=["top","bottom"],_w=["bottom","top"];function Zw(t,a,s){switch(t){case"top":case"bottom":return s?a?qg:Eg:a?Eg:qg;case"left":case"right":return a?Xw:_w;default:return[]}}function Aw(t,a,s,l){const o=Vl(t);let u=Zw(oa(t),s==="start",l);return o&&(u=u.map(d=>d+"-"+o),a&&(u=u.concat(u.map(uf)))),u}function Oc(t){const a=oa(t);return zw[a]+t.slice(a.length)}function Ew(t){return{top:0,right:0,bottom:0,left:0,...t}}function q0(t){return typeof t!="number"?Ew(t):{top:t,right:t,bottom:t,left:t}}function fc(t){const{x:a,y:s,width:l,height:o}=t;return{width:l,height:o,top:s,left:a,right:a+l,bottom:s+o,x:a,y:s}}function Mg(t,a,s){let{reference:l,floating:o}=t;const u=$n(a),d=Mf(a),O=qf(d),h=oa(a),p=u==="y",x=l.x+l.width/2-o.width/2,g=l.y+l.height/2-o.height/2,b=l[O]/2-o[O]/2;let y;switch(h){case"top":y={x,y:l.y-o.height};break;case"bottom":y={x,y:l.y+l.height};break;case"right":y={x:l.x+l.width,y:g};break;case"left":y={x:l.x-o.width,y:g};break;default:y={x:l.x,y:l.y}}switch(Vl(a)){case"start":y[d]-=b*(s&&p?-1:1);break;case"end":y[d]+=b*(s&&p?-1:1);break}return y}async function qw(t,a){var s;a===void 0&&(a={});const{x:l,y:o,platform:u,rects:d,elements:O,strategy:h}=t,{boundary:p="clippingAncestors",rootBoundary:x="viewport",elementContext:g="floating",altBoundary:b=!1,padding:y=0}=ia(a,t),Q=q0(y),$=O[b?g==="floating"?"reference":"floating":g],j=fc(await u.getClippingRect({element:(s=await(u.isElement==null?void 0:u.isElement($)))==null||s?$:$.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(O.floating)),boundary:p,rootBoundary:x,strategy:h})),z=g==="floating"?{x:l,y:o,width:d.floating.width,height:d.floating.height}:d.reference,N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(O.floating)),_=await(u.isElement==null?void 0:u.isElement(N))?await(u.getScale==null?void 0:u.getScale(N))||{x:1,y:1}:{x:1,y:1},G=fc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:O,rect:z,offsetParent:N,strategy:h}):z);return{top:(j.top-G.top+Q.top)/_.y,bottom:(G.bottom-j.bottom+Q.bottom)/_.y,left:(j.left-G.left+Q.left)/_.x,right:(G.right-j.right+Q.right)/_.x}}const Mw=50,Yw=async(t,a,s)=>{const{placement:l="bottom",strategy:o="absolute",middleware:u=[],platform:d}=s,O=d.detectOverflow?d:{...d,detectOverflow:qw},h=await(d.isRTL==null?void 0:d.isRTL(a));let p=await d.getElementRects({reference:t,floating:a,strategy:o}),{x,y:g}=Mg(p,l,h),b=l,y=0;const Q={};for(let w=0;w<u.length;w++){const $=u[w];if(!$)continue;const{name:j,fn:z}=$,{x:N,y:_,data:G,reset:R}=await z({x,y:g,initialPlacement:l,placement:b,strategy:o,middlewareData:Q,rects:p,platform:O,elements:{reference:t,floating:a}});x=N??x,g=_??g,Q[j]={...Q[j],...G},R&&y<Mw&&(y++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(p=R.rects===!0?await d.getElementRects({reference:t,floating:a,strategy:o}):R.rects),{x,y:g}=Mg(p,b,h)),w=-1)}return{x,y:g,placement:b,strategy:o,middlewareData:Q}},Uw=t=>({name:"arrow",options:t,async fn(a){const{x:s,y:l,placement:o,rects:u,platform:d,elements:O,middlewareData:h}=a,{element:p,padding:x=0}=ia(t,a)||{};if(p==null)return{};const g=q0(x),b={x:s,y:l},y=Mf(o),Q=qf(y),w=await d.getDimensions(p),$=y==="y",j=$?"top":"left",z=$?"bottom":"right",N=$?"clientHeight":"clientWidth",_=u.reference[Q]+u.reference[y]-b[y]-u.floating[Q],G=b[y]-u.reference[y],R=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let X=R?R[N]:0;(!X||!await(d.isElement==null?void 0:d.isElement(R)))&&(X=O.floating[N]||u.floating[Q]);const T=_/2-G/2,V=X/2-w[Q]/2-1,M=Ia(g[j],V),ae=Ia(g[z],V),F=M,se=X-w[Q]-ae,oe=X/2-w[Q]/2+T,H=cf(F,oe,se),P=!h.arrow&&Vl(o)!=null&&oe!==H&&u.reference[Q]/2-(oe<F?M:ae)-w[Q]/2<0,W=P?oe<F?oe-F:oe-se:0;return{[y]:b[y]+W,data:{[y]:H,centerOffset:oe-H-W,...P&&{alignmentOffset:W}},reset:P}}}),Vw=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(a){var s,l;const{placement:o,middlewareData:u,rects:d,initialPlacement:O,platform:h,elements:p}=a,{mainAxis:x=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:Q="none",flipAlignment:w=!0,...$}=ia(t,a);if((s=u.arrow)!=null&&s.alignmentOffset)return{};const j=oa(o),z=$n(O),N=oa(O)===O,_=await(h.isRTL==null?void 0:h.isRTL(p.floating)),G=b||(N||!w?[Oc(O)]:Cw(O)),R=Q!=="none";!b&&R&&G.push(...Aw(O,w,Q,_));const X=[O,...G],T=await h.detectOverflow(a,$),V=[];let M=((l=u.flip)==null?void 0:l.overflows)||[];if(x&&V.push(T[j]),g){const oe=Rw(o,d,_);V.push(T[oe[0]],T[oe[1]])}if(M=[...M,{placement:o,overflows:V}],!V.every(oe=>oe<=0)){var ae,F;const oe=(((ae=u.flip)==null?void 0:ae.index)||0)+1,H=X[oe];if(H&&(!(g==="alignment"?z!==$n(H):!1)||M.every(E=>$n(E.placement)===z?E.overflows[0]>0:!0)))return{data:{index:oe,overflows:M},reset:{placement:H}};let P=(F=M.filter(W=>W.overflows[0]<=0).sort((W,E)=>W.overflows[1]-E.overflows[1])[0])==null?void 0:F.placement;if(!P)switch(y){case"bestFit":{var se;const W=(se=M.filter(E=>{if(R){const ce=$n(E.placement);return ce===z||ce==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(ce=>ce>0).reduce((ce,ee)=>ce+ee,0)]).sort((E,ce)=>E[1]-ce[1])[0])==null?void 0:se[0];W&&(P=W);break}case"initialPlacement":P=O;break}if(o!==P)return{reset:{placement:P}}}return{}}}};function Yg(t,a){return{top:t.top-a.height,right:t.right-a.width,bottom:t.bottom-a.height,left:t.left-a.width}}function Ug(t){return Pw.some(a=>t[a]>=0)}const Gw=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(a){const{rects:s,platform:l}=a,{strategy:o="referenceHidden",...u}=ia(t,a);switch(o){case"referenceHidden":{const d=await l.detectOverflow(a,{...u,elementContext:"reference"}),O=Yg(d,s.reference);return{data:{referenceHiddenOffsets:O,referenceHidden:Ug(O)}}}case"escaped":{const d=await l.detectOverflow(a,{...u,altBoundary:!0}),O=Yg(d,s.floating);return{data:{escapedOffsets:O,escaped:Ug(O)}}}default:return{}}}}},M0=new Set(["left","top"]);async function Lw(t,a){const{placement:s,platform:l,elements:o}=t,u=await(l.isRTL==null?void 0:l.isRTL(o.floating)),d=oa(s),O=Vl(s),h=$n(s)==="y",p=M0.has(d)?-1:1,x=u&&h?-1:1,g=ia(a,t);let{mainAxis:b,crossAxis:y,alignmentAxis:Q}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return O&&typeof Q=="number"&&(y=O==="end"?Q*-1:Q),h?{x:y*x,y:b*p}:{x:b*p,y:y*x}}const Dw=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(a){var s,l;const{x:o,y:u,placement:d,middlewareData:O}=a,h=await Lw(a,t);return d===((s=O.offset)==null?void 0:s.placement)&&(l=O.arrow)!=null&&l.alignmentOffset?{}:{x:o+h.x,y:u+h.y,data:{...h,placement:d}}}}},Ww=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(a){const{x:s,y:l,placement:o,platform:u}=a,{mainAxis:d=!0,crossAxis:O=!1,limiter:h={fn:j=>{let{x:z,y:N}=j;return{x:z,y:N}}},...p}=ia(t,a),x={x:s,y:l},g=await u.detectOverflow(a,p),b=$n(oa(o)),y=Ef(b);let Q=x[y],w=x[b];if(d){const j=y==="y"?"top":"left",z=y==="y"?"bottom":"right",N=Q+g[j],_=Q-g[z];Q=cf(N,Q,_)}if(O){const j=b==="y"?"top":"left",z=b==="y"?"bottom":"right",N=w+g[j],_=w-g[z];w=cf(N,w,_)}const $=h.fn({...a,[y]:Q,[b]:w});return{...$,data:{x:$.x-s,y:$.y-l,enabled:{[y]:d,[b]:O}}}}}},Bw=function(t){return t===void 0&&(t={}),{options:t,fn(a){const{x:s,y:l,placement:o,rects:u,middlewareData:d}=a,{offset:O=0,mainAxis:h=!0,crossAxis:p=!0}=ia(t,a),x={x:s,y:l},g=$n(o),b=Ef(g);let y=x[b],Q=x[g];const w=ia(O,a),$=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const N=b==="y"?"height":"width",_=u.reference[b]-u.floating[N]+$.mainAxis,G=u.reference[b]+u.reference[N]-$.mainAxis;y<_?y=_:y>G&&(y=G)}if(p){var j,z;const N=b==="y"?"width":"height",_=M0.has(oa(o)),G=u.reference[g]-u.floating[N]+(_&&((j=d.offset)==null?void 0:j[g])||0)+(_?0:$.crossAxis),R=u.reference[g]+u.reference[N]+(_?0:((z=d.offset)==null?void 0:z[g])||0)-(_?$.crossAxis:0);Q<G?Q=G:Q>R&&(Q=R)}return{[b]:y,[g]:Q}}}},Hw=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(a){var s,l;const{placement:o,rects:u,platform:d,elements:O}=a,{apply:h=()=>{},...p}=ia(t,a),x=await d.detectOverflow(a,p),g=oa(o),b=Vl(o),y=$n(o)==="y",{width:Q,height:w}=u.floating;let $,j;g==="top"||g==="bottom"?($=g,j=b===(await(d.isRTL==null?void 0:d.isRTL(O.floating))?"start":"end")?"left":"right"):(j=g,$=b==="end"?"top":"bottom");const z=w-x.top-x.bottom,N=Q-x.left-x.right,_=Ia(w-x[$],z),G=Ia(Q-x[j],N),R=!a.middlewareData.shift;let X=_,T=G;if((s=a.middlewareData.shift)!=null&&s.enabled.x&&(T=N),(l=a.middlewareData.shift)!=null&&l.enabled.y&&(X=z),R&&!b){const M=Lt(x.left,0),ae=Lt(x.right,0),F=Lt(x.top,0),se=Lt(x.bottom,0);y?T=Q-2*(M!==0||ae!==0?M+ae:Lt(x.left,x.right)):X=w-2*(F!==0||se!==0?F+se:Lt(x.top,x.bottom))}await h({...a,availableWidth:T,availableHeight:X});const V=await d.getDimensions(O.floating);return Q!==V.width||w!==V.height?{reset:{rects:!0}}:{}}}};function Zc(){return typeof window<"u"}function Gl(t){return Y0(t)?(t.nodeName||"").toLowerCase():"#document"}function Wt(t){var a;return(t==null||(a=t.ownerDocument)==null?void 0:a.defaultView)||window}function Pn(t){var a;return(a=(Y0(t)?t.ownerDocument:t.document)||window.document)==null?void 0:a.documentElement}function Y0(t){return Zc()?t instanceof Node||t instanceof Wt(t).Node:!1}function pn(t){return Zc()?t instanceof Element||t instanceof Wt(t).Element:!1}function Oa(t){return Zc()?t instanceof HTMLElement||t instanceof Wt(t).HTMLElement:!1}function Vg(t){return!Zc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Wt(t).ShadowRoot}function fi(t){const{overflow:a,overflowX:s,overflowY:l,display:o}=xn(t);return/auto|scroll|overlay|hidden|clip/.test(a+l+s)&&o!=="inline"&&o!=="contents"}function Iw(t){return/^(table|td|th)$/.test(Gl(t))}function Ac(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Fw=/transform|translate|scale|rotate|perspective|filter/,Kw=/paint|layout|strict|content/,Ss=t=>!!t&&t!=="none";let gO;function Yf(t){const a=pn(t)?xn(t):t;return Ss(a.transform)||Ss(a.translate)||Ss(a.scale)||Ss(a.rotate)||Ss(a.perspective)||!Uf()&&(Ss(a.backdropFilter)||Ss(a.filter))||Fw.test(a.willChange||"")||Kw.test(a.contain||"")}function Jw(t){let a=Fa(t);for(;Oa(a)&&!_l(a);){if(Yf(a))return a;if(Ac(a))return null;a=Fa(a)}return null}function Uf(){return gO==null&&(gO=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gO}function _l(t){return/^(html|body|#document)$/.test(Gl(t))}function xn(t){return Wt(t).getComputedStyle(t)}function Ec(t){return pn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fa(t){if(Gl(t)==="html")return t;const a=t.assignedSlot||t.parentNode||Vg(t)&&t.host||Pn(t);return Vg(a)?a.host:a}function U0(t){const a=Fa(t);return _l(a)?t.ownerDocument?t.ownerDocument.body:t.body:Oa(a)&&fi(a)?a:U0(a)}function ei(t,a,s){var l;a===void 0&&(a=[]),s===void 0&&(s=!0);const o=U0(t),u=o===((l=t.ownerDocument)==null?void 0:l.body),d=Wt(o);if(u){const O=df(d);return a.concat(d,d.visualViewport||[],fi(o)?o:[],O&&s?ei(O):[])}else return a.concat(o,ei(o,[],s))}function df(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function V0(t){const a=xn(t);let s=parseFloat(a.width)||0,l=parseFloat(a.height)||0;const o=Oa(t),u=o?t.offsetWidth:s,d=o?t.offsetHeight:l,O=dc(s)!==u||dc(l)!==d;return O&&(s=u,l=d),{width:s,height:l,$:O}}function Vf(t){return pn(t)?t:t.contextElement}function Nl(t){const a=Vf(t);if(!Oa(a))return Tn(1);const s=a.getBoundingClientRect(),{width:l,height:o,$:u}=V0(a);let d=(u?dc(s.width):s.width)/l,O=(u?dc(s.height):s.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!O||!Number.isFinite(O))&&(O=1),{x:d,y:O}}const ek=Tn(0);function G0(t){const a=Wt(t);return!Uf()||!a.visualViewport?ek:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function tk(t,a,s){return a===void 0&&(a=!1),!s||a&&s!==Wt(t)?!1:a}function $s(t,a,s,l){a===void 0&&(a=!1),s===void 0&&(s=!1);const o=t.getBoundingClientRect(),u=Vf(t);let d=Tn(1);a&&(l?pn(l)&&(d=Nl(l)):d=Nl(t));const O=tk(u,s,l)?G0(u):Tn(0);let h=(o.left+O.x)/d.x,p=(o.top+O.y)/d.y,x=o.width/d.x,g=o.height/d.y;if(u){const b=Wt(u),y=l&&pn(l)?Wt(l):l;let Q=b,w=df(Q);for(;w&&l&&y!==Q;){const $=Nl(w),j=w.getBoundingClientRect(),z=xn(w),N=j.left+(w.clientLeft+parseFloat(z.paddingLeft))*$.x,_=j.top+(w.clientTop+parseFloat(z.paddingTop))*$.y;h*=$.x,p*=$.y,x*=$.x,g*=$.y,h+=N,p+=_,Q=Wt(w),w=df(Q)}}return fc({width:x,height:g,x:h,y:p})}function qc(t,a){const s=Ec(t).scrollLeft;return a?a.left+s:$s(Pn(t)).left+s}function L0(t,a){const s=t.getBoundingClientRect(),l=s.left+a.scrollLeft-qc(t,s),o=s.top+a.scrollTop;return{x:l,y:o}}function nk(t){let{elements:a,rect:s,offsetParent:l,strategy:o}=t;const u=o==="fixed",d=Pn(l),O=a?Ac(a.floating):!1;if(l===d||O&&u)return s;let h={scrollLeft:0,scrollTop:0},p=Tn(1);const x=Tn(0),g=Oa(l);if((g||!g&&!u)&&((Gl(l)!=="body"||fi(d))&&(h=Ec(l)),g)){const y=$s(l);p=Nl(l),x.x=y.x+l.clientLeft,x.y=y.y+l.clientTop}const b=d&&!g&&!u?L0(d,h):Tn(0);return{width:s.width*p.x,height:s.height*p.y,x:s.x*p.x-h.scrollLeft*p.x+x.x+b.x,y:s.y*p.y-h.scrollTop*p.y+x.y+b.y}}function ak(t){return Array.from(t.getClientRects())}function sk(t){const a=Pn(t),s=Ec(t),l=t.ownerDocument.body,o=Lt(a.scrollWidth,a.clientWidth,l.scrollWidth,l.clientWidth),u=Lt(a.scrollHeight,a.clientHeight,l.scrollHeight,l.clientHeight);let d=-s.scrollLeft+qc(t);const O=-s.scrollTop;return xn(l).direction==="rtl"&&(d+=Lt(a.clientWidth,l.clientWidth)-o),{width:o,height:u,x:d,y:O}}const Gg=25;function lk(t,a){const s=Wt(t),l=Pn(t),o=s.visualViewport;let u=l.clientWidth,d=l.clientHeight,O=0,h=0;if(o){u=o.width,d=o.height;const x=Uf();(!x||x&&a==="fixed")&&(O=o.offsetLeft,h=o.offsetTop)}const p=qc(l);if(p<=0){const x=l.ownerDocument,g=x.body,b=getComputedStyle(g),y=x.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,Q=Math.abs(l.clientWidth-g.clientWidth-y);Q<=Gg&&(u-=Q)}else p<=Gg&&(u+=p);return{width:u,height:d,x:O,y:h}}function rk(t,a){const s=$s(t,!0,a==="fixed"),l=s.top+t.clientTop,o=s.left+t.clientLeft,u=Oa(t)?Nl(t):Tn(1),d=t.clientWidth*u.x,O=t.clientHeight*u.y,h=o*u.x,p=l*u.y;return{width:d,height:O,x:h,y:p}}function Lg(t,a,s){let l;if(a==="viewport")l=lk(t,s);else if(a==="document")l=sk(Pn(t));else if(pn(a))l=rk(a,s);else{const o=G0(t);l={x:a.x-o.x,y:a.y-o.y,width:a.width,height:a.height}}return fc(l)}function D0(t,a){const s=Fa(t);return s===a||!pn(s)||_l(s)?!1:xn(s).position==="fixed"||D0(s,a)}function ik(t,a){const s=a.get(t);if(s)return s;let l=ei(t,[],!1).filter(O=>pn(O)&&Gl(O)!=="body"),o=null;const u=xn(t).position==="fixed";let d=u?Fa(t):t;for(;pn(d)&&!_l(d);){const O=xn(d),h=Yf(d);!h&&O.position==="fixed"&&(o=null),(u?!h&&!o:!h&&O.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||fi(d)&&!h&&D0(t,d))?l=l.filter(x=>x!==d):o=O,d=Fa(d)}return a.set(t,l),l}function ok(t){let{element:a,boundary:s,rootBoundary:l,strategy:o}=t;const d=[...s==="clippingAncestors"?Ac(a)?[]:ik(a,this._c):[].concat(s),l],O=Lg(a,d[0],o);let h=O.top,p=O.right,x=O.bottom,g=O.left;for(let b=1;b<d.length;b++){const y=Lg(a,d[b],o);h=Lt(y.top,h),p=Ia(y.right,p),x=Ia(y.bottom,x),g=Lt(y.left,g)}return{width:p-g,height:x-h,x:g,y:h}}function ck(t){const{width:a,height:s}=V0(t);return{width:a,height:s}}function uk(t,a,s){const l=Oa(a),o=Pn(a),u=s==="fixed",d=$s(t,!0,u,a);let O={scrollLeft:0,scrollTop:0};const h=Tn(0);function p(){h.x=qc(o)}if(l||!l&&!u)if((Gl(a)!=="body"||fi(o))&&(O=Ec(a)),l){const y=$s(a,!0,u,a);h.x=y.x+a.clientLeft,h.y=y.y+a.clientTop}else o&&p();u&&!l&&o&&p();const x=o&&!l&&!u?L0(o,O):Tn(0),g=d.left+O.scrollLeft-h.x-x.x,b=d.top+O.scrollTop-h.y-x.y;return{x:g,y:b,width:d.width,height:d.height}}function bO(t){return xn(t).position==="static"}function Dg(t,a){if(!Oa(t)||xn(t).position==="fixed")return null;if(a)return a(t);let s=t.offsetParent;return Pn(t)===s&&(s=s.ownerDocument.body),s}function W0(t,a){const s=Wt(t);if(Ac(t))return s;if(!Oa(t)){let o=Fa(t);for(;o&&!_l(o);){if(pn(o)&&!bO(o))return o;o=Fa(o)}return s}let l=Dg(t,a);for(;l&&Iw(l)&&bO(l);)l=Dg(l,a);return l&&_l(l)&&bO(l)&&!Yf(l)?s:l||Jw(t)||s}const dk=async function(t){const a=this.getOffsetParent||W0,s=this.getDimensions,l=await s(t.floating);return{reference:uk(t.reference,await a(t.floating),t.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function Ok(t){return xn(t).direction==="rtl"}const fk={convertOffsetParentRelativeRectToViewportRelativeRect:nk,getDocumentElement:Pn,getClippingRect:ok,getOffsetParent:W0,getElementRects:dk,getClientRects:ak,getDimensions:ck,getScale:Nl,isElement:pn,isRTL:Ok};function B0(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height}function hk(t,a){let s=null,l;const o=Pn(t);function u(){var O;clearTimeout(l),(O=s)==null||O.disconnect(),s=null}function d(O,h){O===void 0&&(O=!1),h===void 0&&(h=1),u();const p=t.getBoundingClientRect(),{left:x,top:g,width:b,height:y}=p;if(O||a(),!b||!y)return;const Q=Mo(g),w=Mo(o.clientWidth-(x+b)),$=Mo(o.clientHeight-(g+y)),j=Mo(x),N={rootMargin:-Q+"px "+-w+"px "+-$+"px "+-j+"px",threshold:Lt(0,Ia(1,h))||1};let _=!0;function G(R){const X=R[0].intersectionRatio;if(X!==h){if(!_)return d();X?d(!1,X):l=setTimeout(()=>{d(!1,1e-7)},1e3)}X===1&&!B0(p,t.getBoundingClientRect())&&d(),_=!1}try{s=new IntersectionObserver(G,{...N,root:o.ownerDocument})}catch{s=new IntersectionObserver(G,N)}s.observe(t)}return d(!0),u}function mk(t,a,s,l){l===void 0&&(l={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:O=typeof IntersectionObserver=="function",animationFrame:h=!1}=l,p=Vf(t),x=o||u?[...p?ei(p):[],...a?ei(a):[]]:[];x.forEach(j=>{o&&j.addEventListener("scroll",s,{passive:!0}),u&&j.addEventListener("resize",s)});const g=p&&O?hk(p,s):null;let b=-1,y=null;d&&(y=new ResizeObserver(j=>{let[z]=j;z&&z.target===p&&y&&a&&(y.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(a)})),s()}),p&&!h&&y.observe(p),a&&y.observe(a));let Q,w=h?$s(t):null;h&&$();function $(){const j=$s(t);w&&!B0(w,j)&&s(),w=j,Q=requestAnimationFrame($)}return s(),()=>{var j;x.forEach(z=>{o&&z.removeEventListener("scroll",s),u&&z.removeEventListener("resize",s)}),g==null||g(),(j=y)==null||j.disconnect(),y=null,h&&cancelAnimationFrame(Q)}}const pk=Dw,xk=Ww,gk=Vw,bk=Hw,vk=Gw,Wg=Uw,yk=Bw,Sk=(t,a,s)=>{const l=new Map,o={platform:fk,...s},u={...o.platform,_c:l};return Yw(t,a,{...o,platform:u})};var Qk=typeof document<"u",jk=function(){},nc=Qk?v.useLayoutEffect:jk;function hc(t,a){if(t===a)return!0;if(typeof t!=typeof a)return!1;if(typeof t=="function"&&t.toString()===a.toString())return!0;let s,l,o;if(t&&a&&typeof t=="object"){if(Array.isArray(t)){if(s=t.length,s!==a.length)return!1;for(l=s;l--!==0;)if(!hc(t[l],a[l]))return!1;return!0}if(o=Object.keys(t),s=o.length,s!==Object.keys(a).length)return!1;for(l=s;l--!==0;)if(!{}.hasOwnProperty.call(a,o[l]))return!1;for(l=s;l--!==0;){const u=o[l];if(!(u==="_owner"&&t.$$typeof)&&!hc(t[u],a[u]))return!1}return!0}return t!==t&&a!==a}function H0(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Bg(t,a){const s=H0(t);return Math.round(a*s)/s}function vO(t){const a=v.useRef(t);return nc(()=>{a.current=t}),a}function wk(t){t===void 0&&(t={});const{placement:a="bottom",strategy:s="absolute",middleware:l=[],platform:o,elements:{reference:u,floating:d}={},transform:O=!0,whileElementsMounted:h,open:p}=t,[x,g]=v.useState({x:0,y:0,strategy:s,placement:a,middlewareData:{},isPositioned:!1}),[b,y]=v.useState(l);hc(b,l)||y(l);const[Q,w]=v.useState(null),[$,j]=v.useState(null),z=v.useCallback(E=>{E!==R.current&&(R.current=E,w(E))},[]),N=v.useCallback(E=>{E!==X.current&&(X.current=E,j(E))},[]),_=u||Q,G=d||$,R=v.useRef(null),X=v.useRef(null),T=v.useRef(x),V=h!=null,M=vO(h),ae=vO(o),F=vO(p),se=v.useCallback(()=>{if(!R.current||!X.current)return;const E={placement:a,strategy:s,middleware:b};ae.current&&(E.platform=ae.current),Sk(R.current,X.current,E).then(ce=>{const ee={...ce,isPositioned:F.current!==!1};oe.current&&!hc(T.current,ee)&&(T.current=ee,$0.flushSync(()=>{g(ee)}))})},[b,a,s,ae,F]);nc(()=>{p===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,g(E=>({...E,isPositioned:!1})))},[p]);const oe=v.useRef(!1);nc(()=>(oe.current=!0,()=>{oe.current=!1}),[]),nc(()=>{if(_&&(R.current=_),G&&(X.current=G),_&&G){if(M.current)return M.current(_,G,se);se()}},[_,G,se,M,V]);const H=v.useMemo(()=>({reference:R,floating:X,setReference:z,setFloating:N}),[z,N]),P=v.useMemo(()=>({reference:_,floating:G}),[_,G]),W=v.useMemo(()=>{const E={position:s,left:0,top:0};if(!P.floating)return E;const ce=Bg(P.floating,x.x),ee=Bg(P.floating,x.y);return O?{...E,transform:"translate("+ce+"px, "+ee+"px)",...H0(P.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ce,top:ee}},[s,O,P.floating,x.x,x.y]);return v.useMemo(()=>({...x,update:se,refs:H,elements:P,floatingStyles:W}),[x,se,H,P,W])}const kk=t=>{function a(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:t,fn(s){const{element:l,padding:o}=typeof t=="function"?t(s):t;return l&&a(l)?l.current!=null?Wg({element:l.current,padding:o}).fn(s):{}:l?Wg({element:l,padding:o}).fn(s):{}}}},$k=(t,a)=>{const s=pk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Tk=(t,a)=>{const s=xk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Nk=(t,a)=>({fn:yk(t).fn,options:[t,a]}),Pk=(t,a)=>{const s=gk(t);return{name:s.name,fn:s.fn,options:[t,a]}},zk=(t,a)=>{const s=bk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Rk=(t,a)=>{const s=vk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Ck=(t,a)=>{const s=kk(t);return{name:s.name,fn:s.fn,options:[t,a]}};var Xk="Arrow",I0=v.forwardRef((t,a)=>{const{children:s,width:l=10,height:o=5,...u}=t;return r.jsx(Be.svg,{...u,ref:a,width:l,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?s:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});I0.displayName=Xk;var _k=I0;function Zk(t){const[a,s]=v.useState(void 0);return ra(()=>{if(t){s({width:t.offsetWidth,height:t.offsetHeight});const l=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let d,O;if("borderBoxSize"in u){const h=u.borderBoxSize,p=Array.isArray(h)?h[0]:h;d=p.inlineSize,O=p.blockSize}else d=t.offsetWidth,O=t.offsetHeight;s({width:d,height:O})});return l.observe(t,{box:"border-box"}),()=>l.unobserve(t)}else s(void 0)},[t]),a}var Gf="Popper",[F0,K0]=Xs(Gf),[Ak,J0]=F0(Gf),eb=t=>{const{__scopePopper:a,children:s}=t,[l,o]=v.useState(null);return r.jsx(Ak,{scope:a,anchor:l,onAnchorChange:o,children:s})};eb.displayName=Gf;var tb="PopperAnchor",nb=v.forwardRef((t,a)=>{const{__scopePopper:s,virtualRef:l,...o}=t,u=J0(tb,s),d=v.useRef(null),O=it(a,d),h=v.useRef(null);return v.useEffect(()=>{const p=h.current;h.current=(l==null?void 0:l.current)||d.current,p!==h.current&&u.onAnchorChange(h.current)}),l?null:r.jsx(Be.div,{...o,ref:O})});nb.displayName=tb;var Lf="PopperContent",[Ek,qk]=F0(Lf),ab=v.forwardRef((t,a)=>{var Ce,Ot,Ae,He,bt,un;const{__scopePopper:s,side:l="bottom",sideOffset:o=0,align:u="center",alignOffset:d=0,arrowPadding:O=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:x=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:y="optimized",onPlaced:Q,...w}=t,$=J0(Lf,s),[j,z]=v.useState(null),N=it(a,Bt=>z(Bt)),[_,G]=v.useState(null),R=Zk(_),X=(R==null?void 0:R.width)??0,T=(R==null?void 0:R.height)??0,V=l+(u!=="center"?"-"+u:""),M=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ae=Array.isArray(p)?p:[p],F=ae.length>0,se={padding:M,boundary:ae.filter(Yk),altBoundary:F},{refs:oe,floatingStyles:H,placement:P,isPositioned:W,middlewareData:E}=wk({strategy:"fixed",placement:V,whileElementsMounted:(...Bt)=>mk(...Bt,{animationFrame:y==="always"}),elements:{reference:$.anchor},middleware:[$k({mainAxis:o+T,alignmentAxis:d}),h&&Tk({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Nk():void 0,...se}),h&&Pk({...se}),zk({...se,apply:({elements:Bt,rects:yt,availableWidth:Hl,availableHeight:Il})=>{const{width:eu,height:yi}=yt.reference,ha=Bt.floating.style;ha.setProperty("--radix-popper-available-width",`${Hl}px`),ha.setProperty("--radix-popper-available-height",`${Il}px`),ha.setProperty("--radix-popper-anchor-width",`${eu}px`),ha.setProperty("--radix-popper-anchor-height",`${yi}px`)}}),_&&Ck({element:_,padding:O}),Uk({arrowWidth:X,arrowHeight:T}),b&&Rk({strategy:"referenceHidden",...se})]}),[ce,ee]=rb(P),be=zt(Q);ra(()=>{W&&(be==null||be())},[W,be]);const Se=(Ce=E.arrow)==null?void 0:Ce.x,ye=(Ot=E.arrow)==null?void 0:Ot.y,Re=((Ae=E.arrow)==null?void 0:Ae.centerOffset)!==0,[B,ue]=v.useState();return ra(()=>{j&&ue(window.getComputedStyle(j).zIndex)},[j]),r.jsx("div",{ref:oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:W?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[(He=E.transformOrigin)==null?void 0:He.x,(bt=E.transformOrigin)==null?void 0:bt.y].join(" "),...((un=E.hide)==null?void 0:un.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:r.jsx(Ek,{scope:s,placedSide:ce,onArrowChange:G,arrowX:Se,arrowY:ye,shouldHideArrow:Re,children:r.jsx(Be.div,{"data-side":ce,"data-align":ee,...w,ref:N,style:{...w.style,animation:W?void 0:"none"}})})})});ab.displayName=Lf;var sb="PopperArrow",Mk={top:"bottom",right:"left",bottom:"top",left:"right"},lb=v.forwardRef(function(a,s){const{__scopePopper:l,...o}=a,u=qk(sb,l),d=Mk[u.placedSide];return r.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:r.jsx(_k,{...o,ref:s,style:{...o.style,display:"block"}})})});lb.displayName=sb;function Yk(t){return t!==null}var Uk=t=>({name:"transformOrigin",options:t,fn(a){var $,j,z;const{placement:s,rects:l,middlewareData:o}=a,d=(($=o.arrow)==null?void 0:$.centerOffset)!==0,O=d?0:t.arrowWidth,h=d?0:t.arrowHeight,[p,x]=rb(s),g={start:"0%",center:"50%",end:"100%"}[x],b=(((j=o.arrow)==null?void 0:j.x)??0)+O/2,y=(((z=o.arrow)==null?void 0:z.y)??0)+h/2;let Q="",w="";return p==="bottom"?(Q=d?g:`${b}px`,w=`${-h}px`):p==="top"?(Q=d?g:`${b}px`,w=`${l.floating.height+h}px`):p==="right"?(Q=`${-h}px`,w=d?g:`${y}px`):p==="left"&&(Q=`${l.floating.width+h}px`,w=d?g:`${y}px`),{data:{x:Q,y:w}}}});function rb(t){const[a,s="center"]=t.split("-");return[a,s]}var Vk=eb,Gk=nb,Lk=ab,Dk=lb,Wk="Portal",Df=v.forwardRef((t,a)=>{var O;const{container:s,...l}=t,[o,u]=v.useState(!1);ra(()=>u(!0),[]);const d=s||o&&((O=globalThis==null?void 0:globalThis.document)==null?void 0:O.body);return d?Sj.createPortal(r.jsx(Be.div,{...l,ref:a}),d):null});Df.displayName=Wk;function Bk(t,a){return v.useReducer((s,l)=>a[s][l]??s,t)}var bn=t=>{const{present:a,children:s}=t,l=Hk(a),o=typeof s=="function"?s({present:l.isPresent}):v.Children.only(s),u=it(l.ref,Ik(o));return typeof s=="function"||l.isPresent?v.cloneElement(o,{ref:u}):null};bn.displayName="Presence";function Hk(t){const[a,s]=v.useState(),l=v.useRef(null),o=v.useRef(t),u=v.useRef("none"),d=t?"mounted":"unmounted",[O,h]=Bk(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const p=Yo(l.current);u.current=O==="mounted"?p:"none"},[O]),ra(()=>{const p=l.current,x=o.current;if(x!==t){const b=u.current,y=Yo(p);t?h("MOUNT"):y==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(x&&b!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,h]),ra(()=>{if(a){let p;const x=a.ownerDocument.defaultView??window,g=y=>{const w=Yo(l.current).includes(CSS.escape(y.animationName));if(y.target===a&&w&&(h("ANIMATION_END"),!o.current)){const $=a.style.animationFillMode;a.style.animationFillMode="forwards",p=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=$)})}},b=y=>{y.target===a&&(u.current=Yo(l.current))};return a.addEventListener("animationstart",b),a.addEventListener("animationcancel",g),a.addEventListener("animationend",g),()=>{x.clearTimeout(p),a.removeEventListener("animationstart",b),a.removeEventListener("animationcancel",g),a.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[a,h]),{isPresent:["mounted","unmountSuspended"].includes(O),ref:v.useCallback(p=>{l.current=p?getComputedStyle(p):null,s(p)},[])}}function Yo(t){return(t==null?void 0:t.animationName)||"none"}function Ik(t){var l,o;let a=(l=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:l.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?t.ref:(a=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?t.props.ref:t.props.ref||t.ref)}var Fk=k0[" useInsertionEffect ".trim().toString()]||ra;function Mc({prop:t,defaultProp:a,onChange:s=()=>{},caller:l}){const[o,u,d]=Kk({defaultProp:a,onChange:s}),O=t!==void 0,h=O?t:o;{const x=v.useRef(t!==void 0);v.useEffect(()=>{const g=x.current;g!==O&&console.warn(`${l} is changing from ${g?"controlled":"uncontrolled"} to ${O?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=O},[O,l])}const p=v.useCallback(x=>{var g;if(O){const b=Jk(x)?x(t):x;b!==t&&((g=d.current)==null||g.call(d,b))}else u(x)},[O,t,u,d]);return[h,p]}function Kk({defaultProp:t,onChange:a}){const[s,l]=v.useState(t),o=v.useRef(s),u=v.useRef(a);return Fk(()=>{u.current=a},[a]),v.useEffect(()=>{var d;o.current!==s&&((d=u.current)==null||d.call(u,s),o.current=s)},[s,o]),[s,l,u]}function Jk(t){return typeof t=="function"}var e$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),t$="VisuallyHidden",ib=v.forwardRef((t,a)=>r.jsx(Be.span,{...t,ref:a,style:{...e$,...t.style}}));ib.displayName=t$;var n$=ib,[Yc]=Xs("Tooltip",[K0]),Uc=K0(),ob="TooltipProvider",a$=700,Of="tooltip.open",[s$,Wf]=Yc(ob),cb=t=>{const{__scopeTooltip:a,delayDuration:s=a$,skipDelayDuration:l=300,disableHoverableContent:o=!1,children:u}=t,d=v.useRef(!0),O=v.useRef(!1),h=v.useRef(0);return v.useEffect(()=>{const p=h.current;return()=>window.clearTimeout(p)},[]),r.jsx(s$,{scope:a,isOpenDelayedRef:d,delayDuration:s,onOpen:v.useCallback(()=>{window.clearTimeout(h.current),d.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>d.current=!0,l)},[l]),isPointerInTransitRef:O,onPointerInTransitChange:v.useCallback(p=>{O.current=p},[]),disableHoverableContent:o,children:u})};cb.displayName=ob;var ti="Tooltip",[l$,hi]=Yc(ti),ub=t=>{const{__scopeTooltip:a,children:s,open:l,defaultOpen:o,onOpenChange:u,disableHoverableContent:d,delayDuration:O}=t,h=Wf(ti,t.__scopeTooltip),p=Uc(a),[x,g]=v.useState(null),b=Tl(),y=v.useRef(0),Q=d??h.disableHoverableContent,w=O??h.delayDuration,$=v.useRef(!1),[j,z]=Mc({prop:l,defaultProp:o??!1,onChange:X=>{X?(h.onOpen(),document.dispatchEvent(new CustomEvent(Of))):h.onClose(),u==null||u(X)},caller:ti}),N=v.useMemo(()=>j?$.current?"delayed-open":"instant-open":"closed",[j]),_=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,$.current=!1,z(!0)},[z]),G=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,z(!1)},[z]),R=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{$.current=!0,z(!0),y.current=0},w)},[w,z]);return v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),r.jsx(Vk,{...p,children:r.jsx(l$,{scope:a,contentId:b,open:j,stateAttribute:N,trigger:x,onTriggerChange:g,onTriggerEnter:v.useCallback(()=>{h.isOpenDelayedRef.current?R():_()},[h.isOpenDelayedRef,R,_]),onTriggerLeave:v.useCallback(()=>{Q?G():(window.clearTimeout(y.current),y.current=0)},[G,Q]),onOpen:_,onClose:G,disableHoverableContent:Q,children:s})})};ub.displayName=ti;var ff="TooltipTrigger",db=v.forwardRef((t,a)=>{const{__scopeTooltip:s,...l}=t,o=hi(ff,s),u=Wf(ff,s),d=Uc(s),O=v.useRef(null),h=it(a,O,o.onTriggerChange),p=v.useRef(!1),x=v.useRef(!1),g=v.useCallback(()=>p.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),r.jsx(Gk,{asChild:!0,...d,children:r.jsx(Be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...l,ref:h,onPointerMove:qe(t.onPointerMove,b=>{b.pointerType!=="touch"&&!x.current&&!u.isPointerInTransitRef.current&&(o.onTriggerEnter(),x.current=!0)}),onPointerLeave:qe(t.onPointerLeave,()=>{o.onTriggerLeave(),x.current=!1}),onPointerDown:qe(t.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:qe(t.onFocus,()=>{p.current||o.onOpen()}),onBlur:qe(t.onBlur,o.onClose),onClick:qe(t.onClick,o.onClose)})})});db.displayName=ff;var Bf="TooltipPortal",[r$,i$]=Yc(Bf,{forceMount:void 0}),Ob=t=>{const{__scopeTooltip:a,forceMount:s,children:l,container:o}=t,u=hi(Bf,a);return r.jsx(r$,{scope:a,forceMount:s,children:r.jsx(bn,{present:s||u.open,children:r.jsx(Df,{asChild:!0,container:o,children:l})})})};Ob.displayName=Bf;var Zl="TooltipContent",fb=v.forwardRef((t,a)=>{const s=i$(Zl,t.__scopeTooltip),{forceMount:l=s.forceMount,side:o="top",...u}=t,d=hi(Zl,t.__scopeTooltip);return r.jsx(bn,{present:l||d.open,children:d.disableHoverableContent?r.jsx(hb,{side:o,...u,ref:a}):r.jsx(o$,{side:o,...u,ref:a})})}),o$=v.forwardRef((t,a)=>{const s=hi(Zl,t.__scopeTooltip),l=Wf(Zl,t.__scopeTooltip),o=v.useRef(null),u=it(a,o),[d,O]=v.useState(null),{trigger:h,onClose:p}=s,x=o.current,{onPointerInTransitChange:g}=l,b=v.useCallback(()=>{O(null),g(!1)},[g]),y=v.useCallback((Q,w)=>{const $=Q.currentTarget,j={x:Q.clientX,y:Q.clientY},z=O$(j,$.getBoundingClientRect()),N=f$(j,z),_=h$(w.getBoundingClientRect()),G=p$([...N,..._]);O(G),g(!0)},[g]);return v.useEffect(()=>()=>b(),[b]),v.useEffect(()=>{if(h&&x){const Q=$=>y($,x),w=$=>y($,h);return h.addEventListener("pointerleave",Q),x.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",Q),x.removeEventListener("pointerleave",w)}}},[h,x,y,b]),v.useEffect(()=>{if(d){const Q=w=>{const $=w.target,j={x:w.clientX,y:w.clientY},z=(h==null?void 0:h.contains($))||(x==null?void 0:x.contains($)),N=!m$(j,d);z?b():N&&(b(),p())};return document.addEventListener("pointermove",Q),()=>document.removeEventListener("pointermove",Q)}},[h,x,d,p,b]),r.jsx(hb,{...t,ref:u})}),[c$,u$]=Yc(ti,{isInside:!1}),d$=hw("TooltipContent"),hb=v.forwardRef((t,a)=>{const{__scopeTooltip:s,children:l,"aria-label":o,onEscapeKeyDown:u,onPointerDownOutside:d,...O}=t,h=hi(Zl,s),p=Uc(s),{onClose:x}=h;return v.useEffect(()=>(document.addEventListener(Of,x),()=>document.removeEventListener(Of,x)),[x]),v.useEffect(()=>{if(h.trigger){const g=b=>{const y=b.target;y!=null&&y.contains(h.trigger)&&x()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,x]),r.jsx(Af,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g=>g.preventDefault(),onDismiss:x,children:r.jsxs(Lk,{"data-state":h.stateAttribute,...p,...O,ref:a,style:{...O.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(d$,{children:l}),r.jsx(c$,{scope:s,isInside:!0,children:r.jsx(n$,{id:h.contentId,role:"tooltip",children:o||l})})]})})});fb.displayName=Zl;var mb="TooltipArrow",pb=v.forwardRef((t,a)=>{const{__scopeTooltip:s,...l}=t,o=Uc(s);return u$(mb,s).isInside?null:r.jsx(Dk,{...o,...l,ref:a})});pb.displayName=mb;function O$(t,a){const s=Math.abs(a.top-t.y),l=Math.abs(a.bottom-t.y),o=Math.abs(a.right-t.x),u=Math.abs(a.left-t.x);switch(Math.min(s,l,o,u)){case u:return"left";case o:return"right";case s:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function f$(t,a,s=5){const l=[];switch(a){case"top":l.push({x:t.x-s,y:t.y+s},{x:t.x+s,y:t.y+s});break;case"bottom":l.push({x:t.x-s,y:t.y-s},{x:t.x+s,y:t.y-s});break;case"left":l.push({x:t.x+s,y:t.y-s},{x:t.x+s,y:t.y+s});break;case"right":l.push({x:t.x-s,y:t.y-s},{x:t.x-s,y:t.y+s});break}return l}function h$(t){const{top:a,right:s,bottom:l,left:o}=t;return[{x:o,y:a},{x:s,y:a},{x:s,y:l},{x:o,y:l}]}function m$(t,a){const{x:s,y:l}=t;let o=!1;for(let u=0,d=a.length-1;u<a.length;d=u++){const O=a[u],h=a[d],p=O.x,x=O.y,g=h.x,b=h.y;x>l!=b>l&&s<(g-p)*(l-x)/(b-x)+p&&(o=!o)}return o}function p$(t){const a=t.slice();return a.sort((s,l)=>s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0),x$(a)}function x$(t){if(t.length<=1)return t.slice();const a=[];for(let l=0;l<t.length;l++){const o=t[l];for(;a.length>=2;){const u=a[a.length-1],d=a[a.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))a.pop();else break}a.push(o)}a.pop();const s=[];for(let l=t.length-1;l>=0;l--){const o=t[l];for(;s.length>=2;){const u=s[s.length-1],d=s[s.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))s.pop();else break}s.push(o)}return s.pop(),a.length===1&&s.length===1&&a[0].x===s[0].x&&a[0].y===s[0].y?a:a.concat(s)}var g$=cb,b$=ub,v$=db,y$=Ob,S$=fb,Q$=pb;function xb(t){var a,s,l="";if(typeof t=="string"||typeof t=="number")l+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(a=0;a<o;a++)t[a]&&(s=xb(t[a]))&&(l&&(l+=" "),l+=s)}else for(s in t)t[s]&&(l&&(l+=" "),l+=s);return l}function j$(){for(var t,a,s=0,l="",o=arguments.length;s<o;s++)(t=arguments[s])&&(a=xb(t))&&(l&&(l+=" "),l+=a);return l}const w$=(t,a)=>{const s=new Array(t.length+a.length);for(let l=0;l<t.length;l++)s[l]=t[l];for(let l=0;l<a.length;l++)s[t.length+l]=a[l];return s},k$=(t,a)=>({classGroupId:t,validator:a}),gb=(t=new Map,a=null,s)=>({nextPart:t,validators:a,classGroupId:s}),mc="-",Hg=[],$$="arbitrary..",T$=t=>{const a=P$(t),{conflictingClassGroups:s,conflictingClassGroupModifiers:l}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return N$(d);const O=d.split(mc),h=O[0]===""&&O.length>1?1:0;return bb(O,h,a)},getConflictingClassGroupIds:(d,O)=>{if(O){const h=l[d],p=s[d];return h?p?w$(p,h):h:p||Hg}return s[d]||Hg}}},bb=(t,a,s)=>{if(t.length-a===0)return s.classGroupId;const o=t[a],u=s.nextPart.get(o);if(u){const p=bb(t,a+1,u);if(p)return p}const d=s.validators;if(d===null)return;const O=a===0?t.join(mc):t.slice(a).join(mc),h=d.length;for(let p=0;p<h;p++){const x=d[p];if(x.validator(O))return x.classGroupId}},N$=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=t.slice(1,-1),s=a.indexOf(":"),l=a.slice(0,s);return l?$$+l:void 0})(),P$=t=>{const{theme:a,classGroups:s}=t;return z$(s,a)},z$=(t,a)=>{const s=gb();for(const l in t){const o=t[l];Hf(o,s,l,a)}return s},Hf=(t,a,s,l)=>{const o=t.length;for(let u=0;u<o;u++){const d=t[u];R$(d,a,s,l)}},R$=(t,a,s,l)=>{if(typeof t=="string"){C$(t,a,s);return}if(typeof t=="function"){X$(t,a,s,l);return}_$(t,a,s,l)},C$=(t,a,s)=>{const l=t===""?a:vb(a,t);l.classGroupId=s},X$=(t,a,s,l)=>{if(Z$(t)){Hf(t(l),a,s,l);return}a.validators===null&&(a.validators=[]),a.validators.push(k$(s,t))},_$=(t,a,s,l)=>{const o=Object.entries(t),u=o.length;for(let d=0;d<u;d++){const[O,h]=o[d];Hf(h,vb(a,O),s,l)}},vb=(t,a)=>{let s=t;const l=a.split(mc),o=l.length;for(let u=0;u<o;u++){const d=l[u];let O=s.nextPart.get(d);O||(O=gb(),s.nextPart.set(d,O)),s=O}return s},Z$=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,A$=t=>{if(t<1)return{get:()=>{},set:()=>{}};let a=0,s=Object.create(null),l=Object.create(null);const o=(u,d)=>{s[u]=d,a++,a>t&&(a=0,l=s,s=Object.create(null))};return{get(u){let d=s[u];if(d!==void 0)return d;if((d=l[u])!==void 0)return o(u,d),d},set(u,d){u in s?s[u]=d:o(u,d)}}},hf="!",Ig=":",E$=[],Fg=(t,a,s,l,o)=>({modifiers:t,hasImportantModifier:a,baseClassName:s,maybePostfixModifierPosition:l,isExternal:o}),q$=t=>{const{prefix:a,experimentalParseClassName:s}=t;let l=o=>{const u=[];let d=0,O=0,h=0,p;const x=o.length;for(let w=0;w<x;w++){const $=o[w];if(d===0&&O===0){if($===Ig){u.push(o.slice(h,w)),h=w+1;continue}if($==="/"){p=w;continue}}$==="["?d++:$==="]"?d--:$==="("?O++:$===")"&&O--}const g=u.length===0?o:o.slice(h);let b=g,y=!1;g.endsWith(hf)?(b=g.slice(0,-1),y=!0):g.startsWith(hf)&&(b=g.slice(1),y=!0);const Q=p&&p>h?p-h:void 0;return Fg(u,y,b,Q)};if(a){const o=a+Ig,u=l;l=d=>d.startsWith(o)?u(d.slice(o.length)):Fg(E$,!1,d,void 0,!0)}if(s){const o=l;l=u=>s({className:u,parseClassName:o})}return l},M$=t=>{const a=new Map;return t.orderSensitiveModifiers.forEach((s,l)=>{a.set(s,1e6+l)}),s=>{const l=[];let o=[];for(let u=0;u<s.length;u++){const d=s[u],O=d[0]==="[",h=a.has(d);O||h?(o.length>0&&(o.sort(),l.push(...o),o=[]),l.push(d)):o.push(d)}return o.length>0&&(o.sort(),l.push(...o)),l}},Y$=t=>({cache:A$(t.cacheSize),parseClassName:q$(t),sortModifiers:M$(t),...T$(t)}),U$=/\s+/,V$=(t,a)=>{const{parseClassName:s,getClassGroupId:l,getConflictingClassGroupIds:o,sortModifiers:u}=a,d=[],O=t.trim().split(U$);let h="";for(let p=O.length-1;p>=0;p-=1){const x=O[p],{isExternal:g,modifiers:b,hasImportantModifier:y,baseClassName:Q,maybePostfixModifierPosition:w}=s(x);if(g){h=x+(h.length>0?" "+h:h);continue}let $=!!w,j=l($?Q.substring(0,w):Q);if(!j){if(!$){h=x+(h.length>0?" "+h:h);continue}if(j=l(Q),!j){h=x+(h.length>0?" "+h:h);continue}$=!1}const z=b.length===0?"":b.length===1?b[0]:u(b).join(":"),N=y?z+hf:z,_=N+j;if(d.indexOf(_)>-1)continue;d.push(_);const G=o(j,$);for(let R=0;R<G.length;++R){const X=G[R];d.push(N+X)}h=x+(h.length>0?" "+h:h)}return h},G$=(...t)=>{let a=0,s,l,o="";for(;a<t.length;)(s=t[a++])&&(l=yb(s))&&(o&&(o+=" "),o+=l);return o},yb=t=>{if(typeof t=="string")return t;let a,s="";for(let l=0;l<t.length;l++)t[l]&&(a=yb(t[l]))&&(s&&(s+=" "),s+=a);return s},L$=(t,...a)=>{let s,l,o,u;const d=h=>{const p=a.reduce((x,g)=>g(x),t());return s=Y$(p),l=s.cache.get,o=s.cache.set,u=O,O(h)},O=h=>{const p=l(h);if(p)return p;const x=V$(h,s);return o(h,x),x};return u=d,(...h)=>u(G$(...h))},D$=[],ct=t=>{const a=s=>s[t]||D$;return a.isThemeGetter=!0,a},Sb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,W$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,B$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,H$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,I$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,K$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=t=>W$.test(t),we=t=>!!t&&!Number.isNaN(Number(t)),Ya=t=>!!t&&Number.isInteger(Number(t)),yO=t=>t.endsWith("%")&&we(t.slice(0,-1)),Kn=t=>B$.test(t),jb=()=>!0,J$=t=>H$.test(t)&&!I$.test(t),If=()=>!1,e5=t=>F$.test(t),t5=t=>K$.test(t),n5=t=>!Oe(t)&&!fe(t),a5=t=>ts(t,$b,If),Oe=t=>Sb.test(t),Qs=t=>ts(t,Tb,J$),Kg=t=>ts(t,d5,we),s5=t=>ts(t,Pb,jb),l5=t=>ts(t,Nb,If),Jg=t=>ts(t,wb,If),r5=t=>ts(t,kb,t5),Uo=t=>ts(t,zb,e5),fe=t=>Qb.test(t),Lr=t=>_s(t,Tb),i5=t=>_s(t,Nb),e1=t=>_s(t,wb),o5=t=>_s(t,$b),c5=t=>_s(t,kb),Vo=t=>_s(t,zb,!0),u5=t=>_s(t,Pb,!0),ts=(t,a,s)=>{const l=Sb.exec(t);return l?l[1]?a(l[1]):s(l[2]):!1},_s=(t,a,s=!1)=>{const l=Qb.exec(t);return l?l[1]?a(l[1]):s:!1},wb=t=>t==="position"||t==="percentage",kb=t=>t==="image"||t==="url",$b=t=>t==="length"||t==="size"||t==="bg-size",Tb=t=>t==="length",d5=t=>t==="number",Nb=t=>t==="family-name",Pb=t=>t==="number"||t==="weight",zb=t=>t==="shadow",O5=()=>{const t=ct("color"),a=ct("font"),s=ct("text"),l=ct("font-weight"),o=ct("tracking"),u=ct("leading"),d=ct("breakpoint"),O=ct("container"),h=ct("spacing"),p=ct("radius"),x=ct("shadow"),g=ct("inset-shadow"),b=ct("text-shadow"),y=ct("drop-shadow"),Q=ct("blur"),w=ct("perspective"),$=ct("aspect"),j=ct("ease"),z=ct("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[..._(),fe,Oe],R=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto","contain","none"],T=()=>[fe,Oe,h],V=()=>[Ma,"full","auto",...T()],M=()=>[Ya,"none","subgrid",fe,Oe],ae=()=>["auto",{span:["full",Ya,fe,Oe]},Ya,fe,Oe],F=()=>[Ya,"auto",fe,Oe],se=()=>["auto","min","max","fr",fe,Oe],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...T()],W=()=>[Ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],E=()=>[Ma,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ce=()=>[Ma,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],ee=()=>[t,fe,Oe],be=()=>[..._(),e1,Jg,{position:[fe,Oe]}],Se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ye=()=>["auto","cover","contain",o5,a5,{size:[fe,Oe]}],Re=()=>[yO,Lr,Qs],B=()=>["","none","full",p,fe,Oe],ue=()=>["",we,Lr,Qs],Ce=()=>["solid","dashed","dotted","double"],Ot=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ae=()=>[we,yO,e1,Jg],He=()=>["","none",Q,fe,Oe],bt=()=>["none",we,fe,Oe],un=()=>["none",we,fe,Oe],Bt=()=>[we,fe,Oe],yt=()=>[Ma,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[jb],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[n5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",we],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ma,Oe,fe,$]}],container:["container"],columns:[{columns:[we,Oe,fe,O]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Ya,"auto",fe,Oe]}],basis:[{basis:[Ma,"full","auto",O,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,Ma,"auto","initial","none",Oe]}],grow:[{grow:["",we,fe,Oe]}],shrink:[{shrink:["",we,fe,Oe]}],order:[{order:[Ya,"first","last","none",fe,Oe]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...E()]}],"min-inline-size":[{"min-inline":["auto",...E()]}],"max-inline-size":[{"max-inline":["none",...E()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[O,"screen",...W()]}],"min-w":[{"min-w":[O,"screen","none",...W()]}],"max-w":[{"max-w":[O,"screen","none","prose",{screen:[d]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",s,Lr,Qs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,u5,s5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yO,Oe]}],"font-family":[{font:[i5,l5,a]}],"font-features":[{"font-features":[Oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,fe,Oe]}],"line-clamp":[{"line-clamp":[we,"none",fe,Kg]}],leading:[{leading:[u,...T()]}],"list-image":[{"list-image":["none",fe,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",fe,Qs]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[we,"auto",fe,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:be()}],"bg-repeat":[{bg:Se()}],"bg-size":[{bg:ye()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ya,fe,Oe],radial:["",fe,Oe],conic:[Ya,fe,Oe]},c5,r5]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,fe,Oe]}],"outline-w":[{outline:["",we,Lr,Qs]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",x,Vo,Uo]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",g,Vo,Uo]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[we,Qs]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",b,Vo,Uo]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[we,fe,Oe]}],"mix-blend":[{"mix-blend":[...Ot(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ot()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ae()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":Ae()}],"mask-image-t-to-pos":[{"mask-t-to":Ae()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":Ae()}],"mask-image-r-to-pos":[{"mask-r-to":Ae()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":Ae()}],"mask-image-b-to-pos":[{"mask-b-to":Ae()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":Ae()}],"mask-image-l-to-pos":[{"mask-l-to":Ae()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":Ae()}],"mask-image-x-to-pos":[{"mask-x-to":Ae()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":Ae()}],"mask-image-y-to-pos":[{"mask-y-to":Ae()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[fe,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ae()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ae()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:be()}],"mask-repeat":[{mask:Se()}],"mask-size":[{mask:ye()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,Oe]}],filter:[{filter:["","none",fe,Oe]}],blur:[{blur:He()}],brightness:[{brightness:[we,fe,Oe]}],contrast:[{contrast:[we,fe,Oe]}],"drop-shadow":[{"drop-shadow":["","none",y,Vo,Uo]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",we,fe,Oe]}],"hue-rotate":[{"hue-rotate":[we,fe,Oe]}],invert:[{invert:["",we,fe,Oe]}],saturate:[{saturate:[we,fe,Oe]}],sepia:[{sepia:["",we,fe,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,Oe]}],"backdrop-blur":[{"backdrop-blur":He()}],"backdrop-brightness":[{"backdrop-brightness":[we,fe,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[we,fe,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,fe,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,fe,Oe]}],"backdrop-invert":[{"backdrop-invert":["",we,fe,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[we,fe,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[we,fe,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",we,fe,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",fe,Oe]}],ease:[{ease:["linear","initial",j,fe,Oe]}],delay:[{delay:[we,fe,Oe]}],animate:[{animate:["none",z,fe,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,fe,Oe]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:bt()}],"rotate-x":[{"rotate-x":bt()}],"rotate-y":[{"rotate-y":bt()}],"rotate-z":[{"rotate-z":bt()}],scale:[{scale:un()}],"scale-x":[{"scale-x":un()}],"scale-y":[{"scale-y":un()}],"scale-z":[{"scale-z":un()}],"scale-3d":["scale-3d"],skew:[{skew:Bt()}],"skew-x":[{"skew-x":Bt()}],"skew-y":[{"skew-y":Bt()}],transform:[{transform:[fe,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:yt()}],"translate-x":[{"translate-x":yt()}],"translate-y":[{"translate-y":yt()}],"translate-z":[{"translate-z":yt()}],"translate-none":["translate-none"],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,Oe]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[we,Lr,Qs,Kg]}],stroke:[{stroke:["none",...ee()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},f5=L$(O5);function re(...t){return f5(j$(t))}function h5({children:t}){return r.jsx(g$,{delayDuration:300,children:t})}function t1({children:t,content:a,side:s="top",className:l}){return a?r.jsxs(b$,{children:[r.jsx(v$,{asChild:!0,children:t}),r.jsx(y$,{children:r.jsxs(S$,{side:s,sideOffset:6,className:re("z-50 px-2.5 py-1.5 text-xs font-sans","bg-surface-4 text-text-0 border border-border rounded-md shadow-lg","animate-in fade-in-0 zoom-in-95",l),children:[a,r.jsx(Q$,{className:"fill-surface-4"})]})})]}):t}/**
|
|
29
|
+
`:" ";$[$.length-1]={...j,text:j.text+_+Q,timestamp:Date.now()}}else $.push({from:"agent",text:Q,timestamp:Date.now()});w[h]=$.slice(-100),t({chatHistory:w}),wl("groove:chatHistory",w)}}if(g&&g.trim()){const Q={...a().activityLog};Q[h]||(Q[h]=[]),Q[h]=[...Q[h].slice(-200),{timestamp:Date.now(),text:g.trim(),type:p.type,subtype:"tool"}],t({activityLog:Q}),wl("groove:activityLog",Q)}break}case"agent:exit":{const h=a().agents.find(y=>y.id===o.agentId),p=(h==null?void 0:h.name)||o.agentId,x=o.status==="killed"||o.code===143||o.code===137,g=o.status==="completed"?`${p} completed`:x?`${p} stopped`:`${p} crashed (exit ${o.code})`,b=o.status==="completed"?"success":x?"info":"warning";a().addToast(b,g,o.error?o.error.slice(0,200):void 0),o.error&&o.agentId&&a().addChatMessage(o.agentId,"system",`Crashed: ${o.error}`),(h==null?void 0:h.role)==="planner"&&o.status==="completed"&&setTimeout(()=>a().checkRecommendedTeam(),1e3);break}case"phase2:spawned":a().addToast("info",`QC agent ${o.name} auto-spawned`,"Auditing phase 1 work");break;case"phase2:failed":a().addToast("error","QC agent failed to spawn",o.error||"Unknown error");break;case"rotation:start":a().addToast("info",`Rotating ${o.agentName}...`);break;case"rotation:complete":{a().addToast("success",`Rotated ${o.agentName}`,`Saved ${o.tokensSaved} tokens`);const h=a().detailPanel;(h==null?void 0:h.type)==="agent"&&h.agentId===o.oldAgentId&&o.newAgentId&&t(p=>{var y,Q,w;const x={...p.chatHistory},g={...p.tokenTimeline},b={...p.activityLog};return(y=x[o.oldAgentId])!=null&&y.length&&(x[o.newAgentId]=[...x[o.oldAgentId]]),(Q=g[o.oldAgentId])!=null&&Q.length&&(g[o.newAgentId]=[...g[o.oldAgentId]]),(w=b[o.oldAgentId])!=null&&w.length&&(b[o.newAgentId]=[...b[o.oldAgentId]]),{chatHistory:x,tokenTimeline:g,activityLog:b,detailPanel:{type:"agent",agentId:o.newAgentId}}});break}case"rotation:failed":a().addToast("error","Rotation failed",o.error);break;case"file:changed":{const h=a().editorRecentSaves[o.path];if(h&&Date.now()-h<2e3)break;t(p=>({editorChangedFiles:{...p.editorChangedFiles,[o.path]:o.timestamp}}));break}case"team:created":case"team:deleted":case"team:updated":a().fetchTeams();break;case"approval:request":t(h=>({pendingApprovals:[...h.pendingApprovals,o.data]})),a().addToast("warning",`Approval needed: ${((u=o.data)==null?void 0:u.agentName)||"agent"}`,(O=(d=o.data)==null?void 0:d.action)==null?void 0:O.description);break;case"approval:resolved":{const h=o.data;t(p=>({pendingApprovals:p.pendingApprovals.filter(x=>x.id!==h.id),resolvedApprovals:[h,...p.resolvedApprovals].slice(0,200)}));break}case"conflict:detected":a().addToast("error",`Scope conflict: ${o.agentName||"agent"}`,o.filePath?`File: ${o.filePath}`:void 0);break;case"qc:activated":a().addToast("info","QC agent activated",`${o.agentCount||"4+"} agents running`);break;case"journalist:cycle":t({journalistStatus:o.data||null});break;case"schedule:execute":a().addToast("info",`Scheduled agent spawned: ${o.name||o.role||"agent"}`);break;case"gateway:status":t({gateways:o.data||[]});break}},s.onclose=()=>{t({connected:!1,hydrated:!1,ws:null,daemonHost:null,tunneled:!1}),setTimeout(()=>a().connect(),2e3)},s.onerror=()=>s.close()},setActiveView(s){t({activeView:s})},async fetchTeams(){try{const s=await J.get("/teams"),l=s.teams||[],o=s.defaultTeamId,{activeTeamId:u}=a(),O=l.map(h=>h.id).includes(u)?u:o;t({teams:l,activeTeamId:O}),O&&localStorage.setItem("groove:activeTeamId",O)}catch{}},switchTeam(s){t({activeTeamId:s,detailPanel:null}),localStorage.setItem("groove:activeTeamId",s)},async createTeam(s,l){try{const o={name:s};l&&(o.workingDir=l);const u=await J.post("/teams",o);return t({activeTeamId:u.id}),localStorage.setItem("groove:activeTeamId",u.id),a().addToast("success",`Team "${s}" created`),u}catch(o){throw a().addToast("error","Failed to create team",o.message),o}},async deleteTeam(s){const l=a().teams.find(o=>o.id===s);if(l!=null&&l.isDefault){a().addToast("warning","Cannot delete the default team");return}try{await J.delete(`/teams/${s}`),a().addToast("info",`Team "${l==null?void 0:l.name}" deleted`)}catch(o){a().addToast("error","Failed to delete team",o.message)}},async renameTeam(s,l){try{const o=await J.patch(`/teams/${s}`,{name:l});return t(u=>({teams:u.teams.map(d=>d.id===s?o:d)})),o}catch(o){throw a().addToast("error","Failed to rename team",o.message),o}},openDetail(s){t({detailPanel:s})},closeDetail(){t({detailPanel:null})},selectAgent(s){t({detailPanel:{type:"agent",agentId:s}})},clearSelection(){t({detailPanel:null})},toggleCommandPalette(){t(s=>({commandPaletteOpen:!s.commandPaletteOpen}))},setDetailPanelWidth(s){t({detailPanelWidth:s}),localStorage.setItem("groove:detailWidth",String(s))},setTerminalVisible(s){t({terminalVisible:s}),localStorage.setItem("groove:terminalVisible",String(s))},setTerminalHeight(s){t({terminalHeight:s}),localStorage.setItem("groove:terminalHeight",String(s))},setTerminalFullHeight(s){t({terminalFullHeight:s})},addToast(s,l,o){const u=++cw;t(d=>({toasts:[...d.toasts,{id:u,type:s,message:l,detail:o}]}))},removeToast(s){t(l=>({toasts:l.toasts.filter(o=>o.id!==s)}))},async checkMarketplaceAuth(){try{const s=await J.get("/auth/status");t({marketplaceAuthenticated:s.authenticated||!1,marketplaceUser:s.user||null})}catch{t({marketplaceAuthenticated:!1,marketplaceUser:null})}},async marketplaceLogin(){try{const s=await J.get("/auth/login-url");s.url&&window.open(s.url,"_blank");const l=setInterval(async()=>{var o,u;try{const d=await J.get("/auth/status");d.authenticated&&(clearInterval(l),t({marketplaceAuthenticated:!0,marketplaceUser:d.user}),a().addToast("success",`Signed in as ${((o=d.user)==null?void 0:o.displayName)||((u=d.user)==null?void 0:u.id)||"user"}`))}catch{}},2e3);setTimeout(()=>clearInterval(l),3e5)}catch(s){a().addToast("error","Login failed",s.message)}},async marketplaceLogout(){try{await J.post("/auth/logout"),t({marketplaceAuthenticated:!1,marketplaceUser:null}),a().addToast("info","Signed out of marketplace")}catch(s){a().addToast("error","Logout failed",s.message)}},async marketplaceCheckout(s){try{const l=await J.post("/auth/checkout",{skillId:s});return l.url&&window.open(l.url,"_blank"),l}catch(l){throw a().addToast("error","Checkout failed",l.message),l}},async fetchApprovals(){try{const s=await J.get("/approvals");t({pendingApprovals:s.pending||[],resolvedApprovals:s.resolved||[]})}catch{}},async approveRequest(s){try{await J.post(`/approvals/${s}/approve`),t(l=>({pendingApprovals:l.pendingApprovals.filter(o=>o.id!==s)})),a().addToast("success","Approved")}catch(l){a().addToast("error","Approve failed",l.message)}},async rejectRequest(s,l=""){try{await J.post(`/approvals/${s}/reject`,{reason:l}),t(o=>({pendingApprovals:o.pendingApprovals.filter(u=>u.id!==s)})),a().addToast("info","Rejected")}catch(o){a().addToast("error","Reject failed",o.message)}},async checkRecommendedTeam(){var s,l;try{const o=await J.get("/recommended-team");if(!o||!((s=o.agents)!=null&&s.length)){t({recommendedTeam:null});return}const d=a().agents.filter(h=>h.role==="planner").sort((h,p)=>(p.lastActivity||"").localeCompare(h.lastActivity||""))[0],O=d==null?void 0:d.teamId;if(O){const h=a().agents.filter(g=>g.teamId===O&&g.role!=="planner"),p=o.agents.filter(g=>!g.phase||g.phase===1).map(g=>g.role);if(p.every(g=>h.some(b=>b.role===g))&&p.length>0){t({recommendedTeam:null});const b=((l=(await J.post("/recommended-team/launch")).agents)==null?void 0:l.map(y=>y.name).join(", "))||"";a().addToast("success","Planner delegated work",b?`→ ${b}`:void 0),J.post("/cleanup").catch(()=>{});return}}t({recommendedTeam:o})}catch{t({recommendedTeam:null})}},async launchRecommendedTeam(s){try{t({recommendedTeam:null}),a().addToast("info","Launching team...");const l=s?{agents:s}:void 0,o=await J.post("/recommended-team/launch",l),u=[o.phase2Pending?`${o.phase2Pending} QC queued`:"",o.projectDir?`→ ${o.projectDir}/`:""].filter(Boolean).join(" · ");return a().addToast("success",`Launched ${o.launched} agents`,u||void 0),J.post("/cleanup").catch(()=>{}),o}catch(l){throw a().addToast("error","Launch failed",l.message),l}},async fetchJournalist(){try{const s=await J.get("/journalist");return t({journalistStatus:s}),s}catch{return null}},async triggerJournalistCycle(){try{const s=await J.post("/journalist/cycle");return a().addToast("success","Synthesis cycle triggered"),t({journalistStatus:s}),s}catch(s){throw a().addToast("error","Synthesis failed",s.message),s}},async spawnAgent(s){try{const l=a().activeTeamId,o=await J.post("/agents",{...s,teamId:l});return a().addToast("success",`Spawned ${o.name}`),o}catch(l){throw a().addToast("error","Spawn failed",l.message),l}},async killAgent(s,l=!1){try{await J.delete(`/agents/${s}?purge=${l}`)}catch(o){a().addToast("error","Kill failed",o.message)}},async rotateAgent(s){try{return await J.post(`/agents/${s}/rotate`)}catch(l){throw a().addToast("error","Rotation failed",l.message),l}},async fetchProviders(){return J.get("/providers")},addChatMessage(s,l,o,u=!1){t(d=>{const O={...d.chatHistory};return O[s]||(O[s]=[]),O[s]=[...O[s].slice(-100),{from:l,text:o,timestamp:Date.now(),isQuery:u}],wl("groove:chatHistory",O),{chatHistory:O}})},thinkingAgents:new Set,async instructAgent(s,l){var d,O;const o=a().agents.find(h=>h.id===s);if(o&&(o.status==="running"||o.status==="starting")){a().addChatMessage(s,"user",l,!1);try{const h=await J.post(`/agents/${s}/query`,{message:l});return h.status==="pending"||h.response==="Message sent to agent"?(t(p=>({thinkingAgents:new Set([...p.thinkingAgents,s])})),h):(a().addChatMessage(s,"agent",h.response),h)}catch(h){throw a().addChatMessage(s,"system",`failed: ${h.message}`),h}}a().addChatMessage(s,"user",l,!1),t(h=>({thinkingAgents:new Set([...h.thinkingAgents,s])}));try{const h=await J.post(`/agents/${s}/instruct`,{message:l});for(const p of["chatHistory","activityLog","tokenTimeline"]){const x=a()[p][s];x!=null&&x.length&&t(g=>({[p]:{...g[p],[h.id]:[...x]}}))}return t(p=>{const x=new Set(p.thinkingAgents);return x.delete(s),x.add(h.id),{thinkingAgents:x}}),(d=a().chatHistory[s])!=null&&d.length&&wl("groove:chatHistory",a().chatHistory),(O=a().activityLog[s])!=null&&O.length&&wl("groove:activityLog",a().activityLog),a().selectAgent(h.id),h}catch(h){throw t(p=>{const x=new Set(p.thinkingAgents);return x.delete(s),{thinkingAgents:x}}),a().addChatMessage(s,"system",`failed: ${h.message}`),h}},async queryAgent(s,l){a().addChatMessage(s,"user",l,!0);try{const o=await J.post(`/agents/${s}/query`,{message:l});return a().addChatMessage(s,"agent",o.response),o}catch(o){throw a().addChatMessage(s,"system",`query failed: ${o.message}`),o}},async openFile(s){var u;if(a().editorFiles[s]||a().editorOpenTabs.includes(s)){t(d=>({editorActiveFile:s,editorOpenTabs:d.editorOpenTabs.includes(s)?d.editorOpenTabs:[...d.editorOpenTabs,s]}));return}const l=(u=s.split(".").pop())==null?void 0:u.toLowerCase();if(["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif","mp4","webm","mov","avi","mkv","ogv"].includes(l)){t(d=>({editorActiveFile:s,editorOpenTabs:[...d.editorOpenTabs,s]}));return}try{const d=await J.get(`/files/read?path=${encodeURIComponent(s)}`);if(d.binary){a().addToast("warning","Binary file — cannot open");return}t(h=>({editorFiles:{...h.editorFiles,[s]:{content:d.content,originalContent:d.content,language:d.language,loadedAt:Date.now()}},editorActiveFile:s,editorOpenTabs:h.editorOpenTabs.includes(s)?h.editorOpenTabs:[...h.editorOpenTabs,s]}));const O=a().ws;(O==null?void 0:O.readyState)===1&&O.send(JSON.stringify({type:"editor:watch",path:s}))}catch(d){a().addToast("error","Failed to open file",d.message)}},closeFile(s){t(o=>{const u=o.editorOpenTabs.filter(p=>p!==s),d={...o.editorFiles};delete d[s];const O={...o.editorChangedFiles};delete O[s];let h=o.editorActiveFile;if(h===s){const p=o.editorOpenTabs.indexOf(s);h=u[Math.min(p,u.length-1)]||null}return{editorOpenTabs:u,editorFiles:d,editorChangedFiles:O,editorActiveFile:h}});const l=a().ws;(l==null?void 0:l.readyState)===1&&l.send(JSON.stringify({type:"editor:unwatch",path:s}))},setActiveFile(s){t({editorActiveFile:s})},updateFileContent(s,l){t(o=>({editorFiles:{...o.editorFiles,[s]:{...o.editorFiles[s],content:l}}}))},async saveFile(s){const l=a().editorFiles[s];if(l)try{await J.post("/files/write",{path:s,content:l.content}),t(o=>({editorFiles:{...o.editorFiles,[s]:{...o.editorFiles[s],originalContent:l.content}},editorChangedFiles:(()=>{const u={...o.editorChangedFiles};return delete u[s],u})(),editorRecentSaves:{...o.editorRecentSaves,[s]:Date.now()}})),a().addToast("success","File saved")}catch(o){a().addToast("error","Save failed",o.message)}},async reloadFile(s){try{const l=await J.get(`/files/read?path=${encodeURIComponent(s)}`);if(l.binary)return;t(o=>({editorFiles:{...o.editorFiles,[s]:{content:l.content,originalContent:l.content,language:l.language,loadedAt:Date.now()}},editorChangedFiles:(()=>{const u={...o.editorChangedFiles};return delete u[s],u})()}))}catch{}},dismissFileChange(s){t(l=>{const o={...l.editorChangedFiles};return delete o[s],{editorChangedFiles:o}})},async fetchTreeDir(s){try{const l=await J.get(`/files/tree?path=${encodeURIComponent(s)}`);t(o=>({editorTreeCache:{...o.editorTreeCache,[s]:l.entries}}))}catch{}},async createFile(s){try{await J.post("/files/create",{path:s});const l=s.includes("/")?s.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(l),a().addToast("success","File created"),!0}catch(l){return a().addToast("error","Create failed",l.message),!1}},async createDir(s){try{await J.post("/files/mkdir",{path:s});const l=s.includes("/")?s.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(l),a().addToast("success","Folder created"),!0}catch(l){return a().addToast("error","Create failed",l.message),!1}},async deleteFile(s){try{await J.delete(`/files/delete?path=${encodeURIComponent(s)}`),a().editorOpenTabs.includes(s)&&a().closeFile(s);const l=s.includes("/")?s.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(l),t(o=>{const u={...o.editorTreeCache};return delete u[s],{editorTreeCache:u}}),a().addToast("success","Deleted"),!0}catch(l){return a().addToast("error","Delete failed",l.message),!1}},async renameFile(s,l){try{await J.post("/files/rename",{oldPath:s,newPath:l}),t(d=>{const O=d.editorOpenTabs.map(x=>x===s?l:x),h={...d.editorFiles};h[s]&&(h[l]=h[s],delete h[s]);const p=d.editorActiveFile===s?l:d.editorActiveFile;return{editorOpenTabs:O,editorFiles:h,editorActiveFile:p}});const o=s.includes("/")?s.split("/").slice(0,-1).join("/"):"",u=l.includes("/")?l.split("/").slice(0,-1).join("/"):"";return await a().fetchTreeDir(o),u!==o&&await a().fetchTreeDir(u),a().addToast("success","Renamed"),!0}catch(o){return a().addToast("error","Rename failed",o.message),!1}}}));function uw(t){v.useEffect(()=>{function a(s){for(const l of t){const o=l.meta?s.metaKey||s.ctrlKey:!0,u=l.shift?s.shiftKey:!s.shiftKey;if(s.key.toLowerCase()===l.key.toLowerCase()&&o&&u){s.preventDefault(),l.handler();return}}}return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t])}function qe(t,a,{checkForDefaultPrevented:s=!0}={}){return function(o){if(t==null||t(o),s===!1||!o.defaultPrevented)return a==null?void 0:a(o)}}function _g(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function _0(...t){return a=>{let s=!1;const l=t.map(o=>{const u=_g(o,a);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let o=0;o<l.length;o++){const u=l[o];typeof u=="function"?u():_g(t[o],null)}}}}function it(...t){return v.useCallback(_0(...t),t)}function dw(t,a){const s=v.createContext(a),l=u=>{const{children:d,...O}=u,h=v.useMemo(()=>O,Object.values(O));return r.jsx(s.Provider,{value:h,children:d})};l.displayName=t+"Provider";function o(u){const d=v.useContext(s);if(d)return d;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${t}\``)}return[l,o]}function Xs(t,a=[]){let s=[];function l(u,d){const O=v.createContext(d),h=s.length;s=[...s,d];const p=g=>{var j;const{scope:b,children:y,...Q}=g,w=((j=b==null?void 0:b[t])==null?void 0:j[h])||O,$=v.useMemo(()=>Q,Object.values(Q));return r.jsx(w.Provider,{value:$,children:y})};p.displayName=u+"Provider";function x(g,b){var w;const y=((w=b==null?void 0:b[t])==null?void 0:w[h])||O,Q=v.useContext(y);if(Q)return Q;if(d!==void 0)return d;throw new Error(`\`${g}\` must be used within \`${u}\``)}return[p,x]}const o=()=>{const u=s.map(d=>v.createContext(d));return function(O){const h=(O==null?void 0:O[t])||u;return v.useMemo(()=>({[`__scope${t}`]:{...O,[t]:h}}),[O,h])}};return o.scopeName=t,[l,Ow(o,...a)]}function Ow(...t){const a=t[0];if(t.length===1)return a;const s=()=>{const l=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(u){const d=l.reduce((O,{useScope:h,scopeName:p})=>{const g=h(u)[`__scope${p}`];return{...O,...g}},{});return v.useMemo(()=>({[`__scope${a.scopeName}`]:d}),[d])}};return s.scopeName=a.scopeName,s}function uc(t){const a=fw(t),s=v.forwardRef((l,o)=>{const{children:u,...d}=l,O=v.Children.toArray(u),h=O.find(mw);if(h){const p=h.props.children,x=O.map(g=>g===h?v.Children.count(p)>1?v.Children.only(null):v.isValidElement(p)?p.props.children:null:g);return r.jsx(a,{...d,ref:o,children:v.isValidElement(p)?v.cloneElement(p,void 0,x):null})}return r.jsx(a,{...d,ref:o,children:u})});return s.displayName=`${t}.Slot`,s}function fw(t){const a=v.forwardRef((s,l)=>{const{children:o,...u}=s;if(v.isValidElement(o)){const d=xw(o),O=pw(u,o.props);return o.type!==v.Fragment&&(O.ref=l?_0(l,d):d),v.cloneElement(o,O)}return v.Children.count(o)>1?v.Children.only(null):null});return a.displayName=`${t}.SlotClone`,a}var Z0=Symbol("radix.slottable");function hw(t){const a=({children:s})=>r.jsx(r.Fragment,{children:s});return a.displayName=`${t}.Slottable`,a.__radixId=Z0,a}function mw(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Z0}function pw(t,a){const s={...a};for(const l in a){const o=t[l],u=a[l];/^on[A-Z]/.test(l)?o&&u?s[l]=(...O)=>{const h=u(...O);return o(...O),h}:o&&(s[l]=o):l==="style"?s[l]={...o,...u}:l==="className"&&(s[l]=[o,u].filter(Boolean).join(" "))}return{...t,...s}}function xw(t){var l,o;let a=(l=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:l.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?t.ref:(a=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?t.props.ref:t.props.ref||t.ref)}var gw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=gw.reduce((t,a)=>{const s=uc(`Primitive.${a}`),l=v.forwardRef((o,u)=>{const{asChild:d,...O}=o,h=d?s:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(h,{...O,ref:u})});return l.displayName=`Primitive.${a}`,{...t,[a]:l}},{});function bw(t,a){t&&$0.flushSync(()=>t.dispatchEvent(a))}function zt(t){const a=v.useRef(t);return v.useEffect(()=>{a.current=t}),v.useMemo(()=>(...s)=>{var l;return(l=a.current)==null?void 0:l.call(a,...s)},[])}function vw(t,a=globalThis==null?void 0:globalThis.document){const s=zt(t);v.useEffect(()=>{const l=o=>{o.key==="Escape"&&s(o)};return a.addEventListener("keydown",l,{capture:!0}),()=>a.removeEventListener("keydown",l,{capture:!0})},[s,a])}var yw="DismissableLayer",of="dismissableLayer.update",Sw="dismissableLayer.pointerDownOutside",Qw="dismissableLayer.focusOutside",Zg,A0=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Af=v.forwardRef((t,a)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:l,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:d,onDismiss:O,...h}=t,p=v.useContext(A0),[x,g]=v.useState(null),b=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),Q=it(a,X=>g(X)),w=Array.from(p.layers),[$]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf($),z=x?w.indexOf(x):-1,N=p.layersWithOutsidePointerEventsDisabled.size>0,_=z>=j,G=kw(X=>{const T=X.target,V=[...p.branches].some(M=>M.contains(T));!_||V||(o==null||o(X),d==null||d(X),X.defaultPrevented||O==null||O())},b),R=$w(X=>{const T=X.target;[...p.branches].some(M=>M.contains(T))||(u==null||u(X),d==null||d(X),X.defaultPrevented||O==null||O())},b);return vw(X=>{z===p.layers.size-1&&(l==null||l(X),!X.defaultPrevented&&O&&(X.preventDefault(),O()))},b),v.useEffect(()=>{if(x)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Zg=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(x)),p.layers.add(x),Ag(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Zg)}},[x,b,s,p]),v.useEffect(()=>()=>{x&&(p.layers.delete(x),p.layersWithOutsidePointerEventsDisabled.delete(x),Ag())},[x,p]),v.useEffect(()=>{const X=()=>y({});return document.addEventListener(of,X),()=>document.removeEventListener(of,X)},[]),r.jsx(Be.div,{...h,ref:Q,style:{pointerEvents:N?_?"auto":"none":void 0,...t.style},onFocusCapture:qe(t.onFocusCapture,R.onFocusCapture),onBlurCapture:qe(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:qe(t.onPointerDownCapture,G.onPointerDownCapture)})});Af.displayName=yw;var jw="DismissableLayerBranch",ww=v.forwardRef((t,a)=>{const s=v.useContext(A0),l=v.useRef(null),o=it(a,l);return v.useEffect(()=>{const u=l.current;if(u)return s.branches.add(u),()=>{s.branches.delete(u)}},[s.branches]),r.jsx(Be.div,{...t,ref:o})});ww.displayName=jw;function kw(t,a=globalThis==null?void 0:globalThis.document){const s=zt(t),l=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const u=O=>{if(O.target&&!l.current){let h=function(){E0(Sw,s,p,{discrete:!0})};const p={originalEvent:O};O.pointerType==="touch"?(a.removeEventListener("click",o.current),o.current=h,a.addEventListener("click",o.current,{once:!0})):h()}else a.removeEventListener("click",o.current);l.current=!1},d=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),a.removeEventListener("pointerdown",u),a.removeEventListener("click",o.current)}},[a,s]),{onPointerDownCapture:()=>l.current=!0}}function $w(t,a=globalThis==null?void 0:globalThis.document){const s=zt(t),l=v.useRef(!1);return v.useEffect(()=>{const o=u=>{u.target&&!l.current&&E0(Qw,s,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",o),()=>a.removeEventListener("focusin",o)},[a,s]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function Ag(){const t=new CustomEvent(of);document.dispatchEvent(t)}function E0(t,a,s,{discrete:l}){const o=s.originalEvent.target,u=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:s});a&&o.addEventListener(t,a,{once:!0}),l?bw(o,u):o.dispatchEvent(u)}var ra=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},Tw=k0[" useId ".trim().toString()]||(()=>{}),Nw=0;function Tl(t){const[a,s]=v.useState(Tw());return ra(()=>{s(l=>l??String(Nw++))},[t]),t||(a?`radix-${a}`:"")}const Pw=["top","right","bottom","left"],Ia=Math.min,Lt=Math.max,dc=Math.round,Mo=Math.floor,Tn=t=>({x:t,y:t}),zw={left:"right",right:"left",bottom:"top",top:"bottom"};function cf(t,a,s){return Lt(t,Ia(a,s))}function ia(t,a){return typeof t=="function"?t(a):t}function oa(t){return t.split("-")[0]}function Vl(t){return t.split("-")[1]}function Ef(t){return t==="x"?"y":"x"}function qf(t){return t==="y"?"height":"width"}function $n(t){const a=t[0];return a==="t"||a==="b"?"y":"x"}function Mf(t){return Ef($n(t))}function Rw(t,a,s){s===void 0&&(s=!1);const l=Vl(t),o=Mf(t),u=qf(o);let d=o==="x"?l===(s?"end":"start")?"right":"left":l==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(d=Oc(d)),[d,Oc(d)]}function Cw(t){const a=Oc(t);return[uf(t),a,uf(a)]}function uf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Eg=["left","right"],qg=["right","left"],Xw=["top","bottom"],_w=["bottom","top"];function Zw(t,a,s){switch(t){case"top":case"bottom":return s?a?qg:Eg:a?Eg:qg;case"left":case"right":return a?Xw:_w;default:return[]}}function Aw(t,a,s,l){const o=Vl(t);let u=Zw(oa(t),s==="start",l);return o&&(u=u.map(d=>d+"-"+o),a&&(u=u.concat(u.map(uf)))),u}function Oc(t){const a=oa(t);return zw[a]+t.slice(a.length)}function Ew(t){return{top:0,right:0,bottom:0,left:0,...t}}function q0(t){return typeof t!="number"?Ew(t):{top:t,right:t,bottom:t,left:t}}function fc(t){const{x:a,y:s,width:l,height:o}=t;return{width:l,height:o,top:s,left:a,right:a+l,bottom:s+o,x:a,y:s}}function Mg(t,a,s){let{reference:l,floating:o}=t;const u=$n(a),d=Mf(a),O=qf(d),h=oa(a),p=u==="y",x=l.x+l.width/2-o.width/2,g=l.y+l.height/2-o.height/2,b=l[O]/2-o[O]/2;let y;switch(h){case"top":y={x,y:l.y-o.height};break;case"bottom":y={x,y:l.y+l.height};break;case"right":y={x:l.x+l.width,y:g};break;case"left":y={x:l.x-o.width,y:g};break;default:y={x:l.x,y:l.y}}switch(Vl(a)){case"start":y[d]-=b*(s&&p?-1:1);break;case"end":y[d]+=b*(s&&p?-1:1);break}return y}async function qw(t,a){var s;a===void 0&&(a={});const{x:l,y:o,platform:u,rects:d,elements:O,strategy:h}=t,{boundary:p="clippingAncestors",rootBoundary:x="viewport",elementContext:g="floating",altBoundary:b=!1,padding:y=0}=ia(a,t),Q=q0(y),$=O[b?g==="floating"?"reference":"floating":g],j=fc(await u.getClippingRect({element:(s=await(u.isElement==null?void 0:u.isElement($)))==null||s?$:$.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(O.floating)),boundary:p,rootBoundary:x,strategy:h})),z=g==="floating"?{x:l,y:o,width:d.floating.width,height:d.floating.height}:d.reference,N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(O.floating)),_=await(u.isElement==null?void 0:u.isElement(N))?await(u.getScale==null?void 0:u.getScale(N))||{x:1,y:1}:{x:1,y:1},G=fc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:O,rect:z,offsetParent:N,strategy:h}):z);return{top:(j.top-G.top+Q.top)/_.y,bottom:(G.bottom-j.bottom+Q.bottom)/_.y,left:(j.left-G.left+Q.left)/_.x,right:(G.right-j.right+Q.right)/_.x}}const Mw=50,Yw=async(t,a,s)=>{const{placement:l="bottom",strategy:o="absolute",middleware:u=[],platform:d}=s,O=d.detectOverflow?d:{...d,detectOverflow:qw},h=await(d.isRTL==null?void 0:d.isRTL(a));let p=await d.getElementRects({reference:t,floating:a,strategy:o}),{x,y:g}=Mg(p,l,h),b=l,y=0;const Q={};for(let w=0;w<u.length;w++){const $=u[w];if(!$)continue;const{name:j,fn:z}=$,{x:N,y:_,data:G,reset:R}=await z({x,y:g,initialPlacement:l,placement:b,strategy:o,middlewareData:Q,rects:p,platform:O,elements:{reference:t,floating:a}});x=N??x,g=_??g,Q[j]={...Q[j],...G},R&&y<Mw&&(y++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(p=R.rects===!0?await d.getElementRects({reference:t,floating:a,strategy:o}):R.rects),{x,y:g}=Mg(p,b,h)),w=-1)}return{x,y:g,placement:b,strategy:o,middlewareData:Q}},Uw=t=>({name:"arrow",options:t,async fn(a){const{x:s,y:l,placement:o,rects:u,platform:d,elements:O,middlewareData:h}=a,{element:p,padding:x=0}=ia(t,a)||{};if(p==null)return{};const g=q0(x),b={x:s,y:l},y=Mf(o),Q=qf(y),w=await d.getDimensions(p),$=y==="y",j=$?"top":"left",z=$?"bottom":"right",N=$?"clientHeight":"clientWidth",_=u.reference[Q]+u.reference[y]-b[y]-u.floating[Q],G=b[y]-u.reference[y],R=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let X=R?R[N]:0;(!X||!await(d.isElement==null?void 0:d.isElement(R)))&&(X=O.floating[N]||u.floating[Q]);const T=_/2-G/2,V=X/2-w[Q]/2-1,M=Ia(g[j],V),ae=Ia(g[z],V),F=M,le=X-w[Q]-ae,oe=X/2-w[Q]/2+T,H=cf(F,oe,le),P=!h.arrow&&Vl(o)!=null&&oe!==H&&u.reference[Q]/2-(oe<F?M:ae)-w[Q]/2<0,W=P?oe<F?oe-F:oe-le:0;return{[y]:b[y]+W,data:{[y]:H,centerOffset:oe-H-W,...P&&{alignmentOffset:W}},reset:P}}}),Vw=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(a){var s,l;const{placement:o,middlewareData:u,rects:d,initialPlacement:O,platform:h,elements:p}=a,{mainAxis:x=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:Q="none",flipAlignment:w=!0,...$}=ia(t,a);if((s=u.arrow)!=null&&s.alignmentOffset)return{};const j=oa(o),z=$n(O),N=oa(O)===O,_=await(h.isRTL==null?void 0:h.isRTL(p.floating)),G=b||(N||!w?[Oc(O)]:Cw(O)),R=Q!=="none";!b&&R&&G.push(...Aw(O,w,Q,_));const X=[O,...G],T=await h.detectOverflow(a,$),V=[];let M=((l=u.flip)==null?void 0:l.overflows)||[];if(x&&V.push(T[j]),g){const oe=Rw(o,d,_);V.push(T[oe[0]],T[oe[1]])}if(M=[...M,{placement:o,overflows:V}],!V.every(oe=>oe<=0)){var ae,F;const oe=(((ae=u.flip)==null?void 0:ae.index)||0)+1,H=X[oe];if(H&&(!(g==="alignment"?z!==$n(H):!1)||M.every(E=>$n(E.placement)===z?E.overflows[0]>0:!0)))return{data:{index:oe,overflows:M},reset:{placement:H}};let P=(F=M.filter(W=>W.overflows[0]<=0).sort((W,E)=>W.overflows[1]-E.overflows[1])[0])==null?void 0:F.placement;if(!P)switch(y){case"bestFit":{var le;const W=(le=M.filter(E=>{if(R){const ce=$n(E.placement);return ce===z||ce==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(ce=>ce>0).reduce((ce,ee)=>ce+ee,0)]).sort((E,ce)=>E[1]-ce[1])[0])==null?void 0:le[0];W&&(P=W);break}case"initialPlacement":P=O;break}if(o!==P)return{reset:{placement:P}}}return{}}}};function Yg(t,a){return{top:t.top-a.height,right:t.right-a.width,bottom:t.bottom-a.height,left:t.left-a.width}}function Ug(t){return Pw.some(a=>t[a]>=0)}const Gw=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(a){const{rects:s,platform:l}=a,{strategy:o="referenceHidden",...u}=ia(t,a);switch(o){case"referenceHidden":{const d=await l.detectOverflow(a,{...u,elementContext:"reference"}),O=Yg(d,s.reference);return{data:{referenceHiddenOffsets:O,referenceHidden:Ug(O)}}}case"escaped":{const d=await l.detectOverflow(a,{...u,altBoundary:!0}),O=Yg(d,s.floating);return{data:{escapedOffsets:O,escaped:Ug(O)}}}default:return{}}}}},M0=new Set(["left","top"]);async function Lw(t,a){const{placement:s,platform:l,elements:o}=t,u=await(l.isRTL==null?void 0:l.isRTL(o.floating)),d=oa(s),O=Vl(s),h=$n(s)==="y",p=M0.has(d)?-1:1,x=u&&h?-1:1,g=ia(a,t);let{mainAxis:b,crossAxis:y,alignmentAxis:Q}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return O&&typeof Q=="number"&&(y=O==="end"?Q*-1:Q),h?{x:y*x,y:b*p}:{x:b*p,y:y*x}}const Dw=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(a){var s,l;const{x:o,y:u,placement:d,middlewareData:O}=a,h=await Lw(a,t);return d===((s=O.offset)==null?void 0:s.placement)&&(l=O.arrow)!=null&&l.alignmentOffset?{}:{x:o+h.x,y:u+h.y,data:{...h,placement:d}}}}},Ww=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(a){const{x:s,y:l,placement:o,platform:u}=a,{mainAxis:d=!0,crossAxis:O=!1,limiter:h={fn:j=>{let{x:z,y:N}=j;return{x:z,y:N}}},...p}=ia(t,a),x={x:s,y:l},g=await u.detectOverflow(a,p),b=$n(oa(o)),y=Ef(b);let Q=x[y],w=x[b];if(d){const j=y==="y"?"top":"left",z=y==="y"?"bottom":"right",N=Q+g[j],_=Q-g[z];Q=cf(N,Q,_)}if(O){const j=b==="y"?"top":"left",z=b==="y"?"bottom":"right",N=w+g[j],_=w-g[z];w=cf(N,w,_)}const $=h.fn({...a,[y]:Q,[b]:w});return{...$,data:{x:$.x-s,y:$.y-l,enabled:{[y]:d,[b]:O}}}}}},Bw=function(t){return t===void 0&&(t={}),{options:t,fn(a){const{x:s,y:l,placement:o,rects:u,middlewareData:d}=a,{offset:O=0,mainAxis:h=!0,crossAxis:p=!0}=ia(t,a),x={x:s,y:l},g=$n(o),b=Ef(g);let y=x[b],Q=x[g];const w=ia(O,a),$=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const N=b==="y"?"height":"width",_=u.reference[b]-u.floating[N]+$.mainAxis,G=u.reference[b]+u.reference[N]-$.mainAxis;y<_?y=_:y>G&&(y=G)}if(p){var j,z;const N=b==="y"?"width":"height",_=M0.has(oa(o)),G=u.reference[g]-u.floating[N]+(_&&((j=d.offset)==null?void 0:j[g])||0)+(_?0:$.crossAxis),R=u.reference[g]+u.reference[N]+(_?0:((z=d.offset)==null?void 0:z[g])||0)-(_?$.crossAxis:0);Q<G?Q=G:Q>R&&(Q=R)}return{[b]:y,[g]:Q}}}},Hw=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(a){var s,l;const{placement:o,rects:u,platform:d,elements:O}=a,{apply:h=()=>{},...p}=ia(t,a),x=await d.detectOverflow(a,p),g=oa(o),b=Vl(o),y=$n(o)==="y",{width:Q,height:w}=u.floating;let $,j;g==="top"||g==="bottom"?($=g,j=b===(await(d.isRTL==null?void 0:d.isRTL(O.floating))?"start":"end")?"left":"right"):(j=g,$=b==="end"?"top":"bottom");const z=w-x.top-x.bottom,N=Q-x.left-x.right,_=Ia(w-x[$],z),G=Ia(Q-x[j],N),R=!a.middlewareData.shift;let X=_,T=G;if((s=a.middlewareData.shift)!=null&&s.enabled.x&&(T=N),(l=a.middlewareData.shift)!=null&&l.enabled.y&&(X=z),R&&!b){const M=Lt(x.left,0),ae=Lt(x.right,0),F=Lt(x.top,0),le=Lt(x.bottom,0);y?T=Q-2*(M!==0||ae!==0?M+ae:Lt(x.left,x.right)):X=w-2*(F!==0||le!==0?F+le:Lt(x.top,x.bottom))}await h({...a,availableWidth:T,availableHeight:X});const V=await d.getDimensions(O.floating);return Q!==V.width||w!==V.height?{reset:{rects:!0}}:{}}}};function Zc(){return typeof window<"u"}function Gl(t){return Y0(t)?(t.nodeName||"").toLowerCase():"#document"}function Wt(t){var a;return(t==null||(a=t.ownerDocument)==null?void 0:a.defaultView)||window}function Pn(t){var a;return(a=(Y0(t)?t.ownerDocument:t.document)||window.document)==null?void 0:a.documentElement}function Y0(t){return Zc()?t instanceof Node||t instanceof Wt(t).Node:!1}function pn(t){return Zc()?t instanceof Element||t instanceof Wt(t).Element:!1}function Oa(t){return Zc()?t instanceof HTMLElement||t instanceof Wt(t).HTMLElement:!1}function Vg(t){return!Zc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Wt(t).ShadowRoot}function fi(t){const{overflow:a,overflowX:s,overflowY:l,display:o}=xn(t);return/auto|scroll|overlay|hidden|clip/.test(a+l+s)&&o!=="inline"&&o!=="contents"}function Iw(t){return/^(table|td|th)$/.test(Gl(t))}function Ac(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Fw=/transform|translate|scale|rotate|perspective|filter/,Kw=/paint|layout|strict|content/,Ss=t=>!!t&&t!=="none";let gO;function Yf(t){const a=pn(t)?xn(t):t;return Ss(a.transform)||Ss(a.translate)||Ss(a.scale)||Ss(a.rotate)||Ss(a.perspective)||!Uf()&&(Ss(a.backdropFilter)||Ss(a.filter))||Fw.test(a.willChange||"")||Kw.test(a.contain||"")}function Jw(t){let a=Fa(t);for(;Oa(a)&&!_l(a);){if(Yf(a))return a;if(Ac(a))return null;a=Fa(a)}return null}function Uf(){return gO==null&&(gO=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gO}function _l(t){return/^(html|body|#document)$/.test(Gl(t))}function xn(t){return Wt(t).getComputedStyle(t)}function Ec(t){return pn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fa(t){if(Gl(t)==="html")return t;const a=t.assignedSlot||t.parentNode||Vg(t)&&t.host||Pn(t);return Vg(a)?a.host:a}function U0(t){const a=Fa(t);return _l(a)?t.ownerDocument?t.ownerDocument.body:t.body:Oa(a)&&fi(a)?a:U0(a)}function ei(t,a,s){var l;a===void 0&&(a=[]),s===void 0&&(s=!0);const o=U0(t),u=o===((l=t.ownerDocument)==null?void 0:l.body),d=Wt(o);if(u){const O=df(d);return a.concat(d,d.visualViewport||[],fi(o)?o:[],O&&s?ei(O):[])}else return a.concat(o,ei(o,[],s))}function df(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function V0(t){const a=xn(t);let s=parseFloat(a.width)||0,l=parseFloat(a.height)||0;const o=Oa(t),u=o?t.offsetWidth:s,d=o?t.offsetHeight:l,O=dc(s)!==u||dc(l)!==d;return O&&(s=u,l=d),{width:s,height:l,$:O}}function Vf(t){return pn(t)?t:t.contextElement}function Nl(t){const a=Vf(t);if(!Oa(a))return Tn(1);const s=a.getBoundingClientRect(),{width:l,height:o,$:u}=V0(a);let d=(u?dc(s.width):s.width)/l,O=(u?dc(s.height):s.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!O||!Number.isFinite(O))&&(O=1),{x:d,y:O}}const ek=Tn(0);function G0(t){const a=Wt(t);return!Uf()||!a.visualViewport?ek:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function tk(t,a,s){return a===void 0&&(a=!1),!s||a&&s!==Wt(t)?!1:a}function $s(t,a,s,l){a===void 0&&(a=!1),s===void 0&&(s=!1);const o=t.getBoundingClientRect(),u=Vf(t);let d=Tn(1);a&&(l?pn(l)&&(d=Nl(l)):d=Nl(t));const O=tk(u,s,l)?G0(u):Tn(0);let h=(o.left+O.x)/d.x,p=(o.top+O.y)/d.y,x=o.width/d.x,g=o.height/d.y;if(u){const b=Wt(u),y=l&&pn(l)?Wt(l):l;let Q=b,w=df(Q);for(;w&&l&&y!==Q;){const $=Nl(w),j=w.getBoundingClientRect(),z=xn(w),N=j.left+(w.clientLeft+parseFloat(z.paddingLeft))*$.x,_=j.top+(w.clientTop+parseFloat(z.paddingTop))*$.y;h*=$.x,p*=$.y,x*=$.x,g*=$.y,h+=N,p+=_,Q=Wt(w),w=df(Q)}}return fc({width:x,height:g,x:h,y:p})}function qc(t,a){const s=Ec(t).scrollLeft;return a?a.left+s:$s(Pn(t)).left+s}function L0(t,a){const s=t.getBoundingClientRect(),l=s.left+a.scrollLeft-qc(t,s),o=s.top+a.scrollTop;return{x:l,y:o}}function nk(t){let{elements:a,rect:s,offsetParent:l,strategy:o}=t;const u=o==="fixed",d=Pn(l),O=a?Ac(a.floating):!1;if(l===d||O&&u)return s;let h={scrollLeft:0,scrollTop:0},p=Tn(1);const x=Tn(0),g=Oa(l);if((g||!g&&!u)&&((Gl(l)!=="body"||fi(d))&&(h=Ec(l)),g)){const y=$s(l);p=Nl(l),x.x=y.x+l.clientLeft,x.y=y.y+l.clientTop}const b=d&&!g&&!u?L0(d,h):Tn(0);return{width:s.width*p.x,height:s.height*p.y,x:s.x*p.x-h.scrollLeft*p.x+x.x+b.x,y:s.y*p.y-h.scrollTop*p.y+x.y+b.y}}function ak(t){return Array.from(t.getClientRects())}function sk(t){const a=Pn(t),s=Ec(t),l=t.ownerDocument.body,o=Lt(a.scrollWidth,a.clientWidth,l.scrollWidth,l.clientWidth),u=Lt(a.scrollHeight,a.clientHeight,l.scrollHeight,l.clientHeight);let d=-s.scrollLeft+qc(t);const O=-s.scrollTop;return xn(l).direction==="rtl"&&(d+=Lt(a.clientWidth,l.clientWidth)-o),{width:o,height:u,x:d,y:O}}const Gg=25;function lk(t,a){const s=Wt(t),l=Pn(t),o=s.visualViewport;let u=l.clientWidth,d=l.clientHeight,O=0,h=0;if(o){u=o.width,d=o.height;const x=Uf();(!x||x&&a==="fixed")&&(O=o.offsetLeft,h=o.offsetTop)}const p=qc(l);if(p<=0){const x=l.ownerDocument,g=x.body,b=getComputedStyle(g),y=x.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,Q=Math.abs(l.clientWidth-g.clientWidth-y);Q<=Gg&&(u-=Q)}else p<=Gg&&(u+=p);return{width:u,height:d,x:O,y:h}}function rk(t,a){const s=$s(t,!0,a==="fixed"),l=s.top+t.clientTop,o=s.left+t.clientLeft,u=Oa(t)?Nl(t):Tn(1),d=t.clientWidth*u.x,O=t.clientHeight*u.y,h=o*u.x,p=l*u.y;return{width:d,height:O,x:h,y:p}}function Lg(t,a,s){let l;if(a==="viewport")l=lk(t,s);else if(a==="document")l=sk(Pn(t));else if(pn(a))l=rk(a,s);else{const o=G0(t);l={x:a.x-o.x,y:a.y-o.y,width:a.width,height:a.height}}return fc(l)}function D0(t,a){const s=Fa(t);return s===a||!pn(s)||_l(s)?!1:xn(s).position==="fixed"||D0(s,a)}function ik(t,a){const s=a.get(t);if(s)return s;let l=ei(t,[],!1).filter(O=>pn(O)&&Gl(O)!=="body"),o=null;const u=xn(t).position==="fixed";let d=u?Fa(t):t;for(;pn(d)&&!_l(d);){const O=xn(d),h=Yf(d);!h&&O.position==="fixed"&&(o=null),(u?!h&&!o:!h&&O.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||fi(d)&&!h&&D0(t,d))?l=l.filter(x=>x!==d):o=O,d=Fa(d)}return a.set(t,l),l}function ok(t){let{element:a,boundary:s,rootBoundary:l,strategy:o}=t;const d=[...s==="clippingAncestors"?Ac(a)?[]:ik(a,this._c):[].concat(s),l],O=Lg(a,d[0],o);let h=O.top,p=O.right,x=O.bottom,g=O.left;for(let b=1;b<d.length;b++){const y=Lg(a,d[b],o);h=Lt(y.top,h),p=Ia(y.right,p),x=Ia(y.bottom,x),g=Lt(y.left,g)}return{width:p-g,height:x-h,x:g,y:h}}function ck(t){const{width:a,height:s}=V0(t);return{width:a,height:s}}function uk(t,a,s){const l=Oa(a),o=Pn(a),u=s==="fixed",d=$s(t,!0,u,a);let O={scrollLeft:0,scrollTop:0};const h=Tn(0);function p(){h.x=qc(o)}if(l||!l&&!u)if((Gl(a)!=="body"||fi(o))&&(O=Ec(a)),l){const y=$s(a,!0,u,a);h.x=y.x+a.clientLeft,h.y=y.y+a.clientTop}else o&&p();u&&!l&&o&&p();const x=o&&!l&&!u?L0(o,O):Tn(0),g=d.left+O.scrollLeft-h.x-x.x,b=d.top+O.scrollTop-h.y-x.y;return{x:g,y:b,width:d.width,height:d.height}}function bO(t){return xn(t).position==="static"}function Dg(t,a){if(!Oa(t)||xn(t).position==="fixed")return null;if(a)return a(t);let s=t.offsetParent;return Pn(t)===s&&(s=s.ownerDocument.body),s}function W0(t,a){const s=Wt(t);if(Ac(t))return s;if(!Oa(t)){let o=Fa(t);for(;o&&!_l(o);){if(pn(o)&&!bO(o))return o;o=Fa(o)}return s}let l=Dg(t,a);for(;l&&Iw(l)&&bO(l);)l=Dg(l,a);return l&&_l(l)&&bO(l)&&!Yf(l)?s:l||Jw(t)||s}const dk=async function(t){const a=this.getOffsetParent||W0,s=this.getDimensions,l=await s(t.floating);return{reference:uk(t.reference,await a(t.floating),t.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function Ok(t){return xn(t).direction==="rtl"}const fk={convertOffsetParentRelativeRectToViewportRelativeRect:nk,getDocumentElement:Pn,getClippingRect:ok,getOffsetParent:W0,getElementRects:dk,getClientRects:ak,getDimensions:ck,getScale:Nl,isElement:pn,isRTL:Ok};function B0(t,a){return t.x===a.x&&t.y===a.y&&t.width===a.width&&t.height===a.height}function hk(t,a){let s=null,l;const o=Pn(t);function u(){var O;clearTimeout(l),(O=s)==null||O.disconnect(),s=null}function d(O,h){O===void 0&&(O=!1),h===void 0&&(h=1),u();const p=t.getBoundingClientRect(),{left:x,top:g,width:b,height:y}=p;if(O||a(),!b||!y)return;const Q=Mo(g),w=Mo(o.clientWidth-(x+b)),$=Mo(o.clientHeight-(g+y)),j=Mo(x),N={rootMargin:-Q+"px "+-w+"px "+-$+"px "+-j+"px",threshold:Lt(0,Ia(1,h))||1};let _=!0;function G(R){const X=R[0].intersectionRatio;if(X!==h){if(!_)return d();X?d(!1,X):l=setTimeout(()=>{d(!1,1e-7)},1e3)}X===1&&!B0(p,t.getBoundingClientRect())&&d(),_=!1}try{s=new IntersectionObserver(G,{...N,root:o.ownerDocument})}catch{s=new IntersectionObserver(G,N)}s.observe(t)}return d(!0),u}function mk(t,a,s,l){l===void 0&&(l={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:O=typeof IntersectionObserver=="function",animationFrame:h=!1}=l,p=Vf(t),x=o||u?[...p?ei(p):[],...a?ei(a):[]]:[];x.forEach(j=>{o&&j.addEventListener("scroll",s,{passive:!0}),u&&j.addEventListener("resize",s)});const g=p&&O?hk(p,s):null;let b=-1,y=null;d&&(y=new ResizeObserver(j=>{let[z]=j;z&&z.target===p&&y&&a&&(y.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(a)})),s()}),p&&!h&&y.observe(p),a&&y.observe(a));let Q,w=h?$s(t):null;h&&$();function $(){const j=$s(t);w&&!B0(w,j)&&s(),w=j,Q=requestAnimationFrame($)}return s(),()=>{var j;x.forEach(z=>{o&&z.removeEventListener("scroll",s),u&&z.removeEventListener("resize",s)}),g==null||g(),(j=y)==null||j.disconnect(),y=null,h&&cancelAnimationFrame(Q)}}const pk=Dw,xk=Ww,gk=Vw,bk=Hw,vk=Gw,Wg=Uw,yk=Bw,Sk=(t,a,s)=>{const l=new Map,o={platform:fk,...s},u={...o.platform,_c:l};return Yw(t,a,{...o,platform:u})};var Qk=typeof document<"u",jk=function(){},nc=Qk?v.useLayoutEffect:jk;function hc(t,a){if(t===a)return!0;if(typeof t!=typeof a)return!1;if(typeof t=="function"&&t.toString()===a.toString())return!0;let s,l,o;if(t&&a&&typeof t=="object"){if(Array.isArray(t)){if(s=t.length,s!==a.length)return!1;for(l=s;l--!==0;)if(!hc(t[l],a[l]))return!1;return!0}if(o=Object.keys(t),s=o.length,s!==Object.keys(a).length)return!1;for(l=s;l--!==0;)if(!{}.hasOwnProperty.call(a,o[l]))return!1;for(l=s;l--!==0;){const u=o[l];if(!(u==="_owner"&&t.$$typeof)&&!hc(t[u],a[u]))return!1}return!0}return t!==t&&a!==a}function H0(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Bg(t,a){const s=H0(t);return Math.round(a*s)/s}function vO(t){const a=v.useRef(t);return nc(()=>{a.current=t}),a}function wk(t){t===void 0&&(t={});const{placement:a="bottom",strategy:s="absolute",middleware:l=[],platform:o,elements:{reference:u,floating:d}={},transform:O=!0,whileElementsMounted:h,open:p}=t,[x,g]=v.useState({x:0,y:0,strategy:s,placement:a,middlewareData:{},isPositioned:!1}),[b,y]=v.useState(l);hc(b,l)||y(l);const[Q,w]=v.useState(null),[$,j]=v.useState(null),z=v.useCallback(E=>{E!==R.current&&(R.current=E,w(E))},[]),N=v.useCallback(E=>{E!==X.current&&(X.current=E,j(E))},[]),_=u||Q,G=d||$,R=v.useRef(null),X=v.useRef(null),T=v.useRef(x),V=h!=null,M=vO(h),ae=vO(o),F=vO(p),le=v.useCallback(()=>{if(!R.current||!X.current)return;const E={placement:a,strategy:s,middleware:b};ae.current&&(E.platform=ae.current),Sk(R.current,X.current,E).then(ce=>{const ee={...ce,isPositioned:F.current!==!1};oe.current&&!hc(T.current,ee)&&(T.current=ee,$0.flushSync(()=>{g(ee)}))})},[b,a,s,ae,F]);nc(()=>{p===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,g(E=>({...E,isPositioned:!1})))},[p]);const oe=v.useRef(!1);nc(()=>(oe.current=!0,()=>{oe.current=!1}),[]),nc(()=>{if(_&&(R.current=_),G&&(X.current=G),_&&G){if(M.current)return M.current(_,G,le);le()}},[_,G,le,M,V]);const H=v.useMemo(()=>({reference:R,floating:X,setReference:z,setFloating:N}),[z,N]),P=v.useMemo(()=>({reference:_,floating:G}),[_,G]),W=v.useMemo(()=>{const E={position:s,left:0,top:0};if(!P.floating)return E;const ce=Bg(P.floating,x.x),ee=Bg(P.floating,x.y);return O?{...E,transform:"translate("+ce+"px, "+ee+"px)",...H0(P.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ce,top:ee}},[s,O,P.floating,x.x,x.y]);return v.useMemo(()=>({...x,update:le,refs:H,elements:P,floatingStyles:W}),[x,le,H,P,W])}const kk=t=>{function a(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:t,fn(s){const{element:l,padding:o}=typeof t=="function"?t(s):t;return l&&a(l)?l.current!=null?Wg({element:l.current,padding:o}).fn(s):{}:l?Wg({element:l,padding:o}).fn(s):{}}}},$k=(t,a)=>{const s=pk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Tk=(t,a)=>{const s=xk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Nk=(t,a)=>({fn:yk(t).fn,options:[t,a]}),Pk=(t,a)=>{const s=gk(t);return{name:s.name,fn:s.fn,options:[t,a]}},zk=(t,a)=>{const s=bk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Rk=(t,a)=>{const s=vk(t);return{name:s.name,fn:s.fn,options:[t,a]}},Ck=(t,a)=>{const s=kk(t);return{name:s.name,fn:s.fn,options:[t,a]}};var Xk="Arrow",I0=v.forwardRef((t,a)=>{const{children:s,width:l=10,height:o=5,...u}=t;return r.jsx(Be.svg,{...u,ref:a,width:l,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?s:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});I0.displayName=Xk;var _k=I0;function Zk(t){const[a,s]=v.useState(void 0);return ra(()=>{if(t){s({width:t.offsetWidth,height:t.offsetHeight});const l=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let d,O;if("borderBoxSize"in u){const h=u.borderBoxSize,p=Array.isArray(h)?h[0]:h;d=p.inlineSize,O=p.blockSize}else d=t.offsetWidth,O=t.offsetHeight;s({width:d,height:O})});return l.observe(t,{box:"border-box"}),()=>l.unobserve(t)}else s(void 0)},[t]),a}var Gf="Popper",[F0,K0]=Xs(Gf),[Ak,J0]=F0(Gf),eb=t=>{const{__scopePopper:a,children:s}=t,[l,o]=v.useState(null);return r.jsx(Ak,{scope:a,anchor:l,onAnchorChange:o,children:s})};eb.displayName=Gf;var tb="PopperAnchor",nb=v.forwardRef((t,a)=>{const{__scopePopper:s,virtualRef:l,...o}=t,u=J0(tb,s),d=v.useRef(null),O=it(a,d),h=v.useRef(null);return v.useEffect(()=>{const p=h.current;h.current=(l==null?void 0:l.current)||d.current,p!==h.current&&u.onAnchorChange(h.current)}),l?null:r.jsx(Be.div,{...o,ref:O})});nb.displayName=tb;var Lf="PopperContent",[Ek,qk]=F0(Lf),ab=v.forwardRef((t,a)=>{var Ce,Ot,Ae,He,bt,un;const{__scopePopper:s,side:l="bottom",sideOffset:o=0,align:u="center",alignOffset:d=0,arrowPadding:O=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:x=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:y="optimized",onPlaced:Q,...w}=t,$=J0(Lf,s),[j,z]=v.useState(null),N=it(a,Bt=>z(Bt)),[_,G]=v.useState(null),R=Zk(_),X=(R==null?void 0:R.width)??0,T=(R==null?void 0:R.height)??0,V=l+(u!=="center"?"-"+u:""),M=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ae=Array.isArray(p)?p:[p],F=ae.length>0,le={padding:M,boundary:ae.filter(Yk),altBoundary:F},{refs:oe,floatingStyles:H,placement:P,isPositioned:W,middlewareData:E}=wk({strategy:"fixed",placement:V,whileElementsMounted:(...Bt)=>mk(...Bt,{animationFrame:y==="always"}),elements:{reference:$.anchor},middleware:[$k({mainAxis:o+T,alignmentAxis:d}),h&&Tk({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Nk():void 0,...le}),h&&Pk({...le}),zk({...le,apply:({elements:Bt,rects:yt,availableWidth:Hl,availableHeight:Il})=>{const{width:eu,height:yi}=yt.reference,ha=Bt.floating.style;ha.setProperty("--radix-popper-available-width",`${Hl}px`),ha.setProperty("--radix-popper-available-height",`${Il}px`),ha.setProperty("--radix-popper-anchor-width",`${eu}px`),ha.setProperty("--radix-popper-anchor-height",`${yi}px`)}}),_&&Ck({element:_,padding:O}),Uk({arrowWidth:X,arrowHeight:T}),b&&Rk({strategy:"referenceHidden",...le})]}),[ce,ee]=rb(P),be=zt(Q);ra(()=>{W&&(be==null||be())},[W,be]);const Se=(Ce=E.arrow)==null?void 0:Ce.x,ye=(Ot=E.arrow)==null?void 0:Ot.y,Re=((Ae=E.arrow)==null?void 0:Ae.centerOffset)!==0,[B,ue]=v.useState();return ra(()=>{j&&ue(window.getComputedStyle(j).zIndex)},[j]),r.jsx("div",{ref:oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:W?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[(He=E.transformOrigin)==null?void 0:He.x,(bt=E.transformOrigin)==null?void 0:bt.y].join(" "),...((un=E.hide)==null?void 0:un.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:r.jsx(Ek,{scope:s,placedSide:ce,onArrowChange:G,arrowX:Se,arrowY:ye,shouldHideArrow:Re,children:r.jsx(Be.div,{"data-side":ce,"data-align":ee,...w,ref:N,style:{...w.style,animation:W?void 0:"none"}})})})});ab.displayName=Lf;var sb="PopperArrow",Mk={top:"bottom",right:"left",bottom:"top",left:"right"},lb=v.forwardRef(function(a,s){const{__scopePopper:l,...o}=a,u=qk(sb,l),d=Mk[u.placedSide];return r.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:r.jsx(_k,{...o,ref:s,style:{...o.style,display:"block"}})})});lb.displayName=sb;function Yk(t){return t!==null}var Uk=t=>({name:"transformOrigin",options:t,fn(a){var $,j,z;const{placement:s,rects:l,middlewareData:o}=a,d=(($=o.arrow)==null?void 0:$.centerOffset)!==0,O=d?0:t.arrowWidth,h=d?0:t.arrowHeight,[p,x]=rb(s),g={start:"0%",center:"50%",end:"100%"}[x],b=(((j=o.arrow)==null?void 0:j.x)??0)+O/2,y=(((z=o.arrow)==null?void 0:z.y)??0)+h/2;let Q="",w="";return p==="bottom"?(Q=d?g:`${b}px`,w=`${-h}px`):p==="top"?(Q=d?g:`${b}px`,w=`${l.floating.height+h}px`):p==="right"?(Q=`${-h}px`,w=d?g:`${y}px`):p==="left"&&(Q=`${l.floating.width+h}px`,w=d?g:`${y}px`),{data:{x:Q,y:w}}}});function rb(t){const[a,s="center"]=t.split("-");return[a,s]}var Vk=eb,Gk=nb,Lk=ab,Dk=lb,Wk="Portal",Df=v.forwardRef((t,a)=>{var O;const{container:s,...l}=t,[o,u]=v.useState(!1);ra(()=>u(!0),[]);const d=s||o&&((O=globalThis==null?void 0:globalThis.document)==null?void 0:O.body);return d?Sj.createPortal(r.jsx(Be.div,{...l,ref:a}),d):null});Df.displayName=Wk;function Bk(t,a){return v.useReducer((s,l)=>a[s][l]??s,t)}var bn=t=>{const{present:a,children:s}=t,l=Hk(a),o=typeof s=="function"?s({present:l.isPresent}):v.Children.only(s),u=it(l.ref,Ik(o));return typeof s=="function"||l.isPresent?v.cloneElement(o,{ref:u}):null};bn.displayName="Presence";function Hk(t){const[a,s]=v.useState(),l=v.useRef(null),o=v.useRef(t),u=v.useRef("none"),d=t?"mounted":"unmounted",[O,h]=Bk(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const p=Yo(l.current);u.current=O==="mounted"?p:"none"},[O]),ra(()=>{const p=l.current,x=o.current;if(x!==t){const b=u.current,y=Yo(p);t?h("MOUNT"):y==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(x&&b!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,h]),ra(()=>{if(a){let p;const x=a.ownerDocument.defaultView??window,g=y=>{const w=Yo(l.current).includes(CSS.escape(y.animationName));if(y.target===a&&w&&(h("ANIMATION_END"),!o.current)){const $=a.style.animationFillMode;a.style.animationFillMode="forwards",p=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=$)})}},b=y=>{y.target===a&&(u.current=Yo(l.current))};return a.addEventListener("animationstart",b),a.addEventListener("animationcancel",g),a.addEventListener("animationend",g),()=>{x.clearTimeout(p),a.removeEventListener("animationstart",b),a.removeEventListener("animationcancel",g),a.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[a,h]),{isPresent:["mounted","unmountSuspended"].includes(O),ref:v.useCallback(p=>{l.current=p?getComputedStyle(p):null,s(p)},[])}}function Yo(t){return(t==null?void 0:t.animationName)||"none"}function Ik(t){var l,o;let a=(l=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:l.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?t.ref:(a=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?t.props.ref:t.props.ref||t.ref)}var Fk=k0[" useInsertionEffect ".trim().toString()]||ra;function Mc({prop:t,defaultProp:a,onChange:s=()=>{},caller:l}){const[o,u,d]=Kk({defaultProp:a,onChange:s}),O=t!==void 0,h=O?t:o;{const x=v.useRef(t!==void 0);v.useEffect(()=>{const g=x.current;g!==O&&console.warn(`${l} is changing from ${g?"controlled":"uncontrolled"} to ${O?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=O},[O,l])}const p=v.useCallback(x=>{var g;if(O){const b=Jk(x)?x(t):x;b!==t&&((g=d.current)==null||g.call(d,b))}else u(x)},[O,t,u,d]);return[h,p]}function Kk({defaultProp:t,onChange:a}){const[s,l]=v.useState(t),o=v.useRef(s),u=v.useRef(a);return Fk(()=>{u.current=a},[a]),v.useEffect(()=>{var d;o.current!==s&&((d=u.current)==null||d.call(u,s),o.current=s)},[s,o]),[s,l,u]}function Jk(t){return typeof t=="function"}var e$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),t$="VisuallyHidden",ib=v.forwardRef((t,a)=>r.jsx(Be.span,{...t,ref:a,style:{...e$,...t.style}}));ib.displayName=t$;var n$=ib,[Yc]=Xs("Tooltip",[K0]),Uc=K0(),ob="TooltipProvider",a$=700,Of="tooltip.open",[s$,Wf]=Yc(ob),cb=t=>{const{__scopeTooltip:a,delayDuration:s=a$,skipDelayDuration:l=300,disableHoverableContent:o=!1,children:u}=t,d=v.useRef(!0),O=v.useRef(!1),h=v.useRef(0);return v.useEffect(()=>{const p=h.current;return()=>window.clearTimeout(p)},[]),r.jsx(s$,{scope:a,isOpenDelayedRef:d,delayDuration:s,onOpen:v.useCallback(()=>{window.clearTimeout(h.current),d.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>d.current=!0,l)},[l]),isPointerInTransitRef:O,onPointerInTransitChange:v.useCallback(p=>{O.current=p},[]),disableHoverableContent:o,children:u})};cb.displayName=ob;var ti="Tooltip",[l$,hi]=Yc(ti),ub=t=>{const{__scopeTooltip:a,children:s,open:l,defaultOpen:o,onOpenChange:u,disableHoverableContent:d,delayDuration:O}=t,h=Wf(ti,t.__scopeTooltip),p=Uc(a),[x,g]=v.useState(null),b=Tl(),y=v.useRef(0),Q=d??h.disableHoverableContent,w=O??h.delayDuration,$=v.useRef(!1),[j,z]=Mc({prop:l,defaultProp:o??!1,onChange:X=>{X?(h.onOpen(),document.dispatchEvent(new CustomEvent(Of))):h.onClose(),u==null||u(X)},caller:ti}),N=v.useMemo(()=>j?$.current?"delayed-open":"instant-open":"closed",[j]),_=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,$.current=!1,z(!0)},[z]),G=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,z(!1)},[z]),R=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{$.current=!0,z(!0),y.current=0},w)},[w,z]);return v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),r.jsx(Vk,{...p,children:r.jsx(l$,{scope:a,contentId:b,open:j,stateAttribute:N,trigger:x,onTriggerChange:g,onTriggerEnter:v.useCallback(()=>{h.isOpenDelayedRef.current?R():_()},[h.isOpenDelayedRef,R,_]),onTriggerLeave:v.useCallback(()=>{Q?G():(window.clearTimeout(y.current),y.current=0)},[G,Q]),onOpen:_,onClose:G,disableHoverableContent:Q,children:s})})};ub.displayName=ti;var ff="TooltipTrigger",db=v.forwardRef((t,a)=>{const{__scopeTooltip:s,...l}=t,o=hi(ff,s),u=Wf(ff,s),d=Uc(s),O=v.useRef(null),h=it(a,O,o.onTriggerChange),p=v.useRef(!1),x=v.useRef(!1),g=v.useCallback(()=>p.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),r.jsx(Gk,{asChild:!0,...d,children:r.jsx(Be.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...l,ref:h,onPointerMove:qe(t.onPointerMove,b=>{b.pointerType!=="touch"&&!x.current&&!u.isPointerInTransitRef.current&&(o.onTriggerEnter(),x.current=!0)}),onPointerLeave:qe(t.onPointerLeave,()=>{o.onTriggerLeave(),x.current=!1}),onPointerDown:qe(t.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:qe(t.onFocus,()=>{p.current||o.onOpen()}),onBlur:qe(t.onBlur,o.onClose),onClick:qe(t.onClick,o.onClose)})})});db.displayName=ff;var Bf="TooltipPortal",[r$,i$]=Yc(Bf,{forceMount:void 0}),Ob=t=>{const{__scopeTooltip:a,forceMount:s,children:l,container:o}=t,u=hi(Bf,a);return r.jsx(r$,{scope:a,forceMount:s,children:r.jsx(bn,{present:s||u.open,children:r.jsx(Df,{asChild:!0,container:o,children:l})})})};Ob.displayName=Bf;var Zl="TooltipContent",fb=v.forwardRef((t,a)=>{const s=i$(Zl,t.__scopeTooltip),{forceMount:l=s.forceMount,side:o="top",...u}=t,d=hi(Zl,t.__scopeTooltip);return r.jsx(bn,{present:l||d.open,children:d.disableHoverableContent?r.jsx(hb,{side:o,...u,ref:a}):r.jsx(o$,{side:o,...u,ref:a})})}),o$=v.forwardRef((t,a)=>{const s=hi(Zl,t.__scopeTooltip),l=Wf(Zl,t.__scopeTooltip),o=v.useRef(null),u=it(a,o),[d,O]=v.useState(null),{trigger:h,onClose:p}=s,x=o.current,{onPointerInTransitChange:g}=l,b=v.useCallback(()=>{O(null),g(!1)},[g]),y=v.useCallback((Q,w)=>{const $=Q.currentTarget,j={x:Q.clientX,y:Q.clientY},z=O$(j,$.getBoundingClientRect()),N=f$(j,z),_=h$(w.getBoundingClientRect()),G=p$([...N,..._]);O(G),g(!0)},[g]);return v.useEffect(()=>()=>b(),[b]),v.useEffect(()=>{if(h&&x){const Q=$=>y($,x),w=$=>y($,h);return h.addEventListener("pointerleave",Q),x.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",Q),x.removeEventListener("pointerleave",w)}}},[h,x,y,b]),v.useEffect(()=>{if(d){const Q=w=>{const $=w.target,j={x:w.clientX,y:w.clientY},z=(h==null?void 0:h.contains($))||(x==null?void 0:x.contains($)),N=!m$(j,d);z?b():N&&(b(),p())};return document.addEventListener("pointermove",Q),()=>document.removeEventListener("pointermove",Q)}},[h,x,d,p,b]),r.jsx(hb,{...t,ref:u})}),[c$,u$]=Yc(ti,{isInside:!1}),d$=hw("TooltipContent"),hb=v.forwardRef((t,a)=>{const{__scopeTooltip:s,children:l,"aria-label":o,onEscapeKeyDown:u,onPointerDownOutside:d,...O}=t,h=hi(Zl,s),p=Uc(s),{onClose:x}=h;return v.useEffect(()=>(document.addEventListener(Of,x),()=>document.removeEventListener(Of,x)),[x]),v.useEffect(()=>{if(h.trigger){const g=b=>{const y=b.target;y!=null&&y.contains(h.trigger)&&x()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,x]),r.jsx(Af,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g=>g.preventDefault(),onDismiss:x,children:r.jsxs(Lk,{"data-state":h.stateAttribute,...p,...O,ref:a,style:{...O.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[r.jsx(d$,{children:l}),r.jsx(c$,{scope:s,isInside:!0,children:r.jsx(n$,{id:h.contentId,role:"tooltip",children:o||l})})]})})});fb.displayName=Zl;var mb="TooltipArrow",pb=v.forwardRef((t,a)=>{const{__scopeTooltip:s,...l}=t,o=Uc(s);return u$(mb,s).isInside?null:r.jsx(Dk,{...o,...l,ref:a})});pb.displayName=mb;function O$(t,a){const s=Math.abs(a.top-t.y),l=Math.abs(a.bottom-t.y),o=Math.abs(a.right-t.x),u=Math.abs(a.left-t.x);switch(Math.min(s,l,o,u)){case u:return"left";case o:return"right";case s:return"top";case l:return"bottom";default:throw new Error("unreachable")}}function f$(t,a,s=5){const l=[];switch(a){case"top":l.push({x:t.x-s,y:t.y+s},{x:t.x+s,y:t.y+s});break;case"bottom":l.push({x:t.x-s,y:t.y-s},{x:t.x+s,y:t.y-s});break;case"left":l.push({x:t.x+s,y:t.y-s},{x:t.x+s,y:t.y+s});break;case"right":l.push({x:t.x-s,y:t.y-s},{x:t.x-s,y:t.y+s});break}return l}function h$(t){const{top:a,right:s,bottom:l,left:o}=t;return[{x:o,y:a},{x:s,y:a},{x:s,y:l},{x:o,y:l}]}function m$(t,a){const{x:s,y:l}=t;let o=!1;for(let u=0,d=a.length-1;u<a.length;d=u++){const O=a[u],h=a[d],p=O.x,x=O.y,g=h.x,b=h.y;x>l!=b>l&&s<(g-p)*(l-x)/(b-x)+p&&(o=!o)}return o}function p$(t){const a=t.slice();return a.sort((s,l)=>s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0),x$(a)}function x$(t){if(t.length<=1)return t.slice();const a=[];for(let l=0;l<t.length;l++){const o=t[l];for(;a.length>=2;){const u=a[a.length-1],d=a[a.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))a.pop();else break}a.push(o)}a.pop();const s=[];for(let l=t.length-1;l>=0;l--){const o=t[l];for(;s.length>=2;){const u=s[s.length-1],d=s[s.length-2];if((u.x-d.x)*(o.y-d.y)>=(u.y-d.y)*(o.x-d.x))s.pop();else break}s.push(o)}return s.pop(),a.length===1&&s.length===1&&a[0].x===s[0].x&&a[0].y===s[0].y?a:a.concat(s)}var g$=cb,b$=ub,v$=db,y$=Ob,S$=fb,Q$=pb;function xb(t){var a,s,l="";if(typeof t=="string"||typeof t=="number")l+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(a=0;a<o;a++)t[a]&&(s=xb(t[a]))&&(l&&(l+=" "),l+=s)}else for(s in t)t[s]&&(l&&(l+=" "),l+=s);return l}function j$(){for(var t,a,s=0,l="",o=arguments.length;s<o;s++)(t=arguments[s])&&(a=xb(t))&&(l&&(l+=" "),l+=a);return l}const w$=(t,a)=>{const s=new Array(t.length+a.length);for(let l=0;l<t.length;l++)s[l]=t[l];for(let l=0;l<a.length;l++)s[t.length+l]=a[l];return s},k$=(t,a)=>({classGroupId:t,validator:a}),gb=(t=new Map,a=null,s)=>({nextPart:t,validators:a,classGroupId:s}),mc="-",Hg=[],$$="arbitrary..",T$=t=>{const a=P$(t),{conflictingClassGroups:s,conflictingClassGroupModifiers:l}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return N$(d);const O=d.split(mc),h=O[0]===""&&O.length>1?1:0;return bb(O,h,a)},getConflictingClassGroupIds:(d,O)=>{if(O){const h=l[d],p=s[d];return h?p?w$(p,h):h:p||Hg}return s[d]||Hg}}},bb=(t,a,s)=>{if(t.length-a===0)return s.classGroupId;const o=t[a],u=s.nextPart.get(o);if(u){const p=bb(t,a+1,u);if(p)return p}const d=s.validators;if(d===null)return;const O=a===0?t.join(mc):t.slice(a).join(mc),h=d.length;for(let p=0;p<h;p++){const x=d[p];if(x.validator(O))return x.classGroupId}},N$=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=t.slice(1,-1),s=a.indexOf(":"),l=a.slice(0,s);return l?$$+l:void 0})(),P$=t=>{const{theme:a,classGroups:s}=t;return z$(s,a)},z$=(t,a)=>{const s=gb();for(const l in t){const o=t[l];Hf(o,s,l,a)}return s},Hf=(t,a,s,l)=>{const o=t.length;for(let u=0;u<o;u++){const d=t[u];R$(d,a,s,l)}},R$=(t,a,s,l)=>{if(typeof t=="string"){C$(t,a,s);return}if(typeof t=="function"){X$(t,a,s,l);return}_$(t,a,s,l)},C$=(t,a,s)=>{const l=t===""?a:vb(a,t);l.classGroupId=s},X$=(t,a,s,l)=>{if(Z$(t)){Hf(t(l),a,s,l);return}a.validators===null&&(a.validators=[]),a.validators.push(k$(s,t))},_$=(t,a,s,l)=>{const o=Object.entries(t),u=o.length;for(let d=0;d<u;d++){const[O,h]=o[d];Hf(h,vb(a,O),s,l)}},vb=(t,a)=>{let s=t;const l=a.split(mc),o=l.length;for(let u=0;u<o;u++){const d=l[u];let O=s.nextPart.get(d);O||(O=gb(),s.nextPart.set(d,O)),s=O}return s},Z$=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,A$=t=>{if(t<1)return{get:()=>{},set:()=>{}};let a=0,s=Object.create(null),l=Object.create(null);const o=(u,d)=>{s[u]=d,a++,a>t&&(a=0,l=s,s=Object.create(null))};return{get(u){let d=s[u];if(d!==void 0)return d;if((d=l[u])!==void 0)return o(u,d),d},set(u,d){u in s?s[u]=d:o(u,d)}}},hf="!",Ig=":",E$=[],Fg=(t,a,s,l,o)=>({modifiers:t,hasImportantModifier:a,baseClassName:s,maybePostfixModifierPosition:l,isExternal:o}),q$=t=>{const{prefix:a,experimentalParseClassName:s}=t;let l=o=>{const u=[];let d=0,O=0,h=0,p;const x=o.length;for(let w=0;w<x;w++){const $=o[w];if(d===0&&O===0){if($===Ig){u.push(o.slice(h,w)),h=w+1;continue}if($==="/"){p=w;continue}}$==="["?d++:$==="]"?d--:$==="("?O++:$===")"&&O--}const g=u.length===0?o:o.slice(h);let b=g,y=!1;g.endsWith(hf)?(b=g.slice(0,-1),y=!0):g.startsWith(hf)&&(b=g.slice(1),y=!0);const Q=p&&p>h?p-h:void 0;return Fg(u,y,b,Q)};if(a){const o=a+Ig,u=l;l=d=>d.startsWith(o)?u(d.slice(o.length)):Fg(E$,!1,d,void 0,!0)}if(s){const o=l;l=u=>s({className:u,parseClassName:o})}return l},M$=t=>{const a=new Map;return t.orderSensitiveModifiers.forEach((s,l)=>{a.set(s,1e6+l)}),s=>{const l=[];let o=[];for(let u=0;u<s.length;u++){const d=s[u],O=d[0]==="[",h=a.has(d);O||h?(o.length>0&&(o.sort(),l.push(...o),o=[]),l.push(d)):o.push(d)}return o.length>0&&(o.sort(),l.push(...o)),l}},Y$=t=>({cache:A$(t.cacheSize),parseClassName:q$(t),sortModifiers:M$(t),...T$(t)}),U$=/\s+/,V$=(t,a)=>{const{parseClassName:s,getClassGroupId:l,getConflictingClassGroupIds:o,sortModifiers:u}=a,d=[],O=t.trim().split(U$);let h="";for(let p=O.length-1;p>=0;p-=1){const x=O[p],{isExternal:g,modifiers:b,hasImportantModifier:y,baseClassName:Q,maybePostfixModifierPosition:w}=s(x);if(g){h=x+(h.length>0?" "+h:h);continue}let $=!!w,j=l($?Q.substring(0,w):Q);if(!j){if(!$){h=x+(h.length>0?" "+h:h);continue}if(j=l(Q),!j){h=x+(h.length>0?" "+h:h);continue}$=!1}const z=b.length===0?"":b.length===1?b[0]:u(b).join(":"),N=y?z+hf:z,_=N+j;if(d.indexOf(_)>-1)continue;d.push(_);const G=o(j,$);for(let R=0;R<G.length;++R){const X=G[R];d.push(N+X)}h=x+(h.length>0?" "+h:h)}return h},G$=(...t)=>{let a=0,s,l,o="";for(;a<t.length;)(s=t[a++])&&(l=yb(s))&&(o&&(o+=" "),o+=l);return o},yb=t=>{if(typeof t=="string")return t;let a,s="";for(let l=0;l<t.length;l++)t[l]&&(a=yb(t[l]))&&(s&&(s+=" "),s+=a);return s},L$=(t,...a)=>{let s,l,o,u;const d=h=>{const p=a.reduce((x,g)=>g(x),t());return s=Y$(p),l=s.cache.get,o=s.cache.set,u=O,O(h)},O=h=>{const p=l(h);if(p)return p;const x=V$(h,s);return o(h,x),x};return u=d,(...h)=>u(G$(...h))},D$=[],ct=t=>{const a=s=>s[t]||D$;return a.isThemeGetter=!0,a},Sb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,W$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,B$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,H$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,I$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,K$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ma=t=>W$.test(t),we=t=>!!t&&!Number.isNaN(Number(t)),Ya=t=>!!t&&Number.isInteger(Number(t)),yO=t=>t.endsWith("%")&&we(t.slice(0,-1)),Kn=t=>B$.test(t),jb=()=>!0,J$=t=>H$.test(t)&&!I$.test(t),If=()=>!1,e5=t=>F$.test(t),t5=t=>K$.test(t),n5=t=>!Oe(t)&&!fe(t),a5=t=>ts(t,$b,If),Oe=t=>Sb.test(t),Qs=t=>ts(t,Tb,J$),Kg=t=>ts(t,d5,we),s5=t=>ts(t,Pb,jb),l5=t=>ts(t,Nb,If),Jg=t=>ts(t,wb,If),r5=t=>ts(t,kb,t5),Uo=t=>ts(t,zb,e5),fe=t=>Qb.test(t),Lr=t=>_s(t,Tb),i5=t=>_s(t,Nb),e1=t=>_s(t,wb),o5=t=>_s(t,$b),c5=t=>_s(t,kb),Vo=t=>_s(t,zb,!0),u5=t=>_s(t,Pb,!0),ts=(t,a,s)=>{const l=Sb.exec(t);return l?l[1]?a(l[1]):s(l[2]):!1},_s=(t,a,s=!1)=>{const l=Qb.exec(t);return l?l[1]?a(l[1]):s:!1},wb=t=>t==="position"||t==="percentage",kb=t=>t==="image"||t==="url",$b=t=>t==="length"||t==="size"||t==="bg-size",Tb=t=>t==="length",d5=t=>t==="number",Nb=t=>t==="family-name",Pb=t=>t==="number"||t==="weight",zb=t=>t==="shadow",O5=()=>{const t=ct("color"),a=ct("font"),s=ct("text"),l=ct("font-weight"),o=ct("tracking"),u=ct("leading"),d=ct("breakpoint"),O=ct("container"),h=ct("spacing"),p=ct("radius"),x=ct("shadow"),g=ct("inset-shadow"),b=ct("text-shadow"),y=ct("drop-shadow"),Q=ct("blur"),w=ct("perspective"),$=ct("aspect"),j=ct("ease"),z=ct("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[..._(),fe,Oe],R=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto","contain","none"],T=()=>[fe,Oe,h],V=()=>[Ma,"full","auto",...T()],M=()=>[Ya,"none","subgrid",fe,Oe],ae=()=>["auto",{span:["full",Ya,fe,Oe]},Ya,fe,Oe],F=()=>[Ya,"auto",fe,Oe],le=()=>["auto","min","max","fr",fe,Oe],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...T()],W=()=>[Ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],E=()=>[Ma,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ce=()=>[Ma,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],ee=()=>[t,fe,Oe],be=()=>[..._(),e1,Jg,{position:[fe,Oe]}],Se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ye=()=>["auto","cover","contain",o5,a5,{size:[fe,Oe]}],Re=()=>[yO,Lr,Qs],B=()=>["","none","full",p,fe,Oe],ue=()=>["",we,Lr,Qs],Ce=()=>["solid","dashed","dotted","double"],Ot=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ae=()=>[we,yO,e1,Jg],He=()=>["","none",Q,fe,Oe],bt=()=>["none",we,fe,Oe],un=()=>["none",we,fe,Oe],Bt=()=>[we,fe,Oe],yt=()=>[Ma,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kn],breakpoint:[Kn],color:[jb],container:[Kn],"drop-shadow":[Kn],ease:["in","out","in-out"],font:[n5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kn],shadow:[Kn],spacing:["px",we],text:[Kn],"text-shadow":[Kn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ma,Oe,fe,$]}],container:["container"],columns:[{columns:[we,Oe,fe,O]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:G()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Ya,"auto",fe,Oe]}],basis:[{basis:[Ma,"full","auto",O,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,Ma,"auto","initial","none",Oe]}],grow:[{grow:["",we,fe,Oe]}],shrink:[{shrink:["",we,fe,Oe]}],order:[{order:[Ya,"first","last","none",fe,Oe]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...E()]}],"min-inline-size":[{"min-inline":["auto",...E()]}],"max-inline-size":[{"max-inline":["none",...E()]}],"block-size":[{block:["auto",...ce()]}],"min-block-size":[{"min-block":["auto",...ce()]}],"max-block-size":[{"max-block":["none",...ce()]}],w:[{w:[O,"screen",...W()]}],"min-w":[{"min-w":[O,"screen","none",...W()]}],"max-w":[{"max-w":[O,"screen","none","prose",{screen:[d]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",s,Lr,Qs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,u5,s5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yO,Oe]}],"font-family":[{font:[i5,l5,a]}],"font-features":[{"font-features":[Oe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,fe,Oe]}],"line-clamp":[{"line-clamp":[we,"none",fe,Kg]}],leading:[{leading:[u,...T()]}],"list-image":[{"list-image":["none",fe,Oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,Oe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",fe,Qs]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[we,"auto",fe,Oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,Oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,Oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:be()}],"bg-repeat":[{bg:Se()}],"bg-size":[{bg:ye()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ya,fe,Oe],radial:["",fe,Oe],conic:[Ya,fe,Oe]},c5,r5]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,fe,Oe]}],"outline-w":[{outline:["",we,Lr,Qs]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",x,Vo,Uo]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",g,Vo,Uo]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[we,Qs]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",b,Vo,Uo]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[we,fe,Oe]}],"mix-blend":[{"mix-blend":[...Ot(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ot()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ae()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":Ae()}],"mask-image-t-to-pos":[{"mask-t-to":Ae()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":Ae()}],"mask-image-r-to-pos":[{"mask-r-to":Ae()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":Ae()}],"mask-image-b-to-pos":[{"mask-b-to":Ae()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":Ae()}],"mask-image-l-to-pos":[{"mask-l-to":Ae()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":Ae()}],"mask-image-x-to-pos":[{"mask-x-to":Ae()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":Ae()}],"mask-image-y-to-pos":[{"mask-y-to":Ae()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[fe,Oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ae()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ae()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:be()}],"mask-repeat":[{mask:Se()}],"mask-size":[{mask:ye()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,Oe]}],filter:[{filter:["","none",fe,Oe]}],blur:[{blur:He()}],brightness:[{brightness:[we,fe,Oe]}],contrast:[{contrast:[we,fe,Oe]}],"drop-shadow":[{"drop-shadow":["","none",y,Vo,Uo]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",we,fe,Oe]}],"hue-rotate":[{"hue-rotate":[we,fe,Oe]}],invert:[{invert:["",we,fe,Oe]}],saturate:[{saturate:[we,fe,Oe]}],sepia:[{sepia:["",we,fe,Oe]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,Oe]}],"backdrop-blur":[{"backdrop-blur":He()}],"backdrop-brightness":[{"backdrop-brightness":[we,fe,Oe]}],"backdrop-contrast":[{"backdrop-contrast":[we,fe,Oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,fe,Oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,fe,Oe]}],"backdrop-invert":[{"backdrop-invert":["",we,fe,Oe]}],"backdrop-opacity":[{"backdrop-opacity":[we,fe,Oe]}],"backdrop-saturate":[{"backdrop-saturate":[we,fe,Oe]}],"backdrop-sepia":[{"backdrop-sepia":["",we,fe,Oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,Oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",fe,Oe]}],ease:[{ease:["linear","initial",j,fe,Oe]}],delay:[{delay:[we,fe,Oe]}],animate:[{animate:["none",z,fe,Oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,fe,Oe]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:bt()}],"rotate-x":[{"rotate-x":bt()}],"rotate-y":[{"rotate-y":bt()}],"rotate-z":[{"rotate-z":bt()}],scale:[{scale:un()}],"scale-x":[{"scale-x":un()}],"scale-y":[{"scale-y":un()}],"scale-z":[{"scale-z":un()}],"scale-3d":["scale-3d"],skew:[{skew:Bt()}],"skew-x":[{"skew-x":Bt()}],"skew-y":[{"skew-y":Bt()}],transform:[{transform:[fe,Oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:yt()}],"translate-x":[{"translate-x":yt()}],"translate-y":[{"translate-y":yt()}],"translate-z":[{"translate-z":yt()}],"translate-none":["translate-none"],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,Oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,Oe]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[we,Lr,Qs,Kg]}],stroke:[{stroke:["none",...ee()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},f5=L$(O5);function re(...t){return f5(j$(t))}function h5({children:t}){return r.jsx(g$,{delayDuration:300,children:t})}function t1({children:t,content:a,side:s="top",className:l}){return a?r.jsxs(b$,{children:[r.jsx(v$,{asChild:!0,children:t}),r.jsx(y$,{children:r.jsxs(S$,{side:s,sideOffset:6,className:re("z-50 px-2.5 py-1.5 text-xs font-sans","bg-surface-4 text-text-0 border border-border rounded-md shadow-lg","animate-in fade-in-0 zoom-in-95",l),children:[a,r.jsx(Q$,{className:"fill-surface-4"})]})})]}):t}/**
|
|
30
30
|
* @license lucide-react v1.7.0 - ISC
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
@@ -61,512 +61,512 @@ Error generating stack: `+c.message+`
|
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
64
|
+
*/const se=(t,a)=>{const s=v.forwardRef(({className:l,...o},u)=>v.createElement(v5,{ref:u,iconNode:a,className:Rb(`lucide-${m5(n1(t))}`,`lucide-${t}`,l),...o}));return s.displayName=n1(t),s};/**
|
|
65
65
|
* @license lucide-react v1.7.0 - ISC
|
|
66
66
|
*
|
|
67
67
|
* This source code is licensed under the ISC license.
|
|
68
68
|
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const y5=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],pc=
|
|
69
|
+
*/const y5=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],pc=se("activity",y5);/**
|
|
70
70
|
* @license lucide-react v1.7.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const S5=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Q5=
|
|
74
|
+
*/const S5=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Q5=se("arrow-up",S5);/**
|
|
75
75
|
* @license lucide-react v1.7.0 - ISC
|
|
76
76
|
*
|
|
77
77
|
* This source code is licensed under the ISC license.
|
|
78
78
|
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const j5=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],w5=
|
|
79
|
+
*/const j5=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],w5=se("book-open",j5);/**
|
|
80
80
|
* @license lucide-react v1.7.0 - ISC
|
|
81
81
|
*
|
|
82
82
|
* This source code is licensed under the ISC license.
|
|
83
83
|
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const k5=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Ff=
|
|
84
|
+
*/const k5=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Ff=se("box",k5);/**
|
|
85
85
|
* @license lucide-react v1.7.0 - ISC
|
|
86
86
|
*
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const $5=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],T5=
|
|
89
|
+
*/const $5=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],T5=se("brain",$5);/**
|
|
90
90
|
* @license lucide-react v1.7.0 - ISC
|
|
91
91
|
*
|
|
92
92
|
* This source code is licensed under the ISC license.
|
|
93
93
|
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const N5=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],P5=
|
|
94
|
+
*/const N5=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],P5=se("calculator",N5);/**
|
|
95
95
|
* @license lucide-react v1.7.0 - ISC
|
|
96
96
|
*
|
|
97
97
|
* This source code is licensed under the ISC license.
|
|
98
98
|
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const z5=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],xc=
|
|
99
|
+
*/const z5=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],xc=se("calendar",z5);/**
|
|
100
100
|
* @license lucide-react v1.7.0 - ISC
|
|
101
101
|
*
|
|
102
102
|
* This source code is licensed under the ISC license.
|
|
103
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const R5=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Vc=
|
|
104
|
+
*/const R5=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Vc=se("chart-column",R5);/**
|
|
105
105
|
* @license lucide-react v1.7.0 - ISC
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const C5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Dt=
|
|
109
|
+
*/const C5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Dt=se("check",C5);/**
|
|
110
110
|
* @license lucide-react v1.7.0 - ISC
|
|
111
111
|
*
|
|
112
112
|
* This source code is licensed under the ISC license.
|
|
113
113
|
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const X5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ca=
|
|
114
|
+
*/const X5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ca=se("chevron-down",X5);/**
|
|
115
115
|
* @license lucide-react v1.7.0 - ISC
|
|
116
116
|
*
|
|
117
117
|
* This source code is licensed under the ISC license.
|
|
118
118
|
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const _5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Cb=
|
|
119
|
+
*/const _5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Cb=se("chevron-left",_5);/**
|
|
120
120
|
* @license lucide-react v1.7.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Z5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ll=
|
|
124
|
+
*/const Z5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ll=se("chevron-right",Z5);/**
|
|
125
125
|
* @license lucide-react v1.7.0 - ISC
|
|
126
126
|
*
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const A5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ua=
|
|
129
|
+
*/const A5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ua=se("circle-alert",A5);/**
|
|
130
130
|
* @license lucide-react v1.7.0 - ISC
|
|
131
131
|
*
|
|
132
132
|
* This source code is licensed under the ISC license.
|
|
133
133
|
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const E5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ni=
|
|
134
|
+
*/const E5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ni=se("circle-check-big",E5);/**
|
|
135
135
|
* @license lucide-react v1.7.0 - ISC
|
|
136
136
|
*
|
|
137
137
|
* This source code is licensed under the ISC license.
|
|
138
138
|
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const q5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mf=
|
|
139
|
+
*/const q5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mf=se("circle-check",q5);/**
|
|
140
140
|
* @license lucide-react v1.7.0 - ISC
|
|
141
141
|
*
|
|
142
142
|
* This source code is licensed under the ISC license.
|
|
143
143
|
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const M5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],gc=
|
|
144
|
+
*/const M5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],gc=se("circle-question-mark",M5);/**
|
|
145
145
|
* @license lucide-react v1.7.0 - ISC
|
|
146
146
|
*
|
|
147
147
|
* This source code is licensed under the ISC license.
|
|
148
148
|
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const Y5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Xb=
|
|
149
|
+
*/const Y5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Xb=se("circle-x",Y5);/**
|
|
150
150
|
* @license lucide-react v1.7.0 - ISC
|
|
151
151
|
*
|
|
152
152
|
* This source code is licensed under the ISC license.
|
|
153
153
|
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const U5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],pf=
|
|
154
|
+
*/const U5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],pf=se("clock",U5);/**
|
|
155
155
|
* @license lucide-react v1.7.0 - ISC
|
|
156
156
|
*
|
|
157
157
|
* This source code is licensed under the ISC license.
|
|
158
158
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const V5=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],G5=
|
|
159
|
+
*/const V5=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],G5=se("cloud",V5);/**
|
|
160
160
|
* @license lucide-react v1.7.0 - ISC
|
|
161
161
|
*
|
|
162
162
|
* This source code is licensed under the ISC license.
|
|
163
163
|
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const L5=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],ns=
|
|
164
|
+
*/const L5=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],ns=se("code-xml",L5);/**
|
|
165
165
|
* @license lucide-react v1.7.0 - ISC
|
|
166
166
|
*
|
|
167
167
|
* This source code is licensed under the ISC license.
|
|
168
168
|
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const D5=[["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"}]],xf=
|
|
169
|
+
*/const D5=[["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"}]],xf=se("copy",D5);/**
|
|
170
170
|
* @license lucide-react v1.7.0 - ISC
|
|
171
171
|
*
|
|
172
172
|
* This source code is licensed under the ISC license.
|
|
173
173
|
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const W5=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Al=
|
|
174
|
+
*/const W5=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Al=se("cpu",W5);/**
|
|
175
175
|
* @license lucide-react v1.7.0 - ISC
|
|
176
176
|
*
|
|
177
177
|
* This source code is licensed under the ISC license.
|
|
178
178
|
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const B5=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],H5=
|
|
179
|
+
*/const B5=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],H5=se("database",B5);/**
|
|
180
180
|
* @license lucide-react v1.7.0 - ISC
|
|
181
181
|
*
|
|
182
182
|
* This source code is licensed under the ISC license.
|
|
183
183
|
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const I5=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],F5=
|
|
184
|
+
*/const I5=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],F5=se("dollar-sign",I5);/**
|
|
185
185
|
* @license lucide-react v1.7.0 - ISC
|
|
186
186
|
*
|
|
187
187
|
* This source code is licensed under the ISC license.
|
|
188
188
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const K5=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],mi=
|
|
189
|
+
*/const K5=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],mi=se("download",K5);/**
|
|
190
190
|
* @license lucide-react v1.7.0 - ISC
|
|
191
191
|
*
|
|
192
192
|
* This source code is licensed under the ISC license.
|
|
193
193
|
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const J5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],bc=
|
|
194
|
+
*/const J5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],bc=se("external-link",J5);/**
|
|
195
195
|
* @license lucide-react v1.7.0 - ISC
|
|
196
196
|
*
|
|
197
197
|
* This source code is licensed under the ISC license.
|
|
198
198
|
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const eT=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Kf=
|
|
199
|
+
*/const eT=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Kf=se("eye-off",eT);/**
|
|
200
200
|
* @license lucide-react v1.7.0 - ISC
|
|
201
201
|
*
|
|
202
202
|
* This source code is licensed under the ISC license.
|
|
203
203
|
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const tT=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Dl=
|
|
204
|
+
*/const tT=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Dl=se("eye",tT);/**
|
|
205
205
|
* @license lucide-react v1.7.0 - ISC
|
|
206
206
|
*
|
|
207
207
|
* This source code is licensed under the ISC license.
|
|
208
208
|
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const nT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],aT=
|
|
209
|
+
*/const nT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],aT=se("file-code",nT);/**
|
|
210
210
|
* @license lucide-react v1.7.0 - ISC
|
|
211
211
|
*
|
|
212
212
|
* This source code is licensed under the ISC license.
|
|
213
213
|
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const sT=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],_b=
|
|
214
|
+
*/const sT=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],_b=se("file-pen",sT);/**
|
|
215
215
|
* @license lucide-react v1.7.0 - ISC
|
|
216
216
|
*
|
|
217
217
|
* This source code is licensed under the ISC license.
|
|
218
218
|
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const lT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],QO=
|
|
219
|
+
*/const lT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],QO=se("file-plus",lT);/**
|
|
220
220
|
* @license lucide-react v1.7.0 - ISC
|
|
221
221
|
*
|
|
222
222
|
* This source code is licensed under the ISC license.
|
|
223
223
|
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const rT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ba=
|
|
224
|
+
*/const rT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ba=se("file-text",rT);/**
|
|
225
225
|
* @license lucide-react v1.7.0 - ISC
|
|
226
226
|
*
|
|
227
227
|
* This source code is licensed under the ISC license.
|
|
228
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const iT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],oT=
|
|
229
|
+
*/const iT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],oT=se("file",iT);/**
|
|
230
230
|
* @license lucide-react v1.7.0 - ISC
|
|
231
231
|
*
|
|
232
232
|
* This source code is licensed under the ISC license.
|
|
233
233
|
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const cT=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],uT=
|
|
234
|
+
*/const cT=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],uT=se("flame",cT);/**
|
|
235
235
|
* @license lucide-react v1.7.0 - ISC
|
|
236
236
|
*
|
|
237
237
|
* This source code is licensed under the ISC license.
|
|
238
238
|
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const dT=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],OT=
|
|
239
|
+
*/const dT=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],OT=se("folder-closed",dT);/**
|
|
240
240
|
* @license lucide-react v1.7.0 - ISC
|
|
241
241
|
*
|
|
242
242
|
* This source code is licensed under the ISC license.
|
|
243
243
|
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const fT=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ai=
|
|
244
|
+
*/const fT=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ai=se("folder-open",fT);/**
|
|
245
245
|
* @license lucide-react v1.7.0 - ISC
|
|
246
246
|
*
|
|
247
247
|
* This source code is licensed under the ISC license.
|
|
248
248
|
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const hT=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],jO=
|
|
249
|
+
*/const hT=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],jO=se("folder-plus",hT);/**
|
|
250
250
|
* @license lucide-react v1.7.0 - ISC
|
|
251
251
|
*
|
|
252
252
|
* This source code is licensed under the ISC license.
|
|
253
253
|
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const mT=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],Zb=
|
|
254
|
+
*/const mT=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],Zb=se("folder-search",mT);/**
|
|
255
255
|
* @license lucide-react v1.7.0 - ISC
|
|
256
256
|
*
|
|
257
257
|
* This source code is licensed under the ISC license.
|
|
258
258
|
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const pT=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ab=
|
|
259
|
+
*/const pT=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ab=se("folder",pT);/**
|
|
260
260
|
* @license lucide-react v1.7.0 - ISC
|
|
261
261
|
*
|
|
262
262
|
* This source code is licensed under the ISC license.
|
|
263
263
|
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const xT=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Eb=
|
|
264
|
+
*/const xT=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Eb=se("gauge",xT);/**
|
|
265
265
|
* @license lucide-react v1.7.0 - ISC
|
|
266
266
|
*
|
|
267
267
|
* This source code is licensed under the ISC license.
|
|
268
268
|
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const gT=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],Jf=
|
|
269
|
+
*/const gT=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],Jf=se("hard-drive",gT);/**
|
|
270
270
|
* @license lucide-react v1.7.0 - ISC
|
|
271
271
|
*
|
|
272
272
|
* This source code is licensed under the ISC license.
|
|
273
273
|
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const bT=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],vT=
|
|
274
|
+
*/const bT=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],vT=se("headphones",bT);/**
|
|
275
275
|
* @license lucide-react v1.7.0 - ISC
|
|
276
276
|
*
|
|
277
277
|
* This source code is licensed under the ISC license.
|
|
278
278
|
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const yT=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],ST=
|
|
279
|
+
*/const yT=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],ST=se("heart",yT);/**
|
|
280
280
|
* @license lucide-react v1.7.0 - ISC
|
|
281
281
|
*
|
|
282
282
|
* This source code is licensed under the ISC license.
|
|
283
283
|
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const QT=[["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-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],jT=
|
|
284
|
+
*/const QT=[["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-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],jT=se("house",QT);/**
|
|
285
285
|
* @license lucide-react v1.7.0 - ISC
|
|
286
286
|
*
|
|
287
287
|
* This source code is licensed under the ISC license.
|
|
288
288
|
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const wT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],qb=
|
|
289
|
+
*/const wT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],qb=se("info",wT);/**
|
|
290
290
|
* @license lucide-react v1.7.0 - ISC
|
|
291
291
|
*
|
|
292
292
|
* This source code is licensed under the ISC license.
|
|
293
293
|
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const kT=[["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"}]],vc=
|
|
294
|
+
*/const kT=[["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"}]],vc=se("key",kT);/**
|
|
295
295
|
* @license lucide-react v1.7.0 - ISC
|
|
296
296
|
*
|
|
297
297
|
* This source code is licensed under the ISC license.
|
|
298
298
|
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const $T=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],a1=
|
|
299
|
+
*/const $T=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],a1=se("layers",$T);/**
|
|
300
300
|
* @license lucide-react v1.7.0 - ISC
|
|
301
301
|
*
|
|
302
302
|
* This source code is licensed under the ISC license.
|
|
303
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const TT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],NT=
|
|
304
|
+
*/const TT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],NT=se("layout-dashboard",TT);/**
|
|
305
305
|
* @license lucide-react v1.7.0 - ISC
|
|
306
306
|
*
|
|
307
307
|
* This source code is licensed under the ISC license.
|
|
308
308
|
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const PT=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],zT=
|
|
309
|
+
*/const PT=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],zT=se("list-checks",PT);/**
|
|
310
310
|
* @license lucide-react v1.7.0 - ISC
|
|
311
311
|
*
|
|
312
312
|
* This source code is licensed under the ISC license.
|
|
313
313
|
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const RT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ka=
|
|
314
|
+
*/const RT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ka=se("loader-circle",RT);/**
|
|
315
315
|
* @license lucide-react v1.7.0 - ISC
|
|
316
316
|
*
|
|
317
317
|
* This source code is licensed under the ISC license.
|
|
318
318
|
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const CT=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],eh=
|
|
319
|
+
*/const CT=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],eh=se("log-in",CT);/**
|
|
320
320
|
* @license lucide-react v1.7.0 - ISC
|
|
321
321
|
*
|
|
322
322
|
* This source code is licensed under the ISC license.
|
|
323
323
|
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const XT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Mb=
|
|
324
|
+
*/const XT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Mb=se("log-out",XT);/**
|
|
325
325
|
* @license lucide-react v1.7.0 - ISC
|
|
326
326
|
*
|
|
327
327
|
* This source code is licensed under the ISC license.
|
|
328
328
|
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const _T=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],ZT=
|
|
329
|
+
*/const _T=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],ZT=se("map",_T);/**
|
|
330
330
|
* @license lucide-react v1.7.0 - ISC
|
|
331
331
|
*
|
|
332
332
|
* This source code is licensed under the ISC license.
|
|
333
333
|
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const AT=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ET=
|
|
334
|
+
*/const AT=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ET=se("maximize-2",AT);/**
|
|
335
335
|
* @license lucide-react v1.7.0 - ISC
|
|
336
336
|
*
|
|
337
337
|
* This source code is licensed under the ISC license.
|
|
338
338
|
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const qT=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],MT=
|
|
339
|
+
*/const qT=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],MT=se("memory-stick",qT);/**
|
|
340
340
|
* @license lucide-react v1.7.0 - ISC
|
|
341
341
|
*
|
|
342
342
|
* This source code is licensed under the ISC license.
|
|
343
343
|
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const YT=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],UT=
|
|
344
|
+
*/const YT=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],UT=se("megaphone",YT);/**
|
|
345
345
|
* @license lucide-react v1.7.0 - ISC
|
|
346
346
|
*
|
|
347
347
|
* This source code is licensed under the ISC license.
|
|
348
348
|
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const VT=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Yb=
|
|
349
|
+
*/const VT=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Yb=se("message-circle",VT);/**
|
|
350
350
|
* @license lucide-react v1.7.0 - ISC
|
|
351
351
|
*
|
|
352
352
|
* This source code is licensed under the ISC license.
|
|
353
353
|
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const GT=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],pi=
|
|
354
|
+
*/const GT=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],pi=se("message-square",GT);/**
|
|
355
355
|
* @license lucide-react v1.7.0 - ISC
|
|
356
356
|
*
|
|
357
357
|
* This source code is licensed under the ISC license.
|
|
358
358
|
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const LT=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],DT=
|
|
359
|
+
*/const LT=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],DT=se("minimize-2",LT);/**
|
|
360
360
|
* @license lucide-react v1.7.0 - ISC
|
|
361
361
|
*
|
|
362
362
|
* This source code is licensed under the ISC license.
|
|
363
363
|
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const WT=[["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"}]],th=
|
|
364
|
+
*/const WT=[["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"}]],th=se("monitor",WT);/**
|
|
365
365
|
* @license lucide-react v1.7.0 - ISC
|
|
366
366
|
*
|
|
367
367
|
* This source code is licensed under the ISC license.
|
|
368
368
|
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const BT=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Ub=
|
|
369
|
+
*/const BT=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Ub=se("network",BT);/**
|
|
370
370
|
* @license lucide-react v1.7.0 - ISC
|
|
371
371
|
*
|
|
372
372
|
* This source code is licensed under the ISC license.
|
|
373
373
|
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const HT=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],si=
|
|
374
|
+
*/const HT=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],si=se("newspaper",HT);/**
|
|
375
375
|
* @license lucide-react v1.7.0 - ISC
|
|
376
376
|
*
|
|
377
377
|
* This source code is licensed under the ISC license.
|
|
378
378
|
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const IT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Vb=
|
|
379
|
+
*/const IT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Vb=se("package",IT);/**
|
|
380
380
|
* @license lucide-react v1.7.0 - ISC
|
|
381
381
|
*
|
|
382
382
|
* This source code is licensed under the ISC license.
|
|
383
383
|
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const FT=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],KT=
|
|
384
|
+
*/const FT=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],KT=se("paperclip",FT);/**
|
|
385
385
|
* @license lucide-react v1.7.0 - ISC
|
|
386
386
|
*
|
|
387
387
|
* This source code is licensed under the ISC license.
|
|
388
388
|
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const JT=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],eN=
|
|
389
|
+
*/const JT=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],eN=se("pause",JT);/**
|
|
390
390
|
* @license lucide-react v1.7.0 - ISC
|
|
391
391
|
*
|
|
392
392
|
* This source code is licensed under the ISC license.
|
|
393
393
|
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const tN=[["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"}]],nN=
|
|
394
|
+
*/const tN=[["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"}]],nN=se("pen",tN);/**
|
|
395
395
|
* @license lucide-react v1.7.0 - ISC
|
|
396
396
|
*
|
|
397
397
|
* This source code is licensed under the ISC license.
|
|
398
398
|
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const aN=[["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"}]],Gc=
|
|
399
|
+
*/const aN=[["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"}]],Gc=se("pencil",aN);/**
|
|
400
400
|
* @license lucide-react v1.7.0 - ISC
|
|
401
401
|
*
|
|
402
402
|
* This source code is licensed under the ISC license.
|
|
403
403
|
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const sN=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],lN=
|
|
404
|
+
*/const sN=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],lN=se("play",sN);/**
|
|
405
405
|
* @license lucide-react v1.7.0 - ISC
|
|
406
406
|
*
|
|
407
407
|
* This source code is licensed under the ISC license.
|
|
408
408
|
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
-
*/const rN=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],s1=
|
|
409
|
+
*/const rN=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],s1=se("plug-zap",rN);/**
|
|
410
410
|
* @license lucide-react v1.7.0 - ISC
|
|
411
411
|
*
|
|
412
412
|
* This source code is licensed under the ISC license.
|
|
413
413
|
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
-
*/const iN=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Gb=
|
|
414
|
+
*/const iN=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Gb=se("plug",iN);/**
|
|
415
415
|
* @license lucide-react v1.7.0 - ISC
|
|
416
416
|
*
|
|
417
417
|
* This source code is licensed under the ISC license.
|
|
418
418
|
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
-
*/const oN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ja=
|
|
419
|
+
*/const oN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ja=se("plus",oN);/**
|
|
420
420
|
* @license lucide-react v1.7.0 - ISC
|
|
421
421
|
*
|
|
422
422
|
* This source code is licensed under the ISC license.
|
|
423
423
|
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
-
*/const cN=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],uN=
|
|
424
|
+
*/const cN=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],uN=se("presentation",cN);/**
|
|
425
425
|
* @license lucide-react v1.7.0 - ISC
|
|
426
426
|
*
|
|
427
427
|
* This source code is licensed under the ISC license.
|
|
428
428
|
* See the LICENSE file in the root directory of this source tree.
|
|
429
|
-
*/const dN=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Lb=
|
|
429
|
+
*/const dN=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Lb=se("puzzle",dN);/**
|
|
430
430
|
* @license lucide-react v1.7.0 - ISC
|
|
431
431
|
*
|
|
432
432
|
* This source code is licensed under the ISC license.
|
|
433
433
|
* See the LICENSE file in the root directory of this source tree.
|
|
434
|
-
*/const ON=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],nh=
|
|
434
|
+
*/const ON=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],nh=se("radio",ON);/**
|
|
435
435
|
* @license lucide-react v1.7.0 - ISC
|
|
436
436
|
*
|
|
437
437
|
* This source code is licensed under the ISC license.
|
|
438
438
|
* See the LICENSE file in the root directory of this source tree.
|
|
439
|
-
*/const fN=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],zn=
|
|
439
|
+
*/const fN=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],zn=se("refresh-cw",fN);/**
|
|
440
440
|
* @license lucide-react v1.7.0 - ISC
|
|
441
441
|
*
|
|
442
442
|
* This source code is licensed under the ISC license.
|
|
443
443
|
* See the LICENSE file in the root directory of this source tree.
|
|
444
|
-
*/const hN=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],Db=
|
|
444
|
+
*/const hN=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],Db=se("rocket",hN);/**
|
|
445
445
|
* @license lucide-react v1.7.0 - ISC
|
|
446
446
|
*
|
|
447
447
|
* This source code is licensed under the ISC license.
|
|
448
448
|
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
-
*/const mN=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Wl=
|
|
449
|
+
*/const mN=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Wl=se("rotate-cw",mN);/**
|
|
450
450
|
* @license lucide-react v1.7.0 - ISC
|
|
451
451
|
*
|
|
452
452
|
* This source code is licensed under the ISC license.
|
|
453
453
|
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/const pN=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],xN=
|
|
454
|
+
*/const pN=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],xN=se("save",pN);/**
|
|
455
455
|
* @license lucide-react v1.7.0 - ISC
|
|
456
456
|
*
|
|
457
457
|
* This source code is licensed under the ISC license.
|
|
458
458
|
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
-
*/const gN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],da=
|
|
459
|
+
*/const gN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],da=se("search",gN);/**
|
|
460
460
|
* @license lucide-react v1.7.0 - ISC
|
|
461
461
|
*
|
|
462
462
|
* This source code is licensed under the ISC license.
|
|
463
463
|
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/const bN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ah=
|
|
464
|
+
*/const bN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ah=se("send",bN);/**
|
|
465
465
|
* @license lucide-react v1.7.0 - ISC
|
|
466
466
|
*
|
|
467
467
|
* This source code is licensed under the ISC license.
|
|
468
468
|
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
-
*/const vN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Wb=
|
|
469
|
+
*/const vN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Wb=se("server",vN);/**
|
|
470
470
|
* @license lucide-react v1.7.0 - ISC
|
|
471
471
|
*
|
|
472
472
|
* This source code is licensed under the ISC license.
|
|
473
473
|
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
-
*/const yN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bb=
|
|
474
|
+
*/const yN=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bb=se("settings",yN);/**
|
|
475
475
|
* @license lucide-react v1.7.0 - ISC
|
|
476
476
|
*
|
|
477
477
|
* This source code is licensed under the ISC license.
|
|
478
478
|
* See the LICENSE file in the root directory of this source tree.
|
|
479
|
-
*/const SN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Hb=
|
|
479
|
+
*/const SN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Hb=se("shield-check",SN);/**
|
|
480
480
|
* @license lucide-react v1.7.0 - ISC
|
|
481
481
|
*
|
|
482
482
|
* This source code is licensed under the ISC license.
|
|
483
483
|
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
-
*/const QN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],jN=
|
|
484
|
+
*/const QN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],jN=se("shield-x",QN);/**
|
|
485
485
|
* @license lucide-react v1.7.0 - ISC
|
|
486
486
|
*
|
|
487
487
|
* This source code is licensed under the ISC license.
|
|
488
488
|
* See the LICENSE file in the root directory of this source tree.
|
|
489
|
-
*/const wN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],li=
|
|
489
|
+
*/const wN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],li=se("shield",wN);/**
|
|
490
490
|
* @license lucide-react v1.7.0 - ISC
|
|
491
491
|
*
|
|
492
492
|
* This source code is licensed under the ISC license.
|
|
493
493
|
* See the LICENSE file in the root directory of this source tree.
|
|
494
|
-
*/const kN=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],wO=
|
|
494
|
+
*/const kN=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],wO=se("shopping-bag",kN);/**
|
|
495
495
|
* @license lucide-react v1.7.0 - ISC
|
|
496
496
|
*
|
|
497
497
|
* This source code is licensed under the ISC license.
|
|
498
498
|
* See the LICENSE file in the root directory of this source tree.
|
|
499
|
-
*/const $N=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],sh=
|
|
499
|
+
*/const $N=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],sh=se("skull",$N);/**
|
|
500
500
|
* @license lucide-react v1.7.0 - ISC
|
|
501
501
|
*
|
|
502
502
|
* This source code is licensed under the ISC license.
|
|
503
503
|
* See the LICENSE file in the root directory of this source tree.
|
|
504
|
-
*/const TN=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ir=
|
|
504
|
+
*/const TN=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ir=se("sparkles",TN);/**
|
|
505
505
|
* @license lucide-react v1.7.0 - ISC
|
|
506
506
|
*
|
|
507
507
|
* This source code is licensed under the ISC license.
|
|
508
508
|
* See the LICENSE file in the root directory of this source tree.
|
|
509
|
-
*/const NN=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ib=
|
|
509
|
+
*/const NN=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Ib=se("star",NN);/**
|
|
510
510
|
* @license lucide-react v1.7.0 - ISC
|
|
511
511
|
*
|
|
512
512
|
* This source code is licensed under the ISC license.
|
|
513
513
|
* See the LICENSE file in the root directory of this source tree.
|
|
514
|
-
*/const PN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],xi=
|
|
514
|
+
*/const PN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],xi=se("terminal",PN);/**
|
|
515
515
|
* @license lucide-react v1.7.0 - ISC
|
|
516
516
|
*
|
|
517
517
|
* This source code is licensed under the ISC license.
|
|
518
518
|
* See the LICENSE file in the root directory of this source tree.
|
|
519
|
-
*/const zN=[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]],lh=
|
|
519
|
+
*/const zN=[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]],lh=se("test-tube",zN);/**
|
|
520
520
|
* @license lucide-react v1.7.0 - ISC
|
|
521
521
|
*
|
|
522
522
|
* This source code is licensed under the ISC license.
|
|
523
523
|
* See the LICENSE file in the root directory of this source tree.
|
|
524
|
-
*/const RN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],as=
|
|
524
|
+
*/const RN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],as=se("trash-2",RN);/**
|
|
525
525
|
* @license lucide-react v1.7.0 - ISC
|
|
526
526
|
*
|
|
527
527
|
* This source code is licensed under the ISC license.
|
|
528
528
|
* See the LICENSE file in the root directory of this source tree.
|
|
529
|
-
*/const CN=[["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"}]],gi=
|
|
529
|
+
*/const CN=[["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"}]],gi=se("triangle-alert",CN);/**
|
|
530
530
|
* @license lucide-react v1.7.0 - ISC
|
|
531
531
|
*
|
|
532
532
|
* This source code is licensed under the ISC license.
|
|
533
533
|
* See the LICENSE file in the root directory of this source tree.
|
|
534
|
-
*/const XN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],_N=
|
|
534
|
+
*/const XN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],_N=se("upload",XN);/**
|
|
535
535
|
* @license lucide-react v1.7.0 - ISC
|
|
536
536
|
*
|
|
537
537
|
* This source code is licensed under the ISC license.
|
|
538
538
|
* See the LICENSE file in the root directory of this source tree.
|
|
539
|
-
*/const ZN=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],AN=
|
|
539
|
+
*/const ZN=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],AN=se("user-check",ZN);/**
|
|
540
540
|
* @license lucide-react v1.7.0 - ISC
|
|
541
541
|
*
|
|
542
542
|
* This source code is licensed under the ISC license.
|
|
543
543
|
* See the LICENSE file in the root directory of this source tree.
|
|
544
|
-
*/const EN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],qN=
|
|
544
|
+
*/const EN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],qN=se("user-plus",EN);/**
|
|
545
545
|
* @license lucide-react v1.7.0 - ISC
|
|
546
546
|
*
|
|
547
547
|
* This source code is licensed under the ISC license.
|
|
548
548
|
* See the LICENSE file in the root directory of this source tree.
|
|
549
|
-
*/const MN=[["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"}]],Fb=
|
|
549
|
+
*/const MN=[["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"}]],Fb=se("user",MN);/**
|
|
550
550
|
* @license lucide-react v1.7.0 - ISC
|
|
551
551
|
*
|
|
552
552
|
* This source code is licensed under the ISC license.
|
|
553
553
|
* See the LICENSE file in the root directory of this source tree.
|
|
554
|
-
*/const YN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],bi=
|
|
554
|
+
*/const YN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],bi=se("users",YN);/**
|
|
555
555
|
* @license lucide-react v1.7.0 - ISC
|
|
556
556
|
*
|
|
557
557
|
* This source code is licensed under the ISC license.
|
|
558
558
|
* See the LICENSE file in the root directory of this source tree.
|
|
559
|
-
*/const UN=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],VN=
|
|
559
|
+
*/const UN=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],VN=se("wrench",UN);/**
|
|
560
560
|
* @license lucide-react v1.7.0 - ISC
|
|
561
561
|
*
|
|
562
562
|
* This source code is licensed under the ISC license.
|
|
563
563
|
* See the LICENSE file in the root directory of this source tree.
|
|
564
|
-
*/const GN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qt=
|
|
564
|
+
*/const GN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qt=se("x",GN);/**
|
|
565
565
|
* @license lucide-react v1.7.0 - ISC
|
|
566
566
|
*
|
|
567
567
|
* This source code is licensed under the ISC license.
|
|
568
568
|
* See the LICENSE file in the root directory of this source tree.
|
|
569
|
-
*/const LN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Rn=le("zap",LN),DN={success:ni,error:ua,info:qb,warning:gi},WN={success:"border-l-success",error:"border-l-danger",info:"border-l-accent",warning:"border-l-warning"},BN={success:"text-success",error:"text-danger",info:"text-accent",warning:"text-warning"},HN={success:3e3,error:0,info:5e3,warning:5e3};function IN({toast:t}){const a=D(o=>o.removeToast),s=DN[t.type]||qb,l=HN[t.type];return v.useEffect(()=>{if(!l)return;const o=setTimeout(()=>a(t.id),l);return()=>clearTimeout(o)},[t.id,l,a]),r.jsxs(Xf.div,{layout:!0,initial:{opacity:0,x:80,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:80,scale:.95},transition:{duration:.2},className:re("w-80 rounded-md border border-border bg-surface-1 shadow-xl","border-l-4 flex items-center gap-3 px-4 py-3",WN[t.type]),children:[r.jsx(s,{size:16,className:re("flex-shrink-0",BN[t.type])}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm text-text-0 font-sans",children:t.message}),t.detail&&r.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:t.detail})]}),r.jsx("button",{onClick:o=>{o.stopPropagation(),a(t.id)},className:"p-1.5 text-text-4 hover:text-text-1 hover:bg-surface-5 rounded transition-colors cursor-pointer flex-shrink-0 z-10",children:r.jsx(Qt,{size:14})})]})}function FN(){const t=D(a=>a.toasts);return r.jsx("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col-reverse gap-2",children:r.jsx(Cf,{mode:"popLayout",children:t.slice(-3).map(a=>r.jsx(IN,{toast:a},a.id))})})}const KN=[{id:"agents",icon:Ub,label:"Agents"},{id:"editor",icon:ns,label:"Editor"},{id:"dashboard",icon:Vc,label:"Dashboard"},{id:"marketplace",icon:Lb,label:"Marketplace"},{id:"models",icon:Ff,label:"Models"},{id:"teams",icon:bi,label:"Teams"}],JN=[{id:"journalist",icon:si,label:"Journalist",panel:!0},{id:"settings",icon:Bb,label:"Settings",nav:!0}];function eP({activeView:t,detailPanel:a,onNavigate:s,onTogglePanel:l}){return r.jsxs("nav",{className:"w-12 flex-shrink-0 flex flex-col bg-surface-3 border-r border-border",children:[r.jsx("div",{className:"flex flex-col items-center gap-0.5 pt-2",children:KN.map(o=>r.jsx(t1,{content:o.label,side:"right",children:r.jsx("button",{onClick:()=>s(o.id),className:re("w-10 h-10 flex items-center justify-center rounded-md transition-colors cursor-pointer",t===o.id?"text-text-0 bg-surface-5":"text-text-3 hover:text-text-1 hover:bg-surface-4"),children:r.jsx(o.icon,{size:20,strokeWidth:t===o.id?2:1.5})})},o.id))}),r.jsx("div",{className:"flex-1"}),r.jsx("div",{className:"flex flex-col items-center gap-0.5 pb-2",children:JN.map(o=>{const u=o.panel?(a==null?void 0:a.type)===o.id:t===o.id;return r.jsx(t1,{content:o.label,side:"right",children:r.jsx("button",{onClick:()=>o.panel?l(o.id):s((o.nav,o.id)),className:re("w-10 h-10 flex items-center justify-center rounded-md transition-colors cursor-pointer",u?"text-text-0 bg-surface-5":"text-text-3 hover:text-text-1 hover:bg-surface-4"),children:r.jsx(o.icon,{size:20,strokeWidth:u?2:1.5})})},o.id)})})]})}const tP={agents:"Agents",editor:"Editor",dashboard:"Dashboard",marketplace:"Marketplace",teams:"Teams"};function nP({activeView:t,connected:a,daemonHost:s,editorActiveFile:l,onOpenCommandPalette:o,onSpawn:u}){const d=["Groove",tP[t]||t];return t==="editor"&&l&&d.push(l.split("/").pop()),r.jsxs("header",{className:"h-11 flex-shrink-0 flex items-center gap-3 px-4 bg-surface-3 border-b border-border",children:[r.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-7 w-7 rounded-full flex-shrink-0"}),s&&r.jsx("span",{className:"text-2xs font-mono font-semibold text-text-3 bg-surface-5 px-1.5 py-0.5 rounded flex-shrink-0",children:s}),r.jsx("div",{className:"flex-1 min-w-4"}),r.jsxs("button",{onClick:o,className:re("flex items-center gap-2.5 h-8 px-4 rounded-full w-full max-w-md","bg-surface-1 border border-border-subtle","text-sm text-text-4 font-sans","hover:border-border hover:text-text-3 transition-colors cursor-pointer"),children:[r.jsx(da,{size:14,className:"flex-shrink-0"}),r.jsx("span",{className:"flex-1 text-left",children:"Search commands..."}),r.jsx("kbd",{className:"text-2xs font-mono bg-surface-4 px-1.5 py-0.5 rounded-full text-text-4",children:"Cmd+K"})]}),r.jsx("div",{className:"flex-1 min-w-4"}),r.jsx("div",{className:"flex items-center gap-1 text-xs font-sans text-text-3 flex-shrink-0",children:d.map((O,h)=>r.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&r.jsx(Ll,{size:11,className:"text-text-4"}),r.jsx("span",{className:re(h===d.length-1?"text-text-2":"text-text-4"),children:O})]},h))}),a&&r.jsxs("button",{onClick:u,className:"ml-1 flex items-center gap-1 h-7 px-3.5 rounded-full bg-accent/15 text-accent text-xs font-semibold font-sans hover:bg-accent/25 transition-colors cursor-pointer select-none flex-shrink-0",children:[r.jsx(Ja,{size:14}),"Spawn"]})]})}const aP={running:"var(--color-success)",starting:"var(--color-warning)",stopped:"var(--color-text-3)",crashed:"var(--color-danger)",completed:"var(--color-accent)",killed:"var(--color-text-3)",rotating:"var(--color-purple)"};function rh(t){return aP[t]||"var(--color-text-3)"}const sP={planner:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},backend:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},frontend:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},fullstack:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},testing:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},devops:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"},docs:{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"},security:{bg:"rgba(224, 108, 117, 0.12)",text:"#e06c75",border:"#e06c75"},database:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},cmo:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},cfo:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},ea:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},support:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},analyst:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},creative:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},slides:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"}};function Kb(t){const a=(t||"").toLowerCase();return sP[a]||{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"}}function Ts({status:t,size:a="md",className:s}){const l=t==="running"||t==="starting",o=a==="sm"?"w-1.5 h-1.5":a==="lg"?"w-3 h-3":"w-2 h-2";return r.jsx("span",{className:re("rounded-full inline-block flex-shrink-0",l&&"animate-pulse",o,s),style:{background:rh(t)}})}function et(t){return t==null||isNaN(t)?"0":t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":Math.round(t).toLocaleString()}function Lc(t){return t==null||isNaN(t)?"$0":t>=1e3?"$"+(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":t>=1||t>=.01?"$"+t.toFixed(2):"$"+t.toFixed(3)}function Ns(t){return t==null||isNaN(t)?"0%":Math.round(t)+"%"}function Dc(t){if(!t||t<0)return"0s";const a=Math.floor(t/86400),s=Math.floor(t%86400/3600),l=Math.floor(t%3600/60),o=Math.floor(t%60);return a>0?`${a}d ${s}h`:s>0?`${s}h ${l}m`:l>0?`${l}m ${o}s`:`${o}s`}function vt(t){if(!t)return"";const a=(Date.now()-new Date(t).getTime())/1e3;return a<5?"just now":a<60?`${Math.floor(a)}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}function lP({connected:t,agentCount:a,runningCount:s,uptime:l,terminalVisible:o,onToggleTerminal:u}){return r.jsxs("footer",{className:"h-6 flex-shrink-0 flex items-center px-3 bg-surface-3 border-t border-border text-2xs font-sans select-none",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Ts,{status:t?"running":"crashed",size:"sm"}),r.jsx("span",{className:t?"text-text-2":"text-danger",children:t?"Connected":"Offline"})]}),t&&l>0&&r.jsxs("span",{className:"text-text-4",children:["Up ",Dc(l)]}),t&&a>0&&r.jsxs("span",{className:"text-text-4",children:[s,"/",a," agents"]})]}),r.jsx("div",{className:"flex-1"}),r.jsxs("a",{href:"https://docs.groovedev.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-2 h-full text-text-3 hover:text-text-1 hover:bg-surface-5 transition-colors no-underline",children:[r.jsx(w5,{size:12}),r.jsx("span",{children:"Docs"})]}),r.jsxs("button",{onClick:u,className:re("flex items-center gap-1.5 px-2 h-full transition-colors cursor-pointer",o?"text-accent bg-accent/8 hover:bg-accent/12":"text-text-3 hover:text-text-1 hover:bg-surface-5"),children:[r.jsx(xi,{size:12}),r.jsx("span",{children:"Terminal"}),r.jsx("kbd",{className:"font-mono text-text-4 ml-0.5",children:"Cmd+J"})]})]})}function rP({children:t,width:a,onWidthChange:s,onClose:l,className:o}){const u=v.useRef(!1),d=v.useRef(0),O=v.useRef(0),h=v.useCallback(p=>{p.preventDefault(),u.current=!0,d.current=p.clientX,O.current=a;function x(b){if(!u.current)return;const y=d.current-b.clientX,Q=Math.min(Math.max(O.current+y,380),window.innerWidth*.65);s(Q)}function g(){u.current=!1,document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",g)}document.addEventListener("mousemove",x),document.addEventListener("mouseup",g)},[a,s]);return r.jsxs("aside",{className:re("flex-shrink-0 flex bg-surface-1 border-l border-border relative",o),style:{width:a},children:[r.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:h}),r.jsx("button",{onClick:l,className:"absolute top-3 right-3 z-10 p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:r.jsx(Qt,{size:14})}),r.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:t})]})}const iP=[{id:"nav:agents",label:"Go to Agents",icon:Ub,category:"Navigation",action:t=>{t.setActiveView("agents")}},{id:"nav:editor",label:"Go to Editor",icon:ns,category:"Navigation",action:t=>{t.setActiveView("editor")}},{id:"nav:dashboard",label:"Go to Dashboard",icon:Vc,category:"Navigation",action:t=>{t.setActiveView("dashboard")}},{id:"nav:marketplace",label:"Go to Marketplace",icon:Lb,category:"Navigation",action:t=>{t.setActiveView("marketplace")}},{id:"nav:teams",label:"Go to Teams",icon:bi,category:"Navigation",action:t=>{t.setActiveView("teams")}},{id:"action:spawn",label:"Spawn Agent",icon:Ja,category:"Actions",action:t=>{t.openDetail({type:"spawn"})}},{id:"action:terminal",label:"Toggle Terminal",icon:xi,category:"Actions",action:t=>{t.setTerminalVisible(!t.terminalVisible)},shortcut:"Cmd+J"},{id:"action:journalist",label:"Toggle Journalist",icon:si,category:"Actions",action:t=>{var a;((a=t.detailPanel)==null?void 0:a.type)==="journalist"?t.closeDetail():t.openDetail({type:"journalist"})}}];function oP(){const t=D(y=>y.commandPaletteOpen),a=D(y=>y.toggleCommandPalette),s=D(y=>y.agents),l=D,[o,u]=v.useState(""),[d,O]=v.useState(0),h=v.useRef(null),p=v.useMemo(()=>{const y=s.flatMap(Q=>[{id:`chat:${Q.id}`,label:`Chat with ${Q.name}`,icon:pi,category:"Agents",action:w=>{w.selectAgent(Q.id)}},...Q.status==="running"?[{id:`rotate:${Q.id}`,label:`Rotate ${Q.name}`,icon:Wl,category:"Agents",action:w=>{w.rotateAgent(Q.id)}},{id:`kill:${Q.id}`,label:`Kill ${Q.name}`,icon:sh,category:"Agents",action:w=>{w.killAgent(Q.id)}}]:[]]);return[...iP,...y]},[s]),x=v.useMemo(()=>{if(!o.trim())return p.slice(0,12);const y=o.toLowerCase();return p.filter(Q=>Q.label.toLowerCase().includes(y)||Q.category.toLowerCase().includes(y)).slice(0,12)},[p,o]);v.useEffect(()=>{t&&(u(""),O(0),setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.focus()},50))},[t]),v.useEffect(()=>{d>=x.length&&O(Math.max(0,x.length-1))},[x.length,d]);function g(y){y.action(l.getState()),a()}function b(y){y.key==="ArrowDown"?(y.preventDefault(),O(Q=>Math.min(Q+1,x.length-1))):y.key==="ArrowUp"?(y.preventDefault(),O(Q=>Math.max(Q-1,0))):y.key==="Enter"&&x[d]?(y.preventDefault(),g(x[d])):y.key==="Escape"&&a()}return t?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm",onClick:a}),r.jsx(Cf,{children:r.jsxs(Xf.div,{initial:{opacity:0,y:-20,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{duration:.15},className:"fixed top-[15%] left-1/2 -translate-x-1/2 z-50 w-[480px] max-h-[400px] bg-surface-1 border border-border rounded-lg shadow-2xl overflow-hidden",onKeyDown:b,children:[r.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border-subtle",children:[r.jsx(da,{size:16,className:"text-text-3 flex-shrink-0"}),r.jsx("input",{ref:h,value:o,onChange:y=>{u(y.target.value),O(0)},placeholder:"Type a command...",className:"flex-1 bg-transparent text-sm text-text-0 font-sans placeholder:text-text-4 focus:outline-none"})]}),r.jsxs("div",{className:"overflow-y-auto max-h-[320px] py-1",children:[x.length===0&&r.jsx("div",{className:"px-4 py-6 text-sm text-text-3 text-center font-sans",children:"No results"}),x.map((y,Q)=>r.jsxs("button",{onClick:()=>g(y),onMouseEnter:()=>O(Q),className:re("w-full flex items-center gap-3 px-4 py-2 text-sm font-sans cursor-pointer",Q===d?"bg-surface-5 text-text-0":"text-text-1 hover:bg-surface-4"),children:[r.jsx(y.icon,{size:16,className:"text-text-3 flex-shrink-0"}),r.jsx("span",{className:"flex-1 text-left",children:y.label}),r.jsx("span",{className:"text-2xs text-text-4",children:y.category}),y.shortcut&&r.jsx("kbd",{className:"text-2xs font-mono bg-surface-4 px-1 py-0.5 rounded text-text-3 ml-1",children:y.shortcut})]},y.id))]})]})})]}):null}function cP({children:t,detailContent:a,terminalContent:s}){const l=D(R=>R.activeView),o=D(R=>R.detailPanel),u=D(R=>R.connected),d=D(R=>R.tunneled),O=D(R=>R.daemonHost),h=D(R=>R.agents),p=D(R=>R.editorActiveFile),x=D(R=>R.detailPanelWidth),g=D(R=>R.terminalVisible),b=D(R=>R.terminalFullHeight),y=D(R=>R.setActiveView),Q=D(R=>R.openDetail),w=D(R=>R.closeDetail),$=D(R=>R.setDetailPanelWidth),j=D(R=>R.setTerminalVisible),z=D(R=>R.toggleCommandPalette),N=v.useMemo(()=>h.filter(R=>R.status==="running").length,[h]),_=v.useMemo(()=>[{key:"k",meta:!0,handler:()=>D.getState().toggleCommandPalette()},{key:"p",meta:!0,shift:!0,handler:()=>D.getState().toggleCommandPalette()},{key:"j",meta:!0,handler:()=>{const R=D.getState();R.setTerminalVisible(!R.terminalVisible)}},{key:"n",meta:!0,handler:()=>D.getState().openDetail({type:"spawn"})},{key:"1",meta:!0,handler:()=>D.getState().setActiveView("agents")},{key:"2",meta:!0,handler:()=>D.getState().setActiveView("editor")},{key:"3",meta:!0,handler:()=>D.getState().setActiveView("dashboard")},{key:"4",meta:!0,handler:()=>D.getState().setActiveView("marketplace")},{key:"5",meta:!0,handler:()=>D.getState().setActiveView("teams")},{key:"Escape",handler:()=>{const R=D.getState();R.commandPaletteOpen?R.toggleCommandPalette():R.detailPanel&&R.closeDetail()}}],[]);uw(_);const G=o&&o.type!=="spawn";return r.jsx(h5,{children:r.jsxs("div",{className:"w-full h-full flex flex-col bg-surface-2 text-text-1 font-sans",children:[r.jsx(nP,{activeView:l,connected:u,tunneled:d,daemonHost:O,editorActiveFile:p,onOpenCommandPalette:z,onSpawn:()=>Q({type:"spawn"})}),r.jsxs("div",{className:"flex-1 flex min-h-0",children:[r.jsx(eP,{activeView:l,detailPanel:o,onNavigate:y,onTogglePanel:R=>{(o==null?void 0:o.type)===R?w():Q({type:R})}}),r.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[!(g&&b)&&r.jsx("main",{className:"flex-1 min-h-0 overflow-hidden relative",children:t}),s]}),G&&r.jsx(rP,{width:x,onWidthChange:$,onClose:w,children:a})]}),r.jsx(lP,{connected:u,agentCount:h.length,runningCount:N,terminalVisible:g,onToggleTerminal:()=>j(!g)}),r.jsx(oP,{}),r.jsx(FN,{})]})})}const uP=[];function dP(t){if(!t||t==="auto")return"auto";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)(?:-\d+)?$/);return a?`${a[1][0].toUpperCase()+a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gemini ").replace("-preview","").replace("-flash-lite"," Flash Lite").replace("-flash"," Flash").replace("-pro"," Pro"):t.startsWith("gpt-")?t.toUpperCase().replace("GPT-","GPT-"):t}function OP(t){if(!t)return null;const a=t.toLowerCase();return a.includes("read")?"READ":a.includes("edit")||a.includes("writ")?"WRITE":a.includes("search")||a.includes("grep")||a.includes("glob")?"SEARCH":a.includes("bash")||a.includes("exec")||a.includes("running")?"EXEC":a.includes("test")?"TEST":a.includes("error")||a.includes("fail")?"ERR":a.includes("complet")||a.includes("done")?"DONE":"WORK"}function fP(t){if(!t)return"";const a=Math.floor((Date.now()-t)/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:`${Math.floor(a/3600)}h`}function hP({agent:t}){const s=(D(l=>l.activityLog[t.id])||uP).slice(-8);return r.jsx("div",{className:"absolute left-full top-0 ml-2 z-50 pointer-events-none",style:{width:220,animation:"tooltip-slide-in 0.15s ease-out"},children:r.jsxs("div",{className:"overflow-hidden",style:{background:"#181b21",border:"1px solid #262a32",borderRadius:4},children:[t.prompt&&r.jsx("div",{className:"px-2.5 py-2 border-b border-[#262a32]",children:r.jsx("p",{className:"text-[9px] font-sans text-[#8b929e] line-clamp-3 leading-snug",children:t.prompt})}),s.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"px-2.5 pt-1.5 pb-1",children:r.jsx("span",{className:"text-[8px] font-mono text-[#3a3f4b] uppercase tracking-widest",children:"Activity"})}),s.map((l,o)=>{var O;const u=OP(l.text),d=((O=l.text)==null?void 0:O.length)>45?l.text.slice(0,45)+"...":l.text;return r.jsxs("div",{className:"px-2.5 py-[3px] flex items-start gap-1.5",children:[r.jsx("span",{className:"text-[8px] font-mono text-[#333842] w-5 flex-shrink-0 text-right",children:fP(l.timestamp)}),u&&r.jsx("span",{className:re("text-[7px] font-mono w-7 flex-shrink-0 text-center rounded-sm px-0.5 py-px",u==="ERR"?"text-[#e06c75] bg-[#e06c75]/10":"text-[#505862] bg-[#505862]/10"),children:u}),r.jsx("span",{className:"text-[9px] font-sans text-[#6e7681] truncate flex-1",children:d})]},o)}),r.jsx("div",{className:"h-1.5"})]}):r.jsx("div",{className:"px-2.5 py-3",children:r.jsx("span",{className:"text-[9px] font-mono text-[#333842]",children:"Awaiting activity..."})})]})})}const mP={running:"LIVE",starting:"INIT",stopped:"IDLE",crashed:"ERR",completed:"DONE",killed:"KILL",rotating:"ROT"},Jb=v.memo(({data:t,selected:a})=>{const{agent:s}=t,l=s.status==="running"||s.status==="starting",o=Math.round((s.contextUsage||0)*100),u=rh(s.status),d=s.tokensUsed||0,[O,h]=v.useState(!1);return r.jsxs("div",{className:"relative",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[r.jsxs("div",{className:"w-[220px] overflow-hidden transition-all duration-150",style:{background:"#1c1f26",border:`1px solid ${a?"#2e323a":"#262a32"}`,borderRadius:4},children:[r.jsx(Da,{id:"top",type:"target",position:Wa.Top,className:"!w-1 !h-1 !bg-transparent !border-0"}),r.jsx(Da,{id:"bottom",type:"target",position:Wa.Bottom,className:"!w-1 !h-1 !bg-transparent !border-0"}),r.jsx(Da,{id:"left",type:"target",position:Wa.Left,className:"!w-1 !h-1 !bg-transparent !border-0"}),r.jsx(Da,{id:"right",type:"target",position:Wa.Right,className:"!w-1 !h-1 !bg-transparent !border-0"}),l&&r.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",style:{borderRadius:3},children:r.jsx("div",{className:"absolute left-0 right-0 h-px",style:{background:"linear-gradient(90deg, transparent 0%, rgba(97,175,239,0.25) 50%, transparent 100%)",animation:"node-scan 3s ease-in-out infinite"}})}),r.jsxs("div",{className:"px-3 pt-2.5 pb-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[r.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:u}}),l&&r.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:u,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]}),r.jsx("span",{className:"text-[12px] font-semibold text-[#e6e6e6] font-sans truncate flex-1 leading-none",children:s.name}),r.jsx("span",{className:"text-[7px] font-mono font-bold uppercase tracking-wider px-1 py-px rounded-sm",style:{color:u,background:u+"12"},children:mP[s.status]||s.status})]}),r.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[r.jsx("span",{className:"text-[9px] font-mono text-[#505862] uppercase tracking-[0.05em]",children:s.role}),r.jsx("span",{className:"text-[9px] text-[#2a2e36]",children:"/"}),r.jsx("span",{className:"text-[9px] font-mono text-[#505862]",children:dP(s.model)})]})]}),r.jsxs("div",{className:"px-3 pt-1 pb-2",children:[r.jsxs("div",{className:"flex items-baseline gap-1.5",children:[r.jsx("span",{className:"text-[14px] font-mono font-medium text-[#bcc2cd] leading-none",children:et(d)}),r.jsx("span",{className:"text-[8px] font-mono text-[#505862]",children:"tok"}),r.jsx("span",{className:"flex-1"}),r.jsxs("span",{className:"text-[9px] font-mono text-[#505862]",children:[o,"%"]})]}),r.jsx("div",{className:"mt-1.5 h-[2px] rounded-sm bg-[#262a32] overflow-hidden",children:r.jsx("div",{className:"h-full rounded-sm transition-all duration-700",style:{width:`${Math.max(o,1)}%`,background:o>80?"#e06c75":o>60?"#e5c07b":l?"#61afef":"#333842"}})})]})]}),O&&r.jsx(hP,{agent:s})]})});Jb.displayName="AgentNode";const ev=v.memo(({data:t})=>{const{agentCount:a,runningCount:s}=t,l=s>0,o={background:"transparent",border:0,width:2,height:2};return r.jsxs("div",{className:"relative flex items-center justify-center",style:{width:84,height:84},children:[r.jsx("div",{className:re("absolute inset-0 rounded-full transition-all duration-500",l&&"animate-[spin-slow_30s_linear_infinite]"),style:{border:`1px dashed ${l?"rgba(97,175,239,0.5)":"rgba(97,175,239,0.25)"}`}}),r.jsx("div",{className:"absolute inset-[10px] rounded-full",style:{background:l?"radial-gradient(circle, rgba(97,175,239,0.15) 0%, transparent 70%)":"radial-gradient(circle, rgba(97,175,239,0.05) 0%, transparent 70%)",animation:l?"node-pulse-bar 2.5s ease-in-out infinite":"none"}}),r.jsx("div",{className:re("w-14 h-14 rounded-full flex items-center justify-center relative z-10 transition-all duration-300",l?"bg-[#1c1f26] border-2 border-[#61afef]/35 shadow-[0_0_28px_rgba(97,175,239,0.15)]":"bg-[#1c1f26] border border-[#61afef]/20"),children:r.jsx("img",{src:"/favicon.png",alt:"G",className:re("h-7 w-7 rounded-full transition-opacity",l?"opacity-90":"opacity-60")})}),a>0&&r.jsx("div",{className:re("absolute z-20 min-w-[20px] h-[20px] rounded-sm flex items-center justify-center","text-[10px] font-mono font-bold px-1 transition-all duration-300",l?"bg-[#1c1f26] text-[#61afef] border border-[#61afef]/40":"bg-[#1c1f26] text-[#61afef]/60 border border-[#61afef]/20"),style:{bottom:2,right:2},children:a}),r.jsx(Da,{id:"bottom",type:"source",position:Wa.Bottom,style:o}),r.jsx(Da,{id:"right",type:"source",position:Wa.Right,style:o}),r.jsx(Da,{id:"left",type:"source",position:Wa.Left,style:o}),r.jsx(Da,{id:"top",type:"source",position:Wa.Top,style:o})]})});ev.displayName="RootNode";const pP={primary:"bg-accent/20 text-accent border border-accent/25 hover:bg-accent/30 font-medium",secondary:"bg-surface-5/40 text-text-1 border border-border-subtle hover:bg-surface-5/70 hover:text-text-0",ghost:"bg-transparent text-text-2 border border-transparent hover:bg-surface-5/50 hover:text-text-0",danger:"bg-danger/12 text-danger border border-danger/15 hover:bg-danger/20",info:"bg-info/12 text-info border border-info/15 hover:bg-info/20",outline:"bg-transparent text-accent border border-accent/30 hover:bg-accent/10"},xP={sm:"h-7 px-2.5 text-xs gap-1.5 rounded",md:"h-8 px-3 text-sm gap-2 rounded",lg:"h-9 px-4 text-sm gap-2 rounded",icon:"h-8 w-8 rounded"},ve=v.forwardRef(({className:t,variant:a="secondary",size:s="md",children:l,...o},u)=>r.jsx("button",{ref:u,className:re("inline-flex items-center justify-center font-sans transition-colors duration-100","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent","disabled:opacity-40 disabled:pointer-events-none","cursor-pointer select-none",pP[a],xP[s],t),...o,children:l}));ve.displayName="Button";const gP={default:"bg-surface-4 text-text-2",accent:"bg-accent/12 text-accent",success:"bg-success/12 text-success",warning:"bg-warning/12 text-warning",danger:"bg-danger/12 text-danger",info:"bg-info/12 text-info",purple:"bg-purple/12 text-purple",orange:"bg-orange/12 text-orange"};function Xe({children:t,variant:a="default",className:s,dot:l,...o}){return r.jsxs("span",{className:re("inline-flex items-center gap-1 px-1.5 py-0.5","text-2xs font-semibold uppercase tracking-wider rounded","font-sans select-none whitespace-nowrap",gP[a],s),...o,children:[l&&r.jsx("span",{className:re("w-1.5 h-1.5 rounded-full",l==="pulse"&&"animate-pulse"),style:{background:"currentColor"}}),t]})}const bP={agentNode:Jb,rootNode:ev},l1=220,r1=82,Go=260,Lo=130,Ua=4,wn="__groove_root__";function kO(){try{return JSON.parse(localStorage.getItem("groove:nodePositions")||"{}")}catch{return{}}}function vP(t){try{localStorage.setItem("groove:nodePositions",JSON.stringify(t))}catch{}}function yP(){const t=D(N=>N.teams),a=D(N=>N.activeTeamId),s=D(N=>N.agents),l=D(N=>N.switchTeam),o=D(N=>N.createTeam),u=D(N=>N.deleteTeam),d=D(N=>N.renameTeam),[O,h]=v.useState(!1),[p,x]=v.useState(""),[g,b]=v.useState(null),[y,Q]=v.useState(""),w=v.useRef(!1);function $(){const N=p.trim();!N||w.current||(w.current=!0,x(""),h(!1),o(N).finally(()=>{w.current=!1}))}function j(N){b(N.id),Q(N.name)}function z(){const N=y.trim();if(!N||!g){b(null);return}d(g,N),b(null)}return r.jsxs("div",{className:"flex items-end px-0 pt-0 pb-0 bg-surface-1 border-b border-border gap-0 flex-shrink-0",children:[t.map(N=>{const _=s.filter(T=>T.teamId===N.id).length,G=N.id===a,R=g===N.id,X=s.filter(T=>T.teamId===N.id&&(T.status==="running"||T.status==="starting")).length;return r.jsxs("div",{onClick:()=>!R&&l(N.id),onDoubleClick:()=>j(N),className:re("group relative flex items-center gap-2 px-4 h-9 text-xs font-sans cursor-pointer select-none transition-colors",G?"bg-surface-0 text-text-0 font-semibold border-x border-x-border":"text-text-3 hover:text-text-1 hover:bg-surface-3/50"),children:[G&&r.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-accent",style:{height:"0.5px"}}),r.jsx(bi,{size:13,className:G?"text-accent":"text-text-4"}),R?r.jsx("input",{value:y,onChange:T=>Q(T.target.value),onKeyDown:T=>{T.key==="Enter"&&z(),T.key==="Escape"&&b(null)},onBlur:z,className:"h-5 w-24 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none",autoFocus:!0,onClick:T=>T.stopPropagation()}):r.jsx("span",{className:"truncate max-w-[120px]",children:N.name}),_>0&&!R&&r.jsx("span",{className:re("flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full text-2xs font-mono font-semibold",X>0?"bg-accent/15 text-accent":"bg-surface-4 text-text-3"),children:_}),!R&&r.jsxs("div",{className:"flex items-center gap-0.5 ml-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[r.jsx("button",{onClick:T=>{T.stopPropagation(),j(N)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 cursor-pointer",title:"Rename team",children:r.jsx(Gc,{size:10})}),!N.isDefault&&r.jsx("button",{onClick:T=>{T.stopPropagation(),u(N.id)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-danger cursor-pointer",title:"Delete team",children:r.jsx(Qt,{size:10})})]}),G&&r.jsx("div",{className:"absolute bottom-[-1px] left-0 right-0 h-px bg-surface-0"})]},N.id)}),O?r.jsxs("div",{className:"flex items-center gap-1.5 px-3 h-9 bg-surface-3/50",children:[r.jsx("input",{value:p,onChange:N=>x(N.target.value),onKeyDown:N=>{N.key==="Enter"&&$(),N.key==="Escape"&&(h(!1),x(""))},placeholder:"Team name...",className:"h-5 w-28 px-1.5 text-xs bg-surface-0 border border-border-subtle rounded text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:$,disabled:!p.trim(),className:"p-1 rounded text-accent hover:bg-accent/10 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",children:r.jsx(Dt,{size:12})}),r.jsx("button",{onClick:()=>{h(!1),x("")},className:"p-1 rounded text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:12})})]}):r.jsx("button",{onClick:()=>h(!0),className:"flex items-center justify-center w-9 h-9 text-text-4 hover:text-text-1 hover:bg-surface-3/50 cursor-pointer transition-colors",title:"New team",children:r.jsx(Ja,{size:14})})]})}function SP(){const t=D(T=>T.agents),a=D(T=>T.activeTeamId),s=D(T=>T.tokenTimeline),l=D(T=>T.selectAgent),o=D(T=>T.closeDetail),u=v.useMemo(()=>t.filter(T=>T.teamId===a),[t,a]),{fitView:d}=jj(),[O,h]=v.useState(0),p=v.useMemo(()=>{const T=kO(),V=u.filter(H=>H.status==="running").length,M=[{id:wn,type:"rootNode",position:T[wn]||{x:0,y:0},data:{agentCount:u.length,runningCount:V},draggable:!0,selectable:!1}],ae=new Set,F=(H,P)=>`${Math.round(H/100)},${Math.round(P/100)}`,se=T[wn]||{x:0,y:0};ae.add(F(se.x,se.y));const oe=[];u.forEach((H,P)=>{const W=H.name||H.id;if(T[W]){const E=T[W];ae.add(F(E.x,E.y)),M.push({id:H.id,type:"agentNode",position:E,data:{agent:H,timeline:s[H.id]||[]},draggable:!0,selectable:!0})}else oe.push({agent:H,index:P})});for(const{agent:H,index:P}of oe){const W=Math.floor(P/Ua),E=P%Ua;let be={x:-((Math.min(u.length-W*Ua,Ua)-1)*Go)/2+E*Go,y:Lo+W*Lo};for(;ae.has(F(be.x,be.y));)be={x:be.x,y:be.y+Lo};ae.add(F(be.x,be.y)),M.push({id:H.id,type:"agentNode",position:be,data:{agent:H,timeline:s[H.id]||[]},draggable:!0,selectable:!0})}return M},[u,s]),x=v.useMemo(()=>{const T=kO(),V=T[wn]||{x:0,y:0};return u.map((M,ae)=>{const F=M.name||M.id,se=Math.floor(ae/Ua),oe=ae%Ua,P=-((Math.min(u.length-se*Ua,Ua)-1)*Go)/2,W=T[F]||{x:P+oe*Go,y:140+se*Lo},E=W.x+l1/2-V.x,ce=W.y+r1/2-V.y;let ee,be;return Math.abs(ce)>Math.abs(E)?(ee=ce>0?"bottom":"top",be=ce>0?"top":"bottom"):(ee=E>0?"right":"left",be=E>0?"left":"right"),{id:`e-${wn}-${M.id}`,source:wn,target:M.id,sourceHandle:ee,targetHandle:be,type:"default",animated:M.status==="running"}})},[u]),[g,b,y]=wj(p),[Q,w,$]=kj(x),j=v.useRef(new Set);v.useEffect(()=>{b(T=>{const V=new Map(T.map(M=>[M.id,M]));return new Set(p.map(M=>M.id)),p.map(M=>{const ae=V.get(M.id);return ae?{...ae,data:M.data}:M})})},[p,b]),v.useEffect(()=>{w(x)},[x,w]);const z=u.map(T=>T.id).join(","),N=v.useRef(null);v.useEffect(()=>{const T=new Set(u.map(M=>M.id)),V=u.length>0&&[...T].some(M=>!j.current.has(M));j.current=T,O===0&&u.length>0?d({padding:.3,maxZoom:1.2,duration:0}):V&&(clearTimeout(N.current),N.current=setTimeout(()=>d({padding:.3,maxZoom:1.2,duration:300}),500)),h(u.length)},[z,O,d]);const _=v.useCallback((T,V)=>{V.id!==wn&&l(V.id)},[l]),G=v.useCallback(()=>{o()},[o]),R=v.useCallback((T,V)=>{const M=g.find(F=>F.id===wn);if(!M)return;const ae=M.position;w(F=>F.map(se=>{const oe=se.source===V.id,H=se.target===V.id;if(!oe&&!H)return se;const P=V.position,W=P.x+l1/2-ae.x,E=P.y+r1/2-ae.y;let ce,ee;return Math.abs(E)>Math.abs(W)?(ce=E>0?"bottom":"top",ee=E>0?"top":"bottom"):(ce=W>0?"right":"left",ee=W>0?"left":"right"),{...se,sourceHandle:ce,targetHandle:ee}}))},[g,w]),X=v.useCallback((T,V)=>{const M=u.find(se=>se.id===V.id),ae=V.id===wn?wn:(M==null?void 0:M.name)||V.id,F=kO();F[ae]=V.position,vP(F)},[u]);return r.jsx($j,{nodes:g,edges:Q,nodeTypes:bP,onNodesChange:y,onEdgesChange:$,onNodeClick:_,onPaneClick:G,onNodeDrag:R,onNodeDragStop:X,defaultViewport:{x:0,y:0,zoom:1.2},proOptions:{hideAttribution:!0},minZoom:.2,maxZoom:1.5,className:"bg-surface-2",children:r.jsx(Tj,{color:"rgba(97,175,239,0.03)",gap:24,size:1})})}function QP({onPlanner:t,onSpawn:a}){return r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsxs("div",{className:"max-w-2xl w-full text-center space-y-10 px-8",children:[r.jsxs("div",{className:"relative mx-auto w-20 h-20",children:[r.jsx("div",{className:"absolute inset-0 rounded-full bg-accent/8 animate-pulse"}),r.jsx("div",{className:"absolute inset-1 rounded-full bg-surface-3 border border-border-subtle flex items-center justify-center shadow-lg shadow-accent/5",children:r.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-10 w-10 rounded-full"})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("h1",{className:"text-3xl font-bold text-text-0 font-sans tracking-tight",children:"Welcome to Groove"}),r.jsx("p",{className:"text-base text-text-2 font-sans max-w-md mx-auto leading-relaxed",children:"Your mission control for AI agents. Spawn, orchestrate, and ship faster than ever."})]}),r.jsxs("div",{className:"space-y-3 max-w-xl mx-auto",children:[r.jsxs("button",{onClick:t,className:"w-full flex items-center gap-4 p-5 rounded-lg border border-accent/25 bg-gradient-to-r from-accent/8 to-accent/3 hover:from-accent/14 hover:to-accent/6 hover:border-accent/40 transition-all cursor-pointer group text-left",children:[r.jsx("div",{className:"w-12 h-12 rounded-lg bg-accent/20 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:r.jsx(Rn,{size:24,className:"text-accent"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Start with a Planner"}),r.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Describe what you want to build and let AI plan the perfect team"})]}),r.jsx("div",{className:"text-accent text-xs font-semibold font-sans flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity",children:"Recommended"})]}),r.jsxs("button",{onClick:a,className:"w-full flex items-center gap-3 p-4 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 hover:border-border transition-all cursor-pointer group text-left",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-surface-4 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:r.jsx(Ja,{size:20,className:"text-text-1"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Spawn Agent"}),r.jsx("div",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Choose a role and configure"})]})]})]}),r.jsxs("p",{className:"text-xs text-text-4 font-sans",children:[r.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+K"}),r.jsx("span",{className:"mx-1.5",children:"command palette"}),r.jsx("span",{className:"text-text-4 mx-1",children:"·"}),r.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+N"}),r.jsx("span",{className:"mx-1.5",children:"spawn"}),r.jsx("span",{className:"text-text-4 mx-1",children:"·"}),r.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+J"}),r.jsx("span",{className:"mx-1.5",children:"terminal"})]})]})})}const jP={backend:Wb,frontend:th,fullstack:ns,testing:lh,security:li},wP=/^[a-zA-Z0-9_-]{1,64}$/;function kP(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64)}function $P(){var y;const t=D(Q=>Q.recommendedTeam),a=D(Q=>Q.launchRecommendedTeam),[s,l]=v.useState(!1),[o,u]=v.useState(null);if(!((y=t==null?void 0:t.agents)!=null&&y.length))return null;const d=t.agents,O=d.filter(Q=>!Q.phase||Q.phase===1),h=d.filter(Q=>Q.phase===2),p=o??O.map(Q=>({...Q,name:Q.name||""}));function x(Q,w){const $=p.map((j,z)=>z===Q?{...j,name:kP(w)}:j);u($)}async function g(){l(!0);try{const Q=[...p,...h];await a(Q)}catch{}l(!1)}function b(){D.setState({recommendedTeam:null})}return r.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-50 w-full max-w-lg",children:r.jsxs("div",{className:"mx-4 rounded-lg border border-accent/30 bg-surface-2/95 backdrop-blur-md shadow-xl shadow-accent/5 overflow-hidden",children:[r.jsxs("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center gap-2",children:[r.jsx(Db,{size:16,className:"text-accent"}),r.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Planner Recommends a Team"}),r.jsx("button",{onClick:b,className:"text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:14})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[p.map((Q,w)=>{var z;const $=jP[Q.role]||ns,j=!Q.name||wP.test(Q.name);return r.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-surface-4 border border-border-subtle",children:[r.jsx($,{size:12,className:"text-text-2 shrink-0"}),r.jsx("input",{type:"text",value:Q.name,onChange:N=>x(w,N.target.value),placeholder:Q.role,className:re("flex-1 min-w-0 bg-transparent text-xs font-mono text-text-0 outline-none placeholder:text-text-4",!j&&"text-red-400"),maxLength:64,spellCheck:!1}),((z=Q.scope)==null?void 0:z.length)>0&&r.jsxs("span",{className:"text-2xs text-text-4 font-mono shrink-0 truncate max-w-[120px]",children:[Q.scope[0],Q.scope.length>1?` +${Q.scope.length-1}`:""]})]},w)}),t.projectDir&&r.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-2 font-mono pt-0.5",children:[r.jsx("span",{className:"text-text-4",children:"Project:"}),r.jsxs("span",{className:"text-accent",children:[t.projectDir,"/"]})]}),h.length>0&&r.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans",children:[r.jsx(li,{size:10}),r.jsxs("span",{children:[h.length," QC agent",h.length>1?"s":""," will auto-spawn after builders complete"]})]})]}),r.jsx("div",{className:"px-4 py-3 border-t border-border-subtle",children:r.jsxs(ve,{variant:"primary",size:"md",onClick:g,disabled:s,className:"w-full gap-2",children:[r.jsx(Rn,{size:14}),s?"Launching...":`Launch ${O.length} Agent${O.length>1?"s":""}`]})})]})})}function i1(){const t=D(b=>b.agents),a=D(b=>b.activeTeamId),s=D(b=>b.openDetail),l=D(b=>b.spawnAgent),o=D(b=>b.selectAgent);D(b=>b.recommendedTeam);const u=D(b=>b.checkRecommendedTeam);v.useEffect(()=>{if(!t.some(Q=>Q.role==="planner"&&(Q.status==="running"||Q.status==="starting")))return;const y=setInterval(()=>u(),5e3);return()=>clearInterval(y)},[t,u]);async function d(){try{const b=await l({role:"planner"});b!=null&&b.id&&o(b.id)}catch{}}const O=t.filter(b=>b.teamId===a),h=D(b=>b.hydrated),[p,x]=v.useState(!0);v.useEffect(()=>{const b=setTimeout(()=>x(!1),1200);return()=>clearTimeout(b)},[]);const g=p||!h;return r.jsxs("div",{className:"flex flex-col h-full relative",children:[r.jsx(yP,{}),r.jsx("div",{className:"flex-1 min-h-0",children:g?r.jsxs("div",{className:re("flex flex-col items-center justify-center h-full transition-opacity duration-500",!p&&h?"opacity-0":"opacity-100"),children:[r.jsxs("div",{className:"relative w-12 h-12 mb-5",children:[r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),r.jsx("span",{className:"absolute inset-[6px] rounded-full bg-accent/8 flex items-center justify-center",children:r.jsx(Rn,{size:16,className:"text-accent animate-pulse"})})]}),r.jsx("p",{className:"text-sm font-medium text-text-1 font-sans animate-pulse",children:"Connecting to agents"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Syncing with daemon..."})]}):O.length===0?r.jsx(QP,{onPlanner:d,onSpawn:()=>s({type:"spawn"})}):r.jsx(Qj,{children:r.jsx(SP,{})})}),r.jsx($P,{})]})}var TP=v.createContext(void 0);function ih(t){const a=v.useContext(TP);return t||a||"ltr"}function NP(t,[a,s]){return Math.min(s,Math.max(a,t))}function PP(t,a){return v.useReducer((s,l)=>a[s][l]??s,t)}var oh="ScrollArea",[tv]=Xs(oh),[zP,on]=tv(oh),nv=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,type:l="hover",dir:o,scrollHideDelay:u=600,...d}=t,[O,h]=v.useState(null),[p,x]=v.useState(null),[g,b]=v.useState(null),[y,Q]=v.useState(null),[w,$]=v.useState(null),[j,z]=v.useState(0),[N,_]=v.useState(0),[G,R]=v.useState(!1),[X,T]=v.useState(!1),V=it(a,ae=>h(ae)),M=ih(o);return r.jsx(zP,{scope:s,type:l,dir:M,scrollHideDelay:u,scrollArea:O,viewport:p,onViewportChange:x,content:g,onContentChange:b,scrollbarX:y,onScrollbarXChange:Q,scrollbarXEnabled:G,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:$,scrollbarYEnabled:X,onScrollbarYEnabledChange:T,onCornerWidthChange:z,onCornerHeightChange:_,children:r.jsx(Be.div,{dir:M,...d,ref:V,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});nv.displayName=oh;var av="ScrollAreaViewport",sv=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,children:l,nonce:o,...u}=t,d=on(av,s),O=v.useRef(null),h=it(a,O,d.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),r.jsx(Be.div,{"data-radix-scroll-area-viewport":"",...u,ref:h,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...t.style},children:r.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});sv.displayName=av;var Cn="ScrollAreaScrollbar",lv=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=on(Cn,t.__scopeScrollArea),{onScrollbarXEnabledChange:u,onScrollbarYEnabledChange:d}=o,O=t.orientation==="horizontal";return v.useEffect(()=>(O?u(!0):d(!0),()=>{O?u(!1):d(!1)}),[O,u,d]),o.type==="hover"?r.jsx(RP,{...l,ref:a,forceMount:s}):o.type==="scroll"?r.jsx(CP,{...l,ref:a,forceMount:s}):o.type==="auto"?r.jsx(rv,{...l,ref:a,forceMount:s}):o.type==="always"?r.jsx(ch,{...l,ref:a}):null});lv.displayName=Cn;var RP=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=on(Cn,t.__scopeScrollArea),[u,d]=v.useState(!1);return v.useEffect(()=>{const O=o.scrollArea;let h=0;if(O){const p=()=>{window.clearTimeout(h),d(!0)},x=()=>{h=window.setTimeout(()=>d(!1),o.scrollHideDelay)};return O.addEventListener("pointerenter",p),O.addEventListener("pointerleave",x),()=>{window.clearTimeout(h),O.removeEventListener("pointerenter",p),O.removeEventListener("pointerleave",x)}}},[o.scrollArea,o.scrollHideDelay]),r.jsx(bn,{present:s||u,children:r.jsx(rv,{"data-state":u?"visible":"hidden",...l,ref:a})})}),CP=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=on(Cn,t.__scopeScrollArea),u=t.orientation==="horizontal",d=Bc(()=>h("SCROLL_END"),100),[O,h]=PP("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(O==="idle"){const p=window.setTimeout(()=>h("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[O,o.scrollHideDelay,h]),v.useEffect(()=>{const p=o.viewport,x=u?"scrollLeft":"scrollTop";if(p){let g=p[x];const b=()=>{const y=p[x];g!==y&&(h("SCROLL"),d()),g=y};return p.addEventListener("scroll",b),()=>p.removeEventListener("scroll",b)}},[o.viewport,u,h,d]),r.jsx(bn,{present:s||O!=="hidden",children:r.jsx(ch,{"data-state":O==="hidden"?"hidden":"visible",...l,ref:a,onPointerEnter:qe(t.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:qe(t.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),rv=v.forwardRef((t,a)=>{const s=on(Cn,t.__scopeScrollArea),{forceMount:l,...o}=t,[u,d]=v.useState(!1),O=t.orientation==="horizontal",h=Bc(()=>{if(s.viewport){const p=s.viewport.offsetWidth<s.viewport.scrollWidth,x=s.viewport.offsetHeight<s.viewport.scrollHeight;d(O?p:x)}},10);return El(s.viewport,h),El(s.content,h),r.jsx(bn,{present:l||u,children:r.jsx(ch,{"data-state":u?"visible":"hidden",...o,ref:a})})}),ch=v.forwardRef((t,a)=>{const{orientation:s="vertical",...l}=t,o=on(Cn,t.__scopeScrollArea),u=v.useRef(null),d=v.useRef(0),[O,h]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=dv(O.viewport,O.content),x={...l,sizes:O,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:b=>u.current=b,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:b=>d.current=b};function g(b,y){return qP(b,d.current,O,y)}return s==="horizontal"?r.jsx(XP,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&u.current){const b=o.viewport.scrollLeft,y=o1(b,O,o.dir);u.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollLeft=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollLeft=g(b,o.dir))}}):s==="vertical"?r.jsx(_P,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&u.current){const b=o.viewport.scrollTop,y=o1(b,O);u.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollTop=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollTop=g(b))}}):null}),XP=v.forwardRef((t,a)=>{const{sizes:s,onSizesChange:l,...o}=t,u=on(Cn,t.__scopeScrollArea),[d,O]=v.useState(),h=v.useRef(null),p=it(a,h,u.onScrollbarXChange);return v.useEffect(()=>{h.current&&O(getComputedStyle(h.current))},[h]),r.jsx(ov,{"data-orientation":"horizontal",...o,ref:p,sizes:s,style:{bottom:0,left:u.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:u.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wc(s)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.x),onDragScroll:x=>t.onDragScroll(x.x),onWheelScroll:(x,g)=>{if(u.viewport){const b=u.viewport.scrollLeft+x.deltaX;t.onWheelScroll(b),fv(b,g)&&x.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:Sc(d.paddingLeft),paddingEnd:Sc(d.paddingRight)}})}})}),_P=v.forwardRef((t,a)=>{const{sizes:s,onSizesChange:l,...o}=t,u=on(Cn,t.__scopeScrollArea),[d,O]=v.useState(),h=v.useRef(null),p=it(a,h,u.onScrollbarYChange);return v.useEffect(()=>{h.current&&O(getComputedStyle(h.current))},[h]),r.jsx(ov,{"data-orientation":"vertical",...o,ref:p,sizes:s,style:{top:0,right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wc(s)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.y),onDragScroll:x=>t.onDragScroll(x.y),onWheelScroll:(x,g)=>{if(u.viewport){const b=u.viewport.scrollTop+x.deltaY;t.onWheelScroll(b),fv(b,g)&&x.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:Sc(d.paddingTop),paddingEnd:Sc(d.paddingBottom)}})}})}),[ZP,iv]=tv(Cn),ov=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,sizes:l,hasThumb:o,onThumbChange:u,onThumbPointerUp:d,onThumbPointerDown:O,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:x,onResize:g,...b}=t,y=on(Cn,s),[Q,w]=v.useState(null),$=it(a,V=>w(V)),j=v.useRef(null),z=v.useRef(""),N=y.viewport,_=l.content-l.viewport,G=zt(x),R=zt(h),X=Bc(g,10);function T(V){if(j.current){const M=V.clientX-j.current.left,ae=V.clientY-j.current.top;p({x:M,y:ae})}}return v.useEffect(()=>{const V=M=>{const ae=M.target;(Q==null?void 0:Q.contains(ae))&&G(M,_)};return document.addEventListener("wheel",V,{passive:!1}),()=>document.removeEventListener("wheel",V,{passive:!1})},[N,Q,_,G]),v.useEffect(R,[l,R]),El(Q,X),El(y.content,X),r.jsx(ZP,{scope:s,scrollbar:Q,hasThumb:o,onThumbChange:zt(u),onThumbPointerUp:zt(d),onThumbPositionChange:R,onThumbPointerDown:zt(O),children:r.jsx(Be.div,{...b,ref:$,style:{position:"absolute",...b.style},onPointerDown:qe(t.onPointerDown,V=>{V.button===0&&(V.target.setPointerCapture(V.pointerId),j.current=Q.getBoundingClientRect(),z.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),T(V))}),onPointerMove:qe(t.onPointerMove,T),onPointerUp:qe(t.onPointerUp,V=>{const M=V.target;M.hasPointerCapture(V.pointerId)&&M.releasePointerCapture(V.pointerId),document.body.style.webkitUserSelect=z.current,y.viewport&&(y.viewport.style.scrollBehavior=""),j.current=null})})})}),yc="ScrollAreaThumb",cv=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=iv(yc,t.__scopeScrollArea);return r.jsx(bn,{present:s||o.hasThumb,children:r.jsx(AP,{ref:a,...l})})}),AP=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,style:l,...o}=t,u=on(yc,s),d=iv(yc,s),{onThumbPositionChange:O}=d,h=it(a,g=>d.onThumbChange(g)),p=v.useRef(void 0),x=Bc(()=>{p.current&&(p.current(),p.current=void 0)},100);return v.useEffect(()=>{const g=u.viewport;if(g){const b=()=>{if(x(),!p.current){const y=MP(g,O);p.current=y,O()}};return O(),g.addEventListener("scroll",b),()=>g.removeEventListener("scroll",b)}},[u.viewport,x,O]),r.jsx(Be.div,{"data-state":d.hasThumb?"visible":"hidden",...o,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:qe(t.onPointerDownCapture,g=>{const y=g.target.getBoundingClientRect(),Q=g.clientX-y.left,w=g.clientY-y.top;d.onThumbPointerDown({x:Q,y:w})}),onPointerUp:qe(t.onPointerUp,d.onThumbPointerUp)})});cv.displayName=yc;var uh="ScrollAreaCorner",uv=v.forwardRef((t,a)=>{const s=on(uh,t.__scopeScrollArea),l=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&l?r.jsx(EP,{...t,ref:a}):null});uv.displayName=uh;var EP=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,...l}=t,o=on(uh,s),[u,d]=v.useState(0),[O,h]=v.useState(0),p=!!(u&&O);return El(o.scrollbarX,()=>{var g;const x=((g=o.scrollbarX)==null?void 0:g.offsetHeight)||0;o.onCornerHeightChange(x),h(x)}),El(o.scrollbarY,()=>{var g;const x=((g=o.scrollbarY)==null?void 0:g.offsetWidth)||0;o.onCornerWidthChange(x),d(x)}),p?r.jsx(Be.div,{...l,ref:a,style:{width:u,height:O,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Sc(t){return t?parseInt(t,10):0}function dv(t,a){const s=t/a;return isNaN(s)?0:s}function Wc(t){const a=dv(t.viewport,t.content),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=(t.scrollbar.size-s)*a;return Math.max(l,18)}function qP(t,a,s,l="ltr"){const o=Wc(s),u=o/2,d=a||u,O=o-d,h=s.scrollbar.paddingStart+d,p=s.scrollbar.size-s.scrollbar.paddingEnd-O,x=s.content-s.viewport,g=l==="ltr"?[0,x]:[x*-1,0];return Ov([h,p],g)(t)}function o1(t,a,s="ltr"){const l=Wc(a),o=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,u=a.scrollbar.size-o,d=a.content-a.viewport,O=u-l,h=s==="ltr"?[0,d]:[d*-1,0],p=NP(t,h);return Ov([0,d],[0,O])(p)}function Ov(t,a){return s=>{if(t[0]===t[1]||a[0]===a[1])return a[0];const l=(a[1]-a[0])/(t[1]-t[0]);return a[0]+l*(s-t[0])}}function fv(t,a){return t>0&&t<a}var MP=(t,a=()=>{})=>{let s={left:t.scrollLeft,top:t.scrollTop},l=0;return(function o(){const u={left:t.scrollLeft,top:t.scrollTop},d=s.left!==u.left,O=s.top!==u.top;(d||O)&&a(),s=u,l=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(l)};function Bc(t,a){const s=zt(t),l=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(l.current),[]),v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(s,a)},[s,a])}function El(t,a){const s=zt(a);ra(()=>{let l=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(s)});return o.observe(t),()=>{window.cancelAnimationFrame(l),o.unobserve(t)}}},[t,s])}var YP=nv,UP=sv,c1=lv,u1=cv,VP=uv;function fa({children:t,className:a,...s}){return r.jsxs(YP,{className:re("overflow-hidden",a),...s,children:[r.jsx(UP,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsx(c1,{orientation:"vertical",className:"flex touch-none select-none p-0.5 transition-colors w-2",children:r.jsx(u1,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),r.jsx(c1,{orientation:"horizontal",className:"flex touch-none select-none flex-col p-0.5 transition-colors h-2",children:r.jsx(u1,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),r.jsx(VP,{})]})}const GP={js:"text-warning",jsx:"text-warning",ts:"text-info",tsx:"text-info",css:"text-info",html:"text-orange",json:"text-warning",md:"text-text-2",py:"text-success",rs:"text-orange",go:"text-accent",sh:"text-success",yaml:"text-danger",yml:"text-danger",sql:"text-purple",xml:"text-orange",svg:"text-warning"};function LP(t){var s;const a=(s=t.split(".").pop())==null?void 0:s.toLowerCase();return GP[a]||"text-text-3"}function DP({x:t,y:a,items:s,onClose:l}){const o=v.useRef(null);return v.useEffect(()=>{function u(d){o.current&&!o.current.contains(d.target)&&l()}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[l]),r.jsx("div",{ref:o,className:"fixed z-50 min-w-[160px] py-1 bg-surface-2 border border-border rounded-lg shadow-xl",style:{left:t,top:a},children:s.map((u,d)=>u.separator?r.jsx("div",{className:"h-px bg-border-subtle my-1"},d):r.jsxs("button",{onClick:()=>{u.action(),l()},className:re("w-full flex items-center gap-2.5 px-3 py-1.5 text-xs font-sans text-left cursor-pointer transition-colors",u.danger?"text-danger hover:bg-danger/10":"text-text-1 hover:bg-surface-5"),children:[u.icon&&r.jsx(u.icon,{size:12,className:u.danger?"text-danger":"text-text-3"}),u.label]},d))})}function Qc({defaultValue:t="",placeholder:a,onSubmit:s,onCancel:l,depth:o=0}){const[u,d]=v.useState(t),O=v.useRef(null);v.useEffect(()=>{var p,x;(p=O.current)==null||p.focus(),t&&((x=O.current)==null||x.select())},[t]);function h(p){if(p.key==="Enter"){const x=u.trim();x&&s(x)}p.key==="Escape"&&l()}return r.jsx("div",{className:"flex items-center py-0.5",style:{paddingLeft:o*16+8},children:r.jsx("input",{ref:O,value:u,onChange:p=>d(p.target.value),onKeyDown:h,onBlur:l,placeholder:a,className:"w-full h-5 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none"})})}function hv({entry:t,depth:a=0,activePath:s,onFileClick:l,onDirToggle:o,expanded:u,onContextMenu:d}){const O=t.type==="dir",h=s===t.path,p=u.has(t.path),x=a*16+8;function g(b){b.preventDefault(),b.stopPropagation(),d(b,t)}return r.jsxs("button",{onClick:()=>O?o(t.path):l(t.path),onContextMenu:g,className:re("w-full flex items-center gap-1.5 py-1 text-xs font-sans cursor-pointer","hover:bg-surface-5 transition-colors text-left select-none",h&&"bg-accent/10 text-text-0",!h&&"text-text-1"),style:{paddingLeft:x},children:[O?r.jsxs(r.Fragment,{children:[p?r.jsx(ca,{size:12,className:"text-text-4 flex-shrink-0"}):r.jsx(Ll,{size:12,className:"text-text-4 flex-shrink-0"}),p?r.jsx(ai,{size:14,className:"text-accent flex-shrink-0"}):r.jsx(Ab,{size:14,className:"text-text-3 flex-shrink-0"})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3"}),r.jsx(oT,{size:14,className:re("flex-shrink-0",LP(t.name))})]}),r.jsx("span",{className:"truncate",children:t.name})]})}function mv({dirPath:t,depth:a,activePath:s,onFileClick:l,expanded:o,onDirToggle:u,treeCache:d,fetchTreeDir:O,onContextMenu:h,inlineInput:p}){const x=d[t]||[];return v.useEffect(()=>{o.has(t)&&!d[t]&&O(t)},[o,t,d,O]),o.has(t)?r.jsxs(r.Fragment,{children:[(p==null?void 0:p.parentPath)===t&&r.jsx(Qc,{placeholder:p.type==="file"?"filename.ext":"folder-name",onSubmit:p.onSubmit,onCancel:p.onCancel,depth:a}),x.map(g=>r.jsxs("div",{children:[(p==null?void 0:p.renamePath)===g.path?r.jsx(Qc,{defaultValue:g.name,onSubmit:p.onSubmit,onCancel:p.onCancel,depth:a}):r.jsx(hv,{entry:g,depth:a,activePath:s,onFileClick:l,onDirToggle:u,expanded:o,onContextMenu:h}),g.type==="dir"&&r.jsx(mv,{dirPath:g.path,depth:a+1,activePath:s,onFileClick:l,expanded:o,onDirToggle:u,treeCache:d,fetchTreeDir:O,onContextMenu:h,inlineInput:p})]},g.path))]}):null}function WP({rootDir:t}){const a=D(T=>T.editorTreeCache),s=D(T=>T.editorActiveFile),l=D(T=>T.openFile),o=D(T=>T.fetchTreeDir),u=D(T=>T.addToast),[d,O]=v.useState(new Set([""])),[h,p]=v.useState(""),[x,g]=v.useState(null),[b,y]=v.useState(null);v.useEffect(()=>{o("")},[o,t]);function Q(T){O(V=>{const M=new Set(V);return M.has(T)?M.delete(T):M.add(T),M})}function w(T,V){g({x:T.clientX,y:T.clientY,entry:V})}function $(T){T.preventDefault(),g({x:T.clientX,y:T.clientY,entry:{type:"dir",path:"",name:"root"}})}function j(T){const V=T.split("/");return V.pop(),V.join("/")}async function z(T){O(V=>new Set([...V,T])),y({type:"file",parentPath:T,onSubmit:async V=>{const M=T?`${T}/${V}`:V;try{await J.post("/files/create",{path:M,content:""}),o(T),l(M),u("success",`Created ${V}`)}catch(ae){u("error","Create failed",ae.message)}y(null)},onCancel:()=>y(null)})}async function N(T){O(V=>new Set([...V,T])),y({type:"folder",parentPath:T,onSubmit:async V=>{const M=T?`${T}/${V}`:V;try{await J.post("/files/mkdir",{path:M}),o(T),O(ae=>new Set([...ae,M])),u("success",`Created ${V}/`)}catch(ae){u("error","Create folder failed",ae.message)}y(null)},onCancel:()=>y(null)})}async function _(T){y({type:"rename",renamePath:T.path,onSubmit:async V=>{const M=j(T.path),ae=M?`${M}/${V}`:V;try{await J.post("/files/rename",{oldPath:T.path,newPath:ae}),o(M),u("success",`Renamed to ${V}`)}catch(F){u("error","Rename failed",F.message)}y(null)},onCancel:()=>y(null)})}async function G(T){const V=T.type==="dir"?`folder "${T.name}" and all contents`:`"${T.name}"`;if(window.confirm(`Delete ${V}?`))try{await J.delete(`/files/delete?path=${encodeURIComponent(T.path)}`),o(j(T.path)),u("success",`Deleted ${T.name}`)}catch(M){u("error","Delete failed",M.message)}}function R(T){const V=T.type==="dir",M=[];return V&&(M.push({icon:QO,label:"New File",action:()=>z(T.path)}),M.push({icon:jO,label:"New Folder",action:()=>N(T.path)})),T.name!=="root"?(M.length>0&&M.push({separator:!0}),M.push({icon:Gc,label:"Rename",action:()=>_(T)}),M.push({icon:as,label:"Delete",danger:!0,action:()=>G(T)})):(M.length=0,M.push({icon:QO,label:"New File",action:()=>z("")}),M.push({icon:jO,label:"New Folder",action:()=>N("")})),M}const X=a[""]||[];return r.jsxs("div",{className:"flex flex-col h-full bg-surface-1",onContextMenu:$,children:[r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border-subtle",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(da,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-4"}),r.jsx("input",{value:h,onChange:T=>p(T.target.value),placeholder:"Filter...",className:"w-full h-6 pl-6 pr-2 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 placeholder:text-text-4 focus:outline-none focus:border-accent font-sans"})]}),r.jsx("button",{onClick:()=>z(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New file",children:r.jsx(QO,{size:12})}),r.jsx("button",{onClick:()=>N(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New folder",children:r.jsx(jO,{size:12})}),r.jsx("button",{onClick:()=>o(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Refresh",children:r.jsx(zn,{size:12})})]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[(b==null?void 0:b.parentPath)===""&&r.jsx(Qc,{placeholder:b.type==="file"?"filename.ext":"folder-name",onSubmit:b.onSubmit,onCancel:b.onCancel,depth:0}),X.filter(T=>!h||T.name.toLowerCase().includes(h.toLowerCase())).map(T=>r.jsxs("div",{children:[(b==null?void 0:b.renamePath)===T.path?r.jsx(Qc,{defaultValue:T.name,onSubmit:b.onSubmit,onCancel:b.onCancel,depth:0}):r.jsx(hv,{entry:T,depth:0,activePath:s,onFileClick:l,onDirToggle:Q,expanded:d,onContextMenu:w}),T.type==="dir"&&r.jsx(mv,{dirPath:T.path,depth:1,activePath:s,onFileClick:l,expanded:d,onDirToggle:Q,treeCache:a,fetchTreeDir:o,onContextMenu:w,inlineInput:b})]},T.path))]})}),x&&r.jsx(DP,{x:x.x,y:x.y,items:R(x.entry),onClose:()=>g(null)})]})}function BP(){const t=D(u=>u.editorOpenTabs),a=D(u=>u.editorActiveFile),s=D(u=>u.editorFiles),l=D(u=>u.setActiveFile),o=D(u=>u.closeFile);return t.length===0?null:r.jsx("div",{className:"flex items-center h-8 bg-surface-3 border-b border-border overflow-x-auto flex-shrink-0",children:t.map(u=>{const d=u===a,O=s[u],h=O&&O.content!==O.originalContent,p=u.split("/").pop();return r.jsxs("div",{className:re("flex items-center gap-1.5 h-full px-3 text-xs font-sans cursor-pointer select-none","border-r border-border-subtle","transition-colors duration-75",d?"bg-surface-2 text-text-0 border-b-2 border-b-accent":"bg-surface-3 text-text-3 hover:text-text-1 hover:bg-surface-4"),onClick:()=>l(u),children:[r.jsx("span",{className:"truncate max-w-[120px]",children:p}),h&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-warning flex-shrink-0"}),r.jsx("button",{onClick:x=>{x.stopPropagation(),o(u)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 transition-colors cursor-pointer ml-0.5",children:r.jsx(Qt,{size:12})})]},u)})})}var d1={};class jc{constructor(a,s,l,o,u,d,O,h,p,x=0,g){this.p=a,this.stack=s,this.state=l,this.reducePos=o,this.pos=u,this.score=d,this.buffer=O,this.bufferBase=h,this.curContext=p,this.lookAhead=x,this.parent=g}toString(){return`[${this.stack.filter((a,s)=>s%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(a,s,l=0){let o=a.parser.context;return new jc(a,[],s,l,l,0,[],0,o?new O1(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(a,s){this.stack.push(this.state,s,this.bufferBase+this.buffer.length),this.state=a}reduce(a){var s;let l=a>>19,o=a&65535,{parser:u}=this.p,d=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),O=u.dynamicPrecedence(o);if(O&&(this.score+=O),l==0){this.pushState(u.getGoto(this.state,o,!0),this.reducePos),o<u.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,d?8:4,!0),this.reduceContext(o,this.reducePos);return}let h=this.stack.length-(l-1)*3-(a&262144?6:0),p=h?this.stack[h-2]:this.p.ranges[0].from,x=this.reducePos-p;x>=2e3&&!(!((s=this.p.parser.nodeSet.types[o])===null||s===void 0)&&s.isAnonymous)&&(p==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=x):this.p.lastBigReductionSize<x&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=p,this.p.lastBigReductionSize=x));let g=h?this.stack[h-1]:0,b=this.bufferBase+this.buffer.length-g;if(o<u.minRepeatTerm||a&131072){let y=u.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,p,y,b+4,!0)}if(a&262144)this.state=this.stack[h];else{let y=this.stack[h-3];this.state=u.getGoto(y,o,!0)}for(;this.stack.length>h;)this.stack.pop();this.reduceContext(o,p)}storeNode(a,s,l,o=4,u=!1){if(a==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let d=this,O=this.buffer.length;if(O==0&&d.parent&&(O=d.bufferBase-d.parent.bufferBase,d=d.parent),O>0&&d.buffer[O-4]==0&&d.buffer[O-1]>-1){if(s==l)return;if(d.buffer[O-2]>=s){d.buffer[O-2]=l;return}}}if(!u||this.pos==l)this.buffer.push(a,s,l,o);else{let d=this.buffer.length;if(d>0&&(this.buffer[d-4]!=0||this.buffer[d-1]<0)){let O=!1;for(let h=d;h>0&&this.buffer[h-2]>l;h-=4)if(this.buffer[h-1]>=0){O=!0;break}if(O)for(;d>0&&this.buffer[d-2]>l;)this.buffer[d]=this.buffer[d-4],this.buffer[d+1]=this.buffer[d-3],this.buffer[d+2]=this.buffer[d-2],this.buffer[d+3]=this.buffer[d-1],d-=4,o>4&&(o-=4)}this.buffer[d]=a,this.buffer[d+1]=s,this.buffer[d+2]=l,this.buffer[d+3]=o}}shift(a,s,l,o){if(a&131072)this.pushState(a&65535,this.pos);else if((a&262144)==0){let u=a,{parser:d}=this.p;this.pos=o;let O=d.stateFlag(u,1);!O&&(o>l||s<=d.maxNode)&&(this.reducePos=o),this.pushState(u,O?l:Math.min(l,this.reducePos)),this.shiftContext(s,l),s<=d.maxNode&&this.buffer.push(s,l,o,4)}else this.pos=o,this.shiftContext(s,l),s<=this.p.parser.maxNode&&this.buffer.push(s,l,o,4)}apply(a,s,l,o){a&65536?this.reduce(a):this.shift(a,s,l,o)}useNode(a,s){let l=this.p.reused.length-1;(l<0||this.p.reused[l]!=a)&&(this.p.reused.push(a),l++);let o=this.pos;this.reducePos=this.pos=o+a.length,this.pushState(s,o),this.buffer.push(l,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,a,this,this.p.stream.reset(this.pos-a.length)))}split(){let a=this,s=a.buffer.length;for(;s>0&&a.buffer[s-2]>a.reducePos;)s-=4;let l=a.buffer.slice(s),o=a.bufferBase+s;for(;a&&o==a.bufferBase;)a=a.parent;return new jc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,l,o,this.curContext,this.lookAhead,a)}recoverByDelete(a,s){let l=a<=this.p.parser.maxNode;l&&this.storeNode(a,this.pos,s,4),this.storeNode(0,this.pos,s,l?8:4),this.pos=this.reducePos=s,this.score-=190}canShift(a){for(let s=new HP(this);;){let l=this.p.parser.stateSlot(s.state,4)||this.p.parser.hasAction(s.state,a);if(l==0)return!1;if((l&65536)==0)return!0;s.reduce(l)}}recoverByInsert(a){if(this.stack.length>=300)return[];let s=this.p.parser.nextStates(this.state);if(s.length>8||this.stack.length>=120){let o=[];for(let u=0,d;u<s.length;u+=2)(d=s[u+1])!=this.state&&this.p.parser.hasAction(d,a)&&o.push(s[u],d);if(this.stack.length<120)for(let u=0;o.length<8&&u<s.length;u+=2){let d=s[u+1];o.some((O,h)=>h&1&&O==d)||o.push(s[u],d)}s=o}let l=[];for(let o=0;o<s.length&&l.length<4;o+=2){let u=s[o+1];if(u==this.state)continue;let d=this.split();d.pushState(u,this.pos),d.storeNode(0,d.pos,d.pos,4,!0),d.shiftContext(s[o],this.pos),d.reducePos=this.pos,d.score-=200,l.push(d)}return l}forceReduce(){let{parser:a}=this.p,s=a.stateSlot(this.state,5);if((s&65536)==0)return!1;if(!a.validAction(this.state,s)){let l=s>>19,o=s&65535,u=this.stack.length-l*3;if(u<0||a.getGoto(this.stack[u],o,!1)<0){let d=this.findForcedReduction();if(d==null)return!1;s=d}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(s),!0}findForcedReduction(){let{parser:a}=this.p,s=[],l=(o,u)=>{if(!s.includes(o))return s.push(o),a.allActions(o,d=>{if(!(d&393216))if(d&65536){let O=(d>>19)-u;if(O>1){let h=d&65535,p=this.stack.length-O*3;if(p>=0&&a.getGoto(this.stack[p],h,!1)>=0)return O<<19|65536|h}}else{let O=l(d,u+1);if(O!=null)return O}})};return l(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:a}=this.p;return a.data[a.stateSlot(this.state,1)]==65535&&!a.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(a){if(this.state!=a.state||this.stack.length!=a.stack.length)return!1;for(let s=0;s<this.stack.length;s+=3)if(this.stack[s]!=a.stack[s])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(a){return this.p.parser.dialect.flags[a]}shiftContext(a,s){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,a,this,this.p.stream.reset(s)))}reduceContext(a,s){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,a,this,this.p.stream.reset(s)))}emitContext(){let a=this.buffer.length-1;(a<0||this.buffer[a]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let a=this.buffer.length-1;(a<0||this.buffer[a]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(a){if(a!=this.curContext.context){let s=new O1(this.curContext.tracker,a);s.hash!=this.curContext.hash&&this.emitContext(),this.curContext=s}}setLookAhead(a){return a<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=a,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class O1{constructor(a,s){this.tracker=a,this.context=s,this.hash=a.strict?a.hash(s):0}}class HP{constructor(a){this.start=a,this.state=a.state,this.stack=a.stack,this.base=this.stack.length}reduce(a){let s=a&65535,l=a>>19;l==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(l-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],s,!0);this.state=o}}class wc{constructor(a,s,l){this.stack=a,this.pos=s,this.index=l,this.buffer=a.buffer,this.index==0&&this.maybeNext()}static create(a,s=a.bufferBase+a.buffer.length){return new wc(a,s,s-a.bufferBase)}maybeNext(){let a=this.stack.parent;a!=null&&(this.index=this.stack.bufferBase-a.bufferBase,this.stack=a,this.buffer=a.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new wc(this.stack,this.pos,this.index)}}function Hr(t,a=Uint16Array){if(typeof t!="string")return t;let s=null;for(let l=0,o=0;l<t.length;){let u=0;for(;;){let d=t.charCodeAt(l++),O=!1;if(d==126){u=65535;break}d>=92&&d--,d>=34&&d--;let h=d-32;if(h>=46&&(h-=46,O=!0),u+=h,O)break;u*=46}s?s[o++]=u:s=new a(u)}return s}class ac{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const f1=new ac;class IP{constructor(a,s){this.input=a,this.ranges=s,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=f1,this.rangeIndex=0,this.pos=this.chunkPos=s[0].from,this.range=s[0],this.end=s[s.length-1].to,this.readNext()}resolveOffset(a,s){let l=this.range,o=this.rangeIndex,u=this.pos+a;for(;u<l.from;){if(!o)return null;let d=this.ranges[--o];u-=l.from-d.to,l=d}for(;s<0?u>l.to:u>=l.to;){if(o==this.ranges.length-1)return null;let d=this.ranges[++o];u+=d.from-l.to,l=d}return u}clipPos(a){if(a>=this.range.from&&a<this.range.to)return a;for(let s of this.ranges)if(s.to>a)return Math.max(a,s.from);return this.end}peek(a){let s=this.chunkOff+a,l,o;if(s>=0&&s<this.chunk.length)l=this.pos+a,o=this.chunk.charCodeAt(s);else{let u=this.resolveOffset(a,1);if(u==null)return-1;if(l=u,l>=this.chunk2Pos&&l<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(l-this.chunk2Pos);else{let d=this.rangeIndex,O=this.range;for(;O.to<=l;)O=this.ranges[++d];this.chunk2=this.input.chunk(this.chunk2Pos=l),l+this.chunk2.length>O.to&&(this.chunk2=this.chunk2.slice(0,O.to-l)),o=this.chunk2.charCodeAt(0)}}return l>=this.token.lookAhead&&(this.token.lookAhead=l+1),o}acceptToken(a,s=0){let l=s?this.resolveOffset(s,-1):this.pos;if(l==null||l<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=a,this.token.end=l}acceptTokenTo(a,s){this.token.value=a,this.token.end=s}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:a,chunkPos:s}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=a,this.chunk2Pos=s,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let a=this.input.chunk(this.pos),s=this.pos+a.length;this.chunk=s>this.range.to?a.slice(0,this.range.to-this.pos):a,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(a=1){for(this.chunkOff+=a;this.pos+a>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();a-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=a,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(a,s){if(s?(this.token=s,s.start=a,s.lookAhead=a+1,s.value=s.extended=-1):this.token=f1,this.pos!=a){if(this.pos=a,a==this.end)return this.setDone(),this;for(;a<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;a>=this.range.to;)this.range=this.ranges[++this.rangeIndex];a>=this.chunkPos&&a<this.chunkPos+this.chunk.length?this.chunkOff=a-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(a,s){if(a>=this.chunkPos&&s<=this.chunkPos+this.chunk.length)return this.chunk.slice(a-this.chunkPos,s-this.chunkPos);if(a>=this.chunk2Pos&&s<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(a-this.chunk2Pos,s-this.chunk2Pos);if(a>=this.range.from&&s<=this.range.to)return this.input.read(a,s);let l="";for(let o of this.ranges){if(o.from>=s)break;o.to>a&&(l+=this.input.read(Math.max(o.from,a),Math.min(o.to,s)))}return l}}class Pl{constructor(a,s){this.data=a,this.id=s}token(a,s){let{parser:l}=s.p;pv(this.data,a,s,this.id,l.data,l.tokenPrecTable)}}Pl.prototype.contextual=Pl.prototype.fallback=Pl.prototype.extend=!1;class kc{constructor(a,s,l){this.precTable=s,this.elseToken=l,this.data=typeof a=="string"?Hr(a):a}token(a,s){let l=a.pos,o=0;for(;;){let u=a.next<0,d=a.resolveOffset(1,1);if(pv(this.data,a,s,0,this.data,this.precTable),a.token.value>-1)break;if(this.elseToken==null)return;if(u||o++,d==null)break;a.reset(d,a.token)}o&&(a.reset(l,a.token),a.acceptToken(this.elseToken,o))}}kc.prototype.contextual=Pl.prototype.fallback=Pl.prototype.extend=!1;class gt{constructor(a,s={}){this.token=a,this.contextual=!!s.contextual,this.fallback=!!s.fallback,this.extend=!!s.extend}}function pv(t,a,s,l,o,u){let d=0,O=1<<l,{dialect:h}=s.p.parser;e:for(;(O&t[d])!=0;){let p=t[d+1];for(let y=d+3;y<p;y+=2)if((t[y+1]&O)>0){let Q=t[y];if(h.allows(Q)&&(a.token.value==-1||a.token.value==Q||FP(Q,a.token.value,o,u))){a.acceptToken(Q);break}}let x=a.next,g=0,b=t[d+2];if(a.next<0&&b>g&&t[p+b*3-3]==65535){d=t[p+b*3-1];continue e}for(;g<b;){let y=g+b>>1,Q=p+y+(y<<1),w=t[Q],$=t[Q+1]||65536;if(x<w)b=y;else if(x>=$)g=y+1;else{d=t[Q+2],a.advance();continue e}}break}}function h1(t,a,s){for(let l=a,o;(o=t[l])!=65535;l++)if(o==s)return l-a;return-1}function FP(t,a,s,l){let o=h1(s,l,a);return o<0||h1(s,l,t)<o}const Ut=typeof process<"u"&&d1&&/\bparse\b/.test(d1.LOG);let $O=null;function m1(t,a,s){let l=t.cursor(Xc.IncludeAnonymous);for(l.moveTo(a);;)if(!(s<0?l.childBefore(a):l.childAfter(a)))for(;;){if((s<0?l.to<a:l.from>a)&&!l.type.isError)return s<0?Math.max(0,Math.min(l.to-1,a-25)):Math.min(t.length,Math.max(l.from+1,a+25));if(s<0?l.prevSibling():l.nextSibling())break;if(!l.parent())return s<0?0:t.length}}let KP=class{constructor(a,s){this.fragments=a,this.nodeSet=s,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let a=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(a){for(this.safeFrom=a.openStart?m1(a.tree,a.from+a.offset,1)-a.offset:a.from,this.safeTo=a.openEnd?m1(a.tree,a.to+a.offset,-1)-a.offset:a.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(a.tree),this.start.push(-a.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(a){if(a<this.nextStart)return null;for(;this.fragment&&this.safeTo<=a;)this.nextFragment();if(!this.fragment)return null;for(;;){let s=this.trees.length-1;if(s<0)return this.nextFragment(),null;let l=this.trees[s],o=this.index[s];if(o==l.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let u=l.children[o],d=this.start[s]+l.positions[o];if(d>a)return this.nextStart=d,null;if(u instanceof mn){if(d==a){if(d<this.safeFrom)return null;let O=d+u.length;if(O<=this.safeTo){let h=u.prop(la.lookAhead);if(!h||O+h<this.fragment.to)return u}}this.index[s]++,d+u.length>=Math.max(this.safeFrom,a)&&(this.trees.push(u),this.start.push(d),this.index.push(0))}else this.index[s]++,this.nextStart=d+u.length}}};class JP{constructor(a,s){this.stream=s,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=a.tokenizers.map(l=>new ac)}getActions(a){let s=0,l=null,{parser:o}=a.p,{tokenizers:u}=o,d=o.stateSlot(a.state,3),O=a.curContext?a.curContext.hash:0,h=0;for(let p=0;p<u.length;p++){if((1<<p&d)==0)continue;let x=u[p],g=this.tokens[p];if(!(l&&!x.fallback)&&((x.contextual||g.start!=a.pos||g.mask!=d||g.context!=O)&&(this.updateCachedToken(g,x,a),g.mask=d,g.context=O),g.lookAhead>g.end+25&&(h=Math.max(g.lookAhead,h)),g.value!=0)){let b=s;if(g.extended>-1&&(s=this.addActions(a,g.extended,g.end,s)),s=this.addActions(a,g.value,g.end,s),!x.extend&&(l=g,s>b))break}}for(;this.actions.length>s;)this.actions.pop();return h&&a.setLookAhead(h),!l&&a.pos==this.stream.end&&(l=new ac,l.value=a.p.parser.eofTerm,l.start=l.end=a.pos,s=this.addActions(a,l.value,l.end,s)),this.mainToken=l,this.actions}getMainToken(a){if(this.mainToken)return this.mainToken;let s=new ac,{pos:l,p:o}=a;return s.start=l,s.end=Math.min(l+1,o.stream.end),s.value=l==o.stream.end?o.parser.eofTerm:0,s}updateCachedToken(a,s,l){let o=this.stream.clipPos(l.pos);if(s.token(this.stream.reset(o,a),l),a.value>-1){let{parser:u}=l.p;for(let d=0;d<u.specialized.length;d++)if(u.specialized[d]==a.value){let O=u.specializers[d](this.stream.read(a.start,a.end),l);if(O>=0&&l.p.parser.dialect.allows(O>>1)){(O&1)==0?a.value=O>>1:a.extended=O>>1;break}}}else a.value=0,a.end=this.stream.clipPos(o+1)}putAction(a,s,l,o){for(let u=0;u<o;u+=3)if(this.actions[u]==a)return o;return this.actions[o++]=a,this.actions[o++]=s,this.actions[o++]=l,o}addActions(a,s,l,o){let{state:u}=a,{parser:d}=a.p,{data:O}=d;for(let h=0;h<2;h++)for(let p=d.stateSlot(u,h?2:1);;p+=3){if(O[p]==65535)if(O[p+1]==1)p=sa(O,p+2);else{o==0&&O[p+1]==2&&(o=this.putAction(sa(O,p+2),s,l,o));break}O[p]==s&&(o=this.putAction(sa(O,p+1),s,l,o))}return o}}class e3{constructor(a,s,l,o){this.parser=a,this.input=s,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new IP(s,o),this.tokens=new JP(a,this.stream),this.topTerm=a.top[1];let{from:u}=o[0];this.stacks=[jc.start(this,a.top[0],u)],this.fragments=l.length&&this.stream.end-u>a.bufferLength*4?new KP(l,a.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let a=this.stacks,s=this.minStackPos,l=this.stacks=[],o,u;if(this.bigReductionCount>300&&a.length==1){let[d]=a;for(;d.forceReduce()&&d.stack.length&&d.stack[d.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let d=0;d<a.length;d++){let O=a[d];for(;;){if(this.tokens.mainToken=null,O.pos>s)l.push(O);else{if(this.advanceStack(O,l,a))continue;{o||(o=[],u=[]),o.push(O);let h=this.tokens.getMainToken(O);u.push(h.value,h.end)}}break}}if(!l.length){let d=o&&n3(o);if(d)return Ut&&console.log("Finish with "+this.stackID(d)),this.stackToTree(d);if(this.parser.strict)throw Ut&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+s);this.recovering||(this.recovering=5)}if(this.recovering&&o){let d=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,u,l);if(d)return Ut&&console.log("Force-finish "+this.stackID(d)),this.stackToTree(d.forceAll())}if(this.recovering){let d=this.recovering==1?1:this.recovering*3;if(l.length>d)for(l.sort((O,h)=>h.score-O.score);l.length>d;)l.pop();l.some(O=>O.reducePos>s)&&this.recovering--}else if(l.length>1){e:for(let d=0;d<l.length-1;d++){let O=l[d];for(let h=d+1;h<l.length;h++){let p=l[h];if(O.sameState(p)||O.buffer.length>500&&p.buffer.length>500)if((O.score-p.score||O.buffer.length-p.buffer.length)>0)l.splice(h--,1);else{l.splice(d--,1);continue e}}}l.length>12&&(l.sort((d,O)=>O.score-d.score),l.splice(12,l.length-12))}this.minStackPos=l[0].pos;for(let d=1;d<l.length;d++)l[d].pos<this.minStackPos&&(this.minStackPos=l[d].pos);return null}stopAt(a){if(this.stoppedAt!=null&&this.stoppedAt<a)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=a}advanceStack(a,s,l){let o=a.pos,{parser:u}=this,d=Ut?this.stackID(a)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return a.forceReduce()?a:null;if(this.fragments){let p=a.curContext&&a.curContext.tracker.strict,x=p?a.curContext.hash:0;for(let g=this.fragments.nodeAt(o);g;){let b=this.parser.nodeSet.types[g.type.id]==g.type?u.getGoto(a.state,g.type.id):-1;if(b>-1&&g.length&&(!p||(g.prop(la.contextHash)||0)==x))return a.useNode(g,b),Ut&&console.log(d+this.stackID(a)+` (via reuse of ${u.getName(g.type.id)})`),!0;if(!(g instanceof mn)||g.children.length==0||g.positions[0]>0)break;let y=g.children[0];if(y instanceof mn&&g.positions[0]==0)g=y;else break}}let O=u.stateSlot(a.state,4);if(O>0)return a.reduce(O),Ut&&console.log(d+this.stackID(a)+` (via always-reduce ${u.getName(O&65535)})`),!0;if(a.stack.length>=8400)for(;a.stack.length>6e3&&a.forceReduce(););let h=this.tokens.getActions(a);for(let p=0;p<h.length;){let x=h[p++],g=h[p++],b=h[p++],y=p==h.length||!l,Q=y?a:a.split(),w=this.tokens.mainToken;if(Q.apply(x,g,w?w.start:Q.pos,b),Ut&&console.log(d+this.stackID(Q)+` (via ${(x&65536)==0?"shift":`reduce of ${u.getName(x&65535)}`} for ${u.getName(g)} @ ${o}${Q==a?"":", split"})`),y)return!0;Q.pos>o?s.push(Q):l.push(Q)}return!1}advanceFully(a,s){let l=a.pos;for(;;){if(!this.advanceStack(a,null,null))return!1;if(a.pos>l)return p1(a,s),!0}}runRecovery(a,s,l){let o=null,u=!1;for(let d=0;d<a.length;d++){let O=a[d],h=s[d<<1],p=s[(d<<1)+1],x=Ut?this.stackID(O)+" -> ":"";if(O.deadEnd&&(u||(u=!0,O.restart(),Ut&&console.log(x+this.stackID(O)+" (restarted)"),this.advanceFully(O,l))))continue;let g=O.split(),b=x;for(let y=0;y<10&&g.forceReduce()&&(Ut&&console.log(b+this.stackID(g)+" (via force-reduce)"),!this.advanceFully(g,l));y++)Ut&&(b=this.stackID(g)+" -> ");for(let y of O.recoverByInsert(h))Ut&&console.log(x+this.stackID(y)+" (via recover-insert)"),this.advanceFully(y,l);this.stream.end>O.pos?(p==O.pos&&(p++,h=0),O.recoverByDelete(h,p),Ut&&console.log(x+this.stackID(O)+` (via recover-delete ${this.parser.getName(h)})`),p1(O,l)):(!o||o.score<g.score)&&(o=g)}return o}stackToTree(a){return a.close(),mn.build({buffer:wc.create(a),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:a.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(a){let s=($O||($O=new WeakMap)).get(a);return s||$O.set(a,s=String.fromCodePoint(this.nextStackID++)),s+a}}function p1(t,a){for(let s=0;s<a.length;s++){let l=a[s];if(l.pos==t.pos&&l.sameState(t)){a[s].score<t.score&&(a[s]=t);return}}a.push(t)}class t3{constructor(a,s,l){this.source=a,this.flags=s,this.disabled=l}allows(a){return!this.disabled||this.disabled[a]==0}}const TO=t=>t;class dh{constructor(a){this.start=a.start,this.shift=a.shift||TO,this.reduce=a.reduce||TO,this.reuse=a.reuse||TO,this.hash=a.hash||(()=>0),this.strict=a.strict!==!1}}class es extends T0{constructor(a){if(super(),this.wrappers=[],a.version!=14)throw new RangeError(`Parser version (${a.version}) doesn't match runtime version (14)`);let s=a.nodeNames.split(" ");this.minRepeatTerm=s.length;for(let O=0;O<a.repeatNodeCount;O++)s.push("");let l=Object.keys(a.topRules).map(O=>a.topRules[O][1]),o=[];for(let O=0;O<s.length;O++)o.push([]);function u(O,h,p){o[O].push([h,h.deserialize(String(p))])}if(a.nodeProps)for(let O of a.nodeProps){let h=O[0];typeof h=="string"&&(h=la[h]);for(let p=1;p<O.length;){let x=O[p++];if(x>=0)u(x,h,O[p++]);else{let g=O[p+-x];for(let b=-x;b>0;b--)u(O[p++],h,g);p++}}}this.nodeSet=new _f(s.map((O,h)=>di.define({name:h>=this.minRepeatTerm?void 0:O,id:h,props:o[h],top:l.indexOf(h)>-1,error:h==0,skipped:a.skippedNodes&&a.skippedNodes.indexOf(h)>-1}))),a.propSources&&(this.nodeSet=this.nodeSet.extend(...a.propSources)),this.strict=!1,this.bufferLength=Nj;let d=Hr(a.tokenData);this.context=a.context,this.specializerSpecs=a.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let O=0;O<this.specializerSpecs.length;O++)this.specialized[O]=this.specializerSpecs[O].term;this.specializers=this.specializerSpecs.map(x1),this.states=Hr(a.states,Uint32Array),this.data=Hr(a.stateData),this.goto=Hr(a.goto),this.maxTerm=a.maxTerm,this.tokenizers=a.tokenizers.map(O=>typeof O=="number"?new Pl(d,O):O),this.topRules=a.topRules,this.dialects=a.dialects||{},this.dynamicPrecedences=a.dynamicPrecedences||null,this.tokenPrecTable=a.tokenPrec,this.termNames=a.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(a,s,l){let o=new e3(this,a,s,l);for(let u of this.wrappers)o=u(o,a,s,l);return o}getGoto(a,s,l=!1){let o=this.goto;if(s>=o[0])return-1;for(let u=o[s+1];;){let d=o[u++],O=d&1,h=o[u++];if(O&&l)return h;for(let p=u+(d>>1);u<p;u++)if(o[u]==a)return h;if(O)return-1}}hasAction(a,s){let l=this.data;for(let o=0;o<2;o++)for(let u=this.stateSlot(a,o?2:1),d;;u+=3){if((d=l[u])==65535)if(l[u+1]==1)d=l[u=sa(l,u+2)];else{if(l[u+1]==2)return sa(l,u+2);break}if(d==s||d==0)return sa(l,u+1)}return 0}stateSlot(a,s){return this.states[a*6+s]}stateFlag(a,s){return(this.stateSlot(a,0)&s)>0}validAction(a,s){return!!this.allActions(a,l=>l==s?!0:null)}allActions(a,s){let l=this.stateSlot(a,4),o=l?s(l):void 0;for(let u=this.stateSlot(a,1);o==null;u+=3){if(this.data[u]==65535)if(this.data[u+1]==1)u=sa(this.data,u+2);else break;o=s(sa(this.data,u+1))}return o}nextStates(a){let s=[];for(let l=this.stateSlot(a,1);;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=sa(this.data,l+2);else break;if((this.data[l+2]&1)==0){let o=this.data[l+1];s.some((u,d)=>d&1&&u==o)||s.push(this.data[l],o)}}return s}configure(a){let s=Object.assign(Object.create(es.prototype),this);if(a.props&&(s.nodeSet=this.nodeSet.extend(...a.props)),a.top){let l=this.topRules[a.top];if(!l)throw new RangeError(`Invalid top rule name ${a.top}`);s.top=l}return a.tokenizers&&(s.tokenizers=this.tokenizers.map(l=>{let o=a.tokenizers.find(u=>u.from==l);return o?o.to:l})),a.specializers&&(s.specializers=this.specializers.slice(),s.specializerSpecs=this.specializerSpecs.map((l,o)=>{let u=a.specializers.find(O=>O.from==l.external);if(!u)return l;let d=Object.assign(Object.assign({},l),{external:u.to});return s.specializers[o]=x1(d),d})),a.contextTracker&&(s.context=a.contextTracker),a.dialect&&(s.dialect=this.parseDialect(a.dialect)),a.strict!=null&&(s.strict=a.strict),a.wrap&&(s.wrappers=s.wrappers.concat(a.wrap)),a.bufferLength!=null&&(s.bufferLength=a.bufferLength),s}hasWrappers(){return this.wrappers.length>0}getName(a){return this.termNames?this.termNames[a]:String(a<=this.maxNode&&this.nodeSet.types[a].name||a)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(a){let s=this.dynamicPrecedences;return s==null?0:s[a]||0}parseDialect(a){let s=Object.keys(this.dialects),l=s.map(()=>!1);if(a)for(let u of a.split(" ")){let d=s.indexOf(u);d>=0&&(l[d]=!0)}let o=null;for(let u=0;u<s.length;u++)if(!l[u])for(let d=this.dialects[s[u]],O;(O=this.data[d++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[O]=1;return new t3(a,l,o)}static deserialize(a){return new es(a)}}function sa(t,a){return t[a]|t[a+1]<<16}function n3(t){let a=null;for(let s of t){let l=s.p.stoppedAt;(s.pos==s.p.stream.end||l!=null&&s.pos>l)&&s.p.parser.stateFlag(s.state,2)&&(!a||a.score<s.score)&&(a=s)}return a}function x1(t){if(t.external){let a=t.extend?1:0;return(s,l)=>t.external(s,l)<<1|a}return t.get}const a3=316,s3=317,g1=1,l3=2,r3=3,i3=4,o3=318,c3=320,u3=321,d3=5,O3=6,f3=0,gf=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],xv=125,h3=59,bf=47,m3=42,p3=43,x3=45,g3=60,b3=44,v3=63,y3=46,S3=91,Q3=new dh({start:!1,shift(t,a){return a==d3||a==O3||a==c3?t:a==u3},strict:!1}),j3=new gt((t,a)=>{let{next:s}=t;(s==xv||s==-1||a.context)&&t.acceptToken(o3)},{contextual:!0,fallback:!0}),w3=new gt((t,a)=>{let{next:s}=t,l;gf.indexOf(s)>-1||s==bf&&((l=t.peek(1))==bf||l==m3)||s!=xv&&s!=h3&&s!=-1&&!a.context&&t.acceptToken(a3)},{contextual:!0}),k3=new gt((t,a)=>{t.next==S3&&!a.context&&t.acceptToken(s3)},{contextual:!0}),$3=new gt((t,a)=>{let{next:s}=t;if(s==p3||s==x3){if(t.advance(),s==t.next){t.advance();let l=!a.context&&a.canShift(g1);t.acceptToken(l?g1:l3)}}else s==v3&&t.peek(1)==y3&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(r3))},{contextual:!0});function NO(t,a){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!a&&t>=48&&t<=57}const T3=new gt((t,a)=>{if(t.next!=g3||!a.dialectEnabled(f3)||(t.advance(),t.next==bf))return;let s=0;for(;gf.indexOf(t.next)>-1;)t.advance(),s++;if(NO(t.next,!0)){for(t.advance(),s++;NO(t.next,!1);)t.advance(),s++;for(;gf.indexOf(t.next)>-1;)t.advance(),s++;if(t.next==b3)return;for(let l=0;;l++){if(l==7){if(!NO(t.next,!0))return;break}if(t.next!="extends".charCodeAt(l))break;t.advance(),s++}}t.acceptToken(i3,-s)}),N3=Rs({"get set async static":A.modifier,"for while do if else switch try catch finally return throw break continue default case defer":A.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":A.operatorKeyword,"let var const using function class extends":A.definitionKeyword,"import export from":A.moduleKeyword,"with debugger new":A.keyword,TemplateString:A.special(A.string),super:A.atom,BooleanLiteral:A.bool,this:A.self,null:A.null,Star:A.modifier,VariableName:A.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":A.function(A.variableName),VariableDefinition:A.definition(A.variableName),Label:A.labelName,PropertyName:A.propertyName,PrivatePropertyName:A.special(A.propertyName),"CallExpression/MemberExpression/PropertyName":A.function(A.propertyName),"FunctionDeclaration/VariableDefinition":A.function(A.definition(A.variableName)),"ClassDeclaration/VariableDefinition":A.definition(A.className),"NewExpression/VariableName":A.className,PropertyDefinition:A.definition(A.propertyName),PrivatePropertyDefinition:A.definition(A.special(A.propertyName)),UpdateOp:A.updateOperator,"LineComment Hashbang":A.lineComment,BlockComment:A.blockComment,Number:A.number,String:A.string,Escape:A.escape,ArithOp:A.arithmeticOperator,LogicOp:A.logicOperator,BitOp:A.bitwiseOperator,CompareOp:A.compareOperator,RegExp:A.regexp,Equals:A.definitionOperator,Arrow:A.function(A.punctuation),": Spread":A.punctuation,"( )":A.paren,"[ ]":A.squareBracket,"{ }":A.brace,"InterpolationStart InterpolationEnd":A.special(A.brace),".":A.derefOperator,", ;":A.separator,"@":A.meta,TypeName:A.typeName,TypeDefinition:A.definition(A.typeName),"type enum interface implements namespace module declare":A.definitionKeyword,"abstract global Privacy readonly override":A.modifier,"is keyof unique infer asserts":A.operatorKeyword,JSXAttributeValue:A.attributeValue,JSXText:A.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":A.angleBracket,"JSXIdentifier JSXNameSpacedName":A.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":A.attributeName,"JSXBuiltin/JSXIdentifier":A.standard(A.tagName)}),P3={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},z3={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},R3={__proto__:null,"<":193},C3=es.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`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=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Q3,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[N3],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;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!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[w3,k3,$3,T3,2,3,4,5,6,7,8,9,10,11,12,13,14,j3,new kc("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new kc("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>P3[t]||-1},{term:343,get:t=>z3[t]||-1},{term:95,get:t=>R3[t]||-1}],tokenPrec:15201}),gv=[Fe("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Fe("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Fe("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Fe("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Fe("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Fe(`try {
|
|
569
|
+
*/const LN=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Rn=se("zap",LN),DN={success:ni,error:ua,info:qb,warning:gi},WN={success:"border-l-success",error:"border-l-danger",info:"border-l-accent",warning:"border-l-warning"},BN={success:"text-success",error:"text-danger",info:"text-accent",warning:"text-warning"},HN={success:3e3,error:0,info:5e3,warning:5e3};function IN({toast:t}){const a=D(o=>o.removeToast),s=DN[t.type]||qb,l=HN[t.type];return v.useEffect(()=>{if(!l)return;const o=setTimeout(()=>a(t.id),l);return()=>clearTimeout(o)},[t.id,l,a]),r.jsxs(Xf.div,{layout:!0,initial:{opacity:0,x:80,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:80,scale:.95},transition:{duration:.2},className:re("w-80 rounded-md border border-border bg-surface-1 shadow-xl","border-l-4 flex items-center gap-3 px-4 py-3",WN[t.type]),children:[r.jsx(s,{size:16,className:re("flex-shrink-0",BN[t.type])}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm text-text-0 font-sans",children:t.message}),t.detail&&r.jsx("p",{className:"text-xs text-text-3 font-sans mt-0.5",children:t.detail})]}),r.jsx("button",{onClick:o=>{o.stopPropagation(),a(t.id)},className:"p-1.5 text-text-4 hover:text-text-1 hover:bg-surface-5 rounded transition-colors cursor-pointer flex-shrink-0 z-10",children:r.jsx(Qt,{size:14})})]})}function FN(){const t=D(a=>a.toasts);return r.jsx("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col-reverse gap-2",children:r.jsx(Cf,{mode:"popLayout",children:t.slice(-3).map(a=>r.jsx(IN,{toast:a},a.id))})})}const KN=[{id:"agents",icon:Ub,label:"Agents"},{id:"editor",icon:ns,label:"Editor"},{id:"dashboard",icon:Vc,label:"Dashboard"},{id:"marketplace",icon:Lb,label:"Marketplace"},{id:"models",icon:Ff,label:"Models"},{id:"teams",icon:bi,label:"Teams"}],JN=[{id:"journalist",icon:si,label:"Journalist",panel:!0},{id:"settings",icon:Bb,label:"Settings",nav:!0}];function eP({activeView:t,detailPanel:a,onNavigate:s,onTogglePanel:l}){return r.jsxs("nav",{className:"w-12 flex-shrink-0 flex flex-col bg-surface-3 border-r border-border",children:[r.jsx("div",{className:"flex flex-col items-center gap-0.5 pt-2",children:KN.map(o=>r.jsx(t1,{content:o.label,side:"right",children:r.jsx("button",{onClick:()=>s(o.id),className:re("w-10 h-10 flex items-center justify-center rounded-md transition-colors cursor-pointer",t===o.id?"text-text-0 bg-surface-5":"text-text-3 hover:text-text-1 hover:bg-surface-4"),children:r.jsx(o.icon,{size:20,strokeWidth:t===o.id?2:1.5})})},o.id))}),r.jsx("div",{className:"flex-1"}),r.jsx("div",{className:"flex flex-col items-center gap-0.5 pb-2",children:JN.map(o=>{const u=o.panel?(a==null?void 0:a.type)===o.id:t===o.id;return r.jsx(t1,{content:o.label,side:"right",children:r.jsx("button",{onClick:()=>o.panel?l(o.id):s((o.nav,o.id)),className:re("w-10 h-10 flex items-center justify-center rounded-md transition-colors cursor-pointer",u?"text-text-0 bg-surface-5":"text-text-3 hover:text-text-1 hover:bg-surface-4"),children:r.jsx(o.icon,{size:20,strokeWidth:u?2:1.5})})},o.id)})})]})}const tP={agents:"Agents",editor:"Editor",dashboard:"Dashboard",marketplace:"Marketplace",teams:"Teams"};function nP({activeView:t,connected:a,daemonHost:s,editorActiveFile:l,onOpenCommandPalette:o,onSpawn:u}){const d=["Groove",tP[t]||t];return t==="editor"&&l&&d.push(l.split("/").pop()),r.jsxs("header",{className:"h-11 flex-shrink-0 flex items-center gap-3 px-4 bg-surface-3 border-b border-border",children:[r.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-7 w-7 rounded-full flex-shrink-0"}),s&&r.jsx("span",{className:"text-2xs font-mono font-semibold text-text-3 bg-surface-5 px-1.5 py-0.5 rounded flex-shrink-0",children:s}),r.jsx("div",{className:"flex-1 min-w-4"}),r.jsxs("button",{onClick:o,className:re("flex items-center gap-2.5 h-8 px-4 rounded-full w-full max-w-md","bg-surface-1 border border-border-subtle","text-sm text-text-4 font-sans","hover:border-border hover:text-text-3 transition-colors cursor-pointer"),children:[r.jsx(da,{size:14,className:"flex-shrink-0"}),r.jsx("span",{className:"flex-1 text-left",children:"Search commands..."}),r.jsx("kbd",{className:"text-2xs font-mono bg-surface-4 px-1.5 py-0.5 rounded-full text-text-4",children:"Cmd+K"})]}),r.jsx("div",{className:"flex-1 min-w-4"}),r.jsx("div",{className:"flex items-center gap-1 text-xs font-sans text-text-3 flex-shrink-0",children:d.map((O,h)=>r.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&r.jsx(Ll,{size:11,className:"text-text-4"}),r.jsx("span",{className:re(h===d.length-1?"text-text-2":"text-text-4"),children:O})]},h))}),a&&r.jsxs("button",{onClick:u,className:"ml-1 flex items-center gap-1 h-7 px-3.5 rounded-full bg-accent/15 text-accent text-xs font-semibold font-sans hover:bg-accent/25 transition-colors cursor-pointer select-none flex-shrink-0",children:[r.jsx(Ja,{size:14}),"Spawn"]})]})}const aP={running:"var(--color-success)",starting:"var(--color-warning)",stopped:"var(--color-text-3)",crashed:"var(--color-danger)",completed:"var(--color-accent)",killed:"var(--color-text-3)",rotating:"var(--color-purple)"};function rh(t){return aP[t]||"var(--color-text-3)"}const sP={planner:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},backend:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},frontend:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},fullstack:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},testing:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},devops:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"},docs:{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"},security:{bg:"rgba(224, 108, 117, 0.12)",text:"#e06c75",border:"#e06c75"},database:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},cmo:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},cfo:{bg:"rgba(74, 225, 104, 0.12)",text:"#4ae168",border:"#4ae168"},ea:{bg:"rgba(97, 175, 239, 0.12)",text:"#61afef",border:"#61afef"},support:{bg:"rgba(51, 175, 188, 0.12)",text:"#33afbc",border:"#33afbc"},analyst:{bg:"rgba(198, 120, 221, 0.12)",text:"#c678dd",border:"#c678dd"},creative:{bg:"rgba(229, 192, 123, 0.12)",text:"#e5c07b",border:"#e5c07b"},slides:{bg:"rgba(209, 154, 102, 0.12)",text:"#d19a66",border:"#d19a66"}};function Kb(t){const a=(t||"").toLowerCase();return sP[a]||{bg:"rgba(139, 146, 158, 0.12)",text:"#8b929e",border:"#8b929e"}}function Ts({status:t,size:a="md",className:s}){const l=t==="running"||t==="starting",o=a==="sm"?"w-1.5 h-1.5":a==="lg"?"w-3 h-3":"w-2 h-2";return r.jsx("span",{className:re("rounded-full inline-block flex-shrink-0",l&&"animate-pulse",o,s),style:{background:rh(t)}})}function et(t){return t==null||isNaN(t)?"0":t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":Math.round(t).toLocaleString()}function Lc(t){return t==null||isNaN(t)?"$0":t>=1e3?"$"+(t/1e3).toFixed(1).replace(/\.0$/,"")+"k":t>=1||t>=.01?"$"+t.toFixed(2):"$"+t.toFixed(3)}function Ns(t){return t==null||isNaN(t)?"0%":Math.round(t)+"%"}function Dc(t){if(!t||t<0)return"0s";const a=Math.floor(t/86400),s=Math.floor(t%86400/3600),l=Math.floor(t%3600/60),o=Math.floor(t%60);return a>0?`${a}d ${s}h`:s>0?`${s}h ${l}m`:l>0?`${l}m ${o}s`:`${o}s`}function vt(t){if(!t)return"";const a=(Date.now()-new Date(t).getTime())/1e3;return a<5?"just now":a<60?`${Math.floor(a)}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}function lP({connected:t,agentCount:a,runningCount:s,uptime:l,terminalVisible:o,onToggleTerminal:u}){return r.jsxs("footer",{className:"h-6 flex-shrink-0 flex items-center px-3 bg-surface-3 border-t border-border text-2xs font-sans select-none",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Ts,{status:t?"running":"crashed",size:"sm"}),r.jsx("span",{className:t?"text-text-2":"text-danger",children:t?"Connected":"Offline"})]}),t&&l>0&&r.jsxs("span",{className:"text-text-4",children:["Up ",Dc(l)]}),t&&a>0&&r.jsxs("span",{className:"text-text-4",children:[s,"/",a," agents"]})]}),r.jsx("div",{className:"flex-1"}),r.jsxs("a",{href:"https://docs.groovedev.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-2 h-full text-text-3 hover:text-text-1 hover:bg-surface-5 transition-colors no-underline",children:[r.jsx(w5,{size:12}),r.jsx("span",{children:"Docs"})]}),r.jsxs("button",{onClick:u,className:re("flex items-center gap-1.5 px-2 h-full transition-colors cursor-pointer",o?"text-accent bg-accent/8 hover:bg-accent/12":"text-text-3 hover:text-text-1 hover:bg-surface-5"),children:[r.jsx(xi,{size:12}),r.jsx("span",{children:"Terminal"}),r.jsx("kbd",{className:"font-mono text-text-4 ml-0.5",children:"Cmd+J"})]})]})}function rP({children:t,width:a,onWidthChange:s,onClose:l,className:o}){const u=v.useRef(!1),d=v.useRef(0),O=v.useRef(0),h=v.useCallback(p=>{p.preventDefault(),u.current=!0,d.current=p.clientX,O.current=a;function x(b){if(!u.current)return;const y=d.current-b.clientX,Q=Math.min(Math.max(O.current+y,380),window.innerWidth*.65);s(Q)}function g(){u.current=!1,document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",g)}document.addEventListener("mousemove",x),document.addEventListener("mouseup",g)},[a,s]);return r.jsxs("aside",{className:re("flex-shrink-0 flex bg-surface-1 border-l border-border relative",o),style:{width:a},children:[r.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:h}),r.jsx("button",{onClick:l,className:"absolute top-3 right-3 z-10 p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:r.jsx(Qt,{size:14})}),r.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:t})]})}const iP=[{id:"nav:agents",label:"Go to Agents",icon:Ub,category:"Navigation",action:t=>{t.setActiveView("agents")}},{id:"nav:editor",label:"Go to Editor",icon:ns,category:"Navigation",action:t=>{t.setActiveView("editor")}},{id:"nav:dashboard",label:"Go to Dashboard",icon:Vc,category:"Navigation",action:t=>{t.setActiveView("dashboard")}},{id:"nav:marketplace",label:"Go to Marketplace",icon:Lb,category:"Navigation",action:t=>{t.setActiveView("marketplace")}},{id:"nav:teams",label:"Go to Teams",icon:bi,category:"Navigation",action:t=>{t.setActiveView("teams")}},{id:"action:spawn",label:"Spawn Agent",icon:Ja,category:"Actions",action:t=>{t.openDetail({type:"spawn"})}},{id:"action:terminal",label:"Toggle Terminal",icon:xi,category:"Actions",action:t=>{t.setTerminalVisible(!t.terminalVisible)},shortcut:"Cmd+J"},{id:"action:journalist",label:"Toggle Journalist",icon:si,category:"Actions",action:t=>{var a;((a=t.detailPanel)==null?void 0:a.type)==="journalist"?t.closeDetail():t.openDetail({type:"journalist"})}}];function oP(){const t=D(y=>y.commandPaletteOpen),a=D(y=>y.toggleCommandPalette),s=D(y=>y.agents),l=D,[o,u]=v.useState(""),[d,O]=v.useState(0),h=v.useRef(null),p=v.useMemo(()=>{const y=s.flatMap(Q=>[{id:`chat:${Q.id}`,label:`Chat with ${Q.name}`,icon:pi,category:"Agents",action:w=>{w.selectAgent(Q.id)}},...Q.status==="running"?[{id:`rotate:${Q.id}`,label:`Rotate ${Q.name}`,icon:Wl,category:"Agents",action:w=>{w.rotateAgent(Q.id)}},{id:`kill:${Q.id}`,label:`Kill ${Q.name}`,icon:sh,category:"Agents",action:w=>{w.killAgent(Q.id)}}]:[]]);return[...iP,...y]},[s]),x=v.useMemo(()=>{if(!o.trim())return p.slice(0,12);const y=o.toLowerCase();return p.filter(Q=>Q.label.toLowerCase().includes(y)||Q.category.toLowerCase().includes(y)).slice(0,12)},[p,o]);v.useEffect(()=>{t&&(u(""),O(0),setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.focus()},50))},[t]),v.useEffect(()=>{d>=x.length&&O(Math.max(0,x.length-1))},[x.length,d]);function g(y){y.action(l.getState()),a()}function b(y){y.key==="ArrowDown"?(y.preventDefault(),O(Q=>Math.min(Q+1,x.length-1))):y.key==="ArrowUp"?(y.preventDefault(),O(Q=>Math.max(Q-1,0))):y.key==="Enter"&&x[d]?(y.preventDefault(),g(x[d])):y.key==="Escape"&&a()}return t?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm",onClick:a}),r.jsx(Cf,{children:r.jsxs(Xf.div,{initial:{opacity:0,y:-20,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{duration:.15},className:"fixed top-[15%] left-1/2 -translate-x-1/2 z-50 w-[480px] max-h-[400px] bg-surface-1 border border-border rounded-lg shadow-2xl overflow-hidden",onKeyDown:b,children:[r.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border-subtle",children:[r.jsx(da,{size:16,className:"text-text-3 flex-shrink-0"}),r.jsx("input",{ref:h,value:o,onChange:y=>{u(y.target.value),O(0)},placeholder:"Type a command...",className:"flex-1 bg-transparent text-sm text-text-0 font-sans placeholder:text-text-4 focus:outline-none"})]}),r.jsxs("div",{className:"overflow-y-auto max-h-[320px] py-1",children:[x.length===0&&r.jsx("div",{className:"px-4 py-6 text-sm text-text-3 text-center font-sans",children:"No results"}),x.map((y,Q)=>r.jsxs("button",{onClick:()=>g(y),onMouseEnter:()=>O(Q),className:re("w-full flex items-center gap-3 px-4 py-2 text-sm font-sans cursor-pointer",Q===d?"bg-surface-5 text-text-0":"text-text-1 hover:bg-surface-4"),children:[r.jsx(y.icon,{size:16,className:"text-text-3 flex-shrink-0"}),r.jsx("span",{className:"flex-1 text-left",children:y.label}),r.jsx("span",{className:"text-2xs text-text-4",children:y.category}),y.shortcut&&r.jsx("kbd",{className:"text-2xs font-mono bg-surface-4 px-1 py-0.5 rounded text-text-3 ml-1",children:y.shortcut})]},y.id))]})]})})]}):null}function cP({children:t,detailContent:a,terminalContent:s}){const l=D(R=>R.activeView),o=D(R=>R.detailPanel),u=D(R=>R.connected),d=D(R=>R.tunneled),O=D(R=>R.daemonHost),h=D(R=>R.agents),p=D(R=>R.editorActiveFile),x=D(R=>R.detailPanelWidth),g=D(R=>R.terminalVisible),b=D(R=>R.terminalFullHeight),y=D(R=>R.setActiveView),Q=D(R=>R.openDetail),w=D(R=>R.closeDetail),$=D(R=>R.setDetailPanelWidth),j=D(R=>R.setTerminalVisible),z=D(R=>R.toggleCommandPalette),N=v.useMemo(()=>h.filter(R=>R.status==="running").length,[h]),_=v.useMemo(()=>[{key:"k",meta:!0,handler:()=>D.getState().toggleCommandPalette()},{key:"p",meta:!0,shift:!0,handler:()=>D.getState().toggleCommandPalette()},{key:"j",meta:!0,handler:()=>{const R=D.getState();R.setTerminalVisible(!R.terminalVisible)}},{key:"n",meta:!0,handler:()=>D.getState().openDetail({type:"spawn"})},{key:"1",meta:!0,handler:()=>D.getState().setActiveView("agents")},{key:"2",meta:!0,handler:()=>D.getState().setActiveView("editor")},{key:"3",meta:!0,handler:()=>D.getState().setActiveView("dashboard")},{key:"4",meta:!0,handler:()=>D.getState().setActiveView("marketplace")},{key:"5",meta:!0,handler:()=>D.getState().setActiveView("teams")},{key:"Escape",handler:()=>{const R=D.getState();R.commandPaletteOpen?R.toggleCommandPalette():R.detailPanel&&R.closeDetail()}}],[]);uw(_);const G=o&&o.type!=="spawn";return r.jsx(h5,{children:r.jsxs("div",{className:"w-full h-full flex flex-col bg-surface-2 text-text-1 font-sans",children:[r.jsx(nP,{activeView:l,connected:u,tunneled:d,daemonHost:O,editorActiveFile:p,onOpenCommandPalette:z,onSpawn:()=>Q({type:"spawn"})}),r.jsxs("div",{className:"flex-1 flex min-h-0",children:[r.jsx(eP,{activeView:l,detailPanel:o,onNavigate:y,onTogglePanel:R=>{(o==null?void 0:o.type)===R?w():Q({type:R})}}),r.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:[!(g&&b)&&r.jsx("main",{className:"flex-1 min-h-0 overflow-hidden relative",children:t}),s]}),G&&r.jsx(rP,{width:x,onWidthChange:$,onClose:w,children:a})]}),r.jsx(lP,{connected:u,agentCount:h.length,runningCount:N,terminalVisible:g,onToggleTerminal:()=>j(!g)}),r.jsx(oP,{}),r.jsx(FN,{})]})})}const uP=[];function dP(t){if(!t||t==="auto")return"auto";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)(?:-\d+)?$/);return a?`${a[1][0].toUpperCase()+a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gemini ").replace("-preview","").replace("-flash-lite"," Flash Lite").replace("-flash"," Flash").replace("-pro"," Pro"):t.startsWith("gpt-")?t.toUpperCase().replace("GPT-","GPT-"):t}function OP(t){if(!t)return null;const a=t.toLowerCase();return a.includes("read")?"READ":a.includes("edit")||a.includes("writ")?"WRITE":a.includes("search")||a.includes("grep")||a.includes("glob")?"SEARCH":a.includes("bash")||a.includes("exec")||a.includes("running")?"EXEC":a.includes("test")?"TEST":a.includes("error")||a.includes("fail")?"ERR":a.includes("complet")||a.includes("done")?"DONE":"WORK"}function fP(t){if(!t)return"";const a=Math.floor((Date.now()-t)/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:`${Math.floor(a/3600)}h`}function hP({agent:t}){const s=(D(l=>l.activityLog[t.id])||uP).slice(-8);return r.jsx("div",{className:"absolute left-full top-0 ml-2 z-50 pointer-events-none",style:{width:220,animation:"tooltip-slide-in 0.15s ease-out"},children:r.jsxs("div",{className:"overflow-hidden",style:{background:"#181b21",border:"1px solid #262a32",borderRadius:4},children:[t.prompt&&r.jsx("div",{className:"px-2.5 py-2 border-b border-[#262a32]",children:r.jsx("p",{className:"text-[9px] font-sans text-[#8b929e] line-clamp-3 leading-snug",children:t.prompt})}),s.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"px-2.5 pt-1.5 pb-1",children:r.jsx("span",{className:"text-[8px] font-mono text-[#3a3f4b] uppercase tracking-widest",children:"Activity"})}),s.map((l,o)=>{var O;const u=OP(l.text),d=((O=l.text)==null?void 0:O.length)>45?l.text.slice(0,45)+"...":l.text;return r.jsxs("div",{className:"px-2.5 py-[3px] flex items-start gap-1.5",children:[r.jsx("span",{className:"text-[8px] font-mono text-[#333842] w-5 flex-shrink-0 text-right",children:fP(l.timestamp)}),u&&r.jsx("span",{className:re("text-[7px] font-mono w-7 flex-shrink-0 text-center rounded-sm px-0.5 py-px",u==="ERR"?"text-[#e06c75] bg-[#e06c75]/10":"text-[#505862] bg-[#505862]/10"),children:u}),r.jsx("span",{className:"text-[9px] font-sans text-[#6e7681] truncate flex-1",children:d})]},o)}),r.jsx("div",{className:"h-1.5"})]}):r.jsx("div",{className:"px-2.5 py-3",children:r.jsx("span",{className:"text-[9px] font-mono text-[#333842]",children:"Awaiting activity..."})})]})})}const mP={running:"LIVE",starting:"INIT",stopped:"IDLE",crashed:"ERR",completed:"DONE",killed:"KILL",rotating:"ROT"},Jb=v.memo(({data:t,selected:a})=>{const{agent:s}=t,l=s.status==="running"||s.status==="starting",o=Math.round((s.contextUsage||0)*100),u=rh(s.status),d=s.tokensUsed||0,[O,h]=v.useState(!1);return r.jsxs("div",{className:"relative",onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[r.jsxs("div",{className:"w-[220px] overflow-hidden transition-all duration-150",style:{background:"#1c1f26",border:`1px solid ${a?"#2e323a":"#262a32"}`,borderRadius:4},children:[r.jsx(Da,{id:"top",type:"target",position:Wa.Top,className:"!w-1 !h-1 !bg-transparent !border-0"}),r.jsx(Da,{id:"bottom",type:"target",position:Wa.Bottom,className:"!w-1 !h-1 !bg-transparent !border-0"}),r.jsx(Da,{id:"left",type:"target",position:Wa.Left,className:"!w-1 !h-1 !bg-transparent !border-0"}),r.jsx(Da,{id:"right",type:"target",position:Wa.Right,className:"!w-1 !h-1 !bg-transparent !border-0"}),l&&r.jsx("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",style:{borderRadius:3},children:r.jsx("div",{className:"absolute left-0 right-0 h-px",style:{background:"linear-gradient(90deg, transparent 0%, rgba(97,175,239,0.25) 50%, transparent 100%)",animation:"node-scan 3s ease-in-out infinite"}})}),r.jsxs("div",{className:"px-3 pt-2.5 pb-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[r.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:u}}),l&&r.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:u,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]}),r.jsx("span",{className:"text-[12px] font-semibold text-[#e6e6e6] font-sans truncate flex-1 leading-none",children:s.name}),r.jsx("span",{className:"text-[7px] font-mono font-bold uppercase tracking-wider px-1 py-px rounded-sm",style:{color:u,background:u+"12"},children:mP[s.status]||s.status})]}),r.jsxs("div",{className:"flex items-center gap-1.5 mt-1.5",children:[r.jsx("span",{className:"text-[9px] font-mono text-[#505862] uppercase tracking-[0.05em]",children:s.role}),r.jsx("span",{className:"text-[9px] text-[#2a2e36]",children:"/"}),r.jsx("span",{className:"text-[9px] font-mono text-[#505862]",children:dP(s.model)})]})]}),r.jsxs("div",{className:"px-3 pt-1 pb-2",children:[r.jsxs("div",{className:"flex items-baseline gap-1.5",children:[r.jsx("span",{className:"text-[14px] font-mono font-medium text-[#bcc2cd] leading-none",children:et(d)}),r.jsx("span",{className:"text-[8px] font-mono text-[#505862]",children:"tok"}),r.jsx("span",{className:"flex-1"}),r.jsxs("span",{className:"text-[9px] font-mono text-[#505862]",children:[o,"%"]})]}),r.jsx("div",{className:"mt-1.5 h-[2px] rounded-sm bg-[#3e4451] overflow-hidden",children:r.jsx("div",{className:"h-full rounded-sm transition-all duration-700",style:{width:`${Math.max(o,1)}%`,background:o>80?"var(--color-danger)":o>60?"var(--color-warning)":l?"var(--color-accent)":"#3e4451"}})})]})]}),O&&r.jsx(hP,{agent:s})]})});Jb.displayName="AgentNode";const ev=v.memo(({data:t})=>{const{agentCount:a,runningCount:s}=t,l=s>0,o={background:"transparent",border:0,width:2,height:2};return r.jsxs("div",{className:"relative flex items-center justify-center",style:{width:84,height:84},children:[r.jsx("div",{className:re("absolute inset-0 rounded-full transition-all duration-500",l&&"animate-[spin-slow_30s_linear_infinite]"),style:{border:`1px dashed ${l?"rgba(97,175,239,0.5)":"rgba(97,175,239,0.25)"}`}}),r.jsx("div",{className:"absolute inset-[10px] rounded-full",style:{background:l?"radial-gradient(circle, rgba(97,175,239,0.15) 0%, transparent 70%)":"radial-gradient(circle, rgba(97,175,239,0.05) 0%, transparent 70%)",animation:l?"node-pulse-bar 2.5s ease-in-out infinite":"none"}}),r.jsx("div",{className:re("w-14 h-14 rounded-full flex items-center justify-center relative z-10 transition-all duration-300",l?"bg-[#1c1f26] border-2 border-[#61afef]/35 shadow-[0_0_28px_rgba(97,175,239,0.15)]":"bg-[#1c1f26] border border-[#61afef]/20"),children:r.jsx("img",{src:"/favicon.png",alt:"G",className:re("h-7 w-7 rounded-full transition-opacity",l?"opacity-90":"opacity-60")})}),a>0&&r.jsx("div",{className:re("absolute z-20 min-w-[20px] h-[20px] rounded-sm flex items-center justify-center","text-[10px] font-mono font-bold px-1 transition-all duration-300",l?"bg-[#1c1f26] text-[#61afef] border border-[#61afef]/40":"bg-[#1c1f26] text-[#61afef]/60 border border-[#61afef]/20"),style:{bottom:2,right:2},children:a}),r.jsx(Da,{id:"bottom",type:"source",position:Wa.Bottom,style:o}),r.jsx(Da,{id:"right",type:"source",position:Wa.Right,style:o}),r.jsx(Da,{id:"left",type:"source",position:Wa.Left,style:o}),r.jsx(Da,{id:"top",type:"source",position:Wa.Top,style:o})]})});ev.displayName="RootNode";const pP={primary:"bg-accent/20 text-accent border border-accent/25 hover:bg-accent/30 font-medium",secondary:"bg-surface-5/40 text-text-1 border border-border-subtle hover:bg-surface-5/70 hover:text-text-0",ghost:"bg-transparent text-text-2 border border-transparent hover:bg-surface-5/50 hover:text-text-0",danger:"bg-danger/12 text-danger border border-danger/15 hover:bg-danger/20",info:"bg-info/12 text-info border border-info/15 hover:bg-info/20",outline:"bg-transparent text-accent border border-accent/30 hover:bg-accent/10"},xP={sm:"h-7 px-2.5 text-xs gap-1.5 rounded",md:"h-8 px-3 text-sm gap-2 rounded",lg:"h-9 px-4 text-sm gap-2 rounded",icon:"h-8 w-8 rounded"},ve=v.forwardRef(({className:t,variant:a="secondary",size:s="md",children:l,...o},u)=>r.jsx("button",{ref:u,className:re("inline-flex items-center justify-center font-sans transition-colors duration-100","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent","disabled:opacity-40 disabled:pointer-events-none","cursor-pointer select-none",pP[a],xP[s],t),...o,children:l}));ve.displayName="Button";const gP={default:"bg-surface-4 text-text-2",accent:"bg-accent/12 text-accent",success:"bg-success/12 text-success",warning:"bg-warning/12 text-warning",danger:"bg-danger/12 text-danger",info:"bg-info/12 text-info",purple:"bg-purple/12 text-purple",orange:"bg-orange/12 text-orange"};function Xe({children:t,variant:a="default",className:s,dot:l,...o}){return r.jsxs("span",{className:re("inline-flex items-center gap-1 px-1.5 py-0.5","text-2xs font-semibold uppercase tracking-wider rounded","font-sans select-none whitespace-nowrap",gP[a],s),...o,children:[l&&r.jsx("span",{className:re("w-1.5 h-1.5 rounded-full",l==="pulse"&&"animate-pulse"),style:{background:"currentColor"}}),t]})}const bP={agentNode:Jb,rootNode:ev},l1=220,r1=82,Go=260,Lo=130,Ua=4,wn="__groove_root__";function kO(){try{return JSON.parse(localStorage.getItem("groove:nodePositions")||"{}")}catch{return{}}}function vP(t){try{localStorage.setItem("groove:nodePositions",JSON.stringify(t))}catch{}}function yP(){const t=D(N=>N.teams),a=D(N=>N.activeTeamId),s=D(N=>N.agents),l=D(N=>N.switchTeam),o=D(N=>N.createTeam),u=D(N=>N.deleteTeam),d=D(N=>N.renameTeam),[O,h]=v.useState(!1),[p,x]=v.useState(""),[g,b]=v.useState(null),[y,Q]=v.useState(""),w=v.useRef(!1);function $(){const N=p.trim();!N||w.current||(w.current=!0,x(""),h(!1),o(N).finally(()=>{w.current=!1}))}function j(N){b(N.id),Q(N.name)}function z(){const N=y.trim();if(!N||!g){b(null);return}d(g,N),b(null)}return r.jsxs("div",{className:"flex items-end px-0 pt-0 pb-0 bg-surface-1 border-b border-border gap-0 flex-shrink-0",children:[t.map(N=>{const _=s.filter(T=>T.teamId===N.id).length,G=N.id===a,R=g===N.id,X=s.filter(T=>T.teamId===N.id&&(T.status==="running"||T.status==="starting")).length;return r.jsxs("div",{onClick:()=>!R&&l(N.id),onDoubleClick:()=>j(N),className:re("group relative flex items-center gap-2 px-4 h-9 text-xs font-sans cursor-pointer select-none transition-colors",G?"bg-surface-0 text-text-0 font-semibold border-x border-x-border":"text-text-3 hover:text-text-1 hover:bg-surface-3/50"),children:[G&&r.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-accent",style:{height:"0.5px"}}),r.jsx(bi,{size:13,className:G?"text-accent":"text-text-4"}),R?r.jsx("input",{value:y,onChange:T=>Q(T.target.value),onKeyDown:T=>{T.key==="Enter"&&z(),T.key==="Escape"&&b(null)},onBlur:z,className:"h-5 w-24 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none",autoFocus:!0,onClick:T=>T.stopPropagation()}):r.jsx("span",{className:"truncate max-w-[120px]",children:N.name}),_>0&&!R&&r.jsx("span",{className:re("flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full text-2xs font-mono font-semibold",X>0?"bg-accent/15 text-accent":"bg-surface-4 text-text-3"),children:_}),!R&&r.jsxs("div",{className:"flex items-center gap-0.5 ml-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[r.jsx("button",{onClick:T=>{T.stopPropagation(),j(N)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 cursor-pointer",title:"Rename team",children:r.jsx(Gc,{size:10})}),!N.isDefault&&r.jsx("button",{onClick:T=>{T.stopPropagation(),u(N.id)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-danger cursor-pointer",title:"Delete team",children:r.jsx(Qt,{size:10})})]}),G&&r.jsx("div",{className:"absolute bottom-[-1px] left-0 right-0 h-px bg-surface-0"})]},N.id)}),O?r.jsxs("div",{className:"flex items-center gap-1.5 px-3 h-9 bg-surface-3/50",children:[r.jsx("input",{value:p,onChange:N=>x(N.target.value),onKeyDown:N=>{N.key==="Enter"&&$(),N.key==="Escape"&&(h(!1),x(""))},placeholder:"Team name...",className:"h-5 w-28 px-1.5 text-xs bg-surface-0 border border-border-subtle rounded text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:$,disabled:!p.trim(),className:"p-1 rounded text-accent hover:bg-accent/10 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",children:r.jsx(Dt,{size:12})}),r.jsx("button",{onClick:()=>{h(!1),x("")},className:"p-1 rounded text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:12})})]}):r.jsx("button",{onClick:()=>h(!0),className:"flex items-center justify-center w-9 h-9 text-text-4 hover:text-text-1 hover:bg-surface-3/50 cursor-pointer transition-colors",title:"New team",children:r.jsx(Ja,{size:14})})]})}function SP(){const t=D(T=>T.agents),a=D(T=>T.activeTeamId),s=D(T=>T.tokenTimeline),l=D(T=>T.selectAgent),o=D(T=>T.closeDetail),u=v.useMemo(()=>t.filter(T=>T.teamId===a),[t,a]),{fitView:d}=jj(),[O,h]=v.useState(0),p=v.useMemo(()=>{const T=kO(),V=u.filter(H=>H.status==="running").length,M=[{id:wn,type:"rootNode",position:T[wn]||{x:0,y:0},data:{agentCount:u.length,runningCount:V},draggable:!0,selectable:!1}],ae=new Set,F=(H,P)=>`${Math.round(H/100)},${Math.round(P/100)}`,le=T[wn]||{x:0,y:0};ae.add(F(le.x,le.y));const oe=[];u.forEach((H,P)=>{const W=H.id;if(T[W]){const E=T[W];ae.add(F(E.x,E.y)),M.push({id:H.id,type:"agentNode",position:E,data:{agent:H,timeline:s[H.id]||[]},draggable:!0,selectable:!0})}else oe.push({agent:H,index:P})});for(const{agent:H,index:P}of oe){const W=Math.floor(P/Ua),E=P%Ua;let be={x:-((Math.min(u.length-W*Ua,Ua)-1)*Go)/2+E*Go,y:Lo+W*Lo};for(;ae.has(F(be.x,be.y));)be={x:be.x,y:be.y+Lo};ae.add(F(be.x,be.y)),M.push({id:H.id,type:"agentNode",position:be,data:{agent:H,timeline:s[H.id]||[]},draggable:!0,selectable:!0})}return M},[u,s]),x=v.useMemo(()=>{const T=kO(),V=T[wn]||{x:0,y:0};return u.map((M,ae)=>{const F=M.id,le=Math.floor(ae/Ua),oe=ae%Ua,P=-((Math.min(u.length-le*Ua,Ua)-1)*Go)/2,W=T[F]||{x:P+oe*Go,y:140+le*Lo},E=W.x+l1/2-V.x,ce=W.y+r1/2-V.y;let ee,be;return Math.abs(ce)>Math.abs(E)?(ee=ce>0?"bottom":"top",be=ce>0?"top":"bottom"):(ee=E>0?"right":"left",be=E>0?"left":"right"),{id:`e-${wn}-${M.id}`,source:wn,target:M.id,sourceHandle:ee,targetHandle:be,type:"default",animated:M.status==="running"}})},[u]),[g,b,y]=wj(p),[Q,w,$]=kj(x),j=v.useRef(new Set);v.useEffect(()=>{b(T=>{const V=new Map(T.map(M=>[M.id,M]));return new Set(p.map(M=>M.id)),p.map(M=>{const ae=V.get(M.id);return ae?{...ae,data:M.data}:M})})},[p,b]),v.useEffect(()=>{w(x)},[x,w]);const z=u.map(T=>T.id).join(","),N=v.useRef(null);v.useEffect(()=>{const T=new Set(u.map(M=>M.id)),V=u.length>0&&[...T].some(M=>!j.current.has(M));j.current=T,O===0&&u.length>0?d({padding:.3,maxZoom:1.2,duration:0}):V&&(clearTimeout(N.current),N.current=setTimeout(()=>d({padding:.3,maxZoom:1.2,duration:300}),500)),h(u.length)},[z,O,d]);const _=v.useCallback((T,V)=>{V.id!==wn&&l(V.id)},[l]),G=v.useCallback(()=>{o()},[o]),R=v.useCallback((T,V)=>{const M=g.find(F=>F.id===wn);if(!M)return;const ae=M.position;w(F=>F.map(le=>{const oe=le.source===V.id,H=le.target===V.id;if(!oe&&!H)return le;const P=V.position,W=P.x+l1/2-ae.x,E=P.y+r1/2-ae.y;let ce,ee;return Math.abs(E)>Math.abs(W)?(ce=E>0?"bottom":"top",ee=E>0?"top":"bottom"):(ce=W>0?"right":"left",ee=W>0?"left":"right"),{...le,sourceHandle:ce,targetHandle:ee}}))},[g,w]),X=v.useCallback((T,V)=>{u.find(F=>F.id===V.id);const M=V.id===wn?wn:V.id,ae=kO();ae[M]=V.position,vP(ae)},[u]);return r.jsx($j,{nodes:g,edges:Q,nodeTypes:bP,onNodesChange:y,onEdgesChange:$,onNodeClick:_,onPaneClick:G,onNodeDrag:R,onNodeDragStop:X,defaultViewport:{x:0,y:0,zoom:1.2},proOptions:{hideAttribution:!0},minZoom:.2,maxZoom:1.5,className:"bg-surface-2",children:r.jsx(Tj,{color:"rgba(97,175,239,0.03)",gap:24,size:1})})}function QP({onPlanner:t,onSpawn:a}){return r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsxs("div",{className:"max-w-2xl w-full text-center space-y-10 px-8",children:[r.jsxs("div",{className:"relative mx-auto w-20 h-20",children:[r.jsx("div",{className:"absolute inset-0 rounded-full bg-accent/8 animate-pulse"}),r.jsx("div",{className:"absolute inset-1 rounded-full bg-surface-3 border border-border-subtle flex items-center justify-center shadow-lg shadow-accent/5",children:r.jsx("img",{src:"/favicon.png",alt:"Groove",className:"h-10 w-10 rounded-full"})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx("h1",{className:"text-3xl font-bold text-text-0 font-sans tracking-tight",children:"Welcome to Groove"}),r.jsx("p",{className:"text-base text-text-2 font-sans max-w-md mx-auto leading-relaxed",children:"Your mission control for AI agents. Spawn, orchestrate, and ship faster than ever."})]}),r.jsxs("div",{className:"space-y-3 max-w-xl mx-auto",children:[r.jsxs("button",{onClick:t,className:"w-full flex items-center gap-4 p-5 rounded-lg border border-accent/25 bg-gradient-to-r from-accent/8 to-accent/3 hover:from-accent/14 hover:to-accent/6 hover:border-accent/40 transition-all cursor-pointer group text-left",children:[r.jsx("div",{className:"w-12 h-12 rounded-lg bg-accent/20 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:r.jsx(Rn,{size:24,className:"text-accent"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-base font-semibold text-text-0 font-sans",children:"Start with a Planner"}),r.jsx("div",{className:"text-sm text-text-2 font-sans mt-0.5",children:"Describe what you want to build and let AI plan the perfect team"})]}),r.jsx("div",{className:"text-accent text-xs font-semibold font-sans flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity",children:"Recommended"})]}),r.jsxs("button",{onClick:a,className:"w-full flex items-center gap-3 p-4 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 hover:border-border transition-all cursor-pointer group text-left",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg bg-surface-4 flex items-center justify-center group-hover:scale-110 transition-transform flex-shrink-0",children:r.jsx(Ja,{size:20,className:"text-text-1"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-semibold text-text-0 font-sans",children:"Spawn Agent"}),r.jsx("div",{className:"text-xs text-text-3 font-sans mt-0.5",children:"Choose a role and configure"})]})]})]}),r.jsxs("p",{className:"text-xs text-text-4 font-sans",children:[r.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+K"}),r.jsx("span",{className:"mx-1.5",children:"command palette"}),r.jsx("span",{className:"text-text-4 mx-1",children:"·"}),r.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+N"}),r.jsx("span",{className:"mx-1.5",children:"spawn"}),r.jsx("span",{className:"text-text-4 mx-1",children:"·"}),r.jsx("kbd",{className:"font-mono bg-surface-4 px-1.5 py-0.5 rounded text-text-3",children:"Cmd+J"}),r.jsx("span",{className:"mx-1.5",children:"terminal"})]})]})})}const jP={backend:Wb,frontend:th,fullstack:ns,testing:lh,security:li},wP=/^[a-zA-Z0-9_-]{1,64}$/;function kP(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64)}function $P(){var y;const t=D(Q=>Q.recommendedTeam),a=D(Q=>Q.launchRecommendedTeam),[s,l]=v.useState(!1),[o,u]=v.useState(null);if(!((y=t==null?void 0:t.agents)!=null&&y.length))return null;const d=t.agents,O=d.filter(Q=>!Q.phase||Q.phase===1),h=d.filter(Q=>Q.phase===2),p=o??O.map(Q=>({...Q,name:Q.name||""}));function x(Q,w){const $=p.map((j,z)=>z===Q?{...j,name:kP(w)}:j);u($)}async function g(){l(!0);try{const Q=[...p,...h];await a(Q)}catch{}l(!1)}function b(){D.setState({recommendedTeam:null})}return r.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-50 w-full max-w-lg",children:r.jsxs("div",{className:"mx-4 rounded-lg border border-accent/30 bg-surface-2/95 backdrop-blur-md shadow-xl shadow-accent/5 overflow-hidden",children:[r.jsxs("div",{className:"px-4 py-3 border-b border-border-subtle flex items-center gap-2",children:[r.jsx(Db,{size:16,className:"text-accent"}),r.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Planner Recommends a Team"}),r.jsx("button",{onClick:b,className:"text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:14})})]}),r.jsxs("div",{className:"px-4 py-3 space-y-1.5",children:[p.map((Q,w)=>{var z;const $=jP[Q.role]||ns,j=!Q.name||wP.test(Q.name);return r.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-surface-4 border border-border-subtle",children:[r.jsx($,{size:12,className:"text-text-2 shrink-0"}),r.jsx("input",{type:"text",value:Q.name,onChange:N=>x(w,N.target.value),placeholder:Q.role,className:re("flex-1 min-w-0 bg-transparent text-xs font-mono text-text-0 outline-none placeholder:text-text-4",!j&&"text-red-400"),maxLength:64,spellCheck:!1}),((z=Q.scope)==null?void 0:z.length)>0&&r.jsxs("span",{className:"text-2xs text-text-4 font-mono shrink-0 truncate max-w-[120px]",children:[Q.scope[0],Q.scope.length>1?` +${Q.scope.length-1}`:""]})]},w)}),t.projectDir&&r.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-2 font-mono pt-0.5",children:[r.jsx("span",{className:"text-text-4",children:"Project:"}),r.jsxs("span",{className:"text-accent",children:[t.projectDir,"/"]})]}),h.length>0&&r.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans",children:[r.jsx(li,{size:10}),r.jsxs("span",{children:[h.length," QC agent",h.length>1?"s":""," will auto-spawn after builders complete"]})]})]}),r.jsx("div",{className:"px-4 py-3 border-t border-border-subtle",children:r.jsxs(ve,{variant:"primary",size:"md",onClick:g,disabled:s,className:"w-full gap-2",children:[r.jsx(Rn,{size:14}),s?"Launching...":`Launch ${O.length} Agent${O.length>1?"s":""}`]})})]})})}function i1(){const t=D(b=>b.agents),a=D(b=>b.activeTeamId),s=D(b=>b.openDetail),l=D(b=>b.spawnAgent),o=D(b=>b.selectAgent);D(b=>b.recommendedTeam);const u=D(b=>b.checkRecommendedTeam);v.useEffect(()=>{if(!t.some(Q=>Q.role==="planner"&&(Q.status==="running"||Q.status==="starting")))return;const y=setInterval(()=>u(),5e3);return()=>clearInterval(y)},[t,u]);async function d(){try{const b=await l({role:"planner"});b!=null&&b.id&&o(b.id)}catch{}}const O=t.filter(b=>b.teamId===a),h=D(b=>b.hydrated),[p,x]=v.useState(!0);v.useEffect(()=>{const b=setTimeout(()=>x(!1),1200);return()=>clearTimeout(b)},[]);const g=p||!h;return r.jsxs("div",{className:"flex flex-col h-full relative",children:[r.jsx(yP,{}),r.jsx("div",{className:"flex-1 min-h-0",children:g?r.jsxs("div",{className:re("flex flex-col items-center justify-center h-full transition-opacity duration-500",!p&&h?"opacity-0":"opacity-100"),children:[r.jsxs("div",{className:"relative w-12 h-12 mb-5",children:[r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),r.jsx("span",{className:"absolute inset-[6px] rounded-full bg-accent/8 flex items-center justify-center",children:r.jsx(Rn,{size:16,className:"text-accent animate-pulse"})})]}),r.jsx("p",{className:"text-sm font-medium text-text-1 font-sans animate-pulse",children:"Connecting to agents"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Syncing with daemon..."})]}):O.length===0?r.jsx(QP,{onPlanner:d,onSpawn:()=>s({type:"spawn"})}):r.jsx(Qj,{children:r.jsx(SP,{})})}),r.jsx($P,{})]})}var TP=v.createContext(void 0);function ih(t){const a=v.useContext(TP);return t||a||"ltr"}function NP(t,[a,s]){return Math.min(s,Math.max(a,t))}function PP(t,a){return v.useReducer((s,l)=>a[s][l]??s,t)}var oh="ScrollArea",[tv]=Xs(oh),[zP,on]=tv(oh),nv=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,type:l="hover",dir:o,scrollHideDelay:u=600,...d}=t,[O,h]=v.useState(null),[p,x]=v.useState(null),[g,b]=v.useState(null),[y,Q]=v.useState(null),[w,$]=v.useState(null),[j,z]=v.useState(0),[N,_]=v.useState(0),[G,R]=v.useState(!1),[X,T]=v.useState(!1),V=it(a,ae=>h(ae)),M=ih(o);return r.jsx(zP,{scope:s,type:l,dir:M,scrollHideDelay:u,scrollArea:O,viewport:p,onViewportChange:x,content:g,onContentChange:b,scrollbarX:y,onScrollbarXChange:Q,scrollbarXEnabled:G,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:$,scrollbarYEnabled:X,onScrollbarYEnabledChange:T,onCornerWidthChange:z,onCornerHeightChange:_,children:r.jsx(Be.div,{dir:M,...d,ref:V,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});nv.displayName=oh;var av="ScrollAreaViewport",sv=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,children:l,nonce:o,...u}=t,d=on(av,s),O=v.useRef(null),h=it(a,O,d.onViewportChange);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),r.jsx(Be.div,{"data-radix-scroll-area-viewport":"",...u,ref:h,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...t.style},children:r.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});sv.displayName=av;var Cn="ScrollAreaScrollbar",lv=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=on(Cn,t.__scopeScrollArea),{onScrollbarXEnabledChange:u,onScrollbarYEnabledChange:d}=o,O=t.orientation==="horizontal";return v.useEffect(()=>(O?u(!0):d(!0),()=>{O?u(!1):d(!1)}),[O,u,d]),o.type==="hover"?r.jsx(RP,{...l,ref:a,forceMount:s}):o.type==="scroll"?r.jsx(CP,{...l,ref:a,forceMount:s}):o.type==="auto"?r.jsx(rv,{...l,ref:a,forceMount:s}):o.type==="always"?r.jsx(ch,{...l,ref:a}):null});lv.displayName=Cn;var RP=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=on(Cn,t.__scopeScrollArea),[u,d]=v.useState(!1);return v.useEffect(()=>{const O=o.scrollArea;let h=0;if(O){const p=()=>{window.clearTimeout(h),d(!0)},x=()=>{h=window.setTimeout(()=>d(!1),o.scrollHideDelay)};return O.addEventListener("pointerenter",p),O.addEventListener("pointerleave",x),()=>{window.clearTimeout(h),O.removeEventListener("pointerenter",p),O.removeEventListener("pointerleave",x)}}},[o.scrollArea,o.scrollHideDelay]),r.jsx(bn,{present:s||u,children:r.jsx(rv,{"data-state":u?"visible":"hidden",...l,ref:a})})}),CP=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=on(Cn,t.__scopeScrollArea),u=t.orientation==="horizontal",d=Bc(()=>h("SCROLL_END"),100),[O,h]=PP("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(O==="idle"){const p=window.setTimeout(()=>h("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[O,o.scrollHideDelay,h]),v.useEffect(()=>{const p=o.viewport,x=u?"scrollLeft":"scrollTop";if(p){let g=p[x];const b=()=>{const y=p[x];g!==y&&(h("SCROLL"),d()),g=y};return p.addEventListener("scroll",b),()=>p.removeEventListener("scroll",b)}},[o.viewport,u,h,d]),r.jsx(bn,{present:s||O!=="hidden",children:r.jsx(ch,{"data-state":O==="hidden"?"hidden":"visible",...l,ref:a,onPointerEnter:qe(t.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:qe(t.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),rv=v.forwardRef((t,a)=>{const s=on(Cn,t.__scopeScrollArea),{forceMount:l,...o}=t,[u,d]=v.useState(!1),O=t.orientation==="horizontal",h=Bc(()=>{if(s.viewport){const p=s.viewport.offsetWidth<s.viewport.scrollWidth,x=s.viewport.offsetHeight<s.viewport.scrollHeight;d(O?p:x)}},10);return El(s.viewport,h),El(s.content,h),r.jsx(bn,{present:l||u,children:r.jsx(ch,{"data-state":u?"visible":"hidden",...o,ref:a})})}),ch=v.forwardRef((t,a)=>{const{orientation:s="vertical",...l}=t,o=on(Cn,t.__scopeScrollArea),u=v.useRef(null),d=v.useRef(0),[O,h]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=dv(O.viewport,O.content),x={...l,sizes:O,onSizesChange:h,hasThumb:p>0&&p<1,onThumbChange:b=>u.current=b,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:b=>d.current=b};function g(b,y){return qP(b,d.current,O,y)}return s==="horizontal"?r.jsx(XP,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&u.current){const b=o.viewport.scrollLeft,y=o1(b,O,o.dir);u.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollLeft=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollLeft=g(b,o.dir))}}):s==="vertical"?r.jsx(_P,{...x,ref:a,onThumbPositionChange:()=>{if(o.viewport&&u.current){const b=o.viewport.scrollTop,y=o1(b,O);u.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollTop=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollTop=g(b))}}):null}),XP=v.forwardRef((t,a)=>{const{sizes:s,onSizesChange:l,...o}=t,u=on(Cn,t.__scopeScrollArea),[d,O]=v.useState(),h=v.useRef(null),p=it(a,h,u.onScrollbarXChange);return v.useEffect(()=>{h.current&&O(getComputedStyle(h.current))},[h]),r.jsx(ov,{"data-orientation":"horizontal",...o,ref:p,sizes:s,style:{bottom:0,left:u.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:u.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wc(s)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.x),onDragScroll:x=>t.onDragScroll(x.x),onWheelScroll:(x,g)=>{if(u.viewport){const b=u.viewport.scrollLeft+x.deltaX;t.onWheelScroll(b),fv(b,g)&&x.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:Sc(d.paddingLeft),paddingEnd:Sc(d.paddingRight)}})}})}),_P=v.forwardRef((t,a)=>{const{sizes:s,onSizesChange:l,...o}=t,u=on(Cn,t.__scopeScrollArea),[d,O]=v.useState(),h=v.useRef(null),p=it(a,h,u.onScrollbarYChange);return v.useEffect(()=>{h.current&&O(getComputedStyle(h.current))},[h]),r.jsx(ov,{"data-orientation":"vertical",...o,ref:p,sizes:s,style:{top:0,right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wc(s)+"px",...t.style},onThumbPointerDown:x=>t.onThumbPointerDown(x.y),onDragScroll:x=>t.onDragScroll(x.y),onWheelScroll:(x,g)=>{if(u.viewport){const b=u.viewport.scrollTop+x.deltaY;t.onWheelScroll(b),fv(b,g)&&x.preventDefault()}},onResize:()=>{h.current&&u.viewport&&d&&l({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:Sc(d.paddingTop),paddingEnd:Sc(d.paddingBottom)}})}})}),[ZP,iv]=tv(Cn),ov=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,sizes:l,hasThumb:o,onThumbChange:u,onThumbPointerUp:d,onThumbPointerDown:O,onThumbPositionChange:h,onDragScroll:p,onWheelScroll:x,onResize:g,...b}=t,y=on(Cn,s),[Q,w]=v.useState(null),$=it(a,V=>w(V)),j=v.useRef(null),z=v.useRef(""),N=y.viewport,_=l.content-l.viewport,G=zt(x),R=zt(h),X=Bc(g,10);function T(V){if(j.current){const M=V.clientX-j.current.left,ae=V.clientY-j.current.top;p({x:M,y:ae})}}return v.useEffect(()=>{const V=M=>{const ae=M.target;(Q==null?void 0:Q.contains(ae))&&G(M,_)};return document.addEventListener("wheel",V,{passive:!1}),()=>document.removeEventListener("wheel",V,{passive:!1})},[N,Q,_,G]),v.useEffect(R,[l,R]),El(Q,X),El(y.content,X),r.jsx(ZP,{scope:s,scrollbar:Q,hasThumb:o,onThumbChange:zt(u),onThumbPointerUp:zt(d),onThumbPositionChange:R,onThumbPointerDown:zt(O),children:r.jsx(Be.div,{...b,ref:$,style:{position:"absolute",...b.style},onPointerDown:qe(t.onPointerDown,V=>{V.button===0&&(V.target.setPointerCapture(V.pointerId),j.current=Q.getBoundingClientRect(),z.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),T(V))}),onPointerMove:qe(t.onPointerMove,T),onPointerUp:qe(t.onPointerUp,V=>{const M=V.target;M.hasPointerCapture(V.pointerId)&&M.releasePointerCapture(V.pointerId),document.body.style.webkitUserSelect=z.current,y.viewport&&(y.viewport.style.scrollBehavior=""),j.current=null})})})}),yc="ScrollAreaThumb",cv=v.forwardRef((t,a)=>{const{forceMount:s,...l}=t,o=iv(yc,t.__scopeScrollArea);return r.jsx(bn,{present:s||o.hasThumb,children:r.jsx(AP,{ref:a,...l})})}),AP=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,style:l,...o}=t,u=on(yc,s),d=iv(yc,s),{onThumbPositionChange:O}=d,h=it(a,g=>d.onThumbChange(g)),p=v.useRef(void 0),x=Bc(()=>{p.current&&(p.current(),p.current=void 0)},100);return v.useEffect(()=>{const g=u.viewport;if(g){const b=()=>{if(x(),!p.current){const y=MP(g,O);p.current=y,O()}};return O(),g.addEventListener("scroll",b),()=>g.removeEventListener("scroll",b)}},[u.viewport,x,O]),r.jsx(Be.div,{"data-state":d.hasThumb?"visible":"hidden",...o,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:qe(t.onPointerDownCapture,g=>{const y=g.target.getBoundingClientRect(),Q=g.clientX-y.left,w=g.clientY-y.top;d.onThumbPointerDown({x:Q,y:w})}),onPointerUp:qe(t.onPointerUp,d.onThumbPointerUp)})});cv.displayName=yc;var uh="ScrollAreaCorner",uv=v.forwardRef((t,a)=>{const s=on(uh,t.__scopeScrollArea),l=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&l?r.jsx(EP,{...t,ref:a}):null});uv.displayName=uh;var EP=v.forwardRef((t,a)=>{const{__scopeScrollArea:s,...l}=t,o=on(uh,s),[u,d]=v.useState(0),[O,h]=v.useState(0),p=!!(u&&O);return El(o.scrollbarX,()=>{var g;const x=((g=o.scrollbarX)==null?void 0:g.offsetHeight)||0;o.onCornerHeightChange(x),h(x)}),El(o.scrollbarY,()=>{var g;const x=((g=o.scrollbarY)==null?void 0:g.offsetWidth)||0;o.onCornerWidthChange(x),d(x)}),p?r.jsx(Be.div,{...l,ref:a,style:{width:u,height:O,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Sc(t){return t?parseInt(t,10):0}function dv(t,a){const s=t/a;return isNaN(s)?0:s}function Wc(t){const a=dv(t.viewport,t.content),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=(t.scrollbar.size-s)*a;return Math.max(l,18)}function qP(t,a,s,l="ltr"){const o=Wc(s),u=o/2,d=a||u,O=o-d,h=s.scrollbar.paddingStart+d,p=s.scrollbar.size-s.scrollbar.paddingEnd-O,x=s.content-s.viewport,g=l==="ltr"?[0,x]:[x*-1,0];return Ov([h,p],g)(t)}function o1(t,a,s="ltr"){const l=Wc(a),o=a.scrollbar.paddingStart+a.scrollbar.paddingEnd,u=a.scrollbar.size-o,d=a.content-a.viewport,O=u-l,h=s==="ltr"?[0,d]:[d*-1,0],p=NP(t,h);return Ov([0,d],[0,O])(p)}function Ov(t,a){return s=>{if(t[0]===t[1]||a[0]===a[1])return a[0];const l=(a[1]-a[0])/(t[1]-t[0]);return a[0]+l*(s-t[0])}}function fv(t,a){return t>0&&t<a}var MP=(t,a=()=>{})=>{let s={left:t.scrollLeft,top:t.scrollTop},l=0;return(function o(){const u={left:t.scrollLeft,top:t.scrollTop},d=s.left!==u.left,O=s.top!==u.top;(d||O)&&a(),s=u,l=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(l)};function Bc(t,a){const s=zt(t),l=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(l.current),[]),v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(s,a)},[s,a])}function El(t,a){const s=zt(a);ra(()=>{let l=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(s)});return o.observe(t),()=>{window.cancelAnimationFrame(l),o.unobserve(t)}}},[t,s])}var YP=nv,UP=sv,c1=lv,u1=cv,VP=uv;function fa({children:t,className:a,...s}){return r.jsxs(YP,{className:re("overflow-hidden",a),...s,children:[r.jsx(UP,{className:"h-full w-full rounded-[inherit]",children:t}),r.jsx(c1,{orientation:"vertical",className:"flex touch-none select-none p-0.5 transition-colors w-2",children:r.jsx(u1,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),r.jsx(c1,{orientation:"horizontal",className:"flex touch-none select-none flex-col p-0.5 transition-colors h-2",children:r.jsx(u1,{className:"relative flex-1 rounded-full bg-surface-5 hover:bg-surface-6"})}),r.jsx(VP,{})]})}const GP={js:"text-warning",jsx:"text-warning",ts:"text-info",tsx:"text-info",css:"text-info",html:"text-orange",json:"text-warning",md:"text-text-2",py:"text-success",rs:"text-orange",go:"text-accent",sh:"text-success",yaml:"text-danger",yml:"text-danger",sql:"text-purple",xml:"text-orange",svg:"text-warning"};function LP(t){var s;const a=(s=t.split(".").pop())==null?void 0:s.toLowerCase();return GP[a]||"text-text-3"}function DP({x:t,y:a,items:s,onClose:l}){const o=v.useRef(null);return v.useEffect(()=>{function u(d){o.current&&!o.current.contains(d.target)&&l()}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[l]),r.jsx("div",{ref:o,className:"fixed z-50 min-w-[160px] py-1 bg-surface-2 border border-border rounded-lg shadow-xl",style:{left:t,top:a},children:s.map((u,d)=>u.separator?r.jsx("div",{className:"h-px bg-border-subtle my-1"},d):r.jsxs("button",{onClick:()=>{u.action(),l()},className:re("w-full flex items-center gap-2.5 px-3 py-1.5 text-xs font-sans text-left cursor-pointer transition-colors",u.danger?"text-danger hover:bg-danger/10":"text-text-1 hover:bg-surface-5"),children:[u.icon&&r.jsx(u.icon,{size:12,className:u.danger?"text-danger":"text-text-3"}),u.label]},d))})}function Qc({defaultValue:t="",placeholder:a,onSubmit:s,onCancel:l,depth:o=0}){const[u,d]=v.useState(t),O=v.useRef(null);v.useEffect(()=>{var p,x;(p=O.current)==null||p.focus(),t&&((x=O.current)==null||x.select())},[t]);function h(p){if(p.key==="Enter"){const x=u.trim();x&&s(x)}p.key==="Escape"&&l()}return r.jsx("div",{className:"flex items-center py-0.5",style:{paddingLeft:o*16+8},children:r.jsx("input",{ref:O,value:u,onChange:p=>d(p.target.value),onKeyDown:h,onBlur:l,placeholder:a,className:"w-full h-5 px-1.5 text-xs bg-surface-0 border border-accent rounded text-text-0 font-sans focus:outline-none"})})}function hv({entry:t,depth:a=0,activePath:s,onFileClick:l,onDirToggle:o,expanded:u,onContextMenu:d}){const O=t.type==="dir",h=s===t.path,p=u.has(t.path),x=a*16+8;function g(b){b.preventDefault(),b.stopPropagation(),d(b,t)}return r.jsxs("button",{onClick:()=>O?o(t.path):l(t.path),onContextMenu:g,className:re("w-full flex items-center gap-1.5 py-1 text-xs font-sans cursor-pointer","hover:bg-surface-5 transition-colors text-left select-none",h&&"bg-accent/10 text-text-0",!h&&"text-text-1"),style:{paddingLeft:x},children:[O?r.jsxs(r.Fragment,{children:[p?r.jsx(ca,{size:12,className:"text-text-4 flex-shrink-0"}):r.jsx(Ll,{size:12,className:"text-text-4 flex-shrink-0"}),p?r.jsx(ai,{size:14,className:"text-accent flex-shrink-0"}):r.jsx(Ab,{size:14,className:"text-text-3 flex-shrink-0"})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3"}),r.jsx(oT,{size:14,className:re("flex-shrink-0",LP(t.name))})]}),r.jsx("span",{className:"truncate",children:t.name})]})}function mv({dirPath:t,depth:a,activePath:s,onFileClick:l,expanded:o,onDirToggle:u,treeCache:d,fetchTreeDir:O,onContextMenu:h,inlineInput:p}){const x=d[t]||[];return v.useEffect(()=>{o.has(t)&&!d[t]&&O(t)},[o,t,d,O]),o.has(t)?r.jsxs(r.Fragment,{children:[(p==null?void 0:p.parentPath)===t&&r.jsx(Qc,{placeholder:p.type==="file"?"filename.ext":"folder-name",onSubmit:p.onSubmit,onCancel:p.onCancel,depth:a}),x.map(g=>r.jsxs("div",{children:[(p==null?void 0:p.renamePath)===g.path?r.jsx(Qc,{defaultValue:g.name,onSubmit:p.onSubmit,onCancel:p.onCancel,depth:a}):r.jsx(hv,{entry:g,depth:a,activePath:s,onFileClick:l,onDirToggle:u,expanded:o,onContextMenu:h}),g.type==="dir"&&r.jsx(mv,{dirPath:g.path,depth:a+1,activePath:s,onFileClick:l,expanded:o,onDirToggle:u,treeCache:d,fetchTreeDir:O,onContextMenu:h,inlineInput:p})]},g.path))]}):null}function WP({rootDir:t}){const a=D(T=>T.editorTreeCache),s=D(T=>T.editorActiveFile),l=D(T=>T.openFile),o=D(T=>T.fetchTreeDir),u=D(T=>T.addToast),[d,O]=v.useState(new Set([""])),[h,p]=v.useState(""),[x,g]=v.useState(null),[b,y]=v.useState(null);v.useEffect(()=>{o("")},[o,t]);function Q(T){O(V=>{const M=new Set(V);return M.has(T)?M.delete(T):M.add(T),M})}function w(T,V){g({x:T.clientX,y:T.clientY,entry:V})}function $(T){T.preventDefault(),g({x:T.clientX,y:T.clientY,entry:{type:"dir",path:"",name:"root"}})}function j(T){const V=T.split("/");return V.pop(),V.join("/")}async function z(T){O(V=>new Set([...V,T])),y({type:"file",parentPath:T,onSubmit:async V=>{const M=T?`${T}/${V}`:V;try{await J.post("/files/create",{path:M,content:""}),o(T),l(M),u("success",`Created ${V}`)}catch(ae){u("error","Create failed",ae.message)}y(null)},onCancel:()=>y(null)})}async function N(T){O(V=>new Set([...V,T])),y({type:"folder",parentPath:T,onSubmit:async V=>{const M=T?`${T}/${V}`:V;try{await J.post("/files/mkdir",{path:M}),o(T),O(ae=>new Set([...ae,M])),u("success",`Created ${V}/`)}catch(ae){u("error","Create folder failed",ae.message)}y(null)},onCancel:()=>y(null)})}async function _(T){y({type:"rename",renamePath:T.path,onSubmit:async V=>{const M=j(T.path),ae=M?`${M}/${V}`:V;try{await J.post("/files/rename",{oldPath:T.path,newPath:ae}),o(M),u("success",`Renamed to ${V}`)}catch(F){u("error","Rename failed",F.message)}y(null)},onCancel:()=>y(null)})}async function G(T){const V=T.type==="dir"?`folder "${T.name}" and all contents`:`"${T.name}"`;if(window.confirm(`Delete ${V}?`))try{await J.delete(`/files/delete?path=${encodeURIComponent(T.path)}`),o(j(T.path)),u("success",`Deleted ${T.name}`)}catch(M){u("error","Delete failed",M.message)}}function R(T){const V=T.type==="dir",M=[];return V&&(M.push({icon:QO,label:"New File",action:()=>z(T.path)}),M.push({icon:jO,label:"New Folder",action:()=>N(T.path)})),T.name!=="root"?(M.length>0&&M.push({separator:!0}),M.push({icon:Gc,label:"Rename",action:()=>_(T)}),M.push({icon:as,label:"Delete",danger:!0,action:()=>G(T)})):(M.length=0,M.push({icon:QO,label:"New File",action:()=>z("")}),M.push({icon:jO,label:"New Folder",action:()=>N("")})),M}const X=a[""]||[];return r.jsxs("div",{className:"flex flex-col h-full bg-surface-1",onContextMenu:$,children:[r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border-subtle",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(da,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-text-4"}),r.jsx("input",{value:h,onChange:T=>p(T.target.value),placeholder:"Filter...",className:"w-full h-6 pl-6 pr-2 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 placeholder:text-text-4 focus:outline-none focus:border-accent font-sans"})]}),r.jsx("button",{onClick:()=>z(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New file",children:r.jsx(QO,{size:12})}),r.jsx("button",{onClick:()=>N(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"New folder",children:r.jsx(jO,{size:12})}),r.jsx("button",{onClick:()=>o(""),className:"p-1 text-text-4 hover:text-text-1 transition-colors cursor-pointer",title:"Refresh",children:r.jsx(zn,{size:12})})]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[(b==null?void 0:b.parentPath)===""&&r.jsx(Qc,{placeholder:b.type==="file"?"filename.ext":"folder-name",onSubmit:b.onSubmit,onCancel:b.onCancel,depth:0}),X.filter(T=>!h||T.name.toLowerCase().includes(h.toLowerCase())).map(T=>r.jsxs("div",{children:[(b==null?void 0:b.renamePath)===T.path?r.jsx(Qc,{defaultValue:T.name,onSubmit:b.onSubmit,onCancel:b.onCancel,depth:0}):r.jsx(hv,{entry:T,depth:0,activePath:s,onFileClick:l,onDirToggle:Q,expanded:d,onContextMenu:w}),T.type==="dir"&&r.jsx(mv,{dirPath:T.path,depth:1,activePath:s,onFileClick:l,expanded:d,onDirToggle:Q,treeCache:a,fetchTreeDir:o,onContextMenu:w,inlineInput:b})]},T.path))]})}),x&&r.jsx(DP,{x:x.x,y:x.y,items:R(x.entry),onClose:()=>g(null)})]})}function BP(){const t=D(u=>u.editorOpenTabs),a=D(u=>u.editorActiveFile),s=D(u=>u.editorFiles),l=D(u=>u.setActiveFile),o=D(u=>u.closeFile);return t.length===0?null:r.jsx("div",{className:"flex items-center h-8 bg-surface-3 border-b border-border overflow-x-auto flex-shrink-0",children:t.map(u=>{const d=u===a,O=s[u],h=O&&O.content!==O.originalContent,p=u.split("/").pop();return r.jsxs("div",{className:re("flex items-center gap-1.5 h-full px-3 text-xs font-sans cursor-pointer select-none","border-r border-border-subtle","transition-colors duration-75",d?"bg-surface-2 text-text-0 border-b-2 border-b-accent":"bg-surface-3 text-text-3 hover:text-text-1 hover:bg-surface-4"),onClick:()=>l(u),children:[r.jsx("span",{className:"truncate max-w-[120px]",children:p}),h&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-warning flex-shrink-0"}),r.jsx("button",{onClick:x=>{x.stopPropagation(),o(u)},className:"p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 transition-colors cursor-pointer ml-0.5",children:r.jsx(Qt,{size:12})})]},u)})})}var d1={};class jc{constructor(a,s,l,o,u,d,O,h,p,x=0,g){this.p=a,this.stack=s,this.state=l,this.reducePos=o,this.pos=u,this.score=d,this.buffer=O,this.bufferBase=h,this.curContext=p,this.lookAhead=x,this.parent=g}toString(){return`[${this.stack.filter((a,s)=>s%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(a,s,l=0){let o=a.parser.context;return new jc(a,[],s,l,l,0,[],0,o?new O1(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(a,s){this.stack.push(this.state,s,this.bufferBase+this.buffer.length),this.state=a}reduce(a){var s;let l=a>>19,o=a&65535,{parser:u}=this.p,d=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),O=u.dynamicPrecedence(o);if(O&&(this.score+=O),l==0){this.pushState(u.getGoto(this.state,o,!0),this.reducePos),o<u.minRepeatTerm&&this.storeNode(o,this.reducePos,this.reducePos,d?8:4,!0),this.reduceContext(o,this.reducePos);return}let h=this.stack.length-(l-1)*3-(a&262144?6:0),p=h?this.stack[h-2]:this.p.ranges[0].from,x=this.reducePos-p;x>=2e3&&!(!((s=this.p.parser.nodeSet.types[o])===null||s===void 0)&&s.isAnonymous)&&(p==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=x):this.p.lastBigReductionSize<x&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=p,this.p.lastBigReductionSize=x));let g=h?this.stack[h-1]:0,b=this.bufferBase+this.buffer.length-g;if(o<u.minRepeatTerm||a&131072){let y=u.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(o,p,y,b+4,!0)}if(a&262144)this.state=this.stack[h];else{let y=this.stack[h-3];this.state=u.getGoto(y,o,!0)}for(;this.stack.length>h;)this.stack.pop();this.reduceContext(o,p)}storeNode(a,s,l,o=4,u=!1){if(a==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let d=this,O=this.buffer.length;if(O==0&&d.parent&&(O=d.bufferBase-d.parent.bufferBase,d=d.parent),O>0&&d.buffer[O-4]==0&&d.buffer[O-1]>-1){if(s==l)return;if(d.buffer[O-2]>=s){d.buffer[O-2]=l;return}}}if(!u||this.pos==l)this.buffer.push(a,s,l,o);else{let d=this.buffer.length;if(d>0&&(this.buffer[d-4]!=0||this.buffer[d-1]<0)){let O=!1;for(let h=d;h>0&&this.buffer[h-2]>l;h-=4)if(this.buffer[h-1]>=0){O=!0;break}if(O)for(;d>0&&this.buffer[d-2]>l;)this.buffer[d]=this.buffer[d-4],this.buffer[d+1]=this.buffer[d-3],this.buffer[d+2]=this.buffer[d-2],this.buffer[d+3]=this.buffer[d-1],d-=4,o>4&&(o-=4)}this.buffer[d]=a,this.buffer[d+1]=s,this.buffer[d+2]=l,this.buffer[d+3]=o}}shift(a,s,l,o){if(a&131072)this.pushState(a&65535,this.pos);else if((a&262144)==0){let u=a,{parser:d}=this.p;this.pos=o;let O=d.stateFlag(u,1);!O&&(o>l||s<=d.maxNode)&&(this.reducePos=o),this.pushState(u,O?l:Math.min(l,this.reducePos)),this.shiftContext(s,l),s<=d.maxNode&&this.buffer.push(s,l,o,4)}else this.pos=o,this.shiftContext(s,l),s<=this.p.parser.maxNode&&this.buffer.push(s,l,o,4)}apply(a,s,l,o){a&65536?this.reduce(a):this.shift(a,s,l,o)}useNode(a,s){let l=this.p.reused.length-1;(l<0||this.p.reused[l]!=a)&&(this.p.reused.push(a),l++);let o=this.pos;this.reducePos=this.pos=o+a.length,this.pushState(s,o),this.buffer.push(l,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,a,this,this.p.stream.reset(this.pos-a.length)))}split(){let a=this,s=a.buffer.length;for(;s>0&&a.buffer[s-2]>a.reducePos;)s-=4;let l=a.buffer.slice(s),o=a.bufferBase+s;for(;a&&o==a.bufferBase;)a=a.parent;return new jc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,l,o,this.curContext,this.lookAhead,a)}recoverByDelete(a,s){let l=a<=this.p.parser.maxNode;l&&this.storeNode(a,this.pos,s,4),this.storeNode(0,this.pos,s,l?8:4),this.pos=this.reducePos=s,this.score-=190}canShift(a){for(let s=new HP(this);;){let l=this.p.parser.stateSlot(s.state,4)||this.p.parser.hasAction(s.state,a);if(l==0)return!1;if((l&65536)==0)return!0;s.reduce(l)}}recoverByInsert(a){if(this.stack.length>=300)return[];let s=this.p.parser.nextStates(this.state);if(s.length>8||this.stack.length>=120){let o=[];for(let u=0,d;u<s.length;u+=2)(d=s[u+1])!=this.state&&this.p.parser.hasAction(d,a)&&o.push(s[u],d);if(this.stack.length<120)for(let u=0;o.length<8&&u<s.length;u+=2){let d=s[u+1];o.some((O,h)=>h&1&&O==d)||o.push(s[u],d)}s=o}let l=[];for(let o=0;o<s.length&&l.length<4;o+=2){let u=s[o+1];if(u==this.state)continue;let d=this.split();d.pushState(u,this.pos),d.storeNode(0,d.pos,d.pos,4,!0),d.shiftContext(s[o],this.pos),d.reducePos=this.pos,d.score-=200,l.push(d)}return l}forceReduce(){let{parser:a}=this.p,s=a.stateSlot(this.state,5);if((s&65536)==0)return!1;if(!a.validAction(this.state,s)){let l=s>>19,o=s&65535,u=this.stack.length-l*3;if(u<0||a.getGoto(this.stack[u],o,!1)<0){let d=this.findForcedReduction();if(d==null)return!1;s=d}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(s),!0}findForcedReduction(){let{parser:a}=this.p,s=[],l=(o,u)=>{if(!s.includes(o))return s.push(o),a.allActions(o,d=>{if(!(d&393216))if(d&65536){let O=(d>>19)-u;if(O>1){let h=d&65535,p=this.stack.length-O*3;if(p>=0&&a.getGoto(this.stack[p],h,!1)>=0)return O<<19|65536|h}}else{let O=l(d,u+1);if(O!=null)return O}})};return l(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:a}=this.p;return a.data[a.stateSlot(this.state,1)]==65535&&!a.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(a){if(this.state!=a.state||this.stack.length!=a.stack.length)return!1;for(let s=0;s<this.stack.length;s+=3)if(this.stack[s]!=a.stack[s])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(a){return this.p.parser.dialect.flags[a]}shiftContext(a,s){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,a,this,this.p.stream.reset(s)))}reduceContext(a,s){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,a,this,this.p.stream.reset(s)))}emitContext(){let a=this.buffer.length-1;(a<0||this.buffer[a]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let a=this.buffer.length-1;(a<0||this.buffer[a]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(a){if(a!=this.curContext.context){let s=new O1(this.curContext.tracker,a);s.hash!=this.curContext.hash&&this.emitContext(),this.curContext=s}}setLookAhead(a){return a<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=a,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class O1{constructor(a,s){this.tracker=a,this.context=s,this.hash=a.strict?a.hash(s):0}}class HP{constructor(a){this.start=a,this.state=a.state,this.stack=a.stack,this.base=this.stack.length}reduce(a){let s=a&65535,l=a>>19;l==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(l-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],s,!0);this.state=o}}class wc{constructor(a,s,l){this.stack=a,this.pos=s,this.index=l,this.buffer=a.buffer,this.index==0&&this.maybeNext()}static create(a,s=a.bufferBase+a.buffer.length){return new wc(a,s,s-a.bufferBase)}maybeNext(){let a=this.stack.parent;a!=null&&(this.index=this.stack.bufferBase-a.bufferBase,this.stack=a,this.buffer=a.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new wc(this.stack,this.pos,this.index)}}function Hr(t,a=Uint16Array){if(typeof t!="string")return t;let s=null;for(let l=0,o=0;l<t.length;){let u=0;for(;;){let d=t.charCodeAt(l++),O=!1;if(d==126){u=65535;break}d>=92&&d--,d>=34&&d--;let h=d-32;if(h>=46&&(h-=46,O=!0),u+=h,O)break;u*=46}s?s[o++]=u:s=new a(u)}return s}class ac{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const f1=new ac;class IP{constructor(a,s){this.input=a,this.ranges=s,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=f1,this.rangeIndex=0,this.pos=this.chunkPos=s[0].from,this.range=s[0],this.end=s[s.length-1].to,this.readNext()}resolveOffset(a,s){let l=this.range,o=this.rangeIndex,u=this.pos+a;for(;u<l.from;){if(!o)return null;let d=this.ranges[--o];u-=l.from-d.to,l=d}for(;s<0?u>l.to:u>=l.to;){if(o==this.ranges.length-1)return null;let d=this.ranges[++o];u+=d.from-l.to,l=d}return u}clipPos(a){if(a>=this.range.from&&a<this.range.to)return a;for(let s of this.ranges)if(s.to>a)return Math.max(a,s.from);return this.end}peek(a){let s=this.chunkOff+a,l,o;if(s>=0&&s<this.chunk.length)l=this.pos+a,o=this.chunk.charCodeAt(s);else{let u=this.resolveOffset(a,1);if(u==null)return-1;if(l=u,l>=this.chunk2Pos&&l<this.chunk2Pos+this.chunk2.length)o=this.chunk2.charCodeAt(l-this.chunk2Pos);else{let d=this.rangeIndex,O=this.range;for(;O.to<=l;)O=this.ranges[++d];this.chunk2=this.input.chunk(this.chunk2Pos=l),l+this.chunk2.length>O.to&&(this.chunk2=this.chunk2.slice(0,O.to-l)),o=this.chunk2.charCodeAt(0)}}return l>=this.token.lookAhead&&(this.token.lookAhead=l+1),o}acceptToken(a,s=0){let l=s?this.resolveOffset(s,-1):this.pos;if(l==null||l<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=a,this.token.end=l}acceptTokenTo(a,s){this.token.value=a,this.token.end=s}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:a,chunkPos:s}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=a,this.chunk2Pos=s,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let a=this.input.chunk(this.pos),s=this.pos+a.length;this.chunk=s>this.range.to?a.slice(0,this.range.to-this.pos):a,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(a=1){for(this.chunkOff+=a;this.pos+a>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();a-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=a,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(a,s){if(s?(this.token=s,s.start=a,s.lookAhead=a+1,s.value=s.extended=-1):this.token=f1,this.pos!=a){if(this.pos=a,a==this.end)return this.setDone(),this;for(;a<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;a>=this.range.to;)this.range=this.ranges[++this.rangeIndex];a>=this.chunkPos&&a<this.chunkPos+this.chunk.length?this.chunkOff=a-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(a,s){if(a>=this.chunkPos&&s<=this.chunkPos+this.chunk.length)return this.chunk.slice(a-this.chunkPos,s-this.chunkPos);if(a>=this.chunk2Pos&&s<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(a-this.chunk2Pos,s-this.chunk2Pos);if(a>=this.range.from&&s<=this.range.to)return this.input.read(a,s);let l="";for(let o of this.ranges){if(o.from>=s)break;o.to>a&&(l+=this.input.read(Math.max(o.from,a),Math.min(o.to,s)))}return l}}class Pl{constructor(a,s){this.data=a,this.id=s}token(a,s){let{parser:l}=s.p;pv(this.data,a,s,this.id,l.data,l.tokenPrecTable)}}Pl.prototype.contextual=Pl.prototype.fallback=Pl.prototype.extend=!1;class kc{constructor(a,s,l){this.precTable=s,this.elseToken=l,this.data=typeof a=="string"?Hr(a):a}token(a,s){let l=a.pos,o=0;for(;;){let u=a.next<0,d=a.resolveOffset(1,1);if(pv(this.data,a,s,0,this.data,this.precTable),a.token.value>-1)break;if(this.elseToken==null)return;if(u||o++,d==null)break;a.reset(d,a.token)}o&&(a.reset(l,a.token),a.acceptToken(this.elseToken,o))}}kc.prototype.contextual=Pl.prototype.fallback=Pl.prototype.extend=!1;class gt{constructor(a,s={}){this.token=a,this.contextual=!!s.contextual,this.fallback=!!s.fallback,this.extend=!!s.extend}}function pv(t,a,s,l,o,u){let d=0,O=1<<l,{dialect:h}=s.p.parser;e:for(;(O&t[d])!=0;){let p=t[d+1];for(let y=d+3;y<p;y+=2)if((t[y+1]&O)>0){let Q=t[y];if(h.allows(Q)&&(a.token.value==-1||a.token.value==Q||FP(Q,a.token.value,o,u))){a.acceptToken(Q);break}}let x=a.next,g=0,b=t[d+2];if(a.next<0&&b>g&&t[p+b*3-3]==65535){d=t[p+b*3-1];continue e}for(;g<b;){let y=g+b>>1,Q=p+y+(y<<1),w=t[Q],$=t[Q+1]||65536;if(x<w)b=y;else if(x>=$)g=y+1;else{d=t[Q+2],a.advance();continue e}}break}}function h1(t,a,s){for(let l=a,o;(o=t[l])!=65535;l++)if(o==s)return l-a;return-1}function FP(t,a,s,l){let o=h1(s,l,a);return o<0||h1(s,l,t)<o}const Ut=typeof process<"u"&&d1&&/\bparse\b/.test(d1.LOG);let $O=null;function m1(t,a,s){let l=t.cursor(Xc.IncludeAnonymous);for(l.moveTo(a);;)if(!(s<0?l.childBefore(a):l.childAfter(a)))for(;;){if((s<0?l.to<a:l.from>a)&&!l.type.isError)return s<0?Math.max(0,Math.min(l.to-1,a-25)):Math.min(t.length,Math.max(l.from+1,a+25));if(s<0?l.prevSibling():l.nextSibling())break;if(!l.parent())return s<0?0:t.length}}let KP=class{constructor(a,s){this.fragments=a,this.nodeSet=s,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let a=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(a){for(this.safeFrom=a.openStart?m1(a.tree,a.from+a.offset,1)-a.offset:a.from,this.safeTo=a.openEnd?m1(a.tree,a.to+a.offset,-1)-a.offset:a.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(a.tree),this.start.push(-a.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(a){if(a<this.nextStart)return null;for(;this.fragment&&this.safeTo<=a;)this.nextFragment();if(!this.fragment)return null;for(;;){let s=this.trees.length-1;if(s<0)return this.nextFragment(),null;let l=this.trees[s],o=this.index[s];if(o==l.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let u=l.children[o],d=this.start[s]+l.positions[o];if(d>a)return this.nextStart=d,null;if(u instanceof mn){if(d==a){if(d<this.safeFrom)return null;let O=d+u.length;if(O<=this.safeTo){let h=u.prop(la.lookAhead);if(!h||O+h<this.fragment.to)return u}}this.index[s]++,d+u.length>=Math.max(this.safeFrom,a)&&(this.trees.push(u),this.start.push(d),this.index.push(0))}else this.index[s]++,this.nextStart=d+u.length}}};class JP{constructor(a,s){this.stream=s,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=a.tokenizers.map(l=>new ac)}getActions(a){let s=0,l=null,{parser:o}=a.p,{tokenizers:u}=o,d=o.stateSlot(a.state,3),O=a.curContext?a.curContext.hash:0,h=0;for(let p=0;p<u.length;p++){if((1<<p&d)==0)continue;let x=u[p],g=this.tokens[p];if(!(l&&!x.fallback)&&((x.contextual||g.start!=a.pos||g.mask!=d||g.context!=O)&&(this.updateCachedToken(g,x,a),g.mask=d,g.context=O),g.lookAhead>g.end+25&&(h=Math.max(g.lookAhead,h)),g.value!=0)){let b=s;if(g.extended>-1&&(s=this.addActions(a,g.extended,g.end,s)),s=this.addActions(a,g.value,g.end,s),!x.extend&&(l=g,s>b))break}}for(;this.actions.length>s;)this.actions.pop();return h&&a.setLookAhead(h),!l&&a.pos==this.stream.end&&(l=new ac,l.value=a.p.parser.eofTerm,l.start=l.end=a.pos,s=this.addActions(a,l.value,l.end,s)),this.mainToken=l,this.actions}getMainToken(a){if(this.mainToken)return this.mainToken;let s=new ac,{pos:l,p:o}=a;return s.start=l,s.end=Math.min(l+1,o.stream.end),s.value=l==o.stream.end?o.parser.eofTerm:0,s}updateCachedToken(a,s,l){let o=this.stream.clipPos(l.pos);if(s.token(this.stream.reset(o,a),l),a.value>-1){let{parser:u}=l.p;for(let d=0;d<u.specialized.length;d++)if(u.specialized[d]==a.value){let O=u.specializers[d](this.stream.read(a.start,a.end),l);if(O>=0&&l.p.parser.dialect.allows(O>>1)){(O&1)==0?a.value=O>>1:a.extended=O>>1;break}}}else a.value=0,a.end=this.stream.clipPos(o+1)}putAction(a,s,l,o){for(let u=0;u<o;u+=3)if(this.actions[u]==a)return o;return this.actions[o++]=a,this.actions[o++]=s,this.actions[o++]=l,o}addActions(a,s,l,o){let{state:u}=a,{parser:d}=a.p,{data:O}=d;for(let h=0;h<2;h++)for(let p=d.stateSlot(u,h?2:1);;p+=3){if(O[p]==65535)if(O[p+1]==1)p=sa(O,p+2);else{o==0&&O[p+1]==2&&(o=this.putAction(sa(O,p+2),s,l,o));break}O[p]==s&&(o=this.putAction(sa(O,p+1),s,l,o))}return o}}class e3{constructor(a,s,l,o){this.parser=a,this.input=s,this.ranges=o,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new IP(s,o),this.tokens=new JP(a,this.stream),this.topTerm=a.top[1];let{from:u}=o[0];this.stacks=[jc.start(this,a.top[0],u)],this.fragments=l.length&&this.stream.end-u>a.bufferLength*4?new KP(l,a.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let a=this.stacks,s=this.minStackPos,l=this.stacks=[],o,u;if(this.bigReductionCount>300&&a.length==1){let[d]=a;for(;d.forceReduce()&&d.stack.length&&d.stack[d.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let d=0;d<a.length;d++){let O=a[d];for(;;){if(this.tokens.mainToken=null,O.pos>s)l.push(O);else{if(this.advanceStack(O,l,a))continue;{o||(o=[],u=[]),o.push(O);let h=this.tokens.getMainToken(O);u.push(h.value,h.end)}}break}}if(!l.length){let d=o&&n3(o);if(d)return Ut&&console.log("Finish with "+this.stackID(d)),this.stackToTree(d);if(this.parser.strict)throw Ut&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+s);this.recovering||(this.recovering=5)}if(this.recovering&&o){let d=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,u,l);if(d)return Ut&&console.log("Force-finish "+this.stackID(d)),this.stackToTree(d.forceAll())}if(this.recovering){let d=this.recovering==1?1:this.recovering*3;if(l.length>d)for(l.sort((O,h)=>h.score-O.score);l.length>d;)l.pop();l.some(O=>O.reducePos>s)&&this.recovering--}else if(l.length>1){e:for(let d=0;d<l.length-1;d++){let O=l[d];for(let h=d+1;h<l.length;h++){let p=l[h];if(O.sameState(p)||O.buffer.length>500&&p.buffer.length>500)if((O.score-p.score||O.buffer.length-p.buffer.length)>0)l.splice(h--,1);else{l.splice(d--,1);continue e}}}l.length>12&&(l.sort((d,O)=>O.score-d.score),l.splice(12,l.length-12))}this.minStackPos=l[0].pos;for(let d=1;d<l.length;d++)l[d].pos<this.minStackPos&&(this.minStackPos=l[d].pos);return null}stopAt(a){if(this.stoppedAt!=null&&this.stoppedAt<a)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=a}advanceStack(a,s,l){let o=a.pos,{parser:u}=this,d=Ut?this.stackID(a)+" -> ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return a.forceReduce()?a:null;if(this.fragments){let p=a.curContext&&a.curContext.tracker.strict,x=p?a.curContext.hash:0;for(let g=this.fragments.nodeAt(o);g;){let b=this.parser.nodeSet.types[g.type.id]==g.type?u.getGoto(a.state,g.type.id):-1;if(b>-1&&g.length&&(!p||(g.prop(la.contextHash)||0)==x))return a.useNode(g,b),Ut&&console.log(d+this.stackID(a)+` (via reuse of ${u.getName(g.type.id)})`),!0;if(!(g instanceof mn)||g.children.length==0||g.positions[0]>0)break;let y=g.children[0];if(y instanceof mn&&g.positions[0]==0)g=y;else break}}let O=u.stateSlot(a.state,4);if(O>0)return a.reduce(O),Ut&&console.log(d+this.stackID(a)+` (via always-reduce ${u.getName(O&65535)})`),!0;if(a.stack.length>=8400)for(;a.stack.length>6e3&&a.forceReduce(););let h=this.tokens.getActions(a);for(let p=0;p<h.length;){let x=h[p++],g=h[p++],b=h[p++],y=p==h.length||!l,Q=y?a:a.split(),w=this.tokens.mainToken;if(Q.apply(x,g,w?w.start:Q.pos,b),Ut&&console.log(d+this.stackID(Q)+` (via ${(x&65536)==0?"shift":`reduce of ${u.getName(x&65535)}`} for ${u.getName(g)} @ ${o}${Q==a?"":", split"})`),y)return!0;Q.pos>o?s.push(Q):l.push(Q)}return!1}advanceFully(a,s){let l=a.pos;for(;;){if(!this.advanceStack(a,null,null))return!1;if(a.pos>l)return p1(a,s),!0}}runRecovery(a,s,l){let o=null,u=!1;for(let d=0;d<a.length;d++){let O=a[d],h=s[d<<1],p=s[(d<<1)+1],x=Ut?this.stackID(O)+" -> ":"";if(O.deadEnd&&(u||(u=!0,O.restart(),Ut&&console.log(x+this.stackID(O)+" (restarted)"),this.advanceFully(O,l))))continue;let g=O.split(),b=x;for(let y=0;y<10&&g.forceReduce()&&(Ut&&console.log(b+this.stackID(g)+" (via force-reduce)"),!this.advanceFully(g,l));y++)Ut&&(b=this.stackID(g)+" -> ");for(let y of O.recoverByInsert(h))Ut&&console.log(x+this.stackID(y)+" (via recover-insert)"),this.advanceFully(y,l);this.stream.end>O.pos?(p==O.pos&&(p++,h=0),O.recoverByDelete(h,p),Ut&&console.log(x+this.stackID(O)+` (via recover-delete ${this.parser.getName(h)})`),p1(O,l)):(!o||o.score<g.score)&&(o=g)}return o}stackToTree(a){return a.close(),mn.build({buffer:wc.create(a),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:a.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(a){let s=($O||($O=new WeakMap)).get(a);return s||$O.set(a,s=String.fromCodePoint(this.nextStackID++)),s+a}}function p1(t,a){for(let s=0;s<a.length;s++){let l=a[s];if(l.pos==t.pos&&l.sameState(t)){a[s].score<t.score&&(a[s]=t);return}}a.push(t)}class t3{constructor(a,s,l){this.source=a,this.flags=s,this.disabled=l}allows(a){return!this.disabled||this.disabled[a]==0}}const TO=t=>t;class dh{constructor(a){this.start=a.start,this.shift=a.shift||TO,this.reduce=a.reduce||TO,this.reuse=a.reuse||TO,this.hash=a.hash||(()=>0),this.strict=a.strict!==!1}}class es extends T0{constructor(a){if(super(),this.wrappers=[],a.version!=14)throw new RangeError(`Parser version (${a.version}) doesn't match runtime version (14)`);let s=a.nodeNames.split(" ");this.minRepeatTerm=s.length;for(let O=0;O<a.repeatNodeCount;O++)s.push("");let l=Object.keys(a.topRules).map(O=>a.topRules[O][1]),o=[];for(let O=0;O<s.length;O++)o.push([]);function u(O,h,p){o[O].push([h,h.deserialize(String(p))])}if(a.nodeProps)for(let O of a.nodeProps){let h=O[0];typeof h=="string"&&(h=la[h]);for(let p=1;p<O.length;){let x=O[p++];if(x>=0)u(x,h,O[p++]);else{let g=O[p+-x];for(let b=-x;b>0;b--)u(O[p++],h,g);p++}}}this.nodeSet=new _f(s.map((O,h)=>di.define({name:h>=this.minRepeatTerm?void 0:O,id:h,props:o[h],top:l.indexOf(h)>-1,error:h==0,skipped:a.skippedNodes&&a.skippedNodes.indexOf(h)>-1}))),a.propSources&&(this.nodeSet=this.nodeSet.extend(...a.propSources)),this.strict=!1,this.bufferLength=Nj;let d=Hr(a.tokenData);this.context=a.context,this.specializerSpecs=a.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let O=0;O<this.specializerSpecs.length;O++)this.specialized[O]=this.specializerSpecs[O].term;this.specializers=this.specializerSpecs.map(x1),this.states=Hr(a.states,Uint32Array),this.data=Hr(a.stateData),this.goto=Hr(a.goto),this.maxTerm=a.maxTerm,this.tokenizers=a.tokenizers.map(O=>typeof O=="number"?new Pl(d,O):O),this.topRules=a.topRules,this.dialects=a.dialects||{},this.dynamicPrecedences=a.dynamicPrecedences||null,this.tokenPrecTable=a.tokenPrec,this.termNames=a.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(a,s,l){let o=new e3(this,a,s,l);for(let u of this.wrappers)o=u(o,a,s,l);return o}getGoto(a,s,l=!1){let o=this.goto;if(s>=o[0])return-1;for(let u=o[s+1];;){let d=o[u++],O=d&1,h=o[u++];if(O&&l)return h;for(let p=u+(d>>1);u<p;u++)if(o[u]==a)return h;if(O)return-1}}hasAction(a,s){let l=this.data;for(let o=0;o<2;o++)for(let u=this.stateSlot(a,o?2:1),d;;u+=3){if((d=l[u])==65535)if(l[u+1]==1)d=l[u=sa(l,u+2)];else{if(l[u+1]==2)return sa(l,u+2);break}if(d==s||d==0)return sa(l,u+1)}return 0}stateSlot(a,s){return this.states[a*6+s]}stateFlag(a,s){return(this.stateSlot(a,0)&s)>0}validAction(a,s){return!!this.allActions(a,l=>l==s?!0:null)}allActions(a,s){let l=this.stateSlot(a,4),o=l?s(l):void 0;for(let u=this.stateSlot(a,1);o==null;u+=3){if(this.data[u]==65535)if(this.data[u+1]==1)u=sa(this.data,u+2);else break;o=s(sa(this.data,u+1))}return o}nextStates(a){let s=[];for(let l=this.stateSlot(a,1);;l+=3){if(this.data[l]==65535)if(this.data[l+1]==1)l=sa(this.data,l+2);else break;if((this.data[l+2]&1)==0){let o=this.data[l+1];s.some((u,d)=>d&1&&u==o)||s.push(this.data[l],o)}}return s}configure(a){let s=Object.assign(Object.create(es.prototype),this);if(a.props&&(s.nodeSet=this.nodeSet.extend(...a.props)),a.top){let l=this.topRules[a.top];if(!l)throw new RangeError(`Invalid top rule name ${a.top}`);s.top=l}return a.tokenizers&&(s.tokenizers=this.tokenizers.map(l=>{let o=a.tokenizers.find(u=>u.from==l);return o?o.to:l})),a.specializers&&(s.specializers=this.specializers.slice(),s.specializerSpecs=this.specializerSpecs.map((l,o)=>{let u=a.specializers.find(O=>O.from==l.external);if(!u)return l;let d=Object.assign(Object.assign({},l),{external:u.to});return s.specializers[o]=x1(d),d})),a.contextTracker&&(s.context=a.contextTracker),a.dialect&&(s.dialect=this.parseDialect(a.dialect)),a.strict!=null&&(s.strict=a.strict),a.wrap&&(s.wrappers=s.wrappers.concat(a.wrap)),a.bufferLength!=null&&(s.bufferLength=a.bufferLength),s}hasWrappers(){return this.wrappers.length>0}getName(a){return this.termNames?this.termNames[a]:String(a<=this.maxNode&&this.nodeSet.types[a].name||a)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(a){let s=this.dynamicPrecedences;return s==null?0:s[a]||0}parseDialect(a){let s=Object.keys(this.dialects),l=s.map(()=>!1);if(a)for(let u of a.split(" ")){let d=s.indexOf(u);d>=0&&(l[d]=!0)}let o=null;for(let u=0;u<s.length;u++)if(!l[u])for(let d=this.dialects[s[u]],O;(O=this.data[d++])!=65535;)(o||(o=new Uint8Array(this.maxTerm+1)))[O]=1;return new t3(a,l,o)}static deserialize(a){return new es(a)}}function sa(t,a){return t[a]|t[a+1]<<16}function n3(t){let a=null;for(let s of t){let l=s.p.stoppedAt;(s.pos==s.p.stream.end||l!=null&&s.pos>l)&&s.p.parser.stateFlag(s.state,2)&&(!a||a.score<s.score)&&(a=s)}return a}function x1(t){if(t.external){let a=t.extend?1:0;return(s,l)=>t.external(s,l)<<1|a}return t.get}const a3=316,s3=317,g1=1,l3=2,r3=3,i3=4,o3=318,c3=320,u3=321,d3=5,O3=6,f3=0,gf=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],xv=125,h3=59,bf=47,m3=42,p3=43,x3=45,g3=60,b3=44,v3=63,y3=46,S3=91,Q3=new dh({start:!1,shift(t,a){return a==d3||a==O3||a==c3?t:a==u3},strict:!1}),j3=new gt((t,a)=>{let{next:s}=t;(s==xv||s==-1||a.context)&&t.acceptToken(o3)},{contextual:!0,fallback:!0}),w3=new gt((t,a)=>{let{next:s}=t,l;gf.indexOf(s)>-1||s==bf&&((l=t.peek(1))==bf||l==m3)||s!=xv&&s!=h3&&s!=-1&&!a.context&&t.acceptToken(a3)},{contextual:!0}),k3=new gt((t,a)=>{t.next==S3&&!a.context&&t.acceptToken(s3)},{contextual:!0}),$3=new gt((t,a)=>{let{next:s}=t;if(s==p3||s==x3){if(t.advance(),s==t.next){t.advance();let l=!a.context&&a.canShift(g1);t.acceptToken(l?g1:l3)}}else s==v3&&t.peek(1)==y3&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(r3))},{contextual:!0});function NO(t,a){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!a&&t>=48&&t<=57}const T3=new gt((t,a)=>{if(t.next!=g3||!a.dialectEnabled(f3)||(t.advance(),t.next==bf))return;let s=0;for(;gf.indexOf(t.next)>-1;)t.advance(),s++;if(NO(t.next,!0)){for(t.advance(),s++;NO(t.next,!1);)t.advance(),s++;for(;gf.indexOf(t.next)>-1;)t.advance(),s++;if(t.next==b3)return;for(let l=0;;l++){if(l==7){if(!NO(t.next,!0))return;break}if(t.next!="extends".charCodeAt(l))break;t.advance(),s++}}t.acceptToken(i3,-s)}),N3=Rs({"get set async static":A.modifier,"for while do if else switch try catch finally return throw break continue default case defer":A.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":A.operatorKeyword,"let var const using function class extends":A.definitionKeyword,"import export from":A.moduleKeyword,"with debugger new":A.keyword,TemplateString:A.special(A.string),super:A.atom,BooleanLiteral:A.bool,this:A.self,null:A.null,Star:A.modifier,VariableName:A.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":A.function(A.variableName),VariableDefinition:A.definition(A.variableName),Label:A.labelName,PropertyName:A.propertyName,PrivatePropertyName:A.special(A.propertyName),"CallExpression/MemberExpression/PropertyName":A.function(A.propertyName),"FunctionDeclaration/VariableDefinition":A.function(A.definition(A.variableName)),"ClassDeclaration/VariableDefinition":A.definition(A.className),"NewExpression/VariableName":A.className,PropertyDefinition:A.definition(A.propertyName),PrivatePropertyDefinition:A.definition(A.special(A.propertyName)),UpdateOp:A.updateOperator,"LineComment Hashbang":A.lineComment,BlockComment:A.blockComment,Number:A.number,String:A.string,Escape:A.escape,ArithOp:A.arithmeticOperator,LogicOp:A.logicOperator,BitOp:A.bitwiseOperator,CompareOp:A.compareOperator,RegExp:A.regexp,Equals:A.definitionOperator,Arrow:A.function(A.punctuation),": Spread":A.punctuation,"( )":A.paren,"[ ]":A.squareBracket,"{ }":A.brace,"InterpolationStart InterpolationEnd":A.special(A.brace),".":A.derefOperator,", ;":A.separator,"@":A.meta,TypeName:A.typeName,TypeDefinition:A.definition(A.typeName),"type enum interface implements namespace module declare":A.definitionKeyword,"abstract global Privacy readonly override":A.modifier,"is keyof unique infer asserts":A.operatorKeyword,JSXAttributeValue:A.attributeValue,JSXText:A.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":A.angleBracket,"JSXIdentifier JSXNameSpacedName":A.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":A.attributeName,"JSXBuiltin/JSXIdentifier":A.standard(A.tagName)}),P3={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},z3={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},R3={__proto__:null,"<":193},C3=es.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0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ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Q3,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[N3],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(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TEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[w3,k3,$3,T3,2,3,4,5,6,7,8,9,10,11,12,13,14,j3,new kc("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new kc("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>P3[t]||-1},{term:343,get:t=>z3[t]||-1},{term:95,get:t=>R3[t]||-1}],tokenPrec:15201}),gv=[Fe("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Fe("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Fe("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Fe("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Fe("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Fe(`try {
|
|
570
570
|
\${}
|
|
571
571
|
} catch (\${error}) {
|
|
572
572
|
\${}
|
|
@@ -585,7 +585,7 @@ Error generating stack: `+c.message+`
|
|
|
585
585
|
`);l=o<0?s:s.slice(0,o)}return a+l.length>this.to?l.slice(0,this.to-a):l}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(a,s,l=0){this.block=Nc.create(a,l,this.lineStart+s,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(a,s,l=0){this.startContext(this.parser.getNodeType(a),s,l)}addNode(a,s,l){typeof a=="number"&&(a=new mn(this.parser.nodeSet.types[a],Yl,Yl,(l??this.prevLineEnd())-s)),this.block.addChild(a,s-this.block.from)}addElement(a){this.block.addChild(a.toTree(this.parser.nodeSet),a.from-this.block.from)}addLeafElement(a,s){this.addNode(this.buffer.writeElements(kf(s.children,a.marks),-s.from).finish(s.type,s.to-s.from),s.from)}finishContext(){let a=this.stack.pop(),s=this.stack[this.stack.length-1];s.addChild(a.toTree(this.parser.nodeSet),a.from-s.from),this.block=s}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(a){return this.ranges.length>1?cy(this.ranges,0,a.topNode,this.ranges[0].from,this.reusePlaceholders):a}finishLeaf(a){for(let l of a.parsers)if(l.finish(this,a))return;let s=kf(this.parser.parseInline(a.content,a.start),a.marks);this.addNode(this.buffer.writeElements(s,-a.start).finish(ie.Paragraph,a.content.length),a.start)}elt(a,s,l,o){return typeof a=="string"?ze(this.parser.getNodeType(a),s,l,o):new Oy(a,s)}get buffer(){return new dy(this.parser.nodeSet)}}function cy(t,a,s,l,o){let u=t[a].to,d=[],O=[],h=s.from+l;function p(x,g){for(;g?x>=u:x>u;){let b=t[a+1].from-u;l+=b,x+=b,a++,u=t[a].to}}for(let x=s.firstChild;x;x=x.nextSibling){p(x.from+l,!0);let g=x.from+l,b,y=o.get(x.tree);y?b=y:x.to+l>u?(b=cy(t,a,x,l,o),p(x.to+l,!1)):b=x.toTree(),d.push(b),O.push(g-h)}return p(s.to+l,!1),new mn(s.type,d,O,s.to+l-h,s.tree?s.tree.propValues:void 0)}class Hc extends T0{constructor(a,s,l,o,u,d,O,h,p){super(),this.nodeSet=a,this.blockParsers=s,this.leafBlockParsers=l,this.blockNames=o,this.endLeafBlock=u,this.skipContextMarkup=d,this.inlineParsers=O,this.inlineNames=h,this.wrappers=p,this.nodeTypes=Object.create(null);for(let x of a.types)this.nodeTypes[x.name]=x.id}createParse(a,s,l){let o=new wz(this,a,s,l);for(let u of this.wrappers)o=u(o,a,s,l);return o}configure(a){let s=wf(a);if(!s)return this;let{nodeSet:l,skipContextMarkup:o}=this,u=this.blockParsers.slice(),d=this.leafBlockParsers.slice(),O=this.blockNames.slice(),h=this.inlineParsers.slice(),p=this.inlineNames.slice(),x=this.endLeafBlock.slice(),g=this.wrappers;if(Br(s.defineNodes)){o=Object.assign({},o);let b=l.types.slice(),y;for(let Q of s.defineNodes){let{name:w,block:$,composite:j,style:z}=typeof Q=="string"?{name:Q}:Q;if(b.some(G=>G.name==w))continue;j&&(o[b.length]=(G,R,X)=>j(R,X,G.value));let N=b.length,_=j?["Block","BlockContext"]:$?N>=ie.ATXHeading1&&N<=ie.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;b.push(di.define({id:N,name:w,props:_&&[[la.group,_]]})),z&&(y||(y={}),Array.isArray(z)||z instanceof Rj?y[w]=z:Object.assign(y,z))}l=new _f(b),y&&(l=l.extend(Rs(y)))}if(Br(s.props)&&(l=l.extend(...s.props)),Br(s.remove))for(let b of s.remove){let y=this.blockNames.indexOf(b),Q=this.inlineNames.indexOf(b);y>-1&&(u[y]=d[y]=void 0),Q>-1&&(h[Q]=void 0)}if(Br(s.parseBlock))for(let b of s.parseBlock){let y=O.indexOf(b.name);if(y>-1)u[y]=b.parse,d[y]=b.leaf;else{let Q=b.before?Wo(O,b.before):b.after?Wo(O,b.after)+1:O.length-1;u.splice(Q,0,b.parse),d.splice(Q,0,b.leaf),O.splice(Q,0,b.name)}b.endLeaf&&x.push(b.endLeaf)}if(Br(s.parseInline))for(let b of s.parseInline){let y=p.indexOf(b.name);if(y>-1)h[y]=b.parse;else{let Q=b.before?Wo(p,b.before):b.after?Wo(p,b.after)+1:p.length-1;h.splice(Q,0,b.parse),p.splice(Q,0,b.name)}}return s.wrap&&(g=g.concat(s.wrap)),new Hc(l,u,d,O,x,o,h,p,g)}getNodeType(a){let s=this.nodeTypes[a];if(s==null)throw new RangeError(`Unknown node type '${a}'`);return s}parseInline(a,s){let l=new vh(this,a,s);e:for(let o=s;o<l.end;){let u=l.char(o);for(let d of this.inlineParsers)if(d){let O=d(l,u,o);if(O>=0){o=O;continue e}}o++}return l.resolveMarkers(0)}}function Br(t){return t!=null&&t.length>0}function wf(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let a=wf(t[0]);if(t.length==1)return a;let s=wf(t.slice(1));if(!s||!a)return a||s;let l=(d,O)=>(d||Yl).concat(O||Yl),o=a.wrap,u=s.wrap;return{props:l(a.props,s.props),defineNodes:l(a.defineNodes,s.defineNodes),parseBlock:l(a.parseBlock,s.parseBlock),parseInline:l(a.parseInline,s.parseInline),remove:l(a.remove,s.remove),wrap:o?u?(d,O,h,p)=>o(u(d,O,h,p),O,h,p):o:u}}function Wo(t,a){let s=t.indexOf(a);if(s<0)throw new RangeError(`Position specified relative to unknown parser ${a}`);return s}let uy=[di.none];for(let t=1,a;a=ie[t];t++)uy[t]=di.define({id:t,name:a,props:t>=ie.Escape?[]:[[la.group,t in Jv?["Block","BlockContext"]:["Block","LeafBlock"]]],top:a=="Document"});const Yl=[];class dy{constructor(a){this.nodeSet=a,this.content=[],this.nodes=[]}write(a,s,l,o=0){return this.content.push(a,s,l,4+o*4),this}writeElements(a,s=0){for(let l of a)l.writeTo(this,s);return this}finish(a,s){return mn.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:a,length:s})}}let oi=class{constructor(a,s,l,o=Yl){this.type=a,this.from=s,this.to=l,this.children=o}writeTo(a,s){let l=a.content.length;a.writeElements(this.children,s),a.content.push(this.type,this.from+s,this.to+s,a.content.length+4-l)}toTree(a){return new dy(a).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class Oy{constructor(a,s){this.tree=a,this.from=s}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Yl}writeTo(a,s){a.nodes.push(this.tree),a.content.push(a.nodes.length-1,this.from+s,this.to+s,-1)}toTree(){return this.tree}}function ze(t,a,s,l){return new oi(t,a,s,l)}const fy={resolve:"Emphasis",mark:"EmphasisMark"},hy={resolve:"Emphasis",mark:"EmphasisMark"},js={},Pc={};class Gt{constructor(a,s,l,o){this.type=a,this.from=s,this.to=l,this.side=o}}const Y1="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let ci=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{ci=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const EO={Escape(t,a,s){if(a!=92||s==t.end-1)return-1;let l=t.char(s+1);for(let o=0;o<Y1.length;o++)if(Y1.charCodeAt(o)==l)return t.append(ze(ie.Escape,s,s+2));return-1},Entity(t,a,s){if(a!=38)return-1;let l=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(s+1,s+31));return l?t.append(ze(ie.Entity,s,s+1+l[0].length)):-1},InlineCode(t,a,s){if(a!=96||s&&t.char(s-1)==96)return-1;let l=s+1;for(;l<t.end&&t.char(l)==96;)l++;let o=l-s,u=0;for(;l<t.end;l++)if(t.char(l)==96){if(u++,u==o&&t.char(l+1)!=96)return t.append(ze(ie.InlineCode,s,l+1,[ze(ie.CodeMark,s,s+o),ze(ie.CodeMark,l+1-o,l+1)]))}else u=0;return-1},HTMLTag(t,a,s){if(a!=60||s==t.end-1)return-1;let l=t.slice(s+1,t.end),o=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(l);if(o)return t.append(ze(ie.Autolink,s,s+1+o[0].length,[ze(ie.LinkMark,s,s+1),ze(ie.URL,s+1,s+o[0].length),ze(ie.LinkMark,s+o[0].length,s+1+o[0].length)]));let u=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(l);if(u)return t.append(ze(ie.Comment,s,s+1+u[0].length));let d=/^\?[^]*?\?>/.exec(l);if(d)return t.append(ze(ie.ProcessingInstruction,s,s+1+d[0].length));let O=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(l);return O?t.append(ze(ie.HTMLTag,s,s+1+O[0].length)):-1},Emphasis(t,a,s){if(a!=95&&a!=42)return-1;let l=s+1;for(;t.char(l)==a;)l++;let o=t.slice(s-1,s),u=t.slice(l,l+1),d=ci.test(o),O=ci.test(u),h=/\s|^$/.test(o),p=/\s|^$/.test(u),x=!p&&(!O||h||d),g=!h&&(!d||p||O),b=x&&(a==42||!g||d),y=g&&(a==42||!x||O);return t.append(new Gt(a==95?fy:hy,s,l,(b?1:0)|(y?2:0)))},HardBreak(t,a,s){if(a==92&&t.char(s+1)==10)return t.append(ze(ie.HardBreak,s,s+2));if(a==32){let l=s+1;for(;t.char(l)==32;)l++;if(t.char(l)==10&&l>=s+2)return t.append(ze(ie.HardBreak,s,l+1))}return-1},Link(t,a,s){return a==91?t.append(new Gt(js,s,s+1,1)):-1},Image(t,a,s){return a==33&&t.char(s+1)==91?t.append(new Gt(Pc,s,s+2,1)):-1},LinkEnd(t,a,s){if(a!=93)return-1;for(let l=t.parts.length-1;l>=0;l--){let o=t.parts[l];if(o instanceof Gt&&(o.type==js||o.type==Pc)){if(!o.side||t.skipSpace(o.to)==s&&!/[(\[]/.test(t.slice(s+1,s+2)))return t.parts[l]=null,-1;let u=t.takeContent(l),d=t.parts[l]=kz(t,u,o.type==js?ie.Link:ie.Image,o.from,s+1);if(o.type==js)for(let O=0;O<l;O++){let h=t.parts[O];h instanceof Gt&&h.type==js&&(h.side=0)}return d.to}}return-1}};function kz(t,a,s,l,o){let{text:u}=t,d=t.char(o),O=o;if(a.unshift(ze(ie.LinkMark,l,l+(s==ie.Image?2:1))),a.push(ze(ie.LinkMark,o-1,o)),d==40){let h=t.skipSpace(o+1),p=my(u,h-t.offset,t.offset),x;p&&(h=t.skipSpace(p.to),h!=p.to&&(x=py(u,h-t.offset,t.offset),x&&(h=t.skipSpace(x.to)))),t.char(h)==41&&(a.push(ze(ie.LinkMark,o,o+1)),O=h+1,p&&a.push(p),x&&a.push(x),a.push(ze(ie.LinkMark,h,O)))}else if(d==91){let h=xy(u,o-t.offset,t.offset,!1);h&&(a.push(h),O=h.to)}return ze(s,l,O,a)}function my(t,a,s){if(t.charCodeAt(a)==60){for(let o=a+1;o<t.length;o++){let u=t.charCodeAt(o);if(u==62)return ze(ie.URL,a+s,o+1+s);if(u==60||u==10)return!1}return null}else{let o=0,u=a;for(let d=!1;u<t.length;u++){let O=t.charCodeAt(u);if(cn(O))break;if(d)d=!1;else if(O==40)o++;else if(O==41){if(!o)break;o--}else O==92&&(d=!0)}return u>a?ze(ie.URL,a+s,u+s):u==t.length?null:!1}}function py(t,a,s){let l=t.charCodeAt(a);if(l!=39&&l!=34&&l!=40)return!1;let o=l==40?41:l;for(let u=a+1,d=!1;u<t.length;u++){let O=t.charCodeAt(u);if(d)d=!1;else{if(O==o)return ze(ie.LinkTitle,a+s,u+1+s);O==92&&(d=!0)}}return null}function xy(t,a,s,l){for(let o=!1,u=a+1,d=Math.min(t.length,u+999);u<d;u++){let O=t.charCodeAt(u);if(o)o=!1;else{if(O==93)return l?!1:ze(ie.LinkLabel,a+s,u+1+s);if(l&&!cn(O)&&(l=!1),O==91)return!1;O==92&&(o=!0)}}return null}class vh{constructor(a,s,l){this.parser=a,this.text=s,this.offset=l,this.parts=[]}char(a){return a>=this.end?-1:this.text.charCodeAt(a-this.offset)}get end(){return this.offset+this.text.length}slice(a,s){return this.text.slice(a-this.offset,s-this.offset)}append(a){return this.parts.push(a),a.to}addDelimiter(a,s,l,o,u){return this.append(new Gt(a,s,l,(o?1:0)|(u?2:0)))}get hasOpenLink(){for(let a=this.parts.length-1;a>=0;a--){let s=this.parts[a];if(s instanceof Gt&&(s.type==js||s.type==Pc))return!0}return!1}addElement(a){return this.append(a)}resolveMarkers(a){for(let l=a;l<this.parts.length;l++){let o=this.parts[l];if(!(o instanceof Gt&&o.type.resolve&&o.side&2))continue;let u=o.type==fy||o.type==hy,d=o.to-o.from,O,h=l-1;for(;h>=a;h--){let w=this.parts[h];if(w instanceof Gt&&w.side&1&&w.type==o.type&&!(u&&(o.side&1||w.side&2)&&(w.to-w.from+d)%3==0&&((w.to-w.from)%3||d%3))){O=w;break}}if(!O)continue;let p=o.type.resolve,x=[],g=O.from,b=o.to;if(u){let w=Math.min(2,O.to-O.from,d);g=O.to-w,b=o.from+w,p=w==1?"Emphasis":"StrongEmphasis"}O.type.mark&&x.push(this.elt(O.type.mark,g,O.to));for(let w=h+1;w<l;w++)this.parts[w]instanceof oi&&x.push(this.parts[w]),this.parts[w]=null;o.type.mark&&x.push(this.elt(o.type.mark,o.from,b));let y=this.elt(p,g,b,x);this.parts[h]=u&&O.from!=g?new Gt(O.type,O.from,g,O.side):null,(this.parts[l]=u&&o.to!=b?new Gt(o.type,b,o.to,o.side):null)?this.parts.splice(l,0,y):this.parts[l]=y}let s=[];for(let l=a;l<this.parts.length;l++){let o=this.parts[l];o instanceof oi&&s.push(o)}return s}findOpeningDelimiter(a){for(let s=this.parts.length-1;s>=0;s--){let l=this.parts[s];if(l instanceof Gt&&l.type==a&&l.side&1)return s}return null}takeContent(a){let s=this.resolveMarkers(a);return this.parts.length=a,s}getDelimiterAt(a){let s=this.parts[a];return s instanceof Gt?s:null}skipSpace(a){return Fr(this.text,a-this.offset)+this.offset}elt(a,s,l,o){return typeof a=="string"?ze(this.parser.getNodeType(a),s,l,o):new Oy(a,s)}}vh.linkStart=js;vh.imageStart=Pc;function kf(t,a){if(!a.length)return t;if(!t.length)return a;let s=t.slice(),l=0;for(let o of a){for(;l<s.length&&s[l].to<o.to;)l++;if(l<s.length&&s[l].from<o.from){let u=s[l];u instanceof oi&&(s[l]=new oi(u.type,u.from,u.to,kf(u.children,[o])))}else s.splice(l++,0,o)}return s}const $z=[ie.CodeBlock,ie.ListItem,ie.OrderedList,ie.BulletList];class Tz{constructor(a,s){this.fragments=a,this.input=s,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,a.length&&(this.fragment=a[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(a,s){for(;this.fragment&&this.fragment.to<=a;)this.nextFragment();if(!this.fragment||this.fragment.from>(a?a-1:0))return!1;if(this.fragmentEnd<0){let u=this.fragment.to;for(;u>0&&this.input.read(u-1,u)!=`
|
|
586
586
|
`;)u--;this.fragmentEnd=u?u-1:0}let l=this.cursor;l||(l=this.cursor=this.fragment.tree.cursor(),l.firstChild());let o=a+this.fragment.offset;for(;l.to<=o;)if(!l.parent())return!1;for(;;){if(l.from>=o)return this.fragment.from<=s;if(!l.childAfter(o))return!1}}matches(a){let s=this.cursor.tree;return s&&s.prop(la.contextHash)==a}takeNodes(a){let s=this.cursor,l=this.fragment.offset,o=this.fragmentEnd-(this.fragment.openEnd?1:0),u=a.absoluteLineStart,d=u,O=a.block.children.length,h=d,p=O;for(;;){if(s.to-l>o){if(s.type.isAnonymous&&s.firstChild())continue;break}let x=gy(s.from-l,a.ranges);if(s.to-l<=a.ranges[a.rangeI].to)a.addNode(s.tree,x);else{let g=new mn(a.parser.nodeSet.types[ie.Paragraph],[],[],0,a.block.hashProp);a.reusePlaceholders.set(g,s.tree),a.addNode(g,x)}if(s.type.is("Block")&&($z.indexOf(s.type.id)<0?(d=s.to-l,O=a.block.children.length):(d=h,O=p),h=s.to-l,p=a.block.children.length),!s.nextSibling())break}for(;a.block.children.length>O;)a.block.children.pop(),a.block.positions.pop();return d-u}}function gy(t,a){let s=t;for(let l=1;l<a.length;l++){let o=a[l-1].to,u=a[l].from;o<t&&(s-=u-o)}return s}const Nz=Rs({"Blockquote/...":A.quote,HorizontalRule:A.contentSeparator,"ATXHeading1/... SetextHeading1/...":A.heading1,"ATXHeading2/... SetextHeading2/...":A.heading2,"ATXHeading3/...":A.heading3,"ATXHeading4/...":A.heading4,"ATXHeading5/...":A.heading5,"ATXHeading6/...":A.heading6,"Comment CommentBlock":A.comment,Escape:A.escape,Entity:A.character,"Emphasis/...":A.emphasis,"StrongEmphasis/...":A.strong,"Link/... Image/...":A.link,"OrderedList/... BulletList/...":A.list,"BlockQuote/...":A.quote,"InlineCode CodeText":A.monospace,"URL Autolink":A.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":A.processingInstruction,"CodeInfo LinkLabel":A.labelName,LinkTitle:A.string,Paragraph:A.content}),Pz=new Hc(new _f(uy).extend(Nz),Object.keys(Do).map(t=>Do[t]),Object.keys(Do).map(t=>oy[t]),Object.keys(Do),Qz,Jv,Object.keys(EO).map(t=>EO[t]),Object.keys(EO),[]);function zz(t,a,s){let l=[];for(let o=t.firstChild,u=a;;o=o.nextSibling){let d=o?o.from:s;if(d>u&&l.push({from:u,to:d}),!o)break;u=o.to}return l}function Rz(t){let{codeParser:a,htmlParser:s}=t;return{wrap:C0((o,u)=>{let d=o.type.id;if(a&&(d==ie.CodeBlock||d==ie.FencedCode)){let O="";if(d==ie.FencedCode){let p=o.node.getChild(ie.CodeInfo);p&&(O=u.read(p.from,p.to))}let h=a(O);if(h)return{parser:h,overlay:p=>p.type.id==ie.CodeText,bracketed:d==ie.FencedCode}}else if(s&&(d==ie.HTMLBlock||d==ie.HTMLTag||d==ie.CommentBlock))return{parser:s,overlay:zz(o.node,o.from,o.to)};return null})}}const Cz={resolve:"Strikethrough",mark:"StrikethroughMark"},Xz={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":A.strikethrough}},{name:"StrikethroughMark",style:A.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,a,s){if(a!=126||t.char(s+1)!=126||t.char(s+2)==126)return-1;let l=t.slice(s-1,s),o=t.slice(s+2,s+3),u=/\s|^$/.test(l),d=/\s|^$/.test(o),O=ci.test(l),h=ci.test(o);return t.addDelimiter(Cz,s,s+2,!d&&(!h||u||O),!u&&(!O||d||h))},after:"Emphasis"}]};function Kr(t,a,s=0,l,o=0){let u=0,d=!0,O=-1,h=-1,p=!1,x=()=>{l.push(t.elt("TableCell",o+O,o+h,t.parser.parseInline(a.slice(O,h),o+O)))};for(let g=s;g<a.length;g++){let b=a.charCodeAt(g);b==124&&!p?((!d||O>-1)&&u++,d=!1,l&&(O>-1&&x(),l.push(t.elt("TableDelimiter",g+o,g+o+1))),O=h=-1):(p||b!=32&&b!=9)&&(O<0&&(O=g),h=g+1),p=!p&&b==92}return O>-1&&(u++,l&&x()),u}function U1(t,a){for(let s=a;s<t.length;s++){let l=t.charCodeAt(s);if(l==124)return!0;l==92&&s++}return!1}const by=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class V1{constructor(){this.rows=null}nextLine(a,s,l){if(this.rows==null){this.rows=!1;let o;if((s.next==45||s.next==58||s.next==124)&&by.test(o=s.text.slice(s.pos))){let u=[];Kr(a,l.content,0,u,l.start)==Kr(a,o,s.pos)&&(this.rows=[a.elt("TableHeader",l.start,l.start+l.content.length,u),a.elt("TableDelimiter",a.lineStart+s.pos,a.lineStart+s.text.length)])}}else if(this.rows){let o=[];Kr(a,s.text,s.pos,o,a.lineStart),this.rows.push(a.elt("TableRow",a.lineStart+s.pos,a.lineStart+s.text.length,o))}return!1}finish(a,s){return this.rows?(a.addLeafElement(s,a.elt("Table",s.start,s.start+s.content.length,this.rows)),!0):!1}}const _z={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":A.heading}},"TableRow",{name:"TableCell",style:A.content},{name:"TableDelimiter",style:A.processingInstruction}],parseBlock:[{name:"Table",leaf(t,a){return U1(a.content,0)?new V1:null},endLeaf(t,a,s){if(s.parsers.some(o=>o instanceof V1)||!U1(a.text,a.basePos))return!1;let l=t.peekLine();return by.test(l)&&Kr(t,a.text,a.basePos)==Kr(t,l,a.basePos)},before:"SetextHeading"}]};class Zz{nextLine(){return!1}finish(a,s){return a.addLeafElement(s,a.elt("Task",s.start,s.start+s.content.length,[a.elt("TaskMarker",s.start,s.start+3),...a.parser.parseInline(s.content.slice(3),s.start+3)])),!0}}const Az={defineNodes:[{name:"Task",block:!0,style:A.list},{name:"TaskMarker",style:A.atom}],parseBlock:[{name:"TaskList",leaf(t,a){return/^\[[ xX]\][ \t]/.test(a.content)&&t.parentType().name=="ListItem"?new Zz:null},after:"SetextHeading"}]},G1=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,L1=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Ez=/[\w-]+\.[\w-]+($|\/)/,D1=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,W1=/\/[a-zA-Z\d@.]+/gy;function B1(t,a,s,l){let o=0;for(let u=a;u<s;u++)t[u]==l&&o++;return o}function qz(t,a){L1.lastIndex=a;let s=L1.exec(t);if(!s||Ez.exec(s[0])[0].indexOf("_")>-1)return-1;let l=a+s[0].length;for(;;){let o=t[l-1],u;if(/[?!.,:*_~]/.test(o)||o==")"&&B1(t,a,l,")")>B1(t,a,l,"("))l--;else if(o==";"&&(u=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(a,l))))l=a+u.index;else break}return l}function H1(t,a){D1.lastIndex=a;let s=D1.exec(t);if(!s)return-1;let l=s[0][s[0].length-1];return l=="_"||l=="-"?-1:a+s[0].length-(l=="."?1:0)}const Mz={parseInline:[{name:"Autolink",parse(t,a,s){let l=s-t.offset;if(l&&/\w/.test(t.text[l-1]))return-1;G1.lastIndex=l;let o=G1.exec(t.text),u=-1;if(!o)return-1;if(o[1]||o[2]){if(u=qz(t.text,l+o[0].length),u>-1&&t.hasOpenLink){let d=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(l,u));u=l+d[0].length}}else o[3]?u=H1(t.text,l):(u=H1(t.text,l+o[0].length),u>-1&&o[0]=="xmpp:"&&(W1.lastIndex=u,o=W1.exec(t.text),o&&(u=o.index+o[0].length)));return u<0?-1:(t.addElement(t.elt("URL",s,u+t.offset)),u+t.offset)}}]},Yz=[_z,Az,Xz,Mz];function vy(t,a,s){return(l,o,u)=>{if(o!=t||l.char(u+1)==t)return-1;let d=[l.elt(s,u,u+1)];for(let O=u+1;O<l.end;O++){let h=l.char(O);if(h==t)return l.addElement(l.elt(a,u,O+1,d.concat(l.elt(s,O,O+1))));if(h==92&&d.push(l.elt("Escape",O,O+++2)),cn(h))break}return-1}}const Uz={defineNodes:[{name:"Superscript",style:A.special(A.content)},{name:"SuperscriptMark",style:A.processingInstruction}],parseInline:[{name:"Superscript",parse:vy(94,"Superscript","SuperscriptMark")}]},Vz={defineNodes:[{name:"Subscript",style:A.special(A.content)},{name:"SubscriptMark",style:A.processingInstruction}],parseInline:[{name:"Subscript",parse:vy(126,"Subscript","SubscriptMark")}]},Gz={defineNodes:[{name:"Emoji",style:A.character}],parseInline:[{name:"Emoji",parse(t,a,s){let l;return a!=58||!(l=/^[a-zA-Z_0-9]+:/.exec(t.slice(s+1,t.end)))?-1:t.addElement(t.elt("Emoji",s,s+1+l[0].length))}}]},yy=R0({commentTokens:{block:{open:"<!--",close:"-->"}}}),Sy=new la,Qy=Pz.configure({props:[Cs.add(t=>!t.is("Block")||t.is("Document")||$f(t)!=null||Lz(t)?void 0:(a,s)=>({from:s.doc.lineAt(a.from).to,to:a.to})),Sy.add($f),Ul.add({Document:()=>null}),Ej.add({Document:yy})]});function $f(t){let a=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return a?+a[1]:void 0}function Lz(t){return t.name=="OrderedList"||t.name=="BulletList"}function Dz(t,a){let s=t;for(;;){let l=s.nextSibling,o;if(!l||(o=$f(l.type))!=null&&o<=a)break;s=l}return s.to}const Wz=Xj.of((t,a,s)=>{for(let l=gn(t).resolveInner(s,-1);l&&!(l.from<a);l=l.parent){let o=l.type.prop(Sy);if(o==null)continue;let u=Dz(l,o);if(u>s)return{from:s,to:u}}return null});function yh(t){return new _j(yy,t,[],"markdown")}const Bz=yh(Qy),Hz=Qy.configure([Yz,Vz,Uz,Gz,{props:[Cs.add({Table:(t,a)=>({from:a.doc.lineAt(t.from).to,to:t.to})})]}]),zc=yh(Hz);function Iz(t,a){return s=>{if(s&&t){let l=null;if(s=/\S*/.exec(s)[0],typeof t=="function"?l=t(s):l=Ng.matchLanguageName(t,s,!0),l instanceof Ng)return l.support?l.support.language.parser:qj.getSkippingParser(l.load());if(l)return l.parser}return a?a.parser:null}}let qO=class{constructor(a,s,l,o,u,d,O){this.node=a,this.from=s,this.to=l,this.spaceBefore=o,this.spaceAfter=u,this.type=d,this.item=O}blank(a,s=!0){let l=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(a!=null){for(;l.length<a;)l+=" ";return l}else{for(let o=this.to-this.from-l.length-this.spaceAfter.length;o>0;o--)l+=" ";return l+(s?this.spaceAfter:"")}}marker(a,s){let l=this.node.name=="OrderedList"?String(+wy(this.item,a)[2]+s):"";return this.spaceBefore+l+this.type+this.spaceAfter}};function jy(t,a){let s=[],l=[];for(let o=t;o;o=o.parent){if(o.name=="FencedCode")return l;(o.name=="ListItem"||o.name=="Blockquote")&&s.push(o)}for(let o=s.length-1;o>=0;o--){let u=s[o],d,O=a.lineAt(u.from),h=u.from-O.from;if(u.name=="Blockquote"&&(d=/^ *>( ?)/.exec(O.text.slice(h))))l.push(new qO(u,h,h+d[0].length,"",d[1],">",null));else if(u.name=="ListItem"&&u.parent.name=="OrderedList"&&(d=/^( *)\d+([.)])( *)/.exec(O.text.slice(h)))){let p=d[3],x=d[0].length;p.length>=4&&(p=p.slice(0,p.length-4),x-=4),l.push(new qO(u.parent,h,h+x,d[1],p,d[2],u))}else if(u.name=="ListItem"&&u.parent.name=="BulletList"&&(d=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(O.text.slice(h)))){let p=d[4],x=d[0].length;p.length>4&&(p=p.slice(0,p.length-4),x-=4);let g=d[2];d[3]&&(g+=d[3].replace(/[xX]/," ")),l.push(new qO(u.parent,h,h+x,d[1],p,g,u))}}return l}function wy(t,a){return/^(\s*)(\d+)(?=[.)])/.exec(a.sliceString(t.from,t.from+10))}function MO(t,a,s,l=0){for(let o=-1,u=t;;){if(u.name=="ListItem"){let O=wy(u,a),h=+O[2];if(o>=0){if(h!=o+1)return;s.push({from:u.from+O[1].length,to:u.from+O[0].length,insert:String(o+2+l)})}o=h}let d=u.nextSibling;if(!d)break;u=d}}function Sh(t,a){let s=/^[ \t]*/.exec(t)[0].length;if(!s||a.facet(Zj)!=" ")return t;let l=Jr(t,4,s),o="";for(let u=l;u>0;)u>=4?(o+=" ",u-=4):(o+=" ",u--);return o+t.slice(s)}const Fz=(t={})=>({state:a,dispatch:s})=>{let l=gn(a),{doc:o}=a,u=null,d=a.changeByRange(O=>{if(!O.empty||!zc.isActiveAt(a,O.from,-1)&&!zc.isActiveAt(a,O.from,1))return u={range:O};let h=O.from,p=o.lineAt(h),x=jy(l.resolveInner(h,-1),o);for(;x.length&&x[x.length-1].from>h-p.from;)x.pop();if(!x.length)return u={range:O};let g=x[x.length-1];if(g.to-g.spaceAfter.length>h-p.from)return u={range:O};let b=h>=g.to-g.spaceAfter.length&&!/\S/.test(p.text.slice(g.to));if(g.item&&b){let j=g.node.firstChild,z=g.node.getChild("ListItem","ListItem");if(j.to>=h||z&&z.to<h||p.from>0&&!/[^\s>]/.test(o.lineAt(p.from-1).text)||t.nonTightLists===!1){let N=x.length>1?x[x.length-2]:null,_,G="";N&&N.item?(_=p.from+N.from,G=N.marker(o,1)):_=p.from+(N?N.to:0);let R=[{from:_,to:h,insert:G}];return g.node.name=="OrderedList"&&MO(g.item,o,R,-2),N&&N.node.name=="OrderedList"&&MO(N.item,o,R),{range:Ha.cursor(_+G.length),changes:R}}else{let N=F1(x,a,p);return{range:Ha.cursor(h+N.length+1),changes:{from:p.from,insert:N+a.lineBreak}}}}if(g.node.name=="Blockquote"&&b&&p.from){let j=o.lineAt(p.from-1),z=/>\s*$/.exec(j.text);if(z&&z.index==g.from){let N=a.changes([{from:j.from+z.index,to:j.to},{from:p.from+g.from,to:p.to}]);return{range:O.map(N),changes:N}}}let y=[];g.node.name=="OrderedList"&&MO(g.item,o,y);let Q=g.item&&g.item.from<p.from,w="";if(!Q||/^[\s\d.)\-+*>]*/.exec(p.text)[0].length>=g.to)for(let j=0,z=x.length-1;j<=z;j++)w+=j==z&&!Q?x[j].marker(o,1):x[j].blank(j<z?Jr(p.text,4,x[j+1].from)-w.length:null);let $=h;for(;$>p.from&&/\s/.test(p.text.charAt($-p.from-1));)$--;return w=Sh(w,a),Jz(g.node,a.doc)&&(w=F1(x,a,p)+a.lineBreak+w),y.push({from:$,to:h,insert:a.lineBreak+w}),{range:Ha.cursor($+w.length+1),changes:y}});return u?!1:(s(a.update(d,{scrollIntoView:!0,userEvent:"input"})),!0)},Kz=Fz();function I1(t){return t.name=="QuoteMark"||t.name=="ListMark"}function Jz(t,a){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let s=t.firstChild,l=t.getChild("ListItem","ListItem");if(!l)return!1;let o=a.lineAt(s.to),u=a.lineAt(l.from),d=/^[\s>]*$/.test(o.text);return o.number+(d?0:1)<u.number}function F1(t,a,s){let l="";for(let o=0,u=t.length-2;o<=u;o++)l+=t[o].blank(o<u?Jr(s.text,4,t[o+1].from)-l.length:null,o<u);return Sh(l,a)}function eR(t,a){let s=t.resolveInner(a,-1),l=a;I1(s)&&(l=s.from,s=s.parent);for(let o;o=s.childBefore(l);)if(I1(o))l=o.from;else if(o.name=="OrderedList"||o.name=="BulletList")s=o.lastChild,l=s.to;else break;return s}const tR=({state:t,dispatch:a})=>{let s=gn(t),l=null,o=t.changeByRange(u=>{let d=u.from,{doc:O}=t;if(u.empty&&zc.isActiveAt(t,u.from)){let h=O.lineAt(d),p=jy(eR(s,d),O);if(p.length){let x=p[p.length-1],g=x.to-x.spaceAfter.length+(x.spaceAfter?1:0);if(d-h.from>g&&!/\S/.test(h.text.slice(g,d-h.from)))return{range:Ha.cursor(h.from+g),changes:{from:h.from+g,to:d}};if(d-h.from==g&&(!x.item||h.from<=x.item.from||!/\S/.test(h.text.slice(0,x.to)))){let b=h.from+x.from;if(x.item&&x.node.from<x.item.from&&/\S/.test(h.text.slice(x.from,x.to))){let y=x.blank(Jr(h.text,4,x.to)-Jr(h.text,4,x.from));return b==h.from&&(y=Sh(y,t)),{range:Ha.cursor(b+y.length),changes:{from:b,to:h.from+x.to,insert:y}}}if(b<d)return{range:Ha.cursor(b),changes:{from:b,to:d}}}}}return l={range:u}});return l?!1:(a(t.update(o,{scrollIntoView:!0,userEvent:"delete"})),!0)},nR=[{key:"Enter",run:Kz},{key:"Backspace",run:tR}],ky=Kv({matchClosingTags:!1});function aR(t={}){let{codeLanguages:a,defaultCodeLanguage:s,addKeymap:l=!0,base:{parser:o}=Bz,completeHTMLTags:u=!0,pasteURLAsLink:d=!0,htmlTagLanguage:O=ky}=t;if(!(o instanceof Hc))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let h=t.extensions?[t.extensions]:[],p=[O.support,Wz],x;d&&p.push(iR),s instanceof ks?(p.push(s.support),x=s.language):s&&(x=s);let g=a||x?Iz(a,x):void 0;h.push(Rz({codeParser:g,htmlParser:O.language.parser})),l&&p.push(Cj.high(lf.of(nR)));let b=yh(o.configure(h));return u&&p.push(b.data.of({autocomplete:sR})),new ks(b,p)}function sR(t){let{state:a,pos:s}=t,l=/<[:\-\.\w\u00b7-\uffff]*$/.exec(a.sliceDoc(s-25,s));if(!l)return null;let o=gn(a).resolveInner(s,-1);for(;o&&!o.type.isTop;){if(o.name=="CodeBlock"||o.name=="FencedCode"||o.name=="ProcessingInstructionBlock"||o.name=="CommentBlock"||o.name=="Link"||o.name=="Image")return null;o=o.parent}return{from:s-l[0].length,to:s,options:lR(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let YO=null;function lR(){if(YO)return YO;let t=dz(new Aj(X0.create({extensions:ky}),0,!0));return YO=t?t.options:[]}const rR=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,iR=Xl.domEventHandlers({paste:(t,a)=>{var s;let{main:l}=a.state.selection;if(l.empty)return!1;let o=(s=t.clipboardData)===null||s===void 0?void 0:s.getData("text/plain");if(!o||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(o)||(/^www\./.test(o)&&(o="https://"+o),!zc.isActiveAt(a.state,l.from,1)))return!1;let u=gn(a.state),d=!1;return u.iterate({from:l.from,to:l.to,enter:O=>{(O.from>l.from||rR.test(O.name))&&(d=!0)},leave:O=>{O.to<l.to&&(d=!0)}}),d?!1:(a.dispatch({changes:[{from:l.from,insert:"["},{from:l.to,insert:`](${o})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),oR=1,$y=194,Ty=195,cR=196,K1=197,uR=198,dR=199,OR=200,fR=2,Ny=3,J1=201,hR=24,mR=25,pR=49,xR=50,gR=55,bR=56,vR=57,yR=59,SR=60,QR=61,jR=62,wR=63,kR=65,$R=238,TR=71,NR=241,PR=242,zR=243,RR=244,CR=245,XR=246,_R=247,ZR=248,Py=72,AR=249,ER=250,qR=251,MR=252,YR=253,UR=254,VR=255,GR=256,LR=73,DR=77,WR=263,BR=112,HR=130,IR=151,FR=152,KR=155,Ps=10,ui=13,Qh=32,Ic=9,jh=35,JR=40,eC=46,Tf=123,e0=125,zy=39,Ry=34,t0=92,tC=111,nC=120,aC=78,sC=117,lC=85,rC=new Set([mR,pR,xR,WR,kR,HR,bR,vR,$R,jR,wR,Py,LR,DR,SR,QR,IR,FR,KR,BR]);function UO(t){return t==Ps||t==ui}function VO(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const iC=new gt((t,a)=>{let s;if(t.next<0)t.acceptToken(dR);else if(a.context.flags&rc)UO(t.next)&&t.acceptToken(uR,1);else if(((s=t.peek(-1))<0||UO(s))&&a.canShift(K1)){let l=0;for(;t.next==Qh||t.next==Ic;)t.advance(),l++;(t.next==Ps||t.next==ui||t.next==jh)&&t.acceptToken(K1,-l)}else UO(t.next)&&t.acceptToken(cR,1)},{contextual:!0}),oC=new gt((t,a)=>{let s=a.context;if(s.flags)return;let l=t.peek(-1);if(l==Ps||l==ui){let o=0,u=0;for(;;){if(t.next==Qh)o++;else if(t.next==Ic)o+=8-o%8;else break;t.advance(),u++}o!=s.indent&&t.next!=Ps&&t.next!=ui&&t.next!=jh&&(o<s.indent?t.acceptToken(Ty,-u):t.acceptToken($y))}}),rc=1,Cy=2,ea=4,ta=8,na=16,aa=32;function ic(t,a,s){this.parent=t,this.indent=a,this.flags=s,this.hash=(t?t.hash+t.hash<<8:0)+a+(a<<4)+s+(s<<6)}const cC=new ic(null,0,0);function uC(t){let a=0;for(let s=0;s<t.length;s++)a+=t.charCodeAt(s)==Ic?8-a%8:1;return a}const n0=new Map([[NR,0],[PR,ea],[zR,ta],[RR,ta|ea],[CR,na],[XR,na|ea],[_R,na|ta],[ZR,na|ta|ea],[AR,aa],[ER,aa|ea],[qR,aa|ta],[MR,aa|ta|ea],[YR,aa|na],[UR,aa|na|ea],[VR,aa|na|ta],[GR,aa|na|ta|ea]].map(([t,a])=>[t,a|Cy])),dC=new dh({start:cC,reduce(t,a,s,l){return t.flags&rc&&rC.has(a)||(a==TR||a==Py)&&t.flags&Cy?t.parent:t},shift(t,a,s,l){return a==$y?new ic(t,uC(l.read(l.pos,s.pos)),0):a==Ty?t.parent:a==hR||a==gR||a==yR||a==Ny?new ic(t,0,rc):n0.has(a)?new ic(t,0,n0.get(a)|t.flags&rc):t},hash(t){return t.hash}}),OC=new gt(t=>{for(let a=0;a<5;a++){if(t.next!="print".charCodeAt(a))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let a=0;;a++){let s=t.peek(a);if(!(s==Qh||s==Ic)){s!=JR&&s!=eC&&s!=Ps&&s!=ui&&s!=jh&&t.acceptToken(oR);return}}}),fC=new gt((t,a)=>{let{flags:s}=a.context,l=s&ea?Ry:zy,o=(s&ta)>0,u=!(s&na),d=(s&aa)>0,O=t.pos;for(;!(t.next<0);)if(d&&t.next==Tf)if(t.peek(1)==Tf)t.advance(2);else{if(t.pos==O){t.acceptToken(Ny,1);return}break}else if(u&&t.next==t0){if(t.pos==O){t.advance();let h=t.next;h>=0&&(t.advance(),hC(t,h)),t.acceptToken(fR);return}break}else if(t.next==t0&&!u&&t.peek(1)>-1)t.advance(2);else if(t.next==l&&(!o||t.peek(1)==l&&t.peek(2)==l)){if(t.pos==O){t.acceptToken(J1,o?3:1);return}break}else if(t.next==Ps){if(o)t.advance();else if(t.pos==O){t.acceptToken(J1);return}break}else t.advance();t.pos>O&&t.acceptToken(OR)});function hC(t,a){if(a==tC)for(let s=0;s<2&&t.next>=48&&t.next<=55;s++)t.advance();else if(a==nC)for(let s=0;s<2&&VO(t.next);s++)t.advance();else if(a==sC)for(let s=0;s<4&&VO(t.next);s++)t.advance();else if(a==lC)for(let s=0;s<8&&VO(t.next);s++)t.advance();else if(a==aC&&t.next==Tf){for(t.advance();t.next>=0&&t.next!=e0&&t.next!=zy&&t.next!=Ry&&t.next!=Ps;)t.advance();t.next==e0&&t.advance()}}const mC=Rs({'async "*" "**" FormatConversion FormatSpec':A.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":A.controlKeyword,"in not and or is del":A.operatorKeyword,"from def class global nonlocal lambda":A.definitionKeyword,import:A.moduleKeyword,"with as print":A.keyword,Boolean:A.bool,None:A.null,VariableName:A.variableName,"CallExpression/VariableName":A.function(A.variableName),"FunctionDefinition/VariableName":A.function(A.definition(A.variableName)),"ClassDefinition/VariableName":A.definition(A.className),PropertyName:A.propertyName,"CallExpression/MemberExpression/PropertyName":A.function(A.propertyName),Comment:A.lineComment,Number:A.number,String:A.string,FormatString:A.special(A.string),Escape:A.escape,UpdateOp:A.updateOperator,"ArithOp!":A.arithmeticOperator,BitOp:A.bitwiseOperator,CompareOp:A.compareOperator,AssignOp:A.definitionOperator,Ellipsis:A.punctuation,At:A.meta,"( )":A.paren,"[ ]":A.squareBracket,"{ }":A.brace,".":A.derefOperator,", ;":A.separator}),pC={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},xC=es.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQd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#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!Z!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:dC,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[mC],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^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T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[OC,oC,iC,fC,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>pC[t]||-1}],tokenPrec:7668}),a0=new Zf,Xy=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function Bo(t){return(a,s,l)=>{if(l)return!1;let o=a.node.getChild("VariableName");return o&&s(o,t),!0}}const gC={FunctionDefinition:Bo("function"),ClassDefinition:Bo("class"),ForStatement(t,a,s){if(s){for(let l=t.node.firstChild;l;l=l.nextSibling)if(l.name=="VariableName")a(l,"variable");else if(l.name=="in")break}},ImportStatement(t,a){var s,l;let{node:o}=t,u=((s=o.firstChild)===null||s===void 0?void 0:s.name)=="from";for(let d=o.getChild("import");d;d=d.nextSibling)d.name=="VariableName"&&((l=d.nextSibling)===null||l===void 0?void 0:l.name)!="as"&&a(d,u?"variable":"namespace")},AssignStatement(t,a){for(let s=t.node.firstChild;s;s=s.nextSibling)if(s.name=="VariableName")a(s,"variable");else if(s.name==":"||s.name=="AssignOp")break},ParamList(t,a){for(let s=null,l=t.node.firstChild;l;l=l.nextSibling)l.name=="VariableName"&&(!s||!/\*|AssignOp/.test(s.name))&&a(l,"variable"),s=l},CapturePattern:Bo("variable"),AsPattern:Bo("variable"),__proto__:null};function _y(t,a){let s=a0.get(a);if(s)return s;let l=[],o=!0;function u(d,O){let h=t.sliceString(d.from,d.to);l.push({label:h,type:O})}return a.cursor(Xc.IncludeAnonymous).iterate(d=>{if(d.name){let O=gC[d.name];if(O&&O(d,u,o)||!o&&Xy.has(d.name))return!1;o=!1}else if(d.to-d.from>8192){for(let O of _y(t,d.node))l.push(O);return!1}}),a0.set(a,l),l}const s0=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Zy=["String","FormatString","Comment","PropertyName"];function bC(t){let a=gn(t.state).resolveInner(t.pos,-1);if(Zy.indexOf(a.name)>-1)return null;let s=a.name=="VariableName"||a.to-a.from<20&&s0.test(t.state.sliceDoc(a.from,a.to));if(!s&&!t.explicit)return null;let l=[];for(let o=a;o;o=o.parent)Xy.has(o.name)&&(l=l.concat(_y(t.state.doc,o)));return{options:l,from:s?a.from:t.pos,validFor:s0}}const vC=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),yC=[Fe("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Fe("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Fe("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Fe("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Fe(`if \${}:
|
|
587
587
|
|
|
588
|
-
`,{label:"if",detail:"block",type:"keyword"}),Fe("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Fe("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Fe("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Fe("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],SC=N0(Zy,P0(vC.concat(yC)));function GO(t){let{node:a,pos:s}=t,l=t.lineIndent(s,-1),o=null;for(;;){let u=a.childBefore(s);if(u)if(u.name=="Comment")s=u.from;else if(u.name=="Body"||u.name=="MatchBody")t.baseIndentFor(u)+t.unit<=l&&(o=u),a=u;else if(u.name=="MatchClause")a=u;else if(u.type.is("Statement"))a=u;else break;else break}return o}function LO(t,a){let s=t.baseIndentFor(a),l=t.lineAt(t.pos,-1),o=l.from+l.text.length;return/^\s*($|#)/.test(l.text)&&t.node.to<o+100&&!/\S/.test(t.state.sliceDoc(o,t.node.to))&&t.lineIndent(t.pos,-1)<=s||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>s?null:s+t.unit}const DO=Oi.define({name:"python",parser:xC.configure({props:[Ul.add({Body:t=>{var a;let s=/^\s*(#|$)/.test(t.textAfter)&&GO(t)||t.node;return(a=LO(t,s))!==null&&a!==void 0?a:t.continue()},MatchBody:t=>{var a;let s=GO(t);return(a=LO(t,s||t.node))!==null&&a!==void 0?a:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":tc({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":tc({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":tc({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var a;let s=GO(t);return(a=s&&LO(t,s))!==null&&a!==void 0?a:t.continue()}}),Cs.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":_c,Body:(t,a)=>({from:t.from+1,to:t.to-(t.to==a.doc.length?0:1)}),"String FormatString":(t,a)=>({from:a.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function QC(){return new ks(DO,[DO.data.of({autocomplete:bC}),DO.data.of({autocomplete:SC})])}const Ho={javascript:()=>vf({jsx:!0,typescript:!1}),typescript:()=>vf({jsx:!0,typescript:!0}),css:()=>Cv(),html:()=>Kv(),json:()=>gz(),markdown:()=>aR(),python:()=>QC()},jC=Xl.theme({"&":{backgroundColor:"#24282f",color:"#bcc2cd",fontFamily:"var(--font-mono)",fontSize:"13px",height:"100%"},".cm-scroller":{overflow:"auto"},".cm-content":{caretColor:"#33afbc"},".cm-cursor":{borderLeftColor:"#33afbc"},".cm-gutters":{backgroundColor:"#24282f",borderRight:"1px solid #2c313a",color:"#505862"},".cm-activeLineGutter":{backgroundColor:"#2c313a"},".cm-activeLine":{backgroundColor:"rgba(44, 49, 58, 0.5)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"}},{dark:!0});function l0({content:t,language:a,onChange:s,onSave:l}){const o=v.useRef(null),u=v.useRef(null),d=v.useRef(new Mj),O=v.useRef(s),h=v.useRef(l);return O.current=s,h.current=l,v.useEffect(()=>{if(!o.current)return;const p=Ho[a]||Ho.javascript,x=lf.of([{key:"Mod-s",run:()=>{var y;return(y=h.current)==null||y.call(h),!0}}]),g=X0.create({doc:t||"",extensions:[Uj(),Vj(),Gj(),Lj(),Dj(),Wj(),Bj(),lf.of([...Hj,...Ij,...Fj]),x,Yj,jC,d.current.of(p()),Xl.updateListener.of(y=>{var Q;y.docChanged&&((Q=O.current)==null||Q.call(O,y.state.doc.toString()))})]}),b=new Xl({state:g,parent:o.current});return u.current=b,()=>{b.destroy(),u.current=null}},[]),v.useEffect(()=>{const p=u.current;if(!p)return;const x=p.state.doc.toString();t!==x&&p.dispatch({changes:{from:0,to:x.length,insert:t||""}})},[t]),v.useEffect(()=>{const p=u.current;if(!p)return;const x=Ho[a]||Ho.javascript;p.dispatch({effects:d.current.reconfigure(x())})},[a]),r.jsx("div",{ref:o,className:"w-full h-full overflow-hidden"})}const wC=["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"],Ay=["mp4","webm","mov","avi","mkv","ogv"];function kC(t){var s;const a=(s=t.split(".").pop())==null?void 0:s.toLowerCase();return wC.includes(a)||Ay.includes(a)}function $C({path:t}){var u;const a=(u=t.split(".").pop())==null?void 0:u.toLowerCase(),s=`/api/files/raw?path=${encodeURIComponent(t)}`,l=t.split("/").pop(),o=Ay.includes(a);return r.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-surface-0 p-8 gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-3 font-sans",children:[r.jsx(Xe,{children:a==null?void 0:a.toUpperCase()}),r.jsx("span",{className:"font-mono",children:l}),r.jsx("a",{href:s,target:"_blank",rel:"noopener",className:"text-accent hover:text-accent/80 transition-colors",children:r.jsx(bc,{size:12})})]}),o?r.jsx("video",{src:s,controls:!0,className:"max-w-full max-h-[70vh] rounded-md border border-border"}):r.jsx("img",{src:s,alt:l,className:"max-w-full max-h-[70vh] rounded-md border border-border object-contain"})]})}function TC(t){var s;const a=(s=t==null?void 0:t.split(".").pop())==null?void 0:s.toLowerCase();return a==="html"||a==="htm"}function NC(){const t=D(j=>j.editorActiveFile),a=D(j=>j.editorFiles),s=D(j=>j.editorChangedFiles),l=D(j=>j.updateFileContent),o=D(j=>j.saveFile),u=D(j=>j.reloadFile),d=D(j=>j.dismissFileChange),[O,h]=v.useState(""),[p,x]=v.useState(!1),[g,b]=v.useState(0);v.useEffect(()=>{J.get("/files/root").then(j=>h(j.root||"")).catch(()=>{})},[]),v.useEffect(()=>{x(!1)},[t]);const y=t?a[t]:null,Q=t&&kC(t),w=t&&TC(t),$=t&&s[t];return r.jsxs("div",{className:"flex h-full",children:[r.jsx("div",{className:"w-60 flex-shrink-0 border-r border-border",children:r.jsx(WP,{rootDir:O})}),r.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[r.jsx(BP,{}),r.jsxs("div",{className:"flex-1 relative min-h-0",children:[$&&r.jsxs("div",{className:"absolute top-0 left-0 right-0 z-10 flex items-center gap-2 px-4 py-2 bg-warning/10 border-b border-warning/20",children:[r.jsx(gi,{size:14,className:"text-warning"}),r.jsx("span",{className:"text-xs text-warning font-sans flex-1",children:"File modified externally"}),r.jsxs(ve,{variant:"ghost",size:"sm",onClick:()=>u(t),children:[r.jsx(zn,{size:12})," Reload"]}),r.jsxs(ve,{variant:"ghost",size:"sm",onClick:()=>d(t),children:[r.jsx(Qt,{size:12})," Dismiss"]})]}),!t&&r.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans",children:r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx(ns,{size:32,className:"mx-auto"}),r.jsx("p",{className:"text-sm",children:"Open a file from the tree"})]})}),t&&Q&&r.jsx($C,{path:t}),t&&!Q&&w&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"absolute top-0 right-4 z-10 flex items-center gap-0.5 mt-2 bg-surface-2 border border-border-subtle rounded-md p-0.5",children:[r.jsxs("button",{onClick:()=>x(!1),className:re("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",p?"text-text-3 hover:text-text-1":"bg-surface-4 text-text-0 font-medium"),children:[r.jsx(aT,{size:12})," Code"]}),r.jsxs("button",{onClick:()=>{x(!0),b(j=>j+1)},className:re("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",p?"bg-surface-4 text-text-0 font-medium":"text-text-3 hover:text-text-1"),children:[r.jsx(Dl,{size:12})," Preview"]})]}),p?r.jsx("iframe",{src:`/api/files/raw?path=${encodeURIComponent(t)}`,className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin",title:"HTML Preview"},g):y&&r.jsx(l0,{content:y.content,language:y.language,onChange:j=>l(t,j),onSave:()=>o(t)})]}),t&&!Q&&!w&&y&&r.jsx(l0,{content:y.content,language:y.language,onChange:j=>l(t,j),onSave:()=>o(t)})]})]})]})}function PC(){var w;const t=D($=>$.connected),a=D($=>$.agents),[s,l]=v.useState(null),[o,u]=v.useState(!0),[d,O]=v.useState({tokens:[],cost:[],saved:[],efficiency:[],cache:[],inputOutput:[],agents:[],turns:[]}),h=v.useRef(0);v.useEffect(()=>{if(!t)return;let $=!0;async function j(){try{const N=await J.get("/dashboard");if(!$)return;l(N),u(!1),h.current=Date.now(),O(_=>{var F,se,oe,H,P,W,E,ce,ee;const G=Date.now(),R=(be,Se)=>[...be.slice(-59),{t:G,v:Se||0}],X=((F=N.tokens)==null?void 0:F.totalTokens)||0,T=((oe=(se=N.tokens)==null?void 0:se.savings)==null?void 0:oe.total)||0,V=X+T,M=((H=N.tokens)==null?void 0:H.totalInputTokens)||0,ae=((P=N.tokens)==null?void 0:P.totalOutputTokens)||0;return{tokens:R(_.tokens,X),cost:R(_.cost,(W=N.tokens)==null?void 0:W.totalCostUsd),saved:R(_.saved,T),efficiency:R(_.efficiency,V>0?T/V*100:0),cache:R(_.cache,(E=N.tokens)==null?void 0:E.cacheHitRate),inputOutput:R(_.inputOutput,ae>0?M/ae:0),agents:R(_.agents,((ce=N.agents)==null?void 0:ce.running)||0),turns:R(_.turns,(ee=N.tokens)==null?void 0:ee.totalTurns)}})}catch{$&&u(!1)}}j();const z=setInterval(j,4e3);return()=>{$=!1,clearInterval(z)}},[t]);const p=((w=s==null?void 0:s.agents)==null?void 0:w.breakdown)||[],x=(s==null?void 0:s.routing)||null,g=(s==null?void 0:s.rotation)||null,b=(s==null?void 0:s.adaptive)||[],y=(s==null?void 0:s.journalist)||null,Q=(g==null?void 0:g.rotating)||[];return{data:s,loading:o,agents:a,connected:t,kpiHistory:d,lastFetch:h.current,agentBreakdown:p,routing:x,rotation:g,adaptive:b,journalist:y,rotating:Q}}const r0=v.memo(function({connected:a,runningCount:s,totalCount:l,uptime:o,lastFetch:u,activeTeam:d}){return r.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-surface-1 border-b border-border",children:[r.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Command Center"}),d&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-text-4",children:"/"}),r.jsx("span",{className:"text-xs font-mono text-text-2",children:d.name})]}),r.jsx("div",{className:"flex-1"}),a&&r.jsxs("div",{className:"flex items-center gap-3.5 text-xs font-mono text-text-2",children:[r.jsxs("span",{children:[r.jsx("span",{className:"text-text-1",children:s}),r.jsxs("span",{className:"text-text-3",children:["/",l]}),r.jsx("span",{className:"ml-1 text-text-3",children:"agents"})]}),o>0&&r.jsxs("span",{className:"text-text-3",children:["Up ",Dc(o)]}),u>0&&r.jsxs("span",{className:"flex items-center gap-1 text-text-4",children:[r.jsx(zn,{size:9}),r.jsx("span",{children:vt(u)})]})]}),r.jsx(Ts,{status:a?"running":"crashed",size:"sm"})]})});function ln(t,a){const s=parseInt(t.slice(1,3),16),l=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${s},${l},${o},${a})`}const xe={surface0:"#1a1e25",surface4:"#2c313a",surface5:"#333842",text0:"#e6e6e6",text1:"#bcc2cd",text2:"#8b929e",text3:"#6e7681",text4:"#505862",accent:"#33afbc",success:"#4ae168",warning:"#e5c07b",danger:"#e06c75",info:"#61afef",purple:"#c678dd",orange:"#d19a66"};function zC({data:t,color:a=xe.accent,width:s=72,height:l=22}){if(!t||t.length<2)return r.jsx("div",{style:{width:s,height:l}});const o=t.map(x=>x.v),u=Math.min(...o),O=Math.max(...o)-u||1,h=t.map((x,g)=>{const b=g/(t.length-1)*s,y=l-(x.v-u)/O*(l-2)-1;return`${b},${y}`}).join(" "),p=`kpi-${a.replace("#","")}`;return r.jsxs("svg",{width:s,height:l,className:"flex-shrink-0",children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:"0.2"}),r.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:"0"})]})}),r.jsx("polygon",{points:`0,${l} ${h} ${s},${l}`,fill:`url(#${p})`}),r.jsx("polyline",{points:h,fill:"none",stroke:a,strokeWidth:"1.5",strokeLinejoin:"round",strokeOpacity:"0.8"})]})}const RC=v.memo(function({label:a,value:s,sparkData:l,color:o=xe.accent,className:u}){return r.jsxs("div",{className:re("flex items-center gap-2.5 px-3 py-2.5 min-w-0","bg-surface-1",u),children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5 truncate",children:a}),r.jsx("div",{className:"text-base font-semibold font-mono text-text-0 tabular-nums leading-none",children:s})]}),r.jsx(zC,{data:l,color:o})]})});function CC({kpis:t}){return r.jsx("div",{className:"flex flex-wrap border-b border-border",style:{background:"var(--color-surface-0)"},children:t.map(a=>r.jsx(RC,{label:a.label,value:a.value,sparkData:a.sparkData,color:a.color,className:re("flex-1 basis-[12.5%] min-w-[140px]","border-b border-r border-border")},a.label))})}const XC={actual:"ACT",estimated:"EST",local:"LOC"},_C=v.memo(function({agent:a,isRotating:s}){const l=a.status==="running"||a.status==="starting",o=Math.round((a.contextUsage||0)*100),u=s?"#c678dd":rh(a.status),d=a.quality,O=(d==null?void 0:d.toolSuccessRate)!=null?Math.round(d.toolSuccessRate*100):null,h=a.rotationThreshold?Math.round(a.rotationThreshold*100):null;return r.jsxs("div",{className:"px-3 py-2 hover:bg-surface-3 transition-colors space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[r.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:u}}),l&&r.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:u,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate leading-none",children:a.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:a.role}),r.jsx("span",{className:"text-2xs text-text-4",children:"/"}),r.jsx("span",{className:"text-2xs font-mono text-text-3",children:ZC(a.model)})]})]}),r.jsx("div",{className:"flex-1"}),O!=null&&r.jsxs("span",{className:"text-2xs font-mono font-bold uppercase px-1 py-px rounded-sm flex-shrink-0",style:{color:O>=90?"#4ae168":O>=70?"#e5c07b":"#e06c75",background:O>=90?"rgba(74,225,104,0.1)":O>=70?"rgba(229,192,123,0.1)":"rgba(224,108,117,0.1)"},children:[O,"%"]}),a.costSource&&a.costSource!=="actual"&&r.jsx("span",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider flex-shrink-0",children:XC[a.costSource]||""}),r.jsxs("div",{className:"text-right flex-shrink-0",children:[r.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums leading-none",children:et(a.tokens||0)}),(a.costUsd||0)>0&&r.jsx("div",{className:"text-2xs font-mono text-text-3 mt-0.5",children:Lc(a.costUsd)})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"relative flex-1 h-[3px] bg-surface-4 rounded-full overflow-visible",children:[r.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full transition-all duration-700",style:{width:`${Math.max(o,1)}%`,background:o>80?"#e06c75":o>60?"#e5c07b":l?"#61afef":"#333842"}}),h&&r.jsx("div",{className:"absolute top-[-2px] w-px h-[7px]",style:{left:`${h}%`,background:"#c678dd"},title:`Rotation at ${h}%`})]}),r.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums flex-shrink-0 w-7 text-right",children:[o,"%"]})]})]})});function ZC(t){if(!t||t==="auto"||t==="default")return"default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gem ").replace("-preview",""):t.length>12?t.slice(0,12)+"...":t}const AC=v.memo(function({agentBreakdown:a,rotating:s=[]}){if(!(a!=null&&a.length))return r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"No agents"});const l={};for(const u of a){const d=u.teamId||"ungrouped";l[d]||(l[d]=[]),l[d].push(u)}const o=new Set(s);return r.jsx(fa,{className:"flex-1",children:r.jsx("div",{className:"py-1",children:Object.entries(l).map(([u,d])=>r.jsxs("div",{children:[r.jsx("div",{className:"px-3 pt-2 pb-1",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:u})}),d.map(O=>r.jsx(_C,{agent:O,isRotating:o.has(O.id)},O.id))]},u))})})}),EC=v.memo(function({data:a}){const s=v.useRef(null),l=v.useRef(null),[o,u]=v.useState({width:0,height:0}),[d,O]=v.useState(null),{width:h,height:p}=o,x={top:28,right:12,bottom:8,left:12},g=Math.max(h-x.left-x.right,0),b=Math.max(p-x.top-x.bottom,0),y=v.useMemo(()=>!a||a.length<2?[]:a.slice(1).map(($,j)=>{const z=a[j],N=($.t-z.t)/6e4,_=Math.max(($.tokens||0)-(z.tokens||0),0);return{burnRate:N>0?Math.round(_/N):0,cacheHitRate:$.cacheHitRate||0,running:$.running||0,agents:$.agents||0,t:$.t}}),[a]);v.useEffect(()=>{const $=s.current;if(!$)return;const j=new ResizeObserver(z=>{const{width:N,height:_}=z[0].contentRect;N>0&&_>0&&u({width:Math.floor(N),height:Math.floor(_)})});return j.observe($),()=>j.disconnect()},[]);const Q=v.useCallback($=>{const j=l.current;if(!j||!y.length||g<=0)return;const z=j.getBoundingClientRect(),N=$.clientX-z.left-x.left;if(N<0||N>g){O(null);return}const _=Math.round(N/g*(y.length-1));O({x:x.left+_/Math.max(y.length-1,1)*g,index:_})},[y,g,x.left]),w=v.useCallback(()=>O(null),[]);return v.useEffect(()=>{const $=l.current;if(!$||!y.length||h<=0||p<=0||g<=0||b<=0)return;const j=$.getContext("2d"),z=window.devicePixelRatio||1;$.width=h*z,$.height=p*z,j.scale(z,z),j.clearRect(0,0,h,p);const N=y.map(P=>P.burnRate),_=y.map(P=>P.cacheHitRate),G=y.map(P=>P.running),R=Math.max(...N,100),X=Math.max(...G,1),T=P=>x.left+P/Math.max(y.length-1,1)*g,V=P=>x.top+b-P/R*b,M=P=>x.top+b-P*b,ae=Math.max(g/y.length-1,2);for(let P=0;P<y.length;P++){const W=G[P];if(W<=0)continue;const E=W/X*b*.3,ce=T(P)-ae/2,ee=x.top+b-E;j.fillStyle=ln(xe.surface5,.5),j.fillRect(ce,ee,ae,E)}j.setLineDash([2,4]),j.strokeStyle=ln(xe.text4,.2),j.lineWidth=1;for(let P=1;P<=3;P++){const W=x.top+b/4*P;j.beginPath(),j.moveTo(x.left,W),j.lineTo(x.left+g,W),j.stroke()}j.setLineDash([]),j.font="9px 'JetBrains Mono Variable', monospace",j.textAlign="left",j.fillStyle=ln(xe.text3,.5),j.fillText(`${et(R)}/m`,x.left+4,x.top+10),j.fillText(`${et(Math.round(R/2))}/m`,x.left+4,x.top+b/2+4),j.beginPath(),j.moveTo(x.left,x.top+b);for(let P=0;P<y.length;P++)j.lineTo(T(P),V(N[P]));j.lineTo(T(y.length-1),x.top+b),j.closePath();const F=j.createLinearGradient(0,x.top,0,x.top+b);F.addColorStop(0,ln(xe.accent,.2)),F.addColorStop(.7,ln(xe.accent,.04)),F.addColorStop(1,ln(xe.accent,0)),j.fillStyle=F,j.fill(),j.beginPath(),j.strokeStyle=xe.accent,j.lineWidth=1.5,j.lineJoin="round";for(let P=0;P<y.length;P++){const W=T(P),E=V(N[P]);P===0?j.moveTo(W,E):j.lineTo(W,E)}j.stroke();const se=_.some(P=>P>0);if(se){j.beginPath(),j.strokeStyle=ln(xe.info,.45),j.lineWidth=1,j.lineJoin="round",j.setLineDash([2,3]);for(let P=0;P<y.length;P++){const W=T(P),E=M(_[P]);P===0?j.moveTo(W,E):j.lineTo(W,E)}j.stroke(),j.setLineDash([])}j.font="9px 'Inter Variable', sans-serif",j.textAlign="right";let oe=h-x.right-4;const H=14;if(se&&(j.fillStyle=ln(xe.info,.5),j.fillText("Cache %",oe,H),oe-=j.measureText("Cache %").width+4,j.beginPath(),j.arc(oe,H-3,2.5,0,Math.PI*2),j.fill(),oe-=14),j.fillStyle=ln(xe.surface5,.7),j.fillText("Agents",oe,H),oe-=j.measureText("Agents").width+4,j.beginPath(),j.arc(oe,H-3,2.5,0,Math.PI*2),j.fill(),oe-=14,j.fillStyle=xe.accent,j.fillText("Burn Rate",oe,H),oe-=j.measureText("Burn Rate").width+4,j.beginPath(),j.arc(oe,H-3,2.5,0,Math.PI*2),j.fill(),d&&d.index>=0&&d.index<y.length){const P=d.x,W=y[d.index];j.beginPath(),j.moveTo(P,x.top),j.lineTo(P,x.top+b),j.strokeStyle=ln(xe.text1,.15),j.lineWidth=1,j.stroke();const E=V(W.burnRate);j.beginPath(),j.arc(P,E,3,0,Math.PI*2),j.fillStyle=xe.accent,j.fill();const ce=[{label:"Burn",value:`${et(W.burnRate)}/m`,color:xe.accent},{label:"Cache",value:Ns(W.cacheHitRate*100),color:xe.info},{label:"Agents",value:`${W.running}/${W.agents}`,color:xe.text2}],ee=104,be=ce.length*16+12;let Se=P+12;Se+ee>h-8&&(Se=P-ee-12);const ye=Math.max(x.top,E-be/2);j.fillStyle=ln(xe.surface0,.92),j.beginPath(),j.roundRect(Se,ye,ee,be,4),j.fill(),j.strokeStyle=ln(xe.text4,.2),j.lineWidth=1,j.stroke(),j.textAlign="left",ce.forEach((Re,B)=>{const ue=ye+14+B*16;j.beginPath(),j.arc(Se+8,ue-3,2,0,Math.PI*2),j.fillStyle=Re.color,j.fill(),j.font="8px 'Inter Variable', sans-serif",j.fillStyle=xe.text3,j.fillText(Re.label,Se+14,ue),j.font="9px 'JetBrains Mono Variable', monospace",j.fillStyle=xe.text0,j.textAlign="right",j.fillText(Re.value,Se+ee-8,ue),j.textAlign="left"})}},[y,h,p,d,g,b,x]),r.jsx("div",{ref:s,className:"absolute inset-0",children:h>0&&p>0&&r.jsx("canvas",{ref:l,style:{width:h,height:p},className:"block cursor-crosshair",onMouseMove:Q,onMouseLeave:w})})}),qC=v.memo(function({cacheRead:a=0,cacheCreation:s=0,totalInput:l=0,size:o=140}){const u=v.useRef(null),d=a+s+l,O=d>0?a/d*100:0;return v.useEffect(()=>{const h=u.current;if(!h)return;const p=window.devicePixelRatio||1;h.width=o*p,h.height=o*p;const x=h.getContext("2d");x.scale(p,p),x.clearRect(0,0,o,o);const g=o/2,b=o/2,y=(o-12)/2,Q=5,w=135*Math.PI/180,$=405*Math.PI/180,j=$-w;if(x.beginPath(),x.arc(g,b,y,w,$),x.strokeStyle=xe.surface4,x.lineWidth=Q,x.lineCap="round",x.stroke(),d>0){const z=a/d,N=s/d;if(z>0){const _=w+j*z;x.beginPath(),x.arc(g,b,y,w,_),x.strokeStyle=xe.accent,x.lineWidth=Q,x.lineCap="round",x.stroke()}if(N>0){const _=w+j*z,G=_+j*N;x.beginPath(),x.arc(g,b,y,_,G),x.strokeStyle=xe.purple,x.lineWidth=Q,x.lineCap="butt",x.stroke()}}x.textAlign="center",x.textBaseline="middle",x.font=`600 ${o*.2}px 'JetBrains Mono Variable', monospace`,x.fillStyle=xe.text0,x.fillText(`${Math.round(O)}%`,g,b-3),x.font=`500 ${o*.08}px 'JetBrains Mono Variable', monospace`,x.fillStyle=xe.text3,x.fillText("CACHE",g,b+o*.13)},[a,s,l,o,d,O]),r.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-3 py-3",children:[r.jsx("canvas",{ref:u,className:"flex-shrink-0",style:{width:o,height:o}}),r.jsxs("div",{className:"w-full mt-3 space-y-1.5 max-w-[160px]",children:[r.jsx(WO,{color:xe.accent,label:"Read",value:et(a)}),r.jsx(WO,{color:xe.purple,label:"Create",value:et(s)}),r.jsx(WO,{color:xe.surface5,label:"Miss",value:et(Math.max(l-a-s,0))})]})]})});function WO({color:t,label:a,value:s}){return r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:t}}),r.jsx("span",{className:"text-text-3 uppercase tracking-wider flex-1",children:a}),r.jsx("span",{className:"text-text-1 tabular-nums",children:s})]})}const i0={heavy:xe.danger,medium:xe.warning,light:xe.success},o0={heavy:"Heavy",medium:"Medium",light:"Light"},MC=v.memo(function({routing:a,agentBreakdown:s}){if(!a)return null;const{byTier:l={},totalDecisions:o=0,autoRoutedCount:u=0}=a,d=["heavy","medium","light"],O=d.reduce((g,b)=>g+(l[b]||0),0),h={};for(const g of s||[]){const b=g.model||"default";h[b]||(h[b]={tokens:0,agents:0}),h[b].tokens+=g.tokens||0,h[b].agents+=1}const p=Object.entries(h).sort((g,b)=>b[1].tokens-g[1].tokens),x=p.length>0?p[0][1].tokens:0;return r.jsxs("div",{className:"flex flex-col h-full px-3 py-3 overflow-y-auto",children:[O>0&&r.jsxs("div",{className:"space-y-1.5 mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Tier Distribution"}),r.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto tabular-nums",children:[et(O)," decisions"]})]}),r.jsx("div",{className:"h-[6px] bg-surface-4 rounded-full overflow-hidden flex",children:d.map(g=>{const b=l[g]||0;if(b===0)return null;const y=b/O*100;return r.jsx("div",{className:"h-full transition-all duration-500",style:{width:`${y}%`,background:i0[g]},title:`${o0[g]}: ${b} (${Math.round(y)}%)`},g)})}),r.jsx("div",{className:"flex items-center gap-3",children:d.map(g=>{const b=l[g]||0;if(b===0)return null;const y=O>0?b/O*100:0;return r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:i0[g]}}),r.jsx("span",{className:"text-2xs font-mono text-text-2",children:o0[g]}),r.jsx("span",{className:"text-2xs font-mono text-text-4 tabular-nums",children:Ns(y)})]},g)})})]}),p.length>0&&r.jsxs("div",{className:"space-y-1.5 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Models in Use"}),u>0&&r.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto",children:[u," auto"]})]}),r.jsx("div",{className:"space-y-1.5",children:p.map(([g,b])=>{const y=x>0?b.tokens/x*100:0;return r.jsxs("div",{className:"space-y-0.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs font-mono text-text-1 flex-1 truncate",children:YC(g)}),r.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[b.agents," agent",b.agents!==1?"s":""]}),r.jsx("span",{className:"text-xs font-mono text-text-1 tabular-nums",children:et(b.tokens)})]}),r.jsx("div",{className:"h-[3px] bg-surface-4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(y,2)}%`,background:xe.accent}})})]},g)})})]}),O===0&&p.length===0&&r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono",children:"No routing data"})]})});function YC(t){if(!t||t==="auto"||t==="default")return"Default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gemini ").replace("-preview",""):t}function UC(t){const a=t+"CollectionProvider",[s,l]=Xs(a),[o,u]=s(a,{collectionRef:{current:null},itemMap:new Map}),d=w=>{const{scope:$,children:j}=w,z=Ga.useRef(null),N=Ga.useRef(new Map).current;return r.jsx(o,{scope:$,itemMap:N,collectionRef:z,children:j})};d.displayName=a;const O=t+"CollectionSlot",h=uc(O),p=Ga.forwardRef((w,$)=>{const{scope:j,children:z}=w,N=u(O,j),_=it($,N.collectionRef);return r.jsx(h,{ref:_,children:z})});p.displayName=O;const x=t+"CollectionItemSlot",g="data-radix-collection-item",b=uc(x),y=Ga.forwardRef((w,$)=>{const{scope:j,children:z,...N}=w,_=Ga.useRef(null),G=it($,_),R=u(x,j);return Ga.useEffect(()=>(R.itemMap.set(_,{ref:_,...N}),()=>void R.itemMap.delete(_))),r.jsx(b,{[g]:"",ref:G,children:z})});y.displayName=x;function Q(w){const $=u(t+"CollectionConsumer",w);return Ga.useCallback(()=>{const z=$.collectionRef.current;if(!z)return[];const N=Array.from(z.querySelectorAll(`[${g}]`));return Array.from($.itemMap.values()).sort((R,X)=>N.indexOf(R.ref.current)-N.indexOf(X.ref.current))},[$.collectionRef,$.itemMap])}return[{Provider:d,Slot:p,ItemSlot:y},Q,l]}var BO="rovingFocusGroup.onEntryFocus",VC={bubbles:!1,cancelable:!0},vi="RovingFocusGroup",[Nf,Ey,GC]=UC(vi),[LC,qy]=Xs(vi,[GC]),[DC,WC]=LC(vi),My=v.forwardRef((t,a)=>r.jsx(Nf.Provider,{scope:t.__scopeRovingFocusGroup,children:r.jsx(Nf.Slot,{scope:t.__scopeRovingFocusGroup,children:r.jsx(BC,{...t,ref:a})})}));My.displayName=vi;var BC=v.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:s,orientation:l,loop:o=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:O,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...g}=t,b=v.useRef(null),y=it(a,b),Q=ih(u),[w,$]=Mc({prop:d,defaultProp:O??null,onChange:h,caller:vi}),[j,z]=v.useState(!1),N=zt(p),_=Ey(s),G=v.useRef(!1),[R,X]=v.useState(0);return v.useEffect(()=>{const T=b.current;if(T)return T.addEventListener(BO,N),()=>T.removeEventListener(BO,N)},[N]),r.jsx(DC,{scope:s,orientation:l,dir:Q,loop:o,currentTabStopId:w,onItemFocus:v.useCallback(T=>$(T),[$]),onItemShiftTab:v.useCallback(()=>z(!0),[]),onFocusableItemAdd:v.useCallback(()=>X(T=>T+1),[]),onFocusableItemRemove:v.useCallback(()=>X(T=>T-1),[]),children:r.jsx(Be.div,{tabIndex:j||R===0?-1:0,"data-orientation":l,...g,ref:y,style:{outline:"none",...t.style},onMouseDown:qe(t.onMouseDown,()=>{G.current=!0}),onFocus:qe(t.onFocus,T=>{const V=!G.current;if(T.target===T.currentTarget&&V&&!j){const M=new CustomEvent(BO,VC);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const ae=_().filter(P=>P.focusable),F=ae.find(P=>P.active),se=ae.find(P=>P.id===w),H=[F,se,...ae].filter(Boolean).map(P=>P.ref.current);Vy(H,x)}}G.current=!1}),onBlur:qe(t.onBlur,()=>z(!1))})})}),Yy="RovingFocusGroupItem",Uy=v.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:s,focusable:l=!0,active:o=!1,tabStopId:u,children:d,...O}=t,h=Tl(),p=u||h,x=WC(Yy,s),g=x.currentTabStopId===p,b=Ey(s),{onFocusableItemAdd:y,onFocusableItemRemove:Q,currentTabStopId:w}=x;return v.useEffect(()=>{if(l)return y(),()=>Q()},[l,y,Q]),r.jsx(Nf.ItemSlot,{scope:s,id:p,focusable:l,active:o,children:r.jsx(Be.span,{tabIndex:g?0:-1,"data-orientation":x.orientation,...O,ref:a,onMouseDown:qe(t.onMouseDown,$=>{l?x.onItemFocus(p):$.preventDefault()}),onFocus:qe(t.onFocus,()=>x.onItemFocus(p)),onKeyDown:qe(t.onKeyDown,$=>{if($.key==="Tab"&&$.shiftKey){x.onItemShiftTab();return}if($.target!==$.currentTarget)return;const j=FC($,x.orientation,x.dir);if(j!==void 0){if($.metaKey||$.ctrlKey||$.altKey||$.shiftKey)return;$.preventDefault();let N=b().filter(_=>_.focusable).map(_=>_.ref.current);if(j==="last")N.reverse();else if(j==="prev"||j==="next"){j==="prev"&&N.reverse();const _=N.indexOf($.currentTarget);N=x.loop?KC(N,_+1):N.slice(_+1)}setTimeout(()=>Vy(N))}}),children:typeof d=="function"?d({isCurrentTabStop:g,hasTabStop:w!=null}):d})})});Uy.displayName=Yy;var HC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IC(t,a){return a!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function FC(t,a,s){const l=IC(t.key,s);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return HC[l]}function Vy(t,a=!1){const s=document.activeElement;for(const l of t)if(l===s||(l.focus({preventScroll:a}),document.activeElement!==s))return}function KC(t,a){return t.map((s,l)=>t[(a+l)%t.length])}var JC=My,eX=Uy,Fc="Tabs",[tX]=Xs(Fc,[qy]),Gy=qy(),[nX,wh]=tX(Fc),Ly=v.forwardRef((t,a)=>{const{__scopeTabs:s,value:l,onValueChange:o,defaultValue:u,orientation:d="horizontal",dir:O,activationMode:h="automatic",...p}=t,x=ih(O),[g,b]=Mc({prop:l,onChange:o,defaultProp:u??"",caller:Fc});return r.jsx(nX,{scope:s,baseId:Tl(),value:g,onValueChange:b,orientation:d,dir:x,activationMode:h,children:r.jsx(Be.div,{dir:x,"data-orientation":d,...p,ref:a})})});Ly.displayName=Fc;var Dy="TabsList",Wy=v.forwardRef((t,a)=>{const{__scopeTabs:s,loop:l=!0,...o}=t,u=wh(Dy,s),d=Gy(s);return r.jsx(JC,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:l,children:r.jsx(Be.div,{role:"tablist","aria-orientation":u.orientation,...o,ref:a})})});Wy.displayName=Dy;var By="TabsTrigger",Hy=v.forwardRef((t,a)=>{const{__scopeTabs:s,value:l,disabled:o=!1,...u}=t,d=wh(By,s),O=Gy(s),h=Ky(d.baseId,l),p=Jy(d.baseId,l),x=l===d.value;return r.jsx(eX,{asChild:!0,...O,focusable:!o,active:x,children:r.jsx(Be.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":p,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:h,...u,ref:a,onMouseDown:qe(t.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?d.onValueChange(l):g.preventDefault()}),onKeyDown:qe(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&d.onValueChange(l)}),onFocus:qe(t.onFocus,()=>{const g=d.activationMode!=="manual";!x&&!o&&g&&d.onValueChange(l)})})})});Hy.displayName=By;var Iy="TabsContent",Fy=v.forwardRef((t,a)=>{const{__scopeTabs:s,value:l,forceMount:o,children:u,...d}=t,O=wh(Iy,s),h=Ky(O.baseId,l),p=Jy(O.baseId,l),x=l===O.value,g=v.useRef(x);return v.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),r.jsx(bn,{present:o||x,children:({present:b})=>r.jsx(Be.div,{"data-state":x?"active":"inactive","data-orientation":O.orientation,role:"tabpanel","aria-labelledby":h,hidden:!b,id:p,tabIndex:0,...d,ref:a,style:{...t.style,animationDuration:g.current?"0s":void 0},children:b&&u})})});Fy.displayName=Iy;function Ky(t,a){return`${t}-trigger-${a}`}function Jy(t,a){return`${t}-content-${a}`}var aX=Ly,sX=Wy,lX=Hy,rX=Fy;function eS({children:t,...a}){return r.jsx(aX,{...a,children:t})}function tS({children:t,className:a,...s}){return r.jsx(sX,{className:re("flex items-center gap-0 border-b border-border-subtle",a),...s,children:t})}function zl({children:t,className:a,...s}){return r.jsx(lX,{className:re("px-3 py-2 text-sm font-medium font-sans text-text-2","border-b-2 border-transparent","hover:text-text-0 hover:bg-surface-5/50","data-[state=active]:text-text-0 data-[state=active]:border-accent","transition-colors duration-100 cursor-pointer select-none","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",a),...s,children:t})}function Rl({children:t,className:a,...s}){return r.jsx(rX,{className:re("flex-1 min-h-0",a),...s,children:t})}function c0({data:t,color:a=xe.accent,width:s=60,height:l=16}){if(!t||t.length<2)return r.jsx("div",{style:{width:s,height:l}});const o=Array.isArray(t[0])?t:t.map(p=>typeof p=="number"?p:p.v),u=Math.min(...o),O=Math.max(...o)-u||1,h=o.map((p,x)=>{const g=x/(o.length-1)*s,b=l-(p-u)/O*(l-2)-1;return`${g},${b}`}).join(" ");return r.jsx("svg",{width:s,height:l,className:"flex-shrink-0",children:r.jsx("polyline",{points:h,fill:"none",stroke:a,strokeWidth:"1",strokeLinejoin:"round",strokeOpacity:"0.7"})})}function HO({label:t,value:a,total:s,color:l}){const o=s>0?a/s*100:0;return r.jsxs("div",{className:"space-y-0.5",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[r.jsx("span",{className:"text-text-2",children:t}),r.jsx("span",{className:"text-text-1 tabular-nums",children:et(a)})]}),r.jsx("div",{className:"h-[2px] bg-surface-4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(o,100)}%`,background:l}})})]})}function iX({tokens:t,rotation:a}){var d;const s=(t==null?void 0:t.savings)||{},l=s.total||0,u=((t==null?void 0:t.totalTokens)||0)+l;return r.jsxs("div",{className:"p-3 space-y-4",children:[r.jsxs("div",{className:"flex gap-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Rotations"}),r.jsx("div",{className:"text-xl font-mono font-semibold text-text-0 tabular-nums leading-none",children:(a==null?void 0:a.totalRotations)||0})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Saved"}),r.jsx("div",{className:"text-xl font-mono font-semibold text-success tabular-nums leading-none",children:et(l)}),u>0&&r.jsxs("div",{className:"text-2xs font-mono text-text-3 mt-0.5",children:[Ns(l/u*100)," of total"]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(HO,{label:"Rotation",value:s.fromRotation||0,total:u,color:xe.accent}),r.jsx(HO,{label:"Conflict prevention",value:s.fromConflictPrevention||0,total:u,color:xe.purple}),r.jsx(HO,{label:"Cold-start skip",value:s.fromColdStartSkip||0,total:u,color:xe.info})]}),((d=a==null?void 0:a.history)==null?void 0:d.length)>0&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1.5",children:"Recent"}),r.jsx("div",{className:"space-y-1",children:a.history.slice(-8).reverse().map((O,h)=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono px-2 py-1 bg-surface-0 rounded",children:[r.jsx("span",{className:"text-text-1 font-medium capitalize truncate flex-1",children:O.agentName||O.role}),r.jsx("span",{className:"text-text-3 tabular-nums",children:Ns((O.contextUsage||0)*100)}),r.jsx("span",{className:"text-text-4",children:vt(O.timestamp)})]},h))})]})]})}function oX({adaptive:t}){if(!(t!=null&&t.length))return r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"No adaptive profiles"});function a(s){const l=s.split(":");return{provider:l[0]||s,role:l[1]||""}}return r.jsx("div",{children:r.jsxs("div",{className:"p-3 space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2 px-2 pb-1 text-2xs font-mono text-text-4 uppercase tracking-wider",children:[r.jsx("span",{className:"flex-1",children:"Role"}),r.jsx("span",{className:"w-12 text-right",children:"Threshold"}),r.jsx("span",{className:"w-12 text-right",children:"Adj."}),r.jsx("span",{className:"w-14 text-right",children:"Status"})]}),t.map(s=>{var O,h;const{provider:l,role:o}=a(s.key),u=((O=s.thresholdHistory)==null?void 0:O.length)>1,d=((h=s.recentScores)==null?void 0:h.length)>1;return r.jsxs("div",{className:"bg-surface-0 rounded px-2 py-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"text-xs font-mono text-text-1 capitalize",children:o||l}),o&&r.jsx("span",{className:"text-2xs font-mono text-text-4 ml-1.5",children:l})]}),r.jsx("span",{className:"w-12 text-right text-xs font-mono font-semibold text-text-0 tabular-nums",children:Ns(s.threshold*100)}),r.jsx("span",{className:"w-12 text-right text-2xs font-mono text-text-3 tabular-nums",children:s.adjustments}),r.jsx("span",{className:re("w-14 text-right text-2xs font-mono font-bold uppercase",s.converged?"text-success":"text-text-4"),children:s.converged?"Converged":"Learning"})]}),(u||d)&&r.jsxs("div",{className:"flex items-center gap-3 mt-1.5 pl-1",children:[u&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-2xs font-mono text-text-4",children:"Threshold"}),r.jsx(c0,{data:s.thresholdHistory.map(p=>p.v),color:s.converged?xe.success:xe.accent,width:70,height:12})]}),d&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-2xs font-mono text-text-4",children:"Quality"}),r.jsx(c0,{data:s.recentScores,color:xe.warning,width:70,height:12})]})]})]},s.key)})]})})}function cX({journalist:t}){var a;return t?r.jsx("div",{children:r.jsxs("div",{className:"p-3 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Cycles"}),r.jsx("div",{className:"text-lg font-mono font-semibold text-text-0 tabular-nums leading-none",children:t.cycleCount||0})]}),t.lastCycleAt&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Last"}),r.jsx("div",{className:"text-xs font-mono text-text-2",children:vt(t.lastCycleAt)})]}),t.synthesizing&&r.jsx("span",{className:"text-2xs font-mono font-bold text-accent uppercase tracking-wider animate-pulse",children:"Synthesizing"})]}),t.lastSummary&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Summary"}),r.jsx("div",{className:"text-xs font-sans text-text-2 leading-relaxed",children:t.lastSummary})]}),t.projectMap&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Project Map"}),r.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.projectMap})]}),t.decisions&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Decisions"}),r.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.decisions})]}),((a=t.recentHistory)==null?void 0:a.length)>0&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1.5",children:"History"}),r.jsx("div",{className:"space-y-1",children:t.recentHistory.slice().reverse().map((s,l)=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono px-2 py-1 bg-surface-0 rounded",children:[r.jsxs("span",{className:"text-text-3",children:["#",s.cycle]}),r.jsxs("span",{className:"text-text-2 flex-1 truncate",children:[s.agentCount," agents"]}),r.jsx("span",{className:"text-text-4",children:vt(s.timestamp)})]},l))})]})]})}):r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"Journalist inactive"})}const uX=v.memo(function({tokens:a,rotation:s,adaptive:l,journalist:o}){return r.jsxs(eS,{defaultValue:"rotation",className:"flex flex-col h-full",children:[r.jsxs(tS,{className:"flex-shrink-0 px-1",children:[r.jsxs(zl,{value:"rotation",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[r.jsx(Wl,{size:11}),"Rotation"]}),r.jsxs(zl,{value:"adaptive",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[r.jsx(T5,{size:11}),"Adaptive"]}),r.jsxs(zl,{value:"journalist",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[r.jsx(nh,{size:11}),"Journalist"]})]}),r.jsx(Rl,{value:"rotation",className:"flex-1 min-h-0 relative",children:r.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:r.jsx(iX,{tokens:a,rotation:s})})}),r.jsx(Rl,{value:"adaptive",className:"flex-1 min-h-0 relative",children:r.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:r.jsx(oX,{adaptive:l})})}),r.jsx(Rl,{value:"journalist",className:"flex-1 min-h-0 relative",children:r.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:r.jsx(cX,{journalist:o})})})]})}),dX={spawn:qN,complete:ni,crash:gi,kill:Xb,rotate:Wl,error:sh},OX={spawn:"text-accent",complete:"text-success",crash:"text-danger",kill:"text-text-3",rotate:"text-purple",error:"text-danger"};function fX(t){const a=t.agentName||t.role||"";switch(t.type){case"spawn":return`${a} spawned`;case"complete":return`${a} completed`;case"crash":return`${a} crashed`;case"kill":return`${a} killed`;case"rotate":return`${a} rotated`;default:return t.text||t.type||"event"}}const hX=v.memo(function({events:a=[]}){return a.length?r.jsx("div",{className:"flex items-center gap-3 overflow-x-auto py-2 px-3",children:a.slice(-15).reverse().map((s,l)=>{const o=dX[s.type]||Rn,u=OX[s.type]||"text-text-3",d=fX(s);return r.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsx(o,{size:11,className:u}),r.jsx("span",{className:"text-xs font-sans text-text-2 whitespace-nowrap",children:d}),r.jsx("span",{className:"text-2xs font-mono text-text-4",children:vt(s.t||s.timestamp)})]},l)})}):r.jsx("div",{className:"text-xs text-text-3 font-mono py-2.5 text-center",children:"No recent activity"})});function rn({className:t,...a}){return r.jsx("div",{className:re("rounded-md bg-surface-4","bg-gradient-to-r from-surface-4 via-surface-5 to-surface-4","bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",t),...a})}function mX(){return r.jsxs("div",{className:"flex-1 grid gap-px p-0",style:{gridTemplateRows:"auto minmax(0, 1fr) minmax(0, 1fr)",gridTemplateColumns:"3fr 1.5fr 1.5fr",background:"#282c34"},children:[r.jsx("div",{className:"col-span-3",children:r.jsx(rn,{className:"h-[72px] rounded-none"})}),r.jsx(rn,{className:"rounded-none"}),r.jsx(rn,{className:"rounded-none"}),r.jsx(rn,{className:"rounded-none"}),r.jsx(rn,{className:"rounded-none"}),r.jsx("div",{className:"col-span-2",children:r.jsx(rn,{className:"h-full rounded-none"})})]})}function pX(){const{data:t,loading:a,agents:s,connected:l,kpiHistory:o,lastFetch:u,agentBreakdown:d,routing:O,rotation:h,adaptive:p,journalist:x,rotating:g}=PC(),b=s.filter(R=>R.status==="running").length;if(!l)return r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsxs("div",{className:"text-center space-y-2 text-text-3 font-mono",children:[r.jsx(Vc,{size:28,className:"mx-auto"}),r.jsx("p",{className:"text-xs",children:"Connecting to daemon..."})]})});if(a||!t)return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx(r0,{connected:l,runningCount:0,totalCount:0,uptime:0,lastFetch:0}),r.jsx(mX,{})]});const y=t.tokens||{},Q={totalTokens:y.totalTokens||0,totalCostUsd:y.totalCostUsd||0,totalInputTokens:y.totalInputTokens||0,totalOutputTokens:y.totalOutputTokens||0,cacheReadTokens:y.cacheReadTokens||0,cacheCreationTokens:y.cacheCreationTokens||0,cacheHitRate:y.cacheHitRate||0,totalTurns:y.totalTurns||0,agentCount:y.agentCount||0,savings:y.savings||{}},w=Q.totalTokens+(Q.savings.total||0),$=w>0?(Q.savings.total||0)/w*100:0,j=Q.totalOutputTokens>0?(Q.totalInputTokens/Q.totalOutputTokens).toFixed(1):"—",z=t.timeline||{},N=z.snapshots||[],_=z.events||t.events||[],G=[{label:"Tokens Used",value:et(Q.totalTokens),sparkData:o.tokens,color:xe.accent},{label:"Total Cost",value:Lc(Q.totalCostUsd),sparkData:o.cost,color:xe.warning},{label:"Tokens Saved",value:et(Q.savings.total||0),sparkData:o.saved,color:xe.success},{label:"Efficiency",value:Ns($),sparkData:o.efficiency,color:xe.purple},{label:"Cache Rate",value:Ns(Q.cacheHitRate*100),sparkData:o.cache,color:xe.info},{label:"I/O Ratio",value:`${j}:1`,sparkData:o.inputOutput,color:xe.orange},{label:"Agents",value:`${b}/${s.length}`,sparkData:o.agents,color:xe.accent},{label:"Turns",value:et(Q.totalTurns),sparkData:o.turns,color:xe.text2}];return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx(r0,{connected:l,runningCount:b,totalCount:s.length,uptime:t.uptime||0,lastFetch:u,activeTeam:t.activeTeam}),r.jsx(CC,{kpis:G}),r.jsxs("div",{className:"flex-1 min-h-0 grid",style:{gridTemplateRows:"minmax(0, 1fr) minmax(0, 1fr)",gridTemplateColumns:"3fr 1.5fr 1.5fr",background:"#282c34",gap:"1px"},children:[r.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 relative",children:r.jsx(EC,{data:N})}),r.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[r.jsx("div",{className:"px-3 pt-2.5 pb-1",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Cache Performance"})}),r.jsx(qC,{cacheRead:Q.cacheReadTokens,cacheCreation:Q.cacheCreationTokens,totalInput:Q.totalInputTokens})]}),r.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[r.jsx("div",{className:"px-3 pt-2.5 pb-1",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Model Routing"})}),r.jsx(MC,{routing:O,agentBreakdown:d})]}),r.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-border",children:[r.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Agent Fleet"})}),r.jsx(AC,{agentBreakdown:d,rotating:g})]}),r.jsx("div",{className:"col-span-2 min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-l border-border",children:r.jsx(uX,{tokens:Q,rotation:h,adaptive:p,journalist:x})})]}),r.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-t border-border",children:r.jsx(hX,{events:_})})]})}const u0={sm:12,md:16,lg:20};function xX({fill:t="full",size:a,color:s="#fbbf24",emptyColor:l="rgba(255,255,255,0.4)"}){const o=`star-${Math.random().toString(36).slice(2,8)}`;return r.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",children:[t==="half"&&r.jsx("defs",{children:r.jsxs("linearGradient",{id:o,children:[r.jsx("stop",{offset:"50%",stopColor:s}),r.jsx("stop",{offset:"50%",stopColor:l})]})}),r.jsx("path",{d:"M10 1.5l2.47 5.01 5.53.8-4 3.9.94 5.49L10 14.27 5.06 16.7 6 11.21l-4-3.9 5.53-.8L10 1.5z",fill:t==="full"?s:t==="half"?`url(#${o})`:l})]})}function nS({rating:t=0,count:a,size:s="sm"}){const l=u0[s]||u0.sm,o=[];for(let u=1;u<=5;u++)t>=u?o.push("full"):t>=u-.5?o.push("half"):o.push("empty");return r.jsxs("span",{className:"inline-flex items-center",style:{gap:1},children:[o.map((u,d)=>r.jsx(xX,{fill:u,size:l},d)),a!=null&&r.jsxs("span",{className:"ml-1 text-[11px] text-[var(--text-dim,#6b7f95)] font-sans",children:["(",a,")"]})]})}const d0={design:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},quality:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},devtools:{color:"#33afbc",bg:"rgba(51,175,188,0.14)"},workflow:{color:"#fbbf24",bg:"rgba(251,191,36,0.12)"},security:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},specialized:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},verified:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},anthropic:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},published:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},draft:{color:"#6b7f95",bg:"rgba(255,255,255,0.06)"},review:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},rejected:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},free:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"}};function aS({label:t,variant:a,className:s}){const l=d0[a]||d0.draft;return r.jsx("span",{className:re("inline-flex items-center whitespace-nowrap font-sans select-none",s),style:{padding:"3px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.4,color:l.color,background:l.bg},children:t})}function sS({price:t=0,size:a="sm"}){const s=!t||t===0,l={sm:"text-2xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-xs px-3 py-1"};return r.jsx("span",{className:`inline-flex items-center font-mono font-semibold rounded whitespace-nowrap ${l[a]||l.sm} ${s?"bg-success/12 text-success":"bg-white/8 text-text-1"}`,children:s?"Free":`$${t.toFixed(2)}`})}function lS({type:t="verified",size:a=12}){const s=t==="claude-official"||t==="anthropic"?"#f59e0b":"#4ade80";return r.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",className:"inline-block flex-shrink-0",children:[r.jsx("path",{d:"M10 0l2.36 3.15L16.18 2l.68 3.93L20.8 7.1l-1.87 3.52L20.8 14.14l-3.94 1.17-.68 3.93-3.82-1.15L10 21.24l-2.36-3.15-3.82 1.15-.68-3.93-3.94-1.17 1.87-3.52L-.8 7.1l3.94-1.17.68-3.93 3.82 1.15L10 0z",fill:s}),r.jsx("path",{d:"M7 10.5l2 2 4-4.5",fill:"none",stroke:"#24282f",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}const rS="groove_favorites";function kh(){try{return JSON.parse(localStorage.getItem(rS)||"[]")}catch{return[]}}function gX(t){return kh().includes(t)}function bX(t){const a=kh(),s=a.indexOf(t);return s>=0?a.splice(s,1):a.push(t),localStorage.setItem(rS,JSON.stringify(a)),s<0}function vX(t){const a=new Set(kh());return t.map(s=>({...s,favorited:a.has(s.id)}))}function yX({filled:t,size:a=16}){return r.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:t?"#f87171":"none",stroke:t?"#f87171":"rgba(255,255,255,0.3)",strokeWidth:"2",children:r.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}function SX(){return r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),r.jsx("polyline",{points:"7 10 12 15 17 10"}),r.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function QX({skill:t,onClick:a}){var u,d;const[s,l]=v.useState(()=>gX(t.id));function o(O){O.stopPropagation(),l(bX(t.id))}return r.jsxs("div",{onClick:()=>a==null?void 0:a(t),className:re("flex flex-col cursor-pointer group","bg-surface-1 border border-border-subtle rounded-md","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150"),style:{padding:20,minHeight:280},children:[r.jsxs("div",{className:"flex justify-between items-start",children:[r.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-accent/12 text-[20px]",children:t.icon||((d=(u=t.name)==null?void 0:u[0])==null?void 0:d.toUpperCase())||"?"}),r.jsx("button",{onClick:o,className:"opacity-40 group-hover:opacity-80 hover:!opacity-100 transition-opacity cursor-pointer bg-transparent border-0 p-0",children:r.jsx(yX,{filled:s})})]}),r.jsx("div",{className:"mt-3 text-[15px] font-semibold text-text-0 font-sans line-clamp-2 leading-snug",children:t.name}),r.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-text-3 font-sans",children:[r.jsxs("span",{children:["by ",t.author||"Community"]}),(t.source==="claude-official"||t.verified)&&r.jsx(lS,{type:t.source,size:12})]}),r.jsx("div",{className:"mt-2.5 text-xs text-text-2 font-sans line-clamp-3 flex-1 leading-relaxed",children:t.description}),r.jsx("div",{className:"mt-3",children:r.jsx(aS,{label:t.category||"general",variant:t.category||"draft"})}),r.jsx("div",{className:"h-px bg-border-subtle my-3"}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx(nS,{rating:t.rating||0,count:t.rating_count||t.ratingCount||0,size:"sm"}),r.jsxs("span",{className:"flex items-center gap-1 text-xs text-text-3 font-mono",children:[r.jsx(SX,{}),et(t.downloads||0)]}),r.jsx(sS,{price:t.price||0,size:"sm"})]})]})}function iS(){return r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md animate-pulse",style:{padding:20,minHeight:280},children:[r.jsx("div",{className:"w-10 h-10 rounded-full bg-surface-4"}),r.jsx("div",{className:"mt-3 h-4 w-[70%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-2 h-3 w-[40%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-3.5 h-3 w-full rounded bg-surface-4"}),r.jsx("div",{className:"mt-1.5 h-3 w-[90%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-1.5 h-3 w-[60%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-3.5 h-5 w-[50px] rounded bg-surface-4"}),r.jsx("div",{className:"h-px bg-surface-4 my-3"}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("div",{className:"h-3 w-16 rounded bg-surface-4"}),r.jsx("div",{className:"h-3 w-12 rounded bg-surface-4"}),r.jsx("div",{className:"h-3 w-10 rounded bg-surface-4"})]})]})}const jX={slack:"https://cdn.simpleicons.org/slack/E01E5A",github:"https://cdn.simpleicons.org/github/white",stripe:"https://cdn.simpleicons.org/stripe/635BFF",gmail:"https://cdn.simpleicons.org/gmail/EA4335","google-calendar":"https://cdn.simpleicons.org/googlecalendar/4285F4","google-drive":"https://cdn.simpleicons.org/googledrive/4285F4","google-maps":"https://cdn.simpleicons.org/googlemaps/4285F4",postgres:"https://cdn.simpleicons.org/postgresql/4169E1",notion:"https://cdn.simpleicons.org/notion/white",discord:"https://cdn.simpleicons.org/discord/5865F2",linear:"https://cdn.simpleicons.org/linear/5E6AD2","brave-search":"https://cdn.simpleicons.org/brave/FB542B","home-assistant":"https://cdn.simpleicons.org/homeassistant/18BCF2"};function wX({item:t,size:a=40}){const s=jX[t.id];if(s)return r.jsxs("div",{className:"rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:a,height:a},children:[r.jsx("img",{src:s,alt:t.name,className:"w-5 h-5",onError:u=>{u.target.style.display="none",u.target.nextSibling.style.display="flex"}}),r.jsx("div",{className:"hidden items-center justify-center w-full h-full text-lg font-bold font-sans text-text-1",children:(t.name||"?")[0]})]});const l=(t.name||"?")[0].toUpperCase(),o=t.name?t.name.charCodeAt(0)*37%360:200;return r.jsx("div",{className:"rounded-md flex items-center justify-center flex-shrink-0 text-lg font-bold font-sans",style:{width:a,height:a,background:`hsl(${o}, 40%, 18%)`,color:`hsl(${o}, 60%, 65%)`},children:l})}function kX({item:t,onClick:a,className:s}){var o;const l=t.installed;return r.jsxs("button",{onClick:()=>a(t),className:re("flex flex-col p-5 rounded-md border border-border-subtle bg-surface-1 text-left","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150 cursor-pointer group",s),style:{minHeight:200},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx(wX,{item:t,size:36}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[14px] font-semibold text-text-0 font-sans truncate",children:t.name}),(t.verified||t.verified==="mcp-official")&&r.jsx(ni,{size:11,className:"text-accent flex-shrink-0"})]}),r.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.author||"Community"})]})]}),r.jsx("p",{className:"text-xs text-text-2 font-sans line-clamp-3 mb-3 flex-1 leading-relaxed",children:t.description}),r.jsx("div",{className:"h-px bg-border-subtle my-2"}),r.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(mi,{size:10}),et(t.downloads||0)]}),(t.rating||0)>0&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Ib,{size:10,className:"text-warning",fill:"currentColor"}),(o=t.rating)==null?void 0:o.toFixed(1)]}),r.jsx("span",{className:"flex-1"}),l&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Installed"})]})]})}function oS({value:t,onChange:a,placeholder:s="Search skills, tags, authors...",large:l}){const[o,u]=v.useState(t||""),d=v.useRef(null);v.useEffect(()=>{u(t||"")},[t]);function O(h){const p=h.target.value;u(p),clearTimeout(d.current),d.current=setTimeout(()=>a(p),300)}return r.jsxs("div",{className:"relative w-full",children:[r.jsx(da,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),r.jsx("input",{value:o,onChange:O,placeholder:s,className:re("w-full font-sans outline-none","bg-surface-0 border border-border text-text-0 placeholder:text-text-4","focus:border-accent/40 transition-colors",l?"py-3 pl-11 pr-12 text-[15px] rounded-lg":"py-2.5 pl-10 pr-3 text-sm rounded-md")}),l&&r.jsx("kbd",{className:"absolute right-3.5 top-1/2 -translate-y-1/2 bg-surface-4 text-text-4 px-2 py-0.5 rounded text-xs font-mono",children:"/"})]})}const $X=[{id:"",label:"All"},{id:"design",label:"Design"},{id:"quality",label:"Quality"},{id:"devtools",label:"Dev Tools"},{id:"workflow",label:"Workflow"},{id:"security",label:"Security"},{id:"specialized",label:"Specialized"}];function TX({selected:t="",categories:a=$X,onSelect:s}){return r.jsx("div",{className:"flex gap-2 overflow-x-auto",style:{scrollbarWidth:"none"},children:a.map(l=>{const o=t===l.id;return r.jsx("button",{onClick:()=>s(l.id),className:re("whitespace-nowrap font-sans cursor-pointer select-none transition-all text-[13px] rounded-full border",o?"bg-accent text-surface-0 border-accent font-semibold":"bg-surface-1 text-text-3 border-border-subtle hover:text-text-1 hover:border-border font-medium"),style:{padding:"7px 16px"},children:l.label},l.id)})})}function Bl(){const t=D(a=>a.addToast);return{success:(a,s)=>t("success",a,s),error:(a,s)=>t("error",a,s),info:(a,s)=>t("info",a,s),warning:(a,s)=>t("warning",a,s)}}function NX({skill:t,onBack:a}){var G,R,X;const s=Bl(),[l,o]=v.useState(""),[u,d]=v.useState(!1),[O,h]=v.useState(!1),[p,x]=v.useState(!1),[g,b]=v.useState(!1),[y,Q]=v.useState(t.installed),[w,$]=v.useState(!0);v.useEffect(()=>{$(!0),J.get(`/skills/${t.id}/content`).then(T=>{o(T.content||""),d(T.requiresPurchase||!1)}).catch(()=>{}).finally(()=>$(!1))},[t.id]);async function j(){h(!0);try{await J.post(`/skills/${t.id}/install`),Q(!0),s.success(`${t.name} installed`)}catch(T){s.error("Install failed",T.message)}h(!1)}async function z(){x(!0);try{await J.post(`/skills/${t.id}/update`),s.success(`${t.name} updated to latest`);const T=await J.get(`/skills/${t.id}/content`);T.content&&o(T.content)}catch(T){s.error("Update failed",T.message)}x(!1)}async function N(){b(!0);try{await J.delete(`/skills/${t.id}`),Q(!1),s.success(`${t.name} uninstalled`)}catch(T){s.error("Uninstall failed",T.message)}b(!1)}async function _(){const{marketplaceAuthenticated:T,marketplaceLogin:V,marketplaceCheckout:M}=D.getState();if(!T){V();return}try{await M(t.id)}catch{}}return r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-6 py-5",children:[r.jsxs("button",{onClick:a,className:"flex items-center gap-1 text-xs text-text-3 font-sans hover:text-text-0 cursor-pointer bg-transparent border-0 mb-4",children:[r.jsx(Cb,{size:14})," Back"]}),r.jsxs("div",{className:"flex gap-8",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-11 h-11 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-[22px]",children:t.icon||((R=(G=t.name)==null?void 0:G[0])==null?void 0:R.toUpperCase())}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:t.name}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-text-3 font-sans",children:[r.jsx("span",{children:t.author||"Community"}),(t.source==="claude-official"||t.verified)&&r.jsx(lS,{type:t.source,size:13})]})]})]}),r.jsx("p",{className:"mt-3 text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((X=t.tags)==null?void 0:X.length)>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:t.tags.map(T=>r.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:T},T))}),r.jsx("div",{className:"h-px bg-border-subtle my-5"}),w?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"h-3 w-48 bg-surface-4 rounded animate-pulse"}),r.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),r.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}):l?r.jsxs("div",{className:"text-sm text-text-2 font-sans leading-relaxed",children:[r.jsx("h2",{className:"text-sm font-semibold text-text-0 mb-2",children:"About"}),r.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:l})]}):u?r.jsxs("div",{className:"bg-warning/5 border border-warning/15 rounded-lg px-4 py-3",children:[r.jsx("p",{className:"text-sm text-text-1 font-sans font-medium",children:"Paid skill — purchase to view content"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Sign in and purchase this skill to access its full instructions."})]}):r.jsx("p",{className:"text-xs text-text-4 font-sans",children:"Content loading failed — check your connection."})]}),r.jsx("div",{className:"w-[240px] flex-shrink-0",children:r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-lg p-4 sticky top-4",children:[r.jsx(sS,{price:t.price||0,size:"md"}),u&&!y?r.jsxs("button",{onClick:_,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 flex items-center justify-center gap-2 border bg-warning/15 text-warning border-warning/20 hover:bg-warning/25",children:["Buy $",(t.price||0).toFixed(2)]}):y?r.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[r.jsxs("button",{onClick:z,disabled:p,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:[r.jsx(zn,{size:12,className:p?"animate-spin":""}),p?"Updating...":"Pull Latest"]}),r.jsxs("button",{onClick:N,disabled:g,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-error/10 text-error border-error/20 hover:bg-error/15",children:[r.jsx(as,{size:12}),g?"Removing...":"Uninstall"]})]}):r.jsx("button",{onClick:j,disabled:O,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:O?"Installing...":"Install"}),r.jsx("div",{className:"mt-4 flex flex-col gap-2.5",children:[["Downloads",r.jsx("span",{className:"font-mono text-text-0",children:et(t.downloads||0)},"d")],["Rating",r.jsx(nS,{rating:t.rating||0,count:t.rating_count||t.ratingCount,size:"sm"},"r")],["Version",r.jsx("span",{className:"font-mono text-text-0",children:t.version||"1.0.0"},"v")],["Category",r.jsx(aS,{label:t.category||"general",variant:t.category||"draft"},"c")],["Source",r.jsx("span",{className:"text-text-0",children:t.source==="claude-official"?"Anthropic":"Community"},"s")]].map(([T,V])=>r.jsxs("div",{className:"flex justify-between items-center text-xs font-sans",children:[r.jsx("span",{className:"text-text-3",children:T}),V]},T))})]})})]})]})})}function PX(){const[t,a]=v.useState([]),[s,l]=v.useState(!0),[o,u]=v.useState(""),[d,O]=v.useState(""),[h,p]=v.useState("popular"),[x,g]=v.useState(null);return v.useEffect(()=>{l(!0);const b=new URLSearchParams;o&&b.set("search",o),d&&b.set("category",d),h&&b.set("sort",h),J.get(`/skills/registry?${b}`).then(y=>a(vX(y.skills||y.items||(Array.isArray(y)?y:[])))).catch(()=>a([])).finally(()=>l(!1))},[o,d,h]),x?r.jsx(NX,{skill:x,onBack:()=>g(null)}):r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-5 py-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-72",children:r.jsx(oS,{value:o,onChange:u})}),r.jsx(TX,{selected:d,onSelect:O}),r.jsx("div",{className:"flex-1"}),r.jsxs("div",{className:"relative flex-shrink-0",children:[r.jsxs("select",{value:h,onChange:b=>p(b.target.value),className:"appearance-none font-sans cursor-pointer pr-7 py-2 pl-3 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 focus:outline-none",children:[r.jsx("option",{value:"popular",children:"Popular"}),r.jsx("option",{value:"rating",children:"Top Rated"}),r.jsx("option",{value:"newest",children:"Newest"}),r.jsx("option",{value:"name",children:"A-Z"})]}),r.jsx(ca,{size:12,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),r.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),r.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:8}).map((b,y)=>r.jsx(iS,{},y)):t.map(b=>r.jsx(QX,{skill:b,onClick:g},b.id))}),!s&&t.length===0&&r.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No skills found."})]})})}function zX(){const[t,a]=v.useState([]),[s,l]=v.useState(!0),[o,u]=v.useState(""),d=Bl();return v.useEffect(()=>{l(!0),J.get(`/integrations/registry?search=${encodeURIComponent(o)}`).then(O=>a(O.integrations||O.items||(Array.isArray(O)?O:[]))).catch(()=>a([])).finally(()=>l(!1))},[o]),r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-5 py-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-72",children:r.jsx(oS,{value:o,onChange:u,placeholder:"Search integrations..."})}),r.jsx("div",{className:"flex-1"}),r.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),r.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:6}).map((O,h)=>r.jsx(iS,{},h)):t.map(O=>r.jsx(kX,{item:O,onClick:()=>d.info(`${O.name} — install via CLI: groove integrations install ${O.id}`)},O.id))}),!s&&t.length===0&&r.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No integrations found."})]})})}function RX(){const t=D($=>$.marketplaceAuthenticated),a=D($=>$.marketplaceLogin),[s,l]=v.useState([]),[o,u]=v.useState([]),[d,O]=v.useState(!0),[h,p]=v.useState(null),x=Bl(),g=v.useRef(null),b=async()=>{const $=await J.get("/skills/installed");u(Array.isArray($)?$:$.skills||[])};v.useEffect(()=>{O(!0),Promise.all([t?J.get("/auth/purchases").then($=>$.purchases||[]).catch(()=>[]):Promise.resolve([]),J.get("/skills/installed").then($=>Array.isArray($)?$:$.skills||[]).catch(()=>[])]).then(([$,j])=>{l($),u(j)}).finally(()=>O(!1))},[t]);async function y($){p($.id);try{await J.post(`/skills/${$.id}/update`),x.success(`${$.name||$.id} updated`),await b()}catch(j){x.error("Update failed",j.message)}p(null)}async function Q($){p($.id);try{await J.delete(`/skills/${$.id}`),x.success(`${$.name||$.id} uninstalled`),await b()}catch(j){x.error("Uninstall failed",j.message)}p(null)}async function w($){var z;const j=(z=$.target.files)==null?void 0:z[0];if(j){try{const N=await j.text(),_=j.name.replace(/\.md$/i,"");await J.post("/skills/import",{name:_,content:N}),x.success(`Imported "${_}"`),await b()}catch(N){x.error("Import failed",N.message)}$.target.value=""}}return d?r.jsx("div",{className:"p-5 space-y-3",children:[...Array(4)].map(($,j)=>r.jsx(rn,{className:"h-14 rounded-md"},j))}):r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-5 py-4 space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{ref:g,type:"file",accept:".md",onChange:w,className:"hidden"}),r.jsxs(ve,{variant:"secondary",size:"md",onClick:()=>{var $;return($=g.current)==null?void 0:$.click()},className:"gap-1.5",children:[r.jsx(_N,{size:13}),"Import .md Skill"]}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Drop a markdown skill file to install locally"})]}),t&&s.length>0&&r.jsxs("div",{children:[r.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[r.jsx(wO,{size:12}),"Purchases (",s.length,")"]}),r.jsx("div",{className:"space-y-1.5",children:s.map($=>{var j,z;return r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[r.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:$.skill_icon||((z=(j=$.skill_name)==null?void 0:j[0])==null?void 0:z.toUpperCase())||"?"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:$.skill_name||$.skill_id}),r.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:["$",($.amount||0).toFixed(2)," · ",vt($.created_at)]})]}),r.jsx(Xe,{variant:"success",className:"text-2xs flex-shrink-0",children:"Owned"})]},$.id||$.skill_id)})})]}),t&&s.length===0&&r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[r.jsx(wO,{size:20,className:"mx-auto text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No purchases yet"})]}),!t&&r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[r.jsx(wO,{size:20,className:"mx-auto text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-2 font-sans mb-3",children:"Sign in to see your purchases"}),r.jsxs(ve,{variant:"primary",size:"sm",onClick:a,className:"gap-1.5 mx-auto",children:[r.jsx(eh,{size:12})," Sign in"]})]}),r.jsxs("div",{children:[r.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[r.jsx(Vb,{size:12}),"Installed (",o.length,")"]}),o.length===0?r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[r.jsx(mi,{size:20,className:"mx-auto text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No skills installed — browse the Skills tab or import a .md file"})]}):r.jsx("div",{className:"space-y-1.5",children:o.map($=>{var j,z;return r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle group",children:[r.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:$.icon||((z=(j=$.name)==null?void 0:j[0])==null?void 0:z.toUpperCase())||"?"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:$.name||$.id}),r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:$.description||$.category||"local skill"})]}),r.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[r.jsx("button",{onClick:()=>y($),disabled:h===$.id,title:"Pull latest version",className:"p-1.5 rounded text-text-3 hover:text-accent hover:bg-accent/10 cursor-pointer transition-colors disabled:opacity-50",children:r.jsx(zn,{size:12,className:h===$.id?"animate-spin":""})}),r.jsx("button",{onClick:()=>Q($),disabled:h===$.id,title:"Uninstall",className:"p-1.5 rounded text-text-3 hover:text-error hover:bg-error/10 cursor-pointer transition-colors disabled:opacity-50",children:r.jsx(as,{size:12})})]}),r.jsx(Xe,{variant:"accent",className:"text-2xs flex-shrink-0",children:"Installed"})]},$.id)})})]})]})})}function CX(){const t=D(o=>o.marketplaceAuthenticated),a=D(o=>o.marketplaceUser),s=D(o=>o.marketplaceLogin),l=D(o=>o.marketplaceLogout);return t?r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded bg-surface-3 border border-border-subtle",children:[r.jsx("div",{className:"w-4 h-4 rounded-full bg-accent/20 flex items-center justify-center",children:r.jsx(Fb,{size:9,className:"text-accent"})}),r.jsx("span",{className:"text-xs text-text-0 font-sans font-medium max-w-[120px] truncate",children:(a==null?void 0:a.displayName)||(a==null?void 0:a.id)||"Account"})]}),r.jsx("button",{onClick:l,className:"flex items-center gap-1 px-2 py-1.5 rounded text-xs text-text-3 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:r.jsx(Mb,{size:11})})]}):r.jsxs("button",{onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold font-sans text-text-0 bg-accent/15 border border-accent/25 rounded hover:bg-accent/25 cursor-pointer transition-colors",children:[r.jsx(eh,{size:12}),"Sign in"]})}function XX(){const[t,a]=v.useState("skills"),s=[{id:"skills",label:"Skills",icon:Ir},{id:"integrations",label:"Integrations",icon:Gb},{id:"library",label:"My Library",icon:Vb}];return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-b border-border-subtle",children:r.jsxs("div",{className:"flex items-center px-5 h-11",children:[r.jsx("div",{className:"flex items-center",children:s.map(l=>{const o=l.icon;return r.jsxs("button",{onClick:()=>a(l.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-xs font-semibold font-sans cursor-pointer select-none border-b-2 -mb-px transition-colors ${t===l.id?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"}`,children:[r.jsx(o,{size:12}),l.label]},l.id)})}),r.jsx("div",{className:"flex-1"}),r.jsx(CX,{})]})}),r.jsxs("div",{className:"flex-1 min-h-0",children:[t==="skills"&&r.jsx(PX,{}),t==="integrations"&&r.jsx(zX,{}),t==="library"&&r.jsx(RX,{})]})]})}function _X(){const t=D(u=>u.teams),a=D(u=>u.agents),s=D(u=>u.activeTeamId),l=D(u=>u.deleteTeam),o=D(u=>u.addToast);return t.length===0?r.jsx("div",{className:"flex-1 flex items-center justify-center",children:r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx(bi,{size:28,className:"mx-auto text-text-4"}),r.jsx("p",{className:"text-xs font-sans text-text-3",children:"No teams yet"}),r.jsx("p",{className:"text-2xs font-sans text-text-4",children:"Teams are created when you spawn agents or launch a planner"})]})}):r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsx("div",{className:"p-4 space-y-3",children:t.map(u=>{const d=a.filter(y=>y.teamId===u.id),O=d.filter(y=>y.status==="running"||y.status==="starting"),h=d.filter(y=>y.status==="completed"),p=d.filter(y=>y.status==="crashed"),x=d.reduce((y,Q)=>y+(Q.tokensUsed||0),0),g=d.reduce((y,Q)=>y+(Q.costUsd||0),0),b=u.id===s;return r.jsxs("div",{className:re("rounded-md border bg-surface-1 overflow-hidden transition-colors",b?"border-accent/30":"border-border-subtle"),children:[r.jsxs("div",{className:"px-4 py-3 flex items-center gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans",children:u.name}),b&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Active"})]}),u.workingDir&&r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(Ab,{size:10,className:"text-text-4"}),r.jsx("span",{className:"text-2xs font-mono text-text-3 truncate",children:u.workingDir})]})]}),r.jsx("button",{onClick:()=>{if(d.some(y=>y.status==="running")){o("error","Stop running agents first");return}l(u.id)},className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Delete team",children:r.jsx(as,{size:13})})]}),r.jsxs("div",{className:"px-4 py-2.5 border-t border-border-subtle bg-surface-0 flex items-center gap-4",children:[r.jsx(vl,{label:"Agents",value:d.length}),r.jsx(vl,{label:"Running",value:O.length,color:O.length>0?"text-success":void 0}),r.jsx(vl,{label:"Done",value:h.length}),r.jsx(vl,{label:"Crashed",value:p.length,color:p.length>0?"text-danger":void 0}),r.jsx("div",{className:"flex-1"}),r.jsx(vl,{label:"Tokens",value:et(x)}),g>0&&r.jsx(vl,{label:"Cost",value:Lc(g)})]}),d.length>0&&r.jsx("div",{className:"border-t border-border-subtle",children:d.map(y=>r.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 border-b border-border-subtle last:border-b-0",children:[r.jsx(Ts,{status:y.status,size:"sm"}),r.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:y.name}),r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:y.role}),r.jsx("div",{className:"flex-1"}),r.jsx("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:et(y.tokensUsed||0)})]},y.id))})]},u.id)})})})}function vl({label:t,value:a,color:s}){return r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:re("text-xs font-mono tabular-nums",s||"text-text-1"),children:a}),r.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:t})]})}function ZX(){const t=D(l=>l.pendingApprovals),a=D(l=>l.approveRequest),s=D(l=>l.rejectRequest);return t.length===0?null:r.jsxs("div",{className:"px-4 pt-4 space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(gi,{size:12,className:"text-warning"}),r.jsxs("span",{className:"text-2xs font-mono text-warning uppercase tracking-wider",children:["Pending (",t.length,")"]})]}),t.map(l=>{var o,u,d;return r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md bg-warning/5 border border-warning/20",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"text-xs text-text-0 font-sans font-medium truncate",children:[l.agentName,": ",((o=l.action)==null?void 0:o.description)||((u=l.action)==null?void 0:u.type)||"action"]}),((d=l.action)==null?void 0:d.filePath)&&r.jsx("div",{className:"text-2xs font-mono text-text-3 truncate mt-0.5",children:l.action.filePath}),r.jsx("div",{className:"text-2xs text-text-4 font-mono mt-0.5",children:vt(l.requestedAt)})]}),r.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>a(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[r.jsx(Hb,{size:10})," Approve"]}),r.jsxs(ve,{variant:"danger",size:"sm",onClick:()=>s(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[r.jsx(jN,{size:10})," Reject"]})]})]},l.id)})]})}function AX(){const t=D(h=>h.resolvedApprovals),[a,s]=v.useState([]),[l,o]=v.useState(!0);v.useEffect(()=>{const h=setInterval(u,4e3);return u(),()=>clearInterval(h)},[]);async function u(){try{const h=await J.get("/pm/history");s(h.history||h||[])}catch{}o(!1)}const d=new Set,O=[...t,...a].filter(h=>{const p=h.id||`${h.agentName}-${h.timestamp}`;return d.has(p)?!1:(d.add(p),!0)});return r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r.jsx(ZX,{}),r.jsxs("div",{className:"p-4 space-y-1.5",children:[l&&O.length===0&&r.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!l&&O.length===0&&r.jsxs("div",{className:"text-center py-12",children:[r.jsx(ni,{size:24,className:"mx-auto mb-2 text-text-4"}),r.jsx("p",{className:"text-xs font-sans text-text-3",children:"No approval history"}),r.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Approvals appear when agents use Auto permission mode"})]}),O.map((h,p)=>{var g;const x=h.status==="approved"||h.verdict==="approved";return r.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-surface-0 border border-border-subtle",children:[x?r.jsx(ni,{size:12,className:"text-success flex-shrink-0"}):r.jsx(Xb,{size:12,className:"text-danger flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"text-xs text-text-1 font-sans truncate",children:[r.jsx("span",{className:"font-medium text-text-0",children:h.agentName}),r.jsx("span",{className:"text-text-3 mx-1",children:"·"}),r.jsx("span",{children:((g=h.action)==null?void 0:g.description)||h.action||"action"})]}),h.reason&&r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate mt-0.5",children:h.reason})]}),r.jsx("span",{className:"text-2xs font-mono text-text-4 flex-shrink-0",children:vt(h.resolvedAt||h.timestamp)})]},h.id||p)})]})]})}function EX(){const[t,a]=v.useState([]),[s,l]=v.useState(!0),o=Bl();v.useEffect(()=>{const O=setInterval(u,1e4);return u(),()=>clearInterval(O)},[]);async function u(){try{const O=await J.get("/schedules");a(O.schedules||O||[])}catch{}l(!1)}async function d(O,h){try{await J.post(`/schedules/${O}/${h?"disable":"enable"}`),u()}catch(p){o.error("Failed to toggle schedule",p.message)}}return r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsxs("div",{className:"p-4 space-y-2",children:[s&&t.length===0&&r.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!s&&t.length===0&&r.jsxs("div",{className:"text-center py-12",children:[r.jsx(xc,{size:24,className:"mx-auto mb-2 text-text-4"}),r.jsx("p",{className:"text-xs font-sans text-text-3",children:"No schedules configured"}),r.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Use the CLI to create agent schedules"})]}),t.map(O=>r.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:O.name}),r.jsx(Xe,{variant:O.enabled?"success":"default",className:"text-2xs",children:O.enabled?"Active":"Paused"})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx("span",{className:"text-2xs font-mono text-text-2",children:O.cron}),r.jsx("span",{className:"text-2xs text-text-4",children:"·"}),r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:O.role}),O.teamId&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-2xs text-text-4",children:"·"}),r.jsx("span",{className:"text-2xs font-sans text-text-3",children:O.teamName||O.teamId})]})]}),O.prompt&&r.jsx("div",{className:"text-2xs font-sans text-text-4 mt-1 truncate",children:O.prompt})]}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>d(O.id,O.enabled),className:"h-7 px-2.5 gap-1 text-2xs",children:O.enabled?r.jsxs(r.Fragment,{children:[r.jsx(eN,{size:10})," Pause"]}):r.jsxs(r.Fragment,{children:[r.jsx(lN,{size:10})," Enable"]})})]}),O.lastRunAt&&r.jsxs("div",{className:"px-4 py-1.5 border-t border-border-subtle bg-surface-1 text-2xs font-mono text-text-4",children:["Last run: ",vt(O.lastRunAt),O.nextRunAt&&r.jsxs("span",{className:"ml-3",children:["Next: ",vt(O.nextRunAt)]})]})]},O.id))]})})}function qX(){return r.jsxs(eS,{defaultValue:"dashboard",className:"flex flex-col h-full",children:[r.jsxs("div",{className:"px-4 pt-3 bg-surface-1 border-b border-border",children:[r.jsx("div",{className:"flex items-center gap-4 mb-0",children:r.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Management"})}),r.jsxs(tS,{className:"border-b-0",children:[r.jsxs(zl,{value:"dashboard",className:"inline-flex items-center gap-1.5",children:[r.jsx(NT,{size:12}),"Teams"]}),r.jsxs(zl,{value:"approvals",className:"inline-flex items-center gap-1.5",children:[r.jsx(zT,{size:12}),"Approvals"]}),r.jsxs(zl,{value:"schedules",className:"inline-flex items-center gap-1.5",children:[r.jsx(xc,{size:12}),"Schedules"]})]})]}),r.jsx(Rl,{value:"dashboard",className:"flex-1 min-h-0",children:r.jsx(_X,{})}),r.jsx(Rl,{value:"approvals",className:"flex-1 min-h-0",children:r.jsx(AX,{})}),r.jsx(Rl,{value:"schedules",className:"flex-1 min-h-0",children:r.jsx(EX,{})})]})}const MX={code:"Code",general:"General"},YX={light:"text-success",medium:"text-accent",heavy:"text-warning"};function UX(t){return t<1?`${Math.round(t*1024)} MB`:`${t} GB`}function cS({hardware:t}){if(!t)return null;const{totalRamGb:a,gpu:s,isAppleSilicon:l}=t;return r.jsxs("div",{className:"flex items-center gap-3 bg-surface-0 rounded-lg border border-border-subtle px-3 py-2.5",children:[r.jsx(th,{size:14,className:"text-text-3 flex-shrink-0"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsxs("div",{className:"flex items-center gap-2 text-xs font-sans",children:[r.jsxs("span",{className:"text-text-0 font-semibold",children:[a," GB RAM"]}),s&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-text-4",children:"·"}),r.jsx("span",{className:"text-text-2",children:s.name})]}),l&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Unified Memory"})]})})]})}function VX({onRecheck:t}){const[a,s]=v.useState(null),[l,o]=v.useState(!1),[u,d]=v.useState(!1),[O,h]=v.useState(!1),p=D(_=>_.addToast);v.useEffect(()=>{J.post("/providers/ollama/check").then(s).catch(()=>{})},[]);async function x(){o(!0);try{const _=await J.post("/providers/ollama/check");s(_),_.installed&&_.serverRunning?(p("success","Ollama is ready!"),t()):_.installed?p("info","Ollama installed — server needs to start"):p("info","Ollama not found — install and try again")}catch{}o(!1)}async function g(){d(!0);try{if((await J.post("/providers/ollama/serve")).ok){p("success","Ollama server started!");let G=!1;for(let R=0;R<5;R++){await new Promise(T=>setTimeout(T,2e3));const X=await J.post("/providers/ollama/check");if(s(X),X.serverRunning){G=!0;break}}G&&t()}}catch(_){p("error","Could not start server",_.message)}d(!1)}function b(_){navigator.clipboard.writeText(_),h(!0),setTimeout(()=>h(!1),2e3)}if(!a)return r.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{hardware:y,install:Q,requirements:w,installed:$,serverRunning:j}=a,z=y.totalRamGb>=w.minRAM,N=y.recommended;return r.jsxs("div",{className:"space-y-3 p-3",children:[r.jsx(cS,{hardware:y}),z?r.jsxs("div",{className:"flex items-start gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2.5",children:[r.jsx(Dt,{size:14,className:"text-success flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs font-sans",children:[r.jsx("span",{className:"text-success font-semibold",children:"Your system is ready."}),r.jsx("span",{className:"text-text-2 ml-1",children:N.code?`Recommended: ${N.code}`:`${y.totalRamGb} GB RAM available`})]})]}):r.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[r.jsx(ua,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs font-sans text-text-2",children:[r.jsxs("span",{className:"text-warning font-semibold",children:[y.totalRamGb," GB RAM detected."]})," ","Minimum ",w.minRAM," GB needed. Smallest models may still work."]})]}),$&&!j&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[r.jsx(ua,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs font-sans text-text-2",children:[r.jsx("span",{className:"text-warning font-semibold",children:"Ollama installed but server not running."})," ","The server needs to be running to pull and use models."]})]}),r.jsxs(ve,{variant:"primary",size:"md",onClick:g,disabled:u,className:"w-full gap-1.5",children:[r.jsx(Rn,{size:12}),u?"Starting...":"Start Ollama Server"]})]}),!$&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"text-xs font-semibold text-text-1 font-sans",children:"Install Ollama"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("code",{className:"flex-1 bg-surface-0 border border-border-subtle rounded-md px-3 py-2 text-xs font-mono text-text-1 truncate",children:Q.command}),r.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>b(Q.command),className:"h-8 px-2.5 gap-1 flex-shrink-0",children:[O?r.jsx(Dt,{size:12}):r.jsx(xf,{size:12}),O?"Copied":"Copy"]})]}),Q.alt&&r.jsx("p",{className:"text-2xs text-text-4 font-sans",children:Q.alt})]}),r.jsxs(ve,{variant:"secondary",size:"md",onClick:x,disabled:l,className:"w-full gap-1.5",children:[r.jsx(zn,{size:12,className:l?"animate-spin":""}),l?"Checking...":$?"Check again":"I installed it — check again"]})]})}function GX({model:t,isInstalled:a,isRecommended:s,canRun:l,onPull:o,onDelete:u,pulling:d}){const O=d===t.id;return r.jsxs("div",{className:re("flex items-center gap-2 px-3 py-2 border-t border-border-subtle transition-colors",!l&&"opacity-40"),children:[a?r.jsx(Dt,{size:12,className:"text-success flex-shrink-0"}):r.jsx("div",{className:"w-3"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs font-mono text-text-1 truncate",children:t.name}),s&&r.jsx(Ib,{size:10,className:"text-warning flex-shrink-0"})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[r.jsx("span",{className:re("text-2xs font-semibold font-sans",YX[t.tier]),children:t.tier}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:UX(t.sizeGb)}),r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["· ",t.ramGb," GB RAM"]})]})]}),a?r.jsx("button",{onClick:()=>u(t.id),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Remove model",children:r.jsx(as,{size:12})}):l?r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>o(t.id),disabled:!!d,className:"h-7 px-2 text-2xs gap-1",children:O?r.jsxs(r.Fragment,{children:[r.jsx(zn,{size:10,className:"animate-spin"})," Pulling..."]}):r.jsxs(r.Fragment,{children:[r.jsx(mi,{size:10})," Pull"]})}):r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["Needs ",t.ramGb," GB"]})]})}function LX({onStopped:t}){const[a,s]=v.useState(null),l=D(d=>d.addToast);async function o(){s("stopping");try{(await J.post("/providers/ollama/stop")).ok?(l("info","Ollama server stopped"),t&&t()):l("error","Could not stop server")}catch(d){l("error","Stop failed",d.message)}s(null)}async function u(){s("restarting");try{(await J.post("/providers/ollama/restart")).ok?l("success","Ollama server restarted"):l("error","Restart failed")}catch(d){l("error","Restart failed",d.message)}s(null)}return r.jsxs("div",{className:"flex items-center gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2",children:[r.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[r.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),r.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),r.jsx("span",{className:"text-xs font-sans text-success font-semibold",children:"Server Running"}),r.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),r.jsx("div",{className:"flex-1"}),r.jsxs("button",{onClick:u,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-accent cursor-pointer transition-colors disabled:opacity-40",children:[r.jsx(zn,{size:10,className:a==="restarting"?"animate-spin":""}),a==="restarting"?"Restarting...":"Restart"]}),r.jsxs("button",{onClick:o,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-danger cursor-pointer transition-colors disabled:opacity-40",children:[r.jsx(ua,{size:10}),a==="stopping"?"Stopping...":"Stop"]})]})}function DX({onModelChange:t}){var T,V;const[a,s]=v.useState(null),[l,o]=v.useState(null),[u,d]=v.useState("code"),[O,h]=v.useState(!1),[p,x]=v.useState(!1),g=D(M=>M.addToast),b=v.useRef(!1);function y(){J.get("/providers/ollama/models").then(M=>{var ae;s(M),!b.current&&((ae=M.installed)==null?void 0:ae.length)===0&&(b.current=!0,setTimeout(y,2e3))}).catch(()=>{})}v.useEffect(()=>{y()},[]);async function Q(M){o(M);try{await J.post("/providers/ollama/pull",{model:M}),g("success",`Pulled ${M}`),y(),t&&t()}catch(ae){g("error",`Pull failed: ${ae.message}`)}o(null)}async function w(M){try{await J.delete(`/providers/ollama/models/${encodeURIComponent(M)}`),g("info",`Removed ${M}`),y(),t&&t()}catch(ae){g("error",`Delete failed: ${ae.message}`)}}if(!a)return r.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{installed:$,catalog:j,hardware:z}=a,N=new Set($.map(M=>M.id)),_=z.totalRamGb,G=[(T=z.recommended)==null?void 0:T.code,(V=z.recommended)==null?void 0:V.general].filter(Boolean),R=j.filter(M=>M.category===u),X=O?R:R.filter(M=>M.ramGb<=_);return p?r.jsxs("div",{className:"space-y-3 p-3",children:[r.jsxs("div",{className:"flex items-center gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[r.jsx(ua,{size:14,className:"text-warning flex-shrink-0"}),r.jsxs("span",{className:"text-xs font-sans text-text-2",children:[r.jsx("span",{className:"text-warning font-semibold",children:"Ollama server stopped."})," ","Start it again to pull and use models."]})]}),r.jsxs(ve,{variant:"primary",size:"md",onClick:async()=>{try{(await J.post("/providers/ollama/serve")).ok&&(g("success","Ollama server started!"),x(!1),b.current=!1,setTimeout(y,2e3))}catch(M){g("error","Could not start server",M.message)}},className:"w-full gap-1.5",children:[r.jsx(Rn,{size:12}),"Start Ollama Server"]})]}):r.jsxs("div",{className:"space-y-2 p-3",children:[r.jsx(LX,{onStopped:()=>x(!0)}),r.jsx(cS,{hardware:z}),$.length>0&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-sans text-text-2",children:[r.jsx(Jf,{size:12,className:"text-text-3"}),r.jsx("span",{className:"font-semibold",children:$.length})," model",$.length!==1?"s":""," installed"]}),r.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:Object.entries(MX).map(([M,ae])=>r.jsx("button",{onClick:()=>d(M),className:re("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",u===M?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:ae},M))}),r.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[X.map(M=>r.jsx(GX,{model:M,isInstalled:N.has(M.id),isRecommended:G.includes(M.id),canRun:M.ramGb<=_,onPull:Q,onDelete:w,pulling:l},M.id)),X.length===0&&r.jsxs("div",{className:"px-3 py-4 text-center text-xs text-text-4 font-sans",children:["No ",u," models available for your hardware"]})]}),!O&&R.length>X.length&&r.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-1 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[r.jsx(ca,{size:10}),"Show ",R.length-X.length," more (exceed your RAM)"]})]})}function uS({isInstalled:t,onModelChange:a}){const[s,l]=v.useState(!1),[o,u]=v.useState(!1);return v.useEffect(()=>{t?J.post("/providers/ollama/check").then(d=>{l(d.installed&&d.serverRunning),u(!0)}).catch(()=>u(!0)):u(!0)},[t]),o?s?r.jsx(DX,{onModelChange:a}):r.jsx(VX,{onRecheck:()=>{l(!0),a&&a()}}):r.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Checking Ollama..."})}var IO="focusScope.autoFocusOnMount",FO="focusScope.autoFocusOnUnmount",O0={bubbles:!1,cancelable:!0},WX="FocusScope",dS=v.forwardRef((t,a)=>{const{loop:s=!1,trapped:l=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=t,[O,h]=v.useState(null),p=zt(o),x=zt(u),g=v.useRef(null),b=it(a,w=>h(w)),y=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(l){let w=function(N){if(y.paused||!O)return;const _=N.target;O.contains(_)?g.current=_:La(g.current,{select:!0})},$=function(N){if(y.paused||!O)return;const _=N.relatedTarget;_!==null&&(O.contains(_)||La(g.current,{select:!0}))},j=function(N){if(document.activeElement===document.body)for(const G of N)G.removedNodes.length>0&&La(O)};document.addEventListener("focusin",w),document.addEventListener("focusout",$);const z=new MutationObserver(j);return O&&z.observe(O,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",$),z.disconnect()}}},[l,O,y.paused]),v.useEffect(()=>{if(O){h0.add(y);const w=document.activeElement;if(!O.contains(w)){const j=new CustomEvent(IO,O0);O.addEventListener(IO,p),O.dispatchEvent(j),j.defaultPrevented||(BX(JX(OS(O)),{select:!0}),document.activeElement===w&&La(O))}return()=>{O.removeEventListener(IO,p),setTimeout(()=>{const j=new CustomEvent(FO,O0);O.addEventListener(FO,x),O.dispatchEvent(j),j.defaultPrevented||La(w??document.body,{select:!0}),O.removeEventListener(FO,x),h0.remove(y)},0)}}},[O,p,x,y]);const Q=v.useCallback(w=>{if(!s&&!l||y.paused)return;const $=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,j=document.activeElement;if($&&j){const z=w.currentTarget,[N,_]=HX(z);N&&_?!w.shiftKey&&j===_?(w.preventDefault(),s&&La(N,{select:!0})):w.shiftKey&&j===N&&(w.preventDefault(),s&&La(_,{select:!0})):j===z&&w.preventDefault()}},[s,l,y.paused]);return r.jsx(Be.div,{tabIndex:-1,...d,ref:b,onKeyDown:Q})});dS.displayName=WX;function BX(t,{select:a=!1}={}){const s=document.activeElement;for(const l of t)if(La(l,{select:a}),document.activeElement!==s)return}function HX(t){const a=OS(t),s=f0(a,t),l=f0(a.reverse(),t);return[s,l]}function OS(t){const a=[],s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const o=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||o?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)a.push(s.currentNode);return a}function f0(t,a){for(const s of t)if(!IX(s,{upTo:a}))return s}function IX(t,{upTo:a}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(a!==void 0&&t===a)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function FX(t){return t instanceof HTMLInputElement&&"select"in t}function La(t,{select:a=!1}={}){if(t&&t.focus){const s=document.activeElement;t.focus({preventScroll:!0}),t!==s&&FX(t)&&a&&t.select()}}var h0=KX();function KX(){let t=[];return{add(a){const s=t[0];a!==s&&(s==null||s.pause()),t=m0(t,a),t.unshift(a)},remove(a){var s;t=m0(t,a),(s=t[0])==null||s.resume()}}}function m0(t,a){const s=[...t],l=s.indexOf(a);return l!==-1&&s.splice(l,1),s}function JX(t){return t.filter(a=>a.tagName!=="A")}var KO=0;function e_(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??p0()),document.body.insertAdjacentElement("beforeend",t[1]??p0()),KO++,()=>{KO===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),KO--}},[])}function p0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var kn=function(){return kn=Object.assign||function(a){for(var s,l=1,o=arguments.length;l<o;l++){s=arguments[l];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(a[u]=s[u])}return a},kn.apply(this,arguments)};function fS(t,a){var s={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&a.indexOf(l)<0&&(s[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(t);o<l.length;o++)a.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(t,l[o])&&(s[l[o]]=t[l[o]]);return s}function t_(t,a,s){if(s||arguments.length===2)for(var l=0,o=a.length,u;l<o;l++)(u||!(l in a))&&(u||(u=Array.prototype.slice.call(a,0,l)),u[l]=a[l]);return t.concat(u||Array.prototype.slice.call(a))}var oc="right-scroll-bar-position",cc="width-before-scroll-bar",n_="with-scroll-bars-hidden",a_="--removed-body-scroll-bar-size";function JO(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function s_(t,a){var s=v.useState(function(){return{value:t,callback:a,facade:{get current(){return s.value},set current(l){var o=s.value;o!==l&&(s.value=l,s.callback(l,o))}}}})[0];return s.callback=a,s.facade}var l_=typeof window<"u"?v.useLayoutEffect:v.useEffect,x0=new WeakMap;function r_(t,a){var s=s_(null,function(l){return t.forEach(function(o){return JO(o,l)})});return l_(function(){var l=x0.get(s);if(l){var o=new Set(l),u=new Set(t),d=s.current;o.forEach(function(O){u.has(O)||JO(O,null)}),u.forEach(function(O){o.has(O)||JO(O,d)})}x0.set(s,t)},[t]),s}function i_(t){return t}function o_(t,a){a===void 0&&(a=i_);var s=[],l=!1,o={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:t},useMedium:function(u){var d=a(u,l);return s.push(d),function(){s=s.filter(function(O){return O!==d})}},assignSyncMedium:function(u){for(l=!0;s.length;){var d=s;s=[],d.forEach(u)}s={push:function(O){return u(O)},filter:function(){return s}}},assignMedium:function(u){l=!0;var d=[];if(s.length){var O=s;s=[],O.forEach(u),d=s}var h=function(){var x=d;d=[],x.forEach(u)},p=function(){return Promise.resolve().then(h)};p(),s={push:function(x){d.push(x),p()},filter:function(x){return d=d.filter(x),s}}}};return o}function c_(t){t===void 0&&(t={});var a=o_(null);return a.options=kn({async:!0,ssr:!1},t),a}var hS=function(t){var a=t.sideCar,s=fS(t,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=a.read();if(!l)throw new Error("Sidecar medium not found");return v.createElement(l,kn({},s))};hS.isSideCarExport=!0;function u_(t,a){return t.useMedium(a),hS}var mS=c_(),ef=function(){},Kc=v.forwardRef(function(t,a){var s=v.useRef(null),l=v.useState({onScrollCapture:ef,onWheelCapture:ef,onTouchMoveCapture:ef}),o=l[0],u=l[1],d=t.forwardProps,O=t.children,h=t.className,p=t.removeScrollBar,x=t.enabled,g=t.shards,b=t.sideCar,y=t.noRelative,Q=t.noIsolation,w=t.inert,$=t.allowPinchZoom,j=t.as,z=j===void 0?"div":j,N=t.gapMode,_=fS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=b,R=r_([s,a]),X=kn(kn({},_),o);return v.createElement(v.Fragment,null,x&&v.createElement(G,{sideCar:mS,removeScrollBar:p,shards:g,noRelative:y,noIsolation:Q,inert:w,setCallbacks:u,allowPinchZoom:!!$,lockRef:s,gapMode:N}),d?v.cloneElement(v.Children.only(O),kn(kn({},X),{ref:R})):v.createElement(z,kn({},X,{className:h,ref:R}),O))});Kc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Kc.classNames={fullWidth:cc,zeroRight:oc};var d_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=d_();return a&&t.setAttribute("nonce",a),t}function f_(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function h_(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var m_=function(){var t=0,a=null;return{add:function(s){t==0&&(a=O_())&&(f_(a,s),h_(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},p_=function(){var t=m_();return function(a,s){v.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&s])}},pS=function(){var t=p_(),a=function(s){var l=s.styles,o=s.dynamic;return t(l,o),null};return a},x_={left:0,top:0,right:0,gap:0},tf=function(t){return parseInt(t||"",10)||0},g_=function(t){var a=window.getComputedStyle(document.body),s=a[t==="padding"?"paddingLeft":"marginLeft"],l=a[t==="padding"?"paddingTop":"marginTop"],o=a[t==="padding"?"paddingRight":"marginRight"];return[tf(s),tf(l),tf(o)]},b_=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return x_;var a=g_(t),s=document.documentElement.clientWidth,l=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,l-s+a[2]-a[0])}},v_=pS(),Cl="data-scroll-locked",y_=function(t,a,s,l){var o=t.left,u=t.top,d=t.right,O=t.gap;return s===void 0&&(s="margin"),`
|
|
588
|
+
`,{label:"if",detail:"block",type:"keyword"}),Fe("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Fe("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Fe("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Fe("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],SC=N0(Zy,P0(vC.concat(yC)));function GO(t){let{node:a,pos:s}=t,l=t.lineIndent(s,-1),o=null;for(;;){let u=a.childBefore(s);if(u)if(u.name=="Comment")s=u.from;else if(u.name=="Body"||u.name=="MatchBody")t.baseIndentFor(u)+t.unit<=l&&(o=u),a=u;else if(u.name=="MatchClause")a=u;else if(u.type.is("Statement"))a=u;else break;else break}return o}function LO(t,a){let s=t.baseIndentFor(a),l=t.lineAt(t.pos,-1),o=l.from+l.text.length;return/^\s*($|#)/.test(l.text)&&t.node.to<o+100&&!/\S/.test(t.state.sliceDoc(o,t.node.to))&&t.lineIndent(t.pos,-1)<=s||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>s?null:s+t.unit}const DO=Oi.define({name:"python",parser:xC.configure({props:[Ul.add({Body:t=>{var a;let s=/^\s*(#|$)/.test(t.textAfter)&&GO(t)||t.node;return(a=LO(t,s))!==null&&a!==void 0?a:t.continue()},MatchBody:t=>{var a;let s=GO(t);return(a=LO(t,s||t.node))!==null&&a!==void 0?a:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),"ForStatement WhileStatement":t=>/^\s*else:/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except[ :]|finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),MatchStatement:t=>/^\s*case /.test(t.textAfter)?t.baseIndent+t.unit:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":tc({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":tc({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":tc({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var a;let s=GO(t);return(a=s&&LO(t,s))!==null&&a!==void 0?a:t.continue()}}),Cs.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":_c,Body:(t,a)=>({from:t.from+1,to:t.to-(t.to==a.doc.length?0:1)}),"String FormatString":(t,a)=>({from:a.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function QC(){return new ks(DO,[DO.data.of({autocomplete:bC}),DO.data.of({autocomplete:SC})])}const Ho={javascript:()=>vf({jsx:!0,typescript:!1}),typescript:()=>vf({jsx:!0,typescript:!0}),css:()=>Cv(),html:()=>Kv(),json:()=>gz(),markdown:()=>aR(),python:()=>QC()},jC=Xl.theme({"&":{backgroundColor:"#24282f",color:"#bcc2cd",fontFamily:"var(--font-mono)",fontSize:"13px",height:"100%"},".cm-scroller":{overflow:"auto"},".cm-content":{caretColor:"#33afbc"},".cm-cursor":{borderLeftColor:"#33afbc"},".cm-gutters":{backgroundColor:"#24282f",borderRight:"1px solid #2c313a",color:"#505862"},".cm-activeLineGutter":{backgroundColor:"#2c313a"},".cm-activeLine":{backgroundColor:"rgba(44, 49, 58, 0.5)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"rgba(51, 175, 188, 0.15)"}},{dark:!0});function l0({content:t,language:a,onChange:s,onSave:l}){const o=v.useRef(null),u=v.useRef(null),d=v.useRef(new Mj),O=v.useRef(s),h=v.useRef(l);return O.current=s,h.current=l,v.useEffect(()=>{if(!o.current)return;const p=Ho[a]||Ho.javascript,x=lf.of([{key:"Mod-s",run:()=>{var y;return(y=h.current)==null||y.call(h),!0}}]),g=X0.create({doc:t||"",extensions:[Uj(),Vj(),Gj(),Lj(),Dj(),Wj(),Bj(),lf.of([...Hj,...Ij,...Fj]),x,Yj,jC,d.current.of(p()),Xl.updateListener.of(y=>{var Q;y.docChanged&&((Q=O.current)==null||Q.call(O,y.state.doc.toString()))})]}),b=new Xl({state:g,parent:o.current});return u.current=b,()=>{b.destroy(),u.current=null}},[]),v.useEffect(()=>{const p=u.current;if(!p)return;const x=p.state.doc.toString();t!==x&&p.dispatch({changes:{from:0,to:x.length,insert:t||""}})},[t]),v.useEffect(()=>{const p=u.current;if(!p)return;const x=Ho[a]||Ho.javascript;p.dispatch({effects:d.current.reconfigure(x())})},[a]),r.jsx("div",{ref:o,className:"w-full h-full overflow-hidden"})}const wC=["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif"],Ay=["mp4","webm","mov","avi","mkv","ogv"];function kC(t){var s;const a=(s=t.split(".").pop())==null?void 0:s.toLowerCase();return wC.includes(a)||Ay.includes(a)}function $C({path:t}){var u;const a=(u=t.split(".").pop())==null?void 0:u.toLowerCase(),s=`/api/files/raw?path=${encodeURIComponent(t)}`,l=t.split("/").pop(),o=Ay.includes(a);return r.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-surface-0 p-8 gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-3 font-sans",children:[r.jsx(Xe,{children:a==null?void 0:a.toUpperCase()}),r.jsx("span",{className:"font-mono",children:l}),r.jsx("a",{href:s,target:"_blank",rel:"noopener",className:"text-accent hover:text-accent/80 transition-colors",children:r.jsx(bc,{size:12})})]}),o?r.jsx("video",{src:s,controls:!0,className:"max-w-full max-h-[70vh] rounded-md border border-border"}):r.jsx("img",{src:s,alt:l,className:"max-w-full max-h-[70vh] rounded-md border border-border object-contain"})]})}function TC(t){var s;const a=(s=t==null?void 0:t.split(".").pop())==null?void 0:s.toLowerCase();return a==="html"||a==="htm"}function NC(){const t=D(j=>j.editorActiveFile),a=D(j=>j.editorFiles),s=D(j=>j.editorChangedFiles),l=D(j=>j.updateFileContent),o=D(j=>j.saveFile),u=D(j=>j.reloadFile),d=D(j=>j.dismissFileChange),[O,h]=v.useState(""),[p,x]=v.useState(!1),[g,b]=v.useState(0);v.useEffect(()=>{J.get("/files/root").then(j=>h(j.root||"")).catch(()=>{})},[]),v.useEffect(()=>{x(!1)},[t]);const y=t?a[t]:null,Q=t&&kC(t),w=t&&TC(t),$=t&&s[t];return r.jsxs("div",{className:"flex h-full",children:[r.jsx("div",{className:"w-60 flex-shrink-0 border-r border-border",children:r.jsx(WP,{rootDir:O})}),r.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[r.jsx(BP,{}),r.jsxs("div",{className:"flex-1 relative min-h-0",children:[$&&r.jsxs("div",{className:"absolute top-0 left-0 right-0 z-10 flex items-center gap-2 px-4 py-2 bg-warning/10 border-b border-warning/20",children:[r.jsx(gi,{size:14,className:"text-warning"}),r.jsx("span",{className:"text-xs text-warning font-sans flex-1",children:"File modified externally"}),r.jsxs(ve,{variant:"ghost",size:"sm",onClick:()=>u(t),children:[r.jsx(zn,{size:12})," Reload"]}),r.jsxs(ve,{variant:"ghost",size:"sm",onClick:()=>d(t),children:[r.jsx(Qt,{size:12})," Dismiss"]})]}),!t&&r.jsx("div",{className:"w-full h-full flex items-center justify-center text-text-4 font-sans",children:r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx(ns,{size:32,className:"mx-auto"}),r.jsx("p",{className:"text-sm",children:"Open a file from the tree"})]})}),t&&Q&&r.jsx($C,{path:t}),t&&!Q&&w&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"absolute top-0 right-4 z-10 flex items-center gap-0.5 mt-2 bg-surface-2 border border-border-subtle rounded-md p-0.5",children:[r.jsxs("button",{onClick:()=>x(!1),className:re("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",p?"text-text-3 hover:text-text-1":"bg-surface-4 text-text-0 font-medium"),children:[r.jsx(aT,{size:12})," Code"]}),r.jsxs("button",{onClick:()=>{x(!0),b(j=>j+1)},className:re("flex items-center gap-1.5 px-2.5 py-1 text-xs font-sans rounded cursor-pointer transition-colors",p?"bg-surface-4 text-text-0 font-medium":"text-text-3 hover:text-text-1"),children:[r.jsx(Dl,{size:12})," Preview"]})]}),p?r.jsx("iframe",{src:`/api/files/raw?path=${encodeURIComponent(t)}`,className:"w-full h-full border-0",sandbox:"allow-scripts allow-same-origin",title:"HTML Preview"},g):y&&r.jsx(l0,{content:y.content,language:y.language,onChange:j=>l(t,j),onSave:()=>o(t)})]}),t&&!Q&&!w&&y&&r.jsx(l0,{content:y.content,language:y.language,onChange:j=>l(t,j),onSave:()=>o(t)})]})]})]})}function PC(){var w;const t=D($=>$.connected),a=D($=>$.agents),[s,l]=v.useState(null),[o,u]=v.useState(!0),[d,O]=v.useState({tokens:[],cost:[],saved:[],efficiency:[],cache:[],inputOutput:[],agents:[],turns:[]}),h=v.useRef(0);v.useEffect(()=>{if(!t)return;let $=!0;async function j(){try{const N=await J.get("/dashboard");if(!$)return;l(N),u(!1),h.current=Date.now(),O(_=>{var F,le,oe,H,P,W,E,ce,ee;const G=Date.now(),R=(be,Se)=>[...be.slice(-59),{t:G,v:Se||0}],X=((F=N.tokens)==null?void 0:F.totalTokens)||0,T=((oe=(le=N.tokens)==null?void 0:le.savings)==null?void 0:oe.total)||0,V=X+T,M=((H=N.tokens)==null?void 0:H.totalInputTokens)||0,ae=((P=N.tokens)==null?void 0:P.totalOutputTokens)||0;return{tokens:R(_.tokens,X),cost:R(_.cost,(W=N.tokens)==null?void 0:W.totalCostUsd),saved:R(_.saved,T),efficiency:R(_.efficiency,V>0?T/V*100:0),cache:R(_.cache,(E=N.tokens)==null?void 0:E.cacheHitRate),inputOutput:R(_.inputOutput,ae>0?M/ae:0),agents:R(_.agents,((ce=N.agents)==null?void 0:ce.running)||0),turns:R(_.turns,(ee=N.tokens)==null?void 0:ee.totalTurns)}})}catch{$&&u(!1)}}j();const z=setInterval(j,4e3);return()=>{$=!1,clearInterval(z)}},[t]);const p=((w=s==null?void 0:s.agents)==null?void 0:w.breakdown)||[],x=(s==null?void 0:s.routing)||null,g=(s==null?void 0:s.rotation)||null,b=(s==null?void 0:s.adaptive)||[],y=(s==null?void 0:s.journalist)||null,Q=(g==null?void 0:g.rotating)||[];return{data:s,loading:o,agents:a,connected:t,kpiHistory:d,lastFetch:h.current,agentBreakdown:p,routing:x,rotation:g,adaptive:b,journalist:y,rotating:Q}}const r0=v.memo(function({connected:a,runningCount:s,totalCount:l,uptime:o,lastFetch:u,activeTeam:d}){return r.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-surface-1 border-b border-border",children:[r.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Command Center"}),d&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-text-4",children:"/"}),r.jsx("span",{className:"text-xs font-mono text-text-2",children:d.name})]}),r.jsx("div",{className:"flex-1"}),a&&r.jsxs("div",{className:"flex items-center gap-3.5 text-xs font-mono text-text-2",children:[r.jsxs("span",{children:[r.jsx("span",{className:"text-text-1",children:s}),r.jsxs("span",{className:"text-text-3",children:["/",l]}),r.jsx("span",{className:"ml-1 text-text-3",children:"agents"})]}),o>0&&r.jsxs("span",{className:"text-text-3",children:["Up ",Dc(o)]}),u>0&&r.jsxs("span",{className:"flex items-center gap-1 text-text-4",children:[r.jsx(zn,{size:9}),r.jsx("span",{children:vt(u)})]})]}),r.jsx(Ts,{status:a?"running":"crashed",size:"sm"})]})});function ln(t,a){const s=parseInt(t.slice(1,3),16),l=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${s},${l},${o},${a})`}const xe={surface0:"#1a1e25",surface4:"#2c313a",surface5:"#333842",text0:"#e6e6e6",text1:"#bcc2cd",text2:"#8b929e",text3:"#6e7681",text4:"#505862",accent:"#33afbc",success:"#4ae168",warning:"#e5c07b",danger:"#e06c75",info:"#61afef",purple:"#c678dd",orange:"#d19a66"};function zC({data:t,color:a=xe.accent,width:s=72,height:l=22}){if(!t||t.length<2)return r.jsx("div",{style:{width:s,height:l}});const o=t.map(x=>x.v),u=Math.min(...o),O=Math.max(...o)-u||1,h=t.map((x,g)=>{const b=g/(t.length-1)*s,y=l-(x.v-u)/O*(l-2)-1;return`${b},${y}`}).join(" "),p=`kpi-${a.replace("#","")}`;return r.jsxs("svg",{width:s,height:l,className:"flex-shrink-0",children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:"0.2"}),r.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:"0"})]})}),r.jsx("polygon",{points:`0,${l} ${h} ${s},${l}`,fill:`url(#${p})`}),r.jsx("polyline",{points:h,fill:"none",stroke:a,strokeWidth:"1.5",strokeLinejoin:"round",strokeOpacity:"0.8"})]})}const RC=v.memo(function({label:a,value:s,sparkData:l,color:o=xe.accent,className:u}){return r.jsxs("div",{className:re("flex items-center gap-2.5 px-3 py-2.5 min-w-0","bg-surface-1",u),children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5 truncate",children:a}),r.jsx("div",{className:"text-base font-semibold font-mono text-text-0 tabular-nums leading-none",children:s})]}),r.jsx(zC,{data:l,color:o})]})});function CC({kpis:t}){return r.jsx("div",{className:"flex flex-wrap border-b border-border",style:{background:"var(--color-surface-0)"},children:t.map(a=>r.jsx(RC,{label:a.label,value:a.value,sparkData:a.sparkData,color:a.color,className:re("flex-1 basis-[12.5%] min-w-[140px]","border-b border-r border-border")},a.label))})}const XC={actual:"ACT",estimated:"EST",local:"LOC"},_C=v.memo(function({agent:a,isRotating:s}){const l=a.status==="running"||a.status==="starting",o=Math.round((a.contextUsage||0)*100),u=s?"#c678dd":rh(a.status),d=a.quality,O=(d==null?void 0:d.toolSuccessRate)!=null?Math.round(d.toolSuccessRate*100):null,h=a.rotationThreshold?Math.round(a.rotationThreshold*100):null;return r.jsxs("div",{className:"px-3 py-2 hover:bg-surface-3 transition-colors space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[r.jsx("span",{className:"absolute inset-0 rounded-sm",style:{background:u}}),l&&r.jsx("span",{className:"absolute inset-[-2px] rounded-sm",style:{background:u,opacity:.15,animation:"node-pulse-bar 2s ease-in-out infinite"}})]}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate leading-none",children:a.name}),r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:a.role}),r.jsx("span",{className:"text-2xs text-text-4",children:"/"}),r.jsx("span",{className:"text-2xs font-mono text-text-3",children:ZC(a.model)})]})]}),r.jsx("div",{className:"flex-1"}),O!=null&&r.jsxs("span",{className:"text-2xs font-mono font-bold uppercase px-1 py-px rounded-sm flex-shrink-0",style:{color:O>=90?"#4ae168":O>=70?"#e5c07b":"#e06c75",background:O>=90?"rgba(74,225,104,0.1)":O>=70?"rgba(229,192,123,0.1)":"rgba(224,108,117,0.1)"},children:[O,"%"]}),a.costSource&&a.costSource!=="actual"&&r.jsx("span",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider flex-shrink-0",children:XC[a.costSource]||""}),r.jsxs("div",{className:"text-right flex-shrink-0",children:[r.jsx("div",{className:"text-xs font-mono text-text-1 tabular-nums leading-none",children:et(a.tokens||0)}),(a.costUsd||0)>0&&r.jsx("div",{className:"text-2xs font-mono text-text-3 mt-0.5",children:Lc(a.costUsd)})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"relative flex-1 h-[3px] bg-surface-4 rounded-full overflow-visible",children:[r.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full transition-all duration-700",style:{width:`${Math.max(o,1)}%`,background:o>80?"#e06c75":o>60?"#e5c07b":l?"#61afef":"#333842"}}),h&&r.jsx("div",{className:"absolute top-[-2px] w-px h-[7px]",style:{left:`${h}%`,background:"#c678dd"},title:`Rotation at ${h}%`})]}),r.jsxs("span",{className:"text-2xs font-mono text-text-2 tabular-nums flex-shrink-0 w-7 text-right",children:[o,"%"]})]})]})});function ZC(t){if(!t||t==="auto"||t==="default")return"default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gem ").replace("-preview",""):t.length>12?t.slice(0,12)+"...":t}const AC=v.memo(function({agentBreakdown:a,rotating:s=[]}){if(!(a!=null&&a.length))return r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"No agents"});const l={};for(const u of a){const d=u.teamId||"ungrouped";l[d]||(l[d]=[]),l[d].push(u)}const o=new Set(s);return r.jsx(fa,{className:"flex-1",children:r.jsx("div",{className:"py-1",children:Object.entries(l).map(([u,d])=>r.jsxs("div",{children:[r.jsx("div",{className:"px-3 pt-2 pb-1",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:u})}),d.map(O=>r.jsx(_C,{agent:O,isRotating:o.has(O.id)},O.id))]},u))})})}),EC=v.memo(function({data:a}){const s=v.useRef(null),l=v.useRef(null),[o,u]=v.useState({width:0,height:0}),[d,O]=v.useState(null),{width:h,height:p}=o,x={top:28,right:12,bottom:8,left:12},g=Math.max(h-x.left-x.right,0),b=Math.max(p-x.top-x.bottom,0),y=v.useMemo(()=>!a||a.length<2?[]:a.slice(1).map(($,j)=>{const z=a[j],N=($.t-z.t)/6e4,_=Math.max(($.tokens||0)-(z.tokens||0),0);return{burnRate:N>0?Math.round(_/N):0,cacheHitRate:$.cacheHitRate||0,running:$.running||0,agents:$.agents||0,t:$.t}}),[a]);v.useEffect(()=>{const $=s.current;if(!$)return;const j=new ResizeObserver(z=>{const{width:N,height:_}=z[0].contentRect;N>0&&_>0&&u({width:Math.floor(N),height:Math.floor(_)})});return j.observe($),()=>j.disconnect()},[]);const Q=v.useCallback($=>{const j=l.current;if(!j||!y.length||g<=0)return;const z=j.getBoundingClientRect(),N=$.clientX-z.left-x.left;if(N<0||N>g){O(null);return}const _=Math.round(N/g*(y.length-1));O({x:x.left+_/Math.max(y.length-1,1)*g,index:_})},[y,g,x.left]),w=v.useCallback(()=>O(null),[]);return v.useEffect(()=>{const $=l.current;if(!$||!y.length||h<=0||p<=0||g<=0||b<=0)return;const j=$.getContext("2d"),z=window.devicePixelRatio||1;$.width=h*z,$.height=p*z,j.scale(z,z),j.clearRect(0,0,h,p);const N=y.map(P=>P.burnRate),_=y.map(P=>P.cacheHitRate),G=y.map(P=>P.running),R=Math.max(...N,100),X=Math.max(...G,1),T=P=>x.left+P/Math.max(y.length-1,1)*g,V=P=>x.top+b-P/R*b,M=P=>x.top+b-P*b,ae=Math.max(g/y.length-1,2);for(let P=0;P<y.length;P++){const W=G[P];if(W<=0)continue;const E=W/X*b*.3,ce=T(P)-ae/2,ee=x.top+b-E;j.fillStyle=ln(xe.surface5,.5),j.fillRect(ce,ee,ae,E)}j.setLineDash([2,4]),j.strokeStyle=ln(xe.text4,.2),j.lineWidth=1;for(let P=1;P<=3;P++){const W=x.top+b/4*P;j.beginPath(),j.moveTo(x.left,W),j.lineTo(x.left+g,W),j.stroke()}j.setLineDash([]),j.font="9px 'JetBrains Mono Variable', monospace",j.textAlign="left",j.fillStyle=ln(xe.text3,.5),j.fillText(`${et(R)}/m`,x.left+4,x.top+10),j.fillText(`${et(Math.round(R/2))}/m`,x.left+4,x.top+b/2+4),j.beginPath(),j.moveTo(x.left,x.top+b);for(let P=0;P<y.length;P++)j.lineTo(T(P),V(N[P]));j.lineTo(T(y.length-1),x.top+b),j.closePath();const F=j.createLinearGradient(0,x.top,0,x.top+b);F.addColorStop(0,ln(xe.accent,.2)),F.addColorStop(.7,ln(xe.accent,.04)),F.addColorStop(1,ln(xe.accent,0)),j.fillStyle=F,j.fill(),j.beginPath(),j.strokeStyle=xe.accent,j.lineWidth=1.5,j.lineJoin="round";for(let P=0;P<y.length;P++){const W=T(P),E=V(N[P]);P===0?j.moveTo(W,E):j.lineTo(W,E)}j.stroke();const le=_.some(P=>P>0);if(le){j.beginPath(),j.strokeStyle=ln(xe.info,.45),j.lineWidth=1,j.lineJoin="round",j.setLineDash([2,3]);for(let P=0;P<y.length;P++){const W=T(P),E=M(_[P]);P===0?j.moveTo(W,E):j.lineTo(W,E)}j.stroke(),j.setLineDash([])}j.font="9px 'Inter Variable', sans-serif",j.textAlign="right";let oe=h-x.right-4;const H=14;if(le&&(j.fillStyle=ln(xe.info,.5),j.fillText("Cache %",oe,H),oe-=j.measureText("Cache %").width+4,j.beginPath(),j.arc(oe,H-3,2.5,0,Math.PI*2),j.fill(),oe-=14),j.fillStyle=ln(xe.surface5,.7),j.fillText("Agents",oe,H),oe-=j.measureText("Agents").width+4,j.beginPath(),j.arc(oe,H-3,2.5,0,Math.PI*2),j.fill(),oe-=14,j.fillStyle=xe.accent,j.fillText("Burn Rate",oe,H),oe-=j.measureText("Burn Rate").width+4,j.beginPath(),j.arc(oe,H-3,2.5,0,Math.PI*2),j.fill(),d&&d.index>=0&&d.index<y.length){const P=d.x,W=y[d.index];j.beginPath(),j.moveTo(P,x.top),j.lineTo(P,x.top+b),j.strokeStyle=ln(xe.text1,.15),j.lineWidth=1,j.stroke();const E=V(W.burnRate);j.beginPath(),j.arc(P,E,3,0,Math.PI*2),j.fillStyle=xe.accent,j.fill();const ce=[{label:"Burn",value:`${et(W.burnRate)}/m`,color:xe.accent},{label:"Cache",value:Ns(W.cacheHitRate*100),color:xe.info},{label:"Agents",value:`${W.running}/${W.agents}`,color:xe.text2}],ee=104,be=ce.length*16+12;let Se=P+12;Se+ee>h-8&&(Se=P-ee-12);const ye=Math.max(x.top,E-be/2);j.fillStyle=ln(xe.surface0,.92),j.beginPath(),j.roundRect(Se,ye,ee,be,4),j.fill(),j.strokeStyle=ln(xe.text4,.2),j.lineWidth=1,j.stroke(),j.textAlign="left",ce.forEach((Re,B)=>{const ue=ye+14+B*16;j.beginPath(),j.arc(Se+8,ue-3,2,0,Math.PI*2),j.fillStyle=Re.color,j.fill(),j.font="8px 'Inter Variable', sans-serif",j.fillStyle=xe.text3,j.fillText(Re.label,Se+14,ue),j.font="9px 'JetBrains Mono Variable', monospace",j.fillStyle=xe.text0,j.textAlign="right",j.fillText(Re.value,Se+ee-8,ue),j.textAlign="left"})}},[y,h,p,d,g,b,x]),r.jsx("div",{ref:s,className:"absolute inset-0",children:h>0&&p>0&&r.jsx("canvas",{ref:l,style:{width:h,height:p},className:"block cursor-crosshair",onMouseMove:Q,onMouseLeave:w})})}),qC=v.memo(function({cacheRead:a=0,cacheCreation:s=0,totalInput:l=0,size:o=140}){const u=v.useRef(null),d=a+s+l,O=d>0?a/d*100:0;return v.useEffect(()=>{const h=u.current;if(!h)return;const p=window.devicePixelRatio||1;h.width=o*p,h.height=o*p;const x=h.getContext("2d");x.scale(p,p),x.clearRect(0,0,o,o);const g=o/2,b=o/2,y=(o-12)/2,Q=5,w=135*Math.PI/180,$=405*Math.PI/180,j=$-w;if(x.beginPath(),x.arc(g,b,y,w,$),x.strokeStyle=xe.surface4,x.lineWidth=Q,x.lineCap="round",x.stroke(),d>0){const z=a/d,N=s/d;if(z>0){const _=w+j*z;x.beginPath(),x.arc(g,b,y,w,_),x.strokeStyle=xe.accent,x.lineWidth=Q,x.lineCap="round",x.stroke()}if(N>0){const _=w+j*z,G=_+j*N;x.beginPath(),x.arc(g,b,y,_,G),x.strokeStyle=xe.purple,x.lineWidth=Q,x.lineCap="butt",x.stroke()}}x.textAlign="center",x.textBaseline="middle",x.font=`600 ${o*.2}px 'JetBrains Mono Variable', monospace`,x.fillStyle=xe.text0,x.fillText(`${Math.round(O)}%`,g,b-3),x.font=`500 ${o*.08}px 'JetBrains Mono Variable', monospace`,x.fillStyle=xe.text3,x.fillText("CACHE",g,b+o*.13)},[a,s,l,o,d,O]),r.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-3 py-3",children:[r.jsx("canvas",{ref:u,className:"flex-shrink-0",style:{width:o,height:o}}),r.jsxs("div",{className:"w-full mt-3 space-y-1.5 max-w-[160px]",children:[r.jsx(WO,{color:xe.accent,label:"Read",value:et(a)}),r.jsx(WO,{color:xe.purple,label:"Create",value:et(s)}),r.jsx(WO,{color:xe.surface5,label:"Miss",value:et(Math.max(l-a-s,0))})]})]})});function WO({color:t,label:a,value:s}){return r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:t}}),r.jsx("span",{className:"text-text-3 uppercase tracking-wider flex-1",children:a}),r.jsx("span",{className:"text-text-1 tabular-nums",children:s})]})}const i0={heavy:xe.danger,medium:xe.warning,light:xe.success},o0={heavy:"Heavy",medium:"Medium",light:"Light"},MC=v.memo(function({routing:a,agentBreakdown:s}){if(!a)return null;const{byTier:l={},totalDecisions:o=0,autoRoutedCount:u=0}=a,d=["heavy","medium","light"],O=d.reduce((g,b)=>g+(l[b]||0),0),h={};for(const g of s||[]){const b=g.model||"default";h[b]||(h[b]={tokens:0,agents:0}),h[b].tokens+=g.tokens||0,h[b].agents+=1}const p=Object.entries(h).sort((g,b)=>b[1].tokens-g[1].tokens),x=p.length>0?p[0][1].tokens:0;return r.jsxs("div",{className:"flex flex-col h-full px-3 py-3 overflow-y-auto",children:[O>0&&r.jsxs("div",{className:"space-y-1.5 mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Tier Distribution"}),r.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto tabular-nums",children:[et(O)," decisions"]})]}),r.jsx("div",{className:"h-[6px] bg-surface-4 rounded-full overflow-hidden flex",children:d.map(g=>{const b=l[g]||0;if(b===0)return null;const y=b/O*100;return r.jsx("div",{className:"h-full transition-all duration-500",style:{width:`${y}%`,background:i0[g]},title:`${o0[g]}: ${b} (${Math.round(y)}%)`},g)})}),r.jsx("div",{className:"flex items-center gap-3",children:d.map(g=>{const b=l[g]||0;if(b===0)return null;const y=O>0?b/O*100:0;return r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:i0[g]}}),r.jsx("span",{className:"text-2xs font-mono text-text-2",children:o0[g]}),r.jsx("span",{className:"text-2xs font-mono text-text-4 tabular-nums",children:Ns(y)})]},g)})})]}),p.length>0&&r.jsxs("div",{className:"space-y-1.5 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider",children:"Models in Use"}),u>0&&r.jsxs("span",{className:"text-2xs font-mono text-text-4 ml-auto",children:[u," auto"]})]}),r.jsx("div",{className:"space-y-1.5",children:p.map(([g,b])=>{const y=x>0?b.tokens/x*100:0;return r.jsxs("div",{className:"space-y-0.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs font-mono text-text-1 flex-1 truncate",children:YC(g)}),r.jsxs("span",{className:"text-2xs font-mono text-text-3 tabular-nums",children:[b.agents," agent",b.agents!==1?"s":""]}),r.jsx("span",{className:"text-xs font-mono text-text-1 tabular-nums",children:et(b.tokens)})]}),r.jsx("div",{className:"h-[3px] bg-surface-4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.max(y,2)}%`,background:xe.accent}})})]},g)})})]}),O===0&&p.length===0&&r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono",children:"No routing data"})]})});function YC(t){if(!t||t==="auto"||t==="default")return"Default";const a=t.match(/^claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);return a?`${a[1][0].toUpperCase()}${a[1].slice(1)} ${a[2]}.${a[3]}`:t.startsWith("gemini-")?t.replace("gemini-","Gemini ").replace("-preview",""):t}function UC(t){const a=t+"CollectionProvider",[s,l]=Xs(a),[o,u]=s(a,{collectionRef:{current:null},itemMap:new Map}),d=w=>{const{scope:$,children:j}=w,z=Ga.useRef(null),N=Ga.useRef(new Map).current;return r.jsx(o,{scope:$,itemMap:N,collectionRef:z,children:j})};d.displayName=a;const O=t+"CollectionSlot",h=uc(O),p=Ga.forwardRef((w,$)=>{const{scope:j,children:z}=w,N=u(O,j),_=it($,N.collectionRef);return r.jsx(h,{ref:_,children:z})});p.displayName=O;const x=t+"CollectionItemSlot",g="data-radix-collection-item",b=uc(x),y=Ga.forwardRef((w,$)=>{const{scope:j,children:z,...N}=w,_=Ga.useRef(null),G=it($,_),R=u(x,j);return Ga.useEffect(()=>(R.itemMap.set(_,{ref:_,...N}),()=>void R.itemMap.delete(_))),r.jsx(b,{[g]:"",ref:G,children:z})});y.displayName=x;function Q(w){const $=u(t+"CollectionConsumer",w);return Ga.useCallback(()=>{const z=$.collectionRef.current;if(!z)return[];const N=Array.from(z.querySelectorAll(`[${g}]`));return Array.from($.itemMap.values()).sort((R,X)=>N.indexOf(R.ref.current)-N.indexOf(X.ref.current))},[$.collectionRef,$.itemMap])}return[{Provider:d,Slot:p,ItemSlot:y},Q,l]}var BO="rovingFocusGroup.onEntryFocus",VC={bubbles:!1,cancelable:!0},vi="RovingFocusGroup",[Nf,Ey,GC]=UC(vi),[LC,qy]=Xs(vi,[GC]),[DC,WC]=LC(vi),My=v.forwardRef((t,a)=>r.jsx(Nf.Provider,{scope:t.__scopeRovingFocusGroup,children:r.jsx(Nf.Slot,{scope:t.__scopeRovingFocusGroup,children:r.jsx(BC,{...t,ref:a})})}));My.displayName=vi;var BC=v.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:s,orientation:l,loop:o=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:O,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...g}=t,b=v.useRef(null),y=it(a,b),Q=ih(u),[w,$]=Mc({prop:d,defaultProp:O??null,onChange:h,caller:vi}),[j,z]=v.useState(!1),N=zt(p),_=Ey(s),G=v.useRef(!1),[R,X]=v.useState(0);return v.useEffect(()=>{const T=b.current;if(T)return T.addEventListener(BO,N),()=>T.removeEventListener(BO,N)},[N]),r.jsx(DC,{scope:s,orientation:l,dir:Q,loop:o,currentTabStopId:w,onItemFocus:v.useCallback(T=>$(T),[$]),onItemShiftTab:v.useCallback(()=>z(!0),[]),onFocusableItemAdd:v.useCallback(()=>X(T=>T+1),[]),onFocusableItemRemove:v.useCallback(()=>X(T=>T-1),[]),children:r.jsx(Be.div,{tabIndex:j||R===0?-1:0,"data-orientation":l,...g,ref:y,style:{outline:"none",...t.style},onMouseDown:qe(t.onMouseDown,()=>{G.current=!0}),onFocus:qe(t.onFocus,T=>{const V=!G.current;if(T.target===T.currentTarget&&V&&!j){const M=new CustomEvent(BO,VC);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const ae=_().filter(P=>P.focusable),F=ae.find(P=>P.active),le=ae.find(P=>P.id===w),H=[F,le,...ae].filter(Boolean).map(P=>P.ref.current);Vy(H,x)}}G.current=!1}),onBlur:qe(t.onBlur,()=>z(!1))})})}),Yy="RovingFocusGroupItem",Uy=v.forwardRef((t,a)=>{const{__scopeRovingFocusGroup:s,focusable:l=!0,active:o=!1,tabStopId:u,children:d,...O}=t,h=Tl(),p=u||h,x=WC(Yy,s),g=x.currentTabStopId===p,b=Ey(s),{onFocusableItemAdd:y,onFocusableItemRemove:Q,currentTabStopId:w}=x;return v.useEffect(()=>{if(l)return y(),()=>Q()},[l,y,Q]),r.jsx(Nf.ItemSlot,{scope:s,id:p,focusable:l,active:o,children:r.jsx(Be.span,{tabIndex:g?0:-1,"data-orientation":x.orientation,...O,ref:a,onMouseDown:qe(t.onMouseDown,$=>{l?x.onItemFocus(p):$.preventDefault()}),onFocus:qe(t.onFocus,()=>x.onItemFocus(p)),onKeyDown:qe(t.onKeyDown,$=>{if($.key==="Tab"&&$.shiftKey){x.onItemShiftTab();return}if($.target!==$.currentTarget)return;const j=FC($,x.orientation,x.dir);if(j!==void 0){if($.metaKey||$.ctrlKey||$.altKey||$.shiftKey)return;$.preventDefault();let N=b().filter(_=>_.focusable).map(_=>_.ref.current);if(j==="last")N.reverse();else if(j==="prev"||j==="next"){j==="prev"&&N.reverse();const _=N.indexOf($.currentTarget);N=x.loop?KC(N,_+1):N.slice(_+1)}setTimeout(()=>Vy(N))}}),children:typeof d=="function"?d({isCurrentTabStop:g,hasTabStop:w!=null}):d})})});Uy.displayName=Yy;var HC={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IC(t,a){return a!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function FC(t,a,s){const l=IC(t.key,s);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(l))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(l)))return HC[l]}function Vy(t,a=!1){const s=document.activeElement;for(const l of t)if(l===s||(l.focus({preventScroll:a}),document.activeElement!==s))return}function KC(t,a){return t.map((s,l)=>t[(a+l)%t.length])}var JC=My,eX=Uy,Fc="Tabs",[tX]=Xs(Fc,[qy]),Gy=qy(),[nX,wh]=tX(Fc),Ly=v.forwardRef((t,a)=>{const{__scopeTabs:s,value:l,onValueChange:o,defaultValue:u,orientation:d="horizontal",dir:O,activationMode:h="automatic",...p}=t,x=ih(O),[g,b]=Mc({prop:l,onChange:o,defaultProp:u??"",caller:Fc});return r.jsx(nX,{scope:s,baseId:Tl(),value:g,onValueChange:b,orientation:d,dir:x,activationMode:h,children:r.jsx(Be.div,{dir:x,"data-orientation":d,...p,ref:a})})});Ly.displayName=Fc;var Dy="TabsList",Wy=v.forwardRef((t,a)=>{const{__scopeTabs:s,loop:l=!0,...o}=t,u=wh(Dy,s),d=Gy(s);return r.jsx(JC,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:l,children:r.jsx(Be.div,{role:"tablist","aria-orientation":u.orientation,...o,ref:a})})});Wy.displayName=Dy;var By="TabsTrigger",Hy=v.forwardRef((t,a)=>{const{__scopeTabs:s,value:l,disabled:o=!1,...u}=t,d=wh(By,s),O=Gy(s),h=Ky(d.baseId,l),p=Jy(d.baseId,l),x=l===d.value;return r.jsx(eX,{asChild:!0,...O,focusable:!o,active:x,children:r.jsx(Be.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":p,"data-state":x?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:h,...u,ref:a,onMouseDown:qe(t.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?d.onValueChange(l):g.preventDefault()}),onKeyDown:qe(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&d.onValueChange(l)}),onFocus:qe(t.onFocus,()=>{const g=d.activationMode!=="manual";!x&&!o&&g&&d.onValueChange(l)})})})});Hy.displayName=By;var Iy="TabsContent",Fy=v.forwardRef((t,a)=>{const{__scopeTabs:s,value:l,forceMount:o,children:u,...d}=t,O=wh(Iy,s),h=Ky(O.baseId,l),p=Jy(O.baseId,l),x=l===O.value,g=v.useRef(x);return v.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),r.jsx(bn,{present:o||x,children:({present:b})=>r.jsx(Be.div,{"data-state":x?"active":"inactive","data-orientation":O.orientation,role:"tabpanel","aria-labelledby":h,hidden:!b,id:p,tabIndex:0,...d,ref:a,style:{...t.style,animationDuration:g.current?"0s":void 0},children:b&&u})})});Fy.displayName=Iy;function Ky(t,a){return`${t}-trigger-${a}`}function Jy(t,a){return`${t}-content-${a}`}var aX=Ly,sX=Wy,lX=Hy,rX=Fy;function eS({children:t,...a}){return r.jsx(aX,{...a,children:t})}function tS({children:t,className:a,...s}){return r.jsx(sX,{className:re("flex items-center gap-0 border-b border-border-subtle",a),...s,children:t})}function zl({children:t,className:a,...s}){return r.jsx(lX,{className:re("px-3 py-2 text-sm font-medium font-sans text-text-2","border-b-2 border-transparent","hover:text-text-0 hover:bg-surface-5/50","data-[state=active]:text-text-0 data-[state=active]:border-accent","transition-colors duration-100 cursor-pointer select-none","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",a),...s,children:t})}function Rl({children:t,className:a,...s}){return r.jsx(rX,{className:re("flex-1 min-h-0",a),...s,children:t})}function c0({data:t,color:a=xe.accent,width:s=60,height:l=16}){if(!t||t.length<2)return r.jsx("div",{style:{width:s,height:l}});const o=Array.isArray(t[0])?t:t.map(p=>typeof p=="number"?p:p.v),u=Math.min(...o),O=Math.max(...o)-u||1,h=o.map((p,x)=>{const g=x/(o.length-1)*s,b=l-(p-u)/O*(l-2)-1;return`${g},${b}`}).join(" ");return r.jsx("svg",{width:s,height:l,className:"flex-shrink-0",children:r.jsx("polyline",{points:h,fill:"none",stroke:a,strokeWidth:"1",strokeLinejoin:"round",strokeOpacity:"0.7"})})}function HO({label:t,value:a,total:s,color:l}){const o=s>0?a/s*100:0;return r.jsxs("div",{className:"space-y-0.5",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs font-mono",children:[r.jsx("span",{className:"text-text-2",children:t}),r.jsx("span",{className:"text-text-1 tabular-nums",children:et(a)})]}),r.jsx("div",{className:"h-[2px] bg-surface-4 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(o,100)}%`,background:l}})})]})}function iX({tokens:t,rotation:a}){var d;const s=(t==null?void 0:t.savings)||{},l=s.total||0,u=((t==null?void 0:t.totalTokens)||0)+l;return r.jsxs("div",{className:"p-3 space-y-4",children:[r.jsxs("div",{className:"flex gap-4",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Rotations"}),r.jsx("div",{className:"text-xl font-mono font-semibold text-text-0 tabular-nums leading-none",children:(a==null?void 0:a.totalRotations)||0})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Saved"}),r.jsx("div",{className:"text-xl font-mono font-semibold text-success tabular-nums leading-none",children:et(l)}),u>0&&r.jsxs("div",{className:"text-2xs font-mono text-text-3 mt-0.5",children:[Ns(l/u*100)," of total"]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(HO,{label:"Rotation",value:s.fromRotation||0,total:u,color:xe.accent}),r.jsx(HO,{label:"Conflict prevention",value:s.fromConflictPrevention||0,total:u,color:xe.purple}),r.jsx(HO,{label:"Cold-start skip",value:s.fromColdStartSkip||0,total:u,color:xe.info})]}),((d=a==null?void 0:a.history)==null?void 0:d.length)>0&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1.5",children:"Recent"}),r.jsx("div",{className:"space-y-1",children:a.history.slice(-8).reverse().map((O,h)=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono px-2 py-1 bg-surface-0 rounded",children:[r.jsx("span",{className:"text-text-1 font-medium capitalize truncate flex-1",children:O.agentName||O.role}),r.jsx("span",{className:"text-text-3 tabular-nums",children:Ns((O.contextUsage||0)*100)}),r.jsx("span",{className:"text-text-4",children:vt(O.timestamp)})]},h))})]})]})}function oX({adaptive:t}){if(!(t!=null&&t.length))return r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"No adaptive profiles"});function a(s){const l=s.split(":");return{provider:l[0]||s,role:l[1]||""}}return r.jsx("div",{children:r.jsxs("div",{className:"p-3 space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2 px-2 pb-1 text-2xs font-mono text-text-4 uppercase tracking-wider",children:[r.jsx("span",{className:"flex-1",children:"Role"}),r.jsx("span",{className:"w-12 text-right",children:"Threshold"}),r.jsx("span",{className:"w-12 text-right",children:"Adj."}),r.jsx("span",{className:"w-14 text-right",children:"Status"})]}),t.map(s=>{var O,h;const{provider:l,role:o}=a(s.key),u=((O=s.thresholdHistory)==null?void 0:O.length)>1,d=((h=s.recentScores)==null?void 0:h.length)>1;return r.jsxs("div",{className:"bg-surface-0 rounded px-2 py-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"text-xs font-mono text-text-1 capitalize",children:o||l}),o&&r.jsx("span",{className:"text-2xs font-mono text-text-4 ml-1.5",children:l})]}),r.jsx("span",{className:"w-12 text-right text-xs font-mono font-semibold text-text-0 tabular-nums",children:Ns(s.threshold*100)}),r.jsx("span",{className:"w-12 text-right text-2xs font-mono text-text-3 tabular-nums",children:s.adjustments}),r.jsx("span",{className:re("w-14 text-right text-2xs font-mono font-bold uppercase",s.converged?"text-success":"text-text-4"),children:s.converged?"Converged":"Learning"})]}),(u||d)&&r.jsxs("div",{className:"flex items-center gap-3 mt-1.5 pl-1",children:[u&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-2xs font-mono text-text-4",children:"Threshold"}),r.jsx(c0,{data:s.thresholdHistory.map(p=>p.v),color:s.converged?xe.success:xe.accent,width:70,height:12})]}),d&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-2xs font-mono text-text-4",children:"Quality"}),r.jsx(c0,{data:s.recentScores,color:xe.warning,width:70,height:12})]})]})]},s.key)})]})})}function cX({journalist:t}){var a;return t?r.jsx("div",{children:r.jsxs("div",{className:"p-3 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Cycles"}),r.jsx("div",{className:"text-lg font-mono font-semibold text-text-0 tabular-nums leading-none",children:t.cycleCount||0})]}),t.lastCycleAt&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-0.5",children:"Last"}),r.jsx("div",{className:"text-xs font-mono text-text-2",children:vt(t.lastCycleAt)})]}),t.synthesizing&&r.jsx("span",{className:"text-2xs font-mono font-bold text-accent uppercase tracking-wider animate-pulse",children:"Synthesizing"})]}),t.lastSummary&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Summary"}),r.jsx("div",{className:"text-xs font-sans text-text-2 leading-relaxed",children:t.lastSummary})]}),t.projectMap&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Project Map"}),r.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.projectMap})]}),t.decisions&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1",children:"Decisions"}),r.jsx("div",{className:"text-xs font-mono text-text-2 leading-relaxed whitespace-pre-wrap",children:t.decisions})]}),((a=t.recentHistory)==null?void 0:a.length)>0&&r.jsxs("div",{children:[r.jsx("div",{className:"text-2xs font-mono text-text-3 uppercase tracking-wider mb-1.5",children:"History"}),r.jsx("div",{className:"space-y-1",children:t.recentHistory.slice().reverse().map((s,l)=>r.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono px-2 py-1 bg-surface-0 rounded",children:[r.jsxs("span",{className:"text-text-3",children:["#",s.cycle]}),r.jsxs("span",{className:"text-text-2 flex-1 truncate",children:[s.agentCount," agents"]}),r.jsx("span",{className:"text-text-4",children:vt(s.timestamp)})]},l))})]})]})}):r.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-text-3 font-mono p-4",children:"Journalist inactive"})}const uX=v.memo(function({tokens:a,rotation:s,adaptive:l,journalist:o}){return r.jsxs(eS,{defaultValue:"rotation",className:"flex flex-col h-full",children:[r.jsxs(tS,{className:"flex-shrink-0 px-1",children:[r.jsxs(zl,{value:"rotation",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[r.jsx(Wl,{size:11}),"Rotation"]}),r.jsxs(zl,{value:"adaptive",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[r.jsx(T5,{size:11}),"Adaptive"]}),r.jsxs(zl,{value:"journalist",className:"text-xs px-2.5 py-1.5 inline-flex items-center gap-1.5",children:[r.jsx(nh,{size:11}),"Journalist"]})]}),r.jsx(Rl,{value:"rotation",className:"flex-1 min-h-0 relative",children:r.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:r.jsx(iX,{tokens:a,rotation:s})})}),r.jsx(Rl,{value:"adaptive",className:"flex-1 min-h-0 relative",children:r.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:r.jsx(oX,{adaptive:l})})}),r.jsx(Rl,{value:"journalist",className:"flex-1 min-h-0 relative",children:r.jsx("div",{className:"absolute inset-0 overflow-y-auto",children:r.jsx(cX,{journalist:o})})})]})}),dX={spawn:qN,complete:ni,crash:gi,kill:Xb,rotate:Wl,error:sh},OX={spawn:"text-accent",complete:"text-success",crash:"text-danger",kill:"text-text-3",rotate:"text-purple",error:"text-danger"};function fX(t){const a=t.agentName||t.role||"";switch(t.type){case"spawn":return`${a} spawned`;case"complete":return`${a} completed`;case"crash":return`${a} crashed`;case"kill":return`${a} killed`;case"rotate":return`${a} rotated`;default:return t.text||t.type||"event"}}const hX=v.memo(function({events:a=[]}){return a.length?r.jsx("div",{className:"flex items-center gap-3 overflow-x-auto py-2 px-3",children:a.slice(-15).reverse().map((s,l)=>{const o=dX[s.type]||Rn,u=OX[s.type]||"text-text-3",d=fX(s);return r.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[r.jsx(o,{size:11,className:u}),r.jsx("span",{className:"text-xs font-sans text-text-2 whitespace-nowrap",children:d}),r.jsx("span",{className:"text-2xs font-mono text-text-4",children:vt(s.t||s.timestamp)})]},l)})}):r.jsx("div",{className:"text-xs text-text-3 font-mono py-2.5 text-center",children:"No recent activity"})});function rn({className:t,...a}){return r.jsx("div",{className:re("rounded-md bg-surface-4","bg-gradient-to-r from-surface-4 via-surface-5 to-surface-4","bg-[length:200%_100%] animate-[shimmer_1.5s_ease-in-out_infinite]",t),...a})}function mX(){return r.jsxs("div",{className:"flex-1 grid gap-px p-0",style:{gridTemplateRows:"auto minmax(0, 1fr) minmax(0, 1fr)",gridTemplateColumns:"3fr 1.5fr 1.5fr",background:"#282c34"},children:[r.jsx("div",{className:"col-span-3",children:r.jsx(rn,{className:"h-[72px] rounded-none"})}),r.jsx(rn,{className:"rounded-none"}),r.jsx(rn,{className:"rounded-none"}),r.jsx(rn,{className:"rounded-none"}),r.jsx(rn,{className:"rounded-none"}),r.jsx("div",{className:"col-span-2",children:r.jsx(rn,{className:"h-full rounded-none"})})]})}function pX(){const{data:t,loading:a,agents:s,connected:l,kpiHistory:o,lastFetch:u,agentBreakdown:d,routing:O,rotation:h,adaptive:p,journalist:x,rotating:g}=PC(),b=s.filter(R=>R.status==="running").length;if(!l)return r.jsx("div",{className:"w-full h-full flex items-center justify-center",children:r.jsxs("div",{className:"text-center space-y-2 text-text-3 font-mono",children:[r.jsx(Vc,{size:28,className:"mx-auto"}),r.jsx("p",{className:"text-xs",children:"Connecting to daemon..."})]})});if(a||!t)return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx(r0,{connected:l,runningCount:0,totalCount:0,uptime:0,lastFetch:0}),r.jsx(mX,{})]});const y=t.tokens||{},Q={totalTokens:y.totalTokens||0,totalCostUsd:y.totalCostUsd||0,totalInputTokens:y.totalInputTokens||0,totalOutputTokens:y.totalOutputTokens||0,cacheReadTokens:y.cacheReadTokens||0,cacheCreationTokens:y.cacheCreationTokens||0,cacheHitRate:y.cacheHitRate||0,totalTurns:y.totalTurns||0,agentCount:y.agentCount||0,savings:y.savings||{}},w=Q.totalTokens+(Q.savings.total||0),$=w>0?(Q.savings.total||0)/w*100:0,j=Q.totalOutputTokens>0?(Q.totalInputTokens/Q.totalOutputTokens).toFixed(1):"—",z=t.timeline||{},N=z.snapshots||[],_=z.events||t.events||[],G=[{label:"Tokens Used",value:et(Q.totalTokens),sparkData:o.tokens,color:xe.accent},{label:"Total Cost",value:Lc(Q.totalCostUsd),sparkData:o.cost,color:xe.warning},{label:"Tokens Saved",value:et(Q.savings.total||0),sparkData:o.saved,color:xe.success},{label:"Efficiency",value:Ns($),sparkData:o.efficiency,color:xe.purple},{label:"Cache Rate",value:Ns(Q.cacheHitRate*100),sparkData:o.cache,color:xe.info},{label:"I/O Ratio",value:`${j}:1`,sparkData:o.inputOutput,color:xe.orange},{label:"Agents",value:`${b}/${s.length}`,sparkData:o.agents,color:xe.accent},{label:"Turns",value:et(Q.totalTurns),sparkData:o.turns,color:xe.text2}];return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx(r0,{connected:l,runningCount:b,totalCount:s.length,uptime:t.uptime||0,lastFetch:u,activeTeam:t.activeTeam}),r.jsx(CC,{kpis:G}),r.jsxs("div",{className:"flex-1 min-h-0 grid",style:{gridTemplateRows:"minmax(0, 1fr) minmax(0, 1fr)",gridTemplateColumns:"3fr 1.5fr 1.5fr",background:"#282c34",gap:"1px"},children:[r.jsx("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 relative",children:r.jsx(EC,{data:N})}),r.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[r.jsx("div",{className:"px-3 pt-2.5 pb-1",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Cache Performance"})}),r.jsx(qC,{cacheRead:Q.cacheReadTokens,cacheCreation:Q.cacheCreationTokens,totalInput:Q.totalInputTokens})]}),r.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-l border-border",children:[r.jsx("div",{className:"px-3 pt-2.5 pb-1",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Model Routing"})}),r.jsx(MC,{routing:O,agentBreakdown:d})]}),r.jsxs("div",{className:"min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-border",children:[r.jsx("div",{className:"px-3 pt-2.5 pb-1 flex-shrink-0",children:r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase tracking-widest",children:"Agent Fleet"})}),r.jsx(AC,{agentBreakdown:d,rotating:g})]}),r.jsx("div",{className:"col-span-2 min-w-0 min-h-0 overflow-hidden bg-surface-1 flex flex-col border-t border-l border-border",children:r.jsx(uX,{tokens:Q,rotation:h,adaptive:p,journalist:x})})]}),r.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-t border-border",children:r.jsx(hX,{events:_})})]})}const u0={sm:12,md:16,lg:20};function xX({fill:t="full",size:a,color:s="#fbbf24",emptyColor:l="rgba(255,255,255,0.4)"}){const o=`star-${Math.random().toString(36).slice(2,8)}`;return r.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",children:[t==="half"&&r.jsx("defs",{children:r.jsxs("linearGradient",{id:o,children:[r.jsx("stop",{offset:"50%",stopColor:s}),r.jsx("stop",{offset:"50%",stopColor:l})]})}),r.jsx("path",{d:"M10 1.5l2.47 5.01 5.53.8-4 3.9.94 5.49L10 14.27 5.06 16.7 6 11.21l-4-3.9 5.53-.8L10 1.5z",fill:t==="full"?s:t==="half"?`url(#${o})`:l})]})}function nS({rating:t=0,count:a,size:s="sm"}){const l=u0[s]||u0.sm,o=[];for(let u=1;u<=5;u++)t>=u?o.push("full"):t>=u-.5?o.push("half"):o.push("empty");return r.jsxs("span",{className:"inline-flex items-center",style:{gap:1},children:[o.map((u,d)=>r.jsx(xX,{fill:u,size:l},d)),a!=null&&r.jsxs("span",{className:"ml-1 text-[11px] text-[var(--text-dim,#6b7f95)] font-sans",children:["(",a,")"]})]})}const d0={design:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},quality:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},devtools:{color:"#33afbc",bg:"rgba(51,175,188,0.14)"},workflow:{color:"#fbbf24",bg:"rgba(251,191,36,0.12)"},security:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},specialized:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},verified:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},anthropic:{color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},published:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"},draft:{color:"#6b7f95",bg:"rgba(255,255,255,0.06)"},review:{color:"#c678dd",bg:"rgba(198,120,221,0.12)"},rejected:{color:"#f87171",bg:"rgba(248,113,113,0.12)"},free:{color:"#4ade80",bg:"rgba(74,222,128,0.12)"}};function aS({label:t,variant:a,className:s}){const l=d0[a]||d0.draft;return r.jsx("span",{className:re("inline-flex items-center whitespace-nowrap font-sans select-none",s),style:{padding:"3px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",lineHeight:1.4,color:l.color,background:l.bg},children:t})}function sS({price:t=0,size:a="sm"}){const s=!t||t===0,l={sm:"text-2xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-xs px-3 py-1"};return r.jsx("span",{className:`inline-flex items-center font-mono font-semibold rounded whitespace-nowrap ${l[a]||l.sm} ${s?"bg-success/12 text-success":"bg-white/8 text-text-1"}`,children:s?"Free":`$${t.toFixed(2)}`})}function lS({type:t="verified",size:a=12}){const s=t==="claude-official"||t==="anthropic"?"#f59e0b":"#4ade80";return r.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",className:"inline-block flex-shrink-0",children:[r.jsx("path",{d:"M10 0l2.36 3.15L16.18 2l.68 3.93L20.8 7.1l-1.87 3.52L20.8 14.14l-3.94 1.17-.68 3.93-3.82-1.15L10 21.24l-2.36-3.15-3.82 1.15-.68-3.93-3.94-1.17 1.87-3.52L-.8 7.1l3.94-1.17.68-3.93 3.82 1.15L10 0z",fill:s}),r.jsx("path",{d:"M7 10.5l2 2 4-4.5",fill:"none",stroke:"#24282f",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}const rS="groove_favorites";function kh(){try{return JSON.parse(localStorage.getItem(rS)||"[]")}catch{return[]}}function gX(t){return kh().includes(t)}function bX(t){const a=kh(),s=a.indexOf(t);return s>=0?a.splice(s,1):a.push(t),localStorage.setItem(rS,JSON.stringify(a)),s<0}function vX(t){const a=new Set(kh());return t.map(s=>({...s,favorited:a.has(s.id)}))}function yX({filled:t,size:a=16}){return r.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:t?"#f87171":"none",stroke:t?"#f87171":"rgba(255,255,255,0.3)",strokeWidth:"2",children:r.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})})}function SX(){return r.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),r.jsx("polyline",{points:"7 10 12 15 17 10"}),r.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function QX({skill:t,onClick:a}){var u,d;const[s,l]=v.useState(()=>gX(t.id));function o(O){O.stopPropagation(),l(bX(t.id))}return r.jsxs("div",{onClick:()=>a==null?void 0:a(t),className:re("flex flex-col cursor-pointer group","bg-surface-1 border border-border-subtle rounded-md","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150"),style:{padding:20,minHeight:280},children:[r.jsxs("div",{className:"flex justify-between items-start",children:[r.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-accent/12 text-[20px]",children:t.icon||((d=(u=t.name)==null?void 0:u[0])==null?void 0:d.toUpperCase())||"?"}),r.jsx("button",{onClick:o,className:"opacity-40 group-hover:opacity-80 hover:!opacity-100 transition-opacity cursor-pointer bg-transparent border-0 p-0",children:r.jsx(yX,{filled:s})})]}),r.jsx("div",{className:"mt-3 text-[15px] font-semibold text-text-0 font-sans line-clamp-2 leading-snug",children:t.name}),r.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-text-3 font-sans",children:[r.jsxs("span",{children:["by ",t.author||"Community"]}),(t.source==="claude-official"||t.verified)&&r.jsx(lS,{type:t.source,size:12})]}),r.jsx("div",{className:"mt-2.5 text-xs text-text-2 font-sans line-clamp-3 flex-1 leading-relaxed",children:t.description}),r.jsx("div",{className:"mt-3",children:r.jsx(aS,{label:t.category||"general",variant:t.category||"draft"})}),r.jsx("div",{className:"h-px bg-border-subtle my-3"}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx(nS,{rating:t.rating||0,count:t.rating_count||t.ratingCount||0,size:"sm"}),r.jsxs("span",{className:"flex items-center gap-1 text-xs text-text-3 font-mono",children:[r.jsx(SX,{}),et(t.downloads||0)]}),r.jsx(sS,{price:t.price||0,size:"sm"})]})]})}function iS(){return r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md animate-pulse",style:{padding:20,minHeight:280},children:[r.jsx("div",{className:"w-10 h-10 rounded-full bg-surface-4"}),r.jsx("div",{className:"mt-3 h-4 w-[70%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-2 h-3 w-[40%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-3.5 h-3 w-full rounded bg-surface-4"}),r.jsx("div",{className:"mt-1.5 h-3 w-[90%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-1.5 h-3 w-[60%] rounded bg-surface-4"}),r.jsx("div",{className:"mt-3.5 h-5 w-[50px] rounded bg-surface-4"}),r.jsx("div",{className:"h-px bg-surface-4 my-3"}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("div",{className:"h-3 w-16 rounded bg-surface-4"}),r.jsx("div",{className:"h-3 w-12 rounded bg-surface-4"}),r.jsx("div",{className:"h-3 w-10 rounded bg-surface-4"})]})]})}const jX={slack:"https://cdn.simpleicons.org/slack/E01E5A",github:"https://cdn.simpleicons.org/github/white",stripe:"https://cdn.simpleicons.org/stripe/635BFF",gmail:"https://cdn.simpleicons.org/gmail/EA4335","google-calendar":"https://cdn.simpleicons.org/googlecalendar/4285F4","google-drive":"https://cdn.simpleicons.org/googledrive/4285F4","google-maps":"https://cdn.simpleicons.org/googlemaps/4285F4",postgres:"https://cdn.simpleicons.org/postgresql/4169E1",notion:"https://cdn.simpleicons.org/notion/white",discord:"https://cdn.simpleicons.org/discord/5865F2",linear:"https://cdn.simpleicons.org/linear/5E6AD2","brave-search":"https://cdn.simpleicons.org/brave/FB542B","home-assistant":"https://cdn.simpleicons.org/homeassistant/18BCF2"};function wX({item:t,size:a=40}){const s=jX[t.id];if(s)return r.jsxs("div",{className:"rounded-md bg-surface-4 flex items-center justify-center flex-shrink-0 overflow-hidden",style:{width:a,height:a},children:[r.jsx("img",{src:s,alt:t.name,className:"w-5 h-5",onError:u=>{u.target.style.display="none",u.target.nextSibling.style.display="flex"}}),r.jsx("div",{className:"hidden items-center justify-center w-full h-full text-lg font-bold font-sans text-text-1",children:(t.name||"?")[0]})]});const l=(t.name||"?")[0].toUpperCase(),o=t.name?t.name.charCodeAt(0)*37%360:200;return r.jsx("div",{className:"rounded-md flex items-center justify-center flex-shrink-0 text-lg font-bold font-sans",style:{width:a,height:a,background:`hsl(${o}, 40%, 18%)`,color:`hsl(${o}, 60%, 65%)`},children:l})}function kX({item:t,onClick:a,className:s}){var o;const l=t.installed;return r.jsxs("button",{onClick:()=>a(t),className:re("flex flex-col p-5 rounded-md border border-border-subtle bg-surface-1 text-left","hover:border-accent/30 hover:bg-surface-2","transition-all duration-150 cursor-pointer group",s),style:{minHeight:200},children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx(wX,{item:t,size:36}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-[14px] font-semibold text-text-0 font-sans truncate",children:t.name}),(t.verified||t.verified==="mcp-official")&&r.jsx(ni,{size:11,className:"text-accent flex-shrink-0"})]}),r.jsx("span",{className:"text-2xs text-text-3 font-sans",children:t.author||"Community"})]})]}),r.jsx("p",{className:"text-xs text-text-2 font-sans line-clamp-3 mb-3 flex-1 leading-relaxed",children:t.description}),r.jsx("div",{className:"h-px bg-border-subtle my-2"}),r.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(mi,{size:10}),et(t.downloads||0)]}),(t.rating||0)>0&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Ib,{size:10,className:"text-warning",fill:"currentColor"}),(o=t.rating)==null?void 0:o.toFixed(1)]}),r.jsx("span",{className:"flex-1"}),l&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Installed"})]})]})}function oS({value:t,onChange:a,placeholder:s="Search skills, tags, authors...",large:l}){const[o,u]=v.useState(t||""),d=v.useRef(null);v.useEffect(()=>{u(t||"")},[t]);function O(h){const p=h.target.value;u(p),clearTimeout(d.current),d.current=setTimeout(()=>a(p),300)}return r.jsxs("div",{className:"relative w-full",children:[r.jsx(da,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"}),r.jsx("input",{value:o,onChange:O,placeholder:s,className:re("w-full font-sans outline-none","bg-surface-0 border border-border text-text-0 placeholder:text-text-4","focus:border-accent/40 transition-colors",l?"py-3 pl-11 pr-12 text-[15px] rounded-lg":"py-2.5 pl-10 pr-3 text-sm rounded-md")}),l&&r.jsx("kbd",{className:"absolute right-3.5 top-1/2 -translate-y-1/2 bg-surface-4 text-text-4 px-2 py-0.5 rounded text-xs font-mono",children:"/"})]})}const $X=[{id:"",label:"All"},{id:"design",label:"Design"},{id:"quality",label:"Quality"},{id:"devtools",label:"Dev Tools"},{id:"workflow",label:"Workflow"},{id:"security",label:"Security"},{id:"specialized",label:"Specialized"}];function TX({selected:t="",categories:a=$X,onSelect:s}){return r.jsx("div",{className:"flex gap-2 overflow-x-auto",style:{scrollbarWidth:"none"},children:a.map(l=>{const o=t===l.id;return r.jsx("button",{onClick:()=>s(l.id),className:re("whitespace-nowrap font-sans cursor-pointer select-none transition-all text-[13px] rounded-full border",o?"bg-accent text-surface-0 border-accent font-semibold":"bg-surface-1 text-text-3 border-border-subtle hover:text-text-1 hover:border-border font-medium"),style:{padding:"7px 16px"},children:l.label},l.id)})})}function Bl(){const t=D(a=>a.addToast);return{success:(a,s)=>t("success",a,s),error:(a,s)=>t("error",a,s),info:(a,s)=>t("info",a,s),warning:(a,s)=>t("warning",a,s)}}function NX({skill:t,onBack:a}){var G,R,X;const s=Bl(),[l,o]=v.useState(""),[u,d]=v.useState(!1),[O,h]=v.useState(!1),[p,x]=v.useState(!1),[g,b]=v.useState(!1),[y,Q]=v.useState(t.installed),[w,$]=v.useState(!0);v.useEffect(()=>{$(!0),J.get(`/skills/${t.id}/content`).then(T=>{o(T.content||""),d(T.requiresPurchase||!1)}).catch(()=>{}).finally(()=>$(!1))},[t.id]);async function j(){h(!0);try{await J.post(`/skills/${t.id}/install`),Q(!0),s.success(`${t.name} installed`)}catch(T){s.error("Install failed",T.message)}h(!1)}async function z(){x(!0);try{await J.post(`/skills/${t.id}/update`),s.success(`${t.name} updated to latest`);const T=await J.get(`/skills/${t.id}/content`);T.content&&o(T.content)}catch(T){s.error("Update failed",T.message)}x(!1)}async function N(){b(!0);try{await J.delete(`/skills/${t.id}`),Q(!1),s.success(`${t.name} uninstalled`)}catch(T){s.error("Uninstall failed",T.message)}b(!1)}async function _(){const{marketplaceAuthenticated:T,marketplaceLogin:V,marketplaceCheckout:M}=D.getState();if(!T){V();return}try{await M(t.id)}catch{}}return r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-6 py-5",children:[r.jsxs("button",{onClick:a,className:"flex items-center gap-1 text-xs text-text-3 font-sans hover:text-text-0 cursor-pointer bg-transparent border-0 mb-4",children:[r.jsx(Cb,{size:14})," Back"]}),r.jsxs("div",{className:"flex gap-8",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-11 h-11 rounded-lg flex items-center justify-center flex-shrink-0 bg-accent/10 border border-accent/20 text-[22px]",children:t.icon||((R=(G=t.name)==null?void 0:G[0])==null?void 0:R.toUpperCase())}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h1",{className:"text-lg font-bold text-text-0 font-sans",children:t.name}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-text-3 font-sans",children:[r.jsx("span",{children:t.author||"Community"}),(t.source==="claude-official"||t.verified)&&r.jsx(lS,{type:t.source,size:13})]})]})]}),r.jsx("p",{className:"mt-3 text-sm text-text-2 font-sans leading-relaxed",children:t.description}),((X=t.tags)==null?void 0:X.length)>0&&r.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:t.tags.map(T=>r.jsx("span",{className:"text-2xs text-text-3 font-sans px-2 py-0.5 rounded bg-surface-4",children:T},T))}),r.jsx("div",{className:"h-px bg-border-subtle my-5"}),w?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"h-3 w-48 bg-surface-4 rounded animate-pulse"}),r.jsx("div",{className:"h-3 w-full bg-surface-4 rounded animate-pulse"}),r.jsx("div",{className:"h-3 w-3/4 bg-surface-4 rounded animate-pulse"})]}):l?r.jsxs("div",{className:"text-sm text-text-2 font-sans leading-relaxed",children:[r.jsx("h2",{className:"text-sm font-semibold text-text-0 mb-2",children:"About"}),r.jsx("pre",{className:"whitespace-pre-wrap font-sans",children:l})]}):u?r.jsxs("div",{className:"bg-warning/5 border border-warning/15 rounded-lg px-4 py-3",children:[r.jsx("p",{className:"text-sm text-text-1 font-sans font-medium",children:"Paid skill — purchase to view content"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Sign in and purchase this skill to access its full instructions."})]}):r.jsx("p",{className:"text-xs text-text-4 font-sans",children:"Content loading failed — check your connection."})]}),r.jsx("div",{className:"w-[240px] flex-shrink-0",children:r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-lg p-4 sticky top-4",children:[r.jsx(sS,{price:t.price||0,size:"md"}),u&&!y?r.jsxs("button",{onClick:_,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 flex items-center justify-center gap-2 border bg-warning/15 text-warning border-warning/20 hover:bg-warning/25",children:["Buy $",(t.price||0).toFixed(2)]}):y?r.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[r.jsxs("button",{onClick:z,disabled:p,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:[r.jsx(zn,{size:12,className:p?"animate-spin":""}),p?"Updating...":"Pull Latest"]}),r.jsxs("button",{onClick:N,disabled:g,className:"w-full py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-error/10 text-error border-error/20 hover:bg-error/15",children:[r.jsx(as,{size:12}),g?"Removing...":"Uninstall"]})]}):r.jsx("button",{onClick:j,disabled:O,className:"w-full mt-3 py-2 px-3 text-xs font-sans font-semibold rounded cursor-pointer transition-all hover:opacity-85 disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2 border bg-accent/15 text-accent border-accent/20 hover:bg-accent/25",children:O?"Installing...":"Install"}),r.jsx("div",{className:"mt-4 flex flex-col gap-2.5",children:[["Downloads",r.jsx("span",{className:"font-mono text-text-0",children:et(t.downloads||0)},"d")],["Rating",r.jsx(nS,{rating:t.rating||0,count:t.rating_count||t.ratingCount,size:"sm"},"r")],["Version",r.jsx("span",{className:"font-mono text-text-0",children:t.version||"1.0.0"},"v")],["Category",r.jsx(aS,{label:t.category||"general",variant:t.category||"draft"},"c")],["Source",r.jsx("span",{className:"text-text-0",children:t.source==="claude-official"?"Anthropic":"Community"},"s")]].map(([T,V])=>r.jsxs("div",{className:"flex justify-between items-center text-xs font-sans",children:[r.jsx("span",{className:"text-text-3",children:T}),V]},T))})]})})]})]})})}function PX(){const[t,a]=v.useState([]),[s,l]=v.useState(!0),[o,u]=v.useState(""),[d,O]=v.useState(""),[h,p]=v.useState("popular"),[x,g]=v.useState(null);return v.useEffect(()=>{l(!0);const b=new URLSearchParams;o&&b.set("search",o),d&&b.set("category",d),h&&b.set("sort",h),J.get(`/skills/registry?${b}`).then(y=>a(vX(y.skills||y.items||(Array.isArray(y)?y:[])))).catch(()=>a([])).finally(()=>l(!1))},[o,d,h]),x?r.jsx(NX,{skill:x,onBack:()=>g(null)}):r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-5 py-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-72",children:r.jsx(oS,{value:o,onChange:u})}),r.jsx(TX,{selected:d,onSelect:O}),r.jsx("div",{className:"flex-1"}),r.jsxs("div",{className:"relative flex-shrink-0",children:[r.jsxs("select",{value:h,onChange:b=>p(b.target.value),className:"appearance-none font-sans cursor-pointer pr-7 py-2 pl-3 text-xs bg-surface-0 border border-border-subtle rounded text-text-1 focus:outline-none",children:[r.jsx("option",{value:"popular",children:"Popular"}),r.jsx("option",{value:"rating",children:"Top Rated"}),r.jsx("option",{value:"newest",children:"Newest"}),r.jsx("option",{value:"name",children:"A-Z"})]}),r.jsx(ca,{size:12,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 pointer-events-none"})]}),r.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),r.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:8}).map((b,y)=>r.jsx(iS,{},y)):t.map(b=>r.jsx(QX,{skill:b,onClick:g},b.id))}),!s&&t.length===0&&r.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No skills found."})]})})}function zX(){const[t,a]=v.useState([]),[s,l]=v.useState(!0),[o,u]=v.useState(""),d=Bl();return v.useEffect(()=>{l(!0),J.get(`/integrations/registry?search=${encodeURIComponent(o)}`).then(O=>a(O.integrations||O.items||(Array.isArray(O)?O:[]))).catch(()=>a([])).finally(()=>l(!1))},[o]),r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-5 py-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-72",children:r.jsx(oS,{value:o,onChange:u,placeholder:"Search integrations..."})}),r.jsx("div",{className:"flex-1"}),r.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0",children:t.length})]}),r.jsx("div",{className:"mt-4 grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:s?Array.from({length:6}).map((O,h)=>r.jsx(iS,{},h)):t.map(O=>r.jsx(kX,{item:O,onClick:()=>d.info(`${O.name} — install via CLI: groove integrations install ${O.id}`)},O.id))}),!s&&t.length===0&&r.jsx("div",{className:"text-center py-16 text-text-4 font-sans text-sm",children:"No integrations found."})]})})}function RX(){const t=D($=>$.marketplaceAuthenticated),a=D($=>$.marketplaceLogin),[s,l]=v.useState([]),[o,u]=v.useState([]),[d,O]=v.useState(!0),[h,p]=v.useState(null),x=Bl(),g=v.useRef(null),b=async()=>{const $=await J.get("/skills/installed");u(Array.isArray($)?$:$.skills||[])};v.useEffect(()=>{O(!0),Promise.all([t?J.get("/auth/purchases").then($=>$.purchases||[]).catch(()=>[]):Promise.resolve([]),J.get("/skills/installed").then($=>Array.isArray($)?$:$.skills||[]).catch(()=>[])]).then(([$,j])=>{l($),u(j)}).finally(()=>O(!1))},[t]);async function y($){p($.id);try{await J.post(`/skills/${$.id}/update`),x.success(`${$.name||$.id} updated`),await b()}catch(j){x.error("Update failed",j.message)}p(null)}async function Q($){p($.id);try{await J.delete(`/skills/${$.id}`),x.success(`${$.name||$.id} uninstalled`),await b()}catch(j){x.error("Uninstall failed",j.message)}p(null)}async function w($){var z;const j=(z=$.target.files)==null?void 0:z[0];if(j){try{const N=await j.text(),_=j.name.replace(/\.md$/i,"");await J.post("/skills/import",{name:_,content:N}),x.success(`Imported "${_}"`),await b()}catch(N){x.error("Import failed",N.message)}$.target.value=""}}return d?r.jsx("div",{className:"p-5 space-y-3",children:[...Array(4)].map(($,j)=>r.jsx(rn,{className:"h-14 rounded-md"},j))}):r.jsx(fa,{className:"h-full",children:r.jsxs("div",{className:"px-5 py-4 space-y-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{ref:g,type:"file",accept:".md",onChange:w,className:"hidden"}),r.jsxs(ve,{variant:"secondary",size:"md",onClick:()=>{var $;return($=g.current)==null?void 0:$.click()},className:"gap-1.5",children:[r.jsx(_N,{size:13}),"Import .md Skill"]}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Drop a markdown skill file to install locally"})]}),t&&s.length>0&&r.jsxs("div",{children:[r.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[r.jsx(wO,{size:12}),"Purchases (",s.length,")"]}),r.jsx("div",{className:"space-y-1.5",children:s.map($=>{var j,z;return r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle",children:[r.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:$.skill_icon||((z=(j=$.skill_name)==null?void 0:j[0])==null?void 0:z.toUpperCase())||"?"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:$.skill_name||$.skill_id}),r.jsxs("div",{className:"text-2xs text-text-4 font-sans",children:["$",($.amount||0).toFixed(2)," · ",vt($.created_at)]})]}),r.jsx(Xe,{variant:"success",className:"text-2xs flex-shrink-0",children:"Owned"})]},$.id||$.skill_id)})})]}),t&&s.length===0&&r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[r.jsx(wO,{size:20,className:"mx-auto text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No purchases yet"})]}),!t&&r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[r.jsx(wO,{size:20,className:"mx-auto text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-2 font-sans mb-3",children:"Sign in to see your purchases"}),r.jsxs(ve,{variant:"primary",size:"sm",onClick:a,className:"gap-1.5 mx-auto",children:[r.jsx(eh,{size:12})," Sign in"]})]}),r.jsxs("div",{children:[r.jsxs("h3",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[r.jsx(Vb,{size:12}),"Installed (",o.length,")"]}),o.length===0?r.jsxs("div",{className:"bg-surface-1 border border-border-subtle rounded-md px-4 py-6 text-center",children:[r.jsx(mi,{size:20,className:"mx-auto text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No skills installed — browse the Skills tab or import a .md file"})]}):r.jsx("div",{className:"space-y-1.5",children:o.map($=>{var j,z;return r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-1 border border-border-subtle group",children:[r.jsx("div",{className:"w-8 h-8 rounded-md bg-accent/10 flex items-center justify-center text-sm flex-shrink-0",children:$.icon||((z=(j=$.name)==null?void 0:j[0])==null?void 0:z.toUpperCase())||"?"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:$.name||$.id}),r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:$.description||$.category||"local skill"})]}),r.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[r.jsx("button",{onClick:()=>y($),disabled:h===$.id,title:"Pull latest version",className:"p-1.5 rounded text-text-3 hover:text-accent hover:bg-accent/10 cursor-pointer transition-colors disabled:opacity-50",children:r.jsx(zn,{size:12,className:h===$.id?"animate-spin":""})}),r.jsx("button",{onClick:()=>Q($),disabled:h===$.id,title:"Uninstall",className:"p-1.5 rounded text-text-3 hover:text-error hover:bg-error/10 cursor-pointer transition-colors disabled:opacity-50",children:r.jsx(as,{size:12})})]}),r.jsx(Xe,{variant:"accent",className:"text-2xs flex-shrink-0",children:"Installed"})]},$.id)})})]})]})})}function CX(){const t=D(o=>o.marketplaceAuthenticated),a=D(o=>o.marketplaceUser),s=D(o=>o.marketplaceLogin),l=D(o=>o.marketplaceLogout);return t?r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded bg-surface-3 border border-border-subtle",children:[r.jsx("div",{className:"w-4 h-4 rounded-full bg-accent/20 flex items-center justify-center",children:r.jsx(Fb,{size:9,className:"text-accent"})}),r.jsx("span",{className:"text-xs text-text-0 font-sans font-medium max-w-[120px] truncate",children:(a==null?void 0:a.displayName)||(a==null?void 0:a.id)||"Account"})]}),r.jsx("button",{onClick:l,className:"flex items-center gap-1 px-2 py-1.5 rounded text-xs text-text-3 hover:text-text-0 hover:bg-surface-3 font-sans cursor-pointer transition-colors",children:r.jsx(Mb,{size:11})})]}):r.jsxs("button",{onClick:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold font-sans text-text-0 bg-accent/15 border border-accent/25 rounded hover:bg-accent/25 cursor-pointer transition-colors",children:[r.jsx(eh,{size:12}),"Sign in"]})}function XX(){const[t,a]=v.useState("skills"),s=[{id:"skills",label:"Skills",icon:Ir},{id:"integrations",label:"Integrations",icon:Gb},{id:"library",label:"My Library",icon:Vb}];return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx("div",{className:"flex-shrink-0 bg-surface-1 border-b border-border-subtle",children:r.jsxs("div",{className:"flex items-center px-5 h-11",children:[r.jsx("div",{className:"flex items-center",children:s.map(l=>{const o=l.icon;return r.jsxs("button",{onClick:()=>a(l.id),className:`flex items-center gap-1.5 px-3 py-2.5 text-xs font-semibold font-sans cursor-pointer select-none border-b-2 -mb-px transition-colors ${t===l.id?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"}`,children:[r.jsx(o,{size:12}),l.label]},l.id)})}),r.jsx("div",{className:"flex-1"}),r.jsx(CX,{})]})}),r.jsxs("div",{className:"flex-1 min-h-0",children:[t==="skills"&&r.jsx(PX,{}),t==="integrations"&&r.jsx(zX,{}),t==="library"&&r.jsx(RX,{})]})]})}function _X(){const t=D(u=>u.teams),a=D(u=>u.agents),s=D(u=>u.activeTeamId),l=D(u=>u.deleteTeam),o=D(u=>u.addToast);return t.length===0?r.jsx("div",{className:"flex-1 flex items-center justify-center",children:r.jsxs("div",{className:"text-center space-y-2",children:[r.jsx(bi,{size:28,className:"mx-auto text-text-4"}),r.jsx("p",{className:"text-xs font-sans text-text-3",children:"No teams yet"}),r.jsx("p",{className:"text-2xs font-sans text-text-4",children:"Teams are created when you spawn agents or launch a planner"})]})}):r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsx("div",{className:"p-4 space-y-3",children:t.map(u=>{const d=a.filter(y=>y.teamId===u.id),O=d.filter(y=>y.status==="running"||y.status==="starting"),h=d.filter(y=>y.status==="completed"),p=d.filter(y=>y.status==="crashed"),x=d.reduce((y,Q)=>y+(Q.tokensUsed||0),0),g=d.reduce((y,Q)=>y+(Q.costUsd||0),0),b=u.id===s;return r.jsxs("div",{className:re("rounded-md border bg-surface-1 overflow-hidden transition-colors",b?"border-accent/30":"border-border-subtle"),children:[r.jsxs("div",{className:"px-4 py-3 flex items-center gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-semibold text-text-0 font-sans",children:u.name}),b&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Active"})]}),u.workingDir&&r.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[r.jsx(Ab,{size:10,className:"text-text-4"}),r.jsx("span",{className:"text-2xs font-mono text-text-3 truncate",children:u.workingDir})]})]}),r.jsx("button",{onClick:()=>{if(d.some(y=>y.status==="running")){o("error","Stop running agents first");return}l(u.id)},className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Delete team",children:r.jsx(as,{size:13})})]}),r.jsxs("div",{className:"px-4 py-2.5 border-t border-border-subtle bg-surface-0 flex items-center gap-4",children:[r.jsx(vl,{label:"Agents",value:d.length}),r.jsx(vl,{label:"Running",value:O.length,color:O.length>0?"text-success":void 0}),r.jsx(vl,{label:"Done",value:h.length}),r.jsx(vl,{label:"Crashed",value:p.length,color:p.length>0?"text-danger":void 0}),r.jsx("div",{className:"flex-1"}),r.jsx(vl,{label:"Tokens",value:et(x)}),g>0&&r.jsx(vl,{label:"Cost",value:Lc(g)})]}),d.length>0&&r.jsx("div",{className:"border-t border-border-subtle",children:d.map(y=>r.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 border-b border-border-subtle last:border-b-0",children:[r.jsx(Ts,{status:y.status,size:"sm"}),r.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:y.name}),r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:y.role}),r.jsx("div",{className:"flex-1"}),r.jsx("span",{className:"text-2xs font-mono text-text-2 tabular-nums",children:et(y.tokensUsed||0)})]},y.id))})]},u.id)})})})}function vl({label:t,value:a,color:s}){return r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:re("text-xs font-mono tabular-nums",s||"text-text-1"),children:a}),r.jsx("div",{className:"text-2xs font-mono text-text-4 uppercase tracking-wider",children:t})]})}function ZX(){const t=D(l=>l.pendingApprovals),a=D(l=>l.approveRequest),s=D(l=>l.rejectRequest);return t.length===0?null:r.jsxs("div",{className:"px-4 pt-4 space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(gi,{size:12,className:"text-warning"}),r.jsxs("span",{className:"text-2xs font-mono text-warning uppercase tracking-wider",children:["Pending (",t.length,")"]})]}),t.map(l=>{var o,u,d;return r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-md bg-warning/5 border border-warning/20",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"text-xs text-text-0 font-sans font-medium truncate",children:[l.agentName,": ",((o=l.action)==null?void 0:o.description)||((u=l.action)==null?void 0:u.type)||"action"]}),((d=l.action)==null?void 0:d.filePath)&&r.jsx("div",{className:"text-2xs font-mono text-text-3 truncate mt-0.5",children:l.action.filePath}),r.jsx("div",{className:"text-2xs text-text-4 font-mono mt-0.5",children:vt(l.requestedAt)})]}),r.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>a(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[r.jsx(Hb,{size:10})," Approve"]}),r.jsxs(ve,{variant:"danger",size:"sm",onClick:()=>s(l.id),className:"h-7 px-2.5 gap-1 text-2xs",children:[r.jsx(jN,{size:10})," Reject"]})]})]},l.id)})]})}function AX(){const t=D(h=>h.resolvedApprovals),[a,s]=v.useState([]),[l,o]=v.useState(!0);v.useEffect(()=>{const h=setInterval(u,4e3);return u(),()=>clearInterval(h)},[]);async function u(){try{const h=await J.get("/pm/history");s(h.history||h||[])}catch{}o(!1)}const d=new Set,O=[...t,...a].filter(h=>{const p=h.id||`${h.agentName}-${h.timestamp}`;return d.has(p)?!1:(d.add(p),!0)});return r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r.jsx(ZX,{}),r.jsxs("div",{className:"p-4 space-y-1.5",children:[l&&O.length===0&&r.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!l&&O.length===0&&r.jsxs("div",{className:"text-center py-12",children:[r.jsx(ni,{size:24,className:"mx-auto mb-2 text-text-4"}),r.jsx("p",{className:"text-xs font-sans text-text-3",children:"No approval history"}),r.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Approvals appear when agents use Auto permission mode"})]}),O.map((h,p)=>{var g;const x=h.status==="approved"||h.verdict==="approved";return r.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 rounded-md bg-surface-0 border border-border-subtle",children:[x?r.jsx(ni,{size:12,className:"text-success flex-shrink-0"}):r.jsx(Xb,{size:12,className:"text-danger flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"text-xs text-text-1 font-sans truncate",children:[r.jsx("span",{className:"font-medium text-text-0",children:h.agentName}),r.jsx("span",{className:"text-text-3 mx-1",children:"·"}),r.jsx("span",{children:((g=h.action)==null?void 0:g.description)||h.action||"action"})]}),h.reason&&r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate mt-0.5",children:h.reason})]}),r.jsx("span",{className:"text-2xs font-mono text-text-4 flex-shrink-0",children:vt(h.resolvedAt||h.timestamp)})]},h.id||p)})]})]})}function EX(){const[t,a]=v.useState([]),[s,l]=v.useState(!0),o=Bl();v.useEffect(()=>{const O=setInterval(u,1e4);return u(),()=>clearInterval(O)},[]);async function u(){try{const O=await J.get("/schedules");a(O.schedules||O||[])}catch{}l(!1)}async function d(O,h){try{await J.post(`/schedules/${O}/${h?"disable":"enable"}`),u()}catch(p){o.error("Failed to toggle schedule",p.message)}}return r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsxs("div",{className:"p-4 space-y-2",children:[s&&t.length===0&&r.jsx("div",{className:"text-center py-12 text-text-4 font-mono text-xs",children:"Loading..."}),!s&&t.length===0&&r.jsxs("div",{className:"text-center py-12",children:[r.jsx(xc,{size:24,className:"mx-auto mb-2 text-text-4"}),r.jsx("p",{className:"text-xs font-sans text-text-3",children:"No schedules configured"}),r.jsx("p",{className:"text-2xs text-text-4 font-sans mt-1",children:"Use the CLI to create agent schedules"})]}),t.map(O=>r.jsxs("div",{className:"rounded-md border border-border-subtle bg-surface-0 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:O.name}),r.jsx(Xe,{variant:O.enabled?"success":"default",className:"text-2xs",children:O.enabled?"Active":"Paused"})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx("span",{className:"text-2xs font-mono text-text-2",children:O.cron}),r.jsx("span",{className:"text-2xs text-text-4",children:"·"}),r.jsx("span",{className:"text-2xs font-mono text-text-3 uppercase",children:O.role}),O.teamId&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-2xs text-text-4",children:"·"}),r.jsx("span",{className:"text-2xs font-sans text-text-3",children:O.teamName||O.teamId})]})]}),O.prompt&&r.jsx("div",{className:"text-2xs font-sans text-text-4 mt-1 truncate",children:O.prompt})]}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>d(O.id,O.enabled),className:"h-7 px-2.5 gap-1 text-2xs",children:O.enabled?r.jsxs(r.Fragment,{children:[r.jsx(eN,{size:10})," Pause"]}):r.jsxs(r.Fragment,{children:[r.jsx(lN,{size:10})," Enable"]})})]}),O.lastRunAt&&r.jsxs("div",{className:"px-4 py-1.5 border-t border-border-subtle bg-surface-1 text-2xs font-mono text-text-4",children:["Last run: ",vt(O.lastRunAt),O.nextRunAt&&r.jsxs("span",{className:"ml-3",children:["Next: ",vt(O.nextRunAt)]})]})]},O.id))]})})}function qX(){return r.jsxs(eS,{defaultValue:"dashboard",className:"flex flex-col h-full",children:[r.jsxs("div",{className:"px-4 pt-3 bg-surface-1 border-b border-border",children:[r.jsx("div",{className:"flex items-center gap-4 mb-0",children:r.jsx("h2",{className:"text-xs font-semibold text-text-0 font-sans tracking-wide uppercase",children:"Management"})}),r.jsxs(tS,{className:"border-b-0",children:[r.jsxs(zl,{value:"dashboard",className:"inline-flex items-center gap-1.5",children:[r.jsx(NT,{size:12}),"Teams"]}),r.jsxs(zl,{value:"approvals",className:"inline-flex items-center gap-1.5",children:[r.jsx(zT,{size:12}),"Approvals"]}),r.jsxs(zl,{value:"schedules",className:"inline-flex items-center gap-1.5",children:[r.jsx(xc,{size:12}),"Schedules"]})]})]}),r.jsx(Rl,{value:"dashboard",className:"flex-1 min-h-0",children:r.jsx(_X,{})}),r.jsx(Rl,{value:"approvals",className:"flex-1 min-h-0",children:r.jsx(AX,{})}),r.jsx(Rl,{value:"schedules",className:"flex-1 min-h-0",children:r.jsx(EX,{})})]})}const MX={code:"Code",general:"General"},YX={light:"text-success",medium:"text-accent",heavy:"text-warning"};function UX(t){return t<1?`${Math.round(t*1024)} MB`:`${t} GB`}function cS({hardware:t}){if(!t)return null;const{totalRamGb:a,gpu:s,isAppleSilicon:l}=t;return r.jsxs("div",{className:"flex items-center gap-3 bg-surface-0 rounded-lg border border-border-subtle px-3 py-2.5",children:[r.jsx(th,{size:14,className:"text-text-3 flex-shrink-0"}),r.jsx("div",{className:"flex-1 min-w-0",children:r.jsxs("div",{className:"flex items-center gap-2 text-xs font-sans",children:[r.jsxs("span",{className:"text-text-0 font-semibold",children:[a," GB RAM"]}),s&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-text-4",children:"·"}),r.jsx("span",{className:"text-text-2",children:s.name})]}),l&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Unified Memory"})]})})]})}function VX({onRecheck:t}){const[a,s]=v.useState(null),[l,o]=v.useState(!1),[u,d]=v.useState(!1),[O,h]=v.useState(!1),p=D(_=>_.addToast);v.useEffect(()=>{J.post("/providers/ollama/check").then(s).catch(()=>{})},[]);async function x(){o(!0);try{const _=await J.post("/providers/ollama/check");s(_),_.installed&&_.serverRunning?(p("success","Ollama is ready!"),t()):_.installed?p("info","Ollama installed — server needs to start"):p("info","Ollama not found — install and try again")}catch{}o(!1)}async function g(){d(!0);try{if((await J.post("/providers/ollama/serve")).ok){p("success","Ollama server started!");let G=!1;for(let R=0;R<5;R++){await new Promise(T=>setTimeout(T,2e3));const X=await J.post("/providers/ollama/check");if(s(X),X.serverRunning){G=!0;break}}G&&t()}}catch(_){p("error","Could not start server",_.message)}d(!1)}function b(_){navigator.clipboard.writeText(_),h(!0),setTimeout(()=>h(!1),2e3)}if(!a)return r.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{hardware:y,install:Q,requirements:w,installed:$,serverRunning:j}=a,z=y.totalRamGb>=w.minRAM,N=y.recommended;return r.jsxs("div",{className:"space-y-3 p-3",children:[r.jsx(cS,{hardware:y}),z?r.jsxs("div",{className:"flex items-start gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2.5",children:[r.jsx(Dt,{size:14,className:"text-success flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs font-sans",children:[r.jsx("span",{className:"text-success font-semibold",children:"Your system is ready."}),r.jsx("span",{className:"text-text-2 ml-1",children:N.code?`Recommended: ${N.code}`:`${y.totalRamGb} GB RAM available`})]})]}):r.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[r.jsx(ua,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs font-sans text-text-2",children:[r.jsxs("span",{className:"text-warning font-semibold",children:[y.totalRamGb," GB RAM detected."]})," ","Minimum ",w.minRAM," GB needed. Smallest models may still work."]})]}),$&&!j&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-start gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[r.jsx(ua,{size:14,className:"text-warning flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs font-sans text-text-2",children:[r.jsx("span",{className:"text-warning font-semibold",children:"Ollama installed but server not running."})," ","The server needs to be running to pull and use models."]})]}),r.jsxs(ve,{variant:"primary",size:"md",onClick:g,disabled:u,className:"w-full gap-1.5",children:[r.jsx(Rn,{size:12}),u?"Starting...":"Start Ollama Server"]})]}),!$&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("p",{className:"text-xs font-semibold text-text-1 font-sans",children:"Install Ollama"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("code",{className:"flex-1 bg-surface-0 border border-border-subtle rounded-md px-3 py-2 text-xs font-mono text-text-1 truncate",children:Q.command}),r.jsxs(ve,{variant:"secondary",size:"sm",onClick:()=>b(Q.command),className:"h-8 px-2.5 gap-1 flex-shrink-0",children:[O?r.jsx(Dt,{size:12}):r.jsx(xf,{size:12}),O?"Copied":"Copy"]})]}),Q.alt&&r.jsx("p",{className:"text-2xs text-text-4 font-sans",children:Q.alt})]}),r.jsxs(ve,{variant:"secondary",size:"md",onClick:x,disabled:l,className:"w-full gap-1.5",children:[r.jsx(zn,{size:12,className:l?"animate-spin":""}),l?"Checking...":$?"Check again":"I installed it — check again"]})]})}function GX({model:t,isInstalled:a,isRecommended:s,canRun:l,onPull:o,onDelete:u,pulling:d}){const O=d===t.id;return r.jsxs("div",{className:re("flex items-center gap-2 px-3 py-2 border-t border-border-subtle transition-colors",!l&&"opacity-40"),children:[a?r.jsx(Dt,{size:12,className:"text-success flex-shrink-0"}):r.jsx("div",{className:"w-3"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs font-mono text-text-1 truncate",children:t.name}),s&&r.jsx(Ib,{size:10,className:"text-warning flex-shrink-0"})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[r.jsx("span",{className:re("text-2xs font-semibold font-sans",YX[t.tier]),children:t.tier}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:UX(t.sizeGb)}),r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["· ",t.ramGb," GB RAM"]})]})]}),a?r.jsx("button",{onClick:()=>u(t.id),className:"p-1.5 text-text-4 hover:text-danger rounded transition-colors cursor-pointer",title:"Remove model",children:r.jsx(as,{size:12})}):l?r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>o(t.id),disabled:!!d,className:"h-7 px-2 text-2xs gap-1",children:O?r.jsxs(r.Fragment,{children:[r.jsx(zn,{size:10,className:"animate-spin"})," Pulling..."]}):r.jsxs(r.Fragment,{children:[r.jsx(mi,{size:10})," Pull"]})}):r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:["Needs ",t.ramGb," GB"]})]})}function LX({onStopped:t}){const[a,s]=v.useState(null),l=D(d=>d.addToast);async function o(){s("stopping");try{(await J.post("/providers/ollama/stop")).ok?(l("info","Ollama server stopped"),t&&t()):l("error","Could not stop server")}catch(d){l("error","Stop failed",d.message)}s(null)}async function u(){s("restarting");try{(await J.post("/providers/ollama/restart")).ok?l("success","Ollama server restarted"):l("error","Restart failed")}catch(d){l("error","Restart failed",d.message)}s(null)}return r.jsxs("div",{className:"flex items-center gap-2 bg-success/8 border border-success/20 rounded-lg px-3 py-2",children:[r.jsxs("span",{className:"relative flex-shrink-0 w-[6px] h-[6px]",children:[r.jsx("span",{className:"absolute inset-0 rounded-full bg-success"}),r.jsx("span",{className:"absolute inset-[-2px] rounded-full bg-success opacity-20 animate-pulse"})]}),r.jsx("span",{className:"text-xs font-sans text-success font-semibold",children:"Server Running"}),r.jsx("span",{className:"text-2xs font-mono text-text-4",children:":11434"}),r.jsx("div",{className:"flex-1"}),r.jsxs("button",{onClick:u,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-accent cursor-pointer transition-colors disabled:opacity-40",children:[r.jsx(zn,{size:10,className:a==="restarting"?"animate-spin":""}),a==="restarting"?"Restarting...":"Restart"]}),r.jsxs("button",{onClick:o,disabled:!!a,className:"flex items-center gap-1 text-2xs font-sans text-text-3 hover:text-danger cursor-pointer transition-colors disabled:opacity-40",children:[r.jsx(ua,{size:10}),a==="stopping"?"Stopping...":"Stop"]})]})}function DX({onModelChange:t}){var T,V;const[a,s]=v.useState(null),[l,o]=v.useState(null),[u,d]=v.useState("code"),[O,h]=v.useState(!1),[p,x]=v.useState(!1),g=D(M=>M.addToast),b=v.useRef(!1);function y(){J.get("/providers/ollama/models").then(M=>{var ae;s(M),!b.current&&((ae=M.installed)==null?void 0:ae.length)===0&&(b.current=!0,setTimeout(y,2e3))}).catch(()=>{})}v.useEffect(()=>{y()},[]);async function Q(M){o(M);try{await J.post("/providers/ollama/pull",{model:M}),g("success",`Pulled ${M}`),y(),t&&t()}catch(ae){g("error",`Pull failed: ${ae.message}`)}o(null)}async function w(M){try{await J.delete(`/providers/ollama/models/${encodeURIComponent(M)}`),g("info",`Removed ${M}`),y(),t&&t()}catch(ae){g("error",`Delete failed: ${ae.message}`)}}if(!a)return r.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Loading..."});const{installed:$,catalog:j,hardware:z}=a,N=new Set($.map(M=>M.id)),_=z.totalRamGb,G=[(T=z.recommended)==null?void 0:T.code,(V=z.recommended)==null?void 0:V.general].filter(Boolean),R=j.filter(M=>M.category===u),X=O?R:R.filter(M=>M.ramGb<=_);return p?r.jsxs("div",{className:"space-y-3 p-3",children:[r.jsxs("div",{className:"flex items-center gap-2 bg-warning/8 border border-warning/20 rounded-lg px-3 py-2.5",children:[r.jsx(ua,{size:14,className:"text-warning flex-shrink-0"}),r.jsxs("span",{className:"text-xs font-sans text-text-2",children:[r.jsx("span",{className:"text-warning font-semibold",children:"Ollama server stopped."})," ","Start it again to pull and use models."]})]}),r.jsxs(ve,{variant:"primary",size:"md",onClick:async()=>{try{(await J.post("/providers/ollama/serve")).ok&&(g("success","Ollama server started!"),x(!1),b.current=!1,setTimeout(y,2e3))}catch(M){g("error","Could not start server",M.message)}},className:"w-full gap-1.5",children:[r.jsx(Rn,{size:12}),"Start Ollama Server"]})]}):r.jsxs("div",{className:"space-y-2 p-3",children:[r.jsx(LX,{onStopped:()=>x(!0)}),r.jsx(cS,{hardware:z}),$.length>0&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-sans text-text-2",children:[r.jsx(Jf,{size:12,className:"text-text-3"}),r.jsx("span",{className:"font-semibold",children:$.length})," model",$.length!==1?"s":""," installed"]}),r.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:Object.entries(MX).map(([M,ae])=>r.jsx("button",{onClick:()=>d(M),className:re("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",u===M?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:ae},M))}),r.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[X.map(M=>r.jsx(GX,{model:M,isInstalled:N.has(M.id),isRecommended:G.includes(M.id),canRun:M.ramGb<=_,onPull:Q,onDelete:w,pulling:l},M.id)),X.length===0&&r.jsxs("div",{className:"px-3 py-4 text-center text-xs text-text-4 font-sans",children:["No ",u," models available for your hardware"]})]}),!O&&R.length>X.length&&r.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-1 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[r.jsx(ca,{size:10}),"Show ",R.length-X.length," more (exceed your RAM)"]})]})}function uS({isInstalled:t,onModelChange:a}){const[s,l]=v.useState(!1),[o,u]=v.useState(!1);return v.useEffect(()=>{t?J.post("/providers/ollama/check").then(d=>{l(d.installed&&d.serverRunning),u(!0)}).catch(()=>u(!0)):u(!0)},[t]),o?s?r.jsx(DX,{onModelChange:a}):r.jsx(VX,{onRecheck:()=>{l(!0),a&&a()}}):r.jsx("div",{className:"py-4 text-center text-xs text-text-4 font-sans",children:"Checking Ollama..."})}var IO="focusScope.autoFocusOnMount",FO="focusScope.autoFocusOnUnmount",O0={bubbles:!1,cancelable:!0},WX="FocusScope",dS=v.forwardRef((t,a)=>{const{loop:s=!1,trapped:l=!1,onMountAutoFocus:o,onUnmountAutoFocus:u,...d}=t,[O,h]=v.useState(null),p=zt(o),x=zt(u),g=v.useRef(null),b=it(a,w=>h(w)),y=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(l){let w=function(N){if(y.paused||!O)return;const _=N.target;O.contains(_)?g.current=_:La(g.current,{select:!0})},$=function(N){if(y.paused||!O)return;const _=N.relatedTarget;_!==null&&(O.contains(_)||La(g.current,{select:!0}))},j=function(N){if(document.activeElement===document.body)for(const G of N)G.removedNodes.length>0&&La(O)};document.addEventListener("focusin",w),document.addEventListener("focusout",$);const z=new MutationObserver(j);return O&&z.observe(O,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",$),z.disconnect()}}},[l,O,y.paused]),v.useEffect(()=>{if(O){h0.add(y);const w=document.activeElement;if(!O.contains(w)){const j=new CustomEvent(IO,O0);O.addEventListener(IO,p),O.dispatchEvent(j),j.defaultPrevented||(BX(JX(OS(O)),{select:!0}),document.activeElement===w&&La(O))}return()=>{O.removeEventListener(IO,p),setTimeout(()=>{const j=new CustomEvent(FO,O0);O.addEventListener(FO,x),O.dispatchEvent(j),j.defaultPrevented||La(w??document.body,{select:!0}),O.removeEventListener(FO,x),h0.remove(y)},0)}}},[O,p,x,y]);const Q=v.useCallback(w=>{if(!s&&!l||y.paused)return;const $=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,j=document.activeElement;if($&&j){const z=w.currentTarget,[N,_]=HX(z);N&&_?!w.shiftKey&&j===_?(w.preventDefault(),s&&La(N,{select:!0})):w.shiftKey&&j===N&&(w.preventDefault(),s&&La(_,{select:!0})):j===z&&w.preventDefault()}},[s,l,y.paused]);return r.jsx(Be.div,{tabIndex:-1,...d,ref:b,onKeyDown:Q})});dS.displayName=WX;function BX(t,{select:a=!1}={}){const s=document.activeElement;for(const l of t)if(La(l,{select:a}),document.activeElement!==s)return}function HX(t){const a=OS(t),s=f0(a,t),l=f0(a.reverse(),t);return[s,l]}function OS(t){const a=[],s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const o=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||o?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)a.push(s.currentNode);return a}function f0(t,a){for(const s of t)if(!IX(s,{upTo:a}))return s}function IX(t,{upTo:a}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(a!==void 0&&t===a)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function FX(t){return t instanceof HTMLInputElement&&"select"in t}function La(t,{select:a=!1}={}){if(t&&t.focus){const s=document.activeElement;t.focus({preventScroll:!0}),t!==s&&FX(t)&&a&&t.select()}}var h0=KX();function KX(){let t=[];return{add(a){const s=t[0];a!==s&&(s==null||s.pause()),t=m0(t,a),t.unshift(a)},remove(a){var s;t=m0(t,a),(s=t[0])==null||s.resume()}}}function m0(t,a){const s=[...t],l=s.indexOf(a);return l!==-1&&s.splice(l,1),s}function JX(t){return t.filter(a=>a.tagName!=="A")}var KO=0;function e_(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??p0()),document.body.insertAdjacentElement("beforeend",t[1]??p0()),KO++,()=>{KO===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),KO--}},[])}function p0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var kn=function(){return kn=Object.assign||function(a){for(var s,l=1,o=arguments.length;l<o;l++){s=arguments[l];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(a[u]=s[u])}return a},kn.apply(this,arguments)};function fS(t,a){var s={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&a.indexOf(l)<0&&(s[l]=t[l]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,l=Object.getOwnPropertySymbols(t);o<l.length;o++)a.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(t,l[o])&&(s[l[o]]=t[l[o]]);return s}function t_(t,a,s){if(s||arguments.length===2)for(var l=0,o=a.length,u;l<o;l++)(u||!(l in a))&&(u||(u=Array.prototype.slice.call(a,0,l)),u[l]=a[l]);return t.concat(u||Array.prototype.slice.call(a))}var oc="right-scroll-bar-position",cc="width-before-scroll-bar",n_="with-scroll-bars-hidden",a_="--removed-body-scroll-bar-size";function JO(t,a){return typeof t=="function"?t(a):t&&(t.current=a),t}function s_(t,a){var s=v.useState(function(){return{value:t,callback:a,facade:{get current(){return s.value},set current(l){var o=s.value;o!==l&&(s.value=l,s.callback(l,o))}}}})[0];return s.callback=a,s.facade}var l_=typeof window<"u"?v.useLayoutEffect:v.useEffect,x0=new WeakMap;function r_(t,a){var s=s_(null,function(l){return t.forEach(function(o){return JO(o,l)})});return l_(function(){var l=x0.get(s);if(l){var o=new Set(l),u=new Set(t),d=s.current;o.forEach(function(O){u.has(O)||JO(O,null)}),u.forEach(function(O){o.has(O)||JO(O,d)})}x0.set(s,t)},[t]),s}function i_(t){return t}function o_(t,a){a===void 0&&(a=i_);var s=[],l=!1,o={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:t},useMedium:function(u){var d=a(u,l);return s.push(d),function(){s=s.filter(function(O){return O!==d})}},assignSyncMedium:function(u){for(l=!0;s.length;){var d=s;s=[],d.forEach(u)}s={push:function(O){return u(O)},filter:function(){return s}}},assignMedium:function(u){l=!0;var d=[];if(s.length){var O=s;s=[],O.forEach(u),d=s}var h=function(){var x=d;d=[],x.forEach(u)},p=function(){return Promise.resolve().then(h)};p(),s={push:function(x){d.push(x),p()},filter:function(x){return d=d.filter(x),s}}}};return o}function c_(t){t===void 0&&(t={});var a=o_(null);return a.options=kn({async:!0,ssr:!1},t),a}var hS=function(t){var a=t.sideCar,s=fS(t,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=a.read();if(!l)throw new Error("Sidecar medium not found");return v.createElement(l,kn({},s))};hS.isSideCarExport=!0;function u_(t,a){return t.useMedium(a),hS}var mS=c_(),ef=function(){},Kc=v.forwardRef(function(t,a){var s=v.useRef(null),l=v.useState({onScrollCapture:ef,onWheelCapture:ef,onTouchMoveCapture:ef}),o=l[0],u=l[1],d=t.forwardProps,O=t.children,h=t.className,p=t.removeScrollBar,x=t.enabled,g=t.shards,b=t.sideCar,y=t.noRelative,Q=t.noIsolation,w=t.inert,$=t.allowPinchZoom,j=t.as,z=j===void 0?"div":j,N=t.gapMode,_=fS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=b,R=r_([s,a]),X=kn(kn({},_),o);return v.createElement(v.Fragment,null,x&&v.createElement(G,{sideCar:mS,removeScrollBar:p,shards:g,noRelative:y,noIsolation:Q,inert:w,setCallbacks:u,allowPinchZoom:!!$,lockRef:s,gapMode:N}),d?v.cloneElement(v.Children.only(O),kn(kn({},X),{ref:R})):v.createElement(z,kn({},X,{className:h,ref:R}),O))});Kc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Kc.classNames={fullWidth:cc,zeroRight:oc};var d_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var a=d_();return a&&t.setAttribute("nonce",a),t}function f_(t,a){t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a))}function h_(t){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(t)}var m_=function(){var t=0,a=null;return{add:function(s){t==0&&(a=O_())&&(f_(a,s),h_(a)),t++},remove:function(){t--,!t&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},p_=function(){var t=m_();return function(a,s){v.useEffect(function(){return t.add(a),function(){t.remove()}},[a&&s])}},pS=function(){var t=p_(),a=function(s){var l=s.styles,o=s.dynamic;return t(l,o),null};return a},x_={left:0,top:0,right:0,gap:0},tf=function(t){return parseInt(t||"",10)||0},g_=function(t){var a=window.getComputedStyle(document.body),s=a[t==="padding"?"paddingLeft":"marginLeft"],l=a[t==="padding"?"paddingTop":"marginTop"],o=a[t==="padding"?"paddingRight":"marginRight"];return[tf(s),tf(l),tf(o)]},b_=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return x_;var a=g_(t),s=document.documentElement.clientWidth,l=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,l-s+a[2]-a[0])}},v_=pS(),Cl="data-scroll-locked",y_=function(t,a,s,l){var o=t.left,u=t.top,d=t.right,O=t.gap;return s===void 0&&(s="margin"),`
|
|
589
589
|
.`.concat(n_,` {
|
|
590
590
|
overflow: hidden `).concat(l,`;
|
|
591
591
|
padding-right: `).concat(O,"px ").concat(l,`;
|
|
@@ -629,10 +629,10 @@ Error generating stack: `+c.message+`
|
|
|
629
629
|
|
|
630
630
|
If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
631
631
|
|
|
632
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(s))},[s,t]),null},H_="DialogDescriptionWarning",I_=({contentRef:t,descriptionId:a})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ZS(H_).contentName}}.`;return v.useEffect(()=>{var u;const o=(u=t.current)==null?void 0:u.getAttribute("aria-describedby");a&&o&&(document.getElementById(a)||console.warn(l))},[l,t,a]),null},AS=QS,ES=kS,qS=$S,MS=TS,YS=PS,US=RS,VS=XS;function GS({children:t,...a}){return r.jsx(AS,{...a,children:t})}function LS({children:t,className:a,title:s,description:l,...o}){return r.jsxs(ES,{children:[r.jsx(qS,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),r.jsxs(MS,{className:re("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-full max-w-lg max-h-[85vh] overflow-y-auto","bg-surface-1 border border-border rounded-lg shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",a),...o,children:[s&&r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle",children:[r.jsx(YS,{className:"text-base font-semibold text-text-0 font-sans",children:s}),r.jsx(VS,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors",children:r.jsx(Qt,{size:16})})]}),l&&r.jsx(US,{className:"sr-only",children:l}),t]})]})}var S0={};function F_({path:t,onNavigate:a}){const s=t.split("/").filter(Boolean);return r.jsxs("div",{className:"flex items-center gap-0.5 min-w-0 overflow-x-auto py-1.5 scrollbar-none",children:[r.jsx("button",{onClick:()=>a("/"),className:"flex-shrink-0 p-1 rounded hover:bg-surface-5 cursor-pointer text-text-3 hover:text-text-0 transition-colors",children:r.jsx(Jf,{size:13})}),s.map((l,o)=>{const u="/"+s.slice(0,o+1).join("/"),d=o===s.length-1;return r.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[r.jsx(Ll,{size:11,className:"text-text-4"}),r.jsx("button",{onClick:()=>a(u),className:re("px-1.5 py-0.5 rounded text-xs font-mono cursor-pointer transition-colors",d?"text-text-0 bg-surface-4 font-medium":"text-text-3 hover:text-text-0 hover:bg-surface-5"),children:l})]},o)})]})}function DS({open:t,onOpenChange:a,currentPath:s,onSelect:l}){const[o,u]=v.useState(s||S0.HOME||"/"),[d,O]=v.useState([]),[h,p]=v.useState(!1),[x,g]=v.useState(null);v.useEffect(()=>{t&&b(s||"/")},[t]);async function b($){p(!0),g(null);try{const j=await J.get(`/browse-system?path=${encodeURIComponent($)}`);u(j.current||$),O(j.dirs||[])}catch(j){g(j.message),O([])}p(!1)}function y(){const $=o==="/"?"/":o.split("/").slice(0,-1).join("/")||"/";b($)}function Q(){b(S0.HOME||"/Users")}function w(){l(o),a(!1)}return r.jsx(GS,{open:t,onOpenChange:a,children:r.jsx(LS,{title:"Select Working Directory",description:"Choose a directory for this agent to work in",className:"max-w-[520px]",children:r.jsxs("div",{className:"px-5 py-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:y,disabled:o==="/",className:"p-1.5 rounded-md bg-surface-4 border border-border text-text-2 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",children:r.jsx(Q5,{size:14})}),r.jsx("button",{onClick:Q,className:"p-1.5 rounded-md bg-surface-4 border border-border text-text-2 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:r.jsx(jT,{size:14})}),r.jsx("div",{className:"flex-1 min-w-0 bg-surface-0 rounded-md border border-border-subtle px-2",children:r.jsx(F_,{path:o,onNavigate:b})})]}),r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle overflow-hidden",children:r.jsxs("div",{className:"max-h-[340px] overflow-y-auto",children:[h&&r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(Ka,{size:18,className:"text-text-3 animate-spin"})}),x&&r.jsx("div",{className:"px-4 py-6 text-center",children:r.jsx("p",{className:"text-xs text-danger font-sans",children:x})}),!h&&!x&&d.length===0&&r.jsx("div",{className:"px-4 py-6 text-center",children:r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No subdirectories"})}),!h&&!x&&d.map($=>r.jsxs("button",{onClick:()=>b($.path),className:re("w-full flex items-center gap-2.5 px-3.5 py-2 text-left cursor-pointer","hover:bg-surface-4 transition-colors border-b border-border-subtle last:border-0"),children:[$.hasChildren?r.jsx(OT,{size:15,className:"text-warning flex-shrink-0"}):r.jsx(ai,{size:15,className:"text-text-3 flex-shrink-0"}),r.jsx("span",{className:"text-sm text-text-0 font-sans truncate flex-1",children:$.name}),$.hasChildren&&r.jsx(Ll,{size:12,className:"text-text-4 flex-shrink-0"})]},$.path))]})}),r.jsxs("div",{className:"flex items-center gap-3 bg-surface-4/50 rounded-lg px-3.5 py-2.5 border border-border-subtle",children:[r.jsx(ai,{size:16,className:"text-accent flex-shrink-0"}),r.jsx("span",{className:"text-xs font-mono text-text-1 truncate flex-1",children:o})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(ve,{variant:"ghost",size:"md",onClick:()=>a(!1),children:"Cancel"}),r.jsxs(ve,{variant:"primary",size:"md",onClick:w,className:"gap-1.5",children:[r.jsx(Dt,{size:14})," Select Folder"]})]})]})})})}function WS({children:t,...a}){return r.jsx(AS,{...a,children:t})}function BS({children:t,className:a,title:s,side:l="right",width:o=400,...u}){return r.jsxs(ES,{children:[r.jsx(qS,{className:"fixed inset-0 z-40 bg-black/30"}),r.jsxs(MS,{className:re("fixed top-0 z-50 h-full overflow-y-auto","bg-surface-1 border-l border-border shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out",l==="right"&&"right-0 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",l==="left"&&"left-0 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",a),style:{width:o},...u,children:[s&&r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle sticky top-0 bg-surface-1 z-10",children:[r.jsx(YS,{className:"text-base font-semibold text-text-0 font-sans",children:s}),r.jsx(VS,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:r.jsx(Qt,{size:16})})]}),r.jsx(US,{className:"sr-only",children:"Panel"}),t]})]})}function K_({value:t,onChange:a}){return r.jsx("button",{onClick:()=>a(!t),className:re("w-9 h-5 rounded-full p-0.5 transition-colors cursor-pointer",t?"bg-accent":"bg-surface-5"),children:r.jsx("div",{className:re("w-4 h-4 rounded-full bg-white shadow-sm transition-transform",t?"translate-x-4":"translate-x-0")})})}function J_({user:t}){const[a,s]=v.useState(!1),l=(t==null?void 0:t.avatar)||(t==null?void 0:t.picture)||(t==null?void 0:t.photoURL)||(t==null?void 0:t.photo);return l&&!a?r.jsx("img",{src:l,alt:"",className:"w-6 h-6 rounded-full",referrerPolicy:"no-referrer",crossOrigin:"anonymous",onError:()=>s(!0)}):r.jsx("div",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center",children:r.jsx(Fb,{size:12,className:"text-accent"})})}function eZ({provider:t,onKeyChange:a}){var $,j,z;const[s,l]=v.useState(!1),[o,u]=v.useState(""),[d,O]=v.useState(!1),[h,p]=v.useState(!1),x=D(N=>N.addToast),g=t.authType==="local",b=t.authType==="subscription",y=g||b?t.installed:t.hasKey;async function Q(){if(o.trim())try{await J.post(`/credentials/${t.id}`,{key:o.trim()}),x("success",`API key set for ${t.name}`),u(""),l(!1),a&&a()}catch(N){x("error","Failed to set key",N.message)}}async function w(){try{await J.delete(`/credentials/${t.id}`),x("info",`Removed ${t.name} key`),a&&a()}catch(N){x("error","Remove failed",N.message)}}if(g){const N=((j=($=t.models)==null?void 0:$.filter(G=>!G.disabled))==null?void 0:j.length)||0,_=()=>D.getState().setActiveView("models");return r.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(Ts,{status:y&&N>0?"running":"crashed",size:"sm"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),r.jsx("div",{className:"flex-1"}),y&&N>0?r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(Dt,{size:8})," ",N," models"]}):y?r.jsx(Xe,{variant:"warning",className:"text-2xs",children:"No models pulled"}):r.jsx(Xe,{variant:"default",className:"text-2xs",children:"Not set up"})]}),r.jsx("div",{className:"flex-1",children:h?r.jsxs(r.Fragment,{children:[r.jsx(uS,{isInstalled:y,onModelChange:a}),r.jsxs("div",{className:"px-4 py-2 border-t border-border-subtle flex gap-2",children:[r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"flex-1 h-7 text-2xs",children:"Back"}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>{p(!1),_()},className:"flex-1 h-7 text-2xs gap-1",children:"Models Tab"})]})]}):r.jsxs("div",{className:"px-4 py-3 flex flex-col h-full",children:[r.jsx("div",{className:"text-xs text-text-3 font-sans flex-1",children:y&&N>0?"Full agentic runtime — tool calling, context rotation, zero cloud cost":y?"Ollama is running. Pull a model to start using local agents.":"Run any open-source model locally — free, private, fully offline. Requires Ollama."}),r.jsxs("div",{className:"flex gap-2 mt-3",children:[y?r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>p(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(Al,{size:11})," ",N>0?"Manage":"Pull Models"]}):r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>p(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(Al,{size:11})," Set Up Ollama"]}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:_,className:"flex-1 h-7 text-2xs gap-1.5",children:"Models Tab"})]})]})})]})}return r.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(Ts,{status:y?"running":"crashed",size:"sm"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),r.jsx("div",{className:"flex-1"}),y?r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(Dt,{size:8})," Ready"]}):r.jsx(Xe,{variant:"default",className:"text-2xs",children:b?"Not installed":"No key"})]}),r.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[120px]",children:[((z=t.models)==null?void 0:z.length)>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.models.map(N=>r.jsx("span",{className:"px-1.5 py-0.5 rounded bg-surface-4 text-2xs font-mono text-text-3",children:N.name||N.id},N.id))}),b&&y&&!t.hasKey&&!s&&r.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-accent/8 border border-accent/20 rounded-md text-2xs font-sans text-accent mb-3",children:[r.jsx(Dt,{size:10})," Subscription active"]}),t.hasKey&&!s&&r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsxs("div",{className:"flex-1 flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success",children:[r.jsx(Dt,{size:10})," API Connected"]}),r.jsx("button",{onClick:()=>{l(!0),O(!1),u("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:"Edit"}),r.jsx("button",{onClick:w,className:"text-2xs text-text-4 hover:text-danger cursor-pointer font-sans",children:"Remove"})]}),r.jsx("div",{className:"flex-1"}),s&&r.jsxs("div",{className:"space-y-2.5 pt-1",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:t.hasKey?"Update API Key":`${t.name} API Key`}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{value:o,onChange:N=>u(N.target.value),onKeyDown:N=>N.key==="Enter"&&Q(),type:d?"text":"password",placeholder:"sk-...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:()=>O(!d),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:d?r.jsx(Kf,{size:12}):r.jsx(Dl,{size:12})})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ve,{variant:"primary",size:"sm",onClick:Q,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Key"}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{l(!1),u("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!s&&!t.hasKey&&r.jsxs(ve,{variant:b?"secondary":"primary",size:"sm",onClick:()=>{l(!0),O(!1),u("")},className:"w-full h-8 text-2xs gap-1.5 mt-2",children:[r.jsx(vc,{size:11}),b?"Add API key for headless mode":"Add API Key"]})]})]})}function jl({icon:t,label:a,description:s,children:l}){return r.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:r.jsx(t,{size:12,className:"text-accent"})}),r.jsx("div",{className:"text-[13px] font-medium text-text-0 font-sans leading-tight",children:a})]}),r.jsx("div",{className:"text-2xs text-text-4 font-sans leading-relaxed",children:s}),r.jsx("div",{className:"mt-auto pt-1",children:l})]})}const HS={telegram:ah,discord:pi,slack:Yb},ws={telegram:"Telegram",discord:"Discord",slack:"Slack"},tZ={telegram:"Bot token from @BotFather",discord:"Bot token from Developer Portal",slack:"Bot token (xoxb-...)"},nZ=["critical","lifecycle","all"];function aZ({type:t,open:a,onOpenChange:s}){if(!t)return null;const o={telegram:{title:"Set Up Telegram",icon:ah,intro:"Create a Telegram bot and connect it to Groove in under 2 minutes. No dependencies required.",sections:[{title:"Create Your Bot",steps:[{text:"Open Telegram on any device and search for",link:"https://t.me/BotFather",linkText:"@BotFather"},{text:"Send /newbot to start the setup"},{text:"Choose a display name — we suggest GroovePilot"},{text:'Choose a username (must end in "bot") — e.g. GroovePilot_bot'},{text:"BotFather will reply with your bot token — copy it"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Telegram card"},{text:"Paste your bot token and click Save"},{text:"The gateway will connect automatically"}]},{title:"Link a Chat",steps:[{text:"Open a chat with your new bot in Telegram"},{text:'Send any message (e.g. "hello") — Groove captures the chat ID automatically'},{text:"Click Test in the gateway card to verify"}]},{title:"Commands",note:"All commands use / prefix in Telegram:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},discord:{title:"Set Up Discord",icon:pi,intro:"Create a Discord bot and add it to your server. Requires discord.js (installed automatically with Groove).",sections:[{title:"Create the Application",steps:[{text:"Go to the",link:"https://discord.com/developers/applications",linkText:"Discord Developer Portal"},{text:"Click New Application and name it GroovePilot"},{text:"Go to the Bot tab in the left sidebar"},{text:"Click Reset Token and copy the bot token"}]},{title:"Set Permissions & Invite",steps:[{text:"Go to OAuth2 > URL Generator"},{text:"Under Scopes, check bot"},{text:"Under Bot Permissions, check:"}],scopes:["Send Messages","Read Message History","Embed Links","Use External Emojis"],after:[{text:"Copy the generated URL at the bottom and open it in your browser"},{text:"Select your server and click Authorize"}]},{title:"Enable Message Content Intent",steps:[{text:"Go back to the Bot tab in the Developer Portal"},{text:"Scroll to Privileged Gateway Intents"},{text:"Enable Message Content Intent — required for the bot to read commands"},{text:"Click Save Changes"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Discord card"},{text:"Paste your bot token and click Save"},{text:"Send a message in any channel where the bot is — Groove captures the channel automatically"}]},{title:"Commands",note:"All commands use / prefix in Discord:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},slack:{title:"Set Up Slack",icon:Yb,intro:"Create a Slack app with Socket Mode — no public URL needed. Requires @slack/bolt (installed automatically with Groove).",sections:[{title:"Create the App",steps:[{text:"Go to",link:"https://api.slack.com/apps",linkText:"api.slack.com/apps"},{text:"Click Create New App > From scratch"},{text:"Name it GroovePilot and select your workspace"}]},{title:"Enable Socket Mode",steps:[{text:"In the left sidebar, go to Settings > Socket Mode"},{text:"Toggle Enable Socket Mode to on"},{text:"It will ask you to create an App-Level Token"},{text:'Name it "groove", add the connections:write scope'},{text:"Click Generate — copy the xapp-... token (this is your App Token)"}],important:"Save this token now — you can't view it again after closing the dialog."},{title:"Set Bot Token Scopes",steps:[{text:"Go to Features > OAuth & Permissions"},{text:"Scroll to Bot Token Scopes and add all of these:"}],scopes:["chat:write","channels:read","channels:history","groups:read","groups:history","im:history","app_mentions:read"],after:[{text:"Scroll up and click Install to Workspace"},{text:"Click Allow to grant permissions"},{text:"Copy the Bot User OAuth Token (xoxb-...) — this is your Bot Token"}]},{title:"Enable Events",steps:[{text:"Go to Features > Event Subscriptions"},{text:"Toggle Enable Events to on"},{text:"Under Subscribe to bot events, add:"}],scopes:["message.channels","message.im","app_mention"],after:[{text:"Click Save Changes at the bottom"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Slack card"},{text:"Paste your Bot Token (xoxb-...) in the first field"},{text:"Paste your App Token (xapp-...) in the second field"},{text:"Click Save — Groove will auto-connect"}]},{title:"Link a Channel",steps:[{text:"Invite the bot to a channel: /invite @GroovePilot"},{text:"Select the channel from the dropdown in the gateway card"},{text:"Or @mention the bot — it will auto-capture the channel"},{text:"Click Test to verify"}],important:"For private channels, make sure you added the groups:read scope."},{title:"Commands",note:"In Slack, use plain text commands (no / prefix) or @mention the bot:",commands:["instruct <team> <msg>","query <team> <question>","plan <description>","log <team>","brief","tokens","status","agents","help","@GroovePilot status"]}]}}[t];if(!o)return null;const u=o.icon;return r.jsx(WS,{open:a,onOpenChange:s,children:r.jsx(BS,{title:o.title,width:480,children:r.jsxs("div",{className:"px-5 py-4 space-y-5",children:[r.jsxs("div",{className:"flex items-start gap-3 p-3 bg-accent/5 border border-accent/15 rounded-lg",children:[r.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:r.jsx(u,{size:16,className:"text-accent"})}),r.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed",children:o.intro})]}),o.sections.map((d,O)=>{var h;return r.jsxs("div",{children:[r.jsxs("h3",{className:"text-xs font-semibold text-text-0 font-sans mb-2.5 flex items-center gap-2",children:[r.jsx("span",{className:"w-5 h-5 rounded-full bg-accent/10 flex items-center justify-center text-2xs font-bold text-accent",children:O+1}),d.title]}),d.note&&r.jsx("p",{className:"text-2xs text-text-3 font-sans mb-2",children:d.note}),d.steps&&r.jsx("ol",{className:"space-y-2 mb-2",children:d.steps.map((p,x)=>r.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[r.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[x+1,"."]}),r.jsxs("span",{children:[p.text,p.link&&r.jsxs(r.Fragment,{children:[" ",r.jsxs("a",{href:p.link,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-0.5 font-medium",children:[p.linkText,r.jsx(bc,{size:9})]})]})]})]},x))}),d.scopes&&r.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 ml-6",children:d.scopes.map(p=>r.jsx("code",{className:"px-2 py-0.5 rounded bg-surface-4 text-2xs font-mono text-accent",children:p},p))}),d.after&&r.jsx("ol",{className:"space-y-2 mb-2",start:(((h=d.steps)==null?void 0:h.length)||0)+1,children:d.after.map((p,x)=>{var g;return r.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[r.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[(((g=d.steps)==null?void 0:g.length)||0)+x+1,"."]}),r.jsx("span",{children:p.text})]},x)})}),d.important&&r.jsx("div",{className:"ml-6 p-2 bg-warning/8 border border-warning/20 rounded-md text-2xs text-warning font-sans",children:d.important}),d.commands&&r.jsx("div",{className:"ml-6 p-2.5 bg-surface-0 border border-border-subtle rounded-md space-y-1",children:d.commands.map(p=>r.jsx("code",{className:"block text-2xs font-mono text-text-1",children:p},p))})]},O)}),r.jsxs("a",{href:"https://docs.groovedev.ai/guide/gateways",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium mt-2",children:[r.jsx(bc,{size:10}),"Full documentation at docs.groovedev.ai"]})]})})})}function sZ({gateway:t,onRefresh:a}){var se,oe;const[s,l]=v.useState(!1),[o,u]=v.useState(""),[d,O]=v.useState(""),[h,p]=v.useState(!1),[x,g]=v.useState(!1),[b,y]=v.useState(!1),[Q,w]=v.useState([]),[$,j]=v.useState(!1),z=D(H=>H.addToast);v.useEffect(()=>{t.connected&&!t.chatId&&t.type==="slack"&&J.get(`/gateways/${t.id}/channels`).then(H=>w(Array.isArray(H)?H:[])).catch(()=>{})},[t.connected,t.chatId,t.id,t.type]);const N=HS[t.type]||nh,_=t.type==="slack";async function G(){if(o.trim())try{await J.post(`/gateways/${t.id}/credentials`,{key:"bot_token",value:o.trim()}),_&&d.trim()&&await J.post(`/gateways/${t.id}/credentials`,{key:"app_token",value:d.trim()}),z("success","Token saved — connecting..."),u(""),O(""),l(!1);try{await J.post(`/gateways/${t.id}/connect`),z("success",`${ws[t.type]} connected!`)}catch(H){z("error","Token saved but connect failed",H.message)}a()}catch(H){z("error","Failed to save token",H.message)}}async function R(){g(!0);try{await J.post(`/gateways/${t.id}/test`),z("success","Test message sent!")}catch(H){z("error","Test failed",H.message)}g(!1)}async function X(){y(!0);try{t.connected?(await J.post(`/gateways/${t.id}/disconnect`),z("info",`${ws[t.type]} disconnected`)):(await J.post(`/gateways/${t.id}/connect`),z("success",`${ws[t.type]} connected!`)),a()}catch(H){z("error",t.connected?"Disconnect failed":"Connect failed",H.message)}y(!1)}async function T(H){try{await J.patch(`/gateways/${t.id}`,{enabled:H}),a()}catch(P){z("error","Update failed",P.message)}}async function V(H){try{await J.patch(`/gateways/${t.id}`,{notifications:{preset:H}}),a()}catch(P){z("error","Update failed",P.message)}}async function M(H){try{await J.patch(`/gateways/${t.id}`,{commandPermission:H}),a()}catch(P){z("error","Update failed",P.message)}}async function ae(){try{await J.delete(`/gateways/${t.id}`),z("info",`${ws[t.type]} gateway removed`),a()}catch(H){z("error","Delete failed",H.message)}}const F=((se=t.notifications)==null?void 0:se.preset)||"critical";return r.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(Ts,{status:t.connected?"running":"crashed",size:"sm"}),r.jsx(N,{size:13,className:"text-text-2"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:ws[t.type]}),r.jsx("div",{className:"flex-1"}),t.connected?r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(s1,{size:8})," Connected"]}):t.enabled?r.jsx(Xe,{variant:"warning",className:"text-2xs",children:"Disconnected"}):r.jsx(Xe,{variant:"default",className:"text-2xs",children:"Disabled"})]}),r.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[140px]",children:[t.connected&&!s&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success mb-3",children:[r.jsx(Dt,{size:10})," Gateway active",t.botUsername&&r.jsxs("span",{className:"text-text-4 ml-1",children:["@",t.botUsername]}),t.botTag&&r.jsx("span",{className:"text-text-4 ml-1",children:t.botTag})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:t.type==="slack"?"Channel":"Chat ID"}),t.chatId?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("code",{className:"flex-1 flex items-center h-7 px-2 bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2",children:t.type==="slack"&&Q.length>0?`#${((oe=Q.find(H=>H.id===t.chatId))==null?void 0:oe.name)||t.chatId}`:t.chatId}),r.jsx("button",{onClick:async()=>{try{await J.patch(`/gateways/${t.id}`,{chatId:null}),a()}catch(H){z("error","Failed",H.message)}},className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans",children:"Change"})]}):t.type==="slack"&&Q.length>0?r.jsxs("select",{onChange:async H=>{if(H.target.value)try{await J.patch(`/gateways/${t.id}`,{chatId:H.target.value}),a()}catch(P){z("error","Failed to set channel",P.message)}},className:"w-full h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",defaultValue:"",children:[r.jsx("option",{value:"",disabled:!0,children:"Select a channel..."}),Q.map(H=>r.jsxs("option",{value:H.id,children:["#",H.name]},H.id))]}):r.jsxs("div",{className:"text-2xs text-warning font-sans",children:[t.type==="slack"?"No channels found — invite the bot to a channel first.":"Send a message to the bot to auto-capture, or enter manually:",r.jsx("input",{placeholder:t.type==="slack"?"C0123456789":"Chat ID",className:"mt-1 w-full h-7 px-2 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",onKeyDown:async H=>{if(H.key==="Enter"&&H.target.value.trim())try{await J.patch(`/gateways/${t.id}`,{chatId:H.target.value.trim()}),a()}catch(P){z("error","Failed to set channel",P.message)}}})]})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Notifications"}),r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:nZ.map(H=>r.jsx("button",{onClick:()=>V(H),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",F===H?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:H},H))})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Commands"}),r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["full","read-only"].map(H=>r.jsx("button",{onClick:()=>M(H),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",(t.commandPermission||"full")===H?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:H==="full"?"Full Access":"Read Only"},H))})]})]}),!t.connected&&!s&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-xs text-text-3 font-sans mb-2",children:t.enabled?t.hasCredentials?"Tokens saved — click Connect.":"Configure bot token to connect.":"Gateway is disabled."}),!t.hasCredentials&&r.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer mb-2",children:[r.jsx(gc,{size:11}),"How to set up",r.jsx(bc,{size:9})]})]}),r.jsx(aZ,{type:t.type,open:$,onOpenChange:j}),r.jsx("div",{className:"flex-1"}),s&&r.jsxs("div",{className:"space-y-2.5 pt-1",children:[r.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer",children:[r.jsx(gc,{size:11}),"Where do I get these?"]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"Bot Token"}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{value:o,onChange:H=>u(H.target.value),onKeyDown:H=>H.key==="Enter"&&!_&&G(),type:h?"text":"password",placeholder:tZ[t.type],className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:()=>p(!h),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:h?r.jsx(Kf,{size:12}):r.jsx(Dl,{size:12})})]})]}),_&&r.jsxs("div",{children:[r.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"App Token (Socket Mode)"}),r.jsx("input",{value:d,onChange:H=>O(H.target.value),onKeyDown:H=>H.key==="Enter"&&G(),type:h?"text":"password",placeholder:"xapp-...",className:"w-full h-9 px-3 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ve,{variant:"primary",size:"sm",onClick:G,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Token"}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{l(!1),u(""),O("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!s&&r.jsxs("div",{className:"flex gap-2 mt-2",children:[!t.connected&&r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>l(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(vc,{size:11}),t.enabled?"Set Token":"Configure"]}),t.connected&&r.jsxs(r.Fragment,{children:[r.jsxs(ve,{variant:"secondary",size:"sm",onClick:R,disabled:x,className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(lh,{size:11}),x?"Sending...":"Test"]}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>l(!0),className:"h-7 text-2xs px-2.5",children:r.jsx(vc,{size:11})})]}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:X,disabled:b,className:"h-7 text-2xs px-2.5",title:t.connected?"Disconnect":"Connect",children:t.connected?r.jsx(Gb,{size:11}):r.jsx(s1,{size:11})}),r.jsx(K_,{value:t.enabled,onChange:T}),r.jsx("button",{onClick:ae,className:"text-text-4 hover:text-danger cursor-pointer p-1",title:"Remove gateway",children:r.jsx(as,{size:11})})]})]})]})}function lZ({existingTypes:t,onAdd:a}){const[s,l]=v.useState(!1),o=["telegram","discord","slack"].filter(u=>!t.includes(u));return o.length===0?null:s?r.jsxs("div",{className:"flex flex-col rounded-lg border border-accent/30 bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(nh,{size:13,className:"text-accent"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:"Add Gateway"}),r.jsx("div",{className:"flex-1"}),r.jsx("button",{onClick:()=>l(!1),className:"text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:12})})]}),r.jsx("div",{className:"p-3 space-y-2",children:o.map(u=>{const d=HS[u];return r.jsxs("button",{onClick:()=>{a(u),l(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-0 hover:bg-accent/8 border border-border-subtle hover:border-accent/20 cursor-pointer transition-all group",children:[r.jsx(d,{size:14,className:"text-text-3 group-hover:text-accent"}),r.jsx("span",{className:"text-xs font-medium text-text-1 group-hover:text-accent font-sans",children:ws[u]})]},u)})})]}):r.jsxs("button",{onClick:()=>l(!0),className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border-subtle bg-surface-1/50 hover:bg-surface-1 hover:border-accent/30 min-h-[140px] min-w-[220px] cursor-pointer transition-all group",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/8 group-hover:bg-accent/15 flex items-center justify-center mb-2 transition-colors",children:r.jsx(Ja,{size:14,className:"text-accent"})}),r.jsx("span",{className:"text-2xs font-semibold text-text-3 group-hover:text-text-1 font-sans transition-colors",children:"Add Gateway"})]})}function rZ(){const[t,a]=v.useState([]),[s,l]=v.useState(null),[o,u]=v.useState(null),[d,O]=v.useState([]),[h,p]=v.useState(!0),[x,g]=v.useState(!1),b=D(X=>X.addToast),y=D(X=>X.marketplaceUser),Q=D(X=>X.marketplaceAuthenticated),w=D(X=>X.marketplaceLogin),$=D(X=>X.marketplaceLogout);function j(){J.get("/providers").then(X=>a(Array.isArray(X)?X:[])).catch(()=>{})}function z(){J.get("/gateways").then(X=>O(Array.isArray(X)?X:[])).catch(()=>{})}v.useEffect(()=>{Promise.all([J.get("/providers"),J.get("/config"),J.get("/status"),J.get("/gateways")]).then(([X,T,V,M])=>{a(Array.isArray(X)?X:[]),l(T),u(V),O(Array.isArray(M)?M:[]),p(!1)}).catch(()=>p(!1))},[]);async function N(X){try{await J.post("/gateways",{type:X}),b("success",`${ws[X]} gateway added`),z()}catch(T){b("error","Failed to add gateway",T.message)}}async function _(X,T){try{const V=await J.patch("/config",{[X]:T});l(V)}catch(V){b("error","Update failed",V.message)}}if(h)return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx("div",{className:"h-12 bg-surface-1 border-b border-border"}),r.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[r.jsx("div",{className:"grid grid-cols-4 gap-3",children:[...Array(4)].map((X,T)=>r.jsx(rn,{className:"h-40 rounded-lg"},T))}),r.jsx("div",{className:"grid grid-cols-3 gap-3",children:[...Array(6)].map((X,T)=>r.jsx(rn,{className:"h-28 rounded-lg"},T))})]})]});const G=t.filter(X=>X.authType==="local"||X.authType==="subscription"?X.installed:X.hasKey).length,R=(s==null?void 0:s.rotationThreshold)||0;return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border-b border-border flex-shrink-0",children:[r.jsx("h2",{className:"text-sm font-semibold text-text-0 font-sans",children:"Settings"}),r.jsx("div",{className:"flex-1"}),r.jsxs("div",{className:"flex items-center gap-4 text-2xs text-text-3 font-sans",children:[(o==null?void 0:o.version)&&r.jsxs("span",{children:["v",o.version]}),(o==null?void 0:o.port)&&r.jsxs("span",{children:[":",o.port]}),(o==null?void 0:o.uptime)>0&&r.jsxs("span",{children:["Up ",Dc(o.uptime)]})]}),r.jsx("div",{className:"w-px h-4 bg-border-subtle"}),Q?r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(J_,{user:y}),r.jsx("span",{className:"text-xs font-medium text-text-0 font-sans",children:(y==null?void 0:y.displayName)||"User"}),r.jsxs("button",{onClick:$,className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans flex items-center gap-1",children:[r.jsx(Mb,{size:10})," Sign out"]})]}):r.jsxs(ve,{variant:"ghost",size:"sm",onClick:w,className:"h-7 text-2xs gap-1.5 text-text-3",children:[r.jsx(eh,{size:11})," Sign in"]}),r.jsx(Ts,{status:"running",size:"sm"})]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"p-4 space-y-4",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Providers"}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[G,"/",t.length," connected"]})]}),r.jsx("div",{className:"grid grid-cols-4 gap-3",children:t.map(X=>r.jsx(eZ,{provider:X,onKeyChange:j},X.id))})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Gateways"}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[d.filter(X=>X.connected).length,"/",d.length," connected"]})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[d.map(X=>r.jsx(sZ,{gateway:X,onRefresh:z},X.id)),r.jsx(lZ,{existingTypes:d.map(X=>X.type),onAdd:N})]})]}),s&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Configuration"}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Auto-saves"})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsx(jl,{icon:Al,label:"Default Provider",description:"Provider used when spawning new agents.",children:r.jsx("select",{value:s.defaultProvider||"claude-code",onChange:X=>_("defaultProvider",X.target.value),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:t.filter(X=>X.installed||X.hasKey).map(X=>r.jsx("option",{value:X.id,children:X.name},X.id))})}),r.jsx(jl,{icon:ai,label:"Working Directory",description:"Default root directory for new agents.",children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("code",{className:"flex-1 h-8 px-2 flex items-center bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2 truncate min-w-0",children:s.defaultWorkingDir||"Project root"}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>g(!0),className:"h-8 px-2 flex-shrink-0",children:r.jsx(Zb,{size:12})})]})}),r.jsx(jl,{icon:Eb,label:"Rotation Threshold",description:"Context usage that triggers auto-rotation.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["auto","50%","65%","75%","85%"].map(X=>{const T=X==="auto"?0:parseInt(X,10)/100,V=R===T;return r.jsx("button",{onClick:()=>_("rotationThreshold",T),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",V?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:X==="auto"?"Auto":X},X)})})}),r.jsx(jl,{icon:Hb,label:"QC Threshold",description:"Running agents count that triggers auto-QC.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[2,3,4,6,8].map(X=>{const T=(s.qcThreshold||2)===X;return r.jsx("button",{onClick:()=>_("qcThreshold",X),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:X},X)})})}),r.jsx(jl,{icon:bi,label:"Max Agents",description:"Concurrent agent limit. 0 = unlimited.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[0,4,8,12,20].map(X=>{const T=(s.maxAgents||0)===X;return r.jsx("button",{onClick:()=>_("maxAgents",X),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:X===0?"∞":X},X)})})}),r.jsx(jl,{icon:si,label:"Journalist Interval",description:"Seconds between synthesis cycles.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[60,120,300,600].map(X=>{const T=(s.journalistInterval||120)===X,V=X<60?`${X}s`:`${X/60}m`;return r.jsx("button",{onClick:()=>_("journalistInterval",X),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:V},X)})})})]})]})]})}),r.jsx(DS,{open:x,onOpenChange:g,currentPath:(s==null?void 0:s.defaultWorkingDir)||"/",onSelect:X=>_("defaultWorkingDir",X)})]})}const zf=v.forwardRef(({className:t,label:a,error:s,mono:l,...o},u)=>r.jsxs("div",{className:"flex flex-col gap-1",children:[a&&r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),r.jsx("input",{ref:u,className:re("h-8 w-full rounded-md px-3 text-sm","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",l?"font-mono":"font-sans",s&&"border-danger focus:ring-danger",t),...o}),s&&r.jsx("span",{className:"text-2xs text-danger font-sans",children:s})]}));zf.displayName="Input";const iZ=v.forwardRef(({className:t,label:a,error:s,mono:l,...o},u)=>r.jsxs("div",{className:"flex flex-col gap-1",children:[a&&r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),r.jsx("textarea",{ref:u,className:re("w-full rounded-md px-3 py-2 text-sm resize-none","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",l?"font-mono":"font-sans",s&&"border-danger focus:ring-danger",t),...o}),s&&r.jsx("span",{className:"text-2xs text-danger font-sans",children:s})]}));iZ.displayName="Textarea";function Cc(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`:"—"}function oZ(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB/s`:`${(t/(1024*1024)).toFixed(1)} MB/s`:""}function cZ({hardware:t}){var a;return t?r.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border border-border-subtle rounded-lg text-xs font-sans text-text-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(MT,{size:14,className:"text-text-3"}),r.jsxs("span",{children:[t.totalRamGb," GB RAM"]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Al,{size:14,className:"text-text-3"}),r.jsxs("span",{children:[t.cores," cores"]})]}),t.gpu&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Jf,{size:14,className:"text-text-3"}),r.jsxs("span",{children:[t.gpu.name,t.gpu.vram?` (${t.gpu.vram} GB)`:""]})]}),((a=t.recommended)==null?void 0:a.code)&&r.jsxs("div",{className:"ml-auto text-accent",children:["Recommended: ",t.recommended.code]})]}):null}function uZ({download:t}){const a=Math.round((t.percent||0)*100);return r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans text-text-3",children:[r.jsx("span",{children:t.filename}),r.jsxs("span",{children:[a,"% ",oZ(t.speed)]})]}),r.jsx("div",{className:"h-1.5 bg-surface-3 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-accent rounded-full transition-all",style:{width:`${a}%`}})}),r.jsxs("div",{className:"text-2xs text-text-4",children:[Cc(t.downloaded)," / ",Cc(t.totalBytes)]})]})}function dZ({model:t,onDelete:a}){const[s,l]=v.useState(!1),o={light:"text-green-400",medium:"text-blue-400",heavy:"text-orange-400"};return r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg",children:[r.jsx(Ff,{size:18,className:"text-accent flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.id}),t.quantization&&r.jsx(Xe,{variant:"subtle",className:"text-2xs",children:t.quantization}),t.parameters&&r.jsx(Xe,{variant:"subtle",className:"text-2xs",children:t.parameters}),r.jsx("span",{className:re("text-2xs font-medium capitalize",o[t.tier]||"text-text-3"),children:t.tier})]}),r.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[Cc(t.sizeBytes)," · ctx ",(t.contextWindow||0).toLocaleString()," · ",t.category,t.repoId&&r.jsxs("span",{className:"text-text-4",children:[" · ",t.repoId]})]})]}),r.jsx("button",{onClick:async()=>{l(!0),await a(t.id),l(!1)},disabled:s,className:"p-1.5 rounded-md text-text-4 hover:text-red-400 hover:bg-red-400/10 transition-colors",children:s?r.jsx(Ka,{size:14,className:"animate-spin"}):r.jsx(as,{size:14})})]})}function OZ({result:t,onExpand:a,expanded:s}){var l;return r.jsxs("button",{onClick:()=>a(s?null:t.id),className:"w-full text-left px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg hover:border-accent/30 transition-colors cursor-pointer",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate flex-1",children:t.name}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:t.author}),s?r.jsx(ca,{size:14,className:"text-text-3"}):r.jsx(Ll,{size:14,className:"text-text-3"})]}),r.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5 flex gap-3",children:[r.jsxs("span",{children:[(l=t.downloads)==null?void 0:l.toLocaleString()," downloads"]}),r.jsxs("span",{children:[t.likes," likes"]})]})]})}function fZ({repoId:t,onDownload:a,systemRamGb:s}){const[l,o]=v.useState(null),[u,d]=v.useState(!0),[O,h]=v.useState(null),p=Bl();v.useEffect(()=>{d(!0),J.get(`/models/${t}/files`).then(g=>o(g.files||[])).catch(()=>p.error("Failed to load model files")).finally(()=>d(!1))},[t]);async function x(g){h(g.filename);try{await J.post("/models/download",{repoId:t,filename:g.filename}),p.success(`Downloading ${g.filename}`),a==null||a(g.filename)}catch(b){p.error(b.message)}h(null)}return u?r.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"Loading quantization variants..."}):l!=null&&l.length?r.jsx("div",{className:"pl-6 pr-4 pb-2 space-y-1.5",children:l.map(g=>{const b=!g.estimatedRamGb||!s||g.estimatedRamGb<=s,y=g.estimatedRamGb&&s&&g.estimatedRamGb>s*.8&&b;return r.jsxs("div",{className:re("flex items-center gap-2 py-1.5 px-3 rounded-md text-xs font-sans",b?"bg-surface-2":"bg-red-500/5 border border-red-500/15"),children:[r.jsx("span",{className:"font-mono text-text-1 truncate flex-1",children:g.filename}),g.quantization&&r.jsx(Xe,{variant:"subtle",className:"text-2xs",children:g.quantization}),r.jsx("span",{className:"text-text-2 text-2xs w-16 text-right",children:Cc(g.size)}),g.estimatedRamGb&&r.jsxs("span",{className:re("text-2xs w-20 text-right font-medium",b?y?"text-yellow-400":"text-green-400":"text-red-400"),children:["~",g.estimatedRamGb," GB RAM"]}),!b&&r.jsx("span",{className:"text-2xs text-red-400 font-medium",children:"too large"}),r.jsx("button",{onClick:()=>x(g),disabled:O===g.filename||!b,className:re("p-1 rounded transition-colors",b?"text-accent hover:bg-accent/10":"text-text-4 cursor-not-allowed","disabled:opacity-40"),children:O===g.filename?r.jsx(Ka,{size:13,className:"animate-spin"}):r.jsx(mi,{size:13})})]},g.filename)})}):r.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"No GGUF files found in this repo."})}function hZ({model:t,systemRamGb:a,onPull:s,pulling:l,isInstalled:o}){const u={light:"text-green-400",medium:"text-blue-400",heavy:"text-orange-400"},d={code:"{}",general:"AI"},O=a?Math.round((1-t.ramGb/a)*100):null;return r.jsxs("div",{className:re("flex items-center gap-3 px-4 py-3 border rounded-lg transition-colors",o?"bg-success/5 border-success/20":"bg-surface-1 border-border-subtle hover:border-accent/20"),children:[r.jsx("div",{className:"w-9 h-9 rounded-lg bg-surface-3 flex items-center justify-center text-xs font-mono text-text-2 flex-shrink-0",children:d[t.category]||"AI"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.name}),r.jsx("span",{className:re("text-2xs font-semibold capitalize",u[t.tier]),children:t.tier}),o&&r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(Dt,{size:8})," Installed"]})]}),r.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:t.description}),r.jsxs("div",{className:"flex items-center gap-3 mt-1 text-2xs font-sans",children:[r.jsxs("span",{className:"text-text-2",children:[t.sizeGb," GB download"]}),r.jsxs("span",{className:"text-green-400 font-medium",children:[t.ramGb," GB RAM"]}),O!==null&&r.jsxs("span",{className:"text-text-4",children:[O,"% headroom"]})]})]}),o?r.jsx("span",{className:"text-xs text-success font-sans font-medium px-3 py-1.5",children:"Ready"}):r.jsxs("button",{onClick:()=>s(t.id),disabled:l===t.id,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer disabled:opacity-40",children:[l===t.id?r.jsx(Ka,{size:12,className:"animate-spin"}):r.jsx(mi,{size:12}),"Pull"]})]})}function mZ(){const[t,a]=v.useState("recommended"),[s,l]=v.useState(""),[o,u]=v.useState([]),[d,O]=v.useState(!1),[h,p]=v.useState([]),[x,g]=v.useState([]),[b,y]=v.useState([]),[Q,w]=v.useState(null),[$,j]=v.useState(null),[z,N]=v.useState(null),[_,G]=v.useState([]),R=Bl(),X=v.useCallback(()=>{J.get("/models/installed").then(F=>{p(F.models||[])}).catch(()=>{})},[]),T=v.useCallback(()=>{J.get("/providers/ollama/models").then(F=>{G((F.installed||[]).map(se=>se.id))}).catch(()=>{})},[]);v.useEffect(()=>{J.get("/providers/ollama/hardware").then(w).catch(()=>{}),J.get("/models/recommended").then(F=>{g(F.models||[]),!Q&&F.hardware&&w(F.hardware)}).catch(()=>{}),X(),T()},[X,T]);async function V(F){N(F);try{await J.post("/providers/ollama/pull",{model:F}),R.success(`${F} ready to use`),X(),T(),G(se=>[...se,F])}catch(se){R.error(`Pull failed: ${se.message}`)}N(null)}v.useEffect(()=>{const F=D.subscribe((oe,H)=>{}),se=setInterval(()=>{J.get("/models/downloads").then(y).catch(()=>{})},2e3);return()=>{F(),clearInterval(se)}},[]),v.useEffect(()=>{function F(oe){try{const H=JSON.parse(oe.data);H.type==="model:download:progress"&&y(P=>{const W=P.findIndex(E=>E.filename===H.data.filename);if(W>=0){const E=[...P];return E[W]=H.data,E}return[...P,H.data]}),H.type==="model:download:complete"&&(y(P=>P.filter(W=>W.filename!==H.data.filename)),X(),R.success(`${H.data.filename} downloaded`)),H.type==="model:download:error"&&(y(P=>P.filter(W=>W.filename!==H.data.filename)),R.error(`Download failed: ${H.data.error}`))}catch{}}const se=D.getState()._ws;return se&&se.addEventListener("message",F),()=>{se&&se.removeEventListener("message",F)}},[X,R]);async function M(){if(s.trim()){O(!0),a("search");try{const F=await J.get(`/models/search?q=${encodeURIComponent(s.trim())}`);u(F)}catch(F){R.error(F.message)}O(!1)}}async function ae(F){try{await J.delete(`/models/${F}`),p(se=>se.filter(oe=>oe.id!==F)),R.success("Model deleted")}catch(se){R.error(se.message)}}return r.jsxs("div",{className:"h-full flex flex-col bg-surface-0",children:[r.jsxs("div",{className:"flex-shrink-0 px-5 pt-4 pb-3 border-b border-border space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h1",{className:"text-base font-bold font-sans text-text-0",children:"Local Models"}),r.jsxs(Xe,{variant:"subtle",className:"text-2xs",children:[h.length," installed"]})]}),r.jsx(cZ,{hardware:Q}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(da,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-4"}),r.jsx("input",{value:s,onChange:F=>l(F.target.value),onKeyDown:F=>F.key==="Enter"&&M(),placeholder:"Search HuggingFace for GGUF models...",className:"w-full h-8 pl-9 pr-3 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),r.jsx(ve,{onClick:M,disabled:d,size:"sm",variant:"accent",children:d?r.jsx(Ka,{size:14,className:"animate-spin"}):"Search"})]}),r.jsx("div",{className:"flex gap-1",children:[{id:"recommended",label:`Recommended (${x.length})`},{id:"installed",label:`Installed (${h.length})`},{id:"search",label:`Search (${o.length})`}].map(F=>r.jsx("button",{onClick:()=>a(F.id),className:re("px-3 py-1 rounded-md text-xs font-sans font-medium transition-colors cursor-pointer",t===F.id?"bg-accent/12 text-accent":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:F.label},F.id))})]}),b.length>0&&r.jsxs("div",{className:"px-5 py-3 border-b border-border space-y-2",children:[r.jsx("div",{className:"text-xs font-sans font-semibold text-text-2",children:"Downloading"}),b.map(F=>r.jsx(uZ,{download:F},F.filename))]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"px-5 py-4 space-y-2",children:[t==="recommended"&&r.jsx(r.Fragment,{children:x.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Al,{size:40,className:"mx-auto text-text-4 mb-3"}),r.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Detecting hardware..."}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Make sure Ollama is installed so we can check your system."})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"text-xs text-text-3 font-sans mb-2",children:["Top models for your system (",(Q==null?void 0:Q.totalRamGb)||"?"," GB RAM). Click Pull to download via Ollama."]}),x.map(F=>{const se=F.id.split(":")[0],oe=_.some(H=>H===F.id||H.startsWith(se+":")||H===se);return r.jsx(hZ,{model:F,systemRamGb:Q==null?void 0:Q.totalRamGb,onPull:V,pulling:z,isInstalled:oe},F.id)})]})}),t==="installed"&&r.jsx(r.Fragment,{children:h.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ff,{size:40,className:"mx-auto text-text-4 mb-3"}),r.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"No local models yet"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Search HuggingFace to download GGUF models, or pull models via Ollama."})]}):h.map(F=>r.jsx(dZ,{model:F,onDelete:ae},F.id))}),t==="search"&&r.jsx(r.Fragment,{children:d?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ka,{size:24,className:"mx-auto text-accent animate-spin mb-3"}),r.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Searching HuggingFace..."})]}):o.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(da,{size:40,className:"mx-auto text-text-4 mb-3"}),r.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Search for GGUF models"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:'Try "qwen coder", "deepseek", "codestral", "llama"'})]}):o.map(F=>r.jsxs("div",{className:"space-y-1",children:[r.jsx(OZ,{result:F,expanded:$===F.id,onExpand:j}),$===F.id&&r.jsx(fZ,{repoId:F.id,onDownload:()=>X(),systemRamGb:Q==null?void 0:Q.totalRamGb})]},F.id))})]})})]})}const Q0=["Reading through the codebase...","Thinking through your request...","Planning the approach...","Running tool calls...","Working through the problem...","Reasoning step by step...","Reviewing context...","Considering options...","Analyzing the code...","Making progress..."];function pZ({agent:t,className:a}){const[s,l]=v.useState(0),[o,u]=v.useState(!0);return v.useEffect(()=>{const d=setInterval(()=>{u(!1),setTimeout(()=>{l(O=>(O+1)%Q0.length),u(!0)},250)},2800);return()=>clearInterval(d)},[]),r.jsxs("div",{className:`${a||""}`,children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(t==null?void 0:t.name)||"Agent"}),r.jsx("span",{className:"text-2xs text-accent font-mono",children:"thinking"})]}),r.jsxs("div",{className:"border-l border-accent/40 pl-3.5 py-1 flex items-center gap-2.5",children:[r.jsx("div",{className:"relative w-3.5 h-3.5 flex-shrink-0",children:r.jsx("span",{className:"absolute inset-0 rounded-full border border-transparent border-t-accent animate-spin",style:{animationDuration:"0.9s"}})}),r.jsx("span",{className:"text-[12px] font-sans text-text-3 transition-opacity duration-[250ms]",style:{opacity:o?1:0},children:Q0[s]})]})]})}const Rf=[];function IS(t){const a=(t||"").toLowerCase();return a.includes("reading")||a.includes("read ")?{icon:Dl,color:"text-info",label:"Reading"}:a.includes("editing")||a.includes("wrote")||a.includes("writing")||a.includes("edit ")?{icon:_b,color:"text-warning",label:"Editing"}:a.includes("searching")||a.includes("search")||a.includes("grep")||a.includes("glob")?{icon:da,color:"text-purple",label:"Searching"}:a.includes("running")||a.includes("bash")||a.includes("command")||a.includes("exec")?{icon:xi,color:"text-orange",label:"Running"}:a.includes("test")||a.includes("pass")?{icon:mf,color:"text-success",label:"Testing"}:a.includes("error")||a.includes("fail")||a.includes("crash")?{icon:ua,color:"text-danger",label:"Error"}:a.includes("rotat")?{icon:Wl,color:"text-accent",label:"Rotating"}:a.includes("spawn")||a.includes("start")?{icon:Rn,color:"text-success",label:"Spawned"}:a.includes("tool")||a.includes("function")?{icon:VN,color:"text-text-2",label:"Tool"}:a.includes("complet")||a.includes("done")||a.includes("finish")?{icon:mf,color:"text-success",label:"Done"}:{icon:ns,color:"text-text-3",label:"Activity"}}function kl({text:t}){return t?t.split(/(\*\*[^*]+\*\*|`[^`]+`)/g).map((a,s)=>a.startsWith("**")&&a.endsWith("**")?r.jsx("strong",{className:"font-semibold text-text-0",children:a.slice(2,-2)},s):a.startsWith("`")&&a.endsWith("`")?r.jsx("code",{className:"px-1 py-px rounded bg-accent/8 text-[11px] font-mono text-accent",children:a.slice(1,-1)},s):r.jsx("span",{children:a},s)):null}function xZ({text:t}){if(!t)return null;const a=[],s=t.split(`
|
|
632
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(s))},[s,t]),null},H_="DialogDescriptionWarning",I_=({contentRef:t,descriptionId:a})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ZS(H_).contentName}}.`;return v.useEffect(()=>{var u;const o=(u=t.current)==null?void 0:u.getAttribute("aria-describedby");a&&o&&(document.getElementById(a)||console.warn(l))},[l,t,a]),null},AS=QS,ES=kS,qS=$S,MS=TS,YS=PS,US=RS,VS=XS;function GS({children:t,...a}){return r.jsx(AS,{...a,children:t})}function LS({children:t,className:a,title:s,description:l,...o}){return r.jsxs(ES,{children:[r.jsx(qS,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),r.jsxs(MS,{className:re("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-full max-w-lg max-h-[85vh] overflow-y-auto","bg-surface-1 border border-border rounded-lg shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",a),...o,children:[s&&r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle",children:[r.jsx(YS,{className:"text-base font-semibold text-text-0 font-sans",children:s}),r.jsx(VS,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors",children:r.jsx(Qt,{size:16})})]}),l&&r.jsx(US,{className:"sr-only",children:l}),t]})]})}var S0={};function F_({path:t,onNavigate:a}){const s=t.split("/").filter(Boolean);return r.jsxs("div",{className:"flex items-center gap-0.5 min-w-0 overflow-x-auto py-1.5 scrollbar-none",children:[r.jsx("button",{onClick:()=>a("/"),className:"flex-shrink-0 p-1 rounded hover:bg-surface-5 cursor-pointer text-text-3 hover:text-text-0 transition-colors",children:r.jsx(Jf,{size:13})}),s.map((l,o)=>{const u="/"+s.slice(0,o+1).join("/"),d=o===s.length-1;return r.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[r.jsx(Ll,{size:11,className:"text-text-4"}),r.jsx("button",{onClick:()=>a(u),className:re("px-1.5 py-0.5 rounded text-xs font-mono cursor-pointer transition-colors",d?"text-text-0 bg-surface-4 font-medium":"text-text-3 hover:text-text-0 hover:bg-surface-5"),children:l})]},o)})]})}function DS({open:t,onOpenChange:a,currentPath:s,onSelect:l}){const[o,u]=v.useState(s||S0.HOME||"/"),[d,O]=v.useState([]),[h,p]=v.useState(!1),[x,g]=v.useState(null);v.useEffect(()=>{t&&b(s||"/")},[t]);async function b($){p(!0),g(null);try{const j=await J.get(`/browse-system?path=${encodeURIComponent($)}`);u(j.current||$),O(j.dirs||[])}catch(j){g(j.message),O([])}p(!1)}function y(){const $=o==="/"?"/":o.split("/").slice(0,-1).join("/")||"/";b($)}function Q(){b(S0.HOME||"/Users")}function w(){l(o),a(!1)}return r.jsx(GS,{open:t,onOpenChange:a,children:r.jsx(LS,{title:"Select Working Directory",description:"Choose a directory for this agent to work in",className:"max-w-[520px]",children:r.jsxs("div",{className:"px-5 py-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{onClick:y,disabled:o==="/",className:"p-1.5 rounded-md bg-surface-4 border border-border text-text-2 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",children:r.jsx(Q5,{size:14})}),r.jsx("button",{onClick:Q,className:"p-1.5 rounded-md bg-surface-4 border border-border text-text-2 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:r.jsx(jT,{size:14})}),r.jsx("div",{className:"flex-1 min-w-0 bg-surface-0 rounded-md border border-border-subtle px-2",children:r.jsx(F_,{path:o,onNavigate:b})})]}),r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle overflow-hidden",children:r.jsxs("div",{className:"max-h-[340px] overflow-y-auto",children:[h&&r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(Ka,{size:18,className:"text-text-3 animate-spin"})}),x&&r.jsx("div",{className:"px-4 py-6 text-center",children:r.jsx("p",{className:"text-xs text-danger font-sans",children:x})}),!h&&!x&&d.length===0&&r.jsx("div",{className:"px-4 py-6 text-center",children:r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No subdirectories"})}),!h&&!x&&d.map($=>r.jsxs("button",{onClick:()=>b($.path),className:re("w-full flex items-center gap-2.5 px-3.5 py-2 text-left cursor-pointer","hover:bg-surface-4 transition-colors border-b border-border-subtle last:border-0"),children:[$.hasChildren?r.jsx(OT,{size:15,className:"text-warning flex-shrink-0"}):r.jsx(ai,{size:15,className:"text-text-3 flex-shrink-0"}),r.jsx("span",{className:"text-sm text-text-0 font-sans truncate flex-1",children:$.name}),$.hasChildren&&r.jsx(Ll,{size:12,className:"text-text-4 flex-shrink-0"})]},$.path))]})}),r.jsxs("div",{className:"flex items-center gap-3 bg-surface-4/50 rounded-lg px-3.5 py-2.5 border border-border-subtle",children:[r.jsx(ai,{size:16,className:"text-accent flex-shrink-0"}),r.jsx("span",{className:"text-xs font-mono text-text-1 truncate flex-1",children:o})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(ve,{variant:"ghost",size:"md",onClick:()=>a(!1),children:"Cancel"}),r.jsxs(ve,{variant:"primary",size:"md",onClick:w,className:"gap-1.5",children:[r.jsx(Dt,{size:14})," Select Folder"]})]})]})})})}function WS({children:t,...a}){return r.jsx(AS,{...a,children:t})}function BS({children:t,className:a,title:s,side:l="right",width:o=400,...u}){return r.jsxs(ES,{children:[r.jsx(qS,{className:"fixed inset-0 z-40 bg-black/30"}),r.jsxs(MS,{className:re("fixed top-0 z-50 h-full overflow-y-auto","bg-surface-1 border-l border-border shadow-2xl","data-[state=open]:animate-in data-[state=closed]:animate-out",l==="right"&&"right-0 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",l==="left"&&"left-0 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",a),style:{width:o},...u,children:[s&&r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-subtle sticky top-0 bg-surface-1 z-10",children:[r.jsx(YS,{className:"text-base font-semibold text-text-0 font-sans",children:s}),r.jsx(VS,{className:"p-1 rounded-md text-text-3 hover:text-text-0 hover:bg-surface-5 transition-colors cursor-pointer",children:r.jsx(Qt,{size:16})})]}),r.jsx(US,{className:"sr-only",children:"Panel"}),t]})]})}function K_({value:t,onChange:a}){return r.jsx("button",{onClick:()=>a(!t),className:re("w-9 h-5 rounded-full p-0.5 transition-colors cursor-pointer",t?"bg-accent":"bg-surface-5"),children:r.jsx("div",{className:re("w-4 h-4 rounded-full bg-white shadow-sm transition-transform",t?"translate-x-4":"translate-x-0")})})}function J_({user:t}){const[a,s]=v.useState(!1),l=(t==null?void 0:t.avatar)||(t==null?void 0:t.picture)||(t==null?void 0:t.photoURL)||(t==null?void 0:t.photo);return l&&!a?r.jsx("img",{src:l,alt:"",className:"w-6 h-6 rounded-full",referrerPolicy:"no-referrer",crossOrigin:"anonymous",onError:()=>s(!0)}):r.jsx("div",{className:"w-6 h-6 rounded-full bg-accent/10 flex items-center justify-center",children:r.jsx(Fb,{size:12,className:"text-accent"})})}function eZ({provider:t,onKeyChange:a}){var $,j,z;const[s,l]=v.useState(!1),[o,u]=v.useState(""),[d,O]=v.useState(!1),[h,p]=v.useState(!1),x=D(N=>N.addToast),g=t.authType==="local",b=t.authType==="subscription",y=g||b?t.installed:t.hasKey;async function Q(){if(o.trim())try{await J.post(`/credentials/${t.id}`,{key:o.trim()}),x("success",`API key set for ${t.name}`),u(""),l(!1),a&&a()}catch(N){x("error","Failed to set key",N.message)}}async function w(){try{await J.delete(`/credentials/${t.id}`),x("info",`Removed ${t.name} key`),a&&a()}catch(N){x("error","Remove failed",N.message)}}if(g){const N=((j=($=t.models)==null?void 0:$.filter(G=>!G.disabled))==null?void 0:j.length)||0,_=()=>D.getState().setActiveView("models");return r.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(Ts,{status:y&&N>0?"running":"crashed",size:"sm"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),r.jsx("div",{className:"flex-1"}),y&&N>0?r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(Dt,{size:8})," ",N," models"]}):y?r.jsx(Xe,{variant:"warning",className:"text-2xs",children:"No models pulled"}):r.jsx(Xe,{variant:"default",className:"text-2xs",children:"Not set up"})]}),r.jsx("div",{className:"flex-1",children:h?r.jsxs(r.Fragment,{children:[r.jsx(uS,{isInstalled:y,onModelChange:a}),r.jsxs("div",{className:"px-4 py-2 border-t border-border-subtle flex gap-2",children:[r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>p(!1),className:"flex-1 h-7 text-2xs",children:"Back"}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>{p(!1),_()},className:"flex-1 h-7 text-2xs gap-1",children:"Models Tab"})]})]}):r.jsxs("div",{className:"px-4 py-3 flex flex-col h-full",children:[r.jsx("div",{className:"text-xs text-text-3 font-sans flex-1",children:y&&N>0?"Full agentic runtime — tool calling, context rotation, zero cloud cost":y?"Ollama is running. Pull a model to start using local agents.":"Run any open-source model locally — free, private, fully offline. Requires Ollama."}),r.jsxs("div",{className:"flex gap-2 mt-3",children:[y?r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>p(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(Al,{size:11})," ",N>0?"Manage":"Pull Models"]}):r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>p(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(Al,{size:11})," Set Up Ollama"]}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:_,className:"flex-1 h-7 text-2xs gap-1.5",children:"Models Tab"})]})]})})]})}return r.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(Ts,{status:y?"running":"crashed",size:"sm"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:t.name}),r.jsx("div",{className:"flex-1"}),y?r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(Dt,{size:8})," Ready"]}):r.jsx(Xe,{variant:"default",className:"text-2xs",children:b?"Not installed":"No key"})]}),r.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[120px]",children:[((z=t.models)==null?void 0:z.length)>0&&r.jsx("div",{className:"flex flex-wrap gap-1 mb-3",children:t.models.map(N=>r.jsx("span",{className:"px-1.5 py-0.5 rounded bg-surface-4 text-2xs font-mono text-text-3",children:N.name||N.id},N.id))}),b&&y&&!t.hasKey&&!s&&r.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-accent/8 border border-accent/20 rounded-md text-2xs font-sans text-accent mb-3",children:[r.jsx(Dt,{size:10})," Subscription active"]}),t.hasKey&&!s&&r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsxs("div",{className:"flex-1 flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success",children:[r.jsx(Dt,{size:10})," API Connected"]}),r.jsx("button",{onClick:()=>{l(!0),O(!1),u("")},className:"text-2xs text-text-4 hover:text-accent cursor-pointer font-sans",children:"Edit"}),r.jsx("button",{onClick:w,className:"text-2xs text-text-4 hover:text-danger cursor-pointer font-sans",children:"Remove"})]}),r.jsx("div",{className:"flex-1"}),s&&r.jsxs("div",{className:"space-y-2.5 pt-1",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:t.hasKey?"Update API Key":`${t.name} API Key`}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{value:o,onChange:N=>u(N.target.value),onKeyDown:N=>N.key==="Enter"&&Q(),type:d?"text":"password",placeholder:"sk-...",className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:()=>O(!d),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:d?r.jsx(Kf,{size:12}):r.jsx(Dl,{size:12})})]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ve,{variant:"primary",size:"sm",onClick:Q,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Key"}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{l(!1),u("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!s&&!t.hasKey&&r.jsxs(ve,{variant:b?"secondary":"primary",size:"sm",onClick:()=>{l(!0),O(!1),u("")},className:"w-full h-8 text-2xs gap-1.5 mt-2",children:[r.jsx(vc,{size:11}),b?"Add API key for headless mode":"Add API Key"]})]})]})}function jl({icon:t,label:a,description:s,children:l}){return r.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-1 px-4 py-3.5 flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-6 h-6 rounded bg-accent/8 flex items-center justify-center flex-shrink-0",children:r.jsx(t,{size:12,className:"text-accent"})}),r.jsx("div",{className:"text-[13px] font-medium text-text-0 font-sans leading-tight",children:a})]}),r.jsx("div",{className:"text-2xs text-text-4 font-sans leading-relaxed",children:s}),r.jsx("div",{className:"mt-auto pt-1",children:l})]})}const HS={telegram:ah,discord:pi,slack:Yb},ws={telegram:"Telegram",discord:"Discord",slack:"Slack"},tZ={telegram:"Bot token from @BotFather",discord:"Bot token from Developer Portal",slack:"Bot token (xoxb-...)"},nZ=["critical","lifecycle","all"];function aZ({type:t,open:a,onOpenChange:s}){if(!t)return null;const o={telegram:{title:"Set Up Telegram",icon:ah,intro:"Create a Telegram bot and connect it to Groove in under 2 minutes. No dependencies required.",sections:[{title:"Create Your Bot",steps:[{text:"Open Telegram on any device and search for",link:"https://t.me/BotFather",linkText:"@BotFather"},{text:"Send /newbot to start the setup"},{text:"Choose a display name — we suggest GroovePilot"},{text:'Choose a username (must end in "bot") — e.g. GroovePilot_bot'},{text:"BotFather will reply with your bot token — copy it"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Telegram card"},{text:"Paste your bot token and click Save"},{text:"The gateway will connect automatically"}]},{title:"Link a Chat",steps:[{text:"Open a chat with your new bot in Telegram"},{text:'Send any message (e.g. "hello") — Groove captures the chat ID automatically'},{text:"Click Test in the gateway card to verify"}]},{title:"Commands",note:"All commands use / prefix in Telegram:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},discord:{title:"Set Up Discord",icon:pi,intro:"Create a Discord bot and add it to your server. Requires discord.js (installed automatically with Groove).",sections:[{title:"Create the Application",steps:[{text:"Go to the",link:"https://discord.com/developers/applications",linkText:"Discord Developer Portal"},{text:"Click New Application and name it GroovePilot"},{text:"Go to the Bot tab in the left sidebar"},{text:"Click Reset Token and copy the bot token"}]},{title:"Set Permissions & Invite",steps:[{text:"Go to OAuth2 > URL Generator"},{text:"Under Scopes, check bot"},{text:"Under Bot Permissions, check:"}],scopes:["Send Messages","Read Message History","Embed Links","Use External Emojis"],after:[{text:"Copy the generated URL at the bottom and open it in your browser"},{text:"Select your server and click Authorize"}]},{title:"Enable Message Content Intent",steps:[{text:"Go back to the Bot tab in the Developer Portal"},{text:"Scroll to Privileged Gateway Intents"},{text:"Enable Message Content Intent — required for the bot to read commands"},{text:"Click Save Changes"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Discord card"},{text:"Paste your bot token and click Save"},{text:"Send a message in any channel where the bot is — Groove captures the channel automatically"}]},{title:"Commands",note:"All commands use / prefix in Discord:",commands:["/instruct <team> <msg>","/query <team> <question>","/plan <description>","/log <team>","/brief","/tokens","/status","/agents","/help"]}]},slack:{title:"Set Up Slack",icon:Yb,intro:"Create a Slack app with Socket Mode — no public URL needed. Requires @slack/bolt (installed automatically with Groove).",sections:[{title:"Create the App",steps:[{text:"Go to",link:"https://api.slack.com/apps",linkText:"api.slack.com/apps"},{text:"Click Create New App > From scratch"},{text:"Name it GroovePilot and select your workspace"}]},{title:"Enable Socket Mode",steps:[{text:"In the left sidebar, go to Settings > Socket Mode"},{text:"Toggle Enable Socket Mode to on"},{text:"It will ask you to create an App-Level Token"},{text:'Name it "groove", add the connections:write scope'},{text:"Click Generate — copy the xapp-... token (this is your App Token)"}],important:"Save this token now — you can't view it again after closing the dialog."},{title:"Set Bot Token Scopes",steps:[{text:"Go to Features > OAuth & Permissions"},{text:"Scroll to Bot Token Scopes and add all of these:"}],scopes:["chat:write","channels:read","channels:history","groups:read","groups:history","im:history","app_mentions:read"],after:[{text:"Scroll up and click Install to Workspace"},{text:"Click Allow to grant permissions"},{text:"Copy the Bot User OAuth Token (xoxb-...) — this is your Bot Token"}]},{title:"Enable Events",steps:[{text:"Go to Features > Event Subscriptions"},{text:"Toggle Enable Events to on"},{text:"Under Subscribe to bot events, add:"}],scopes:["message.channels","message.im","app_mention"],after:[{text:"Click Save Changes at the bottom"}]},{title:"Connect to Groove",steps:[{text:"In Groove Settings > Gateways, click Set Token on the Slack card"},{text:"Paste your Bot Token (xoxb-...) in the first field"},{text:"Paste your App Token (xapp-...) in the second field"},{text:"Click Save — Groove will auto-connect"}]},{title:"Link a Channel",steps:[{text:"Invite the bot to a channel: /invite @GroovePilot"},{text:"Select the channel from the dropdown in the gateway card"},{text:"Or @mention the bot — it will auto-capture the channel"},{text:"Click Test to verify"}],important:"For private channels, make sure you added the groups:read scope."},{title:"Commands",note:"In Slack, use plain text commands (no / prefix) or @mention the bot:",commands:["instruct <team> <msg>","query <team> <question>","plan <description>","log <team>","brief","tokens","status","agents","help","@GroovePilot status"]}]}}[t];if(!o)return null;const u=o.icon;return r.jsx(WS,{open:a,onOpenChange:s,children:r.jsx(BS,{title:o.title,width:480,children:r.jsxs("div",{className:"px-5 py-4 space-y-5",children:[r.jsxs("div",{className:"flex items-start gap-3 p-3 bg-accent/5 border border-accent/15 rounded-lg",children:[r.jsx("div",{className:"w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:r.jsx(u,{size:16,className:"text-accent"})}),r.jsx("p",{className:"text-xs text-text-2 font-sans leading-relaxed",children:o.intro})]}),o.sections.map((d,O)=>{var h;return r.jsxs("div",{children:[r.jsxs("h3",{className:"text-xs font-semibold text-text-0 font-sans mb-2.5 flex items-center gap-2",children:[r.jsx("span",{className:"w-5 h-5 rounded-full bg-accent/10 flex items-center justify-center text-2xs font-bold text-accent",children:O+1}),d.title]}),d.note&&r.jsx("p",{className:"text-2xs text-text-3 font-sans mb-2",children:d.note}),d.steps&&r.jsx("ol",{className:"space-y-2 mb-2",children:d.steps.map((p,x)=>r.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[r.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[x+1,"."]}),r.jsxs("span",{children:[p.text,p.link&&r.jsxs(r.Fragment,{children:[" ",r.jsxs("a",{href:p.link,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-0.5 font-medium",children:[p.linkText,r.jsx(bc,{size:9})]})]})]})]},x))}),d.scopes&&r.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 ml-6",children:d.scopes.map(p=>r.jsx("code",{className:"px-2 py-0.5 rounded bg-surface-4 text-2xs font-mono text-accent",children:p},p))}),d.after&&r.jsx("ol",{className:"space-y-2 mb-2",start:(((h=d.steps)==null?void 0:h.length)||0)+1,children:d.after.map((p,x)=>{var g;return r.jsxs("li",{className:"flex gap-2 text-2xs text-text-2 font-sans leading-relaxed",children:[r.jsxs("span",{className:"text-text-4 font-mono w-4 flex-shrink-0 pt-px",children:[(((g=d.steps)==null?void 0:g.length)||0)+x+1,"."]}),r.jsx("span",{children:p.text})]},x)})}),d.important&&r.jsx("div",{className:"ml-6 p-2 bg-warning/8 border border-warning/20 rounded-md text-2xs text-warning font-sans",children:d.important}),d.commands&&r.jsx("div",{className:"ml-6 p-2.5 bg-surface-0 border border-border-subtle rounded-md space-y-1",children:d.commands.map(p=>r.jsx("code",{className:"block text-2xs font-mono text-text-1",children:p},p))})]},O)}),r.jsxs("a",{href:"https://docs.groovedev.ai/guide/gateways",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium mt-2",children:[r.jsx(bc,{size:10}),"Full documentation at docs.groovedev.ai"]})]})})})}function sZ({gateway:t,onRefresh:a}){var le,oe;const[s,l]=v.useState(!1),[o,u]=v.useState(""),[d,O]=v.useState(""),[h,p]=v.useState(!1),[x,g]=v.useState(!1),[b,y]=v.useState(!1),[Q,w]=v.useState([]),[$,j]=v.useState(!1),z=D(H=>H.addToast);v.useEffect(()=>{t.connected&&!t.chatId&&t.type==="slack"&&J.get(`/gateways/${t.id}/channels`).then(H=>w(Array.isArray(H)?H:[])).catch(()=>{})},[t.connected,t.chatId,t.id,t.type]);const N=HS[t.type]||nh,_=t.type==="slack";async function G(){if(o.trim())try{await J.post(`/gateways/${t.id}/credentials`,{key:"bot_token",value:o.trim()}),_&&d.trim()&&await J.post(`/gateways/${t.id}/credentials`,{key:"app_token",value:d.trim()}),z("success","Token saved — connecting..."),u(""),O(""),l(!1);try{await J.post(`/gateways/${t.id}/connect`),z("success",`${ws[t.type]} connected!`)}catch(H){z("error","Token saved but connect failed",H.message)}a()}catch(H){z("error","Failed to save token",H.message)}}async function R(){g(!0);try{await J.post(`/gateways/${t.id}/test`),z("success","Test message sent!")}catch(H){z("error","Test failed",H.message)}g(!1)}async function X(){y(!0);try{t.connected?(await J.post(`/gateways/${t.id}/disconnect`),z("info",`${ws[t.type]} disconnected`)):(await J.post(`/gateways/${t.id}/connect`),z("success",`${ws[t.type]} connected!`)),a()}catch(H){z("error",t.connected?"Disconnect failed":"Connect failed",H.message)}y(!1)}async function T(H){try{await J.patch(`/gateways/${t.id}`,{enabled:H}),a()}catch(P){z("error","Update failed",P.message)}}async function V(H){try{await J.patch(`/gateways/${t.id}`,{notifications:{preset:H}}),a()}catch(P){z("error","Update failed",P.message)}}async function M(H){try{await J.patch(`/gateways/${t.id}`,{commandPermission:H}),a()}catch(P){z("error","Update failed",P.message)}}async function ae(){try{await J.delete(`/gateways/${t.id}`),z("info",`${ws[t.type]} gateway removed`),a()}catch(H){z("error","Delete failed",H.message)}}const F=((le=t.notifications)==null?void 0:le.preset)||"critical";return r.jsxs("div",{className:"flex flex-col rounded-lg border border-border-subtle bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(Ts,{status:t.connected?"running":"crashed",size:"sm"}),r.jsx(N,{size:13,className:"text-text-2"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:ws[t.type]}),r.jsx("div",{className:"flex-1"}),t.connected?r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(s1,{size:8})," Connected"]}):t.enabled?r.jsx(Xe,{variant:"warning",className:"text-2xs",children:"Disconnected"}):r.jsx(Xe,{variant:"default",className:"text-2xs",children:"Disabled"})]}),r.jsxs("div",{className:"flex-1 flex flex-col px-4 py-3 min-h-[140px]",children:[t.connected&&!s&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 h-8 px-2.5 bg-success/8 border border-success/20 rounded-md text-2xs font-sans text-success mb-3",children:[r.jsx(Dt,{size:10})," Gateway active",t.botUsername&&r.jsxs("span",{className:"text-text-4 ml-1",children:["@",t.botUsername]}),t.botTag&&r.jsx("span",{className:"text-text-4 ml-1",children:t.botTag})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:t.type==="slack"?"Channel":"Chat ID"}),t.chatId?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("code",{className:"flex-1 flex items-center h-7 px-2 bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2",children:t.type==="slack"&&Q.length>0?`#${((oe=Q.find(H=>H.id===t.chatId))==null?void 0:oe.name)||t.chatId}`:t.chatId}),r.jsx("button",{onClick:async()=>{try{await J.patch(`/gateways/${t.id}`,{chatId:null}),a()}catch(H){z("error","Failed",H.message)}},className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans",children:"Change"})]}):t.type==="slack"&&Q.length>0?r.jsxs("select",{onChange:async H=>{if(H.target.value)try{await J.patch(`/gateways/${t.id}`,{chatId:H.target.value}),a()}catch(P){z("error","Failed to set channel",P.message)}},className:"w-full h-7 px-2 text-2xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",defaultValue:"",children:[r.jsx("option",{value:"",disabled:!0,children:"Select a channel..."}),Q.map(H=>r.jsxs("option",{value:H.id,children:["#",H.name]},H.id))]}):r.jsxs("div",{className:"text-2xs text-warning font-sans",children:[t.type==="slack"?"No channels found — invite the bot to a channel first.":"Send a message to the bot to auto-capture, or enter manually:",r.jsx("input",{placeholder:t.type==="slack"?"C0123456789":"Chat ID",className:"mt-1 w-full h-7 px-2 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",onKeyDown:async H=>{if(H.key==="Enter"&&H.target.value.trim())try{await J.patch(`/gateways/${t.id}`,{chatId:H.target.value.trim()}),a()}catch(P){z("error","Failed to set channel",P.message)}}})]})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Notifications"}),r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:nZ.map(H=>r.jsx("button",{onClick:()=>V(H),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",F===H?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:H},H))})]}),r.jsxs("div",{className:"mb-3",children:[r.jsx("label",{className:"text-2xs font-semibold text-text-3 font-sans mb-1.5 block",children:"Commands"}),r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["full","read-only"].map(H=>r.jsx("button",{onClick:()=>M(H),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer capitalize",(t.commandPermission||"full")===H?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:H==="full"?"Full Access":"Read Only"},H))})]})]}),!t.connected&&!s&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-xs text-text-3 font-sans mb-2",children:t.enabled?t.hasCredentials?"Tokens saved — click Connect.":"Configure bot token to connect.":"Gateway is disabled."}),!t.hasCredentials&&r.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer mb-2",children:[r.jsx(gc,{size:11}),"How to set up",r.jsx(bc,{size:9})]})]}),r.jsx(aZ,{type:t.type,open:$,onOpenChange:j}),r.jsx("div",{className:"flex-1"}),s&&r.jsxs("div",{className:"space-y-2.5 pt-1",children:[r.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 text-2xs text-accent hover:text-accent/80 font-sans font-medium cursor-pointer",children:[r.jsx(gc,{size:11}),"Where do I get these?"]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"Bot Token"}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{value:o,onChange:H=>u(H.target.value),onKeyDown:H=>H.key==="Enter"&&!_&&G(),type:h?"text":"password",placeholder:tZ[t.type],className:"w-full h-9 px-3 pr-9 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:()=>p(!h),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:h?r.jsx(Kf,{size:12}):r.jsx(Dl,{size:12})})]})]}),_&&r.jsxs("div",{children:[r.jsx("label",{className:"text-2xs font-semibold text-text-2 font-sans mb-1.5 block",children:"App Token (Socket Mode)"}),r.jsx("input",{value:d,onChange:H=>O(H.target.value),onKeyDown:H=>H.key==="Enter"&&G(),type:h?"text":"password",placeholder:"xapp-...",className:"w-full h-9 px-3 text-xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(ve,{variant:"primary",size:"sm",onClick:G,disabled:!o.trim(),className:"flex-1 h-8 text-xs",children:"Save Token"}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{l(!1),u(""),O("")},className:"h-8 text-xs px-3",children:"Cancel"})]})]}),!s&&r.jsxs("div",{className:"flex gap-2 mt-2",children:[!t.connected&&r.jsxs(ve,{variant:"primary",size:"sm",onClick:()=>l(!0),className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(vc,{size:11}),t.enabled?"Set Token":"Configure"]}),t.connected&&r.jsxs(r.Fragment,{children:[r.jsxs(ve,{variant:"secondary",size:"sm",onClick:R,disabled:x,className:"flex-1 h-7 text-2xs gap-1.5",children:[r.jsx(lh,{size:11}),x?"Sending...":"Test"]}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>l(!0),className:"h-7 text-2xs px-2.5",children:r.jsx(vc,{size:11})})]}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:X,disabled:b,className:"h-7 text-2xs px-2.5",title:t.connected?"Disconnect":"Connect",children:t.connected?r.jsx(Gb,{size:11}):r.jsx(s1,{size:11})}),r.jsx(K_,{value:t.enabled,onChange:T}),r.jsx("button",{onClick:ae,className:"text-text-4 hover:text-danger cursor-pointer p-1",title:"Remove gateway",children:r.jsx(as,{size:11})})]})]})]})}function lZ({existingTypes:t,onAdd:a}){const[s,l]=v.useState(!1),o=["telegram","discord","slack"].filter(u=>!t.includes(u));return o.length===0?null:s?r.jsxs("div",{className:"flex flex-col rounded-lg border border-accent/30 bg-surface-1 overflow-hidden min-w-[220px]",children:[r.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-border-subtle",children:[r.jsx(nh,{size:13,className:"text-accent"}),r.jsx("span",{className:"text-[13px] font-semibold text-text-0 font-sans",children:"Add Gateway"}),r.jsx("div",{className:"flex-1"}),r.jsx("button",{onClick:()=>l(!1),className:"text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:12})})]}),r.jsx("div",{className:"p-3 space-y-2",children:o.map(u=>{const d=HS[u];return r.jsxs("button",{onClick:()=>{a(u),l(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-md bg-surface-0 hover:bg-accent/8 border border-border-subtle hover:border-accent/20 cursor-pointer transition-all group",children:[r.jsx(d,{size:14,className:"text-text-3 group-hover:text-accent"}),r.jsx("span",{className:"text-xs font-medium text-text-1 group-hover:text-accent font-sans",children:ws[u]})]},u)})})]}):r.jsxs("button",{onClick:()=>l(!0),className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border-subtle bg-surface-1/50 hover:bg-surface-1 hover:border-accent/30 min-h-[140px] min-w-[220px] cursor-pointer transition-all group",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-accent/8 group-hover:bg-accent/15 flex items-center justify-center mb-2 transition-colors",children:r.jsx(Ja,{size:14,className:"text-accent"})}),r.jsx("span",{className:"text-2xs font-semibold text-text-3 group-hover:text-text-1 font-sans transition-colors",children:"Add Gateway"})]})}function rZ(){const[t,a]=v.useState([]),[s,l]=v.useState(null),[o,u]=v.useState(null),[d,O]=v.useState([]),[h,p]=v.useState(!0),[x,g]=v.useState(!1),b=D(X=>X.addToast),y=D(X=>X.marketplaceUser),Q=D(X=>X.marketplaceAuthenticated),w=D(X=>X.marketplaceLogin),$=D(X=>X.marketplaceLogout);function j(){J.get("/providers").then(X=>a(Array.isArray(X)?X:[])).catch(()=>{})}function z(){J.get("/gateways").then(X=>O(Array.isArray(X)?X:[])).catch(()=>{})}v.useEffect(()=>{Promise.all([J.get("/providers"),J.get("/config"),J.get("/status"),J.get("/gateways")]).then(([X,T,V,M])=>{a(Array.isArray(X)?X:[]),l(T),u(V),O(Array.isArray(M)?M:[]),p(!1)}).catch(()=>p(!1))},[]);async function N(X){try{await J.post("/gateways",{type:X}),b("success",`${ws[X]} gateway added`),z()}catch(T){b("error","Failed to add gateway",T.message)}}async function _(X,T){try{const V=await J.patch("/config",{[X]:T});l(V)}catch(V){b("error","Update failed",V.message)}}if(h)return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsx("div",{className:"h-12 bg-surface-1 border-b border-border"}),r.jsxs("div",{className:"flex-1 p-4 space-y-4",children:[r.jsx("div",{className:"grid grid-cols-4 gap-3",children:[...Array(4)].map((X,T)=>r.jsx(rn,{className:"h-40 rounded-lg"},T))}),r.jsx("div",{className:"grid grid-cols-3 gap-3",children:[...Array(6)].map((X,T)=>r.jsx(rn,{className:"h-28 rounded-lg"},T))})]})]});const G=t.filter(X=>X.authType==="local"||X.authType==="subscription"?X.installed:X.hasKey).length,R=(s==null?void 0:s.rotationThreshold)||0;return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border-b border-border flex-shrink-0",children:[r.jsx("h2",{className:"text-sm font-semibold text-text-0 font-sans",children:"Settings"}),r.jsx("div",{className:"flex-1"}),r.jsxs("div",{className:"flex items-center gap-4 text-2xs text-text-3 font-sans",children:[(o==null?void 0:o.version)&&r.jsxs("span",{children:["v",o.version]}),(o==null?void 0:o.port)&&r.jsxs("span",{children:[":",o.port]}),(o==null?void 0:o.uptime)>0&&r.jsxs("span",{children:["Up ",Dc(o.uptime)]})]}),r.jsx("div",{className:"w-px h-4 bg-border-subtle"}),Q?r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(J_,{user:y}),r.jsx("span",{className:"text-xs font-medium text-text-0 font-sans",children:(y==null?void 0:y.displayName)||"User"}),r.jsxs("button",{onClick:$,className:"text-2xs text-text-4 hover:text-text-1 cursor-pointer font-sans flex items-center gap-1",children:[r.jsx(Mb,{size:10})," Sign out"]})]}):r.jsxs(ve,{variant:"ghost",size:"sm",onClick:w,className:"h-7 text-2xs gap-1.5 text-text-3",children:[r.jsx(eh,{size:11})," Sign in"]}),r.jsx(Ts,{status:"running",size:"sm"})]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"p-4 space-y-4",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Providers"}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[G,"/",t.length," connected"]})]}),r.jsx("div",{className:"grid grid-cols-4 gap-3",children:t.map(X=>r.jsx(eZ,{provider:X,onKeyChange:j},X.id))})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Gateways"}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsxs("span",{className:"text-2xs text-text-4 font-sans",children:[d.filter(X=>X.connected).length,"/",d.length," connected"]})]}),r.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[d.map(X=>r.jsx(sZ,{gateway:X,onRefresh:z},X.id)),r.jsx(lZ,{existingTypes:d.map(X=>X.type),onAdd:N})]})]}),s&&r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2.5 px-0.5",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Configuration"}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"Auto-saves"})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[r.jsx(jl,{icon:Al,label:"Default Provider",description:"Provider used when spawning new agents.",children:r.jsx("select",{value:s.defaultProvider||"claude-code",onChange:X=>_("defaultProvider",X.target.value),className:"w-full h-8 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer",children:t.filter(X=>X.installed||X.hasKey).map(X=>r.jsx("option",{value:X.id,children:X.name},X.id))})}),r.jsx(jl,{icon:ai,label:"Working Directory",description:"Default root directory for new agents.",children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("code",{className:"flex-1 h-8 px-2 flex items-center bg-surface-0 border border-border-subtle rounded-md text-2xs font-mono text-text-2 truncate min-w-0",children:s.defaultWorkingDir||"Project root"}),r.jsx(ve,{variant:"secondary",size:"sm",onClick:()=>g(!0),className:"h-8 px-2 flex-shrink-0",children:r.jsx(Zb,{size:12})})]})}),r.jsx(jl,{icon:Eb,label:"Rotation Threshold",description:"Context usage that triggers auto-rotation.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:["auto","50%","65%","75%","85%"].map(X=>{const T=X==="auto"?0:parseInt(X,10)/100,V=R===T;return r.jsx("button",{onClick:()=>_("rotationThreshold",T),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",V?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:X==="auto"?"Auto":X},X)})})}),r.jsx(jl,{icon:Hb,label:"QC Threshold",description:"Running agents count that triggers auto-QC.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[2,3,4,6,8].map(X=>{const T=(s.qcThreshold||2)===X;return r.jsx("button",{onClick:()=>_("qcThreshold",X),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:X},X)})})}),r.jsx(jl,{icon:bi,label:"Max Agents",description:"Concurrent agent limit. 0 = unlimited.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[0,4,8,12,20].map(X=>{const T=(s.maxAgents||0)===X;return r.jsx("button",{onClick:()=>_("maxAgents",X),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:X===0?"∞":X},X)})})}),r.jsx(jl,{icon:si,label:"Journalist Interval",description:"Seconds between synthesis cycles.",children:r.jsx("div",{className:"flex bg-surface-0 rounded-md p-0.5 border border-border-subtle",children:[60,120,300,600].map(X=>{const T=(s.journalistInterval||120)===X,V=X<60?`${X}s`:`${X/60}m`;return r.jsx("button",{onClick:()=>_("journalistInterval",X),className:re("flex-1 px-2 py-1.5 text-2xs font-semibold font-sans rounded transition-all cursor-pointer",T?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:V},X)})})})]})]})]})}),r.jsx(DS,{open:x,onOpenChange:g,currentPath:(s==null?void 0:s.defaultWorkingDir)||"/",onSelect:X=>_("defaultWorkingDir",X)})]})}const zf=v.forwardRef(({className:t,label:a,error:s,mono:l,...o},u)=>r.jsxs("div",{className:"flex flex-col gap-1",children:[a&&r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),r.jsx("input",{ref:u,className:re("h-8 w-full rounded-md px-3 text-sm","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",l?"font-mono":"font-sans",s&&"border-danger focus:ring-danger",t),...o}),s&&r.jsx("span",{className:"text-2xs text-danger font-sans",children:s})]}));zf.displayName="Input";const iZ=v.forwardRef(({className:t,label:a,error:s,mono:l,...o},u)=>r.jsxs("div",{className:"flex flex-col gap-1",children:[a&&r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:a}),r.jsx("textarea",{ref:u,className:re("w-full rounded-md px-3 py-2 text-sm resize-none","bg-surface-1 border border-border text-text-0","placeholder:text-text-4","focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent","disabled:opacity-40 disabled:cursor-not-allowed","transition-colors duration-100",l?"font-mono":"font-sans",s&&"border-danger focus:ring-danger",t),...o}),s&&r.jsx("span",{className:"text-2xs text-danger font-sans",children:s})]}));iZ.displayName="Textarea";function Cc(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`:"—"}function oZ(t){return t?t<1024*1024?`${(t/1024).toFixed(0)} KB/s`:`${(t/(1024*1024)).toFixed(1)} MB/s`:""}function cZ({hardware:t}){var a;return t?r.jsxs("div",{className:"flex items-center gap-4 px-4 py-2.5 bg-surface-1 border border-border-subtle rounded-lg text-xs font-sans text-text-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(MT,{size:14,className:"text-text-3"}),r.jsxs("span",{children:[t.totalRamGb," GB RAM"]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Al,{size:14,className:"text-text-3"}),r.jsxs("span",{children:[t.cores," cores"]})]}),t.gpu&&r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(Jf,{size:14,className:"text-text-3"}),r.jsxs("span",{children:[t.gpu.name,t.gpu.vram?` (${t.gpu.vram} GB)`:""]})]}),((a=t.recommended)==null?void 0:a.code)&&r.jsxs("div",{className:"ml-auto text-accent",children:["Recommended: ",t.recommended.code]})]}):null}function uZ({download:t}){const a=Math.round((t.percent||0)*100);return r.jsxs("div",{className:"space-y-1",children:[r.jsxs("div",{className:"flex items-center justify-between text-2xs font-sans text-text-3",children:[r.jsx("span",{children:t.filename}),r.jsxs("span",{children:[a,"% ",oZ(t.speed)]})]}),r.jsx("div",{className:"h-1.5 bg-surface-3 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-accent rounded-full transition-all",style:{width:`${a}%`}})}),r.jsxs("div",{className:"text-2xs text-text-4",children:[Cc(t.downloaded)," / ",Cc(t.totalBytes)]})]})}function dZ({model:t,onDelete:a}){const[s,l]=v.useState(!1),o={light:"text-green-400",medium:"text-blue-400",heavy:"text-orange-400"};return r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg",children:[r.jsx(Ff,{size:18,className:"text-accent flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.id}),t.quantization&&r.jsx(Xe,{variant:"subtle",className:"text-2xs",children:t.quantization}),t.parameters&&r.jsx(Xe,{variant:"subtle",className:"text-2xs",children:t.parameters}),r.jsx("span",{className:re("text-2xs font-medium capitalize",o[t.tier]||"text-text-3"),children:t.tier})]}),r.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:[Cc(t.sizeBytes)," · ctx ",(t.contextWindow||0).toLocaleString()," · ",t.category,t.repoId&&r.jsxs("span",{className:"text-text-4",children:[" · ",t.repoId]})]})]}),r.jsx("button",{onClick:async()=>{l(!0),await a(t.id),l(!1)},disabled:s,className:"p-1.5 rounded-md text-text-4 hover:text-red-400 hover:bg-red-400/10 transition-colors",children:s?r.jsx(Ka,{size:14,className:"animate-spin"}):r.jsx(as,{size:14})})]})}function OZ({result:t,onExpand:a,expanded:s}){var l;return r.jsxs("button",{onClick:()=>a(s?null:t.id),className:"w-full text-left px-4 py-3 bg-surface-1 border border-border-subtle rounded-lg hover:border-accent/30 transition-colors cursor-pointer",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate flex-1",children:t.name}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:t.author}),s?r.jsx(ca,{size:14,className:"text-text-3"}):r.jsx(Ll,{size:14,className:"text-text-3"})]}),r.jsxs("div",{className:"text-2xs text-text-3 font-sans mt-0.5 flex gap-3",children:[r.jsxs("span",{children:[(l=t.downloads)==null?void 0:l.toLocaleString()," downloads"]}),r.jsxs("span",{children:[t.likes," likes"]})]})]})}function fZ({repoId:t,onDownload:a,systemRamGb:s}){const[l,o]=v.useState(null),[u,d]=v.useState(!0),[O,h]=v.useState(null),p=Bl();v.useEffect(()=>{d(!0),J.get(`/models/${t}/files`).then(g=>o(g.files||[])).catch(()=>p.error("Failed to load model files")).finally(()=>d(!1))},[t]);async function x(g){h(g.filename);try{await J.post("/models/download",{repoId:t,filename:g.filename}),p.success(`Downloading ${g.filename}`),a==null||a(g.filename)}catch(b){p.error(b.message)}h(null)}return u?r.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"Loading quantization variants..."}):l!=null&&l.length?r.jsx("div",{className:"pl-6 pr-4 pb-2 space-y-1.5",children:l.map(g=>{const b=!g.estimatedRamGb||!s||g.estimatedRamGb<=s,y=g.estimatedRamGb&&s&&g.estimatedRamGb>s*.8&&b;return r.jsxs("div",{className:re("flex items-center gap-2 py-1.5 px-3 rounded-md text-xs font-sans",b?"bg-surface-2":"bg-red-500/5 border border-red-500/15"),children:[r.jsx("span",{className:"font-mono text-text-1 truncate flex-1",children:g.filename}),g.quantization&&r.jsx(Xe,{variant:"subtle",className:"text-2xs",children:g.quantization}),r.jsx("span",{className:"text-text-2 text-2xs w-16 text-right",children:Cc(g.size)}),g.estimatedRamGb&&r.jsxs("span",{className:re("text-2xs w-20 text-right font-medium",b?y?"text-yellow-400":"text-green-400":"text-red-400"),children:["~",g.estimatedRamGb," GB RAM"]}),!b&&r.jsx("span",{className:"text-2xs text-red-400 font-medium",children:"too large"}),r.jsx("button",{onClick:()=>x(g),disabled:O===g.filename||!b,className:re("p-1 rounded transition-colors",b?"text-accent hover:bg-accent/10":"text-text-4 cursor-not-allowed","disabled:opacity-40"),children:O===g.filename?r.jsx(Ka,{size:13,className:"animate-spin"}):r.jsx(mi,{size:13})})]},g.filename)})}):r.jsx("div",{className:"py-3 px-4 text-2xs text-text-4 font-sans",children:"No GGUF files found in this repo."})}function hZ({model:t,systemRamGb:a,onPull:s,pulling:l,isInstalled:o}){const u={light:"text-green-400",medium:"text-blue-400",heavy:"text-orange-400"},d={code:"{}",general:"AI"},O=a?Math.round((1-t.ramGb/a)*100):null;return r.jsxs("div",{className:re("flex items-center gap-3 px-4 py-3 border rounded-lg transition-colors",o?"bg-success/5 border-success/20":"bg-surface-1 border-border-subtle hover:border-accent/20"),children:[r.jsx("div",{className:"w-9 h-9 rounded-lg bg-surface-3 flex items-center justify-center text-xs font-mono text-text-2 flex-shrink-0",children:d[t.category]||"AI"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm font-mono font-bold text-text-0 truncate",children:t.name}),r.jsx("span",{className:re("text-2xs font-semibold capitalize",u[t.tier]),children:t.tier}),o&&r.jsxs(Xe,{variant:"success",className:"text-2xs gap-1",children:[r.jsx(Dt,{size:8})," Installed"]})]}),r.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:t.description}),r.jsxs("div",{className:"flex items-center gap-3 mt-1 text-2xs font-sans",children:[r.jsxs("span",{className:"text-text-2",children:[t.sizeGb," GB download"]}),r.jsxs("span",{className:"text-green-400 font-medium",children:[t.ramGb," GB RAM"]}),O!==null&&r.jsxs("span",{className:"text-text-4",children:[O,"% headroom"]})]})]}),o?r.jsx("span",{className:"text-xs text-success font-sans font-medium px-3 py-1.5",children:"Ready"}):r.jsxs("button",{onClick:()=>s(t.id),disabled:l===t.id,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-sans font-medium bg-accent/10 text-accent hover:bg-accent/20 transition-colors cursor-pointer disabled:opacity-40",children:[l===t.id?r.jsx(Ka,{size:12,className:"animate-spin"}):r.jsx(mi,{size:12}),"Pull"]})]})}function mZ(){const[t,a]=v.useState("recommended"),[s,l]=v.useState(""),[o,u]=v.useState([]),[d,O]=v.useState(!1),[h,p]=v.useState([]),[x,g]=v.useState([]),[b,y]=v.useState([]),[Q,w]=v.useState(null),[$,j]=v.useState(null),[z,N]=v.useState(null),[_,G]=v.useState([]),R=Bl(),X=v.useCallback(()=>{J.get("/models/installed").then(F=>{p(F.models||[])}).catch(()=>{})},[]),T=v.useCallback(()=>{J.get("/providers/ollama/models").then(F=>{G((F.installed||[]).map(le=>le.id))}).catch(()=>{})},[]);v.useEffect(()=>{J.get("/providers/ollama/hardware").then(w).catch(()=>{}),J.get("/models/recommended").then(F=>{g(F.models||[]),!Q&&F.hardware&&w(F.hardware)}).catch(()=>{}),X(),T()},[X,T]);async function V(F){N(F);try{await J.post("/providers/ollama/pull",{model:F}),R.success(`${F} ready to use`),X(),T(),G(le=>[...le,F])}catch(le){R.error(`Pull failed: ${le.message}`)}N(null)}v.useEffect(()=>{const F=D.subscribe((oe,H)=>{}),le=setInterval(()=>{J.get("/models/downloads").then(y).catch(()=>{})},2e3);return()=>{F(),clearInterval(le)}},[]),v.useEffect(()=>{function F(oe){try{const H=JSON.parse(oe.data);H.type==="model:download:progress"&&y(P=>{const W=P.findIndex(E=>E.filename===H.data.filename);if(W>=0){const E=[...P];return E[W]=H.data,E}return[...P,H.data]}),H.type==="model:download:complete"&&(y(P=>P.filter(W=>W.filename!==H.data.filename)),X(),R.success(`${H.data.filename} downloaded`)),H.type==="model:download:error"&&(y(P=>P.filter(W=>W.filename!==H.data.filename)),R.error(`Download failed: ${H.data.error}`))}catch{}}const le=D.getState()._ws;return le&&le.addEventListener("message",F),()=>{le&&le.removeEventListener("message",F)}},[X,R]);async function M(){if(s.trim()){O(!0),a("search");try{const F=await J.get(`/models/search?q=${encodeURIComponent(s.trim())}`);u(F)}catch(F){R.error(F.message)}O(!1)}}async function ae(F){try{await J.delete(`/models/${F}`),p(le=>le.filter(oe=>oe.id!==F)),R.success("Model deleted")}catch(le){R.error(le.message)}}return r.jsxs("div",{className:"h-full flex flex-col bg-surface-0",children:[r.jsxs("div",{className:"flex-shrink-0 px-5 pt-4 pb-3 border-b border-border space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("h1",{className:"text-base font-bold font-sans text-text-0",children:"Local Models"}),r.jsxs(Xe,{variant:"subtle",className:"text-2xs",children:[h.length," installed"]})]}),r.jsx(cZ,{hardware:Q}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(da,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-4"}),r.jsx("input",{value:s,onChange:F=>l(F.target.value),onKeyDown:F=>F.key==="Enter"&&M(),placeholder:"Search HuggingFace for GGUF models...",className:"w-full h-8 pl-9 pr-3 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"})]}),r.jsx(ve,{onClick:M,disabled:d,size:"sm",variant:"accent",children:d?r.jsx(Ka,{size:14,className:"animate-spin"}):"Search"})]}),r.jsx("div",{className:"flex gap-1",children:[{id:"recommended",label:`Recommended (${x.length})`},{id:"installed",label:`Installed (${h.length})`},{id:"search",label:`Search (${o.length})`}].map(F=>r.jsx("button",{onClick:()=>a(F.id),className:re("px-3 py-1 rounded-md text-xs font-sans font-medium transition-colors cursor-pointer",t===F.id?"bg-accent/12 text-accent":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:F.label},F.id))})]}),b.length>0&&r.jsxs("div",{className:"px-5 py-3 border-b border-border space-y-2",children:[r.jsx("div",{className:"text-xs font-sans font-semibold text-text-2",children:"Downloading"}),b.map(F=>r.jsx(uZ,{download:F},F.filename))]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"px-5 py-4 space-y-2",children:[t==="recommended"&&r.jsx(r.Fragment,{children:x.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Al,{size:40,className:"mx-auto text-text-4 mb-3"}),r.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Detecting hardware..."}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Make sure Ollama is installed so we can check your system."})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"text-xs text-text-3 font-sans mb-2",children:["Top models for your system (",(Q==null?void 0:Q.totalRamGb)||"?"," GB RAM). Click Pull to download via Ollama."]}),x.map(F=>{const le=F.id.split(":")[0],oe=_.some(H=>H===F.id||H.startsWith(le+":")||H===le);return r.jsx(hZ,{model:F,systemRamGb:Q==null?void 0:Q.totalRamGb,onPull:V,pulling:z,isInstalled:oe},F.id)})]})}),t==="installed"&&r.jsx(r.Fragment,{children:h.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ff,{size:40,className:"mx-auto text-text-4 mb-3"}),r.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"No local models yet"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Search HuggingFace to download GGUF models, or pull models via Ollama."})]}):h.map(F=>r.jsx(dZ,{model:F,onDelete:ae},F.id))}),t==="search"&&r.jsx(r.Fragment,{children:d?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Ka,{size:24,className:"mx-auto text-accent animate-spin mb-3"}),r.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Searching HuggingFace..."})]}):o.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(da,{size:40,className:"mx-auto text-text-4 mb-3"}),r.jsx("p",{className:"text-sm text-text-2 font-sans font-medium",children:"Search for GGUF models"}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:'Try "qwen coder", "deepseek", "codestral", "llama"'})]}):o.map(F=>r.jsxs("div",{className:"space-y-1",children:[r.jsx(OZ,{result:F,expanded:$===F.id,onExpand:j}),$===F.id&&r.jsx(fZ,{repoId:F.id,onDownload:()=>X(),systemRamGb:Q==null?void 0:Q.totalRamGb})]},F.id))})]})})]})}const Q0=["Reading through the codebase...","Thinking through your request...","Planning the approach...","Running tool calls...","Working through the problem...","Reasoning step by step...","Reviewing context...","Considering options...","Analyzing the code...","Making progress..."];function pZ({agent:t,className:a}){const[s,l]=v.useState(0),[o,u]=v.useState(!0);return v.useEffect(()=>{const d=setInterval(()=>{u(!1),setTimeout(()=>{l(O=>(O+1)%Q0.length),u(!0)},250)},2800);return()=>clearInterval(d)},[]),r.jsxs("div",{className:`${a||""}`,children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(t==null?void 0:t.name)||"Agent"}),r.jsx("span",{className:"text-2xs text-accent font-mono",children:"thinking"})]}),r.jsxs("div",{className:"border-l border-accent/40 pl-3.5 py-1 flex items-center gap-2.5",children:[r.jsx("div",{className:"relative w-3.5 h-3.5 flex-shrink-0",children:r.jsx("span",{className:"absolute inset-0 rounded-full border border-transparent border-t-accent animate-spin",style:{animationDuration:"0.9s"}})}),r.jsx("span",{className:"text-[12px] font-sans text-text-3 transition-opacity duration-[250ms]",style:{opacity:o?1:0},children:Q0[s]})]})]})}const Rf=[];function IS(t){const a=(t||"").toLowerCase();return a.includes("reading")||a.includes("read ")?{icon:Dl,color:"text-info",label:"Reading"}:a.includes("editing")||a.includes("wrote")||a.includes("writing")||a.includes("edit ")?{icon:_b,color:"text-warning",label:"Editing"}:a.includes("searching")||a.includes("search")||a.includes("grep")||a.includes("glob")?{icon:da,color:"text-purple",label:"Searching"}:a.includes("running")||a.includes("bash")||a.includes("command")||a.includes("exec")?{icon:xi,color:"text-orange",label:"Running"}:a.includes("test")||a.includes("pass")?{icon:mf,color:"text-success",label:"Testing"}:a.includes("error")||a.includes("fail")||a.includes("crash")?{icon:ua,color:"text-danger",label:"Error"}:a.includes("rotat")?{icon:Wl,color:"text-accent",label:"Rotating"}:a.includes("spawn")||a.includes("start")?{icon:Rn,color:"text-success",label:"Spawned"}:a.includes("tool")||a.includes("function")?{icon:VN,color:"text-text-2",label:"Tool"}:a.includes("complet")||a.includes("done")||a.includes("finish")?{icon:mf,color:"text-success",label:"Done"}:{icon:ns,color:"text-text-3",label:"Activity"}}function kl({text:t}){return t?t.split(/(\*\*[^*]+\*\*|`[^`]+`)/g).map((a,s)=>a.startsWith("**")&&a.endsWith("**")?r.jsx("strong",{className:"font-semibold text-text-0",children:a.slice(2,-2)},s):a.startsWith("`")&&a.endsWith("`")?r.jsx("code",{className:"px-1 py-px rounded bg-accent/8 text-[11px] font-mono text-accent",children:a.slice(1,-1)},s):r.jsx("span",{children:a},s)):null}function xZ({text:t}){if(!t)return null;const a=[],s=t.split(`
|
|
633
633
|
`);let l=0;for(;l<s.length;){const o=s[l];if(o.trimStart().startsWith("```")){const d=[],O=o.trim().slice(3);for(l++;l<s.length&&!s[l].trimStart().startsWith("```");)d.push(s[l]),l++;l++,a.push({type:"code",content:d.join(`
|
|
634
|
-
`),lang:O});continue}if(/^#{1,3}\s/.test(o)||/^\*\*[^*]+:\*\*\s*$/.test(o.trim())){const d=o.replace(/^#+\s*/,"").replace(/^\*\*/,"").replace(/:\*\*\s*$/,":").trim();a.push({type:"heading",content:d}),l++;continue}if(/^\s*[-*]\s/.test(o)){const d=[];for(;l<s.length&&/^\s*[-*]\s/.test(s[l]);)d.push(s[l].replace(/^\s*[-*]\s+/,"").trim()),l++;a.push({type:"list",items:d});continue}if(/^\s*\d+[\.)]\s/.test(o)){const d=[];for(;l<s.length&&/^\s*\d+[\.)]\s/.test(s[l]);)d.push(s[l].replace(/^\s*\d+[\.)]\s+/,"").trim()),l++;a.push({type:"numbered",items:d});continue}if(!o.trim()){l++;continue}if(/^(Note|Warning|Important|IMPORTANT|TODO):/i.test(o.trim())){a.push({type:"note",content:o.trim()}),l++;continue}const u=[];for(;l<s.length&&s[l].trim()&&!/^#{1,3}\s/.test(s[l])&&!/^\s*[-*]\s/.test(s[l])&&!/^\s*\d+[\.)]\s/.test(s[l])&&!s[l].trimStart().startsWith("```");)u.push(s[l].trim()),l++;u.length>0&&a.push({type:"para",content:u.join(" ")})}return r.jsx("div",{className:"space-y-2",children:a.map((o,u)=>{switch(o.type){case"heading":return r.jsxs("div",{className:"flex items-center gap-1.5 pt-1.5 first:pt-0",children:[r.jsx("div",{className:"w-1 h-3.5 rounded-full bg-accent/40 flex-shrink-0"}),r.jsx("span",{className:"text-[12px] font-semibold text-text-0 font-sans",children:r.jsx(kl,{text:o.content})})]},u);case"list":return r.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((d,O)=>r.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[r.jsx("span",{className:"text-accent/50 mt-0.5 flex-shrink-0",children:"-"}),r.jsx("span",{className:"min-w-0",children:r.jsx(kl,{text:d})})]},O))},u);case"numbered":return r.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((d,O)=>r.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[r.jsxs("span",{className:"text-text-4 font-mono w-4 text-right flex-shrink-0",children:[O+1,"."]}),r.jsx("span",{className:"min-w-0",children:r.jsx(kl,{text:d})})]},O))},u);case"code":return r.jsx("pre",{className:"p-2.5 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06] leading-relaxed",children:o.content},u);case"note":return r.jsxs("div",{className:"flex items-start gap-1.5 px-2.5 py-1.5 rounded-md bg-warning/6 border border-warning/12",children:[r.jsx(ua,{size:10,className:"text-warning mt-0.5 flex-shrink-0"}),r.jsx("span",{className:"text-[11px] text-warning/80 font-sans",children:r.jsx(kl,{text:o.content})})]},u);case"para":default:return r.jsx("p",{className:"text-[12px] text-text-0 font-sans leading-relaxed",children:r.jsx(kl,{text:o.content})},u)}})})}function gZ({text:t}){if(!t)return null;const a=t.split(/(```[\s\S]*?```)/g);return r.jsx("span",{children:a.map((s,l)=>{if(s.startsWith("```")&&s.endsWith("```")){const o=s.slice(3,-3).replace(/^\w+\n/,"");return r.jsx("pre",{className:"my-1.5 p-2 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06]",children:o},l)}return r.jsx("span",{children:r.jsx(kl,{text:s})},l)})})}function bZ({msg:t}){const a=t.isQuery;return r.jsx("div",{className:"flex justify-end pl-8",children:r.jsxs("div",{className:"max-w-[90%]",children:[a&&r.jsxs("div",{className:"flex items-center justify-end gap-1 mb-1",children:[r.jsx(gc,{size:9,className:"text-info"}),r.jsx("span",{className:"text-2xs text-info font-sans font-medium",children:"Query"})]}),r.jsx("div",{className:re("px-3.5 py-2.5 rounded-lg border","bg-info/10 border-info/25"),children:r.jsx("div",{className:"text-[12px] font-sans whitespace-pre-wrap break-words leading-relaxed text-text-0",children:r.jsx(gZ,{text:t.text})})}),r.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 text-right",children:vt(t.timestamp)})]})})}function vZ({msg:t,agent:a}){var u,d;const[s,l]=v.useState(((u=t.text)==null?void 0:u.length)>600),o=((d=t.text)==null?void 0:d.length)>600;return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(a==null?void 0:a.name)||"Agent"}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:a==null?void 0:a.role}),r.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:vt(t.timestamp)})]}),r.jsx("div",{className:"border-l border-accent pl-3.5 py-1",children:r.jsx(xZ,{text:s?t.text.slice(0,600)+"...":t.text})}),s&&r.jsxs("button",{onClick:()=>l(!1),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[r.jsx(ca,{size:11}),"Show full response"]}),o&&!s&&r.jsxs("button",{onClick:()=>l(!0),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[r.jsx(ca,{size:11,className:"rotate-180"}),"Collapse"]})]})}function yZ({msg:t}){return r.jsxs("div",{className:"flex items-center gap-3 py-2",children:[r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsx("span",{className:"text-[10px] text-text-4 font-sans flex-shrink-0 uppercase tracking-wide",children:t.text}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]})}function SZ({entries:t,isLive:a}){var d;const[s,l]=v.useState(0);if(v.useEffect(()=>{if(!a||t.length<=1)return;const O=setInterval(()=>l(h=>(h+1)%t.length),1500);return()=>clearInterval(O)},[t.length,a]),!a){const O=t[t.length-1],p=IS(O.text).icon;return r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 text-[10px] text-text-4 font-mono",children:[r.jsx(p,{size:10,className:"opacity-50"}),r.jsxs("span",{children:[t.length," tool call",t.length!==1?"s":""]})]})}const o=t[Math.min(s,t.length-1)],u=((d=o.text)==null?void 0:d.length)>60?o.text.slice(0,60)+"...":o.text;return r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 max-w-[280px] rounded-md bg-surface-3/50 border border-border-subtle/30",children:[r.jsx(Ka,{size:11,className:"text-accent animate-spin flex-shrink-0"}),r.jsx("span",{className:"text-[11px] text-text-2 font-mono truncate transition-opacity duration-300",children:u}),t.length>1&&r.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:t.length})]})}function QZ({agent:t}){const a=D(h=>h.activityLog[t.id])||Rf,s=a[a.length-1],l=s?IS(s.text):null,o=(l==null?void 0:l.icon)||ns,u=s&&Date.now()-s.timestamp<1e4,d=u&&s.text?s.text.length>60?s.text.slice(0,60)+"...":s.text:null,O=Math.round((t.contextUsage||0)*100);return r.jsxs("div",{className:"flex items-center gap-3 px-4 h-8 border-b border-border-subtle bg-surface-1/80 flex-shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[r.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[r.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/15 animate-ping",style:{animationDuration:"2s"}}),r.jsx("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),u?r.jsxs(r.Fragment,{children:[r.jsx(o,{size:10,className:re(l.color,"flex-shrink-0")}),r.jsx("span",{className:"text-[11px] text-text-2 font-sans truncate",children:d})]}):r.jsx("span",{className:"text-[11px] text-text-3 font-sans",children:"Working..."})]}),r.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[r.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:jZ(t.tokensUsed)}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("div",{className:"w-14 h-1 rounded-full bg-surface-4 overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${O}%`,background:O>=75?"var(--color-danger)":O>=50?"var(--color-warning)":"var(--color-accent)"}})}),r.jsxs("span",{className:"text-[10px] text-text-4 font-mono w-7 text-right",children:[O,"%"]})]})]})]})}function jZ(t){return t?t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":String(t):"0"}function wZ({agent:t}){const[a,s]=v.useState([]),l=[{text:`Initializing ${t.name}`,delay:0},{text:`Role: ${t.role}`,delay:400},{text:`Provider: ${t.provider||"claude-code"}`,delay:700},{text:"Loading workspace context",delay:1e3},{text:"Scanning project structure",delay:1400},{text:"Session active",delay:1900}];return v.useEffect(()=>{const o=l.map((u,d)=>setTimeout(()=>s(O=>[...O,d]),u.delay));return()=>o.forEach(clearTimeout)},[]),r.jsxs("div",{className:"flex flex-col px-4 pt-6",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[r.jsxs("div",{className:"relative w-9 h-9",children:[r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),r.jsx("span",{className:"absolute inset-[5px] rounded-full bg-accent/8"})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-bold text-text-0 font-sans",children:t.name}),r.jsx("p",{className:"text-2xs text-accent font-mono",children:"starting up"})]})]}),r.jsx("div",{className:"space-y-2 pl-3 border-l border-accent/15",children:l.map((o,u)=>{const d=a.includes(u),O=u===l.length-1;return r.jsxs("div",{className:re("flex items-center gap-2.5 transition-all duration-300",d?"opacity-100 translate-x-0":"opacity-0 -translate-x-2"),children:[r.jsx("span",{className:re("w-1 h-1 rounded-full flex-shrink-0",O&&d?"bg-accent":d?"bg-text-3":"bg-transparent")}),r.jsx("span",{className:re("text-[11px] font-mono",O&&d?"text-accent":"text-text-3"),children:o.text}),O&&d&&r.jsxs("span",{className:"flex gap-0.5 ml-1",children:[r.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"0ms"}}),r.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"200ms"}}),r.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"400ms"}})]})]},u)})})]})}function kZ({agent:t}){const a=D(R=>R.chatHistory[t.id])||Rf,s=D(R=>R.activityLog[t.id])||Rf,l=D(R=>R.instructAgent),o=D(R=>R.queryAgent),u=D(R=>{var X;return(X=R.thinkingAgents)==null?void 0:X.has(t.id)}),d=D(R=>R.chatInputs[t.id]||""),O=R=>D.setState(X=>({chatInputs:{...X.chatInputs,[t.id]:R}})),h=d,p=O,[x,g]=v.useState("instruct"),[b,y]=v.useState(!1),Q=v.useRef(null),w=v.useRef(null),$=v.useRef(null),j=v.useMemo(()=>{var F;const R=[],X=new Set;for(const se of a){const oe=`${se.from}:${(F=se.text)==null?void 0:F.slice(0,100)}`;R.find(P=>{var W;return P.kind==="chat"&&`${P.from}:${(W=P.text)==null?void 0:W.slice(0,100)}`===oe&&Math.abs(P.ts-se.timestamp)<5e3})||(R.push({...se,kind:"chat",ts:se.timestamp}),X.add(se.text))}const T=X,V=s.slice(-30);for(const se of V)(se.text||"").trim()&&!T.has(se.text)&&R.push({...se,kind:"activity",ts:se.timestamp});R.sort((se,oe)=>se.ts-oe.ts);const M=[];let ae=[];for(const se of R)se.kind==="activity"?ae.push(se):(ae.length>0&&(M.push({kind:"activity-group",entries:ae}),ae=[]),M.push(se));return ae.length>0&&M.push({kind:"activity-group",entries:ae}),M},[a,s]);v.useEffect(()=>{Q.current&&requestAnimationFrame(()=>{Q.current&&(Q.current.scrollTop=Q.current.scrollHeight)})},[j.length]);async function z(R){var M;const X=Array.from(R.target.files||[]);if(X.length===0)return;const T=D.getState().addToast,V=[];for(const ae of X)try{const F=await new Promise((se,oe)=>{const H=new FileReader;H.onload=()=>se(H.result.split(",")[1]),H.onerror=oe,H.readAsDataURL(ae)});await J.post(`/agents/${t.id}/upload`,{filename:ae.name,content:F}),V.push(ae.name)}catch(F){T("error",`Upload failed: ${ae.name}`,F.message)}if(V.length>0){const ae=V.join(", ");p(F=>(F?F+`
|
|
634
|
+
`),lang:O});continue}if(/^#{1,3}\s/.test(o)||/^\*\*[^*]+:\*\*\s*$/.test(o.trim())){const d=o.replace(/^#+\s*/,"").replace(/^\*\*/,"").replace(/:\*\*\s*$/,":").trim();a.push({type:"heading",content:d}),l++;continue}if(/^\s*[-*]\s/.test(o)){const d=[];for(;l<s.length&&/^\s*[-*]\s/.test(s[l]);)d.push(s[l].replace(/^\s*[-*]\s+/,"").trim()),l++;a.push({type:"list",items:d});continue}if(/^\s*\d+[\.)]\s/.test(o)){const d=[];for(;l<s.length&&/^\s*\d+[\.)]\s/.test(s[l]);)d.push(s[l].replace(/^\s*\d+[\.)]\s+/,"").trim()),l++;a.push({type:"numbered",items:d});continue}if(!o.trim()){l++;continue}if(/^(Note|Warning|Important|IMPORTANT|TODO):/i.test(o.trim())){a.push({type:"note",content:o.trim()}),l++;continue}const u=[];for(;l<s.length&&s[l].trim()&&!/^#{1,3}\s/.test(s[l])&&!/^\s*[-*]\s/.test(s[l])&&!/^\s*\d+[\.)]\s/.test(s[l])&&!s[l].trimStart().startsWith("```");)u.push(s[l].trim()),l++;u.length>0&&a.push({type:"para",content:u.join(" ")})}return r.jsx("div",{className:"space-y-2",children:a.map((o,u)=>{switch(o.type){case"heading":return r.jsxs("div",{className:"flex items-center gap-1.5 pt-1.5 first:pt-0",children:[r.jsx("div",{className:"w-1 h-3.5 rounded-full bg-accent/40 flex-shrink-0"}),r.jsx("span",{className:"text-[12px] font-semibold text-text-0 font-sans",children:r.jsx(kl,{text:o.content})})]},u);case"list":return r.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((d,O)=>r.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[r.jsx("span",{className:"text-accent/50 mt-0.5 flex-shrink-0",children:"-"}),r.jsx("span",{className:"min-w-0",children:r.jsx(kl,{text:d})})]},O))},u);case"numbered":return r.jsx("div",{className:"space-y-1 pl-2",children:o.items.map((d,O)=>r.jsxs("div",{className:"flex gap-2 text-[12px] text-text-0 font-sans leading-relaxed",children:[r.jsxs("span",{className:"text-text-4 font-mono w-4 text-right flex-shrink-0",children:[O+1,"."]}),r.jsx("span",{className:"min-w-0",children:r.jsx(kl,{text:d})})]},O))},u);case"code":return r.jsx("pre",{className:"p-2.5 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06] leading-relaxed",children:o.content},u);case"note":return r.jsxs("div",{className:"flex items-start gap-1.5 px-2.5 py-1.5 rounded-md bg-warning/6 border border-warning/12",children:[r.jsx(ua,{size:10,className:"text-warning mt-0.5 flex-shrink-0"}),r.jsx("span",{className:"text-[11px] text-warning/80 font-sans",children:r.jsx(kl,{text:o.content})})]},u);case"para":default:return r.jsx("p",{className:"text-[12px] text-text-0 font-sans leading-relaxed",children:r.jsx(kl,{text:o.content})},u)}})})}function gZ({text:t}){if(!t)return null;const a=t.split(/(```[\s\S]*?```)/g);return r.jsx("span",{children:a.map((s,l)=>{if(s.startsWith("```")&&s.endsWith("```")){const o=s.slice(3,-3).replace(/^\w+\n/,"");return r.jsx("pre",{className:"my-1.5 p-2 rounded-md bg-[#0d1117] text-[11px] font-mono text-[#c9d1d9] overflow-x-auto whitespace-pre-wrap border border-white/[0.06]",children:o},l)}return r.jsx("span",{children:r.jsx(kl,{text:s})},l)})})}function bZ({msg:t}){const a=t.isQuery;return r.jsx("div",{className:"flex justify-end pl-8",children:r.jsxs("div",{className:"max-w-[90%]",children:[a&&r.jsxs("div",{className:"flex items-center justify-end gap-1 mb-1",children:[r.jsx(gc,{size:9,className:"text-info"}),r.jsx("span",{className:"text-2xs text-info font-sans font-medium",children:"Query"})]}),r.jsx("div",{className:re("px-3.5 py-2.5 rounded-lg border","bg-info/10 border-info/25"),children:r.jsx("div",{className:"text-[12px] font-sans whitespace-pre-wrap break-words leading-relaxed text-text-0",children:r.jsx(gZ,{text:t.text})})}),r.jsx("div",{className:"text-[10px] text-text-4 font-sans mt-1 text-right",children:vt(t.timestamp)})]})})}function vZ({msg:t,agent:a}){var u,d;const[s,l]=v.useState(((u=t.text)==null?void 0:u.length)>600),o=((d=t.text)==null?void 0:d.length)>600;return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-1 font-sans",children:(a==null?void 0:a.name)||"Agent"}),r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:a==null?void 0:a.role}),r.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:vt(t.timestamp)})]}),r.jsx("div",{className:"border-l border-accent pl-3.5 py-1",children:r.jsx(xZ,{text:s?t.text.slice(0,600)+"...":t.text})}),s&&r.jsxs("button",{onClick:()=>l(!1),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[r.jsx(ca,{size:11}),"Show full response"]}),o&&!s&&r.jsxs("button",{onClick:()=>l(!0),className:"ml-3.5 mt-1.5 flex items-center gap-1.5 text-[11px] text-accent/70 hover:text-accent font-sans font-medium cursor-pointer transition-colors",children:[r.jsx(ca,{size:11,className:"rotate-180"}),"Collapse"]})]})}function yZ({msg:t}){return r.jsxs("div",{className:"flex items-center gap-3 py-2",children:[r.jsx("div",{className:"flex-1 h-px bg-border-subtle"}),r.jsx("span",{className:"text-[10px] text-text-4 font-sans flex-shrink-0 uppercase tracking-wide",children:t.text}),r.jsx("div",{className:"flex-1 h-px bg-border-subtle"})]})}function SZ({entries:t,isLive:a}){var d;const[s,l]=v.useState(0);if(v.useEffect(()=>{if(!a||t.length<=1)return;const O=setInterval(()=>l(h=>(h+1)%t.length),1500);return()=>clearInterval(O)},[t.length,a]),!a){const O=t[t.length-1],p=IS(O.text).icon;return r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 text-[10px] text-text-4 font-mono",children:[r.jsx(p,{size:10,className:"opacity-50"}),r.jsxs("span",{children:[t.length," tool call",t.length!==1?"s":""]})]})}const o=t[Math.min(s,t.length-1)],u=((d=o.text)==null?void 0:d.length)>60?o.text.slice(0,60)+"...":o.text;return r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-2 max-w-[280px] rounded-md bg-surface-3/50 border border-border-subtle/30",children:[r.jsx(Ka,{size:11,className:"text-accent animate-spin flex-shrink-0"}),r.jsx("span",{className:"text-[11px] text-text-2 font-mono truncate transition-opacity duration-300",children:u}),t.length>1&&r.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:t.length})]})}function QZ({agent:t}){const a=D(h=>h.activityLog[t.id])||Rf,s=a[a.length-1],l=s?IS(s.text):null,o=(l==null?void 0:l.icon)||ns,u=s&&Date.now()-s.timestamp<1e4,d=u&&s.text?s.text.length>60?s.text.slice(0,60)+"...":s.text:null,O=Math.round((t.contextUsage||0)*100);return r.jsxs("div",{className:"flex items-center gap-3 px-4 h-8 border-b border-border-subtle bg-surface-1/80 flex-shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[r.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[r.jsx("span",{className:"absolute inset-0 rounded-full bg-accent/15 animate-ping",style:{animationDuration:"2s"}}),r.jsx("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),u?r.jsxs(r.Fragment,{children:[r.jsx(o,{size:10,className:re(l.color,"flex-shrink-0")}),r.jsx("span",{className:"text-[11px] text-text-2 font-sans truncate",children:d})]}):r.jsx("span",{className:"text-[11px] text-text-3 font-sans",children:"Working..."})]}),r.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[r.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:jZ(t.tokensUsed)}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("div",{className:"w-14 h-1 rounded-full bg-surface-4 overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${O}%`,background:O>=75?"var(--color-danger)":O>=50?"var(--color-warning)":"var(--color-accent)"}})}),r.jsxs("span",{className:"text-[10px] text-text-4 font-mono w-7 text-right",children:[O,"%"]})]})]})]})}function jZ(t){return t?t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":String(t):"0"}function wZ({agent:t}){const[a,s]=v.useState([]),l=[{text:`Initializing ${t.name}`,delay:0},{text:`Role: ${t.role}`,delay:400},{text:`Provider: ${t.provider||"claude-code"}`,delay:700},{text:"Loading workspace context",delay:1e3},{text:"Scanning project structure",delay:1400},{text:"Session active",delay:1900}];return v.useEffect(()=>{const o=l.map((u,d)=>setTimeout(()=>s(O=>[...O,d]),u.delay));return()=>o.forEach(clearTimeout)},[]),r.jsxs("div",{className:"flex flex-col px-4 pt-6",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[r.jsxs("div",{className:"relative w-9 h-9",children:[r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-accent/20 animate-ping",style:{animationDuration:"2s"}}),r.jsx("span",{className:"absolute inset-0 rounded-full border-2 border-transparent border-t-accent animate-spin",style:{animationDuration:"1s"}}),r.jsx("span",{className:"absolute inset-[5px] rounded-full bg-accent/8"})]}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-bold text-text-0 font-sans",children:t.name}),r.jsx("p",{className:"text-2xs text-accent font-mono",children:"starting up"})]})]}),r.jsx("div",{className:"space-y-2 pl-3 border-l border-accent/15",children:l.map((o,u)=>{const d=a.includes(u),O=u===l.length-1;return r.jsxs("div",{className:re("flex items-center gap-2.5 transition-all duration-300",d?"opacity-100 translate-x-0":"opacity-0 -translate-x-2"),children:[r.jsx("span",{className:re("w-1 h-1 rounded-full flex-shrink-0",O&&d?"bg-accent":d?"bg-text-3":"bg-transparent")}),r.jsx("span",{className:re("text-[11px] font-mono",O&&d?"text-accent":"text-text-3"),children:o.text}),O&&d&&r.jsxs("span",{className:"flex gap-0.5 ml-1",children:[r.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"0ms"}}),r.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"200ms"}}),r.jsx("span",{className:"w-1 h-1 rounded-full bg-accent animate-pulse",style:{animationDelay:"400ms"}})]})]},u)})})]})}function kZ({agent:t}){const a=D(R=>R.chatHistory[t.id])||Rf,s=D(R=>R.activityLog[t.id])||Rf,l=D(R=>R.instructAgent),o=D(R=>R.queryAgent),u=D(R=>{var X;return(X=R.thinkingAgents)==null?void 0:X.has(t.id)}),d=D(R=>R.chatInputs[t.id]||""),O=R=>D.setState(X=>({chatInputs:{...X.chatInputs,[t.id]:R}})),h=d,p=O,[x,g]=v.useState("instruct"),[b,y]=v.useState(!1),Q=v.useRef(null),w=v.useRef(null),$=v.useRef(null),j=v.useMemo(()=>{var F;const R=[],X=new Set;for(const le of a){const oe=`${le.from}:${(F=le.text)==null?void 0:F.slice(0,100)}`;R.find(P=>{var W;return P.kind==="chat"&&`${P.from}:${(W=P.text)==null?void 0:W.slice(0,100)}`===oe&&Math.abs(P.ts-le.timestamp)<5e3})||(R.push({...le,kind:"chat",ts:le.timestamp}),X.add(le.text))}const T=X,V=s.slice(-30);for(const le of V)(le.text||"").trim()&&!T.has(le.text)&&R.push({...le,kind:"activity",ts:le.timestamp});R.sort((le,oe)=>le.ts-oe.ts);const M=[];let ae=[];for(const le of R)le.kind==="activity"?ae.push(le):(ae.length>0&&(M.push({kind:"activity-group",entries:ae}),ae=[]),M.push(le));return ae.length>0&&M.push({kind:"activity-group",entries:ae}),M},[a,s]);v.useEffect(()=>{Q.current&&requestAnimationFrame(()=>{Q.current&&(Q.current.scrollTop=Q.current.scrollHeight)})},[j.length]);async function z(R){var M;const X=Array.from(R.target.files||[]);if(X.length===0)return;const T=D.getState().addToast,V=[];for(const ae of X)try{const F=await new Promise((le,oe)=>{const H=new FileReader;H.onload=()=>le(H.result.split(",")[1]),H.onerror=oe,H.readAsDataURL(ae)});await J.post(`/agents/${t.id}/upload`,{filename:ae.name,content:F}),V.push(ae.name)}catch(F){T("error",`Upload failed: ${ae.name}`,F.message)}if(V.length>0){const ae=V.join(", ");p(F=>(F?F+`
|
|
635
635
|
`:"")+`[Uploaded: ${ae}] — I've uploaded these files to your working directory. Read them and use their content.`),T("success",`Uploaded ${V.length} file${V.length>1?"s":""}`)}R.target.value="",(M=w.current)==null||M.focus()}async function N(){var X;const R=h.trim();if(!(!R||b)){if(R==="/rotate"){const T=D.getState().rotateAgent;p("");try{await T(t.id)}catch{}return}p(""),y(!0);try{x==="query"?await o(t.id,R):await l(t.id,R)}catch{}y(!1),(X=w.current)==null||X.focus()}}function _(R){R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),N())}const G=t.status==="running"||t.status==="starting";return r.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[G&&r.jsx(QZ,{agent:t}),r.jsxs("div",{ref:Q,className:"flex-1 overflow-y-auto px-4 py-4 space-y-4",children:[!j.some(R=>R.from==="agent"||R.kind==="activity-group")&&(G?r.jsx(wZ,{agent:t}):r.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-8",children:[r.jsx("div",{className:"w-10 h-10 rounded-xl bg-surface-3 flex items-center justify-center mb-3",children:r.jsx(pi,{size:18,className:"text-text-4"})}),r.jsx("p",{className:"text-sm font-semibold text-text-0 font-sans",children:t.name}),r.jsx("p",{className:"text-xs text-text-3 font-sans mt-1",children:"Session complete — send a message to continue"})]})),j.map((R,X)=>{if(R.kind==="activity-group"){const T=!j.slice(X+1).some(V=>V.kind==="activity-group"||V.from==="agent");return r.jsx("div",{children:r.jsx(SZ,{entries:R.entries,isLive:G&&T})},`grp-${X}`)}return R.from==="user"?r.jsx(bZ,{msg:R},`msg-${X}`):R.from==="system"?r.jsx(yZ,{msg:R},`msg-${X}`):r.jsx(vZ,{msg:R,agent:t},`msg-${X}`)}),r.jsx(Cf,{children:(b||u)&&r.jsx(Xf.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.25,ease:"easeOut"},children:r.jsx(pZ,{agent:t})},"thinking")})]}),r.jsxs("div",{className:"border-t border-border px-4 py-3 bg-surface-1/50 flex-shrink-0",children:[r.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[r.jsxs("button",{onClick:()=>g("instruct"),className:re("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",x==="instruct"?"bg-accent/12 text-accent border border-accent/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[r.jsx(Gc,{size:10}),"Instruct"]}),r.jsxs("button",{onClick:()=>g("query"),className:re("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[11px] font-sans font-medium transition-colors cursor-pointer",x==="query"?"bg-info/12 text-info border border-info/20":"text-text-3 hover:text-text-1 hover:bg-surface-3"),children:[r.jsx(gc,{size:10}),"Query"]}),r.jsx("span",{className:"text-[10px] text-text-4 font-sans ml-auto",children:x==="query"?"Read-only — agent keeps working":G?"Directs the agent":"Continues the session"})]}),r.jsxs("div",{className:re("flex items-end gap-1 rounded-xl border bg-surface-0 p-1 transition-colors",x==="query"?"border-info/20 focus-within:border-info/40":"border-border-subtle focus-within:border-accent/30"),children:[r.jsx("input",{ref:$,type:"file",multiple:!0,accept:".pdf,.png,.jpg,.jpeg,.gif,.svg,.csv,.txt,.md,.json,.yaml,.yml,.docx,.pptx,.xlsx",onChange:z,className:"hidden"}),r.jsx("button",{onClick:()=>{var R;return(R=$.current)==null?void 0:R.click()},className:"w-9 h-9 flex items-center justify-center rounded-lg text-text-4 hover:text-text-1 hover:bg-surface-3 transition-colors cursor-pointer flex-shrink-0 mb-px",title:"Attach file",children:r.jsx(KT,{size:14})}),r.jsx("textarea",{ref:w,value:h,onChange:R=>p(R.target.value),onKeyDown:_,placeholder:x==="query"?"Ask about this agent's work...":G?"Send an instruction...":"Continue this session...",rows:1,className:re("flex-1 resize-none px-3 py-2 text-[13px]","bg-transparent text-text-0 font-sans","placeholder:text-text-4","focus:outline-none","max-h-[120px] min-h-[36px]"),style:{height:Math.min(Math.max(36,h.split(`
|
|
636
|
-
`).length*20),120)}}),r.jsx("button",{onClick:N,disabled:!h.trim()||b,className:re("w-9 h-9 flex items-center justify-center rounded-lg transition-all cursor-pointer flex-shrink-0 mb-px","disabled:opacity-15 disabled:cursor-not-allowed",h.trim()?x==="query"?"bg-info text-white hover:bg-info/85":"bg-accent text-white hover:bg-accent/85":"bg-transparent text-text-4"),children:b?r.jsx(Ka,{size:15,className:"animate-spin"}):r.jsx(ah,{size:15})})]})]})]})}function af({options:t,value:a,onChange:s}){return r.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:t.map(l=>r.jsx("button",{onClick:()=>s(l.value),className:re("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",a===l.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:l.label},l.value))})}function hn({label:t,icon:a,children:s,description:l}){return r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-semibold text-text-1 font-sans",children:[a&&r.jsx(a,{size:13,className:"text-text-3"}),t]}),l&&r.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:l})]}),s]})}function $Z({agent:t}){const a=D(Q=>Q.killAgent),s=D(Q=>Q.rotateAgent),l=D(Q=>Q.spawnAgent),o=D(Q=>Q.closeDetail),u=D(Q=>Q.addToast),[d,O]=v.useState(null),[h,p]=v.useState(!1),x=t.status==="running"||t.status==="starting";async function g(){O("rotate");try{await s(t.id)}catch{}O(null)}async function b(){if(!h){p(!0),setTimeout(()=>p(!1),3e3);return}O("kill");try{await a(t.id),o()}catch{}O(null),p(!1)}async function y(){O("clone");try{await l({role:t.role,provider:t.provider,model:t.model,name:`${t.name}-clone`,scope:t.scope,workingDir:t.workingDir}),u("success",`Cloned ${t.name}`)}catch{}O(null)}return x?r.jsx("div",{className:"space-y-2",children:r.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[r.jsxs(ve,{variant:"primary",size:"md",onClick:g,disabled:d==="rotate",className:"gap-1.5",children:[r.jsx(Wl,{size:12,className:d==="rotate"?"animate-spin":""}),"Rotate"]}),r.jsxs(ve,{variant:"info",size:"md",onClick:y,disabled:!!d,className:"gap-1.5",children:[r.jsx(xf,{size:12})," Clone"]}),r.jsxs(ve,{variant:"danger",size:"md",onClick:b,disabled:d==="kill",className:"gap-1.5",children:[r.jsx(sh,{size:12}),h?"Confirm":"Kill"]})]})}):r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs(ve,{variant:"info",size:"md",onClick:y,disabled:!!d,className:"gap-1.5",children:[r.jsx(xf,{size:12})," Clone"]}),r.jsxs(ve,{variant:"danger",size:"md",onClick:b,disabled:d==="kill",className:"gap-1.5",children:[r.jsx(as,{size:12}),h?"Confirm":"Remove"]})]})}function TZ({agent:t}){var Re;const a=D(B=>B.addToast),[s,l]=v.useState([]),[o,u]=v.useState(t.model||""),[d,O]=v.useState(""),[h,p]=v.useState(t.effort||"default"),[x,g]=v.useState(!1),[b,y]=v.useState(""),[Q,w]=v.useState(null),[$,j]=v.useState(!1),[z,N]=v.useState(null),[_,G]=v.useState(t.routingMode||"auto"),[R,X]=v.useState([]),[T,V]=v.useState("hr"),[M,ae]=v.useState("1"),[F,se]=v.useState(!1),oe=t.status==="running"||t.status==="starting";v.useEffect(()=>{H(),J.get("/skills/installed").then(ue=>X(Array.isArray(ue)?ue:ue.skills||[])).catch(()=>{});function B(){H()}return window.addEventListener("groove:providers-changed",B),()=>window.removeEventListener("groove:providers-changed",B)},[]);function H(){J.get("/providers").then(B=>l(Array.isArray(B)?B:[])).catch(()=>{})}v.useEffect(()=>{u(t.model||""),J.get(`/agents/${t.id}/routing/recommend`).then(B=>{G((B==null?void 0:B.mode)||"fixed")}).catch(()=>{})},[t.id,t.model]);const P=s.find(B=>B.id===t.provider);async function W(B,ue){u(ue);try{const Ce={model:ue};B&&B!==t.provider&&(Ce.provider=B),await J.patch(`/agents/${t.id}`,Ce),a("success",`Model → ${ue}${Ce.provider?` (${B})`:""}`)}catch(Ce){a("error","Model swap failed",Ce.message)}}async function E(B){try{await J.patch(`/agents/${t.id}`,{workingDir:B}),a("success",`Working dir → ${B.split("/").pop()||B}`)}catch(ue){a("error","Update failed",ue.message)}}async function ce(B){p(B);try{await J.patch(`/agents/${t.id}`,{effort:B}),a("success",`Effort → ${B}`)}catch(ue){a("error","Update failed",ue.message)}}async function ee(B){if(!B.trim())return;const ue=[...t.scope||[],B.trim()];try{await J.patch(`/agents/${t.id}`,{scope:ue}),O("")}catch(Ce){a("error","Scope update failed",Ce.message)}}async function be(B){const ue=(t.scope||[]).filter((Ce,Ot)=>Ot!==B);try{await J.patch(`/agents/${t.id}`,{scope:ue})}catch(Ce){a("error","Scope update failed",Ce.message)}}async function Se(B){if(b.trim())try{await J.post(`/credentials/${B}`,{key:b.trim()}),a("success",`API key set for ${B}`),y(""),w(null),H(),window.dispatchEvent(new CustomEvent("groove:providers-changed"))}catch(ue){a("error","Failed to set key",ue.message)}}const ye=t.spawnedAt||t.createdAt;return r.jsxs("div",{className:"px-5 py-5 space-y-6 overflow-y-auto h-full",children:[r.jsx(hn,{label:"Active Model",icon:Al,children:r.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-bold font-mono text-text-0",children:t.model||"auto"}),r.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:(P==null?void 0:P.name)||t.provider})]}),(P==null?void 0:P.canHotSwap)&&oe&&r.jsxs(Xe,{variant:"accent",className:"text-2xs gap-1",children:[r.jsx(Rn,{size:8})," Hot-swap"]})]}),((Re=P==null?void 0:P.models)==null?void 0:Re.length)>1&&r.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3 pt-3 border-t border-border-subtle",children:P.models.filter(B=>!B.disabled).map(B=>{const ue=B.id===t.model;return r.jsx("button",{onClick:()=>W(t.provider,B.id),disabled:!1,className:re("px-2.5 py-1 rounded-md text-xs font-mono transition-all","cursor-pointer",ue?"bg-accent/15 text-accent font-semibold":"bg-surface-4 text-text-2 hover:bg-surface-5 hover:text-text-0"),children:B.name||B.id},B.id)})})]})}),r.jsx($Z,{agent:t}),r.jsxs(hn,{label:"Providers",icon:a1,description:"Click a provider to see its models and connection status.",children:[r.jsx("div",{className:"space-y-1.5",children:s.map(B=>{const ue=B.id===t.provider,Ce=B.installed||B.hasKey,Ot=z===B.id,Ae=B.models||[];return r.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[r.jsxs("button",{onClick:()=>N(Ot?null:B.id),className:"w-full flex items-center gap-2.5 px-3 py-2 cursor-pointer hover:bg-surface-4/50 transition-colors",children:[r.jsx("div",{className:re("w-2 h-2 rounded-full flex-shrink-0",Ce?"bg-success":"bg-text-4")}),r.jsx("span",{className:re("text-xs font-semibold font-sans flex-1 text-left",Ce?"text-text-0":"text-text-3"),children:B.name||B.id}),ue&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Active"}),!Ce&&r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:B.authType==="local"?"Not installed":"No key"}),r.jsx(ca,{size:12,className:re("text-text-4 transition-transform",Ot&&"rotate-180")})]}),Ot&&B.authType==="local"&&r.jsx("div",{className:"border-t border-border-subtle",children:r.jsx(uS,{isInstalled:Ce,onModelChange:H})}),Ot&&B.authType!=="local"&&r.jsxs("div",{className:"border-t border-border-subtle",children:[(!Ce||B.hasKey)&&r.jsx("div",{className:"px-3 py-2 bg-surface-1/50",children:Q===B.id?r.jsxs("div",{className:"flex gap-1.5",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx("input",{value:b,onChange:He=>y(He.target.value),onKeyDown:He=>He.key==="Enter"&&Se(B.id),type:$?"text":"password",placeholder:`${B.name||B.id} API key...`,className:"w-full h-7 px-2.5 pr-7 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:()=>j(!$),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:$?r.jsx(Kf,{size:10}):r.jsx(Dl,{size:10})})]}),r.jsx(ve,{variant:"primary",size:"sm",onClick:()=>Se(B.id),disabled:!b.trim(),className:"h-7 px-2 text-2xs",children:"Save"}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{w(null),y("")},className:"h-7 px-2 text-2xs",children:"Cancel"})]}):r.jsxs("button",{onClick:()=>{w(B.id),y(""),j(!1)},className:"flex items-center gap-1.5 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[r.jsx(vc,{size:10}),Ce?"Update API key":"Add API key to enable"]})}),Ce&&Ae.filter(He=>!He.disabled).length>0&&Ae.filter(He=>!He.disabled).map(He=>{const bt=B.id===t.provider&&He.id===t.model;return r.jsxs("button",{onClick:()=>W(B.id,He.id),disabled:!1,className:re("w-full flex items-center gap-2 px-3 py-2 text-left text-xs font-sans transition-colors","border-t border-border-subtle","cursor-pointer hover:bg-surface-4/50",bt?"text-accent":"text-text-2"),children:[bt?r.jsx(Dt,{size:11,className:"text-accent flex-shrink-0"}):r.jsx("div",{className:"w-[11px]"}),r.jsx("span",{className:"font-mono flex-1 truncate",children:He.name||He.id}),r.jsx(Xe,{variant:bt?"accent":"default",className:"text-2xs",children:He.tier})]},He.id)})]})]},B.id)})}),oe&&r.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans mt-1.5",children:[r.jsx(ua,{size:10}),r.jsx("span",{children:"Model changes apply on next rotation or respawn."})]})]}),r.jsx(hn,{label:"Working Directory",icon:ai,description:"The root directory this agent operates in.",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"flex-1 bg-surface-0 rounded-lg px-3 py-2.5 text-sm font-mono text-text-1 border border-border-subtle truncate min-w-0",children:t.workingDir||"Project root"}),r.jsxs(ve,{variant:"secondary",size:"md",onClick:()=>g(!0),className:"gap-1.5 flex-shrink-0",children:[r.jsx(Zb,{size:14})," Browse"]})]})}),r.jsx(hn,{label:"Permission Mode",icon:li,description:"Full Send = no approvals. Agent Approve = Fullstack Manager reviews risky operations.",children:r.jsx(af,{options:[{value:"full",label:"Full Send"},{value:"auto",label:"Agent Approve"}],value:t.permission||"full",onChange:async B=>{try{await J.patch(`/agents/${t.id}`,{permission:B}),a("success",`Permission → ${B==="full"?"Full Send":"Agent Approve"}`)}catch(ue){a("error","Update failed",ue.message)}}})}),r.jsxs(hn,{label:"Model Routing",icon:pc,description:"How Groove selects models for this agent's tasks.",children:[r.jsx(af,{options:[{value:"fixed",label:"Fixed"},{value:"auto",label:"Auto"},{value:"auto-floor",label:"Auto + Floor"}],value:_,onChange:async B=>{G(B);try{await J.post(`/agents/${t.id}/routing`,{mode:B}),a("success",`Routing → ${B}`)}catch(ue){a("error","Update failed",ue.message)}}}),r.jsxs("div",{className:"text-2xs text-text-4 font-sans mt-1",children:[_==="fixed"&&"Uses the selected model for all tasks.",_==="auto"&&"Groove picks Opus/Sonnet/Haiku based on task complexity.",_==="auto-floor"&&"Auto-routes but never drops below Sonnet."]})]}),r.jsx(hn,{label:"File Scope",icon:li,description:"Restrict which files this agent can access. Empty = unrestricted.",children:r.jsxs("div",{className:"flex flex-wrap gap-2",children:[(t.scope||[]).map((B,ue)=>r.jsxs(Xe,{variant:"default",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[B,r.jsx("button",{onClick:()=>be(ue),className:"hover:text-danger cursor-pointer",children:r.jsx(Qt,{size:10})})]},ue)),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("input",{value:d,onChange:B=>O(B.target.value),onKeyDown:B=>B.key==="Enter"&&ee(d),placeholder:"e.g. src/**",className:"w-28 h-7 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),r.jsx("button",{onClick:()=>ee(d),disabled:!d.trim(),className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:r.jsx(Ja,{size:12})})]})]})}),r.jsx(hn,{label:"Effort Level",icon:Eb,description:"Controls how deep the agent reasons. Higher = more tokens but better results.",children:r.jsx(af,{options:[{value:"min",label:"Min"},{value:"low",label:"Low"},{value:"default",label:"Default"},{value:"high",label:"High"},{value:"max",label:"Max"}],value:h,onChange:ce})}),r.jsx(hn,{label:"Agent Details",icon:a1,children:r.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle divide-y divide-border-subtle",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"ID"}),r.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.id})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Role"}),r.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.role})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Provider"}),r.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.provider})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Model"}),r.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.model||"auto"})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Status"}),r.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.status})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Spawned"}),r.jsx("span",{className:"text-xs text-text-1 font-sans",children:ye?vt(ye):"—"})]}),t.sessionId&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Session"}),r.jsxs("span",{className:"text-xs text-text-1 font-mono",children:[t.sessionId.slice(0,16),"..."]})]})]})}),r.jsx(hn,{label:"Skills",icon:Ir,description:"Attach installed skills to this agent's context.",children:r.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.skills||[]).map(B=>r.jsxs(Xe,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[B,r.jsx("button",{onClick:async()=>{try{await J.delete(`/agents/${t.id}/skills/${B}`),a("success",`Detached ${B}`)}catch(ue){a("error","Detach failed",ue.message)}},className:"hover:text-danger cursor-pointer",children:r.jsx(Qt,{size:10})})]},B)),R.filter(B=>!(t.skills||[]).includes(B.id)).length>0&&r.jsxs("div",{className:"relative group",children:[r.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:r.jsx(Ja,{size:12})}),r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[160px]",children:R.filter(B=>!(t.skills||[]).includes(B.id)).map(B=>r.jsx("button",{onClick:async()=>{try{await J.post(`/agents/${t.id}/skills/${B.id}`),a("success",`Attached ${B.name||B.id}`)}catch(ue){a("error","Attach failed",ue.message)}},className:"w-full text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:B.name||B.id},B.id))})]}),(t.skills||[]).length===0&&R.length===0&&r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No skills installed — browse the Marketplace"})]})}),r.jsx(hn,{label:"Schedule",icon:xc,description:"Run this agent on a recurring schedule.",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-text-2 font-sans",children:"Every"}),r.jsx("input",{value:M,onChange:B=>ae(B.target.value.replace(/\D/g,"").slice(0,3)),className:"w-12 h-7 px-2 text-xs text-center bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent",placeholder:"1"}),r.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:[{value:"min",label:"Min"},{value:"hr",label:"Hr"},{value:"day",label:"Day"},{value:"wk",label:"Wk"},{value:"mo",label:"Mo"}].map(B=>r.jsx("button",{onClick:()=>V(B.value),className:re("px-2 py-1 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",T===B.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:B.label},B.value))}),r.jsxs(ve,{variant:"primary",size:"sm",disabled:F||!M||parseInt(M,10)<1,onClick:async()=>{const B=parseInt(M,10);if(!B||B<1)return;const ue={min:B===1?"* * * * *":`*/${B} * * * *`,hr:B===1?"0 * * * *":`0 */${B} * * *`,day:B===1?"0 0 * * *":`0 0 */${B} * *`,wk:`0 0 * * ${B===1?"1":"*"}`,mo:`0 0 ${B===1?"1":B} * *`};se(!0);try{await J.post("/schedules",{name:`${t.name} schedule`,cron:ue[T],agentConfig:{role:t.role,provider:t.provider,model:t.model,scope:t.scope,workingDir:t.workingDir,prompt:t.prompt}}),a("success",`Scheduled every ${B} ${T}`)}catch(Ce){a("error","Schedule failed",Ce.message)}se(!1)},className:"h-7 px-3 text-2xs gap-1",children:[r.jsx(xc,{size:10}),F?"...":"Set"]})]})}),t.prompt&&r.jsx(hn,{label:"Original Prompt",icon:pc,children:r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3 py-3 text-xs text-text-2 font-sans leading-relaxed max-h-40 overflow-y-auto",children:t.prompt})}),r.jsx(DS,{open:x,onOpenChange:g,currentPath:t.workingDir||"/",onSelect:E})]})}const j0=[];function NZ({data:t,isAlive:a,height:s=48}){const l=v.useRef(null);return v.useEffect(()=>{const o=l.current;if(!o||!t.length)return;const u=o.getContext("2d"),d=window.devicePixelRatio||1,O=o.clientWidth,h=o.clientHeight;o.width=O*d,o.height=h*d,u.scale(d,d),u.clearRect(0,0,O,h);const p=t.map(Q=>Q.v),x=Math.min(...p),b=Math.max(...p,1)-x||1;u.beginPath(),u.moveTo(0,h),t.forEach((Q,w)=>{const $=w/(t.length-1)*O,j=h-(Q.v-x)/b*(h-4)-2;u.lineTo($,j)}),u.lineTo(O,h),u.closePath();const y=u.createLinearGradient(0,0,0,h);if(y.addColorStop(0,a?"rgba(51,175,188,0.15)":"rgba(110,118,129,0.08)"),y.addColorStop(1,"rgba(0,0,0,0)"),u.fillStyle=y,u.fill(),u.beginPath(),u.strokeStyle=a?xe.accent:xe.text3,u.lineWidth=1.5,t.forEach((Q,w)=>{const $=w/(t.length-1)*O,j=h-(Q.v-x)/b*(h-4)-2;w===0?u.moveTo($,j):u.lineTo($,j)}),u.stroke(),t.length>1&&a){const Q=t[t.length-1],w=O-1,$=h-(Q.v-x)/b*(h-4)-2;u.beginPath(),u.arc(w,$,5,0,Math.PI*2),u.fillStyle="rgba(51,175,188,0.3)",u.fill(),u.beginPath(),u.arc(w,$,2.5,0,Math.PI*2),u.fillStyle=xe.accent,u.fill()}},[t,a]),r.jsx("div",{className:"w-full rounded-lg bg-surface-0 overflow-hidden border border-border-subtle",style:{height:s},children:r.jsx("canvas",{ref:l,className:"w-full h-full"})})}function ec({icon:t,label:a,value:s,color:l,sub:o}){return r.jsxs("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 border border-border-subtle",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(t,{size:12,className:l||"text-text-3"}),r.jsx("span",{className:"text-2xs text-text-4 font-sans uppercase tracking-wider",children:a})]}),r.jsx("div",{className:re("text-lg font-bold font-mono tabular-nums",l||"text-text-0"),children:s}),o&&r.jsx("div",{className:"text-2xs text-text-4 font-sans mt-0.5",children:o})]})}function PZ({score:t}){const a=Math.min(Math.max(t,0),100);let s=xe.success,l="Healthy";return a<40?(s=xe.danger,l="Degraded"):a<70&&(s=xe.warning,l="Fair"),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[r.jsxs("span",{className:"text-2xs text-text-3 font-sans flex items-center gap-1.5",children:[r.jsx(ST,{size:11}),"Session Health"]}),r.jsxs("span",{className:"text-xs font-bold font-mono",style:{color:s},children:[a,"/100"]})]}),r.jsx("div",{className:"h-2 bg-surface-0 rounded-full overflow-hidden border border-border-subtle",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${a}%`,background:s}})}),r.jsx("span",{className:"text-2xs font-sans mt-1 block",style:{color:s},children:l})]})}function zZ(t){const a=(t||"").toLowerCase();return a.includes("edit")||a.includes("writ")?{icon:_b,color:"text-warning"}:a.includes("read")||a.includes("view")?{icon:Dl,color:"text-info"}:a.includes("search")||a.includes("grep")||a.includes("glob")?{icon:da,color:"text-purple"}:a.includes("bash")||a.includes("command")||a.includes("terminal")?{icon:xi,color:"text-orange"}:a.includes("error")||a.includes("fail")?{icon:ua,color:"text-danger"}:a.includes("spawn")||a.includes("start")?{icon:Rn,color:"text-success"}:a.includes("complet")||a.includes("done")?{icon:mf,color:"text-success"}:{icon:pf,color:"text-text-4"}}function RZ({agent:t}){const a=D(d=>d.tokenTimeline[t.id])||j0,s=D(d=>d.activityLog[t.id])||j0,l=t.status==="running"||t.status==="starting",o=v.useMemo(()=>{if(a.length<2)return 0;const d=a.slice(-10),O=(d[d.length-1].t-d[0].t)/6e4,h=d[d.length-1].v-d[0].v;return O>0?Math.round(h/O):0},[a]),u=v.useMemo(()=>{const d=t.contextUsage||0;let O=100;return d>90?O-=50:d>70?O-=25:d>50&&(O-=10),o>5e3?O-=15:o>3e3&&(O-=8),t.status==="crashed"&&(O=10),t.status==="completed"&&(O=95),Math.max(0,Math.min(100,O))},[t.contextUsage,t.status,o]);return r.jsxs("div",{className:"px-5 py-5 space-y-5 overflow-y-auto h-full",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Token Burn"}),l&&r.jsx("span",{className:"text-2xs text-accent font-mono animate-pulse",children:"LIVE"})]}),r.jsx(NZ,{data:a,isAlive:l,height:56})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx(ec,{icon:uT,label:"Burn Rate",value:o>0?`${et(o)}/m`:"—",color:o>5e3?"text-danger":o>2e3?"text-warning":"text-text-0"}),r.jsx(ec,{icon:F5,label:"Cost",value:Lc(t.costUsd||0),color:"text-text-0"}),r.jsx(ec,{icon:Wl,label:"Rotations",value:t.rotations||"0",color:"text-text-0"}),r.jsx(ec,{icon:Rn,label:"Turns",value:t.turns||"0",color:"text-text-0"})]}),r.jsx(PZ,{score:u}),t.prompt&&r.jsxs("div",{children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-1.5",children:"Task"}),r.jsx("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 text-xs text-text-2 font-sans leading-relaxed max-h-28 overflow-y-auto border border-border-subtle",children:t.prompt})]}),s.length>0&&r.jsxs("div",{children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-2",children:"Activity"}),r.jsxs("div",{className:"space-y-0 relative",children:[r.jsx("div",{className:"absolute left-[9px] top-2 bottom-2 w-px bg-border-subtle"}),s.slice(-12).reverse().map((d,O)=>{const h=zZ(d.text),p=h.icon;return r.jsxs("div",{className:"flex items-start gap-3 py-1.5 relative",children:[r.jsx("div",{className:re("w-[18px] h-[18px] rounded-full flex items-center justify-center flex-shrink-0 z-10","bg-surface-1 border border-border-subtle"),children:r.jsx(p,{size:9,className:h.color})}),r.jsx("span",{className:"text-2xs text-text-2 font-sans flex-1 line-clamp-1 pt-0.5",children:d.text}),r.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0 pt-0.5",children:vt(d.timestamp)})]},O)})]})]})]})}function CZ({agent:t}){const a=D(z=>z.addToast),[s,l]=v.useState([]),[o,u]=v.useState(""),[d,O]=v.useState(null),[h,p]=v.useState(""),[x,g]=v.useState(""),[b,y]=v.useState(!1);async function Q(){try{const z=await J.get(`/agents/${t.id}/mdfiles`);l(z.files||[]),u(z.workingDir||"")}catch{}}v.useEffect(()=>{Q()},[t.id]);async function w(z){try{const N=await J.get(`/agents/${t.id}/mdfiles/read?path=${encodeURIComponent(z)}`);p(N.content||""),g(N.content||""),O(z)}catch(N){a("error","Failed to read file",N.message)}}async function $(){if(d){y(!0);try{await J.put(`/agents/${t.id}/mdfiles/write`,{path:d,content:h}),g(h),a("success",`Saved ${d}`)}catch(z){a("error","Save failed",z.message)}y(!1)}}const j=h!==x;return d?r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-subtle",children:[r.jsx("button",{onClick:()=>{O(null),p(""),g("")},className:"p-1 text-text-3 hover:text-text-0 cursor-pointer",children:r.jsx(Cb,{size:14})}),r.jsx(Ba,{size:12,className:"text-accent"}),r.jsx("span",{className:"text-xs text-text-0 font-sans font-medium flex-1 truncate",children:d}),j&&r.jsx("span",{className:"text-[10px] text-warning font-sans",children:"unsaved"}),r.jsxs("button",{onClick:$,disabled:!j||b,className:re("flex items-center gap-1 px-2.5 py-1 rounded text-2xs font-sans font-medium cursor-pointer transition-colors",j?"bg-accent/15 text-accent hover:bg-accent/25":"text-text-4 opacity-50 cursor-not-allowed"),children:[r.jsx(xN,{size:10}),b?"Saving...":"Save"]})]}),r.jsx("textarea",{value:h,onChange:z=>p(z.target.value),className:"flex-1 w-full px-4 py-3 bg-surface-0 text-[12px] font-mono text-text-1 leading-relaxed resize-none focus:outline-none",spellCheck:!1})]}):r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border-subtle",children:[r.jsx(Ba,{size:12,className:"text-text-3"}),r.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:"Markdown Files"}),r.jsx("button",{onClick:Q,className:"p-1 text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(zn,{size:11})})]}),o&&r.jsx("div",{className:"px-4 py-1.5 text-[10px] text-text-4 font-mono truncate border-b border-border-subtle/50",children:o}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:s.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-4",children:[r.jsx(Ba,{size:20,className:"text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No markdown files found"}),r.jsx("p",{className:"text-[10px] text-text-4 font-sans mt-1",children:"MD files in the agent's working directory will appear here"})]}):r.jsx("div",{className:"py-1",children:s.map(z=>r.jsxs("button",{onClick:()=>w(z.path),className:"w-full flex items-center gap-2.5 px-4 py-2 text-left hover:bg-surface-5 transition-colors cursor-pointer",children:[r.jsx(Ba,{size:13,className:"text-accent flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"text-xs text-text-0 font-sans block truncate",children:z.name}),r.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:z.path})]}),r.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:z.size>1024?`${(z.size/1024).toFixed(1)}K`:`${z.size}B`})]},z.path))})})]})}const XZ={running:"success",starting:"warning",stopped:"default",crashed:"danger",completed:"accent",killed:"default",rotating:"purple"},_Z={running:"Running",starting:"Starting",stopped:"Stopped",crashed:"Crashed",completed:"Done",killed:"Killed",rotating:"Rotating"},ZZ=[{id:"command",label:"Chat",icon:pi},{id:"config",label:"Config",icon:Bb},{id:"telemetry",label:"Monitor",icon:pc},{id:"mdfiles",label:"Files",icon:Ba}];function AZ({agent:t}){const a=D(h=>h.addToast),[s,l]=v.useState(!1),[o,u]=v.useState(t.name),d=v.useRef(null);async function O(){const h=o.trim();if(!h||h===t.name){l(!1);return}try{await J.patch(`/agents/${t.id}`,{name:h.replace(/\s+/g,"-")}),a("success",`Renamed → ${h}`)}catch(p){a("error","Rename failed",p.message),u(t.name)}l(!1)}return s?r.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:[r.jsx("input",{ref:d,value:o,onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&O(),h.key==="Escape"&&(u(t.name),l(!1))},className:"flex-1 min-w-0 h-6 px-1.5 text-sm font-bold bg-surface-0 border border-accent/30 rounded text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent/40",autoFocus:!0}),r.jsx("button",{onClick:O,className:"p-0.5 text-accent hover:text-accent/80 cursor-pointer",children:r.jsx(Dt,{size:12})}),r.jsx("button",{onClick:()=>{u(t.name),l(!1)},className:"p-0.5 text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:12})})]}):r.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0 group",children:[r.jsx("h2",{className:"text-sm font-bold text-text-0 font-sans truncate",children:t.name}),r.jsx("button",{onClick:()=>{u(t.name),l(!0)},className:"p-0.5 text-text-4 opacity-0 group-hover:opacity-100 hover:text-text-1 cursor-pointer transition-opacity",children:r.jsx(Gc,{size:10})})]})}function EZ(){const t=D(p=>p.detailPanel),a=D(p=>p.agents),[s,l]=v.useState("command");if((t==null?void 0:t.type)!=="agent")return null;const o=a.find(p=>p.id===t.agentId);if(!o)return null;const u=o.status==="running"||o.status==="starting",d=Math.round((o.contextUsage||0)*100),O=o.spawnedAt||o.createdAt,h=O?Math.floor((Date.now()-new Date(O).getTime())/1e3):0;return Kb(o.role),r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex-shrink-0",children:[r.jsxs("div",{className:"pl-4 pr-10 pt-3 pb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(AZ,{agent:o}),r.jsx(Xe,{variant:XZ[o.status]||"default",dot:u?"pulse":void 0,className:"text-2xs flex-shrink-0",children:_Z[o.status]||o.status})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1 text-2xs text-text-3 font-mono",children:[r.jsx("span",{className:"capitalize",children:o.role}),r.jsx("span",{className:"text-text-4",children:"·"}),r.jsxs("span",{children:[o.provider,":",o.model||"auto"]}),r.jsx("span",{className:"text-text-4",children:"·"}),r.jsxs("span",{children:[et(o.tokensUsed||0)," tok"]}),d>0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-text-4",children:"·"}),r.jsxs("span",{className:re(d>80?"text-danger":d>60?"text-warning":"text-text-3"),children:[d,"% ctx"]})]}),r.jsx("span",{className:"text-text-4",children:"·"}),r.jsx("span",{children:Dc(h)})]})]}),r.jsx("div",{className:"flex items-center px-4 border-b border-border-subtle",children:ZZ.map(p=>{const x=p.icon,g=s===p.id;return r.jsxs("button",{onClick:()=>l(p.id),className:re("flex items-center gap-1.5 px-3 py-2 text-2xs font-semibold font-sans transition-all cursor-pointer select-none border-b-2 -mb-px",g?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"),children:[r.jsx(x,{size:11}),p.label]},p.id)})})]}),r.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[s==="command"&&r.jsx(kZ,{agent:o}),s==="config"&&r.jsx(TZ,{agent:o}),s==="telemetry"&&r.jsx(RZ,{agent:o}),s==="mdfiles"&&r.jsx(CZ,{agent:o})]})]})}const qZ=[{id:"planner",label:"Planner",desc:"Plans the team and tasks",icon:Db,tier:"Heavy"},{id:"backend",label:"Backend",desc:"APIs, services, databases",icon:Wb,tier:"Medium"},{id:"frontend",label:"Frontend",desc:"UI, components, styling",icon:th,tier:"Medium"},{id:"fullstack",label:"Fullstack",desc:"End-to-end implementation",icon:ns,tier:"Heavy"},{id:"testing",label:"Testing",desc:"Tests, coverage, QA",icon:lh,tier:"Medium"},{id:"devops",label:"DevOps",desc:"CI/CD, infra, deployment",icon:G5,tier:"Medium"},{id:"docs",label:"Docs",desc:"Documentation, guides",icon:Ba,tier:"Light"},{id:"security",label:"Security",desc:"Audits, vulnerabilities",icon:li,tier:"Medium"},{id:"database",label:"Database",desc:"Schema, migrations, queries",icon:H5,tier:"Medium"},{id:"cmo",label:"CMO",desc:"Marketing, content, growth",icon:UT,tier:"Medium"},{id:"cfo",label:"CFO",desc:"Finance, metrics, forecasting",icon:P5,tier:"Medium"},{id:"ea",label:"EA",desc:"Executive assistant, scheduling",icon:AN,tier:"Light"},{id:"support",label:"Support",desc:"Customer support, FAQs",icon:vT,tier:"Medium"},{id:"analyst",label:"Analyst",desc:"Data analysis, insights",icon:Vc,tier:"Medium"},{id:"creative",label:"Writer",desc:"Copy, articles, proposals",icon:nN,tier:"Heavy",skillHint:!0},{id:"slides",label:"Slides",desc:"Pitch decks, presentations",icon:uN,tier:"Heavy",skillHint:!0}];function MZ(){return r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",className:"text-accent flex-shrink-0",children:[r.jsx("circle",{cx:"7",cy:"7",r:"6",fill:"currentColor",fillOpacity:"0.15",stroke:"currentColor",strokeWidth:"1"}),r.jsx("path",{d:"M4.5 7 L6.5 9 L9.5 5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function YZ(){const t=D(E=>E.detailPanel),a=D(E=>E.closeDetail),s=D(E=>E.spawnAgent),l=D(E=>E.fetchProviders),o=(t==null?void 0:t.type)==="spawn",[u,d]=v.useState(""),[O,h]=v.useState(""),[p,x]=v.useState(""),[g,b]=v.useState(""),[y,Q]=v.useState(""),[w,$]=v.useState(""),[j,z]=v.useState([]),[N,_]=v.useState([]),[G,R]=v.useState([]),[X,T]=v.useState(!1),[V,M]=v.useState(""),[ae,F]=v.useState(!1);v.useEffect(()=>{o&&(l().then(E=>{const ce=Array.isArray(E)?E:E.providers||[];z(ce);const ee=ce.filter(be=>be.installed);if(ee.length>0&&!g){const Se=["claude-code","gemini","codex","ollama"].find(ye=>ee.some(Re=>Re.id===ye))||ee[0].id;b(Se)}}).catch(()=>{}),J.get("/skills/installed").then(E=>{_(Array.isArray(E)?E:[])}).catch(()=>{}),d(""),h(""),x(""),b(""),Q(""),$(""),R([]))},[o,l]);const se=u||O,oe=j.find(E=>E.id===g),H=(oe==null?void 0:oe.models)||[],P=j.filter(E=>E.installed);async function W(){if(se){F(!0);try{const E={role:se,...p&&{name:p.replace(/\s+/g,"-")},...g&&{provider:g},...y&&{model:y},...w&&{prompt:w},...G.length>0&&{skills:G}};await s(E),a()}catch{}F(!1)}}return r.jsx(WS,{open:o,onOpenChange:E=>{E||a()},children:r.jsx(BS,{title:"Spawn Agent",width:480,children:r.jsxs("div",{className:"flex flex-col h-[calc(100%-57px)]",children:[r.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-3",children:"Choose Role"}),r.jsx("div",{className:"grid grid-cols-2 gap-2",children:qZ.map(E=>{const ce=Kb(E.id),ee=u===E.id;return r.jsxs("button",{onClick:()=>{d(E.id),h("")},className:re("flex items-center gap-2.5 p-3 rounded-md border text-left transition-all cursor-pointer",ee?"border-accent bg-accent/5":"border-border-subtle bg-surface-1 hover:border-border hover:bg-surface-2"),children:[r.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0",style:{background:ce.bg},children:r.jsx(E.icon,{size:16,style:{color:ce.text}})}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:E.label}),E.skillHint&&r.jsx("span",{className:"text-2xs font-mono text-warning/70 bg-warning/8 px-1 py-px rounded",children:"skill"})]}),r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:E.desc})]})]},E.id)})}),r.jsx("div",{className:"mt-3",children:r.jsx(zf,{placeholder:"or type a custom role (e.g. chat-agent)...",value:O,onChange:E=>{h(E.target.value.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,50)),d("")},className:"text-xs"})})]}),se&&r.jsxs("div",{className:"space-y-4",children:[r.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block",children:"Configuration"}),r.jsx(zf,{label:"Name (optional)",value:p,onChange:E=>x(E.target.value),placeholder:`${se}-1`}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Provider"}),r.jsxs("div",{className:"relative",children:[r.jsxs("select",{value:g,onChange:E=>{b(E.target.value),Q("")},className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[r.jsx("option",{value:"",children:"Auto"}),j.map(E=>r.jsxs("option",{value:E.id,disabled:!E.installed,children:[E.name,E.installed?"":" (not installed)"]},E.id))]}),r.jsx(ca,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Model"}),r.jsxs("div",{className:"relative",children:[r.jsxs("select",{value:y,onChange:E=>Q(E.target.value),disabled:!g,className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-40",children:[r.jsx("option",{value:"",children:"Auto"}),H.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsx(ca,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]})]}),g&&oe&&r.jsx("div",{className:"text-2xs text-text-3 font-sans flex items-center gap-2",children:oe.authType==="local"?r.jsx(Xe,{variant:"success",children:"Local"}):oe.authType==="subscription"?r.jsx(Xe,{variant:"accent",children:"Subscription"}):oe.hasKey?r.jsx(Xe,{variant:"success",children:"API key set"}):r.jsxs(Xe,{variant:"warning",children:["No API key — set with: groove set-key ",g," YOUR_KEY"]})}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Skills"}),r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[G.map(E=>{const ce=N.find(ee=>ee.id===E);return r.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[r.jsx(Ir,{size:9}),(ce==null?void 0:ce.name)||E,r.jsx("button",{onClick:()=>R(ee=>ee.filter(be=>be!==E)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:r.jsx(Qt,{size:9})})]},E)}),r.jsxs("button",{onClick:()=>{T(!0),M("")},className:re("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[r.jsx(Ir,{size:10}),G.length>0?"Add skill":"Attach skill"]})]})]}),r.jsx(GS,{open:X,onOpenChange:T,children:r.jsx(LS,{title:"Select Skill",className:"max-w-sm",children:r.jsxs("div",{className:"space-y-3 p-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(da,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),r.jsx("input",{value:V,onChange:E=>M(E.target.value),placeholder:"Search skills...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),r.jsxs("div",{className:"max-h-64 overflow-y-auto space-y-1",children:[N.filter(E=>{if(!V)return!0;const ce=V.toLowerCase();return(E.name||E.id).toLowerCase().includes(ce)||(E.description||"").toLowerCase().includes(ce)}).map(E=>{const ce=G.includes(E.id);return r.jsxs("button",{onClick:()=>{R(ee=>ce?ee.filter(be=>be!==E.id):[...ee,E.id])},className:re("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors cursor-pointer",ce?"bg-accent/10 border border-accent/25":"hover:bg-surface-3 border border-transparent"),children:[r.jsx(Ir,{size:12,className:ce?"text-accent":"text-text-3"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:E.name||E.id}),E.description&&r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:E.description})]}),ce&&r.jsx(MZ,{})]},E.id)}),N.length===0&&r.jsx("div",{className:"text-center py-6 text-xs text-text-3 font-sans",children:"No skills installed. Visit the Marketplace to install skills."})]})]})})})]})]}),r.jsxs("div",{className:"border-t border-border-subtle px-5 py-4 bg-surface-1",children:[P.length===0&&j.length>0&&r.jsxs("div",{className:"flex items-center gap-2 mb-3 px-3 py-2 rounded-md bg-warning/8 border border-warning/20",children:[r.jsx(gi,{size:13,className:"text-warning flex-shrink-0"}),r.jsx("span",{className:"text-2xs font-sans text-text-2",children:"No AI providers installed. Install Claude Code, Gemini CLI, Codex, or Ollama to spawn agents."})]}),se&&P.length>0&&r.jsxs("div",{className:"flex items-center gap-2 mb-3 text-xs text-text-3 font-sans",children:[r.jsx("span",{children:"Spawning"}),r.jsx(Xe,{variant:"accent",children:se}),g&&r.jsxs("span",{children:["on ",(oe==null?void 0:oe.name)||g]}),p&&r.jsxs("span",{children:["as ",p.replace(/\s+/g,"-")]})]}),r.jsx(ve,{variant:"primary",size:"lg",onClick:W,disabled:!se||ae||P.length===0,className:"w-full",children:ae?"Spawning...":"Spawn Agent"})]})]})})})}function w0({title:t,icon:a,defaultOpen:s=!1,badge:l,children:o,className:u}){const[d,O]=v.useState(s);return r.jsxs("div",{className:re("border-t border-border-subtle",u),children:[r.jsxs("button",{onClick:()=>O(!d),className:"w-full flex items-center gap-2 px-5 py-3 text-left cursor-pointer hover:bg-surface-5/30 transition-colors group",children:[r.jsx(Ll,{size:12,className:re("text-text-4 transition-transform duration-200 flex-shrink-0",d&&"rotate-90")}),a&&r.jsx(a,{size:13,className:"text-text-3 flex-shrink-0"}),r.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:t}),l&&r.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-0.5 rounded",children:l})]}),d&&r.jsx("div",{className:"px-5 pb-4",children:o})]})}function UZ(){const t=D(g=>g.journalistStatus),a=D(g=>g.fetchJournalist),s=D(g=>g.triggerJournalistCycle),[l,o]=v.useState(!0),[u,d]=v.useState(!1);v.useEffect(()=>{a().then(()=>o(!1));const g=setInterval(a,1e4);return()=>clearInterval(g)},[a]);async function O(){d(!0);try{await s()}catch{}d(!1)}if(l)return r.jsxs("div",{className:"p-5 space-y-4",children:[r.jsx(rn,{className:"h-6 w-32 rounded"}),r.jsx(rn,{className:"h-20 rounded-md"}),r.jsx(rn,{className:"h-20 rounded-md"})]});const h=t||{},p=h.lastSynthesis,x=h.history||[];return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"px-5 py-4 border-b border-border-subtle flex items-center gap-2",children:[r.jsx(si,{size:16,className:"text-accent"}),r.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Journalist"}),r.jsxs(ve,{variant:"secondary",size:"sm",onClick:O,disabled:u,className:"gap-1.5 text-2xs",children:[r.jsx(zn,{size:11,className:u?"animate-spin":""}),u?"Running...":"Run Synthesis"]})]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"px-5 py-4 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(pc,{size:10}),r.jsxs("span",{children:[h.cycleCount||0," cycles"]})]}),h.lastCycleTime&&r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(pf,{size:10}),r.jsxs("span",{children:["Last: ",vt(h.lastCycleTime)]})]}),r.jsx(Xe,{variant:h.cycleCount>0?"success":"default",className:"text-2xs",children:h.cycleCount>0?"Active":"Idle"})]}),(p==null?void 0:p.summary)&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[r.jsx(Ba,{size:12,className:"text-text-3"}),"Latest Summary"]}),r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-sans leading-relaxed",children:p.summary})]}),(p==null?void 0:p.projectMap)&&r.jsx(w0,{title:"Project Map",icon:ZT,children:r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:p.projectMap})}),(p==null?void 0:p.decisions)&&r.jsx(w0,{title:"Decisions Log",icon:Ba,children:r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:p.decisions})}),x.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[r.jsx(pf,{size:12,className:"text-text-3"}),"History (",x.length,")"]}),r.jsx("div",{className:"space-y-1.5",children:x.slice().reverse().slice(0,20).map((g,b)=>r.jsxs("div",{className:"bg-surface-0 rounded-md border border-border-subtle px-3 py-2",children:[r.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[r.jsxs(Xe,{variant:"default",className:"text-2xs",children:["Cycle ",g.cycle]}),r.jsxs("span",{className:"text-text-4 font-sans",children:[g.agentCount," agent",g.agentCount!==1?"s":""]}),r.jsx("span",{className:"text-text-4 font-sans ml-auto",children:vt(g.timestamp)})]}),g.summary&&r.jsx("p",{className:"text-xs text-text-2 font-sans mt-1 leading-relaxed",children:g.summary})]},b))})]}),!p&&x.length===0&&r.jsxs("div",{className:"text-center py-8 text-text-4 font-sans",children:[r.jsx(si,{size:28,className:"mx-auto mb-2"}),r.jsx("p",{className:"text-sm",children:"No synthesis data yet"}),r.jsx("p",{className:"text-2xs mt-1",children:"The journalist runs automatically when agents are active, or trigger manually above"})]})]})})]})}function VZ({children:t,height:a,onHeightChange:s,visible:l,fullHeight:o,tabs:u,activeTab:d,onSelectTab:O,onAddTab:h,onCloseTab:p,onToggleFullHeight:x,onMinimize:g}){const b=v.useRef(!1),y=v.useRef(0),Q=v.useRef(0),w=v.useCallback(j=>{if(o)return;j.preventDefault(),b.current=!0,y.current=j.clientY,Q.current=a;function z(_){if(!b.current)return;const G=y.current-_.clientY,R=Math.min(Math.max(Q.current+G,120),600);s(R)}function N(){b.current=!1,document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",N)}document.addEventListener("mousemove",z),document.addEventListener("mouseup",N)},[a,s,o]);if(!l)return null;const $=u||[{id:"default",label:"Terminal"}];return r.jsxs("div",{className:"flex flex-col border-t border-border bg-surface-0 relative",style:o?{flex:1,minHeight:0}:{height:a,flexShrink:0},children:[!o&&r.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-row-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:w}),r.jsxs("div",{className:"flex items-center h-9 bg-surface-1 border-b border-border-subtle flex-shrink-0 pl-3 pr-1.5",children:[r.jsxs("div",{className:"flex items-center gap-0 flex-1 min-w-0 overflow-x-auto scrollbar-none",children:[$.map(j=>r.jsxs("button",{onClick:()=>O==null?void 0:O(j.id),className:re("flex items-center gap-1.5 pl-2.5 pr-1 h-7 text-2xs font-sans cursor-pointer select-none transition-colors flex-shrink-0 rounded-t",j.id===d?"text-text-0 bg-surface-0":"text-text-3 hover:text-text-1 hover:bg-surface-0/50"),children:[r.jsx(xi,{size:10}),r.jsx("span",{className:"truncate max-w-[80px]",children:j.label}),$.length>1&&r.jsx("button",{onClick:z=>{z.stopPropagation(),p==null||p(j.id)},className:"ml-0.5 p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:9})})]},j.id)),r.jsx("button",{onClick:h,className:"flex items-center justify-center w-6 h-6 text-text-4 hover:text-text-1 hover:bg-surface-0/50 rounded cursor-pointer transition-colors flex-shrink-0 ml-0.5",title:"New terminal",children:r.jsx(Ja,{size:11})})]}),r.jsx("div",{className:"flex items-center gap-0.5 flex-shrink-0 ml-2",children:o?r.jsx("button",{onClick:g,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Restore",children:r.jsx(DT,{size:12})}):r.jsx("button",{onClick:x,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Maximize",children:r.jsx(ET,{size:12})})})]}),r.jsx("div",{className:"flex-1 min-h-0 p-2",children:t})]})}const GZ={background:"#1a1e25",foreground:"#bcc2cd",cursor:"#33afbc",cursorAccent:"#1a1e25",selectionBackground:"rgba(51, 175, 188, 0.25)",black:"#1a1e25",red:"#e06c75",green:"#4ae168",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#33afbc",white:"#bcc2cd",brightBlack:"#505862",brightRed:"#e06c75",brightGreen:"#4ae168",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#33afbc",brightWhite:"#e6e6e6"};let sf=0;function LZ({tabId:t,visible:a}){const s=v.useRef(null),l=v.useRef(null),o=v.useRef(null),u=v.useRef(null),d=v.useRef(!1);return v.useEffect(()=>{if(!s.current||d.current)return;d.current=!0;const O=new Kj({theme:GZ,fontFamily:"'JetBrains Mono Variable', 'SF Mono', monospace",fontSize:13,lineHeight:1.4,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,allowProposedApi:!0}),h=new Jj;O.loadAddon(h),O.loadAddon(new ew),O.open(s.current),l.current=O,requestAnimationFrame(()=>h.fit());function p(){const g=D.getState().ws;if(!g||g.readyState!==WebSocket.OPEN){setTimeout(p,500);return}g.send(JSON.stringify({type:"terminal:spawn",cols:O.cols,rows:O.rows}));function b(y){let Q;try{Q=JSON.parse(y.data)}catch{return}Q.type==="terminal:spawned"&&!o.current?o.current=Q.id:Q.type==="terminal:output"&&Q.id===o.current?O.write(Q.data):Q.type==="terminal:exit"&&Q.id===o.current&&(O.write(`\r
|
|
636
|
+
`).length*20),120)}}),r.jsx("button",{onClick:N,disabled:!h.trim()||b,className:re("w-9 h-9 flex items-center justify-center rounded-lg transition-all cursor-pointer flex-shrink-0 mb-px","disabled:opacity-15 disabled:cursor-not-allowed",h.trim()?x==="query"?"bg-info text-white hover:bg-info/85":"bg-accent text-white hover:bg-accent/85":"bg-transparent text-text-4"),children:b?r.jsx(Ka,{size:15,className:"animate-spin"}):r.jsx(ah,{size:15})})]})]})]})}function af({options:t,value:a,onChange:s}){return r.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:t.map(l=>r.jsx("button",{onClick:()=>s(l.value),className:re("flex-1 px-3 py-1.5 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",a===l.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:l.label},l.value))})}function hn({label:t,icon:a,children:s,description:l}){return r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"flex items-center gap-1.5 text-xs font-semibold text-text-1 font-sans",children:[a&&r.jsx(a,{size:13,className:"text-text-3"}),t]}),l&&r.jsx("p",{className:"text-2xs text-text-4 font-sans mt-0.5",children:l})]}),s]})}function $Z({agent:t}){const a=D(Q=>Q.killAgent),s=D(Q=>Q.rotateAgent),l=D(Q=>Q.spawnAgent),o=D(Q=>Q.closeDetail),u=D(Q=>Q.addToast),[d,O]=v.useState(null),[h,p]=v.useState(!1),x=t.status==="running"||t.status==="starting";async function g(){O("rotate");try{await s(t.id)}catch{}O(null)}async function b(){if(!h){p(!0),setTimeout(()=>p(!1),3e3);return}O("kill");try{await a(t.id),o()}catch{}O(null),p(!1)}async function y(){O("clone");try{await l({role:t.role,provider:t.provider,model:t.model,name:`${t.name}-clone`,scope:t.scope,workingDir:t.workingDir}),u("success",`Cloned ${t.name}`)}catch{}O(null)}return x?r.jsx("div",{className:"space-y-2",children:r.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[r.jsxs(ve,{variant:"primary",size:"md",onClick:g,disabled:d==="rotate",className:"gap-1.5",children:[r.jsx(Wl,{size:12,className:d==="rotate"?"animate-spin":""}),"Rotate"]}),r.jsxs(ve,{variant:"info",size:"md",onClick:y,disabled:!!d,className:"gap-1.5",children:[r.jsx(xf,{size:12})," Clone"]}),r.jsxs(ve,{variant:"danger",size:"md",onClick:b,disabled:d==="kill",className:"gap-1.5",children:[r.jsx(sh,{size:12}),h?"Confirm":"Kill"]})]})}):r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs(ve,{variant:"info",size:"md",onClick:y,disabled:!!d,className:"gap-1.5",children:[r.jsx(xf,{size:12})," Clone"]}),r.jsxs(ve,{variant:"danger",size:"md",onClick:b,disabled:d==="kill",className:"gap-1.5",children:[r.jsx(as,{size:12}),h?"Confirm":"Remove"]})]})}function TZ({agent:t}){var Re;const a=D(B=>B.addToast),[s,l]=v.useState([]),[o,u]=v.useState(t.model||""),[d,O]=v.useState(""),[h,p]=v.useState(t.effort||"default"),[x,g]=v.useState(!1),[b,y]=v.useState(""),[Q,w]=v.useState(null),[$,j]=v.useState(!1),[z,N]=v.useState(null),[_,G]=v.useState(t.routingMode||"auto"),[R,X]=v.useState([]),[T,V]=v.useState("hr"),[M,ae]=v.useState("1"),[F,le]=v.useState(!1),oe=t.status==="running"||t.status==="starting";v.useEffect(()=>{H(),J.get("/skills/installed").then(ue=>X(Array.isArray(ue)?ue:ue.skills||[])).catch(()=>{});function B(){H()}return window.addEventListener("groove:providers-changed",B),()=>window.removeEventListener("groove:providers-changed",B)},[]);function H(){J.get("/providers").then(B=>l(Array.isArray(B)?B:[])).catch(()=>{})}v.useEffect(()=>{u(t.model||""),J.get(`/agents/${t.id}/routing/recommend`).then(B=>{G((B==null?void 0:B.mode)||"fixed")}).catch(()=>{})},[t.id,t.model]);const P=s.find(B=>B.id===t.provider);async function W(B,ue){u(ue);try{const Ce={model:ue};B&&B!==t.provider&&(Ce.provider=B),await J.patch(`/agents/${t.id}`,Ce),a("success",`Model → ${ue}${Ce.provider?` (${B})`:""}`)}catch(Ce){a("error","Model swap failed",Ce.message)}}async function E(B){try{await J.patch(`/agents/${t.id}`,{workingDir:B}),a("success",`Working dir → ${B.split("/").pop()||B}`)}catch(ue){a("error","Update failed",ue.message)}}async function ce(B){p(B);try{await J.patch(`/agents/${t.id}`,{effort:B}),a("success",`Effort → ${B}`)}catch(ue){a("error","Update failed",ue.message)}}async function ee(B){if(!B.trim())return;const ue=[...t.scope||[],B.trim()];try{await J.patch(`/agents/${t.id}`,{scope:ue}),O("")}catch(Ce){a("error","Scope update failed",Ce.message)}}async function be(B){const ue=(t.scope||[]).filter((Ce,Ot)=>Ot!==B);try{await J.patch(`/agents/${t.id}`,{scope:ue})}catch(Ce){a("error","Scope update failed",Ce.message)}}async function Se(B){if(b.trim())try{await J.post(`/credentials/${B}`,{key:b.trim()}),a("success",`API key set for ${B}`),y(""),w(null),H(),window.dispatchEvent(new CustomEvent("groove:providers-changed"))}catch(ue){a("error","Failed to set key",ue.message)}}const ye=t.spawnedAt||t.createdAt;return r.jsxs("div",{className:"px-5 py-5 space-y-6 overflow-y-auto h-full",children:[r.jsx(hn,{label:"Active Model",icon:Al,children:r.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-bold font-mono text-text-0",children:t.model||"auto"}),r.jsx("div",{className:"text-2xs text-text-3 font-sans mt-0.5",children:(P==null?void 0:P.name)||t.provider})]}),(P==null?void 0:P.canHotSwap)&&oe&&r.jsxs(Xe,{variant:"accent",className:"text-2xs gap-1",children:[r.jsx(Rn,{size:8})," Hot-swap"]})]}),((Re=P==null?void 0:P.models)==null?void 0:Re.length)>1&&r.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3 pt-3 border-t border-border-subtle",children:P.models.filter(B=>!B.disabled).map(B=>{const ue=B.id===t.model;return r.jsx("button",{onClick:()=>W(t.provider,B.id),disabled:!1,className:re("px-2.5 py-1 rounded-md text-xs font-mono transition-all","cursor-pointer",ue?"bg-accent/15 text-accent font-semibold":"bg-surface-4 text-text-2 hover:bg-surface-5 hover:text-text-0"),children:B.name||B.id},B.id)})})]})}),r.jsx($Z,{agent:t}),r.jsxs(hn,{label:"Providers",icon:a1,description:"Click a provider to see its models and connection status.",children:[r.jsx("div",{className:"space-y-1.5",children:s.map(B=>{const ue=B.id===t.provider,Ce=B.installed||B.hasKey,Ot=z===B.id,Ae=B.models||[];return r.jsxs("div",{className:"rounded-lg border border-border-subtle bg-surface-0 overflow-hidden",children:[r.jsxs("button",{onClick:()=>N(Ot?null:B.id),className:"w-full flex items-center gap-2.5 px-3 py-2 cursor-pointer hover:bg-surface-4/50 transition-colors",children:[r.jsx("div",{className:re("w-2 h-2 rounded-full flex-shrink-0",Ce?"bg-success":"bg-text-4")}),r.jsx("span",{className:re("text-xs font-semibold font-sans flex-1 text-left",Ce?"text-text-0":"text-text-3"),children:B.name||B.id}),ue&&r.jsx(Xe,{variant:"accent",className:"text-2xs",children:"Active"}),!Ce&&r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:B.authType==="local"?"Not installed":"No key"}),r.jsx(ca,{size:12,className:re("text-text-4 transition-transform",Ot&&"rotate-180")})]}),Ot&&B.authType==="local"&&r.jsx("div",{className:"border-t border-border-subtle",children:r.jsx(uS,{isInstalled:Ce,onModelChange:H})}),Ot&&B.authType!=="local"&&r.jsxs("div",{className:"border-t border-border-subtle",children:[(!Ce||B.hasKey)&&r.jsx("div",{className:"px-3 py-2 bg-surface-1/50",children:Q===B.id?r.jsxs("div",{className:"flex gap-1.5",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx("input",{value:b,onChange:He=>y(He.target.value),onKeyDown:He=>He.key==="Enter"&&Se(B.id),type:$?"text":"password",placeholder:`${B.name||B.id} API key...`,className:"w-full h-7 px-2.5 pr-7 text-2xs bg-surface-0 border border-border rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent",autoFocus:!0}),r.jsx("button",{onClick:()=>j(!$),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-4 hover:text-text-2 cursor-pointer",children:$?r.jsx(Kf,{size:10}):r.jsx(Dl,{size:10})})]}),r.jsx(ve,{variant:"primary",size:"sm",onClick:()=>Se(B.id),disabled:!b.trim(),className:"h-7 px-2 text-2xs",children:"Save"}),r.jsx(ve,{variant:"ghost",size:"sm",onClick:()=>{w(null),y("")},className:"h-7 px-2 text-2xs",children:"Cancel"})]}):r.jsxs("button",{onClick:()=>{w(B.id),y(""),j(!1)},className:"flex items-center gap-1.5 text-2xs text-text-3 hover:text-accent font-sans cursor-pointer transition-colors",children:[r.jsx(vc,{size:10}),Ce?"Update API key":"Add API key to enable"]})}),Ce&&Ae.filter(He=>!He.disabled).length>0&&Ae.filter(He=>!He.disabled).map(He=>{const bt=B.id===t.provider&&He.id===t.model;return r.jsxs("button",{onClick:()=>W(B.id,He.id),disabled:!1,className:re("w-full flex items-center gap-2 px-3 py-2 text-left text-xs font-sans transition-colors","border-t border-border-subtle","cursor-pointer hover:bg-surface-4/50",bt?"text-accent":"text-text-2"),children:[bt?r.jsx(Dt,{size:11,className:"text-accent flex-shrink-0"}):r.jsx("div",{className:"w-[11px]"}),r.jsx("span",{className:"font-mono flex-1 truncate",children:He.name||He.id}),r.jsx(Xe,{variant:bt?"accent":"default",className:"text-2xs",children:He.tier})]},He.id)})]})]},B.id)})}),oe&&r.jsxs("div",{className:"flex items-center gap-1.5 text-2xs text-text-3 font-sans mt-1.5",children:[r.jsx(ua,{size:10}),r.jsx("span",{children:"Model changes apply on next rotation or respawn."})]})]}),r.jsx(hn,{label:"Working Directory",icon:ai,description:"The root directory this agent operates in.",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("div",{className:"flex-1 bg-surface-0 rounded-lg px-3 py-2.5 text-sm font-mono text-text-1 border border-border-subtle truncate min-w-0",children:t.workingDir||"Project root"}),r.jsxs(ve,{variant:"secondary",size:"md",onClick:()=>g(!0),className:"gap-1.5 flex-shrink-0",children:[r.jsx(Zb,{size:14})," Browse"]})]})}),r.jsx(hn,{label:"Permission Mode",icon:li,description:"Full Send = no approvals. Agent Approve = Fullstack Manager reviews risky operations.",children:r.jsx(af,{options:[{value:"full",label:"Full Send"},{value:"auto",label:"Agent Approve"}],value:t.permission||"full",onChange:async B=>{try{await J.patch(`/agents/${t.id}`,{permission:B}),a("success",`Permission → ${B==="full"?"Full Send":"Agent Approve"}`)}catch(ue){a("error","Update failed",ue.message)}}})}),r.jsxs(hn,{label:"Model Routing",icon:pc,description:"How Groove selects models for this agent's tasks.",children:[r.jsx(af,{options:[{value:"fixed",label:"Fixed"},{value:"auto",label:"Auto"},{value:"auto-floor",label:"Auto + Floor"}],value:_,onChange:async B=>{G(B);try{await J.post(`/agents/${t.id}/routing`,{mode:B}),a("success",`Routing → ${B}`)}catch(ue){a("error","Update failed",ue.message)}}}),r.jsxs("div",{className:"text-2xs text-text-4 font-sans mt-1",children:[_==="fixed"&&"Uses the selected model for all tasks.",_==="auto"&&"Groove picks Opus/Sonnet/Haiku based on task complexity.",_==="auto-floor"&&"Auto-routes but never drops below Sonnet."]})]}),r.jsx(hn,{label:"File Scope",icon:li,description:"Restrict which files this agent can access. Empty = unrestricted.",children:r.jsxs("div",{className:"flex flex-wrap gap-2",children:[(t.scope||[]).map((B,ue)=>r.jsxs(Xe,{variant:"default",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[B,r.jsx("button",{onClick:()=>be(ue),className:"hover:text-danger cursor-pointer",children:r.jsx(Qt,{size:10})})]},ue)),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("input",{value:d,onChange:B=>O(B.target.value),onKeyDown:B=>B.key==="Enter"&&ee(d),placeholder:"e.g. src/**",className:"w-28 h-7 px-2.5 text-xs bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono placeholder:text-text-4 focus:outline-none focus:ring-1 focus:ring-accent"}),r.jsx("button",{onClick:()=>ee(d),disabled:!d.trim(),className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:r.jsx(Ja,{size:12})})]})]})}),r.jsx(hn,{label:"Effort Level",icon:Eb,description:"Controls how deep the agent reasons. Higher = more tokens but better results.",children:r.jsx(af,{options:[{value:"min",label:"Min"},{value:"low",label:"Low"},{value:"default",label:"Default"},{value:"high",label:"High"},{value:"max",label:"Max"}],value:h,onChange:ce})}),r.jsx(hn,{label:"Agent Details",icon:a1,children:r.jsxs("div",{className:"bg-surface-0 rounded-lg border border-border-subtle divide-y divide-border-subtle",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"ID"}),r.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.id})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Role"}),r.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.role})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Provider"}),r.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.provider})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Model"}),r.jsx("span",{className:"text-xs text-text-1 font-mono",children:t.model||"auto"})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Status"}),r.jsx("span",{className:"text-xs text-text-1 font-sans capitalize",children:t.status})]}),r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Spawned"}),r.jsx("span",{className:"text-xs text-text-1 font-sans",children:ye?vt(ye):"—"})]}),t.sessionId&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[r.jsx("span",{className:"text-xs text-text-3 font-sans",children:"Session"}),r.jsxs("span",{className:"text-xs text-text-1 font-mono",children:[t.sessionId.slice(0,16),"..."]})]})]})}),r.jsx(hn,{label:"Skills",icon:Ir,description:"Attach installed skills to this agent's context.",children:r.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[(t.skills||[]).map(B=>r.jsxs(Xe,{variant:"accent",className:"font-mono text-xs gap-1.5 px-2.5 py-1",children:[B,r.jsx("button",{onClick:async()=>{try{await J.delete(`/agents/${t.id}/skills/${B}`),a("success",`Detached ${B}`)}catch(ue){a("error","Detach failed",ue.message)}},className:"hover:text-danger cursor-pointer",children:r.jsx(Qt,{size:10})})]},B)),R.filter(B=>!(t.skills||[]).includes(B.id)).length>0&&r.jsxs("div",{className:"relative group",children:[r.jsx("button",{className:"w-7 h-7 flex items-center justify-center rounded-md bg-surface-4 border border-border-subtle text-text-3 hover:text-accent cursor-pointer transition-colors",children:r.jsx(Ja,{size:12})}),r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 hidden group-hover:block bg-surface-2 border border-border-subtle rounded-lg shadow-xl py-1 min-w-[160px]",children:R.filter(B=>!(t.skills||[]).includes(B.id)).map(B=>r.jsx("button",{onClick:async()=>{try{await J.post(`/agents/${t.id}/skills/${B.id}`),a("success",`Attached ${B.name||B.id}`)}catch(ue){a("error","Attach failed",ue.message)}},className:"w-full text-left px-3 py-1.5 text-xs font-sans text-text-1 hover:bg-surface-4 cursor-pointer transition-colors",children:B.name||B.id},B.id))})]}),(t.skills||[]).length===0&&R.length===0&&r.jsx("span",{className:"text-2xs text-text-4 font-sans",children:"No skills installed — browse the Marketplace"})]})}),r.jsx(hn,{label:"Schedule",icon:xc,description:"Run this agent on a recurring schedule.",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-text-2 font-sans",children:"Every"}),r.jsx("input",{value:M,onChange:B=>ae(B.target.value.replace(/\D/g,"").slice(0,3)),className:"w-12 h-7 px-2 text-xs text-center bg-surface-0 border border-border-subtle rounded-md text-text-0 font-mono focus:outline-none focus:ring-1 focus:ring-accent",placeholder:"1"}),r.jsx("div",{className:"flex bg-surface-0 rounded-lg p-0.5 border border-border-subtle",children:[{value:"min",label:"Min"},{value:"hr",label:"Hr"},{value:"day",label:"Day"},{value:"wk",label:"Wk"},{value:"mo",label:"Mo"}].map(B=>r.jsx("button",{onClick:()=>V(B.value),className:re("px-2 py-1 text-2xs font-semibold font-sans rounded-md transition-all cursor-pointer",T===B.value?"bg-accent/15 text-accent shadow-sm":"text-text-3 hover:text-text-1"),children:B.label},B.value))}),r.jsxs(ve,{variant:"primary",size:"sm",disabled:F||!M||parseInt(M,10)<1,onClick:async()=>{const B=parseInt(M,10);if(!B||B<1)return;const ue={min:B===1?"* * * * *":`*/${B} * * * *`,hr:B===1?"0 * * * *":`0 */${B} * * *`,day:B===1?"0 0 * * *":`0 0 */${B} * *`,wk:`0 0 * * ${B===1?"1":"*"}`,mo:`0 0 ${B===1?"1":B} * *`};le(!0);try{await J.post("/schedules",{name:`${t.name} schedule`,cron:ue[T],agentConfig:{role:t.role,provider:t.provider,model:t.model,scope:t.scope,workingDir:t.workingDir,prompt:t.prompt}}),a("success",`Scheduled every ${B} ${T}`)}catch(Ce){a("error","Schedule failed",Ce.message)}le(!1)},className:"h-7 px-3 text-2xs gap-1",children:[r.jsx(xc,{size:10}),F?"...":"Set"]})]})}),t.prompt&&r.jsx(hn,{label:"Original Prompt",icon:pc,children:r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3 py-3 text-xs text-text-2 font-sans leading-relaxed max-h-40 overflow-y-auto",children:t.prompt})}),r.jsx(DS,{open:x,onOpenChange:g,currentPath:t.workingDir||"/",onSelect:E})]})}const j0=[];function NZ({data:t,isAlive:a,height:s=48}){const l=v.useRef(null);return v.useEffect(()=>{const o=l.current;if(!o||!t.length)return;const u=o.getContext("2d"),d=window.devicePixelRatio||1,O=o.clientWidth,h=o.clientHeight;o.width=O*d,o.height=h*d,u.scale(d,d),u.clearRect(0,0,O,h);const p=t.map(Q=>Q.v),x=Math.min(...p),b=Math.max(...p,1)-x||1;u.beginPath(),u.moveTo(0,h),t.forEach((Q,w)=>{const $=w/(t.length-1)*O,j=h-(Q.v-x)/b*(h-4)-2;u.lineTo($,j)}),u.lineTo(O,h),u.closePath();const y=u.createLinearGradient(0,0,0,h);if(y.addColorStop(0,a?"rgba(51,175,188,0.15)":"rgba(110,118,129,0.08)"),y.addColorStop(1,"rgba(0,0,0,0)"),u.fillStyle=y,u.fill(),u.beginPath(),u.strokeStyle=a?xe.accent:xe.text3,u.lineWidth=1.5,t.forEach((Q,w)=>{const $=w/(t.length-1)*O,j=h-(Q.v-x)/b*(h-4)-2;w===0?u.moveTo($,j):u.lineTo($,j)}),u.stroke(),t.length>1&&a){const Q=t[t.length-1],w=O-1,$=h-(Q.v-x)/b*(h-4)-2;u.beginPath(),u.arc(w,$,5,0,Math.PI*2),u.fillStyle="rgba(51,175,188,0.3)",u.fill(),u.beginPath(),u.arc(w,$,2.5,0,Math.PI*2),u.fillStyle=xe.accent,u.fill()}},[t,a]),r.jsx("div",{className:"w-full rounded-lg bg-surface-0 overflow-hidden border border-border-subtle",style:{height:s},children:r.jsx("canvas",{ref:l,className:"w-full h-full"})})}function ec({icon:t,label:a,value:s,color:l,sub:o}){return r.jsxs("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 border border-border-subtle",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(t,{size:12,className:l||"text-text-3"}),r.jsx("span",{className:"text-2xs text-text-4 font-sans uppercase tracking-wider",children:a})]}),r.jsx("div",{className:re("text-lg font-bold font-mono tabular-nums",l||"text-text-0"),children:s}),o&&r.jsx("div",{className:"text-2xs text-text-4 font-sans mt-0.5",children:o})]})}function PZ({score:t}){const a=Math.min(Math.max(t,0),100);let s=xe.success,l="Healthy";return a<40?(s=xe.danger,l="Degraded"):a<70&&(s=xe.warning,l="Fair"),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[r.jsxs("span",{className:"text-2xs text-text-3 font-sans flex items-center gap-1.5",children:[r.jsx(ST,{size:11}),"Session Health"]}),r.jsxs("span",{className:"text-xs font-bold font-mono",style:{color:s},children:[a,"/100"]})]}),r.jsx("div",{className:"h-2 bg-surface-0 rounded-full overflow-hidden border border-border-subtle",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${a}%`,background:s}})}),r.jsx("span",{className:"text-2xs font-sans mt-1 block",style:{color:s},children:l})]})}function zZ(t){const a=(t||"").toLowerCase();return a.includes("edit")||a.includes("writ")?{icon:_b,color:"text-warning"}:a.includes("read")||a.includes("view")?{icon:Dl,color:"text-info"}:a.includes("search")||a.includes("grep")||a.includes("glob")?{icon:da,color:"text-purple"}:a.includes("bash")||a.includes("command")||a.includes("terminal")?{icon:xi,color:"text-orange"}:a.includes("error")||a.includes("fail")?{icon:ua,color:"text-danger"}:a.includes("spawn")||a.includes("start")?{icon:Rn,color:"text-success"}:a.includes("complet")||a.includes("done")?{icon:mf,color:"text-success"}:{icon:pf,color:"text-text-4"}}function RZ({agent:t}){const a=D(d=>d.tokenTimeline[t.id])||j0,s=D(d=>d.activityLog[t.id])||j0,l=t.status==="running"||t.status==="starting",o=v.useMemo(()=>{if(a.length<2)return 0;const d=a.slice(-10),O=(d[d.length-1].t-d[0].t)/6e4,h=d[d.length-1].v-d[0].v;return O>0?Math.round(h/O):0},[a]),u=v.useMemo(()=>{const d=t.contextUsage||0;let O=100;return d>90?O-=50:d>70?O-=25:d>50&&(O-=10),o>5e3?O-=15:o>3e3&&(O-=8),t.status==="crashed"&&(O=10),t.status==="completed"&&(O=95),Math.max(0,Math.min(100,O))},[t.contextUsage,t.status,o]);return r.jsxs("div",{className:"px-5 py-5 space-y-5 overflow-y-auto h-full",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider",children:"Token Burn"}),l&&r.jsx("span",{className:"text-2xs text-accent font-mono animate-pulse",children:"LIVE"})]}),r.jsx(NZ,{data:a,isAlive:l,height:56})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsx(ec,{icon:uT,label:"Burn Rate",value:o>0?`${et(o)}/m`:"—",color:o>5e3?"text-danger":o>2e3?"text-warning":"text-text-0"}),r.jsx(ec,{icon:F5,label:"Cost",value:Lc(t.costUsd||0),color:"text-text-0"}),r.jsx(ec,{icon:Wl,label:"Rotations",value:t.rotations||"0",color:"text-text-0"}),r.jsx(ec,{icon:Rn,label:"Turns",value:t.turns||"0",color:"text-text-0"})]}),r.jsx(PZ,{score:u}),t.prompt&&r.jsxs("div",{children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-1.5",children:"Task"}),r.jsx("div",{className:"bg-surface-0 rounded-lg px-3 py-2.5 text-xs text-text-2 font-sans leading-relaxed max-h-28 overflow-y-auto border border-border-subtle",children:t.prompt})]}),s.length>0&&r.jsxs("div",{children:[r.jsx("span",{className:"text-2xs font-semibold text-text-3 font-sans uppercase tracking-wider block mb-2",children:"Activity"}),r.jsxs("div",{className:"space-y-0 relative",children:[r.jsx("div",{className:"absolute left-[9px] top-2 bottom-2 w-px bg-border-subtle"}),s.slice(-12).reverse().map((d,O)=>{const h=zZ(d.text),p=h.icon;return r.jsxs("div",{className:"flex items-start gap-3 py-1.5 relative",children:[r.jsx("div",{className:re("w-[18px] h-[18px] rounded-full flex items-center justify-center flex-shrink-0 z-10","bg-surface-1 border border-border-subtle"),children:r.jsx(p,{size:9,className:h.color})}),r.jsx("span",{className:"text-2xs text-text-2 font-sans flex-1 line-clamp-1 pt-0.5",children:d.text}),r.jsx("span",{className:"text-2xs text-text-4 font-mono flex-shrink-0 pt-0.5",children:vt(d.timestamp)})]},O)})]})]})]})}function CZ({agent:t}){const a=D(z=>z.addToast),[s,l]=v.useState([]),[o,u]=v.useState(""),[d,O]=v.useState(null),[h,p]=v.useState(""),[x,g]=v.useState(""),[b,y]=v.useState(!1);async function Q(){try{const z=await J.get(`/agents/${t.id}/mdfiles`);l(z.files||[]),u(z.workingDir||"")}catch{}}v.useEffect(()=>{Q()},[t.id]);async function w(z){try{const N=await J.get(`/agents/${t.id}/mdfiles/read?path=${encodeURIComponent(z)}`);p(N.content||""),g(N.content||""),O(z)}catch(N){a("error","Failed to read file",N.message)}}async function $(){if(d){y(!0);try{await J.put(`/agents/${t.id}/mdfiles/write`,{path:d,content:h}),g(h),a("success",`Saved ${d}`)}catch(z){a("error","Save failed",z.message)}y(!1)}}const j=h!==x;return d?r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border-subtle",children:[r.jsx("button",{onClick:()=>{O(null),p(""),g("")},className:"p-1 text-text-3 hover:text-text-0 cursor-pointer",children:r.jsx(Cb,{size:14})}),r.jsx(Ba,{size:12,className:"text-accent"}),r.jsx("span",{className:"text-xs text-text-0 font-sans font-medium flex-1 truncate",children:d}),j&&r.jsx("span",{className:"text-[10px] text-warning font-sans",children:"unsaved"}),r.jsxs("button",{onClick:$,disabled:!j||b,className:re("flex items-center gap-1 px-2.5 py-1 rounded text-2xs font-sans font-medium cursor-pointer transition-colors",j?"bg-accent/15 text-accent hover:bg-accent/25":"text-text-4 opacity-50 cursor-not-allowed"),children:[r.jsx(xN,{size:10}),b?"Saving...":"Save"]})]}),r.jsx("textarea",{value:h,onChange:z=>p(z.target.value),className:"flex-1 w-full px-4 py-3 bg-surface-0 text-[12px] font-mono text-text-1 leading-relaxed resize-none focus:outline-none",spellCheck:!1})]}):r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border-subtle",children:[r.jsx(Ba,{size:12,className:"text-text-3"}),r.jsx("span",{className:"text-2xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:"Markdown Files"}),r.jsx("button",{onClick:Q,className:"p-1 text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(zn,{size:11})})]}),o&&r.jsx("div",{className:"px-4 py-1.5 text-[10px] text-text-4 font-mono truncate border-b border-border-subtle/50",children:o}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:s.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-4",children:[r.jsx(Ba,{size:20,className:"text-text-4 mb-2"}),r.jsx("p",{className:"text-xs text-text-3 font-sans",children:"No markdown files found"}),r.jsx("p",{className:"text-[10px] text-text-4 font-sans mt-1",children:"MD files in the agent's working directory will appear here"})]}):r.jsx("div",{className:"py-1",children:s.map(z=>r.jsxs("button",{onClick:()=>w(z.path),className:"w-full flex items-center gap-2.5 px-4 py-2 text-left hover:bg-surface-5 transition-colors cursor-pointer",children:[r.jsx(Ba,{size:13,className:"text-accent flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:"text-xs text-text-0 font-sans block truncate",children:z.name}),r.jsx("span",{className:"text-[10px] text-text-4 font-mono",children:z.path})]}),r.jsx("span",{className:"text-[10px] text-text-4 font-mono flex-shrink-0",children:z.size>1024?`${(z.size/1024).toFixed(1)}K`:`${z.size}B`})]},z.path))})})]})}const XZ={running:"success",starting:"warning",stopped:"default",crashed:"danger",completed:"accent",killed:"default",rotating:"purple"},_Z={running:"Running",starting:"Starting",stopped:"Stopped",crashed:"Crashed",completed:"Done",killed:"Killed",rotating:"Rotating"},ZZ=[{id:"command",label:"Chat",icon:pi},{id:"config",label:"Config",icon:Bb},{id:"telemetry",label:"Monitor",icon:pc},{id:"mdfiles",label:"Files",icon:Ba}];function AZ({agent:t}){const a=D(h=>h.addToast),[s,l]=v.useState(!1),[o,u]=v.useState(t.name),d=v.useRef(null);async function O(){const h=o.trim();if(!h||h===t.name){l(!1);return}try{await J.patch(`/agents/${t.id}`,{name:h.replace(/\s+/g,"-")}),a("success",`Renamed → ${h}`)}catch(p){a("error","Rename failed",p.message),u(t.name)}l(!1)}return s?r.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:[r.jsx("input",{ref:d,value:o,onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&O(),h.key==="Escape"&&(u(t.name),l(!1))},className:"flex-1 min-w-0 h-6 px-1.5 text-sm font-bold bg-surface-0 border border-accent/30 rounded text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent/40",autoFocus:!0}),r.jsx("button",{onClick:O,className:"p-0.5 text-accent hover:text-accent/80 cursor-pointer",children:r.jsx(Dt,{size:12})}),r.jsx("button",{onClick:()=>{u(t.name),l(!1)},className:"p-0.5 text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:12})})]}):r.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0 group",children:[r.jsx("h2",{className:"text-sm font-bold text-text-0 font-sans truncate",children:t.name}),r.jsx("button",{onClick:()=>{u(t.name),l(!0)},className:"p-0.5 text-text-4 opacity-0 group-hover:opacity-100 hover:text-text-1 cursor-pointer transition-opacity",children:r.jsx(Gc,{size:10})})]})}function EZ(){const t=D(p=>p.detailPanel),a=D(p=>p.agents),[s,l]=v.useState("command");if((t==null?void 0:t.type)!=="agent")return null;const o=a.find(p=>p.id===t.agentId);if(!o)return null;const u=o.status==="running"||o.status==="starting",d=Math.round((o.contextUsage||0)*100),O=o.spawnedAt||o.createdAt,h=O?Math.floor((Date.now()-new Date(O).getTime())/1e3):0;return Kb(o.role),r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"flex-shrink-0",children:[r.jsxs("div",{className:"pl-4 pr-10 pt-3 pb-2",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(AZ,{agent:o}),r.jsx(Xe,{variant:XZ[o.status]||"default",dot:u?"pulse":void 0,className:"text-2xs flex-shrink-0",children:_Z[o.status]||o.status})]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1 text-2xs text-text-3 font-mono",children:[r.jsx("span",{className:"capitalize",children:o.role}),r.jsx("span",{className:"text-text-4",children:"·"}),r.jsxs("span",{children:[o.provider,":",o.model||"auto"]}),r.jsx("span",{className:"text-text-4",children:"·"}),r.jsxs("span",{children:[et(o.tokensUsed||0)," tok"]}),d>0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-text-4",children:"·"}),r.jsxs("span",{className:re(d>80?"text-danger":d>60?"text-warning":"text-text-3"),children:[d,"% ctx"]})]}),r.jsx("span",{className:"text-text-4",children:"·"}),r.jsx("span",{children:Dc(h)})]})]}),r.jsx("div",{className:"flex items-center px-4 border-b border-border-subtle",children:ZZ.map(p=>{const x=p.icon,g=s===p.id;return r.jsxs("button",{onClick:()=>l(p.id),className:re("flex items-center gap-1.5 px-3 py-2 text-2xs font-semibold font-sans transition-all cursor-pointer select-none border-b-2 -mb-px",g?"border-accent text-text-0":"border-transparent text-text-3 hover:text-text-1"),children:[r.jsx(x,{size:11}),p.label]},p.id)})})]}),r.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[s==="command"&&r.jsx(kZ,{agent:o}),s==="config"&&r.jsx(TZ,{agent:o}),s==="telemetry"&&r.jsx(RZ,{agent:o}),s==="mdfiles"&&r.jsx(CZ,{agent:o})]})]})}const qZ=[{id:"planner",label:"Planner",desc:"Plans the team and tasks",icon:Db,tier:"Heavy"},{id:"backend",label:"Backend",desc:"APIs, services, databases",icon:Wb,tier:"Medium"},{id:"frontend",label:"Frontend",desc:"UI, components, styling",icon:th,tier:"Medium"},{id:"fullstack",label:"Fullstack",desc:"End-to-end implementation",icon:ns,tier:"Heavy"},{id:"testing",label:"Testing",desc:"Tests, coverage, QA",icon:lh,tier:"Medium"},{id:"devops",label:"DevOps",desc:"CI/CD, infra, deployment",icon:G5,tier:"Medium"},{id:"docs",label:"Docs",desc:"Documentation, guides",icon:Ba,tier:"Light"},{id:"security",label:"Security",desc:"Audits, vulnerabilities",icon:li,tier:"Medium"},{id:"database",label:"Database",desc:"Schema, migrations, queries",icon:H5,tier:"Medium"},{id:"cmo",label:"CMO",desc:"Marketing, content, growth",icon:UT,tier:"Medium"},{id:"cfo",label:"CFO",desc:"Finance, metrics, forecasting",icon:P5,tier:"Medium"},{id:"ea",label:"EA",desc:"Executive assistant, scheduling",icon:AN,tier:"Light"},{id:"support",label:"Support",desc:"Customer support, FAQs",icon:vT,tier:"Medium"},{id:"analyst",label:"Analyst",desc:"Data analysis, insights",icon:Vc,tier:"Medium"},{id:"creative",label:"Writer",desc:"Copy, articles, proposals",icon:nN,tier:"Heavy",skillHint:!0},{id:"slides",label:"Slides",desc:"Pitch decks, presentations",icon:uN,tier:"Heavy",skillHint:!0}];function MZ(){return r.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",className:"text-accent flex-shrink-0",children:[r.jsx("circle",{cx:"7",cy:"7",r:"6",fill:"currentColor",fillOpacity:"0.15",stroke:"currentColor",strokeWidth:"1"}),r.jsx("path",{d:"M4.5 7 L6.5 9 L9.5 5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function YZ(){const t=D(E=>E.detailPanel),a=D(E=>E.closeDetail),s=D(E=>E.spawnAgent),l=D(E=>E.fetchProviders),o=(t==null?void 0:t.type)==="spawn",[u,d]=v.useState(""),[O,h]=v.useState(""),[p,x]=v.useState(""),[g,b]=v.useState(""),[y,Q]=v.useState(""),[w,$]=v.useState(""),[j,z]=v.useState([]),[N,_]=v.useState([]),[G,R]=v.useState([]),[X,T]=v.useState(!1),[V,M]=v.useState(""),[ae,F]=v.useState(!1);v.useEffect(()=>{o&&(l().then(E=>{const ce=Array.isArray(E)?E:E.providers||[];z(ce);const ee=ce.filter(be=>be.installed);if(ee.length>0&&!g){const Se=["claude-code","gemini","codex","ollama"].find(ye=>ee.some(Re=>Re.id===ye))||ee[0].id;b(Se)}}).catch(()=>{}),J.get("/skills/installed").then(E=>{_(Array.isArray(E)?E:[])}).catch(()=>{}),d(""),h(""),x(""),b(""),Q(""),$(""),R([]))},[o,l]);const le=u||O,oe=j.find(E=>E.id===g),H=(oe==null?void 0:oe.models)||[],P=j.filter(E=>E.installed);async function W(){if(le){F(!0);try{const E={role:le,...p&&{name:p.replace(/\s+/g,"-")},...g&&{provider:g},...y&&{model:y},...w&&{prompt:w},...G.length>0&&{skills:G}};await s(E),a()}catch{}F(!1)}}return r.jsx(WS,{open:o,onOpenChange:E=>{E||a()},children:r.jsx(BS,{title:"Spawn Agent",width:480,children:r.jsxs("div",{className:"flex flex-col h-[calc(100%-57px)]",children:[r.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-6",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block mb-3",children:"Choose Role"}),r.jsx("div",{className:"grid grid-cols-2 gap-2",children:qZ.map(E=>{const ce=Kb(E.id),ee=u===E.id;return r.jsxs("button",{onClick:()=>{d(E.id),h("")},className:re("flex items-center gap-2.5 p-3 rounded-md border text-left transition-all cursor-pointer",ee?"border-accent bg-accent/5":"border-border-subtle bg-surface-1 hover:border-border hover:bg-surface-2"),children:[r.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0",style:{background:ce.bg},children:r.jsx(E.icon,{size:16,style:{color:ce.text}})}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs font-semibold text-text-0 font-sans",children:E.label}),E.skillHint&&r.jsx("span",{className:"text-2xs font-mono text-warning/70 bg-warning/8 px-1 py-px rounded",children:"skill"})]}),r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:E.desc})]})]},E.id)})}),r.jsx("div",{className:"mt-3",children:r.jsx(zf,{placeholder:"or type a custom role (e.g. chat-agent)...",value:O,onChange:E=>{h(E.target.value.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").slice(0,50)),d("")},className:"text-xs"})})]}),le&&r.jsxs("div",{className:"space-y-4",children:[r.jsx("label",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider block",children:"Configuration"}),r.jsx(zf,{label:"Name (optional)",value:p,onChange:E=>x(E.target.value),placeholder:`${le}-1`}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Provider"}),r.jsxs("div",{className:"relative",children:[r.jsxs("select",{value:g,onChange:E=>{b(E.target.value),Q("")},className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent",children:[r.jsx("option",{value:"",children:"Auto"}),j.map(E=>r.jsxs("option",{value:E.id,disabled:!E.installed,children:[E.name,E.installed?"":" (not installed)"]},E.id))]}),r.jsx(ca,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Model"}),r.jsxs("div",{className:"relative",children:[r.jsxs("select",{value:y,onChange:E=>Q(E.target.value),disabled:!g,className:"w-full h-8 px-3 pr-8 text-sm rounded-md bg-surface-1 border border-border text-text-0 font-sans appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-accent disabled:opacity-40",children:[r.jsx("option",{value:"",children:"Auto"}),H.map(E=>r.jsx("option",{value:E.id,children:E.name},E.id))]}),r.jsx(ca,{size:14,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-3 pointer-events-none"})]})]})]}),g&&oe&&r.jsx("div",{className:"text-2xs text-text-3 font-sans flex items-center gap-2",children:oe.authType==="local"?r.jsx(Xe,{variant:"success",children:"Local"}):oe.authType==="subscription"?r.jsx(Xe,{variant:"accent",children:"Subscription"}):oe.hasKey?r.jsx(Xe,{variant:"success",children:"API key set"}):r.jsxs(Xe,{variant:"warning",children:["No API key — set with: groove set-key ",g," YOUR_KEY"]})}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-text-2 font-sans",children:"Skills"}),r.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[G.map(E=>{const ce=N.find(ee=>ee.id===E);return r.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded bg-accent/12 text-accent border border-accent/25 text-2xs font-sans",children:[r.jsx(Ir,{size:9}),(ce==null?void 0:ce.name)||E,r.jsx("button",{onClick:()=>R(ee=>ee.filter(be=>be!==E)),className:"ml-0.5 hover:text-text-0 cursor-pointer",children:r.jsx(Qt,{size:9})})]},E)}),r.jsxs("button",{onClick:()=>{T(!0),M("")},className:re("inline-flex items-center gap-1.5 px-2.5 py-1 rounded text-2xs font-sans transition-colors cursor-pointer","bg-surface-0 text-text-2 border border-border-subtle hover:border-border hover:text-text-0"),children:[r.jsx(Ir,{size:10}),G.length>0?"Add skill":"Attach skill"]})]})]}),r.jsx(GS,{open:X,onOpenChange:T,children:r.jsx(LS,{title:"Select Skill",className:"max-w-sm",children:r.jsxs("div",{className:"space-y-3 p-4",children:[r.jsxs("div",{className:"relative",children:[r.jsx(da,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-text-4"}),r.jsx("input",{value:V,onChange:E=>M(E.target.value),placeholder:"Search skills...",autoFocus:!0,className:"w-full h-8 pl-8 pr-3 text-xs rounded-md bg-surface-0 border border-border text-text-0 font-sans focus:outline-none focus:ring-1 focus:ring-accent"})]}),r.jsxs("div",{className:"max-h-64 overflow-y-auto space-y-1",children:[N.filter(E=>{if(!V)return!0;const ce=V.toLowerCase();return(E.name||E.id).toLowerCase().includes(ce)||(E.description||"").toLowerCase().includes(ce)}).map(E=>{const ce=G.includes(E.id);return r.jsxs("button",{onClick:()=>{R(ee=>ce?ee.filter(be=>be!==E.id):[...ee,E.id])},className:re("w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors cursor-pointer",ce?"bg-accent/10 border border-accent/25":"hover:bg-surface-3 border border-transparent"),children:[r.jsx(Ir,{size:12,className:ce?"text-accent":"text-text-3"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-text-0 font-sans truncate",children:E.name||E.id}),E.description&&r.jsx("div",{className:"text-2xs text-text-3 font-sans truncate",children:E.description})]}),ce&&r.jsx(MZ,{})]},E.id)}),N.length===0&&r.jsx("div",{className:"text-center py-6 text-xs text-text-3 font-sans",children:"No skills installed. Visit the Marketplace to install skills."})]})]})})})]})]}),r.jsxs("div",{className:"border-t border-border-subtle px-5 py-4 bg-surface-1",children:[P.length===0&&j.length>0&&r.jsxs("div",{className:"flex items-center gap-2 mb-3 px-3 py-2 rounded-md bg-warning/8 border border-warning/20",children:[r.jsx(gi,{size:13,className:"text-warning flex-shrink-0"}),r.jsx("span",{className:"text-2xs font-sans text-text-2",children:"No AI providers installed. Install Claude Code, Gemini CLI, Codex, or Ollama to spawn agents."})]}),le&&P.length>0&&r.jsxs("div",{className:"flex items-center gap-2 mb-3 text-xs text-text-3 font-sans",children:[r.jsx("span",{children:"Spawning"}),r.jsx(Xe,{variant:"accent",children:le}),g&&r.jsxs("span",{children:["on ",(oe==null?void 0:oe.name)||g]}),p&&r.jsxs("span",{children:["as ",p.replace(/\s+/g,"-")]})]}),r.jsx(ve,{variant:"primary",size:"lg",onClick:W,disabled:!le||ae||P.length===0,className:"w-full",children:ae?"Spawning...":"Spawn Agent"})]})]})})})}function w0({title:t,icon:a,defaultOpen:s=!1,badge:l,children:o,className:u}){const[d,O]=v.useState(s);return r.jsxs("div",{className:re("border-t border-border-subtle",u),children:[r.jsxs("button",{onClick:()=>O(!d),className:"w-full flex items-center gap-2 px-5 py-3 text-left cursor-pointer hover:bg-surface-5/30 transition-colors group",children:[r.jsx(Ll,{size:12,className:re("text-text-4 transition-transform duration-200 flex-shrink-0",d&&"rotate-90")}),a&&r.jsx(a,{size:13,className:"text-text-3 flex-shrink-0"}),r.jsx("span",{className:"text-xs font-semibold text-text-2 font-sans uppercase tracking-wider flex-1",children:t}),l&&r.jsx("span",{className:"text-2xs font-mono text-text-4 bg-surface-4 px-1.5 py-0.5 rounded",children:l})]}),d&&r.jsx("div",{className:"px-5 pb-4",children:o})]})}function UZ(){const t=D(g=>g.journalistStatus),a=D(g=>g.fetchJournalist),s=D(g=>g.triggerJournalistCycle),[l,o]=v.useState(!0),[u,d]=v.useState(!1);v.useEffect(()=>{a().then(()=>o(!1));const g=setInterval(a,1e4);return()=>clearInterval(g)},[a]);async function O(){d(!0);try{await s()}catch{}d(!1)}if(l)return r.jsxs("div",{className:"p-5 space-y-4",children:[r.jsx(rn,{className:"h-6 w-32 rounded"}),r.jsx(rn,{className:"h-20 rounded-md"}),r.jsx(rn,{className:"h-20 rounded-md"})]});const h=t||{},p=h.lastSynthesis,x=h.history||[];return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"px-5 py-4 border-b border-border-subtle flex items-center gap-2",children:[r.jsx(si,{size:16,className:"text-accent"}),r.jsx("h3",{className:"text-sm font-semibold text-text-0 font-sans flex-1",children:"Journalist"}),r.jsxs(ve,{variant:"secondary",size:"sm",onClick:O,disabled:u,className:"gap-1.5 text-2xs",children:[r.jsx(zn,{size:11,className:u?"animate-spin":""}),u?"Running...":"Run Synthesis"]})]}),r.jsx(fa,{className:"flex-1",children:r.jsxs("div",{className:"px-5 py-4 space-y-5",children:[r.jsxs("div",{className:"flex items-center gap-3 text-2xs text-text-3 font-sans",children:[r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(pc,{size:10}),r.jsxs("span",{children:[h.cycleCount||0," cycles"]})]}),h.lastCycleTime&&r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx(pf,{size:10}),r.jsxs("span",{children:["Last: ",vt(h.lastCycleTime)]})]}),r.jsx(Xe,{variant:h.cycleCount>0?"success":"default",className:"text-2xs",children:h.cycleCount>0?"Active":"Idle"})]}),(p==null?void 0:p.summary)&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[r.jsx(Ba,{size:12,className:"text-text-3"}),"Latest Summary"]}),r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-sans leading-relaxed",children:p.summary})]}),(p==null?void 0:p.projectMap)&&r.jsx(w0,{title:"Project Map",icon:ZT,children:r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:p.projectMap})}),(p==null?void 0:p.decisions)&&r.jsx(w0,{title:"Decisions Log",icon:Ba,children:r.jsx("div",{className:"bg-surface-0 rounded-lg border border-border-subtle px-3.5 py-3 text-xs text-text-2 font-mono leading-relaxed max-h-64 overflow-y-auto whitespace-pre-wrap",children:p.decisions})}),x.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"text-xs font-semibold text-text-1 font-sans flex items-center gap-1.5",children:[r.jsx(pf,{size:12,className:"text-text-3"}),"History (",x.length,")"]}),r.jsx("div",{className:"space-y-1.5",children:x.slice().reverse().slice(0,20).map((g,b)=>r.jsxs("div",{className:"bg-surface-0 rounded-md border border-border-subtle px-3 py-2",children:[r.jsxs("div",{className:"flex items-center gap-2 text-2xs",children:[r.jsxs(Xe,{variant:"default",className:"text-2xs",children:["Cycle ",g.cycle]}),r.jsxs("span",{className:"text-text-4 font-sans",children:[g.agentCount," agent",g.agentCount!==1?"s":""]}),r.jsx("span",{className:"text-text-4 font-sans ml-auto",children:vt(g.timestamp)})]}),g.summary&&r.jsx("p",{className:"text-xs text-text-2 font-sans mt-1 leading-relaxed",children:g.summary})]},b))})]}),!p&&x.length===0&&r.jsxs("div",{className:"text-center py-8 text-text-4 font-sans",children:[r.jsx(si,{size:28,className:"mx-auto mb-2"}),r.jsx("p",{className:"text-sm",children:"No synthesis data yet"}),r.jsx("p",{className:"text-2xs mt-1",children:"The journalist runs automatically when agents are active, or trigger manually above"})]})]})})]})}function VZ({children:t,height:a,onHeightChange:s,visible:l,fullHeight:o,tabs:u,activeTab:d,onSelectTab:O,onAddTab:h,onCloseTab:p,onToggleFullHeight:x,onMinimize:g}){const b=v.useRef(!1),y=v.useRef(0),Q=v.useRef(0),w=v.useCallback(j=>{if(o)return;j.preventDefault(),b.current=!0,y.current=j.clientY,Q.current=a;function z(_){if(!b.current)return;const G=y.current-_.clientY,R=Math.min(Math.max(Q.current+G,120),600);s(R)}function N(){b.current=!1,document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",N)}document.addEventListener("mousemove",z),document.addEventListener("mouseup",N)},[a,s,o]);if(!l)return null;const $=u||[{id:"default",label:"Terminal"}];return r.jsxs("div",{className:"flex flex-col border-t border-border bg-surface-0 relative",style:o?{flex:1,minHeight:0}:{height:a,flexShrink:0},children:[!o&&r.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-row-resize hover:bg-accent/30 transition-colors z-10",onMouseDown:w}),r.jsxs("div",{className:"flex items-center h-9 bg-surface-1 border-b border-border-subtle flex-shrink-0 pl-3 pr-1.5",children:[r.jsxs("div",{className:"flex items-center gap-0 flex-1 min-w-0 overflow-x-auto scrollbar-none",children:[$.map(j=>r.jsxs("button",{onClick:()=>O==null?void 0:O(j.id),className:re("flex items-center gap-1.5 pl-2.5 pr-1 h-7 text-2xs font-sans cursor-pointer select-none transition-colors flex-shrink-0 rounded-t",j.id===d?"text-text-0 bg-surface-0":"text-text-3 hover:text-text-1 hover:bg-surface-0/50"),children:[r.jsx(xi,{size:10}),r.jsx("span",{className:"truncate max-w-[80px]",children:j.label}),$.length>1&&r.jsx("button",{onClick:z=>{z.stopPropagation(),p==null||p(j.id)},className:"ml-0.5 p-0.5 rounded hover:bg-surface-5 text-text-4 hover:text-text-1 cursor-pointer",children:r.jsx(Qt,{size:9})})]},j.id)),r.jsx("button",{onClick:h,className:"flex items-center justify-center w-6 h-6 text-text-4 hover:text-text-1 hover:bg-surface-0/50 rounded cursor-pointer transition-colors flex-shrink-0 ml-0.5",title:"New terminal",children:r.jsx(Ja,{size:11})})]}),r.jsx("div",{className:"flex items-center gap-0.5 flex-shrink-0 ml-2",children:o?r.jsx("button",{onClick:g,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Restore",children:r.jsx(DT,{size:12})}):r.jsx("button",{onClick:x,className:"p-1.5 rounded text-text-3 hover:text-text-0 hover:bg-surface-5 cursor-pointer transition-colors",title:"Maximize",children:r.jsx(ET,{size:12})})})]}),r.jsx("div",{className:"flex-1 min-h-0 p-2",children:t})]})}const GZ={background:"#1a1e25",foreground:"#bcc2cd",cursor:"#33afbc",cursorAccent:"#1a1e25",selectionBackground:"rgba(51, 175, 188, 0.25)",black:"#1a1e25",red:"#e06c75",green:"#4ae168",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#33afbc",white:"#bcc2cd",brightBlack:"#505862",brightRed:"#e06c75",brightGreen:"#4ae168",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#33afbc",brightWhite:"#e6e6e6"};let sf=0;function LZ({tabId:t,visible:a}){const s=v.useRef(null),l=v.useRef(null),o=v.useRef(null),u=v.useRef(null),d=v.useRef(!1);return v.useEffect(()=>{if(!s.current||d.current)return;d.current=!0;const O=new Kj({theme:GZ,fontFamily:"'JetBrains Mono Variable', 'SF Mono', monospace",fontSize:13,lineHeight:1.4,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,allowProposedApi:!0}),h=new Jj;O.loadAddon(h),O.loadAddon(new ew),O.open(s.current),l.current=O,requestAnimationFrame(()=>h.fit());function p(){const g=D.getState().ws;if(!g||g.readyState!==WebSocket.OPEN){setTimeout(p,500);return}g.send(JSON.stringify({type:"terminal:spawn",cols:O.cols,rows:O.rows}));function b(y){let Q;try{Q=JSON.parse(y.data)}catch{return}Q.type==="terminal:spawned"&&!o.current?o.current=Q.id:Q.type==="terminal:output"&&Q.id===o.current?O.write(Q.data):Q.type==="terminal:exit"&&Q.id===o.current&&(O.write(`\r
|
|
637
637
|
\x1B[90m[session ended]\x1B[0m\r
|
|
638
638
|
`),o.current=null)}g.addEventListener("message",b),u.current={ws:g,handler:b},O.onData(y=>{const Q=D.getState().ws;(Q==null?void 0:Q.readyState)===WebSocket.OPEN&&o.current&&Q.send(JSON.stringify({type:"terminal:input",id:o.current,data:y}))}),O.onResize(({cols:y,rows:Q})=>{const w=D.getState().ws;(w==null?void 0:w.readyState)===WebSocket.OPEN&&o.current&&w.send(JSON.stringify({type:"terminal:resize",id:o.current,rows:Q,cols:y}))})}p();const x=new ResizeObserver(()=>{requestAnimationFrame(()=>{try{h.fit()}catch{}})});return x.observe(s.current),()=>{x.disconnect();const g=D.getState().ws;(g==null?void 0:g.readyState)===WebSocket.OPEN&&o.current&&g.send(JSON.stringify({type:"terminal:kill",id:o.current})),u.current&&u.current.ws.removeEventListener("message",u.current.handler),O.dispose(),d.current=!1}},[]),v.useEffect(()=>{a&&l.current&&requestAnimationFrame(()=>{var O,h,p,x,g;try{(g=(x=(p=(h=(O=l.current._addonManager)==null?void 0:O._addons)==null?void 0:h[0])==null?void 0:p.instance)==null?void 0:x.fit)==null||g.call(x)}catch{}})},[a]),r.jsx("div",{ref:s,className:"w-full h-full",style:{display:a?"block":"none"}})}function DZ(){const t=D(b=>b.terminalVisible),a=D(b=>b.terminalHeight),s=D(b=>b.setTerminalVisible),l=D(b=>b.setTerminalHeight),o=D(b=>b.terminalFullHeight),u=D(b=>b.setTerminalFullHeight),[d,O]=v.useState([{id:"term-0",label:"Terminal"}]),[h,p]=v.useState("term-0"),x=v.useCallback(()=>{sf++;const b=`term-${sf}`;O(y=>[...y,{id:b,label:`Terminal ${sf+1}`}]),p(b)},[]),g=v.useCallback(b=>{O(y=>{const Q=y.filter(w=>w.id!==b);if(Q.length===0)return s(!1),y;if(h===b){const w=y.findIndex(j=>j.id===b),$=Q[Math.min(w,Q.length-1)];p($.id)}return Q})},[h,s]);return r.jsx(VZ,{visible:t,height:a,onHeightChange:l,fullHeight:o,tabs:d,activeTab:h,onSelectTab:p,onAddTab:x,onCloseTab:g,onToggleFullHeight:()=>u(!0),onMinimize:()=>u(!1),children:d.map(b=>r.jsx(LZ,{tabId:b.id,visible:b.id===h},b.id))})}class WZ extends Ga.Component{constructor(a){super(a),this.state={error:null}}static getDerivedStateFromError(a){return{error:a}}render(){return this.state.error?r.jsxs("div",{className:"h-screen bg-surface-0 p-10 font-sans",children:[r.jsx("h2",{className:"text-lg font-semibold text-text-0 mb-4",children:"Groove — Render Error"}),r.jsx("pre",{className:"text-sm text-danger whitespace-pre-wrap mb-4",children:this.state.error.message}),r.jsx("pre",{className:"text-xs text-text-3 whitespace-pre-wrap",children:this.state.error.stack}),r.jsx("button",{onClick:()=>this.setState({error:null}),className:"mt-6 px-4 py-2 bg-accent text-surface-0 rounded-md font-medium text-sm cursor-pointer",children:"Try Again"})]}):this.props.children}}function BZ(){const t=D(o=>o.activeView),a=D(o=>o.detailPanel);let s;switch(t){case"agents":s=r.jsx(i1,{});break;case"editor":s=r.jsx(NC,{});break;case"dashboard":s=r.jsx(pX,{});break;case"marketplace":s=r.jsx(XX,{});break;case"teams":s=r.jsx(qX,{});break;case"models":s=r.jsx(mZ,{});break;case"settings":s=r.jsx(rZ,{});break;default:s=r.jsx(i1,{})}let l=null;if(a)switch(a.type){case"agent":l=r.jsx(EZ,{});break;case"journalist":l=r.jsx(UZ,{});break;case"spawn":l=null;break}return r.jsxs(cP,{detailContent:l,terminalContent:r.jsx(DZ,{}),children:[s,r.jsx(YZ,{})]})}function HZ(){return r.jsxs("div",{className:"h-screen bg-surface-0 flex flex-col items-center justify-center gap-4",children:[r.jsx("img",{src:"/favicon.png",alt:"",className:"w-10 h-10 opacity-60 animate-pulse"}),r.jsx("p",{className:"text-sm text-text-3 font-sans",children:"Connecting..."})]})}function IZ(){const t=D(s=>s.connect),a=D(s=>s.hydrated);return v.useEffect(()=>{t()},[t]),a?r.jsx(WZ,{children:r.jsx(BZ,{})}):r.jsx(HZ,{})}lw.createRoot(document.getElementById("root")).render(r.jsx(v.StrictMode,{children:r.jsx(IZ,{})}));
|