@mrpatronz/nexusflow 2.10.0 → 2.10.2
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/README.md +5 -0
- package/desktop/assets/icon.png +0 -0
- package/dist/agent/ClaudeCliAdapter.d.ts +2 -2
- package/dist/agent/ClaudeCliAdapter.d.ts.map +1 -1
- package/dist/agent/ClaudeCliAdapter.js +6 -4
- package/dist/agent/ClaudeCliAdapter.js.map +1 -1
- package/dist/agent/CliAdapterBase.d.ts.map +1 -1
- package/dist/agent/CliAdapterBase.js +8 -1
- package/dist/agent/CliAdapterBase.js.map +1 -1
- package/dist/agent/cliAvailability.d.ts +2 -5
- package/dist/agent/cliAvailability.d.ts.map +1 -1
- package/dist/agent/cliAvailability.js +6 -41
- package/dist/agent/cliAvailability.js.map +1 -1
- package/dist/agent/session.d.ts +5 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +8 -0
- package/dist/agent/session.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +40 -0
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/desktop.d.ts +2 -0
- package/dist/commands/desktop.d.ts.map +1 -1
- package/dist/commands/desktop.js +102 -31
- package/dist/commands/desktop.js.map +1 -1
- package/dist/core/workspace.d.ts +10 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +21 -4
- package/dist/core/workspace.js.map +1 -1
- package/dist/core/worktree.d.ts +10 -4
- package/dist/core/worktree.d.ts.map +1 -1
- package/dist/core/worktree.js +34 -47
- package/dist/core/worktree.js.map +1 -1
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +0 -1
- package/dist/generators/base.js.map +1 -1
- package/dist/gui/assets/AgentsPage-DbivhmK0.js +3 -0
- package/dist/gui/assets/DashboardPage-D50Qrm3e.js +1 -0
- package/dist/gui/assets/{GettingStartedPage-BKeuSHZQ.js → GettingStartedPage-1MOTng3B.js} +1 -1
- package/dist/gui/assets/{NullStore-DuSDhGOe.js → NullStore-tdPen1kp.js} +1 -1
- package/dist/gui/assets/ProjectsPage-srKgf7VN.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-CP0yn5mw.js +1 -0
- package/dist/gui/assets/SettingsPage-DWmrLV8o.js +1 -0
- package/dist/gui/assets/SkillsPage-CKjTXdrd.js +6 -0
- package/dist/gui/assets/StartWorkPage-BCUnJ9k8.js +1 -0
- package/dist/gui/assets/{StrategiesPage-BRQMly_d.js → StrategiesPage-CdCbbIu-.js} +2 -2
- package/dist/gui/assets/WorkroomsPage-BcT-mGtT.js +4 -0
- package/dist/gui/assets/WorkspacesPage-CYFCm-7_.js +2 -0
- package/dist/gui/assets/{alert-dialog-BHEUQVyS.js → alert-dialog-u7qgb9Hq.js} +1 -1
- package/dist/gui/assets/badge-DwXvB44H.js +1 -0
- package/dist/gui/assets/chunk-BV7QT456-DfUBKG-z.js +3 -0
- package/dist/gui/assets/index-3tD_IeyQ.js +55 -0
- package/dist/gui/assets/index-CK5YRfPV.css +2 -0
- package/dist/gui/assets/tabs-BrHKp5bD.js +1 -0
- package/dist/gui/assets/{useAriaLabelledBy-BmJErI5a.js → useAriaLabelledBy-C4zV-1Ra.js} +1 -1
- package/dist/gui/assets/{vsc-eMRaEwN3.js → vsc-D80c4gBT.js} +1 -1
- package/dist/gui/index.html +5 -8
- package/dist/orchestration/runner.d.ts.map +1 -1
- package/dist/orchestration/runner.js +28 -10
- package/dist/orchestration/runner.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +116 -10
- package/dist/server.js.map +1 -1
- package/dist/utils/repo-freshness.d.ts +106 -0
- package/dist/utils/repo-freshness.d.ts.map +1 -0
- package/dist/utils/repo-freshness.js +405 -0
- package/dist/utils/repo-freshness.js.map +1 -0
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +23 -8
- package/dist/utils/session-finder.js.map +1 -1
- package/dist/utils/terminal-launch.d.ts +4 -2
- package/dist/utils/terminal-launch.d.ts.map +1 -1
- package/dist/utils/terminal-launch.js +26 -16
- package/dist/utils/terminal-launch.js.map +1 -1
- package/dist/utils/user-paths.d.ts +23 -0
- package/dist/utils/user-paths.d.ts.map +1 -0
- package/dist/utils/user-paths.js +126 -0
- package/dist/utils/user-paths.js.map +1 -0
- package/package.json +6 -2
- package/dist/gui/assets/AgentsPage-CnXzZFo1.js +0 -3
- package/dist/gui/assets/DashboardPage-rm3hKgsw.js +0 -1
- package/dist/gui/assets/ProjectsPage-CioaA4uf.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-DKZ1rPmE.js +0 -1
- package/dist/gui/assets/Separator-BgWyHDtg.js +0 -1
- package/dist/gui/assets/SettingsPage-BevO8oge.js +0 -1
- package/dist/gui/assets/SkillsPage-D2stJRWy.js +0 -6
- package/dist/gui/assets/StartWorkPage-C8a6eN90.js +0 -1
- package/dist/gui/assets/WorkroomsPage-KqBkRD-x.js +0 -4
- package/dist/gui/assets/WorkspacesPage-DcA2i5HN.js +0 -2
- package/dist/gui/assets/badge-DTBzXOWn.js +0 -1
- package/dist/gui/assets/index-BB4BuHBQ.css +0 -2
- package/dist/gui/assets/index-BTe-_1Mu.js +0 -57
- package/dist/gui/assets/isElementDisabled-BrwmCB1d.js +0 -1
- package/dist/gui/assets/menu-d_G9km1-.js +0 -1
- package/dist/gui/assets/tabs-BHwTt4t1.js +0 -1
- package/dist/gui/assets/useValueChanged-WS99hTmm.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,c as n,g as r,h as i,i as a,l as o,m as s,p as c,t as l}from"./button-CREn1mup.js";import{A as u,C as d,F as f,Gn as p,Gt as m,H as h,Ht as g,I as _,J as v,Kn as y,L as b,M as x,Mn as S,N as C,O as w,P as T,R as E,Vn as D,Wt as O,X as k,Xt as A,Y as j,Yn as M,Yt as N,Z as P,_ as F,_n as I,at as L,bn as R,cn as z,g as ee,in as B,j as te,k as V,n as H,nn as ne,nt as re,q as ie,qn as ae,qt as oe,sn as U,t as W,tt as se,v as ce,yt as le,z as ue}from"./badge-DTBzXOWn.js";import{a as de,c as fe,d as pe,f as me,l as he,n as G,o as ge,p as _e,r as ve,t as ye,u as be}from"./menu-d_G9km1-.js";import{t as K}from"./chevron-down-B_Mwbim8.js";import{n as xe,r as Se,t as Ce}from"./shield-check-Dd1Yv3l2.js";import{t as we}from"./code-xml-DH-38Tt7.js";import{a as Te,i as Ee,n as De,r as Oe,t as ke}from"./square-check-big-BSIiYXPI.js";import{t as Ae}from"./git-branch-Ce0I2663.js";import{t as je}from"./layers-j_brOuoa.js";import{a as Me,i as Ne,n as Pe,o as Fe,r as Ie,t as Le}from"./tabs-BHwTt4t1.js";import{t as Re}from"./trash-2-CMdv3eD3.js";import{_ as ze,a as Be,d as Ve,f as He,g as Ue,l as We,n as Ge,o as Ke,s as qe,u as Je}from"./isElementDisabled-BrwmCB1d.js";import{i as Ye,n as Xe,r as Ze}from"./NullStore-DuSDhGOe.js";import{d as Qe,o as $e,t as et}from"./brand-hHByyyzq.js";import{$t as tt,At as nt,B as rt,Bt as it,Ct as at,D as ot,E as st,Ft as ct,Gt as lt,It as ut,Jt as dt,Kt as ft,Mt as pt,O as mt,Qt as ht,Rt as gt,U as _t,Ut as vt,V as yt,Vt as bt,Wt as xt,X as St,Xt as Ct,Y as wt,Yt as Tt,Z as Et,Zt as Dt,a as Ot,an as kt,b as At,bt as jt,c as Mt,ct as Nt,d as q,en as J,et as Pt,f as Y,i as Ft,in as It,it as Lt,k as Rt,l as zt,n as Bt,nn as X,nt as Vt,o as Ht,on as Ut,qt as Wt,r as Gt,rn as Kt,rt as qt,s as Jt,sn as Yt,st as Xt,t as Zt,u as Qt,xt as $t,z as en,zt as tn}from"./index-BTe-_1Mu.js";import{t as Z}from"./card-yrg6ov8B.js";import{n as nn,t as rn}from"./vsc-eMRaEwN3.js";var an=i(`brain`,[[`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`}]]),on=i(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),sn=i(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),cn=i(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),ln=i(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]]),un=i(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),dn=i(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),fn=i(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),pn=i(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),mn=i(`layout-dashboard`,[[`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`}]]),hn=i(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),gn=i(`list-todo`,[[`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`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),_n=i(`milestone`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M12 3v3`,key:`1n5kay`}],[`path`,{d:`M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z`,key:`8gz4t4`}]]),vn=i(`puzzle`,[[`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`}]]),yn=i(`radio`,[[`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`}]]),bn=i(`rotate-cw`,[[`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`}]]),xn=i(`save`,[[`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`}]]),Sn=i(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Cn=i(`user`,[[`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`}]]),Q=t(e(),1);function wn(e){let{popupElement:t,positionerElement:n,content:r,mounted:i,onMeasureLayout:a,onMeasureLayoutComplete:s,side:c,direction:l}=e,u=m(t,!0),d=oe(),f=Q.useRef(null),p=Q.useRef(!0),h=Q.useRef(o),g=z(a),_=z(s),v=Q.useMemo(()=>Tn(c,l),[c,l]);U(()=>{if(!i){h.current=o,p.current=!0,f.current=null;return}if(!t||!n)return;h.current=Dn(t,v),On(t,`auto`);let e=En(t,`position`,`static`),r=En(t,`transform`,`none`),a=En(t,`scale`,`1`),s=Dn(n,{"--available-width":`max-content`,"--available-height":`max-content`});function c(){e(),r(),s()}function l(){c(),a()}if(g?.(),p.current||f.current===null){kn(n,`max-content`);let e=Me(t);return f.current=e,kn(n,e),l(),_?.(null,e),p.current=!1,()=>{h.current(),h.current=o}}kn(n,`max-content`);let m=f.current,y=Me(t);f.current=y,On(t,m),l(),_?.(m,y),kn(n,y);let b=new AbortController;return d.request(()=>{On(t,y),u(()=>{t.style.setProperty(`--popup-width`,`auto`),t.style.setProperty(`--popup-height`,`auto`)},b.signal)}),()=>{b.abort(),d.cancel(),h.current(),h.current=o}},[r,t,n,u,d,i,g,_,v])}function Tn(e,t){let r=e===`top`,i=e===`left`||e===(t===`rtl`?`inline-end`:`inline-start`);return!r&&!i?n:{position:`absolute`,[r?`bottom`:`top`]:`0`,[i?`right`:`left`]:`0`}}function En(e,t,n){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}function Dn(e,t){let n=[];for(let[r,i]of Object.entries(t))n.push(En(e,r,i));return n.length?()=>{n.forEach(e=>e())}:o}function On(e,t){let n=t===`auto`?`auto`:`${t.width}px`,r=t===`auto`?`auto`:`${t.height}px`;e.style.setProperty(`--popup-width`,n),e.style.setProperty(`--popup-height`,r)}function kn(e,t){let n=t===`max-content`?`max-content`:`${t.width}px`,r=t===`max-content`?`max-content`:`${t.height}px`;e.style.setProperty(`--positioner-width`,n),e.style.setProperty(`--positioner-height`,r)}var An={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=I(i),l=c.getComputedStyle(i);if(l.transitionDuration===`0s`||l.transitionDuration===``)return{x:t,y:n,data:Je};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=B(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=ze(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Je.sideX,g=f===`top`?`bottom`:Je.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}},jn=t(M(),1),$=r(),Mn={activationDirection:e=>e?{"data-activation-direction":e}:null};function Nn(e){let{store:t,side:n,children:r}=e,i=F(),a=t.useState(`activeTriggerElement`),o=t.useState(`activeTriggerId`),s=t.useState(`open`),c=t.useState(`payload`),l=t.useState(`mounted`),u=t.useState(`popupElement`),d=t.useState(`positionerElement`),f=Ge(s?a:null),p=Ln(o,c),h=Q.useRef(null),[g,_]=Q.useState(null),[v,y]=Q.useState(null),b=Q.useRef(null),x=Q.useRef(null),S=m(b,!0),C=oe(),w=Q.useRef(null),[T,E]=Q.useState(null),[D,O]=Q.useState(!1);U(()=>(t.set(`adaptiveOrigin`,An),()=>{t.set(`adaptiveOrigin`,void 0)}),[t]);let k=z(()=>{b.current?.style.setProperty(`animation`,`none`),b.current?.style.setProperty(`transition`,`none`),x.current?.style.setProperty(`display`,`none`)}),A=z(e=>{b.current?.style.removeProperty(`animation`),b.current?.style.removeProperty(`transition`),x.current?.style.removeProperty(`display`),e&&E(e)}),j=z(()=>{w.current?.abort();let e=new AbortController;w.current=e,S(()=>{_(null),E(null),h.current=null},e.signal)}),M=Q.useRef(null);U(()=>{(!s||!l)&&(M.current=null)},[s,l]),U(()=>{if(a&&f&&a!==f&&M.current!==a&&h.current){_(h.current),O(!0);let e=In(f,a);y(e),M.current=a}},[a,f]),U(()=>{g!=null&&(w.current?.abort(),O(!0),C.request(()=>{jn.flushSync(()=>{O(!1)}),j()}))},[p,g,j,C]),U(()=>{let e=b.current;if(!e)return;let t=B(e).createElement(`div`);for(let n of Array.from(e.childNodes))t.appendChild(n.cloneNode(!0));h.current=t});let N=g!=null,P;P=N?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(`div`,{"data-previous":!0,inert:ce(!0),ref:x,style:{...T?{"--popup-width":`${T.width}px`,"--popup-height":`${T.height}px`}:null,position:`absolute`},"data-ending-style":D?void 0:``},`previous`),(0,$.jsx)(`div`,{"data-current":!0,ref:b,"data-starting-style":D?``:void 0,children:r},p)]}):(0,$.jsx)(`div`,{"data-current":!0,ref:b,children:r},p),U(()=>{let e=x.current;!e||!g||e.replaceChildren(...Array.from(g.childNodes))},[g]),wn({popupElement:u,positionerElement:d,mounted:l,content:c,onMeasureLayout:k,onMeasureLayoutComplete:A,side:n,direction:i});let I={activationDirection:Pn(v),transitioning:N};return{children:P,state:I}}function Pn(e){if(e)return`${Fn(e.horizontal,5,`right`,`left`)} ${Fn(e.vertical,5,`down`,`up`)}`}function Fn(e,t,n,r){return e>t?n:e<-t?r:``}function In(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:n.left+n.width/2,y:n.top+n.height/2},a={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:a.x-i.x,vertical:a.y-i.y}}function Ln(e,t){let[n,r]=Q.useState(0),i=Q.useRef(e),a=Q.useRef(t),o=Q.useRef(!1);return U(()=>{let n=i.current,s=a.current,c=e!==n,l=t!==s;c?(r(e=>e+1),o.current=!l):o.current&&l&&(r(e=>e+1),o.current=!1),i.current=e,a.current=t},[e,t]),`${e??`current`}-${n}`}var Rn=Q.createContext(void 0);function zn(e){let t=Q.useContext(Rn);if(t===void 0&&!e)throw Error(c(47));return t}var Bn={...Ye,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Vn=class extends h{constructor(e,t,n){let r=new w;super(Hn(e,r,t,n),Un(r),Bn)}setOpen=(e,t)=>{let n=t.reason===D,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=te(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};C(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),jn.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Hn(e,t,n,r=!1){let i={...Xe(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i.floatingRootContext=Ze(t,n,r),i}function Un(e){return{popupRef:Q.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),stickIfOpenTimeout:new g,triggerElements:e}}function Wn({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,d=Kn(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});d.useControlledProp(`openProp`,n),d.useControlledProp(`triggerIdProp`,c);let p=d.useState(`open`),m=d.useState(`mounted`),h=d.useState(`payload`);d.useContextCallback(`onOpenChange`,i),d.useContextCallback(`onOpenChangeComplete`,a),E(d,p),T(d);let{forceUnmount:g}=f(p,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o}),Q.useEffect(()=>{p||d.context.stickIfOpenTimeout.clear()},[d,p]),Q.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,N(S))}),[g,d]);let _=p||m;return(0,$.jsxs)(Rn.Provider,{value:d,children:[s&&(0,$.jsx)(u,{handle:s,store:d}),_&&(0,$.jsx)(qn,{store:d,modal:o}),typeof t==`function`?t({payload:h}):t]})}function Gn(e){return zn(!0)?(0,$.jsx)(Wn,{props:e}):(0,$.jsx)(k,{children:(0,$.jsx)(Wn,{props:e})})}function Kn(e,t){let n=b((e,n)=>new Vn(t,e,n));return Q.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function qn({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=ie(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return _(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var Jn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,handle:l,payload:u,openOnHover:d=!1,delay:f=300,closeDelay:p=0,id:m,...h}=e,g=zn(!0),_=pe(l)??g;if(!_)throw Error(c(74));let v=A(m),b=_.useState(`isTriggerActive`,v),x=_.useState(`floatingRootContext`),S=_.useState(`isOpenedByTrigger`,v),C=_.useState(`triggerPopupId`,v),w=Q.useRef(null),{registerTrigger:T,isMountedByThisTrigger:E}=ue(v,w,_,{payload:u,disabled:o,openOnHover:d,closeDelay:p}),D=_.useState(`openChangeReason`),O=_.useState(`stickIfOpen`),k=_.useState(`openMethod`),j=_.useState(`focusManagerModal`),M=he(x,{enabled:!o&&d&&(k!==`touch`||D!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:fe(),restMs:f,delay:{close:p},triggerElementRef:w,isActiveTrigger:b,isClosing:()=>_.select(`transitionStatus`)===`ending`}),N=Ue(x,{stickIfOpen:O}),P=Be(()=>_.select(`open`),e=>{_.set(`openMethod`,e)}),F=_.useState(`triggerProps`,E),{getButtonProps:I,buttonRef:L}=ne({disabled:o,native:s}),R={open(e){return e&&D===`trigger-press`?y.open(e):ae.open(e)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:ee,handleFocusTargetFocus:B}=ge(_,w),te=a(`button`,e,{state:{disabled:o,open:S},ref:[L,t,T,w],props:[N.reference,M,F,P,{[re]:``,id:v,"aria-haspopup":`dialog`,"aria-expanded":S,"aria-controls":C},h,I],stateAttributesMapping:R}),V=(0,$.jsx)(Q.Fragment,{children:te},v);return E&&!j?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(le,{ref:z,onFocus:ee}),V,(0,$.jsx)(le,{ref:_.context.triggerFocusTargetRef,onFocus:B})]}):V}),Yn=Q.createContext(void 0);function Xn(){let e=Q.useContext(Yn);if(e===void 0)throw Error(c(45));return e}var Zn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return zn().useState(`mounted`)||n?(0,$.jsx)(Yn.Provider,{value:n,children:(0,$.jsx)(se,{ref:t,...r})}):null}),Qn=Q.createContext(void 0);function $n(){let e=Q.useContext(Qn);if(!e)throw Error(c(46));return e}var er=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=L,...v}=e,y=zn(),b=Xn(),x=P(),S=y.useState(`floatingRootContext`),C=y.useState(`mounted`),w=y.useState(`open`),T=y.useState(`openChangeReason`),E=y.useState(`activeTriggerElement`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`positionerElement`),A=y.useState(`instantType`),M=y.useState(`transitionStatus`),N=y.useState(`adaptiveOrigin`),F=Q.useRef(null),I=m(k),R=We({anchor:a,floatingRootContext:S,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:h,disableAnchorTracking:g,keepMounted:b,nodeId:x,collisionAvoidance:_,adaptiveOrigin:N}),z=S.useState(`domReferenceElement`);U(()=>{let e=z,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return I(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[z,I,y]);let B=D===!0&&T!==`trigger-hover`;Ke(w&&B,O===`touch`,k,E);let te=y.useStateSetter(`positionerElement`),V={open:w,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:A},H=qe(e,V,{styles:R.positionerStyles,transitionStatus:M,props:v,refs:[t,te],hidden:!C,inert:!w});return(0,$.jsxs)(Qn.Provider,{value:R,children:[C&&B&&(0,$.jsx)(ee,{inert:ce(!w),cutout:E}),(0,$.jsx)(j,{id:x,children:H})]})}),tr=Q.createContext(void 0);function nr(){let[e,t]=Q.useState(0),n=z(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:Q.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var rr=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:o,finalFocus:s,...c}=e,l=zn(),u=$n(),f=He(!0)!=null,{context:m,hasClosePart:h}=nr(),g=l.useState(`open`),_=l.useState(`openMethod`),y=l.useState(`instantType`),b=l.useState(`transitionStatus`),S=l.useState(`popupProps`),C=l.useState(`titleElementId`),w=l.useState(`descriptionElementId`),T=l.useState(`modal`),E=l.useState(`mounted`),D=l.useState(`openChangeReason`),k=l.useState(`activeTriggerElement`),A=l.useState(`floatingRootContext`),j=A.useState(`floatingId`),M=l.useState(`disabled`),N=l.useState(`openOnHover`),P=l.useState(`closeDelay`);O({open:g,ref:l.context.popupRef,onComplete(){g&&l.context.onOpenChangeComplete?.(!0)}}),be(A,{enabled:N&&!M,closeDelay:P});let F=o===void 0?x(l.context.popupRef):o,I=T!==!1&&h;l.useSyncedValue(`focusManagerModal`,I);let L=l.useStateSetter(`popupElement`),z={open:g,side:u.side,align:u.align,instant:y,transitionStatus:b},ee=a(`div`,e,{state:z,ref:[t,l.context.popupRef,L],props:[S,{id:j,role:`dialog`,...V,"aria-labelledby":C,"aria-describedby":w,onKeyDown(e){f&&d.has(e.key)&&e.stopPropagation()}},Ve(b),c],stateAttributesMapping:p});return(0,$.jsx)(v,{context:A,openInteractionType:_,modal:I,disabled:!E||D===`trigger-hover`,initialFocus:F,returnFocus:s,restoreFocus:`popup`,previousFocusableElement:R(k)?k:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:(0,$.jsx)(tr.Provider,{value:m,children:ee})})}),ir=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,children:o,...s}=e,c=zn(),{side:l}=$n(),u=c.useState(`instantType`),{children:d,state:f}=Nn({store:c,side:l,children:o}),p={activationDirection:f.activationDirection,transitioning:f.transitioning,instant:u};return a(`div`,e,{state:p,ref:t,props:[s,{children:d}],stateAttributesMapping:Mn})}),ar=Gn;function or({className:e,children:t,...n}){return(0,$.jsx)(Jn,{className:e,"data-slot":`popover-trigger`,...n,children:t})}function sr({children:e,className:t,viewportClassName:n,side:r=`bottom`,align:i=`center`,sideOffset:a=4,alignOffset:o=0,tooltipStyle:c=!1,anchor:l,...u}){return(0,$.jsx)(Zn,{children:(0,$.jsx)(er,{align:i,alignOffset:o,anchor:l,className:`z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,"data-slot":`popover-positioner`,side:r,sideOffset:a,children:(0,$.jsx)(rr,{className:s(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 outline-none transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] has-data-[slot=calendar]:rounded-xl has-data-[slot=calendar]:before:rounded-[calc(var(--radius-xl)-1px)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,c&&`w-fit text-balance rounded-md text-xs shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]`,t),"data-slot":`popover-popup`,...u,children:(0,$.jsx)(ir,{className:s(`relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) py-4 [--viewport-inline-padding:--spacing(4)] has-data-[slot=calendar]:p-2 data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,c?`py-1 [--viewport-inline-padding:--spacing(2)]`:`not-data-transitioning:overflow-y-auto`,n),"data-slot":`popover-viewport`,children:e})})})})}function cr({repos:e,disabled:t,onAdd:n}){let[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(``),s=(0,Q.useMemo)(()=>{let t=a.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,a]);return(0,$.jsxs)(ar,{open:r,onOpenChange:e=>{e&&o(``),i(e)},children:[(0,$.jsx)(or,{render:(0,$.jsxs)(l,{variant:`outline`,size:`sm`,disabled:t,className:`h-8 text-xs text-muted-foreground`,children:[(0,$.jsx)(lt,{size:14}),` Add repository`]})}),(0,$.jsxs)(sr,{align:`end`,className:`w-[320px]`,viewportClassName:`p-0`,children:[(0,$.jsx)(`div`,{className:`border-b border-border p-2`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(vt,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(H,{autoFocus:!0,value:a,onChange:e=>o(e.target.value),placeholder:`Search repositories`,className:`pl-8`,"aria-label":`Search repositories`})]})}),(0,$.jsx)(`div`,{role:`listbox`,className:`max-h-64 overflow-y-auto py-1`,children:s.length===0?(0,$.jsx)(`div`,{className:`px-3 py-4 text-center text-sm text-muted-foreground`,children:`No repositories found.`}):s.map(e=>(0,$.jsxs)(`button`,{role:`option`,"aria-selected":!1,onClick:()=>{i(!1),n(e.path)},className:`flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-accent`,children:[(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,$.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.path})]}),(0,$.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]},e.path))})]})]})}var lr=(e,t)=>{switch(e){case`antigravity`:return`agy --conversation ${t}`;case`claude`:return`claude --resume ${t}`;case`codex`:return`codex resume ${t}`;case`copilot`:return`copilot --resume ${t}`;default:return`agy --conversation ${t}`}},ur=e=>{switch(e){case`antigravity`:return(0,$.jsx)(`span`,{className:`grid size-5.5 place-items-center rounded-md bg-card border border-border/80 shadow-2xs p-0.5 shrink-0`,title:`Google Antigravity`,children:(0,$.jsx)(jt,{className:`size-3.5`})});case`claude`:return(0,$.jsx)(`span`,{className:`grid size-5.5 place-items-center rounded-md bg-[#D97757] text-white font-bold text-[9px] shadow-2xs shrink-0`,title:`Claude Code`,children:(0,$.jsx)($t,{className:`size-2.5`})});case`codex`:return(0,$.jsx)(`span`,{className:`grid size-5.5 place-items-center rounded-md bg-foreground text-background font-bold text-[9px] shadow-2xs shrink-0`,title:`OpenAI Codex`,children:(0,$.jsx)(nt,{className:`size-2.5`})});case`copilot`:return(0,$.jsx)(`span`,{className:`grid size-5.5 place-items-center rounded-md bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white font-bold text-[9px] shadow-2xs shrink-0`,title:`GitHub Copilot`,children:(0,$.jsx)(at,{className:`size-2.5`})});default:return null}},dr=e=>{if(!e)return``;let t=new Date(e);return isNaN(t.getTime())?``:new Date().toDateString()===t.toDateString()?`Today ${t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}`:`${t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})} ${t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}`},fr=({ws:e,sessions:t,sessionsLoading:n,setActiveSession:r,setTranscript:i,fetchSessionTranscript:a,handleOpenDesktopSession:o,showToast:c})=>{let u=Pt(),d=en(),f=mt(),p=f.data?.find(e=>e.name===`antigravity`)?.detected??!0,m=!!f.data?.find(e=>e.name===`claude`)?.detected,h=!!f.data?.find(e=>e.name===`codex`)?.detected,g=!!f.data?.find(e=>e.name===`copilot`)?.command,_=!!u.data?.some(e=>e.id===`antigravity`&&e.available),v=!!u.data?.some(e=>e.id===`codex-desktop`&&e.available),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(null),[D,O]=(0,Q.useState)(`created-desc`),[k,A]=(0,Q.useState)(`harness`),[j,M]=(0,Q.useState)(``),[N,P]=(0,Q.useState)(`all`),[F,I]=(0,Q.useState)({antigravity:!1,claude:!1,codex:!1,copilot:!1}),L=e=>{I(t=>({...t,[e]:!t[e]}))},R=(0,Q.useRef)(!1),z=(0,Q.useRef)(null),ee=async t=>{try{await Xt(`/api/workspace/${encodeURIComponent(e.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t})}),c?.(`Launched ${t===`claude-desktop`?`Claude Desktop`:t===`codex-desktop`?`Codex Desktop`:t} for workspace ${e.branchName}`,`success`)}catch(e){let t=e instanceof Error?e.message:`Failed to launch desktop application`;c?.(t,`error`)}},B=async t=>{if(!C){w(t);try{await d.mutateAsync({workspaceId:e.branchName,assistant:t}),E({assistant:t,cmd:t===`antigravity`?`agy`:t===`claude`?`claude`:t===`codex`?`codex`:`copilot`,timestamp:new Date}),c?.(`Started new ${t} session in terminal`,`success`)}catch(e){let t=e instanceof Error?e.message:`Failed to launch terminal`;c?.(t,`error`)}finally{w(null)}}},te=async(t,n)=>{if(!R.current){R.current=!0,S(t);try{await d.mutateAsync({workspaceId:e.branchName,sessionId:t,assistant:n});let r=lr(n,t);E({assistant:n,cmd:r,timestamp:new Date}),c?.(`Resumed ${n} session in terminal`,`success`)}catch{let e=lr(n,t);await Mt(e),c?.(`Copied resume command to clipboard: ${e}`,`info`)}finally{S(null),R.current=!1}}},V=async t=>{if(!(!v||z.current)){z.current=t,b(t);try{await o(e,t,`codex`)}finally{z.current=null,b(null)}}},H=(e,t)=>[...e].sort((e,n)=>{switch(t){case`created-desc`:{let t=new Date(e.createdAt||e.updatedAt||0).getTime();return new Date(n.createdAt||n.updatedAt||0).getTime()-t}case`created-asc`:return new Date(e.createdAt||e.updatedAt||0).getTime()-new Date(n.createdAt||n.updatedAt||0).getTime();case`updated-desc`:{let t=new Date(e.updatedAt||e.createdAt||0).getTime();return new Date(n.updatedAt||n.createdAt||0).getTime()-t}case`messages-desc`:return(n.messageCount||0)-(e.messageCount||0);case`title-asc`:return(e.title||``).localeCompare(n.title||``);default:return 0}}),ne=(0,Q.useMemo)(()=>{let e=t;if(N!==`all`&&(e=e.filter(e=>e.assistant===N)),j.trim()){let t=j.toLowerCase();e=e.filter(e=>`${e.title} ${e.id} ${e.assistant}`.toLowerCase().includes(t))}return H(e,D)},[t,N,j,D]),re=(0,Q.useMemo)(()=>H(t.filter(e=>e.assistant===`antigravity`),D),[t,D]),ie=(0,Q.useMemo)(()=>H(t.filter(e=>e.assistant===`claude`),D),[t,D]),ae=(0,Q.useMemo)(()=>H(t.filter(e=>e.assistant===`codex`),D),[t,D]),oe=(0,Q.useMemo)(()=>H(t.filter(e=>e.assistant===`copilot`),D),[t,D]),U=(0,Q.useCallback)(t=>e.assistants?.includes(t)??!1,[e.assistants]),W=(0,Q.useMemo)(()=>[{id:`antigravity`,name:`Google Antigravity`,cliCommand:`agy`,isDetected:p,isConfigured:U(`antigravity`),hasApp:_,appName:`IDE`,appTargetId:`antigravity`,sessions:re,icon:(0,$.jsx)(`span`,{className:`grid size-6 place-items-center rounded-md bg-card border border-border/80 shadow-2xs p-0.5`,children:(0,$.jsx)(jt,{className:`size-4`})})},{id:`claude`,name:`Claude Code`,cliCommand:`claude`,isDetected:m,isConfigured:U(`claude`),hasApp:!1,appName:`App`,appTargetId:`claude`,sessions:ie,icon:(0,$.jsx)(`span`,{className:`grid size-6 place-items-center rounded-md bg-[#D97757] text-white font-bold text-[10px] shadow-2xs`,children:(0,$.jsx)($t,{className:`size-3`})})},{id:`codex`,name:`OpenAI Codex`,cliCommand:`codex`,isDetected:h,isConfigured:U(`codex`),hasApp:v,appName:`Desktop`,appTargetId:`codex-desktop`,sessions:ae,icon:(0,$.jsx)(`span`,{className:`grid size-6 place-items-center rounded-md bg-foreground text-background font-bold text-[10px] shadow-2xs`,children:(0,$.jsx)(nt,{className:`size-3`})})},{id:`copilot`,name:`GitHub Copilot`,cliCommand:`copilot`,isDetected:g,isConfigured:U(`copilot`),hasApp:!1,appName:`App`,appTargetId:`copilot`,sessions:oe,icon:(0,$.jsx)(`span`,{className:`grid size-6 place-items-center rounded-md bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white font-bold text-[10px] shadow-2xs`,children:(0,$.jsx)(at,{className:`size-3`})})}],[p,m,h,g,_,v,U,re,ie,ae,oe]),se=(0,Q.useMemo)(()=>W.filter(e=>e.isDetected||e.sessions.length>0),[W]);return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between bg-card/60 p-2 rounded-md border border-border/80`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`relative flex-1 min-w-0 max-w-xs`,children:[(0,$.jsx)(vt,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 size-3 text-muted-foreground`}),(0,$.jsx)(`input`,{type:`text`,value:j,onChange:e=>M(e.target.value),placeholder:`Search chat sessions...`,className:`w-full pl-7 pr-6 py-1 text-xs rounded border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary`}),j&&(0,$.jsx)(`button`,{type:`button`,onClick:()=>M(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground text-[10px] cursor-pointer`,children:`✕`})]}),(0,$.jsxs)(`div`,{className:`hidden md:flex items-center gap-1`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:()=>P(`all`),className:s(`px-2 py-0.5 text-[11px] rounded font-medium transition-colors cursor-pointer`,N===`all`?`bg-primary text-primary-foreground font-semibold shadow-2xs`:`bg-muted/60 text-muted-foreground hover:text-foreground hover:bg-muted`),children:[`All (`,t.length,`)`]}),se.map(e=>{let t=e.sessions.length;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>P(N===e.id?`all`:e.id),className:s(`px-2 py-0.5 text-[11px] rounded font-medium capitalize transition-colors cursor-pointer`,N===e.id?`bg-primary text-primary-foreground font-semibold shadow-2xs`:`bg-muted/60 text-muted-foreground hover:text-foreground hover:bg-muted`),children:[e.name.replace(`Google `,``).replace(`OpenAI `,``).replace(`GitHub `,``),` (`,t,`)`]},e.id)})]}),n&&(0,$.jsx)(`span`,{className:`flex items-center gap-1 text-xs text-muted-foreground shrink-0 pl-1`,children:(0,$.jsx)(Y,{className:`size-3`})})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,$.jsxs)(ye,{children:[(0,$.jsxs)(de,{className:`flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded border border-border bg-card text-foreground hover:bg-accent cursor-pointer shadow-2xs transition-colors`,children:[(0,$.jsx)(Ut,{size:11,className:`text-muted-foreground`}),(0,$.jsx)(`span`,{children:{"created-desc":`Newest`,"created-asc":`Oldest`,"updated-desc":`Recently active`,"messages-desc":`Most turns`,"title-asc":`A–Z`}[D]}),(0,$.jsx)(K,{size:10,className:`text-muted-foreground opacity-70`})]}),(0,$.jsxs)(ve,{align:`end`,className:`w-48`,children:[(0,$.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-semibold text-muted-foreground uppercase tracking-wider`,children:`Order Chats By`}),(0,$.jsxs)(G,{onClick:()=>O(`created-desc`),className:`flex items-center justify-between text-xs`,children:[(0,$.jsx)(`span`,{children:`Newest created`}),D===`created-desc`&&(0,$.jsx)(X,{size:12,className:`text-primary`})]}),(0,$.jsxs)(G,{onClick:()=>O(`created-asc`),className:`flex items-center justify-between text-xs`,children:[(0,$.jsx)(`span`,{children:`Oldest created`}),D===`created-asc`&&(0,$.jsx)(X,{size:12,className:`text-primary`})]}),(0,$.jsxs)(G,{onClick:()=>O(`updated-desc`),className:`flex items-center justify-between text-xs`,children:[(0,$.jsx)(`span`,{children:`Recently active`}),D===`updated-desc`&&(0,$.jsx)(X,{size:12,className:`text-primary`})]}),(0,$.jsxs)(G,{onClick:()=>O(`messages-desc`),className:`flex items-center justify-between text-xs`,children:[(0,$.jsx)(`span`,{children:`Most turns`}),D===`messages-desc`&&(0,$.jsx)(X,{size:12,className:`text-primary`})]}),(0,$.jsxs)(G,{onClick:()=>O(`title-asc`),className:`flex items-center justify-between text-xs`,children:[(0,$.jsx)(`span`,{children:`Title (A–Z)`}),D===`title-asc`&&(0,$.jsx)(X,{size:12,className:`text-primary`})]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center rounded border border-border bg-card p-0.5 shadow-2xs`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>A(`harness`),title:`Group chats by AI Harness`,className:s(`px-2 py-0.5 text-xs rounded font-medium transition-colors cursor-pointer`,k===`harness`?`bg-primary text-primary-foreground font-semibold shadow-2xs`:`text-muted-foreground hover:text-foreground`),children:`Grouped`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>A(`timeline`),title:`Unified Chronological Timeline`,className:s(`px-2 py-0.5 text-xs rounded font-medium transition-colors cursor-pointer`,k===`timeline`?`bg-primary text-primary-foreground font-semibold shadow-2xs`:`text-muted-foreground hover:text-foreground`),children:`Timeline`})]})]})]}),T&&(0,$.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 p-2.5 rounded-md bg-emerald-500/10 border border-emerald-500/30 text-xs animate-fade-in`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground min-w-0`,children:[(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-emerald-500 animate-pulse shrink-0`}),(0,$.jsxs)(`span`,{className:`truncate`,children:[(0,$.jsx)(`strong`,{children:`Active in terminal:`}),` `,(0,$.jsx)(`code`,{className:`font-mono bg-background/80 px-1.5 py-0.5 rounded text-emerald-400`,children:T.cmd})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:async()=>{await Mt(T.cmd),c?.(`Command copied to clipboard!`,`success`)},className:`inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium rounded border border-emerald-500/40 bg-emerald-500/15 text-emerald-400 hover:bg-emerald-500/25 transition-colors cursor-pointer`,children:[(0,$.jsx)(J,{size:11}),` Copy`]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>E(null),className:`text-muted-foreground hover:text-foreground cursor-pointer text-xs px-1`,title:`Dismiss banner`,children:`✕`})]})]}),k===`timeline`?(0,$.jsx)(Z,{className:`divide-y divide-border overflow-hidden surface-card`,children:ne.length===0?(0,$.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:j?`No chat sessions match your search filter.`:`No chat sessions recorded yet.`}):ne.map(e=>(0,$.jsxs)(`div`,{className:`group flex flex-col gap-2 p-3 hover:bg-accent/40 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[ur(e.assistant),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground mb-0.5`,children:[(0,$.jsx)(`span`,{className:`font-semibold capitalize text-foreground`,children:e.assistant===`antigravity`?`Antigravity`:e.assistant===`claude`?`Claude`:e.assistant===`codex`?`Codex`:`Copilot`}),(0,$.jsx)(`span`,{children:`•`}),(0,$.jsx)(`span`,{className:`font-mono text-muted-foreground/80`,children:e.id.slice(0,8)}),(0,$.jsx)(`span`,{children:`•`}),(0,$.jsx)(`span`,{children:dr(e.createdAt||e.updatedAt)}),(0,$.jsx)(`span`,{children:`•`}),(0,$.jsxs)(`span`,{className:`font-mono`,children:[e.messageCount,` `,e.messageCount===1?`turn`:`turns`]})]}),(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground truncate`,title:e.title,children:e.title})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 pl-8 sm:pl-0`,children:[(0,$.jsxs)(l,{size:`xs`,variant:`default`,disabled:x===e.id,onClick:()=>void te(e.id,e.assistant),title:`Resume session in terminal (${e.id})`,children:[x===e.id?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(tn,{size:12}),(0,$.jsx)(`span`,{children:`Resume`})]}),(0,$.jsxs)(l,{size:`xs`,variant:`outline`,onClick:()=>{r(e),i([]),a(e.assistant,e.id)},title:`Inspect transcript log`,children:[(0,$.jsx)(dt,{size:12}),(0,$.jsx)(`span`,{children:`Logs`})]}),e.assistant===`codex`&&v&&(0,$.jsxs)(l,{size:`xs`,variant:`outline`,disabled:y===e.id,onClick:()=>void V(e.id),title:`Open in Codex Desktop`,children:[y===e.id?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(ht,{size:12}),(0,$.jsx)(`span`,{children:`Desktop`})]}),(0,$.jsx)(l,{size:`icon-xs`,variant:`ghost`,onClick:async()=>{let t=lr(e.assistant,e.id);await Mt(t),c?.(`Copied: ${t}`,`success`)},title:`Copy CLI resume command`,children:(0,$.jsx)(J,{size:12})})]})]},e.id))}):(0,$.jsx)(`div`,{className:`space-y-2.5`,children:se.map(e=>{let t=F[e.id]??!1,n=e.sessions.filter(e=>{if(!j.trim())return!0;let t=j.toLowerCase();return`${e.title} ${e.id}`.toLowerCase().includes(t)});return(0,$.jsxs)(Z,{className:`overflow-hidden surface-card`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 p-3 sm:flex-row sm:items-center sm:justify-between bg-muted/20 hover:bg-muted/35 transition-colors cursor-pointer select-none`,onClick:()=>L(e.id),children:[(0,$.jsxs)(`div`,{className:`flex flex-1 items-center gap-2.5 min-w-0`,children:[(0,$.jsx)(`span`,{className:`text-muted-foreground transition-transform`,children:t?(0,$.jsx)(K,{size:14}):(0,$.jsx)(Se,{size:14})}),e.icon,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 min-w-0`,children:[(0,$.jsx)(`span`,{className:`font-bold text-xs text-foreground`,children:e.name}),(0,$.jsxs)(q,{tone:e.isDetected?`success`:`neutral`,dot:e.isDetected,children:[`CLI: `,e.cliCommand]}),e.hasApp&&(0,$.jsx)(q,{tone:`running`,children:e.appName}),(0,$.jsxs)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:[`(`,n.length,`)`]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 pl-6 sm:pl-0`,onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(l,{size:`xs`,variant:`default`,disabled:C===e.id,onClick:()=>void B(e.id),title:`Launch new ${e.cliCommand} session in terminal`,children:[C===e.id?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(lt,{size:12}),(0,$.jsx)(`span`,{children:`New Session`})]}),e.hasApp&&(0,$.jsxs)(l,{size:`xs`,variant:`outline`,onClick:()=>void ee(e.appTargetId),title:`Open in ${e.appName}`,children:[(0,$.jsx)(ht,{size:12}),(0,$.jsx)(`span`,{children:e.appName})]})]})]}),t&&(0,$.jsx)(`div`,{className:`divide-y divide-border/60 border-t border-border`,children:n.length===0?(0,$.jsxs)(`div`,{className:`p-4 text-center text-xs text-muted-foreground flex items-center justify-center gap-2`,children:[(0,$.jsx)(`span`,{children:j?`No sessions match your search query.`:`No previous sessions recorded for ${e.name}.`}),!j&&(0,$.jsxs)(`button`,{type:`button`,onClick:()=>void B(e.id),className:`text-primary font-semibold hover:underline cursor-pointer inline-flex items-center gap-1 text-xs`,children:[(0,$.jsx)(lt,{size:11}),` Start session`]})]}):n.map(e=>(0,$.jsxs)(`div`,{className:`group flex flex-col gap-1.5 px-3.5 py-2.5 hover:bg-accent/40 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-0.5 text-[11px] text-muted-foreground font-mono`,children:[(0,$.jsx)(`span`,{children:e.id.slice(0,8)}),(0,$.jsx)(`span`,{children:`•`}),(0,$.jsx)(`span`,{children:dr(e.createdAt||e.updatedAt)}),(0,$.jsx)(`span`,{children:`•`}),(0,$.jsxs)(`span`,{children:[e.messageCount,` `,e.messageCount===1?`turn`:`turns`]})]}),(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground truncate`,title:e.title,children:e.title})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,$.jsxs)(l,{size:`xs`,variant:`default`,disabled:x===e.id,onClick:()=>void te(e.id,e.assistant),title:`Resume session in terminal (${e.id})`,children:[x===e.id?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(tn,{size:12}),(0,$.jsx)(`span`,{children:`Resume`})]}),(0,$.jsxs)(l,{size:`xs`,variant:`outline`,onClick:()=>{r(e),i([]),a(e.assistant,e.id)},title:`Inspect transcript log`,children:[(0,$.jsx)(dt,{size:12}),(0,$.jsx)(`span`,{children:`Logs`})]}),e.assistant===`codex`&&v&&(0,$.jsxs)(l,{size:`xs`,variant:`outline`,disabled:y===e.id,onClick:()=>void V(e.id),title:`Open in Codex Desktop`,children:[y===e.id?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(ht,{size:12}),(0,$.jsx)(`span`,{children:`Desktop`})]}),(0,$.jsx)(l,{size:`icon-xs`,variant:`ghost`,onClick:async()=>{let t=lr(e.assistant,e.id);await Mt(t),c?.(`Copied: ${t}`,`success`)},title:`Copy CLI resume command`,children:(0,$.jsx)(J,{size:12})})]})]},e.id))})]},e.id)})})]})},pr=({ws:e,gitChanges:t,gitChangesLoading:n,syncLoading:r,syncResults:i,commitMessage:a,showCommitModal:o,commitLoading:c,commitResults:u,setSyncResults:d,setCommitResults:f,setCommitMessage:p,setShowCommitModal:m,fetchGitChanges:h,handleSyncAll:g,handleCommitAll:_})=>{let[v,y]=(0,Q.useState)({}),[b,x]=(0,Q.useState)({}),[S,C]=(0,Q.useState)({}),[w,T]=(0,Q.useState)({}),[E,D]=(0,Q.useState)({}),[O,k]=(0,Q.useState)(``),A=e=>v[e]??!0,j=e=>{y(t=>({...t,[e]:!A(e)}))},M=()=>{let e={};t.forEach(t=>{e[t.repoName]=!1}),y(e)},N=()=>{let e={};t.forEach(t=>{e[t.repoName]=!0}),y(e),x({})},P=async(t,n)=>{let r=`${t}/${n}`,i=!b[r];if(x(e=>({...e,[r]:i})),i&&!S[r]){T(e=>({...e,[r]:!0})),D(e=>({...e,[r]:``}));try{let i=encodeURIComponent(e.branchName),a=await fetch(`/api/workspace/${i}/changes/diff?repo=${encodeURIComponent(t)}&file=${encodeURIComponent(n)}`);if(!a.ok)throw Error(`Failed to load diff: ${a.statusText}`);let o=await a.json();C(e=>({...e,[r]:o.diff||``}))}catch(e){D(t=>({...t,[r]:e.message||`Unknown error`}))}finally{T(e=>({...e,[r]:!1}))}}},F=e=>{if(!e||!e.trim())return(0,$.jsx)(`div`,{className:`p-3 font-mono text-[11px] italic text-muted-foreground`,children:`No diff details available.`});let t=e.split(`
|
|
2
|
-
`);return(0,$.jsx)(`pre`,{className:`custom-scrollbar max-h-[450px] overflow-x-auto overflow-y-auto rounded-xl border border-border bg-muted/40 p-4 font-mono text-[11px] leading-relaxed text-muted-foreground select-text`,children:t.map((e,t)=>{let n;return n=e.startsWith(`+`)&&!e.startsWith(`+++`)?`block w-full rounded-sm bg-success/10 px-1 text-success-foreground`:e.startsWith(`-`)&&!e.startsWith(`---`)?`block w-full rounded-sm bg-destructive/10 px-1 text-destructive-foreground`:e.startsWith(`@@`)?`block w-full bg-info/10 px-1 font-semibold italic text-info-foreground`:e.startsWith(`diff`)||e.startsWith(`index`)||e.startsWith(`---`)||e.startsWith(`+++`)?`block w-full font-bold text-muted-foreground`:`block w-full px-1 text-foreground`,(0,$.jsx)(`code`,{className:n,children:e},t)})})},I=t.filter(e=>e.files&&e.files.length>0),L=I.reduce((e,t)=>e+t.files.length,0);return(0,$.jsxs)(`div`,{className:`animate-fade-in`,children:[(0,$.jsxs)(`header`,{className:`flex justify-between items-center mb-6 flex-wrap gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,$.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-bold text-foreground`,children:[(0,$.jsx)(Ct,{size:16,className:`text-primary`}),` Active Workspace Git Diffs`]}),I.length>0&&(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 pl-2 border-l border-border/80`,children:[(0,$.jsxs)(l,{variant:`ghost`,size:`xs`,onClick:N,title:`Collapse all repositories and file diffs`,className:`text-xs text-muted-foreground hover:text-foreground h-7 px-2 gap-1 font-semibold`,children:[(0,$.jsx)(on,{size:12}),(0,$.jsx)(`span`,{children:`Collapse All`})]}),(0,$.jsxs)(l,{variant:`ghost`,size:`xs`,onClick:M,title:`Expand all repositories`,className:`text-xs text-muted-foreground hover:text-foreground h-7 px-2 gap-1 font-semibold`,children:[(0,$.jsx)(sn,{size:12}),(0,$.jsx)(`span`,{children:`Expand All`})]})]})]}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>h(e.branchName),disabled:n,children:[(0,$.jsx)(xt,{size:11,className:n?`animate-spin text-primary`:``}),` Refresh Changes`]}),e.mode!==`in-place`&&(0,$.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>g(e.branchName),disabled:r,children:[r?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(xt,{size:11}),` Sync All`]}),(0,$.jsx)(l,{size:`sm`,onClick:()=>m(!0),disabled:L===0||c,children:`Commit & Push All`})]})]}),i&&e.mode!==`in-place`&&(0,$.jsxs)(`div`,{className:`relative mb-5 rounded-xl border border-info/25 bg-info/10 p-5 text-info-foreground shadow-sm`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between border-b border-info/20 pb-2`,children:[(0,$.jsx)(`h5`,{className:`font-mono text-xs font-bold text-foreground`,children:`Rebase / Sync Action Logs`}),(0,$.jsx)(`button`,{className:`cursor-pointer text-[10px] font-bold text-info-foreground hover:text-foreground`,onClick:()=>d(null),children:`Dismiss`})]}),(0,$.jsx)(`div`,{className:`space-y-2`,children:i.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-border bg-card p-2 font-mono text-[10px]`,children:[(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.repoName}),(0,$.jsx)(`span`,{className:e.success?`font-bold text-success-foreground`:`font-bold text-destructive-foreground`,children:e.success?`✓ Synced (${e.message})`:`✗ Conflict: ${e.message}`})]},e.repoName))})]}),u&&(0,$.jsxs)(`div`,{className:`relative mb-5 rounded-xl border border-success/25 bg-success/10 p-5 text-success-foreground shadow-sm`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center justify-between border-b border-success/20 pb-2`,children:[(0,$.jsx)(`h5`,{className:`font-mono text-xs font-bold text-foreground`,children:`Commit & Push Results`}),(0,$.jsx)(`button`,{className:`cursor-pointer text-[10px] font-bold text-success-foreground hover:text-foreground`,onClick:()=>f(null),children:`Dismiss`})]}),(0,$.jsx)(`div`,{className:`space-y-2`,children:u.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-border bg-card p-2 font-mono text-[10px]`,children:[(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.repoName}),(0,$.jsx)(`span`,{className:e.success?`font-bold text-success-foreground`:`font-bold text-destructive-foreground`,children:e.success?`✓ Committed ${e.filesChanged} file(s) (${e.commitHash?e.commitHash.slice(0,7):`no hash`})`:`✗ Error: ${e.message}`})]},e.repoName))})]}),o&&(0,$.jsxs)(`div`,{className:`relative mb-6 rounded-xl border border-border bg-card p-6 shadow-sm animate-rise`,children:[(0,$.jsxs)(`h5`,{className:`mb-3 flex items-center gap-1.5 text-xs font-bold text-foreground`,children:[(0,$.jsx)(xn,{size:13,className:`text-primary`}),` Enter Commit Message`]}),(0,$.jsx)(H,{type:`text`,className:`mb-4 font-mono text-xs`,placeholder:`feat: implement multi-repo logic...`,value:a,onChange:e=>p(e.target.value),onKeyDown:t=>{t.key===`Enter`&&a.trim()&&_(e.branchName)}}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2.5`,children:[(0,$.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>{m(!1),p(``)},disabled:c,children:`Cancel`}),(0,$.jsxs)(l,{size:`sm`,onClick:()=>_(e.branchName),disabled:c||!a.trim(),children:[c?(0,$.jsx)(Y,{className:`size-3`}):null,c?`Committing...`:`Commit & Push All`]})]})]}),n?(0,$.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,$.jsx)(Y,{className:`size-6 text-primary`})}):(0,$.jsx)(`div`,{className:`space-y-4`,children:I.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-xl border border-border bg-card py-16 text-center shadow-xs`,children:[(0,$.jsx)(`div`,{className:`mb-3 flex h-10 w-10 items-center justify-center rounded-full border border-success/25 bg-success/10 text-success-foreground shadow-sm`,children:(0,$.jsx)(X,{size:20})}),(0,$.jsx)(`h5`,{className:`text-sm font-bold text-foreground`,children:`No Uncommitted Changes`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Workspace repositories are completely in sync with Git feature branches.`})]}):I.map(e=>{let t=e.files.length,n=e.files.reduce((e,t)=>e+(t.additions||0),0),r=e.files.reduce((e,t)=>e+(t.deletions||0),0),i=A(e.repoName);return(0,$.jsxs)(`div`,{className:`relative rounded-xl border border-border/80 bg-card/80 backdrop-blur-md transition-all shadow-xs overflow-hidden`,children:[(0,$.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:()=>j(e.repoName),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),j(e.repoName))},className:s(`flex justify-between items-center px-5 py-4 cursor-pointer select-none transition-colors`,i?`hover:bg-accent/40`:`bg-muted/20 border-b border-border/60 hover:bg-muted/30`),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap min-w-0`,children:[(0,$.jsx)(`span`,{className:`grid size-6 place-items-center rounded-md bg-primary/10 text-primary border border-primary/20 shrink-0`,children:i?(0,$.jsx)(Se,{size:14,className:`shrink-0 text-muted-foreground`}):(0,$.jsx)(K,{size:14,className:`shrink-0 text-primary`})}),(0,$.jsx)(`h5`,{className:`font-mono text-sm font-bold text-foreground truncate`,children:e.repoName}),(0,$.jsxs)(q,{tone:`warning`,dot:!1,children:[t,` file`,t===1?``:`s`,` changed`]}),(n>0||r>0)&&(0,$.jsxs)(`span`,{className:`rounded-md border border-border bg-muted/60 px-2 py-0.5 font-mono text-[10px] font-bold`,children:[(0,$.jsxs)(`span`,{className:`font-bold text-success-foreground`,children:[`+`,n]}),` `,(0,$.jsxs)(`span`,{className:`font-bold text-destructive-foreground`,children:[`-`,r]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,$.jsx)(`span`,{className:`max-w-[280px] truncate font-mono text-[10px] text-muted-foreground hidden md:inline`,title:e.repoPath,children:e.repoPath}),(0,$.jsx)(`span`,{className:`text-[11px] font-bold text-primary hover:underline`,children:i?`Expand Files`:`Collapse`})]})]}),!i&&(0,$.jsx)(`div`,{className:`p-5 flex flex-col gap-3 bg-card/40`,children:e.files.map(t=>{let n=`${e.repoName}/${t.file}`,r=!!b[n],i=!!w[n],a=S[n]||``,o=E[n]||``;return(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/80 bg-muted/20 transition-colors hover:border-primary/30 shadow-2xs`,children:[(0,$.jsxs)(`div`,{className:`flex cursor-pointer select-none items-center justify-between px-4 py-3 transition-colors hover:bg-accent/50`,onClick:()=>P(e.repoName,t.file),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[r?(0,$.jsx)(K,{size:14,className:`shrink-0 text-primary`}):(0,$.jsx)(Se,{size:14,className:`shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`max-w-[240px] truncate font-mono text-[11px] text-foreground sm:max-w-[480px] font-semibold`,title:t.file,children:t.file}),(t.additions>0||t.deletions>0)&&(0,$.jsxs)(`span`,{className:`ml-1 shrink-0 font-mono text-[9px] font-bold text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`text-success-foreground`,children:[`+`,t.additions]}),` /`,` `,(0,$.jsxs)(`span`,{className:`text-destructive-foreground`,children:[`-`,t.deletions]})]})]}),(0,$.jsx)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:(0,$.jsx)(`span`,{className:`rounded border px-2 py-0.5 text-[8px] font-bold uppercase tracking-wider ${t.type===`added`?`border-success/25 bg-success/10 text-success-foreground`:t.type===`deleted`?`border-destructive/25 bg-destructive/10 text-destructive-foreground`:`border-warning/25 bg-warning/10 text-warning-foreground`}`,children:t.type})})]}),r&&(0,$.jsx)(`div`,{className:`border-t border-border bg-background p-3`,children:i?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 p-2 font-mono text-[10px] text-primary`,children:[(0,$.jsx)(Y,{className:`size-3`}),` Loading diff...`]}):o?(0,$.jsxs)(`div`,{className:`p-2 font-mono text-[10px] text-destructive-foreground`,children:[`Error: `,o]}):(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(a),k(n),setTimeout(()=>k(``),2e3)},className:`cursor-pointer rounded-lg border border-border bg-card p-1.5 text-muted-foreground shadow-sm transition-colors hover:bg-accent hover:text-foreground`,title:`Copy Diff`,children:O===n?(0,$.jsx)(X,{size:12,className:`text-success-foreground`}):(0,$.jsx)(J,{size:12})})}),F(a)]})})]},t.file)})})]},e.repoName)})})]})},mr=({ws:e,knowledgeContent:t,knowledgeLoading:n,isEditingKnowledge:r,editedKnowledge:i,saveKnowledgeLoading:a,setEditedKnowledge:o,setIsEditingKnowledge:s,handleSaveKnowledge:c})=>{let[u,d]=(0,Q.useState)(`preview`);return(0,$.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-5 shadow-xs`,children:[(0,$.jsxs)(`header`,{className:`flex justify-between items-center mb-4`,children:[(0,$.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-bold text-foreground`,children:[(0,$.jsx)(kt,{size:16,className:`text-primary`}),` Persistent Knowledge Memory (contextspace-knowledge.md)`]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!r&&t&&(0,$.jsxs)(`div`,{className:`flex items-center gap-1 bg-muted/50 p-0.5 rounded-md border border-border/60`,children:[(0,$.jsxs)(l,{size:`xs`,variant:u===`preview`?`secondary`:`ghost`,onClick:()=>d(`preview`),className:`text-[11px] gap-1 px-2`,children:[(0,$.jsx)(xe,{size:11}),` Preview`]}),(0,$.jsxs)(l,{size:`xs`,variant:u===`raw`?`secondary`:`ghost`,onClick:()=>d(`raw`),className:`text-[11px] gap-1 px-2`,children:[(0,$.jsx)(dn,{size:11}),` Raw`]})]}),r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(l,{variant:`outline`,size:`xs`,onClick:()=>{o(t),s(!1)},disabled:a,children:`Cancel`}),(0,$.jsxs)(l,{size:`xs`,onClick:()=>c(e.branchName),disabled:a,children:[a?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(xn,{size:10}),` Save`]})]}):(0,$.jsxs)(l,{variant:`outline`,size:`xs`,onClick:()=>s(!0),disabled:n,children:[(0,$.jsx)(Sn,{size:10}),` Edit Knowledge`]})]})]}),n?(0,$.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,$.jsx)(xt,{className:`animate-spin text-primary`,size:20})}):r?(0,$.jsx)(Jt,{className:`[&_[data-slot=textarea]]:h-96 [&_[data-slot=textarea]]:resize-y [&_[data-slot=textarea]]:font-mono [&_[data-slot=textarea]]:text-xs`,value:i,onChange:e=>o(e.target.value)}):t?u===`preview`?(0,$.jsx)(`div`,{className:`max-h-[550px] overflow-auto rounded-xl border border-border/70 bg-card/40 backdrop-blur-xs p-4`,children:(0,$.jsx)(At,{content:t})}):(0,$.jsx)(`div`,{className:`max-h-[550px] overflow-auto whitespace-pre-wrap rounded-xl border border-border/70 bg-card/40 backdrop-blur-xs p-4 font-mono text-xs leading-relaxed text-muted-foreground`,children:t}):(0,$.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/20 p-6 text-center text-xs text-muted-foreground`,children:`No knowledge file generated yet.`})]})},hr=({planContent:e,planLoading:t})=>{let[n,r]=(0,Q.useState)(`preview`);return(0,$.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-5 shadow-xs`,children:[(0,$.jsxs)(`header`,{className:`flex justify-between items-center mb-4`,children:[(0,$.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-bold text-foreground`,children:[(0,$.jsx)(hn,{size:16,className:`text-primary`}),` Inter-Repo Implementation Plan (contextspace-plan.md)`]}),e&&(0,$.jsxs)(`div`,{className:`flex items-center gap-1 bg-muted/50 p-0.5 rounded-md border border-border/60`,children:[(0,$.jsxs)(l,{size:`xs`,variant:n===`preview`?`secondary`:`ghost`,onClick:()=>r(`preview`),className:`text-[11px] gap-1 px-2`,children:[(0,$.jsx)(xe,{size:11}),` Preview`]}),(0,$.jsxs)(l,{size:`xs`,variant:n===`raw`?`secondary`:`ghost`,onClick:()=>r(`raw`),className:`text-[11px] gap-1 px-2`,children:[(0,$.jsx)(dn,{size:11}),` Raw`]})]})]}),t?(0,$.jsx)(`div`,{className:`flex justify-center py-10`,children:(0,$.jsx)(xt,{className:`animate-spin text-primary`,size:20})}):e?n===`preview`?(0,$.jsx)(`div`,{className:`max-h-[550px] overflow-auto rounded-xl border border-border/70 bg-card/40 backdrop-blur-xs p-4`,children:(0,$.jsx)(At,{content:e})}):(0,$.jsx)(`div`,{className:`max-h-[550px] overflow-auto whitespace-pre-wrap rounded-xl border border-border/70 bg-card/40 backdrop-blur-xs p-4 font-mono text-xs leading-relaxed text-muted-foreground`,children:e}):(0,$.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/20 p-6 text-center text-xs text-muted-foreground`,children:`No implementation plan generated yet.`})]})},gr={"git-pull-request":Oe,"flask-conical":Ee,package:De,database:Te,"shield-check":Ce,terminal:tn,zap:ct,cpu:tt,layers:je,boxes:Kt};function _r({ws:e,showToast:t}){let[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)({}),[o,c]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(!1),{data:m=[],isLoading:h}=St(),{data:g=[],isLoading:_}=Et(e.branchName),{data:v=[],isLoading:y}=ot(),{data:b,isLoading:x,isError:S}=qt(e.branchName),C=Rt(),w=_t(),T=(0,Q.useMemo)(()=>new Set(o??b?.enabledSkills??[]),[o,b?.enabledSkills]),E=(0,Q.useMemo)(()=>new Set(u??b?.enabledAgents??[]),[u,b?.enabledAgents]);(0,Q.useEffect)(()=>{b&&(c([...b.enabledSkills??[]]),d([...b.enabledAgents??[]]))},[b]);let D=(0,Q.useMemo)(()=>{if(!b||o===null||u===null)return!1;let e=new Set(b.enabledSkills??[]),t=new Set(b.enabledAgents??[]);return!!(o.length!==e.size||o.some(t=>!e.has(t))||u.length!==t.size||u.some(e=>!t.has(e)))},[b,o,u]),O=e=>{a(t=>({...t,[e]:!t[e]}))},k=e=>{if(o===null)return;let t=new Set(o);t.has(e)?t.delete(e):t.add(e),c(Array.from(t))},A=e=>{if(u===null)return;let t=new Set(u);t.has(e)?t.delete(e):t.add(e),d(Array.from(t))},j=(e,t,n)=>{if(o===null)return;let r=new Set(o);for(let e of n)t?r.add(e.id):r.delete(e.id);c(Array.from(r))},M=async()=>{if(!(!b||o===null||u===null)){p(!0);try{await C.mutateAsync({workspaceId:e.branchName,expectedRevision:b.revision??0,enabledSkills:o,enabledAgents:u,enabledCategories:m.map(e=>e.id)}),await w.mutateAsync({workspaceId:e.branchName}),t?.(`Skills & agents deployed successfully to workspace context!`,`success`)}catch(e){t?.(e instanceof Error?e.message:`Failed to deploy skills`,`error`)}finally{p(!1)}}},N=(0,Q.useMemo)(()=>{if(!n.trim())return g;let e=n.toLowerCase();return g.filter(t=>t.title?.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.tags?.some(t=>t.toLowerCase().includes(e)))},[g,n]),P=(0,Q.useMemo)(()=>{if(!n.trim())return v;let e=n.toLowerCase();return v.filter(t=>t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.category.toLowerCase().includes(e))},[v,n]),F=(0,Q.useMemo)(()=>{let e={};for(let t of m)e[t.id]=N.filter(e=>e.category===t.id);return e},[m,N]);return h||_||y||x?(0,$.jsxs)(`div`,{className:`flex items-center justify-center p-12 gap-3 text-muted-foreground`,children:[(0,$.jsx)(Y,{}),(0,$.jsx)(`span`,{className:`text-sm`,children:`Loading workspace skills...`})]}):S?(0,$.jsx)(Bt,{className:`py-12 border border-dashed rounded-xl`,children:(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Ht,{children:`Could not load workspace skills config`}),(0,$.jsx)(Gt,{children:`Unable to read .contextspace/skills.json for this workspace.`})]})}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsxs)(Z,{className:`p-5 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md shadow-xs flex flex-col sm:flex-row sm:items-center justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-lg bg-primary/10 text-primary`,children:(0,$.jsx)(Kt,{className:`h-5 w-5`})}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-bold text-foreground`,children:`Workspace Skills & Agents`}),(0,$.jsxs)(W,{variant:`secondary`,className:`text-[10px] font-mono`,children:[T.size,` Skills Active`]}),E.size>0&&(0,$.jsxs)(W,{variant:`secondary`,className:`text-[10px] font-mono`,children:[E.size,` Agents Active`]})]}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Choose which reusable Agent Skills and Codex Agents to deploy into this workspace.`})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(l,{size:`sm`,onClick:M,disabled:f||!D&&T.size===0&&E.size===0,className:`flex items-center gap-1.5 shadow-sm`,children:[f?(0,$.jsx)(Y,{className:`size-3.5`}):(0,$.jsx)(bt,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:f?`Deploying…`:D?`Save & Deploy Changes`:`Re-Deploy to Workspace`})]}),(0,$.jsxs)(l,{render:(0,$.jsx)(pt,{to:`/skills`}),variant:`outline`,size:`sm`,className:`flex items-center gap-1.5`,children:[(0,$.jsx)(ht,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:`Resource Library`})]})]})]}),(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(vt,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,$.jsx)(H,{value:n,onChange:e=>r(e.target.value),placeholder:`Filter skills & agents by keyword...`,className:`pl-9 pr-8 h-8 text-xs bg-card`}),n&&(0,$.jsx)(`button`,{onClick:()=>r(``),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,$.jsx)(ut,{className:`h-3.5 w-3.5`})})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[m.map(e=>{let t=gr[e.icon||`boxes`]||Kt,r=F[e.id]||[];if(n&&r.length===0)return null;let a=!!i[e.id],o=r.length>0&&r.every(e=>T.has(e.id));return(0,$.jsxs)(`div`,{className:`border border-border rounded-xl overflow-hidden bg-card/60 transition-colors`,children:[(0,$.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":!a,onClick:()=>O(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),O(e.id))},className:`p-3 flex items-center justify-between cursor-pointer hover:bg-muted/40 transition-colors select-none`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,$.jsx)(`div`,{className:`p-1.5 rounded-md text-white shadow-xs flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,$.jsx)(t,{className:`h-3.5 w-3.5`})}),(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`h4`,{className:`font-semibold text-xs text-foreground`,children:e.name}),(0,$.jsxs)(W,{variant:`outline`,className:`text-[9px] px-1 py-0`,children:[r.filter(e=>T.has(e.id)).length,`/`,r.length,` active`]})]})})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,onClick:e=>e.stopPropagation(),children:[r.length>0&&(0,$.jsxs)(l,{variant:`ghost`,size:`xs`,onClick:()=>j(e.id,!o,r),className:`h-6 text-[11px] px-2 text-muted-foreground hover:text-foreground`,children:[o?(0,$.jsx)(ke,{className:`h-3 w-3 mr-1 text-primary`}):(0,$.jsx)(it,{className:`h-3 w-3 mr-1`}),(0,$.jsx)(`span`,{children:o?`Deselect All`:`Select All`})]}),(0,$.jsx)(`div`,{className:`p-0.5 text-muted-foreground`,children:a?(0,$.jsx)(Se,{className:`h-4 w-4`}):(0,$.jsx)(K,{className:`h-4 w-4`})})]})]}),!a&&(0,$.jsx)(`div`,{className:`p-3 border-t border-border/40 bg-background/50`,children:r.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground py-2 text-center`,children:`No skills in this category.`}):(0,$.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2.5`,children:r.map(e=>{let t=T.has(e.id);return(0,$.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:()=>k(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),k(e.id))},className:s(`p-3 rounded-lg border text-left cursor-pointer transition-all flex flex-col justify-between select-none shadow-2xs`,t?`border-primary/60 bg-primary/5 text-foreground`:`border-border bg-card/70 text-muted-foreground hover:border-foreground/20 hover:text-foreground`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(`span`,{className:s(`grid size-4 shrink-0 place-items-center rounded border transition-colors`,t?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/40 bg-transparent`),children:t&&(0,$.jsx)(X,{className:`size-3 stroke-[3]`})}),(0,$.jsx)(`span`,{className:`font-mono text-xs font-semibold truncate`,children:e.title||e.name})]}),(0,$.jsx)(W,{variant:`outline`,className:`text-[9px] px-1 py-0 shrink-0`,children:e.custom?`Custom`:`Template`})]}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground line-clamp-2 leading-relaxed pl-6`,children:e.description||`No description provided.`}),e.tags&&e.tags.length>0&&(0,$.jsx)(`div`,{className:`mt-2 pl-6 flex items-center gap-1 flex-wrap`,children:e.tags.slice(0,3).map(e=>(0,$.jsxs)(`span`,{className:`text-[9px] font-mono text-muted-foreground bg-muted/60 px-1 py-0.2 rounded`,children:[`#`,e]},e))})]},e.id)})})})]},e.id)}),P.length>0&&(0,$.jsxs)(`div`,{className:`border border-border rounded-xl overflow-hidden bg-card/60 transition-colors`,children:[(0,$.jsx)(`div`,{className:`p-3 flex items-center justify-between border-b border-border/40 select-none`,children:(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,$.jsx)(`div`,{className:`p-1.5 rounded-md bg-purple-600 text-white shadow-xs flex items-center justify-center`,children:(0,$.jsx)(It,{className:`h-3.5 w-3.5`})}),(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`h4`,{className:`font-semibold text-xs text-foreground`,children:`Codex Native Agents`}),(0,$.jsxs)(W,{variant:`outline`,className:`text-[9px] px-1 py-0`,children:[P.filter(e=>E.has(e.id)).length,`/`,P.length,` active`]})]})})]})}),(0,$.jsx)(`div`,{className:`p-3 bg-background/50`,children:(0,$.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2.5`,children:P.map(e=>{let t=E.has(e.id);return(0,$.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:()=>A(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),A(e.id))},className:s(`p-3 rounded-lg border text-left cursor-pointer transition-all flex flex-col justify-between select-none shadow-2xs`,t?`border-purple-500/60 bg-purple-500/5 text-foreground`:`border-border bg-card/70 text-muted-foreground hover:border-foreground/20 hover:text-foreground`),children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(`span`,{className:s(`grid size-4 shrink-0 place-items-center rounded border transition-colors`,t?`border-purple-600 bg-purple-600 text-white`:`border-muted-foreground/40 bg-transparent`),children:t&&(0,$.jsx)(X,{className:`size-3 stroke-[3]`})}),(0,$.jsx)(`span`,{className:`font-mono text-xs font-semibold truncate`,children:e.name})]}),(0,$.jsx)(W,{variant:`secondary`,className:`text-[9px] px-1 py-0 shrink-0`,children:`.codex/agents`})]}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground line-clamp-2 leading-relaxed pl-6`,children:e.description||`No description provided.`})]},e.id)})})})]})]}),(0,$.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Saving & deploying will write to `,(0,$.jsxs)(`code`,{className:`font-mono text-xs text-foreground`,children:[$e,`/skills.json`]}),` and materialize files into `,(0,$.jsx)(`code`,{className:`font-mono text-xs text-foreground`,children:`.agents/skills/`}),`, `,(0,$.jsx)(`code`,{className:`font-mono text-xs text-foreground`,children:`.claude/skills/`}),`, `,(0,$.jsx)(`code`,{className:`font-mono text-xs text-foreground`,children:`.codex/skills/`}),`, `,(0,$.jsx)(`code`,{className:`font-mono text-xs text-foreground`,children:`.github/skills/`}),`, `,(0,$.jsx)(`code`,{className:`font-mono text-xs text-foreground`,children:`.cursor/skills/`}),`, and `,(0,$.jsx)(`code`,{className:`font-mono text-xs text-foreground`,children:`.codex/agents/`}),`.`]})]})}function vr(e){return e?/\b(fail|failed|failing|error|errors|unverified|not verified|rejected|timeout|timed out)\b/i.test(e):!1}function yr(e){if(e.confirmedBy&&String(e.confirmedBy).trim().length>0)return!0;let t=(e.author??``).trim().toLowerCase();if(t===`human`||t===`user`)return!0;if(t===`agent`)return!1;let n=(e.harness??``).trim().toLowerCase();return n===`human`||n===`developer`||n===`user`}function br(e){let t=`${e.message??``} ${e.content??``}`,n=e.evidence??``;if(vr(t)||vr(n)||e.status===`failed`||e.status===`rejected`||e.stepProposal?.status===`failed`||e.stepProposal?.status===`rejected`||e.syncError)return`failed`;if(e.status===`in_progress`||e.stepProposal?.status===`in_progress`)return`in_progress`;let r=e.stepProposal?.evidence&&String(e.stepProposal.evidence).trim().length>0;if(!(n.trim()||r))return`proposed`;if(e.stepProposal){if(e.stepProposal.status===`completion_proposed`||e.stepProposal.status===`pending`)return`proposed`;if(e.stepProposal.status===`completed`)return`completed`}return yr(e)&&(e.status===`completed`||e.status===`verified`||e.confirmedBy)?`completed`:`proposed`}function xr(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,month:`short`,day:`numeric`}).format(t)}function Sr({harness:e,author:t}){let n=(e||t||``).toLowerCase();return n.includes(`claude`)?(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg border border-[#D97757]/40 bg-[#D97757]/15 text-[#D97757] shadow-2xs`,children:(0,$.jsx)($t,{size:15})}):n.includes(`codex`)||n.includes(`openai`)?(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg border border-emerald-500/40 bg-emerald-500/15 text-emerald-400 shadow-2xs`,children:(0,$.jsx)(nt,{size:14})}):n.includes(`copilot`)?(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg border border-blue-500/40 bg-blue-500/15 text-blue-400 shadow-2xs`,children:(0,$.jsx)(at,{size:14})}):n.includes(`antigravity`)||n.includes(`agy`)?(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg border border-primary/40 bg-primary/15 text-primary shadow-2xs`,children:(0,$.jsx)(jt,{className:`size-4`})}):n.includes(`dev`)||n.includes(`human`)||n.includes(`user`)?(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg border border-border bg-card text-foreground shadow-2xs`,children:(0,$.jsx)(Cn,{size:15})}):(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg border border-border bg-muted text-muted-foreground shadow-2xs`,children:(0,$.jsx)(_e,{size:15})})}function Cr({harness:e,author:t}){let n=(e||t||``).toLowerCase();return n.includes(`claude`)?(0,$.jsx)(W,{variant:`outline`,className:`border-[#D97757]/50 text-[#D97757] bg-[#D97757]/10 font-mono text-[10px]`,children:`Claude Code`}):n.includes(`codex`)||n.includes(`openai`)?(0,$.jsx)(W,{variant:`outline`,className:`border-emerald-500/50 text-emerald-400 bg-emerald-500/10 font-mono text-[10px]`,children:`OpenAI Codex`}):n.includes(`copilot`)?(0,$.jsx)(W,{variant:`outline`,className:`border-blue-500/50 text-blue-400 bg-blue-500/10 font-mono text-[10px]`,children:`GitHub Copilot`}):n.includes(`antigravity`)||n.includes(`agy`)?(0,$.jsx)(W,{variant:`outline`,className:`border-primary/50 text-primary bg-primary/10 font-mono text-[10px]`,children:`Antigravity`}):n.includes(`dev`)||n.includes(`human`)||n.includes(`user`)?(0,$.jsx)(W,{variant:`secondary`,className:`font-mono text-[10px]`,children:`Developer`}):(0,$.jsx)(W,{variant:`outline`,className:`font-mono text-[10px]`,children:e||`Assistant`})}function wr({ws:e,showToast:t}){let{data:n,isLoading:r,refetch:i,isFetching:a}=Lt(e.branchName,{refetchInterval:3e3}),o=yt(e.branchName),[s,c]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(`developer`),[f,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(`proposed`),[v,y]=(0,Q.useState)(!1),b=(0,Q.useMemo)(()=>n?.messages??[],[n?.messages]),x=(0,Q.useMemo)(()=>new Map(n?.workflowProgress?.steps?.map(e=>[e.stepId,e])??[]),[n?.workflowProgress?.steps]),S=(0,Q.useMemo)(()=>{let e=new Map;for(let t of b)if(t.stepId){let n=x.get(t.stepId)??t.stepProposal,r=br({status:t.status,author:t.author,harness:t.harness,confirmedBy:t.confirmedBy,confirmedAt:t.confirmedAt,stepProposal:n,syncError:t.syncError,message:t.message,content:t.content,evidence:n?.evidence||t.evidence});e.set(t.stepId,{stepId:t.stepId,status:r,lastMessage:t.message||t.content||``,harness:t.harness||`unknown`})}return Array.from(e.values())},[b,x]),C=async e=>{e&&e.preventDefault();let n=s.trim();if(!(!n||o.isPending))try{let e=u===`developer`;await o.mutateAsync({message:n,harness:u,author:e?`human`:`agent`,...f.trim()?{stepId:f.trim(),status:g}:{},...m.trim()?{evidence:m.trim()}:{}}),c(``),h(``),p(``),_(`proposed`),t?.(`Handoff update posted to workspace stream.`,`success`)}catch(e){t?.(`Failed to post update: ${e instanceof Error?e.message:String(e)}`,`error`)}};return(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 animate-fade-in pb-12`,"data-testid":`workspace-workroom-tab`,children:[(0,$.jsxs)(Z,{className:`p-4 bg-card/60 surface-card border-border/80`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`grid size-7 place-items-center rounded-md bg-primary/10 text-primary border border-primary/20`,children:(0,$.jsx)(yn,{size:14,className:`animate-pulse`})}),(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Workspace Workroom`}),(0,$.jsxs)(W,{variant:`success`,className:`gap-1`,children:[(0,$.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`}),`Live updates`]}),n?.isRemoteActive&&n.remoteStatus&&(0,$.jsxs)(W,{variant:`info`,className:`gap-1`,children:[(0,$.jsx)(Fe,{size:11}),`LAN Room Active (`,n.remoteStatus.roomId.slice(0,8),`)`]})]}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Share updates and handoffs with the people and assistants working in this workspace.`})]}),(0,$.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:(0,$.jsxs)(l,{variant:`outline`,size:`xs`,onClick:()=>void i(),disabled:a,className:`gap-1.5 text-xs`,children:[(0,$.jsx)(xt,{size:12,className:a?`animate-spin`:``}),(0,$.jsx)(`span`,{children:`Refresh`})]})})]}),S.length>0&&(0,$.jsxs)(`div`,{className:`mt-4 pt-3 border-t border-border/60`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,$.jsx)(_n,{size:13,className:`text-primary`}),(0,$.jsxs)(`span`,{className:`text-[11px] font-semibold text-muted-foreground uppercase tracking-wider`,children:[`Tracked Milestones (`,S.length,`)`]})]}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:S.map(e=>{let t=e.status===`completed`,n=e.status===`failed`||e.status===`rejected`,r=e.status===`proposed`;return(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md border text-xs font-mono ${t?`border-emerald-500/30 bg-emerald-500/10 text-emerald-400`:n?`border-destructive/40 bg-destructive/10 text-destructive`:r?`border-amber-500/30 bg-amber-500/10 text-amber-400`:`border-blue-500/30 bg-blue-500/10 text-blue-400`}`,title:`${e.stepId} · ${e.status}: ${e.lastMessage}`,children:[t?(0,$.jsx)(ln,{size:12,className:`text-emerald-400`}):n?(0,$.jsx)(gt,{size:12,className:`text-destructive`}):r?(0,$.jsx)(un,{size:12,className:`text-amber-400`}):(0,$.jsx)(yn,{size:12,className:`text-blue-400`}),(0,$.jsx)(`span`,{className:`font-semibold`,children:e.stepId}),(0,$.jsxs)(`span`,{className:`text-[10px] opacity-80 capitalize`,children:[`(`,t?`Completed`:r?`Review Requested`:n?`Failed`:`In Progress`,`)`]})]},e.stepId)})})]})]}),(0,$.jsxs)(Z,{className:`divide-y divide-border/60 overflow-hidden surface-card border-border/80`,children:[(0,$.jsxs)(`div`,{className:`p-3.5 bg-muted/20 flex items-center justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(je,{size:14,className:`text-muted-foreground`}),(0,$.jsxs)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[`Timeline Activity (`,b.length,`)`]})]}),(0,$.jsxs)(`span`,{className:`text-[11px] font-mono text-muted-foreground`,children:[`Isolated to `,e.branchName]})]}),r?(0,$.jsxs)(`div`,{className:`flex items-center justify-center p-12 text-muted-foreground`,children:[(0,$.jsx)(Y,{className:`size-5 mr-2`}),(0,$.jsx)(`span`,{className:`text-xs`,children:`Loading workroom stream…`})]}):b.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`grid size-10 place-items-center rounded-full bg-muted/50 text-muted-foreground mb-3`,children:(0,$.jsx)(yn,{size:20})}),(0,$.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:`No handoff events recorded yet`}),(0,$.jsxs)(`p`,{className:`text-[11px] text-muted-foreground max-w-sm mt-1`,children:[`AI assistants using the `,(0,$.jsx)(`code`,{className:`font-mono text-[10px]`,children:`post_workroom_handoff`}),` tool will post updates here automatically. You can also write an update below.`]})]}):(0,$.jsx)(`div`,{className:`divide-y divide-border/40 max-h-[38rem] overflow-y-auto`,children:b.map((e,t)=>{let n=e.message||e.content||``,r=e.author||e.harness||`Assistant`,i=(e.stepId?x.get(e.stepId):void 0)??e.stepProposal,a=br({...e,stepProposal:i}),o=i?.evidence||e.evidence,s=vr(o);return(0,$.jsx)(`div`,{className:`p-4 transition-colors hover:bg-muted/10`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(Sr,{harness:e.harness,author:e.author}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:r}),(0,$.jsx)(Cr,{harness:e.harness,author:e.author}),e.stepId&&(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded border font-mono text-[10px] ${a===`completed`?`border-emerald-500/30 bg-emerald-500/10 text-emerald-400`:a===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:`border-amber-500/30 bg-amber-500/10 text-amber-400`}`,children:[(0,$.jsx)(_n,{size:10}),e.stepId,` (`,a===`completed`?`completed`:a===`failed`?`failed`:`proposal`,`)`]}),(0,$.jsx)(`time`,{className:`text-[10px] font-mono text-muted-foreground ml-auto`,children:xr(e.timestamp)})]}),(0,$.jsx)(`div`,{className:`text-xs text-foreground/90 leading-relaxed break-words`,children:(0,$.jsx)(At,{content:n})}),o&&(s||a===`failed`?(0,$.jsxs)(`div`,{className:`mt-2.5 p-2.5 rounded-md border border-destructive/40 bg-destructive/10`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-semibold text-destructive mb-1`,children:[(0,$.jsx)(gt,{size:13}),(0,$.jsx)(`span`,{children:`Test Failure / Negative Evidence`})]}),(0,$.jsx)(`pre`,{className:`font-mono text-[11px] text-destructive whitespace-pre-wrap break-all`,children:o})]}):a===`completed`?(0,$.jsxs)(`div`,{className:`mt-2.5 p-2.5 rounded-md border border-emerald-500/30 bg-emerald-500/5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-semibold text-emerald-400 mb-1`,children:[(0,$.jsx)(Ce,{size:13}),(0,$.jsx)(`span`,{children:`Verified Evidence (Confirmed)`})]}),(0,$.jsx)(`pre`,{className:`font-mono text-[11px] text-emerald-300/90 whitespace-pre-wrap break-all`,children:o})]}):(0,$.jsxs)(`div`,{className:`mt-2.5 p-2.5 rounded-md border border-amber-500/30 bg-amber-500/5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-semibold text-amber-400 mb-1`,children:[(0,$.jsx)(un,{size:13}),(0,$.jsx)(`span`,{children:`Proposal Evidence (Review Requested)`})]}),(0,$.jsx)(`pre`,{className:`font-mono text-[11px] text-amber-300/90 whitespace-pre-wrap break-all`,children:o})]})),Array.isArray(e.artifacts)&&e.artifacts.length>0&&(0,$.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.artifacts.map((e,t)=>(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded bg-muted/60 border border-border/80 text-[11px] font-mono text-muted-foreground`,title:e.summary||e.path,children:[(0,$.jsx)(Dt,{size:11,className:`text-primary`}),(0,$.jsx)(`span`,{children:e.title||e.path})]},t))})]})]})},e.id||t)})}),(0,$.jsx)(`form`,{onSubmit:C,className:`p-4 bg-muted/20 border-t border-border/80`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Post as:`}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 bg-card rounded-md border border-border/80 p-0.5 text-xs`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(`developer`),className:`px-2 py-0.5 rounded text-[11px] font-medium transition-colors ${u===`developer`?`bg-primary text-primary-foreground font-semibold shadow-xs`:`text-muted-foreground hover:text-foreground`}`,children:`Developer`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(`antigravity`),className:`px-2 py-0.5 rounded text-[11px] font-medium transition-colors ${u===`antigravity`?`bg-primary text-primary-foreground font-semibold shadow-xs`:`text-muted-foreground hover:text-foreground`}`,children:`Antigravity`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(`claude`),className:`px-2 py-0.5 rounded text-[11px] font-medium transition-colors ${u===`claude`?`bg-[#D97757] text-white font-semibold shadow-xs`:`text-muted-foreground hover:text-foreground`}`,children:`Claude`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>d(`codex`),className:`px-2 py-0.5 rounded text-[11px] font-medium transition-colors ${u===`codex`?`bg-emerald-600 text-white font-semibold shadow-xs`:`text-muted-foreground hover:text-foreground`}`,children:`Codex`})]})]}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>y(e=>!e),className:`text-[11px] text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors cursor-pointer`,children:v?`Hide Milestone Fields`:`+ Milestone & Evidence`})]}),v&&(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2 p-2.5 rounded-md border border-border/70 bg-card/50 text-xs`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{htmlFor:`handoff-step`,className:`text-[10px] font-mono text-muted-foreground uppercase`,children:`Milestone ID`}),(0,$.jsx)(H,{id:`handoff-step`,placeholder:`e.g. step-1-api-routes`,value:f,onChange:e=>p(e.target.value),className:`h-7 text-xs font-mono mt-1`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{htmlFor:`handoff-status`,className:`text-[10px] font-mono text-muted-foreground uppercase`,children:`Milestone Status`}),(0,$.jsxs)(`select`,{id:`handoff-status`,value:g,onChange:e=>_(e.target.value),className:`h-7 w-full text-xs font-mono mt-1 rounded-md border border-border bg-card px-2 text-foreground`,children:[(0,$.jsx)(`option`,{value:`proposed`,children:`Proposed (Review Requested)`}),(0,$.jsx)(`option`,{value:`completed`,children:`Completed (Confirmed)`}),(0,$.jsx)(`option`,{value:`in_progress`,children:`In Progress`}),(0,$.jsx)(`option`,{value:`failed`,children:`Failed / Blocker`})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{htmlFor:`handoff-evidence`,className:`text-[10px] font-mono text-muted-foreground uppercase`,children:`Evidence / Test Output`}),(0,$.jsx)(H,{id:`handoff-evidence`,placeholder:`e.g. 12/12 unit tests passing`,value:m,onChange:e=>h(e.target.value),className:`h-7 text-xs font-mono mt-1`})]})]}),(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(Jt,{"aria-label":`Handoff message`,placeholder:`Share a decision, result, blocker, or next step…`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),C())},className:`min-h-[4.5rem] text-xs leading-relaxed resize-y pr-24 bg-card`}),(0,$.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:(0,$.jsxs)(l,{type:`submit`,size:`sm`,disabled:!s.trim()||o.isPending,className:`gap-1.5 text-xs font-medium`,children:[o.isPending?(0,$.jsx)(Y,{className:`size-3`}):(0,$.jsx)(me,{size:12}),(0,$.jsx)(`span`,{children:`Post`})]})})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-muted-foreground px-1`,children:[(0,$.jsxs)(`span`,{children:[`Press `,(0,$.jsx)(`kbd`,{className:`px-1 py-0.5 rounded border border-border bg-muted text-[9px] font-mono`,children:`Ctrl`}),` + `,(0,$.jsx)(`kbd`,{className:`px-1 py-0.5 rounded border border-border bg-muted text-[9px] font-mono`,children:`Enter`}),` to send`]}),(0,$.jsx)(`span`,{children:`Saved in this workspace`})]})]})})]})]})}function Tr({ws:e}){let t=e.branchName,n=Vt(t),r=wt(t),i=rt(t),a=n.data,o=(0,Q.useMemo)(()=>a?.services??[],[a]),c=(0,Q.useMemo)(()=>a?.runningState??[],[a]),u=a?.orchestrationTools??[],d=(0,Q.useMemo)(()=>a?.runningOrchestrators??[],[a]),f=(0,Q.useMemo)(()=>d.filter(e=>e.mode===`pm2`&&e.logName),[d]),[p,m]=(0,Q.useState)(`classic`),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{let e=[...o.map(e=>e.name),...f.map(e=>e.logName)];e.length===0?_!==null&&v(null):(!_||!e.includes(_))&&v(e[0])},[o,f]);let{logs:y,connected:b,clear:x}=st(t,_,!0),S=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{S.current?.scrollIntoView({behavior:`smooth`})},[y]);let C=(0,Q.useMemo)(()=>new Set(c.filter(e=>e.pid>0).map(e=>e.name)),[c]),w=(0,Q.useMemo)(()=>new Set(d.map(e=>e.id)),[d]),T=C.size>0,E=p===`matrix`?`term-matrix`:p===`dracula`?`term-dracula`:`term-classic`,D=r.isPending||i.isPending;return(0,$.jsxs)(`div`,{className:`animate-fade-in`,children:[n.isLoading&&(0,$.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-[10px] text-primary`,children:[(0,$.jsx)(Y,{className:`size-3`}),(0,$.jsx)(`span`,{className:`font-semibold tracking-wider uppercase`,children:`Scanning service configurations...`})]}),u.length>0&&(0,$.jsxs)(`div`,{className:`mb-4 rounded-md border border-border/80 bg-card p-4 surface-card`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:[(0,$.jsx)(gt,{size:12,className:`text-info`}),` Orchestration tools`]}),(0,$.jsx)(`div`,{className:`flex flex-col gap-2`,children:u.map(e=>{let t=w.has(e.id);return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/60 bg-muted/20 p-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`h-2 w-2 rounded-full ${t?`bg-success`:`bg-muted-foreground/40`}`}),(0,$.jsx)(`span`,{className:`text-xs font-bold text-foreground`,children:e.tool}),(0,$.jsx)(q,{tone:`idle`,dot:!1,children:e.mode})]}),(0,$.jsx)(`code`,{className:`mt-1 block truncate font-mono text-[9px] text-muted-foreground`,children:e.configPath})]}),(0,$.jsx)(`div`,{className:`shrink-0`,children:t?(0,$.jsxs)(l,{size:`xs`,variant:`destructive`,"aria-label":`Stop ${e.tool}`,disabled:D,onClick:()=>i.mutate({action:`stop`,id:e.id}),children:[(0,$.jsx)(it,{size:12}),` Stop`]}):(0,$.jsxs)(l,{size:`xs`,"aria-label":`Start ${e.tool}`,disabled:D,onClick:()=>i.mutate({action:`start`,id:e.id}),children:[(0,$.jsx)(ft,{size:12}),` Start`]})})]},e.id)})})]}),(0,$.jsxs)(`div`,{className:`mb-4 rounded-md border border-border/80 bg-card p-4 surface-card`,children:[(0,$.jsxs)(`div`,{className:`mb-2 flex items-center justify-between text-xs font-semibold text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:`Workspace Status`}),(0,$.jsx)(q,{tone:T?`running`:`idle`,children:T?`Active`:`Standby`})]}),(0,$.jsx)(`div`,{className:`mb-3 text-xs font-semibold text-foreground`,children:T?`${C.size} process${C.size===1?``:`es`} active`:`All processes offline`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsxs)(l,{size:`sm`,disabled:T||D,onClick:()=>r.mutate({action:`start`}),children:[(0,$.jsx)(ft,{size:13}),` Start All Services`]}),(0,$.jsxs)(l,{size:`sm`,variant:`destructive`,disabled:!T||D,onClick:()=>r.mutate({action:`stop`}),children:[(0,$.jsx)(it,{size:13}),` Stop All`]})]})]}),(o.length>0||f.length>0)&&(0,$.jsxs)(`div`,{className:`grid grid-cols-1 overflow-hidden rounded-md border border-border/80 bg-card shadow-xs lg:grid-cols-12 surface-card`,children:[(0,$.jsxs)(`div`,{className:`border-b border-border/80 bg-muted/20 p-4 lg:col-span-4 lg:border-b-0 lg:border-r`,children:[(0,$.jsxs)(`h4`,{className:`mb-4 flex items-center gap-1.5 border-b border-border pb-2 text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:[(0,$.jsx)(tn,{size:12,className:`text-primary`}),` Background Services`]}),(0,$.jsxs)(`div`,{className:`flex max-h-[400px] flex-col gap-2 overflow-y-auto pr-1`,children:[o.map(e=>{let t=_===e.name,n=C.has(e.name);return(0,$.jsxs)(`div`,{className:s(`flex cursor-pointer flex-col rounded-xl border p-3 transition-colors`,t?`border-primary/40 bg-primary/10 text-foreground`:`border-border bg-card text-muted-foreground hover:border-foreground/15 hover:bg-accent/50 hover:text-foreground`),onClick:()=>v(e.name),children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${n?`bg-success`:`bg-destructive`}`}),(0,$.jsx)(`span`,{className:`truncate text-xs font-bold`,children:e.name})]}),(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,onClick:e=>e.stopPropagation(),children:n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(l,{size:`icon-xs`,variant:`ghost`,"aria-label":`Restart ${e.name}`,disabled:D,onClick:()=>r.mutate({action:`restart`,service:e.name}),children:(0,$.jsx)(bn,{})}),(0,$.jsx)(l,{size:`icon-xs`,variant:`ghost`,"aria-label":`Stop ${e.name}`,disabled:D,onClick:()=>r.mutate({action:`stop`,service:e.name}),children:(0,$.jsx)(it,{})})]}):(0,$.jsx)(l,{size:`icon-xs`,variant:`ghost`,"aria-label":`Start ${e.name}`,disabled:D,onClick:()=>r.mutate({action:`start`,service:e.name}),children:(0,$.jsx)(ft,{})})})]}),e.port?(0,$.jsxs)(`span`,{className:`mt-2 w-fit rounded border border-border bg-background px-2 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`Port: `,e.port]}):null,(0,$.jsxs)(`code`,{className:`mt-2 block truncate rounded border border-border bg-muted/40 p-1.5 font-mono text-[9px] text-muted-foreground`,children:[e.command,` `,e.args.join(` `)]})]},e.name)}),f.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`mt-2 border-t border-border pt-3 text-[9px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Orchestrators`}),f.map(e=>{let t=e.logName;return(0,$.jsxs)(`div`,{className:s(`flex cursor-pointer items-center gap-2 rounded-xl border p-3 transition-colors`,_===t?`border-primary/40 bg-primary/10 text-foreground`:`border-border bg-card text-muted-foreground hover:border-foreground/15 hover:bg-accent/50 hover:text-foreground`),onClick:()=>v(t),children:[(0,$.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-success`}),(0,$.jsx)(`span`,{className:`truncate text-xs font-bold`,children:e.tool}),(0,$.jsx)(q,{tone:`idle`,dot:!1,children:e.mode})]},e.id)})]})]})]}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col bg-background lg:col-span-8`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border bg-muted/40 px-5 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`font-mono text-xs font-bold text-primary`,children:_||`no-service`}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`|`}),(0,$.jsx)(q,{tone:b?`running`:`idle`,children:b?`streaming`:`idle`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3 self-end sm:self-auto`,children:[(0,$.jsx)(`div`,{className:`flex rounded-lg border border-border bg-card p-0.5 text-[9px] font-semibold text-muted-foreground`,children:[`classic`,`matrix`,`dracula`].map(e=>(0,$.jsx)(`button`,{className:s(`cursor-pointer rounded-md px-2 py-1 capitalize transition-colors`,p===e?`bg-primary/10 font-bold text-primary`:`hover:text-foreground`),onClick:()=>m(e),children:e},e))}),(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(`button`,{onClick:x,className:`cursor-pointer rounded-lg border border-border bg-card p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:`Clear Console`,children:(0,$.jsx)(Re,{size:13})}),(0,$.jsx)(`button`,{onClick:()=>g(!h),className:`cursor-pointer rounded-lg border border-border bg-card p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:h?`Minimize Console`:`Expand Console`,children:h?(0,$.jsx)(Wt,{size:13}):(0,$.jsx)(Tt,{size:13})})]})]})]}),(0,$.jsxs)(`div`,{className:s(`relative overflow-y-auto whitespace-pre-wrap p-5 font-mono text-[10.5px] leading-relaxed selection:bg-primary/20`,E,h?`h-[520px]`:`h-80`),children:[y.trim()?y:(0,$.jsx)(`span`,{className:`font-mono italic text-muted-foreground`,children:`(no log content yet)`}),(0,$.jsx)(`div`,{ref:S})]})]})]})]})}var Er=(e,t)=>{let n=`${e} ${t}`.toLowerCase();return n.includes(`insiders`)?(0,$.jsx)(nn,{size:15,className:`text-[#24C05A] shrink-0`}):n.includes(`code`)||n.includes(`vscode`)?(0,$.jsx)(rn,{size:15,className:`text-[#007ACC] shrink-0`}):n.includes(`antigravity`)?(0,$.jsx)(jt,{className:`size-3.5 shrink-0`}):n.includes(`cursor`)?(0,$.jsx)(bt,{size:14,className:`text-purple-400 shrink-0`}):n.includes(`powershell`)||n.includes(`pwsh`)?(0,$.jsx)(tn,{size:14,className:`text-sky-400 shrink-0`}):n.includes(`cmd`)||n.includes(`command prompt`)?(0,$.jsx)(tn,{size:14,className:`text-amber-400 shrink-0`}):(0,$.jsx)(we,{size:14,className:`shrink-0`})},Dr=[{value:`overview`,label:`Overview`,icon:mn},{value:`workroom`,label:`Workroom`,icon:yn},{value:`changes`,label:`Changes`,icon:pn},{value:`services`,label:`Services`,icon:ct},{value:`sessions`,label:`AI & Sessions`,icon:It},{value:`knowledge`,label:`Knowledge`,icon:an},{value:`plan`,label:`Plan`,icon:gn},{value:`skills`,label:`Skills`,icon:vn}];function Or(e){let{workspaces:t,workspaceStatuses:n,selectedId:r,subTab:i,onSelectTab:a,handleCopyPrompt:o,handleDeleteWorkspace:c,deleteWsLoading:u,repos:d,addRepoLoading:f,handleAddRepo:p,showToast:m,sessionProps:h,changesProps:g,knowledgeProps:_,planProps:v}=e,y=t.find(e=>e.branchName===r)??null,b=y?.mode??`worktree`,{open:x}=Nt(),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{if(!y?.branchName){C(!1);return}let e=!0;return fetch(`/api/workspace/${encodeURIComponent(y.branchName)}/migration-status`).then(e=>e.ok?e.json():{isLegacy:!1}).then(t=>{e&&C(!!t?.isLegacy)}).catch(()=>{e&&C(!1)}),()=>{e=!1}},[y?.branchName]);let E=async()=>{if(!(!y?.branchName||w)){T(!0);try{if(!(await fetch(`/api/workspace/${encodeURIComponent(y.branchName)}/migrate`,{method:`POST`})).ok)throw Error(`Migration failed`);m?.(`Workspace successfully upgraded to native ${et}!`,`success`),C(!1),e.fetchWorkspaces?.()}catch(e){m?.(e.message||`Failed to migrate workspace`,`error`)}finally{T(!1)}}},D=qt(y?.branchName??null).data,{data:O=[],isLoading:k}=Et(y?.branchName),A=O.filter(e=>D?.enabledSkills?.includes(e.id)),j=y?y.repos.map(e=>{let t=zt(e),n=g.gitChanges?.find(e=>e.repoName===t);return{name:t,path:e,changedCount:n?n.files?.length??0:null}}):[],M=y?d.filter(e=>!y.repos.includes(e.path)):[],N=Pt(),[P,F]=(0,Q.useState)(null),I=N.data?.filter(e=>e.kind===`editor`&&e.available)??[],L=I.find(e=>e.id===`vscode-insiders`)||I.find(e=>e.id===`vscode`)||I[0],R=async e=>{if(!(P||!y)){F(e);try{await Xt(`/api/workspace/${encodeURIComponent(y.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:e})}),m?.(`Opened workspace in ${e}.`,`success`)}catch(t){m?.(`Failed to open ${e}: ${t instanceof Error?t.message:String(t)}`,`error`)}finally{F(null)}}};return(0,$.jsx)(`div`,{className:`flex flex-col h-full animate-fade-in w-full min-w-0 bg-transparent`,children:y?(0,$.jsx)(`div`,{className:`flex-1 min-w-0 h-full overflow-y-auto`,children:(0,$.jsx)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col`,children:(()=>{if(!y)return null;let e=n[y.branchName],t=b===`in-place`?null:e?Qt(e.syncStatus):null,r=e?.changedFiles??0;return(0,$.jsxs)(`div`,{className:`flex flex-col min-w-0 pb-12`,children:[(0,$.jsx)(`div`,{className:`border-b border-border/80 bg-card/75 backdrop-blur-md px-6 py-5 shadow-xs`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-center md:justify-between`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,$.jsx)(`div`,{className:`grid size-7 place-items-center rounded-md bg-primary/15 text-primary border border-primary/25 shrink-0`,children:(0,$.jsx)(Ae,{size:15})}),(0,$.jsx)(`h1`,{className:`truncate font-mono text-base sm:text-lg font-extrabold text-foreground tracking-tight`,title:y.branchName,children:y.branchName}),(0,$.jsx)(`button`,{type:`button`,onClick:async()=>{await Mt(y.branchName)&&m?.(`Copied branch name to clipboard.`,`success`)},className:`text-muted-foreground hover:text-primary transition-colors p-1 rounded-md hover:bg-accent cursor-pointer`,title:`Copy branch name`,children:(0,$.jsx)(J,{size:13})}),(0,$.jsx)(`span`,{className:`inline-flex items-center rounded-md border border-primary/20 bg-primary/10 px-2 py-0.5 font-mono text-[10px] font-bold text-primary uppercase tracking-wider`,children:b===`in-place`?`In-Place Mode`:`Worktree Mode`})]}),(0,$.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-3 font-mono text-[11px] text-muted-foreground`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-foreground/80 font-medium`,children:[(0,$.jsx)(Ct,{size:13,className:`text-muted-foreground`}),y.repos.length,` `,y.repos.length===1?`repo`:`repos`]}),(0,$.jsx)(`span`,{children:`•`}),r>0?(0,$.jsxs)(`button`,{type:`button`,onClick:()=>a(y.branchName,`changes`),className:`flex items-center gap-1.5 text-amber-400 font-semibold hover:underline cursor-pointer`,children:[(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-amber-400 animate-pulse`}),r,` modified files`]}):(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-emerald-400 font-medium`,children:[(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-emerald-400`}),`Clean worktrees`]}),(0,$.jsx)(`span`,{children:`•`}),(0,$.jsxs)(`span`,{className:`text-muted-foreground/80`,children:[`Created `,new Date(y.createdAt).toLocaleDateString()]}),t&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:`•`}),(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 text-primary font-medium`,children:[(0,$.jsx)(xt,{size:11,className:`animate-spin-slow`}),` `,t.label]})]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[L&&(I.length>1?(0,$.jsxs)(`div`,{className:`inline-flex h-9 items-center rounded-lg border border-border bg-card shadow-xs hover:border-primary/40 transition-colors`,children:[(0,$.jsxs)(`button`,{type:`button`,disabled:!!P,onClick:()=>void R(L.id),title:`Open workspace in ${L.name}`,className:`inline-flex h-full items-center gap-2 px-3.5 text-xs font-bold text-foreground hover:bg-accent transition-colors cursor-pointer rounded-l-lg`,children:[P===L.id?(0,$.jsx)(Y,{className:`size-3.5`}):Er(L.id,L.name),(0,$.jsx)(`span`,{children:L.name})]}),(0,$.jsxs)(ye,{children:[(0,$.jsx)(de,{"aria-label":`Choose editor`,className:`inline-flex h-full w-7 items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent border-l border-border transition-colors cursor-pointer rounded-r-lg`,children:(0,$.jsx)(K,{size:13})}),(0,$.jsxs)(ve,{align:`end`,className:`w-56`,children:[(0,$.jsx)(`div`,{className:`px-2.5 py-1 text-[10px] font-bold text-muted-foreground uppercase tracking-wider`,children:`Open Workspace In`}),I.map(e=>(0,$.jsxs)(G,{onClick:()=>void R(e.id),className:s(`flex items-center justify-between text-xs py-2`,e.id===L.id&&`font-bold text-primary bg-primary/5`),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[Er(e.id,e.name),(0,$.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.id===L.id&&(0,$.jsx)(`span`,{className:`text-[10px] text-primary font-mono font-bold`,children:`(default)`})]},e.id))]})]})]}):(0,$.jsxs)(l,{variant:`outline`,size:`sm`,disabled:!!P,onClick:()=>void R(L.id),title:`Open workspace in ${L.name}`,className:`font-bold h-9 gap-2`,children:[P===L.id?(0,$.jsx)(Y,{className:`size-3.5`}):Er(L.id,L.name),(0,$.jsx)(`span`,{children:L.name})]})),(0,$.jsxs)(l,{variant:`outline`,size:`sm`,onClick:()=>o(y),"aria-label":`Copy Context`,title:`Copy AI Context prompt for external LLM`,className:`h-9 gap-1.5 text-xs font-semibold`,children:[(0,$.jsx)(J,{size:13}),(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:`Copy Context`})]}),(0,$.jsxs)(ye,{children:[(0,$.jsx)(de,{"aria-label":`Workspace actions`,className:`grid size-9 place-items-center rounded-lg border border-border bg-card text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer shadow-xs`,children:(0,$.jsx)(fn,{size:15})}),(0,$.jsxs)(ve,{align:`end`,className:`w-52`,children:[(0,$.jsxs)(G,{onClick:()=>o(y),className:`flex items-center gap-2 text-xs py-2`,children:[(0,$.jsx)(J,{size:13}),` `,(0,$.jsx)(`span`,{children:`Copy AI Context`})]}),(0,$.jsxs)(G,{onClick:()=>void c(y.branchName),disabled:u===y.branchName,className:`flex items-center gap-2 text-xs py-2 text-destructive hover:bg-destructive/10`,children:[(0,$.jsx)(Re,{size:13}),(0,$.jsx)(`span`,{children:u===y.branchName?`Deleting…`:`Delete Workspace`})]})]})]})]})]})}),(0,$.jsxs)(`div`,{className:`px-6 pt-5`,children:[S&&(0,$.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-amber-500/30 bg-gradient-to-r from-amber-500/15 via-orange-500/10 to-transparent p-3 backdrop-blur-md shadow-xs`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5 text-xs text-amber-200`,children:[(0,$.jsx)(bt,{size:16,className:`text-amber-400 shrink-0 animate-pulse`}),(0,$.jsxs)(`span`,{children:[(0,$.jsxs)(`strong`,{className:`font-semibold text-amber-300`,children:[`Legacy `,Qe,` Workspace:`]}),` Upgrade to native `,et,` manifest and synchronized artifacts.`]})]}),(0,$.jsxs)(`button`,{type:`button`,onClick:E,disabled:w,className:`inline-flex items-center gap-1.5 rounded-lg bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-400 hover:to-orange-400 px-3 py-1.5 text-xs font-bold text-white shadow-sm transition-all active:scale-95 disabled:opacity-50 cursor-pointer`,children:[(0,$.jsx)(cn,{size:14,className:w?`animate-spin`:``}),w?`Upgrading...`:`Migrate to ${et}`]})]}),(0,$.jsxs)(Le,{value:i,onValueChange:e=>typeof e==`string`&&a(y.branchName,e),className:`mb-6`,children:[(0,$.jsx)(Pe,{className:`w-full flex-nowrap overflow-x-auto justify-start gap-1.5 p-1.5 rounded-xl border border-border/70 bg-card/60 backdrop-blur-md shadow-xs`,children:Dr.map(e=>{let t=e.icon,n=i===e.value,a=null;return e.value===`changes`&&r>0?a=(0,$.jsx)(`span`,{className:`ml-1.5 inline-flex items-center justify-center rounded-full bg-amber-500/20 px-1.5 py-0.2 text-[10px] font-mono font-bold text-amber-400`,children:r}):e.value===`skills`&&A.length>0&&(a=(0,$.jsx)(`span`,{className:`ml-1.5 inline-flex items-center justify-center rounded-full bg-primary/20 px-1.5 py-0.2 text-[10px] font-mono font-bold text-primary`,children:A.length})),(0,$.jsxs)(Ne,{value:e.value,className:s(`flex shrink-0 items-center gap-2 px-3.5 py-2 text-xs font-bold rounded-lg transition-all cursor-pointer`,n?`bg-card text-foreground shadow-xs border border-primary/30 text-primary ring-1 ring-primary/20`:`text-muted-foreground hover:text-foreground hover:bg-accent/70`),children:[(0,$.jsx)(t,{size:14,className:s(`shrink-0`,n?`text-primary`:`text-muted-foreground`)}),(0,$.jsx)(`span`,{children:e.label}),a]},e.value)})}),(0,$.jsxs)(`section`,{"aria-labelledby":`embedded-harness-heading`,"aria-hidden":i!==`sessions`,className:s(`space-y-3 pt-4`,i!==`sessions`&&`hidden`),children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{id:`embedded-harness-heading`,className:`text-sm font-bold text-foreground`,children:`Embedded Harness & Live Chat`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Direct execution engine for Claude, OpenAI, Antigravity, and Copilot in this workspace.`})]}),(0,$.jsx)(`div`,{className:`h-[38rem] min-h-[28rem] overflow-hidden rounded-2xl border border-border/80 bg-card shadow-sm`,children:(0,$.jsx)(Zt,{ws:y},y.branchName)})]}),(0,$.jsxs)(Ie,{value:i,className:`animate-fade-in pt-4`,children:[i===`overview`&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-4`,children:[(0,$.jsxs)(`div`,{onClick:()=>a(y.branchName,`changes`),className:`group p-4 rounded-xl border border-border/80 bg-card/70 hover:bg-card hover:border-primary/40 transition-all cursor-pointer shadow-xs flex flex-col justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`grid size-8 place-items-center rounded-lg bg-primary/10 text-primary border border-primary/20`,children:(0,$.jsx)(pn,{size:15})}),(0,$.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground uppercase tracking-wider`,children:`Git Changes`})]}),(0,$.jsx)(Yt,{size:13,className:`text-muted-foreground group-hover:text-primary transition-transform group-hover:translate-x-1`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-2xl font-black font-mono text-foreground`,children:r>0?(0,$.jsxs)(`span`,{className:`text-amber-400`,children:[r,` Modified`]}):(0,$.jsx)(`span`,{className:`text-emerald-400`,children:`Clean`})}),(0,$.jsxs)(`div`,{className:`text-[11px] text-muted-foreground mt-1`,children:[y.repos.length,` mapped `,y.repos.length===1?`repository`:`repositories`]})]})]}),(0,$.jsxs)(`div`,{onClick:()=>a(y.branchName,`sessions`),className:`group p-4 rounded-xl border border-border/80 bg-card/70 hover:bg-card hover:border-primary/40 transition-all cursor-pointer shadow-xs flex flex-col justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`grid size-8 place-items-center rounded-lg bg-primary/10 text-primary border border-primary/20`,children:(0,$.jsx)(It,{size:15})}),(0,$.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground uppercase tracking-wider`,children:`AI Assistant`})]}),(0,$.jsx)(Yt,{size:13,className:`text-muted-foreground group-hover:text-primary transition-transform group-hover:translate-x-1`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`text-xl font-black text-foreground capitalize`,children:y.assistants[0]||`Antigravity`}),(0,$.jsx)(`div`,{className:`text-[11px] text-muted-foreground mt-1`,children:`Context rules & templates ready`})]})]}),(0,$.jsxs)(`div`,{onClick:()=>a(y.branchName,`skills`),className:`group p-4 rounded-xl border border-border/80 bg-card/70 hover:bg-card hover:border-primary/40 transition-all cursor-pointer shadow-xs flex flex-col justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`grid size-8 place-items-center rounded-lg bg-primary/10 text-primary border border-primary/20`,children:(0,$.jsx)(vn,{size:15})}),(0,$.jsx)(`span`,{className:`text-xs font-bold text-muted-foreground uppercase tracking-wider`,children:`Skills & Toolkits`})]}),(0,$.jsx)(Yt,{size:13,className:`text-muted-foreground group-hover:text-primary transition-transform group-hover:translate-x-1`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`text-2xl font-black font-mono text-foreground`,children:[A.length,` `,(0,$.jsx)(`span`,{className:`text-sm font-semibold text-muted-foreground`,children:`Active`})]}),(0,$.jsx)(`div`,{className:`text-[11px] text-muted-foreground mt-1`,children:A.length===0?`Click to attach capabilities`:`Reviewers, linters & test suites`})]})]})]}),y.description&&(0,$.jsxs)(Z,{className:`p-5 border-border/80 bg-card/60 backdrop-blur-md rounded-xl`,children:[(0,$.jsxs)(`h4`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2 flex items-center gap-2`,children:[(0,$.jsx)(ct,{size:13,className:`text-primary`}),` Feature Intent & Description`]}),(0,$.jsx)(`div`,{className:`text-xs sm:text-sm leading-relaxed text-foreground/90`,children:(0,$.jsx)(At,{content:y.description})})]}),(0,$.jsxs)(Z,{className:`border-border/80 bg-card/70 backdrop-blur-md rounded-xl overflow-hidden shadow-xs`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b border-border/60 bg-muted/20`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,$.jsx)(Ct,{size:16,className:`text-primary`}),(0,$.jsxs)(`h3`,{className:`text-xs font-extrabold uppercase tracking-wider text-foreground`,children:[`Mapped Repositories & Worktrees (`,y.repos.length,`)`]})]}),M.length>0&&(0,$.jsx)(cr,{repos:M,disabled:f,onAdd:e=>{window.confirm(`Add repository "${zt(e)}" to this workspace?\nThis creates a new git worktree and re-runs analysis.`)&&p(y.branchName,e)}})]}),(0,$.jsx)(`div`,{className:`divide-y divide-border/60`,children:j.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-4 hover:bg-accent/40 transition-colors text-xs`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,$.jsx)(`span`,{className:s(`size-2.5 rounded-full shrink-0 shadow-xs`,e.changedCount===null?`bg-muted-foreground`:e.changedCount>0?`bg-amber-400 animate-pulse`:`bg-emerald-400`),title:e.changedCount===null?`Status unknown`:e.changedCount>0?`${e.changedCount} uncommitted changes`:`Clean`}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`font-mono font-bold text-foreground text-xs sm:text-sm truncate`,children:e.name}),(0,$.jsx)(`div`,{className:`font-mono text-[10px] text-muted-foreground/80 truncate max-w-md`,children:e.path})]})]}),(0,$.jsx)(`div`,{className:`flex items-center gap-3 shrink-0`,children:(0,$.jsx)(`span`,{className:s(`font-mono text-[11px] font-semibold px-2 py-0.5 rounded-md border`,e.changedCount===null?`border-border bg-muted/60 text-muted-foreground`:e.changedCount>0?`border-amber-500/30 bg-amber-500/10 text-amber-400`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-400`),children:e.changedCount===null?`—`:e.changedCount>0?`${e.changedCount} modified`:`Clean`})})]},e.name))})]}),(0,$.jsxs)(Z,{className:`border-border/80 bg-card/70 backdrop-blur-md rounded-xl p-5 shadow-xs`,children:[(0,$.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,$.jsx)(vn,{size:16,className:`text-primary`}),(0,$.jsx)(`h3`,{className:`text-xs font-extrabold uppercase tracking-wider text-foreground`,children:`Attached Skills & Capabilities`}),(0,$.jsxs)(`span`,{className:s(`inline-flex items-center px-2 py-0.5 rounded-md text-[10px] font-bold font-mono border`,A.length>0?`border-primary/30 bg-primary/10 text-primary`:`border-border/70 bg-muted/60 text-muted-foreground`),children:[A.length,` active`]})]}),(0,$.jsxs)(l,{size:`sm`,variant:`outline`,onClick:()=>a(y.branchName,`skills`),className:`text-xs font-semibold gap-1.5 h-8`,children:[(0,$.jsx)(vn,{size:13}),(0,$.jsx)(`span`,{children:`Configure Skills`})]})]}),k?(0,$.jsx)(`div`,{className:`h-16 rounded-xl bg-muted/40 animate-pulse`}):A.length===0?(0,$.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/80 bg-muted/20 p-4 sm:flex sm:items-center sm:justify-between gap-4`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-xs font-bold text-foreground`,children:`No skills attached to this workspace`}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground mt-0.5`,children:`Equip the AI assistant with specialized toolkits (PR reviewers, linters, test harnesses).`})]}),(0,$.jsx)(l,{size:`sm`,variant:`default`,onClick:()=>a(y.branchName,`skills`),className:`shrink-0 font-bold mt-2 sm:mt-0 h-8 text-xs`,children:`Attach Skills →`})]}):(0,$.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:A.map(e=>(0,$.jsxs)(`div`,{className:`flex flex-col justify-between p-3.5 rounded-xl border border-border/80 bg-card/60 hover:bg-card hover:border-primary/30 transition-all shadow-xs gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(`span`,{className:`grid size-6 place-items-center rounded-lg bg-primary/15 text-primary shrink-0`,children:(0,$.jsx)(vn,{size:12})}),(0,$.jsx)(`span`,{className:`text-xs font-bold text-foreground truncate`,title:e.title||e.name,children:e.title||e.name})]}),(0,$.jsx)(`span`,{className:s(`text-[9px] font-mono font-bold uppercase px-1.5 py-0.5 rounded-md border shrink-0`,e.custom?`border-purple-500/30 bg-purple-500/10 text-purple-400`:`border-border/70 bg-muted text-muted-foreground`),children:e.custom?`Custom`:`Template`})]}),e.description&&(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground line-clamp-2 leading-relaxed`,children:e.description})]},e.id))})]})]}),i===`sessions`&&(0,$.jsxs)(`section`,{"aria-labelledby":`session-history-heading`,className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3 p-4 rounded-xl border border-border bg-card shadow-xs`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{id:`session-history-heading`,className:`text-sm font-semibold text-foreground`,children:`AI Sessions & History`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Inspect recorded session logs, turns, and token usage, or open active conversations in the floating chat.`})]}),(0,$.jsxs)(l,{variant:`default`,size:`sm`,onClick:()=>x(y.branchName),className:`text-xs h-8 gap-1.5 shrink-0 cursor-pointer self-start sm:self-auto`,title:`Open floating multi-workspace chat`,children:[(0,$.jsx)(It,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:`Open Floating Chat`})]})]}),(0,$.jsx)(fr,{ws:y,showToast:m,...h})]}),i===`workroom`&&(0,$.jsx)(wr,{ws:y,showToast:m}),i===`changes`&&(0,$.jsx)(pr,{ws:y,...g}),i===`knowledge`&&(0,$.jsx)(mr,{ws:y,..._}),i===`plan`&&(0,$.jsx)(hr,{...v}),i===`skills`&&(0,$.jsx)(_r,{ws:y,showToast:m}),i===`services`&&(0,$.jsx)(Tr,{ws:y})]})]})]})]})})()})}):(0,$.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,$.jsx)(`div`,{className:`max-w-md w-full`,children:(0,$.jsx)(Bt,{children:(0,$.jsxs)(Ft,{children:[(0,$.jsx)(Ot,{variant:`icon`,children:(0,$.jsx)(Ct,{})}),(0,$.jsx)(Ht,{children:`No workspace selected`}),(0,$.jsx)(Gt,{children:`Select a workspace from the sidebar to inspect git changes, context, or launch AI assistants.`})]})})})})})}export{Or as WorkspacesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,u as h,v as g}from"./button-CREn1mup.js";var _=g((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.8`})),v=g(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()})),y=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),b={"data-starting-style":``},x={"data-ending-style":``},S={transitionStatus(e){return e===`starting`?b:e===`ending`?x:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=y.startingStyle]=`startingStyle`,e[e.endingStyle=y.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var C={"data-popup-open":``},w={"data-popup-open":``,"data-pressed":``},T={"data-open":``},E={"data-closed":``},D={"data-anchor-hidden":``},O={open(e){return e?C:null}},k={open(e){return e?w:null}},A={open(e){return e?T:E},anchorHidden(e){return e?D:null}},j={...A,...S},M=`none`,ee=`trigger-press`,N=`trigger-hover`,P=`trigger-focus`,te=`outside-press`,ne=`item-press`,F=`close-press`,re=`focus-out`,ie=`escape-key`,ae=`list-navigation`,oe=`cancel-open`,se=`sibling-open`,I=`disabled`,ce=`missing`,L=`initial`,R=`imperative-action`,z=`window-resize`,le=n(v(),1),B=o(),V=n(e(),1);function ue({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=V.useRef(e!==void 0),[a,o]=V.useState(t);return[i?e:a,V.useCallback(e=>{i||o(e)},[])]}function de(){return typeof window<`u`}function H(e){return pe(e)?(e.nodeName||``).toLowerCase():`#document`}function U(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fe(e){return((pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pe(e){return de()?e instanceof Node||e instanceof U(e).Node:!1}function W(e){return de()?e instanceof Element||e instanceof U(e).Element:!1}function G(e){return de()?e instanceof HTMLElement||e instanceof U(e).HTMLElement:!1}function me(e){return!de()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof U(e).ShadowRoot}function he(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ge(e){return/^(table|td|th)$/.test(H(e))}function _e(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ve=/transform|translate|scale|rotate|perspective|filter/,ye=/paint|layout|strict|content/,be=e=>!!e&&e!==`none`,xe;function Se(e){let t=W(e)?Ee(e):e;return be(t.transform)||be(t.translate)||be(t.scale)||be(t.rotate)||be(t.perspective)||!we()&&(be(t.backdropFilter)||be(t.filter))||ve.test(t.willChange||``)||ye.test(t.contain||``)}function Ce(e){let t=Oe(e);for(;G(t)&&!Te(t);){if(Se(t))return t;if(_e(t))return null;t=Oe(t)}return null}function we(){return xe??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xe}function Te(e){return/^(html|body|#document)$/.test(H(e))}function Ee(e){return U(e).getComputedStyle(e)}function De(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oe(e){if(H(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||me(e)&&e.host||fe(e);return me(t)?t.host:t}function ke(e){let t=Oe(e);return Te(t)?(e.ownerDocument||e).body:G(t)&&he(t)?t:ke(t)}function Ae(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ke(e),i=r===e.ownerDocument?.body,a=U(r);if(i){let e=je(a);return t.concat(a,a.visualViewport||[],he(r)?r:[],e&&n?Ae(e):[])}return t.concat(r,Ae(r,[],n))}function je(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Me={...V},Ne=Me.useInsertionEffect,Pe=Ne&&Ne!==Me.useLayoutEffect?Ne:e=>e();function K(e){let t=a(Fe).current;return t.next=e,Pe(t.effect),t.trampoline}function Fe(){let e={next:void 0,callback:Ie,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ie(){}var q=typeof document<`u`?V.useLayoutEffect:()=>{},Le=V.createContext(void 0);function Re(e=!1){let t=V.useContext(Le);if(t===void 0&&!e)throw Error(f(16));return t}function ze(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:V.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function J(e){return e?.ownerDocument||document}function Be(e,t,{detail:n=0}={}){e.dispatchEvent(new(U(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ve(e={}){let{disabled:n=!1,focusableWhenDisabled:r,tabIndex:i=0,native:a=!0,composite:o}=e,s=V.useRef(null),c=Re(!0),l=o??c!==void 0,{props:u}=ze({focusableWhenDisabled:r,disabled:n,composite:l,tabIndex:i,isNativeButton:a}),f=V.useCallback(()=>{let e=s.current;He(e)&&l&&n&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[n,u.disabled,l]);return q(f,[f]),{getButtonProps:V.useCallback((e={})=>{let{onClick:r,onMouseDown:i,onKeyUp:o,onKeyDown:s,onPointerDown:c,...f}=e;return d({onClick(e){if(n){e.preventDefault();return}r?.(e)},onMouseDown(e){n||i?.(e)},onKeyDown(e){if(n||(t(e),s?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,i=e.currentTarget,o=He(i),c=!a&&Ue(i),u=r&&(a?o:!c),d=e.key===`Enter`,f=e.key===` `,p=i.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&l&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),(!a||o)&&(e.preventBaseUIHandler(),Be(i,e));return}if(!u||a||!f&&!d){r&&c&&f&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),d&&(e.preventBaseUIHandler(),Be(i,e)))},onKeyUp(e){if(!n){if(t(e),o?.(e),e.target===e.currentTarget&&a&&l&&He(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Be(e.currentTarget,e))}},onPointerDown(e){if(n){e.preventDefault();return}c?.(e)}},a?{type:`button`}:{role:`button`},u,f)},[n,u,l,a]),buttonRef:K(e=>{s.current=e,f()})}}function He(e){return G(e)&&e.tagName===`BUTTON`}function Ue(e){return G(e)&&e.tagName===`A`&&!!e.href}function We(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ge,platform:Ke,maxTouchPoints:qe}=We(),Je=Ge.toLowerCase(),Ye=Ke.toLowerCase(),Xe=/^i(os$|p)/.test(Ye)||Ye===`macintel`&&qe>1,Ze=`android`,Qe=Ye===Ze||Je.includes(Ze),$e=!Xe&&Ye.startsWith(`mac`);Ye.startsWith(`win`),!Qe&&/^(linux|chrome os)/.test(Ye);var et=$e||Xe,tt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!tt&&Je.includes(`firefox`),!tt&&Je.includes(`chrom`);var nt=et,rt=/jsdom|happydom/.test(Je),it=0;function at(e,t=`mui`){let[n,r]=V.useState(e),i=e||n;return V.useEffect(()=>{n??(it+=1,r(`${t}-${it}`))},[n,t]),i}var ot=Me.useId;function st(e,t){if(ot!==void 0){let n=ot();return e??(t?`${t}-${n}`:n)}return at(e,t)}function ct(e){return st(e,`base-ui`)}function lt(e,t,n,i){let a=!1,o=!1,s=i??r;return{reason:e,event:t??new Event(`base-ui`),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...s}}function ut(e){V.useEffect(e,m)}var dt=null;globalThis.requestAnimationFrame;var ft=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},pt=class e{static create(){return new e}static request(e){return ft.request(e)}static cancel(e){return ft.cancel(e)}currentId=dt;request(e){this.cancel(),this.currentId=ft.request(()=>{this.currentId=dt,e()})}cancel=()=>{this.currentId!==dt&&(ft.cancel(this.currentId),this.currentId=dt)};disposeEffect=()=>this.cancel};function mt(){let e=a(pt.create).current;return ut(e.disposeEffect),e}function ht(e,t=!1,n=!1){let[r,i]=V.useState(e&&t?`idle`:void 0),[a,o]=V.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),q(()=>{if(!e&&a&&r!==`ending`&&n){let e=pt.request(()=>{i(`ending`)});return()=>{pt.cancel(e)}}},[e,a,r,n]),q(()=>{if(!e||t)return;let n=pt.request(()=>{i(void 0)});return()=>{pt.cancel(n)}},[t,e]),q(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=pt.request(()=>{i(`idle`)});return()=>{pt.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Y(e){return e==null?e:`current`in e?e.current:e}function gt(e,t=!1){let n=mt();return K((r,i=null)=>{n.cancel();let a=Y(e);if(a==null)return;let o=a,s=()=>{le.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function _t(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=K(i),o=gt(r,n);V.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var vt=0,yt=class e{static create(){return new e}currentId=vt;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=vt,t()},e)}isStarted(){return this.currentId!==vt}clear=()=>{this.currentId!==vt&&(clearTimeout(this.currentId),this.currentId=vt)};disposeEffect=()=>this.clear};function bt(){let e=a(yt.create).current;return ut(e.disposeEffect),e}function xt(e){e.preventDefault(),e.stopPropagation()}function St(e){return`nativeEvent`in e}function Ct(e){return e.pointerType===``&&e.isTrusted?!0:Qe&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function wt(e){return rt?!1:!Qe&&e.width===0&&e.height===0||Qe&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Tt(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Et(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Dt=`data-base-ui-focusable`,Ot=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,kt=`ArrowLeft`,At=`ArrowRight`,jt=`ArrowUp`,Mt=`ArrowDown`;function X(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&me(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Nt(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Pt(e,t){if(!W(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Ft(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function It(e){return e.matches(`html,body`)}function Lt(e){return G(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Rt(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ot}`)!=null}function zt(e){return e?e.getAttribute(`role`)===`combobox`&&Lt(e):!1}function Bt(e){if(!e||rt)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Vt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Q(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ht(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ut(e){let t=a(Wt,e).current;return t.next=e,q(t.effect),t}function Wt(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Gt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Kt={...Gt,position:`fixed`,top:0,left:0},qt={...Gt,position:`absolute`},Jt=V.forwardRef(function(e,t){let[n,r]=V.useState();q(()=>{nt&&tt&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,B.jsx)(`span`,{...e,ref:t,style:Kt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Yt(e,t){return t<0||t>=e.length}function Xt(e,t){return Qt(e.current,{disabledIndices:t})}function Zt(e,t){return Qt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Qt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&$t(e,a,r));return a}function $t(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!tn(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function en(e){return e.visibility===`hidden`||e.visibility===`collapse`}function tn(e,t=e?Ee(e):null){return!e||!e.isConnected||!t||en(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var nn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function rn(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return me(n)?n.host:null}function an(e){for(let t of Array.from(e.children))if(H(t)===`summary`)return t;return null}function on(e,t){let n=an(t);return!!n&&(e===n||Z(n,e))}function sn(e){let t=e?H(e):``;return e!=null&&e.matches(nn)&&(t!==`summary`||e.parentElement!=null&&H(e.parentElement)===`details`&&an(e.parentElement)===e)&&(t!==`details`||an(e)==null)&&(t!==`input`||e.type!==`hidden`)}function cn(e){if(!sn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=rn(t)){let n=t!==e,r=H(t)===`slot`;if(t.hasAttribute(`inert`)||n&&H(t)===`details`&&!t.open&&!on(e,t)||t.hasAttribute(`hidden`)||!r&&!ln(t,n))return!1}return!0}function ln(e,t){let n=Ee(e);return t?n.display!==`none`:tn(e,n)}function un(e){let t=e.tabIndex;if(t<0){let t=H(e);if(t===`details`||t===`audio`||t===`video`||G(e)&&e.isContentEditable)return 0}return t}function dn(e){if(H(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function fn(e,t){let n=dn(e);if(!n)return!0;let r=t.find(e=>{let t=dn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=dn(e);return t?.name===n.name&&t.form===n.form})===n}function pn(e){if(G(e)&&H(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return G(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function mn(e,t){pn(e).forEach(e=>{sn(e)&&t.push(e),mn(e,t)})}function hn(e,t,n){pn(e).forEach(e=>{G(e)&&e.matches(t)&&n.push(e),hn(e,t,n)})}function gn(e){return cn(e)&&un(e)>=0}function _n(e){let t=[];return mn(e,t),t.filter(cn)}function vn(e){let t=_n(e);return t.filter(e=>un(e)>=0&&fn(e,t))}function yn(e,t){let n=vn(e),r=n.length;if(r===0)return;let i=X(J(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function bn(e){return yn(J(e).body,1)||e}function xn(e){return yn(J(e).body,-1)||e}function Sn(e,t){if(!e)return null;let n=vn(J(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Cn(e){return Sn(e,1)}function wn(e){return Sn(e,-1)}function Tn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function En(e){vn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Dn(e){let t=[];hn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function On(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...On(e,t.id,n)])}function kn(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function An(e){return`data-base-ui-${e}`}var jn=0;function Mn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(jn);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),c;let o=requestAnimationFrame(a);return jn=o,()=>{jn===o&&(cancelAnimationFrame(o),jn=0)}}var Nn={inert:new WeakMap,"aria-hidden":new WeakMap},Pn=`data-base-ui-inert`,Fn={inert:new WeakSet,"aria-hidden":new WeakSet},In=new WeakMap,Ln=0;function Rn(e){return Fn[e]}function zn(e){return e?me(e)?e.host:zn(e.parentNode):null}var Bn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=zn(t);return e.contains(n)?n:null}).filter(e=>e!=null),Vn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Hn=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{H(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Un(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Bn(t,e),l=i?Hn(t,Vn(c),new Set(c)):[],u=[],d=[];if(a){let e=Nn[a],n=Rn(a);s=n,o=e;let r=Bn(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Hn(t,Vn(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(In.get(e)||0)+1;In.set(e,t),d.push(e),t===1&&e.setAttribute(Pn,``)}),Ln+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(In.get(e)||0)-1;In.set(e,t),t||e.removeAttribute(Pn)}),--Ln,Ln||(Nn.inert=new WeakMap,Nn[`aria-hidden`]=new WeakMap,Fn.inert=new WeakSet,Fn[`aria-hidden`]=new WeakSet,In=new WeakMap)}}function Wn(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=J(e[0]).body;return Un(e,a,n,r,{mark:i})}var Gn={style:{transition:`none`}},Kn=`data-base-ui-click-trigger`,qn={fallbackAxisSide:`none`},Jn={fallbackAxisSide:`end`},Yn={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Xn=V.createContext(null),Zn=()=>V.useContext(Xn),Qn=An(`portal`);function $n(e={}){let{ref:t,container:n,componentProps:i=r,elementProps:a}=e,o=st(),c=Zn()?.portalNode,[l,u]=V.useState(null),[d,f]=V.useState(null),p=K(e=>{e!==null&&f(e)}),m=V.useRef(null);q(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}let e=(n&&(pe(n)?n:n.current))??c??document.body;if(e==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==e&&(m.current=e,f(null),u(e))},[n,c]);let h=s(`div`,i,{ref:[t,p],props:[{id:o,[Qn]:``},a]}),g=l&&h?le.createPortal(h,l):null;return{node:d,nodeId:V.isValidElement(h)?h.props.id:void 0,subtree:g}}var er=V.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=$n({container:o,ref:t,componentProps:e,elementProps:s}),d=V.useRef(null),f=V.useRef(null),p=V.useRef(null),m=V.useRef(null),[h,g]=V.useState(null),_=V.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;V.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&Tn(e)&&(e.type===`focusin`?_.current&&=(Dn(c),!1):(En(c),_.current=!0))}return Ht(Q(c,`focusin`,e,!0),Q(c,`focusout`,e,!0))},[c,v]),q(()=>{!c||y!==!0||!_.current||(Dn(c),_.current=!1)},[y,c]);let x=V.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,B.jsxs)(V.Fragment,{children:[u,(0,B.jsxs)(Xn.Provider,{value:x,children:[b&&c&&(0,B.jsx)(Jt,{"data-type":`outside`,ref:d,onFocus:e=>{Tn(e,c)?p.current?.focus():xn(h?h.domReference:null)?.focus()}}),b&&c&&(0,B.jsx)(`span`,{"aria-owns":l,style:Yn}),c&&le.createPortal(a,c),b&&c&&(0,B.jsx)(Jt,{"data-type":`outside`,ref:f,onFocus:e=>{Tn(e,c)?m.current?.focus():(bn(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,lt(`focus-out`,e.nativeEvent)))}})]})]})});function tr(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var nr=class{nodesRef={current:[]};events=tr();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},rr=V.createContext(null),ir=V.createContext(null),ar=()=>V.useContext(rr)?.id||null,or=e=>{let t=V.useContext(ir);return e??t};function sr(e){let t=st(),n=or(e),r=ar();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function cr(e){let{children:t,id:n}=e,r=ar();return(0,B.jsx)(rr.Provider,{value:V.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function lr(e){let{children:t,externalTree:n}=e,r=a(()=>n??new nr).current;return(0,B.jsx)(ir.Provider,{value:r,children:t})}function ur(e,t){let n=U(Nt(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var dr=20,$=[];function fr(){$=$.filter(e=>e.deref()?.isConnected)}function pr(e){fr(),e&&H(e)!==`body`&&($.push(new WeakRef(e)),$.length>dr&&($=$.slice(-20)))}function mr(){return fr(),$[$.length-1]?.deref()}function hr(e){return e?gn(e)?e:vn(e)[0]||e:null}function gr(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=_n(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return gn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function _r(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=K(()=>x.current.floatingContext?.nodeId),C=a===!1,w=zt(v)&&C,T=Ut(a),E=Ut(o),D=Ut(u),O=Ut(_),k=or(m),A=Zn(),j=V.useRef(!1),M=V.useRef(!1),ee=V.useRef(!1),N=V.useRef(null),P=V.useRef(``),te=V.useRef(``),ne=V.useRef(null),F=V.useRef(null),ie=i(ne,p,A?.beforeInsideRef),ae=i(F,A?.afterInsideRef),oe=bt(),se=bt(),I=mt(),ce=A!=null,L=Vt(y),R=K((e=L)=>e?vn(e):[]),z=K(()=>h?.().filter(e=>e!=null)??[]);V.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Z(L,X(J(L)))&&R().length===0&&!w&&xt(e)}return Q(J(L),`keydown`,e)},[r,L,c,w,R]),V.useEffect(()=>{if(r||!_)return;let e=J(L);function t(){ee.current=!1}function n(e){let t=Nt(e),n=z(),r=Z(y,t)||Z(v,t)||Z(A?.portalNode,t)||n.some(e=>e===t||Z(e,t));ee.current=!r,te.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,se.start(0,()=>{M.current=!1}))}function i(){te.current=`keyboard`}return Ht(Q(e,`pointerdown`,n,!0),Q(e,`pointerup`,t,!0),Q(e,`pointercancel`,t,!0),Q(e,`keydown`,i,!0),t)},[r,y,v,L,_,A,se,z]),V.useEffect(()=>{if(r||!l)return;let e=J(L);function t(){M.current=!0,se.start(0,()=>{M.current=!1})}function n(e){let t=Nt(e);gn(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Nt(t);c&&n==null&&i!=null&&Z(y,i)&&pr(i),queueMicrotask(()=>{let a=S(),o=g.context.triggerElements,l=z(),u=n?.hasAttribute(An(`focus-guard`))&&[ne.current,F.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,Y(f),Y(d)].includes(n),p=!(Z(v,n)||Z(y,n)||Z(n,y)||Z(A?.portalNode,n)||l.some(e=>e===n||Z(e,n))||o.hasMatchingElement(e=>Z(e,n))||u||k&&(On(k.nodesRef.current,a).find(e=>Z(e.context?.elements.floating,n)||Z(e.context?.elements.domReference,n))||kn(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Vt(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&L&&gr(L),s&&r!==v&&!tn(i)&&X(e)===e.body){if(G(L)&&(L.focus(),s===`popup`)){I.request(()=>{L.focus()});return}let e=R(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||L;G(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!c)&&n&&p&&!M.current&&(w||n!==mr())&&(j.current=!0,g.setOpen(!1,lt(re,t)))})}function a(){ee.current||(x.current.insideReactTree=!0,oe.start(0,()=>{x.current.insideReactTree=!1}))}let o=G(v)?v:null;if(!(!y&&!o))return Ht(o&&Q(o,`focusout`,i),o&&Q(o,`pointerdown`,t),y&&Q(y,`focusin`,n),y&&Q(y,`focusout`,i),y&&A&&Q(y,`focusout`,a,!0))},[r,v,y,L,c,k,A,g,l,s,R,w,S,x,oe,se,I,d,f,z]),V.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${An(`portal`)}]`)||[]),t=(k?kn(k.nodesRef.current,S()):[]).find(e=>zt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Wn([y,...e,ne.current,F.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...z(),t,Y(f),Y(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Wn([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,A,w,k,S,d,f,z]),q(()=>{if(!_||r||!G(L))return;P.current=``,te.current=``;let e=J(L),t=X(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Z(L,t))return;let i=null,a=()=>(i??=R(L),i[0]||L),o;o=r===!0||r===null?a():Y(r),o||=a();let s=Z(L,X(e));Mn(o,{preventScroll:o===L,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=X(e);return!(t!==o&&Z(L,t))}})})},[r,_,L,R,T,D,O]),q(()=>{if(r||!L)return;let e=J(L),t=X(e),n=D.current==null;pr(t);function i(e){if(e.open||(P.current=ur(e.nativeEvent,te.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Ct(e.nativeEvent)||wt(e.nativeEvent))j.current=!1;else{let e=!1;J(L).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&H(t)!==`body`?t:null,s=n?o||a:a||o;return s||=mr()||null,typeof i==`boolean`?s:Y(i)||s||null}return()=>{b.off(`openchange`,i);let t=X(e),n=z(),r=Z(y,t)||n.some(e=>e===t||Z(e,t))||k&&On(k.nodesRef.current,S(),!1).some(e=>Z(e.context?.elements.floating,t)),o=E.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=hr(c),i=typeof o!=`boolean`;if(o&&!j.current&&G(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,L,E,D,b,k,v,S,z]),q(()=>{if(!tt||_||!y)return;let e=X(J(y));!G(e)||!Lt(e)||Z(y,e)&&e.blur()},[_,y]),q(()=>{if(!(r||!A))return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,g,l,v]),q(()=>{if(!(r||!L))return gr(L),()=>{queueMicrotask(fr)}},[r,L]);let le=!r&&(!c||!w)&&(ce||c);return(0,B.jsxs)(V.Fragment,{children:[le&&(0,B.jsx)(Jt,{"data-type":`inside`,ref:ie,onFocus:e=>{if(c){let e=R();Mn(e[e.length-1])}else A?.portalNode&&(j.current=!1,Tn(e,A.portalNode)?bn(v)?.focus():Y(f??A.beforeOutsideRef)?.focus())}}),n,le&&(0,B.jsx)(Jt,{"data-type":`inside`,ref:ae,onFocus:e=>{c?Mn(R()[0]):A?.portalNode&&(l&&(j.current=!0),Tn(e,A.portalNode)?xn(v)?.focus():Y(d??A.afterOutsideRef)?.focus())}})]})}function vr(){return!1}function yr(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function br(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=vr,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=or(c),m=K(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=K(()=>a),{escapeKey:v,outsidePress:y}=yr(s),b=V.useRef(!1),x=V.useRef(!1),S=V.useRef(!1),C=V.useRef(!1),w=V.useRef(``),T=V.useRef(null),E=bt(),D=bt(),O=K(()=>{D.clear(),f.current.insideReactTree=!1}),k=K(e=>{let t=f.current.floatingContext?.nodeId;return(p?On(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=K(e=>Ft(e,l.select(`floatingElement`))||Ft(e,l.select(`domReferenceElement`))),j=K(e=>{o()&&l.setOpen(!1,lt(ee,e.nativeEvent))}),M=K(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=lt(ie,St(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),N=K(()=>{f.current.insideReactTree=!0,D.start(0,O)}),P=K(e=>{if(!u||!n||e.button!==0)return;let t=Nt(e.nativeEvent);Z(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),ne=K(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});V.useEffect(()=>{if(!u||!n)return O;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new yt,t=new yt;function i(){e.clear(),C.current=!0}function a(){e.start(tt?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&On(p.nodesRef.current,t).some(t=>Ft(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=Nt(e),r=`[${An(`inert`)}]`,i=W(n)?n.getRootNode():null,a=Array.from((me(i)?i:J(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Z(e,n))))return;let s=W(n)?n:null;for(;s&&!Te(s);){let e=Oe(s);if(Te(e)||!W(e))break;s=e}if(!(a.length&&W(n)&&!It(n)&&!Z(n,l.select(`floatingElement`))&&a.every(e=>!Z(s,e)))){if(G(n)&&!(`touches`in e)){let t=Te(n),r=Ee(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,lt(te,e)),O())}}}function ee(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function N(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function P(e,t){let n=Nt(e);if(!n)return;let r=Q(n,e.type,()=>{t(e),r()})}function ne(e){w.current=`touch`,P(e,N)}function F(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&P(e,e=>{e.type===`pointerdown`?ee(e):j(e)})}function re(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function ie(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function ae(e){P(e,ie)}function oe(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function se(e){P(e,oe)}let I=J(d),ce=Ht(r&&Ht(Q(I,`keydown`,M),Q(I,`compositionstart`,i),Q(I,`compositionend`,a)),g&&Ht(Q(I,`click`,F,!0),Q(I,`pointerdown`,F,!0),Q(I,`pointerup`,re,!0),Q(I,`pointercancel`,re,!0),Q(I,`mousedown`,F,!0),Q(I,`mouseup`,re,!0),Q(I,`touchstart`,ne,!0),Q(I,`touchmove`,ae,!0),Q(I,`touchend`,se,!0)));return()=>{ce(),e.clear(),t.clear(),s(),S.current=!1,O()}},[f,d,r,g,h,u,n,v,y,M,O,_,k,A,p,l,E]);let F=V.useMemo(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),re=V.useMemo(()=>({onKeyDown:M,onPointerDown:ne,onMouseDown:ne,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,P,ne]);return V.useMemo(()=>n?{reference:F,floating:re,trigger:F}:{},[n,F,re])}var xr=g((t=>{var n=e();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Sr=g(((e,t)=>{t.exports=xr()})),Cr=g((t=>{var n=e(),r=Sr();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),wr=g(((e,t)=>{t.exports=Cr()})),Tr=Sr(),Er=wr(),Dr=[],Or=void 0;function kr(){return Or}function Ar(e){Dr.push(e)}function jr(e){let t=(t,n)=>{let r=a(Nr).current,i;try{Or=r;for(let e of Dr)e.before(r);i=e(t,n);for(let e of Dr)e.after(r);r.didInitialize=!0}finally{Or=void 0}return i};return t.displayName=e.displayName||e.name,t}function Mr(e){return V.forwardRef(jr(e))}function Nr(){return{didInitialize:!1}}var Pr=h(19)?Lr:Rr;function Fr(e,t,n,r,i){return Pr(e,t,n,r,i)}function Ir(e,t,n,r,i){let a=V.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Tr.useSyncExternalStore)(e.subscribe,a,a)}Ar({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Lr(e,t,n,r,i){let a=kr();if(!a)return Ir(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Rr(e,t,n,r,i){return(0,Er.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var zr=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Fr(this,e,t,n,r)}},Br=class extends zr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){V.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){V.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return V.useDebugValue(e),Fr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){V.useDebugValue(e);let n=K(t??c);this.context[e]=n}useStateSetter(e){let t=V.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Vr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Hr=class extends Br{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:tr(),nested:n,triggerElements:i},Vr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Et(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ur(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=V.useRef(null);r===void 0&&f.current===null&&(f.current=new Hr({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};W(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var Wr={tabIndex:-1,[Dt]:``};function Gr(e){return t=>t!==`touch`||e.current}function Kr(e,t=!1){let n=st(),r=ar()!=null,i=a(()=>e(n,r)).current;return Ur({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function qr({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Jr(e,t){let n=V.useRef(null),r=V.useRef(null);return V.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Yr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Xr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Zr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Jr(e,n),o=K(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=V.useCallback(e=>{a(e),e&&o(e)},[a,o]);return q(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Qr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=V.useRef(null),i=e.useState(`open`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=lt(M);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function $r(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=ht(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=K(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return _t({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function ei(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r})},[e])}function ti(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ni=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},ri=`ArrowUp`,ii=`ArrowDown`,ai=`ArrowLeft`,oi=`ArrowRight`,si=`Home`,ci=new Set([ri,ii,ai,oi,si,`End`]),li=[`Shift`,`Control`,`Alt`,`Meta`];function ui(e){return G(e)&&e.tagName===`INPUT`}function di(e){return!!(ui(e)&&e.selectionStart!=null||G(e)&&e.tagName===`TEXTAREA`)}function fi(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=pi(e,t,`left`),a=mi(e),o=mi(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=pi(e,t,`top`),r=mi(e),i=mi(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function pi(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function mi(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function hi(e){return h(19)?e:e?`true`:void 0}var gi=V.createContext(void 0);function _i(){return V.useContext(gi)?.direction??`ltr`}var vi=V.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,B.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),yi={},bi={},xi=``;function Si(e,t){return he(e)?e:t}function Ci(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Si(t,n)).overflowY)}function wi(e){if(typeof document>`u`)return!1;let t=J(e);return U(t).innerWidth-t.documentElement.clientWidth>0}function Ti(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=J(e),n=t.documentElement,r=t.body,i=Si(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ei(e){let t=J(e),n=t.documentElement,r=t.body,i=Si(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Di(e){let t=J(e),n=t.documentElement,r=t.body,i=U(n),a=0,o=0,s=!1,c=pt.create();if(tt&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,yi={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},xi=n.style.scrollBehavior,bi={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Si(n,r);if(s=Ti(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,yi),Object.assign(r.style,bi),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=xi)}function d(){u(),c.request(l)}l();let f=Q(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Oi=new class{lockCount=0;restore=null;timeoutLock=yt.create();timeoutUnlock=yt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=J(e),n=t.documentElement,r=t.body,i=U(n);if(Ci(i,n,r)){let t=new i.MutationObserver(()=>{Ci(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Xe||!wi(e);this.restore=a?Ei(e):Di(e)}};function ki(e=!0,t=null){q(()=>{if(e)return Oi.acquire(t)},[e,t])}var Ai=`base-ui-disable-scrollbar`,ji={className:Ai,getElement(e){return(0,B.jsx)(`style`,{nonce:e,href:Ai,precedence:`base-ui:low`,children:`.${Ai}{scrollbar-width:none}.${Ai}::-webkit-scrollbar{display:none}`})}},Mi=V.createContext(void 0),Ni={disableStyleElements:!1};function Pi(){return V.useContext(Mi)??Ni}function Fi(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Ii(e,t){return Math.max(0,e-t)}function Li(e,t){if(t<=0)return 0;let n=Fi(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var Ri={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},zi={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Bi={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},Vi={invalid:void 0,name:void 0,validityData:{state:Ri,errors:[],error:``,value:``,initialValue:null},setValidityData:c,disabled:void 0,setTouched:c,setDirty:c,setFilled:c,setFocused:c,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:zi,registerFieldControl:c,validation:{getValidationProps:(e,t=r)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:c,getInputControl:()=>null,commit:async()=>{},change:c}},Hi=V.createContext(Vi);function Ui(e=!0){let t=V.useContext(Hi);if(t.setValidityData===c&&!e)throw Error(f(28));return t}var Wi=V.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:c,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Gi(){return V.useContext(Wi)}var Ki=V.createContext({controlId:void 0,registerControlId:c,labelId:void 0,setLabelId:c,messageIds:[],setMessageIds:c,getDescriptionProps:e=>e});function qi(){return V.useContext(Ki)}function Ji(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:o}=qi(),s=ct(t),l=n?i:void 0,u=a(()=>Symbol()),d=V.useRef(!1),f=V.useRef(t!=null),p=K(()=>{!d.current||o===c||(d.current=!1,o(u.current,void 0))});return q(()=>{if(o===c)return;let e;if(n){let n=r?.current;e=W(n)&&n.closest(`label`)!=null?t??null:l??s}else if(t!=null)f.current=!0,e=t;else if(f.current)e=s;else{p();return}if(e===void 0){p();return}d.current=!0,o(u.current,e)},[t,r,l,o,n,s,u,p]),V.useEffect(()=>p,[p]),i??s}function Yi(e,t,n,r,i=!0,o){let{registerFieldControl:s}=Ui(),c=a(()=>Symbol());q(()=>{let a=c.current;if(!i){s(a,void 0);return}s(a,{controlRef:e,getValue:r,id:t,name:o,value:n})},[e,i,r,t,o,s,c,n]),q(()=>{let e=c.current;return()=>{s(e,void 0)}},[s,c])}var Xi=V.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFocused:b,setFilled:x,validationMode:S,validation:C}=Ui(),{clearErrors:w}=Gi(),T=g||c,E=h??a,D={...m,disabled:T},{labelId:O}=qi(),k=Ji({id:i});q(()=>{let e=o!=null;C.inputRef.current?.value||e&&o!==``?x(!0):e&&o===``&&x(!1)},[C.inputRef,x,o]);let A=V.useRef(null);q(()=>{d&&A.current===X(J(A.current))&&b(!0)},[d,b]);let[j]=ue({controlled:o,default:u,name:`FieldControl`,state:`value`}),ee=o!==void 0,N=ee?j:void 0,P=K(()=>C.inputRef.current?.value);return Yi(C.inputRef,k,N,P,!T,a),s(`input`,e,{ref:[t,A],state:D,props:[{id:k,disabled:T,name:E,ref:C.inputRef,"aria-labelledby":O,autoFocus:d,...ee?{value:N}:{defaultValue:u},onChange(e){let t=e.currentTarget.value;l?.(t,lt(M,e.nativeEvent)),v(t!==(y.initialValue??``)),x(t!==``),e.nativeEvent.defaultPrevented||(w(E),C.change(t))},onFocus(){b(!0)},onBlur(e){_(!0),b(!1),S===`onBlur`&&C.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(_(!0),C.commit(e.currentTarget.value))}},p,e=>C.getValidationProps(T,e)],stateAttributesMapping:Bi})}),Zi=V.forwardRef(function(e,t){return(0,B.jsx)(Xi,{ref:t,...e})});function Qi({className:e,size:t=`default`,unstyled:n=!1,nativeInput:r=!1,...i}){let a=l(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,i.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,i.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),o;if(r){let{style:e,onValueChange:n,...r}=i;o=(0,B.jsx)(`input`,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else o=(0,B.jsx)(Zi,{className:a,"data-slot":`input`,size:typeof t==`number`?t:void 0,...i});return(0,B.jsx)(`span`,{className:l(!n&&`relative inline-flex w-full rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-visible:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none has-focus-visible:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:o})}var $i=u(`relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs`,lg:`h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm`,sm:`h-5 min-w-5 rounded-[.25rem] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]`},variant:{default:`bg-primary text-primary-foreground [button&,a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white [button&,a&]:hover:bg-destructive/90`,error:`bg-destructive/8 text-destructive-foreground dark:bg-destructive/16`,info:`bg-info/8 text-info-foreground dark:bg-info/16`,outline:`border-input bg-background text-foreground dark:bg-input/32 [button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48`,secondary:`bg-secondary text-secondary-foreground [button&,a&]:hover:bg-secondary/90`,success:`bg-success/8 text-success-foreground dark:bg-success/16`,warning:`bg-warning/8 text-warning-foreground dark:bg-warning/16`}}});function ea({className:e,variant:t,size:n,render:r,...i}){let a={className:l($i({className:e,size:n,variant:t})),"data-slot":`badge`};return p({defaultTagName:`span`,props:d(a,i),render:r})}export{or as $,tt as $t,qr as A,ie as An,Bt as At,Ur as B,P as Bn,wt as Bt,ci as C,ge as Cn,Ht as Ct,fi as D,oe as Dn,Pt as Dt,di as E,ue as En,Rt as Et,$r as F,ae as Fn,kt as Ft,Mr as G,j as Gn,gt as Gt,Br as H,ee as Hn,yt as Ht,ei as I,ce as In,At as It,_r as J,S as Jn,ut as Jt,Sr as K,k as Kn,ht as Kt,Kr as L,M as Ln,jt as Lt,Gr as M,R as Mn,Z as Mt,Yr as N,L as Nn,Nt,ni as O,F as On,zt as Ot,Qr as P,ne as Pn,Mt as Pt,ar as Q,rt as Qt,ti as R,te as Rn,Tt as Rt,ri as S,he as Sn,Ut as St,li as T,we as Tn,Vt as Tt,Fr as U,z as Un,bt as Ut,Hr as V,N as Vn,xt as Vt,jr as W,A as Wn,_t as Wt,lr as X,ct as Xt,cr as Y,v as Yn,lt as Yt,sr as Z,st as Zt,_i as _,U as _n,Yt as _t,Ji as a,Le as an,Jn as at,ai as b,G as bn,Kt as bt,Ui as c,K as cn,On as ct,Li as d,fe as dn,wn as dt,Xe as en,nr as et,Fi as f,je as fn,Tn as ft,vi as g,Oe as gn,tn as gt,ki as h,Ae as hn,Xt as ht,Yi as i,J as in,qn as it,Xr as j,re as jn,X as jt,Wr as k,I as kn,Lt as kt,Bi as l,Ee as ln,bn as lt,ji as m,De as mn,Zt as mt,Qi as n,Ve as nn,Kn as nt,qi as o,Re as on,Mn as ot,Pi as p,H as pn,Qt as pt,br as q,O as qn,mt as qt,Xi as r,Be as rn,Gn as rt,Gi as s,q as sn,An as st,ea as t,$e as tn,er as tt,Ii as u,Ce as un,Cn as ut,hi as v,Se as vn,$t as vt,si as w,_e as wn,Q as wt,oi as x,Te as xn,qt as xt,ii as y,W as yn,Jt as yt,Zr as z,se as zn,Ct as zt};
|